List all resources
426222
def iter(context, resource, **kwargs):
    """"""
    data = utils.sanitize_kwargs(**kwargs)
    id = data.pop('id', None)
    subresource = data.pop('subresource', None)
    data['limit'] = data.get('limit', 20)

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

    data['offset'] = 0
    while True:
        j = context.session.get(uri, timeout=HTTP_TIMEOUT, params=data).json()
        if len(j[resource]):
            for i in j[resource]:
                yield i
        else:
            break
        data['offset'] += data['limit']
129137
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)

        result = []

        for resource in resources['rows']:
            parent = cls.parent_resource(**resource['doc'])
            result.append(cls(parent=parent, **resource['value']))

        raise Return(result)
1282984
def resources(self):
        
        return sa.orm.relationship(
            "Resource",
            cascade="all",
            passive_deletes=True,
            passive_updates=True,
            backref="owner",
            lazy="dynamic",
        )
937008
public ResourceList getAllResources() {
        if (allWhitelistedResourcesCached == null) {
            // Index Resource objects by path
            final ResourceList whitelistedResourcesList = new ResourceList();
            for (final ClasspathElement classpathElt : classpathOrder) {
                if (classpathElt.whitelistedResources != null) {
                    whitelistedResourcesList.addAll(classpathElt.whitelistedResources);
                }
            }
            // Set atomically for thread safety
            allWhitelistedResourcesCached = whitelistedResourcesList;
        }
        return allWhitelistedResourcesCached;
    }
55503
def resources(self):
        
        resources = []

        for endpoint in self.endpoints:
            resource_type = endpoint.Meta.resource_type
            table = endpoint.Meta.table
            url = endpoint.name

            resources.append((resource_type, {'table': table, 'url': url}))

        return resources
884548
def get_all(cls, parent=None, **params):

        if parent is not None:
            route = copy(parent.route)
        else:
            route = {}
        if cls.ID_NAME is not None:
            # Empty string triggers "get all resources"
            route[cls.ID_NAME] = ""

        base_obj = cls(key=parent.key, route=route, config=parent.config)
        """"""

        start = datetime.now()
        r = requests.get(
            base_obj._url(), auth=(base_obj.key, ""), params=params)
        cls._delay_for_ratelimits(start)

        if r.status_code not in cls.TRUTHY_CODES:
            return base_obj._handle_request_exception(r)

        response = r.json()
        objects_data = response.get(base_obj.ENVELOPE or base_obj, [])

        return_objects = []
        for data in objects_data:
            # Note that this approach does not get meta data
            return_objects.append(
                cls.get(
                    parent=parent,
                    id=data.get(cls.ID_NAME, data.get("id")),
                    data=data))

        return return_objects
788268
def resource_list(cls):
        
        items = cls.list({'items_per_page': 500})
        ret = [str(ip['id']) for ip in items]
        ret.extend([ip['ip'] for ip in items])
        return ret
340338
def list(self, resource=None, sort=None):
        
        schema = TagSchema()
        resp = self.service.get(self.base, params={'resource': resource, 'sort': sort})
        return self.service.decode(schema, resp, many=True)
1192287
def index():
    """"""
    kwdb = current_app.kwdb

    libraries = get_collections(kwdb, libtype="library")
    resource_files = get_collections(kwdb, libtype="resource")

    return flask.render_template("libraryNames.html",
                                 data={"libraries": libraries,
                                       "version": __version__,
                                       "resource_files": resource_files
                                   })
935105
def list(self, limit=None, marker=None, end_marker=None, prefix=None):
        
        uri = "/%s" % self.uri_base
        qs = utils.dict_to_qs({"marker": marker, "limit": limit,
                "prefix": prefix, "end_marker": end_marker})
        if qs:
            uri = "%s?%s" % (uri, qs)
        resp, resp_body = self.api.method_get(uri)
        return [Container(self, res, loaded=False)
                for res in resp_body if res]
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
516599
function list(options) {
  return function (req, res) {
    let list,
      listOptions = _.assign({
        prefix: req.uri,
        values: false
      }, options);

    list = db.list(listOptions);

    res.set('Content-Type', 'application/json');
    list.pipe(res);
  };
}
190807
def resource_list(cls):
        
        items = cls.list()
        ret = [vlan['name'] for vlan in items]
        ret.extend([str(vlan['id']) for vlan in items])
        return ret
519449
def list():
    """"""
    s3 = boto3.resource('s3')
    return [b.name for b in s3.buckets.all()]
405500
def list_all(self, name=None, visibility=None, member_status=None,
            owner=None, tag=None, status=None, size_min=None, size_max=None,
            sort_key=None, sort_dir=None):
        

        def strip_version(uri):
            """
            The 'next' uri contains a redundant version number. We need to
            strip it to use in the method_get() call.
            """
            pos = uri.find("/images")
            return uri[pos:]

        obj_class = self.resource_class
        resp, resp_body = self.list(name=name, visibility=visibility,
                member_status=member_status, owner=owner, tag=tag,
                status=status, size_min=size_min, size_max=size_max,
                sort_key=sort_key, sort_dir=sort_dir, return_raw=True)
        data = resp_body.get(self.plural_response_key, resp_body)
        next_uri = strip_version(resp_body.get("next", ""))
        ret = [obj_class(manager=self, info=res) for res in data if res]
        while next_uri:
            resp, resp_body = self.api.method_get(next_uri)
            data = resp_body.get(self.plural_response_key, resp_body)
            next_uri = strip_version(resp_body.get("next", ""))
            ret.extend([obj_class(manager=self, info=res)
                    for res in data if res])
        return ret
742496
public function listResources()
	{
		$list = [];
		$path = $this->getPath() . "resources";
		if( file_exists($path) )
		{
			$scan = @ scandir($path);
			if( !$scan )
			{
				throw new ReadException("Cannot ready resources directory for the '" . get_class($this) . "' module");
			}

			$path .= DIRECTORY_SEPARATOR;
			foreach( $scan as $file )
			{
				if( $file[0] !== "." && preg_match('/\.json$/', $file) )
				{
					$list[] = new Resource($path . $file);
				}
			}
		}

		return new Collection($list);
	}
59883
public function listJsonAction() {
        //Get the folder
        $folderUri = $this->container->get('request')->query->get('id');

        //Set folder uri to null to use the default if the root is requested ('#')
        if ('#' === $folderUri) {
            $folder = null;
        } else {
            $folder = $folderUri;
        }

        //Get the resource descriptors (not recursively)
        $resources = $this->container->get('mesd.jasper.report.client')->getResourceList($folder, false);

        //Convert the resources into an array to encode in json in the way jstree can read them
        $response = array();
        foreach($resources as $resource) {
            $data = array();
            $data['id'] = $resource->getUriString();
            $data['parent'] = $folderUri;
            $data['icon'] = false;

            if ('reportUnit' === $resource->getWsType()) {
                //Report object specific settings
                $data['text'] = '<i id="' . $data['id'] . '-icon" class="icon-file"></i> ' . $resource->getLabel();
                $data['children'] = false;
                //Set the href to the report input form
                $data['a_attr'] = array('href' => $this->container->get('router')->generate('MesdJasperReportViewerBundle_display_report_viewer', array('reportUri' => rawurlencode($resource->getUriString()))));
                $data['dump'] = $resource->getUriString();
            } elseif ('folder' === $resource->getWsType()) {
                //Folder object specific settings
                $data['text'] = '<i id="' . $data['id'] . '-icon" class="icon-folder-close"></i> ' . $resource->getLabel();
                $data['children'] = true;
            }

            $response[] = $data;
        }

        //Get the resources
        return new JsonResponse($response);
    }