code: def parser_tagger_data(
      path: Path,
      mixin_data_path: Optional[Path],
      mixin_data_percent: float,
      gold_preproc: bool,
      max_length: int = 0,
      limit: int = 0,
      augmenter: Optional[Callable] = None,
      seed: int = 0,
  ) -> Callable[[Language], Iterator[Example]]:
      random.seed(seed)
      main_corpus = Corpus(
          path,
          gold_preproc=gold_preproc,
          max_length=max_length,
          limit=limit,
          augmenter=augmenter,
      )
      if mixin_data_path is not None:
          mixin_corpus = Corpus(
              mixin_data_path,
              gold_preproc=gold_preproc,
              max_length=max_length,
              limit=limit,
              augmenter=augmenter,
          )
  
      def mixed_corpus(nlp: Language) -> Iterator[Example]:
          if mixin_data_path is not None:
              main_examples = main_corpus(nlp)
              mixin_examples = iter_sample(
                  mixin_corpus(nlp), mixin_data_percent
              )
              return itertools.chain(main_examples, mixin_examples)
          else:
              return main_corpus(nlp)
  
      return mixed_corpus
  
file_path: scispacy/scispacy/base_project_code.py
imports: from typing import Optional, Callable, Iterable, Iterator
  from pathlib import Path
  import random
  import itertools
  import spacy
  import warnings
  from spacy.training import Corpus, Example
  from spacy.language import Language
  from scispacy.custom_tokenizer import combined_rule_tokenizer
  from scispacy.data_util import read_full_med_mentions, read_ner_from_tsv
label_desc: Use image node_id 3 for calling a global function with example usage: parser_tagger_data(path, mixin_data_path, mixin_data_percent, gold_preproc, max_length, limit, augmenter, seed) and returns: mixed_corpus, itertools, main_corpus