code: def test_predecessor(self):
      assert dict(nx.bfs_predecessors(self.G, source=0)) == {
          1: 0,
          2: 1,
          3: 1,
          4: 2,
      }
  
imports: from functools import partial
  import pytest
  import networkx
label_desc: Use image node_id 3 for calling the TestBFS obj's underlying member method code with example usage: obj.test_predecessor() without return types