code: def add_cyclic_datepart(
      df: pd.DataFrame,
      field_name: str,
      prefix: str = None,
      drop: bool = True,
      time: bool = False,
      add_linear: bool = False,
  ):
      "Helper function that adds trigonometric date/time features to a date in the column `field_name` of `df`."
      make_date(df, field_name)
      field = df[field_name]
      prefix = ifnone(prefix, re.sub("[Dd]ate$", "", field_name))
      series = field.apply(
          partial(cyclic_dt_features, time=time, add_linear=add_linear)
      )
      columns = [
          prefix + c for c in cyclic_dt_feat_names(time, add_linear)
      ]
      df_feats = pd.DataFrame(
          [item for item in series], columns=columns, index=series.index
      )
      for column in columns:
          df[column] = df_feats[column]
      if drop:
          df.drop(field_name, axis=1, inplace=True)
      return df
  
imports: from ..None import utils
  from ..imports import *
  from ..preprocessor import Preprocessor
  from numbers import Number
  from types import SimpleNamespace
  from typing import Any, AnyStr, Callable, Collection, Dict, Hashable, Iterator, List, Mapping, NewType, Optional, Sequence, Tuple, TypeVar, Union
  from pandas.api.types import is_categorical_dtype, is_numeric_dtype
label_desc: Use image node_id 9 for calling a global function with example usage: add_cyclic_datepart(df, field_name, prefix, drop, time, add_linear) and returns: df