code: def test_validate_key():
      validate_key(1)
      validate_key(("x", 1))
      with pytest.raises(TypeError, match="Unexpected key type.*list"):
          validate_key(["x", 1])
  
      with pytest.raises(
          TypeError, match="unexpected key type at index=1"
      ):
          validate_key((2, int))
  
imports: from __future__ import annotations
  import pickle
  from collections import namedtuple
  import pytest
  from dask.core import flatten, get, get_dependencies, get_deps, getcycle, has_tasks, ishashable, iskey, istask, literal, preorder_traversal, quote, subs, validate_key
  from dask.utils_test import GetFunctionTestMixin, add, inc
label_desc: Use image node_id 5 for calling a global function with example usage: test_validate_key() without return types