In your command-line run the following commands:
brew doctorbrew update
| from collections import defaultdict, Counter | |
| from operator import add | |
| from functools import reduce | |
| import numpy as np | |
| from sklearn.cluster import KMeans | |
| def dict_of_list(keys, values): | |
| assert(len(keys) == len(values)) |
| from collections import defaultdict | |
| from functools import reduce, partial | |
| import numpy as np | |
| from itertools import chain | |
| def flatten(l): | |
| return list(chain.from_iterable(l)) |
| "calculate PMI(A,B)=P(A,B)/P(A)P(B) for every token A and B in a window" | |
| from itertools import tee, combinations | |
| from collections import Counter | |
| def count_bigram(sentence, window=5): | |
| # ['A','B','C','D', 'E', 'F', 'G'], 4 -> | |
| # [['A', 'B', 'C', 'D'], | |
| # ['B', 'C', 'D', 'E'], | |
| # ['C', 'D', 'E', 'F'], |
| import requests, re, sys | |
| url = "https://mobile.twitter.com/{}/following" | |
| cursor = "" | |
| usernames = [] | |
| first = True | |
| if len(sys.argv) < 2: | |
| print("Usage: python followers.py <username>") | |
| quit(1) |
In your command-line run the following commands:
brew doctorbrew update| # Copyright (c) 2014-2015 Kyle Gorman <gormanky@ohsu.edu> | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a | |
| # copy of this software and associated documentation files (the | |
| # "Software"), to deal in the Software without restriction, including | |
| # without limitation the rights to use, copy, modify, merge, publish, | |
| # distribute, sublicense, and/or sell copies of the Software, and to | |
| # permit persons to whom the Software is furnished to do so, subject to | |
| # the following conditions: | |
| # |
Update: https://github.com/phracker/MacOSX-SDKs hosts the direct SDK folders already extracted.
Xcode 4.3.3Show Package Content/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs| try: | |
| from xml.etree.cElementTree import XML | |
| except ImportError: | |
| from xml.etree.ElementTree import XML | |
| import zipfile | |
| """ | |
| Module that extract text from MS XML Word document (.docx). | |
| (Inspired by python-docx <https://github.com/mikemaccana/python-docx>) |
| # s|^■||g | |
| # s| : | |g | |
| s|《 .* 》||g | |
| s|{ .* }||g | |
| s|〔 .* 〕||g | |
| s|[ .* ]||g | |
| s|( .* )||g | |
| s|〈 .* 〉||g | |
| s|【 .* 】||g |