code: def get_shape_scale(plot_table, ref_group, accessibility_mode=False):
      """
      Calculate the shape scale for the bubbles centers. The reference group bubble center
      is a cross while the others are circles. If accessibility_mode is on and there are
      more colors in the categorical color palette than different non-reference groups , then we
      also use shapes to distinguish between colors in the scale.
      """
  
      num_groups = plot_table["attribute_value"].nunique()
      num_colors = len(Colors.CATEGORICAL_COLOR_PALETTE)
  
      if (num_colors >= num_groups - 1) and accessibility_mode:
          # we find the midpoint in the palette, first half will use the default shape
          # while the second half will use the alternative shape. By the order of the palette,
          # first half should have high constrat between colors, and second half will have
          # some colors that may be similar to the ones in the first half. Therefore, we
          # we change shape to make them more distinguishable in accessibility mode.
          palette_midpoint = math.ceil(num_colors / 2.0)
          shape_range = (
              [Shape.reference]
              + [Shape.default] * palette_midpoint
              + [Shape.alternative] * (num_colors - palette_midpoint)
          )
      else:
          shape_range = [Shape.reference] + [Shape.default] * (
              num_groups - 1
          )
  
      shape_domain = list(plot_table["attribute_value"])
      shape_domain.insert(
          0, shape_domain.pop(shape_domain.index(ref_group))
      )
      shape_scale = alt.Scale(domain=shape_domain, range=shape_range)
      return shape_scale
  
file_path: aequitas/src/aequitas/plot/commons/scales.py
imports: from aequitas.plot.commons.style.classes import Shape, Bubble
  from aequitas.plot.commons.style import color
  import altair
  import math
label_desc: Use image node_id 3 for calling a global function with example usage: get_shape_scale(plot_table, ref_group, accessibility_mode) and returns: shape_scale