def METHOD_NAME(spawn_fns, n, name=None, weights=None, as_list=False, verbose=True, **kwargs):
    if not isinstance(spawn_fns, list):
        spawn_fns = [spawn_fns]
    if weights is None:
        weights = np.ones(len(spawn_fns))
    weights /= sum(weights)
    if name is None:
        name = ','.join([repr(f) for f in spawn_fns])
    if verbose:
        logger.info(f'Generating collection of {n} assets from {name}')
    objs = [[] for _ in range(len(spawn_fns))]
    r = trange(n) if verbose else range(n)
    for i in r:
        fn_idx = np.random.choice(np.arange(len(spawn_fns)), p=weights)
        obj = spawn_fns[fn_idx](i=i, **kwargs)
        objs[fn_idx].append(obj)
    for os, f in zip(objs, spawn_fns):
        if hasattr(f, 'finalize_assets'):
            f.finalize_assets(os)
    objs = sum(objs, start=[])    
    if as_list:
        return objs
    else:
        col = butil.group_in_collection(objs, name=f'assets:{name}', reuse=False)
        col.hide_viewport = True
        col.hide_render = True
        return col