Return the ancestor types of *typename*.
337547
def ancestors(self, typename):
        """"""
        xs = []
        for parent in self._hier[typename][0]:
            xs.append(parent)
            xs.extend(self.ancestors(parent))
        return xs
931979
@Override
    public List<? extends Tree> getAncestors() {
        if ( getParent()==null ) return null;
        List<Tree> ancestors = new ArrayList<Tree>();
        Tree t = this;
        t = t.getParent();
        while ( t!=null ) {
            ancestors.add(0, t); // insert at start
            t = t.getParent();
        }
        return ancestors;
    }
1268353
def get_ancestors(self):
        
        if self.is_root():
            return get_result_class(self.__class__).objects.none()

        paths = [
            self.path[0:pos]
            for pos in range(0, len(self.path), self.steplen)[1:]
        ]
        return get_result_class(self.__class__).objects.filter(
            path__in=paths).order_by('depth')
71842
function getDefaultTypeRoots(currentDirectory, host) {
        if (!host.directoryExists) {
            return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)];
        }
        var typeRoots;
        while (true) {
            var atTypes = ts.combinePaths(currentDirectory, nodeModulesAtTypes);
            if (host.directoryExists(atTypes)) {
                (typeRoots || (typeRoots = [])).push(atTypes);
            }
            var parent_15 = ts.getDirectoryPath(currentDirectory);
            if (parent_15 === currentDirectory) {
                break;
            }
            currentDirectory = parent_15;
        }
        return typeRoots;
    }
631278
def _ancestors(collection):
    """"""
    for index, c in enumerate(collection.path_to_root()):
        if index > 0 and c.dbquery is not None:
            raise StopIteration
        yield c.name
    raise StopIteration
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)
55427
def types(self):
        """"""
        return [term for term in self._terms
                if isinstance(term, (TypeIdentifier, String, Regex))]
1286336
def get_ancestors(self):
        
        ancestors = []
        if self._meta.proxy_for_model:
            # the current node is a proxy model; our result set
            # should use the same proxy model, so we need to
            # explicitly fetch instances of that model
            # when following the 'parent' relation
            cls = self.__class__
            node = self
            while node.parent_id:
                node = cls.objects.get(pk=node.parent_id)
                ancestors.insert(0, node)
        else:
            node = self.parent
            while node:
                ancestors.insert(0, node)
                node = node.parent
        return ancestors
493143
def getTypename(cls):
        '''
        
        '''
        if cls is Event:
            return None
        else:
            for c in cls.__bases__:
                if issubclass(c, Event):
                    if c is Event:
                        return cls._getTypename()
                    else:
                        return c.getTypename()
1201220
def type_name(value):
    """"""
    return type(value).__name__ if isinstance(value, EncapsulatedNode) else \
           "struct" if isinstance(value, dict) else \
           "sequence" if isinstance(value, (tuple, list)) else \
           type(value).__name__
1073537
function getAncestors(node) {
  var path = [];
  var current = node;
  while (current.parent) {
    path.unshift(current);
    current = current.parent;
  }
  return path;
}
614781
def get_ancestors(self):
        
        if self.is_root():
            return get_result_class(self.__class__).objects.none()
        return get_result_class(self.__class__).objects.filter(
            tree_id=self.tree_id,
            lft__lt=self.lft,
            rgt__gt=self.rgt)
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)
138780
private @Nullable TypeElement findParentType(TypeElement typeElement, Set<TypeElement> parents) {
    TypeMirror type;
    while (true) {
      type = typeElement.getSuperclass();
      if (type.getKind() == TypeKind.NONE) {
        return null;
      }
      typeElement = (TypeElement) ((DeclaredType) type).asElement();
      if (parents.contains(typeElement)) {
        return typeElement;
      }
    }
  }
178354
def get_type(self):
        
        for typechar, typename in self.KEY_TYPE_CHOICES:
            if typechar == self.key_type:
                return typename
50264
public function findSubtypes($parentTypeName)
    {
        $this->stringHelper->validate($parentTypeName);

        $symbols = [];

        foreach ($this->symbols as $symbol) {
            if (is_a($symbol, $parentTypeName)) {
                $symbols[] = $symbol;
            }
        }

        return $symbols;
    }
701984
public static function page_type_classes()
    {
        $classes = ClassInfo::getValidSubClasses();

        $baseClassIndex = array_search(self::class, $classes);
        if ($baseClassIndex !== false) {
            unset($classes[$baseClassIndex]);
        }

        $kill_ancestors = array();

        // figure out if there are any classes we don't want to appear
        foreach ($classes as $class) {
            $instance = singleton($class);

            // do any of the progeny want to hide an ancestor?
            if ($ancestor_to_hide = $instance->config()->get('hide_ancestor')) {
                // note for killing later
                $kill_ancestors[] = $ancestor_to_hide;
            }
        }

        // If any of the descendents don't want any of the elders to show up, cruelly render the elders surplus to
        // requirements
        if ($kill_ancestors) {
            $kill_ancestors = array_unique($kill_ancestors);
            foreach ($kill_ancestors as $mark) {
                // unset from $classes
                $idx = array_search($mark, $classes, true);
                if ($idx !== false) {
                    unset($classes[$idx]);
                }
            }
        }

        return $classes;
    }