code: def test_external_id_index_to_iloc(count, expected_missing):
      values = [f"id{x}" for x in range(count)]
      idx = ExternalIdIndex(values)
  
      all_ilocs = idx.to_iloc(values)
      assert (all_ilocs == list(range(count))).all()
      # the value for a missing ID should be larger than everything else, so that indexing with it
      # into an array indexed by the current ExternalIdIndex will fail
      assert (all_ilocs < expected_missing).all()
  
      if count <= 256:
          # only do individual lookups when there's a few IDs, and assume that if those work, then large ones will too
          for i, x in enumerate(values):
              np.testing.assert_array_equal(idx.to_iloc([x]), [i])
  
      # missing value
      assert idx.to_iloc(["A"]) == expected_missing
  
imports: import pytest
  import numpy
  from stellargraph.core.element_data import ExternalIdIndex
label_desc: Use image node_id 1 for calling a global function with example usage: test_external_id_index_to_iloc(count, expected_missing) without return types