Serialize an object to disk using pickle protocol.

    Args:
        obj: The object to serialize.
        filename: Path to the output file.
        protocol: Version of the pickle protocol.

def save(obj, filename, protocol=4):
    """
    Serialize an object to disk using pickle protocol.

    Args:
        obj: The object to serialize.
        filename: Path to the output file.
        protocol: Version of the pickle protocol.
    """

    with open(filename, 'wb') as f:
        pickle.dump(obj, f, protocol=protocol)