Skip to content

Commit 64c0f40

Browse files
committed
fixes
1 parent 9501d8d commit 64c0f40

File tree

2 files changed

+72
-12
lines changed

2 files changed

+72
-12
lines changed

Untitled-1.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python criteo_mlp.py -e 50 -m 100 -n 0 -s 0.001 -c 0.000001 -g 10 -b 1000 -l 1 -u 0 -v 0 -f 1 banditnet_lambda0_train.txt.gz banditnet_lambda0_validation.txt.gz banditnet_lambda0_test.txt.gz > ../exp3/full_e_50_m100_n0_s0.001_c0.000001_g10_b1000_l1.log

client.py

Lines changed: 71 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,56 @@
55
#
66
# This is the main client for git message
77

8+
9+
import subprocess
810
import requests
911
import os
12+
import base64
1013
from bs4 import BeautifulSoup
1114

15+
from contextlib import contextmanager
16+
import sys, os
17+
18+
#Starting Messages
19+
#print(" o8o . ooo ooooo ")
20+
#print(" `' .o8 `88. .888' ")
21+
#print(" .oooooooo oooo .o888oo 888b d'888 .ooooo. .oooo.o .oooo.o .oooo. .oooooooo .ooooo. ")
22+
#print("888' `88b `888 888 8 Y88. .P 888 d88' `88b d88( '8 d88( '8 `P )88b 888' `88b d88' `88b ")
23+
#print("888 888 888 888 8 `888' 888 888ooo888 `'Y88b. `'Y88b. .oP'888 888 888 888ooo888 ")
24+
#print("`88bod8P' 888 888 . 8 Y 888 888 .o o. )88b o. )88b d8( 888 `88bod8P' 888 .o ")
25+
#print("`8oooooo. o888o '888' o8o o888o `Y8bod8P' 8""888P' 8""888P' `Y888""8o `8oooooo.`Y8bod8P' ")
26+
#print("d' YD d' YD ")
27+
#print("'Y88888P' 'Y88888P' ")
28+
os.system("cls")
29+
print("")
30+
print(" ▄████ ██▓▄▄▄█████▓ ███▄ ▄███▓▓█████ ██████ ██████ ▄▄▄ ▄████ ▓█████")
31+
print(" ██▒ ▀█▒▓██▒▓ ██▒ ▓▒▓██▒▀█▀ ██▒▓█ ▀ ▒██ ▒ ▒██ ▒ ▒████▄ ██▒ ▀█▒▓█ ▀ ")
32+
print("▒██░▄▄▄░▒██▒▒ ▓██░ ▒░▓██ ▓██░▒███ ░ ▓██▄ ░ ▓██▄ ▒██ ▀█▄ ▒██░▄▄▄░▒███ ")
33+
print("░▓█ ██▓░██░░ ▓██▓ ░ ▒██ ▒██ ▒▓█ ▄ ▒ ██▒ ▒ ██▒░██▄▄▄▄██ ░▓█ ██▓▒▓█ ▄ ")
34+
print("░▒▓███▀▒░██░ ▒██▒ ░ ▒██▒ ░██▒░▒████▒▒██████▒▒▒██████▒▒ ▓█ ▓██▒░▒▓███▀▒░▒████▒")
35+
print(" ░▒ ▒ ░▓ ▒ ░░ ░ ▒░ ░ ░░░ ▒░ ░▒ ▒▓▒ ▒ ░▒ ▒▓▒ ▒ ░ ▒▒ ▓▒█░ ░▒ ▒ ░░ ▒░ ░")
36+
print(" ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░░ ░▒ ░ ░░ ░▒ ░ ░ ▒ ▒▒ ░ ░ ░ ░ ░ ░")
37+
print("░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ")
38+
print(" ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░")
39+
print("")
40+
print("'I don't want my name on this project' - Henry Samuelson 2019")
41+
print("")
42+
print("Connect to Sever (git repo):")
43+
44+
45+
@contextmanager
46+
def suppress_stdout():
47+
with open(os.devnull, "w") as devnull:
48+
old_stdout = sys.stdout
49+
sys.stdout = devnull
50+
try:
51+
yield
52+
finally:
53+
sys.stdout = old_stdout
54+
55+
56+
57+
1258
noServer = True
1359
client = requests.session()
1460
ServerPath = ""
@@ -24,7 +70,9 @@
2470
noServer = False
2571

2672
#clone repo
27-
command = "git clone" + ServerPath
73+
#with open(os.devnull, 'wb') as devnull:
74+
# subprocess.check_call(['git clone ' + ServerPath], stdout=devnull, stderr=subprocess.STDOUT)
75+
command = "git clone " + ServerPath
2876
os.system(command)
2977

3078
print("Connected To Server")
@@ -34,20 +82,31 @@
3482

3583
messageClient = True
3684
prompt = "(" + REPOPATH + ")>"
37-
chatPath = str(ServerPath + "chat.txt")
38-
85+
os.chdir(REPOPATH.split("/")[1])
86+
url = "https://api.github.com/repos/" + REPOPATH + "/contents/chat.txt"
3987

4088
while messageClient:
41-
client.get(chatPath)
89+
print("chat file")
90+
91+
# load chat file
92+
#print(client.get(chatPath).text)
93+
a = requests.get(url).json()
94+
b = base64.b64decode(a['content'])
95+
c = bytes(str(b), "utf-8").decode("unicode_escape")
96+
os.system("cls")
97+
print(c)
4298
msg = str(input(prompt))
99+
if msg != "":
100+
# save message to chat file
101+
with open("chat.txt", "a") as myfile:
102+
myfile.write(str(msg + " \n"))
43103

44-
# save message to chat file
45-
with open("chat.txt", "a") as myfile:
46-
myfile.write(msg)
47-
48-
#commit message to git
49-
os.system("git pull")
50-
os.system("git commit *")
51-
os.system("git push")
104+
#commit message to git
105+
52106

107+
os.system("git pull ")
108+
os.system("git commit * -m 'msg' ")
109+
os.system("git push")
53110

111+
else:
112+
os.system("git pull")

0 commit comments

Comments
 (0)