def CreateSP(imp, params):
if (imp == "<STR_LIT>"):<EOL><INDENT>spClass = PySpatialPooler<EOL><DEDENT>elif (imp == "<STR_LIT>"):<EOL><INDENT>spClass = CPPSpatialPooler<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>print(params)<EOL>sp = spClass(**params)<EOL>return sp<EOL>
Helper class for creating an instance of the appropriate spatial pooler using
given parameters.

Parameters:
----------------------------
imp:       Either 'py' or 'cpp' for creating the appropriate instance.
params:    A dict for overriding constructor parameters. The keys must
           correspond to contructor parameter names.

Returns the SP object.