code: def is_primary_in_view(self, viewNo: int) -> Optional[bool]:
          
          if viewNo not in self.primaryNames:
              return False
          return self.primaryNames[viewNo] == self.name
docs: Return whether this replica was primary in the given view