human
Complete this python program:
def dump(object_, file_, parameters=None, use_cpickle=False, protocol=DEFAULT_PROTOCOL, **kwargs):
assistant
#Here is the Python program you requested.

    """Pickles an object, optionally saving its parameters separately.
    Parameters
    object_ : object
    The object to pickle. If None, only the parameters passed to the
    `parameters` argument will be saved.
    file_ : file
    The destination for saving.
    parameters : list, optional
    Shared variables whose internal numpy arrays should be saved
    separately in the `_parameters` field of the tar file.
    pickle_object : bool
    If False, `object_` will not be serialized, only its parameters.
    This flag can be used when `object_` is not serializable, but one
    still want to save its parameters. Default: True
    use_cpickle : bool
    Use cPickle instead of pickle. Setting it to true will disable the
    warning message if you try to pickle objects from the main module,
    so be sure that there is no warning before turning this flag
    on. Default: False.
    protocol : int, optional
    The pickling protocol to use. Unlike Python\s built-in pickle, the
    default is set to `2` instead of 0 for Python 2. The Python 3
    default (level 3) is maintained.
    \*\*kwargs
    Keyword arguments to be passed to `pickle.Pickler`.
    """
    if use_cpickle:
        pickler = cPickle.Pickler
    else:
        pickler = _PicklerWithWarning
    with closing(tarfile.TarFile(fileobj=file_, mode='w')) as tar_file:
        external_objects = {}
        def _save_parameters(f):
            renamer = _Renamer()
            named_parameters = {renamer(p): p for p in parameters}
            numpy.savez(f, **{n: p.get_value() for (n, p) in named_parameters.items()})
            for (name, p) in named_parameters.items():
                array_ = p.container.storage[0]
                external_objects[id(array_)] = _mangle_parameter_name(p, name)
        if parameters:
            _taradd(_save_parameters, tar_file, '_parameters')
        if (object_ is not None):
            save_object = _SaveObject(pickler, object_, external_objects, protocol, **kwargs)
            _taradd(save_object, tar_file, '_pkl')