code: def do_draw(self, data):
      result = {}
      cap_low, cap_high = True, True
      for name in (
          "year",
          "month",
          "day",
          "hour",
          "minute",
          "second",
          "microsecond",
      ):
          low = getattr(
              self.min_dt if cap_low else dt.datetime.min, name
          )
          high = getattr(
              self.max_dt if cap_high else dt.datetime.max, name
          )
          if name == "day" and not cap_high:
              _, high = monthrange(**result)
          if name == "year":
              val = utils.integer_range(data, low, high, 2000)
          else:
              val = utils.integer_range(data, low, high)
          result[name] = val
          cap_low = cap_low and val == low
          cap_high = cap_high and val == high
      result = dt.datetime(**result)
      tz = data.draw(self.tz_strat)
      try:
          if is_pytz_timezone(tz):
              # Can't just construct; see http://pytz.sourceforge.net
              return tz.normalize(tz.localize(result))
          return result.replace(tzinfo=tz)
      except (ValueError, OverflowError):
          msg = "Failed to draw a datetime between %r and %r with timezone from %r."
          data.note_event(
              msg % (self.min_dt, self.max_dt, self.tz_strat)
          )
          data.mark_invalid()
  
file_path: catboost/contrib/python/hypothesis/py2/hypothesis/strategies/_internal/datetime.py
imports: from __future__ import absolute_import, division, print_function
  import datetime
  from calendar import monthrange
  from hypothesis.internal.conjecture import utils
  from hypothesis.strategies._internal.strategies import SearchStrategy
label_desc: Use image node_id 2 for calling the DatetimeStrategy obj's underlying member method code with example usage: obj.do_draw(data) and returns: result, tz