<s> """<STR_LIT>""" <EOL> from ovs . dal . datalist import DataList <EOL> from ovs . dal . hybrids . backend import Backend <EOL> class BackendList ( object ) : <EOL> """<STR_LIT>""" <EOL> @ staticmethod <EOL> def get_backends ( ) : <EOL> """<STR_LIT>""" <EOL> return DataList ( Backend , { '<STR_LIT:type>' : DataList . where_operator . AND , <EOL> '<STR_LIT>' : [ ] } ) <EOL> @ staticmethod <EOL> def get_by_name ( name ) : <EOL> backends = DataList ( Backend , { '<STR_LIT:type>' : DataList . where_operator . AND , <EOL> '<STR_LIT>' : [ ( '<STR_LIT:name>' , DataList . operator . EQUALS , name ) ] } ) <EOL> if len ( backends ) > <NUM_LIT:1> : <EOL> raise RuntimeError ( '<STR_LIT>' . format ( len ( backends ) ) ) <EOL> if len ( backends ) == <NUM_LIT:0> : <EOL> return None <EOL> return backends [ <NUM_LIT:0> ] </s>
