code: def local_1d_pattern(
      attn_size: int, window_size: int
  ) -> torch.Tensor:
      assert (
          window_size % 2 == 1
      ), "The window size is assumed to be odd (counts self-attention + 2 wings)"
      h_win_size = window_size // 2 + 1
      return local_nd_pattern(attn_size, distance=h_win_size, p=1.0)
  
imports: import math
  from typing import List
  import numpy
  import torch
  from xformers.components.attention.sparsity_config import BigBirdSparsityConfig, BSLongformerSparsityConfig, FixedSparsityConfig, VariableSparsityConfig
label_desc: Use image node_id 9 for calling a global function with example usage: local_1d_pattern(attn_size, window_size) and returns: local_nd_pattern