code: def verifyurl(self, url, data):
      d = ["%s" % (len(data),)]
      try:
          import hashlib
  
          d.append(hashlib.sha1(data).hexdigest())
          d.append(hashlib.md5(data).hexdigest())
      except ImportError:
          import sha
  
          d.append(sha.new(data).hexdigest())
          import md5
  
          d.append(md5.new(data).hexdigest())
  
      write("    Length:", d[0], " SHA1:", d[1], " MD5:", d[2])
      sums = os.path.join(os.path.dirname(__file__), "checksums")
      for line in read_whole_file(sums, "rt").split("\n"):
          line = line.strip()
          if len(line) == 0 or line[0] == "#":
              continue
          l = [l.strip() for l in line.split()]
          if len(l) != 4:
              write("Invalid line in checksums file:", line, sys.stderr)
              raise ValueError("Bad checksums file")
          if l[0] == url:
              if l[1:] == d:
                  write("    Checksums verified")
                  return
              if l[1] != d[0]:
                  write(
                      "Length does not match.  Expected",
                      l[1],
                      "download was",
                      d[0],
                  )
              if l[2] != d[1]:
                  write(
                      "SHA does not match.  Expected",
                      l[2],
                      "download was",
                      d[1],
                  )
              if l[3] != d[2]:
                  write(
                      "MD5 does not match.  Expected",
                      l[3],
                      "download was",
                      d[2],
                  )
              write(
                  "The download does not match the checksums distributed with APSW.\n"
                  "The download should not have changed since the checksums were\n"
                  "generated.  The cause could be anything from network corruption\n"
                  "to a malicious attack."
              )
              raise ValueError("Checksums do not match")
      # no matching line
      write("    (Not verified.  No match in checksums file)")
      if not self.missing_checksum_ok:
          raise ValueError(
              "No checksum available.  Use --missing-checksum-ok option to continue"
          )
  
imports: import os
  import sys
  import shlex
  import glob
  import re
  import time
  import zipfile
  import tarfile
  from distutils.command import build_ext, build, sdist
label_desc: Use image node_id 4 for calling the fetch obj's underlying member method code with example usage: obj.verifyurl(url, data) without return types