code: def test_to_sequence_min_length():
      min_sequence_length = 10
      interactions = movielens.get_movielens_dataset("100K")
  
      # Check that with default arguments there are sequences
      # that are shorter than we want
      sequences = interactions.to_sequence(max_sequence_length=20)
      assert np.any(
          (sequences.sequences != 0).sum(axis=1) < min_sequence_length
      )
  
      # But no such sequences after we specify min length.
      sequences = interactions.to_sequence(
          max_sequence_length=20,
          min_sequence_length=min_sequence_length,
      )
      assert not np.any(
          (sequences.sequences != 0).sum(axis=1) < min_sequence_length
      )
  
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 8 for calling a global function with example usage: test_to_sequence_min_length() without return types