<s> from __future__ import division , print_function , absolute_import <EOL> __all__ = [ '<STR_LIT>' ] <EOL> try : <EOL> from . import _flinalg <EOL> except ImportError : <EOL> _flinalg = None <EOL> has_column_major_storage = lambda a : <NUM_LIT:0> <EOL> def has_column_major_storage ( arr ) : <EOL> return arr . flags [ '<STR_LIT>' ] <EOL> _type_conv = { '<STR_LIT:f>' : '<STR_LIT:s>' , '<STR_LIT:d>' : '<STR_LIT:d>' , '<STR_LIT:F>' : '<STR_LIT:c>' , '<STR_LIT:D>' : '<STR_LIT:z>' } <EOL> def get_flinalg_funcs ( names , arrays = ( ) , debug = <NUM_LIT:0> ) : <EOL> """<STR_LIT>""" <EOL> ordering = [ ] <EOL> for i in range ( len ( arrays ) ) : <EOL> t = arrays [ i ] . dtype . char <EOL> if t not in _type_conv : <EOL> t = '<STR_LIT:d>' <EOL> ordering . append ( ( t , i ) ) <EOL> if ordering : <EOL> ordering . sort ( ) <EOL> required_prefix = _type_conv [ ordering [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] ] <EOL> else : <EOL> required_prefix = '<STR_LIT:d>' <EOL> if ordering and has_column_major_storage ( arrays [ ordering [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] ] ) : <EOL> suffix1 , suffix2 = '<STR_LIT>' , '<STR_LIT>' <EOL> else : <EOL> suffix1 , suffix2 = '<STR_LIT>' , '<STR_LIT>' <EOL> funcs = [ ] <EOL> for name in names : <EOL> func_name = required_prefix + name <EOL> func = getattr ( _flinalg , func_name + suffix1 , <EOL> getattr ( _flinalg , func_name + suffix2 , None ) ) <EOL> funcs . append ( func ) <EOL> return tuple ( funcs ) </s>
