code: def test_to_pydatetime_bijective(self):
      # Ensure that converting to datetime and back only loses precision
      # by going from nanoseconds to microseconds.
      exp_warning = (
          None if Timestamp.max.nanosecond == 0 else UserWarning
      )
      with tm.assert_produces_warning(exp_warning):
          pydt_max = Timestamp.max.to_pydatetime()
  
      assert (
          Timestamp(pydt_max).as_unit("ns")._value / 1000
          == Timestamp.max._value / 1000
      )
  
      exp_warning = (
          None if Timestamp.min.nanosecond == 0 else UserWarning
      )
      with tm.assert_produces_warning(exp_warning):
          pydt_min = Timestamp.min.to_pydatetime()
  
      # The next assertion can be enabled once GH#39221 is merged
      #  assert pydt_min < Timestamp.min  # this is bc nanos are dropped
      tdus = timedelta(microseconds=1)
      assert pydt_min + tdus > Timestamp.min
  
      assert (
          Timestamp(pydt_min + tdus).as_unit("ns")._value / 1000
          == Timestamp.min._value / 1000
      )
  
file_path: pandas/pandas/tests/scalar/timestamp/methods/test_to_pydatetime.py
imports: from datetime import datetime, timedelta
  import pytz
  from pandas._libs.tslibs.timezones import dateutil_gettz
  import pandas.util._test_decorators
  from pandas import Timestamp
  import pandas._testing
label_desc: Use image node_id 7 for calling the TestTimestampToPyDatetime obj's underlying member method code with example usage: obj.test_to_pydatetime_bijective() without return types