code: def from_timestamp(
      timestamp, tz=UTC  # type: Union[int, float]  # type: Union[str, _Timezone]
  ):  # type: (...) -> DateTime
      
      dt = _datetime.datetime.utcfromtimestamp(timestamp)
  
      dt = datetime(
          dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.microsecond
      )
  
      if tz is not UTC or tz != "UTC":
          dt = dt.in_timezone(tz)
  
      return dt
docs: Create a DateTime instance from a timestamp.