class_docstr: One-hot encoding for polyphonic events.
code: def encode_event(self, event):
      if event.event_type in EVENT_CLASSES_WITHOUT_PITCH:
          return EVENT_CLASSES_WITHOUT_PITCH.index(event.event_type)
      elif event.event_type in EVENT_CLASSES_WITH_PITCH:
          return len(EVENT_CLASSES_WITHOUT_PITCH) + (
              EVENT_CLASSES_WITH_PITCH.index(event.event_type)
              * PITCH_CLASSES
              + event.pitch
          )
      else:
          raise ValueError("Unknown event type: %s" % event.event_type)
  
file_path: magenta/magenta/models/polyphony_rnn/polyphony_encoder_decoder.py
imports: from __future__ import division
  from magenta.models.polyphony_rnn import polyphony_lib
  from magenta.models.polyphony_rnn.polyphony_lib import PolyphonicEvent
  from note_seq import encoder_decoder
label_desc: Use image node_id 3 for calling the PolyphonyOneHotEncoding obj's underlying member method code with example usage: obj.encode_event(event) and returns: EVENT_CLASSES_WITHOUT_PITCH, unknown