def METHOD_NAME(self, path, cost_dict):
    if path is not None:
        with gzip.open(path) as file:
            return json.loads(file.read())
    else:
        if cost_dict is not None:
            return cost_dict
        else:
            raise Exception