def _ValidateRowId(row_dict, test_map):
    'Checks whether the ID for a Row is OK.\n\n  Args:\n    row_dict: A dictionary with new point properties, including "revision".\n    test_map: A dictionary mapping test paths to the last previously added\n        revision for each test.\n\n  Raises:\n    BadRequestError: The revision is not acceptable for some reason.\n  '
    row_id = GetAndValidateRowId(row_dict)
    (master, bot, test) = (row_dict['master'], row_dict['bot'], row_dict['test'])
    test_path = ('%s/%s/%s' % (master, bot, test))
    last_row_id = test_map.get(test_path)
    if (not last_row_id):
        logging.warning('Test %s has no last added revision entry.', test_path)
        return
    allow_jump = (master.endswith('Internal') or (master.endswith('QA') and bot.startswith('release-tests-')))
    if (not _IsAcceptableRowId(row_id, last_row_id, allow_jump=allow_jump)):
        raise BadRequestError(('Invalid ID (revision) %d; compared to previous ID %s, it was larger or smaller by too much.' % (row_id, last_row_id)))
Checks whether the ID for a Row is OK.

Args:
  row_dict: A dictionary with new point properties, including "revision".
  test_map: A dictionary mapping test paths to the last previously added
      revision for each test.

Raises:
  BadRequestError: The revision is not acceptable for some reason.
def _ValidateRowId(row_dict, test_map):
    'Checks whether the ID for a Row is OK.\n\n  Args:\n    row_dict: A dictionary with new point properties, including "revision".\n    test_map: A dictionary mapping test paths to the last previously added\n        revision for each test.\n\n  Raises:\n    BadRequestError: The revision is not acceptable for some reason.\n  '
    row_id = GetAndValidateRowId(row_dict)
    (master, bot, test) = (row_dict['master'], row_dict['bot'], row_dict['test'])
    test_path = ('%s/%s/%s' % (master, bot, test))
    last_row_id = test_map.get(test_path)
    if (not last_row_id):
        logging.warning('Test %s has no last added revision entry.', test_path)
        return
    allow_jump = (master.endswith('Internal') or (master.endswith('QA') and bot.startswith('release-tests-')))
    if (not _IsAcceptableRowId(row_id, last_row_id, allow_jump=allow_jump)):
        raise BadRequestError(('Invalid ID (revision) %d; compared to previous ID %s, it was larger or smaller by too much.' % (row_id, last_row_id)))