content stringlengths 7 1.05M |
|---|
# encoding: utf8
class End(object):
def __init__(self, connection=None):
self.connection = connection
self.__point = None
def paint(self, painter, point):
self.connection.paint(painter, self, point)
def set_point(self, point):
self.__point = point
def get_point(self)... |
# Straight down to your spine(After u crash into a "PROTEIN THINGNY" by E235 at 65km/h, imagine that high-speed and safe brought u by JR East and ATC/ATS)
# Be "straight" here for sure: This is for some external features that I just want to share around the repo and test it out
# Btw, remenber what this repo for?
def... |
'''
Aprimore o desafio 093 para que ele funcione com vários jogadores, incluindo um sistema de visualização de detalhes do aproeitamento de cada jogador.
'''
campeonato = list()
while True:
jogador = dict()
partidas = list()
jogador['nome'] = str(input('Nome do jogador: '))
tot = int(input(f'quantas par... |
num = float(input())
if (100 > num or num > 200) and num != 0:
print("invalid")
elif num == 0:
print()
|
# 21300 - [Job Adv] (Lv.60) Aran
sm.setSpeakerID(1510009)
sm.sendNext("How is the training going? Hm, Lv. 60? You still ahve a long way to go, but it's definitely praiseworthy compared to the first time I met you. Continue to train diligently, and I'm sure you'll regain your strength soon!")
if sm.sendAskYesNo("But f... |
"""
Дана база данных о продажах некоторого интернет-магазина. Каждая строка входного файла представляет собой запись вида
Покупатель товар количество, где
Покупатель — имя покупателя (строка без пробелов),
товар — название товара (строка без пробелов),
количество — количество приобретенных единиц товара.
Создайте спи... |
i = 0
while True:
print(i)
i = i + 1
|
"""
Faça uma função que receba um número N e retorne a soma dos algarítimos de N!. Ex: se N = 4, N! = 24. Logo, a soma de seus algarismos é 2 + 4 = 6.
Doctests:
>>> somaalgarismos(4)
6
>>> somaalgarismos(12)
27
>>> somaalgarismos(7)
9
>>> somaalgarismos(0)
1
"""
def somaalgarismos(n: int):
fat = 1
soma = 0
... |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findBottomLeftValue(self, root):
"""
:type root: TreeNode
:rtype: int
"""... |
# Please be warned, that when turning on the "saving_enabled" feature, it will consume a lot of ram while it is saving
# The frames. This is because every single frame that is played during the animation is recorded into the memory
# At the moment, I dont see any other way to output a gif straight out of pygame. ... |
# EDITION
# PLAYING WITH NUMBERS
my_var_int = 1234
my_var_int = my_var_int + 20
print(f"my_var_int: {my_var_int}")
my_var_int += 20# my_var_int = my_var_int + 20
print(f"my_var_int: {my_var_int}")
my_var_int = my_var_int - 75 # substraction
print(f"my_var_int: {my_var_int}")
my_var_int = my_var_int / 2 # division
print... |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
class MinStack:
def __init__(self):
"""
initialize your data structure here.
"""
self.l = []
self.min_stack = [math.inf]
def push(self, x: int) -> None:
self.l.append(x)
self.min_stack.append(min(x, self.min_stack[-1]))
def pop(self) -> None:
... |
r=int(input("enter radius\n"))
area=3.14*r*r
print(area)
r=int(input("enter radius\n"))
circumference=2*3.14*r
print(circumference)
|
"""
pythonbible-parser is a Python library for parsing Bible texts in various formats
and convert them into a format for easy and efficient use in Python.
"""
__version__ = "0.0.3"
|
plugins_modules = [
"authorization",
"anonymous",
]
|
SEND_TEXT = 'send_text'
SEND_IMAGE = 'send_image'
SEND_TEXT_AND_BUTTON = 'send_text_and_button'
CHECK_STATUS_MESSAGES = 'check_status_messages'
API = [SEND_TEXT, SEND_IMAGE, SEND_TEXT_AND_BUTTON, CHECK_STATUS_MESSAGES]
API_CHOICES = [(api, api) for api in API] |
def reverse(list):
if len(list) < 2:
return list
return [list[-1]] + reverse(list[:-1])
assert reverse([]) == []
assert reverse([2]) == [2]
assert reverse([2, 6, 5]) == [5, 6, 2] |
ENTRY_POINT = 'compare_one'
#[PROMPT]
def compare_one(a, b):
"""
Create a function that takes integers, floats, or strings representing
real numbers, and returns the larger variable in its given variable type.
Return None if the values are equal.
Note: If a real number is represented as a string, t... |
class Arvore():
def __init__(self, valor, esq=None, dir=None):
self.dir = dir
self.esq = esq
self.valor = valor
def __iter__(self):
yield self.valor
if self.esq:
for valor in self.esq:
yield valor
if self.dir:
for valor in ... |
#4
row=0
while row<10:
col=0
while col<9:
if col+row==6 or row==6 or (col==6):
print("*",end=" ")
else:
print(" ",end=" ")
col +=1
row +=1
print()
|
def hex(number):
if number == 0:
return '0'
res = ''
while number > 0:
digit = number % 16
if digit <= 9:
digit = str(digit)
elif digit <= 13:
if digit <= 11:
if digit == 10:
digit = 'A'
else:
... |
class Singleton(type):
_instances = {}
def __call__(cls, tree):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(tree)
instance = cls._instances[cls]
instance.tree = tree # update tree
return instance
def clear(cls):
tr... |
#Joe is a prisoner who has been sentenced to hard labor for his crimes. Each day he is given a pile of large rocks to break into tiny rocks. To make matters worse, they do not provide any tools to work with. Instead, he must use the rocks themselves. He always picks up the largest two stones and smashes them together... |
#! python3
"""A number n is called deficient if the sum of its proper divisors is less
than n and it is called abundant if this sum exceeds n.
Find the sum of all the positive integers which cannot
be written as the sum of two abundant numbers."""
mn, mx = 12, 28123
def sdivisors_until(m):
"""Sum of divisors gene... |
# (C) Datadog, Inc. 2020 - Present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
GENERIC_METRICS = {
'go_gc_duration_seconds': 'go.gc_duration_seconds',
'go_goroutines': 'go.goroutines',
'go_info': 'go.info',
'go_memstats_alloc_bytes': 'go.memstats.alloc_bytes',
'go_m... |
N, M = list(map(int, input().split()))
a_list = [[0 for _ in range(M)] for _ in range(N)]
for i in range(N):
a_list[i] = list(map(int, input().split()))
ans = 0
for t1 in range(M-1):
for t2 in range(t1+1, M):
score = 0
for i in range(N):
score += max(a_list[i][t1], a_list[i][t2])
... |
a = int(input())
b = int(input())
c = int(input())
max = a
if max < b:
max = b
if max < c:
max = c
elif max < c:
max = c
print(max) |
students = {
"males" : ["joseph", "stephen", "theophilus"],
"females" : ["kara", "sharon", "lois"]
}
print(students["males"])
print(students["females"]) |
def hourglassSum(arr):
dic = {}
top = 0
mid = 1
bot = 2
top_one = 0
mid_one = 1
bot_one = 0
num = 0
max = float('-inf')
while bot < len(arr):
while bot_one < len(arr[-1])-2:
dic[num] = sum(arr[top][top_one : top_one + 3]) + arr[mid][mid_one] + sum(arr... |
'''
Various utility methods for building html attributes.
'''
def styles(*styles):
'''Join multiple "conditional styles" and return a single style attribute'''
return '; '.join(filter(None, styles))
def classes(*classes):
'''Join multiple "conditional classes" and return a single class attribute'''
return ' '.joi... |
SNOW_START = -100
SNOW_END = 0
GRASS_START = 0
GRASS_END = 40
SAND_START = 40
SAND_END = 100
def color_rgb(r,g,b):
"""r,g,b are intensities of red, green, and blue in range(256)
Returns color specifier string for the resulting color"""
return "#%02x%02x%02x" % (r,g,b)
def climate_color(temperature, brig... |
class Solution:
def smallestSubsequence(self, s: str) -> str:
stack, seen, lastOccurence = deque([]), set(), {char: index for index, char in enumerate(s)}
for index, char in enumerate(s):
if char not in seen:
while stack and char < stack[-1] and index < lastOccurence[stac... |
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate... |
print('Hello World')
# This code supports my weekly habit of seeing if I can
# afford a ferrari. The general algorithm is to compare
# my bank account amount to the current cost of a ferrari.
"""
:)
:|
:(
"""
bank_balance = 100
ferrari_cost = 50
if bank_balance >= ferrari_cost:
# If it's greater I can finally bu... |
def study_template(p):
study_regex = r"Study"
for template in p.filter_templates(matches=study_regex):
if template.name.strip() == study_regex:
return template
return None
|
cont = ('zero', 'um', 'dois', 'três', 'quatro', 'cinco', 'seis', 'sete', 'oito', 'nove', 'dez')
r = ''
while True:
n = int(input('Digite um número de 0 a 10'))
while n not in range(0, 11):
n = int(input('Tente novamente. Digite um numero de 0 a 10'))
print(f'{n} por extenso é {cont[n]}.')
r = ... |
"""
Version of platform_services
"""
__version__ = '0.19.0'
|
'''
*Book Record Management in Python*
With this project a used can Add/Delete/Update/View the book records
the project is implement in python
Inbuilt data structures used: LIST
concepts of functions, try-catch statements, if else statements and loops are used in this pr... |
def f(x, y, z): return "{}時の{}は{}".format(x, y, z)
print(f(12, "気温", 22.4))
|
nomes_paises = ('Brasil', 'Argentina', 'China', 'Canadá', 'Japão')
print(nomes_paises)
nome_estado = 'São Paulo',
print(nome_estado, type(nome_estado))
len(nomes_paises)
nomes_paises[0]
b, a, c, ca, j = nomes_paises
print(b, c, j)
print(*nomes_paises)
|
DEPS = [
'archive',
'depot_tools/bot_update',
'chromium',
'chromium_tests',
'chromium_android',
'commit_position',
'file',
'depot_tools/gclient',
'isolate',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/step',
'swarming',... |
class Configs:
def __init__(self, client_id, client_secret, tenant_id):
"""
Configs(...)
configs = Configs()
Initializes client_id, client_secret and tenant_id.
Required arguments:
client_id: client_id of application
client_secret: client_secret of appl... |
### All lines that are commented out (and some that aren't) are optional ###
### Telegram Settings
### Get your own api_id and api_hash from https://my.telegram.org, under API Development
### Default vaules are exmaple and will not work
API_ID = 123456 # Int value, example: 123456
API_HASH = 'e59ffe6c16bfaafb682... |
class DatasetParameter:
def __init__(self, db_url, **dataset_kwargs):
self.db_url = db_url
self.dataset_kwargs = dataset_kwargs
@property
def DbUrl(self): return self.db_url
@property
def DbKwargs(self): return self.dataset_kwargs
|
"""
Patient Tracking
"""
module = request.controller
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# -----------------------------------------------------------------------------
def index():
"Module's Home Page"
module_name = settings.modules[module].get("... |
# This program demonstrates variable reassignment.
# Assign a value to the dollars variable.
dollars = 2.75
print('I have', dollars, 'in my account.')
# Reassign dollars so it references
# a different value.
dollars = 99.95
print('But now I have', dollars, 'in my account!')
|
suffix_slang_3 = {
'ine': '9',
'aus': 'oz',
'ate': '8',
'for': '4',
}
suffix_slang_4 = {
'ause': 'oz',
'fore': '4',
}
general_slang = {
'you': 'u',
'for': '4',
'thanks': 'thnx',
'are': 'r',
'they': 'dey',
'... |
def ClumpFinder(k,L,t,Genome):
#Length of Genome
N = len(Genome)
#Storing Frequent patterns
freq_patterns = []
for i in range(N-L+1):
#choosing region of length L in the Genome
region = Genome[i:i+L]
#Calculating the Frequency array in the first iteration
if... |
# coding: utf-8
def humor(request):
return {
'site_authors': [
'добрыми питонистами',
'заботливыми программистами',
'рьяными энтузиастами',
'по вечерам и выходным дням',
'сообществом разработчиков'
]
}
|
PDBCUTOFF = 33.0
DSSPCUTOFF = 0.55
TEST=False
three2oneAA={
"ALA": "A",
"ARG": "R",
"ASN": "N",
"ASP": "D",
"CYS": "C",
"GLN": "Q",
"GLU": "E",
"GLY": "G",
"HIS": "H",
"ILE": "I",
"LEU": "L",
"LYS": "K",
"MET": "M",
"PHE": "F",
"PRO": "P",
"SER": "S",
"THR": "T",
"TRP": "W",
"TYR": "Y",
"VAL": "V"
... |
#PROGRESSÃO ARITMÉTICA(PA)3.0
p1 = int(input('digite o primeiro termo: '))
r = int(input('digite a razão: '))
pa = p1
cont = 1
total = 0
mais = 10
while mais != 0:
total += mais
while cont <= total:
print(pa,end=' -> ')
pa += r
cont += 1
print('PAUSA')
mais = int(input('quantos t... |
price, size = map(int, input().split())
dislikes = list(map(int, input().split()))
likes = list(set(range(10)) - set(dislikes))
digits = [int(digit) for digit in str(price)]
r_digits = list(reversed(digits))
res = []
for i in range(len(r_digits)):
if r_digits[i] in likes:
res.append(r_digits[i])
... |
# # Literate Programming in Markdown
# ---------------------------------------------------------------------------
# Literate Programming in Markdown takes a markdown file and converts it into a programming language. Traditional programming often begins with writing code, followed by adding comments. The Literate Pr... |
# -*- coding: utf-8 -*-
"""
awsecommerceservice
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class ItemSearchRequest(object):
"""Implementation of the 'ItemSearchRequest' model.
TODO: type model description here.
Attributes:
actor (string): TODO:... |
class Solution(object):
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1
for i in range(2, n + 1):
dp[i] = dp[i - 1] + dp[i - 2]
return dp[-1]
|
class UserNotValidException(Exception):
pass
class PhoneNotValidException(Exception):
pass
class ConfigFileParseException(Exception):
pass
class DuplicateUserException(Exception):
pass
class IndexOutofRangeException(Exception):
pass
class IndexNotGivenException(Exception):
pass |
class User:
def __init__(self, user_id, username):
self.id = user_id
self.username = username
self.followers = 0
self.following = 0
def follow(self, user):
user.followers += 1
self.following += 1
user_1 = User("001", "nuno")
user_2 = User("003", "paula")
... |
#Eliminar
conjuntos = set()
conjuntos = {1,2,3,"brian", 4.6}
conjuntos.discard(3)
print (conjuntos)
("==================================================================================")
|
#The code is implemented to print the range of numbers from 100-15000
for x in range(50,750):
x = x * 2
print(x)
print("Even number") |
#coding: utf-8
#------------------------------------------------------------------------------
# Um programa que tem uma tupla preenchida com uma contagem por extenso de
# zero à vinte. O programa recebe um número inteiro e retorna esse em extenso.
#--------------------------------------------------------------------... |
# class for tiles
class Tile:
def __init__(self, name, items=None, player_on=False, mob_on=False):
if name == 'w' or name == 'mt' or name == 'sb':
self.obstacle = True
else:
self.obstacle = False
self.name = name
self.items = items
self.player_on = player_on
self.mob_on = mob_on
self.mob = None
s... |
def draw_event_cb(e):
dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param())
if dsc.part == lv.PART.TICKS and dsc.id == lv.chart.AXIS.PRIMARY_X:
month = ["Jan", "Febr", "March", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec"]
# dsc.text is defined char text[16], I must therefore ... |
def linha(tam=42):
return '-'*tam
def cabeçalho(txt):
print(linha())
print(f'{txt:^42}')
print(linha())
def leiaint(msg):
while True:
try:
n = int(input(msg))
except(ValueError, TypeError):
print('\033[31m ERRO: por favor, digite um número inteiro válido.\033[m... |
"""
## Call graph rbreak
Build a function call graph of the non-dynamic functions of an executable.
This implementation is very slow for very large projects, where `rbreak .` takes forever to complete.
- http://stackoverflow.com/questions/9549693/gdb-list-of-all-function-calls-made-in-an-application
- http://stackov... |
class Params:
"""Model parameters."""
NUM_HIDDEN = 75
NUM_LAYERS = 3
KEEP_PROB = 0.5
EPOCH = 50
BATCH_SIZE = 400
MAX_LENGTH = 100
ERROR = 0.5
def __init__(self):
self.num_hidden = self.NUM_HIDDEN
self.num_layers = self.NUM_LAYERS
self.keep_prob = self.KEEP_PR... |
# [기초-산술연산] 정수 2개 입력받아 합 출력하기2(설명)
# minso.jeong@daum.net
'''
문제링크 : https://www.codeup.kr/problem.php?id=1039
'''
n1, n2 = map(int, input().split())
print(n1+n2) |
## bisenetv2
cfg = dict(
model_type='bisenetv2',
num_aux_heads=4,
lr_start = 5e-2,
weight_decay=5e-4,
warmup_iters = 1000,
max_iter = 150000,
im_root='/remote-home/source/Cityscapes/',
train_im_anns='../datasets/cityscapes/train.txt',
val_im_anns='../datasets/cityscapes/val.txt',
... |
def factorials(number: int, iteratively=True) -> int:
"""
Calculates factorials iteratively as well as recursively. Default iteratively. Takes linear time.
Args:
- ``number`` (int): Number for which you want to get a factorial.
- ``iteratively`` (bool): Set this to False you want... |
LOOKUPS = {
"AirConditioning": {
"C":"Central",
"F":"Free Standing",
"M":"Multi-Zone",
"N":"None",
"T":"Through the Wall",
"U":"Unknown Type",
"W":"Window Units",
},
"Borough": {
"BK":"Brooklyn",
"BX":"Bronx",
"NY":"Manhattan",
"QN":"Queens",
"SI":"Staten Island",
},
"B... |
class DotDictMeta(type):
def __repr__(cls):
return cls.__name__
class DotDict(dict, metaclass=DotDictMeta):
"""Dictionary that supports dot notation as well as dictionary access notation.
Use the dot motation only for get values, not for setting.
usage:
>>> d1 = DotDict()
>>> d['val2'... |
token = ''
Whitelist = 'whitelist.txt'
Masterkey = '1bc45'
Students = 'students.txt'
|
"""
Package version
"""
__version__ = "0.1.0"
|
# define constants
DETALHE_FILE_NAME = 'detalhe_votacao_secao'
MUNZONA_FILE_NAME = 'detalhe_votacao_zona'
DC_CODE = '58335'
TURNO = '2'
SECAO_FILE = 'detalhe_votacao_secao_2016_RJ.txt'
BOLETIM_FILE = 'bweb_2t_RJ_31102016134235.txt'
COLUMNS_TO_DETALHE_SECAO = [
'codigo_municipio',
'secao',
'zona',
... |
class Singleton:
__instance = None
def __new__(cls, val=None):
if Singleton.__instance is None:
Singleton.__instance = object.__new__(cls)
Singleton.__instance.val = val
return Singleton.__instance
|
with open("input.txt") as f:
card_public, door_public = [int(x) for x in f.readlines()]
def transform_once(subject: int, num: int) -> int:
return (subject * num) % 20201227
num = 1
i = 0
while num != door_public:
i += 1
num = transform_once(7, num)
door_loop = i
num = 1
for _ in range(door_loop):
... |
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def insertIntoBST(self, root: TreeNode, val: int) -> TreeNode:
# Iteration (1): Time O(h) Space O(1)
... |
class Student:
"""This is a very simple Student class"""
course_marks = {}
name = ""
family = ""
def __init__(self, name, family):
self.name = name
self.family = family
def addCourseMark(self, course, mark):
"""Add the course to the course dictionary,
this will overide the old mark if one exists."""
... |
""" This file handles default application config settings for Flask-User.
:copyright: (c) 2013 by Ling Thio
:author: Ling Thio (ling.thio@gmail.com)
:license: Simplified BSD License, see LICENSE.txt for more details."""
def set_default_settings(user_manager, app_config):
""" Set default app.config se... |
def setup_application():
# Example to change config stuff, call this method before everything else.
# config.cache_config.cache_dir = "abc"
a = 1
|
# Databricks notebook source
GFMGVNZKIYBRLMUHVQJSGYOCQYAYFKD
NATXOZQANOZFMUPBDEBUCJBHQ
BJWJMKDTNLLWEEQGCDJHHROEXMTBAULGXCRKMKPAOIFSOXERBMUOUQBBIVEWZHMSYRLVABWGSRFDRZXZCVSGFRALYARODLWSCWHPCCCYDSNEVCUWSKZJHCKBJDB
HRYAMXRDXHYWHJVTVBJEHAQTXYHBGBHHTNXU
OICSMCKGDPDCHROEZXHBROAOVOMOHKSZQSTZHZOBOUBKWKFQJFW
XVYHXHBOYUJCZFNBKYBK... |
def tambor_desplazamiento (entrada_TD, acarreo_entrada_TD, senal_control_TD):
resultado_TD = [0]*8
if senal_control_TD[2] == 0: # Rotaciones
if senal_control_TD[1] == 0: # Rotaciones a Derecha
for i in range (0,7):
resultado_TD[i] = entrada_TD[i+1]
... |
DEFAULT_DOTENV_KWARGS = dict(
driver='MSDSS_DATABASE_DRIVER',
user='MSDSS_DATABASE_USER',
password='MSDSS_DATABASE_PASSWORD',
host='MSDSS_DATABASE_HOST',
port='MSDSS_DATABASE_PORT',
database='MSDSS_DATABASE_NAME',
env_file='./.env',
key_path=None,
defaults=dict(
driver='postg... |
class param:
"""
Copyright (c) 2018 van Ovost Automatisering b.v.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless re... |
# Enter your code here. Read input from STDIN. Print output to STDOUT
dateActually, monthActually, yearActually = list(map(int, input().split()))
dateExpected, monthExpected, yearExpected = list(map(int, input().split()))
fine = 0
if (yearActually > yearExpected):
fine = 10000
elif (yearActually == yearExpected):
... |
"""Util functions and classes."""
# Copyright 2013-2018 The Home Assistant Authors
# https://github.com/home-assistant/home-assistant/blob/master/LICENSE.md
class Registry(dict):
"""Registry of items."""
def register(self, name):
"""Return decorator to register item with a specific name."""
... |
x = int(input())
numbers = 0
while numbers < x:
y = int(input())
numbers += y
print(numbers)
|
# def f():
# x=10
if 1:
x=10
print(x) |
def add(matrix_a, matrix_b):
rows = len(matrix_a)
columns = len(matrix_a[0])
matrix_c = []
for i in range(rows):
list_1 = []
for j in range(columns):
val = matrix_a[i][j] + matrix_b[i][j]
list_1.append(val)
matrix_c.append(list_1)
return matrix_c
def... |
# EDIT THESE WITH YOUR OWN DATASET/TABLES
billing_project_id = 'project_id'
billing_dataset_id = 'billing_dataset'
billing_table_name = 'billing_data'
output_dataset_id = 'output_dataset'
output_table_name = 'transformed_table'
# You can leave this unless you renamed the file yourself.
sql_file_path = 'cud_sud_attrib... |
# testing the bargaining power proxy
def barPower(budget, totalBudget, N):
'''
(float, float, integer) => float
computes bargaining power within a project
'''
bP = ( N * budget - totalBudget) / (N * totalBudget)
return bP
projects = []
project1 = [10, 10, 10, 10, 1000]
project2 = [50, 50, 5... |
"""
This module houses the GDAL & SRS Exception objects, and the
check_err() routine which checks the status code returned by
GDAL/OGR methods.
"""
# #### GDAL & SRS Exceptions ####
class GDALException(Exception):
pass
class SRSException(Exception):
pass
# #### GDAL/OGR error checking c... |
class Solution:
def maxDepth(self, s: str) -> int:
z=0
m=0
for i in s:
if i=="(":
z+=1
elif i==")":
z-=1
m=max(m,z)
return m
|
## Animal is-a object
class Animal(object):
pass
## Dog is-a Animal
class Dog(Animal):
def __init__(self, name):
## Dog has-a name
self.name = name
## Cat is-a Animal
class Cat(Animal):
def __init__(self, name):
## Cat has-a name
self.name = name
## Person is-a object... |
class Project:
def __init__(self, name=None, description=None, id=None):
self.name = name
self.description = description
self.id = id |
__all__ = [
"max",
"min",
"pow",
"sqrt",
"exp",
"log",
"sin",
"cos",
"tan",
"arcsin",
"arccos",
"arctan",
"fabs",
"floor",
"ceil",
"isinf",
"isnan",
]
def max(a: float, b: float) -> float:
raise NotImplementedError
def min(a: float, b: float) -... |
class Message(object):
""" Implements a Windows message. """
def Instance(self):
""" This function has been arbitrarily put into the stubs"""
return Message()
@staticmethod
def Create(hWnd,msg,wparam,lparam):
"""
Create(hWnd: IntPtr,msg: int,wparam: IntPtr,lparam: IntPtr) -> Message
Crea... |
# These contain production data that impacts logic
# no dependencies (besides DB migration)
ESSENTIAL_DATA_FIXTURES = (
'counties',
'organizations',
'addresses',
'groups',
'template_options',
)
# These contain fake accounts for each org
# depends on ESSENTIAL_DATA_FIXTURES
MOCK_USER_ACCOUNT_FIXTURE... |
#!/usr/bin/env python
"""
Copyright 2014-2015 Taxamo, Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by app... |
"""used to check if data existed in database already
"""
def duplicate_checker(tuple1,list_all):
return tuple1 in list_all
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.