<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> import numbers <EOL> def check_random_state ( seed ) : <EOL> """<STR_LIT>""" <EOL> if seed is None or seed is np . random : <EOL> return np . random . mtrand . _rand <EOL> if isinstance ( seed , ( numbers . Integral , np . integer ) ) : <EOL> return np . random . RandomState ( seed ) <EOL> if isinstance ( seed , np . random . RandomState ) : <EOL> return seed <EOL> raise ValueError ( '<STR_LIT>' <EOL> '<STR_LIT>' % seed ) </s>
