<s> from pebl import config , data , prior <EOL> def fromconfig ( data_ = None , prior_ = None ) : <EOL> learnertype = config . get ( '<STR_LIT>' ) <EOL> if '<STR_LIT::>' in learnertype : <EOL> CustomLearner ( <EOL> data_ or data . fromconfig ( ) , <EOL> prior_ or prior . fromconfig ( ) , <EOL> learnerurl = learnertype <EOL> ) <EOL> else : <EOL> learnermodule , learnerclass = learnertype . split ( '<STR_LIT:.>' ) <EOL> mymod = __import__ ( "<STR_LIT>" % learnermodule , fromlist = [ '<STR_LIT>' ] ) <EOL> mylearner = getattr ( mymod , learnerclass ) <EOL> return mylearner ( data_ or data . fromconfig ( ) , prior_ or prior . fromconfig ( ) ) </s>
