# Path: robottools/testrobot/keyword.py
# class Keyword(KeywordInspector):
#     def __init__(self, handler, context, debug=False):
#         KeywordInspector.__init__(self, handler)
#         if not isinstance(handler, Handler):
#             handler.__class__ = Handler[handler.__class__]
#         self._context = context
#         self._debug = debug
# 
#     @property
#     def __doc__(self):
#         return KeywordInspector.__doc__.fget(self)
# 
#     def __call__(self, *args, **kwargs):
#         # HACK: normally, RFW's Keyword argument resolvers expect
#         # a plain list of arguments coming from an RFW script,
#         # which has limitations, as described in the .handler.Handler wrapper,
#         # which is patched later into the actual Keyword function runner
#         # by self._context.get_runner(),
#         # and which expects the (args, kwargs) pair instead
#         if self._debug:
#             runner = DebugKeyword(self.name, args=(args, kwargs))
#         else:
#             runner = robot.running.Keyword(self.name, args=(args, kwargs))
#         # HACK: `with` registers Context to EXECUTION_CONTEXTS
#         # and Output to LOGGER:
#         with self._context as ctx:
#             try:
#                 # Robot >= 2.9
#                 if (StatusReporter or NormalRunner) and isinstance(
#                         runner, DebugKeyword
#                 ):
#                     with runner:
#                         return runner.run(ctx)
# 
#                 return runner.run(ctx)
#             # Robot 2.8: raised by robot.running.Keyword:
#             except HandlerExecutionFailed:
#                 pass
# 
#     def debug(self, *args, **kwargs):
#         keyword = Keyword(self._handler, self._context, debug=True)
#         return keyword(*args, **kwargs)


from robot.errors import DataError
from robot.running import EXECUTION_CONTEXTS
from robot.running.namespace import Importer
from .keyword import Keyword
import robot.running.namespace
        #HACK: Registers output to LOGGER
        self.output.__enter__()
        return self

    def __exit__(self, *exc):
        #HACK: Unregisters output from LOGGER
        self.output.__exit__(*exc)
        #HACK:
        EXECUTION_CONTEXTS._contexts = []
        robot.running.namespace.IMPORTER = None

    @property
    def variables(self):
        return self.testrobot._variables

    @property
    def output(self):
        return self.testrobot._output

    @property
    def namespace(self):
        return self.testrobot._namespace

    @property
    def keywords(self):
        return []

    def get_handler(self, name):
        try:
            keyword = self.testrobot[name]

# Path: robottools/testrobot/keyword.py
# class Keyword(KeywordInspector):
#     def __init__(self, handler, context, debug=False):
#         KeywordInspector.__init__(self, handler)
#         if not isinstance(handler, Handler):
#             handler.__class__ = Handler[handler.__class__]
#         self._context = context
#         self._debug = debug
# 
#     @property
#     def __doc__(self):
#         return KeywordInspector.__doc__.fget(self)
# 
#     def __call__(self, *args, **kwargs):
#         # HACK: normally, RFW's Keyword argument resolvers expect
#         # a plain list of arguments coming from an RFW script,
#         # which has limitations, as described in the .handler.Handler wrapper,
#         # which is patched later into the actual Keyword function runner
#         # by self._context.get_runner(),
#         # and which expects the (args, kwargs) pair instead
#         if self._debug:
#             runner = DebugKeyword(self.name, args=(args, kwargs))
#         else:
#             runner = robot.running.Keyword(self.name, args=(args, kwargs))
#         # HACK: `with` registers Context to EXECUTION_CONTEXTS
#         # and Output to LOGGER:
#         with self._context as ctx:
#             try:
#                 # Robot >= 2.9
#                 if (StatusReporter or NormalRunner) and isinstance(
#                         runner, DebugKeyword
#                 ):
#                     with runner:
#                         return runner.run(ctx)
# 
#                 return runner.run(ctx)
#             # Robot 2.8: raised by robot.running.Keyword:
#             except HandlerExecutionFailed:
#                 pass
# 
#     def debug(self, *args, **kwargs):
#         keyword = Keyword(self._handler, self._context, debug=True)
#         return keyword(*args, **kwargs)


# Path: robottools/testrobot/context.py
from robot.errors import DataError
from robot.running import EXECUTION_CONTEXTS
from robot.running.namespace import Importer
from .keyword import Keyword
import robot.running.namespace

        #HACK: Registers output to LOGGER
        self.output.__enter__()
        return self

    def __exit__(self, *exc):
        #HACK: Unregisters output from LOGGER
        self.output.__exit__(*exc)
        #HACK:
        EXECUTION_CONTEXTS._contexts = []
        robot.running.namespace.IMPORTER = None

    @property
    def variables(self):
        return self.testrobot._variables

    @property
    def output(self):
        return self.testrobot._output

    @property
    def namespace(self):
        return self.testrobot._namespace

    @property
    def keywords(self):
        return []

    def get_handler(self, name):
        try:
            keyword = self.testrobot[name]

            if type(keyword) is not Keyword: