import json


def load_json(path=None, http_response=None):
    """Return the dict from the json file."""
    if path:
        with open(path) as f:
            return json.load(f)
    elif http_response: return json.load(http_response)
    else: raise Exception('ERROR: invalid filetype for json')