code: def position_encoding_init(self, n_position, d_pos_vec):
      position_enc = np.array(
          [
              [
                  pos / np.power(10000, 2 * (j // 2) / d_pos_vec)
                  for j in range(d_pos_vec)
              ]
              if pos != 0
              else np.zeros(d_pos_vec)
              for pos in range(n_position)
          ]
      )
  
      position_enc[1:, 0::2] = np.sin(position_enc[1:, 0::2])  # dim 2i
      position_enc[1:, 1::2] = np.cos(
          position_enc[1:, 1::2]
      )  # dim 2i+1
      return position_enc
  
imports: import logging
  import json
  import numpy
  from collections import OrderedDict
  from .None import ontology
label_desc: Use image node_id 7 for calling a global function with example usage: position_encoding_init(n_position, d_pos_vec) and returns: position_enc