def METHOD_NAME(self, name, data):
    data["name"] = name
    for k in list(data):
        # Drop bytes objects for now
        if isinstance(data[k], bytes):
            del data[k]
    self.write_message(data)