Register the subscriptions for extensions that have them.
191529
public function registerSubscriptions(EventDispatcher $dispatcher)
    {
        if ($this->registered) {
            throw new \RuntimeException('Cannot register debug toolbar subscriptions when already registered.');
        }

        foreach ($this->toolbar->getExtensions() as $extension) {
            if ( ! $extension instanceof EventSubscriberInterface) {
                continue;
            }

            $dispatcher->addSubscriber($extension);
        }

        $this->registered = true;
    }
607174
protected function registerServiceProviders()
    {
        foreach ($this->serviceProviders[$this->flare->compatibility()] as $class) {
            $this->app->register($class);
        }
    }
1021848
def register(template_class,*extensions):
		'''  '''
		for ext in extensions:
			ext = normalize(ext)
			if not Lean.template_mappings.has_key(ext):
				Lean.template_mappings[ext] = []

			Lean.template_mappings[ext].insert(0,template_class)
			Lean.template_mappings[ext] = unique(Lean.template_mappings[ext])
191842
public void registerExtension(ExtensionNamespaceSupport extNsSpt)
  {
    String namespace = extNsSpt.getNamespace();
    if (namespaceIndex(namespace, m_extensions) == -1)
    {
      m_extensions.add(extNsSpt);
      if (m_unregisteredExtensions.contains(namespace))
        m_unregisteredExtensions.remove(namespace);
    }
    
  }
1335308
private function registerListeners(): void
    {
        Event::listen(ReactionHasBeenAdded::class, IncrementAggregates::class);
        Event::listen(ReactionHasBeenRemoved::class, DecrementAggregates::class);
    }
523624
@Transactional
	public void register(Subscription subscription) {
		Endpoint versionsEndpoint = subscription.getEndpoint(ModuleIdentifier.VERSIONS);
		if (versionsEndpoint == null) {
			return;
		}

		LOG.info("Registering, get versions from endpoint " + versionsEndpoint.getUrl());
		Version version = findHighestMutualVersion(
				getVersions(versionsEndpoint.getUrl(), subscription.getPartnerAuthorizationToken()));

		LOG.info("Registering, get versiondetails at " + version.url);
		VersionDetails versionDetails = getVersionDetails(version.url, subscription.getPartnerAuthorizationToken());
		// store version and endpoints for this subscription
		subscription.setOcpiVersion(version.version);

		for (io.motown.ocpi.dto.Endpoint endpoint : versionDetails.endpoints) {

			subscription.addToEndpoints(new Endpoint(endpoint.identifier, endpoint.url.toString()));
			// because the endpoints in 'versionInformationResponse' are not
			// DTO's (yet) we must instantiate ModuleIdentifier from value
		}

		// if not present generate a new token
		if (subscription.getAuthorizationToken() == null) {
			subscription.generateNewAuthorizationToken();
		}
		ocpiRepository.insertOrUpdate(subscription);

		Credentials credentials = postCredentials(subscription);
		if (credentials.token != null) { // if no token update do not overwrite
			// existing partner token!
			LOG.debug("Updating partnerToken with: " + credentials.token);
			subscription.setPartnerAuthorizationToken(credentials.token);
			// at this point we can safely remove the versionsEndpoint
			LOG.info("REMOVING VERIONS-ENDPOINT");
			subscription.getEndpoints().remove(versionsEndpoint);

			ocpiRepository.insertOrUpdate(subscription);
		}
	}
651062
public void register(XExtension extension) {
                extensionMap.put(extension.getUri(), extension);
                // replace the registered index in the list with the new extension.
                int i = extensionList.indexOf(extension);
                if (i < 0) {
                        extensionList.add(extension);
                } else {
                        extensionList.remove(i);
                        extensionList.add(i, extension);
                }
        }
1158484
private void registerAbilities() {
    try {
      // Collect all classes that implement AbilityExtension declared in the bot
      List<AbilityExtension> extensions = stream(getClass().getMethods())
          .filter(checkReturnType(AbilityExtension.class))
          .map(returnExtension(this))
          .collect(Collectors.toList());

      // Add the bot itself as it is an AbilityExtension
      extensions.add(this);

      // Extract all abilities from every single extension instance
      abilities = extensions.stream()
          .flatMap(ext -> stream(ext.getClass().getMethods())
              .filter(checkReturnType(Ability.class))
              .map(returnAbility(ext)))
          // Abilities are immutable, build it respectively
          .collect(ImmutableMap::<String, Ability>builder,
              (b, a) -> b.put(a.name(), a),
              (b1, b2) -> b1.putAll(b2.build()))
          .build();

      // Extract all replies from every single extension instance
      Stream<Reply> extensionReplies = extensions.stream()
          .flatMap(ext -> stream(ext.getClass().getMethods())
              .filter(checkReturnType(Reply.class))
              .map(returnReply(ext)));

      // Replies can be standalone or attached to abilities, fetch those too
      Stream<Reply> abilityReplies = abilities.values().stream()
          .flatMap(ability -> ability.replies().stream());

      // Now create the replies registry (list)
      replies = Stream.concat(abilityReplies, extensionReplies).collect(
          ImmutableList::<Reply>builder,
          Builder::add,
          (b1, b2) -> b1.addAll(b2.build()))
          .build();
    } catch (IllegalStateException e) {
      BotLogger.error(TAG, "Duplicate names found while registering abilities. Make sure that the abilities declared don't clash with the reserved ones.", e);
      throw propagate(e);
    }
  }
1097835
protected function registerServices()
    {
        foreach ($this->serviceBindings as $key => $value) {
            is_numeric($key)
                    ? $this->app->singleton($value)
                    : $this->app->singleton($key, $value);
        }
    }
1294143
private function registerStreams()
    {
        foreach ($this->_streamWrappers as $wrappers) {
            foreach ($wrappers as $wrapper) {
                if (false === in_array($wrapper['protocol'], $this->_availableWrappers)) {
                    stream_wrapper_register($wrapper['protocol'], $wrapper['classname']);
                    $this->_availableWrappers = stream_get_wrappers();
                }
            }
        }
    }
1052683
private function registerTwigExtensions()
    {
        foreach ($this->app->getSetting('twig_extensions', []) as $extension) {
            $this->twig->addExtension(new $extension($this));
        }
    }
228858
void register(Object listener) {
    Multimap<Class<?>, Subscriber> listenerMethods = findAllSubscribers(listener);

    for (Map.Entry<Class<?>, Collection<Subscriber>> entry : listenerMethods.asMap().entrySet()) {
      Class<?> eventType = entry.getKey();
      Collection<Subscriber> eventMethodsInListener = entry.getValue();

      CopyOnWriteArraySet<Subscriber> eventSubscribers = subscribers.get(eventType);

      if (eventSubscribers == null) {
        CopyOnWriteArraySet<Subscriber> newSet = new CopyOnWriteArraySet<Subscriber>();
        eventSubscribers =
            MoreObjects.firstNonNull(subscribers.putIfAbsent(eventType, newSet), newSet);
      }

      eventSubscribers.addAll(eventMethodsInListener);
    }
  }
325833
public function register($subscribers)
    {
        is_array($subscribers) || $subscribers = [$subscribers];

        foreach ($subscribers as $subscriber) {
            $this->registerSubscriber($subscriber);
        }
    }
111248
def _add_subscribers_for_type(self, callback_type, subscribers, callbacks, **kwargs):
        '''  '''
        for subscriber in subscribers:
            callback_name = 'on_' + callback_type
            if hasattr(subscriber, callback_name):
                _function = functools.partial(getattr(subscriber, callback_name), **kwargs)
                callbacks.append(_function)
1251926
public boolean register( String clientID , String subscriptionName )
	{
		String key = clientID+"-"+subscriptionName;
		synchronized (subscriptions)
		{
			if (subscriptions.containsKey(key))
				return false;
			
			subscriptions.put(key, new DurableTopicSubscription(System.currentTimeMillis(),
					                                            clientID,
					                                            subscriptionName));
			return true;
		}
	}
905040
function registerExtension(ext) {
  var old = oldHandlers[ext] || oldHandlers[".js"] || require.extensions[".js"];

  var loader = normalLoader;
  if (process.env.running_under_istanbul) loader = istanbulLoader;

  require.extensions[ext] = function (m, filename) {
    if (shouldIgnore(filename)) {
      old(m, filename);
    } else {
      loader(m, filename, old);
    }
  };
}
633869
function registerExtension(name, extension, options, mergeConfig) {
  var params = name;

  if (!isObject(name)) {
    params = {};
    params[name] = {
      extension: extension,
      options: options
    };
  }

  each(params, function (v, name) {
    if (v) {
      var _extension = v.extension,
          _options3 = v.options;

      if (_extension) {
        extensions[name] = _extension;
      } else if (!mergeConfig) {
        extensions[name] = v;
      }

      if (mergeConfig) {
        if (!extensionConfig[name]) {
          extensionConfig[name] = _config();
        }

        assign(extensionConfig[name], _options3);
      } else {
        extensionConfig[name] = _config(_options3);
      }
    }
  }, false);
}