Helper function to create the gene-to-pathway
    membership matrix and apply crosstalk correction on that
    matrix. Returns the crosstalk-corrected pathway definitions
    for the input `genes.`

def _apply_correction_on_genes(genes,
                               pathway_column_names,
                               pathway_definitions):
    """Helper function to create the gene-to-pathway
    membership matrix and apply crosstalk correction on that
    matrix. Returns the crosstalk-corrected pathway definitions
    for the input `genes.`
    """
    gene_row_names = index_element_map(genes)
    membership_matrix = initialize_membership_matrix(
        genes, pathway_definitions)
    crosstalk_corrected_index_map = maximum_impact_estimation(
        membership_matrix)

    updated_pathway_definitions = _update_pathway_definitions(
        crosstalk_corrected_index_map,
        gene_row_names, pathway_column_names)
    return updated_pathway_definitions