code: def datetime_from_isoformat(o):
      # type: (str) -> Optional[datetime]
      if not o:
          return None
      if isinstance(o, datetime):
          return o
      try:
          return datetime.strptime(
              o.split("+")[0], "%Y-%m-%dT%H:%M:%S.%f"
          )
      except ValueError:
          return datetime.strptime(o.split("+")[0], "%Y-%m-%dT%H:%M:%S")
  
imports: import getpass
  import re
  from _socket import gethostname
  from datetime import datetime
  from typing import Optional, Any
  from ..backend_api.services import projects, queues
  from ..debugging.log import get_logger, LoggerRoot
label_desc: Use image node_id 15 for calling a global function with example usage: datetime_from_isoformat(o) and returns: None, o, datetime, datetime