code: def second2tick(
      second, ticks_per_beat=DEFAULT_TICKS_PER_BEAT, tempo=DEFAULT_TEMPO
  ):
      """
      Convert absolute time in seconds to ticks.
  
      Returns absolute time in ticks for a chosen MIDI file time resolution
      (ticks/pulses per quarter note, also called PPQN) and tempo (microseconds
      per quarter note).
  
      """
      # Note: both tempo (microseconds) and ticks are per quarter note
      #       thus the time signature is irrelevant
      scale = tempo * 1e-6 / ticks_per_beat
      return int(round(second / scale))
  
imports: from __future__ import absolute_import, division, print_function
  import warnings
  import mido
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: second2tick(second, ticks_per_beat, tempo) and returns: int