Return field paths for all parents.

        Returns: Set[:class:`FieldPath`]
337568
def lineage(self):
        
        indexes = six.moves.range(1, len(self.parts))
        return {FieldPath(*self.parts[:index]) for index in indexes}
478862
def parents(self, resources):
        

        if self.docname == 'index':
            # The root has no parents
            return []
        parents = []
        parent = resources.get(self.parent)
        while parent is not None:
            parents.append(parent)
            parent = resources.get(parent.parent)
        return parents
84662
def get_parent_path(index=2):  # type: (int) -> str
    
    try:
        path = _caller_path(index)
    except RuntimeError:
        path = os.getcwd()
    path = os.path.abspath(os.path.join(path, os.pardir))
    return path
443311
def _get_starting_paths(self, curdir):
        

        results = [curdir]

        if not self._is_parent(curdir) and not self._is_this(curdir):
            fullpath = os.path.abspath(curdir)
            basename = os.path.basename(fullpath)
            dirname = os.path.dirname(fullpath)
            if basename:
                matcher = self._get_matcher(basename)
                results = [os.path.basename(name) for name in self._glob_dir(dirname, matcher, self)]

        return results
290659
def get_path_fields(cls, base=[]):
    
    pfs = []
    for pf in cls.TutelaryMeta.path_fields:
        if pf == 'pk':
            pfs.append(base + ['pk'])
        else:
            f = cls._meta.get_field(pf)
            if isinstance(f, models.ForeignKey):
                pfs += get_path_fields(f.target_field.model, base=base + [pf])
            else:
                pfs.append(base + [f.name])
    return pfs
588523
def root_and_path(self):
        """"""
        rt = []
        curAttr = self
        while isinstance(curAttr.parent, AdHocTree):
            rt.append(curAttr.name)
            curAttr = curAttr.parent
        rt.reverse()
        return (curAttr.parent, rt)
1107146
def parents(self):
        
        q = self.__parent__.parents()
        q.put(self)
        return q
857180
def iter_fields(self):
        
        def generator(path, values):
            for name,value in sorted(values.items()):
                if isinstance(value, ValueTree):
                    for inner in generator(path + name, value._values):
                        yield inner
                else:
                    yield (path, name, value)
        return generator(Path([]), self._values)
215856
def _get_simple_fields(self):
        
        fields = []
        for field_name in self.cls._fields:
            field = self.cls.get_field(field_name)
            if not isinstance(field, MultiValuesField):
                fields.append(field_name)
        return fields
469657
def _path(self):  # type: () -> str
        
        if self._parent:
            return '{}.{}'.format(self._parent._path(), self._key_name())

        return self._key_name()
756422
def path(self, *paths, **kwargs):
        
        return self.__class__(self.__root__, *paths, **kwargs)
982917
def parents( self, node ):
        """"""
        if 'index' in node:
            index = node['index']()
            parents = list(meliaeloader.children( node, index, 'parents' ))
            return parents 
        return []
1126797
def path(self):
        
        return pathlib.Path(self.package.__file__).resolve().parent.parent
282899
def _all_fields(self):
        
        if (
            not settings.ENABLE_FIELDS_CACHE or
            not self.ENABLE_FIELDS_CACHE or
            self.__class__ not in FIELDS_CACHE
        ):
            all_fields = super(
                WithDynamicSerializerMixin,
                self
            ).get_fields()

            if (
                settings.ENABLE_FIELDS_CACHE and
                self.ENABLE_FIELDS_CACHE
            ):
                FIELDS_CACHE[self.__class__] = all_fields
        else:
            all_fields = copy.copy(FIELDS_CACHE[self.__class__])
            for k, field in six.iteritems(all_fields):
                if hasattr(field, 'reset'):
                    field.reset()

        for k, field in six.iteritems(all_fields):
            field.field_name = k
            field.parent = self

        return all_fields
278828
def fields(self):
        
        return {k:getattr(self, k, None) for k in self.schema.fields}
1177309
def get_fields(self):
        
        for c in self.classes.values():
            for f in c.get_fields():
                yield f
276685
def _get_path_from_parent(self, parent):
    
    if hasattr(self, 'get_path_from_parent'):
        return self.get_path_from_parent(parent)
    if self.model is parent:
        return []
    model = self.concrete_model
    # Get a reversed base chain including both the current and parent
    # models.
    chain = model._meta.get_base_chain(parent) or []
    chain.reverse()
    chain.append(model)
    # Construct a list of the PathInfos between models in chain.
    path = []
    for i, ancestor in enumerate(chain[:-1]):
        child = chain[i + 1]
        link = child._meta.get_ancestor_link(ancestor)
        path.extend(link.get_reverse_path_info())
    return path