parameters: (row_entities)
docstring: Adds a list of rows to the cache, in revision order.
  
    Updates multiple cache entries for different tests.
  
    Args:
      row_entities: List of Row entities.
docstring_summary: Adds a list of rows to the cache, in revision order.
docstring_tokens: Adds a list of rows to the cache in revision order .
function: def AddRowsToCache(row_entities):
    """Adds a list of rows to the cache, in revision order.
  
    Updates multiple cache entries for different tests.
  
    Args:
      row_entities: List of Row entities.
    """
    test_key_to_rows = {}
    for row in row_entities:
      test_key = row.parent_test
      if test_key in test_key_to_rows:
        graph_rows = test_key_to_rows[test_key]
      else:
        test_path = utils.TestPath(test_key)
        graph_rows = namespaced_stored_object.Get(_CACHE_KEY % test_path)
        if not graph_rows:
          # We only want to update caches for tests that people have looked at.
          continue
        test_key_to_rows[test_key] = graph_rows
  
      revisions = [r[0] for r in graph_rows]
      index = bisect.bisect_left(revisions, row.revision)
      if index < len(revisions) - 1:
        if revisions[index + 1] == row.revision:
          return  # Already in cache.
      graph_rows.insert(index, _MakeTriplet(row))
  
    for test_key in test_key_to_rows:
      graph_rows = test_key_to_rows[test_key]
      SetCache(utils.TestPath(test_key), graph_rows)
function_tokens: def AddRowsToCache ( row_entities ) : test_key_to_rows = { } for row in row_entities : test_key = row . parent_test if test_key in test_key_to_rows : graph_rows = test_key_to_rows [ test_key ] else : test_path = utils . TestPath ( test_key ) graph_rows = namespaced_stored_object . Get ( _CACHE_KEY % test_path ) if not graph_rows : # We only want to update caches for tests that people have looked at. continue test_key_to_rows [ test_key ] = graph_rows revisions = [ r [ 0 ] for r in graph_rows ] index = bisect . bisect_left ( revisions , row . revision ) if index < len ( revisions ) - 1 : if revisions [ index + 1 ] == row . revision : return # Already in cache. graph_rows . insert ( index , _MakeTriplet ( row ) ) for test_key in test_key_to_rows : graph_rows = test_key_to_rows [ test_key ] SetCache ( utils . TestPath ( test_key ) , graph_rows )