code: def draw_capped_multipart(
      data, min_value, max_value, duration_names=DATENAMES + TIMENAMES
  ):
      assert isinstance(min_value, (dt.date, dt.time, dt.datetime))
      assert type(min_value) == type(max_value)
      assert min_value <= max_value
      result = {}
      cap_low, cap_high = True, True
      for name in duration_names:
          low = getattr(min_value if cap_low else dt.datetime.min, name)
          high = getattr(
              max_value if cap_high else dt.datetime.max, name
          )
          if name == "day" and not cap_high:
              _, high = monthrange(**result)
          if name == "year":
              val = data.draw_integer(low, high, shrink_towards=2000)
          else:
              val = data.draw_integer(low, high)
          result[name] = val
          cap_low = cap_low and val == low
          cap_high = cap_high and val == high
      if hasattr(min_value, "fold"):
          # The `fold` attribute is ignored in comparison of naive datetimes.
          # In tz-aware datetimes it would require *very* invasive changes to
          # the logic above, and be very sensitive to the specific timezone
          # (at the cost of efficient shrinking and mutation), so at least for
          # now we stick with the status quo and generate it independently.
          result["fold"] = data.draw_integer(0, 1)
      return result
  
imports: import datetime
  from calendar import monthrange
  from functools import lru_cache
  from importlib import resources
  from pathlib import Path
  from typing import Optional
  from hypothesis.errors import InvalidArgument
  from hypothesis.internal.validation import check_type, check_valid_interval
  from hypothesis.strategies._internal.core import sampled_from
  from hypothesis.strategies._internal.misc import just, none
  from hypothesis.strategies._internal.strategies import SearchStrategy
  from hypothesis.strategies._internal.utils import defines_strategy
label_desc: Use image node_id 4 for calling a global function with example usage: draw_capped_multipart(data, min_value, max_value, duration_names) and returns: result