code: def test_pos_embedding(
      is_learnable: bool,
      input_seq_len: int,
      sequence_first: bool,
      padding_idx: int,
  ):
      num_embeddings = 128
      pos_embedding = PositionalEmbedding(
          opts=None,
          num_embeddings=num_embeddings,
          embedding_dim=512,
          padding_idx=padding_idx,
          is_learnable=is_learnable,
          sequence_first=sequence_first,
      )
      seq_dim = 0 if sequence_first else 1
  
      out = pos_embedding(input_seq_len)
      np.testing.assert_equal(out.shape[seq_dim], input_seq_len)
  
imports: import sys
  import numpy
  import pytest
  from cvnets.layers.positional_embedding import PositionalEmbedding
label_desc: Use image node_id 1 for calling a global function with example usage: test_pos_embedding(is_learnable, input_seq_len, sequence_first, padding_idx) without return types