code: def flatten(
      l: DeepIterable[T],
      stop: t.Optional[t.Callable[[t.Any], bool]] = None,
  ) -> t.Iterable[T]:
      """Flatten nested iterables."""
      for it in l:
          if callable(stop) and stop(it) is True:
              yield t.cast(T, it)
          elif isinstance(
              it, (list, tuple, set, t.Generator, t.Iterator)
          ):
              yield from flatten(it, stop=stop)
          else:
              yield t.cast(T, it)
  
imports: import io
  import json
  import textwrap
  import typing
  from contextlib import contextmanager
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import pandas
  import plotly.io._html
  from ipywidgets import DOMWidget
  from jsonpickle.pickler import Pickler
  from pandas.io.formats.style import Styler
  from plotly.io._utils import plotly_cdn_url
  from plotly.offline.offline import get_plotlyjs
  from deepchecks.core import check_result
  from deepchecks.core import errors
  from deepchecks.utils.dataframes import hide_index_for_display, un_numpy
  from deepchecks.utils.html import linktag
  from deepchecks.utils.strings import truncate_string
label_desc: Use image node_id 12 for calling a global function with example usage: flatten(l, stop) without return types