code: def add_weekday_condition(df: pd.DataFrame):
      """Adds columns for conditional seasonalities to the df.
  
      Parameters
      ----------
          df : pd.DataFrame
              dataframe containing column ``ds``, ``y`` with all data
  
      Returns
      -------
          pd.DataFrame
              dataframe with added columns for conditional seasonalities
      """
      df["ds"] = pd.to_datetime(df["ds"])
      df["weekend"] = (
          df["ds"].apply(lambda x: x.weekday() in [5, 6]).astype(int)
      )
      df["weekday"] = (
          df["ds"]
          .apply(lambda x: x.weekday() in [0, 1, 2, 3, 4])
          .astype(int)
      )
      return df
  
imports: from __future__ import annotations
  import logging
  import math
  from collections import OrderedDict
  from dataclasses import dataclass
  from typing import TYPE_CHECKING, List, Optional, Tuple
  import numpy
  import pandas
label_desc: Use image node_id 37 for calling a global function with example usage: add_weekday_condition(df) and returns: df