def collect_merged_boolean_field(block_structure, transformer, xblock_field_name, merged_field_name):
 for block_key in block_structure.topological_traversal():
  parents = block_structure.get_parents(block_key)
  all_parents_merged_value = (all((block_structure.get_transformer_block_field(parent_key, transformer, merged_field_name, False) for parent_key in parents)) if parents else False)
  block_structure.set_transformer_block_field(block_key, transformer, merged_field_name, (all_parents_merged_value or get_field_on_block(block_structure.get_xblock(block_key), xblock_field_name, False)))

def collect_merged_boolean_field ( block_structure , transformer , xblock_field_name , merged_field_name ) : for block_key in block_structure . topological_traversal ( ) : parents = block_structure . get_parents ( block_key ) all_parents_merged_value = ( all ( ( block_structure . get_transformer_block_field ( parent_key , transformer , merged_field_name , False ) for parent_key in parents ) ) if parents else False ) block_structure . set_transformer_block_field ( block_key , transformer , merged_field_name , ( all_parents_merged_value or get_field_on_block ( block_structure . get_xblock ( block_key ) , xblock_field_name , False ) ) )
collects a boolean xblock field of name xblock_field_name for the given block_structure and transformer .