Create an external account
    @param name: Immutable external account name
    @param display_name: Display name
    @param type_name: Account type
    @param account_configs: Optional account configuration
    @return: An ApiExternalAccount object
963077
def create_external_account(self, name, display_name, type_name,
                              account_configs=None):
    
    return external_accounts.create_external_account(
      self, name, display_name, type_name, account_configs)
1293955
def create_azure_storage_credentials(config, general_options):
    # type: (dict, blobxfer.models.options.General) ->
    #        blobxfer.operations.azure.StorageCredentials
    
    creds = blobxfer.operations.azure.StorageCredentials(general_options)
    endpoint = config['azure_storage'].get('endpoint') or 'core.windows.net'
    for name in config['azure_storage']['accounts']:
        key = config['azure_storage']['accounts'][name]
        creds.add_storage_account(name, key, endpoint)
    return creds
288264
def user_by_external_id_and_provider(
        cls, external_id, provider_name, db_session=None
    ):
        
        db_session = get_db_session(db_session)
        query = db_session.query(cls.models_proxy.User)
        query = query.filter(cls.model.external_id == external_id)
        query = query.filter(cls.model.provider_name == provider_name)
        query = query.filter(cls.models_proxy.User.id == cls.model.local_user_id)
        return query.first()
1182550
def set_display_name(self, display_name):
        
        self.displayname = display_name
        return self.api.set_display_name(self.user_id, display_name)
984506
def create_from_label_monetary_account(cls, label_monetary_account):
        

        instance = cls.__new__(cls)
        instance.label_monetary_account = label_monetary_account
        instance.pointer = Pointer()
        instance.pointer._name = label_monetary_account.display_name
        instance.pointer._type_ = cls._POINTER_TYPE_IBAN
        instance.pointer._value = label_monetary_account.iban

        return instance
1060019
public static function createExternalAccount($id, $params = null, $opts = null)
    {
        return self::_createNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts);
    }
577666
def create_identity(self, user, sp_mapping, **extra_config):
        

        return {
            out_attr: getattr(user, user_attr)
            for user_attr, out_attr in sp_mapping.items()
            if hasattr(user, user_attr)
        }
1112401
def create_user(name,
                username,
                email,
                password,
                token_manager=None,
                app_url=defaults.APP_URL):
    
    headers = token_manager.get_access_token_headers()
    auth_url = environment.get_auth_url(app_url=app_url)
    url = "%s/api/v1/accounts" % auth_url

    payload = {
        'name': name,
        'username': username,
        'email': email,
        'password': password
    }

    response = requests.post(url,
                             data=json.dumps(payload),
                             headers=headers)

    if response.status_code == 201:
        return response.json()

    else:
        raise JutException('Error %s: %s' % (response.status_code, response.text))
663221
def delete_external_account(resource_root, name):
  
  return call(resource_root.delete,
      EXTERNAL_ACCOUNT_FETCH_PATH % ("delete", name,),
      ApiExternalAccount, False)
153011
public void createAccount() {
    mAccount = new AccountFactory(mAccountConfig).setHttpClient(httpclient).createAccount();
    mAccess = mAccount.getAccess();
    if (mRegion != null) {
      mAccess.setPreferredRegion(mRegion);
    }
  }
5004
def update_external_account(resource_root, account):
  
  return call(resource_root.put,
      EXTERNAL_ACCOUNT_PATH % ("update",),
      ApiExternalAccount, False, data=account)
767179
def by_external_id_and_provider(cls, external_id, provider_name, db_session=None):
        
        db_session = get_db_session(db_session)
        query = db_session.query(cls.model)
        query = query.filter(cls.model.external_id == external_id)
        query = query.filter(cls.model.provider_name == provider_name)
        return query.first()
1131505
public String createPolicyRuleForExternalId(ComponentService componentService, ExternalId externalId, String policyName) throws IntegrationException {
        Optional<ComponentVersionView> componentVersionView = componentService.getComponentVersion(externalId);
        if (!componentVersionView.isPresent()) {
            throw new BlackDuckIntegrationException(String.format("The external id (%s) provided could not be found, so no policy can be created for it.", externalId.createExternalId()));
        }

        PolicyRuleExpressionSetBuilder builder = new PolicyRuleExpressionSetBuilder();
        builder.addComponentVersionCondition(PolicyRuleConditionOperatorType.EQ, componentVersionView.get());
        PolicyRuleExpressionSetView expressionSet = builder.createPolicyRuleExpressionSetView();

        PolicyRuleView policyRuleView = new PolicyRuleView();
        policyRuleView.setName(policyName);
        policyRuleView.setEnabled(true);
        policyRuleView.setOverridable(true);
        policyRuleView.setExpression(expressionSet);

        return createPolicyRule(policyRuleView);
    }
528555
def auth(self, transport, account_name, password):
        
        auth_token = AuthToken()
        auth_token.account_name = account_name

        attrs = {sconstant.A_BY: sconstant.V_NAME}
        account = SOAPpy.Types.stringType(data=account_name, attrs=attrs)

        params = {sconstant.E_ACCOUNT: account,
                  sconstant.E_PASSWORD: password}

        self.log.debug('Authenticating account %s' % account_name)
        try:
            res = transport.invoke(zconstant.NS_ZIMBRA_ACC_URL,
                                   sconstant.AuthRequest,
                                   params,
                                   auth_token)
        except SoapException as exc:
            raise AuthException(unicode(exc), exc)

        auth_token.token = res.authToken
        
        if hasattr(res, 'sessionId'):
            auth_token.session_id = res.sessionId

        self.log.info('Authenticated account %s, session id %s'
                      % (account_name, auth_token.session_id))

        return auth_token
713793
def external_account_cmd_by_name(self, command_name):
    
    return self._cmd(command_name, data=self.name, api_version=16)
354920
def newaccount(ctx, accountname, account, password):
    
    pprint(
        ctx.peerplays.create_account(accountname, registrar=account, password=password)
    )
831840
def _get_external_id(account_info):
    """"""
    if all(k in account_info for k in ('external_id', 'external_method')):
        return dict(id=account_info['external_id'],
                    method=account_info['external_method'])
    return None