def get_hqe_percentage_complete(**filter_data):
 query = models.HostQueueEntry.query_objects(filter_data)
 complete_count = query.filter(complete=True).count()
 total_count = query.count()
 if (total_count == 0):
  return 1
 return (float(complete_count) / total_count)

def get_hqe_percentage_complete ( ** filter_data ) : query = models . HostQueueEntry . query_objects ( filter_data ) complete_count = query . filter ( complete = True ) . count ( ) total_count = query . count ( ) if ( total_count == 0 ) : return 1 return ( float ( complete_count ) / total_count )
computes the fraction of host queue entries matching the given filter data that are complete .