code: def parse(data: dict) -> AnyRunConfiguration:
      try:
          conf = RunConfiguration.parse_obj(data).__root__
      except ValidationError as e:
          raise ConfigurationError(e)
      return conf
  
imports: import re
  from enum import Enum
  from typing import Dict, List, Optional, Union
  from pydantic import BaseModel, Field, ValidationError, conint, constr, validator
  from typing_extensions import Annotated, Literal
  from dstack._internal.core.errors import ConfigurationError
  from dstack._internal.core.models.common import ForbidExtra
  from dstack._internal.core.models.repos.base import Repo
  from dstack._internal.core.models.repos.virtual import VirtualRepo
label_desc: Use image node_id 1 for calling a global function with example usage: parse(data) and returns: conf