def make_rng(rng_or_seed=None, default_seed=None, which_method=None, constructor=None):
 if isinstance(which_method, six.string_types):
  which_method = [which_method]
 if ((rng_or_seed is not None) and all((hasattr(rng_or_seed, attr) for attr in which_method))):
  rng = rng_or_seed
 elif (rng_or_seed is not None):
  rng = constructor(rng_or_seed)
 elif (default_seed is not None):
  rng = constructor(default_seed)
 else:
  rng = constructor(42)
 return rng

def make_rng ( rng_or_seed = None , default_seed = None , which_method = None , constructor = None ) : if isinstance ( which_method , six . string_types ) : which_method = [ which_method ] if ( ( rng_or_seed is not None ) and all ( ( hasattr ( rng_or_seed , attr ) for attr in which_method ) ) ) : rng = rng_or_seed elif ( rng_or_seed is not None ) : rng = constructor ( rng_or_seed ) elif ( default_seed is not None ) : rng = constructor ( default_seed ) else : rng = constructor ( 42 ) return rng
returns a rng object .