code: def test_accepts_datetime(self) -> None:
      class Foo(HasProps):
          dt = bcpd.NumberSpec("dt", accept_datetime=True)
          ndt = bcpd.NumberSpec("ndt", accept_datetime=False)
  
      f = Foo()
  
      f.dt = datetime.datetime(2016, 5, 11)
      assert f.dt == 1462924800000.0
  
      f.dt = np.datetime64("2016-05-11")
      assert f.dt == 1462924800000.0
  
      f.dt = datetime.date(2016, 5, 11)
      assert f.dt == 1462924800000.0
  
      with pytest.raises(ValueError):
          f.ndt = datetime.datetime(2016, 5, 11)
  
      with pytest.raises(ValueError):
          f.ndt = datetime.date(2016, 5, 11)
  
      with pytest.raises(ValueError):
          f.ndt = np.datetime64("2016-05-11")
  
imports: from __future__ import annotations
  import pytest
  import datetime
  import warnings
  from copy import copy
  import numpy
  import pandas
  from bokeh.core.has_props import HasProps, Local
  from bokeh.core.property.vectorization import Field, Value, field, value
  from tests.support.util.api import verify_all
  import bokeh.core.property.dataspec
label_desc: Use image node_id 5 for calling the Test_NumberSpec obj's underlying member method code with example usage: obj.test_accepts_datetime() without return types