class_docstr: Tests the helper functions.
class_docstr_tok: ["Tests","the","helper","functions","."]
docstr: Test that _n_k_gray_code produces the Gray code correctly.
docstr_tok: ["Test","that","_n_k_gray_code","produces","the","Gray","code","correctly","."]
code: def test_n_k_gray_code(self, n, k, expected_code):
      """Test that _n_k_gray_code produces the Gray code correctly."""
      for expected_word, word in zip(
          expected_code, _n_k_gray_code(n, k)
      ):
          assert expected_word == word
  
imports: import pytest
  import numpy
  from pennylane import numpy
  import pennylane
  from pennylane.templates.subroutines.arbitrary_unitary import _all_pauli_words_but_identity, _tuple_to_word, _n_k_gray_code
label_desc: Use image node_id 1 for calling the TestHelpers obj's underlying member method code with example usage: obj.test_n_k_gray_code(n, k, expected_code) without return types