code: def ms_to_frames(ms, fps):
      
      if fps <= 0:
          raise ValueError("Framerate must be positive number (%f)." % fps)
  
      return int(round((ms / 1000) * fps))
docs: Convert milliseconds to number of frames.
      
      Arguments:
          ms: Number of milliseconds (may be int, float or other numeric class).
          fps: Framerate (must be a positive number, eg. 23.976).
      
      Returns:
          Number of frames (int).
          
      Raises:
          ValueError: fps was negative or zero.