code: def prepare_data_config(args):
      """Adjust configuration for data processing."""
      batch_size = args.batch_size
      neg_sample_size = args.neg_sample_size
      neg_sample_type = args.neg_sample_type
      if neg_sample_type == "chunk" and neg_sample_size < batch_size:
          if batch_size % neg_sample_size != 0:
              batch_size = int(
                  math.ceil(batch_size / neg_sample_size)
                  * neg_sample_size
              )
              print(
                  'For "chunk" negative sampling, batch size should '
                  "be divisible by negative sample size {}. Thus, "
                  "batch_size {} is reset as {}".format(
                      neg_sample_size, args.batch_size, batch_size
                  )
              )
              args.batch_size = batch_size
  
      if neg_sample_type == "chunk":
          args.num_chunks = max(
              args.batch_size // args.neg_sample_size, 1
          )
      else:
          args.num_chunks = args.batch_size
  
      return args
  
file_path: PGL/apps/Graph4KG/config.py
imports: import os
  import sys
  import math
  import json
  import warnings
  from argparse import ArgumentParser
  import paddle.distributed
label_desc: Use image node_id 3 for calling a global function with example usage: prepare_data_config(args) and returns: args