code: def _test_shifted(sequence_users, sequences, step_size):
      """
      Unless there was a change of user, row i + 1's interactions
      should contain row i's interactions shifted to the right by
      step size.
      """
  
      for i in range(1, len(sequences)):
          if sequence_users[i] != sequence_users[i - 1]:
              # Change of user
              continue
  
          assert np.all(
              sequences[i][step_size:] == sequences[i - 1][:-step_size]
          )
  
file_path: spotlight/tests/test_interactions.py
imports: import numpy
  import pytest
  from spotlight.cross_validation import random_train_test_split
  from spotlight.datasets import movielens
  from spotlight.interactions import Interactions
label_desc: Use image node_id 3 for calling a global function with example usage: _test_shifted(sequence_users, sequences, step_size) without return types