def _cluster_to_full_summary(cluster, now=None):
 cs = _cluster_to_basic_summary(cluster, now=now)
 cs['usage'] = _cluster_to_usage_data(cluster, basic_summary=cs, now=now)
 if cs['end']:
  cs['nih_billed'] = cs['nih']
 else:
  cs['nih_billed'] = float(sum((u['nih_billed'] for u in cs['usage'])))
 for nih_type in ('nih_used', 'nih_bbnu'):
  cs[nih_type] = float(sum((u[nih_type] for u in cs['usage'])))
 return cs

def _cluster_to_full_summary ( cluster , now = None ) : cs = _cluster_to_basic_summary ( cluster , now = now ) cs [ 'usage' ] = _cluster_to_usage_data ( cluster , basic_summary = cs , now = now ) if cs [ 'end' ] : cs [ 'nih_billed' ] = cs [ 'nih' ] else : cs [ 'nih_billed' ] = float ( sum ( ( u [ 'nih_billed' ] for u in cs [ 'usage' ] ) ) ) for nih_type in ( 'nih_used' , 'nih_bbnu' ) : cs [ nih_type ] = float ( sum ( ( u [ nih_type ] for u in cs [ 'usage' ] ) ) ) return cs
convert a cluster to a full summary for use in creating a report .