Lists the names and IDs of up to 10 files.
@param {google.auth.OAuth2} auth An authorized OAuth2 client.
974890
function listFiles(auth) {
  const service = google.drive('v3');
  service.files.list(
    {
      auth: auth,
      pageSize: 10,
      fields: 'nextPageToken, files(id, name)',
    },
    (err, res) => {
      if (err) {
        console.error('The API returned an error.');
        throw err;
      }
      const files = res.data.files;
      if (files.length === 0) {
        console.log('No files found.');
      } else {
        console.log('Files:');
        for (const file of files) {
          console.log(`${file.name} (${file.id})`);
        }
      }
    }
  );
}
204286
function(req, res) {
    var params = URL.parse(req.url, true).query;
    var oauth2_server_id = params.provider || this.config.default_server;
    var next_url = this.nexturl_query(req, params);
    this.redirects_for_login(oauth2_server_id, res, next_url);
  }
1094102
def list_folder(self, dir_name=None, prefix=None, num=1000, context=None):
        
        if dir_name[0] == '/':
            dir_name = dir_name[1:len(dir_name)]
        self.url = 'http://<Region>.file.myqcloud.com/files/v2/<appid>/<bucket_name>/'
        self.url = self.url.replace("<Region>", self.config.region).replace("<appid>", str(self.config.app_id)).replace("<bucket_name>", self.config.bucket)
        if dir_name is not None:
            self.url = self.url + str(dir_name) + "/"
        if prefix is not None:
            self.url = self.url + str(prefix)
        self.url = self.url + "?op=list&num=" + str(num)
        if context is not None:
            self.url = self.url + '&context=' + str(context)
        self.headers['Authorization'] = CosAuth(self.config).sign_more(self.config.bucket, '', 30)
        response, content = self.http.request(uri=self.url, method='GET', headers=self.headers)
        return content.decode("utf8")
1202773
def list(self, detail=False):
        
        creds_provider = CredentialsManager(upload_area=self)
        s3agent = S3Agent(credentials_provider=creds_provider)
        key_prefix = self.uuid + "/"
        key_prefix_length = len(key_prefix)
        for page in s3agent.list_bucket_by_page(bucket_name=self.uri.bucket_name, key_prefix=key_prefix):
            file_list = [key[key_prefix_length:] for key in page]  # cut off upload-area-id/
            if detail:
                files_info = self.upload_service.api_client.files_info(self.uuid, file_list)
            else:
                files_info = [{'name': filename} for filename in file_list]
            for file_info in files_info:
                yield file_info
265504
function(authStore, session) {
  var found = false;

  for (var i = 0; i < authStore.length; i++) {
    if (authStore[i].equal(session)) {
      found = true;
      break;
    }
  }

  if (!found) authStore.push(session);
}
1294129
function(oauth, callback) {
		orionAccount.find({oauth: new RegExp("^" + oauth + "$", "m")}, function(err, user) {
			if (err) {
				return callback(err);
			}
			if (user && user.length) {
				return callback(null, user[0]);
			}
			return callback(null, null);
		});
	}
1180287
def list_permissions(self, file_id):
        
        url = '{0}/{1}/permissions'.format(DRIVE_FILES_API_V2_URL, file_id)

        r = self.request('get', url)

        return r.json()['items']
874395
def image_list(name=None, profile=None, **kwargs):
    '''
    
    '''
    conn = _auth(profile, **kwargs)
    return conn.image_list(name)
148610
def list(self, href):
        
        for iTry in range(TRYINGS):
            logger.info(u("list(%s): %s") % (iTry, href))
            folders = None
            files = None
            try:
                href = os.path.join(u("/"), _(href))
                conn = self.getConnection()
                conn.request("PROPFIND", _encode_utf8(href), u(""), self.getHeaders())
                response = conn.getresponse()
                checkResponse(response)
                data = response.read()
                if data == b('list: folder was not found'):
                    return folders, files
                elif data == b('You are not authorized to see this!'):
                    return folders, files
                else:
                    try:
                        dom = xml.dom.minidom.parseString(data)
                        responces = dom.getElementsByTagNameNS("DAV:", "response")
                        folders = {}
                        files = {}
                        for dom in responces:
                            response = RemoteObject(dom, self, href)
                            if response.href != href:
                                if response.isFolder():
                                    folders[response.href] = response
                                else:
                                    files[response.href] = response
                    except xml.parsers.expat.ExpatError:
                        e = sys.exc_info()[1]
                        logger.exception(e)
                return folders, files
            except ConnectionException:
                raise
            except Exception:
                e = sys.exc_info()[1]
                logger.exception(e)
            return folders, files
1345414
def list_files(self, secure_data_path, limit=None, offset=None):
        """"""

        # Make sure that limit and offset are in range.
        # Set the normal defaults
        if not limit or limit <= 0:
            limit = 100

        if not offset or offset < 0:
            offset = 0

        payload = {'limit': str(limit), 'offset': str(offset)}

        # Because of the addition of versionId and the way URLs are constructed, secure_data_path should
        #  always end in a '/'.
        secure_data_path = self._add_slash(secure_data_path)
        secret_resp = get_with_retry(self.cerberus_url + '/v1/secure-files/' + secure_data_path,
                                   params=payload, headers=self.HEADERS)
        throw_if_bad_response(secret_resp)
        return secret_resp.json()
50476
function (req, res, next) {
            if (options.forceAuthorize) {
                return next();
            }
            var userId = req.oauth2.user.id;
            var clientId = req.oauth2.client.id;
            var scope = req.oauth2.req.scope;
            models.Permissions.isAuthorized(clientId, userId, scope,
                function (err, authorized) {
                    if (err) {
                        return next(err);
                    } else if (authorized) {
                        req.oauth2.res = {};
                        req.oauth2.res.allow = true;
                        server._respond(req.oauth2, res, function (err) {
                            if (err) {
                                return next(err);
                            }
                            return next(new AuthorizationError('Unsupported response type: '
                                + req.oauth2.req.type, 'unsupported_response_type'));
                        });
                    } else {
                        next();
                    }
                });
        }
442878
function() {
      var authData = this.get('authData');
      if (!authData) {
        return;
      }
      var self = this;
      Parse._objectEach(this.get('authData'), function(value, key) {
        self._logOutWith(key);
      });
    }
1332932
function listAuthorizationsOnResources ({ userId, resources, organizationId, sourceIpAddress, sourcePort }, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      async.waterfall([
        function validate (next) {
          Joi.validate({ userId, resources, organizationId }, validationRules.listAuthorizationsOnResources, badRequestWrap(next))
        },
        function listPolicies (result, next) {
          policyOps.listAllUserPolicies({ userId, organizationId }, badImplementationWrap(next))
        },
        function listAuthorizationsOnResources (policies, next) {
          let context = buildContext({userId, organizationId, sourceIpAddress, sourcePort})
          iam(policies).actionsOnResources({ resources, context }, badImplementationWrap(next))
        }
      ], cb)

      return promise
    }
1057754
def file_list( blockchain_id, config_path=CONFIG_PATH, wallet_keys=None ):
    

    config_dir = os.path.dirname(config_path)
    client_config_path = os.path.join(config_dir, blockstack_client.CONFIG_FILENAME )
    proxy = blockstack_client.get_default_proxy( config_path=client_config_path )

    res = blockstack_client.data_list( blockchain_id, wallet_keys=wallet_keys, proxy=proxy )
    if 'error' in res:
        log.error("Failed to list data: %s" % res['error'])
        return {'error': 'Failed to list data'}

    listing = []

    # find the ones that this app put there 
    for rec in res['listing']:
        if not file_is_fq_data_name( rec['data_id'] ):
            continue
        
        listing.append( rec )

    return {'status': True, 'listing': listing}
58365
def index():
    """"""
    oauth = current_app.extensions['oauthlib.client']

    services = []
    service_map = {}
    i = 0

    for appid, conf in six.iteritems(
            current_app.config['OAUTHCLIENT_REMOTE_APPS']):
        if not conf.get('hide', False):
            services.append(dict(
                appid=appid,
                title=conf['title'],
                icon=conf.get('icon', None),
                description=conf.get('description', None),
                account=None
            ))
            service_map[oauth.remote_apps[appid].consumer_key] = i
            i += 1

    # Fetch already linked accounts
    accounts = RemoteAccount.query.filter_by(
        user_id=current_user.get_id()
    ).all()

    for a in accounts:
        if a.client_id in service_map:
            services[service_map[a.client_id]]['account'] = a

    # Sort according to title
    services.sort(key=itemgetter('title'))

    return render_template(
        'invenio_oauthclient/settings/index.html',
        services=services
    )
771374
private Long getAccountIdArg(Object[] arguments) {
        if (arguments.length <= ACCT_ID_INDEX) {
            log.error("Illegal number of args: " + arguments.length);
        }
        return (Long) arguments[ACCT_ID_INDEX];
    }
1088621
function listDocAsStream (opts) {
      return relax({ db: dbName, path: '_all_docs', qs: opts, stream: true })
    }