class_docstr: The minimum resources requirements for the run.
  
  Attributes:
      cpu (Optional[int]): The minimum number of CPUs
      memory (Optional[str]): The minimum size of RAM memory (e.g., `"16GB"`)
      gpu (Optional[GPU]): The GPU spec
      shm_size (Optional[str]): The size of shared memory (e.g., `"8GB"`). If you are using parallel communicating processes (e.g., dataloaders in PyTorch), you may need to configure this.
      disk (Optional[Disk]): The disk spec
class_docstr_tok: ["The","minimum","resources","requirements","for","the","run",".","Attributes",":","cpu","(","Optional","[","int","]",")",":","The","minimum","number","of","CPUs","memory","(","Optional","[","str","]",")",":","The","minimum","size","of","RAM","memory","(","e.g.",",","`","``","16GB","''","`",")","gpu","(","Optional","[","GPU","]",")",":","The","GPU","spec","shm_size","(","Optional","[","str","]",")",":","The","size","of","shared","memory","(","e.g.",",","`","``","8GB","''","`",")",".","If","you","are","using","parallel","communicating","processes","(","e.g.",",","dataloaders","in","PyTorch",")",",","you","may","need","to","configure","this",".","disk","(","Optional","[","Disk","]",")",":","The","disk","spec"]
code: def _validate_disk(
      cls, v: Optional[Union[int, str, ProfileDisk]]
  ) -> Optional[ProfileDisk]:
      if isinstance(v, int):
          v = ProfileDisk(size=v)
      if isinstance(v, str):
          v = ProfileDisk(size=parse_memory(v))
      return 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 2 for calling the ProfileResources obj's underlying member method code with example usage: obj._validate_disk(cls, v) and returns: v