import logging
import lzma
import pickle


def import_go_tree(import_location):
    """
    Decompresses and deserialises the given file containing the processed GO
    tree created by create_go_tree.py

    :type import_location: str
    :param import_location: File location of the LZMA compressed and pickled
        object.

    :rtype: dict[str, GoTerm]
    :return: The deserialised object from the file.
    """
    logging.info("Decompressing and importing GO dictionary from %s ...", import_location)
    with lzma.open(import_location, "rb") as f:
        return pickle.load(f)