import torch


def blendowski_collate(lst):
    """ collate function to integrate BlendowskiDataset with PyTorch DataLoader """
    ctrs, qrys, dp_goals, hm_goals = [], [], [], []
    for (ctr, qry), (dp_goal, hm_goal) in lst:
        ctrs.append(ctr)
        qrys.append(qry)
        dp_goals.append(dp_goal)
        hm_goals.append(hm_goal)
    ctrs = torch.stack(ctrs)
    qrys = torch.stack(qrys)
    dp_goals = torch.stack(dp_goals)
    hm_goals = torch.stack(hm_goals)
    return (ctrs, qrys), (dp_goals, hm_goals)