code: def _all_string_prefixes(
      *, include_fstring=False, only_fstring=False
  ):
      def different_case_versions(prefix):
          for s in _itertools.product(
              *[(c, c.upper()) for c in prefix]
          ):
              yield "".join(s)
  
      # The valid string prefixes. Only contain the lower case versions,
      #  and don't contain any permuations (include 'fr', but not
      #  'rf'). The various permutations will be generated.
      valid_string_prefixes = ["b", "r", "u", "br"]
  
      result = {""}
      if include_fstring:
          f = ["f", "fr"]
          if only_fstring:
              valid_string_prefixes = f
              result = set()
          else:
              valid_string_prefixes += f
      elif only_fstring:
          return set()
  
      # if we add binary f-strings, add: ['fb', 'fbr']
      for prefix in valid_string_prefixes:
          for t in _itertools.permutations(prefix):
              # create a list with upper and lower versions of each
              #  character
              result.update(different_case_versions(t))
      return result
  
imports: from __future__ import absolute_import
  import sys
  import re
  import itertools
  from codecs import BOM_UTF8
  from typing import NamedTuple, Tuple, Iterator, Iterable, List, Dict, Pattern, Set
  from parso.python.token import PythonTokenTypes
  from parso.utils import split_lines, PythonVersionInfo, parse_version_string
label_desc: Use image node_id 3 for calling a global function with example usage: _all_string_prefixes() and returns: result, set