Пример #1
0
  if not driver:
    raise Error(
        'Failed to create driver instance with flag %s' % FLAGS.browser_driver)

  try:
    driver.implicitly_wait(IMPLICIT_WAIT)
    driver.get(LOGIN_PAGE_URL)
    user_id_input = driver.find_element_by_id('input-email')
    user_id_input.send_keys(USER_ID)
    contrasena = driver.find_element_by_id('password-password')
    contrasena.send_keys(CONTRASENA)
    sign_in_boton = driver.find_element_by_id('create-account-btn')
    sign_in_boton.send_keys('\n')

    j4u_link = get_j4u_link(driver)
    if j4u_link:
      load_personalized(driver)
      time.sleep(IMPLICIT_WAIT)
      log.info('Sleeping %d seconds...', IMPLICIT_WAIT)
      load_coupons(driver)
    else:
      raise Error('Just4U link was never found.')

  finally:
    driver.close()


if __name__ == '__main__':
  app.run()


def main(_):
    gin.parse_config_files_and_bindings(FLAGS.gin_config, FLAGS.gin_params)
    print('********')
    print(FLAGS.mode)
    print(FLAGS.gin_config)
    print(FLAGS.gin_params)

    env = active_vision_dataset_env.ActiveVisionDatasetEnv(modality_types=[
        task_env.ModalityTypes.IMAGE, task_env.ModalityTypes.
        SEMANTIC_SEGMENTATION, task_env.ModalityTypes.OBJECT_DETECTION,
        task_env.ModalityTypes.DEPTH, task_env.ModalityTypes.DISTANCE
    ])

    if FLAGS.mode == BENCHMARK_MODE:
        benchmark(env, env.possible_targets)
    elif FLAGS.mode == GRAPH_MODE:
        for loc in env.worlds:
            env.check_scene_graph(loc, 'fridge')
    elif FLAGS.mode == HUMAN_MODE:
        human(env, env.possible_targets)
    elif FLAGS.mode == VIS_MODE:
        visualize_random_step_sequence(env)
    elif FLAGS.mode == EVAL_MODE:
        evaluate_folder(env, FLAGS.eval_folder)


if __name__ == '__main__':
    app.run(main)
                        print defered_lines[0].replace(old_short_cdata,
                                                       new_short_cdata),
                    for index in range(1, len(defered_lines)):
                        print defered_lines[index],
                    print line,
                    defered_lines = []
                    in_defered_mode = False
                else:
                    defered_lines.append(line)


def main(argv):
    if not (len(argv) == 1 and FLAGS.long and FLAGS.short
            and FLAGS.long.startswith(FLAGS.short)):
        sys.stderr.write('Wrong Usage of the script %s \n\n' % argv[0])
        sys.stderr.write(__doc__)
        sys.exit(-1)
    script_path = os.path.abspath(argv[0])
    common_prefix = os.path.dirname(os.path.dirname(script_path))
    fusion_version_file = '%s/%s' % (common_prefix, 'src/fusion_version.txt')
    (old_long,
     old_short) = FindUpdateCurrentVersion(fusion_version_file, FLAGS.long,
                                           FLAGS.short,
                                           datetime.datetime.now().year)
    ChangeVersionInInstallerFiles(common_prefix, old_long, FLAGS.long,
                                  old_short, FLAGS.short)


if __name__ == '__main__':
    app.run()

def main(_):
  gin.parse_config_files_and_bindings(FLAGS.gin_config, FLAGS.gin_params)
  print('********')
  print(FLAGS.mode)
  print(FLAGS.gin_config)
  print(FLAGS.gin_params)

  env = active_vision_dataset_env.ActiveVisionDatasetEnv(modality_types=[
      task_env.ModalityTypes.IMAGE,
      task_env.ModalityTypes.SEMANTIC_SEGMENTATION,
      task_env.ModalityTypes.OBJECT_DETECTION, task_env.ModalityTypes.DEPTH,
      task_env.ModalityTypes.DISTANCE
  ])

  if FLAGS.mode == BENCHMARK_MODE:
    benchmark(env, env.possible_targets)
  elif FLAGS.mode == GRAPH_MODE:
    for loc in env.worlds:
      env.check_scene_graph(loc, 'fridge')
  elif FLAGS.mode == HUMAN_MODE:
    human(env, env.possible_targets)
  elif FLAGS.mode == VIS_MODE:
    visualize_random_step_sequence(env)
  elif FLAGS.mode == EVAL_MODE:
    evaluate_folder(env, FLAGS.eval_folder)

if __name__ == '__main__':
  app.run(main)