Registers new generator instance 'g'.
970574
def register (g):
    
    assert isinstance(g, Generator)
    id = g.id()

    __generators [id] = g

    # A generator can produce several targets of the
    # same type. We want unique occurence of that generator
    # in .generators.$(t) in that case, otherwise, it will
    # be tried twice and we'll get false ambiguity.
    for t in sequence.unique(g.target_types()):
        __type_to_generators.setdefault(t, []).append(g)

    # Update the set of generators for toolset

    # TODO: should we check that generator with this id
    # is not already registered. For example, the fop.jam
    # module intentionally declared two generators with the
    # same id, so such check will break it.

    # Some generators have multiple periods in their name, so the
    # normal $(id:S=) won't generate the right toolset name.
    # e.g. if id = gcc.compile.c++, then
    # .generators-for-toolset.$(id:S=) will append to
    # .generators-for-toolset.gcc.compile, which is a separate
    # value from .generators-for-toolset.gcc. Correcting this
    # makes generator inheritance work properly.
    # See also inherit-generators in module toolset
    base = id.split ('.', 100) [0]

    __generators_for_toolset.setdefault(base, []).append(g)

    # After adding a new generator that can construct new target types, we need
    # to clear the related cached viable source target type information for
    # constructing a specific target type or using a specific generator. Cached
    # viable source target type lists affected by this are those containing any
    # of the target types constructed by the new generator or any of their base
    # target types.
    #
    # A more advanced alternative to clearing that cached viable source target
    # type information would be to expand it with additional source types or
    # even better - mark it as needing to be expanded on next use.
    #
    # For now we just clear all the cached viable source target type information
    # that does not simply state 'all types' and may implement a more detailed
    # algorithm later on if it becomes needed.

    invalidate_extendable_viable_source_target_type_cache()
879381
private void register(PathMapping pathMapping) throws IOException {

		GeneratorRegistry generatorRegistry = bundlesHandler.getConfig().getGeneratorRegistry();
		List<PathMapping> mappings = new ArrayList<>();
		if (generatorRegistry.isPathGenerated(pathMapping.getPath())) {
			List<PathMapping> genPathMappings = generatorRegistry.getGeneratedPathMappings(pathMapping.getBundle(),
					pathMapping.getPath(), rsReader);
			if (genPathMappings != null) {
				mappings.addAll(genPathMappings);
			} else {
				mappings.add(pathMapping);
			}
		} else {
			mappings.add(pathMapping);
		}

		for (PathMapping pMapping : mappings) {
			String filePath = rsReader.getFilePath(pMapping.getPath());
			registerPathMapping(pMapping, filePath);
		}
	}
626544
private void register(String converterClassName) {

    Class<Converter> converterClass = ObjectUtils.loadClass(converterClassName);

    if (ObjectUtils.assignableTo(converterClass, Converter.class)) {
      try {
        Converter<?, ?> converter = (Converter<?, ?>) converterClass.newInstance();
        register(converter);
      }
      catch (Exception ignore) {
      }
    }
  }
415039
protected function registerControllerGenerator()
	{
		$this->app['generate.controller'] = $this->app->share(function($app)
		{
			$cache = new Cache($app['files']);
			$generator = new Generators\ControllerGenerator($app['files'], $cache);

			return new Commands\ControllerGeneratorCommand($generator);
		});
	}
398492
private VariantResolver registerResolver(VariantResolver defaultResolver, String configPropertyName) {
		VariantResolver resolver = null;
		if (configProperties.getProperty(configPropertyName) == null) {
			resolver = defaultResolver;
		} else {
			resolver = (VariantResolver) ClassLoaderResourceUtils
					.buildObjectInstance(configProperties.getProperty(configPropertyName));
		}

		this.generatorRegistry.registerVariantResolver(resolver);
		return resolver;
	}
374874
public void registerGlobal(IGlobalScope scope) {
        log.trace("Registering global scope: {}", scope.getName(), scope);
        globals.put(scope.getName(), scope);
    }
545057
protected function registerUrlGenerator()
	{
		$this->app['url'] = $this->app->share(function($app)
		{
			// The URL generator needs the route collection that exists on the router.
			// Keep in mind this is an object, so we're passing by references here
			// and all the registered routes will be available to the generator.
			$routes = $app['router']->getRoutes();

			return new UrlGenerator($routes, $app->rebinding('request', function($app, $request)
			{
				$app['url']->setRequest($request);
			}));
		});
	}
847050
def add_generator(self, generator):
        
        if generator not in self._generators and isinstance(generator,
                                                            GeneratorDing0):
            self._generators.append(generator)
            self.graph_add_node(generator)
645374
private final void add(ThreadGroup g){
        synchronized (this) {
            if (destroyed) {
                throw new IllegalThreadStateException();
            }
            if (groups == null) {
                groups = new ThreadGroup[4];
            } else if (ngroups == groups.length) {
                groups = Arrays.copyOf(groups, ngroups * 2);
            }
            groups[ngroups] = g;

            // This is done last so it doesn't matter in case the
            // thread is killed
            ngroups++;
        }
    }
829433
@CheckReturnValue
    public static <T> FluentGenerator<T> from(@Nonnull Generator<T> generator) {
        return new FluentGenerator<>(generator);
    }
1119140
public void registerFactory(String name, String groupName, Factory factory) {
        getProxyBuilder().factories.put(name, factory);
        getRegistrationGroup(groupName).add(name);
        factory.onFactoryRegistration(this, name, groupName);
    }
1341131
@GwtIncompatible("incompatible method")
    private static void register(final Object value) {
        Set<IDKey> registry = getRegistry();
        if (registry == null) {
            registry = new HashSet<>();
            REGISTRY.set(registry);
        }
        registry.add(new IDKey(value));
    }
432935
def _compile_pfgen(self):
        """"""
        string = '"""\n'
        string += 'system.dae.init_g()\n'
        for gcall, pflow, shunt, series, stagen, call in zip(
                self.gcall, self.pflow, self.shunt, self.series, self.stagen,
                self.gcalls):
            if gcall and pflow and (shunt or series) and not stagen:
                string += call
        string += '\n'
        string += 'system.dae.reset_small_g()\n'
        string += '"""'
        self.pfgen = compile(eval(string), '', 'exec')
69584
def generator_name(cls):
		
		if cls.__generator_name__ is None:
			raise ValueError('"__generator_name__" should be override in a derived class')
		if isinstance(cls.__generator_name__, str) is False:
			raise TypeError('"__generator_name__" should be a str instance')
		return cls.__generator_name__.upper()
646385
def make_copy(cls, generator):
        
        return from_commandline(
            to_commandline(generator), classname=classes.get_classname(DataGenerator()))
693604
def _register_aggregate(agg, con):
    
    nargs = number_of_arguments(agg.step) - 1  # because self
    con.connection.connection.create_aggregate(agg.__name__, nargs, agg)
1094349
def register():
    """"""
    from pelican import signals

    signals.initialized.connect(setup_git)

    signals.article_generator_finalized.connect(replace_git_url)