code: def parse_pretty_duration(duration: str) -> int:
      regex = re.compile(r"(?P<amount>\d+)(?P<unit>s|m|h|d|w)$")
      re_match = regex.match(duration)
      if not re_match:
          raise ValueError(f"Cannot parse the duration {duration}")
      amount, unit = int(re_match.group("amount")), re_match.group(
          "unit"
      )
      multiplier = {
          "s": 1,
          "m": 60,
          "h": 3600,
          "d": 24 * 3600,
          "w": 7 * 24 * 3600,
      }[unit]
      return amount * multiplier
  
file_path: dstack/src/dstack/_internal/utils/common.py
imports: import re
  import time
  from datetime import datetime, timedelta, timezone
  from pathlib import Path
  from typing import Optional, Tuple, Union
label_desc: Use image node_id 7 for calling a global function with example usage: parse_pretty_duration(duration) and returns: unknown