def stringify(node):
    if isinstance(node, ast.Name):
        return node.id
    elif isinstance(node, ast.Attribute):
        return '%s.%s' % (stringify(node.value), node.attr)
    elif isinstance(node, ast.Subscript):
        return '%s[%s]' % (stringify(node.value), stringify(node.slice))
    elif isinstance(node, ast.Index):
        return stringify(node.value)
    elif isinstance(node, ast.Call):
        return '%s(%s, %s)' % (stringify(node.func), stringify(node.args), stringify(node.keywords))
    elif isinstance(node, list):
        return '[%s]' % (', '.join(stringify(n) for n in node))
    elif isinstance(node, ast.Str):
        return node.s
    else:
        return ast.dump(node)
dataset/ETHPy150Open uber/py-find-injection/py_find_injection/__init__.py/stringify/original