code: def test_kerple(cfg):
      # non-causal
      PE_nc = KERPLERelativePositionEmbedding(
          bidirectional=True,
          num_attention_heads=cfg["num_attention_heads"],
          layer_type=cfg["layer_type"],
          max_seq_len=cfg["max_seq_len"],
      )
  
      # causal
      PE_c = KERPLERelativePositionEmbedding(
          bidirectional=False,
          num_attention_heads=cfg["num_attention_heads"],
          layer_type=cfg["layer_type"],
          max_seq_len=cfg["max_seq_len"],
      )
  
      q_len = k_len = random.randint(1, cfg["max_seq_len"] * 2)
  
      bias_nc = PE_nc(q_len, k_len)
      assert bias_nc.shape == (
          1,
          cfg["num_attention_heads"],
          q_len,
          k_len,
      )
      assert torch.equal(bias_nc, bias_nc.transpose(2, 3))
  
      bias_c = PE_c(q_len, k_len)
      assert bias_c.shape == (
          1,
          cfg["num_attention_heads"],
          q_len,
          k_len,
      )
      assert torch.all(torch.triu(bias_c, diagonal=0) == 0)
  
file_path: NeMo/tests/collections/nlp/test_position_embedding.py
imports: import random
  import pytest
  import torch
  from nemo.collections.nlp.modules.common.megatron.layer_type import LayerType
  from nemo.collections.nlp.modules.common.megatron.position_embedding import ALiBiRelativePositionEmbedding, KERPLERelativePositionEmbedding, RotaryEmbedding, SandwichRelativePositionEmbedding, T5RelativePositionEmbedding, XPOSPositionEmbedding
  from nemo.collections.nlp.modules.common.megatron.position_embedding.rotary_position_embedding import apply_rotary_pos_emb
  from nemo.collections.nlp.modules.common.megatron.utils import init_method_normal
label_desc: Use image node_id 4 for calling a global function with example usage: test_kerple(cfg) without return types