Load account.

@param string $account

@throws InvalidConfigException

@return Application
499055
public function account($account)
    {
        if (isset($this->accounts[$account])) {
            return $this->accounts[$account];
        }

        if (!isset($this['config']['account'][$account])) {
            throw new InvalidConfigException('This account not exist.');
        }

        return $this->accounts[$account] = new self(
            array_merge($this['config']->all(), $this['config']['account'][$account])
        );
    }
1294664
public static function load($params = null)
    {
        if (!isset(self::$_instance)) {
            self::$_instance = new Email($params);
        }

        return self::$_instance;
    }
1306371
public function load(InputInterface $input): ConfigInterface
    {
        $configFile = $input->getOption('config');
        if (!$configFile || !$this->filesystem->fileExists($configFile)) {
            throw InvalidArgumentException::invalidConfigFile();
        }
        $config = include $configFile;
        if (!$config instanceof ConfigInterface) {
            throw InvalidArgumentException::invalidConfigFile();
        }

        return $config;
    }
858468
public function getAccount()
    {
        $response = $this->rest->get(
            static::ACCOUNT_PATH
        );

        $this->checkResponse($response);

        return new Account($response);
    }
768690
public function blackAdd($account)
    {
        $request = new AddBlackRequest($this->identifier, $account);
        $response = new BaseResponse();
        return $this->client->sendRequest($request, $response);
    }
414155
public function register(Application $app)
    {
        $app['accounts.service'] = $app->share(function () use ($app) {
            return new AccountService(
                $app['authentication'],
                $app['auth.password-encoder'],
                $app['dispatcher'],
                $app['orm.em'],
                $app['model.user-manager'],
                $app['manipulator.user'],
                $app['repo.users']
            );
        });
    }
786329
public function addAccount(Account $account)
    {
        $this->accounts->add($account);
        $account->addOrganization($this);

        return $this;
    }
600777
public function setAccount(ApiAccount $account)
    {
        $account->addTokens($this);

        $this->account = $account;

        return $this;
    }
305947
public static function load($params = null)
    {
        if (!isset(self::$_instance)) {
            self::$_instance = new Auth($params);
        }

        return self::$_instance;
    }
17883
public function open()
    {
        if ($this->manager === null) {
            if (empty($this->dsn)) {
                throw new InvalidConfigException($this->className() . '::dsn cannot be empty.');
            }
            $token = 'Opening MongoDB connection: ' . $this->dsn;
            try {
                Yii::trace($token, __METHOD__);
                Yii::beginProfile($token, __METHOD__);
                $options = $this->options;

                $this->manager = new Manager($this->dsn, $options, $this->driverOptions);
                $this->manager->selectServer($this->manager->getReadPreference());

                $this->initConnection();
                Yii::endProfile($token, __METHOD__);
            } catch (\Exception $e) {
                Yii::endProfile($token, __METHOD__);
                throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
            }

            $this->typeMap = array_merge(
                $this->typeMap,
                [
                    'root' => 'array',
                    'document' => 'array'
                ]
            );
        }
    }
380503
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('account.xml');
        $loader->load('api.xml');

        if ($config['ade_accounts']) {
            $this->loadAdeAccounts($container, $config['ade_accounts']);
        }

        if (isset($config['track_accounts'])) {
            $this->loadTrackAccounts($container, $config['track_accounts']);
        }
    }
743472
public function updateAccount(Account $account)
    {
        $response = $this->rest->post(
            static::ACCOUNT_PATH,
            $account->toUpdateParams()
        );

        $this->checkResponse($response);

        return $account->fromResponse($response);
    }
1330326
public function loadOwnSites(AccountInterface $account)
    {
        $roles = $this->getAccess()->getUserRoles($account);

        return $this->getStorage()->loadAll(array_keys($roles));
    }
270251
public function load($username): UserInterface
    {
        $grav = Grav::instance();
        /** @var UniformResourceLocator $locator */
        $locator = $grav['locator'];

        // force lowercase of username
        $username = mb_strtolower($username);

        $filename = 'account://' . $username . YAML_EXT;
        $path = $locator->findResource($filename) ?: $locator->findResource($filename, true, true);
        $file = CompiledYamlFile::instance($path);
        $content = (array)$file->content() + ['username' => $username, 'state' => 'enabled'];

        $userClass = $this->className;
        $callable = function() {
            $blueprints = new Blueprints;

            return $blueprints->get('user/account');
        };

        /** @var UserInterface $user */
        $user = new $userClass($content, $callable);
        $user->file($file);

        return $user;
    }
156768
def _load_account(self, acct_id, acct_dir_path):
        """"""
        # setup a default config dict for the account
        self._config[acct_id] = {
            'name': None,
            'role_name': DEFAULT_ROLE_NAME,
            'regions': {}
        }
        # read the account config file
        # @TODO unhandled exception if file doesn't exist or isn't JSON
        with open(os.path.join(acct_dir_path, 'config.json'), 'r') as fh:
            acct_conf = json.loads(fh.read())
        # overwrite defaults with what we read from the account JSON
        self._config[acct_id].update(acct_conf)
        # iterate over contents of the per-account directory
        for region_name in os.listdir(acct_dir_path):
            path = os.path.join(acct_dir_path, region_name)
            # skip anything that isn't a directory
            if not os.path.isdir(path):
                continue
            # load the per-region configs for the account...
            # @TODO - should check that it's a valid region name
            self._load_region(acct_id, region_name, path)
1045390
public function setService($account = null) {
        if (!empty($account)) {
            $this->setData('TransInfo', [
                'KfAccount' => [
                    '@cdata' => $account
                ]
            ]);
        }
        return $this->setType(MessageEnum::Service);
    }
1195322
public static function make($account = null, $clientId = null, $clientSecret = null)
    {
        return new static($account, $clientId, $clientSecret);
    }