@classmethod<EOL><INDENT>def encode(cls, value):<DEDENT>
try:<EOL><INDENT>if float(value) + <NUM_LIT:0> == value:<EOL><INDENT>return repr(value)<EOL><DEDENT><DEDENT>except (TypeError, ValueError):<EOL><INDENT>pass<EOL><DEDENT>raise InvalidValue('<STR_LIT>')<EOL>
encode a floating point number to bytes in redis

:param value: float
:return: bytes