code: def renormalize_per_sample(
      data_feature,
      data_attribute,
      data_feature_outputs,
      data_attribute_outputs,
      gen_flags,
      num_real_attribute,
  ):
      attr_dim = 0
      for i in range(num_real_attribute):
          attr_dim += data_attribute_outputs[i].dim
      attr_dim_cp = attr_dim
  
      fea_dim = 0
      for output in data_feature_outputs:
          if output.type_ == OutputType.CONTINUOUS:
              for _ in range(output.dim):
                  max_plus_min_d_2 = data_attribute[:, attr_dim]
                  max_minus_min_d_2 = data_attribute[:, attr_dim + 1]
                  attr_dim += 2
  
                  max_ = max_plus_min_d_2 + max_minus_min_d_2
                  min_ = max_plus_min_d_2 - max_minus_min_d_2
  
                  max_ = np.expand_dims(max_, axis=1)
                  min_ = np.expand_dims(min_, axis=1)
  
                  if output.normalization == Normalization.MINUSONE_ONE:
                      data_feature[:, :, fea_dim] = (
                          data_feature[:, :, fea_dim] + 1.0
                      ) / 2.0
  
                  data_feature[:, :, fea_dim] = (
                      data_feature[:, :, fea_dim] * (max_ - min_) + min_
                  )
  
                  fea_dim += 1
          else:
              fea_dim += output.dim
  
      tmp_gen_flags = np.expand_dims(gen_flags, axis=2)
      data_feature = data_feature * tmp_gen_flags
  
      data_attribute = data_attribute[:, 0:attr_dim_cp]
  
      return data_feature, data_attribute
  
file_path: analytics-zoo/pyzoo/zoo/chronos/simulator/doppelganger/util.py
imports: from .output import OutputType, Output, Normalization
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: renormalize_per_sample(data_feature, data_attribute, data_feature_outputs, data_attribute_outputs, gen_flags, num_real_attribute) and returns: data_feature,  data_attribute