code: def _is_unordered(collection):
      
      if not isinstance(collection, Iterable):
          raise TypeError("Non-iterable alleged collection: {}".
                          format(type(collection)))
      return isinstance(collection, set) or \
             (isinstance(collection, dict) and
              not isinstance(collection, OrderedDict))
docs: Determine whether a collection appears to be unordered.
  
      This is a conservative implementation, allowing for the possibility that
      someone's implemented Mapping or Set, for example, and provided an
      __iter__ implementation that defines a consistent ordering of the
      collection's elements.
  
      :param object collection: Object to check as an unordered collection.
      :return bool: Whether the given object appears to be unordered
      :raises TypeError: If the given "collection" is non-iterable, it's
          illogical to investigate whether it's ordered.