code: def __reset_weights(self, target_phis, res_idxs, obs_idxs):
          
  
          for item in target_phis.keys():
              assert item in res_idxs.keys(),\
                  "Pst.__reset_weights(): " + str(item) +\
                  " not in residual group indices"
              assert item in obs_idxs.keys(), \
                  "Pst.__reset_weights(): " + str(item) +\
                  " not in observation group indices"
              actual_phi = ((self.res.loc[res_idxs[item], "residual"] *
                             self.observation_data.loc
                             [obs_idxs[item], "weight"])**2).sum()
              if actual_phi > 0.0:
                  weight_mult = np.sqrt(target_phis[item] / actual_phi)
                  self.observation_data.loc[obs_idxs[item], "weight"] *= weight_mult
              else:
                  ("Pst.__reset_weights() warning: phi group {0} has zero phi, skipping...".format(item))
docs: private method to reset weights based on target phi values
          for each group.  This method should not be called directly
  
          Parameters
          ----------
          target_phis : dict
              target phi contribution for groups to reweight
          res_idxs : dict
              the index positions of each group of interest
              in the res dataframe
          obs_idxs : dict
              the index positions of each group of interest
              in the observation data dataframe