예제 #1
0
파일: serial.py 프로젝트: w1kke/pylearn2
def to_string(obj):
    """
    .. todo::

        WRITEME
    """
    return cPickle.dumps(obj, get_pickle_protocol())
예제 #2
0
def to_string(obj):
    """
    .. todo::

        WRITEME
    """
    return cPickle.dumps(obj, get_pickle_protocol())
예제 #3
0
파일: serial.py 프로젝트: w1kke/pylearn2
def clone_via_serialize(obj):
    """
    .. todo::

        WRITEME
    """
    s = cPickle.dumps(obj, get_pickle_protocol())
    return cPickle.loads(s)
예제 #4
0
def clone_via_serialize(obj):
    """
    .. todo::

        WRITEME
    """
    s = cPickle.dumps(obj, get_pickle_protocol())
    return cPickle.loads(s)
예제 #5
0
def to_string(obj):
    """
    Serializes an object to a string.
    Parameters
    ----------
    obj : object
        The object to serialize.
    Returns
    -------
    string : str
        The object serialized as a string.
    """
    return cPickle.dumps(obj, get_pickle_protocol())
예제 #6
0
def clone_via_serialize(obj):
    """
    Makes a "deep copy" of an object by serializing it and then
    deserializing it.
    Parameters
    ----------
    obj : object
        The object to clone.
    Returns
    -------
    obj2 : object
        A copy of the object.
    """
    s = cPickle.dumps(obj, get_pickle_protocol())
    return cPickle.loads(s)