def METHOD_NAME(self, conn):
    notices = conn.notices or ()
    if notices:
        notices = list(notices)
        if isinstance(notices[0], dict):
            # pg8000
            notices = [d[b'M'] for d in notices]
            conn.notices.clear()
        else:
            del conn.notices[:]
    return notices