How to use the funcy.cached_property function in funcy

To help you get started, we’ve selected a few funcy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github idrdex / star-django / djapi / __init__.py View on Github external
        @cached_property
        def _mappers(self):
            return []
github Suor / django-cacheops / cacheops / sharding.py View on Github external
    @cached_property
    def dbs(self):
        return [self._queryset.db]
github Suor / django-cacheops / cacheops / query.py View on Github external
    @cached_property
    def _cloning(self):
        return 1000
github iterative / dvc / dvc / scm / git / __init__.py View on Github external
    @cached_property
    def _hooks_home(self):
        return os.path.join(self.root_dir, self.GIT_DIR, "hooks")
github iterative / dvc / dvc / cache.py View on Github external
self.config == {'ssh': 'dvc-storage'}
        self.ssh  # a RemoteSSH instance
    """

    def getter(self):
        from dvc.remote import Remote

        remote = self.config.get(name)
        if not remote:
            return None

        return Remote(self.repo, name=remote)

    getter.__name__ = builtin_str(name)
    return cached_property(getter)
github idrdex / star-django / legacy / management / commands / refresh_data.py View on Github external
    @cached_property
    def conn(self):
        return FTPHost.connect(SERIES_MATRIX_URL.netloc,
                               user="anonymous", password="anonymous", timeout=SOCKET_TIMEOUT)
github iterative / dvc / dvc / scm / git / __init__.py View on Github external
    @cached_property
    def _hooks_home(self):
        return os.path.join(self.root_dir, self.GIT_DIR, "hooks")
github iterative / dvc / dvc / path_info.py View on Github external
    @cached_property
    def url(self):
        return "{}://{}{}".format(self.scheme, self.netloc, self._spath)
github pmrowla / pylivemaker / livemaker / lsb / translate.py View on Github external
    @cached_property
    def digest(self):
        return self.text_digest(self.orig_text)
github iterative / dvc / dvc / path_info.py View on Github external
    @cached_property
    def _path(self):
        return _URLPathInfo(self._spath)