code: def ewm_params(param, param_value):
      
  
      if param not in ["alpha", "com", "span", "halflife"]:
          raise NameError("`param` must be one of {alpha, com, span, halflife}")
  
      def input_alpha(a):
          com = 1.0 / a - 1.0
          span = 2.0 / a - 1.0
          halflife = np.log(0.5) / np.log(1.0 - a)
          return {"com": com, "span": span, "halflife": halflife}
  
      def output_alpha(param, p):
          eqs = {
              "com": 1.0 / (1.0 + p),
              "span": 2.0 / (p + 1.0),
              "halflife": 1.0 - np.exp(np.log(0.5) / p),
          }
          return eqs[param]
  
      if param == "alpha":
          dct = input_alpha(a=param_value)
          alpha = param_value
      else:
          alpha = output_alpha(param=param, p=param_value)
          dct = input_alpha(a=alpha)
      dct.update({"alpha": alpha})
      return dct
docs: Corresponding parameter values for exponentially weighted functions.
  
      Parameters
      ----------
      param : {'alpha', 'com', 'span', 'halflife'}
      param_value : float or int
          The parameter value.
  
      Returns
      -------
      result : dict
          Layout/index of corresponding parameters.