code: def _data_processing(input_file):
      logger.info("start data processing...")
      dirs, _ = os.path.split(input_file)
      output_file = os.path.join(dirs, "preprocessed_output")
  
      f_input = open(input_file, "r")
      f_output = open(output_file, "w")
      user_count = {}
      for line in f_input:
          line = line.strip()
          user = line.split("\t")[1]
          if user not in user_count:
              user_count[user] = 0
          user_count[user] += 1
      f_input.seek(0)
      i = 0
      last_user = None
      for line in f_input:
          line = line.strip()
          user = line.split("\t")[1]
          if user == last_user:
              if i < user_count[user] - 2:
                  f_output.write("train" + "\t" + line + "\n")
              elif i < user_count[user] - 1:
                  f_output.write("valid" + "\t" + line + "\n")
              else:
                  f_output.write("test" + "\t" + line + "\n")
          else:
              last_user = user
              i = 0
              if i < user_count[user] - 2:
                  f_output.write("train" + "\t" + line + "\n")
              elif i < user_count[user] - 1:
                  f_output.write("valid" + "\t" + line + "\n")
              else:
                  f_output.write("test" + "\t" + line + "\n")
          i += 1
      return output_file
  
imports: import os
  import shutil
  import pandas
  import gzip
  import random
  import logging
  import _pickle
  from recommenders.utils.constants import SEED
  from recommenders.datasets.download_utils import maybe_download
label_desc: Use image node_id 12 for calling a global function with example usage: _data_processing(input_file) and returns: output_file