def _ConstructTestPathMap(row_dicts):
    'Makes a mapping from test paths to last added revision.'
    last_added_revision_keys = []
    for row in row_dicts:
        if (not (('master' in row) and ('bot' in row) and ('test' in row))):
            continue
        path = ('%s/%s/%s' % (row['master'], row['bot'], row['test'].strip('/')))
        if (len(path) > _MAX_TEST_PATH_LENGTH):
            continue
        last_added_revision_keys.append(ndb.Key('LastAddedRevision', path))
    try:
        last_added_revision_entities = ndb.get_multi(last_added_revision_keys)
    except datastore_errors.BadRequestError:
        logging.warn('Datastore BadRequestError when getting %s', repr(last_added_revision_keys))
        return {}
    return {r.key.string_id(): r.revision for r in last_added_revision_entities if (r is not None)}
Makes a mapping from test paths to last added revision.
def _ConstructTestPathMap(row_dicts):
    
    last_added_revision_keys = []
    for row in row_dicts:
        if (not (('master' in row) and ('bot' in row) and ('test' in row))):
            continue
        path = ('%s/%s/%s' % (row['master'], row['bot'], row['test'].strip('/')))
        if (len(path) > _MAX_TEST_PATH_LENGTH):
            continue
        last_added_revision_keys.append(ndb.Key('LastAddedRevision', path))
    try:
        last_added_revision_entities = ndb.get_multi(last_added_revision_keys)
    except datastore_errors.BadRequestError:
        logging.warn('Datastore BadRequestError when getting %s', repr(last_added_revision_keys))
        return {}
    return {r.key.string_id(): r.revision for r in last_added_revision_entities if (r is not None)}