class_docstr: Implementation of Sleeper Agent Attack
  
  | Paper link: https://arxiv.org/pdf/2106.08970.pdf
class_docstr_tok: ["Implementation","of","Sleeper","Agent","Attack","|","Paper","link",":","https",":","\/\/arxiv.org\/pdf\/2106.08970.pdf"]
docstr: Used for selecting train samples from target class
  :param x_train: clean training data
  :param y_train: labels fo clean training data
  :return x_train_target_samples, y_train_target_samples:
  samples and labels selected from target class in train data
docstr_tok: ["Used","for","selecting","train","samples","from","target","class",":","param","x_train",":","clean","training","data",":","param","y_train",":","labels","fo","clean","training","data",":","return","x_train_target_samples",",","y_train_target_samples",":","samples","and","labels","selected","from","target","class","in","train","data"]
code: def _select_target_train_samples(
      self, x_train: np.ndarray, y_train: np.ndarray
  ) -> Tuple[np.ndarray, np.ndarray]:
      """
      Used for selecting train samples from target class
      :param x_train: clean training data
      :param y_train: labels fo clean training data
      :return x_train_target_samples, y_train_target_samples:
      samples and labels selected from target class in train data
      """
      x_train_samples = np.copy(x_train)
      index_target = np.where(
          y_train.argmax(axis=1) == self.class_target
      )[0]
      x_train_target_samples = x_train_samples[index_target]
      y_train_target_samples = y_train[index_target]
      return x_train_target_samples, y_train_target_samples
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Tuple, TYPE_CHECKING, List, Union
  import random
  import numpy
  from tqdm.auto import trange
  from art.attacks.poisoning.gradient_matching_attack import GradientMatchingAttack
  from art.estimators.classification.pytorch import PyTorchClassifier
  from art.estimators.classification import TensorFlowV2Classifier
  from art.preprocessing.standardisation_mean_std.pytorch import StandardisationMeanStdPyTorch
  from art.preprocessing.standardisation_mean_std.tensorflow import StandardisationMeanStdTensorFlow
label_desc: Use image node_id 3 for calling the SleeperAgentAttack obj's underlying member method code with example usage: obj._select_target_train_samples(x_train, y_train) and returns: x_train_target_samples,  y_train_target_samples