<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def visibility(vis: Number, unit: str = 'm') -> str: """ Format visibility details into a spoken word string """

    if not vis:
        return 'Visibility unknown'
    if vis.value is None or '/' in vis.repr:
        ret_vis = vis.spoken
    else:
        ret_vis = translate.visibility(vis, unit=unit)
        if unit == 'm':
            unit = 'km'
        ret_vis = ret_vis[:ret_vis.find(' (')].lower().replace(unit, '').strip()
        ret_vis = core.spoken_number(core.remove_leading_zeros(ret_vis))
    ret = 'Visibility ' + ret_vis
    if unit in SPOKEN_UNITS:
        if '/' in vis.repr and 'half' not in ret:
            ret += ' of a'
        ret += ' ' + SPOKEN_UNITS[unit]
        if not (('one half' in ret and ' and ' not in ret) or 'of a' in ret):
            ret += 's'
    else:
        ret += unit
    return ret