nodes: 0, module; 1, function_definition; 2, function_name:find_in_sorted_index; 3, parameters; 4, block; 5, identifier:dts; 6, identifier:dt; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, return_statement; 11, comment:"""
      Find the index of ``dt`` in ``dts``.
  
      This function should be used instead of `dts.get_loc(dt)` if the index is
      large enough that we don't want to initialize a hash table in ``dts``. In
      particular, this should always be used on minutely trading calendars.
  
      Parameters
      ----------
      dts : pd.DatetimeIndex
          Index in which to look up ``dt``. **Must be sorted**.
      dt : pd.Timestamp
          ``dt`` to be looked up.
  
      Returns
      -------
      ix : int
          Integer index such that dts[ix] == dt.
  
      Raises
      ------
      KeyError
          If dt is not in ``dts``.
      """; 12, assignment; 13, boolean_operator; 14, block; 15, identifier:ix; 16, identifier:ix; 17, call; 18, comparison_operator:ix == len(dts); 19, comparison_operator:dts[ix] != dt; 20, raise_statement; 21, attribute; 22, argument_list; 23, identifier:ix; 24, call; 25, subscript; 26, identifier:dt; 27, call; 28, identifier:dts; 29, identifier:searchsorted; 30, identifier:dt; 31, identifier:len; 32, argument_list; 33, identifier:dts; 34, identifier:ix; 35, identifier:LookupError; 36, argument_list; 37, identifier:dts; 38, call; 39, attribute; 40, argument_list; 41, string:"{dt} is not in {dts}"; 42, identifier:format; 43, keyword_argument; 44, keyword_argument; 45, identifier:dt; 46, identifier:dt; 47, identifier:dts; 48, identifier:dts
code: def find_in_sorted_index(dts, dt):
      """
      Find the index of ``dt`` in ``dts``.
  
      This function should be used instead of `dts.get_loc(dt)` if the index is
      large enough that we don't want to initialize a hash table in ``dts``. In
      particular, this should always be used on minutely trading calendars.
  
      Parameters
      ----------
      dts : pd.DatetimeIndex
          Index in which to look up ``dt``. **Must be sorted**.
      dt : pd.Timestamp
          ``dt`` to be looked up.
  
      Returns
      -------
      ix : int
          Integer index such that dts[ix] == dt.
  
      Raises
      ------
      KeyError
          If dt is not in ``dts``.
      """
      ix = dts.searchsorted(dt)
      if ix == len(dts) or dts[ix] != dt:
          raise LookupError("{dt} is not in {dts}".format(dt=dt, dts=dts))
      return ix