def __getitem__(self, name):
        if '/' in name:
            return self._get_path(name)

        if name == '.':
            return self

        elif name == '..':
            if self.parent:
                return self.parent
            else:
                # / (root)
                return self

        mode, hash = self._obj[name]

        if mode & stat.S_IFDIR:
            obj = self._odb.get_tree(hash)

        elif (mode & stat.S_IFLNK) == stat.S_IFLNK:
            obj = self._odb.get_link(hash)

        else:
            obj = self._odb.get_blob(hash)

        obj.parent = self
        obj.name = name
        obj.set_commit(self._commit_sha)

        return obj
dataset/ETHPy150Open nakamuray/blikit/blikit/models.py/TreeObject.__getitem__/original