parameters: (source_text, fixer_names, filename='')
docstring: Use lib2to3 to refactor the source.
  
      Return the refactored source code.
docstring_summary: Use lib2to3 to refactor the source.
docstring_tokens: Use lib2to3 to refactor the source .
function: def refactor_with_2to3(source_text, fixer_names, filename=''):
      """Use lib2to3 to refactor the source.
  
      Return the refactored source code.
  
      """
      from lib2to3.refactor import RefactoringTool
      fixers = ['lib2to3.fixes.fix_' + name for name in fixer_names]
      tool = RefactoringTool(fixer_names=fixers, explicit=fixers)
  
      from lib2to3.pgen2 import tokenize as lib2to3_tokenize
      try:
          # The name parameter is necessary particularly for the "import" fixer.
          return unicode(tool.refactor_string(source_text, name=filename))
      except lib2to3_tokenize.TokenError:
          return source_text
function_tokens: def refactor_with_2to3 ( source_text , fixer_names , filename = '' ) : from lib2to3 . refactor import RefactoringTool fixers = [ 'lib2to3.fixes.fix_' + name for name in fixer_names ] tool = RefactoringTool ( fixer_names = fixers , explicit = fixers ) from lib2to3 . pgen2 import tokenize as lib2to3_tokenize try : # The name parameter is necessary particularly for the "import" fixer. return unicode ( tool . refactor_string ( source_text , name = filename ) ) except lib2to3_tokenize . TokenError : return source_text