code: def test_lagged_sequence_values(
      lag_indices: List[int],
      prior_sequence: torch.Tensor,
      sequence: torch.Tensor,
      output_shape: tuple,
  ):
      res = lagged_sequence_values(
          lag_indices, prior_sequence, sequence, dim=1
      )
      assert res.shape == output_shape
      full_sequence = torch.cat((prior_sequence, sequence), dim=1)
      for t in range(res.shape[1]):
          expected_lags_t = torch.stack(
              [
                  full_sequence[:, t + prior_sequence.shape[1] - l]
                  for l in lag_indices
              ],
              dim=-1,
          )
          assert expected_lags_t.shape == res[:, t, :].shape
          assert torch.allclose(expected_lags_t, res[:, t, :])
  
imports: from typing import List
  import pytest
  import torch
  from gluonts.torch.util import lagged_sequence_values, unsqueeze_expand
label_desc: Use image node_id 1 for calling a global function with example usage: test_lagged_sequence_values(lag_indices, prior_sequence, sequence, output_shape) without return types