Initialise and build SDK client.
971009
public static Observable<ComapiChatClient> initialise(@NonNull final Application app, @NonNull final ChatConfig chatConfig) {

        final FoundationFactory factory = chatConfig.getFoundationFactory();
        final EventsHandler eventsHandler = factory.getAdaptingEventsHandler();
        final CallbackAdapter adapter = chatConfig.getComapiCallbackAdapter();

        return factory.getClientInstance(app, chatConfig)
                .map(client -> {
                    ComapiChatClient chatClient = new ComapiChatClient(app, client, chatConfig, eventsHandler, adapter);
                    ClientHelper.addLifecycleListener(client, chatClient.createLifecycleListener(new WeakReference<>(chatClient)));
                    return chatClient;
                });
    }
584004
def install(config):  # pragma: no cover
        """"""
        client = Client()
        client.prepare_connection()
        key_api = API(client)
        key_api.install()
1065104
def init():
    ''''''
    # Load values from config file
    config_file = os.path.realpath(os.path.join(os.getcwd(), 'swaggery.ini'))
    config = configparser.RawConfigParser(allow_no_value=True)
    config.read(config_file)
    log_level = config.get('application', 'logging_level').upper()
    api_dirs = list(config['apis'])
    do_checks = config.get('application',
                           'disable_boot_checks').lower() == 'false'
    # Set logging level
    log.setLevel(getattr(logging, log_level))
    log.debug('Log level set to {}'.format(log_level))
    # Bootstrap application
    log.debug('Exploring directories: {}'.format(api_dirs))
    application = Swaggery(api_dirs=api_dirs, do_checks=do_checks)
    return application
416211
async def async_init(self) -> None:
        """"""
        if not self._client_established:
            await self.request(
                'put',
                'clients/{0}'.format(self.client_uuid),
                data={
                    'app_id': DEFAULT_APP_ID,
                    'app_version': DEFAULT_APP_VERSION,
                    'locale': self._locale
                })
            self._client_established = True

        resp = await self.request(
            'post',
            'clients/{0}/sessions'.format(self.client_uuid),
            data={
                'email': self._email,
                'password': self._password
            })

        if not self.user_uuid:
            self.user_uuid = resp['result']['user']['user_uuid']
        self._session_expiry = resp['result']['session_expiration_timestamp']

        self.tiles = Tile(self.request, self.user_uuid)
919075
def init_app(self, app, **kwargs):
        """"""
        self.init_config(app)
        state = _AppState(app=app, cache=kwargs.get('cache'))
        app.extensions['invenio-collections'] = state
        return state
739012
@PostConstruct
    public synchronized void initialize() {
        final FwWebDirection direction = assistWebDirection();
        final SessionResourceProvider provider = direction.assistSessionResourceProvider();
        sessionSharedStorage = prepareSessionSharedStorage(provider);
        httpSessionArranger = prepareHttpSessionArranger(provider);
        showBootLogging();
    }
102038
def init_app(self, app, entry_point_group='invenio_webhooks.receivers'):
        """"""
        self.init_config(app)
        state = _WebhooksState(app, entry_point_group=entry_point_group)
        self._state = app.extensions['invenio-webhooks'] = state
675503
@PostConstruct
    public synchronized void initialize() {
        final FwWebDirection direction = assistWebDirection();
        final DoubleSubmitResourceProvider provider = direction.assistDoubleSubmitResourceProvider();
        allowsVerifyTokenBeforeValidation = provider != null && provider.allowsVerifyTokenBeforeValidation();
        showBootLogging();
    }
992922
def main(args):
  """"""

  grr_config.CONFIG.AddContext(contexts.CLIENT_BUILD_CONTEXT)

  if args.subparser_name == "generate_client_config":
    # We don't need a full init to just build a config.
    GetClientConfig(args.client_config_output)
    return

  # TODO(user): Find out if adding the client-builder context is still
  # necessary.
  context = FLAGS.context
  context.append(contexts.CLIENT_BUILD_CONTEXT)

  config_lib.SetPlatformArchContext()
  config_lib.ParseConfigCommandLine()

  # Use basic console output logging so we can see what is happening.
  logger = logging.getLogger()
  handler = logging.StreamHandler()
  handler.setLevel(logging.DEBUG if FLAGS.verbose else logging.INFO)
  logger.handlers = [handler]

  if args.subparser_name == "build":
    if grr_config.CONFIG["Client.fleetspeak_enabled"]:
      if grr_config.CONFIG.ContextApplied("Platform:Darwin"):
        if not args.fleetspeak_service_config:
          raise RuntimeError("--fleetspeak_service_config must be provided.")
        if not grr_config.CONFIG.Get("ClientBuilder.install_dir"):
          raise RuntimeError("ClientBuilder.install_dir must be set.")
        if not grr_config.CONFIG.Get("ClientBuilder.fleetspeak_plist_path"):
          raise RuntimeError("ClientBuilder.fleetspeak_plist_path must be set.")
      grr_config.CONFIG.Set("ClientBuilder.client_path",
                            "grr_response_client.grr_fs_client")
    TemplateBuilder().BuildTemplate(
        context=context,
        output=args.output,
        fleetspeak_service_config=args.fleetspeak_service_config)
  elif args.subparser_name == "repack":
    if args.debug_build:
      context.append("DebugClientBuild Context")
    result_path = repacking.TemplateRepacker().RepackTemplate(
        args.template,
        args.output_dir,
        context=context,
        sign=args.sign,
        signed_template=args.signed_template)

    if not result_path:
      raise ErrorDuringRepacking(" ".join(sys.argv[:]))
  elif args.subparser_name == "repack_multiple":

    # Resolve globs manually on Windows.
    templates = []
    for template in args.templates:
      if "*" in template:
        templates.extend(glob.glob(template))
      else:
        # This could go through glob but then we'd swallow errors for
        # non existing files.
        templates.append(template)

    repack_configs = []
    for repack_config in args.repack_configs:
      if "*" in repack_config:
        repack_configs.extend(glob.glob(repack_config))
      else:
        # This could go through glob but then we'd swallow errors for
        # non existing files.
        repack_configs.append(repack_config)

    MultiTemplateRepacker().RepackTemplates(
        repack_configs,
        templates,
        args.output_dir,
        config=FLAGS.config,
        sign=args.sign,
        signed_template=args.signed_template)
  elif args.subparser_name == "sign_template":
    repacking.TemplateRepacker().SignTemplate(
        args.template, args.output_file, context=context)
    if not os.path.exists(args.output_file):
      raise RuntimeError("Signing failed: output not written")
316822
def init_app(self, app, entry_point_group='invenio_oauth2server.scopes',
                 **kwargs):
        
        self.init_config(app)

        state = _OAuth2ServerState(app, entry_point_group=entry_point_group)

        app.extensions['invenio-oauth2server'] = state
        return state
463811
def init_app(self, app):
        """"""

        self.app = app
        self.app.apscheduler = self

        self._load_config()
        self._load_jobs()

        if self.api_enabled:
            self._load_api()
706785
def init(self):
        """"""
        self.url = self.url.format(host=self.host, port=self.port,
                                   api_key=self.api_key)
661151
def __init(self):
        """"""
        res = self._get(url=self._url,
                           param_dict={"f": "json"},
                           securityHandler=self._securityHandler,
                           proxy_url=self._proxy_url,
                           proxy_port=self._proxy_port)
        self._json_dict = res
        self._json_string = json.dumps(self._json_dict)
        for k,v in self._json_dict.items():
            setattr(self, k, v)
1173445
def init_app(self, app):
        """"""
        app.config.setdefault("SSLIFY_SUBDOMAINS", False)
        app.config.setdefault("SSLIFY_PERMANENT", False)
        app.config.setdefault("SSLIFY_SKIPS", None)

        self.hsts_include_subdomains = (
            self.hsts_include_subdomains or app.config["SSLIFY_SUBDOMAINS"]
        )
        self.permanent = self.permanent or self.app.config["SSLIFY_PERMANENT"]
        self.skip_list = self.skip_list or self.app.config["SSLIFY_SKIPS"]

        app.before_request(self.redirect_to_ssl)
        app.after_request(self.set_hsts_header)
473273
def initialize(self):
        '''
        
        '''
        if not hasattr(self.application, 'event_listener'):
            log.debug('init a listener')
            self.application.event_listener = EventListener(
                self.application.mod_opts,
                self.application.opts,
            )

        if not hasattr(self, 'saltclients'):
            local_client = salt.client.get_local_client(mopts=self.application.opts)
            self.saltclients = {
                'local': local_client.run_job_async,
                # not the actual client we'll use.. but its what we'll use to get args
                'local_async': local_client.run_job_async,
                'runner': salt.runner.RunnerClient(opts=self.application.opts).cmd_async,
                'runner_async': None,  # empty, since we use the same client as `runner`
                }

        if not hasattr(self, 'ckminions'):
            self.ckminions = salt.utils.minions.CkMinions(self.application.opts)
40043
function init() {
        // initialize the SDK with the domain where Just is running and the
        // OAuth 2.0 implicit flow parameters
        sdk = new window.JustSDK({
            domain: 'JUSTDOMAIN',
            oauth2: {
                // adapt this to point to the correct domain and path
                redirect_uri: 'https://YOURDOMAIN/browser-app-authorized.html',
                // the client ID of this app. Must have been registered at the
                // Just installation configured under 'domain' above.
                client_id: 'YOUR_CLIENT_ID',
                flow: 'implicit'
            }
        });

        var loginBtn = document.querySelector('#login');
        var logoutBtn = document.querySelector('#logout');

        loginBtn.addEventListener('click', function() {
            printInfo();
        });
        logoutBtn.addEventListener('click', function() {
            window.localStorage.removeItem('just:accessToken:' + sdk.config.domain);
            window.location.reload();
        });
        getToken(false).then(function() {
            logoutBtn.style.display = '';
            loginBtn.style.display = 'none';
            printInfo();
        }, function() {
            loginBtn.style.display = '';
            logoutBtn.style.display = 'none';
        });
    }
1009134
def build(self):
        """"""
        self.load_builtins()
        self.load_functions(self.tree)
        self.visit(self.tree)