'Flatten redundant type checks after tree changes.'

def _visit_PyTypeTestNode(self, node):

    old_arg = node.arg
    self.visitchildren(node)
    if ((old_arg is node.arg) or (node.arg.type != node.type)):
        return node
    return node.arg
