code: def _all_string_prefixes(
      version_info, 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"]
      if version_info.major >= 3:
          valid_string_prefixes.append("br")
  
      result = set([""])
      if version_info >= (3, 6) and 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))
      if version_info.major == 2:
          # In Python 2 the order cannot just be random.
          result.update(different_case_versions("ur"))
          result.update(different_case_versions("br"))
      return result
  
imports: from __future__ import absolute_import
  import sys
  import re
  from collections import namedtuple
  import itertools
  from codecs import BOM_UTF8
  from parso.python.token import PythonTokenTypes
  from parso.utils import split_lines
label_desc: Use image node_id 3 for calling a global function with example usage: _all_string_prefixes(version_info, include_fstring, only_fstring) and returns: result, set