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 | |
| import datetime | |
| import sys | |
| sys.path.append("mysite") | |
| from app_folder import create_app | |
| from app_folder.models import YOUR_MODEL | |
| app = create_app() |
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 itertools | |
| import re | |
| import urlparse | |
| import boto | |
| import warc | |
| from boto.s3.key import Key | |
| from gzipstream import GzipStreamFile |
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
| from collections import OrderedDict | |
| from operator import itemgetter | |
| class NameData(object): | |
| def __init__(self, data, name, priority, preprocessor=None): | |
| self.data = self.structure_data(data) | |
| self.name_set = self.generate_set(data) | |
| self.name = name | |
| self.priority = priority |
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
| from gensim.utils import smart_open | |
| from collections import defaultdict, OrderedDict | |
| import csv | |
| import xml.etree.ElementTree as ET | |
| headers = ['AcceptedAnswerId', 'AnswerCount', 'ClosedDate', 'CommentCount', 'CommunityOwnedDate', 'CreationDate', | |
| 'FavoriteCount', 'Id', 'LastActivityDate', 'LastEditDate', 'LastEditorDisplayName', 'LastEditorUserId', | |
| 'OwnerDisplayName', 'OwnerUserId', 'ParentId', 'PostTypeId', 'Score', 'Tags', 'Title', 'ViewCount'] | |
| file_path = "" |
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 math | |
| import numpy as np | |
| import seaborn as sns | |
| import matplotlib.pyplot as plt | |
| sns.set() | |
| def node_type(x): | |
| if isinstance(x, str): | |
| return 2 |
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
| { | |
| "manifest_version": 2, | |
| "name": "LinkedIn Profile Saver", | |
| "version": "1.0.0", | |
| "content_scripts": [{ | |
| "matches": [ | |
| "http://*.linkedin.com/in/*", | |
| "https://*.linkedin.com/in/*", | |
| "http://*.linkedin.com/profile/*", | |
| "https://*.linkedin.com/profile/*" |
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
| from cytoolz import groupby | |
| class WordPair(object): | |
| PREFERRED = 'preferred' | |
| OTHERS = 'others' | |
| def __init__(self, preferred, others): | |
| self.preferred = preferred | |
| if isinstance(others, list): |
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 time | |
| import random | |
| class BackOffDecorator(object): | |
| def __init__(self, max_tries, delay, backoff_rate): | |
| self.max_tries = max_tries | |
| self.tries = 0 | |
| self.delay = delay | |
| self.backoff_rate = backoff_rate |
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 pandas as pd | |
| import os | |
| SPREADSHEET_FOLDER = r"C:\Users" # Which folder are these files located in? | |
| OUTPUT_FILEPATH = r"C:\Users" # Where should it go? | |
| if not os.path.isdir(SPREADSHEET_FOLDER): | |
| raise NotADirectoryError | |
| if '.xls' not in OUTPUT_FILEPATH and '.csv' not in OUTPUT_FILEPATH: | |
| raise Exception("Output path must have ext of .csv, .xls, or .xlsx") |