def render(self, content: Any, _reentered=False) -> bytes:
    try:
        with record_timing(self.__metrics, 'pack'):
            return msgpack.packb(content, default=_numpy_safe_msgpack_encoder, datetime=True)
    except TypeError as err:
        if ((err.args == ("can not serialize 'datetime.datetime' object",)) and (not _reentered)):
            patched_content = _patch_naive_datetimes(content)
            return self.render(patched_content, _reentered=True)
        raise
def render(self, content: Any, _reentered=False) -> bytes:
    try:
        with record_timing(self.__metrics, 'pack'):
            return msgpack.packb(content, default=_numpy_safe_msgpack_encoder, datetime=True)
    except TypeError as err:
        if ((err.args == ("can not serialize 'datetime.datetime' object",)) and (not _reentered)):
            patched_content = _patch_naive_datetimes(content)
            return self.render(patched_content, _reentered=True)
        raise