code: def _calculate_maximum(df: pd.DataFrame, is_ex: bool = False):
      """
  
      :param df:
      :param is_ex:
      :return:
      """
      if is_ex:
          end_date = df["cum_ex_return_wo_cost_mdd"].idxmin()
          start_date = df.loc[df.index <= end_date][
              "cum_ex_return_wo_cost"
          ].idxmax()
      else:
          end_date = df["return_wo_mdd"].idxmin()
          start_date = df.loc[df.index <= end_date][
              "cum_return_wo_cost"
          ].idxmax()
      return start_date, end_date
  
imports: import pandas
  from ..graph import SubplotsGraph, BaseGraph
label_desc: Use image node_id 1 for calling a global function with example usage: _calculate_maximum(df, is_ex) and returns: start_date,  end_date