import gzip
import json
from typing import OrderedDict


def open_gzipped_json_data(path_to_data: str):
    """
    Given an json.gz file this method opens it and return the content.
    :param path_to_data:
    :return:
    """
    with gzip.open(path_to_data, "rb") as f:
        return json.loads(f.read().decode("utf-8"), object_pairs_hook=OrderedDict)