class_docstr: An attack generates adversarial examples on text.
  
  This is an abstract class that contains main helper functionality for
  attacks. An attack is comprised of a search method, goal function,
  a transformation, and a set of one or more linguistic constraints that
  successful examples must meet.
class_docstr_tok: ["An","attack","generates","adversarial","examples","on","text",".","This","is","an","abstract","class","that","contains","main","helper","functionality","for","attacks",".","An","attack","is","comprised","of","a","search","method",",","goal","function",",","a","transformation",",","and","a","set","of","one","or","more","linguistic","constraints","that","successful","examples","must","meet","."]
docstr: Prints attack parameters in a human-readable string.
  
  Inspired by the readability of printing PyTorch nn.Modules:
  https://github.com/pytorch/pytorch/blob/master/torch/nn/modules/module.py
docstr_tok: ["Prints","attack","parameters","in","a","human-readable","string",".","Inspired","by","the","readability","of","printing","PyTorch","nn.Modules",":","https",":","\/\/github.com\/pytorch\/pytorch\/blob\/master\/torch\/nn\/modules\/module.py"]
code: def print(self):
      """
      Prints attack parameters in a human-readable string.
  
      Inspired by the readability of printing PyTorch nn.Modules:
      https://github.com/pytorch/pytorch/blob/master/torch/nn/modules/module.py
      """
      main_str = "Attack" + "("
      lines = []
  
      lines.append(
          utils.add_indent(
              f"(search_method): " f"{self.search_method}", 2
          )
      )
      # self.goal_function
      lines.append(
          utils.add_indent(
              f"(goal_function): " f" {self.goal_function}", 2
          )
      )
      # self.transformation
      lines.append(
          utils.add_indent(
              f"(transformation):  " f"{self.transformation}", 2
          )
      )
      # self.constraints
      constraints_lines = []
      constraints = (
          self.constraints + self.pre_transformation_constraints
      )
      if len(constraints):
          for i, constraint in enumerate(constraints):
              constraints_lines.append(
                  utils.add_indent(f"({i}): " f"{constraint}", 2)
              )
          constraints_str = utils.add_indent(
              "\n" + "\n".join(constraints_lines), 2
          )
      else:
          constraints_str = "None"
      lines.append(
          utils.add_indent(f"(constraints): " f"{constraints_str}", 2)
      )
      # self.is_black_box
      lines.append(
          utils.add_indent(
              f"(is_black_box):  " f"{self.is_black_box}", 2
          )
      )
      main_str += "\n  " + "\n  ".join(lines) + "\n"
      main_str += ")"
      return main_str
  
imports: import lru
  from collections import deque
  from ...common import logger
  from textattack.attack_results import FailedAttackResult, MaximizedAttackResult, SuccessfulAttackResult
  from textattack.goal_function_results import GoalFunctionResultStatus
  from textattack.shared import AttackedText, utils
  from textattack.transformations import CompositeTransformation
label_desc: Use image node_id 12 for calling the Attack obj's underlying member method code with example usage: obj.print() and returns: main_str