code: def test_chain_idx_get():
      # dict
      d = {1: {2: 3}}
      ls = [1, [2], [None, [3]]]
      assert (
          py_datastructures.chain_idx_get(d[1], [2], default=1234) == 3
      )
      assert (
          py_datastructures.chain_idx_get(d, [1, 3], default=1234)
          == 1234
      )
  
      # list
      assert py_datastructures.chain_idx_get(ls, [0], default=1234) == 1
      assert (
          py_datastructures.chain_idx_get(ls, [0, 0], default=1234)
          == 1234
      )
      assert (
          py_datastructures.chain_idx_get(ls, [1, 1], default=1234)
          == 1234
      )
  
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 3 for calling a global function with example usage: test_chain_idx_get() without return types