def _try_tuple(k: Any) -> Any:
    """If we serialize a dictionary that had tuple keys, they get turned to json lists."""
    if isinstance(k, list):
        return tuple(k)
    return k  # pragma: no cover
If we serialize a dictionary that had tuple keys, they get turned to json lists.
cirq-google/cirq_google/workflow/quantum_runtime.py