code: def soft_convert_objects(
      values,
      datetime=True,
      numeric=True,
      timedelta=True,
      coerce=False,
      copy=True,
  ):
      """if we have an object dtype, try to coerce dates and/or numbers"""
  
      conversion_count = sum((datetime, numeric, timedelta))
      if conversion_count == 0:
          raise ValueError(
              "At least one of datetime, numeric or timedelta must "
              "be True."
          )
      elif conversion_count > 1 and coerce:
          raise ValueError(
              "Only one of 'datetime', 'numeric' or "
              "'timedelta' can be True when when coerce=True."
          )
  
      if isinstance(values, (list, tuple)):
          # List or scalar
          values = np.array(values, dtype=np.object_)
      elif not hasattr(values, "dtype"):
          values = np.array([values], dtype=np.object_)
      elif not is_object_dtype(values.dtype):
          # If not object, do not attempt conversion
          values = values.copy() if copy else values
          return values
  
      # If 1 flag is coerce, ensure 2 others are False
      if coerce:
          # Immediate return if coerce
          if datetime:
              from pandas import to_datetime
  
              return to_datetime(values, errors="coerce", box=False)
          elif timedelta:
              from pandas import to_timedelta
  
              return to_timedelta(values, errors="coerce", box=False)
          elif numeric:
              from pandas import to_numeric
  
              return to_numeric(values, errors="coerce")
  
      # Soft conversions
      if datetime:
          # GH 20380, when datetime is beyond year 2262, hence outside
          # bound of nanosecond-resolution 64-bit integers.
          try:
              values = lib.maybe_convert_objects(
                  values, convert_datetime=datetime
              )
          except OutOfBoundsDatetime:
              pass
  
      if timedelta and is_object_dtype(values.dtype):
          # Object check to ensure only run if previous did not convert
          values = lib.maybe_convert_objects(
              values, convert_timedelta=timedelta
          )
  
      if numeric and is_object_dtype(values.dtype):
          try:
              converted = lib.maybe_convert_numeric(
                  values, set(), coerce_numeric=True
              )
              # If all NaNs, then do not-alter
              values = (
                  converted if not isna(converted).all() else values
              )
              values = values.copy() if copy else values
          except Exception:
              pass
  
      return values
  
imports: from datetime import datetime, timedelta
  import numpy
  from pandas._libs import lib, tslib, tslibs
  from pandas._libs.tslibs import NaT, OutOfBoundsDatetime, Period, iNaT
  from pandas.compat import PY3, string_types, text_type, to_str
  from .common import _INT64_DTYPE, _NS_DTYPE, _POSSIBLY_CAST_DTYPES, _TD_DTYPE, ensure_int8, ensure_int16, ensure_int32, ensure_int64, ensure_object, is_bool, is_bool_dtype, is_categorical_dtype, is_complex, is_complex_dtype, is_datetime64_dtype, is_datetime64_ns_dtype, is_datetime64tz_dtype, is_datetime_or_timedelta_dtype, is_datetimelike, is_dtype_equal, is_extension_array_dtype, is_extension_type, is_float, is_float_dtype, is_integer, is_integer_dtype, is_object_dtype, is_scalar, is_string_dtype, is_timedelta64_dtype, is_timedelta64_ns_dtype, is_unsigned_integer_dtype, pandas_dtype
  from .dtypes import DatetimeTZDtype, ExtensionDtype, PandasExtensionDtype, PeriodDtype
  from .generic import ABCDatetimeArray, ABCDatetimeIndex, ABCPeriodArray, ABCPeriodIndex, ABCSeries
  from .inference import is_list_like
  from .missing import isna, notna
label_desc: Use image node_id 17 for calling a global function with example usage: soft_convert_objects(values, datetime, numeric, timedelta, coerce, copy) and returns: values, to_datetime, values, to_timedelta, to_numeric