code: def maybe_pad(
      draw, regex, strategy, left_pad_strategy, right_pad_strategy
  ):
      """Attempt to insert padding around the result of a regex draw while
      preserving the match."""
      result = draw(strategy)
      left_pad = draw(left_pad_strategy)
      if left_pad and regex.search(left_pad + result):
          result = left_pad + result
      right_pad = draw(right_pad_strategy)
      if right_pad and regex.search(result + right_pad):
          result += right_pad
      return result
  
imports: import operator
  import re
  from hypothesis.errors import InvalidArgument
  from hypothesis.internal import charmap
  from hypothesis.strategies._internal.lazy import unwrap_strategies
  from hypothesis.strategies._internal.strings import OneCharStringStrategy
  from hypothesis import reject, strategies
  from hypothesis.internal.charmap import as_general_categories, categories
  from hypothesis.internal.compat import add_note, int_to_byte
label_desc: Use image node_id 6 for calling a global function with example usage: maybe_pad(draw, regex, strategy, left_pad_strategy, right_pad_strategy) and returns: result