code: def is_datetime_ordered(df: DataFrame or Series) -> bool:
      """Returns True if the index is a datetime and ordered."""
      index_is_datetime = is_datetime64_any_dtype(df.index)
      try:
          ordered = df.index[0] < df.index[-1]
      except RuntimeWarning:
          pass
      finally:
          return True if index_is_datetime and ordered else False
  
file_path: pandas-ta/pandas_ta/utils/_core.py
imports: import re
  from pathlib import Path
  from sys import float_info
  from numpy import argmax, argmin
  from pandas import DataFrame, Series
  from pandas.api.types import is_datetime64_any_dtype
  from pandas_ta import Imports
label_desc: Use image node_id 5 for calling a global function with example usage: is_datetime_ordered(df) and returns: unknown