def METHOD_NAME(self, data):
    if callable(data):
        stype, strategy = "Code", self.strategy_code
    else:
        stype, strategy = "Data", self.strategy_data
    try:
        return strategy.METHOD_NAME(data)
    except Exception as e:
        err_msg = f"{stype} serialization strategy {type(strategy).__name__} failed"
        raise SerializationError(err_msg) from e