<commit_before># ##############################################################################
# 							*** SETUP ***
# ##############################################################################
# -----------------------------------
# MayAi bot Version 0.9 By Moz4r
# 
# Wikidatafetcher By Beetlejuice
# -----------------------------------
#Your language ( FR/EN )
lang="EN"
BotURL="http://myai.cloud/bot1.php"
#jokeBOT:
JokeType="RANDOM" # JokeType=RANDOM / BLONDES / CUL / CARAMBAR
#WeatherBOT -> Your city :
CITY="paris"
units="metric" # or : imperial
# ##
#LONK AT http://www.myai.cloud/
#FOR SERVER NAME AND BOT STATUS
#
#IF YOU WANT INMOOV MOUTH CONTROL ( inmoov ) set inmoov=1
#IF YOU DIDNT HAVE MOTORS set inmoov=0 
IsInmoov=0
leftPort = "COM3"
rightPort = "COM4"
jawMin = 55
jawMax = 60
# Ligh if you have
IhaveLights = 0
MASSE=27
ROUGE=29
VERT=28
BLEU=30
# ###
# 
# ##############################################################################
#  						*** END SETUP ***
# ##############################################################################




IdontWant=""

import urllib2
from java.lang import String
import random
import threading
import itertools
import random
import time
import textwrap
import codecs
import socket
import os



BotURL=BotURL+"?lang="+lang+"&FixPhpCache="+str(time.time())


#voice emotions
laugh = [" #LAUGH01# ", " #LAUGH02# ", " #LAUGH03# ", " ", " "]
troat = [" #THROAT01# ", " #THROAT02# ", " #THROAT03# ", " ", " ", " "]
image=Runtime.createAndStart("ImageDisplay", "ImageDisplay")
sleep(1)
Runtime.createAndStart("chatBot", "ProgramAB")
Runtime.createAndStart("ear", "WebkitSpeechRecognition") 
Runtime.createAndStart("webGui", "WebGui")
Runtime.createAndStart("htmlFilter", "HtmlFilter")
wdf=Runtime.createAndStart("wdf", "WikiDataFetcher")





if IsInmoov==0:
	Runtime.createAndStart("mouth", "AcapelaSpeech")
	sleep(2)
else:
	i01 = Runtime.createAndStart("i01", "InMoov")
	right = Runtime.start("i01.right", "Arduino")
	right.setBoard("mega2560")
	right.publishState()
	right.connect(rightPort)
	left = Runtime.start("i01.left", "Arduino")
	left.setBoard("mega2560")
	left.publishState()
	left.connect(leftPort)
	sleep(1)
	i01.startRightHand(rightPort,"atmega2560")
	i01.startHead(leftPort,"atmega2560")
	i01.startMouth()
	mouth = i01.mouth
	i01.startMouthControl(leftPort)
	i01.head.jaw.setMinMax(jawMin,jawMax)
	i01.mouthControl.setmouth(jawMin,jawMax)
	i01.head.jaw.setRest(jawMin)
	i01.setHeadSpeed(0.5, 0.5)
	i01.moveHead(80,86,40,78,76)
	i01.head.jaw.rest()
	i01.head.eyeX.setMinMax(0,180)
	i01.head.eyeY.setMinMax(55,180)
	i01.head.eyeX.setRest(90)
	i01.head.eyeY.setRest(90)
	i01.head.eyeY.rest()
	i01.head.eyeX.rest()

if IhaveLights==1:
	right.pinMode(MASSE, Arduino.OUTPUT)
	right.pinMode(ROUGE, Arduino.OUTPUT)
	right.pinMode(VERT, Arduino.OUTPUT)
	right.pinMode(BLEU, Arduino.OUTPUT)
	
	right.digitalWrite(MASSE,1)
	right.digitalWrite(ROUGE,1)
	right.digitalWrite(VERT,0)
	right.digitalWrite(BLEU,1)	

if lang=="FR":
   NoNo="Je ne comprend pas"
   LANGfind="Je vais faire une recherche sur internet"
   LANGimage="Désolé, Je rencontre un problème pour te montrer cette image"
   voiceType="MargauxSad"
   WikiFile="prop.txt"
   ear.setLanguage("fr-FR")
   wdf.setLanguage("fr")
   wdf.setWebSite("frwiki")
else:
   voiceType="Ryan"
   LANGfind="I do a search on internet"
   LANGimage="There is a problem to show the picture I am so sorry"
   NoNo="I don't understand"
   WikiFile="propEN.txt"
   wdf.setLanguage("en")
   wdf.setWebSite("enwiki")

# on cherche en français
 # On fait des recherches sur le site français de wikidata
sleep(2)
mouth.setVoice(voiceType)
mouth.setLanguage(lang)
ear.addTextListener(chatBot)
chatBot.startSession( "ProgramAB", "default", "rachel") 

def talk(data):
	if IsInmoov==0:
		mouth.speak(unicode(data,'utf-8'))
	else:
		mouth.speakBlocking(unicode(data,'utf-8'))
  	print "chatbot dit :", data<commit_msg>Update MyaiBot.py (#45)<commit_after># ##############################################################################
# 							*** SETUP ***
# ##############################################################################
# -----------------------------------
# MayAi bot Version 0.9 By Moz4r
# 
# Wikidatafetcher By Beetlejuice
# -----------------------------------
#Your language ( FR/EN )
lang="FR"
BotURL="http://myai.cloud/bot1.php"
#jokeBOT:
JokeType="RANDOM" # JokeType=RANDOM / BLONDES / CUL / CARAMBAR
#WeatherBOT -> Your city :
CITY="paris"
units="metric" # or : imperial
# ##
#LONK AT http://www.myai.cloud/
#FOR SERVER NAME AND BOT STATUS
#
#IF YOU WANT INMOOV MOUTH CONTROL ( inmoov ) set inmoov=1
#IF YOU DIDNT HAVE MOTORS set inmoov=0 
IsInmoov=0
leftPort = "COM3"
rightPort = "COM4"
jawMin = 55
jawMax = 60
# Ligh if you have
IhaveLights = 0
MASSE=27
ROUGE=29
VERT=28
BLEU=30
# ###
# 
# ##############################################################################
#  						*** END SETUP ***
# ##############################################################################




IdontWant=""

import urllib2
from java.lang import String
import random
import threading
import itertools
import random
import time
import textwrap
import codecs
import socket
import os



BotURL=BotURL+"?lang="+lang+"&FixPhpCache="+str(time.time())


#voice emotions
laugh = [" #LAUGH01# ", " #LAUGH02# ", " #LAUGH03# ", " ", " "]
troat = [" #THROAT01# ", " #THROAT02# ", " #THROAT03# ", " ", " ", " "]
image=Runtime.createAndStart("ImageDisplay", "ImageDisplay")
sleep(1)
Runtime.createAndStart("chatBot", "ProgramAB")
Runtime.createAndStart("ear", "WebkitSpeechRecognition") 
Runtime.createAndStart("webGui", "WebGui")

wdf=Runtime.createAndStart("wdf", "WikiDataFetcher")





if IsInmoov==0:
	Runtime.createAndStart("mouth", "AcapelaSpeech")
	sleep(2)
else:
	i01 = Runtime.createAndStart("i01", "InMoov")
	right = Runtime.start("i01.right", "Arduino")
	right.setBoard("mega2560")
	right.publishState()
	right.connect(rightPort)
	left = Runtime.start("i01.left", "Arduino")
	left.setBoard("mega2560")
	left.publishState()
	left.connect(leftPort)
	sleep(1)
	i01.startRightHand(rightPort,"atmega2560")
	i01.startHead(leftPort,"atmega2560")
	i01.startMouth()
	mouth = i01.mouth
	i01.startMouthControl(leftPort)
	i01.head.jaw.setMinMax(jawMin,jawMax)
	i01.mouthControl.setmouth(jawMin,jawMax)
	i01.head.jaw.setRest(jawMin)
	i01.setHeadSpeed(0.5, 0.5)
	i01.moveHead(80,86,40,78,76)
	i01.head.jaw.rest()
	i01.head.eyeX.setMinMax(0,180)
	i01.head.eyeY.setMinMax(55,180)
	i01.head.eyeX.setRest(90)
	i01.head.eyeY.setRest(90)
	i01.head.eyeY.rest()
	i01.head.eyeX.rest()
	
Runtime.createAndStart("htmlFilter", "HtmlFilter")

if IhaveLights==1:
	right.pinMode(MASSE, Arduino.OUTPUT)
	right.pinMode(ROUGE, Arduino.OUTPUT)
	right.pinMode(VERT, Arduino.OUTPUT)
	right.pinMode(BLEU, Arduino.OUTPUT)
	
	right.digitalWrite(MASSE,1)
	right.digitalWrite(ROUGE,1)
	right.digitalWrite(VERT,0)
	right.digitalWrite(BLEU,1)	

if lang=="FR":
   NoNo="Je ne comprend pas"
   LANGfind="Je vais faire une recherche sur internet"
   LANGimage="Désolé, Je rencontre un problème pour te montrer cette image"
   voiceType="MargauxSad"
   WikiFile="prop.txt"
   ear.setLanguage("fr-FR")
   wdf.setLanguage("fr")
   wdf.setWebSite("frwiki")
else:
   voiceType="Ryan"
   LANGfind="I do a search on internet"
   LANGimage="There is a problem to show the picture I am so sorry"
   NoNo="I don't understand"
   WikiFile="propEN.txt"
   wdf.setLanguage("en")
   wdf.setWebSite("enwiki")

# on cherche en français
 # On fait des recherches sur le site français de wikidata
sleep(2)
mouth.setVoice(voiceType)
mouth.setLanguage(lang)

chatBot.startSession("default", "rachel")
ear.addTextListener(chatBot)
chatBot.addTextListener(htmlFilter)
htmlFilter.addListener("publishText", python.name, "talk") 

def talk(data):
	if IsInmoov==0:
		mouth.speak(unicode(data,'utf-8'))
	else:
		mouth.speakBlocking(unicode(data,'utf-8'))
  	print "chatbot dit :", data
{'fraction_non_alphanumeric': 0.23388419326352972, 'fraction_numerical': 0.033808502586098146, 'mean_word_length': 5.084420567920184, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3060285', 'n_tokens_mistral': 3182, 'n_tokens_neox': 2921, 'n_words': 535}