def CreateSP(imp, params):
 if (imp == 'py'):
  spClass = PySpatialPooler
 elif (imp == 'cpp'):
  spClass = CPPSpatialPooler
 else:
  raise RuntimeError('unrecognized implementation')
 print params
 sp = spClass(**params)
 return sp

def CreateSP ( imp , params ) : if ( imp == 'py' ) : spClass = PySpatialPooler elif ( imp == 'cpp' ) : spClass = CPPSpatialPooler else : raise RuntimeError ( 'unrecognized implementation' ) print params sp = spClass ( ** params ) return sp
helper class for creating an instance of the appropriate spatial pooler using given parameters .