original_docstring: Run the parse_hook function in a loop and return a list of outputs.
docstring: Run the parse_hook function in a loop and return a list of outputs.
docstring_tokens: Run the parse_hook function in a loop and return a list of outputs .
code: def evaluate_for(hook_dict: dict, Hook: ModelMetaclass, context: 'Context'):
      """Run the parse_hook function in a loop and return a list of outputs."""
      loop_targets = render_variable(context, wrap_jinja_braces(hook_dict['for']))
      hook_dict.pop('for')
  
      # Need add an empty list in the value so we have something to append to
      set_key(
          element=context.output_dict,
          keys=context.key_path,
          value=[],
      )
  
      if len(loop_targets) == 0:
          return
  
      for i, l in (
          enumerate(loop_targets)
          if not render_variable(context, hook_dict.get('reverse', None))
          else reversed(list(enumerate(loop_targets)))
      ):
          # Create temporary variables in the context to be used in the loop.
          context.existing_context.update({'index': i, 'item': l})
          # Append the index to the keypath
          context.key_path.append(encode_list_index(i))
  
          # TODO: Do we need to parse a copy of the hook?
          parse_hook(hook_dict.copy(), Hook, context, append_hook_value=True)
          context.key_path.pop()
  
      # Remove temp variables
      context.existing_context.pop('item')
      context.existing_context.pop('index')
code_tokens: def evaluate_for ( hook_dict : dict , Hook : ModelMetaclass , context : 'Context' ) : loop_targets = render_variable ( context , wrap_jinja_braces ( hook_dict [ 'for' ] ) ) hook_dict . pop ( 'for' ) set_key ( element = context . output_dict , keys = context . key_path , value = [ ] , ) if len ( loop_targets ) == 0 : return for i , l in ( enumerate ( loop_targets ) if not render_variable ( context , hook_dict . get ( 'reverse' , None ) ) else reversed ( list ( enumerate ( loop_targets ) ) ) ) : context . existing_context . update ( { 'index' : i , 'item' : l } ) context . key_path . append ( encode_list_index ( i ) ) parse_hook ( hook_dict . copy ( ) , Hook , context , append_hook_value = True ) context . key_path . pop ( ) context . existing_context . pop ( 'item' ) context . existing_context . pop ( 'index' )
short_docstring: Run the parse_hook function in a loop and return a list of outputs.
short_docstring_tokens: Run the parse_hook function in a loop and return a list of outputs .
comment: """Run the parse_hook function in a loop and return a list of outputs."""$SEP$# Need add an empty list in the value so we have something to append to$SEP$# Create temporary variables in the context to be used in the loop.$SEP$# Append the index to the keypath$SEP$# TODO: Do we need to parse a copy of the hook?$SEP$# Remove temp variables