Return all available parents
 TODO: Update parent behaviour
 What happens when parent is deleted or goes from published to
 draft. Possibly allow it but show warnings on the dashboard.
188927
def available_parents
      if persisted?
        unavailable_ids = ancestors.map(&:id)
        unavailable_ids << id
      end

      Page.published.where.not(id: unavailable_ids).order(:title)
    end
262310
def parents(self) -> List["Collection"]:
        
        p = self.parent
        parents = []
        while p is not None:
            parents.append(p)
            p = p.parent
        return parents
326761
def parents(self):
        # type: () -> List[CommitDetails]
        
        if self._parents is None:
            self._parents = [CommitDetails.get(x) for x in self.parents_sha1]

        return self._parents
63573
def top_parent(self):
        
        parent = self.parent
        while parent is not None:
            if parent.parent is None:
                return parent
            else:
                parent = parent.parent
        return self
911459
def parents
      parent = @ancestor
      (@ancestor.instance.path.size...self.instance.path.size).map do |i|
        parent.tap do
          parent = parent[self.instance.path[i]]
        end
      end.reverse
    end
1142323
def get_parent_repository_nodes(self):
        
        parent_repository_nodes = []
        for node in self._my_map['parentNodes']:
            parent_repository_nodes.append(RepositoryNode(
                node._my_map,
                runtime=self._runtime,
                proxy=self._proxy,
                lookup_session=self._lookup_session))
        return RepositoryNodeList(parent_repository_nodes)
1307921
def get_parent_bin_nodes(self):
        
        parent_bin_nodes = []
        for node in self._my_map['parentNodes']:
            parent_bin_nodes.append(BinNode(
                node._my_map,
                runtime=self._runtime,
                proxy=self._proxy,
                lookup_session=self._lookup_session))
        return BinNodeList(parent_bin_nodes)
163604
def handle_parent(repo, **kwargs):
    """"""
    log.info('parent: %s %s' %(repo, kwargs))
    _parent = repo.parent()
    if _parent:
        return [_parent.serialize()]
482106
function() {
                function findAvailableParents(nodes, root) {
                    var availables = [], i;
                    availables.push(root);
                    root.getChildren().forEach(function(test) {
                        for (i = 0; i < nodes.length; i++) {
                            if (nodes[i] == test) return;
                        }
                        availables = availables.concat(findAvailableParents(nodes, test));
                    });
                    return availables;
                }
                this._dropTargets = findAvailableParents(this._dragSources, this._minder.getRoot());
                this._dropTargetBoxes = this._dropTargets.map(function(source) {
                    return source.getLayoutBox();
                });
            }
325986
def get_all_parent_edges(self):
        """"""
        all_parent_edges = set()
        for parent in self.parents:
            all_parent_edges.add((self.item_id, parent.item_id))
            all_parent_edges |= parent.get_all_parent_edges()
        return all_parent_edges
1049694
def no_missing_parents(data_wrapper):
    '''
    '''
    db = data_wrapper.data_block
    ids = np.setdiff1d(db[:, COLS.P], db[:, COLS.ID])[1:]
    return CheckResult(len(ids) == 0, ids.astype(np.int) + 1)
1277319
def parent(self):
        # type: () -> Any
        
        if self.parent_id:
            return self._client.part(pk=self.parent_id, category=self.category)
        else:
            return None
1085672
def add_parents(self, parents):
        

        self._parents += [p for p in parents if p not in self._parents]
678111
def parent(self):
        
        parent_impl_node = self.adapter.get_node_parent(self.impl_node)
        return self.adapter.wrap_node(
            parent_impl_node, self.adapter.impl_document, self.adapter)
388549
def check_integrity(self, parents=None):
        
        if not self.parents:
            parents = parents or []
            if len(parents) == 0:
                try:
                    parents = [self.repository.get_changeset(), None]
                except EmptyRepositoryError:
                    parents = [None, None]
            elif len(parents) == 1:
                parents += [None]
            self.parents = parents

        # Local parents, only if not None
        parents = [p for p in self.parents if p]

        # Check nodes marked as added
        for p in parents:
            for node in self.added:
                try:
                    p.get_node(node.path)
                except NodeDoesNotExistError:
                    pass
                else:
                    raise NodeAlreadyExistsError("Node at %s already exists "
                        "at %s" % (node.path, p))

        # Check nodes marked as changed
        missing = set(self.changed)
        not_changed = set(self.changed)
        if self.changed and not parents:
            raise NodeDoesNotExistError(str(self.changed[0].path))
        for p in parents:
            for node in self.changed:
                try:
                    old = p.get_node(node.path)
                    missing.remove(node)
                    if old.content != node.content:
                        not_changed.remove(node)
                except NodeDoesNotExistError:
                    pass
        if self.changed and missing:
            raise NodeDoesNotExistError("Node at %s is missing "
                "(parents: %s)" % (node.path, parents))

        if self.changed and not_changed:
            raise NodeNotChangedError("Node at %s wasn't actually changed "
                "since parents' changesets: %s" % (not_changed.pop().path,
                    parents)
            )

        # Check nodes marked as removed
        if self.removed and not parents:
            raise NodeDoesNotExistError("Cannot remove node at %s as there "
                "were no parents specified" % self.removed[0].path)
        really_removed = set()
        for p in parents:
            for node in self.removed:
                try:
                    p.get_node(node.path)
                    really_removed.add(node)
                except ChangesetError:
                    pass
        not_removed = set(self.removed) - really_removed
        if not_removed:
            raise NodeDoesNotExistError("Cannot remove node at %s from "
                "following parents: %s" % (not_removed[0], parents))
88054
def get_parent_objects(self, context):
        
        parent_object = api.get_parent(context)
        portal_type = api.get_portal_type(context)
        return parent_object.objectValues(portal_type)
971838
def extend_parents(parents):
    
    new_parents = set()

    for parent in parents:

        new_parents.add(parent)

        if isinstance(parent, DeterministicBase):
            new_parents.remove(parent)
            new_parents |= parent.extended_parents

        elif isinstance(parent, ContainerBase):
            for contained_parent in parent.stochastics:
                new_parents.add(contained_parent)
            for contained_parent in parent.deterministics:
                new_parents |= contained_parent.extended_parents

    return new_parents