code: def normalize_weights(self, samples, num_funcs):
      for i in range(CurveModel.NUM_INSTANCE):
          total = 0
          for j in range(num_funcs):
              total += samples[i][j]
          for j in range(num_funcs):
              samples[i][j] /= total
      return samples
  
imports: import scipy
  import logging
  import numpy
  import time
  from scipy import optimize
label_desc: Use image node_id 4 for calling the CurveModel obj's underlying member method code with example usage: obj.normalize_weights(samples, num_funcs) and returns: samples