# 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






def create_dictionary(*args, **items):
    iargs = iter(args)
    return dict(zip(iargs, iargs), **items)


class KeywordDecoratorType(object):
    """The base class for a Test Library's `keyword` decorator.

    - Stores the Keyword method function
      in the Test Library's `keywords` mapping,
      after applying additional options (decorators) to the function.
    - Options are added with `__getattr__`,
      which generates new decorator class instances.
    """
    def __init__(self, keywords, *options, **meta):
        """Initialize with a Test Library's :class:`KeywordsDict` instance,
           additional `options` to apply to the decorated methods
           and custom `meta` info like name and args list overrides
           and explicit argtypes for automatic type conversions.
        """
        self.keywords = keywords

        for optionname in options:
            if not hasattr(type(self), 'option_' + optionname):

# 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







def create_dictionary(*args, **items):
    iargs = iter(args)
    return dict(zip(iargs, iargs), **items)


class KeywordDecoratorType(object):
    """The base class for a Test Library's `keyword` decorator.

    - Stores the Keyword method function
      in the Test Library's `keywords` mapping,
      after applying additional options (decorators) to the function.
    - Options are added with `__getattr__`,
      which generates new decorator class instances.
    """
    def __init__(self, keywords, *options, **meta):
        """Initialize with a Test Library's :class:`KeywordsDict` instance,
           additional `options` to apply to the decorated methods
           and custom `meta` info like name and args list overrides
           and explicit argtypes for automatic type conversions.
        """
        self.keywords = keywords

        for optionname in options:
            if not hasattr(type(self), 'option_' + optionname):

                raise InvalidKeywordOption(optionname)