@to_tuple
def _get_blocks_from_fork_chain_by_root(self, start_slot: Slot, peer_head_block: BaseBeaconBlock, slot_of_requested_blocks: Sequence[Slot]) -> Iterable[BaseBeaconBlock]:
    cur_index = (len(slot_of_requested_blocks) - 1)
    block = peer_head_block
    if (block.slot == slot_of_requested_blocks[cur_index]):
        (yield block)
        cur_index -= 1
    while ((block.slot > start_slot) and (cur_index >= 0)):
        try:
            block = self.chain.get_block_by_root(block.parent_root)
        except (BlockNotFound, ValidationError):
            break
        else:
            while (block.slot < slot_of_requested_blocks[cur_index]):
                if (cur_index > 0):
                    cur_index -= 1
                else:
                    break
            if (block.slot == slot_of_requested_blocks[cur_index]):
                (yield block)
@to_tuple
def _get_blocks_from_fork_chain_by_root(self, start_slot: Slot, peer_head_block: BaseBeaconBlock, slot_of_requested_blocks: Sequence[Slot]) -> Iterable[BaseBeaconBlock]:
    cur_index = (len(slot_of_requested_blocks) - 1)
    block = peer_head_block
    if (block.slot == slot_of_requested_blocks[cur_index]):
        (yield block)
        cur_index -= 1
    while ((block.slot > start_slot) and (cur_index >= 0)):
        try:
            block = self.chain.get_block_by_root(block.parent_root)
        except (BlockNotFound, ValidationError):
            break
        else:
            while (block.slot < slot_of_requested_blocks[cur_index]):
                if (cur_index > 0):
                    cur_index -= 1
                else:
                    break
            if (block.slot == slot_of_requested_blocks[cur_index]):
                (yield block)