class_docstr: Creates transposed versions of the input NoteSequence.
class_docstr_tok: ["Creates","transposed","versions","of","the","input","NoteSequence","."]
docstr: Transposes a note sequence by the specified amount.
docstr_tok: ["Transposes","a","note","sequence","by","the","specified","amount","."]
code: def _transpose(self, ns, amount, stats):
      """Transposes a note sequence by the specified amount."""
      ts = copy.deepcopy(ns)
      for note in ts.notes:
          if not note.is_drum:
              note.pitch += amount
              if (
                  note.pitch < self._min_pitch
                  or note.pitch > self._max_pitch
              ):
                  stats["skipped_due_to_range_exceeded"].increment()
                  return None
      return ts
  
imports: import copy
  from magenta.pipelines import pipeline
  from magenta.pipelines import statistics
  from note_seq import constants
  from note_seq import sequences_lib
  from note_seq.protobuf import music_pb2
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling the TranspositionPipeline obj's underlying member method code with example usage: obj._transpose(ns, amount, stats) and returns: ts, None