code: def apply_do_fn(
      fn: Callable[[Any], Iterator[Any]],
  ) -> ExampleTransformFn:
      """Applies `fn` that can return any number of examples based on an input.
  
      A do_fn can be used for multiple purposes such as augmentations, but also to
      filter examples.
  
      Arguments:
        fn: the function that takes an example and outputs 0 or more examples.
  
      Returns:
        function that can be applied to perform a do fn.
      """
      return functools.partial(_apply_do_fn, fn=fn)
  
file_path: datasets/tensorflow_datasets/core/transform/transform_lib.py
imports: from __future__ import annotations
  import functools
  from typing import Any, Callable, Iterator, List, Mapping, Optional, Union
  import numpy
  from tensorflow_datasets.core import split_builder
label_desc: Use image node_id 9 for calling a global function with example usage: apply_do_fn(fn) and returns: functools