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 yfinance as yf | |
| import sys | |
| if len(sys.argv) != 2: | |
| raise Exception("please provide ticker") | |
| symbol = sys.argv[1].upper() | |
| ticker = yf.Ticker(symbol) |
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 Stock import Stock | |
| from finsymbols import symbols | |
| import csv | |
| import os | |
| import json | |
| companies = symbols.get_sp500_symbols() | |
| print(len(companies)) |
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 | |
| from sklearn.linear_model import LinearRegression | |
| def exponentialRegression(closing): | |
| x = np.arange(1,len(closing) + 1).reshape((-1, 1)) | |
| y_normalized = np.divide(closing, closing[0]) | |
| y_ln = np.log(y_normalized) | |
| model = LinearRegression() | |
| model.fit(x, y_ln) | |
| scalar = np.exp(model.intercept_) * closing[0] |
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 sys | |
| from regression import exponentialRegression | |
| import matplotlib.pyplot as plt | |
| import time | |
| import requests | |
| import keys | |
| import numpy as np | |
| class Stock: |
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 PIL import Image | |
| import colorsys | |
| import math | |
| import os | |
| #frame parameters | |
| width = 1000 #pixels | |
| x = -0.65 | |
| y = 0 | |
| xRange = 3.4 |
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
| var largeImages = []; | |
| var pixelData; | |
| var mosaic = document.getElementById("mosaic"); | |
| var mosaicCtx; | |
| var width; | |
| $("#generate").click(async function() { | |
| var albumCovers = await getAllAlbumCovers(); | |
| if (albumCovers.length == 0) { | |
| alert("Select at least one playlist to create your mosaic."); |
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
| var stateKey = "spotify_auth_state"; | |
| function getHashParams() { | |
| var hashParams = {}; | |
| var e, | |
| r = /([^&;=]+)=?([^&;]*)/g, | |
| q = window.location.hash.substring(1); | |
| while ((e = r.exec(q))) { | |
| hashParams[e[1]] = decodeURIComponent(e[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
| var express = require("express"); | |
| var app = express(); | |
| app.use(express.static("spotifyMosaic")); //directory of website files | |
| app.listen(8888); | |
| console.log("Listening on port 8888"); |
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 itertools | |
| from src.report import BaseFileReport | |
| from src.utils import dict_verify | |
| # Currently we simply do a shallow parse. | |
| class SnapReport(BaseFileReport): | |
| def __init__(self, path, **kwargs): | |
| # Turn etree elements into snap reports | |
| super(SnapReport, self).__init__(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 re | |
| import logging | |
| from src.utils import UnsupportedFiletypeError | |
| _logger = logging.getLogger('codediff') | |
| class PathValidator: | |
| def validate_dir(self, file_paths): | |
| _logger.warning('This validator does nothing. Use a subclass such as `XmlPathValidator`') |
NewerOlder