def __getitem__(self, index):
        """
        Get the item at a given index.

        If `index` is a slice, you will get back that slice of items. If it's
        the slice [:], exactly the same object is returned. (If you want an
        independent copy of an OrderedSet, use `OrderedSet.copy()`.)

        If `index` is an iterable, you'll get the OrderedSet of items
        corresponding to those indices. This is similar to NumPy's
        "fancy indexing".
        """
        if index == SLICE_ALL:
            return self
        elif hasattr(index, '__index__') or isinstance(index, slice):
            result = self.items[index]
            if isinstance(result, list):
                return OrderedSet(result)
            else:
                return result
        elif is_iterable(index):
            return OrderedSet([self.items[i] for i in index])
        else:
            raise TypeError("Don't know how to index an OrderedSet by {}".format(repr(index)))
def __getitem__ ( self , index ) : if index == SLICE_ALL : return self elif hasattr ( index , '__index__' ) or isinstance ( index , slice ) : result = self . items [ index ] if isinstance ( result , list ) : return OrderedSet ( result ) else : return result elif is_iterable ( index ) : return OrderedSet ( [ self . items [ i ] for i in index ] ) else : raise TypeError ( "Don't know how to index an OrderedSet by {}" . format ( repr ( index ) ) )
Get the item at a given index.

        If `index` is a slice, you will get back that slice of items. If it's
        the slice [:], exactly the same object is returned. (If you want an
        independent copy of an OrderedSet, use `OrderedSet.copy()`.)

        If `index` is an iterable, you'll get the OrderedSet of items
        corresponding to those indices. This is similar to NumPy's
        "fancy indexing".