<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _merge_data(dat1, dat2):
 """ Merge two data dictionaries containing catalogue data :parameter dictionary dat1: Catalogue data dictionary :parameter dictionary dat2: Catalogue data dictionary :returns: A catalogue data dictionary containing the information originally included in dat1 and dat2 """


    cnt = 0
    for key in dat1:
        flg1 = len(dat1[key]) > 0
        flg2 = len(dat2[key]) > 0
        if flg1 != flg2:
            cnt += 1

    if cnt:
        raise Warning('Cannot merge catalogues with different' +
                      ' attributes')
        return None
    else:
        for key in dat1:
            if isinstance(dat1[key], np.ndarray):
                dat1[key] = np.concatenate((dat1[key], dat2[key]), axis=0)
            elif isinstance(dat1[key], list):
                dat1[key] += dat2[key]
            else:
                raise ValueError('Unknown type')
        return dat1