docstr: Add @example() decorator(s) for failing test(s).
  
  `code` is the source code of the module where the test functions are defined.
  `fn_examples` is a dict of function name to list-of-failing-examples.
docstr_tok: ["Add","@","example","(",")","decorator","(","s",")","for","failing","test","(","s",")",".","`","code","`","is","the","source","code","of","the","module","where","the","test","functions","are","defined",".","`","fn_examples","`","is","a","dict","of","function","name","to","list-of-failing-examples","."]
code: def __init__(
      self, context, fn_examples, strip_via=(), dec="example", width=88
  ):
      """Add @example() decorator(s) for failing test(s).
  
      `code` is the source code of the module where the test functions are defined.
      `fn_examples` is a dict of function name to list-of-failing-examples.
      """
      assert (
          fn_examples
      ), "This codemod does nothing without fn_examples."
      super().__init__(context)
  
      self.decorator_func = cst.parse_expression(dec)
      self.line_length = width
      value_in_strip_via = m.MatchIfTrue(
          lambda x: literal_eval(x.value) in strip_via
      )
      self.strip_matching = m.Call(
          m.Attribute(m.Call(), m.Name("via")),
          [m.Arg(m.SimpleString() & value_in_strip_via)],
      )
  
      # Codemod the failing examples to Call nodes usable as decorators
      self.fn_examples = {
          k: tuple(
              self.__call_node_to_example_dec(ex, via)
              for ex, via in nodes
          )
          for k, nodes in fn_examples.items()
      }
  
imports: import difflib
  import hashlib
  import inspect
  import re
  import sys
  from ast import literal_eval
  from contextlib import suppress
  from datetime import date, datetime, timedelta, timezone
  from pathlib import Path
  import libcst
  from libcst import matchers
  from libcst.codemod import CodemodContext, VisitorBasedCodemodCommand
  from hypothesis.configuration import storage_directory
  from hypothesis.version import __version__
label_desc: Use image node_id 1 to create a new AddExamplesCodemod object from inherited base classes: VisitorBasedCodemodCommand with example: obj = AddExamplesCodemod(context, fn_examples, strip_via, dec, width)