code: def _check_timedelta(td):
      """
      Convert strings to Timedelta objects
      Allows for both shortform and longform units, as well as any form of capitalization
      '2 Minutes'
      '2 minutes'
      '2 m'
      '1 Minute'
      '1 minute'
      '1 m'
      '1 units'
      '1 Units'
      '1 u'
      Shortform is fine if space is dropped
      '2m'
      '1u"
      If a pd.Timedelta object is passed, units will be converted to seconds due to the underlying representation
          of pd.Timedelta.
      If a pd.DateOffset object is passed, it will be converted to a Featuretools Timedelta if it has one
          temporal parameter. Otherwise, it will remain a pd.DateOffset.
      """
      if td is None:
          return td
      if isinstance(td, Timedelta):
          return td
      elif not isinstance(
          td, (int, float, str, pd.DateOffset, pd.Timedelta)
      ):
          raise ValueError("Unable to parse timedelta: {}".format(td))
      if isinstance(td, pd.Timedelta):
          unit = "s"
          value = td.total_seconds()
          times = {unit: value}
          return Timedelta(times, delta_obj=td)
      elif isinstance(td, pd.DateOffset):
          # DateOffsets
          if td.__class__.__name__ != "DateOffset":
              if hasattr(td, "__dict__"):
                  # Special offsets (such as BDay) - prior to pandas 1.0.0
                  value = td.__dict__["n"]
              else:
                  # Special offsets (such as BDay) - after pandas 1.0.0
                  value = td.n
              unit = td.__class__.__name__
              times = dict([(unit, value)])
          else:
              times = dict()
              for td_unit, td_value in td.kwds.items():
                  times[td_unit] = td_value
          return Timedelta(times, delta_obj=td)
      else:
          pattern = "([0-9]+) *([a-zA-Z]+)$"
          match = re.match(pattern, td)
          value, unit = match.groups()
          try:
              value = int(value)
          except Exception:
              try:
                  value = float(value)
              except Exception:
                  raise ValueError(
                      "Unable to parse value {} from ".format(value)
                      + "timedelta string: {}".format(td),
                  )
          times = {unit: value}
          return Timedelta(times)
  
file_path: featuretools/featuretools/utils/wrangle.py
imports: import re
  import tarfile
  from datetime import datetime
  import numpy
  import pandas
  from woodwork.logical_types import Datetime, Ordinal
  from featuretools.entityset.timedelta import Timedelta
label_desc: Use image node_id 1 for calling a global function with example usage: _check_timedelta(td) and returns: td, td, Timedelta, Timedelta, Timedelta