def get_tax_summary(source):
 all_line_taxes = []
 untaxed = TaxlessPrice(source.create_price(0).amount)
 for line in source.get_final_lines():
  line_taxes = list(line.taxes)
  all_line_taxes.extend(line_taxes)
  if (not line_taxes):
   untaxed += line.taxless_price
 return TaxSummary.from_line_taxes(all_line_taxes, untaxed)

def get_tax_summary ( source ) : all_line_taxes = [ ] untaxed = TaxlessPrice ( source . create_price ( 0 ) . amount ) for line in source . get_final_lines ( ) : line_taxes = list ( line . taxes ) all_line_taxes . extend ( line_taxes ) if ( not line_taxes ) : untaxed += line . taxless_price return TaxSummary . from_line_taxes ( all_line_taxes , untaxed )
get tax summary of given source lines .