original_docstring: convertPowers takes a string argument and maps all occurrences
      of power sub-expressions into the chosen target syntax. That option
      is one of "**", "^", or "pow".
docstring: convertPowers takes a string argument and maps all occurrences
  of power sub-expressions into the chosen target syntax.
docstring_tokens: convertPowers takes a string argument and maps all occurrences of power sub - expressions into the chosen target syntax .
code: def convertPowers(s, target="pow"):
      """convertPowers takes a string argument and maps all occurrences
      of power sub-expressions into the chosen target syntax. That option
      is one of "**", "^", or "pow"."""
      # temp_macro_names switches python reserved keywords to adapted names
      # that won't make the python parser used in string2ast raise a syntax error
      # ... but only invoke this relatively expensive function in the unlikely
      # event a clash occurs.
      # R. Clewley
      if target=="**":
          try:
              return ast2string(toDoubleStarSyntax(string2ast(s)))
          except SyntaxError:
              s = temp_macro_names(s)
              return temp_macro_names_inv(ast2string(toDoubleStarSyntax(string2ast(s))))
      elif target=="^":
          try:
              return ast2string(ensureints(toCircumflexSyntax(string2ast(s))))
          except SyntaxError:
              s = temp_macro_names(s)
              return temp_macro_names_inv(ast2string(ensureints(toCircumflexSyntax(string2ast(s)))))
      elif target=="pow":
          try:
              return ast2string(toPowSyntax(string2ast(s)))
          except SyntaxError:
              s = temp_macro_names(s)
              return temp_macro_names_inv(ast2string(toPowSyntax(string2ast(s))))
      else:
          raise ValueError("Invalid target syntax")
code_tokens: def convertPowers ( s , target = "pow" ) : if target == "**" : try : return ast2string ( toDoubleStarSyntax ( string2ast ( s ) ) ) except SyntaxError : s = temp_macro_names ( s ) return temp_macro_names_inv ( ast2string ( toDoubleStarSyntax ( string2ast ( s ) ) ) ) elif target == "^" : try : return ast2string ( ensureints ( toCircumflexSyntax ( string2ast ( s ) ) ) ) except SyntaxError : s = temp_macro_names ( s ) return temp_macro_names_inv ( ast2string ( ensureints ( toCircumflexSyntax ( string2ast ( s ) ) ) ) ) elif target == "pow" : try : return ast2string ( toPowSyntax ( string2ast ( s ) ) ) except SyntaxError : s = temp_macro_names ( s ) return temp_macro_names_inv ( ast2string ( toPowSyntax ( string2ast ( s ) ) ) ) else : raise ValueError ( "Invalid target syntax" )
short_docstring: convertPowers takes a string argument and maps all occurrences
  of power sub-expressions into the chosen target syntax.
short_docstring_tokens: convertPowers takes a string argument and maps all occurrences of power sub - expressions into the chosen target syntax .
comment: """convertPowers takes a string argument and maps all occurrences
      of power sub-expressions into the chosen target syntax. That option
      is one of "**", "^", or "pow"."""$SEP$# temp_macro_names switches python reserved keywords to adapted names$SEP$# that won't make the python parser used in string2ast raise a syntax error$SEP$# ... but only invoke this relatively expensive function in the unlikely$SEP$# event a clash occurs.$SEP$# R. Clewley