text: from pathlib import Path
  import os
  
  SOURCE="en_XX"
  TARGET="java"
  
  DATA_HOME="data/codeXglue/text-to-code/"
  DATA_DIR="concode/"
  
  def get_fairseq_arguments(exp_args):
      user_dir, langs, save_dir = exp_args.user_dir, exp_args.langs, \
          exp_args.save_dir
      spm_model = f"{exp_args.home_dir}/sentencepiece/sentencepiece.bpe.model"
  
      arch = exp_args.arch
      return f"""
      --bpe 'sentencepiece' \
      --sentencepiece-model {spm_model} \
      --langs {langs} \
      --arch mbart_base \
      --layernorm-embedding \
      --task translation_from_pretrained_bart \
      --source-lang {SOURCE} \
      --target-lang {TARGET} \
      --criterion label_smoothed_cross_entropy \
      --label-smoothing 0.2 \
      --batch-size 8 \
      --update-freq 3 \
      --max-epoch 30 \
      --optimizer adam \
      --adam-eps 1e-06 \
      --adam-betas '(0.9, 0.98)' \
      --lr-scheduler polynomial_decay \
      --lr 5e-05 \
      --min-lr -1 \
      --warmup-updates 1000 \
      --max-update 200000 \
      --dropout 0.1 \
      --attention-dropout 0.1 \
      --weight-decay 0.01 \
      --seed 1234 \
      --log-format json \
      --log-interval 100 \
      --reset-optimizer \
      --reset-meters \
      --reset-dataloader \
      --reset-lr-scheduler \
      --eval-bleu \
      --eval-bleu-detok space \
      --eval-tokenized-bleu \
      --eval-bleu-remove-bpe sentencepiece \
      --eval-bleu-args '{{"beam": 5}}' \
      --best-checkpoint-metric bleu \
      --maximize-best-checkpoint-metric \
      --no-epoch-checkpoints \
      --patience 10 \
      --save-dir {save_dir} \
      """
  
  def get_evaluator_arguments(exp_args):
      user_dir, langs, save_dir, data_dir = exp_args.user_dir, exp_args.langs, \
          exp_args.save_dir, exp_args.data_dir
      script_dir = Path(os.path.realpath(__file__)).parent
      model_name = exp_args.checkpoint_for_evaluate
      
      return f"""
          python3 {script_dir}/eval.py \
          --save_dir {save_dir} --data_dir {data_dir} \
          -s {SOURCE} -t {TARGET} --langs {langs} \
          --calc_code_bleu {exp_args.home_dir}/evaluation/CodeBLEU/calc_code_bleu.py \
          --model_name {model_name} \
          --fmt_output {save_dir}/output.csv 
      """