def get_squeezed_contents(contents):
    """
    Squeeze the contents by removing blank lines between definition and example
    and remove duplicate blank lines except between sections.
    """
    line_between_example_code = substitute.Substitution(
        '\n\n    ',
        '\n    ',
        True
    )
    lines_between_examples = substitute.Substitution('\n\n\n', '\n\n', True)
    lines_between_sections = substitute.Substitution(
        '\n\n\n\n', '\n\n\n', True
    )

    result = contents
    result = line_between_example_code.apply_and_get_result(result)
    result = lines_between_examples.apply_and_get_result(result)
    result = lines_between_sections.apply_and_get_result(result)
    return result

    Squeeze the contents by removing blank lines between definition and example
    and remove duplicate blank lines except between sections.
    
eg/util.py