def METHOD_NAME(
    output_dir: str,
    ngpu: int,
    seed: int,
    num_workers: int,
    log_level: Union[int, str],
    data_path_and_name_and_type: str,
    key_file: Optional[str],
    model_tag: Optional[str],
    model_dir: Optional[str],
    allow_variable_data_keys: bool,
    decode_options: Dict,
):
    assert check_argument_types()
    if ngpu > 1:
        raise NotImplementedError("only single GPU decoding is supported")
    logging.basicConfig(
        level=log_level,
        format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
    )
    if ngpu >= 1:
        device = "cuda"
    else:
        device = "cpu"
    # 1. Set random-seed
    set_all_random_seed(seed)
    # 2. Build speech2text
    speech2text = Speech2Text(
        model_tag=model_tag,
        model_dir=model_dir,
        device=device,
    )
    # 3. Build data-iterator
    info_list = []
    wavscp = open(key_file, "r", encoding="utf-8")
    for line in wavscp.readlines():
        info_list.append(line.split(maxsplit=1))
    # 7 .Start for-loop
    # FIXME(kamo): The output format should be discussed about
    with DatadirWriter(output_dir) as writer:
        for key, audio_file in info_list:
            # N-best list of (text, token, token_int, hyp_object)
            results = speech2text(os.path.abspath(audio_file.strip()), **decode_options)
            # Normal ASR
            ibest_writer = writer[f"1best_recog"]
            # Write the result to each file
            ibest_writer["text"][key] = results