def _clean_ccx_key(block_location):
 if isinstance(block_location, CCXBlockUsageLocator):
  clean_key = block_location.to_block_locator()
 else:
  clean_key = block_location
 return clean_key.version_agnostic().for_branch(None)

def _clean_ccx_key ( block_location ) : if isinstance ( block_location , CCXBlockUsageLocator ) : clean_key = block_location . to_block_locator ( ) else : clean_key = block_location return clean_key . version_agnostic ( ) . for_branch ( None )
converts the given blockusagekey from a ccx key to the corresponding key for its parent course .