code: def one_matrix(path, pkl_path=None):
      # ast generation
      programfile = open(path, encoding="utf-8")
      # print(os.path.join(rt,file))
      programtext = programfile.read()
      # programtext=programtext.replace('\r','')
      programtokens = javalang.tokenizer.tokenize(programtext)
      parser = javalang.parse.Parser(programtokens)
      tree = parser.parse_member_declaration()
      programfile.close()
  
      file = open(path, "r", encoding="utf-8")
      tokens = list(javalang.tokenizer.tokenize(file.read()))
      # print("programtokens", list(tokens))
      file.close()
  
      # create tree
      nodelist = []
      newtree = AnyNode(id=0, token=None, data=None)
      createtree(newtree, tree, nodelist)
  
      if pkl_path != None:
          out_pkl = (
              pkl_path + path.split("/")[-1].split(".java")[0] + ".pkl"
          )
          WriteAndRead.write_pkl(out_pkl, newtree)
  
      # token type dictionary
      typedict = {}
      for token in tokens:
          token_type = str(type(token))[:-2].split(".")[-1]
          token_value = token.value
          if token_value not in typedict:
              typedict[token_value] = token_type
          else:
              if typedict[token_value] != token_type:
                  print("!!!!!!!!")
  
      # matrix initialization
      matrix = [[0 for col in range(72)] for row in range(57)]
  
      # Traverse the tree to get edge information
      src = []
      tgt = []
      getnodeandedge(newtree, src, tgt)
  
      # print(len(src))
  
      # fill matrix
      for i in range(len(src)):
          m = nodetypedict[src[i]]
          name = tgt[i]
          try:
              n = nodetypedict[name]
          except KeyError:
              try:
                  n = tokendict[typedict[name]]
              except KeyError:
                  n = 62
          matrix[m][n] += 1
  
      for k in range(57):
          total = 0
          for l in range(72):
              total += matrix[k][l]
          if total != 0:
              for p in range(72):
                  matrix[k][p] = matrix[k][p] / total
  
      matrix = np.array(matrix)
      filename = path.split("/")[-1].split(".java")[0]
      print(filename)
      npypath = "./npy/" + filename
      np.save(npypath, matrix)
      return matrix
  
file_path: amain/get_matrix.py
imports: import numpy
  import javalang
  from javalang.ast import Node
  from anytree import AnyNode
  import time
  import os
  from multiprocessing import Pool
  from functools import partial
label_desc: Use image node_id 7 for calling a global function with example usage: one_matrix(path, pkl_path) and returns: matrix