code: def _cut_is_locally_optimal(G, cut_size, set1):
      # test if cut can be locally improved
      for i, node in enumerate(set1):
          cut_size_without_node = nx.algorithms.cut_size(
              G, set1 - {node}, weight="weight"
          )
          assert cut_size_without_node <= cut_size
  
file_path: networkx/networkx/algorithms/approximation/tests/test_maxcut.py
imports: import random
  import pytest
  import networkx
  from networkx.algorithms.approximation import maxcut
label_desc: Use image node_id 3 for calling a global function with example usage: _cut_is_locally_optimal(G, cut_size, set1) without return types