code: def iter_cast(inputs, dst_type, return_type=None):
      """Cast elements of an iterable object into some type.
  
      Args:
          inputs (Iterable): The input object.
          dst_type (type): Destination type.
          return_type (type, optional): If specified, the output object will be
              converted to this type, otherwise an iterator.
  
      Returns:
          iterator or specified type: The converted object.
      """
      if not isinstance(inputs, abc.Iterable):
          raise TypeError("inputs must be an iterable object")
      if not isinstance(dst_type, type):
          raise TypeError('"dst_type" must be a valid type')
  
      out_iterable = map(dst_type, inputs)
  
      if return_type is None:
          return out_iterable
      else:
          return return_type(out_iterable)
  
imports: import collections.abc
  import functools
  import itertools
  import subprocess
  import warnings
  from collections import abc
  from importlib import import_module
  from inspect import getfullargspec
  from itertools import repeat
label_desc: Use image node_id 4 for calling a global function with example usage: iter_cast(inputs, dst_type, return_type) and returns: out_iterable, return_type