def __init__(self): self.start_time = common.time_now() self.end_time = common.end_time(self.start_time, "15m") self.room_info = {} self.timezone = common.SJ_TIME_ZONE self.error = None self.exchange_api = ExchangeApi('', '')
def __init__(self, user, password, start_time=common.time_now(), duration=None, end_time=None, filename=common.ROOMS_CSV, timezone=common.SJ_TIME_ZONE): self.rooms = common.read_room_list(filename) self.user = user self.start_time = start_time self.room_info = {} self.timezone = timezone or common.SJ_TIME_ZONE self.error = None self.exchange_api = ExchangeApi(user, base64.b64decode(urllib.unquote(password))) if end_time is None: self.end_time = common.end_time(self.start_time, duration) if duration is None: self.end_time = end_time
def __init__(self, user, password, roomname, roomemail=None, start_time=common.time_now(), duration=None, end_time=None, raw_password=None, timezone=common.SJ_TIME_ZONE): self.user = user self.roomname = roomname if roomemail is None: self.roomemail = common.read_room_list()[roomname]["email"] else: self.roomemail = roomemail self.start_time = start_time self.timezone = self._calc_timezone_str(timezone) password = raw_password or base64.b64decode(urllib.unquote(password)) self.exchange_api = ExchangeApi(user, password) if end_time is None: self.end_time = common.end_time(self.start_time, duration) if duration is None: self.end_time = end_time
IDS(starter_motifs, desired_hamming_distance, length) def create_neighbor_motifs(motif): neighbor_motifs = [] if motif is None: motif = '' for i in range(0, len(common.motif_characters)): should_pass = True neighbor_motif = motif + common.motif_characters[i] if any(destroyer in motif for destroyer in destoryers): should_pass = False if should_pass == True: neighbor_motifs.append(neighbor_motif) return neighbor_motifs def handled_previously(motif): return motif in created_motifs_by_far st = common.start_time() discover_motifs(common.input_motif_length, common.input_hamming_distance) if global_counter > 0: common.print_success(str(global_counter) + ' motif with the length of ' + str(common.input_motif_length) + ' found.') else: common.print_error('No motifs with length of ' + str(common.input_motif_length) + ' were found.') common.end_time(st)