code: def fix_flags(src, flags):
      # Check and fix flags according to the type of pattern (str or bytes)
      if isinstance(src, str):
          if flags & SRE_FLAG_LOCALE:
              raise ValueError(
                  "cannot use LOCALE flag with a str pattern"
              )
          if not flags & SRE_FLAG_ASCII:
              flags |= SRE_FLAG_UNICODE
          elif flags & SRE_FLAG_UNICODE:
              raise ValueError(
                  "ASCII and UNICODE flags are incompatible"
              )
      else:
          if flags & SRE_FLAG_UNICODE:
              raise ValueError(
                  "cannot use UNICODE flag with a bytes pattern"
              )
          if flags & SRE_FLAG_LOCALE and flags & SRE_FLAG_ASCII:
              raise ValueError(
                  "ASCII and LOCALE flags are incompatible"
              )
      return flags
  
imports: from ._constants import *
label_desc: Use image node_id 7 for calling a global function with example usage: fix_flags(src, flags) and returns: flags