class_docstr: Class gets data dictionary from DatasetReader instance, merge fields if necessary, split a field if necessary
  
  Args:
      data: dictionary of data with fields "train", "valid" and "test" (or some of them)
      fields_to_merge: list of fields (out of ``"train", "valid", "test"``) to merge
      merged_field: name of field (out of ``"train", "valid", "test"``) to which save merged fields
      field_to_split: name of field (out of ``"train", "valid", "test"``) to split
      split_fields: list of fields (out of ``"train", "valid", "test"``) to which save splitted field
      split_proportions: list of corresponding proportions for splitting
      seed: random seed for iterating
      shuffle: whether to shuffle examples in batches
      split_seed: random seed for splitting dataset, if ``split_seed`` is None, division is based on `seed`.
      stratify: whether to use stratified split
      shot: number of examples to sample for each class in training data. If None, all examples will remain in data.
      *args: arguments
      **kwargs: arguments
  
  Attributes:
      data: dictionary of data with fields "train", "valid" and "test" (or some of them)
class_docstr_tok: ["Class","gets","data","dictionary","from","DatasetReader","instance",",","merge","fields","if","necessary",",","split","a","field","if","necessary","Args",":","data",":","dictionary","of","data","with","fields","``","train","''",",","``","valid","''","and","``","test","''","(","or","some","of","them",")","fields_to_merge",":","list","of","fields","(","out","of","``","``","train","''",",","``","valid","''",",","``","test","''","``",")","to","merge","merged_field",":","name","of","field","(","out","of","``","``","train","''",",","``","valid","''",",","``","test","''","``",")","to","which","save","merged","fields","field_to_split",":","name","of","field","(","out","of","``","``","train","''",",","``","valid","''",",","``","test","''","``",")","to","split","split_fields",":","list","of","fields","(","out","of","``","``","train","''",",","``","valid","''",",","``","test","''","``",")","to","which","save","splitted","field","split_proportions",":","list","of","corresponding","proportions","for","splitting","seed",":","random","seed","for","iterating","shuffle",":","whether","to","shuffle","examples","in","batches","split_seed",":","random","seed","for","splitting","dataset",",","if","``","split_seed","``","is","None",",","division","is","based","on","`","seed","`",".","stratify",":","whether","to","use","stratified","split","shot",":","number","of","examples","to","sample","for","each","class","in","training","data",".","If","None",",","all","examples","will","remain","in","data",".","*","args",":","arguments","*","*","kwargs",":","arguments","Attributes",":","data",":","dictionary","of","data","with","fields","``","train","''",",","``","valid","''","and","``","test","''","(","or","some","of","them",")"]
docstr: Merge given fields of dataset
  
  Args:
      fields_to_merge: list of fields (out of ``"train", "valid", "test"``) to merge
      merged_field: name of field (out of ``"train", "valid", "test"``) to which save merged fields
  
  Returns:
      None
docstr_tok: ["Merge","given","fields","of","dataset","Args",":","fields_to_merge",":","list","of","fields","(","out","of","``","``","train","''",",","``","valid","''",",","``","test","''","``",")","to","merge","merged_field",":","name","of","field","(","out","of","``","``","train","''",",","``","valid","''",",","``","test","''","``",")","to","which","save","merged","fields","Returns",":","None"]
code: def _merge_data(
      self, fields_to_merge: List[str] = None, merged_field: str = None
  ) -> bool:
      """
      Merge given fields of dataset
  
      Args:
          fields_to_merge: list of fields (out of ``"train", "valid", "test"``) to merge
          merged_field: name of field (out of ``"train", "valid", "test"``) to which save merged fields
  
      Returns:
          None
      """
      data = self.data.copy()
      data[merged_field] = []
      for name in fields_to_merge:
          data[merged_field] += self.data[name]
      self.data = data
      return True
  
file_path: DeepPavlov/deeppavlov/dataset_iterators/basic_classification_iterator.py
imports: from collections import defaultdict
  from logging import getLogger
  from typing import List
  from sklearn.model_selection import train_test_split
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.data.data_learning_iterator import DataLearningIterator
label_desc: Use image node_id 3 for calling the BasicClassificationDatasetIterator obj's underlying member method code with example usage: obj._merge_data(fields_to_merge, merged_field) and returns: True