<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_by_claim(self, claim):
 """ Returns a list of all the messages from this queue that have been claimed by the specified claim. The claim can be either a claim ID or a QueueClaim object. """

        if not isinstance(claim, QueueClaim):
            claim = self._claim_manager.get(claim)
        return claim.messages