def METHOD_NAME(message, header):
    if header.Command == MQCMD_STATISTICS_CHANNEL:
        stats = ChannelStats(message)
    elif header.Command == MQCMD_STATISTICS_Q:
        stats = QueueStats(message)
    else:
        stats = BaseStats(message)
    return stats