Register the Mastodon application.

Appends client_id and client_secret tp the configuration value object.
332573
public function registerApplication() 
    {
        $options = $this->config->getAppConfiguration();
        $credentials = $this->getResponse(
            '/api/'.ConfigurationVO::API_VERSION.'/apps',
            $options
        );
        if (isset($credentials["client_id"])
            && isset($credentials["client_secret"])
        ) {
            $this->config->setClientId($credentials['client_id']);
            $this->config->setClientSecret($credentials['client_secret']);
        }else {
            echo 'ERROR: no credentials in API response';
        }
    }
113079
private static boolean registerClientProtocolAddress(AvatarZooKeeperClient zk,
      Configuration originalConf, Configuration conf, boolean toOverwrite)
      throws UnsupportedEncodingException, IOException {
    LOG.info("Updating Client Address information in ZooKeeper");
    InetSocketAddress addr = NameNode.getClientProtocolAddress(conf);
    if (addr == null) {
      LOG.error(FSConstants.DFS_NAMENODE_RPC_ADDRESS_KEY
          + " for primary service is not defined");
      return true;
    }
    InetSocketAddress defaultAddr = NameNode.getClientProtocolAddress(originalConf);
    if (defaultAddr == null) {
      LOG.error(FSConstants.DFS_NAMENODE_RPC_ADDRESS_KEY
          + " for default service is not defined");
      return true;
    }
    registerSocketAddress(zk,
        originalConf.get(NameNode.DFS_NAMENODE_RPC_ADDRESS_KEY),
        conf.get(NameNode.DFS_NAMENODE_RPC_ADDRESS_KEY), toOverwrite);
    /** TODO later: need to handle alias leave it as it is now */
    registerAliases(zk, conf, FSConstants.FS_NAMENODE_ALIASES,
        conf.get(NameNode.DFS_NAMENODE_RPC_ADDRESS_KEY), toOverwrite);
    return false;
  }
112240
private void setIdAndRegister() throws IOException {
    mMasterId.set(mMasterClient.getId(mMasterAddress));
    mMasterClient.register(mMasterId.get(),
        ConfigurationUtils.getConfiguration(ServerConfiguration.global(), Scope.MASTER));
  }
855838
def register(self, portstr, username, password, pfactory):
        
        # do some basic normalization of portstrs
        if isinstance(portstr, type(0)) or ':' not in portstr:
            portstr = "tcp:%s" % portstr

        reg = Registration(self, portstr, username)

        if portstr not in self.dispatchers:
            disp = self.dispatchers[portstr] = Dispatcher(portstr)
            disp.setServiceParent(self)
        else:
            disp = self.dispatchers[portstr]

        disp.register(username, password, pfactory)

        return reg
1030938
protected function registerConfig()
    {
        // Merge project config and default package config
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/auth.php'), 'nodes.api.auth');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/errors.php'), 'nodes.api.errors');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/middleware.php'), 'nodes.api.middleware');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/response.php'), 'nodes.api.response');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/settings.php'), 'nodes.api.settings');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/throttling.php'), 'nodes.api.throttling');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/transformer.php'), 'nodes.api.transformer');

        if (! $this->app->runningInConsole() && empty(config('nodes.api.settings.prefix')) && empty(config('nodes.api.settings.domain'))) {
            throw new RuntimeException(sprintf('Unable to boot [%s], configure an API domain or prefix.', 'Nodes\Api\ServiceProvider'));
        }
    }
1295126
function register(client) {
  const appId = client.appId;
  if (registry[appId] && !registry[appId].isDestroyed) {
    registry[appId].destroy();
  }
  registry[appId] = client;

  defer(() => listeners.forEach(listener => listener(client)));
}
188562
function(appConfig, appManifest) {
			if (!!appConfig && !!appManifest) {
				_apps[appConfig.instanceId] = {
					config:appConfig,
					socket:_createContainerToAppSocket(appConfig, appManifest)
				};
			} else {
				F2.log('Unable to register socket connection. Please check container configuration.');
			}
		}
467789
def register(app_name, modules):
    
    global INSTALLED_APPS_REGISTER
    mod_list = INSTALLED_APPS_REGISTER.get(app_name, [])

    if isinstance(modules, basestring):
        mod_list.append(modules)
    elif is_iterable(modules):
        mod_list.extend(modules)

    INSTALLED_APPS_REGISTER[app_name] = mod_list
1208109
def register(self, server_info):
        """"""
        # Path relative to the server directory
        self.path = os.path.relpath(self.filename,
                                    start=server_info['notebook_dir'])

        # Replace backslashes on Windows
        if os.name == 'nt':
            self.path = self.path.replace('\\', '/')

        # Server url to send requests to
        self.server_url = server_info['url']

        # Server token
        self.token = server_info['token']

        url = url_path_join(self.server_url, 'notebooks',
                            url_escape(self.path))

        # Set file url to load this notebook
        self.file_url = self.add_token(url)
542892
protected function registerConfig()
    {
        $this->publishes([
            realpath(PLATFORM_PATH.'/config/press.php') => config_path('press.php'),
        ], 'config');

        $this->mergeConfigFrom(
            realpath(PLATFORM_PATH.'/config/press.php'), 'press'
        );

        return $this;
    }
1017513
public void register(Client client) {
        Exceptions.checkNotClosed(this.closed.get(), this);
        Preconditions.checkNotNull(client, "client");
        synchronized (this.clients) {
            if (!this.clients.contains(client)) {
                this.clients.add(client);
                client.updateGenerations(this.currentGeneration.get(), this.oldestGeneration.get());
            }
        }

        log.info("{} Registered {}.", TRACE_OBJECT_ID, client);
    }
999999
def registerContextEngineId(self, contextEngineId, pduTypes, processPdu):
        """"""
        # 4.3.2 -> no-op

        # 4.3.3
        for pduType in pduTypes:
            k = contextEngineId, pduType
            if k in self._appsRegistration:
                raise error.ProtocolError(
                    'Duplicate registration %r/%s' % (contextEngineId, pduType))

            # 4.3.4
            self._appsRegistration[k] = processPdu

        debug.logger & debug.FLAG_DSP and debug.logger(
            'registerContextEngineId: contextEngineId %r pduTypes '
            '%s' % (contextEngineId, pduTypes))
919624
def cred_init(
            self,
            *,
            secrets_dir: str,
            log: Logger,
            bot_name: str="",
    ) -> None:
        """"""
        super().__init__(secrets_dir=secrets_dir, log=log, bot_name=bot_name)

        self.ldebug("Retrieving ACCESS_TOKEN ...")
        with open(path.join(self.secrets_dir, "ACCESS_TOKEN")) as f:
            ACCESS_TOKEN = f.read().strip()

        # Instance base url optional.
        self.ldebug("Looking for INSTANCE_BASE_URL ...")
        instance_base_url_path = path.join(self.secrets_dir, "INSTANCE_BASE_URL")
        if path.isfile(instance_base_url_path):
            with open(instance_base_url_path) as f:
                self.instance_base_url = f.read().strip()
        else:
            self.ldebug("Couldn't find INSTANCE_BASE_URL, defaulting to mastodon.social.")
            self.instance_base_url = "https://mastodon.social"

        self.api = mastodon.Mastodon(access_token=ACCESS_TOKEN,
                                     api_base_url=self.instance_base_url)
        self.html_re = re.compile("<.*?>")
699191
def register(self, *args):
        """"""

        super(ConfigurableMeta, self).register(*args)
        from hfos.database import configschemastore
        # self.log('ADDING SCHEMA:')
        # pprint(self.configschema)
        configschemastore[self.name] = self.configschema
1132270
def register_url(url, handler, name=None, kwargs=None):
    
    if name is None and kwargs is None:
        app_config.urls.append((url, handler))
        return

    if name is None:
        app_config.urls.append((url, handler, kwargs))
        return

    app_config.urls.append((url, handler, kwargs, name))
996591
public void register(final long masterId, final List<ConfigProperty> configList)
      throws IOException {
    retryRPC(() -> {
      mClient.registerMaster(RegisterMasterPRequest.newBuilder().setMasterId(masterId)
          .setOptions(RegisterMasterPOptions.newBuilder().addAllConfigs(configList).build())
          .build());
      return null;
    });
  }
1016399
public void registerApp(String appId, String shuffleSecret) {
    // Always put the new secret information to make sure it's the most up to date.
    // Otherwise we have to specifically look at the application attempt in addition
    // to the applicationId since the secrets change between application attempts on yarn.
    shuffleSecretMap.put(appId, shuffleSecret);
    logger.info("Registered shuffle secret for application {}", appId);
  }