import pickle


def save_object(obj, filename):
    """ Write object as a pickle
    Args:
        obj: any object
        filename: output file
    """
    with open(filename, 'wb') as output:
        pickle.dump(obj, output, pickle.HIGHEST_PROTOCOL)
    return 0