code: def test_custom_dicter():
      # Allow custom dict-like object in constructor
      class MyDict:
          def __init__(self):
              self._keys = []
  
          def __setitem__(self, key, value):
              self._keys.append(key)
  
          def __getitem__(self, key):
              if key in self._keys:
                  return "spam"
              return "eggs"
  
          def keys(self):
              return ["some", "keys"]
  
          def values(self):
              return ["funny", "list"]
  
      # code, label, aliases
      codes = ((1, "one", "1", "first"), (2, "two"))
      rc = Recoder(codes, map_maker=MyDict)
      assert rc.code[1] == "spam"
      assert rc.code["one"] == "spam"
      assert rc.code["first"] == "spam"
      assert rc.code["bizarre"] == "eggs"
      assert rc.value_set() == {"funny", "list"}
      assert list(rc.keys()) == ["some", "keys"]
  
file_path: nibabel/nibabel/tests/test_recoder.py
imports: import numpy
  import pytest
  from ..volumeutils import DtypeMapper, Recoder, native_code, swapped_code
label_desc: Use image node_id 7 for calling a global function with example usage: test_custom_dicter() and returns: str, list, list, str