Get an account
@param  {String|Integer} accountIdOrSlug A Robin account identifier or slug
@param  {Object}         params          A querystring object
@return {Function}                       A Promise
197930
function (accountIdOrSlug, params) {
    var path;
    if (accountIdOrSlug) {
      path = this.constructPath(constants.ACCOUNTS, accountIdOrSlug);
      return this.Core.GET(path, params);
    } else {
      return this.rejectRequest('Bad Request: An account id or slug must be supplied for this operation');
    }
  }
39836
function(accountData) {
        return Promise.try(() => {
            const txn = this.db.transaction(["accountData"], "readwrite");
            const store = txn.objectStore("accountData");
            for (let i = 0; i < accountData.length; i++) {
                store.put(accountData[i]); // put == UPSERT
            }
            return txnAsPromise(txn);
        });
    }
262182
def get(self, account_id):
        
        response = self.client._make_request('/accounts/{0}'.format(account_id))
        return response.json()
817088
function fetchAuthors (forPackages, opts) {
  opts = normalizeOpts(opts)
  // start with npmUser and email from registry
  return fetchRegistry(forPackages, {}, opts)
    .then(persons => {
      // reduce duplicates and add pre-known aliases
      return reduceDuplicates(persons, opts)
    })
    .then(persons => {
      // add name, githubUser, and twitter from npm profile
      return fetchProfiles(persons, opts)
    })
    .then(persons => {
      // finish with name and email from github
      return fetchGithub(persons, opts)
    })
}
709563
function _getAuthorizationToken() {
    return spinner(
        new Promise((resolve, reject) =>
            ECR.sdk
                .getAuthorizationToken({})
                .promise()
                .then(data => {
                    if (!_.has(data, 'authorizationData.0')) {
                        reject(new Error('No authorization data found.'));
                        return;
                    }
                    resolve(data.authorizationData[0]);
                })
        )
    );
}
1083859
function (callback) {

    var promise = this.request({
      method: 'delete',
      url: 'users/authenticate'
    }).then(this.authorize.bind(this));

    if (callback) {
      promise.then(callback.bind(null, null)).fail(callback);
    }

    return promise;
  }
948483
function (appIdOrSlug, params) {
    var path = this.constructPath(constants.APPS, appIdOrSlug);
    return this.Core.GET(path, params);
  }
351632
function set(Account, roles) {

    var Role = app.models.Role;
    for (var name in roles) {
      var role = roles[name];
      var model = app.models[role.model];
      model.belongsTo(Account, {
        foreignKey: 'accountId',
        as: 'account'
      });

      model.validatesUniquenessOf('accountId');

      Account.hasOne(model, {
        foreignKey: 'accountId',
        as: name
      });

      Role.registerResolver(name, function(roleName, context, cb) {

        Promise.resolve()
          .then(function() {

            var result = context.accessToken && context.accessToken.roles && context.accessToken.roles[roleName];
            return result?true:false;

          })
          .asCallback(cb);

      });

    }

  }
123205
function(params, headers, callback) {
        var url;
        url = this.client.url(false);
        return this.client.get(url, params, headers, callback);
      }
458735
function app(bidderRequest) {
  const pubId = bidderRequest && bidderRequest.length > 0 ? bidderRequest[0].params.cp : '0';
  const appParams = bidderRequest[0].params.app;
  if (appParams) {
    return {
      publisher: {
        id: pubId.toString(),
      },
      bundle: appParams.bundle,
      storeurl: appParams.storeUrl,
      domain: appParams.domain,
    }
  }
  return null;
}
860819
def get_iam_account(l, args, user_name):
    

    iam = get_resource(args, 'iam')
    user = iam.User(user_name)
    user.load()

    return l.find_or_new_account(user.arn)
991906
function getAccountStores(application, callback) {
  var options = { expand: 'accountStore' };

  // Get account store mappings.
  application.getAccountStoreMappings(options, function (err, accountStoreMappings) {
    if (err) {
      return callback(err);
    }

    // Iterate over all account stores, and filter out the ones that
    // don't have a provider (Organizations dont have providers)
    accountStoreMappings.filter(function (accountStoreMapping, next) {
      next(!!accountStoreMapping.accountStore.provider);
    }, function (accountStoreMappings) {
      if (err) {
        return callback(err);
      }

      // Get the account store, and expand the provider so that we can
      // inspect the provider ID
      async.map(accountStoreMappings, function (accountStoreMapping, next) {
        accountStoreMapping.getAccountStore({ expand: 'provider' }, next);
      }, callback);
    });
  });
}
224049
def get_single_role(self, id, role_id, account_id, role=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - id
        """ID"""
        path["id"] = id

        # REQUIRED - PATH - account_id
        """The id of the account containing the role"""
        path["account_id"] = account_id

        # REQUIRED - role_id
        """The unique identifier for the role"""
        params["role_id"] = role_id

        # OPTIONAL - role
        """The name for the role"""
        if role is not None:
            params["role"] = role

        self.logger.debug("GET /api/v1/accounts/{account_id}/roles/{id} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/accounts/{account_id}/roles/{id}".format(**path), data=data, params=params, single_item=True)
992351
function getAccountStoreModel(accountStore) {
  var provider = accountStore.provider;

  return {
    href: accountStore.href,
    name: accountStore.name,
    provider: {
      href: provider.href,
      providerId: provider.providerId,
      callbackUri: provider.callbackUri,
      clientId: provider.clientId
    }
  };
}
1282464
function parseAccountListWithKeys(resp) {
  return new Promise((resolve, reject) => {
    const $ = cheerio.load(resp.body);
    const accounts = [];

    $('#ctl00_ContentHeaderPlaceHolder_updatePanelAccount')
      .find('option')
      .each((i, e) => {
        const texts = $(e)
          .text()
          .split('|')
          .map(t => t.trim());
        if (texts.length === 2) {
          const acc = {
            name: texts[0],
            number: texts[1].replace(/\s+/g, ''),
            key: $(e).attr('value'),
          };
          if (acc.key && acc.number && acc.name) {
            accounts.push(acc);
          }
        }
      });

    if (accounts.length > 0) {
      resolve(Object.assign({}, resp, { accounts }));
    } else {
      reject(new Error('Cannot find accounts keys'));
    }
  });
}
1208206
function doQuery(options) {
            return models.User.findOne(options.data, _.omit(options, ['data']))
                .then((model) => {
                    if (!model) {
                        return Promise.reject(new common.errors.NotFoundError({
                            message: common.i18n.t('errors.api.users.userNotFound')
                        }));
                    }

                    return {
                        users: [urlsForUser(model.id, model.toJSON(options), options)]
                    };
                });
        }
152992
def get_accounts(self, **params):
        """"""
        response = self._get('v2', 'accounts', params=params)
        return self._make_api_object(response, Account)