def METHOD_NAME(ds):
    """
    Take a dataset, which has multiple outputs, and return a list of allocated datasets.
    The allocation data structure looks like:
    .. code-block:: python
        {
            'exchanges': [integer codes for biosphere flows, ...],
            'fraction': out of 100,
            'reference': integer codes
        }
    We assume that the allocation factor for each coproduct is always 100 percent.
    Parameters
    ----------
    ds : dict
        A dataset that has multiple outputs.
    Returns
    -------
    list of dict
        A list of allocated datasets.
    Examples
    --------
    >>> ds = {'name': 'Dataset A', 'exchanges': [{'name': 'Output 1', 'code': 1, 'type': 'production'},
    ...                                          {'name': 'Output 2', 'code': 2},
    ...                                          {'name': 'Output 3', 'code': 3}],
    ...       'allocations': [{'exchanges': [2], 'fraction': 50.0, 'reference': 1},
    ...                        {'exchanges': [3], 'fraction': 50.0, 'reference': 1}]}
    >>> allocate_exchanges(ds)
    [{'name': 'Dataset A', 'exchanges': [{'name': 'Output 1', 'code': 1, 'type': 'production'},
                                         {'name': 'Output 2', 'code': 2, 'type': 'from'},
                                         {'name': 'Output 3', 'code': 3, 'type': 'from'}]},
     {'name': 'Dataset A: Output 2', 'exchanges': [{'name': 'Output 2', 'code': 2, 'type': 'production'}],
      'allocations': [{'exchanges': [2], 'fraction': 100.0, 'reference': 2}]},
     {'name': 'Dataset A: Output 3', 'exchanges': [{'name': 'Output 3', 'code': 3, 'type': 'production'}],
      'allocations': [{'exchanges': [3], 'fraction': 100.0, 'reference': 3}]}]
    """
    new_datasets = []
    coproducts = [exc for exc in ds["exchanges"] if exc["type"] == "production"]
    multipliers = {}
    for obj in ds["allocations"]:
        if not obj["fraction"]:
            continue
        for exc_id in obj["exchanges"]:
            multipliers.setdefault(obj["reference"], {})[exc_id] = obj["fraction"] / 100
    exchange_dict = {
        exc["code"]: exc for exc in ds["exchanges"] if exc["type"] != "production"
    }
    for coproduct in coproducts:
        new_ds = copy.deepcopy(ds)
        new_ds["exchanges"] = [
            rescale_exchange(exchange_dict[exc_id], scale)
            for exc_id, scale in list(multipliers[coproduct["code"]].items())
            # Exclude self-allocation; assume 100%
            if exc_id != coproduct["code"]
        ] + [coproduct]
        new_datasets.append(new_ds)
    return new_datasets