class_docstr: Marginal transformation that transforms the target via an empirical CDF to
  a standard gaussian as described here: https://arxiv.org/abs/1910.03002.
  
  To be used in conjunction with a multivariate gaussian to from a copula.
  Note that this transformation is currently intended for multivariate
  targets only.
class_docstr_tok: ["Marginal","transformation","that","transforms","the","target","via","an","empirical","CDF","to","a","standard","gaussian","as","described","here",":","https",":","\/\/arxiv.org\/abs\/1910.03002",".","To","be","used","in","conjunction","with","a","multivariate","gaussian","to","from","a","copula",".","Note","that","this","transformation","is","currently","intended","for","multivariate","targets","only","."]
docstr: Makes sure target has at least expected_length time-units by repeating
  it or using zeros.
  
  Parameters
  ----------
  target : shape (seq_len, dim)
  expected_length
  
  Returns
  -------
      array of shape (target_length, dim)
docstr_tok: ["Makes","sure","target","has","at","least","expected_length","time-units","by","repeating","it","or","using","zeros",".","Parameters","--","--","--","--","--","target",":","shape","(","seq_len",",","dim",")","expected_length","Returns","--","--","--","-","array","of","shape","(","target_length",",","dim",")"]
code: def _fill(target: np.ndarray, expected_length: int) -> np.ndarray:
      """
      Makes sure target has at least expected_length time-units by repeating
      it or using zeros.
  
      Parameters
      ----------
      target : shape (seq_len, dim)
      expected_length
  
      Returns
      -------
          array of shape (target_length, dim)
      """
  
      current_length, target_dim = target.shape
      if current_length == 0:
          # todo handle the case with no observation better,
          # we could use dataset statistics but for now we use zeros
          filled_target = np.zeros((expected_length, target_dim))
      elif current_length < expected_length:
          filled_target = np.vstack(
              [
                  target
                  for _ in range(expected_length // current_length + 1)
              ]
          )
          filled_target = filled_target[:expected_length]
      elif current_length > expected_length:
          filled_target = target[-expected_length:]
      else:
          filled_target = target
  
      assert filled_target.shape == (expected_length, target_dim)
  
      return filled_target
  
imports: from typing import Callable, Iterator, List, Optional, Tuple, Type
  import numpy
  from toolz import valmap
  from gluonts.core.component import validated, tensor_to_numpy
  from gluonts.dataset.common import DataEntry
  from gluonts.exceptions import assert_data_error
  from ._base import FlatMapTransformation, MapTransformation, SimpleTransformation
label_desc: Use image node_id 12 for calling the CDFtoGaussianTransform obj's underlying member method code with example usage: obj._fill(target, expected_length) and returns: filled_target