code: def _check_read_only_list(lst):
      assert isinstance(lst, ReadOnlyList)
  
      # Check __eq__
      assert lst == lst
      assert lst == ReadOnlyList(lst)
  
      # Check __contains__ and __iter__
      for x in lst:
          assert x in lst
  
      # Check serialization
      _check_serializable(lst)
  
      raises_list = pytest.raises(SacredError, match="read-only")
  
      if len(lst):
          with raises_list:
              del lst[0]
  
          with raises_list:
              lst[0] = 42
  
          with raises_list:
              lst.pop(0)
  
      with raises_list:
          lst.pop()
  
      with raises_list:
          lst.clear()
  
      with raises_list:
          lst.append(42)
  
      with raises_list:
          lst.extend([1, 2, 3, 4])
  
      with raises_list:
          lst.insert(0, 0)
  
      with raises_list:
          lst.remove(1)
  
      with raises_list:
          lst.sort()
  
      with raises_list:
          lst.reverse()
  
imports: import json
  import pickle
  import pytest
  from copy import copy, deepcopy
  from sacred.config.custom_containers import make_read_only, ReadOnlyList, ReadOnlyDict
  from sacred.utils import SacredError
label_desc: Use image node_id 4 for calling a global function with example usage: _check_read_only_list(lst) without return types