code: def test_set_state_float_to_float(echo):
      w = NumberWidget()
      # Set floats to float
      w.set_state(
          dict(
              f=1.2,
              cf=2.6,
          )
      )
      # Ensure one message gets produced
      assert len(w.comm.messages) == (1 if echo else 0)
  
imports: import pytest
  from unittest import mock
  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 13 for calling a global function with example usage: test_set_state_float_to_float(echo) without return types