docstr: Implement task oriented attack. Organise file level attack logic.
  
  Args:
  **kwargs: Other named arguments.
docstr_tok: ["Implement","task","oriented","attack",".","Organise","file","level","attack","logic",".","Args",":","*","*","kwargs",":","Other","named","arguments","."]
code: def _attack(self, **kwargs):
      """
      Implement task oriented attack. Organise file level attack logic.
  
      Args:
      **kwargs: Other named arguments.
      """
      assert self.fromfile is not None or self.fromfolder is not None
  
      if self.fromfile is not None and self.frommaskfile is not None:
          adversarial_output = self._attack_from_file(
              self.fromfile, self.frommaskfile, self.fromlogofile
          )
  
      if self.fromfolder is not None:
          filename_list = os.listdir(self.fromfolder)
          # take pics name out and construct xml filename to read from
          for filename in filename_list:
              pic_name = re.match(r"\d+.JPG", filename)
  
              if pic_name is not None:
                  self.overall_pics += 1
                  print(
                      (
                          "Pics number:",
                          self.overall_pics,
                          "The",
                          pic_name[0],
                          "!",
                      )
                  )
  
                  pic_mask_name = pic_name[0][:-3] + "xml"
                  fromfile = self.fromfolder + "/" + pic_name[0]
                  frommask = self.fromfolder + "/" + pic_mask_name
  
                  self._attack_from_file(fromfile, frommask)
  
          print(
              (
                  "Attack success rate:",
                  old_div(self.success, self.overall_pics),
              )
          )
  
imports: from __future__ import division
  from __future__ import print_function
  from builtins import input
  from builtins import range
  from builtins import object
  from past.utils import old_div
  from abc import ABCMeta
  from abc import abstractmethod
  import numpy
  import cv2
  import os
  import xmltodict
  import pdb
  from future.utils import with_metaclass
label_desc: Use image node_id 7 for calling the ODD_logic obj's underlying member method code with example usage: obj._attack() without return types