class_docstr: Wrapper class for data config YAML
class_docstr_tok: ["Wrapper","class","for","data","config","YAML"]
docstr: Return the task index of the first-pass text decoder.
  If there are multiple 'is_first_pass_decoder: True' in the config file,
      the last task is used for the first-pass decoder.
  If there is no 'is_first_pass_decoder: True' in the config file,
      the last task whose task_name includes 'target' and decoder_type is not ctc.
docstr_tok: ["Return","the","task","index","of","the","first-pass","text","decoder",".","If","there","are","multiple","'is_first_pass_decoder",":","True","'","in","the","config","file",",","the","last","task","is","used","for","the","first-pass","decoder",".","If","there","is","no","'is_first_pass_decoder",":","True","'","in","the","config","file",",","the","last","task","whose","task_name","includes","'target","'","and","decoder_type","is","not","ctc","."]
code: def first_pass_decoder_task_index(self):
      """Return the task index of the first-pass text decoder.
      If there are multiple 'is_first_pass_decoder: True' in the config file,
          the last task is used for the first-pass decoder.
      If there is no 'is_first_pass_decoder: True' in the config file,
          the last task whose task_name includes 'target' and decoder_type is not ctc.
      """
      idx = -1
      for i, (k, v) in enumerate(self.config.items()):
          if v.is_first_pass_decoder:
              idx = i
      if idx < 0:
          for i, (k, v) in enumerate(self.config.items()):
              if (
                  k.startswith("target")
                  and v.decoder_type == "transformer"
              ):
                  idx = i
      return idx
  
imports: import logging
  from argparse import Namespace
  from copy import deepcopy
  from pathlib import Path
  from typing import Dict, Optional
  from fairseq.data import Dictionary
label_desc: Use image node_id 4 for calling the MultitaskConfig obj's underlying member method code with example usage: obj.first_pass_decoder_task_index() and returns: idx