code: def _flag_jumps_single_col(
      df: pd.DataFrame,
      col: str,
      scale: str,
      direction: str,
      threshold: Union[int, float],
  ) -> pd.Series:
      """
      Creates a boolean column that flags whether or not the change
      between consecutive rows in the provided DataFrame column exceeds a
      provided threshold.
  
      Comparisons are always performed utilizing a GREATER THAN
      threshold check. Thus, flags correspond to values that EXCEED
      the provided threshold.
  
      The method used to create consecutive row comparisons is set by the
      `scale` argument. A `scale=absolute` corresponds to a difference
      method (`.diff()`) and a `scale=percentage` corresponds to a
      percentage change methods (`pct_change()`).
  
      A `direction` argument is used to determine how to handle the sign
      of the difference or percentage change methods.
      A `direction=increasing` will only consider consecutive rows that
      are increasing in value and exceeding the provided threshold.
      A `direction=decreasing` will only consider consecutive rows that
      are decreasing in value and exceeding the provided threshold.
      If `direction=any`, the absolute value is taken for both the
      difference method and the percentage change methods and the sign
      between consecutive rows is ignored.
      """
      check("scale", scale, [str])
      check("direction", direction, [str])
      check("threshold", threshold, [int, float])
  
      scale_types = ["absolute", "percentage"]
      if scale not in scale_types:
          raise JanitorError(
              f"Unrecognized scale: '{scale}'. Must be one of: {scale_types}."
          )
  
      direction_types = ["increasing", "decreasing", "any"]
      if direction not in direction_types:
          raise JanitorError(
              f"Unrecognized direction: '{direction}'. "
              f"Must be one of: {direction_types}."
          )
  
      if threshold < 0:
          raise JanitorError(
              f"Unrecognized threshold: {threshold}. "
              "This value must be >= 0.0. "
              "Use 'direction' to specify positive or negative intent."
          )
  
      single_col = df[col]
      single_col_diffs = single_col.diff()
  
      if scale == "percentage":
          single_col_pcts = single_col.pct_change()
  
          if direction == "increasing":
              # Using diffs ensures correct sign is used for incr/decr
              # (see issue #711)
              out = (single_col_diffs > 0) & (
                  single_col_pcts.abs() > threshold
              )
  
          elif direction == "decreasing":
              # Using diffs ensures correct sign is used for incr/decr
              # (see issue #711)
              out = (single_col_diffs < 0) & (
                  single_col_pcts.abs() > threshold
              )
  
          else:
              out = single_col_pcts.abs() > threshold
  
      else:
          if direction == "increasing":
              out = single_col_diffs > threshold
  
          elif direction == "decreasing":
              out = (single_col_diffs < 0) & (
                  single_col_diffs.abs() > threshold
              )
  
          else:
              out = single_col_diffs.abs() > threshold
  
      out = out.astype(int)
  
      return out
  
file_path: pyjanitor/janitor/timeseries.py
imports: import itertools
  from typing import Dict, Union
  import pandas
  import pandas_flavor
  from .errors import JanitorError
  from .utils import check
label_desc: Use image node_id 4 for calling a global function with example usage: _flag_jumps_single_col(df, col, scale, direction, threshold) and returns: out