code: def _calculate_weights(self):
      ensemble_members = Counter(self.indices_).most_common()
      weights = np.zeros((self.num_input_models_,), dtype=float)
      for ensemble_member in ensemble_members:
          weight = float(ensemble_member[1]) / self.ensemble_size
          weights[ensemble_member[0]] = weight
  
      if np.sum(weights) < 1:
          weights = weights / np.sum(weights)
  
      self.weights_ = weights
  
imports: import logging
  import time
  from collections import Counter
  import numpy
  from ...constants import PROBLEM_TYPES
  from ...metrics import log_loss
  from ...utils import compute_weighted_metric, get_pred_from_proba
label_desc: Use image node_id 5 for calling the EnsembleSelection obj's underlying member method code with example usage: obj._calculate_weights() without return types