code: def test_date_to_index_ndarray():
      dr = date_range("20000101", periods=3000, freq="W")
      y = Series(np.arange(3000.0), index=dr)
      date_index = np.asarray(y.index)
  
      index = date_to_index(date_index[0], date_index)
      assert_equal(index, 0)
      index = date_to_index(date_index[-1], date_index)
      assert_equal(index, date_index.shape[0] - 1)
  
imports: from abc import abstractmethod
  import datetime
  import numpy
  from numpy.random import RandomState
  from numpy.testing import assert_equal
  from pandas import DataFrame, Series, Timedelta, date_range
  import pytest
  from arch import doc
  from arch.univariate.base import implicit_constant
  from arch.utility.array import ConcreteClassMeta, DocStringInheritor, cutoff_to_index, date_to_index, ensure1d, ensure2d, find_index, parse_dataframe
label_desc: Use image node_id 12 for calling a global function with example usage: test_date_to_index_ndarray() without return types