          module = import_module(mod)
          script = getattr(module, self._command.title())
          return script
  
      def _test_for_tf_version(self) -> None:
          """ Check that the required Tensorflow version is installed.
  
          Raises
          ------
          FaceswapError
 
</s> remove         Parameters
        ----------
        png_meta: dict
            The information held within the Faceswap PNG Header
        filename: str
            The full path to the file being validated
 </s> add         with futures.ThreadPoolExecutor() as executor:
            proc = {executor.submit(face.aligned.extract_face, img): idx
                    for idx, (face, img) in enumerate(zip(detected_faces, images))} </s> remove         Raises
        ------
        FaceswapError
            If a version 1.0 face appears in a 2.x set or vice versa
        """
        alignment_version = png_meta["source"]["alignments_version"]

        if not self._extract_version:
            logger.debug("Setting initial extract version: %s", alignment_version)
            self._extract_version = alignment_version
            if alignment_version == 1.0 and self._centering != "legacy":
                self._reset_cache(True)
            return
 </s> add             for future in futures.as_completed(proc):
                batch[proc[future], ..., :3] = future.result() </s> remove     def clear_tensorboard(self):
 </s> add     def _update_viewers(self,
                        viewer: Optional[Callable[[np.ndarray, str], None]],
                        timelapse_kwargs: Optional[Dict[str, str]]) -> None:
        """ Update the preview viewer and timelapse output

        Parameters
        ----------
        viewer: :func:`scripts.train.Train._show` or ``None``
            The function that will display the preview image
        timelapse_kwargs: dict
            The keyword arguments for generating time-lapse previews. If a time-lapse preview is
            not required then this should be ``None``. Otherwise all values should be full paths
            the keys being `input_a`, `input_b`, `output`.
        """
        if viewer is not None:
            self._samples.images = self._feeder.generate_preview()
            samples = self._samples.show_sample()
            if samples is not None:
                viewer(samples,
                       "Training - 'S': Save Now. 'R': Refresh Preview. 'M': Toggle Mask. 'F': "
                       "Toggle Screen Fit-Actual Size. 'ENTER': Save and Quit")

        if timelapse_kwargs:
            self._timelapse.output_timelapse(timelapse_kwargs)

    def clear_tensorboard(self) -> None: </s> remove         Raises
        ------
        FaceswapError
            If Alignment information is not available for any of the images being loaded in
            the batch
 </s> add 
    def _set_environment_variables(self) -> None:
        """ Set the number of threads that numexpr can use and TF environment variables. """
        # Allocate a decent number of threads to numexpr to suppress warnings
        cpu_count = os.cpu_count()
        allocate = cpu_count - cpu_count // 3 if cpu_count is not None else 1
        os.environ["NUMEXPR_MAX_THREADS"] = str(max(1, allocate))

        # Ensure tensorflow doesn't pin all threads to one core when using Math Kernel Library
        os.environ["TF_MIN_GPU_MULTIPROCESSOR_COUNT"] = "4"
        os.environ["KMP_AFFINITY"] = "disabled"

          module = import_module(mod)
          script = getattr(module, self._command.title())
          return script
  
    def _set_environment_variables(self) -> None:
        """ Set the number of threads that numexpr can use and TF environment variables. """
        # Allocate a decent number of threads to numexpr to suppress warnings
        cpu_count = os.cpu_count()
        allocate = cpu_count - cpu_count // 3 if cpu_count is not None else 1
        os.environ["NUMEXPR_MAX_THREADS"] = str(max(1, allocate))

        # Ensure tensorflow doesn't pin all threads to one core when using Math Kernel Library
        os.environ["TF_MIN_GPU_MULTIPROCESSOR_COUNT"] = "4"
        os.environ["KMP_AFFINITY"] = "disabled"

      def _test_for_tf_version(self) -> None:
          """ Check that the required Tensorflow version is installed.
  
          Raises
          ------
          FaceswapError
keep keep keep add keep keep keep keep keep keep
 Data Augmentation update (#1263)

- lib.detected_face
    - Subclass Masks for Landmark based masks
    - Add training mask propery + methods to DetectedFace
  - lib.training_training
    - subclass TrainingDataGenerator for training and preview data
    - Split cache into own module
    - Reduce thread count to 1 to prevent image corruption + data re-use
    - Process on largest model input/output size rather than stored image size
    - Size and crop masks during caching stage
    - Implement ring buffer for data flow
    - Fix preview reload bug
  - augmentation
    - typing
    - switch color aug order
    - better initialization
    - Fix warp + landmark warp to correctly apply at different image scales
    - Slightly improved warp caching
    - Don't store whether image is_preview. Handle all data as training images implicitly
  - plugins.trainer: Typing and fixes to work with trainingdata refactor 
lib/cli/launcher.py