INNER CODE UNIT · Python
_extract_cell_output
Kotlin/kandy · util/kandy-samples-utils/nb_to_doc.py:41
def _extract_cell_output(output: Any) -> Tuple[Optional[str], Optional[str]]:
"""
Extract the type and content of a cell output.
Args:
output: The output object from a notebook cell
Returns:
Tuple of (output_type, output_content)
"""
output_type = None
output_content = None
if hasattr(output, 'data'):
if 'application/kotlindataframe+json' in output.data:
output_type = 'dataframe'
elif 'application/plot+json' in output.data:
output_type = 'plot'