<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def for_kind(kind_map, type_, fallback_key):
 """ Create an Options object from any mapping. """

        if type_ not in kind_map:
            if fallback_key not in kind_map:
                raise ConfigException('"%s" is not in the config and has no fallback' % type_)

            config = kind_map[fallback_key]
        else:
            config = kind_map[type_]

        if isinstance(config, dict):
            if 'element' not in config:
                raise ConfigException('"%s" does not define an element' % type_)

            opts = Options(type_, **config)
        else:
            opts = Options(type_, config)

        return opts