Module Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Str With Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Str NameStore body Assign NameStore Call AttributeLoad NameLoad attr While NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Expr Yield TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Dict For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad ListLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad Assign NameStore NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareEq Call AttributeLoad NameLoad attr Str Str body Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad Assign NameStore NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareGt Call AttributeLoad NameLoad attr Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad For NameStore NameLoad body If Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad Assign NameStore NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareLt Call AttributeLoad NameLoad attr Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad Assign NameStore NameLoad For NameStore NameLoad body If Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr CompareIn Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr CompareIsNot Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareLt BinOpAdd NameLoad Num Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr CompareLtE Call AttributeLoad NameLoad attr Str Call AttributeLoad SubscriptLoad NameLoad Index BinOpAdd NameLoad Num attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad For NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareLt BinOpAdd NameLoad Num Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr CompareLtE Call AttributeLoad NameLoad attr Str Call AttributeLoad SubscriptLoad NameLoad Index BinOpAdd NameLoad Num attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad Assign NameStore Num For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareEq Call AttributeLoad NameLoad attr Str Str body AugAssignAdd NameStore Num Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad Assign NameStore Num For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareEq Call AttributeLoad NameLoad attr Str Str body AugAssignAdd NameStore Num Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Num Assign NameStore Num For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body AugAssignAdd NameStore Num Assign NameStore Call NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str If UnaryOpNot NameLoad body Assign NameStore NameLoad Break If CompareEq NameLoad Str body If NameLoad body Assign NameStore NameLoad Break Assign NameStore NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str If CompareEq NameLoad Str body If UnaryOpNot NameLoad body Assign NameStore NameLoad Break Assign NameStore NameLoad If CompareNotEq Call AttributeLoad NameLoad attr Str NameLoad body Assign NameStore NameLoad Break If UnaryOpNot NameLoad body Assign NameStore Num Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str Assign NameStore BinOpSub NameLoad NameLoad AugAssignAdd NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr CompareGtE NameLoad Num BinOpMod Str NameLoad AugAssignAdd NameStore Num Expr Call AttributeLoad NameLoad attr CompareGt NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore BinOpMult BinOpMult AttributeLoad NameLoad attr Num Num Assign NameStore BinOpMult BinOpAdd AttributeLoad NameLoad attr NameLoad BinOpPow Num Num Return BinOpDiv BinOpAdd AttributeLoad NameLoad attr NameLoad BinOpPow Num Num decorator_list decorator_list
N/A N/A copy N/A unittest os path agora.stats PBSVideoStats dateutil.parser parse mrjob.protocol JSONProtocol N/A HERE N/A N/A path abspath N/A N/A path dirname __file__ PBSVideoStatsTestcase N/A N/A unittest TestCase N/A N/A 
    Test agora.stats.PBSVideoStats
     events_generator N/A N/A N/A N/A N/A 
        Parse the output from our VideoCondense mapper.
         N/A protocol N/A JSONProtocol N/A input_filename ./fixtures/video-stream-mapper-sample N/A N/A open N/A N/A path join HERE input_filename r f N/A N/A line N/A N/A f readline N/A line N/A N/A N/A key events N/A N/A protocol read line N/A N/A N/A key events N/A line N/A N/A f readline N/A staticmethod setup_class N/A N/A cls N/A N/A N/A 
        Parse our sample data into a format similar to what is expected for
        a MRJob reduce(key, events) method.
         N/A N/A cls events N/A N/A N/A key event N/A N/A cls events_generator N/A N/A key N/A N/A key_events N/A N/A N/A cls events setdefault key N/A N/A N/A N/A key_events append event N/A N/A N/A cls events N/A key key_events N/A classmethod test_finished_playback N/A N/A self N/A N/A N/A 
        Test that we're accurately marking playback as finished.
         N/A N/A key events N/A N/A N/A self events items N/A N/A stats N/A PBSVideoStats N/A finished_playback False N/A event events N/A N/A N/A N/A stats add_event event N/A N/A N/A N/A event get event_type MediaCompleted N/A N/A finished_playback True N/A results N/A N/A stats summary N/A N/A N/A self assertEqual N/A N/A results get finished_playback finished_playback N/A test_latest_time N/A N/A self N/A N/A N/A 
        Test that we're correctly calculating
        the time of the last event of a stream
         N/A N/A key events N/A N/A N/A self events items N/A N/A stats N/A PBSVideoStats N/A latest_time None N/A event events N/A N/A N/A N/A stats add_event event N/A N/A N/A N/A event get event_date latest_time N/A N/A latest_time N/A N/A event get event_date N/A results N/A N/A stats summary N/A N/A N/A self assertEqual N/A N/A results get latest_time latest_time N/A test_latest_time_none N/A N/A self N/A N/A N/A 
        Test that we're correctly calculating
        the time of the last event of a stream
        given events with no timestamps
         N/A N/A key events N/A N/A copy deepcopy N/A N/A N/A self events items N/A N/A stats N/A PBSVideoStats N/A event events N/A N/A N/A N/A event get event_date N/A N/A N/A event N/A event_date None N/A N/A N/A stats add_event event N/A results N/A N/A stats summary N/A N/A N/A self assertEqual N/A N/A results get latest_time None N/A test_earliest_time N/A N/A self N/A N/A N/A 
        Test that we're correctly calculating
        the time of the first event of a stream
         N/A N/A key events N/A N/A N/A self events items N/A N/A stats N/A PBSVideoStats N/A earliest_time None N/A event events N/A N/A N/A N/A stats add_event event N/A N/A N/A N/A event get event_date earliest_time N/A N/A earliest_time N/A N/A event get event_date N/A results N/A N/A stats summary N/A N/A N/A self assertEqual N/A N/A results get earliest earliest_time N/A test_earliest_time_none N/A N/A self N/A N/A N/A 
        Test that we're correctly calculating
        the time of the first event of a stream
        given events with no timestamps
         N/A N/A key events N/A N/A copy deepcopy N/A N/A N/A self events items N/A N/A stats N/A PBSVideoStats N/A earliest_time None N/A event events N/A N/A N/A N/A event get event_date N/A N/A N/A event N/A event_date None N/A N/A N/A stats add_event event N/A results N/A N/A stats summary N/A N/A N/A self assertEqual N/A N/A results get earliest_time earliest_time N/A test_add_duration_event N/A N/A self N/A N/A N/A 
        Test that only the correct MEDIA_EVENTS
        that have timestamps are added to the
        duration_events list
         N/A N/A key events N/A N/A N/A self events items N/A N/A stats N/A PBSVideoStats N/A event events N/A N/A N/A N/A stats add_event event N/A results N/A stats duration_events N/A edata results N/A N/A N/A N/A self assertTrue N/A N/A N/A edata get etype N/A stats MEDIA_EVENTS N/A N/A N/A self assertTrue N/A N/A N/A edata get edate None N/A test_sort_duration_events_in_order N/A N/A self N/A N/A N/A 
        Test that we're sorting the duration_event timestamps
        (added in chronological order) correctly
         N/A N/A key events N/A N/A N/A self events items N/A N/A stats N/A PBSVideoStats N/A event events N/A N/A N/A N/A stats add_event event N/A N/A N/A stats _calculate_duration N/A results N/A stats duration_events N/A N/A count edata N/A enumerate results N/A N/A N/A N/A count 1 N/A len results N/A N/A N/A N/A self assertTrue N/A N/A N/A edata get edate N/A N/A N/A results N/A N/A count 1 get edate N/A test_sort_duration_events_reverse_order N/A N/A self N/A N/A N/A 
        Test that we're sorting the duration_event timestamps
        (added in reversed order) correctly
         N/A N/A key events N/A N/A N/A self events items N/A N/A stats N/A PBSVideoStats N/A event N/A reversed events N/A N/A N/A N/A stats add_event event N/A N/A N/A stats _calculate_duration N/A results N/A stats duration_events N/A N/A count edata N/A enumerate results N/A N/A N/A N/A count 1 N/A len results N/A N/A N/A N/A self assertTrue N/A N/A N/A edata get edate N/A N/A N/A results N/A N/A count 1 get edate N/A test_media_quality_change_auto N/A N/A self N/A N/A N/A 
        Test that we're tallying MediaQualityChangeAuto events
         N/A N/A key events N/A N/A N/A self events items N/A N/A stats N/A PBSVideoStats N/A auto_bitrate_events 0 N/A event events N/A N/A N/A N/A stats add_event event N/A N/A N/A N/A event get event_type MediaQualityChangeAuto N/A N/A auto_bitrate_events 1 N/A results N/A N/A stats summary N/A N/A N/A self assertEqual N/A N/A results get auto_bitrate_events auto_bitrate_events N/A test_media_quality_change_user N/A N/A self N/A N/A N/A 
        Test that we're tallying MediaQualityChange events
         N/A N/A key events N/A N/A N/A self events items N/A N/A stats N/A PBSVideoStats N/A user_bitrate_events 0 N/A event events N/A N/A N/A N/A stats add_event event N/A N/A N/A N/A event get event_type MediaQualityChange N/A N/A user_bitrate_events 1 N/A results N/A N/A stats summary N/A N/A N/A self assertEqual N/A N/A results get user_bitrate_events user_bitrate_events N/A test_buffering_length N/A N/A self N/A N/A N/A 
        Verify that we're summing the time a stream spends buffering.
         N/A streams_with_buffer_length 0 N/A enum -1 N/A N/A key events N/A N/A N/A self events items N/A N/A enum 1 N/A stats N/A PBSVideoStats N/A stream_buffer_length None N/A open_start_buffer False N/A is_valid_buffering True N/A media_buffering_start_time None N/A media_buffering_start_location None N/A event events N/A N/A N/A N/A stats add_event event N/A event_type N/A N/A event get event_type N/A N/A event_type N/A N/A is_valid_buffering False N/A N/A N/A event_type MediaBufferingStart N/A N/A open_start_buffer N/A N/A is_valid_buffering False N/A N/A open_start_buffer True N/A media_buffering_start_time N/A parse N/A N/A event get event_date N/A media_buffering_start_location N/A N/A event get x_video_location N/A N/A event_type MediaBufferingEnd N/A N/A N/A open_start_buffer N/A N/A is_valid_buffering False N/A N/A open_start_buffer False N/A N/A N/A N/A event get x_video_location media_buffering_start_location N/A N/A is_valid_buffering False N/A N/A N/A stream_buffer_length N/A N/A stream_buffer_length 0 N/A media_buffering_end_time N/A parse N/A N/A event get event_date N/A buffer_delta N/A media_buffering_end_time media_buffering_start_time N/A stream_buffer_length N/A N/A self _total_seconds buffer_delta N/A is_valid_buffering N/A N/A results N/A N/A stats summary N/A results_buffering_length N/A N/A results get buffering_length N/A N/A N/A self assertEqual results_buffering_length stream_buffer_length N/A N/A stream_buffer_length None N/A N/A N/A N/A self assertTrue N/A results_buffering_length 0 N/A %s is not a positive number results_buffering_length N/A streams_with_buffer_length 1 N/A N/A N/A self assertTrue N/A streams_with_buffer_length 0 N/A _total_seconds N/A N/A self timedelta N/A N/A N/A 
        Replacement for timedelta.total_seconds() which
        is not supported in python 2.6
         N/A delta_seconds N/A N/A N/A timedelta days 24 3600 N/A delta_microseconds N/A N/A N/A timedelta seconds delta_seconds N/A 10 6 N/A N/A N/A N/A timedelta microseconds delta_microseconds N/A 10 6 N/A N/A