docs: def compile(pattern, flags=0, auto_compile=None):  # noqa A001
      """Compile both the search or search and replace into one object."""
  
      if isinstance(pattern, Bre):
          if auto_compile is not None:
              raise ValueError("Cannot compile Bre with a different auto_compile!")
          elif flags != 0:
              raise ValueError("Cannot process flags argument with a compiled pattern")
          return pattern
      else:
          if auto_compile is None:
              auto_compile = True
  
          return Bre(compile_search(pattern, flags), auto_compile)