def MultiLineEqual(expected, actual):
  if actual == expected:
    return True

  print "Error: FLAGS.MainModuleHelp() didn't return the expected result."
  print "Got:"
  print actual
  print "[End of got]"

  actual_lines = actual.split("\n")
  expected_lines = expected.split("\n")

  num_actual_lines = len(actual_lines)
  num_expected_lines = len(expected_lines)

  if num_actual_lines != num_expected_lines:
    print "Number of actual lines = %d, expected %d" % (
        num_actual_lines, num_expected_lines)

  num_to_match = min(num_actual_lines, num_expected_lines)

  for i in range(num_to_match):
    if actual_lines[i] != expected_lines[i]:
      print "One discrepancy: Got:"
      print actual_lines[i]
      print "Expected:"
      print expected_lines[i]
      break
  else:
    # If we got here, found no discrepancy, print first new line.
    if num_actual_lines > num_expected_lines:
      print "New help line:"
      print actual_lines[num_expected_lines]
    elif num_expected_lines > num_actual_lines:
      print "Missing expected help line:"
      print expected_lines[num_actual_lines]
    else:
      print "Bug in this test -- discrepancy detected but not found."

  return False
Returns True if expected == actual, or returns False and logs.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/python-gflags/tests/gflags_googletest.py/MultiLineEqual