code: def alter_dataset_langtok(
      self,
      lang_pair_dataset,
      src_eos=None,
      src_lang=None,
      tgt_eos=None,
      tgt_lang=None,
      src_langtok_spec=None,
      tgt_langtok_spec=None,
  ):
      if src_langtok_spec is None and tgt_langtok_spec is None:
          return lang_pair_dataset
  
      new_src_eos = None
      if (
          src_langtok_spec is not None
          and src_eos is not None
          and (src_lang is not None or tgt_lang is not None)
      ):
          new_src_eos = self.get_encoder_langtok(
              src_lang, tgt_lang, src_langtok_spec
          )
      else:
          src_eos = None
  
      new_tgt_bos = None
      if (
          tgt_langtok_spec
          and tgt_eos is not None
          and tgt_lang is not None
      ):
          new_tgt_bos = self.get_decoder_langtok(
              tgt_lang, tgt_langtok_spec
          )
      else:
          tgt_eos = None
  
      return TransformEosLangPairDataset(
          lang_pair_dataset,
          src_eos=src_eos,
          new_src_eos=new_src_eos,
          tgt_bos=tgt_eos,
          new_tgt_bos=new_tgt_bos,
      )
  
imports: import itertools
  import json
  import logging
  import math
  import os
  from collections import OrderedDict, defaultdict
  from argparse import ArgumentError
  from fairseq import utils
  from fairseq.data import AppendTokenDataset, ConcatDataset, Dictionary, LanguagePairDataset, PrependTokenDataset, SampledMultiDataset, SampledMultiEpochDataset, StripTokenDataset, TransformEosLangPairDataset, TruncateDataset, data_utils, indexed_dataset
  from fairseq.data.multilingual.multilingual_utils import EncoderLangtok, LangTokSpec, LangTokStyle, augment_dictionary, get_lang_tok
  from fairseq.data.multilingual.sampled_multi_dataset import CollateFormat
  from fairseq.file_io import PathManager
  from fairseq.utils import FileContentsAction, csv_str_list, eval_str_dict
label_desc: Use image node_id 22 for calling the MultilingualDatasetManager obj's underlying member method code with example usage: obj.alter_dataset_langtok(lang_pair_dataset, src_eos, src_lang, tgt_eos, tgt_lang, src_langtok_spec, tgt_langtok_spec) and returns: TransformEosLangPairDataset, lang_pair_dataset