<commit_before>import fabric.api

from fab_deploy.package import package_install, package_add_repository

def _nodejs_nodejs():
	with fabric.api.settings(fabric.api.hide('running','stdout','stderr'), warn_only=True):
		output = fabric.api.run('dpkg-query --show nodejs')
	return output.succeeded

def nodejs_install():
	""" Install nodejs. """
	if _nodejs_nodejs():
		fabric.api.warn(fabric.colors.yellow('nodejs is already installed'))
		return
	package_add_repository('ppa:chris-lea/node.js')
	package_install(['python-software-properties', 'nodejs'])
	fabric.api.sudo('curl http://npmjs.org/install.sh | sudo sh')
	fabric.api.sudo('npm install socket.io redis')

def nodejs_setup():
	""" Setup nodejs."""
	pass

def nodejs_start():
	""" Start nodejs."""
	pass


<commit_msg>Closes #2. npm packages cannot be installed anymore with sudo, they have be installed by the same node project<commit_after>import fabric.api

from fab_deploy.package import package_install, package_add_repository

def _nodejs_nodejs():
	with fabric.api.settings(fabric.api.hide('running','stdout','stderr'), warn_only=True):
		output = fabric.api.run('dpkg-query --show nodejs')
	return output.succeeded

def nodejs_install():
	""" Install nodejs. """
	if _nodejs_nodejs():
		fabric.api.warn(fabric.colors.yellow('nodejs is already installed'))
		return
	package_add_repository('ppa:chris-lea/node.js')
	package_install(['python-software-properties', 'nodejs'])
	fabric.api.sudo('curl http://npmjs.org/install.sh | sudo sh')

def nodejs_setup():
	""" Setup nodejs."""
	pass

def nodejs_start():
	""" Start nodejs."""
	pass



{'fraction_non_alphanumeric': 0.14847161572052403, 'fraction_numerical': 0.0006238303181534623, 'mean_word_length': 5.628099173553719, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5412967', 'n_tokens_mistral': 558, 'n_tokens_neox': 513, 'n_words': 115}