def normalize_width(width, err):
    if width in (CLIP, PACK):
        return (width, None)
    elif type(width) == int:
        return (GIVEN, width)
    elif type(width) == tuple and len(width) == 2 and width[0] == RELATIVE:
        return width
    raise err("width value %r is not one of fixed number of columns, "
        "'pack', ('relative', percentage of total width), 'clip'"
        % (width,))
Split width into (width_type, width_amount).  Raise exception err
dataset/ETHPy150Open AnyMesh/anyMesh-Python/example/urwid/decoration.py/normalize_width