def dump(value, filename, compress=0, cache_size=100, protocol=None):
    'Fast persistence of an arbitrary Python object into one or multiple\n    files, with dedicated storage for numpy arrays.\n\n    Parameters\n    -----------\n    value: any Python object\n        The object to store to disk\n    filename: string\n        The name of the file in which it is to be stored\n    compress: integer for 0 to 9, optional\n        Optional compression level for the data. 0 is no compression.\n        Higher means more compression, but also slower read and\n        write times. Using a value of 3 is often a good compromise.\n        See the notes for more details.\n    cache_size: positive number, optional\n        Fixes the order of magnitude (in megabytes) of the cache used\n        for in-memory compression. Note that this is just an order of\n        magnitude estimate and that for big arrays, the code will go\n        over this value at dump and at load time.\n    protocol: positive int\n        Pickle protocol, see pickle.dump documentation for more details.\n\n    Returns\n    -------\n    filenames: list of strings\n        The list of file names in which the data is stored. If\n        compress is false, each array is stored in a different file.\n\n    See Also\n    --------\n    joblib.load : corresponding loader\n\n    Notes\n    -----\n    Memmapping on load cannot be used for compressed files. Thus\n    using compression can significantly slow down loading. In\n    addition, compressed files take extra extra memory during\n    dump and load.\n    '
    if (compress is True):
        compress = 3
    if (not isinstance(filename, _basestring)):
        raise ValueError(('Second argument should be a filename, %s (type %s) was given' % (filename, type(filename))))
    try:
        pickler = NumpyPickler(filename, compress=compress, cache_size=cache_size, protocol=protocol)
        pickler.dump(value)
        pickler.close()
    finally:
        if (('pickler' in locals()) and hasattr(pickler, 'file')):
            pickler.file.flush()
            pickler.file.close()
    return pickler._filenames
Fast persistence of an arbitrary Python object into one or multiple
files, with dedicated storage for numpy arrays.

Parameters
-----------
value: any Python object
    The object to store to disk
filename: string
    The name of the file in which it is to be stored
compress: integer for 0 to 9, optional
    Optional compression level for the data. 0 is no compression.
    Higher means more compression, but also slower read and
    write times. Using a value of 3 is often a good compromise.
    See the notes for more details.
cache_size: positive number, optional
    Fixes the order of magnitude (in megabytes) of the cache used
    for in-memory compression. Note that this is just an order of
    magnitude estimate and that for big arrays, the code will go
    over this value at dump and at load time.
protocol: positive int
    Pickle protocol, see pickle.dump documentation for more details.

Returns
-------
filenames: list of strings
    The list of file names in which the data is stored. If
    compress is false, each array is stored in a different file.

See Also
--------
joblib.load : corresponding loader

Notes
-----
Memmapping on load cannot be used for compressed files. Thus
using compression can significantly slow down loading. In
addition, compressed files take extra extra memory during
dump and load.
def dump(value, filename, compress=0, cache_size=100, protocol=None):
    'Fast persistence of an arbitrary Python object into one or multiple\n    files, with dedicated storage for numpy arrays.\n\n    Parameters\n    -----------\n    value: any Python object\n        The object to store to disk\n    filename: string\n        The name of the file in which it is to be stored\n    compress: integer for 0 to 9, optional\n        Optional compression level for the data. 0 is no compression.\n        Higher means more compression, but also slower read and\n        write times. Using a value of 3 is often a good compromise.\n        See the notes for more details.\n    cache_size: positive number, optional\n        Fixes the order of magnitude (in megabytes) of the cache used\n        for in-memory compression. Note that this is just an order of\n        magnitude estimate and that for big arrays, the code will go\n        over this value at dump and at load time.\n    protocol: positive int\n        Pickle protocol, see pickle.dump documentation for more details.\n\n    Returns\n    -------\n    filenames: list of strings\n        The list of file names in which the data is stored. If\n        compress is false, each array is stored in a different file.\n\n    See Also\n    --------\n    joblib.load : corresponding loader\n\n    Notes\n    -----\n    Memmapping on load cannot be used for compressed files. Thus\n    using compression can significantly slow down loading. In\n    addition, compressed files take extra extra memory during\n    dump and load.\n    '
    if (compress is True):
        compress = 3
    if (not isinstance(filename, _basestring)):
        raise ValueError(('Second argument should be a filename, %s (type %s) was given' % (filename, type(filename))))
    try:
        pickler = NumpyPickler(filename, compress=compress, cache_size=cache_size, protocol=protocol)
        pickler.dump(value)
        pickler.close()
    finally:
        if (('pickler' in locals()) and hasattr(pickler, 'file')):
            pickler.file.flush()
            pickler.file.close()
    return pickler._filenames