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

def guess_line_ending(string):
    '''Return the most likely line delimiter from the string.'''
    assert isinstance(string, str), 'Expect str. Got {}'.format(type(string))
    crlf_count = string.count('\r\n')
    lf_count = string.count('\n')

    if crlf_count >= lf_count:
        return '\r\n'
    else:
        return '\n'