Fetch information about ancestors and descendants of a toot.

        Does not require authentication for publicly visible statuses.

        Returns a `context dict`_.
550376
def status_context(self, id):
        
        id = self.__unpack_id(id)
        url = '/api/v1/statuses/{0}/context'.format(str(id))
        return self.__api_request('GET', url)
581716
def visible_ancestors
      return [] unless parent
      if new_record?
        parent.visible_ancestors.tap do |base|
          base.push(parent) if parent.visible?
        end
      else
        ancestors.visible.contentpages.where(language_root: nil).to_a
      end
    end
1176646
def ancestors(self, stop=None):
        
        folder = self
        while folder.parent != stop:
            if folder.parent == folder:
                return
            yield folder.parent
            folder = folder.parent
968710
def traverse_ancestors(self, include_self=True):
        '''
        '''
        if not isinstance(include_self, bool):
            raise TypeError("include_self must be a bool")
        if include_self:
            c = self
        else:
            c = self.parent
        while c is not None:
            yield c; c = c.parent
556265
def getDescendants(self, all_descendants=False):
        

        # N.B. full objects returned here from
        #      `Products.Archetypes.Referenceable.getBRefs`
        #      -> don't add this method into Metadata
        children = self.getBackReferences(
            "AnalysisRequestParentAnalysisRequest")

        descendants = []

        # recursively include all children
        if all_descendants:
            for child in children:
                descendants.append(child)
                descendants += child.getDescendants(all_descendants=True)
        else:
            descendants = children

        return descendants
1340144
def GetAncestors(self):
    
    current = self
    while True:
      current = current.GetParent()
      if current is None:
        return
      yield current
1116239
def get_ancestors(self, limit: int, header: BlockHeader) -> Tuple[BaseBlock, ...]:
        
        ancestor_count = min(header.block_number, limit)

        # We construct a temporary block object
        vm_class = self.get_vm_class_for_block_number(header.block_number)
        block_class = vm_class.get_block_class()
        block = block_class(header=header, uncles=[])

        ancestor_generator = iterate(compose(
            self.get_block_by_hash,
            operator.attrgetter('parent_hash'),
            operator.attrgetter('header'),
        ), block)
        # we peel off the first element from the iterator which will be the
        # temporary block object we constructed.
        next(ancestor_generator)

        return tuple(take(ancestor_count, ancestor_generator))
1343983
def get_relative_path(self, root):
        
        if self.path == root:
            return ''
        ancestors = self.ancestors(stop=root)
        return functools.reduce(lambda f, p: Folder(p.name).child(f),
                                ancestors,
                                self.name)
1343196
def get_ancestor_id_names(mention):
    
    span = _to_span(mention)
    id_names = []
    i = _get_node(span.sentence)
    while i is not None:
        id_names.insert(0, str(i.get("id")))
        i = i.getparent()
    return id_names
1073714
def ancestors(self):
        '''
        
        '''
        ancestors = []
        parent = self.parent
        while parent:
            ancestors.append(parent)
            parent = parent.parent
        return ancestors
800389
def get_ancestor(ancestor_type)
      target_type = {:directory => [Directory],
                     :feature_file => [FeatureFile],
                     :feature => [Feature],
                     :test => [Scenario, Outline, Background],
                     :background => [Background],
                     :scenario => [Scenario],
                     :outline => [Outline],
                     :step => [Step],
                     :table => [Table],
                     :example => [Example],
                     :row => [Row]
      }[ancestor_type]

      raise(ArgumentError, "Unknown ancestor type '#{ancestor_type}'.") if target_type.nil?


      ancestor = self.parent_model

      until target_type.include?(ancestor.class) || ancestor.nil?
        ancestor = ancestor.parent_model
      end


      ancestor
    end
701888
def get_parent(self, update=False):
        
        if self.is_root():
            return
        try:
            if update:
                del self._cached_parent_obj
            else:
                return self._cached_parent_obj
        except AttributeError:
            pass
        # parent = our most direct ancestor
        self._cached_parent_obj = self.get_ancestors().reverse()[0]
        return self._cached_parent_obj
629176
def ancestor_slugs
      return [] if !Config.get(:url_nesting) || parent.nil? || parent.root?
      visible_ancestors.map(&:slug).compact
    end
766647
def descendants(self):
        
        return self.members + \
            [submember for member in self.members for submember in member.descendants]
337547
def ancestors(self, typename):
        """"""
        xs = []
        for parent in self._hier[typename][0]:
            xs.append(parent)
            xs.extend(self.ancestors(parent))
        return xs
1296034
def fetch(self, origination_number=values.unset):
        
        return self._proxy.fetch(origination_number=origination_number, )
219493
def ancestors(self, full_table_name):
        
        nodes = self.subgraph(
            nx.algorithms.dag.ancestors(self, full_table_name))
        return [full_table_name] + list(reversed(list(
            nx.algorithms.dag.topological_sort(nodes))))