def visibility(vis: Number, unit: str = '<STR_LIT:m>') -> str:
if not vis:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>if vis.value is None or '<STR_LIT:/>' in vis.repr:<EOL><INDENT>ret_vis = vis.spoken<EOL><DEDENT>else:<EOL><INDENT>ret_vis = translate.visibility(vis, unit=unit)<EOL>if unit == '<STR_LIT:m>':<EOL><INDENT>unit = '<STR_LIT>'<EOL><DEDENT>ret_vis = ret_vis[:ret_vis.find('<STR_LIT>')].lower().replace(unit, '<STR_LIT>').strip()<EOL>ret_vis = core.spoken_number(core.remove_leading_zeros(ret_vis))<EOL><DEDENT>ret = '<STR_LIT>' + ret_vis<EOL>if unit in SPOKEN_UNITS:<EOL><INDENT>if '<STR_LIT:/>' in vis.repr and '<STR_LIT>' not in ret:<EOL><INDENT>ret += '<STR_LIT>'<EOL><DEDENT>ret += '<STR_LIT:U+0020>' + SPOKEN_UNITS[unit]<EOL>if not (('<STR_LIT>' in ret and '<STR_LIT>' not in ret) or '<STR_LIT>' in ret):<EOL><INDENT>ret += '<STR_LIT:s>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>ret += unit<EOL><DEDENT>return ret<EOL>
Format visibility details into a spoken word string