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
"""Download animes from jkanime.net. | |
It is necessary to install the following python libraries: | |
- beautifulsoup4 | |
- selenium | |
The last one requires an extra step to work: | |
1. Download the latest Firefox driver from: https://github.com/mozilla/geckodriver/releases | |
2. Put it in a folder that can be found by the system's PATH, | |
i.e. in LINUX it can be: '/usr/bin', '/usr/local/bin' or '/home/your-username/bin'. |
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 | |
import os | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import spotipy | |
from spotipy.oauth2 import SpotifyClientCredentials |
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 inspect | |
def build_extensive_kwargs(fn, *args, **kwargs): | |
function_signature = inspect.signature(fn) | |
extensive_kwargs = function_signature.bind_partial(*args, **kwargs) | |
self = extensive_kwargs.arguments.get('self', None) | |
return ['{}={}'.format(key, val) for key, val in extensive_kwargs.arguments.items() if key != 'self'], self | |
def printing(prefix=None, suffix=None): |
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
""" | |
Simple script designed to compare the output of the same program in two given sitations. | |
Specially useful in the case that you have a working version of the program and it suddently | |
stops working. If you can revert the state back to the working version, save the output to a file then | |
you can use the `compare_files` which look for lines that are found in one of the files but not in the other. | |
This can help to identify functions that are not executed in one of the cases when they should be. | |
Usage | |
----- | |
For a given `cmd` command run |
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 math import sqrt | |
from cycler import cycler | |
def latexify(plt, fract=1., margin_x=0., margin_y=0.): | |
"""Latexify the passed matplotlib instance. | |
Sets the default figure size to follow the golden ratio, the default width in points is the `columnwidth` | |
in LaTeX. Also reduces the line widths, sets other default line colors and most importantly, | |
uses latex font styles. |