human
I wrote the below code

    def _ValidateRemoveOneContact(contact_id):
        predicate = (lambda c: (c.contact_id == contact_id))
        existing_contacts = validator.QueryModelObjects(Contact, predicate=predicate, query_forward=True)
        if (len(existing_contacts) > 0):
            last_contact = existing_contacts[(-1)]
            if last_contact.IsRemoved():
                existing_contacts = existing_contacts[:(-1)]
            elif (not removed_contacts_reset):
                removed_contact_dict = {'user_id': user_id, 'contact_id': contact_id, 'contact_source': Contact.GetContactSourceFromContactId(contact_id), 'timestamp': util._TEST_TIME, 'sort_key': Contact.CreateSortKey(contact_id, util._TEST_TIME), 'labels': [Contact.REMOVED]}
                validator.ValidateCreateContact(identities_properties=None, **removed_contact_dict)
            for contact in existing_contacts:
                db_key = DBKey(user_id, contact.sort_key)
                validator.ValidateDeleteDBObject(Contact, db_key)
    validator = tester.validator
    (user_id, device_id) = tester.GetIdsFromCookie(user_cookie)
    request_dict = deepcopy(request_dict)
    actual_dict = tester.SendRequest('remove_contacts', user_cookie, request_dict)
    op_dict = tester._DeriveNotificationOpDict(user_id, device_id, request_dict)
    removed_contacts_reset = _CheckForRemovedContactsReset(tester, user_id)
    if removed_contacts_reset:
        predicate = (lambda c: c.IsRemoved())
        removed_contacts = validator.QueryModelObjects(Contact, predicate=predicate, query_forward=True)
        for removed_contact in removed_contacts:
            validator.ValidateDeleteDBObject(Contact, DBKey(user_id, removed_contact.sort_key))
    for contact_id in request_dict['contacts']:
        _ValidateRemoveOneContact(contact_id)
    timestamp = (0 if removed_contacts_reset else op_dict['op_timestamp'])
    invalidate = {'contacts': {'start_key': Contact.CreateSortKey(None, timestamp)}}
    if removed_contacts_reset:
        invalidate['contacts']['all'] = True
   ...

What's a good function header?
assistant
#Here's a good function header.

def _TestRemoveContacts(tester, user_cookie, request_dict):