code: def _newsample(nnn, ratio):
      if ratio > len(nnn):
          return random.sample(nnn * (ratio // len(nnn) + 1), ratio)
      else:
          return random.sample(nnn, ratio)
  
imports: import os
  import random
  import logging
  import json
  import numpy
  import re
  from tqdm import tqdm
  from nltk.tokenize import RegexpTokenizer
  from recommenders.datasets.download_utils import maybe_download, download_path, unzip_file
label_desc: Use image node_id 4 for calling a global function with example usage: _newsample(nnn, ratio) and returns: random, random