code: def extract_parameters(pil, keys=None):
      
      out_dict = {}
      if keys is None:
          keys = pil.keys()
      for key in keys:
          try:
              out_dict[key] = pil[key]
          except ValueError:
              out_dict[key] = None
      return out_dict
docs: Extract and return parameter names and values from a pil object
  
      Parameters
      ----------
  
      pil : `Pil` object
  
      keys : list
          List of parameter names, if None, extact all parameters
  
      Returns
      -------
  
      out_dict : dict
          Dictionary with parameter name, value pairs