Skip to content

Instantly share code, notes, and snippets.

from math import comb
def chance(k, n, K, N):
return comb(K, k) * comb(N - K, n - k) / comb(N, n)
def fits_in_delta_prob(lower, upper, n, K, N):
result = 0
for x in range(n + 1):
ratio = x / n
(venv) Igors-MacBook-Pro:airflow igor_khrol$ ./breeze --db-reset test-target tests/task/task_runner/test_standard_task_runner.py -- --logging-level=DEBUG
Resetting the DB!
Fixing group permissions
Fixed group permissions
Use CI image.
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
pytest = "*"
pylint = "*"
pylint-quotes = "*"
@Khrol
Khrol / asdf.by
Created September 26, 2016 20:00
Блядский скайп
In [10]: {**{‘x’: 2}, **{'a': 1}}
Out[10]: {'a': 1, 'x': 2}
require 'selenium-webdriver'
begin
driver = Selenium::WebDriver.for(:chrome)
driver.navigate.to 'http://localhost:3000'
# login
driver.find_element(css: '[href="http://localhost:3000/users/login"]').click
sleep 1
driver.find_element(id: 'user_email').send_keys 'user'
# -*- coding: utf-8 -*-
from webium import settings
from webium import driver as webium_driver_hack
from webium import BasePage
from selenium.webdriver.common.by import By
from webium import Find, Finds
from selenium.webdriver.remote.webelement import WebElement
from selenium import webdriver
import time
@Khrol
Khrol / tmp.json
Last active August 29, 2015 14:22
tmp.json
{
"data":[
{
"id":"churn",
"values":[
{
"id":"2012-04-01",
"values":[
{
"id":"churn",
@Khrol
Khrol / rand.py
Last active August 29, 2015 14:14
from random import randint
from math import copysign
def generate(exception, n):
x = randint(1, n - 1)
if x >= exception:
return x + 1
return x
def generate_math(exception, n):
from selenium.webdriver import Firefox
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webelement import WebElement
class Link(WebElement):
def get_href(self):
return self.get_attribute('href')
driver = Firefox()
driver.get('http://ya.ru')