<s> import inspect <EOL> import sys <EOL> import django . shortcuts <EOL> import django . views . defaults <EOL> def dispatcher ( request , test_name ) : <EOL> from openstack_dashboard . test . jasmine import jasmine_tests as tests <EOL> classes = inspect . getmembers ( sys . modules [ tests . __name__ ] , <EOL> inspect . isclass ) <EOL> if not test_name : <EOL> return django . shortcuts . render ( <EOL> request , <EOL> "<STR_LIT>" , <EOL> { '<STR_LIT>' : ( cls_name for cls_name , _ in classes ) } <EOL> ) <EOL> else : <EOL> for cls_name , cls in classes : <EOL> if cls_name == test_name : <EOL> template = cls . template_name <EOL> if not template : <EOL> template = "<STR_LIT>" <EOL> return django . shortcuts . render ( <EOL> request , <EOL> template , <EOL> { '<STR_LIT>' : cls . specs , '<STR_LIT>' : cls . sources , <EOL> '<STR_LIT>' : cls . externalTemplates } ) <EOL> return django . views . defaults . page_not_found ( request ) </s>
