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

def heirarchical_help(shovel, prefix):
    '''Given a shovel of tasks, display a heirarchical list of the tasks'''
    result = []
    tuples = heirarchical_helper(shovel, prefix)
    if not tuples:
        return ''

    # We need to figure out the longest fullname length
    longest = max(len(name + '    ' * level) for name, _, level in tuples)
    fmt = '%%%is => %%-50s' % longest
    for name, docstring, level in tuples:
        if docstring == None:
            result.append('    ' * level + name + '/')
        else:
            docstring = re.sub(r'\s+', ' ', docstring).strip()
            if len(docstring) > 50:
                docstring = docstring[:47] + '...'
            result.append(fmt % (name, docstring))
    return '\n'.join(result)