def add_random_children(doc, fieldname, rows, randomize, unique=None):
	nrows = rows
	if 1 > rows:
		nrows = random.randrange(1, rows)

	for i in xrange(nrows):
		d = {}
		for key, val in randomize.items():
			if isinstance(val[0], basestring):
				d[key] = get_random(*val)
			else:
				d[key] = random.randrange(*val)

		if unique:
			if not doc.get(fieldname, {unique:d[unique]}):
				doc.append(fieldname, d)
		else:
			doc.append(fieldname, d)
dataset/ETHPy150Open frappe/frappe/frappe/utils/make_random.py/add_random_children/swapped operands of `>`