def visibility(vis: Number, unit: str = '<STR_LIT:m>') -> str:
if not (vis and unit in ('<STR_LIT:m>', '<STR_LIT>')):<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>if vis.repr in VIS_REPR:<EOL><INDENT>return VIS_REPR[vis.repr]<EOL><DEDENT>if unit == '<STR_LIT:m>':<EOL><INDENT>converted = vis.value * <NUM_LIT><EOL>converted = str(round(converted, <NUM_LIT:1>)).replace('<STR_LIT>', '<STR_LIT>') + '<STR_LIT>'  <EOL>value = str(round(vis.value / <NUM_LIT:1000>, <NUM_LIT:1>)).replace('<STR_LIT>', '<STR_LIT>')<EOL>unit = '<STR_LIT>'<EOL><DEDENT>elif unit == '<STR_LIT>':<EOL><INDENT>converted = vis.value / <NUM_LIT><EOL>converted = str(round(converted, <NUM_LIT:1>)).replace('<STR_LIT>', '<STR_LIT>') + '<STR_LIT>'  <EOL>value = str(vis.value).replace('<STR_LIT>', '<STR_LIT>')<EOL><DEDENT>return f'<STR_LIT>'<EOL>
Formats a visibility element into a string with both km and sm values

Ex: 8km ( 5sm )