def width(ch):
    """
    Compute the display width of the given character.

    Useful for cursor-repositioning tasks, however this is not entirely
    reliable since different terminal emulators have different behavior in
    this area.

    @see: U{http://unicode.org/reports/tr11/}

    @return: The width in 1/2 ems of the given single-length unicode string.
    @rtype: C{int}
    """
    widthSpecifier = unicodedata.east_asian_width(ch)
    try:
        return _widths[widthSpecifier]
    except __HOLE__:
        raise KeyError("%r has a width that is not supported: %s"
                       % (ch, widthSpecifier))
dataset/ETHPy150Open twisted/imaginary/imaginary/wiring/terminalui.py/width