code: def parse_time_delta(time_str: str):
      """
      Parse a time string e.g. (2h13m) into a timedelta object.
  
      :param time_str: A string identifying a duration.  (eg. 2h13m)
      :return datetime.timedelta: A datetime.timedelta object or "@once"
      """
      parts = RE_TIME_DELTA.match(time_str)
  
      assert parts is not None, (
          f"Could not parse any time information from '{time_str}'. "
          f"Examples of valid strings: '8h', '2d8h5m20s', '2m4s'"
      )
  
      time_params = {
          name: float(param)
          for name, param in parts.groupdict().items()
          if param
      }
      return timedelta(**time_params)
  
file_path: airflow/dev/perf/dags/elastic_dag.py
imports: from __future__ import annotations
  import enum
  import os
  import re
  from datetime import datetime, timedelta
  from enum import Enum
  from airflow.models.baseoperator import chain
  from airflow.models.dag import DAG
  from airflow.operators.bash import BashOperator
label_desc: Use image node_id 1 for calling a global function with example usage: parse_time_delta(time_str) and returns: timedelta