def _create_name_mapping(all_nodes):
    """ helper function to creates the name of the nodes within a GraphPipeline model
    - if no ambiguities, name of node will be name of model
    - otherwise, name of node will be '%s_%s' % (name_of_step,name_of_model)
    
    
    Parameters
    ----------
    all_nodes : list of 2-uple
        nodes of graph : (step_name, model_name)
        
    Returns
    -------
    dictionnary with key = node, and value : string corresponding to the node
    """

    count_by_model_name = dict()
    mapping = {}
    done = set()
    for step_name, model_name in all_nodes:
        if (step_name, model_name) in done:
            raise ValueError("I have a duplicate node %s" % str((step_name, model_name)))
        done.add((step_name, model_name))

        count_by_model_name[model_name[1]] = count_by_model_name.get(model_name[1], 0) + 1

    for step_name, model_name in all_nodes:
        if count_by_model_name[model_name[1]] > 1:
            mapping[(step_name, model_name)] = "%s_%s" % (model_name[0], model_name[1])
        else:
            mapping[(step_name, model_name)] = model_name[1]

    count_by_name = dict()
    for k, v in mapping.items():
        count_by_name[k] = count_by_model_name.get(k, 0) + 1
    for k, v in count_by_name.items():
        if v > 1:
            raise ValueError("I have duplicate name for node %s" % str(k))

    return mapping