def terminal_width(value):
if isinstance(value, bytes):<EOL><INDENT>value = value.decode("<STR_LIT:utf8>", "<STR_LIT:ignore>")<EOL><DEDENT>return sum(map(get_width, map(ord, value)))<EOL>
Returns the width of the string it would be when displayed.