code: def std_statistics(x, mask, dim=-1, eps=1e-6):
      """Standard Scaler
  
      Standardizes features by removing the mean and scaling
      to unit variance along the `dim` dimension.
  
      For example, for `base_windows` models, the scaled features are obtained as (with dim=1):
  
      $$\mathbf{z} = (\mathbf{x}_{[B,T,C]}-\\bar{\mathbf{x}}_{[B,1,C]})/\hat{\sigma}_{[B,1,C]}$$
  
      **Parameters:**<br>
      `x`: torch.Tensor.<br>
      `mask`: torch Tensor bool, same dimension as `x`, indicates where `x` is valid and False
              where `x` should be masked. Mask should not be all False in any column of
              dimension dim to avoid NaNs from zero division.<br>
      `eps` (float, optional): Small value to avoid division by zero. Defaults to 1e-6.<br>
      `dim` (int, optional): Dimension over to compute mean and std. Defaults to -1.<br>
  
      **Returns:**<br>
      `z`: torch.Tensor same shape as `x`, except scaled.
      """
      x_means = masked_mean(x=x, mask=mask, dim=dim)
      x_stds = torch.sqrt(
          masked_mean(x=(x - x_means) ** 2, mask=mask, dim=dim)
      )
  
      # Protect against division by zero
      x_stds[x_stds == 0] = 1.0
      x_stds = x_stds + eps
      return x_means, x_stds
  
imports: import torch
  import torch.nn
label_desc: Use image node_id 9 for calling a global function with example usage: std_statistics(x, mask, dim, eps) and returns: x_means,  x_stds