code: def _convert_listlike(
      arg, unit="ns", box=True, errors="raise", name=None
  ):
      """Convert a list of objects to a timedelta index object."""
  
      if isinstance(arg, (list, tuple)) or not hasattr(arg, "dtype"):
          # This is needed only to ensure that in the case where we end up
          #  returning arg (errors == "ignore"), and where the input is a
          #  generator, we return a useful list-like instead of a
          #  used-up generator
          arg = np.array(list(arg), dtype=object)
  
      try:
          value = sequence_to_td64ns(
              arg, unit=unit, errors=errors, copy=False
          )[0]
      except ValueError:
          if errors == "ignore":
              return arg
          else:
              # This else-block accounts for the cases when errors='raise'
              # and errors='coerce'. If errors == 'raise', these errors
              # should be raised. If errors == 'coerce', we shouldn't
              # expect any errors to be raised, since all parsing errors
              # cause coercion to pd.NaT. However, if an error / bug is
              # introduced that causes an Exception to be raised, we would
              # like to surface it.
              raise
  
      if box:
          from pandas import TimedeltaIndex
  
          value = TimedeltaIndex(value, unit="ns", name=name)
      return value
  
file_path: catboost/contrib/python/pandas/py2/pandas/core/tools/timedeltas.py
imports: import numpy
  from pandas._libs.tslibs.timedeltas import Timedelta, parse_timedelta_unit
  from pandas.core.dtypes.common import is_list_like
  from pandas.core.dtypes.generic import ABCIndexClass, ABCSeries
  import pandas
  from pandas.core.arrays.timedeltas import sequence_to_td64ns
label_desc: Use image node_id 3 for calling a global function with example usage: _convert_listlike(arg, unit, box, errors, name) and returns: value, arg