This file contains 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
from multiprocessing import Process | |
import os | |
import json | |
import requests | |
import sys | |
# API Constants | |
BASE_URL = "https://hacker-news.firebaseio.com/v0/" | |
ITEMS = "item/" | |
USER = "user/" |
This file contains 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 json | |
import time | |
import os | |
from textblob import TextBlob | |
import numpy as np | |
import matplotlib.pyplot as plt | |
PREV = ".." | |
DATA = "data" | |
POSTS = "posts" |
This file contains 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 random, string | |
from multiprocessing import Pool | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.support.wait import WebDriverWait | |
from selenium.common.exceptions import TimeoutException | |
CHROMEDRIVER = "path-to-chromedriver" | |
FORM_URL = "url-to-google-form" |
This file contains 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 | |
import shutil | |
from tqdm import tqdm | |
SRC = "/home/SharedData/intern_sayan/PascalVOC2012/data/VOCdevkit/VOC2012/ImageSets/Main/" | |
IMGS = "/home/SharedData/intern_sayan/PascalVOC2012/data/VOCdevkit/VOC2012/JPEGImages" | |
DEST = "/home/SharedData/intern_sayan/PascalVOC2012_GAN" | |
*_, files = os.walk(SRC) |
This file contains 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
OUTPUT_DIR="./internet_processed" | |
BASE="./Data" | |
IMAGES="images" | |
GROUND_TRUTH="GT" | |
for class_nm in "Airplane100" "Car100" | |
do |
This file contains 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
OUTPUT_DIR="./noisy" | |
mkdir -p $OUTPUT_DIR | |
for img in *.jpg | |
do | |
echo "Processing $img ... \a" | |
magick convert "$img" +noise Gaussian -attenuate 0.3 "$OUTPUT_DIR/$img" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 asyncio | |
import random | |
async def main(ctr): | |
print(f"begin ::- {ctr}") | |
delta = random.random() | |
await asyncio.sleep(delta) | |
print(f"end ::- {ctr}") |
This file contains 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 python3 | |
class Node: | |
def __init__(self, data, children=None): | |
self.data = data | |
self.children = children | |
self.is_expanded = False | |
rules = { |
This file contains 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 python3 | |
class Node: | |
"""abstract base class for Nodes""" | |
def __init__(self): | |
pass | |
def __repr__(self): | |
raise NotImplementedError() |