code: def weights(input_data, threshold=0.3):
      n_seq, length = input_data.shape
      weights = np.zeros(n_seq, dtype=np.float32)
  
      for i in range(n_seq):
          vector = input_data[i, None, :]
          count_matches = np.sum(vector == input_data, axis=1)
          over_threshold = count_matches > (threshold * length)
          total = np.sum(over_threshold)
          weights[i] = 1 / total
  
      return weights
  
label_desc: Use image node_id 1 for calling a global function with example usage: weights(input_data, threshold) and returns: weights