code: def test_convert():
      from dtale.views import startup
      from tests.dtale.test_replacements import replacements_data
      import dtale.global_state as global_state
  
      global_state.clear_store()
      with app.test_client() as c:
          global_state.new_data_inst(c.port)
          startup(URL, data=replacements_data(), data_id=c.port)
  
          resp = c.get(
              "/dtale/to-xarray/{}".format(c.port),
              query_string=dict(index=json.dumps(["a"])),
          )
          assert resp.status_code == 200
          assert global_state.get_dataset(c.port) is not None
          assert global_state.get_settings(c.port)["locked"] == ["a"]
  
file_path: dtale/tests/dtale/test_xarray.py
imports: import json
  import numpy
  import pandas
  import pytest
  import xarray
  from six import PY3
  from tests.dtale.test_views import app, URL
label_desc: Use image node_id 3 for calling a global function with example usage: test_convert() without return types