# Path: hyperengine/base/util.py
# def smart_str(val):
#   if type(val) in [float, np.float32, np.float64] and val:
#     return '%.6f' % val if abs(val) > 1e-6 else '%e' % val
#   if type(val) == dict:
#     return '{%s}' % ', '.join(['%s: %s' % (repr(k), smart_str(val[k])) for k in sorted(val.keys())])
#   if type(val) in [list, tuple]:
#     return '[%s]' % ', '.join(['%s' % smart_str(i) for i in val])
#   return repr(val)


from .util import smart_str
    for k, v in input.items():
      if isinstance(v, (list, tuple)):
        setattr(self, k, [NamedDict(x) if isinstance(x, dict) else x for x in v])
      else:
        setattr(self, k, NamedDict(v) if isinstance(v, dict) else v)

  def keys(self):
    return self.__dict__.keys()

  def items(self):
    return self.__dict__.items()

  def values(self):
    return self.__dict__.values()

  def get(self, key, default=None):
    return self.__dict__.get(key, default)

  def __getitem__(self, key):
    return self.__dict__[key]

  def __getattribute__(self, key):
    if (key in ['get', 'keys', 'items', 'values']) or (key.startswith('__') and key.endswith('__')):
      return object.__getattribute__(self, key)
    return self.__dict__.get(key, None)

  def __contains__(self, key):
    return key in self.__dict__

  def __repr__(self):

# Path: hyperengine/base/util.py
# def smart_str(val):
#   if type(val) in [float, np.float32, np.float64] and val:
#     return '%.6f' % val if abs(val) > 1e-6 else '%e' % val
#   if type(val) == dict:
#     return '{%s}' % ', '.join(['%s: %s' % (repr(k), smart_str(val[k])) for k in sorted(val.keys())])
#   if type(val) in [list, tuple]:
#     return '[%s]' % ', '.join(['%s' % smart_str(i) for i in val])
#   return repr(val)


# Path: hyperengine/base/named_dict.py
from .util import smart_str

    for k, v in input.items():
      if isinstance(v, (list, tuple)):
        setattr(self, k, [NamedDict(x) if isinstance(x, dict) else x for x in v])
      else:
        setattr(self, k, NamedDict(v) if isinstance(v, dict) else v)

  def keys(self):
    return self.__dict__.keys()

  def items(self):
    return self.__dict__.items()

  def values(self):
    return self.__dict__.values()

  def get(self, key, default=None):
    return self.__dict__.get(key, default)

  def __getitem__(self, key):
    return self.__dict__[key]

  def __getattribute__(self, key):
    if (key in ['get', 'keys', 'items', 'values']) or (key.startswith('__') and key.endswith('__')):
      return object.__getattribute__(self, key)
    return self.__dict__.get(key, None)

  def __contains__(self, key):
    return key in self.__dict__

  def __repr__(self):

    return smart_str(self.__dict__)