<commit_before>import logging, os
from pyven.exception import PyvenException

logger = logging.getLogger('global')

class Item(object):

	def __init__(self, node):
		self.company = node.get('company')
		if self.company is None:
			raise PyvenException('Missing artifact or package company')
		self.name = node.get('name')
		if self.name is None:
			raise PyvenException('Missing artifact or package name')
		self.config = node.get('config')
		if self.config is None:
			raise PyvenException('Missing artifact or package config')
		self.version = node.get('version')
		if self.version is None:
			raise PyvenException('Missing artifact or package version')
		self.repo = node.get('repo')
		self.to_retrieve = self.repo is not None
	
	def format_name(self, separator=':'):
		if os.name == 'nt':
			platform = 'windows'
		elif os.name == 'posix':
			platform = 'linux'
		else:
			raise PyvenException('Unsupported platform')
		return platform + separator + self.company + separator + self.name + separator + self.config + separator + self.version
	
	def type(self):
		raise NotImplementedError
	
	def basename(self):
		raise NotImplementedError
	
	def item_specific_location(self):
		return os.path.join(self.company, self.name, self.config, self.version)
	
	def repo_location(self, repo):
		return os.path.join(repo, self.type() + 's')

	def location(self, repo):
		return os.path.join(self.repo_location(repo), self.item_specific_location())<commit_msg>fix (platform) : implicit platform information in name resolution<commit_after>import logging, os
from pyven.exception import PyvenException

logger = logging.getLogger('global')

class Item(object):
	if os.name == 'nt':
		PLATFORM = 'windows'
	elif os.name == 'posix':
		PLATFORM = 'linux'
	else:
		raise PyvenException('Unsupported platform')
	
	def __init__(self, node):
		self.company = node.get('company')
		if self.company is None:
			raise PyvenException('Missing artifact or package company')
		self.name = node.get('name')
		if self.name is None:
			raise PyvenException('Missing artifact or package name')
		self.config = node.get('config')
		if self.config is None:
			raise PyvenException('Missing artifact or package config')
		self.version = node.get('version')
		if self.version is None:
			raise PyvenException('Missing artifact or package version')
		self.repo = node.get('repo')
		self.to_retrieve = self.repo is not None
	
	def format_name(self, separator=':'):
		return self.company + separator + self.name + separator + self.config + separator + self.version
	
	def type(self):
		raise NotImplementedError
	
	def basename(self):
		raise NotImplementedError
	
	def item_specific_location(self):
		return os.path.join(Item.PLATFORM, self.company, self.name, self.config, self.version)
	
	def repo_location(self, repo):
		return os.path.join(repo, self.type() + 's')

	def location(self, repo):
		return os.path.join(self.repo_location(repo), self.item_specific_location())
{'fraction_non_alphanumeric': 0.11858647638464152, 'fraction_numerical': 0.0, 'mean_word_length': 4.639846743295019, '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': '6397258', 'n_tokens_mistral': 985, 'n_tokens_neox': 884, 'n_words': 253}