code: def _to_numeric(val):
      
      if isinstance(val, (int, float, datetime.datetime, datetime.timedelta)):
          return val
      return float(val)
docs: Helper function for conversion of various data types into numeric representation.