Execute simple code blocks.

        Do not attempt this on modules or other blocks where you have
        imports as they won't work.
        Instead write the code to a file and use runpy.run_path()

def exec(self, globals=None, locals=None):
        """
        Execute simple code blocks.

        Do not attempt this on modules or other blocks where you have
        imports as they won't work.
        Instead write the code to a file and use runpy.run_path()
        """
        if locals is None:
            locals = {}
        builtins.exec(self.to_code(), globals, locals)
        return locals