Add docstring for trim_line