def METHOD_NAME(self):
    # hide all output sockets
    for k, names in output_sockets.items():
        for name in names:
            self.outputs[name].hide_safe = True
    # show mode specific output sockets
    for name in output_sockets[self.mode]:
        self.outputs[name].hide_safe = False