@gen.engine
def Start(callback):
  assert sys.platform == 'darwin', 'This script can only run on OSX. You are using %s' % sys.platform

  """Grab a lock on job:client_logs_analysis and call RunOnce."""
  client = db_client.DBClient.Instance()
  job = Job(client, 'client_logs_analysis')

  if options.options.send_email:
    # When running on devbox, this prompts for the passphrase. Skip if not sending email.
    EmailManager.SetInstance(SendGridEmailManager())
  else:
    EmailManager.SetInstance(LoggingEmailManager())

  if options.options.require_lock:
    got_lock = yield gen.Task(job.AcquireLock)
    if got_lock == False:
      logging.warning('Failed to acquire job lock: exiting.')
      callback()
      return

  # We never call job.Start() since we don't want a summary status written to the DB, just the lock.
  try:
    yield gen.Task(RunOnce, client)
  except:
    logging.error(traceback.format_exc())
  finally:
    yield gen.Task(job.ReleaseLock)

  callback()
dataset/ETHPy150Open viewfinderco/viewfinder/backend/logs/symbolicate_user_crashes.py/Start/original