parameters: (self, fifo)
docstring: Reads at most one message from the given fifo.
docstring_summary: Reads at most one message from the given fifo.
docstring_tokens: Reads at most one message from the given fifo .
function: def _read_fifo_message(self, fifo):
          """Reads at most one message from the given fifo."""
          # Read the datagram size.  (The C++ code encodes the datagram_size
          # integer as an ASCII string.)
          datagram_size = None
          buffer = bytearray()
          while not self._done:
              byte = fifo.read(1)
              if not byte:  # EOF
                  return None
              if byte == b'\0':  # EOM
                  datagram_size = int(buffer.decode())
                  break
              else:
                  buffer.extend(byte)
  
          # Read the payload.
          buffer[:] = ()
          while not self._done:
              byte = fifo.read(1)
              if not byte:  # EOF
                  return None
              buffer.extend(byte)
              if len(buffer) == datagram_size:
                  byte = fifo.read(1)
                  assert byte == b'\0'  # EOM
                  return lcmt_call_python.decode(bytes(buffer))
function_tokens: def _read_fifo_message ( self , fifo ) : # Read the datagram size.  (The C++ code encodes the datagram_size # integer as an ASCII string.) datagram_size = None buffer = bytearray ( ) while not self . _done : byte = fifo . read ( 1 ) if not byte : # EOF return None if byte == b'\0' : # EOM datagram_size = int ( buffer . decode ( ) ) break else : buffer . extend ( byte ) # Read the payload. buffer [ : ] = ( ) while not self . _done : byte = fifo . read ( 1 ) if not byte : # EOF return None buffer . extend ( byte ) if len ( buffer ) == datagram_size : byte = fifo . read ( 1 ) assert byte == b'\0' # EOM return lcmt_call_python . decode ( bytes ( buffer ) )