parameters: (arr, unit_size=None)
return_statement: return np.array(points_arr)
docstring: Given an array of Box() objects, return a 2D distribution with shape (n_cells, 2)
docstring_summary: Given an array of Box() objects, return a 2D distribution with shape (n_cells, 2)
docstring_tokens: Given an array of Box () objects return a 2D distribution with shape ( n_cells 2 )
function: def get_categorical_points(arr, unit_size=None):
    '''Given an array of Box() objects, return a 2D distribution with shape (n_cells, 2)'''
    points_arr = []
    for i in arr:
      area = i.w*i.h
      per_unit = (area / i.cells)**(1/2)
      x_units = math.ceil(i.w / per_unit)
      y_units = math.ceil(i.h / per_unit)
      if not unit_size: unit_size = min(i.w/x_units, i.h/y_units)
      for j in range(i.cells):
        x = j%x_units
        y = j//x_units
        points_arr.append([
          i.x+x*unit_size,
          i.y+y*unit_size,
        ])
    return np.array(points_arr)
function_tokens: def get_categorical_points ( arr , unit_size = None ) : points_arr = [ ] for i in arr : area = i . w * i . h per_unit = ( area / i . cells ) ** ( 1 / 2 ) x_units = math . ceil ( i . w / per_unit ) y_units = math . ceil ( i . h / per_unit ) if not unit_size : unit_size = min ( i . w / x_units , i . h / y_units ) for j in range ( i . cells ) : x = j % x_units y = j // x_units points_arr . append ( [ i . x + x * unit_size , i . y + y * unit_size , ] ) return np . array ( points_arr )