def METHOD_NAME(block):
    """ Recursively scan the course tree for blocks of interest """
    if isinstance(block, block_types):
        blocks_to_include.append(block)
    elif block.has_children:
        for child_id in block.children:
            try:
                METHOD_NAME(block.runtime.get_block(child_id))
            except ItemNotFoundError:
                # Blocks may refer to missing children. Don't break in this case.
                pass