def place_order(creator, **kwargs):
 if ('shipping_method' not in kwargs):
  kwargs['shipping_method'] = Free()
 shipping_charge = kwargs['shipping_method'].calculate(kwargs['basket'])
 kwargs['total'] = calculators.OrderTotalCalculator().calculate(basket=kwargs['basket'], shipping_charge=shipping_charge)
 kwargs['shipping_charge'] = shipping_charge
 return creator.place_order(**kwargs)

def place_order ( creator , ** kwargs ) : if ( 'shipping_method' not in kwargs ) : kwargs [ 'shipping_method' ] = Free ( ) shipping_charge = kwargs [ 'shipping_method' ] . calculate ( kwargs [ 'basket' ] ) kwargs [ 'total' ] = calculators . OrderTotalCalculator ( ) . calculate ( basket = kwargs [ 'basket' ] , shipping_charge = shipping_charge ) kwargs [ 'shipping_charge' ] = shipping_charge return creator . place_order ( ** kwargs )
helper function to place an order without the boilerplate .