@classmethod
def _parse_args(cls, args, kwargs):
    """
        Parse kwargs and return a dict.
        :param kwargs: dict to parse
        :return:
        """
    if len(args) > 2:
        raise ValueError(
            'a maximum of 2 optional argument may be given ({} were given.)'
            .format(len(args)))
    for k in kwargs.keys():
        if k not in cls.default_config:
            raise TypeError('unknown option {}'.format(k))
    return kwargs
