code: def _slice_tensorlist(data, size):
      """Constructs TensorList consisting of ``size`` first elements of ``data``."""
  
      return type(data)(list(data)[:size], layout=data.layout())
  
imports: import sys
  from nvidia.dali import backend
  from nvidia.dali import internal
  from nvidia.dali import ops
  from nvidia.dali import tensors
  from nvidia.dali import types
  from nvidia.dali.external_source import _prep_data_for_feed_input
label_desc: Use image node_id 2 for calling a global function with example usage: _slice_tensorlist(data, size) and returns: type