code: def convert_number_to_datetime(
      timestamp: Union[float, int, str]
  ) -> datetime:
      """Convert a numeric timestamp to a datetime object.
  
      `datetime` objects can be created from POSIX timestamps like those returned by `time.time()`.
  
      Args:
          timestamp: A numeric timestamp.
  
      Returns:
          A datetime representation of `timestamp`.
  
      Raises:
          ValueError: Raised if `timestamp` is not a number or not a valid datetime.
      """
      try:
          timestamp = float(timestamp)
      except TypeError:
          raise ValueError(
              f"Provided value {timestamp} is not a valid numeric timestamp"
          )
  
      # Determine the unit of the timestamp
      ts_scale = np.floor(np.log10(timestamp))
  
      # `datetime.datetime.fromtimestamp` expects a timestamp in seconds. Rescale the timestamp if it is not in seconds.
      if SCALE_S < ts_scale:
          delta = ts_scale - SCALE_S
          timestamp = timestamp / np.power(10, delta)
  
      # Convert the timestamp to a datetime object. If it is not a valid timestamp, `ValueError` is raised.
      dt = datetime.utcfromtimestamp(timestamp)
      return dt
  
file_path: ludwig/ludwig/utils/date_utils.py
imports: import time
  from datetime import date, datetime
  from typing import Union
  import numpy
  from dateutil.parser import parse, ParserError
  from ludwig.api_annotations import DeveloperAPI
label_desc: Use image node_id 3 for calling a global function with example usage: convert_number_to_datetime(timestamp) and returns: dt