Returns the ancestor(s) of this Analysis Request
        param all_ancestors: include all ancestors, not only the parent
767741
def getAncestors(self, all_ancestors=True):
        
        parent = self.getParentAnalysisRequest()
        if not parent:
            return list()
        if not all_ancestors:
            return [parent]
        return [parent] + parent.getAncestors(all_ancestors=True)
1310577
def lookup_ancestors #:nodoc:
      klass = self
      classes = [klass]
      return classes if klass == ActiveRecord::Base

      while klass != klass.base_class
        classes << klass = klass.superclass
      end
      classes
    end
1228803
def get_descendants(self, include_self=False, depth=None):
        """"""
        params = {"%s__parent" % self._closure_childref():self.pk}
        if depth is not None:
            params["%s__depth__lte" % self._closure_childref()] = depth
        descendants = self._toplevel().objects.filter(**params)
        if not include_self:
            descendants = descendants.exclude(pk=self.pk)
        return descendants.order_by("%s__depth" % self._closure_childref())
176884
public function getAncestors()
    {
        $ancestors = new Collection();

        $ancestor = $this;

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

        return $ancestors;
    }
90457
def _get_ancestors(self, current=None):
        
        if not current:
            current = []
        current.insert(0, self)
        if self.is_root:
            if current:
                return current
        else:
            return self.parent._get_ancestors(current)
36170
def lookup_ancestors #:nodoc:
      klass = self
      classes = [klass]
      return classes if klass == ActiveRecord::Base

      while !klass.base_class?
        classes << klass = klass.superclass
      end
      classes
    end
509932
def ancestors(self, node):
        
        # We need to use the path virtual field, so ensure it exists.
        self._ensure_virtual_fields(node)
        return self.filter(pk__in=getattr(node, self.model._cte_node_path)[:-1])
672994
def get_parent_family_nodes(self):
        
        parent_family_nodes = []
        for node in self._my_map['parentNodes']:
            parent_family_nodes.append(FamilyNode(
                node._my_map,
                runtime=self._runtime,
                proxy=self._proxy,
                lookup_session=self._lookup_session))
        return FamilyNodeList(parent_family_nodes)
433645
def get_ancestor_hash(self, block_number: int) -> Hash32:
        
        ancestor_depth = self.block_number - block_number - 1
        is_ancestor_depth_out_of_range = (
            ancestor_depth >= MAX_PREV_HEADER_DEPTH or
            ancestor_depth < 0 or
            block_number < 0
        )
        if is_ancestor_depth_out_of_range:
            return Hash32(b'')

        try:
            return nth(ancestor_depth, self.execution_context.prev_hashes)
        except StopIteration:
            # Ancestor with specified depth not present
            return Hash32(b'')
360479
def ancestor(self, generation):
        

        # Don't go below the current generation and don't go above the DC
        if generation < 1:
            return self
        else:
            ancestor_dn = self.group_dn

            for _index in range(generation):
                if ''.join(ancestor_dn.split("DC")[0].split()) == '':
                    break
                else:
                    ancestor_dn = ancestor_dn.split(",", 1).pop()

            return ADGroup(
                group_dn=ancestor_dn, server_uri=self.server_uri, base_dn=self.base_dn,
                user_lookup_attr=self.user_lookup_attr, group_lookup_attr=self.group_lookup_attr,
                attr_list=self.attr_list, bind_dn=self.bind_dn, bind_password=self.bind_password,
                user_search_base_dn=self.user_search_base_dn, group_search_base_dn=self.user_search_base_dn
            )
216712
def get_ancestors(self, include_self=False, depth=None):
        """"""
        if self.is_root_node():
            if not include_self:
                return self._toplevel().objects.none()
            else:
                # Filter on pk for efficiency.
                return self._toplevel().objects.filter(pk=self.pk)

        params = {"%s__child" % self._closure_parentref():self.pk}
        if depth is not None:
            params["%s__depth__lte" % self._closure_parentref()] = depth
        ancestors = self._toplevel().objects.filter(**params)
        if not include_self:
            ancestors = ancestors.exclude(pk=self.pk)
        return ancestors.order_by("%s__depth" % self._closure_parentref())
450941
public function getAncestors()
    {
        // No need to access DB to get ancestors as they are given by the materialized path.
        //I use \/ instead of PATH_SEPARATOR for escape purpose
        $parts = preg_split('/%([^\/]+)\//', $this->materializedPath, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);

        $ancestors = [];
        $countAncestors = count($parts);
        for ($i = 0; $i < $countAncestors; $i += 2) {
            $ancestors[] = [
                'id' => $parts[$i + 1],
                'name' => $parts[$i],
            ];
        }

        return $ancestors;
    }
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
962910
def _get_all(cls, parent_id=None, grandparent_id=None):
        """"""
        client = cls._get_client()
        endpoint = cls._endpoint.format(resource_id="",
                                        parent_id=parent_id or "",
                                        grandparent_id=grandparent_id or "")
        resources = []
        while True:
            response = client.get_resource(endpoint)
            for raw_data in response.get("value", []):
                raw_data["parentResourceID"] = parent_id
                raw_data["grandParentResourceID"] = grandparent_id
                resources.append(cls.from_raw_data(raw_data))
            endpoint = response.get("nextLink")
            if not endpoint:
                break
        return resources
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 []
41224
def ancestor(self, n):
        
        if not isinstance(n, int) or n < 1:
            raise TypeError('Ancestor needs to be positive, received', n)

        if n == 1 or self.parent is None:
            return self.parent
        else:
            return self.parent.ancestor(n-1)
335015
def getAncestorsUIDs(instance):
    
    request = instance.getRequest()
    parents = map(lambda ar: api.get_uid(ar), request.getAncestors())
    return [api.get_uid(request)] + parents