code: def to_streaming(data, context=None, exceptions=None):
      id_ = id(data)
      logger.debug("to_streaming %s", id_)
      exceptions = _exceptions(exceptions)
      if not isinstance(data, pd.DataFrame):
          raise TypeError(f"Expected DataFrame got: {type(data)}")
      if hasattr(data, "__geo_interface__"):
          warnings.warn("Unhandled __geo_interface__, not streaming")
          return alt.to_values(data)
      if id_ in exceptions:
          logger.debug("Exception for %s", id_)
          return alt.to_values(data)
      if isinstance(context, dict):
          name = context.get(id_, None)
          if name is None:
              if len(context) == 0:
                  name = "data"
              else:
                  name = f"data-{len(context)+1}"
              context[id_] = (name, data)
          else:
              name = name[0]
      else:
          name = "data"
      return {"name": name}
  
file_path: ipyvega/vega/altair.py
imports: import warnings
  import logging
  from toolz import curried
  from IPython.display import display
  import pandas
  import altair
  from .widget import VegaWidget
label_desc: Use image node_id 2 for calling a global function with example usage: to_streaming(data, context, exceptions) and returns: dict, alt, alt