code: def remove_padding(x, padding_idx=0):
      if x is None:
          return None
      assert len(x.shape) in [1, 2]
      if len(x.shape) == 2:  # [T, H]
          return x[np.abs(x).sum(-1) != padding_idx]
      elif len(x.shape) == 1:  # [T]
          return x[x != padding_idx]
  
file_path: PaddleHub/modules/audio/svs/diffsinger/utils/__init__.py
imports: import sys
  import time
  import types
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: remove_padding(x, padding_idx) and returns: None, x, x