code: def test_map_iterator():
      sm = m.StringMap({"hi": "bye", "black": "white"})
      assert sm["hi"] == "bye"
      assert len(sm) == 2
      assert sm["black"] == "white"
  
      with pytest.raises(KeyError):
          assert sm["orange"]
      sm["orange"] = "banana"
      assert sm["orange"] == "banana"
  
      expected = {"hi": "bye", "black": "white", "orange": "banana"}
      for k in sm:
          assert sm[k] == expected[k]
      for k, v in sm.items():
          assert v == expected[k]
      assert list(sm.values()) == [expected[k] for k in sm]
  
      it = iter(m.StringMap({}))
      for _ in range(
          3
      ):  # __next__ must continue to raise StopIteration
          with pytest.raises(StopIteration):
              next(it)
  
file_path: coremltools/deps/pybind11/tests/test_sequences_and_iterators.py
imports: import pytest
  from pytest import approx
  from pybind11_tests import ConstructorStats
  from pybind11_tests import sequences_and_iterators
label_desc: Use image node_id 10 for calling a global function with example usage: test_map_iterator() without return types