def create_commit(mutations):
  """A fake Datastore commit method that writes the mutations to a list.

  Args:
    mutations: A list to write mutations to.

  Returns:
    A fake Datastore commit method
  """

  def commit(req):
    for mutation in req.mutations:
      mutations.append(mutation)

  return commit