code: def get_patch_for(func, failing_examples, *, strip_via=()):
      # Skip this if we're unable to find the location or source of this function.
      try:
          module = sys.modules[func.__module__]
          fname = Path(module.__file__).relative_to(Path.cwd())
          before = inspect.getsource(func)
      except Exception:
          return None
  
      # The printed examples might include object reprs which are invalid syntax,
      # so we parse here and skip over those.  If _none_ are valid, there's no patch.
      call_nodes = []
      for ex, via in set(failing_examples):
          with suppress(Exception):
              node = cst.parse_expression(ex)
              assert isinstance(node, cst.Call), node
              # Check for st.data(), which doesn't support explicit examples
              data = m.Arg(
                  m.Call(m.Name("data"), args=[m.Arg(m.Ellipsis())])
              )
              if m.matches(
                  node,
                  m.Call(args=[m.ZeroOrMore(), data, m.ZeroOrMore()]),
              ):
                  return None
              call_nodes.append((node, via))
      if not call_nodes:
          return None
  
      if (
          module.__dict__.get("hypothesis") is sys.modules["hypothesis"]
          and "given"
          not in module.__dict__  # more reliably present than `example`
      ):
          decorator_func = "hypothesis.example"
      else:
          decorator_func = "example"
  
      # Do the codemod and return a triple containing location and replacement info.
      dedented, prefix = dedent(before)
      try:
          node = cst.parse_module(dedented)
      except Exception:  # pragma: no cover
          # inspect.getsource() sometimes returns a decorator alone, which is invalid
          return None
      after = AddExamplesCodemod(
          CodemodContext(),
          fn_examples={func.__name__: call_nodes},
          strip_via=strip_via,
          dec=decorator_func,
          width=88 - len(prefix),  # to match Black's default formatting
      ).transform_module(node)
      return (str(fname), before, indent(after.code, prefix=prefix))
  
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 3 for calling a global function with example usage: get_patch_for(func, failing_examples) and returns: str,  before,  indent, None, None, None, None