code: def loads(string, filename=None, includedir=''):
      '''Load the contents of ``string`` to a Python object
  
      The returned object is a subclass of ``dict`` that exposes string keys as
      attributes as well.
  
      Example:
  
          >>> config = libconf.loads('window: { title: "libconfig example"; };')
          >>> config['window']['title']
          'libconfig example'
          >>> config.window.title
          'libconfig example'
      '''
  
      try:
          f = io.StringIO(string)
      except TypeError:
          raise TypeError("libconf.loads() input string must by unicode")
  
      return load(f, filename=filename, includedir=includedirf loads(string, filename=None, includedir=''):
      '''Load the contents of ``string`` to a Python object
  
      The returned object is a subclass of ``dict`` that exposes string keys as
      attributes as well.
  
      Example:
  
          >>> config = libconf.loads('window: { title: "libconfig example"; };')
          >>> config['window']['title']
          'libconfig example'
          >>> config.window.title
          'libconfig example'
      '''
  
      try:
          f = io.StringIO(string)
      except TypeError:
          raise TypeError("libconf.loads() input string must by unicode")
  
      return load(f, filename=filename, includedir=includedir)
docs: Load the contents of ``string`` to a Python object
  
      The returned object is a subclass of ``dict`` that exposes string keys as
      attributes as well.
  
      Example:
  
          >>> config = libconf.loads('window: { title: "libconfig example"; };')
          >>> config['window']['title']
          'libconfig example'
          >>> config.window.title
          'libconfig example'