<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_receipt_by_index(self, block_number: BlockNumber, receipt_index: int) -> Receipt: """ Returns the Receipt of the transaction at specified index for the block header obtained by the specified block number """

        try:
            block_header = self.get_canonical_block_header_by_number(block_number)
        except HeaderNotFound:
            raise ReceiptNotFound("Block {} is not in the canonical chain".format(block_number))

        receipt_db = HexaryTrie(db=self.db, root_hash=block_header.receipt_root)
        receipt_key = rlp.encode(receipt_index)
        if receipt_key in receipt_db:
            receipt_data = receipt_db[receipt_key]
            return rlp.decode(receipt_data, sedes=Receipt)
        else:
            raise ReceiptNotFound(
                "Receipt with index {} not found in block".format(receipt_index))