def _MakeOptional(property_dict, test_key):
  """Iterates through all key/value pairs in the property dictionary. If the "test_key" function
  returns True for a particular property key, then makes that property optional. Returns the
  updated property dict.
  """
  for key, value in property_dict.items():
    if test_key(key):
      property_dict[key]['required'] = False
  return property_dict