code: def _graph_dataset_iterator(
      ds_iter, graph: tf.Graph
  ) -> Iterator[NumpyElem]:
      """Constructs a Python generator from a tf.data.Iterator."""
      with graph.as_default():
          init = ds_iter.initializer
          ds_item = ds_iter.get_next()
          with utils.nogpu_session() as sess:
              sess.run(tf.compat.v1.tables_initializer())
              sess.run(init)
              while True:
                  try:
                      yield sess.run(ds_item)
                  except tf.errors.OutOfRangeError:
                      break
  
imports: from __future__ import annotations
  import collections.abc
  import functools
  import typing
  from typing import Any, Callable, Iterable, Iterator, Union
  from etils import enp
  from etils.etree import nest
  import numpy
  from tensorflow_datasets.core import logging
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.utils import tree_utils
  from tensorflow_datasets.core.utils import type_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: _graph_dataset_iterator(ds_iter, graph) without return types