code: def get_agent_max_initial_failures(
      default: Optional[int] = None, env: Optional[Env] = None
  ) -> Optional[int]:
      if env is None:
          env = os.environ
      val = env.get(AGENT_MAX_INITIAL_FAILURES, default)
      try:
          val = int(val)  # type: ignore
      except ValueError:
          val = default
      return val
  
imports: import json
  import os
  import sys
  from distutils.util import strtobool
  from pathlib import Path
  from typing import List, MutableMapping, Optional, Union
  import appdirs
label_desc: Use image node_id 33 for calling a global function with example usage: get_agent_max_initial_failures(default, env) and returns: val