def create_and_build(builder_class, *data, **kws):
 if (getattr(builder_class, 'dimensions') is None):
  raise NotImplementedError(('Each builder must specify its dimensions, %s does not.' % builder_class.__name__))
 if (getattr(builder_class, 'default_attributes') is None):
  raise NotImplementedError(('Each builder must specify its default_attributes, %s does not.' % builder_class.__name__))
 builder_props = (set(builder_class.properties()) | set(getattr(builder_class, '__deprecated_attributes__', [])))
 for dim in builder_class.dimensions:
  builder_props.add(dim)
 for attr_name in builder_class.default_attributes.keys():
  builder_props.add(attr_name)
 builder_kws = {k: v for (k, v) in kws.items() if (k in builder_props)}
 builder = builder_class(*data, **builder_kws)
 chart_kws = {k: v for (k, v) in kws.items() if (k not in builder_props)}
 chart = Chart(**chart_kws)
 chart.add_builder(builder)
 chart.start_plot()
 return chart

def create_and_build ( builder_class , * data , ** kws ) : if ( getattr ( builder_class , 'dimensions' ) is None ) : raise NotImplementedError ( ( 'Each builder must specify its dimensions, %s does not.' % builder_class . __name__ ) ) if ( getattr ( builder_class , 'default_attributes' ) is None ) : raise NotImplementedError ( ( 'Each builder must specify its default_attributes, %s does not.' % builder_class . __name__ ) ) builder_props = ( set ( builder_class . properties ( ) ) | set ( getattr ( builder_class , '__deprecated_attributes__' , [ ] ) ) ) for dim in builder_class . dimensions : builder_props . add ( dim ) for attr_name in builder_class . default_attributes . keys ( ) : builder_props . add ( attr_name ) builder_kws = { k : v for ( k , v ) in kws . items ( ) if ( k in builder_props ) } builder = builder_class ( * data , ** builder_kws ) chart_kws = { k : v for ( k , v ) in kws . items ( ) if ( k not in builder_props ) } chart = Chart ( ** chart_kws ) chart . add_builder ( builder ) chart . start_plot ( ) return chart
a factory function for handling chart and builder generation .