# jsonargparse 4.53.0 (MIT), harvested by tools/harvest_corpus.py
=== input
Adds a custom instantiator for a class type, globally for all ``ArgumentParser.instantiate`` calls.

    Prefer the ``instantiators`` parameter of ``instantiate``, which is limited to that call.

    Instantiator functions are expected to have as signature ``(class_type:
    Type[ClassType], *args, **kwargs) -> ClassType``.

    For reference, the default instantiator is ``return class_type(*args,
    **kwargs)``.

    In some use cases, the instantiator function might need access to values
    applied by instantiation links. For this, the instantiator function can
    have an additional keyword parameter ``applied_instantiation_links:
    dict``. This parameter will be populated with a dictionary having as
    keys the targets of the instantiation links and corresponding values
    that were applied.

    Args:
        instantiator: Function that instantiates a class.
        class_type: The class type to instantiate.
        subclasses: Whether to instantiate subclasses of ``class_type``.
        prepend: Whether to prepend the instantiator to the existing instantiators.
    
=== parse google
short_description: 'Adds a custom instantiator for a class type, globally for all ``ArgumentParser.instantiate`` calls.'
long_description: |
  Prefer the ``instantiators`` parameter of ``instantiate``, which is limited to that call.
  
  Instantiator functions are expected to have as signature ``(class_type:
  Type[ClassType], *args, **kwargs) -> ClassType``.
  
  For reference, the default instantiator is ``return class_type(*args,
  **kwargs)``.
  
  In some use cases, the instantiator function might need access to values
  applied by instantiation links. For this, the instantiator function can
  have an additional keyword parameter ``applied_instantiation_links:
  dict``. This parameter will be populated with a dictionary having as
  keys the targets of the instantiation links and corresponding values
  that were applied.
blank_after_short_description: True
blank_after_long_description: True
style: google
- DocstringParam
  description: 'Function that instantiates a class.'
  kind: param
  key: 'param'
  arg_name: 'instantiator'
  is_optional: False
- DocstringParam
  description: 'The class type to instantiate.'
  kind: param
  key: 'param'
  arg_name: 'class_type'
  is_optional: False
- DocstringParam
  description: 'Whether to instantiate subclasses of ``class_type``.'
  kind: param
  key: 'param'
  arg_name: 'subclasses'
  is_optional: False
- DocstringParam
  description: 'Whether to prepend the instantiator to the existing instantiators.'
  kind: param
  key: 'param'
  arg_name: 'prepend'
  is_optional: False
=== detect
google
=== compose google
Adds a custom instantiator for a class type, globally for all ``ArgumentParser.instantiate`` calls.

Prefer the ``instantiators`` parameter of ``instantiate``, which is limited to that call.

Instantiator functions are expected to have as signature ``(class_type:
Type[ClassType], *args, **kwargs) -> ClassType``.

For reference, the default instantiator is ``return class_type(*args,
**kwargs)``.

In some use cases, the instantiator function might need access to values
applied by instantiation links. For this, the instantiator function can
have an additional keyword parameter ``applied_instantiation_links:
dict``. This parameter will be populated with a dictionary having as
keys the targets of the instantiation links and corresponding values
that were applied.

Args:
    instantiator: Function that instantiates a class.
    class_type: The class type to instantiate.
    subclasses: Whether to instantiate subclasses of ``class_type``.
    prepend: Whether to prepend the instantiator to the existing instantiators.
