code: def re_flags_str(flags, custom_flags):
      
      res = ''
      for flag in RE_FLAGS:
          if flags & getattr(re, flag):
              res += flag
      for flag in RE_CUSTOM_FLAGS:
          if custom_flags & getattr(ReFlags, flag):
              res += flag
      return res
docs: Convert regexp flags to string.
  
      Parameters
      ----------
      flags : `int`
          Flags.
      custom_flags : `int`
          Custom flags.
  
      Returns
      -------
      `str`
          Flag string.