class_docstr: A Pipeline that converts performances to a model specific encoding.
class_docstr_tok: ["A","Pipeline","that","converts","performances","to","a","model","specific","encoding","."]
code: def transform(self, input_object):
      performance = input_object
  
      if self._control_signals:
          # Encode conditional on control signals.
          control_sequences = []
          for control in self._control_signals:
              control_sequences.append(control.extract(performance))
          control_sequence = list(zip(*control_sequences))
          if self._optional_conditioning:
              # Create two copies, one with and one without conditioning.
              # pylint: disable=g-complex-comprehension
              encoded = [
                  self._encoder_decoder.encode(
                      list(
                          zip(
                              [disable] * len(control_sequence),
                              control_sequence,
                          )
                      ),
                      performance,
                  )
                  for disable in [False, True]
              ]
              # pylint: enable=g-complex-comprehension
          else:
              encoded = [
                  self._encoder_decoder.encode(
                      control_sequence, performance
                  )
              ]
      else:
          # Encode unconditional.
          encoded = [self._encoder_decoder.encode(performance)]
      return [
          pipelines_common.make_sequence_example(*enc)
          for enc in encoded
      ]
  
imports: from magenta.pipelines import dag_pipeline
  from magenta.pipelines import note_sequence_pipelines
  from magenta.pipelines import pipeline
  from magenta.pipelines import pipelines_common
  from magenta.pipelines import statistics
  from note_seq import MetricPerformance
  from note_seq import Performance
  from note_seq import sequences_lib
  from note_seq.performance_lib import BasePerformance
  from note_seq.performance_lib import NotePerformance
  from note_seq.performance_lib import TooManyDurationStepsError
  from note_seq.performance_lib import TooManyTimeShiftStepsError
  from note_seq.protobuf import music_pb2
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the EncoderPipeline obj's underlying member method code with example usage: obj.transform(input_object) and returns: unknown