Create an enum config
        :param enum_type:
        :param help_string:
        :param default:
        :return:
459
def create_enum(enum_type, help_string=NO_HELP, default=NO_DEFAULT):
        # type: (Type[Enum], str, Union[Any, NO_DEFAULT_TYPE]) -> Type[Enum]
        
        # noinspection PyTypeChecker
        return ParamEnum(
            help_string=help_string,
            default=default,
            enum_type=enum_type,
        )
92002
def __parameter_enum(self, param):
    
    if isinstance(param, messages.EnumField):
      return [enum_entry[0] for enum_entry in sorted(
          param.type.to_dict().items(), key=lambda v: v[1])]
732132
def dict_to_enum_fn(d: Dict[str, Any], enum_class: Type[Enum]) -> Enum:
    
    return enum_class[d['name']]
76852
function enums(schema, defaults, options) {
  const e = en(schema, undefined, options)
  const l = list([e], defaults, options)
  return l
}
1346073
def mime_type(self, type_: Optional[MimeType] = None) -> str:
        
        key = self._validate_enum(item=type_, enum=MimeType)
        types = MIME_TYPES[key]
        return self.random.choice(types)
47879
def setting(self, setting_name, default=None):  # type: (str) -> Any
        
        keys = setting_name.split(".")

        config = self._content
        for key in keys:
            if key not in config:
                return default

            config = config[key]

        return config
794438
def is_config_type(type_):
    

    return (
        isinstance(type_, type)
        and hasattr(type_, "__attrs_attrs__")
        and hasattr(type_, CONFIG_KEY)
    )
1301753
def enum(enum_type='enum', base_classes=None, methods=None, **attrs):
    
    # Enumerations can not be initalized as a new instance
    def __init__(instance, *args, **kwargs):
        raise RuntimeError('%s types can not be initialized.' % enum_type)

    if base_classes is None:
        base_classes = ()

    if methods is None:
        methods = {}

    base_classes = base_classes + (object,)
    for k, v in methods.items():
        methods[k] = classmethod(v)

    attrs['enums'] = attrs.copy()
    methods.update(attrs)
    methods['__init__'] = __init__
    return type(to_string(enum_type), base_classes, methods)
370081
def create_choice(choice_list, help_string=NO_HELP, default=NO_DEFAULT):
        # type: (List[str], str, Union[Any, NO_DEFAULT_TYPE]) -> str
        
        # noinspection PyTypeChecker
        return ParamChoice(
            help_string=help_string,
            default=default,
            choice_list=choice_list,
        )
751856
def set_defaults(self, default_config_params):
        
        map = StringValueMap.from_maps(default_config_params, self)
        return ConfigParams(map)
156049
def _create_enum_class(ffi, type_name, prefix, flags=False):
    """"""

    class _template(int):
        _map = {}

        @property
        def value(self):
            return int(self)

        def __str__(self):
            return self._map.get(self, "Unknown")

        def __repr__(self):
            return "%s.%s" % (type(self).__name__, str(self))

    class _template_flags(int):
        _map = {}

        @property
        def value(self):
            return int(self)

        def __str__(self):
            names = []
            val = int(self)
            for flag, name in self._map.items():
                if val & flag:
                    names.append(name)
                    val &= ~flag
            if val:
                names.append(str(val))
            return " | ".join(sorted(names or ["Unknown"]))

        def __repr__(self):
            return "%s(%s)" % (type(self).__name__, str(self))

    if flags:
        template = _template_flags
    else:
        template = _template

    cls = type(type_name, template.__bases__, dict(template.__dict__))
    prefix_len = len(prefix)
    for value, name in ffi.typeof(type_name).elements.items():
        assert name[:prefix_len] == prefix
        name = name[prefix_len:]
        setattr(cls, name, cls(value))
        cls._map[value] = name

    return cls
1180466
def get_default_config_help(self):
        
        config = super(TSDBHandler, self).get_default_config_help()

        config.update({
            'host': '',
            'port': '',
            'timeout': '',
            'tags': '',
            'prefix': '',
            'batch': '',
            'compression': '',
            'user': '',
            'password': '',
            'cleanMetrics': True,
            'skipAggregates': True,
        })

        return config
927804
def configuration(name, type)
      default_settings = default_settings_for_type(type)
      configurations = configurations_of_type(type)

      build_configuration = if name.nil?
                              configurations.first
                            else
                              configurations.detect do |c|
                                c.name == name.to_s
                              end
                            end

      if build_configuration.nil?

        name = type.to_s.capitalize if name.nil?

        build_configuration = Configuration.new(name) do |b|
          b.type = type
          b.settings.merge!(default_settings)

          yield(b) if block_given?
        end

        @configurations ||= []
        @configurations << build_configuration
      end

      build_configuration
    end
715513
def _generate_configs_from_default(self, overrides=None):
        # type: (Dict[str, int]) -> Dict[str, int]
        
        config = DEFAULT_CONFIG.copy()
        if not overrides:
            overrides = {}
        for k, v in overrides.items():
            config[k] = v
        return config
362787
def register(cls, config_type: Type[DecoderConfig], suffix: str):
        
        def wrapper(target_cls):
            cls.__registry[config_type] = (target_cls, suffix)
            return target_cls

        return wrapper
80146
def _Enum(docstring, *names):
  
  enums = dict(zip(names, range(len(names))))
  reverse = dict((value, key) for key, value in enums.iteritems())
  enums['reverse_mapping'] = reverse
  enums['__doc__'] = docstring
  return type('Enum', (object,), enums)
1120510
def get_default_config_help(self):
        
        config = super(GraphitePickleHandler, self).get_default_config_help()

        config.update({
        })

        return config