code: def test_prepare_spec():
      spec1 = copy.deepcopy(VEGALITE_SPEC)
      spec1view = prepare_spec(spec1, PANDAS_DATA)
      assert spec1 is spec1view  # should modify in-place
  
      spec2 = copy.deepcopy(VEGALITE_SPEC)
      spec2view = prepare_spec(spec2, JSON_DATA["values"])
      assert spec2 is spec2view  # should modify in-place
  
      spec3 = copy.deepcopy(VEGALITE_SPEC)
      spec3["data"] = JSON_DATA
      spec3view = prepare_spec(spec3)
      assert spec3 is spec3view  # should modify in-place
  
      # all three approaches should match
      assert spec1 == spec2 == spec3
  
file_path: ipyvega/vega/tests/test_utils.py
imports: import json
  import copy
  import numpy
  import pandas
  from ..utils import sanitize_dataframe, prepare_spec
label_desc: Use image node_id 3 for calling a global function with example usage: test_prepare_spec() without return types