def add_participant_list(self, participant_list: List[str]) -> bool: participant_set = set(participant_list) if len(participant_set) != len(participant_list): return False to_add = [] for participant in participant_list: if self.check_participant_exists_by_name(participant): return False to_add.append(UserData(participant)) self.__participants.extend(to_add) return True
def remove_participant(self, participant: str) -> bool: if self.check_participant_exists_by_name(participant): self.__participants.remove(UserData(participant)) return True return False
def add_participant(self, participant: str) -> bool: if not self.check_participant_exists_by_name(participant): self.__participants.append(UserData(participant)) return True return False
def sample_user_a(self): return UserData('a')
def sample_user_d(self): return UserData('d')
def sample_user_c(self): return UserData('c')
def sample_user_b(self): return UserData('b')