This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- encoding: utf-8 | |
''' | |
_____.___._______________ __.____ __________ _________ ___ ___ _____ .___ | |
\__ | |\_ _____/ |/ _| | \ \ \_ ___ \ / | \ / _ \ | | | |
/ | | | __)_| < | | / | \ / \ \// ~ \/ /_\ \| | | |
\____ | | \ | \| | / | \ \ \___\ Y / | \ | | |
/ ______|/_______ /____|__ \______/\____|__ / \______ /\___|_ /\____|__ /___| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
""" | |
_____.___._______________ __.____ __________ _________ ___ ___ _____ .___ | |
\__ | |\_ _____/ |/ _| | \ \ \_ ___ \ / | \ / _ \ | | | |
/ | | | __)_| < | | / | \ / \ \// ~ \/ /_\ \| | | |
\____ | | \ | \| | / | \ \ \___\ Y / | \ | | |
/ ______|/_______ /____|__ \______/\____|__ / \______ /\___|_ /\____|__ /___| | |
\/ \/ \/ \/ \/ \/ \/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/afs/inf.ed.ac.uk/user/s17/s1718204/miniconda3/envs/mtenv/bin/python3.4 /afs/inf.ed.ac.uk/user/s17/s1718204/PycharmProjects/MT_2/INFR11062/nmt_translate.py | |
Japanese English dataset configuration | |
vocab size, en=3713, fr=3949 | |
-------------------------------------------------- | |
Training progress will be logged in: | |
model/train_10000sen_2-3layers_100units_ja_en_exp1_NO_ATTN.log | |
-------------------------------------------------- | |
Trained model will be saved as: | |
model/seq2seq_10000sen_2-3layers_100units_ja_en_exp1_NO_ATTN.model | |
-------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/afs/inf.ed.ac.uk/user/s17/s1718204/miniconda3/envs/mtenv/bin/python3.4 /afs/inf.ed.ac.uk/user/s17/s1718204/PycharmProjects/MT/MT/nmt_translate.py | |
Japanese English dataset configuration | |
vocab size, en=3713, fr=3949 | |
-------------------------------------------------- | |
Training progress will be logged in: | |
model/train_10000sen_2-3layers_100units_ja_en_exp1_NO_ATTN.log | |
-------------------------------------------------- | |
Trained model will be saved as: | |
model/seq2seq_10000sen_2-3layers_100units_ja_en_exp1_NO_ATTN.model | |
-------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8 -*- | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
import time | |
def sd_login_and_search(entry_url, username, password ): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: utf-8 -*- | |
import os | |
#de-repeat and return a non-repeated list | |
def de_repeat(filename): | |
li=[] | |
if os.path.isfile(filename): | |
try: | |
with open(filename) as f: | |
for line in f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def de_repeat(filename): | |
li=[] | |
if os.path.isfile(filename): | |
try: | |
with open(filename) as f: | |
for line in f: | |
l=line.lstrip() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
#count line number of a file | |
def count_txt_line(filename): | |
try: | |
with open(filename) as f: | |
count=len(f.readlines()) | |
except IOError as e: | |
print e | |
return count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2,os | |
from bs4 import BeautifulSoup | |
import requests | |
def download_img(url): | |
headers={ | |
'Cookie':'_yasi_website_session=NE5pZU1zdEwySVlzUzRaOVl3eUNTTitQNE05eTcwdjUvNHBXbUJiNGt6QVVpOEV1UTlhMWR6aGZKVzlYVm10VTdWd2ZKOUtDTVhLeEIrOEd3ZUlocWhtLzcyb05TaHp1dVlCak11bW5wby9aWVBQSzZvNCtraHZ6ZGkzRTI4cUxtbTN5cXpqWlp2dXNVRytTZDhXRUU1QkhFSFpWTjdkNmY3UlpOZkw4VUdGb2lmVnJoUTBxa0RSV3ZlWHBjbGY4bUF6TzdwZVVyNnZKSUdvNklFbkkzYXAvdFl3TGNTUFluYWtsUEEzWjZRbExwZ3FORXV1QnNOYlpNVzRWNmpIUDdJR2tjUTVxVG9xTGdUZVhOWVBpdklDUXRhamNqOEJzWlAzblJkUDVsMThieDdueTEwbHhhMHNGcUo2dnBHREhVcm9mcld5OU9EOG03MTlMUG9FWXp3PT0tLXVJTHVvcmVrSk9VendEOVBtaGxKWGc9PQ%3D%3D--9462f8c529da941685976ccf6235f2bceda22298; CNZZDATA1260900061=1970134767-1488189272-%7C1488194905', | |
'Host':'ieltsbro.com', | |
'If-Modified-Since':'Mon, 09 Jan 2017 10:00:42 GMT', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
paperDir="C:\\Users\\%yourPCname%\\AppData\\Local\Packages\\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\\LocalState\\Assets\\" | |
desPath='C:\\Users\\%yourPCname%\\Pictures\\' | |
if not os.path.exists(desPath): | |
os.mkdir(desPath) | |
os.system('cp -r '+paperDir+' '+desPath) | |
countAll=0 |