code: def parse_max_duration(v: Union[int, str]) -> int:
      if v == "off":
          return v
      return parse_duration(v)
  
imports: import re
  from enum import Enum
  from typing import List, Optional, Tuple, Union
  from pydantic import Field, confloat, root_validator, validator
  from typing_extensions import Annotated, Literal
  from dstack._internal.core.models.backends.base import BackendType
  from dstack._internal.core.models.common import ForbidExtra
label_desc: Use image node_id 3 for calling a global function with example usage: parse_max_duration(v) and returns: parse_duration, v