code: def reconstruction_error(S1, S2, reduction="mean"):
      """Do Procrustes alignment and compute reconstruction error."""
      S1_hat = compute_similarity_transform_batch(S1, S2)
      re = np.sqrt(((S1_hat - S2) ** 2).sum(axis=-1)).mean(axis=-1)
      if reduction == "mean":
          re = re.mean()
      elif reduction == "sum":
          re = re.sum()
      return re
  
imports: import paddle
  from paddle.distributed import ParallelEnv
  import os
  import json
  from collections import defaultdict, OrderedDict
  import numpy
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 4 for calling a global function with example usage: reconstruction_error(S1, S2, reduction) and returns: re