code: def _last_zero_crossing(samples, start, end):
      """Returns the last zero crossing in the window [start, end)."""
      samples_greater_than_zero = samples[start:end] > 0
      samples_less_than_zero = samples[start:end] < 0
      samples_greater_than_equal_zero = samples[start:end] >= 0
      samples_less_than_equal_zero = samples[start:end] <= 0
  
      # use np instead of python for loop for speed
      xings = np.logical_or(
          np.logical_and(
              samples_greater_than_zero[:-1],
              samples_less_than_equal_zero[1:],
          ),
          np.logical_and(
              samples_less_than_zero[:-1],
              samples_greater_than_equal_zero[1:],
          ),
      ).nonzero()[0]
  
      return xings[-1] + start if xings.size > 0 else None
  
file_path: magenta/magenta/models/onsets_frames_transcription/audio_label_data_utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import bisect
  import math
  import librosa
  from note_seq import audio_io
  from note_seq import constants
  from note_seq import sequences_lib
  from note_seq.protobuf import music_pb2
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling a global function with example usage: _last_zero_crossing(samples, start, end) and returns: unknown