code: def test_immediate_raise(self):
      @not_implemented_for("directed")
      def yield_nodes(G):
          yield from G
  
      G = nx.Graph([(1, 2)])
      D = nx.DiGraph()
  
      # test first call (argmap is compiled and executed)
      with pytest.raises(nx.NetworkXNotImplemented):
          node_iter = yield_nodes(D)
  
      # test second call (argmap is only executed)
      with pytest.raises(nx.NetworkXNotImplemented):
          node_iter = yield_nodes(D)
  
      # ensure that generators still make generators
      node_iter = yield_nodes(G)
      next(node_iter)
      next(node_iter)
      with pytest.raises(StopIteration):
          next(node_iter)
  
imports: import os
  import pathlib
  import random
  import tempfile
  import pytest
  import networkx
  from networkx.utils.decorators import argmap, not_implemented_for, np_random_state, open_file, py_random_state
  from networkx.utils.misc import PythonRandomInterface
label_desc: Use image node_id 11 for calling the TestArgmap obj's underlying member method code with example usage: obj.test_immediate_raise() without return types