def _os_supports_avx():
 if ((not sys.platform.startswith('linux')) or (platform.machine() not in ('i386', 'i586', 'i686', 'x86_64'))):
  return True
 try:
  f = open('/proc/cpuinfo', 'r')
 except OSError:
  return True
 with f:
  for line in f:
   (head, _, body) = line.partition(':')
   if ((head.strip() == 'flags') and ('avx' in body.split())):
    return True
  else:
   return False

def _os_supports_avx ( ) : if ( ( not sys . platform . startswith ( 'linux' ) ) or ( platform . machine ( ) not in ( 'i386' , 'i586' , 'i686' , 'x86_64' ) ) ) : return True try : f = open ( '/proc/cpuinfo' , 'r' ) except OSError : return True with f : for line in f : ( head , _ , body ) = line . partition ( ':' ) if ( ( head . strip ( ) == 'flags' ) and ( 'avx' in body . split ( ) ) ) : return True else : return False
whether the current os supports avx .