code: def random_perturbations(set_path: str, percent: int):
      for root, _dirnames, filenames in os.walk(set_path):
          for filename in filenames:
              if "jsonl" in filename:
                  set_name = root.split("/")[-1]
                  out_file_name = f"{percent}%_{filename}.jsonl"
                  neg_samples = list(
                      read_negative_file(
                          root,
                          filename,
                      )
                  )
                  indices_to_dupe = random_indices(
                      len(neg_samples), percentage=percent
                  )
                  restore_and_write(
                      samples=neg_samples,
                      indices=indices_to_dupe,
                      directory=os.path.join(opt["out_dir"], set_name),
                      output_file=out_file_name,
                  )
  
file_path: ParlAI/projects/roscoe/roscoe_data/restore_data.py
imports: import copy
  import json
  import os
  import random
  from typing import Any, Dict, Iterable, List, Set
  from parlai.core.params import ParlaiParser
label_desc: Use image node_id 7 for calling a global function with example usage: random_perturbations(set_path, percent) without return types