src/dirbs/reports/base_operator_country.py
def _retrieve_condition_results(self, condition_stats, classification_conditions):
        """Converts DB results into reporting format."""
        if condition_stats is not None:
            condition_stats_lookup = {c.cond_name: c for c in condition_stats}
        else:
            condition_stats_lookup = {}
        rv = {}
        for c in classification_conditions:
            cond_name = c['label']
            rv[cond_name] = {
                'num_imeis': 0,
                'num_triplets': 0,
                'num_imei_imsis': 0,
                'num_imei_msisdns': 0,
                'num_imei_gross_adds': 0
            }
            cond_stat = condition_stats_lookup.get(cond_name, None)
            if cond_stat is not None:
                for k in rv[cond_name].keys():
                    rv[cond_name][k] = getattr(cond_stat, k)
        return rv
Converts DB results into reporting format.
Converts DB results into reporting format.
Converts DB results into reporting format .
def _retrieve_condition_results(self, condition_stats, classification_conditions):
        if condition_stats is not None:
            condition_stats_lookup = {c.cond_name: c for c in condition_stats}
        else:
            condition_stats_lookup = {}
        rv = {}
        for c in classification_conditions:
            cond_name = c['label']
            rv[cond_name] = {
                'num_imeis': 0,
                'num_triplets': 0,
                'num_imei_imsis': 0,
                'num_imei_msisdns': 0,
                'num_imei_gross_adds': 0
            }
            cond_stat = condition_stats_lookup.get(cond_name, None)
            if cond_stat is not None:
                for k in rv[cond_name].keys():
                    rv[cond_name][k] = getattr(cond_stat, k)
        return rv
def _retrieve_condition_results ( self , condition_stats , classification_conditions ) : if condition_stats is not None : condition_stats_lookup = { c . cond_name : c for c in condition_stats } else : condition_stats_lookup = { } rv = { } for c in classification_conditions : cond_name = c [ 'label' ] rv [ cond_name ] = { 'num_imeis' : 0 , 'num_triplets' : 0 , 'num_imei_imsis' : 0 , 'num_imei_msisdns' : 0 , 'num_imei_gross_adds' : 0 } cond_stat = condition_stats_lookup . get ( cond_name , None ) if cond_stat is not None : for k in rv [ cond_name ] . keys ( ) : rv [ cond_name ] [ k ] = getattr ( cond_stat , k ) return rv
Converts DB results into reporting format.
Converts DB results into reporting format .
"""Converts DB results into reporting format."""
self
condition_stats
classification_conditions