Merge two raw datasets into one.

    Parameters
    ----------
    d1 : dict
    d2 : dict

    Returns
    -------
    dict

def merge(d1, d2):
    """Merge two raw datasets into one.

    Parameters
    ----------
    d1 : dict
    d2 : dict

    Returns
    -------
    dict
    """
    if d1['formula_id2latex'] is None:
        formula_id2latex = {}
    else:
        formula_id2latex = d1['formula_id2latex'].copy()
    formula_id2latex.update(d2['formula_id2latex'])
    handwriting_datasets = d1['handwriting_datasets']
    for dataset in d2['handwriting_datasets']:
        handwriting_datasets.append(dataset)
    return {'formula_id2latex': formula_id2latex,
            'handwriting_datasets': handwriting_datasets}