# Path: robottools/utils/normdict.py
# def normdictdata(nd):
#     """Get the internal data dict with normalized keys
#        of :class:`robot.utils.NormalizedDict` instance `nd`
#     """
#     if not isinstance(nd, base):
#         raise TypeError(
#           "normdictdata() arg must be a robot.utils.NormalizedDict instance")
#     return nd.data if _has_UserDict_base else nd._data
# 
# Path: robottools/library/keywords/utils.py
# class KeywordName(str):
#     """:class:`str` wrapper to work with Keyword names in a Robot way.
# 
#     * Converts the given raw Keyword name (usually a function name)
#       to Capitalized Robot Style.
#     * Uses :func:`robot.utils.normalize`d conversions
#       (plain lowercase without spaces and underscores)
#       for comparing and hashing.
#     """
#     def __new__(cls, name='', convert=True):
#         if convert and type(name) is not KeywordName:
#             name = camelize(name, joiner=' ')
#         return str.__new__(cls, name)
# 
#     @property
#     def normalized(self):
#         return normalize(str(self), ignore='_')
# 
#     def __eq__(self, name):
#         return self.normalized == normalize(name, ignore='_')
# 
#     def __hash__(self):
#         return hash(self.normalized)
# 
# Path: robottools/library/keywords/errors.py
# class InvalidKeywordOption(LookupError):
#     pass
# 
# class KeywordNotDefined(LookupError):
#     pass


from six import PY3
from itertools import chain
from moretools import isstring, dictitems
from robot.utils import NormalizedDict
from robot.variables import is_scalar_var
from robot.libraries.BuiltIn import BuiltIn, RobotNotRunningError
from robottools.utils import normdictdata
from .utils import KeywordName
from .errors import InvalidKeywordOption, KeywordNotDefined
import inspect
            for context in self.contexts:
                context(func)
        try:
            contexts = func.contexts
        except AttributeError:
            contexts = None
        # Save original doc string
        doc = func.__doc__
        try:
            argspec = func.argspec
        except AttributeError:
            argspec = inspect.getargspec(func)

        # Use at least one wrapper to make attribute assignments always work
        def func(self, *args, **kwargs):
            return original_func(self, *args, **kwargs)

        func.__name__ = original_func.__name__
        func.argspec = argspec
        # Apply options
        for optionname in self.options:
            decorator = getattr(type(self), 'option_' + optionname)
            func = decorator(func)
            try: # does returned function still have argspec attribute?
                # (unchanged function or option has assigned new argspec)
                argspec = func.argspec
            except AttributeError:
                # Store previous argspec
                func.argspec = argspec
        if name:

# Path: robottools/utils/normdict.py
# def normdictdata(nd):
#     """Get the internal data dict with normalized keys
#        of :class:`robot.utils.NormalizedDict` instance `nd`
#     """
#     if not isinstance(nd, base):
#         raise TypeError(
#           "normdictdata() arg must be a robot.utils.NormalizedDict instance")
#     return nd.data if _has_UserDict_base else nd._data
# 
# Path: robottools/library/keywords/utils.py
# class KeywordName(str):
#     """:class:`str` wrapper to work with Keyword names in a Robot way.
# 
#     * Converts the given raw Keyword name (usually a function name)
#       to Capitalized Robot Style.
#     * Uses :func:`robot.utils.normalize`d conversions
#       (plain lowercase without spaces and underscores)
#       for comparing and hashing.
#     """
#     def __new__(cls, name='', convert=True):
#         if convert and type(name) is not KeywordName:
#             name = camelize(name, joiner=' ')
#         return str.__new__(cls, name)
# 
#     @property
#     def normalized(self):
#         return normalize(str(self), ignore='_')
# 
#     def __eq__(self, name):
#         return self.normalized == normalize(name, ignore='_')
# 
#     def __hash__(self):
#         return hash(self.normalized)
# 
# Path: robottools/library/keywords/errors.py
# class InvalidKeywordOption(LookupError):
#     pass
# 
# class KeywordNotDefined(LookupError):
#     pass


# Path: robottools/library/keywords/deco.py
from six import PY3
from itertools import chain
from moretools import isstring, dictitems
from robot.utils import NormalizedDict
from robot.variables import is_scalar_var
from robot.libraries.BuiltIn import BuiltIn, RobotNotRunningError
from robottools.utils import normdictdata
from .utils import KeywordName
from .errors import InvalidKeywordOption, KeywordNotDefined
import inspect

            for context in self.contexts:
                context(func)
        try:
            contexts = func.contexts
        except AttributeError:
            contexts = None
        # Save original doc string
        doc = func.__doc__
        try:
            argspec = func.argspec
        except AttributeError:
            argspec = inspect.getargspec(func)

        # Use at least one wrapper to make attribute assignments always work
        def func(self, *args, **kwargs):
            return original_func(self, *args, **kwargs)

        func.__name__ = original_func.__name__
        func.argspec = argspec
        # Apply options
        for optionname in self.options:
            decorator = getattr(type(self), 'option_' + optionname)
            func = decorator(func)
            try: # does returned function still have argspec attribute?
                # (unchanged function or option has assigned new argspec)
                argspec = func.argspec
            except AttributeError:
                # Store previous argspec
                func.argspec = argspec
        if name:

            name = KeywordName(name, convert=False)