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 os | |
from typing import Optional, Any | |
def get_env_var(var_name: str) -> Optional[str]: | |
return os.environ.get(var_name) | |
def env_prop(fn=None, name=None): | |
def env_prop_decorator(func): |
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
https://m.do.co/c/4b585b1b69c8 |
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 magic_sum_of_two(number_list, magic_number): | |
print("We should find pair of numbers to sum a magic one") | |
print("For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17.") | |
print(f"Number list: {number_list}") | |
print(f"Magic number: {magic_number}") | |
for idx, val in enumerate(number_list): | |
temp_n = magic_number - val | |
if temp_n in number_list: | |
print(f"The answer is {temp_n} {val}") |
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 numpy as np | |
import pyautogui | |
import cv2 | |
import datetime | |
import time | |
import os | |
p = os.path.dirname(os.path.abspath(__file__)) | |
p = p + '/screens/' | |
ts = time.time() |
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 copy | |
def checking_grid(): | |
N = int(input()) | |
L, iL, answer = [], [], '' | |
for i in range(N): | |
L.append(list(input())) | |
for idx,item in enumerate(L): | |
item.sort() |
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 numpy as np | |
n = 10 | |
a = np.random.randint(0, 10, (n, n, n)) | |
print("All matrix: {0}".format(a)) | |
columns = a.sum(axis=0) | |
rows = a.sum(axis=1) | |
z_s = a.sum(axis=2) | |
t = columns.max() |
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 compareInteger(a,b): | |
stringa = str(a) | |
stringb = str(b) | |
for i in xrange(min(len(stringa), len(stringb))): | |
if stringa[i] > stringb[i]: | |
return 1 | |
elif stringa[i] < stringb[i]: | |
return -1 | |
if len(stringa) > len(stringb): | |
return compareInteger(stringa[len(stringb):], stringb) |