code: def create_mask_for_prediction_frequency(
      prediction_frequency, ds, forecast_lag
  ):
      """Creates a mask for the yhat array, to select the correct values for the prediction frequency.
      This method is only called in _reshape_raw_predictions_to_forecst_df within NeuralProphet.predict().
  
      Parameters
      ----------
          prediction_frequency : dict
              identical to NeuralProphet
          ds : pd.Series
              datestamps of the predictions
          forecast_lag : int
              current forecast lag
  
      Returns
      -------
          np.array
              mask for the yhat array
      """
      masks = []
      for count, (key, value) in enumerate(
          prediction_frequency.items()
      ):
          if count > 0 and forecast_lag > 1:
              target_time = value + 1
          else:
              target_time = value + forecast_lag
          if key == "daily-hour":
              target_time = target_time % 24
              mask = ds.dt.hour == target_time
          elif key == "weekly-day":
              target_time = target_time % 7
              mask = ds.dt.dayofweek == target_time
          elif key == "monthly-day":
              num_days = ds.dt.daysinmonth
              target_time = target_time % num_days
              mask = (ds.dt.day == target_time).reset_index(drop=True)
          elif key == "yearly-month":
              target_time = (
                  target_time % 12 if target_time > 12 else target_time
              )
              target_time = 1 if target_time == 0 else target_time
              mask = ds.dt.month == target_time
          elif key == "hourly-minute":
              target_time = target_time % 60
              mask = ds.dt.minute == target_time
          else:
              raise ValueError(
                  f"prediction_frequency {key} not supported"
              )
          masks.append(mask)
      mask = np.ones((len(ds),), dtype=bool)
      for m in masks:
          mask = mask & m
      return mask
  
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 38 for calling a global function with example usage: create_mask_for_prediction_frequency(prediction_frequency, ds, forecast_lag) and returns: mask