parameters: (timestamps)
docstring: Determine the most likely number of master clock ticks per frame,
  	by looking at how well the timestamps align with frame boundaries when
  	using the two frame timings that openMSX supports.
  	This assumes that the frame timing is the same throughout the replay,
  	which is not guaranteed in general, but will hopefully be the case for
  	tool-assisted speedruns.
docstring_summary: Determine the most likely number of master clock ticks per frame,
  	by looking at how well the timestamps align with frame boundaries when
  	using the two frame timings that openMSX supports.
  	This assumes that the frame timing is the same throughout the replay,
  	which is not guaranteed in general, but will hopefully be the case for
  	tool-assisted speedruns.
docstring_tokens: Determine the most likely number of master clock ticks per frame by looking at how well the timestamps align with frame boundaries when using the two frame timings that openMSX supports . This assumes that the frame timing is the same throughout the replay which is not guaranteed in general but will hopefully be the case for tool - assisted speedruns .
function: def detectTicksPerFrame(timestamps):
  	'''Determine the most likely number of master clock ticks per frame,
  	by looking at how well the timestamps align with frame boundaries when
  	using the two frame timings that openMSX supports.
  	This assumes that the frame timing is the same throughout the replay,
  	which is not guaranteed in general, but will hopefully be the case for
  	tool-assisted speedruns.
  	'''
  	ticksPerFrame50 = (masterClock * vdpTicksPerLine * 313) // vdpClock
  	ticksPerFrame60 = (masterClock * vdpTicksPerLine * 262) // vdpClock
  
  	timestamps = tuple(timestamps)
  	aligned50 = checkAlignment(timestamps, ticksPerFrame50)
  	aligned60 = checkAlignment(timestamps, ticksPerFrame60)
  
  	if aligned50 > aligned60:
  		print('event timestamps align with 50 fps timing: %.2f%%'
  				% (100 * aligned50 / len(timestamps)), file=stderr)
  		return ticksPerFrame50
  	else:
  		print('event timestamps align with 60 fps timing: %.2f%%'
  				% (100 * aligned60 / len(timestamps)), file=stderr)
  		return ticksPerFrame60
function_tokens: def detectTicksPerFrame ( timestamps ) : ticksPerFrame50 = ( masterClock * vdpTicksPerLine * 313 ) // vdpClock ticksPerFrame60 = ( masterClock * vdpTicksPerLine * 262 ) // vdpClock timestamps = tuple ( timestamps ) aligned50 = checkAlignment ( timestamps , ticksPerFrame50 ) aligned60 = checkAlignment ( timestamps , ticksPerFrame60 ) if aligned50 > aligned60 : print ( 'event timestamps align with 50 fps timing: %.2f%%' % ( 100 * aligned50 / len ( timestamps ) ) , file = stderr ) return ticksPerFrame50 else : print ( 'event timestamps align with 60 fps timing: %.2f%%' % ( 100 * aligned60 / len ( timestamps ) ) , file = stderr ) return ticksPerFrame60