Utility method to register any parser. Parsers that support any type will be stored in the "generic"
        list, and the others will be stored in front of the types they support
        :return:
967509
def register_parser(self, parser: Parser):
        
        check_var(parser, var_types=Parser, var_name='parser')
        if (not parser.supports_multifile()) and (not parser.supports_singlefile()):
            # invalid
            raise _InvalidParserException.create(parser)

        # (0) sanity check : check that parser handles jokers properly
        res = parser.is_able_to_parse_detailed(desired_type=JOKER, desired_ext=JOKER, strict=True)
        if not (res[0] is True and res[1] is None):
            raise ValueError('Parser ' + str(parser) + ' can not be registered since it does not handle the JOKER cases '
                             'correctly')

        # (1) store in the main lists
        if parser.is_generic():
            self._generic_parsers.append(parser)
        else:
            self._specific_parsers.append(parser)

        # (2) simpler : simply store the ext <> type maps
        for ext in parser.supported_exts:
            for typ in parser.supported_types:
                insert_element_to_dict_of_list(self._strict_types_to_ext, typ, ext)
                insert_element_to_dict_of_list(self._ext_to_strict_types, ext, typ)
1015451
def register(cls):
    
    definition_name = make_definition_name(cls.__name__)
    REGISTRY[definition_name] = cls
    return cls
306002
private void addDefaultParsers() {
		parsers = new ArrayList<IParser>();
		parsers.add(new GeldKarteParser(this));
		parsers.add(new EmvParser(this));
	}
457430
def create_parser(self, subparsers):
        
        self.parser = subparsers.add_parser(self.name, help=self.help, parents=self.parents)
        self.add_arguments()
        self.parser.set_defaults(func=self.handle)
        return self.parser
101559
def register_subclass(cls):
    

    key = cls.interface_type, cls.resource_class

    if key in _SUBCLASSES:
        raise ValueError('Class already registered for %s and %s' % key)

    _SUBCLASSES[(cls.interface_type, cls.resource_class)] = cls

    _INTERFACE_TYPES.add(cls.interface_type)
    _RESOURCE_CLASSES[cls.interface_type].add(cls.resource_class)

    if cls.is_rc_optional:
        if cls.interface_type in _DEFAULT_RC:
            raise ValueError('Default already specified for %s' %
                             cls.interface_type)
        _DEFAULT_RC[cls.interface_type] = cls.resource_class

    return cls
61059
def add_parser_options(options: Dict[str, Dict[str, Any]], parser_id: str, parser_options: Dict[str, Dict[str, Any]],
                       overwrite: bool = False):
    
    if parser_id in options.keys() and not overwrite:
        raise ValueError('There are already options in this dictionary for parser id ' + parser_id)
    options[parser_id] = parser_options
    return options
1004386
def register_type_name(t, name):
    
    assert isinstance(t, type)
    assert isinstance(name, unicode)
    __type_names[t] = name
505604
def register_type(self, oids, name, casting):
        
        assert type(oids) is tuple
        assert isinstance(name, basestring)
        assert hasattr(casting, '__call__')
        self._register_types.append((oids, name, casting))
        psycopg2.extensions.register_type(psycopg2.extensions.new_type(oids, name, casting))
207202
def register_types(name, *types):
    

    type_names.setdefault(name, set())
    for t in types:
        # Redirecting the type
        if t in media_types:
            type_names[media_types[t]].discard(t)

        # Save the mapping
        media_types[t] = name
        type_names[name].add(t)
105850
def register_library_type(name, type_):
    
    if name in LIBRARY_TYPES:
        raise ArcticException("Library %s already registered as %s" % (name, LIBRARY_TYPES[name]))
    LIBRARY_TYPES[name] = type_
738524
def register(self, *paths, methods=None, name=None, handler=None):
        
        if isinstance(methods, str):
            methods = [methods]

        def wrapper(view):
            if handler is None:

                handler_ = view
                methods_ = methods or [METH_ANY]

                if isfunction(handler_) or ismethod(handler_):
                    handler_ = Handler.from_view(view, *methods_, name=name)

                handler_.bind(self, *paths, methods=methods_, name=name)

            else:

                view_name = view.__name__
                if not hasattr(handler, view_name):
                    setattr(handler, view_name, to_coroutine(view))
                name_ = name or view_name
                handler.bind(self, *paths, methods=methods, name=name_, view=view_name)

            return view

        # Support for @app.register(func)
        if len(paths) == 1 and callable(paths[0]):
            view = paths[0]

            if isclass(view) and issubclass(view, BaseException):
                return wrapper

            paths = []
            return wrapper(view)

        return wrapper
1318482
def register(self, *args, **kwargs):
    """"""
    if self._frozen:
      raise FrozenRegistration(self.scope, args[0])

    # Prevent further registration in enclosing scopes.
    ancestor = self._parent_parser
    while ancestor:
      ancestor._freeze()
      ancestor = ancestor._parent_parser

    if kwargs.get('type') == bool:
      default = kwargs.get('default')
      if default is None:
        # Unless a tri-state bool is explicitly opted into with the `UnsetBool` default value,
        # boolean options always have an implicit boolean-typed default. We make that default
        # explicit here.
        kwargs['default'] = not self._ensure_bool(kwargs.get('implicit_value', True))
      elif default is UnsetBool:
        kwargs['default'] = None

    # Record the args. We'll do the underlying parsing on-demand.
    self._option_registrations.append((args, kwargs))
    if self._parent_parser:
      for arg in args:
        existing_scope = self._parent_parser._existing_scope(arg)
        if existing_scope is not None:
          raise Shadowing(self.scope, arg, outer_scope=self._scope_str(existing_scope))
    for arg in args:
      if arg in self._known_args:
        raise OptionAlreadyRegistered(self.scope, arg)
    self._known_args.update(args)
82061
def register_json_encoder(self, encoder_type: type, encoder: JSONEncoder):
        
        self._json_encoders[encoder_type] = encoder
        return self
651238
public final <T> void registerType(Class<T> runtimeClass, TypeHandler<T> handler) {
        if (started) {
            // Can't add any more metrics anyway; harmless
            return;
        }
        typeHandlers.put(runtimeClass, handler);
    }
135699
public <R, W> JSONer register(Converter<R, W> converter, Class<?>... types) {
        for (Class<?> type : checkNotNull(types)) {
            typeConverts.put(type, checkNotNull(converter));
        }
        return this;
    }
1229347
def register_parser(self, type, parser, **meta):
        
        try:
            self.registered_formats[type]['parser'] = parser
        except KeyError:
            self.registered_formats[type] = {'parser': parser}
        if meta:
            self.register_meta(type, **meta)
1231031
protected function registerHttpParsers()
    {
        $this->app->singleton('Dingo\Api\Http\Parser\Accept', function ($app) {
            return new DingoHttpAcceptParser(
                config('nodes.api.settings.standardsTree'),
                config('nodes.api.settings.subtype'),
                config('nodes.api.settings.version'),
                config('nodes.api.response.defaultFormat')
            );
        });
    }