<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def random_regions(base, n, size):
 """Generate n random regions of 'size' in the provided base spread. """

    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