code: def solr_escape(string):
      if (string == "OR") or (string == "AND"):
          return string.lower()
  
      interior = r"\s+(OR|AND)\s+"
      start = r"^(OR|AND) "
      end = r" (OR|AND)$"
  
      string = re.sub(interior, lambda x: x.group(0).lower(), string)
      string = re.sub(start, lambda x: x.group(0).lower(), string)
      string = re.sub(end, lambda x: x.group(0).lower(), string)
  
      return ESCAPE_CHARS_RE.sub(r"\\\g<char>", string)
  
file_path: BLINK/blink/candidate_retrieval/utils.py
imports: import sys
  import pickle
  import subprocess
  import blink.candidate_retrieval.dataset
  import re
  import os
label_desc: Use image node_id 1 for calling a global function with example usage: solr_escape(string) and returns: ESCAPE_CHARS_RE, string