code: def _FloatDecoder():
      """Returns a decoder for a float field.
  
      This code works around a bug in struct.unpack for non-finite 32-bit
      floating-point values.
      """
  
      local_unpack = struct.unpack
  
      def InnerDecode(buffer, pos):
          """Decode serialized float to a float and new position.
  
          Args:
            buffer: memoryview of the serialized bytes
            pos: int, position in the memory view to start at.
  
          Returns:
            Tuple[float, int] of the deserialized float value and new position
            in the serialized data.
          """
          # We expect a 32-bit value in little-endian byte order.  Bit 1 is the sign
          # bit, bits 2-9 represent the exponent, and bits 10-32 are the significand.
          new_pos = pos + 4
          float_bytes = buffer[pos:new_pos].tobytes()
  
          # If this value has all its exponent bits set, then it's non-finite.
          # In Python 2.4, struct.unpack will convert it to a finite 64-bit value.
          # To avoid that, we parse it specially.
          if (
              float_bytes[3:4] in b"\x7F\xFF"
              and float_bytes[2:3] >= b"\x80"
          ):
              # If at least one significand bit is set...
              if float_bytes[0:3] != b"\x00\x00\x80":
                  return (_NAN, new_pos)
              # If sign bit is set...
              if float_bytes[3:4] == b"\xFF":
                  return (_NEG_INF, new_pos)
              return (_POS_INF, new_pos)
  
          # Note that we expect someone up-stack to catch struct.error and convert
          # it to _DecodeError -- this way we don't have to set up exception-
          # handling blocks every time we parse one value.
          result = local_unpack("<f", float_bytes)[0]
          return (result, new_pos)
  
      return _SimpleDecoder(wire_format.WIRETYPE_FIXED32, InnerDecode)
  
imports: import struct
  import sys
  import six
  from google.protobuf.internal import containers
  from google.protobuf.internal import encoder
  from google.protobuf.internal import wire_format
  from google.protobuf import message
label_desc: Use image node_id 7 for calling a global function with example usage: _FloatDecoder() and returns: _SimpleDecoder, result,  new_pos, _POS_INF,  new_pos, _NAN,  new_pos, _NEG_INF,  new_pos