code: def create_performance_profile(
      score_dict: Mapping[str, np.ndarray],
      tau_list: Union[List[Float], np.ndarray],
      use_score_distribution: bool = True,
      custom_profile_func: Optional[Callable[..., np.ndarray]] = None,
      method: str = "percentile",
      task_bootstrap: bool = False,
      reps: int = 2000,
      confidence_interval_size: Float = 0.95,
  ) -> Tuple[Dict[str, np.ndarray], Dict[str, np.ndarray]]:
      """Function for calculating performance profiles.
  
      Args:
        score_dict: A dictionary of scores for each method where scores are arranged
          as a matrix of the shape (`num_runs` x `num_tasks` x ..).
        tau_list: List or 1D numpy array of threshold values on which the profile is
          evaluated.
        use_score_distribution: Whether to report score distributions or average
          score distributions. Defaults to score distributions for smaller
          uncertainty in reported results with unbiased profiles.
        custom_profile_func: Custom performance profile function. Can be used to
          compute performance profiles other than score distributions.
        method: Bootstrap method for `StratifiedBootstrap`, defaults to percentile.
        task_bootstrap:  Whether to perform bootstrapping over tasks in addition to
          runs. Defaults to False. See `StratifiedBoostrap` for more details.
        reps: Number of bootstrap replications.
        confidence_interval_size: Coverage of confidence interval. Defaults to 95%.
  
      Returns:
        profiles: A dictionary of performance profiles for each key in `score_dict`.
          Each profile is a 1D np array of same size as `tau_list`.
        profile_cis: The 95% confidence intervals of profiles evaluated at
          all threshdolds in `tau_list`.
      """
  
      if custom_profile_func is None:
  
          def profile_function(scores):
              if use_score_distribution:
                  # Performance profile for scores across all tasks and runs
                  return score_distributions(scores, tau_list)
              # Performance profile for task scores averaged across runs
              return average_score_distributions(scores, tau_list)
  
      else:
          profile_function = lambda scores: custom_profile_func(
              scores, tau_list
          )
  
      profiles, profile_cis = get_interval_estimates(
          score_dict,
          func=profile_function,
          task_bootstrap=task_bootstrap,
          method=method,
          reps=reps,
          confidence_interval_size=confidence_interval_size,
      )
      return profiles, profile_cis
  
file_path: rliable/rliable/library.py
imports: from typing import Callable, Dict, List, Optional, Tuple, Union, Mapping
  from absl import logging
  import arch.bootstrap
  import numpy
  from numpy import random
label_desc: Use image node_id 4 for calling a global function with example usage: create_performance_profile(score_dict, tau_list, use_score_distribution, custom_profile_func, method, task_bootstrap, reps, confidence_interval_size) and returns: profiles,  profile_cis, average_score_distributions, score_distributions