<commit_before>package condense

import grails.transaction.Transactional

@Transactional
class PricingBookService {

    def importPricingBook(Date inEffectFrom, String csvFileContent) {
		print "asdasd"
		def newPricingBook = new PricingBook(fromDate: inEffectFrom)//.save()
		
		def allCategories = Category.list()
		def allSubCategories = Subcategory.list()
		def allRegions = Region.list()
		def allProducts = Product.list()
		print allProducts
		def firstRowSkipped = false;
		csvFileContent.eachCsvLine { tokens ->
			if (firstRowSkipped) {
				def newCategory = new Category(name: tokens[1])
				if (!allCategories.contains(newCategory)) {
					newCategory.save()
					allCategories << newCategory
				}
				def newSubcategory = new Subcategory(name: tokens[2])
				if(!allSubCategories.contains(newSubcategory)) {
					newSubcategory.save()
					allSubCategories << newSubcategory
				}
				tokens[3] = tokens[3].isEmpty() ? "Unspecified region" : tokens[3]
				def newRegion = new Region(name: tokens[3])
				if (!allRegions.contains(newRegion)) {
					newRegion.save()
					allRegions << newRegion
				}
				
				def newProduct = new Product(name: tokens[4], guid: tokens[5])
				
				if (!allProducts.contains(newProduct)) {
					
					def newProductCategory = allCategories.find { it.name == tokens[1]}
					def newProductSubcategory = allSubCategories.find { it.name == tokens[2]}
					def newProductRegion = allRegions.find { it.name == tokens[3]}
					
					newProduct.category = newProductCategory
					newProduct.subcategory = newProductSubcategory
					newProduct.region = newProductRegion
					
					newProduct.save()
					allProducts << newProduct
				}
				
				def tierProduct = allProducts.find { it.guid ==  tokens[5]}
				def newTier = new TierDefinition(includedQuantity: tokens[7],
					startQuantity: tokens[8], price: tokens[23], product: tierProduct)
				newPricingBook.addToTierDefinitions(newTier)
			}
			firstRowSkipped = true
		}
		
		newPricingBook.save flush:true
		
		
		print Category.count()
		print Subcategory.count()
		print Region.count()
		print Product.count()<commit_msg>Removing some print statements out of the PricingBookService<commit_after>package condense

import grails.transaction.Transactional

@Transactional
class PricingBookService {

    def importPricingBook(Date inEffectFrom, String csvFileContent) {
		def newPricingBook = new PricingBook(fromDate: inEffectFrom)//.save()
		
		def allCategories = Category.list()
		def allSubCategories = Subcategory.list()
		def allRegions = Region.list()
		def allProducts = Product.list()
		print allProducts
		def firstRowSkipped = false;
		csvFileContent.eachCsvLine { tokens ->
			if (firstRowSkipped) {
				def newCategory = new Category(name: tokens[1])
				if (!allCategories.contains(newCategory)) {
					newCategory.save()
					allCategories << newCategory
				}
				def newSubcategory = new Subcategory(name: tokens[2])
				if(!allSubCategories.contains(newSubcategory)) {
					newSubcategory.save()
					allSubCategories << newSubcategory
				}
				tokens[3] = tokens[3].isEmpty() ? "Unspecified region" : tokens[3]
				def newRegion = new Region(name: tokens[3])
				if (!allRegions.contains(newRegion)) {
					newRegion.save()
					allRegions << newRegion
				}
				
				def newProduct = new Product(name: tokens[4], guid: tokens[5])
				
				if (!allProducts.contains(newProduct)) {
					
					def newProductCategory = allCategories.find { it.name == tokens[1]}
					def newProductSubcategory = allSubCategories.find { it.name == tokens[2]}
					def newProductRegion = allRegions.find { it.name == tokens[3]}
					
					newProduct.category = newProductCategory
					newProduct.subcategory = newProductSubcategory
					newProduct.region = newProductRegion
					
					newProduct.save()
					allProducts << newProduct
				}
				
				def tierProduct = allProducts.find { it.guid ==  tokens[5]}
				def newTier = new TierDefinition(includedQuantity: tokens[7],
					startQuantity: tokens[8], price: tokens[23], product: tierProduct)
				newPricingBook.addToTierDefinitions(newTier)
			}
			firstRowSkipped = true
		}
		
		newPricingBook.save flush:true
		
{'fraction_non_alphanumeric': 0.10184962767235167, 'fraction_numerical': 0.007686764352630314, 'mean_word_length': 3.705084745762712, 'pattern_counts': {'":': 0, '<': 19, '<?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': '2764104', 'n_tokens_mistral': 1588, 'n_tokens_neox': 1225, 'n_words': 268}