Returns the ancestors of a resource.

@return array[array] An array of resources represented as arrays
345686
public function getOldAncestors()
    {
        // No need to access DB to get ancestors as they are given by the materialized path.
        $parts = preg_split('/-(\d+)'.ResourceNode::PATH_OLDSEPARATOR.'/', $this->path, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
        $ancestors = [];
        $countAncestors = count($parts);
        for ($i = 0; $i < $countAncestors; $i += 2) {
            if (array_key_exists($i + 1, $parts)) {
                $ancestors[] = [
                    'id' => (int) $parts[$i + 1],
                    'name' => $parts[$i],
                ];
            }
        }

        return $ancestors;
    }
1227437
function getAncestors(node) {
    const ancestorsStartingAtParent = [];

    for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
        ancestorsStartingAtParent.push(ancestor);
    }

    return ancestorsStartingAtParent.reverse();
}
1026785
public function getDescendants()
    {
        $descendants = [];

        $descendants[$this->name] = $this->appName;

        /** @var $child Node */
        foreach ($this->children as $child) {
            $childDescendats = $child->getDescendants();
            $descendants = array_merge($childDescendats, $descendants);
        }

        return $descendants;
    }
144390
def ancestry(self):
        
        if not self.inherits():
            return []

        schema = orb.system.schema(self.inherits())
        if not schema:
            return []

        return schema.ancestry() + [schema]
542272
function getSiblingsOfAncestors(el) {
    return getAncestors(el).map(item => getSiblings(item)).reduce(flattenArrays, []);
}
1271849
function() {
            var parent = this.getParent(),
                ancestors = new Kinetic.Collection();

            while (parent) {
                ancestors.push(parent);
                parent = parent.getParent();
            }

            return ancestors;
        }
519715
public function getNodeAncestors($maxLevel = 3)
    {
        $ancestors = [];
        $level = 0;

        $node = $this->parentNode;

        while ($node && !($node instanceof DOMDocument)) {
            $ancestors[] = $node;
            $level++;
            if ($level === $maxLevel) {
                break;
            }
            $node = $node->parentNode;
        }

        return $ancestors;
    }
1147697
public function getAncestors($include_parent = false)
    {
        $ancestors = ArrayList::create();
        $object    = $this->Categories()->first();

        if($object) {
            if($include_parent) $ancestors->push($object);

            while ($object = $object->getParent()) {
                $ancestors->push($object);
            }
        }

        $this->extend('updateAncestors', $ancestors, $include_parent);

        return $ancestors;
    }
498042
def ancestors(self, definition: Union[SLOT_OR_SLOTNAME,
                                          CLASS_OR_CLASSNAME]) \
            -> List[Union[SlotDefinitionName, ClassDefinitionName]]:
        
        definition = self.obj_for(definition)
        if definition is not None:
            return [definition.name] + self.ancestors(definition.is_a)
        else:
            return []
69540
def obtain_ancestor(check = nil, orderby = 'post_title DESC')
      post = obtain_record(check)
      return nil if post.blank?
      p = post.ancestors
      p = p.arrange(:order => orderby.to_sym) if !orderby.blank?
      filter_results(p)
    end
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))
37566
def descendants(include_singletons = false)
      return _inherited_by.map { |c| [c, c.descendants] }.flatten.uniq if BBLib.in_opal?
      ObjectSpace.each_object(Class).select do |c|
        (include_singletons || !c.singleton_class?) && c < self
      end
    end
424492
public function getAncestors($includeSelf = false)
    {
        $ancestors = new ArrayList();
        $object = $this->owner;

        if ($includeSelf) {
            $ancestors->push($object);
        }
        while ($object = $object->getParent()) {
            $ancestors->push($object);
        }

        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
176884
public function getAncestors()
    {
        $ancestors = new Collection();

        $ancestor = $this;

        while (($ancestor = $ancestor->parent) && !$ancestors->contains($ancestor)) {
            $ancestors->push($ancestor);
            break;
        }

        return $ancestors;
    }
1180304
def get_page_ancestors(self, page_id):
        
        url = 'rest/api/content/{page_id}?expand=ancestors'.format(page_id=page_id)
        return (self.get(path=url) or {}).get('ancestors')
1149095
def get_ancestor(ancestor_type)
      ancestor = self.parent_element
      target_type = {:directory => Directory,
                     :feature_file => FeatureFile,
                     :feature => Feature,
                     :test => TestElement,
                     :step => Step,
                     :table => Table,
                     :example => Example
      }[ancestor_type]

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

      until ancestor.is_a?(target_type) || ancestor.nil?
        ancestor = ancestor.parent_element
      end

      ancestor
    end