code: def date_range(
      start: Union[str, Any] = None,
      end: Union[str, Any] = None,
      periods: Optional[int] = None,
      freq: Optional[Union[str, DateOffset]] = None,
      tz: Optional[Union[str, tzinfo]] = None,
      normalize: bool = False,
      name: Optional[str] = None,
      inclusive: str = "both",
      **kwargs: Any,
  ) -> DatetimeIndex:
      """
      Return a fixed frequency DatetimeIndex.
  
      Parameters
      ----------
      start : str or datetime-like, optional
          Left bound for generating dates.
      end : str or datetime-like, optional
          Right bound for generating dates.
      periods : int, optional
          Number of periods to generate.
      freq : str or DateOffset, default 'D'
          Frequency strings can have multiples, e.g. '5H'.
      tz : str or tzinfo, optional
          Time zone name for returning localized DatetimeIndex, for example
          'Asia/Hong_Kong'. By default, the resulting DatetimeIndex is
          time zone naive.
      normalize : bool, default False
          Normalize start/end dates to midnight before generating date range.
      name : str, default None
          Name of the resulting DatetimeIndex.
      inclusive : {"both", "neither", "left", "right"}, default "both"
          Include boundaries; Whether to set each bound as closed or open.
  
          .. versionadded:: 4.0.0
  
      **kwargs
          For compatibility. Has no effect on the result.
  
      Returns
      -------
      rng : DatetimeIndex
  
      See Also
      --------
      DatetimeIndex : An immutable container for datetimes.
  
      Notes
      -----
      Of the four parameters ``start``, ``end``, ``periods``, and ``freq``,
      exactly three must be specified. If ``freq`` is omitted, the resulting
      ``DatetimeIndex`` will have ``periods`` linearly spaced elements between
      ``start`` and ``end`` (closed on both sides).
  
      To learn more about the frequency strings, please see `this link
      <https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases>`__.
  
      Examples
      --------
      **Specifying the values**
  
      The next four examples generate the same `DatetimeIndex`, but vary
      the combination of `start`, `end` and `periods`.
  
      Specify `start` and `end`, with the default daily frequency.
  
      >>> ps.date_range(start='1/1/2018', end='1/08/2018')  # doctest: +SKIP
      DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04',
                     '2018-01-05', '2018-01-06', '2018-01-07', '2018-01-08'],
                    dtype='datetime64[ns]', freq=None)
  
      Specify `start` and `periods`, the number of periods (days).
  
      >>> ps.date_range(start='1/1/2018', periods=8)  # doctest: +SKIP
      DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04',
                     '2018-01-05', '2018-01-06', '2018-01-07', '2018-01-08'],
                    dtype='datetime64[ns]', freq=None)
  
      Specify `end` and `periods`, the number of periods (days).
  
      >>> ps.date_range(end='1/1/2018', periods=8)  # doctest: +SKIP
      DatetimeIndex(['2017-12-25', '2017-12-26', '2017-12-27', '2017-12-28',
                     '2017-12-29', '2017-12-30', '2017-12-31', '2018-01-01'],
                    dtype='datetime64[ns]', freq=None)
  
      Specify `start`, `end`, and `periods`; the frequency is generated
      automatically (linearly spaced).
  
      >>> ps.date_range(
      ...     start='2018-04-24', end='2018-04-27', periods=3
      ... )  # doctest: +SKIP
      DatetimeIndex(['2018-04-24 00:00:00', '2018-04-25 12:00:00',
                     '2018-04-27 00:00:00'],
                    dtype='datetime64[ns]', freq=None)
  
      **Other Parameters**
  
      Changed the `freq` (frequency) to ``'M'`` (month end frequency).
  
      >>> ps.date_range(start='1/1/2018', periods=5, freq='M')  # doctest: +SKIP
      DatetimeIndex(['2018-01-31', '2018-02-28', '2018-03-31', '2018-04-30',
                     '2018-05-31'],
                    dtype='datetime64[ns]', freq=None)
  
      Multiples are allowed
  
      >>> ps.date_range(start='1/1/2018', periods=5, freq='3M')  # doctest: +SKIP
      DatetimeIndex(['2018-01-31', '2018-04-30', '2018-07-31', '2018-10-31',
                     '2019-01-31'],
                    dtype='datetime64[ns]', freq=None)
  
      `freq` can also be specified as an Offset object.
  
      >>> ps.date_range(
      ...     start='1/1/2018', periods=5, freq=pd.offsets.MonthEnd(3)
      ... )  # doctest: +SKIP
      DatetimeIndex(['2018-01-31', '2018-04-30', '2018-07-31', '2018-10-31',
                     '2019-01-31'],
                    dtype='datetime64[ns]', freq=None)
  
      `inclusive` controls whether to include `start` and `end` that are on the
      boundary. The default includes boundary points on either end.
  
      >>> ps.date_range(
      ...     start='2017-01-01', end='2017-01-04', inclusive="both"
      ... )  # doctest: +NORMALIZE_WHITESPACE
      DatetimeIndex(['2017-01-01', '2017-01-02', '2017-01-03', '2017-01-04'],
                     dtype='datetime64[ns]', freq=None)
  
      Use ``inclusive='left'`` to exclude `end` if it falls on the boundary.
  
      >>> ps.date_range(
      ...     start='2017-01-01', end='2017-01-04', inclusive='left'
      ... )  # doctest: +NORMALIZE_WHITESPACE
      DatetimeIndex(['2017-01-01', '2017-01-02', '2017-01-03'], dtype='datetime64[ns]', freq=None)
  
      Use ``inclusive='right'`` to exclude `start` if it falls on the boundary.
  
      >>> ps.date_range(
      ...     start='2017-01-01', end='2017-01-04', inclusive='right'
      ... )  # doctest: +NORMALIZE_WHITESPACE
      DatetimeIndex(['2017-01-02', '2017-01-03', '2017-01-04'], dtype='datetime64[ns]', freq=None)
      """
      assert freq not in ["N", "ns"], "nanoseconds is not supported"
      assert tz is None, "Localized DatetimeIndex is not supported"
  
      return cast(
          DatetimeIndex,
          ps.from_pandas(
              pd.date_range(
                  start=start,
                  end=end,
                  periods=periods,
                  freq=freq,
                  tz=tz,
                  normalize=normalize,
                  name=name,
                  inclusive=inclusive,
                  **kwargs,
              )
          ),
      )
  
imports: from typing import Any, Callable, Dict, List, Optional, Set, Sized, Tuple, Type, Union, cast, no_type_check
  from collections.abc import Iterable
  from datetime import tzinfo
  from functools import reduce
  from io import BytesIO
  import json
  import warnings
  import numpy
  import pandas
  from pandas.api.types import is_datetime64_dtype, is_list_like
  from pandas.tseries.offsets import DateOffset
  import pyarrow
  import pyarrow.parquet
  from pyspark.sql import functions, Column
  from pyspark.sql.functions import pandas_udf
  from pyspark.sql.types import ByteType, ShortType, IntegerType, LongType, FloatType, DoubleType, BooleanType, TimestampType, TimestampNTZType, DecimalType, StringType, DateType, StructType, DataType
  from pyspark.sql.dataframe import DataFrame
  from pyspark import pandas
  from pyspark.pandas._typing import Axis, Dtype, Label, Name
  from pyspark.pandas.base import IndexOpsMixin
  from pyspark.pandas.utils import align_diff_frames, default_session, is_name_like_tuple, is_name_like_value, name_like_string, same_anchor, scol_for, validate_axis, log_advice
  from pyspark.pandas.frame import DataFrame, _reduce_spark_multi
  from pyspark.pandas.internal import InternalFrame, DEFAULT_SERIES_NAME, HIDDEN_COLUMNS, SPARK_INDEX_NAME_FORMAT
  from pyspark.pandas.series import Series, first_series
  from pyspark.pandas.spark.utils import as_nullable_spark_type, force_decimal_precision_scale
  from pyspark.pandas.indexes import Index, DatetimeIndex, TimedeltaIndex
  from pyspark.pandas.indexes.multi import MultiIndex
  from pyspark.sql.utils import get_column_class
label_desc: Use image node_id 16 for calling a global function with example usage: date_range(start, end, periods, freq, tz, normalize, name, inclusive) and returns: cast