<commit_before># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

from __future__ import unicode_literals
import frappe, erpnext

from frappe import _

def get_level():
	activation_level = 0
	if frappe.db.get_single_value('System Settings', 'setup_complete'):
		activation_level = 1

	if frappe.db.count('Item') > 5:
		activation_level += 1

	if frappe.db.count('Customer') > 5:
		activation_level += 1

	if frappe.db.count('Sales Order') > 2:
		activation_level += 1

	if frappe.db.count('Purchase Order') > 2:
		activation_level += 1

	if frappe.db.count('Employee') > 3:
		activation_level += 1

	if frappe.db.count('Lead') > 3:
		activation_level += 1

	if frappe.db.count('Payment Entry') > 2:
		activation_level += 1

	if frappe.db.count('Communication', dict(communication_medium='Email')) > 10:
		activation_level += 1

	if frappe.db.count('User') > 5:
		activation_level += 1

	if frappe.db.count('Student') > 5:
		activation_level += 1

	if frappe.db.count('Instructor') > 5:
		activation_level += 1

	# recent login
	if frappe.db.sql('select name from tabUser where last_login > date_sub(now(), interval 2 day) limit 1'):
		activation_level += 1

	return activation_level

def get_help_messages():
	'''Returns help messages to be shown on Desktop'''
	if get_level() > 6:<commit_msg>feat(sync_site): return more data in level<commit_after># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

from __future__ import unicode_literals
import frappe, erpnext

from frappe import _
from six import iteritems

def get_level():
	activation_level = 0
	sales_data = []
	min_count = 0
	doctypes = {"Item": 5, "Customer": 5, "Sales Order": 2, "Sales Invoice": 2, "Purchase Order": 2, "Employee": 3, "Lead": 3, "Quotation": 3,
					"Payment Entry": 2, "User": 5, "Student": 5, "Instructor": 5, "BOM": 3, "Journal Entry": 3, "Stock Entry": 3}
	for doctype, min_count in iteritems(doctypes):
		count = frappe.db.count(doctype)
		if count > min_count:
			activation_level += 1
		sales_data.append({doctype: count})

	if frappe.db.get_single_value('System Settings', 'setup_complete'):
		activation_level += 1

	communication_number = frappe.db.count('Communication', dict(communication_medium='Email'))
	if communication_number > 10:
		activation_level += 1
	sales_data.append({"Communication": communication_number})

	# recent login
	if frappe.db.sql('select name from tabUser where last_login > date_sub(now(), interval 2 day) limit 1'):
		activation_level += 1

	level = {"activation_level": activation_level, "sales_data": sales_data}

	return level

def get_help_messages():
	'''Returns help messages to be shown on Desktop'''
	if get_level() > 6:
{'fraction_non_alphanumeric': 0.12714285714285714, 'fraction_numerical': 0.023214285714285715, 'mean_word_length': 4.909282700421941, 'pattern_counts': {'":': 18, '<': 3, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6622541', 'n_tokens_mistral': 1055, 'n_tokens_neox': 925, 'n_words': 276}