code: def test_negative_cycle_consistency(self):
      import random
  
      unif = random.uniform
      for random_seed in range(2):  # range(20):
          random.seed(random_seed)
          for density in [0.1, 0.9]:  # .3, .7, .9]:
              for N in [1, 10, 20]:  # range(1, 60 - int(30 * density)):
                  for max_cost in [1, 90]:  # [1, 10, 40, 90]:
                      G = nx.binomial_graph(
                          N, density, seed=4, directed=True
                      )
                      edges = (
                          (u, v, unif(-1, max_cost)) for u, v in G.edges
                      )
                      G.add_weighted_edges_from(edges)
  
                      no_heuristic = nx.negative_edge_cycle(
                          G, heuristic=False
                      )
                      with_heuristic = nx.negative_edge_cycle(
                          G, heuristic=True
                      )
                      assert no_heuristic == with_heuristic
  
imports: import pytest
  import networkx
  from networkx.utils import pairwise
label_desc: Use image node_id 5 for calling the TestBellmanFordAndGoldbergRadzik obj's underlying member method code with example usage: obj.test_negative_cycle_consistency() without return types