@staticmethod<EOL><INDENT>def from_spec(spec, kwargs=None):<DEDENT>
if isinstance(spec, dict):<EOL><INDENT>spec = [spec]<EOL><DEDENT>stack = PreprocessorStack()<EOL>for preprocessor_spec in spec:<EOL><INDENT>preprocessor_kwargs = copy.deepcopy(kwargs)<EOL>preprocessor = util.get_object(<EOL>obj=preprocessor_spec,<EOL>predefined_objects=tensorforce.core.preprocessors.preprocessors,<EOL>kwargs=preprocessor_kwargs<EOL>)<EOL>assert isinstance(preprocessor, Preprocessor)<EOL>stack.preprocessors.append(preprocessor)<EOL><DEDENT>return stack<EOL>
Creates a preprocessing stack from a specification dict.