def METHOD_NAME():
  logs.configure('heartbeat')
  dates.initialize_timezone_from_environment()
  environment.set_bot_environment()
  if sys.argv[1] == 'None':
    previous_state = None
  else:
    previous_state = sys.argv[1]
  log_filename = sys.argv[2]
  try:
    sys.stdout.write(str(beat(previous_state, log_filename)))
  except Exception:
    logs.log_error('Failed to beat.')
  time.sleep(data_types.HEARTBEAT_WAIT_INTERVAL)