sampro/sampro.py
def rooted_samples_by_line(self, filename):
        '''
        Get sample counts by line, and root thread function.
        (For one file, specified as a parameter.)
        This is useful for generating "side-by-side" views of
        source code and samples.
        '''
        rooted_leaf_samples, _ = self.live_data_copy()
        rooted_line_samples = {}
        for root, counts in rooted_leaf_samples.items():
            cur = {}
            for key, count in counts.items():
                code, lineno = key
                if code.co_filename != filename:
                    continue
                cur[lineno] = count
            rooted_line_samples[root] = cur
        return rooted_line_samples
def rooted_samples_by_line(self, filename):
        '''
        Get sample counts by line, and root thread function.
        (For one file, specified as a parameter.)
        This is useful for generating "side-by-side" views of
        source code and samples.
        '''
        rooted_leaf_samples, _ = self.live_data_copy()
        rooted_line_samples = {}
        for root, counts in rooted_leaf_samples.items():
            cur = {}
            for key, count in counts.items():
                code, lineno = key
                if code.co_filename != filename:
                    continue
                cur[lineno] = count
            rooted_line_samples[root] = cur
        return rooted_line_samples
Get sample counts by line, and root thread function.
        (For one file, specified as a parameter.)
        This is useful for generating "side-by-side" views of
        source code and samples.