<filename>Preprocessing/code/utils/record.py<gh_stars>10-100
import os
import pickle

def mkdir(path):
    if os.path.exists(path) == False:
        os.makedirs(path)


def save_pickle(dir_name, file_name, data):

    '''
    :param file_path: ...
    :param data:
    :return:
    '''
    mkdir(dir_name)
    with open(dir_name + file_name + '.pickle', 'wb') as f:
        pickle.dump(data, f, protocol=pickle.HIGHEST_PROTOCOL)


def load_pickle(file_path):
    with open(file_path + '.pickle', 'rb') as f:
        data = pickle.load(f)

    return data


<filename>Preprocessing/code/utils/record.py<gh_stars>10-100
import os
import pickle

def mkdir(path):
    if os.path.exists(path) == False:
        os.makedirs(path)


def save_pickle(dir_name, file_name, data):

    '''
    :param file_path: ...
    :param data:
    :return:
    '''
    mkdir(dir_name)
    with open(dir_name + file_name + '.pickle', 'wb') as f:
        pickle.dump(data, f, protocol=pickle.HIGHEST_PROTOCOL)


def load_pickle(file_path):
    with open(file_path + '.pickle', 'rb') as f:
        data = pickle.load(f)

    return data


:param file_path: ...     :param data:     :return: