code: def dump(cfg, f):
      '''Serialize ``cfg`` as a libconfig-formatted stream into ``f``
  
      ``cfg`` must be a ``dict`` with ``str`` keys and libconf-supported values
      (numbers, strings, booleans, possibly nested dicts, lists, and tuples).
  
      ``f`` must be a ``file``-like object with a ``write()`` method.
      '''
  
      if not isinstance(cfg, dict):
          raise ConfigSerializeError(
                  'dump() requires a dict as input, not %r of type %r' %
                  (cfg, type(cfg)))
  
      dump_dict(cfg, f, 0f dump(cfg, f):
      '''Serialize ``cfg`` as a libconfig-formatted stream into ``f``
  
      ``cfg`` must be a ``dict`` with ``str`` keys and libconf-supported values
      (numbers, strings, booleans, possibly nested dicts, lists, and tuples).
  
      ``f`` must be a ``file``-like object with a ``write()`` method.
      '''
  
      if not isinstance(cfg, dict):
          raise ConfigSerializeError(
                  'dump() requires a dict as input, not %r of type %r' %
                  (cfg, type(cfg)))
  
      dump_dict(cfg, f, 0)
docs: Serialize ``cfg`` as a libconfig-formatted stream into ``f``
  
      ``cfg`` must be a ``dict`` with ``str`` keys and libconf-supported values
      (numbers, strings, booleans, possibly nested dicts, lists, and tuples).
  
      ``f`` must be a ``file``-like object with a ``write()`` method.