def __getattr__(self, name):
        flags = ''
        if name.endswith('32'):
            flags = ',floatX=float32'
        if name.endswith('64'):
            flags = ',floatX=float64'

        if name.startswith('cpu'):
            return self.configure('device=cpu'+flags)
        if name.startswith('gpu'):
            return self.configure('device=gpu'+flags)
        
        if name.startswith('thread'):
            try:
                count = int(re.sub('\D', '', name))
            except __HOLE__:
                import multiprocessing
                count = multiprocessing.cpu_count()

            os.environ.setdefault('THEANO_FLAGS', ','.join(['openmp=True', os.environ.get('THEANO_FLAGS', '')]))
            os.environ.setdefault('OMP_NUM_THREADS', str(count))
            return

        return getattr(sys.modules['sknn'], name)
dataset/ETHPy150Open aigamedev/scikit-neuralnetwork/sknn/__init__.py/TheanoConfigurator.__getattr__