class_docstr: An ExternalIdIndex maps between "external IDs" and "integer locations" or "internal locations"
  (ilocs).
  
  It is designed to allow handling only efficient integers internally, but easily convert between
  them and the user-facing IDs.
class_docstr_tok: ["An","ExternalIdIndex","maps","between","``","external","IDs","''","and","``","integer","locations","''","or","``","internal","locations","''","(","ilocs",")",".","It","is","designed","to","allow","handling","only","efficient","integers","internally",",","but","easily","convert","between","them","and","the","user-facing","IDs","."]
docstr: Convert external IDs ``ids`` to integer locations.
  
  Args:
      ids: a collection of external IDs
      smaller_type: if True, convert the ilocs to the smallest type that can hold them, to reduce storage
      strict: if True, check that all IDs are known and throw a KeyError if not
  
  Returns:
      A numpy array of the integer locations for each id that exists, with missing IDs
      represented by either the largest value of the dtype (if smaller_type is True) or -1 (if
      smaller_type is False)
code: def to_iloc(self, ids, smaller_type=True, strict=False) -> np.ndarray:
      """
      Convert external IDs ``ids`` to integer locations.
  
      Args:
          ids: a collection of external IDs
          smaller_type: if True, convert the ilocs to the smallest type that can hold them, to reduce storage
          strict: if True, check that all IDs are known and throw a KeyError if not
  
      Returns:
          A numpy array of the integer locations for each id that exists, with missing IDs
          represented by either the largest value of the dtype (if smaller_type is True) or -1 (if
          smaller_type is False)
      """
      internal_ids = self._index.get_indexer(ids)
      if strict:
          self.require_valid(ids, internal_ids)
  
      # reduce the storage required (especially useful if this is going to be stored rather than
      # just transient)
      if smaller_type:
          return internal_ids.astype(self.dtype)
      return internal_ids
  
imports: import itertools
  from collections import defaultdict
  import numpy
  import pandas
  import scipy.sparse
  from ..globalvar import SOURCE, TARGET, WEIGHT, TYPE_ATTR_NAME
  from .validation import require_dataframe_has_columns, comma_sep
label_desc: Use image node_id 7 for calling the ExternalIdIndex obj's underlying member method code with example usage: obj.to_iloc(ids, smaller_type, strict) and returns: internal_ids, internal_ids