def instance(self, uri, cls=None, default=None, **kwargs):
        instance = self._instances.get(uri, None)

        if instance is None:
            if cls is None:
                try:
                    cls = self._resources[uri[:uri.rfind('/')]]
                except __HOLE__:
                    cls = Reference

            if isinstance(default, Resource) and default.uri is None:
                default._status = 200
                default._uri = uri
                instance = default
            else:
                instance = cls(uri=uri, **kwargs)
            self._instances[uri] = instance
        return instance
dataset/ETHPy150Open biosustain/potion-client/potion_client/__init__.py/Client.instance