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
diff --git mailparser/utils.py mailparser/utils.py | |
index f44139c..797f218 100644 | |
--- mailparser/utils.py | |
+++ mailparser/utils.py | |
@@ -345,7 +345,7 @@ def convert_mail_date(date): | |
log.debug("Date parsed in timestamp: {!r}".format(t)) | |
date_utc = datetime.datetime.utcfromtimestamp(t) | |
timezone = d[9] / 3600 if d[9] else 0 | |
- timezone = "{:+.0f}".format(timezone) | |
+ timezone = "{:+.2f}".format(timezone) |
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 Counter | |
import re | |
import sys | |
cite_re = re.compile(r'\\citation\{(.+)\}', re.MULTILINE) | |
def get_all_cites(aux): | |
""" | |
Retrives all cites from a given aux file. |
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
def read_mctq_data(input_file): | |
""" | |
Read MCTQ data from Qualtrics web survey tool. | |
:param input_file: Path to the CSV file exported from the survey tool | |
:return:: Pandas DataFrame object. | |
""" | |
table = pd.read_csv(input_file, skiprows=[1], | |
usecols=['Q50','Q51', 'Q52_1', 'Q56_1', 'Q58_1', 'Q59_1_TEXT', 'Q60_1', 'Q61', 'Q63_1_TEXT', |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 sklearn | |
from sklearn import tree, metrics, cross_validation | |
from sklearn.feature_extraction.text import CountVectorizer | |
def get_data_from_arxiv(arxiv_data, key): | |
row_doc = [] | |
label = [] | |
for index, (k, v) in enumerate(arxiv_data.iteritems()): | |
for d in v: | |
label.append(index) |
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 -*- | |
""" | |
trigram.py | |
~~~~~~~~~~ | |
Assignment 1 for Info 6010: | |
https://courses.cit.cornell.edu/info6010/assignment1.html | |
""" |
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 gzip | |
def get_gzip_data(filename): | |
"""Read daa from gzip file. | |
param | |
---- | |
filename: Input gzip file. | |
""" | |
with gzip.open(filename, "rb") as 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 numpy as np | |
import sys | |
import matplotlib.pyplot as plt | |
from sklearn import linear_model | |
def read_data_file(filename): | |
"""Reads data file in comma separated format. |
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 github2.client import Github | |
import networkx as nx | |
def build_follower_network(users): | |
follower_list = [] | |
github = Github(requests_per_second=1) | |
for user in users: | |
try: | |
follower_list.append((user, github.users.followers(user))) | |
except RuntimeError: |