class_docstr: Apply some functions to the mini-batch
  
  Examples:
      >>> kwargs = {"process": [{"type": "fbank",
      ...                        "n_mels": 80,
      ...                        "fs": 16000},
      ...                       {"type": "cmvn",
      ...                        "stats": "data/train/cmvn.ark",
      ...                        "norm_vars": True},
      ...                       {"type": "delta", "window": 2, "order": 2}]}
      >>> transform = Transformation(kwargs)
      >>> bs = 10
      >>> xs = [np.random.randn(100, 80).astype(np.float32)
      ...       for _ in range(bs)]
      >>> xs = transform(xs)
class_docstr_tok: ["Apply","some","functions","to","the","mini-batch","Examples",":",">",">",">","kwargs","=","{","``","process","''",":","[","{","``","type","''",":","``","fbank","''",",","...","``","n_mels","''",":","80",",","...","``","fs","''",":","16000","}",",","...","{","``","type","''",":","``","cmvn","''",",","...","``","stats","''",":","``","data\/train\/cmvn.ark","''",",","...","``","norm_vars","''",":","True","}",",","...","{","``","type","''",":","``","delta","''",",","``","window","''",":","2",",","``","order","''",":","2","}","]","}",">",">",">","transform","=","Transformation","(","kwargs",")",">",">",">","bs","=","10",">",">",">","xs","=","[","np.random.randn","(","100",",","80",")",".astype","(","np.float32",")","...","for","_","in","range","(","bs",")","]",">",">",">","xs","=","transform","(","xs",")"]
docstr: Return new mini-batch
  
  :param Union[Sequence[np.ndarray], np.ndarray] xs:
  :param Union[Sequence[str], str] uttid_list:
  :return: batch:
  :rtype: List[np.ndarray]
docstr_tok: ["Return","new","mini-batch",":","param","Union","[","Sequence","[","np.ndarray","]",",","np.ndarray","]","xs",":",":","param","Union","[","Sequence","[","str","]",",","str","]","uttid_list",":",":","return",":","batch",":",":","rtype",":","List","[","np.ndarray","]"]
code: def __call__(self, xs, uttid_list=None, **kwargs):
      """Return new mini-batch
  
      :param Union[Sequence[np.ndarray], np.ndarray] xs:
      :param Union[Sequence[str], str] uttid_list:
      :return: batch:
      :rtype: List[np.ndarray]
      """
      if not isinstance(xs, Sequence):
          is_batch = False
          xs = [xs]
      else:
          is_batch = True
  
      if isinstance(uttid_list, str):
          uttid_list = [uttid_list for _ in range(len(xs))]
  
      if self.conf.get("mode", "sequential") == "sequential":
          for idx in range(len(self.conf["process"])):
              func = self.functions[idx]
              # TODO(karita): use TrainingTrans and UttTrans to check __call__ args
              # Derive only the args which the func has
              try:
                  param = signature(func).parameters
              except ValueError:
                  # Some function, e.g. built-in function, are failed
                  param = {}
              _kwargs = {k: v for k, v in kwargs.items() if k in param}
              try:
                  if uttid_list is not None and "uttid" in param:
                      xs = [
                          func(x, u, **_kwargs)
                          for x, u in zip(xs, uttid_list)
                      ]
                  else:
                      xs = [func(x, **_kwargs) for x in xs]
              except Exception:
                  logging.fatal(
                      "Catch a exception from {}th func: {}".format(
                          idx, func
                      )
                  )
                  raise
      else:
          raise NotImplementedError(
              "Not supporting mode={}".format(self.conf["mode"])
          )
  
      if is_batch:
          return xs
      else:
          return xs[0]
  
file_path: espnet/espnet/transform/transformation.py
imports: import copy
  import io
  import logging
  from collections import OrderedDict
  from collections.abc import Sequence
  from inspect import signature
  import yaml
  from espnet.utils.dynamic_import import dynamic_import
label_desc: Use image node_id 3 for calling the Transformation obj's underlying member method code with example usage: obj.__call__(xs, uttid_list) and returns: xs, xs