code: def _check_and_clean_coverage(
      coverage: Union[float, List[float]]
  ) -> List[float]:
      """Checks the coverage to make sure it is of the allowed types (float or List).
      Returns the lower and upper quantiles for the coverage.
  
      If it is of type
      (1) List, it must have a length 2 indicating the lower and upper quantiles.
      (2) float, it is converted to a List of length 2 indicating the lower and
      upper quantiles.
  
      Parameters
      ----------
      coverage : Union[float, List[float]]
          The coverage value to be checked and cleaned
  
      Returns
      -------
      List[float]
          A list of length 2, indicating the quantiles corresponding to the lower
          and upper intervals
  
      Raises
      ------
      TypeError
          coverage is not of the correct type - List or float
      ValueError
          If coverage is of type List but not of length 2
      """
      if not isinstance(coverage, (float, list)):
          raise TypeError(
              f"'coverage' must be of type float or a List of floats of length 2. "
              f"You passed coverage of type: '{type(coverage)}'"
          )
      elif isinstance(coverage, list) and len(coverage) != 2:
          raise ValueError(
              "When coverage is a list, it must be of length 2 corresponding to the "
              f"lower and upper quantile of the prediction. You specified: '{coverage}'"
          )
  
      if isinstance(coverage, float):
          lower_quantile = (1 - coverage) / 2
          upper_quantile = 1 - lower_quantile
          coverage = [lower_quantile, upper_quantile]
      elif isinstance(coverage, list):
          coverage.sort()
  
      return coverage
  
imports: from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  from sktime.forecasting.base import ForecastingHorizon
label_desc: Use image node_id 1 for calling a global function with example usage: _check_and_clean_coverage(coverage) and returns: coverage