def make_browser_model(browser, filter_type=None):
 factories = {FilterType.instrument_hotswap: make_instruments_browser_model, FilterType.drum_pad_hotswap: make_drum_pad_browser_model, FilterType.audio_effect_hotswap: make_audio_effect_browser_model, FilterType.midi_effect_hotswap: make_midi_effect_browser_model}
 if (filter_type == None):
  filter_type = filter_type_for_browser(browser)
 return factories.get(filter_type, make_fallback_browser_model)(browser)

def make_browser_model ( browser , filter_type = None ) : factories = { FilterType . instrument_hotswap : make_instruments_browser_model , FilterType . drum_pad_hotswap : make_drum_pad_browser_model , FilterType . audio_effect_hotswap : make_audio_effect_browser_model , FilterType . midi_effect_hotswap : make_midi_effect_browser_model } if ( filter_type == None ) : filter_type = filter_type_for_browser ( browser ) return factories . get ( filter_type , make_fallback_browser_model ) ( browser )
factory that returns an appropriate browser model depending on the browser filter type and hotswap target .