def _is_control(char):
    'Checks whether `chars` is a control character.'
    if ((char == '\t') or (char == '\n') or (char == '\r')):
        return False
    cat = unicodedata.category(char)
    if (cat in ('Cc', 'Cf')):
        return True
    return False
Checks whether `chars` is a control character.
def _is_control(char):
    
    if ((char == '\t') or (char == '\n') or (char == '\r')):
        return False
    cat = unicodedata.category(char)
    if (cat in ('Cc', 'Cf')):
        return True
    return False