code: def test_set_state_data(echo):
      w = DataWidget()
      data = memoryview(b"x" * 30)
      w.set_state(
          dict(
              a=True,
              d={"data": data},
          )
      )
      assert len(w.comm.messages) == (1 if echo else 0)
  
imports: import pytest
  from traitlets import Bool, Tuple, List, Instance, CFloat, CInt, Float, Int, TraitError, observe
  from .utils import setup, teardown
  import ipywidgets
  from ipywidgets import Widget
label_desc: Use image node_id 9 for calling a global function with example usage: test_set_state_data(echo) without return types