code: def iter_(obj):
      
      if six.PY2:
          file_types = file,  # noqa
      if six.PY3:
          file_types = io.IOBase,
          dict_items = {}.items().__class__
          dict_values = {}.values().__class__
          dict_keys = {}.keys().__class__
          dict_view = (dict_items, dict_values, dict_keys)
  
      if isinstance(obj, dict):
          return ordered_sequence_iterator(list(obj.keys()))
      if isinstance(obj, file_types):
          return file_iterator(obj)
      if six.PY2:
          if isinstance(obj, (list, tuple)):
              return ordered_sequence_iterator(obj)
          if isinstance(obj, xrange):  # noqa
              return range_iterator(obj)
          if NUMPY_AVAILABLE and isinstance(obj, numpy.ndarray):
              return ordered_sequence_iterator(obj)
      if six.PY3 and isinstance(obj, dict_view):
          return ordered_sequence_iterator(list(obj))
      return iter(obj)
docs: A custom replacement for iter(), dispatching a few custom picklable
      iterators for known types.