@classmethod
    def from_dict(cls, option_dict):
        if len(option_dict) > 1:
            name = option_dict['name']
        else:
            name = list(option_dict.keys())[0]
            option_dict = option_dict[name]

        description = option_dict.get('description')
        shortcut = option_dict.get('shortcut')
        default = option_dict.get('default')
        value_required = option_dict.get('value_required')
        if value_required is True:
            mode = cls.VALUE_REQUIRED
        elif value_required is False:
            mode = cls.VALUE_OPTIONAL
        else:
            mode = cls.VALUE_NONE

        if option_dict.get('flag') is True:
            mode = cls.VALUE_NONE

        if mode != cls.VALUE_NONE and option_dict.get('list', False):
            mode |= cls.VALUE_IS_LIST

        validator = option_dict.get('validator')

        return cls(name, shortcut, mode, description, default, validator=validator)
Return a default Openstack region for testing.
dataset/ETHPy150Open sdispater/cleo/cleo/inputs/input_option.py/InputOption.from_dict--crossover with--dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/agents/testtools/_blockdevice.py/get_openstack_region_for_test