Data Science, Product Analytics, Simulation, Deep Dives, Programming.
is_within_working_hours(self, dt): weekday = dt.strftime('%A') if weekday not in self.time_periods: return False hour = dt.hour time_periods = self.time_periods[weekday] for period in time_periods: if (hour >= period[0]) and (hour < period[1]): return True return False The only method we have for a