code: def replace_by_key(pif, key, subs, new_key=None, remove=False):
      
      if not new_key:
          new_key = key
          remove = False
      orig = pif.as_dictionary()
      new  = _recurse_replace(orig, to_camel_case(key), to_camel_case(new_key), subs, remove)
      return pypif.pif.loads(json.dumps(new))
docs: Replace values that match a key
  
      Deeply traverses the pif object, looking for `key` and
      replacing values in accordance with `subs`.  If `new_key`
      is set, the replaced values are assigned to that key.  If
      `remove` is `True`, the old `key` pairs are removed.