<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def wrap(txt, width=80, ident=0):
    '''
    Wrap text to the required dimensions and clean it up, prepare for display.

    :param txt:
    :param width:
    :return:
    '''
    ident = ' ' * ident
    txt = (txt or '').replace(os.linesep, ' ').strip()

    wrapper = textwrap.TextWrapper()
    wrapper.fix_sentence_endings = False
    wrapper.initial_indent = wrapper.subsequent_indent = ident

    return wrapper.wrap(txt)