code: def test_to_sequence(max_sequence_length, step_size):
      interactions = movielens.get_movielens_dataset("100K")
      _, interactions = random_train_test_split(interactions)
  
      sequences = interactions.to_sequence(
          max_sequence_length=max_sequence_length, step_size=step_size
      )
  
      if step_size == 1:
          assert sequences.sequences.shape == (
              len(interactions),
              max_sequence_length,
          )
      else:
          assert sequences.sequences.shape[1] == max_sequence_length
  
      _test_just_padding(sequences.sequences)
      _test_final_column_no_padding(sequences.sequences)
      _test_shifted(sequences.user_ids, sequences.sequences, step_size)
      _test_temporal_order(
          sequences.user_ids, sequences.sequences, interactions
      )
  
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 7 for calling a global function with example usage: test_to_sequence(max_sequence_length, step_size) without return types