code: def dump(obj, fp, pretty=False, escaped=True):
      
      if not isinstance(obj, dict):
          raise TypeError("Expected data to be an instance of``dict``")
      if not hasattr(fp, 'write'):
          raise TypeError("Expected fp to have write() method")
      if not isinstance(pretty, bool):
          raise TypeError("Expected pretty to be of type bool")
      if not isinstance(escaped, bool):
          raise TypeError("Expected escaped to be of type bool")
  
      for chunk in _dump_gen(obj, pretty, escaped):
          fp.write(chunk)
docs: Serialize ``obj`` as a VDF formatted stream to ``fp`` (a
      ``.write()``-supporting file-like object).