code: def __init__(
      self,
      resolver: DataResolver,
      context: Context,
      name: str,
      definition: "DictStrAny",
      where: str = STAGES_KWD,
  ):
      self.resolver = resolver
      self.relpath = self.resolver.relpath
      self.context = context
      self.name = name
  
      assert DO_KWD in definition
      assert MATRIX_KWD not in definition
      self.foreach_data = definition[FOREACH_KWD]
      self._template = definition[DO_KWD]
  
      self.pair = IterationPair()
      self.where = where
  
imports: import logging
  import os
  from collections.abc import Mapping, Sequence
  from copy import deepcopy
  from itertools import product
  from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional, Tuple, Type, Union
  from funcy import collecting, first, isa, join, reraise
  from dvc.exceptions import DvcException
  from dvc.log import logger
  from dvc.parsing.interpolate import ParseError
  from dvc.utils.objects import cached_property
  from .context import Context, ContextError, KeyNotInContext, MergeError, Node, VarsAlreadyLoaded
  from .interpolate import check_recursive_parse_errors, is_interpolated_string, recurse, to_str
label_desc: Use image node_id 1 to create a new ForeachDefinition object  with example: obj = ForeachDefinition(resolver, context, name, definition, where)