code: def test_binary_serialize_1d(figure):
      x = np.arange(10, dtype=np.float64)
      y = (x**2).astype(np.int32)
      scatter = bqplot.Scatter(x=x, y=y)
  
      state = scatter.get_state()
      assert state["x"]["dtype"] == "float64"
      assert state["y"]["dtype"] == "int32"
  
      assert state["x"]["value"] == memoryview(x)
      assert state["y"]["value"] == memoryview(y)
  
      assert state["x"]["shape"] == (10,)
      assert state["y"]["shape"] == (10,)
  
      scatter2 = bqplot.Scatter()
      scatter2.set_state(state)
  
      assert scatter.x.dtype == np.float64
      assert scatter.y.dtype == np.int32
  
      assert scatter.x.shape == (10,)
      assert scatter.y.shape == (10,)
  
      assert scatter2.x.tolist() == x.tolist()
      assert scatter2.y.tolist() == y.tolist()
  
file_path: bqplot/tests/binary_serialization_test.py
imports: import bqplot
  import numpy
  import pandas
  from bqplot.traits import array_to_json, array_from_json
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_binary_serialize_1d(figure) without return types