def _entity_schema_to_prospective_search_schema(schema, add_entry):
  """Produce SchemaEntries from python schema.

  Args:
    schema: dictionary mapping python type to field names.
    add_entry: sink function for prospective search schema entries.

  Raises:
    SchemaError: schema is invalid.
  """
  all_names = []
  for python_type, names in schema.items():
    all_names.extend(names)
    for name in names:
      model_type = _GetModelTypeForEntityType(python_type)
      if not model_type:
        continue
      _add_schema_entry(model_type, name, add_entry)
  if len(all_names) != len(set(all_names)):
    duplicate_names = all_names
    for name in set(all_names):
      duplicate_names.remove(name)
    raise SchemaError(duplicate_names % 'Duplicate names in schema: %s')
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/prospective_search/prospective_search.py/_entity_schema_to_prospective_search_schema/swapped operands of `%`