code: def trending_down(df: pd.Series, period: int) -> pd.Series:
      """returns boolean Series if the input Series is trending up over last n periods.
      :param df: data
      :param period: range
      :return: result Series
      """
  
      return pd.Series(
          df.diff(period) < 0, name="trending_down {}".format(period)
      )
  
imports: import pandas
label_desc: Use image node_id 5 for calling a global function with example usage: trending_down(df, period) and returns: pd