def make_extension(name, files, *args, **kwargs):
 ext = DelayedExtension(name, files, *args, **kwargs)
 for dir in get_base_dirs():
  include_dir = os.path.join(dir, 'include')
  if os.path.exists(include_dir):
   ext.include_dirs.append(include_dir)
  for lib in ('lib', 'lib64'):
   lib_dir = os.path.join(dir, lib)
   if os.path.exists(lib_dir):
    ext.library_dirs.append(lib_dir)
 ext.include_dirs.append('.')
 return ext

def make_extension ( name , files , * args , ** kwargs ) : ext = DelayedExtension ( name , files , * args , ** kwargs ) for dir in get_base_dirs ( ) : include_dir = os . path . join ( dir , 'include' ) if os . path . exists ( include_dir ) : ext . include_dirs . append ( include_dir ) for lib in ( 'lib' , 'lib64' ) : lib_dir = os . path . join ( dir , lib ) if os . path . exists ( lib_dir ) : ext . library_dirs . append ( lib_dir ) ext . include_dirs . append ( '.' ) return ext
decorator to make given functions into trainer extensions .