code: def gpu_spec(v: str) -> Dict[str, str]:
      patterns = {
          "name": r"^[a-z].+$",  # GPU name starts with a letter
          "count": r"^\d+$",  # Count contains digits only
          "memory": r"^\d+(mb|gb)$",  # Memory has a suffix
      }
      data = {}
      for part in v.split(":"):
          for key, pattern in patterns.items():
              if re.match(pattern, part.lower()) is not None:
                  data[key] = part
                  patterns.pop(
                      key
                  )  # every field could be used at most once
                  break
          else:
              raise ValueError(part)
      return data
  
file_path: dstack/src/dstack/_internal/cli/services/configurators/profile.py
imports: import argparse
  import os
  import re
  from typing import Dict
  from dstack._internal.core.models.profiles import Profile, ProfileDisk, ProfileGPU, ProfileRetryPolicy, SpotPolicy, parse_duration, parse_max_duration
label_desc: Use image node_id 3 for calling a global function with example usage: gpu_spec(v) and returns: data