code: def _ts_infer_next_row(df: pd.DataFrame, ob: str) -> pd.DataFrame:
      """
      Adds an inferred next row for streaming mode purposes.
  
      :param df: dataframe from which next row is inferred.
      :param ob: `order_by` column.
  
      :return: Modified `df` with the inferred row appended to it.
      """
      original_index = df.index.copy()
      start = original_index.min()
      new_index = pd.date_range(
          start=start,
          periods=len(original_index) + 1,
          freq=df["__mdb_inferred_freq"].iloc[0],
      )
      last_row = df.iloc[[-1]].copy()
      last_row["__mdb_ts_inferred"] = True
  
      if df.shape[0] > 1:
          butlast_row = df.iloc[[-2]]
          delta = (
              last_row[ob].values - butlast_row[ob].values
          ).flatten()[0]
      else:
          delta = 1
  
      last_row[ob] += delta
      new_df = pd.concat([df, last_row], ignore_index=True)
      new_df.index = pd.DatetimeIndex(new_index)
      return new_df
  
file_path: lightwood/lightwood/data/timeseries_transform.py
imports: from typing import Dict, Optional
  from functools import partial
  import multiprocessing
  import numpy
  import pandas
  from lightwood.helpers.parallelism import get_nr_procs
  from type_infer.dtype import dtype
  from lightwood.api.types import TimeseriesSettings, PredictionArguments
  from lightwood.helpers.log import log
label_desc: Use image node_id 2 for calling a global function with example usage: _ts_infer_next_row(df, ob) and returns: new_df