def install(h, pip, groups, save, save_dev, packages):
    """Install a pip or bower package."""
    if groups:
        groups = [text_type.strip(group) for group in groups.split(",")]
    else:
        groups = h.requirements.keys()

    if not packages:
        for group in groups:
            if group not in h.requirements:
                warning("{} not in requirements".format(group))
                continue
            install = (h.install_bower if group.startswith("bower")
                       else h.install_pip)
            for requirement in h.requirements[group]:
                install(str(requirement), save=False, save_dev=False)
    if pip:
        for package in packages:
            h.install_pip(package, save=save, save_dev=save_dev)
    else:
        for package in packages:
            h.install_bower(package, save=save, save_dev=save_dev)
def get_list(arg=None):
	"""get list of messages"""
	frappe.form_dict['limit_start'] = int(frappe.form_dict['limit_start'])
	frappe.form_dict['limit_page_length'] = int(frappe.form_dict['limit_page_length'])
	frappe.form_dict['user'] = frappe.session['user']

	# set all messages as read
	frappe.db.begin()
	frappe.db.sql("""UPDATE `tabCommunication` set seen = 1
		where
			communication_type in ('Chat', 'Notification')
			and reference_doctype = 'User'
			and reference_name = %s""", frappe.session.user)

	delete_notification_count_for("Messages")

	frappe.local.flags.commit = True

	if frappe.form_dict['contact'] == frappe.session['user']:
		# return messages
		return frappe.db.sql("""select * from `tabCommunication`
			where
				communication_type in ('Chat', 'Notification')
				and reference_doctype ='User'
				and (owner=%(contact)s
					or reference_name=%(user)s
					or owner=reference_name)
			order by creation desc
			limit %(limit_start)s, %(limit_page_length)s""", frappe.local.form_dict, as_dict=1)
	else:
		return frappe.db.sql("""select * from `tabCommunication`
			where
				communication_type in ('Chat', 'Notification')
				and reference_doctype ='User'
				and ((owner=%(contact)s and reference_name=%(user)s)
					or (owner=%(contact)s and reference_name=%(contact)s))
			order by creation desc
			limit %(limit_start)s, %(limit_page_length)s""", frappe.local.form_dict, as_dict=1)