code: def test_image(
      image_to_check,
      known_names,
      known_face_encodings,
      tolerance=0.6,
      show_distance=False,
  ):
      unknown_image = face_recognition.load_image_file(image_to_check)
  
      # Scale down image if it's giant so things run a little faster
      if max(unknown_image.shape) > 1600:
          pil_img = PIL.Image.fromarray(unknown_image)
          pil_img.thumbnail((1600, 1600), PIL.Image.LANCZOS)
          unknown_image = np.array(pil_img)
  
      unknown_encodings = face_recognition.face_encodings(unknown_image)
  
      for unknown_encoding in unknown_encodings:
          distances = face_recognition.face_distance(
              known_face_encodings, unknown_encoding
          )
          result = list(distances <= tolerance)
  
          if True in result:
              [
                  print_result(
                      image_to_check, name, distance, show_distance
                  )
                  for is_match, name, distance in zip(
                      result, known_names, distances
                  )
                  if is_match
              ]
          else:
              print_result(
                  image_to_check, "unknown_person", None, show_distance
              )
  
      if not unknown_encodings:
          # print out fact that no faces were found in image
          print_result(
              image_to_check, "no_persons_found", None, show_distance
          )
  
file_path: face_recognition/face_recognition/face_recognition_cli.py
imports: from __future__ import print_function
  import click
  import os
  import re
  import face_recognition.api
  import multiprocessing
  import itertools
  import sys
  import PIL.Image
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: test_image(image_to_check, known_names, known_face_encodings, tolerance, show_distance) without return types