code: def port_mapping(v: str) -> PortMapping:
      return PortMapping.parse(v)
  
imports: import argparse
  import re
  import subprocess
  from typing import Dict, List, Optional, Tuple, Type
  from dstack._internal.cli.utils.common import console
  from dstack._internal.core.errors import ConfigurationError
  from dstack._internal.core.models.configurations import BaseConfiguration, BaseConfigurationWithPorts, ConfigurationType, DevEnvironmentConfiguration, PortMapping, ServiceConfiguration, TaskConfiguration
  from dstack._internal.utils.interpolator import VariablesInterpolator
label_desc: Use image node_id 2 for calling a global function with example usage: port_mapping(v) and returns: PortMapping