def _serialize(data: pd.DataFrame, fmt: str) -> Tuple[str, str]:
     """Serialize data to the given format."""
     if fmt == "json":
         content = _data_to_json_string(data)
     elif fmt == "csv":
         content = _data_to_csv_string(data)
     else:
         raise ValueError(f"Unrecognized format: {fmt!r}")
     return content, _compute_data_hash(content)
 def _serialize(data, fmt):
     """Serialize data to the given format."""
     from altair.utils.data import _data_to_json_string, _data_to_csv_string, _compute_data_hash
     if fmt == 'json':
         content = _data_to_json_string(data)
     elif fmt == 'csv':
         content = _data_to_csv_string(data)
     else:
         raise ValueError("Unrecognized format: '{0}'".format(fmt))
     return content, _compute_data_hash(content)