docstr: Format propensity scores into a dictionary of {treatment group: propensity scores}.
  
  Args:
      p (np.ndarray, pd.Series, or dict): propensity scores
      t_groups (list): treatment group names.
  
  Returns:
      dict of {treatment group: propensity scores}
docstr_tok: ["Format","propensity","scores","into","a","dictionary","of","{","treatment","group",":","propensity","scores","}",".","Args",":","p","(","np.ndarray",",","pd.Series",",","or","dict",")",":","propensity","scores","t_groups","(","list",")",":","treatment","group","names",".","Returns",":","dict","of","{","treatment","group",":","propensity","scores","}"]
code: def _format_p(p, t_groups):
      """Format propensity scores into a dictionary of {treatment group: propensity scores}.
  
      Args:
          p (np.ndarray, pd.Series, or dict): propensity scores
          t_groups (list): treatment group names.
  
      Returns:
          dict of {treatment group: propensity scores}
      """
      check_p_conditions(p, t_groups)
  
      if isinstance(p, (np.ndarray, pd.Series)):
          treatment_name = t_groups[0]
          p = {treatment_name: convert_pd_to_np(p)}
      elif isinstance(p, dict):
          p = {
              treatment_name: convert_pd_to_np(_p)
              for treatment_name, _p in p.items()
          }
  
      return p
  
imports: from abc import ABCMeta, abstractclassmethod
  import logging
  import numpy
  import pandas
  from causalml.inference.meta.explainer import Explainer
  from causalml.inference.meta.utils import check_p_conditions, convert_pd_to_np
  from causalml.propensity import compute_propensity_score
label_desc: Use image node_id 6 for calling the BaseLearner obj's underlying member method code with example usage: obj._format_p(p, t_groups) and returns: p