code: def testMidiSignal_ValidityChecks(self):
      # Unsupported type.
      with self.assertRaises(midi_hub.MidiHubError):
          midi_hub.MidiSignal(type="sysex")
      with self.assertRaises(midi_hub.MidiHubError):
          midi_hub.MidiSignal(msg=mido.Message(type="sysex"))
  
      # Invalid arguments.
      with self.assertRaises(midi_hub.MidiHubError):
          midi_hub.MidiSignal()
      with self.assertRaises(midi_hub.MidiHubError):
          midi_hub.MidiSignal(type="note_on", value=1)
      with self.assertRaises(midi_hub.MidiHubError):
          midi_hub.MidiSignal(type="control", note=1)
      with self.assertRaises(midi_hub.MidiHubError):
          midi_hub.MidiSignal(
              msg=mido.Message(type="control_change"), value=1
          )
  
      # Non-inferrale type.
      with self.assertRaises(midi_hub.MidiHubError):
          midi_hub.MidiSignal(note=1, value=1)
  
imports: import collections
  import queue
  import threading
  import time
  from magenta.common import concurrency
  from magenta.interfaces.midi import midi_hub
  import mido
  from note_seq import testing_lib
  from note_seq.protobuf import music_pb2
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling the MidiHubTest obj's underlying member method code with example usage: obj.testMidiSignal_ValidityChecks() without return types