code: def _calculate_weights(self) -> None:
      ensemble_members = Counter(self.indices_).most_common()
      weights = np.zeros(
          (self.num_input_models_,),
          dtype=np.float64,
      )
      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: from __future__ import annotations
  from typing import Dict, List, Sequence, Tuple, Union
  import random
  import warnings
  from collections import Counter
  import numpy
  from sklearn.utils import check_random_state
  from autosklearn.automl_common.common.utils.backend import Backend
  from autosklearn.constants import TASK_TYPES
  from autosklearn.data.validation import SUPPORTED_FEAT_TYPES
  from autosklearn.ensemble_building.run import Run
  from autosklearn.ensembles.abstract_ensemble import AbstractEnsemble
  from autosklearn.metrics import Scorer, calculate_losses
  from autosklearn.pipeline.base import BasePipeline
label_desc: Use image node_id 6 for calling the EnsembleSelection obj's underlying member method code with example usage: obj._calculate_weights() without return types