This file contains 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
def remove_param_from_uri(uri, param): | |
if override_link_type: | |
o = urlparse(uri) | |
query = {x.split('=')[0]: x.split('=')[1] for x in o.query.split('&')} | |
_is_lt = False | |
for x in query: | |
if x.lower() == param: | |
_is_lt = True | |
break | |
if _is_lt: |
This file contains 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 math | |
def is_prime(n): | |
if n in (1, 2): | |
return True | |
for x in range(2, math.ceil(n**0.5) + 1): | |
if n % x == 0: | |
return False | |
return True |
This file contains 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
def r(n, s=0): | |
if n < 10: | |
return n, n, s | |
s += 1 | |
j = str(n) | |
k = 1 | |
for l in j: | |
k *= int(l) | |
if k > 9: | |
m = r(k, s) |
This file contains 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 bcrypt | |
from cryptography.hazmat.primitives.asymmetric import padding | |
from cryptography.hazmat.primitives.asymmetric import rsa | |
from cryptography.hazmat.backends import default_backend | |
from cryptography.hazmat.primitives import hashes | |
from cryptography.hazmat.primitives import serialization | |
from cryptography.hazmat.primitives.asymmetric import utils | |
class settings(object): | |
SECURE_STORE = { |
This file contains 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 | |
def arb(n, A, B): | |
return ((sqrt(5) + 1) / 2) ** n * ((3 * sqrt(5) - 5) * A + (5 - sqrt(5)) * B) / 10 | |
def gen(l, A, B): | |
return [(n, int(round(arb(n, A, B)))) for n in range(l)] | |
def pprint(l, A, B): | |
for each in gen(l, A, B): |