def assign_shapes(data, aes):
    legend_entry = dict()
    if 'shape' in aes:
        shape_col = aes['shape']
        shape = shape_gen()
        labels, scale_type, indices = get_labels(data, shape_col, "discrete")
        # marker in matplotlib are not unicode ready in 1.3.1 :-( -> use explicit str()...
        shape_mapping = dict((value, str(six.next(shape))) for value in labels)
        data[':::shape_mapping:::'] = data[shape_col].apply(
            lambda x: shape_mapping[x])

        legend_entry = {'column_name': shape_col,
                  'dict': dict((v, k) for k, v in shape_mapping.items()),
                  'scale_type': "discrete"}
    return data, legend_entry
Assigns shapes to the given data based on the aes and adds the right legend
dataset/ETHPy150Open yhat/ggplot/ggplot/components/shapes.py/assign_shapes