docstr: Associates a DataCollection with an Augmentation.
  Augmentation objects are in need of refactoring to avoid overwrought functions like these.
docstr_tok: ["Associates","a","DataCollection","with","an","Augmentation",".","Augmentation","objects","are","in","need","of","refactoring","to","avoid","overwrought","functions","like","these","."]
code: def append_augmentation(self, augmentations, multiplier=None):
      """Associates a DataCollection with an Augmentation.
      Augmentation objects are in need of refactoring to avoid overwrought functions like these.
      """
  
      # TODO: Add checks for unequal multiplier, or take multiplier specification out of the hands of individual augmentations.
      # TODO: Add checks for incompatible augmentations. Maybe make this whole thing better in general..
  
      if type(augmentations) is not list:
          augmentations = [augmentations]
  
      augmented_data_groups = []
      for augmentation in augmentations:
          for data_group_label in list(augmentation.data_groups.keys()):
              augmented_data_groups += [data_group_label]
  
      # Unspecified data groups will be copied along.
      unaugmented_data_groups = [
          data_group
          for data_group in list(self.data_groups.keys())
          if data_group not in augmented_data_groups
      ]
      if unaugmented_data_groups != []:
          augmentations += [Copy(data_groups=unaugmented_data_groups)]
  
      for augmentation in augmentations:
          for data_group_label in list(augmentation.data_groups.keys()):
              augmentation.set_multiplier(multiplier)
              augmentation.append_data_group(
                  self.data_groups[data_group_label]
              )
  
      # This is so bad.
      for augmentation in augmentations:
          augmentation.initialize_augmentation()
          for data_group_label in list(augmentation.data_groups.keys()):
              if augmentation.output_shape is not None:
                  self.data_groups[
                      data_group_label
                  ].output_shape = augmentation.output_shape[
                      data_group_label
                  ]
              self.data_groups[
                  data_group_label
              ].augmentation_cases.append(None)
              self.data_groups[
                  data_group_label
              ].augmentation_strings.append("")
  
      # The total iterations variable allows for "total" augmentations later on.
      # For example, "augment until 5000 images is reached"
      total_iterations = multiplier
      self.multiplier *= multiplier
  
      self.augmentations.append(
          {
              "augmentation": augmentations,
              "iterations": total_iterations,
          }
      )
  
      return
  
imports: import os
  import csv
  import numpy
  import tables
  import copy
  from tqdm import tqdm
  from deepneuro.augmentation.augment import Copy
  from deepneuro.utilities.conversion import read_image_files
  from deepneuro.data.data_group import DataGroup
  from deepneuro.data.data_load import parse_directories, parse_filepaths, parse_hdf5, parse_csv, parse_numpy
  from deepneuro.utilities.util import add_parameter
label_desc: Use image node_id 6 for calling the DataCollection obj's underlying member method code with example usage: obj.append_augmentation(augmentations, multiplier) without return types