def guess_n_streams(size, warn=False):
 if (isinstance(size, (tuple, list)) and all([isinstance(i, integer_types) for i in size])):
  r = 1
  for s in size:
   r *= s
  if (r > 6):
   r = (r // 6)
  return min(r, (60 * 256))
 else:
  if warn:
   warnings.warn(("MRG_RandomStreams Can't determine #streams from size (%s), guessing 60*256" % str(size)), stacklevel=3)
  return (60 * 256)

def guess_n_streams ( size , warn = False ) : if ( isinstance ( size , ( tuple , list ) ) and all ( [ isinstance ( i , integer_types ) for i in size ] ) ) : r = 1 for s in size : r *= s if ( r > 6 ) : r = ( r // 6 ) return min ( r , ( 60 * 256 ) ) else : if warn : warnings . warn ( ( "MRG_RandomStreams Can't determine #streams from size (%s), guessing 60*256" % str ( size ) ) , stacklevel = 3 ) return ( 60 * 256 )
return a guess at a good number of streams .