def _getAllowedShapes(self, shape):
    allowedShapes = set()
    if len(shape) == 0:
      allowedShapes.add(tuple())
      return allowedShapes
    shapeVec = np.asarray(shape, dtype=np.int32)
    onesMask = shapeVec == 1
    keepMask = np.logical_not(onesMask)
    nOnes = sum(onesMask)
    for b in range(2**nOnes):
      bStr = np.binary_repr(b)
      bStr = '0'*(nOnes - len(bStr)) + bStr
      keepMask[onesMask] = np.asarray([int(x) > 0 for x in bStr])
      curShape = shapeVec[keepMask]
      allowedShapes.add(tuple(curShape))
    return allowedShapes
Return set of allowed shapes that can be squeezed into given shape.
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/suffstats/ParamBag.py/ParamBag._getAllowedShapes