code: def handle_negative_values(df, col, handle_negatives):
      """
      Handles negative values in a column according to the handle_negatives parameter.
  
      Parameters
      ----------
          df : pd.DataFrame
              dataframe containing column ``ds``, ``y`` with all data
          col : str
              name of the regressor column
          handle_negatives : str, int, float
              specified handling of negative values in the regressor column. Can be one of the following options:
  
              Options
                      * ``remove``: Remove all negative values of the regressor.
                      * ``error``: Raise an error in case of a negative value.
                      * ``float`` or ``int``: Replace negative values with the provided value.
                      * (default) ``None``: Do not handle negative values.
  
      Returns
      -------
          pd.DataFrame
              dataframe with handled negative values
      """
      # check how to handle negative values
      if handle_negatives == "error":
          if (df[col] < 0).any():
              raise ValueError(
                  f"The regressor {col} contains negative values. Please preprocess data manually."
              )
      elif handle_negatives == "remove":
          log.info(
              f"Removing {df[col].count() - (df[col] >= 0).sum()} negative value(s) from regressor {col} due to \
                  handle_negatives='remove'"
          )
          df = df[df[col] >= 0]
      elif type(handle_negatives) in [int, float]:
          df.loc[df[col] < 0, col] = handle_negatives
      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 33 for calling a global function with example usage: handle_negative_values(df, col, handle_negatives) and returns: df