def append_result(results, result_hash, item):
    """Append to results, creating an index if needed."""

    if result_hash not in results:
        results[result_hash] = [item]
    else:
        results[result_hash].append(item)

    return results