code: def tests_accepts_timedelta(self):
      class Foo(HasProps):
          dt = bcpd.NumberSpec("dt", accept_datetime=True)
          ndt = bcpd.NumberSpec("ndt", accept_datetime=False)
  
      f = Foo()
  
      # FYI Numpy erroneously raises an annoying warning about elementwise
      # comparison below because a timedelta is compared to a float.
      # https://github.com/numpy/numpy/issues/10095
      with warnings.catch_warnings():
          warnings.simplefilter(
              action="ignore", category=DeprecationWarning
          )
  
          f.dt = datetime.timedelta(3, 54)
          assert f.dt == 259254000.0
  
          # counts as number.Real out of the box
          f.dt = np.timedelta64(3000, "ms")
          assert f.dt == np.timedelta64(3000, "ms")
  
          f.ndt = datetime.timedelta(3, 54)
          assert f.ndt == 259254000.0
  
          # counts as number.Real out of the box
          f.ndt = np.timedelta64(3000, "ms")
          assert f.ndt == np.timedelta64(3000, "ms")
  
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 3 for calling the Test_NumberSpec obj's underlying member method code with example usage: obj.tests_accepts_timedelta() without return types