def flights(cls, user): """Gets the time periods for which the given user was in flight. Args: user: The user for which to get flight periods for. Returns: A list of TimePeriod objects corresponding to individual flights. """ return TimePeriod.from_events(TakeoffOrLandingEvent.by_user(user), is_start_func=lambda x: x.uas_in_air, is_end_func=lambda x: not x.uas_in_air)
def missions(cls, user): """Gets the time periods which represents periods on the mission clock. Args: user: The user for which to get mission periods for. Returns: A list of TimePeriod objects for the mission clock. """ return TimePeriod.from_events( MissionClockEvent.by_user(user), is_start_func=lambda x: x.team_on_clock, is_end_func=lambda x: not x.team_on_clock)
def flights(cls, user): """Gets the time periods for which the given user was in flight. Args: user: The user for which to get flight periods for. Returns: A list of TimePeriod objects corresponding to individual flights. """ return TimePeriod.from_events( TakeoffOrLandingEvent.by_user(user), is_start_func=lambda x: x.uas_in_air, is_end_func=lambda x: not x.uas_in_air)