code: def _normalize_timestamp(obj):
      """Convert a timestamp in seconds to milliseconds.
  
      If the input overflows, it is treated as milliseconds - otherwise it is
      treated as seconds and converted.
      """
      try:
          datetime.fromtimestamp(obj)
          return int(obj * 1000)
      except (ValueError, OverflowError, OSError):
          return int(obj)
  
file_path: perspective/python/perspective/perspective/table/_date_validator.py
imports: import numpy
  from calendar import timegm
  from datetime import date, datetime
  from dateutil.parser import parse
  from pytz import UTC
  from pandas import Period
  from re import search
  from time import mktime
  from .libpsppy import t_dtype
label_desc: Use image node_id 1 for calling a global function with example usage: _normalize_timestamp(obj) and returns: int, int