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/local/bin/python | |
| import csv | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| from sklearn import linear_model | |
| from sklearn.preprocessing import PolynomialFeatures | |
| def get_data(fname): | |
| with open(fname) 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 httplib2 | |
| import os | |
| from pprint import pprint | |
| from apiclient import discovery | |
| import oauth2client | |
| from oauth2client import client | |
| from oauth2client import tools | |
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 apiclient.discovery import build | |
| from oauth2client.client import SignedJwtAssertionCredentials | |
| import json | |
| import base64 | |
| import httplib2 | |
| def authorize(ga_email, ga_secret): | |
| jwt = SignedJwtAssertionCredentials(ga_email, ga_secret, scope=self.ga_scope, private_key_password='notasecret') | |
| http = jwt.authorize(httplib2.Http()) | |
| return build('analytics', 'v3', http=http) # failure happens here for JSON key file |
NewerOlder