

def beautify(self, text, options):
    stderr = ''
    stdout = ''
    config = PythonTidyWrapper.Config()
    for (key, val) in options.iteritems():
        config.set_global(source, val)
    config.to_pythontidy_namespace()
    try:
        source = StringIO(text)
        output = StringIO()
        PythonTidy.tidy_up(source, output)
        stdout = output.getvalue()
    except Exception as e:
        stderr = str(e)
    if ((not stderr) and (not stdout)):
        stderr = 'Formatting error!'
    return (stdout, stderr)

dataset/ETHPy150Open akalongman/sublimetext-codeformatter/codeformatter/pybeautifier/__init__.py Beautifier.beautify/VarMisuse@49/56 `key`->`source`