def _IsAcceptableRowId(row_id, last_row_id, allow_jump=False):
    'Checks whether the given row id (aka revision) is not too large or small.\n\n  For each data series (i.e. TestMetadata entity), we assume that row IDs are\n  monotonically increasing. On a given chart, points are sorted by these\n  row IDs. This way, points can arrive out of order but still be shown\n  correctly in the chart.\n\n  However, sometimes a bot might start to use a different *type* of row ID;\n  for example it might change from revision numbers or build numbers to\n  timestamps, or from timestamps to build numbers. This causes a lot of\n  problems, including points being put out of order.\n\n  If a sender of data actually wants to switch to a different type of\n  row ID, it would be much cleaner for them to start sending it under a new\n  chart name.\n\n  Args:\n    row_id: The proposed Row entity id (usually sent as "revision")\n    last_row_id: The previous Row id, or None if there were none previous.\n\n  Returns:\n    True if acceptable, False otherwise.\n  '
    if (last_row_id is None):
        return True
    if (row_id <= 0):
        return False
    if (row_id < (0.5 * last_row_id)):
        return False
    if (allow_jump and (1470009600 < row_id < 1483228800)):
        return True
    if (row_id > (2 * last_row_id)):
        return False
    return True
Checks whether the given row id (aka revision) is not too large or small.

For each data series (i.e. TestMetadata entity), we assume that row IDs are
monotonically increasing. On a given chart, points are sorted by these
row IDs. This way, points can arrive out of order but still be shown
correctly in the chart.

However, sometimes a bot might start to use a different *type* of row ID;
for example it might change from revision numbers or build numbers to
timestamps, or from timestamps to build numbers. This causes a lot of
problems, including points being put out of order.

If a sender of data actually wants to switch to a different type of
row ID, it would be much cleaner for them to start sending it under a new
chart name.

Args:
  row_id: The proposed Row entity id (usually sent as "revision")
  last_row_id: The previous Row id, or None if there were none previous.

Returns:
  True if acceptable, False otherwise.
def _IsAcceptableRowId(row_id, last_row_id, allow_jump=False):
    'Checks whether the given row id (aka revision) is not too large or small.\n\n  For each data series (i.e. TestMetadata entity), we assume that row IDs are\n  monotonically increasing. On a given chart, points are sorted by these\n  row IDs. This way, points can arrive out of order but still be shown\n  correctly in the chart.\n\n  However, sometimes a bot might start to use a different *type* of row ID;\n  for example it might change from revision numbers or build numbers to\n  timestamps, or from timestamps to build numbers. This causes a lot of\n  problems, including points being put out of order.\n\n  If a sender of data actually wants to switch to a different type of\n  row ID, it would be much cleaner for them to start sending it under a new\n  chart name.\n\n  Args:\n    row_id: The proposed Row entity id (usually sent as "revision")\n    last_row_id: The previous Row id, or None if there were none previous.\n\n  Returns:\n    True if acceptable, False otherwise.\n  '
    if (last_row_id is None):
        return True
    if (row_id <= 0):
        return False
    if (row_id < (0.5 * last_row_id)):
        return False
    if (allow_jump and (1470009600 < row_id < 1483228800)):
        return True
    if (row_id > (2 * last_row_id)):
        return False
    return True