code: def check_pt(filename, extra_handler):
      try:
          # new pytorch format is a zip file
          with zipfile.ZipFile(filename) as z:
              check_zip_filenames(filename, z.namelist())
  
              # find filename of data.pkl in zip file: '<directory name>/data.pkl'
              data_pkl_filenames = [
                  f for f in z.namelist() if data_pkl_re.match(f)
              ]
              if len(data_pkl_filenames) == 0:
                  raise Exception(f"data.pkl not found in {filename}")
              if len(data_pkl_filenames) > 1:
                  raise Exception(
                      f"Multiple data.pkl found in {filename}"
                  )
              with z.open(data_pkl_filenames[0]) as file:
                  unpickler = RestrictedUnpickler(file)
                  unpickler.extra_handler = extra_handler
                  unpickler.load()
  
      except zipfile.BadZipfile:
          # if it's not a zip file, it's an old pytorch format, with five objects written to pickle
          with open(filename, "rb") as file:
              unpickler = RestrictedUnpickler(file)
              unpickler.extra_handler = extra_handler
              for _ in range(5):
                  unpickler.load()
  
imports: import pickle
  import collections
  import torch
  import numpy
  import _codecs
  import zipfile
  import re
  from modules import errors
label_desc: Use image node_id 3 for calling a global function with example usage: check_pt(filename, extra_handler) without return types