@name Account
@description constructor

@returns function that cane make the API calls.
357919
function Account (coinjar) {
  var self = this;
  self.coinjar = coinjar;

  return function(callback) {
    get.call(self, callback);
  };
}
86049
def create_account(self, **params):
        """"""
        response = self._post('v2', 'accounts', data=params)
        return self._make_api_object(response, Account)
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
    }
  };
}
741245
def show_account():
    
    click.echo("# tonomi api")
    for (key, env) in REVERSE_MAPPING.items():
        value = QUBELL.get(key, None)
        if value:
            click.echo("export %s='%s'" % (env, value))
    if any(map(lambda x: PROVIDER.get(x), REVERSE_PROVIDER_MAPPING.keys())):
        click.echo("# cloud account")
        for (key, env) in REVERSE_PROVIDER_MAPPING.items():
            value = PROVIDER.get(key, None)
            if value:
                click.echo("export %s='%s'" % (env, value))
1215480
function(name,options) {
    var cls = new Class(name,options);
    var custom = new Class("CustomError",{
      inherits: Error,
      constructor: function(message) {
        this.name = name;
        this.message = message;
      },
    })
    cls.inherit(custom);
    return cls.toFunction();
  }
1373255
def account(self):
        
        j, _ = self.request('GET', '')
        if 'login' in j and self.login == 'my':
            self.login = j['login']
        return j
1339197
function (account, cb) {

		Stripeaccount.findOrCreate(account.id, account)
	    .exec(function (err, foundAccount){
	      if (err) return cb(err);
	      Stripeaccount.update(foundAccount.id, account)
	      .exec(function(err, updatedAccounts){
	      	if (err) return cb(err);
	      	cb(null, updatedAccounts[0]);
	      });
	    });
	}
746701
function (name) {
			return function (args, onDone) {
				
				if (typeof args === 'function') {
					onDone = args;
					args = {};
				}
				
				console.log('calling API [' + name + ']...');
				
				// NOTE: by default callbacks are always kept
				SR.sendEvent(name, args, function (result) {
					if (result.err) {
						console.error(result.err);
						return SR.safeCall(onDone, result.err);
					}
					
					SR.safeCall(onDone, null, result.result);
				}, undefined, true);
			}
		}
1159367
function (account) {
	
	// get all local accounts & perform login
	var onDone = function (err, data) {
		if (err) {
			LOG.warn(err.toString());
		}
		else {
			for (var server in data.accounts) {
				LOG.warn('local server: ' + server);

				var user_list = data.accounts[server];
				for (var uid in user_list) {
					var token = user_list[uid];
					LOG.warn('local uid: ' + uid + ' token: ' + token);
					l_send_remote_login(server, uid, token);	
				}
			}
		}
	};
	SR.User.getUser(account, onDone);
}
60589
@RequestMapping(value = "{accountId}", method = RequestMethod.GET)
    public Account getAccount(@PathVariable ID accountId) {
        return accountService.getAccount(accountId);
    }
1352514
function(account, password, internationalApiKey) {
    this.account = account;
    Object.defineProperties(this, {
        password: {
            writable: true,
            enumerable: false,
            configurable: false,
            value: password
        },
        apiKey: {
            writable: true,
            enumerable: false,
            configurable: false,
            value: internationalApiKey
        }
    });
}
292991
function accountInfo(callback) {
    var path  = '/' + config.version + '/account/info.php';
    var params = {};
    return apiMethod(path, params, callback);
  }
1219807
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof OnlineAccount)){
    return new OnlineAccount(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(OnlineAccount.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
1160893
function oneBroker(api_key) {
  var self = this;
  var config = {
    url: 'https://www.1broker.com/api',
    version: 'v1',
    api_key: api_key,
    timeoutMS: 10000
  };
  /**
  * Private methods supported
  * For information on the parameters, check 1broker website https://1broker.com/?c=api_documentation
  */

  /* Account */
  function accountInfo(callback) {
    var path  = '/' + config.version + '/account/info.php';
    var params = {};
    return apiMethod(path, params, callback);
  }
  function accountAddress(callback) {
    var path  = '/' + config.version + '/account/bitcoindepositaddress.php';
    var params = {};
    return apiMethod(path, params, callback);
  }
  /* Orders */

  // Coming soon //

  /* Position */
  function positionList(callback) {
    var path  = '/' + config.version + '/position/list_open.php';
    var params = {};
    return apiMethod(path, params, callback);
  }
  function positionEdit(position_id, callback) {
    var path  = '/' + config.version + '/position/list_open.php';
    var params = {};
    return apiMethod(path, params, callback);
  }
  /* Market Data */
  function marketList(callback) {
    var path  = '/' + config.version + '/market/list.php';
    var params = {};
    return apiMethod(path, params, callback);
  }
  function marketDetail(symbol, callback) {
    var path  = '/' + config.version + '/market/detail.php';
    var params = "symbol="+symbol;
    return apiMethod(path, params, callback);
  }
  function marketQuotes(symbols, callback) {
    var path  = '/' + config.version + '/market/quotes.php';
    var params = "symbols="+symbols;
    return apiMethod(path, params, callback);
  }
  /**
   * This method makes a private API request.
   * @param  {String}   path   The path to the API method
   * @param  {Object}   params   String of arguments to pass to the api call
   * @param  {Function} callback A callback function to be executed when the request is complete
   * @return {Object}            The request object
   */
  function apiMethod(path, params, callback) {
    var url    = config.url + path + '?token=' + config.api_key;
    if(params) url = url+= '&'+params;
    return apiRequest(url, callback);
  }
  /**
   * This method sends the actual HTTP request
   * @param  {String}   url      The URL to make the request
   * @param  {String}   requestType   POST or GET
   * @param  {Object}   params   POST or GET body
   * @param  {Function} callback A callback function to call when the request is complete
   * @return {Object}            The request object
   */
  function apiRequest(url, callback) {
    var options = {
      url: url,
      method: 'GET',
			timeout: config.timeoutMS,
      maxAttempts: 3,
      retryDelay: 2000,  // (default) wait for 2s before trying again
      retryStrategy: request.RetryStrategies.HTTPOrNetworkError // (default) retry on 5xx or network errors
    };

    var req = request(options, function(error, response, body) {
      if(typeof callback === 'function') {
        var data;
        if(error) {
          callback.call(self, new Error('Error in server response: ' + JSON.stringify(error)), null);
          return;
        }
        try {
          data = JSON.parse(body);
          if(data.error != false){
            callback.call(self, new Error('API error.'), null);
          } else {
            // All good.
            callback.call(self,null,data.response);
          }
        }
        catch(e) {
          callback.call(self, new Error('Could unknown server response occured.'), null);
          return;
        }
      }
    });

    return req;
  }

  self.accountInfo = accountInfo;
  self.accountAddress = accountAddress;
  self.positionList = positionList;
  self.positionEdit = positionEdit;
  self.marketList = marketList;
  self.marketDetail = marketDetail;
  self.marketQuotes = marketQuotes;
}
663380
function createAccount() {

  var acct = {
    givenName: 'Jean-Luc',
    surname: 'Picard',
    username: unique('jlpicard'),
    email: accountEmail,
    password: 'Changeme1!'
  };

  return application.createAccount(acct, function(err, createdAccount) {
    if (err) throw err;
    account = createdAccount;
    console.log('Created account:');
    console.log(account);
    return updateAccount(); //next quickstart step
  });
}
884595
function (DB_name, account, pass, onOpenDone) {

		var conn = SR._storage.openDB(DB_name, dbSetting.serverIP, dbSetting.serverPort);

		// load fail
		if (conn === undefined) {
			LOG.error('cannot open DB: ' + DB_name, 'SR.DB');
			return onOpenDone(false);
		}

		// open DB & load the collection data from DB
		conn.open(function (err, client) {

			// check if error
			if (err) {
				LOG.error(err, 'SR.DB');
				return UTIL.safeCall(onOpenDone, false);
			}

			var user_created = false;

			var auth_user = function () {

				// authenticate into the DB
				LOG.sys('authenticating DB [' + DB_name + ']...', 'SR.DB');

				// NOTE: use client.admin().authenticate will force using admin account
				//	   but in general we should not do that

				client.authenticate(account, pass, function (err, replies) {

					if (err) {

						// if this is repeated call
						if (user_created === true) {
							LOG.error(err, 'SR.DB');
							LOG.warn('DB authentication failure', 'SR.DB');
							return UTIL.safeCall(onOpenDone, false);
						}

						// create DB user/pass (assume it's a new DB)
						LOG.warn('auth error, assume DB does not exist, try to create new DB...', 'SR.DB');

						// NOTE: right now this action is always successful, so it's like no auth exists
						//	   might be a bug in MongoDB
						user_created = true;

						client.admin().authenticate(SR.Settings.DB_ADMIN.account, SR.Settings.DB_ADMIN.pass, function (err, replies) {
							if (err) {
								LOG.error(err, 'SR.DB');
								LOG.error('DB admin auth failure, please make sure DB_ADMIN is setup correctly either in system or project setting', 'SR.DB');
								return UTIL.safeCall(onOpenDone, false);
							}

							client.addUser(account, pass, function (err, result) {

								if (err) {
									LOG.error(err, 'SR.DB');
									LOG.warn('DB addUser failure', 'SR.DB');
									return UTIL.safeCall(onOpenDone, false);
								}

								LOG.warn('DB addUser success, re-authenticate', 'SR.DB');
								auth_user();
							});
						});

						return;
					}

					LOG.warn('DB authentication success', 'SR.DB');

					// store client for later access
					l_DBconn[DB_name] = conn;
					l_DBclient[DB_name] = client;
					UTIL.safeCall(onOpenDone, true);
				});
			}

			// perform first DB authentication
			auth_user();
		});
	}
1219209
def set_primary_account(self, account_id, **params):
        """"""
        response = self._post('v2', 'accounts', account_id, 'primary', data=params)
        return self._make_api_object(response, Account)