code: def load_and_cache_clone_data(
      args, filename, pool, tokenizer, split_tag, is_sample=False
  ):
      cache_fn = "{}/{}.pt".format(
          args.cache_path,
          split_tag + "_all"
          if args.data_num == -1
          else "_%d" % args.data_num,
      )
      examples = read_examples(filename, args.data_num, args.task)
      if is_sample:
          examples = random.sample(examples, int(len(examples) * 0.1))
  
      calc_stats(examples, tokenizer, is_tokenize=True)
      if os.path.exists(cache_fn):
          logger.info("Load cache data from %s", cache_fn)
          data = torch.load(cache_fn)
      else:
          if is_sample:
              logger.info("Sample 10 percent of data from %s", filename)
          elif args.data_num == -1:
              logger.info("Create cache data into %s", cache_fn)
          tuple_examples = [
              (example, idx, tokenizer, args)
              for idx, example in enumerate(examples)
          ]
          features = pool.map(
              convert_clone_examples_to_features,
              tqdm(tuple_examples, total=len(tuple_examples)),
          )
          all_source_ids = torch.tensor(
              [f.source_ids for f in features], dtype=torch.long
          )
          all_labels = torch.tensor(
              [f.label for f in features], dtype=torch.long
          )
          data = TensorDataset(all_source_ids, all_labels)
  
          if args.local_rank in [-1, 0] and args.data_num == -1:
              torch.save(data, cache_fn)
      return examples, data
  
file_path: codet5/CodeT5/utils.py
imports: from torch.utils.data import TensorDataset
  import numpy
  import logging
  import os
  import random
  import torch
  import time
  from tqdm import tqdm
  from _utils import *
label_desc: Use image node_id 2 for calling a global function with example usage: load_and_cache_clone_data(args, filename, pool, tokenizer, split_tag, is_sample) and returns: examples,  data