code: def sample(self):
      nodes, magnitudes = zip(*self.sample_map.items())
      return np.random.choice(
          nodes,
          p=np.array(magnitudes, dtype="float32") / np.sum(magnitudes),
      )
  
imports: import random
  import string
  import gast
  import numpy
  from nvidia.dali._autograph.pyct import gast_util
  from nvidia.dali._autograph.pyct import templates
label_desc: Use image node_id 1 for calling the NodeSampler obj's underlying member method code with example usage: obj.sample() and returns: np