parameters: (self, iterator, idx)
return_statement: return next(islice(iterator, idx, None))
docstring: Get the idx-th item of the iterator
docstring_summary: Get the idx-th item of the iterator
docstring_tokens: Get the idx - th item of the iterator
function: def _get_item_by_idx(self, iterator, idx) -> T:
          """Get the idx-th item of the iterator"""
          size = len(self)
          idx = operator.index(idx)
          if not -size <= idx < size:
              raise IndexError('index {} is out of range'.format(idx))
          idx %= size
          return next(islice(iterator, idx, None))
function_tokens: def _get_item_by_idx ( self , iterator , idx ) -> T : size = len ( self ) idx = operator . index ( idx ) if not - size <= idx < size : raise IndexError ( 'index {} is out of range' . format ( idx ) ) idx %= size return next ( islice ( iterator , idx , None ) )