Skip to content

Instantly share code, notes, and snippets.

View monk1337's full-sized avatar
🌱
It's a long hard fight / But I'll always live for tomorrow.

Monk (looking for PhD Fall’24) monk1337

🌱
It's a long hard fight / But I'll always live for tomorrow.
View GitHub Profile
my_dict = {
'name1': 'abc', 'job1': 'xyz', 'pos1': 'tak', 'phone1': 12345,
'name2': 'pqr', 'job2': 'ftr', 'pos2': 'lkj', 'phone2': 27654,
'name3': 'swq', 'job3': 'nme', 'pos3': 'mnb', 'phone3': 98421,
'bad': 'bad_data',
}
group_dict=dict()
for key,value in my_dict.items():
if key[-1] not in group_dict:
group_dict[key[-1]]=[(key,value)]
a=[(2010,2),(2009,4),(1989,8),(2009,7)]
new_dict={}
for i in a:
if i[0] not in new_dict:
new_dict[i[0]]=[i[1]]
else:
try:
original = 'Has two optional arguments which must be specified.'
strings = [{'index': 3, 'string': 'foo'}, {'index': 7, 'string':
'bar'}, {'index': 12, 'string': 'abc'}]
meta_data=[(i['index'],i['string']) for i in strings]
track={}
for i,j in enumerate(original):
track[i]=j
import socket
import threading
from newsapi.articles import Articles
import pickle
import sys
options = ['news', 'jokes', 'life_style']
a=Articles('cff9541f3b5a4558957e63ea59b3743b')
class ThreadedServer(object):
import tensorflow as tf
import numpy as np
from tensorflow.contrib import rnn
word_embedding_dim=250
hidden_dim=270
import hashlib
import csv
import csv
import random
from pymongo import MongoClient
data_base={}
with open('data.csv','r') as f:
def get_last_sunday():
from datetime import date
from dateutil.relativedelta import relativedelta, SU
today = date.today()
last_monday = today + relativedelta(weekday=SU(-1))
return last_monday.strftime("%Y-%m-%d")
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@monk1337
monk1337 / net.py
Created May 8, 2018 16:14 — forked from suriyadeepan/net.py
Sentiment Classification on Movie Reviews
import tensorflow as tf
import numpy as np
DropoutWrapper = tf.nn.rnn_cell.DropoutWrapper
class SentimentNetwork(object):
def __init__(self, hdim=25, wdim=25, pdim=25, vocab_size=2000, pos_vocab_size=30,