class_docstr: Wrapper around GCGraph, disabling its main functionalities to enable checking of the received values.
docstr: Compares the nweights hold by the graph with the once provided (as a dict).
docstr_tok: ["Compares","the","nweights","hold","by","the","graph","with","the","once","provided","(","as","a","dict",")","."]
code: def validate_nweights(self, unittest, expected_result, msg_base=""):
      """Compares the nweights hold by the graph with the once provided (as a dict)."""
      unittest.assertTrue(
          len(self.__nweights) == len(expected_result),
          "{}: Expected {} edges, but {} were added.".format(
              msg_base, len(expected_result), len(self.__nweights)
          ),
      )
      node_id_set = set()
      for key in list(self.__nweights.keys()):
          node_id_set.add(key[0])
          node_id_set.add(key[1])
      unittest.assertTrue(
          len(node_id_set) == self.__nodes
      ), "{}: Not all {} node-ids appeared in the edges, but only {}. Missing are {}.".format(
          msg_base,
          self.__nodes,
          len(node_id_set),
          set(range(0, self.__nodes)) - node_id_set,
      )
      self.__compare_dictionaries(
          unittest, self.__nweights, expected_result, msg_base
      )
  
imports: import sys
  import math
  import unittest
  import scipy
  import numpy
  from numpy.testing import assert_raises
  from medpy.graphcut.energy_label import boundary_stawiaski, boundary_difference_of_means, boundary_stawiaski_directed, regional_atlas
  from medpy.graphcut.graph import GCGraph
label_desc: Use image node_id 4 for calling the GCGraphTest obj's underlying member method code with example usage: obj.validate_nweights(unittest, expected_result, msg_base) without return types