import pickle


def load_graph(filename, location=None):
    """
    Load the pickled the adjacency matrix

    Parameters:

        filename - string;

        location (optional) - string; default location is within the library folder
    """

    if location:
        with open(location + '/' + filename, 'rb') as fin:
            data = pickle.load(fin)
            return data
    else:
        with open(filename, 'rb') as fin:
            data = pickle.load(fin)
            return data