def trim_empty_lines(text):
    lines = text.splitlines(True)
    while lines and is_empty_line(lines[0]):
        lines.pop(0)
    while lines and is_empty_line(lines[-1]):
        lines.pop(-1)
    return ''.join(lines)
:rtype: `SelectionSet`
dataset/ETHPy150Open xolox/python-humanfriendly/humanfriendly/text.py/trim_empty_lines--crossover with--dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.3/pymel/core/nodetypes.py/ObjectSet.getDifference