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

def mount(nbd, root=None):
    '''
    Pass in the nbd connection device location, mount all partitions and return
    a dict of mount points

    CLI Example:

    .. code-block:: bash

        salt '*' qemu_nbd.mount /dev/nbd0
    '''
    __salt__['cmd.run'](
            'partprobe {0}'.format(nbd),
            python_shell=False,
            )
    ret = {}
    if root is None:
        root = os.path.join(
            tempfile.gettempdir(),
            'nbd',
            os.path.basename(nbd)
        )
    for part in glob.glob('{0}p*'.format(nbd)):
        m_pt = os.path.join(root, os.path.basename(part))
        time.sleep(1)
        mnt = __salt__['mount.mount'](m_pt, part, True)
        if mnt is not True:
            continue
        ret[m_pt] = part
    return ret