code: def export_path(path,
                  file_type=None,
                  file_obj=None,
                  **kwargs):
      
      # if file object is a string it is probably a file path
      # so we can split the extension to set the file type
      if util.is_string(file_obj):
          file_type = util.split_extension(file_obj)
  
      # run the export
      export = _path_exporters[file_type](path, **kwargs)
      # if we've been passed files write the data
      _write_export(export=export, file_obj=file_obj)
  
      return export
docs: Export a Path object to a file- like object, or to a filename
  
      Parameters
      ---------
      file_obj:  None, str, or file object
        A filename string or a file-like object
      file_type: None or str
        File type, e.g.: 'svg', 'dxf'
      kwargs : passed to loader
  
      Returns
      ---------
      exported : str or bytes
        Data exported