code: def test_cov_prob_loss():
      """Tests inpi_loss"""
  
      ##############################
      # Regular Calculations ####
      ##############################
      y_pred = None
      lower = pd.Series([0.5, 1.5, 2.5, 3.5])
      upper = pd.Series([1.5, 2.5, 3.5, 4.5])
  
      # All pass
      y_true = pd.Series([1, 2, 3, 4])
      loss = coverage(
          y_true=y_true, y_pred=y_pred, lower=lower, upper=upper
      )
      assert loss == 1.00
  
      # Upper Limit breached
      y_true = pd.Series([1, 2, 4, 4])
      loss = coverage(
          y_true=y_true, y_pred=y_pred, lower=lower, upper=upper
      )
      assert loss == 0.75
  
      # Lower Limit breached
      y_true = pd.Series([1, 1, 3, 4])
      loss = coverage(
          y_true=y_true, y_pred=y_pred, lower=lower, upper=upper
      )
      assert loss == 0.75
  
      # Both Limits breached
      y_true = pd.Series([1, 1, 4, 4])
      loss = coverage(
          y_true=y_true, y_pred=y_pred, lower=lower, upper=upper
      )
      assert loss == 0.50
  
      ##################################
      # Check for NANs in limits ####
      ##################################
      lower = pd.Series([np.nan] * 4)
      upper = pd.Series([np.nan] * 4)
      y_true = pd.Series([1, 2, 3, 4])
      loss = coverage(
          y_true=y_true, y_pred=y_pred, lower=lower, upper=upper
      )
      assert loss is np.nan
  
      ##################################
      # Check for NANs in y_true ####
      ##################################
      lower = pd.Series([0.5, 1.5, 2.5, 3.5])
      upper = pd.Series([1.5, 2.5, 3.5, 4.5])
      y_true = pd.Series([1, 2, np.nan, 4])
      loss = coverage(
          y_true=y_true, y_pred=y_pred, lower=lower, upper=upper
      )
      assert loss is np.nan
  
      ######################################
      # Check for mismatched indices ####
      ######################################
      lower = pd.Series([0.5, 1.5, 2.5, 3.5], index=[0, 1, 2, 3])
      upper = pd.Series([1.5, 2.5, 3.5, 4.5], index=[0, 1, 2, 3])
      y_true = pd.Series([1, 2, 3, 4], index=[0, 1, 2, 4])
      loss = coverage(
          y_true=y_true, y_pred=y_pred, lower=lower, upper=upper
      )
      assert loss is np.nan
  
file_path: pycaret/tests/test_time_series_metrics.py
imports: import numpy
  import pandas
  import pytest
  from pycaret.containers.metrics.time_series import coverage
  from pycaret.datasets import get_data
  from pycaret.time_series import TSForecastingExperiment
label_desc: Use image node_id 1 for calling a global function with example usage: test_cov_prob_loss() without return types