code: def __init__(self, default, *options, **kwargs):
      self.default = default
      self.all = (default,) + options
  
      # All options should be strings
      for val in self.all:
          if not isinstance(val, string_types):
              raise ValueError(
                  "Valid values for an EnumStr parameter "
                  "should be strings",
                  val,
                  type(val),
              )
  
      convert = kwargs.get("convert", None)
  
      def filter(val):
          if convert:
              val = convert(val)
          if val in self.all:
              return val
          else:
              raise ValueError(
                  (
                      'Invalid value ("%s") for configuration variable "%s". '
                      "Valid options are %s"
                      % (val, self.fullname, self.all)
                  )
              )
  
      over = kwargs.get("allow_override", True)
      super(EnumStr, self).__init__(default, filter, over)
  
imports: from __future__ import absolute_import, print_function, division
  import logging
  import os
  import shlex
  import sys
  import warnings
  from functools import wraps
  from six import StringIO, PY3, iteritems
  import theano
  from theano.compat import configparser
  from six import string_types
label_desc: Use image node_id 1 to create a new EnumStr object from inherited base classes: ConfigParam with example: obj = EnumStr(default)