def _GetChartFactory(chart_class, display_class):
 def Inner(*args, **kwargs):
  chart = chart_class(*args, **kwargs)
  chart.display = display_class(chart)
  return chart
 return Inner

def _GetChartFactory ( chart_class , display_class ) : def Inner ( * args , ** kwargs ) : chart = chart_class ( * args , ** kwargs ) chart . display = display_class ( chart ) return chart return Inner
create a factory method for instantiating charts with displays .