code: def test_canonical_name():
      c = {"foo-bar": 1, "fizz_buzz": 2}
      assert canonical_name("foo-bar", c) == "foo-bar"
      assert canonical_name("foo_bar", c) == "foo-bar"
      assert canonical_name("fizz-buzz", c) == "fizz_buzz"
      assert canonical_name("fizz_buzz", c) == "fizz_buzz"
      assert canonical_name("new-key", c) == "new-key"
      assert canonical_name("new_key", c) == "new_key"
  
imports: from __future__ import annotations
  import os
  import site
  import stat
  import sys
  from collections import OrderedDict
  from contextlib import contextmanager
  import pytest
  import yaml
  import dask.config
  from dask.config import _get_paths, canonical_name, collect, collect_env, collect_yaml, config, deserialize, ensure_file, expand_environment_variables, get, merge, pop, refresh, rename, serialize, update, update_defaults
  from dask.utils import tmpfile
label_desc: Use image node_id 1 for calling a global function with example usage: test_canonical_name() without return types