code: def isMsgFromPrimary(self, msg, sender: str) -> bool:
          
          if self.isMsgForCurrentView(msg):
              return self.primaryName == sender
          try:
              return self.primaryNames[msg.viewNo] == sender
          except KeyError:
              return False
docs: Return whether this message was from primary replica
          :param msg:
          :param sender:
          :return: