class_docstr: Base Windows
  
  Base class for all windows-based models. The forecasts are produced separately
  for each window, which are randomly sampled during training.
  
  This class implements the basic functionality for all windows-based models, including:
  - PyTorch Lightning's methods training_step, validation_step, predict_step.<br>
  - fit and predict methods used by NeuralForecast.core class.<br>
  - sampling and wrangling methods to generate windows.
class_docstr_tok: ["Base","Windows","Base","class","for","all","windows-based","models",".","The","forecasts","are","produced","separately","for","each","window",",","which","are","randomly","sampled","during","training",".","This","class","implements","the","basic","functionality","for","all","windows-based","models",",","including",":","-","PyTorch","Lightning","'s","methods","training_step",",","validation_step",",","predict_step.","<","br",">","-","fit","and","predict","methods","used","by","NeuralForecast.core","class.","<","br",">","-","sampling","and","wrangling","methods","to","generate","windows","."]
code: def _normalization(self, windows, y_idx):
      # windows are already filtered by train/validation/test
      # from the `create_windows_method` nor leakage risk
      temporal = windows["temporal"]  # B, L+H, C
      temporal_cols = windows["temporal_cols"].copy()  # B, L+H, C
  
      # To avoid leakage uses only the lags
      # temporal_data_cols = temporal_cols.drop('available_mask').tolist()
      temporal_data_cols = self._get_temporal_exogenous_cols(
          temporal_cols=temporal_cols
      )
      temporal_idxs = get_indexer_raise_missing(
          temporal_cols, temporal_data_cols
      )
      temporal_idxs = np.append(y_idx, temporal_idxs)
      temporal_data = temporal[:, :, temporal_idxs]
      temporal_mask = temporal[
          :, :, temporal_cols.get_loc("available_mask")
      ].clone()
      if self.h > 0:
          temporal_mask[:, -self.h :] = 0.0
  
      # Normalize. self.scaler stores the shift and scale for inverse transform
      temporal_mask = temporal_mask.unsqueeze(
          -1
      )  # Add channel dimension for scaler.transform.
      temporal_data = self.scaler.transform(
          x=temporal_data, mask=temporal_mask
      )
  
      # Replace values in windows dict
      temporal[:, :, temporal_idxs] = temporal_data
      windows["temporal"] = temporal
  
      return windows
  
imports: import random
  import warnings
  import numpy
  import torch
  import torch.nn
  import pytorch_lightning
  from pytorch_lightning.callbacks import TQDMProgressBar
  from pytorch_lightning.callbacks.early_stopping import EarlyStopping
  from ._scalers import TemporalNorm
  from ..tsdataset import TimeSeriesDataModule
  from ..utils import get_indexer_raise_missing
label_desc: Use image node_id 7 for calling the BaseWindows obj's underlying member method code with example usage: obj._normalization(windows, y_idx) and returns: windows