import codecs


def _load_from_json(json_object: dict) -> object:
    """
    Load from JSON using custom schema (see code).

    Args:
        `json_object`: serialized JSON object as a Python dict.
    Returns:
        `python_object`: object hook for `json.load` function.
    """
    if "__class__" in json_object and json_object["__class__"] == "bytes":
        return codecs.decode(json_object["__value__"].encode(), "base64")
    return json_object