<s> import shutil <EOL> import os <EOL> import sys <EOL> import os . path as op <EOL> from distutils . command . clean import clean <EOL> if sys . version_info < ( <NUM_LIT:2> , <NUM_LIT:6> ) : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> try : <EOL> import setuptools <EOL> except ImportError : <EOL> setuptools = None <EOL> with open ( '<STR_LIT>' ) as f : <EOL> requirements = f . read ( ) . splitlines ( ) <EOL> with open ( os . path . join ( '<STR_LIT>' , '<STR_LIT>' ) ) as f : <EOL> exec ( f . read ( ) ) <EOL> def setup_package ( ) : <EOL> metadata = dict ( <EOL> description = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> license = '<STR_LIT>' , <EOL> packages = [ '<STR_LIT>' ] , <EOL> install_requires = requirements , <EOL> setup_requires = requirements <EOL> ) <EOL> if ( len ( sys . argv ) >= <NUM_LIT:2> and <EOL> ( '<STR_LIT>' in sys . argv [ <NUM_LIT:1> : ] or <EOL> ( sys . argv [ <NUM_LIT:1> ] in ( <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) ) ) ) : <EOL> try : <EOL> from setuptools import setup <EOL> except ImportError : <EOL> from distutils . core import setup <EOL> metadata [ '<STR_LIT:name>' ] = '<STR_LIT>' <EOL> metadata [ '<STR_LIT:version>' ] = version <EOL> else : <EOL> from numpy . distutils . core import setup <EOL> from numpy . distutils . command . build_ext import build_ext as numpy_build_ext <EOL> try : <EOL> from distutils . command . build_py import build_py_2to3 as old_build_py <EOL> from numpy . distutils . misc_util import is_string <EOL> class build_py ( old_build_py ) : <EOL> def run ( self ) : <EOL> build_src = self . get_finalized_command ( '<STR_LIT>' ) <EOL> if build_src . py_modules_dict and self . packages is None : <EOL> self . packages = list ( build_src . py_modules_dict . keys ( ) ) <EOL> old_build_py . run ( self ) <EOL> def find_package_modules ( self , package , package_dir ) : <EOL> modules = old_build_py . find_package_modules ( <EOL> self , package , package_dir ) <EOL> build_src = self . get_finalized_command ( '<STR_LIT>' ) <EOL> modules += build_src . py_modules_dict . get ( package , [ ] ) <EOL> return modules <EOL> def find_modules ( self ) : <EOL> old_py_modules = self . py_modules [ : ] <EOL> new_py_modules = list ( filter ( is_string , self . py_modules ) ) <EOL> self . py_modules [ : ] = new_py_modules <EOL> modules = old_build_py . find_modules ( self ) <EOL> self . py_modules [ : ] = old_py_modules <EOL> return modules <EOL> except ImportError : <EOL> from numpy . distutils . command . build_py import build_py <EOL> DEBUG = False <EOL> def localpath ( * args ) : <EOL> return op . abspath ( op . join ( * ( ( op . dirname ( __file__ ) , ) + args ) ) ) <EOL> def debug ( instring ) : <EOL> if DEBUG : <EOL> print ( "<STR_LIT>" + instring ) <EOL> def configuration ( ) : <EOL> from numpy . distutils . misc_util import Configuration , dict_append <EOL> from numpy . distutils . system_info import system_info <EOL> config = Configuration ( '<STR_LIT>' ) <EOL> if op . exists ( '<STR_LIT>' ) : <EOL> mkl_config_data = config . get_info ( '<STR_LIT>' ) <EOL> default_config = system_info ( ) <EOL> dict_append ( mkl_config_data , <EOL> libraries = default_config . get_libraries ( ) , <EOL> library_dirs = default_config . get_lib_dirs ( ) ) <EOL> else : <EOL> mkl_config_data = { } <EOL> if os . name == '<STR_LIT>' : <EOL> pthread_win = [ '<STR_LIT>' ] <EOL> else : <EOL> pthread_win = [ ] <EOL> extension_config_data = { <EOL> '<STR_LIT>' : [ '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ] + pthread_win , <EOL> '<STR_LIT>' : [ '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ] , <EOL> '<STR_LIT>' : [ '<STR_LIT:m>' ] , <EOL> '<STR_LIT>' : [ '<STR_LIT>' , ] , <EOL> } <EOL> dict_append ( extension_config_data , ** mkl_config_data ) <EOL> if '<STR_LIT>' in mkl_config_data : <EOL> library_dirs = '<STR_LIT::>' . join ( mkl_config_data [ '<STR_LIT>' ] ) <EOL> config . add_extension ( '<STR_LIT>' , ** extension_config_data ) <EOL> config . make_config_py ( ) <EOL> config . add_subpackage ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> config . get_version ( '<STR_LIT>' ) <EOL> return config <EOL> class cleaner ( clean ) : <EOL> def run ( self ) : <EOL> path = localpath ( "<STR_LIT>" ) <EOL> try : <EOL> shutil . rmtree ( path ) <EOL> except Exception : <EOL> debug ( "<STR_LIT>" % path ) <EOL> else : <EOL> debug ( "<STR_LIT>" % path ) <EOL> try : <EOL> import imp <EOL> except ImportError : <EOL> if os . name == '<STR_LIT>' : <EOL> paths = [ localpath ( "<STR_LIT>" ) ] <EOL> else : <EOL> paths = [ localpath ( "<STR_LIT>" ) ] <EOL> else : <EOL> paths = [ ] <EOL> for suffix , _ , _ in imp . get_suffixes ( ) : <EOL> if suffix == '<STR_LIT>' : <EOL> continue <EOL> paths . append ( localpath ( "<STR_LIT>" , "<STR_LIT>" + suffix ) ) <EOL> paths . append ( localpath ( "<STR_LIT>" ) ) <EOL> paths . append ( localpath ( "<STR_LIT>" ) ) <EOL> for path in paths : <EOL> try : <EOL> os . remove ( path ) <EOL> except Exception : <EOL> debug ( "<STR_LIT>" % path ) <EOL> else : <EOL> debug ( "<STR_LIT>" % path ) <EOL> clean . run ( self ) <EOL> class build_ext ( numpy_build_ext ) : <EOL> def build_extension ( self , ext ) : <EOL> if self . compiler . compiler_type == '<STR_LIT>' or self . compiler . compiler_type == '<STR_LIT>' : <EOL> ext . extra_compile_args = [ ] <EOL> ext . extra_link_args = [ ] <EOL> ext . libraries . remove ( '<STR_LIT:m>' ) <EOL> numpy_build_ext . build_extension ( self , ext ) <EOL> if setuptools : <EOL> metadata [ '<STR_LIT>' ] = False <EOL> metadata [ '<STR_LIT>' ] = { <EOL> '<STR_LIT>' : build_ext , <EOL> '<STR_LIT>' : cleaner , <EOL> '<STR_LIT>' : build_py , <EOL> } <EOL> metadata [ '<STR_LIT>' ] = configuration <EOL> setup ( ** metadata ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> setup_package ( ) </s>
