tmp = list(itertools.chain(*[[(d, x[1]) for d in x[0]] for x in nn_data]))