code: def scale_data(original_file, new_file, scale_rate):
      """Scale data file."""
      logging.info(
          "Scale file from {} to {}".format(original_file, new_file)
      )
  
      with open(original_file, encoding="utf-8") as original_f, open(
          new_file, "w", encoding="utf-8"
      ) as new_f:
          original_lines = original_f.readlines()
          original_size = len(original_lines)
          new_size = int(original_size * scale_rate)
  
          for i, line in enumerate(data_generator(original_lines)):
              if i >= new_size:
                  break
              new_f.write(line)
  
file_path: delta/delta/data/datasets/utils.py
imports: import os
  import pickle
  import numpy
  from pathlib import Path
  import tempfile
  from absl import logging
  from sklearn.model_selection import train_test_split
label_desc: Use image node_id 2 for calling a global function with example usage: scale_data(original_file, new_file, scale_rate) without return types