code: def test_mapping_works_with_dict(self):
      field = MetadataField({"a": 1, "b": [0]})
  
      assert "a" in field
      assert field["a"] == 1
      assert len(field) == 2
  
      keys = {k for k in field}
      assert keys == {"a", "b"}
  
      values = [v for v in field.values()]
      assert len(values) == 2
      assert 1 in values
      assert [0] in values
  
file_path: allennlp/tests/data/fields/metadata_field_test.py
imports: import pytest
  from allennlp.common.testing.test_case import AllenNlpTestCase
  from allennlp.data.fields import MetadataField
label_desc: Use image node_id 1 for calling the TestMetadataField obj's underlying member method code with example usage: obj.test_mapping_works_with_dict() without return types