code: def test_is_valid(self) -> None:
      prop0 = bcpc.TypeOfAttr(Instance(Parent), "p0", Instance(Child0))
      prop1 = bcpc.TypeOfAttr(Instance(Parent), "p0", Instance(Child1))
      prop2 = bcpc.TypeOfAttr(Instance(Parent), "p0", Instance(Child2))
      prop3 = bcpc.TypeOfAttr(Instance(Parent), "p1", Int)
      prop4 = bcpc.TypeOfAttr(Instance(Parent), "p1", String)
      prop5 = bcpc.TypeOfAttr(Instance(Parent), "p2", String)
  
      assert prop0.is_valid(Parent(p0=Child0())) is True
      assert prop0.is_valid(Parent(p0=Child1())) is True
      assert prop0.is_valid(Parent(p0=Child2())) is False
  
      assert prop1.is_valid(Parent(p0=Child0())) is False
      assert prop1.is_valid(Parent(p0=Child1())) is True
      assert prop1.is_valid(Parent(p0=Child2())) is False
  
      assert prop2.is_valid(Parent(p0=Child0())) is False
      assert prop2.is_valid(Parent(p0=Child1())) is False
      assert prop2.is_valid(Parent(p0=Child2())) is True
  
      assert prop3.is_valid(Parent(p0=Child0(), p1=0)) is True
      assert prop3.is_valid(Parent(p0=Child1(), p1="")) is False
  
      assert prop4.is_valid(Parent(p0=Child0(), p1=0)) is False
      assert prop4.is_valid(Parent(p0=Child1(), p1="")) is True
  
      assert prop5.is_valid(Parent(p0=Child1(), p1="")) is False
  
imports: from __future__ import annotations
  import pytest
  from bokeh.core.has_props import HasProps, Local
  from bokeh.core.properties import Either, Instance, Int, String
  from tests.support.util.api import verify_all
  import bokeh.core.property.constraints
label_desc: Use image node_id 2 for calling the Test_TypeOfAttr obj's underlying member method code with example usage: obj.test_is_valid() without return types