code: def parsedate_to_datetime(data):
      parsed_date_tz = _parsedate_tz(data)
      if parsed_date_tz is None:
          raise ValueError(
              'Invalid date value or format "%s"' % str(data)
          )
      *dtuple, tz = parsed_date_tz
      if tz is None:
          return datetime.datetime(*dtuple[:6])
      return datetime.datetime(
          *dtuple[:6],
          tzinfo=datetime.timezone(datetime.timedelta(seconds=tz)),
      )
  
imports: import os
  import re
  import time
  import random
  import socket
  import datetime
  import urllib.parse
  from email._parseaddr import quote
  from email._parseaddr import AddressList
  from email._parseaddr import mktime_tz
  from email._parseaddr import parsedate, parsedate_tz, _parsedate_tz
  from email.charset import Charset
label_desc: Use image node_id 9 for calling a global function with example usage: parsedate_to_datetime(data) and returns: datetime, datetime