Get a list of parent resources, starting from the Document
348491
def parent_resources(cls):
        """"""
        parent = cls.parent_resource
        parents = [parent]

        try:
            while True:
                parent = parent.parent_resource
                parents.append(parent)
        except AttributeError:
            pass

        parents.reverse()
        return parents
1132566
function getParents(tokens, options) {
    var parentName = tokens.parent,
      parentFiles = [],
      parents = [],
      parentFile,
      parent,
      l;

    while (parentName) {
      if (!options || !options.filename) {
        throw new Error('Cannot extend "' + parentName + '" because current template has no filename.');
      }

      parentFile = parentFile || options.filename;
      parentFile = self.options.loader.resolve(parentName, parentFile);
      parent = cacheGet(parentFile, options) || self.parseFile(parentFile, utils.extend({}, options, { filename: parentFile }));
      parentName = parent.parent;

      if (parentFiles.indexOf(parentFile) !== -1) {
        throw new Error('Illegal circular extends of "' + parentFile + '".');
      }
      parentFiles.push(parentFile);

      parents.push(parent);
    }

    // Remap each parents'(1) blocks onto its own parent(2), receiving the full token list for rendering the original parent(1) on its own.
    l = parents.length;
    for (l = parents.length - 2; l >= 0; l -= 1) {
      parents[l].tokens = remapBlocks(parents[l].blocks, parents[l + 1].tokens);
      importNonBlocks(parents[l].blocks, parents[l].tokens);
    }

    return parents;
  }
759799
def get_resources_dests(resources_root, rules):
    """"""

    def get_rel_path(base, path):
        # normalizes and returns a lstripped-/-separated path
        base = base.replace(os.path.sep, '/')
        path = path.replace(os.path.sep, '/')
        assert path.startswith(base)
        return path[len(base):].lstrip('/')


    destinations = {}
    for base, suffix, dest in rules:
        prefix = os.path.join(resources_root, base)
        for abs_base in iglob(prefix):
            abs_glob = os.path.join(abs_base, suffix)
            for abs_path in iglob(abs_glob):
                resource_file = get_rel_path(resources_root, abs_path)
                if dest is None:  # remove the entry if it was here
                    destinations.pop(resource_file, None)
                else:
                    rel_path = get_rel_path(abs_base, abs_path)
                    rel_dest = dest.replace(os.path.sep, '/').rstrip('/')
                    destinations[resource_file] = rel_dest + '/' + rel_path
    return destinations
1211936
def list(self):
        
        parent_url = self.client.get_url(self.parent_object._manager._URL_KEY, 'GET', 'single', {'id': self.parent_object.id})
        target_url = parent_url + self.client.get_url_path(self._URL_KEY, 'GET', 'multi')
        return base.Query(self, target_url)
1253130
def get_resources(self, request, **resources):
        

        if self.parent:
            resources = self.parent.get_resources(request, **resources)

        pks = (
            resources.get(self._meta.name) or
            request.REQUEST.getlist(self._meta.name) or
            getattr(request, 'data', None) and request.data.get(
                self._meta.name))

        if not pks or self._meta.queryset is None:
            return resources

        pks = as_tuple(pks)

        try:
            if len(pks) == 1:
                resources[self._meta.name] = self._meta.queryset.get(pk=pks[0])

            else:
                resources[self._meta.name] = self._meta.queryset.filter(
                    pk__in=pks)

        except (ObjectDoesNotExist, ValueError, AssertionError):
            raise HttpError("Resource not found.",
                            status=status.HTTP_404_NOT_FOUND)

        except MultipleObjectsReturned:
            raise HttpError("Resources conflict.",
                            status=status.HTTP_409_CONFLICT)

        return resources
849568
def parents(self, node):
        """"""
        return [
            parent for parent in
            getattr( node, 'parents', [] )
            if getattr(parent, 'tree', self.TREE) == self.TREE
        ]
359364
def get_resources
      routes_doc = get_routes_doc
      resources_names = routes_doc.get_resources_names - resources_black_list

      resources_names.map do |resource|
        puts "Generating #{resource} documentation..." if trace?
        ResourceDoc.new( resource, routes_doc.get_actions_route_info( resource ) )
      end
    end
16085
def resource_list(cls):
        
        items = cls.list({'items_per_page': 500})
        ret = [paas['name'] for paas in items]
        ret.extend([str(paas['id']) for paas in items])
        for paas in items:
            paas = cls.info(paas['id'])
            ret.extend([vhost['name'] for vhost in paas['vhosts']])

        return ret
887119
def all(cls, include_deactivated=False):
        
        if include_deactivated:
            resources = yield cls.view.get(include_docs=True)
        else:
            resources = yield cls.active_view.get(include_docs=True)
        raise Return([cls(**resource['doc']) for resource in resources['rows']])
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
1370548
def get_resources_nodes(call=None, resFilter=None):
    '''
    
    '''
    log.debug('Getting resource: nodes.. (filter: %s)', resFilter)
    resources = query('get', 'cluster/resources')

    ret = {}
    for resource in resources:
        if 'type' in resource and resource['type'] == 'node':
            name = resource['node']
            ret[name] = resource

    if resFilter is not None:
        log.debug('Filter given: %s, returning requested '
                  'resource: nodes', resFilter)
        return ret[resFilter]

    log.debug('Filter not given: %s, returning all resource: nodes', ret)
    return ret
982775
def _get_resources(self, resource, obj, params=None, map=None, **kwargs):
        """"""
        r = self._http_resource('GET', resource, params=params)
        d_items = self._resource_deserialize(r.content.decode("utf-8"))

        items =  [obj.new_from_dict(item, h=self, **kwargs) for item in d_items]

        if map is None:
            map = KeyedListResource

        list_resource = map(items=items)
        list_resource._h = self
        list_resource._obj = obj
        list_resource._kwargs = kwargs

        return list_resource
463674
def _get(cls, resource_id, parent_id, grandparent_id):
        """""""
        client = cls._get_client()
        endpoint = cls._endpoint.format(resource_id=resource_id or "",
                                        parent_id=parent_id or "",
                                        grandparent_id=grandparent_id or "")
        raw_data = client.get_resource(endpoint)
        raw_data["parentResourceID"] = parent_id
        raw_data["grandParentResourceID"] = grandparent_id
        return cls.from_raw_data(raw_data)
488804
def list(context, resource, **kwargs):
    """"""
    data = utils.sanitize_kwargs(**kwargs)
    id = data.pop('id', None)
    subresource = data.pop('subresource', None)

    if subresource:
        uri = '%s/%s/%s/%s' % (context.dci_cs_api, resource, id, subresource)
    else:
        uri = '%s/%s' % (context.dci_cs_api, resource)

    return context.session.get(uri, timeout=HTTP_TIMEOUT, params=data)
1004372
def get_parent_id(self, resource, document):
        
        parent_type = self._get_parent_type(resource)
        if parent_type and document:
            return document.get(parent_type.get('field'))

        return None
258251
public function getParentList(){
        if(!$this->isPropertyAvailable('ParentList')){
            $this->setProperty("ParentList", new SPList($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(), "parentlist")),false);
        }
        return $this->getProperty("ParentList");
    }
527815
def list(cls, name, parent=None, interleave=None):
        """"""
        node = cls.leaf_list(name, parent, interleave=interleave)
        node.keys = []
        node.keymap = {}
        return node