<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def decode_length(self, data, state):
 """ Extract and decode a frame length from the data buffer. The consumed data should be removed from the buffer. If the length data is incomplete, must raise a ``NoFrames`` exception. :param data: A ``bytearray`` instance containing the data so far read. :param state: An instance of ``FramerState``. If the buffer contains a partial encoded length, this object can be used to store state information to allow the remainder of the length to be read. :returns: The frame length, as an integer. """


        # Do we have enough data yet?
        if len(data) < self.fmt.size:
            raise exc.NoFrames()

        # Extract the length
        length = self.fmt.unpack(six.binary_type(data[:self.fmt.size]))[0]
        del data[:self.fmt.size]

        # Return the length
        return length