code: def locate_string(
      query_string,
      image,
      fuzziness=0,
      ocr_preset=None,
      offset_x=0,
      offset_y=0,
  ):
      images, text_regions = extract_ocr_candidates(
          image,
          gradient_size=ocr_preset["extract"]["gradient_size"],
          closing_size=ocr_preset["extract"]["closing_size"],
      )
  
      detected_strings = list()
  
      for image in images:
          detected_strings.append(
              perform_ocr(
                  image,
                  scale=ocr_preset["perform"]["scale"],
                  order=ocr_preset["perform"]["order"],
                  horizontal_closing=ocr_preset["perform"][
                      "horizontal_closing"
                  ],
                  vertical_closing=ocr_preset["perform"][
                      "vertical_closing"
                  ],
              )
          )
  
      if query_string in detected_strings:
          text_region = list(
              text_regions[detected_strings.index(query_string)]
          )
  
          text_region[0] += offset_y
          text_region[1] += offset_x
          text_region[2] += offset_y
          text_region[3] += offset_x
  
          return text_region
  
      if len(detected_strings):
          edit_distances = [
              editdistance.eval(query_string, string)
              for string in detected_strings
          ]
          minimum_edit_distance = min(edit_distances)
  
          if minimum_edit_distance <= fuzziness:
              text_region = list(
                  text_regions[
                      edit_distances.index(minimum_edit_distance)
                  ]
              )
  
              text_region[0] += offset_y
              text_region[1] += offset_x
              text_region[2] += offset_y
              text_region[3] += offset_x
  
              return text_region
  
      return None
  
file_path: SerpentAI/serpent/ocr.py
imports: import pathlib
  import shutil
  import skimage.color
  import skimage.segmentation
  import skimage.filters
  import skimage.morphology
  import skimage.util
  import skimage.transform
  import skimage.measure
  import skimage.io
  import pytesseract
  from PIL import Image
  from serpent.utilities import is_windows
label_desc: Use image node_id 3 for calling a global function with example usage: locate_string(query_string, image, fuzziness, ocr_preset, offset_x, offset_y) and returns: None, text_region, text_region