code: def test_check_keys():
      def create_dict_with_keys(keys):
          return {k: None for k in keys}
  
      # equal
      d1 = create_dict_with_keys([1, 2, 3])
      assert py_datastructures.check_keys(d1, [1, 2, 3])
      assert not py_datastructures.check_keys(d1, [1, 2, 3, 4])
      assert not py_datastructures.check_keys(d1, [1])
      assert not py_datastructures.check_keys(d1, [])
  
      # subset
      d1 = create_dict_with_keys([1, 2, 3])
      assert py_datastructures.check_keys(d1, [1, 2, 3], mode="subset")
      assert py_datastructures.check_keys(
          d1, [1, 2, 3, 4], mode="subset"
      )
      assert not py_datastructures.check_keys(
          d1, [1, 2, 4], mode="subset"
      )
      assert not py_datastructures.check_keys(d1, [1, 2], mode="subset")
  
      # superset
      d1 = create_dict_with_keys([1, 2, 3])
      assert py_datastructures.check_keys(
          d1, [1, 2, 3], mode="superset"
      )
      assert not py_datastructures.check_keys(
          d1, [1, 2, 3, 4], mode="superset"
      )
      assert not py_datastructures.check_keys(
          d1, [1, 2, 4], mode="superset"
      )
      assert py_datastructures.check_keys(d1, [1, 2], mode="superset")
  
      # strict_subset
      d1 = create_dict_with_keys([1, 2, 3])
      assert not py_datastructures.check_keys(
          d1, [1, 2, 3], mode="strict_subset"
      )
      assert py_datastructures.check_keys(
          d1, [1, 2, 3, 4], mode="strict_subset"
      )
      assert not py_datastructures.check_keys(
          d1, [1, 2, 4], mode="strict_subset"
      )
      assert not py_datastructures.check_keys(
          d1, [1, 2], mode="strict_subset"
      )
  
      # strict_superset
      d1 = create_dict_with_keys([1, 2, 3])
      assert not py_datastructures.check_keys(
          d1, [1, 2, 3], mode="strict_superset"
      )
      assert not py_datastructures.check_keys(
          d1, [1, 2, 3, 4], mode="strict_superset"
      )
      assert not py_datastructures.check_keys(
          d1, [1, 2, 4], mode="strict_superset"
      )
      assert py_datastructures.check_keys(
          d1, [1, 2], mode="strict_superset"
      )
  
      with pytest.raises(AssertionError):
          py_datastructures.check_keys(d1, [1, 1])
  
file_path: jiant/tests/utils/python/test_datastructures.py
imports: import json
  import pytest
  from dataclasses import dataclass
  import jiant.utils.python.datastructures
label_desc: Use image node_id 8 for calling a global function with example usage: test_check_keys() and returns: unknown