code: def datetimes(
      min_value: dt.datetime = dt.datetime.min,
      max_value: dt.datetime = dt.datetime.max,
      *,
      timezones: SearchStrategy[Optional[dt.tzinfo]] = none(),
      allow_imaginary: bool = True,
  ) -> SearchStrategy[dt.datetime]:
      """datetimes(min_value=datetime.datetime.min, max_value=datetime.datetime.max, *, timezones=none(), allow_imaginary=True)
  
      A strategy for generating datetimes, which may be timezone-aware.
  
      This strategy works by drawing a naive datetime between ``min_value``
      and ``max_value``, which must both be naive (have no timezone).
  
      ``timezones`` must be a strategy that generates either ``None``, for naive
      datetimes, or :class:`~python:datetime.tzinfo` objects for 'aware' datetimes.
      You can construct your own, though we recommend using one of these built-in
      strategies:
  
      * with Python 3.9 or newer or :pypi:`backports.zoneinfo`:
        :func:`hypothesis.strategies.timezones`;
      * with :pypi:`dateutil <python-dateutil>`:
        :func:`hypothesis.extra.dateutil.timezones`; or
      * with :pypi:`pytz`: :func:`hypothesis.extra.pytz.timezones`.
  
      You may pass ``allow_imaginary=False`` to filter out "imaginary" datetimes
      which did not (or will not) occur due to daylight savings, leap seconds,
      timezone and calendar adjustments, etc.  Imaginary datetimes are allowed
      by default, because malformed timestamps are a common source of bugs.
  
      Examples from this strategy shrink towards midnight on January 1st 2000,
      local time.
      """
      # Why must bounds be naive?  In principle, we could also write a strategy
      # that took aware bounds, but the API and validation is much harder.
      # If you want to generate datetimes between two particular moments in
      # time I suggest (a) just filtering out-of-bounds values; (b) if bounds
      # are very close, draw a value and subtract its UTC offset, handling
      # overflows and nonexistent times; or (c) do something customised to
      # handle datetimes in e.g. a four-microsecond span which is not
      # representable in UTC.  Handling (d), all of the above, leads to a much
      # more complex API for all users and a useful feature for very few.
      check_type(bool, allow_imaginary, "allow_imaginary")
      check_type(dt.datetime, min_value, "min_value")
      check_type(dt.datetime, max_value, "max_value")
      if min_value.tzinfo is not None:
          raise InvalidArgument(f"{min_value=} must not have tzinfo")
      if max_value.tzinfo is not None:
          raise InvalidArgument(f"{max_value=} must not have tzinfo")
      check_valid_interval(
          min_value, max_value, "min_value", "max_value"
      )
      if not isinstance(timezones, SearchStrategy):
          raise InvalidArgument(
              f"{timezones=} must be a SearchStrategy that can "
              "provide tzinfo for datetimes (either None or dt.tzinfo objects)"
          )
      return DatetimeStrategy(
          min_value, max_value, timezones, allow_imaginary
      )
  
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 5 for calling a global function with example usage: datetimes(min_value, max_value) and returns: DatetimeStrategy