content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
MAX_MEMORY = 5 * 1024 * 2 ** 10 # 5 MB
BUFFER_SIZE = 1 * 512 * 2 ** 10 # 512 KB
class DataSourceInterface(object):
"""Provides a uniform API regardless of how the data should be fetched."""
def __init__(self, target, preload=False, **kwargs):
raise NotImplementedError()
@property
def is_loa... | max_memory = 5 * 1024 * 2 ** 10
buffer_size = 1 * 512 * 2 ** 10
class Datasourceinterface(object):
"""Provides a uniform API regardless of how the data should be fetched."""
def __init__(self, target, preload=False, **kwargs):
raise not_implemented_error()
@property
def is_loaded(self):
... |
SQLALCHEMY_DATABASE_URI = 'sqlite:///database.sqlite'
SECRET_KEY = 'F12Zr47j\3yX R~X@H!jmM]Lwf/,?KT'
SAVE_FOLDER = '../../../projects'
SQLALCHEMY_TRACK_MODIFICATIONS = 'False'
PORT = '3000'
STATIC_FOLDER = '../../client/dist/static'
| sqlalchemy_database_uri = 'sqlite:///database.sqlite'
secret_key = 'F12Zr47j\x03yX R~X@H!jmM]Lwf/,?KT'
save_folder = '../../../projects'
sqlalchemy_track_modifications = 'False'
port = '3000'
static_folder = '../../client/dist/static' |
discovery_node_rpc_url='https://ctz.solidwallet.io/api/v3'
request_data = {
"jsonrpc": "2.0",
"id": 1234,
"method": "icx_call",
"params": {
"to": "cx0000000000000000000000000000000000000000",
"dataType": "call",
"data": {
... | discovery_node_rpc_url = 'https://ctz.solidwallet.io/api/v3'
request_data = {'jsonrpc': '2.0', 'id': 1234, 'method': 'icx_call', 'params': {'to': 'cx0000000000000000000000000000000000000000', 'dataType': 'call', 'data': {'method': 'getPReps', 'params': {'startRanking': '0x1', 'endRanking': '0xaaa'}}}} |
# jaylin
hours = float(input("Enter hours worked: "))
rate = float(input("Enter hourly rate: "))
if (rate >= 15):
pay=(hours* rate)
print("Pay: $", pay)
else:
print("I'm sorry " + str(rate) + " is lower than the minimum wage!")
| hours = float(input('Enter hours worked: '))
rate = float(input('Enter hourly rate: '))
if rate >= 15:
pay = hours * rate
print('Pay: $', pay)
else:
print("I'm sorry " + str(rate) + ' is lower than the minimum wage!') |
# This is a namespace package. See also:
# http://pythonhosted.org/distribute/setuptools.html#namespace-packages
# http://osdir.com/ml/python.distutils.devel/2006-08/msg00029.html
__import__('pkg_resources').declare_namespace(__name__)
| __import__('pkg_resources').declare_namespace(__name__) |
# put your python code here
def event_time(hours, minutes, seconds):
return (hours * 3600) + (minutes * 60) + seconds
def time_difference(a, b):
return abs(a - b)
hours_1 = int(input())
minutes_1 = int(input())
seconds_1 = int(input())
hours_2 = int(input())
minutes_2 = int(input())
seconds_2 = int(input()... | def event_time(hours, minutes, seconds):
return hours * 3600 + minutes * 60 + seconds
def time_difference(a, b):
return abs(a - b)
hours_1 = int(input())
minutes_1 = int(input())
seconds_1 = int(input())
hours_2 = int(input())
minutes_2 = int(input())
seconds_2 = int(input())
event_1 = event_time(hours_1, minu... |
# buildifier: disable=module-docstring
# buildifier: disable=function-docstring-header
def detect_root(source):
"""Detects the path to the topmost directory of the 'source' outputs.
To be used with external build systems to point to the source code/tools directories.
Args:
source (Target): A filegr... | def detect_root(source):
"""Detects the path to the topmost directory of the 'source' outputs.
To be used with external build systems to point to the source code/tools directories.
Args:
source (Target): A filegroup of source files
Returns:
string: The relative path to the root source ... |
def get_config_cs2en():
config = {}
# Settings which should be given at start time, but are not, for convenience
config['the_task'] = 0
# Settings ----------------------------------------------------------------
config['allTagsSplit'] = 'allTagsSplit/' # can be 'allTagsSplit/', 'POSextra/' or ... | def get_config_cs2en():
config = {}
config['the_task'] = 0
config['allTagsSplit'] = 'allTagsSplit/'
config['identity_init'] = True
config['early_stopping'] = False
config['use_attention'] = True
config['error_fct'] = 'categorical_cross_entropy'
config['seq_len'] = 50
config['enc_nhid... |
ALLOWED_HOSTS = ['testserver']
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOC... | allowed_hosts = ['testserver']
email_backend = 'django.core.mail.backends.console.EmailBackend'
databases = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}}
caches = {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', 'LOCATION': 'iosDevCourse'}, 'local': {'BACKEND': 'djang... |
#!/usr/bin/env python
"""
_Scripts_
"""
| """
_Scripts_
""" |
my_dictionary = {
'type': 'Fruits',
'name': 'Apple',
'color': 'Green',
'available': True,
'number': 25
}
print(my_dictionary)
print(my_dictionary['name'])
# searching with wrong key
print(my_dictionary['weight'])
###############################################################
# printing keys and ... | my_dictionary = {'type': 'Fruits', 'name': 'Apple', 'color': 'Green', 'available': True, 'number': 25}
print(my_dictionary)
print(my_dictionary['name'])
print(my_dictionary['weight'])
for d in my_dictionary:
print(d, my_dictionary[d])
for data in my_dictionary.values():
print(data)
my_dictionary['color'] = 'Red... |
vTotal = 0
i = 0
vMenorValor = 0
cont = 1
vMenorValorItem = ''
while True:
vItem = str(input('Insira o nome do produto: '))
vValor = float(input('Valor do produto: R$'))
vTotal = vTotal + vValor
if vValor >= 1000:
i = i + 1
if cont == 1:
vMenorValor = vValor
vM... | v_total = 0
i = 0
v_menor_valor = 0
cont = 1
v_menor_valor_item = ''
while True:
v_item = str(input('Insira o nome do produto: '))
v_valor = float(input('Valor do produto: R$'))
v_total = vTotal + vValor
if vValor >= 1000:
i = i + 1
if cont == 1:
v_menor_valor = vValor
v_meno... |
# Tai Sakuma <tai.sakuma@gmail.com>
##__________________________________________________________________||
class Parallel(object):
def __init__(self, progressMonitor, communicationChannel, workingarea=None):
self.progressMonitor = progressMonitor
self.communicationChannel = communicationChannel
... | class Parallel(object):
def __init__(self, progressMonitor, communicationChannel, workingarea=None):
self.progressMonitor = progressMonitor
self.communicationChannel = communicationChannel
self.workingarea = workingarea
def __repr__(self):
name_value_pairs = (('progressMonitor'... |
"""Solution to Project Euler Problem 1
https://projecteuler.net/problem=1
"""
NUMBERS = 3, 5
MAXIMUM = 1000
def compute(*numbers, maximum=MAXIMUM):
"""Compute the sum of the multiples of `numbers` below `maximum`."""
if not numbers:
numbers = NUMBERS
multiples = tuple(set(range(0, maximum, numb... | """Solution to Project Euler Problem 1
https://projecteuler.net/problem=1
"""
numbers = (3, 5)
maximum = 1000
def compute(*numbers, maximum=MAXIMUM):
"""Compute the sum of the multiples of `numbers` below `maximum`."""
if not numbers:
numbers = NUMBERS
multiples = tuple((set(range(0, maximum, numbe... |
# Algorithms > Warmup > Compare the Triplets
# Compare the elements in two triplets.
#
# https://www.hackerrank.com/challenges/compare-the-triplets/problem
#
a = map(int, input().split())
b = map(int, input().split())
alice, bob = 0, 0
for i, j in zip(a, b):
if i > j:
alice += 1
elif i < ... | a = map(int, input().split())
b = map(int, input().split())
(alice, bob) = (0, 0)
for (i, j) in zip(a, b):
if i > j:
alice += 1
elif i < j:
bob += 1
print(alice, bob) |
# Gerard Hanlon, 30.01.2018
# A program that displays Fibonacci numbers.
def fib(n):
"""This function returns the nth Fibonacci numbers."""
i = 0 # variable i = the first fibonacci number
j = 1 # variable j = the second fibonacci number
n = n - 1 # variable n = n - 1
while n >= 0: # while n is greater than ... | def fib(n):
"""This function returns the nth Fibonacci numbers."""
i = 0
j = 1
n = n - 1
while n >= 0:
(i, j) = (j, i + j)
n = n - 1
return i
name = 'Hanlon'
first = name[0]
last = name[-1]
firstno = ord(first)
lastno = ord(last)
x = firstno + lastno
ans = fib(x)
print('My surnam... |
'''
Normal Counting sort without any associated array to keep track of
Time Complexity = O(n)
Space Complexity = O(n + k)
Auxilary Space = O(k)
'''
def countingSort(a):
b = [0]*(max(a) + 1)
c = []
for i in range(len(a)):
b[a[i]] += 1
for i in range(len(b)):
if(b[i] != 0)... | """
Normal Counting sort without any associated array to keep track of
Time Complexity = O(n)
Space Complexity = O(n + k)
Auxilary Space = O(k)
"""
def counting_sort(a):
b = [0] * (max(a) + 1)
c = []
for i in range(len(a)):
b[a[i]] += 1
for i in range(len(b)):
if b[i] !=... |
n,m=map(int,input().split())
L = [list(map(int,input().split())) for i in range(m)]
ans = 0
L.sort(key = lambda t:t[0],reverse = True)
for i in L[:-1]:
ans += max(0,n-i[0])
print(ans) | (n, m) = map(int, input().split())
l = [list(map(int, input().split())) for i in range(m)]
ans = 0
L.sort(key=lambda t: t[0], reverse=True)
for i in L[:-1]:
ans += max(0, n - i[0])
print(ans) |
"""
A-Z: 65-90
a-z: 97-122
"""
dic = {}
n = 0
for i in range(10):
dic[n] = str(i)
n += 1
for i in range(65, 91):
dic[n] = chr(i)
n += 1
for i in range(97, 123):
dic[n] = chr(i)
n += 1
print(dic)
| """
A-Z: 65-90
a-z: 97-122
"""
dic = {}
n = 0
for i in range(10):
dic[n] = str(i)
n += 1
for i in range(65, 91):
dic[n] = chr(i)
n += 1
for i in range(97, 123):
dic[n] = chr(i)
n += 1
print(dic) |
N = int(input())
def factorial(N):
if N == 0:
return 1
return N * factorial(N-1)
print(factorial(N))
| n = int(input())
def factorial(N):
if N == 0:
return 1
return N * factorial(N - 1)
print(factorial(N)) |
class AreWeUnitTesting(object):
# no doc
Value = False
__all__ = []
| class Areweunittesting(object):
value = False
__all__ = [] |
CJ_PATH = r''
COOKIES_PATH = r''
CHAN_ID = ''
VID_ID = ''
| cj_path = ''
cookies_path = ''
chan_id = ''
vid_id = '' |
class Rectangle:
def __init__(self, length, breadth, unit_cost=0):
self.length = length
self.breadth = breadth
self.unit_cost = unit_cost
def get_area(self):
return self.length * self.breadth
def calculate_cost(self):
area = self.get_area()
return area * self.unit_cost... | class Rectangle:
def __init__(self, length, breadth, unit_cost=0):
self.length = length
self.breadth = breadth
self.unit_cost = unit_cost
def get_area(self):
return self.length * self.breadth
def calculate_cost(self):
area = self.get_area()
return area * se... |
'''
You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any intervening characters.
Example 1:
Input:
s = "barfoothefoobarman",
words = ["foo","bar"]
Output: [0... | """
You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any intervening characters.
Example 1:
Input:
s = "barfoothefoobarman",
words = ["foo","bar"]
Output: [0... |
# URLs processed simultaneously
class Batch():
def __init__(self):
self._batch = 0
def set_batch(self, n_batch):
try:
self._batch = n_batch
except BaseException:
print("[ERROR] Can't set task batch number.")
def get_batch(self):
try:
r... | class Batch:
def __init__(self):
self._batch = 0
def set_batch(self, n_batch):
try:
self._batch = n_batch
except BaseException:
print("[ERROR] Can't set task batch number.")
def get_batch(self):
try:
return self._batch
except Bas... |
playerFilesWin = {
"lib/avcodec-56.dll" : { "flag_deps" : True, "should_be_removed" : True },
"lib/avformat-56.dll" : { "flag_deps" : True, "should_be_removed" : True },
"lib/avutil-54.dll" : { "flag_deps" : True, "should_be_removed" : True },
"lib/swscale-3.dll" : { "flag_deps" : True, "shou... | player_files_win = {'lib/avcodec-56.dll': {'flag_deps': True, 'should_be_removed': True}, 'lib/avformat-56.dll': {'flag_deps': True, 'should_be_removed': True}, 'lib/avutil-54.dll': {'flag_deps': True, 'should_be_removed': True}, 'lib/swscale-3.dll': {'flag_deps': True, 'should_be_removed': True}, 'lib/gen_files_list.p... |
# Hello world program to demonstrate running PYthon files
print('Hello, world!')
print('I live on a volcano!')
| print('Hello, world!')
print('I live on a volcano!') |
class Productivity:
def __init__(self, irradiance, hours,capacity):
self.irradiance = irradiance
self.hours = hours
self.capacity = capacity
def getUnits(self):
print(self.irradiance)
totalpower = 0
print(totalpower)
for i in self.irradiance... | class Productivity:
def __init__(self, irradiance, hours, capacity):
self.irradiance = irradiance
self.hours = hours
self.capacity = capacity
def get_units(self):
print(self.irradiance)
totalpower = 0
print(totalpower)
for i in self.irradiance:
... |
def create_platform_routes(server):
metrics = server._augur.metrics
| def create_platform_routes(server):
metrics = server._augur.metrics |
__version__ = '0.1.7'
default_app_config = 'dynamic_databases.apps.DynamicDatabasesConfig'
| __version__ = '0.1.7'
default_app_config = 'dynamic_databases.apps.DynamicDatabasesConfig' |
PHYSICS_TECHS = {
"tech_databank_uplinks",
"tech_basic_science_lab_1",
"tech_curator_lab",
"tech_archeology_lab",
"tech_physics_lab_1",
"tech_physics_lab_2",
"tech_physics_lab_3",
"tech_global_research_initiative",
"tech_administrative_ai",
"tech_cryostasis_1",
"tech_cryostas... | physics_techs = {'tech_databank_uplinks', 'tech_basic_science_lab_1', 'tech_curator_lab', 'tech_archeology_lab', 'tech_physics_lab_1', 'tech_physics_lab_2', 'tech_physics_lab_3', 'tech_global_research_initiative', 'tech_administrative_ai', 'tech_cryostasis_1', 'tech_cryostasis_2', 'tech_self_aware_logic', 'tech_automat... |
# Custom errors in classes.
class TooManyPagesReadError(ValueError):
pass
class Book:
def __init__(self, title, page_count):
self.title = title
self.page_count = page_count
self.pages_read = 0
def __repr__(self):
return (
f"<Book {self.title}, read {self.pages_... | class Toomanypagesreaderror(ValueError):
pass
class Book:
def __init__(self, title, page_count):
self.title = title
self.page_count = page_count
self.pages_read = 0
def __repr__(self):
return f'<Book {self.title}, read {self.pages_read} pages out of {self.page_count}>'
... |
""" Trapping rain water: Given an array of non negative integers, they are height of bars.
Find how much water can you collect between there bars """
"""Solution: """
def rain_water(a) -> int:
n = len(a)
res = 0
for i in range(1, n-1):
lmax = a[i]
for j in range(i):
lmax ... | """ Trapping rain water: Given an array of non negative integers, they are height of bars.
Find how much water can you collect between there bars """
'Solution: '
def rain_water(a) -> int:
n = len(a)
res = 0
for i in range(1, n - 1):
lmax = a[i]
for j in range(i):
lmax = ma... |
"""
Test init module
==================================
Author: Casokaks (https://github.com/Casokaks/)
Created on: Aug 15th 2021
"""
| """
Test init module
==================================
Author: Casokaks (https://github.com/Casokaks/)
Created on: Aug 15th 2021
""" |
"""
1065. Index Pairs of a String
Easy
Given a text string and words (a list of strings), return all index pairs [i, j] so that the substring text[i]...text[j] is in the list of words.
Example 1:
Input: text = "thestoryofleetcodeandme", words = ["story","fleet","leetcode"]
Output: [[3,7],[9,13],[10,17]]
Example 2:
... | """
1065. Index Pairs of a String
Easy
Given a text string and words (a list of strings), return all index pairs [i, j] so that the substring text[i]...text[j] is in the list of words.
Example 1:
Input: text = "thestoryofleetcodeandme", words = ["story","fleet","leetcode"]
Output: [[3,7],[9,13],[10,17]]
Example 2:
... |
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
self.dist = math.sqrt(x ** 2 + y ** 2)
class Solution:
"""
Quick Select algo:
Time best -> O(N)
Time worst -> O(N^2)
"""
def kClosest(self, points: List[List[int]], k: int) -> List[List[int]]:
... | class Point:
def __init__(self, x, y):
self.x = x
self.y = y
self.dist = math.sqrt(x ** 2 + y ** 2)
class Solution:
"""
Quick Select algo:
Time best -> O(N)
Time worst -> O(N^2)
"""
def k_closest(self, points: List[List[int]], k: int) -> List[List[int]]:
... |
Candies = [int(x) for x in input("Enter the numbers with space: ").split()]
extraCandies=int(input("Enter the number of extra candies: "))
Output=[ ]
i=0
while(i<len(Candies)):
if(Candies[i]+extraCandies>=max(Candies)):
Output.append("True")
else:
Output.append("False")
i+=1
print(Output)
| candies = [int(x) for x in input('Enter the numbers with space: ').split()]
extra_candies = int(input('Enter the number of extra candies: '))
output = []
i = 0
while i < len(Candies):
if Candies[i] + extraCandies >= max(Candies):
Output.append('True')
else:
Output.append('False')
i += 1
prin... |
class MotionSensor:
"""Get 9Dof data by using MotionSensor.
See [MatrixMotionSensor](https://matrix-robotics.github.io/MatrixMotionSensor/) for more details.
Parameters
----------
i2c_port : int
i2c_port is corresponding with I2C1, I2C2 ... sockets on board.
_dev : class
Matrix... | class Motionsensor:
"""Get 9Dof data by using MotionSensor.
See [MatrixMotionSensor](https://matrix-robotics.github.io/MatrixMotionSensor/) for more details.
Parameters
----------
i2c_port : int
i2c_port is corresponding with I2C1, I2C2 ... sockets on board.
_dev : class
Matrix... |
class MicromagneticModell:
def __init__(self, name, Ms, calc):
self.name = name
self.Ms = Ms
self.field = None
self.calc = calc
def __str__(self):
return "AbstractMicromagneticModell(name={})".format(self.name)
def relax(self):
self.calc.relax(self)
def... | class Micromagneticmodell:
def __init__(self, name, Ms, calc):
self.name = name
self.Ms = Ms
self.field = None
self.calc = calc
def __str__(self):
return 'AbstractMicromagneticModell(name={})'.format(self.name)
def relax(self):
self.calc.relax(self)
de... |
# eventually we will have a proper config
ANONYMIZATION_THRESHOLD = 10
WAREHOUSE_URI = 'postgres://localhost'
WAGE_RECORD_URI = 'postgres://localhost'
| anonymization_threshold = 10
warehouse_uri = 'postgres://localhost'
wage_record_uri = 'postgres://localhost' |
""" Example module """
def java_maker(*args, **kwargs):
""" Make you a java """
java_library(*args, **kwargs)
| """ Example module """
def java_maker(*args, **kwargs):
""" Make you a java """
java_library(*args, **kwargs) |
N = int(input().strip())
names = []
for _ in range(N):
name,email = input().strip().split(' ')
name,email = [str(name),str(email)]
if email.endswith("@gmail.com"):
names.append(name)
names.sort()
for n in names:
print(n)
| n = int(input().strip())
names = []
for _ in range(N):
(name, email) = input().strip().split(' ')
(name, email) = [str(name), str(email)]
if email.endswith('@gmail.com'):
names.append(name)
names.sort()
for n in names:
print(n) |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
def upper_print(f):
def wrapper(*args, **kwargs):
f(*[i.upper() if hasattr(i, 'upper') else i for i in args], **kwargs)
return wrapper
if __name__ == '__main__':
text = 'hello world!'
print(text) # hello world!
ol... | __author__ = 'ipetrash'
def upper_print(f):
def wrapper(*args, **kwargs):
f(*[i.upper() if hasattr(i, 'upper') else i for i in args], **kwargs)
return wrapper
if __name__ == '__main__':
text = 'hello world!'
print(text)
old_print = print
print = upper_print(print)
print(text)
p... |
if __name__ == '__main__':
# Check correct price prediction
price_input_path = 'tests/data/Price_Simple.csv'
price_input = open(price_input_path, 'r').read().splitlines()[0].split(';')
price_prediction = open('price_prediction.csv', 'r').read().splitlines()[0].split(';')
assert price_input == price_... | if __name__ == '__main__':
price_input_path = 'tests/data/Price_Simple.csv'
price_input = open(price_input_path, 'r').read().splitlines()[0].split(';')
price_prediction = open('price_prediction.csv', 'r').read().splitlines()[0].split(';')
assert price_input == price_prediction[:3]
ground_truth = 130... |
rows = []
try:
while True:
rows.append(int(input()))
except EOFError:
pass
rows.sort()
goal = 2020
l = 0
r = len(rows) - 1
while rows[l] + rows[r] != goal and l < r:
if rows[l] + rows[r] < goal:
l += 1
else:
r -= 1
if rows[l] + rows[r] == goal:
print(rows[l] * rows[r])
e... | rows = []
try:
while True:
rows.append(int(input()))
except EOFError:
pass
rows.sort()
goal = 2020
l = 0
r = len(rows) - 1
while rows[l] + rows[r] != goal and l < r:
if rows[l] + rows[r] < goal:
l += 1
else:
r -= 1
if rows[l] + rows[r] == goal:
print(rows[l] * rows[r])
else:
... |
class Telecom:
def __init__(self, contact_db_id, system, value, use, rank, period):
self.contact_db_id = contact_db_id
self.system = system
self.value = value
self.use = use
self.rank = rank
self.period = period
def get_contact_db_id(self):
return self.contact_db_id
def get_system(self):
return se... | class Telecom:
def __init__(self, contact_db_id, system, value, use, rank, period):
self.contact_db_id = contact_db_id
self.system = system
self.value = value
self.use = use
self.rank = rank
self.period = period
def get_contact_db_id(self):
return self.c... |
# kasutaja sisestab 3 numbrit
number1 = int(input("Sisesta esimene arv: "))
number2 = int(input("Sisesta teine arv: "))
number3 = int(input("Sisesta kolmas arv: "))
# funktsioon, mis tagastab kolmes sisestatud arvust suurima
def largest(number1, number2, number3):
biggest = 0
if number1 > biggest:
big... | number1 = int(input('Sisesta esimene arv: '))
number2 = int(input('Sisesta teine arv: '))
number3 = int(input('Sisesta kolmas arv: '))
def largest(number1, number2, number3):
biggest = 0
if number1 > biggest:
biggest = number1
if number2 > number1:
biggest = number2
if number3 > number2... |
#Tuplas
numeros = [1,2,4,5,6,7,8,9] #lista
usuario = {'Nome':'Mateus' , 'senha':123456789 } #dicionario
pessoa = ('Mateus' , 'Alves' , 16 , 14 , 90) #tupla
print(numeros)
print(usuario)
print(pessoa)
numeros[1] = 8
usuario['senha'] = 4545343
| numeros = [1, 2, 4, 5, 6, 7, 8, 9]
usuario = {'Nome': 'Mateus', 'senha': 123456789}
pessoa = ('Mateus', 'Alves', 16, 14, 90)
print(numeros)
print(usuario)
print(pessoa)
numeros[1] = 8
usuario['senha'] = 4545343 |
"""Stores constants used as numbers for readability that are used across all apps"""
class AdminRoles:
""" """
JCRTREASURER = 1
SENIORTREASURER = 2
BURSARY = 3
ASSISTANTBURSAR = 4
CHOICES = (
(JCRTREASURER, 'JCR Treasurer'),
(SENIORTREASURER, 'Senior Treasurer'),
(BURSA... | """Stores constants used as numbers for readability that are used across all apps"""
class Adminroles:
""" """
jcrtreasurer = 1
seniortreasurer = 2
bursary = 3
assistantbursar = 4
choices = ((JCRTREASURER, 'JCR Treasurer'), (SENIORTREASURER, 'Senior Treasurer'), (BURSARY, 'Bursary'), (ASSISTANT... |
def _check_inplace(trace):
"""Checks that all PythonOps that were not translated into JIT format are out of place.
Should be run after the ONNX pass.
"""
graph = trace.graph()
for node in graph.nodes():
if node.kind() == 'PythonOp':
if node.i('inplace'):
raise R... | def _check_inplace(trace):
"""Checks that all PythonOps that were not translated into JIT format are out of place.
Should be run after the ONNX pass.
"""
graph = trace.graph()
for node in graph.nodes():
if node.kind() == 'PythonOp':
if node.i('inplace'):
raise ru... |
###############################################################################
# Utils functions for language models.
#
# NOTE: source from https://github.com/litian96/FedProx
###############################################################################
ALL_LETTERS = "\n !\"&'(),-.0123456789:;>?ABCDEFGHIJKLMNOPQRST... | all_letters = '\n !"&\'(),-.0123456789:;>?ABCDEFGHIJKLMNOPQRSTUVWXYZ[]abcdefghijklmnopqrstuvwxyz}'
num_letters = len(ALL_LETTERS)
def _one_hot(index, size):
"""returns one-hot vector with given size and value 1 at given index
"""
vec = [0 for _ in range(size)]
vec[int(index)] = 1
return vec
def le... |
a = str(input())
b = {'0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0}
for i in a:
b[i] = b[i] + 1
for i in range(len(b)):
if b[str(i)] == 0:
continue
print(str(i) + ':' + str(b[str(i)]))
| a = str(input())
b = {'0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0}
for i in a:
b[i] = b[i] + 1
for i in range(len(b)):
if b[str(i)] == 0:
continue
print(str(i) + ':' + str(b[str(i)])) |
class ModeIndicator:
LENGTH = 4
TERMINATOR_VALUE = 0x0
NUMERIC_VALUE = 0x1
ALPHANUMERIC_VALUE = 0x2
STRUCTURED_APPEND_VALUE = 0x3
BYTE_VALUE = 0x4
KANJI_VALUE = 0x8
| class Modeindicator:
length = 4
terminator_value = 0
numeric_value = 1
alphanumeric_value = 2
structured_append_value = 3
byte_value = 4
kanji_value = 8 |
# 11/03/21
# What does this code do?
# This code introduces a new idea, Dictionaries. The codes purpose is to take an input, and convert it into the numbers you'd need to press
# on an alphanumeric keypad, as shown in the picture.
# How do Dictionaries work?
# To use our dictionary, we first need to initial... | keypad = {'A': '2', 'B': '2', 'C': '2', 'D': '3', 'E': '3', 'F': '3', 'G': '4', 'H': '4', 'I': '4', 'J': '5', 'K': '5', 'L': '5', 'M': '6', 'N': '6', 'O': '6', 'P': '7', 'Q': '7', 'R': '7', 'S': '7', 'T': '8', 'U': '8', 'V': '8', 'W': '9', 'X': '9', 'Y': '9', 'Z': '9'}
word = input('Enter word: ')
for key in word:
... |
#
# PySNMP MIB module Juniper-V35-CONF (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-V35-CONF
# Produced by pysmi-0.3.4 at Wed May 1 14:04:44 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar ... | (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, constraints_union, single_value_constraint, value_size_constraint, constraints_intersection) ... |
def maior_numero(lista):
a = lista[0]
for i in range(len(lista)):
if lista[i] > a:
a = lista[i]
return a
def remove_divisores_do_maior(lista):
maiornumero=maior_numero(lista)
for i in range(len(lista)-1,-1,-1):
if (maiornumero%lista[i])==0:
lista.pop(i)
re... | def maior_numero(lista):
a = lista[0]
for i in range(len(lista)):
if lista[i] > a:
a = lista[i]
return a
def remove_divisores_do_maior(lista):
maiornumero = maior_numero(lista)
for i in range(len(lista) - 1, -1, -1):
if maiornumero % lista[i] == 0:
lista.pop(... |
# sample\core.py
def run_core():
print("In pycharm run_core")
| def run_core():
print('In pycharm run_core') |
raise NotImplementedError("Getting an NPE trying to parse this code")
class KeyValue:
def __init__(self, key, value):
self.key = key
self.value = value
def __repr__(self):
return f"{self.key}->{self.value}"
class MinHeap:
def __init__(self, start_size):
self.heap = [None]... | raise not_implemented_error('Getting an NPE trying to parse this code')
class Keyvalue:
def __init__(self, key, value):
self.key = key
self.value = value
def __repr__(self):
return f'{self.key}->{self.value}'
class Minheap:
def __init__(self, start_size):
self.heap = [No... |
n = int(input())
c = [0]*n
for i in range(n):
l = int(input())
S = input()
for j in range(l):
if (S[j]=='0'):
continue
for k in range(j,l):
if (S[k]=='1'):
c[i] = c[i]+1
for i in range(n):
print(c[i])
| n = int(input())
c = [0] * n
for i in range(n):
l = int(input())
s = input()
for j in range(l):
if S[j] == '0':
continue
for k in range(j, l):
if S[k] == '1':
c[i] = c[i] + 1
for i in range(n):
print(c[i]) |
#
# PySNMP MIB module CHECKPOINT-TRAP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CHECKPOINT-TRAP-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:31:16 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... | (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, value_range_constraint, constraints_union, value_size_constraint, single_value_constraint) ... |
colors_per_chi = {2: 'green', 3: 'orange', 4: 'purple', 5: 'pink', 6: 'red'}
style_per_chi = {2: '-', 3: '-.', 4: 'dotted'}
markers_per_reason = {'converged': 'o', 'progress': 'x', 'ressources': 'v'}
linewidth = 5.31596
| colors_per_chi = {2: 'green', 3: 'orange', 4: 'purple', 5: 'pink', 6: 'red'}
style_per_chi = {2: '-', 3: '-.', 4: 'dotted'}
markers_per_reason = {'converged': 'o', 'progress': 'x', 'ressources': 'v'}
linewidth = 5.31596 |
def get_failed_ids(txt_file):
id = []
fh = open(txt_file, 'r')
for row in fh:
id.append(row.split('/')[1].split('.')[0])
return(id)
| def get_failed_ids(txt_file):
id = []
fh = open(txt_file, 'r')
for row in fh:
id.append(row.split('/')[1].split('.')[0])
return id |
"""
Implementation of Linked List reversal.
"""
# Author: Nikhil Xavier <nikhilxavier@yahoo.com>
# License: BSD 3 clause
class Node:
"""Node class for Singly Linked List."""
def __init__(self, value):
self.value = value
self.next_node = None
def reverse_linked_list(head):
"""Reverse li... | """
Implementation of Linked List reversal.
"""
class Node:
"""Node class for Singly Linked List."""
def __init__(self, value):
self.value = value
self.next_node = None
def reverse_linked_list(head):
"""Reverse linked list.
Returns reversed linked list head.
"""
current_node ... |
d=int(input("enter d"))
n=''
max=''
for i in range(d):
if i==0:
n=n+str(1)
else :
n=n+str(0)
max=max+str(9)
n=int(n)+1 #smallest odd no. with d digits if d>1 or 2 if d==1
max=int(max) #largest no. with d digits
def check_prime(m_odd): #returns truth value of an odd no. or of 2 being prime
if m_odd==2:return T... | d = int(input('enter d'))
n = ''
max = ''
for i in range(d):
if i == 0:
n = n + str(1)
else:
n = n + str(0)
max = max + str(9)
n = int(n) + 1
max = int(max)
def check_prime(m_odd):
if m_odd == 2:
return True
i = 3
while m_odd % i != 0 and i < m_odd:
i = i + 2
... |
class Boolable:
def __bool__(self):
return False
class DescriptiveTrue(Boolable):
def __init__(self, description):
self.description = description
def __bool__(self):
return True
def __str__(self):
return f"{self.description}"
def __repr__(self):
return f"... | class Boolable:
def __bool__(self):
return False
class Descriptivetrue(Boolable):
def __init__(self, description):
self.description = description
def __bool__(self):
return True
def __str__(self):
return f'{self.description}'
def __repr__(self):
return f... |
def fuel_required(weight: int) -> int:
return weight // 3 - 2
def fuel_required_accurate(weight: int) -> int:
fuel = 0
while weight > 0:
weight = max(0, weight // 3 - 2)
fuel += weight
return fuel
def test_fuel_required() -> None:
cases = [(12, 2), (14, 2), (1969, 654), (100756, ... | def fuel_required(weight: int) -> int:
return weight // 3 - 2
def fuel_required_accurate(weight: int) -> int:
fuel = 0
while weight > 0:
weight = max(0, weight // 3 - 2)
fuel += weight
return fuel
def test_fuel_required() -> None:
cases = [(12, 2), (14, 2), (1969, 654), (100756, 33... |
class Node:
def __init__(self, value, index, next, previous):
self.value = value
self.next_value = value
self.index = index
self.next = next
self.previous = previous
def main():
input_data = read_input()
initial_row = input_data.pop(0) # Extract the initial state... | class Node:
def __init__(self, value, index, next, previous):
self.value = value
self.next_value = value
self.index = index
self.next = next
self.previous = previous
def main():
input_data = read_input()
initial_row = input_data.pop(0)
input_data.pop(0)
rule... |
# David Hickox
# Jan 12 17
# HickoxProject2
# Displayes name and classes
# prints my name and classes in columns and waits for the user to hit enter to end the program
print("David Hickox")
print()
print("1st Band")
print("2nd Programming")
print("3rd Ap Pysics C")
print("4th Lunch")
print("5th Ap Lang... | print('David Hickox')
print()
print('1st Band')
print('2nd Programming')
print('3rd Ap Pysics C')
print('4th Lunch')
print('5th Ap Lang')
print('6th TA for R&D')
print('7th Gym')
print('8th AP Calc BC')
print()
input('Press Enter To Continue') |
class Node():
def __init__(self, value):
self.value = value
self.adjacentlist = []
self.visited = False
class Graph():
def DFS(self, node, traversal):
node.visited = True
traversal.append(node.value)
for element in node.adjacentlist:
if element... | class Node:
def __init__(self, value):
self.value = value
self.adjacentlist = []
self.visited = False
class Graph:
def dfs(self, node, traversal):
node.visited = True
traversal.append(node.value)
for element in node.adjacentlist:
if element.visited ... |
# https://www.hackerrank.com/challenges/utopian-tree
def tree_height(tree, N, start):
if not N:
return tree
if start == 'spring':
for i in range(N // 2):
tree = tree * 2 + 1
if N % 2:
return tree * 2
else:
return tree
elif start == 'summer... | def tree_height(tree, N, start):
if not N:
return tree
if start == 'spring':
for i in range(N // 2):
tree = tree * 2 + 1
if N % 2:
return tree * 2
else:
return tree
elif start == 'summer':
for i in range(N // 2):
tree = ... |
### Maximum Number of Coins You Can Get - Solution
class Solution:
def maxCoins(self, piles: List[int]) -> int:
piles.sort()
max_coin, n = 0, len(piles)
for i in range(n//3, n, 2):
max_coin += piles[i]
return max_coin | class Solution:
def max_coins(self, piles: List[int]) -> int:
piles.sort()
(max_coin, n) = (0, len(piles))
for i in range(n // 3, n, 2):
max_coin += piles[i]
return max_coin |
#Antonio Karlo Mijares
#ICS4U-01
#November 24 2016
#1D_2D_arrays.py
#Creates 1D arrays, for the variables to be placed in
characteristics = []
num = []
#Creates a percentage value for the numbers to be calculated with
base = 20
percentage = 100
#2d Arrays
#Ugly Arrays
ugly_one_D = []
ugly_one_D_two = []
ugly_two_D ... | characteristics = []
num = []
base = 20
percentage = 100
ugly_one_d = []
ugly_one_d_two = []
ugly_two_d = []
nice_two_d = []
filename = 'character'
def strength():
with open(str(filename) + '.txt', 'r') as s:
line = s.read().splitlines()
name = line[3].strip(': 17')
number = line[3].strip('... |
kamus = {"elephant" : "gajah", "zebra" : "zebra", "dog" : "anjing", "camel" : "unta"}
kata = input("Masukan kata berbahasa inggris : ")
if kata in kamus:
print("Terjemahan dari " + kata + " adalah " + kamus[kata])
else:
print("Kata tersebt belum ada di kamus") | kamus = {'elephant': 'gajah', 'zebra': 'zebra', 'dog': 'anjing', 'camel': 'unta'}
kata = input('Masukan kata berbahasa inggris : ')
if kata in kamus:
print('Terjemahan dari ' + kata + ' adalah ' + kamus[kata])
else:
print('Kata tersebt belum ada di kamus') |
# -*- coding: utf-8 -*-
'''
nbpkg defspec
'''
NBPKG_MAGIC_NUMBER = b'\x1f\x8b'
NBPKG_HEADER_MAGIC_NUMBER = '\037\213'
NBPKGINFO_MIN_NUMBER = 1000
NBPKGINFO_MAX_NUMBER = 1146
# data types definition
NBPKG_DATA_TYPE_NULL = 0
NBPKG_DATA_TYPE_CHAR = 1
NBPKG_DATA_TYPE_INT8 = 2
NBPKG_DATA_TYPE_INT16 = 3
NBPKG_DATA_TYPE_IN... | """
nbpkg defspec
"""
nbpkg_magic_number = b'\x1f\x8b'
nbpkg_header_magic_number = '\x1f\x8b'
nbpkginfo_min_number = 1000
nbpkginfo_max_number = 1146
nbpkg_data_type_null = 0
nbpkg_data_type_char = 1
nbpkg_data_type_int8 = 2
nbpkg_data_type_int16 = 3
nbpkg_data_type_int32 = 4
nbpkg_data_type_int64 = 5
nbpkg_data_type_s... |
#Write a program which can compute the factorial of a given numbers.
#The results should be printed in a comma-separated sequence on a single line
number=int(input("Please Enter factorial Number: "))
j=1
fact = 1
for i in range(number,0,-1):
fact =fact*i
print(fact) | number = int(input('Please Enter factorial Number: '))
j = 1
fact = 1
for i in range(number, 0, -1):
fact = fact * i
print(fact) |
"""Defines the version number and details of ``qusetta``."""
__all__ = (
'__version__', '__author__', '__authoremail__', '__license__',
'__sourceurl__', '__description__'
)
__version__ = "0.0.0"
__author__ = "Joseph T. Iosue"
__authoremail__ = "joe.iosue@qcware.com"
__license__ = "MIT License"
__sourceurl__ ... | """Defines the version number and details of ``qusetta``."""
__all__ = ('__version__', '__author__', '__authoremail__', '__license__', '__sourceurl__', '__description__')
__version__ = '0.0.0'
__author__ = 'Joseph T. Iosue'
__authoremail__ = 'joe.iosue@qcware.com'
__license__ = 'MIT License'
__sourceurl__ = 'https://gi... |
##Write a program to input from the input file a familiar greeting of any length, each word on a line. Output the greeting file you just received on a single line, the words separated by a space
#Mo file voi mode='r' de doc file
with open('05_ip.txt', 'r') as fileInp:
#Dung ham read() doc toan bo du lieu tu file
F... | with open('05_ip.txt', 'r') as file_inp:
filecomplete = fileInp.read()
list_ofligne = Filecomplete.splitlines()
phrasecomplete = ' '.join(listOfligne)
print(phrasecomplete)
with open('05_out.txt', 'w') as file_out:
fileOut.write(phrasecomplete) |
def fuel_required_single_module(mass):
fuel = int(mass / 3) - 2
return fuel if fuel > 0 else 0
def fuel_required_multiple_modules(masses):
total_fuel = 0
for mass in masses:
total_fuel += fuel_required_single_module(mass)
return total_fuel
def recursive_fuel_required_single_module(mass):... | def fuel_required_single_module(mass):
fuel = int(mass / 3) - 2
return fuel if fuel > 0 else 0
def fuel_required_multiple_modules(masses):
total_fuel = 0
for mass in masses:
total_fuel += fuel_required_single_module(mass)
return total_fuel
def recursive_fuel_required_single_module(mass):
... |
str_xdigits = [
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"a",
"b",
"c",
"d",
"e",
"f",
]
def convert_digit(value: int, base: int) -> str:
return str_xdigits[value % base]
def convert_to_val(value: int, base: int) -> str:
if value == No... | str_xdigits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']
def convert_digit(value: int, base: int) -> str:
return str_xdigits[value % base]
def convert_to_val(value: int, base: int) -> str:
if value == None:
return 'Error'
current = int(value)
result = ''
... |
class SimpleOpt():
def __init__(self):
self.method = 'cpgan'
self.max_epochs = 100
self.graph_type = 'ENZYMES'
self.data_dir = './data/facebook.graphs'
self.gpu = '2'
self.lr = 0.003
self.encode_size = 16
self.decode_size = 16
self.pool_size = ... | class Simpleopt:
def __init__(self):
self.method = 'cpgan'
self.max_epochs = 100
self.graph_type = 'ENZYMES'
self.data_dir = './data/facebook.graphs'
self.gpu = '2'
self.lr = 0.003
self.encode_size = 16
self.decode_size = 16
self.pool_size = 1... |
# What will the gender ratio be after every family stops having children after
# after they have a girl and not until then.
def birth_ratio():
# Everytime a child is born, there is a 0.5 chance of the baby being male
# and 0.5 chance of the baby being a girl. So the ratio is 1:1.
return 1
| def birth_ratio():
return 1 |
# You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are(i, 0) and (i, height[i]).
# Find two lines that together with the x-axis form a container, such that the container contains the most water.
# Return the maximum amount of water a conta... | class Solution:
def max_area(self, height: List[int]) -> int:
(left, right) = (0, len(height) - 1)
result = 0
while left < right:
water = (right - left) * min(height[left], height[right])
if water > result:
result = water
if height[left] <... |
# server backend
server = 'cherrypy'
# debug error messages
debug = False
# auto-reload
reloader = False
# database url
db_url = 'postgresql://user:pass@localhost/dbname'
# echo database engine messages
db_echo = False
| server = 'cherrypy'
debug = False
reloader = False
db_url = 'postgresql://user:pass@localhost/dbname'
db_echo = False |
#decorators
def decorator(myfunc):
def wrapper(*args):
return myfunc(*args)
return wrapper
@decorator
def display():
print('display function')
@decorator
def info(name, age):
print('name is {} and age is {}'.format(name,age))
info('john', 23)
#hi = decorator(display)
#hi()
display() | def decorator(myfunc):
def wrapper(*args):
return myfunc(*args)
return wrapper
@decorator
def display():
print('display function')
@decorator
def info(name, age):
print('name is {} and age is {}'.format(name, age))
info('john', 23)
display() |
def connected_tree(n, edge_list):
current_edges = len(edge_list)
edges_needed = (n-1) - current_edges
return edges_needed
def main():
with open('datasets/rosalind_tree.txt') as input_file:
input_data = input_file.read().strip().split('\n')
n = int(input_data.pop(0))
edge_l... | def connected_tree(n, edge_list):
current_edges = len(edge_list)
edges_needed = n - 1 - current_edges
return edges_needed
def main():
with open('datasets/rosalind_tree.txt') as input_file:
input_data = input_file.read().strip().split('\n')
n = int(input_data.pop(0))
edge_list = list((ma... |
#=============================================================================
#
# JDI Unit Tests
#
#=============================================================================
"""
JDI Unit Tests
==============
Run all unit tests from project's root directory.
python -m unittest discover
python3 -m unittes... | """
JDI Unit Tests
==============
Run all unit tests from project's root directory.
python -m unittest discover
python3 -m unittest discover
"""
__version__ = '0.0.0' |
# Released under the MIT License. See LICENSE for details.
#
# This file was automatically generated from "rampage.ma"
# pylint: disable=all
points = {}
# noinspection PyDictCreation
boxes = {}
boxes['area_of_interest_bounds'] = (0.3544110667, 5.616383286,
-4.066055072) + (0.0, 0.0,... | points = {}
boxes = {}
boxes['area_of_interest_bounds'] = (0.3544110667, 5.616383286, -4.066055072) + (0.0, 0.0, 0.0) + (19.90053969, 10.34051135, 8.16221072)
boxes['edge_box'] = (0.3544110667, 5.438284793, -4.100357672) + (0.0, 0.0, 0.0) + (12.57718032, 4.645176013, 3.605557343)
points['ffa_spawn1'] = (0.5006944438, 5... |
# -*- coding: utf-8 -*-
# see LICENSE.rst
"""Basic Astronomy Functions.
.. todo::
change this to C / pyx. whatever astropy's preferred C thing is.
"""
__author__ = ""
# __copyright__ = "Copyright 2018, "
# __credits__ = [""]
# __license__ = ""
# __version__ = "0.0.0"
# __maintainer__ = ""
# __email__ = ""
# __... | """Basic Astronomy Functions.
.. todo::
change this to C / pyx. whatever astropy's preferred C thing is.
"""
__author__ = '' |
#
# PySNMP MIB module HPN-ICF-8021PAE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-8021PAE-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:24:57 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... | (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, single_value_constraint, value_range_constraint, constraints_union, value_size_constraint) ... |
class SchemaError(Exception):
def __init__(self, schema, code):
self.schema = schema
self.code = code
msg = schema.errors[code].format(**schema.__dict__)
super().__init__(msg)
class NoCurrentApp(Exception):
pass
class ConfigurationError(Exception):
pass
| class Schemaerror(Exception):
def __init__(self, schema, code):
self.schema = schema
self.code = code
msg = schema.errors[code].format(**schema.__dict__)
super().__init__(msg)
class Nocurrentapp(Exception):
pass
class Configurationerror(Exception):
pass |
__author__ = "Wild Print"
__maintainer__ = __author__
__email__ = "telegram_coin_bot@rambler.ru"
__license__ = "MIT"
__version__ = "0.0.1"
__all__ = (
"__author__",
"__email__",
"__license__",
"__maintainer__",
"__version__",
)
| __author__ = 'Wild Print'
__maintainer__ = __author__
__email__ = 'telegram_coin_bot@rambler.ru'
__license__ = 'MIT'
__version__ = '0.0.1'
__all__ = ('__author__', '__email__', '__license__', '__maintainer__', '__version__') |
'''
Created on Oct 10, 2012
@author: Brian Jimenez-Garcia
@contact: brian.jimenez@bsc.es
'''
class Color:
def __init__(self, red=0., green=0., blue=0., alpha=1.0):
self.__red = red
self.__green = green
self.__blue = blue
self.__alpha = alpha
def get_rgba(self):
... | """
Created on Oct 10, 2012
@author: Brian Jimenez-Garcia
@contact: brian.jimenez@bsc.es
"""
class Color:
def __init__(self, red=0.0, green=0.0, blue=0.0, alpha=1.0):
self.__red = red
self.__green = green
self.__blue = blue
self.__alpha = alpha
def get_rgba(self):
ret... |
__COL_GOOD = '\033[32m'
__COL_FAIL = '\033[31m'
__COL_INFO = '\033[34m'
__COL_BOLD = '\033[1m'
__COL_ULIN = '\033[4m'
__COL_ENDC = '\033[0m'
def __TEST__(status, msg, color, args):
args = ", ".join([str(key)+'='+str(args[key]) for key in args.keys()])
if args:
args = "(" + args + ")"
return "[{colo... | __col_good = '\x1b[32m'
__col_fail = '\x1b[31m'
__col_info = '\x1b[34m'
__col_bold = '\x1b[1m'
__col_ulin = '\x1b[4m'
__col_endc = '\x1b[0m'
def __test__(status, msg, color, args):
args = ', '.join([str(key) + '=' + str(args[key]) for key in args.keys()])
if args:
args = '(' + args + ')'
return '[{... |
class Contract:
"""
Model class representing a Cisco ACI Contract
"""
def __init__(self, uid, name, dn):
self.uid = uid
self.name = name
self.dn = dn
def equals(self, con):
return self.dn == con.dn
| class Contract:
"""
Model class representing a Cisco ACI Contract
"""
def __init__(self, uid, name, dn):
self.uid = uid
self.name = name
self.dn = dn
def equals(self, con):
return self.dn == con.dn |
"""Routes and URIs."""
def includeme(config):
"""Add routes and their URIs."""
config.add_static_view('static', 'static', cache_max_age=3600)
config.add_route('home', '/')
config.add_route('about', '/about')
config.add_route('details', '/journal/{id:\d+}')
config.add_route('create', '/journal/... | """Routes and URIs."""
def includeme(config):
"""Add routes and their URIs."""
config.add_static_view('static', 'static', cache_max_age=3600)
config.add_route('home', '/')
config.add_route('about', '/about')
config.add_route('details', '/journal/{id:\\d+}')
config.add_route('create', '/journal/... |
def find_metric_transformation_by_name(metric_transformations, metric_name):
for metric in metric_transformations:
if metric["metricName"] == metric_name:
return metric
def find_metric_transformation_by_namespace(metric_transformations, metric_namespace):
for metric in metric_transformatio... | def find_metric_transformation_by_name(metric_transformations, metric_name):
for metric in metric_transformations:
if metric['metricName'] == metric_name:
return metric
def find_metric_transformation_by_namespace(metric_transformations, metric_namespace):
for metric in metric_transformation... |
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# metrics namespaced under 'scylla'
SCYLLA_ALIEN = {
'scylla_alien_receive_batch_queue_length': 'alien.receive_batch_queue_length',
'scylla_alien_total_received_messages': 'alien.total_received_me... | scylla_alien = {'scylla_alien_receive_batch_queue_length': 'alien.receive_batch_queue_length', 'scylla_alien_total_received_messages': 'alien.total_received_messages', 'scylla_alien_total_sent_messages': 'alien.total_sent_messages'}
scylla_batchlog = {'scylla_batchlog_manager_total_write_replay_attempts': 'batchlog_man... |
# List of tables that should be routed to this app.
# Note that this is not intended to be a complete list of the available tables.
TABLE_NAMES = (
'lemma',
'inflection',
'aspect_pair',
)
| table_names = ('lemma', 'inflection', 'aspect_pair') |
nome = []
temp = []
pesoMaior = pesoMenor = 0
count = 1
while True:
temp.append(str(input('Nome: ')))
temp.append(float(input('Peso: ')))
if count == 1:
pesoMaior = pesoMenor = temp[1]
else:
if temp[1] >= pesoMaior:
pesoMaior = temp[1]
elif temp[1] <= pesoMenor:
... | nome = []
temp = []
peso_maior = peso_menor = 0
count = 1
while True:
temp.append(str(input('Nome: ')))
temp.append(float(input('Peso: ')))
if count == 1:
peso_maior = peso_menor = temp[1]
elif temp[1] >= pesoMaior:
peso_maior = temp[1]
elif temp[1] <= pesoMenor:
peso_menor =... |
tcase = int(input())
while(tcase):
str= input() [::-1]
print(int(str))
tcase -= 1 | tcase = int(input())
while tcase:
str = input()[::-1]
print(int(str))
tcase -= 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.