code: def std_scale(expr, columns=None, with_means=True, with_std=True, preserve=False, suffix='_scaled', group=None):
      
      time_suffix = str(int(time.time()))
  
      def calc_agg(expr, col):
          return [
              getattr(expr, col).mean().rename(col + '_mean_' + time_suffix),
              getattr(expr, col).std(ddof=0).rename(col + '_std_' + time_suffix),
          ]
  
      def do_scale(expr, col):
          c = getattr(expr, col)
          mean_expr = getattr(expr, col + '_mean_' + time_suffix)
          if with_means:
              c = c - mean_expr
              mean_expr = Scalar(0)
          if with_std:
              std_expr = getattr(expr, col + '_std_' + time_suffix)
              c = (std_expr == 0).ifelse(mean_expr, c / getattr(expr, col + '_std_' + time_suffix))
          return c
  
      return _scale_values(expr, columns, calc_agg, do_scale, preserve=preserve, suffix=suffix, group=group)
docs: Resize a data frame by mean and standard error.
  
      :param DataFrame expr: Input DataFrame
      :param bool with_means: Determine whether the output will be subtracted by means
      :param bool with_std: Determine whether the output will be divided by standard deviations
      :param bool preserve: Determine whether input data should be kept. If True, scaled input data will be appended to the data frame with `suffix`
      :param columns: Columns names to resize. If set to None, float or int-typed columns will be normalized if the column is not specified as a group column.
      :param group: determine scale groups. Scaling will be done in each group separately.
      :param str suffix: column suffix to be appended to the scaled columns.
  
      :return: resized data frame
      :rtype: DataFrame