code: def _to_user_defined(pif_obj):
      
      res = {}
  
      # make a read view to flatten the hierarchy
      rv = ReadView(pif_obj)
  
      # Iterate over the keys in the read view
      for k in rv.keys():
          name, value = _extract_key_value(rv[k].raw)
          # add any objects that can be extracted
          if name and value is not None:
              res[name] = value
  
      # Grab interesting values not in the ReadView
      pif = pif_obj.as_dictionary()
  
      elements = {}
      if pif.get("composition"):
          for comp in pif["composition"]:
              if comp.get("actualAtomicPercent"):
                  elements[comp["element"]] = float(comp["actualAtomicPercent"]["value"])
              elif comp.get("actualWeightPercent"):
                  elements[comp["element"]] = float(comp["actualWeightPercent"]["value"])
          if elements:
              res["elemental_percent"] = elements
      elif pif.get("chemicalFormula"):
          symbol = ""
          num = ""
          # Chemical formulae are comprised of letters, numbers, and potentially characters we don't care about
          for char in pif["chemicalFormula"]:
              # Uppercase char indicates beginning of new symbol
              if char.isupper():
                  # If there is already a symbol in holding, process it
                  if symbol:
                      try:
                          elements[symbol] = int(num)
                      # If num is a float, raises ValueError
                      except ValueError:
                          elements[symbol] = float(num) if num else 1
                      symbol = ""
                      num = ""
                  symbol += char
              # Lowercase chars or digits are continuations of a symbol
              elif char.islower():
                  symbol += char
              elif char.isdigit():
                  num += char
              elif char == ".":
                  num += char
              # All other chars are not useful
          if elements:
              res["elemental_proportion"] = elements
      return res
docs: Read the systems in the PIF to populate the user-defined portion