class_docstr: Adversary contains the original object, the target and the adversarial
  example.
class_docstr_tok: ["Adversary","contains","the","original","object",",","the","target","and","the","adversarial","example","."]
docstr: Set the target be targeted or untargeted.
  
  :param is_targeted_attack: bool
  :param target: The target.
  :param target_label: If is_targeted_attack is true and target_label is
              None, self.target_label will be set by the Attack class.
              If is_targeted_attack is false, target_label must be None.
docstr_tok: ["Set","the","target","be","targeted","or","untargeted",".",":","param","is_targeted_attack",":","bool",":","param","target",":","The","target",".",":","param","target_label",":","If","is_targeted_attack","is","true","and","target_label","is","None",",","self.target_label","will","be","set","by","the","Attack","class",".","If","is_targeted_attack","is","false",",","target_label","must","be","None","."]
code: def set_target(
      self, is_targeted_attack, target=None, target_label=None
  ):
      """
      Set the target be targeted or untargeted.
  
      :param is_targeted_attack: bool
      :param target: The target.
      :param target_label: If is_targeted_attack is true and target_label is
                  None, self.target_label will be set by the Attack class.
                  If is_targeted_attack is false, target_label must be None.
      """
      assert (target_label is None) or is_targeted_attack
      self.__is_targeted_attack = is_targeted_attack
      self.target_label = target_label
      self.__target = target
      if not is_targeted_attack:
          self.target_label = None
          self.__target = None
  
file_path: AdvBox/adversarialbox/adversary.py
imports: from builtins import object
  import numpy
  import logging
label_desc: Use image node_id 2 for calling the Adversary obj's underlying member method code with example usage: obj.set_target(is_targeted_attack, target, target_label) without return types