code: def old_hex_to_hash(hexstr, hash_size=8):
      # type: (str, int) -> ImageHash
      """
      Convert a stored hash (hex, as retrieved from str(Imagehash))
      back to a Imagehash object. This method should be used for
      hashes generated by ImageHash up to version 3.7. For hashes
      generated by newer versions of ImageHash, hex_to_hash should
      be used instead.
      """
      arr = []
      count = hash_size * (hash_size // 4)
      if len(hexstr) != count:
          emsg = "Expected hex string size of {}."
          raise ValueError(emsg.format(count))
      for i in range(count // 2):
          h = hexstr[i * 2 : i * 2 + 2]
          v = int("0x" + h, 16)
          arr.append([v & 2**i > 0 for i in range(8)])
      return ImageHash(numpy.array(arr))
  
imports: from __future__ import absolute_import, division, print_function
  import sys
  import numpy
  from PIL import Image, ImageFilter
label_desc: Use image node_id 5 for calling a global function with example usage: old_hex_to_hash(hexstr, hash_size) and returns: ImageHash