code: def test_bslongformer_sparsity_config():
      sc = BSLongformerSparsityConfig(
          num_heads=1, global_block_end_indices=[1]
      )
      assert torch.allclose(
          sc.make_layout(128),
          torch.Tensor(
              [
                  [
                      [1, 1, 1, 1, 1, 1, 1, 1],
                      [1, 1, 1, 0, 0, 0, 0, 0],
                      [1, 1, 1, 1, 0, 0, 0, 0],
                      [1, 0, 1, 1, 1, 0, 0, 0],
                      [1, 0, 0, 1, 1, 1, 0, 0],
                      [1, 0, 0, 0, 1, 1, 1, 0],
                      [1, 0, 0, 0, 0, 1, 1, 1],
                      [1, 0, 0, 0, 0, 0, 1, 1],
                  ]
              ]
          ).long(),
      )
      with pytest.raises(expected_exception=ValueError):
          BSLongformerSparsityConfig(
              num_heads=1, global_block_end_indices=[]
          )
      with pytest.raises(expected_exception=ValueError):
          BSLongformerSparsityConfig(
              num_heads=1, global_block_end_indices=[-1]
          )
  
imports: import itertools
  import pytest
  import torch
  import xformers.components.attention.attention_patterns
  from xformers.components.attention.sparsity_config import BigBirdSparsityConfig, BSLongformerSparsityConfig, DenseSparsityConfig, FixedSparsityConfig, VariableSparsityConfig
label_desc: Use image node_id 20 for calling a global function with example usage: test_bslongformer_sparsity_config() without return types