code: def random_regions(base, n, size):
      
      spread = size // 2
      base_info = collections.defaultdict(list)
      for space, start, end in base:
          base_info[space].append(start + spread)
          base_info[space].append(end - spread)
      regions = []
      for _ in range(n):
          space = random.choice(base_info.keys())
          pos = random.randint(min(base_info[space]), max(base_info[space]))
          regions.append([space, pos-spread, pos+spread])
      return regions
docs: Generate n random regions of 'size' in the provided base spread.