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 pandas as pd | |
import numpy as np | |
def calc_income_tax(income): | |
"""income tax calculation in lacs, under new regime | |
all numbers are in lacs (100_000), and percentages | |
see https://www.incometax.gov.in/iec/foportal/help/individual/return-applicable-1 | |
""" | |
if income > 15: |
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 selenium import webdriver | |
from seleniumwire import webdriver | |
from selenium.webdriver.common.action_chains import ActionChains | |
from selenium.webdriver.chrome.options import Options | |
import time | |
import os | |
import calendar | |
import traceback | |
import json |
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 github import Github | |
g = Github('your-github-login', 'your-github-token-XXXX') | |
if __name__ == '__main__': | |
for repo in g.get_user().get_repos(): | |
print(repo.name) |
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 tabulate | |
def calc_indian_tds(salary): | |
if salary < 2.5e5: | |
tds = 0 | |
elif salary < 5e5: | |
tds = salary * 0.05 | |
elif salary < 1e6: | |
tds = (salary - 5e5) * 0.20 + 5e5 * 0.05 |
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
"""This module provides tools to clone github repos. The GithubOrgCloner | |
can clone an entire org worth of codebases and create a local corpus of projects. | |
""" | |
import git | |
import shutil | |
import traceback | |
import urllib.parse | |
from argparse import ArgumentParser | |
from functools import partial |
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
#!/bin/bash | |
# Dependencies: | |
# ripgrep https://github.com/BurntSushi/ripgrep#installation | |
# realpath from GNU coreutils | |
# pip3 install pylint isort dewildcard | |
# Usage: ./fix-python-wild-card-imports.sh "path/to/python/source/to/fix/" | |
# set -x # uncomment this line to see all commands |
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 tokenize, collections, pathlib, pprint | |
counter = collections.Counter() | |
source_path = pathlib.Path('.') | |
for filename in source_path.glob('**/*.py'): | |
print(f'Scanning tokens {filename} ...') | |
tokens = tokenize.tokenize(open(filename, 'rb').__next__) | |
for token in tokens: | |
if token.type == 1 or token.type == '3' and ' ' not in token.string: |
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 stringcase, tokenize, pathlib, tqdm, os | |
os.system("mkdir -p converted/src/") | |
os.system("rm -rf converted/src/*") | |
os.system("cp -r src/* converted/src/") | |
IGNORE = {'dictConfig', 'Box'} | |
keywords = set() | |
source_path = pathlib.Path('converted/src/') |
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
#pragma once | |
// @generated from tools/autograd/templates/VariableType.h | |
#include <ATen/ATen.h> | |
#include <cstdint> // for size_t | |
#include <functional> // for function | |
#include <memory> // for unique_ptr | |
#include <string> |
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
clear ; close all; clc | |
% Specify the architecture | |
input_layer_size = 900; % 30x30 Input Images of Digits | |
hidden_layer_size = 300; % 300 hidden units | |
num_labels = 92; | |
% set maximum number of training iteration as you please | |
% larger MaxIter results in better accuracy | |
options = optimset('MaxIter', 10); | |
lambda = 1; % learning rate for regularization |
NewerOlder