code: def datetime_from_json(js, manager):
      """Deserialize a Python datetime object from json."""
      if js is None:
          return None
      else:
          try:
              return dt.datetime(
                  js["year"],
                  js["month"] + 1,  # Months are 1-based in Python
                  js["date"],
                  js["hours"],
                  js["minutes"],
                  js["seconds"],
                  js["milliseconds"] * 1000,
                  dt.timezone.utc,
              ).astimezone()
          except (ValueError, OSError):
              # If year is outside valid range for conversion,
              # return naive datetime
              return dt.datetime(
                  js["year"],
                  js["month"] + 1,  # Months are 1-based in Python
                  js["date"],
                  js["hours"],
                  js["minutes"],
                  js["seconds"],
                  js["milliseconds"] * 1000,
                  dt.timezone.utc,
              )
  
imports: import re
  import traitlets
  import datetime
label_desc: Use image node_id 10 for calling a global function with example usage: datetime_from_json(js, manager) and returns: None, dt, dt