Register a mapping of the dependent to resource name.

        After calling, dependency_register.dependents[dependent] should
        contain resource_name.
328142
def _register_dependent(self, dependent, resource_name):
        '''
        
        '''
        if dependent not in self.dependents:
            self.dependents[dependent] = []
        self.dependents[dependent].insert(0, resource_name)
1015451
def register(cls):
    
    definition_name = make_definition_name(cls.__name__)
    REGISTRY[definition_name] = cls
    return cls
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;
	}
573224
def register(cls, interface_type, resource_class):
        
        def _internal(python_class):
            if (interface_type, resource_class) in cls._session_classes:
                logger.warning('%s is already registered in the ResourceManager. '
                               'Overwriting with %s' % ((interface_type, resource_class), python_class))

            python_class.session_type = (interface_type, resource_class)
            cls._session_classes[(interface_type, resource_class)] = python_class
            return python_class
        return _internal
898857
def register_related(cls, related_name):
        

        if not hasattr(cls, '_clone_related'):
            cls._clone_related = []

        if type(cls._clone_related) != type([]):
            cls._clone_related = list(cls._clone_related)

        if not related_name in cls._clone_related:
            cls._clone_related.append(related_name)
425898
public static void register(IRegisterable<?> registerable)
	{
		ResourceLocation name = registerable.getName();
		if (name == null)
			throw new IllegalArgumentException("No name specified for registration for " + registerable.getClass().getName());
		if (!(registerable instanceof Block || registerable instanceof Item))
			throw new IllegalArgumentException("Cannot register " + registerable.getClass().getName() + " (" + name
					+ ") because it's neither a block or an item.");

		if (registerable instanceof Block)
		{
			Block block = (Block) registerable;
			ForgeRegistries.BLOCKS.register(block);
			Item item = registerable.getItem(block);
			if (item != null)
				ForgeRegistries.ITEMS.register(item);

			//register the mapper for the block and the model for the item
			if (MalisisCore.isClient())
			{
				ModelLoader.setCustomStateMapper(block, b -> ImmutableMap.of());
				if (item != null)
					EmptyModelLoader.register(item);
			}

			ClientNotificationManager.discover(block);
		}
		else if (registerable instanceof Item)
		{
			Item item = (Item) registerable;
			ForgeRegistries.ITEMS.register(item);
			if (MalisisCore.isClient())
				EmptyModelLoader.register(item);
		}
	}
744369
function registerResource( $res )
    {
        if ( is_object( $res ) )
            $this->Resources[$res->resourceName()] =& $res;
        else
            $this->warning( "registerResource()", "Supplied argument is not a resource object" );
    }
1009421
protected function registerResource()
    {
        $this->app['generate.resource'] = $this->app->share(function($app)
        {
            $generator = $this->app->make('Way\Generators\Generator');

            return new ResourceGeneratorCommand($generator);
        });

        $this->commands('generate.resource');
    }
1317241
private void registerRequirement(RuntimeRequirementRegistration requirement) {
        assert writeLock.isHeldByCurrentThread();
        CapabilityId dependentId = requirement.getDependentId();
        if (!capabilities.containsKey(dependentId)) {
            throw ControllerLogger.MGMT_OP_LOGGER.unknownCapabilityInContext(dependentId.getName(),
                    dependentId.getScope().getName());
        }
        Map<CapabilityId, Map<String, RuntimeRequirementRegistration>> requirementMap =
                requirement.isRuntimeOnly() ? runtimeOnlyRequirements : requirements;

        Map<String, RuntimeRequirementRegistration> dependents = requirementMap.get(dependentId);
        if (dependents == null) {
            dependents = new HashMap<>();
            requirementMap.put(dependentId, dependents);
        }
        RuntimeRequirementRegistration existing = dependents.get(requirement.getRequiredName());
        if (existing == null) {
            dependents.put(requirement.getRequiredName(), requirement);
        } else {
            existing.addRegistrationPoint(requirement.getOldestRegistrationPoint());
        }
        modified = true;
    }
501163
def _generate_resource_dict(self):
        
        resource_dict = {}

        resource_dict['Type'] = self.resource_type

        if self.depends_on:
            resource_dict['DependsOn'] = self.depends_on

        resource_dict.update(self.resource_attributes)

        properties_dict = {}
        for name in self.property_types:
            value = getattr(self, name)
            if value is not None:
                properties_dict[name] = value

        resource_dict['Properties'] = properties_dict

        return resource_dict
1007582
def add_dependency(id=None, name=None, dependency_id=None, dependency_name=None):
    
    data = add_dependency_raw(id, name, dependency_id, dependency_name)
    if data:
        return utils.format_json_list(data)
780014
def register(resource_class, options = {}, &block)
      config = find_or_build_resource(resource_class, options)

      # Register the resource
      register_resource_controller(config)
      parse_registration_block(config, &block) if block_given?
      reset_menu!

      # Dispatch a registration event
      ActiveSupport::Notifications.publish ActiveAdmin::Resource::RegisterEvent, config

      # Return the config
      config
    end
1014662
def register_rules(self, rules):
    
    if not isinstance(rules, Iterable):
      raise TypeError('The rules must be an iterable, given {!r}'.format(rules))

    # "Index" the rules to normalize them and expand their dependencies.
    normalized_rules = RuleIndex.create(rules).normalized_rules()
    indexed_rules = normalized_rules.rules
    union_rules = normalized_rules.union_rules

    # Store the rules and record their dependency Optionables.
    self._rules.update(indexed_rules)
    self._union_rules.update(union_rules)
    dependency_optionables = {do
                              for rule in indexed_rules
                              for do in rule.dependency_optionables
                              if rule.dependency_optionables}
    self.register_optionables(dependency_optionables)
1221484
def register_model_resource(self, resource: ModelResource):
        
        model_name = resource.Meta.model.__name__
        self.spec.add_tag({
            'name': model_name,
            'description': resource.Meta.model.__doc__,
        })

        for method in resource.methods():
            key = f'{resource.__name__}.{method}'
            if key not in unchained.controller_bundle.controller_endpoints:
                continue

            docs = {}
            http_method = method

            if method == CREATE:
                http_method = 'post'
                docs[http_method] = dict(
                    parameters=[{
                        'in': __location_map__['json'],
                        'required': True,
                        'schema': resource.Meta.serializer_create,
                    }],
                    responses={
                        '201': dict(description=getattr(resource, CREATE).__doc__,
                                    schema=resource.Meta.serializer_create),
                    },
                )
            elif method == DELETE:
                docs[http_method] = dict(
                    parameters=[],
                    responses={
                        '204': dict(description=getattr(resource, DELETE).__doc__),
                    },
                )
            elif method == GET:
                docs[http_method] = dict(
                    parameters=[],
                    responses={
                        '200': dict(description=getattr(resource, GET).__doc__,
                                    schema=resource.Meta.serializer),
                    },
                )
            elif method == LIST:
                http_method = 'get'
                docs[http_method] = dict(
                    parameters=[],
                    responses={
                        '200': dict(description=getattr(resource, LIST).__doc__,
                                    schema=resource.Meta.serializer_many),
                    },
                )
            elif method == PATCH:
                docs[http_method] = dict(
                    parameters=[{
                        'in': __location_map__['json'],
                        'required': False,
                        'schema': resource.Meta.serializer,
                    }],
                    responses={
                        '200': dict(description=getattr(resource, PATCH).__doc__,
                                    schema=resource.Meta.serializer),
                    },
                )
            elif method == PUT:
                docs[http_method] = dict(
                    parameters=[{
                        'in': __location_map__['json'],
                        'required': True,
                        'schema': resource.Meta.serializer,
                    }],
                    responses={
                        '200': dict(description=getattr(resource, PUT).__doc__,
                                    schema=resource.Meta.serializer),
                    },
                )

            docs[http_method]['tags'] = [model_name]
            display_name = title_case(model_name)
            if method == LIST:
                display_name = pluralize(display_name)
            docs[http_method]['summary'] = f'{http_method.upper()} {display_name}'

            routes = unchained.controller_bundle.controller_endpoints[key]
            for route in routes:
                for rule in self.app.url_map.iter_rules(route.endpoint):
                    self.spec.add_path(app=self.app, rule=rule, operations=docs,
                                       view=route.view_func)
948148
def register(cls, key, filename):
        """"""

        if key in cls._stock:
            logger.info('Warning, replacing resource ' + str(key))
        cls._stock[key] = {'type': 'custom', 'filename': filename}
        logger.info('%s registered as %s' % (filename, key))
861198
def ensure_dependent_names_existence(associates_names, dependent_associate_names)
      dependent_associate_names.each do |dependent_name|
        unless associates_names.include?(dependent_name)
          raise NameError, "undefined associated model '#{dependent_name}' for #{name}(#{object_id})"
        end
      end
    end
209714
def add_dependency(self, depend):
        """"""
        try:
            self._add_child(self.depends, self.depends_set, depend)
        except TypeError as e:
            e = e.args[0]
            if SCons.Util.is_List(e):
                s = list(map(str, e))
            else:
                s = str(e)
            raise SCons.Errors.UserError("attempted to add a non-Node dependency to %s:\n\t%s is a %s, not a Node" % (str(self), s, type(e)))