<commit_before>
from nintendo.nex import common
import requests

import logging
logger = logging.getLogger(__name__)


class PersistenceTarget(common.Structure):
	def __init__(self, owner_id, persistence_id):
		self.owner_id = owner_id
		self.persistence_id = persistence_id
	
	def streamin(self, stream):
		stream.u32(self.owner_id)
		stream.u16(self.persistence_id)

	
class DataStorePermission(common.Structure):
	def streamout(self, stream):
		self.permission = stream.u8()
		self.recipients = stream.list(stream.u32)
		
	
class DataStoreRatingInfo(common.Structure):
	def streamout(self, stream):
		self.total_value = stream.s64()
		self.count = stream.u32()
		self.initial_value = stream.s64()
	

class DataStoreRatingInfoWithSlot(common.Structure):
	def streamout(self, stream):
		self.slot = stream.u8()
		self.rating_info = stream.extract(DataStoreRatingInfo)
	
	
class DataStoreGetMetaParam(common.Structure):
	def __init__(self, data_id, persistence_target, result_option, access_password):
		self.data_id = data_id
		self.persistence_target = persistence_target
		self.result_option = result_option
		self.access_password = <PASSWORD>_password
		
	def streamin(self, stream):
		stream.u64(self.data_id)
		stream.add(self.persistence_target)
		stream.u8(self.result_option)
		stream.u64(self.access_password)
		
		
class DataStoreMetaInfo(common.Structure):
	def streamout(self, stream):
		self.data_id = stream.u64()
		self.owner_id = stream.u32()
		self.size = stream.u32()
		self.name = stream.string()
		self.data_type = stream.u16()
		self.meta_binary = stream.qbuffer()
		self.permission = stream.extract(DataStorePermission)
		self.delete_permission = stream.extract(DataStorePermission)
		self.create_time = stream.datetime()
		self.update_time = stream.datetime()
		self.period = stream.u16()
		self.status = stream.u8()
		self.referred_count = stream.u32()
		self.refer_data_id = stream.u32()
		self.flag = stream.u32()
		self.referred_time = stream.datetime()
		self.expire_time = stream.datetime()
		self.tags = stream.list(stream.string)
		self.ratings = stream.list(lambda: stream.extract(DataStoreRatingInfoWithSlot))

<commit_msg>Fix datastore integer sizes for switch<commit_after>
from nintendo.nex import common
import requests

import logging
logger = logging.getLogger(__name__)


class PersistenceTarget(common.Structure):
	def __init__(self, owner_id, persistence_id):
		self.owner_id = owner_id
		self.persistence_id = persistence_id
	
	def streamin(self, stream):
		stream.uint(self.owner_id)
		stream.u16(self.persistence_id)

	
class DataStorePermission(common.Structure):
	def streamout(self, stream):
		self.permission = stream.u8()
		self.recipients = stream.list(stream.u32)
		
	
class DataStoreRatingInfo(common.Structure):
	def streamout(self, stream):
		self.total_value = stream.s64()
		self.count = stream.u32()
		self.initial_value = stream.s64()
	

class DataStoreRatingInfoWithSlot(common.Structure):
	def streamout(self, stream):
		self.slot = stream.u8()
		self.rating_info = stream.extract(DataStoreRatingInfo)
	
	
class DataStoreGetMetaParam(common.Structure):
	def __init__(self, data_id, persistence_target, result_option, access_password):
		self.data_id = data_id
		self.persistence_target = persistence_target
		self.result_option = result_option
		self.access_password = <PASSWORD>
		
	def streamin(self, stream):
		stream.u64(self.data_id)
		stream.add(self.persistence_target)
		stream.u8(self.result_option)
		stream.u64(self.access_password)
		
		
class DataStoreMetaInfo(common.Structure):
	def streamout(self, stream):
		self.data_id = stream.u64()
		self.owner_id = stream.uint()
		self.size = stream.u32()
		self.name = stream.string()
		self.data_type = stream.u16()
		self.meta_binary = stream.qbuffer()
		self.permission = stream.extract(DataStorePermission)
		self.delete_permission = stream.extract(DataStorePermission)
		self.create_time = stream.datetime()
		self.update_time = stream.datetime()
		self.period = stream.u16()
		self.status = stream.u8()
		self.referred_count = stream.u32()
		self.refer_data_id = stream.u32()
		self.flag = stream.u32()
		self.referred_time = stream.datetime()
		self.expire_time = stream.datetime()
		self.tags = stream.list(stream.string)
		self.ratings = stream.list(lambda: stream.extract(DataStoreRatingInfoWithSlot))


{'fraction_non_alphanumeric': 0.11172668513388735, 'fraction_numerical': 0.01569713758079409, 'mean_word_length': 5.137393767705382, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6242225', 'n_tokens_mistral': 1570, 'n_tokens_neox': 1416, 'n_words': 249}