def setComp(self, k, compPB):
    if k < 0 or k >= self.K:
      raise IndexError('Bad compID. Expected [0, %d] but provided %d' % (self.K-1, k))
    if compPB.K != 1:
      raise ValueError('Expected compPB to have K=1')
    for key, dims in self._FieldDims.items():
      if dims is None:
        self.setField(key, getattr(compPB,key), dims=None)
      elif self.K == 1: 
        self.setField(key, getattr(compPB,key), dims=dims)
      else:
        bigArr = getattr(self, key)
        bigArr[k] = getattr(compPB, key) # in-place

  ######################################################### Get component 
  #########################################################
Set (in-place) component k of self to provided compPB object.
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/suffstats/ParamBag.py/ParamBag.setComp