<commit_before>#!/usr/bin/env python

from Module import *
import glob
import wave  
import random
import pyaudio

####################################################################
# 
# 
####################################################################
class Plugin(Module):
	def __init__(self):
		Module.__init__(self,'star_wars')
		#self.intent = 'star_wars'
		
		# setup Star Wars
		file = '/Users/kevin/github/soccer2/sounds/star_wars'
		self.star_wars_sounds = glob.glob(file + '/*.wav')
		#print 'files: ',self.star_wars_sounds, len(self.star_wars_sounds)
		self.logger.info('[+] Star Wars loaded %d sound files'%(len(self.star_wars_sounds)))	
	"""
	"""
	def process(self, entity):
		sound = random.choice( self.star_wars_sounds )
		self.playWave( sound )<commit_msg>made star wars into a random tv movie sound thing<commit_after>#!/usr/bin/env python

from Module import *
import glob
import wave  
import random
import pyaudio

####################################################################
# 
# 
####################################################################
class Plugin(Module):
	def __init__(self):
		Module.__init__(self,'tv_movie_sounds')
		#self.intent = 'star_wars'
		
		# setup Star Wars
		#file = '/Users/kevin/github/soccer2/sounds/star_wars'
		#self.star_wars_sounds = glob.glob(file + '/*.wav')
		#print 'files: ',self.star_wars_sounds, len(self.star_wars_sounds)
		#self.logger.info('[+] Star Wars loaded %d sound files'%(len(self.star_wars_sounds)))	
		self.star_wars_sounds = self.loadSounds('star_wars')
		self.venture_bros_sounds = self.loadSounds('venture_brothers')
		self.blues_bros_sounds = self.loadSounds('blues_bros')
		
	def loadSounds(self,type):
		file = '/Users/kevin/github/soccer2/sounds/' + type
		snds = glob.glob(file + '/*.wav')
		self.logger.info('   [>] %s loaded %d sound files'%(type,len(snds)))	
		return snds
		
	"""
	"""
	def process(self, entity):
		print entity
		sound = ''
		
		# venture bros not working??? also, might be a bad wave file
		if entity['contact']['body'] == 'Star Wars':
			sound = random.choice( self.star_wars_sounds )
		elif entity['contact']['body'] == 'Blues Brothers':
			sound = random.choice( self.blues_bros_sounds )
		elif entity['contact']['body'] == 'Brothers':
			sound = random.choice( self.venture_bros_sounds )
			
		if sound != '':
			self.playWave( sound )
{'fraction_non_alphanumeric': 0.24777636594663277, 'fraction_numerical': 0.0012706480304955528, 'mean_word_length': 5.040920716112532, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1650268', 'n_tokens_mistral': 858, 'n_tokens_neox': 782, 'n_words': 158}