code: def hcl(config, hcl_buffer, graph_holders, empty_flag):
      """Hierarchical Contrastive Learning"""
      if config.sage_layer_type == "TransformerConv":
          # bcl_buffer [ init_feature, (q, k, v, ori_x)]
          # TransformerConv HCL take the output after Linear
          log.info("using TransformerConv HCL")
          feature = (
              hcl_buffer[1][2].reshape([-1, config.emb_size])[1:]
              * empty_flag
          )
      else:
          # bcl_buffer [ init_feature, layer1 inputs]
          feature = hcl_buffer[0][1:]
  
      hcl_logits = []
      for idx, sample in enumerate(config.samples):
          graph_holder = graph_holders[idx]
          edges_src = graph_holder[2]
          edges_dst = graph_holder[3]
          neighbor_src_feat = paddle.gather(feature, edges_src)
          neighbor_src_feat = neighbor_src_feat.reshape(
              [-1, 1, config.emb_size]
          )
          neighbor_dst_feat = paddle.gather(feature, edges_dst)
          neighbor_dst_feat = neighbor_dst_feat.reshape(
              [-1, 1, config.emb_size]
          )
          neighbor_dsts_feat_all = [neighbor_dst_feat]
  
          for neg in range(config.neg_num):
              neighbor_dsts_feat_all.append(
                  F.contrib.layers.shuffle_batch(
                      neighbor_dsts_feat_all[0]
                  )
              )
          neighbor_dsts_feat = paddle.concat(
              neighbor_dsts_feat_all, axis=1
          )
  
          # [batch_size, 1, neg_num+1]
          logits = paddle.matmul(
              neighbor_src_feat, neighbor_dsts_feat, transpose_y=True
          )
          logits = paddle.squeeze(logits, axis=[1])
          hcl_logits.append(logits)
  
      return hcl_logits
  
imports: import os
  import sys
  import math
  import time
  import numpy
  import pickle
  import paddle
  import paddle.fluid
  import paddle.fluid.layers
  import paddle.static
  from paddle.common_ops_import import LayerHelper, check_type, check_variable_and_dtype
  from paddle.fluid.framework import Variable
  import pgl
  from pgl.utils.logger import log
label_desc: Use image node_id 14 for calling a global function with example usage: hcl(config, hcl_buffer, graph_holders, empty_flag) and returns: hcl_logits