code: def weighted_wheel_selection(weights: List[float]) -> int:
      """Selects an individual from a weight-based roulette.
  
      Args:
          weights: List of individuals weights.
  
      Returns:
          (int): Weight-based roulette individual.
  
      """
  
      cumulative_sum = np.cumsum(weights)
      prob = r.generate_uniform_random_number() * cumulative_sum[-1]
  
      for i, c_sum in enumerate(cumulative_sum):
          if c_sum > prob:
              return i
  
      return None
  
file_path: opytimizer/opytimizer/math/general.py
imports: from itertools import islice
  from typing import Any, Iterable, List, Optional
  import numpy
  import opytimizer.math.random
label_desc: Use image node_id 5 for calling a global function with example usage: weighted_wheel_selection(weights) and returns: None, i