Invokes the /applet-xxxx/listProjects API method.

    For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Cloning#API-method%3A-%2Fclass-xxxx%2FlistProjects
540247
def applet_list_projects(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/listProjects' % object_id, input_params, always_retry=always_retry, **kwargs)
1156881
function getList(getList, list, cb) {
			
			/* set route from config and run middleware */
			debug.sockets('run list', getList.key);
			
			if(globalOnlyRoutes && globalOnlyRoutes.indexOf(getList.key) < 0) {
				return cb({
					path: getList.path, 
					success: false, 
					error: 'Not Allowed'
				});
			}
			
			if(globalExcludeRoutes && globalExcludeRoutes.indexOf(getList.key) > -1) {
				return cb({
					path: getList.path, 
					success: false, 
					error: 'Not Allowed'
				});
			}
			
			var listConfig = opts.lists[getList.key];
			
			if(_.isObject(listConfig)) {
				var excludes = listConfig.exclude ? listConfig.exclude.split(/[\s,]+/) : [];
				if(excludes.indexOf('list') > -1) {
					return cb({
						path: getList.path, 
						success: false, 
						error: 'Not Allowed'
					});
				}
			}
			
			var me = configMe(opts, getList.key, 'list', false,  live);
			
			debug.sockets('runAction for me', me);
											
			list.list = getList;
			// add opts
			list.list.apiOptions = opts;
			
			runAction.call(live, me, list, socket, function(err) {
				debug.sockets('## runAction callback for ' + list.list.key);
				if(err) {
					debug.sockets( '#### Err  ', err);
					cb({
						path: getList.path, 
						success: false, 
						error: err.message
					});
				} else {
					me.route.call(live, list, req, socket, function(err, docs) {
						debug.sockets('got docs from list... run postware',list.list.key, err);
						if(docs) {
							runPostware.call(live, list.list.path, docs, socket, me.postware, function(err, a, manipulatedDocs, b) {
								debug.sockets('done.. send docs',list.list.key, err);
								// send data to listeners
								cb({
									path: getList.path, 
									data: manipulatedDocs || docs, 
									success: true
								});
							});
						} else {
							// fail
							debug.sockets('## FAIL ## in route call');
							cb({
								path: getList.path, 
								success: false, 
								error: err.message
							});
						}
					});
				}
			});
		}
679281
private void respondToListSets(Map<String, String> args,
                                   String baseURL,
                                   List<?> sets,
                                   ResumptionToken resumptionToken,
                                   PrintWriter out) {
        appendTop(out);
        appendRequest(args, baseURL, out);
        out.println("  <ListSets>");
        for (int i = 0; i < sets.size(); i++) {
            SetInfo s = (SetInfo) sets.get(i);
            out.println("    <set>");
            out.println("      <setSpec>" + s.getSpec() + "</setSpec>");
            out.println("      <setName>" + s.getName() + "</setName>");
            Iterator<String> iter = s.getDescriptions().iterator();
            while (iter.hasNext()) {
                out.println("      <setDescription>\n");
                out.println(iter.next());
                out.println("      </setDescription>\n");
            }
            out.println("    </set>");
        }
        appendResumptionToken(resumptionToken, out);
        out.println("  </ListSets>");
        appendBottom(out);
    }
296913
def project_list(self, limit=None):
        
        params = {}
        if limit:
            params['limit'] = limit
        return (self.get('rest/api/1.0/projects', params=params) or {}).get('values')
324749
function RedisProject(projectId, adapter) {
    var logger = adapter.logger.fork(projectId);
    this.projectId = projectId;

    this.closeProject = function (callback) {
        var deferred = Q.defer();
        deferred.resolve();
        return deferred.promise.nodeify(callback);
    };

    this.loadObject = function (hash, callback) {
        var deferred = Q.defer();
        if (typeof hash !== 'string') {
            deferred.reject(new Error('loadObject - given hash is not a string : ' + typeof hash));
        } else if (!REGEXP.HASH.test(hash)) {
            deferred.reject(new Error('loadObject - invalid hash :' + hash));
        } else {
            Q.ninvoke(adapter.client, 'hget', projectId, hash)
                .then(function (result) {
                    // Bulk string reply: the value associated with field,
                    // or nil when field is not present in the hash or key does not exist.
                    if (result) {
                        deferred.resolve(JSON.parse(result));
                    } else {
                        logger.error('object does not exist ' + hash);
                        deferred.reject(new Error('object does not exist ' + hash));
                    }
                })
                .catch(deferred.reject);
        }

        return deferred.promise.nodeify(callback);
    };

    this.insertObject = function (object, callback) {
        var deferred = Q.defer();
        if (object === null || typeof object !== 'object') {
            deferred.reject(new Error('object is not an object'));
        } else if (typeof object._id !== 'string' || !REGEXP.HASH.test(object._id)) {
            deferred.reject(new Error('object._id is not a valid hash.'));
        } else {
            Q.ninvoke(adapter.client, 'hsetnx', projectId, object._id, JSON.stringify(object))
                .then(function (result) {
                    // 1 if field is a new field in the hash and value was set.
                    // 0 if field already exists in the hash and no operation was performed.
                    if (result === 0) {
                        Q.ninvoke(adapter.client, 'hget', projectId, object._id)
                            .then(function (objectStr) {
                                var errMsg;
                                if (CANON.stringify(object) === CANON.stringify(JSON.parse(objectStr))) {
                                    logger.info('tried to insert existing hash - the two objects were equal',
                                        object._id);
                                    deferred.resolve();
                                } else {
                                    errMsg = 'tried to insert existing hash - the two objects were NOT equal ';
                                    logger.error(errMsg, {
                                        metadata: {
                                            newObject: CANON.stringify(object),
                                            oldObject: CANON.stringify(JSON.parse(objectStr))
                                        }
                                    });
                                    deferred.reject(new Error(errMsg + object._id));
                                }
                            })
                            .catch(deferred.reject);
                    } else {
                        if (object.type === CONSTANTS.COMMIT_TYPE) {
                            Q.ninvoke(adapter.client, 'hset', projectId + adapter.CONSTANTS.COMMITS,
                                object._id, object.time)
                                .then(function () {
                                    deferred.resolve();
                                })
                                .catch(deferred.reject);
                        } else {
                            deferred.resolve();
                        }
                    }
                });
        }

        return deferred.promise.nodeify(callback);
    };

    this.getBranches = function (callback) {
        return Q.ninvoke(adapter.client, 'hgetall', projectId + adapter.CONSTANTS.BRANCHES)
            .then(function (result) {
                return result || {};
            })
            .nodeify(callback);
    };

    this.getBranchHash = function (branch, callback) {
        return Q.ninvoke(adapter.client, 'hget', projectId + adapter.CONSTANTS.BRANCHES, branch)
            .then(function (branchHash) {
                return branchHash || '';
            }).nodeify(callback);
    };

    this.setBranchHash = function (branch, oldhash, newhash, callback) {
        var deferred = Q.defer(),
            branchesHashMap = projectId + adapter.CONSTANTS.BRANCHES;

        if (oldhash === newhash) {
            Q.ninvoke(adapter.client, 'hget', branchesHashMap, branch)
                .then(function (branchHash) {
                    branchHash = branchHash || '';
                    if (branchHash === oldhash) {
                        deferred.resolve();
                    } else {
                        deferred.reject(new Error('branch hash mismatch'));
                    }
                })
                .catch(deferred.reject);
        } else if (newhash === '') {
            Q.ninvoke(adapter.client, 'hget', branchesHashMap, branch)
                .then(function (branchHash) {
                    if (branchHash === oldhash) {
                        Q.ninvoke(adapter.client, 'hdel', branchesHashMap, branch)
                            .then(deferred.resolve);
                    } else if (branchHash === null) {
                        deferred.resolve();
                    } else {
                        deferred.reject(new Error('branch hash mismatch'));
                    }
                })
                .catch(deferred.reject);
        } else if (oldhash === '') {
            Q.ninvoke(adapter.client, 'hsetnx', branchesHashMap, branch, newhash)
                .then(function (result) {
                    // 1 if field is a new field in the hash and value was set.
                    // 0 if field already exists in the hash and no operation was performed.
                    if (result === 1) {
                        deferred.resolve();
                    } else {
                        deferred.reject(new Error('branch hash mismatch'));
                    }
                })
                .catch(deferred.reject);
        } else {
            Q.ninvoke(adapter.client, 'hget', branchesHashMap, branch)
                .then(function (branchHash) {
                    if (branchHash === oldhash) {
                        Q.ninvoke(adapter.client, 'hset', branchesHashMap, branch, newhash)
                            .then(function () {
                                deferred.resolve();
                            })
                            .catch(deferred.reject);
                    } else {
                        deferred.reject(new Error('branch hash mismatch'));
                    }
                })
                .catch(deferred.reject);
        }

        return deferred.promise.nodeify(callback);
    };

    this.getCommits = function (before, number, callback) {
        return Q.ninvoke(adapter.client, 'hgetall', projectId + adapter.CONSTANTS.COMMITS)
            .then(function (result) {
                var i,
                    hashArray,
                    timestamp,
                    hashKeys = Object.keys(result || {}),
                    commitsInfo = [];

                // FIXME: This is not a very optimized implementation
                for (i = 0; i < hashKeys.length; i += 1) {
                    timestamp = parseInt(result[hashKeys[i]], 10);
                    if (timestamp < before) {
                        commitsInfo.push({
                            hash: hashKeys[i],
                            time: timestamp
                        });
                    }
                }

                commitsInfo.sort(function (a, b) {
                    return b.time - a.time;
                });

                hashArray = commitsInfo.slice(0, number).map(function (commitInfo) {
                    return commitInfo.hash;
                });

                if (hashArray.length > 0) {
                    hashArray.unshift(projectId);
                    return Q.ninvoke(adapter.client, 'hmget', hashArray);
                } else {
                    return [];
                }
            })
            .then(function (commitObjects) {
                return commitObjects.map(function (commitObject) {
                    return JSON.parse(commitObject);
                });
            })
            .nodeify(callback);
    };

    this.createTag = function (name, commitHash, callback) {
        var deferred = Q.defer();

        Q.ninvoke(adapter.client, 'hsetnx', projectId + adapter.CONSTANTS.TAGS, name, commitHash)
            .then(function (result) {
                // 1 if field is a new field in the hash and value was set.
                // 0 if field already exists in the hash and no operation was performed.
                if (result === 1) {
                    deferred.resolve();
                } else {
                    deferred.reject(new Error('Tag already exists [' + name + ']'));
                }
            })
            .catch(deferred.reject);

        return deferred.promise.nodeify(callback);
    };

    this.deleteTag = function (name, callback) {
        return Q.ninvoke(adapter.client, 'hdel', projectId + adapter.CONSTANTS.TAGS, name)
            .nodeify(callback);
    };

    this.getTags = function (callback) {
        return Q.ninvoke(adapter.client, 'hgetall', projectId + adapter.CONSTANTS.TAGS)
            .then(function (result) {
                return result || {};
            })
            .nodeify(callback);
    };
}
236007
def list_projects(self):
        
        url = self._build_url(constants.LIST_PROJECTS_ENDPOINT)
        json = self.client.get(url, timeout=self.timeout)
        return json['projects']
1098233
private <I extends Message, O extends Message> ListenableFuture<JsonRpcResponse> invoke(
      ServerMethod<I, O> method, JsonObject parameter, JsonElement id) {
    I request;
    try {
      request = (I) Messages.fromJson(method.inputBuilder(), parameter);
    } catch (Exception e) {
      serverLogger.logServerFailure(method, e);
      SettableFuture<JsonRpcResponse> future = SettableFuture.create();
      future.setException(e);
      return future;
    }
    ListenableFuture<O> response = method.invoke(request);
    return Futures.transform(response, new JsonConverter(id), TRANSFORM_EXECUTOR);
  }
1071499
public PubsubFuture<SubscriptionList> listSubscriptions(final String project,
                                                          final String pageToken) {
    final String query = (pageToken == null) ? "" : "?pageToken=" + pageToken;
    final String path = "projects/" + project + "/subscriptions" + query;
    return get("list subscriptions", path, readJson(SubscriptionList.class));
  }
605516
private ApiListType executeRequest(Call call) throws IOException, ApiException {
    return client.handleResponse(call.execute(), listType);
  }
1110374
@Override
    protected List<IndexRequestBuilder> toRequest(JCas jCas, Client client,
            String indexName) throws IOException {
        List<IndexRequestBuilder> requests = newArrayList();

        String pmId = getHeaderDocId(jCas);

        try {
            Collection<Neuron> neurons = select(jCas, Neuron.class);

            // UIMA CAS indexes so that we build them once for all sentences.
            Map<AnnotationFS, Collection<AnnotationFS>> idxNeuronProperties = indexCovered(
                    jCas.getCas(), //
                    getType(jCas, Neuron.class),
                    getType(jCas, NeuronProperty.class));
            Map<AnnotationFS, Collection<AnnotationFS>> idxNeurons = indexCovered(
                    jCas.getCas(), //
                    getType(jCas, Neuron.class),
                    getType(jCas, NeuronTrigger.class));

            // only index abstracts that contain a neuron
            if (!(onlyIndexNeurons && neurons.isEmpty())) {

                final XContentBuilder doc = jsonBuilder().startObject();
                doc.field(FIELD_PUBMED_ID, pmId);
                doc.field(FIELD_SENTENCE_TEXT, jCas.getDocumentText());
                // authors & date
                try {
                    List<String> authors = new ArrayList<>();
                    Header header = selectSingle(jCas, Header.class);
                    for (int i = 0; i < header.getAuthors().size(); i++) {
                        AuthorInfo a = header.getAuthors(i);
                        authors.add(a.getForeName() + " " + a.getLastName());
                    }
                    doc.field(FIELD_AUTHORS, authors);

                    String pubDate = header.getCopyright();// 1976-01-16
                    if (pubDate.indexOf("-") > -1) {
                        doc.field(FIELD_PUBLISHED_DATE, pubDate);
                    }
                } catch (Exception e) {// nope
                    LOG.debug("failed to index authors or date for {}: {}",
                            pmId, e.toString());
                }

                // INDEX NEURONS
                doc.startArray("neuron");
                for (Neuron nwp : neurons) {
                    doc.startObject();
                    doc.field(FIELD_NEURON_TEXT, nwp.getCoveredText());
                    doc.field(FIELD_START, nwp.getBegin());
                    doc.field(FIELD_END, nwp.getEnd());

                    // properties
                    doc.startArray("neuron_properties");
                    // neuron(trigger), handle as it were a property
                    NeuronTrigger n = ((NeuronTrigger) (idxNeurons.get(nwp)
                            .iterator().next()));
                    doc.startObject();
                    doc.field(FIELD_NEURON_TYPE, getName(n));
                    doc.field(FIELD_PROPERTY_TEXT, n.getCoveredText());
                    doc.field(FIELD_START, n.getBegin());
                    doc.field(FIELD_END, n.getEnd());
                    doc.endObject(); // end 'n' (neuron trigger)

                    // every NeuronProperty
                    if (idxNeuronProperties.containsKey(nwp)) {
                        for (AnnotationFS np : idxNeuronProperties.get(nwp)) {
                            doc.startObject();
                            doc.field(FIELD_NEURON_TYPE, getName(np));
                            doc.field(FIELD_PROPERTY_TEXT, np.getCoveredText());
                            doc.field(FIELD_START, np.getBegin());
                            doc.field(FIELD_END, np.getEnd());
                            try {
                                String id = ((NeuronProperty) np)
                                        .getOntologyId();
                                if (id != null)
                                    doc.field(FIELD_ONTOLOGY_ID, id);
                            } catch (Exception e) {// nope
                            }
                            doc.endObject();
                        }
                    }
                    doc.endArray(); // end 'properties'
                    doc.endObject(); // end nwp
                }
                doc.endArray(); // end 'neuron'

                // INDEX SEPARATE PROPERTIES
                doc.startArray("all_neuron_properties");
                for (NeuronProperty np : select(jCas, NeuronProperty.class)) {
                    doc.startObject();
                    doc.field(FIELD_PROPERTY_TEXT, np.getCoveredText());
                    doc.field(FIELD_NEURON_TYPE, getName(np));
                    doc.field(FIELD_START, np.getBegin());
                    doc.field(FIELD_END, np.getEnd());
                    try {
                        String id = np.getOntologyId();
                        if (id != null)
                            doc.field(FIELD_ONTOLOGY_ID, id);
                    } catch (Exception e) {// nope
                    }
                    doc.endObject();
                }
                doc.endArray();

                String uid = pmId;// + "_" + sentenceStart; // uid for Lucene
                requests.add(client.prepareIndex(indexName, "abstract_", uid)
                        .setSource(doc));

                LOG.trace(doc.string());
            }

        } catch (Exception e) {
            LOG.warn("could not index pmid" + pmId, e);
        }
        return requests;
    }
1071722
function invokeMap (list, path) {
  var func
  var args = arguments
  var params = []
  var paths = []
  var index = 2
  var len = args.length
  for (; index < len; index++) {
    params.push(args[index])
  }
  if (baseExports.isArray(path)) {
    len = path.length - 1
    for (index = 0; index < len; index++) {
      paths.push(path[index])
    }
    path = path[len]
  }
  return arrayMap(list, function (context) {
    if (paths.length) {
      context = deepGetObj(context, paths)
    }
    func = context[path] || path
    if (func && func.apply) {
      return func.apply(context, params)
    }
  })
}
1250571
def listing(callback=None, path=None, method=Method.GET, resource=None, tags=None, summary="List resources",
            middleware=None, default_limit=50, max_limit=None, use_wrapper=True):
    # type: (Callable, Path, Methods, Resource, Tags, str, List[Any], int, int) -> Operation
    
    op_type = WrappedListOperation if use_wrapper else ListOperation

    def inner(c):
        op = op_type(c, path or NoPath, method, resource, tags, summary, middleware,
                     default_limit=default_limit, max_limit=max_limit)
        op.responses.add(Response(HTTPStatus.OK, "Listing of resources", Listing))
        return op
    return inner(callback) if callback else inner
181991
def list(self, request):
        
        pipeline = [{'$match': request.args.pop('match', {})}]

        sort = request.args.pop('sort', {})
        if sort:
            pipeline.append({'$sort': sort})

        project = request.args.pop('project', {})
        if project:
            pipeline.append({'$project': project})

        return Response(serialize(self.collection.aggregate(pipeline)))
202679
public void invokeRequest (ClientObject caller, byte[] serializedAction,
        InvocationService.ResultListener listener)
    {
        NodeRequest request = null;
        try {
            ObjectInputStream oin =
                new ObjectInputStream(new ByteArrayInputStream(serializedAction));
            request = (NodeRequest)oin.readObject();
            _injector.injectMembers(request);
            request.invoke(listener);

        } catch (Exception e) {
            log.warning("Failed to execute node request",
                        "from", (caller == null) ? "self" : caller.who(),
                        "request", request, "serializedSize", serializedAction.length, e);
            listener.requestFailed("Failed to execute node request");
        }
    }
339173
@Action(name = "List Remover",
            outputs = {
                    @Output(RESPONSE),
                    @Output(RETURN_RESULT),
                    @Output(RETURN_CODE)
            },
            responses = {
                    @Response(text = SUCCESS, field = RETURN_CODE, value = RETURN_CODE_SUCCESS, matchType = MatchType.COMPARE_EQUAL),
                    @Response(text = FAILURE, field = RETURN_CODE, value = RETURN_CODE_FAILURE, matchType = MatchType.COMPARE_EQUAL, isOnFail = true, isDefault = true)
            })
    public Map<String, String> removeElement(@Param(value = LIST, required = true) String list,
                                             @Param(value = ELEMENT, required = true) String index,
                                             @Param(value = DELIMITER, required = true) String delimiter) {
        Map<String, String> result = new HashMap<>();
        try {
            if (StringUtils.isEmpty(list) || StringUtils.isEmpty(index) || StringUtils.isEmpty(delimiter)) {
                throw new RuntimeException(EMPTY_INPUT_EXCEPTION);
            } else {
                String[] elements = StringUtils.split(list, delimiter);
                elements = ArrayUtils.remove(elements, Integer.parseInt(index));
                result.put(RESPONSE, SUCCESS);
                result.put(RETURN_RESULT, StringUtils.join(elements, delimiter));
                result.put(RETURN_CODE, RETURN_CODE_SUCCESS);
            }
        } catch (Exception e) {
            result.put(RESPONSE, FAILURE);
            result.put(RETURN_RESULT, e.getMessage());
            result.put(RETURN_CODE, RETURN_CODE_FAILURE);
        }
        return result;
    }
706413
@Override
    public java.util.concurrent.Future<ListApplicationsResult> listApplicationsAsync(
            com.amazonaws.handlers.AsyncHandler<ListApplicationsRequest, ListApplicationsResult> asyncHandler) {

        return listApplicationsAsync(new ListApplicationsRequest(), asyncHandler);
    }
582328
@Override
    public Set<Scope> getProjects() {

        try {
            String url = featureSettings.getJiraBaseUrl() + (featureSettings.getJiraBaseUrl().endsWith("/") ? "" : "/")
                    + PROJECT_REST_SUFFIX;
            ResponseEntity<String> responseEntity = makeRestCall(url);
            String responseBody = responseEntity.getBody();

            JSONArray projects = (JSONArray) parser.parse(responseBody);

            return parseAsScopes(projects);

        } catch (ParseException pe) {
            LOGGER.error("Parser exception when parsing teams", pe);
        } catch (HygieiaException e) {
            LOGGER.error("Error in calling JIRA API", e);
        }
        return Collections.EMPTY_SET;
    }