code: def make_record(
      path, gis, k, N, img=None, bytestream=False, metadata=None
  ):
      """Makes a record suitable for database insertion.
  
      Note:
          This non-class version of make_record is provided for
          CPU pooling. Functions passed to worker processes must
          be picklable.
  
      Args:
          path (string): path or image data. If bytestream=False, then path is assumed to be
              a URL or filesystem path. Otherwise, it's assumed to be raw image data
          gis (ImageSignature): an instance of ImageSignature for generating the
              signature
          k (int): width of words for encoding
          N (int): number of words for encoding
          img (Optional[string]): usually raw image data. In this case, path will still be stored, but
              a signature will be generated from data in img. If bytestream is False, but img is
              not None, then img is assumed to be the URL or filesystem path. Thus, you can store
              image records with a different 'path' than the actual image location (default None)
          bytestream (Optional[boolean]): will the image be passed as raw bytes?
              That is, is the 'path_or_image' argument an in-memory image? If img is None but, this
              argument will be ignored.  If img is not None, and bytestream is False, then the behavior
              is as described in the explanation for the img argument
              (default False)
          metadata (Optional): any other information you want to include, can be nested (default None)
  
      Returns:
          An image record.
  
          For example:
  
          {'path': 'https://pixabay.com/static/uploads/photo/2012/11/28/08/56/mona-lisa-67506_960_720.jpg',
           'signature': [0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 2, 2, 2, 2, 0 ... ]
           'simple_word_0': 42252475,
           'simple_word_1': 23885671,
           'simple_word_10': 9967839,
           'simple_word_11': 4257902,
           'simple_word_12': 28651959,
           'simple_word_13': 33773597,
           'simple_word_14': 39331441,
           'simple_word_15': 39327300,
           'simple_word_16': 11337345,
           'simple_word_17': 9571961,
           'simple_word_18': 28697868,
           'simple_word_19': 14834907,
           'simple_word_2': 7434746,
           'simple_word_20': 37985525,
           'simple_word_21': 10753207,
           'simple_word_22': 9566120,
           ...
           'metadata': {...}
           }
  
      """
      record = dict()
      record["path"] = path
      if img is not None:
          signature = gis.generate_signature(img, bytestream=bytestream)
      else:
          signature = gis.generate_signature(path)
  
      record["signature"] = signature.tolist()
  
      if metadata:
          record["metadata"] = metadata
  
      words = get_words(signature, k, N)
      max_contrast(words)
  
      words = words_to_int(words)
  
      for i in range(N):
          record["".join(["simple_word_", str(i)])] = words[i].tolist()
  
      return record
  
file_path: image-match/image_match/signature_database_base.py
imports: from image_match.goldberg import ImageSignature
  from itertools import product
  from operator import itemgetter
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: make_record(path, gis, k, N, img, bytestream, metadata) and returns: record