code: def truncate_tensor_dict(tensor_dict, truncated_len):
      """Truncate dictionary of list of tensor.
  
      Args:
          tensor_dict (dict[numpy.ndarray]): a dictionary of {tensors or
              dictionary of tensors}.
          truncated_len (int): Length to truncate.
  
      Return:
          dict: a dictionary of {stacked tensors or dictionary of
              stacked tensors}
  
      """
      ret = dict()
      for k, v in tensor_dict.items():
          if isinstance(v, dict):
              ret[k] = truncate_tensor_dict(v, truncated_len)
          else:
              ret[k] = v[:truncated_len]
  
      return ret
  
file_path: garage/src/garage/np/_functions.py
imports: import warnings
  import numpy
  import scipy.signal
label_desc: Use image node_id 13 for calling a global function with example usage: truncate_tensor_dict(tensor_dict, truncated_len) and returns: ret