def runctx(self, cmd, globals, locals):
        """Similar to profile.Profile.runctx ."""
        with self():
            exec(cmd, globals, locals)
        return self
Similar to profile.Profile.runctx .