def GetDiffBetweenMaps(map1, map2, lookIntoTestExpectationInfo=False):
  """Get difference between maps.

  Args:
    map1: analyzer result map to be compared.
    map2: analyzer result map to be compared.
    lookIntoTestExpectationInfo: a boolean to indicate whether to compare
        test expectation information in addition to just the test case names.

  Returns:
    a tuple of |name1_list| and |name2_list|. |Name1_list| contains all test
        name and the test expectation information in |map1| but not in |map2|.
        |Name2_list| contains all test name and the test expectation
        information in |map2| but not in |map1|.
  """

  def GetDiffBetweenMapsHelper(map1, map2, lookIntoTestExpectationInfo):
    """A helper function for GetDiffBetweenMaps.

    Args:
      map1: analyzer result map to be compared.
      map2: analyzer result map to be compared.
      lookIntoTestExpectationInfo: a boolean to indicate whether to compare
        test expectation information in addition to just the test case names.

    Returns:
      a list of tuples (name, te_info) that are in |map1| but not in |map2|.
    """
    name_list = []
    for (name, value1) in map1.iteritems():
      if name in map2:
        if lookIntoTestExpectationInfo and 'te_info' in value1:
          list1 = value1['te_info']
          list2 = map2[name]['te_info']
          te_diff = [item for item in list1 if not item in list2]
          if te_diff:
            name_list.append((name, te_diff))
      else:
        name_list.append((name, value1))
    return name_list

  return (GetDiffBetweenMapsHelper(map1, map2, lookIntoTestExpectationInfo),
          GetDiffBetweenMapsHelper(map2, map1, lookIntoTestExpectationInfo))