code: def rcompile(pattern, flags=0, verbose=False):
      """A wrapper for re.compile that checks whether "pattern" is a regex object
      or a string to be compiled, and automatically adds the re.UNICODE flag.
      """
  
      if not isinstance(pattern, string_type):
          # If it's not a string, assume it's already a compiled pattern
          return pattern
      if verbose:
          flags |= re.VERBOSE
      return re.compile(pattern, re.UNICODE | flags)
  
file_path: whoosh/src/whoosh/util/text.py
imports: import codecs, re
  from whoosh.compat import string_type, u, byte
label_desc: Use image node_id 7 for calling a global function with example usage: rcompile(pattern, flags, verbose) and returns: re, pattern