<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_url(s, l):
 """Wrap a URL string"""

    parts = s.split('/')

    if len(parts) == 1:
        return parts[0]
    else:
        i = 0
        lines = []
        for j in range(i, len(parts) + 1):
            tv = '/'.join(parts[i:j])
            nv = '/'.join(parts[i:j + 1])

            if len(nv) > l or nv == tv:
                i = j
                lines.append(tv)

        return '/\n'.join(lines)