parameters: (output1, output2)
return_statement: return output1.stdout[0:cap], output2.stdout[0:cap]
docstring: Returns a pair of stdout strings.
  
    The strings are safely capped if at least one run has crashed.
docstring_summary: Returns a pair of stdout strings.
docstring_tokens: Returns a pair of stdout strings .
function: def get_output_capped(output1, output2):
    """Returns a pair of stdout strings.
  
    The strings are safely capped if at least one run has crashed.
    """
  
    # No length difference or no crash -> no capping.
    if (len(output1.stdout) == len(output2.stdout) or
        (not output1.HasCrashed() and not output2.HasCrashed())):
      return output1.stdout, output2.stdout
  
    # Both runs have crashed, cap by the shorter output.
    if output1.HasCrashed() and output2.HasCrashed():
      cap = min(len(output1.stdout), len(output2.stdout))
    # Only the first run has crashed, cap by its output length.
    elif output1.HasCrashed():
      cap = len(output1.stdout)
    # Similar if only the second run has crashed.
    else:
      cap = len(output2.stdout)
  
    return output1.stdout[0:cap], output2.stdout[0:cap]
function_tokens: def get_output_capped ( output1 , output2 ) : # No length difference or no crash -> no capping. if ( len ( output1 . stdout ) == len ( output2 . stdout ) or ( not output1 . HasCrashed ( ) and not output2 . HasCrashed ( ) ) ) : return output1 . stdout , output2 . stdout # Both runs have crashed, cap by the shorter output. if output1 . HasCrashed ( ) and output2 . HasCrashed ( ) : cap = min ( len ( output1 . stdout ) , len ( output2 . stdout ) ) # Only the first run has crashed, cap by its output length. elif output1 . HasCrashed ( ) : cap = len ( output1 . stdout ) # Similar if only the second run has crashed. else : cap = len ( output2 . stdout ) return output1 . stdout [ 0 : cap ] , output2 . stdout [ 0 : cap ]