def resolve(self, path, create=False):
        path_bits = path.strip('/').split('/', 1)
        current = path_bits[0]
        rest = path_bits[1] if len(path_bits) > 1 else None
        if not rest:
            if current == '':
                return self
            if current in self.children.keys():
                return self.children[current]
            if not create:
                raise PathDoesNotExist()
            node = InMemoryFile()
            self.add_child(current, node)
            return node
        if current in self.children.keys():
            return self.children[current].resolve(rest, create=create)
        if not create:
            raise PathDoesNotExist()
        node = InMemoryDir()
        self.add_child(current, node)
        return self.children[current].resolve(rest, create)
dataset/ETHPy150Open codysoyland/django-inmemorystorage/inmemorystorage/storage.py/InMemoryDir.resolve/original