@frappe.whitelist()
def validate_link():
	import frappe
	import frappe.utils

	value, options, fetch = frappe.form_dict.get('value'), frappe.form_dict.get('options'), frappe.form_dict.get('fetch')

	# no options, don't validate
	if not options or options=='null' or options=='undefined':
		frappe.response['message'] = 'Ok'
		return

	valid_value = frappe.db.sql("select name from `tab%s` where name=%s" % (frappe.db.escape(options),
		'%s'), (value,))

	if valid_value:
		valid_value = valid_value[0][0]

		# get fetch values
		if fetch:
			# escape with "`"
			fetch = ", ".join(("`{0}`".format(frappe.db.escape(f.strip())) for f in fetch.split(",")))

			frappe.response['fetch_values'] = [frappe.utils.parse_val(c) \
				for c in frappe.db.sql("select %s from `tab%s` where name=%s" \
					% (fetch, frappe.db.escape(options), '%s'), (value,))[0]]

		frappe.response['valid_value'] = valid_value
		frappe.response['message'] = 'Ok'
This method generates all the positive roots of
dataset/ETHPy150Open frappe/frappe/frappe/desk/form/utils.py/validate_link--crossover with--dataset/ETHPy150Open sympy/sympy/sympy/liealgebras/type_a.py/TypeA.positive_roots