code: def profile_plot(profile, device=None):
      """Generate a visualization over time of the memory usage recorded by kineto memory profiling as an html file.
  
      Args:
          profile: profile as generated by `torch.profiler.profile(profile_memory=True)`
          device (torch.device, optional): Generate the trace for this device, needed if multiple devices have allocations.
  
      Returns:
          str: HTML of visualization
      """
      snapshot = _profile_to_snapshot(profile)
      return _format_viz(snapshot, "Active Memory Timeline", device)
  
imports: import pickle
  import sys
  import os
  import io
  import subprocess
  import json
  from functools import lru_cache
  from typing import Any
  from itertools import groupby
  import base64
  import warnings
label_desc: Use image node_id 19 for calling a global function with example usage: profile_plot(profile, device) and returns: _format_viz