code: def test_keep_signals():
      spec = manual_histogram_spec()
  
      # pre-transform without keep_signals. No signals should be present in pre-transformed spec
      tx_spec, warnings = vf.runtime.pre_transform_spec(spec)
      assert len(tx_spec.get("signals", [])) == 0
  
      # Specify single keep_signal as a string
      tx_spec, warnings = vf.runtime.pre_transform_spec(
          spec,
          keep_signals="layer_0_layer_0_bin_maxbins_10_IMDB_Rating_bins",
      )
      assert len(tx_spec.get("signals", [])) == 1
      sig0 = tx_spec["signals"][0]
      assert (
          sig0["name"]
          == "layer_0_layer_0_bin_maxbins_10_IMDB_Rating_bins"
      )
      assert sig0["value"]["step"] == 1.0
  
      # Specify multiple keep_signals as a list
      tx_spec, warnings = vf.runtime.pre_transform_spec(
          spec,
          keep_signals=[
              "layer_0_layer_0_bin_maxbins_10_IMDB_Rating_bins",
              ("layer_0_layer_0_bin_maxbins_10_IMDB_Rating_extent", []),
          ],
      )
      assert len(tx_spec.get("signals", [])) == 2
      sig0 = tx_spec["signals"][0]
      sig1 = tx_spec["signals"][1]
      [sig0, sig1] = sorted([sig0, sig1], key=lambda v: v["name"])
      assert (
          sig0["name"]
          == "layer_0_layer_0_bin_maxbins_10_IMDB_Rating_bins"
      )
      assert (
          sig1["name"]
          == "layer_0_layer_0_bin_maxbins_10_IMDB_Rating_extent"
      )
      assert sig1["value"] == [1.4, 9.2]
  
imports: import pandas
  import pytest
  from pandas import Timestamp, NaT
  import pyarrow
  import vegafusion
  import json
  import polars
  from datetime import date
  import decimal
  import base64
label_desc: Use image node_id 29 for calling a global function with example usage: test_keep_signals() without return types