'Checks for violations in Python code snippet. This can also be used for
Python that appears in files other than .py files, like in templates.
Arguments:
python_code: The contents of the Python code.
root_node: The root node of the Python code parsed by AST.
results: A file results objects to which violations will be added.'

def check_python_code_is_safe(self, python_code, root_node, results):

    if (root_node is not None):
        visitor = AllNodeVisitor(python_code, results)
        visitor.visit(root_node)
    self._check_custom_escape(python_code, results)
