#NEWLINE# def iterate_graycode( self , k ) : #NEWLINE# #INDENT# '\n        Helper function used for prev_gray and next_gray.\n        It performs k step overs to get the respective Gray codes.\n\n        Examples\n        ========\n\n        >>> from sympy.combinatorics.subsets import Subset\n        >>> a = Subset([1, 2, 3], [1, 2, 3, 4])\n        >>> a.iterate_graycode(3).subset\n        [1, 4]\n        >>> a.iterate_graycode(-2).subset\n        [1, 2, 4]\n\n        See Also\n        ========\n        next_gray, prev_gray\n        ' #NEWLINE# unranked_code = GrayCode . unrank ( self . superset_size , ( ( self . rank_gray + k ) % self . cardinality ) ) #NEWLINE# return Subset . subset_from_bitlist ( k . superset , unranked_code )