original_docstring: 
      Run either a hook or a function. In this context the args are associated with
      arguments in
      
docstring: Run either a hook or a function. In this context the args are associated with
  arguments in
docstring_tokens: Run either a hook or a function . In this context the args are associated with arguments in
code: def run_hook(context: 'Context'):
      """
      Run either a hook or a function. In this context the args are associated with
      arguments in
      """
      if isinstance(context.input_string, str):
          args, kwargs, flags = unpack_input_string(context.input_string)
          # args, kwargs, flags = unpack_args_kwargs_string(context.input_string)
          first_arg = args[0]
          # Remove first args it will be consumed and no longer relevant
          args.pop(0)
  
      else:
          # Rare case when an arrow is used to indicate rendering of a list.
          # Only qualified when input is of form `key->: [{{var}},{{var}},...]
          # In this case we need to set the key a as an empty list
          nested_set(
              element=context.output_dict,
              keys=context.key_path[:-1] + [context.key_path[-1][:-2]],
              value=[],
          )
          # Iterate over values appending rendered values. Rendered values can be any type
          for i, v in enumerate(context.input_string):
              nested_set(
                  element=context.output_dict,
                  keys=context.key_path[:-1]
                  + [context.key_path[-1][:-2]]
                  + [encode_list_index(i)],
                  value=render_variable(context, v),
              )
          return
  
      # Look up the hook from the imported providers
      Hook = get_hook(first_arg, context, suppress_error=True)
  
      if Hook is None:
          raise UnknownHookTypeException
  
      if context.key_path[-1] in ('->', '_>'):
          # We have a expanded or mixed (with args) hook expression and so there will be
          # additional properties in adjacent keys
          hook_dict = nested_get(context.input_dict, context.key_path[:-1]).copy()
  
          # Need to replace arrow keys as for the time being (pydantic 1.8.2) - multiple
          # aliases for the same field (type) can't be specified so doing this hack
          if '->' in hook_dict:
              hook_dict['hook_type'] = first_arg
              hook_dict.pop('->')
          else:
              hook_dict['hook_type'] = first_arg
              hook_dict.pop('_>')
  
      else:
          # Hook is a compact expression - Can only be a string
          hook_dict = {}
          # hook_dict['hook_type'] = nested_get(context.input_dict, context.key_path)
          hook_dict['hook_type'] = first_arg
  
      # Associate hook arguments provided in the call with hook attributes
      evaluate_args(args, hook_dict, Hook)
      # Add any kwargs
      for k, v in kwargs.items():
          hook_dict[k] = v
  
      # Main parser
      parse_hook(hook_dict, Hook, context)
code_tokens: def run_hook ( context : 'Context' ) : if isinstance ( context . input_string , str ) : args , kwargs , flags = unpack_input_string ( context . input_string ) first_arg = args [ 0 ] args . pop ( 0 ) else : nested_set ( element = context . output_dict , keys = context . key_path [ : - 1 ] + [ context . key_path [ - 1 ] [ : - 2 ] ] , value = [ ] , ) for i , v in enumerate ( context . input_string ) : nested_set ( element = context . output_dict , keys = context . key_path [ : - 1 ] + [ context . key_path [ - 1 ] [ : - 2 ] ] + [ encode_list_index ( i ) ] , value = render_variable ( context , v ) , ) return Hook = get_hook ( first_arg , context , suppress_error = True ) if Hook is None : raise UnknownHookTypeException if context . key_path [ - 1 ] in ( '->' , '_>' ) : hook_dict = nested_get ( context . input_dict , context . key_path [ : - 1 ] ) . copy ( ) if '->' in hook_dict : hook_dict [ 'hook_type' ] = first_arg hook_dict . pop ( '->' ) else : hook_dict [ 'hook_type' ] = first_arg hook_dict . pop ( '_>' ) else : hook_dict = { } hook_dict [ 'hook_type' ] = first_arg evaluate_args ( args , hook_dict , Hook ) for k , v in kwargs . items ( ) : hook_dict [ k ] = v parse_hook ( hook_dict , Hook , context )
short_docstring: Run either a hook or a function.
short_docstring_tokens: Run either a hook or a function .
comment: """
      Run either a hook or a function. In this context the args are associated with
      arguments in
      """$SEP$# args, kwargs, flags = unpack_args_kwargs_string(context.input_string)$SEP$# Remove first args it will be consumed and no longer relevant$SEP$# Rare case when an arrow is used to indicate rendering of a list.$SEP$# Only qualified when input is of form `key->: [{{var}},{{var}},...]$SEP$# In this case we need to set the key a as an empty list$SEP$# Iterate over values appending rendered values. Rendered values can be any type$SEP$# Look up the hook from the imported providers$SEP$# We have a expanded or mixed (with args) hook expression and so there will be$SEP$# additional properties in adjacent keys$SEP$# Need to replace arrow keys as for the time being (pydantic 1.8.2) - multiple$SEP$# aliases for the same field (type) can't be specified so doing this hack$SEP$# Hook is a compact expression - Can only be a string$SEP$# hook_dict['hook_type'] = nested_get(context.input_dict, context.key_path)$SEP$# Associate hook arguments provided in the call with hook attributes$SEP$# Add any kwargs$SEP$# Main parser