content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
beggars_jobs = [int(x) for x in input().split(", ")]
count_of_beggars = int(input())
final_list = []
for num in range(count_of_beggars):
jobs = 0
for index in range(num, len(beggars_jobs), count_of_beggars):
jobs += beggars_jobs[index]
final_list.append(jobs)
print(final_list)
| beggars_jobs = [int(x) for x in input().split(', ')]
count_of_beggars = int(input())
final_list = []
for num in range(count_of_beggars):
jobs = 0
for index in range(num, len(beggars_jobs), count_of_beggars):
jobs += beggars_jobs[index]
final_list.append(jobs)
print(final_list) |
try:
raise
except:
pass
try:
raise NotImplementedError('User Defined Error Message.')
except NotImplementedError as err:
print('NotImplementedError')
except:
print('Error :')
try:
raise KeyError('missing key')
except KeyError as ex:
print('KeyError')
except:
print('Error :')
try:
... | try:
raise
except:
pass
try:
raise not_implemented_error('User Defined Error Message.')
except NotImplementedError as err:
print('NotImplementedError')
except:
print('Error :')
try:
raise key_error('missing key')
except KeyError as ex:
print('KeyError')
except:
print('Error :')
try:
... |
N = int(input())
combined_length = 0
for _ in range(N):
length = int(input())
combined_length += length
print(combined_length - (N-1))
| n = int(input())
combined_length = 0
for _ in range(N):
length = int(input())
combined_length += length
print(combined_length - (N - 1)) |
class Resort:
def __init__(self):
self._mysql = False
self._postgres = False
self._borg = False
def name(self, name):
self._name = name
return self
def appendName(self, text):
return text+self._name
return self
def storage(self, storage):
... | class Resort:
def __init__(self):
self._mysql = False
self._postgres = False
self._borg = False
def name(self, name):
self._name = name
return self
def append_name(self, text):
return text + self._name
return self
def storage(self, storage):
... |
#! python3
# -*- coding: utf-8 -*-
def method(args1='sample2'):
print(args1 + " is runned")
print("")
| def method(args1='sample2'):
print(args1 + ' is runned')
print('') |
def extract_author(simple_author_1):
list_tokenize_name=simple_author_1.split("and")
if len(list_tokenize_name)>1:
authors_list = []
for tokenize_name in list_tokenize_name:
splitted=tokenize_name.split(",")
authors_list.append((splitted[0].strip(),splitted[1].strip()))
... | def extract_author(simple_author_1):
list_tokenize_name = simple_author_1.split('and')
if len(list_tokenize_name) > 1:
authors_list = []
for tokenize_name in list_tokenize_name:
splitted = tokenize_name.split(',')
authors_list.append((splitted[0].strip(), splitted[1].stri... |
class SwaggerYaml:
def __init__(self, swagger, info, schemes, basePath, produces, paths, definitions):
self.swagger = swagger
self.info = info
self.schemes = schemes
self.basePath = basePath
self.produces = produces
self.paths = paths
self.definitions = def... | class Swaggeryaml:
def __init__(self, swagger, info, schemes, basePath, produces, paths, definitions):
self.swagger = swagger
self.info = info
self.schemes = schemes
self.basePath = basePath
self.produces = produces
self.paths = paths
self.definitions = defin... |
# Temperature of an oven setting by reading from a pressure meter
r = int(input("Enter the reading:- "))
if( (r == 2) or (r == 3) ):
print("Temperature set to 500 degrees.")
elif( r==4):
print("Temperature set to 600 degrees.")
elif((r==5)or(r==6)or(r==7)):
print("Temperature set to 700 degrees.")
... | r = int(input('Enter the reading:- '))
if r == 2 or r == 3:
print('Temperature set to 500 degrees.')
elif r == 4:
print('Temperature set to 600 degrees.')
elif r == 5 or r == 6 or r == 7:
print('Temperature set to 700 degrees.')
elif r < 2 or r > 7:
print('DEFAULT:- The temperature setting is 300 degree... |
# tested
def Main():
a = 1
b = 10
c = 20
d = add(a, b, 10)
d2 = add(d, d, d)
return d2
def add(a, b, c):
result = a + b + c
return result
| def main():
a = 1
b = 10
c = 20
d = add(a, b, 10)
d2 = add(d, d, d)
return d2
def add(a, b, c):
result = a + b + c
return result |
#!/usr/bin/env python
#########################################################################################
#
# Test function sct_documentation
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2014 Polytechnique Montreal <www.neuro.polymtl.ca>
# Author: Aug... | def test(data_path):
cmd = 'sct_propseg'
return sct.run(cmd)
if __name__ == '__main__':
test() |
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... | 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 Leakage': 0.00662954, 'Peak Dynamic': 0.0, 'Runtime Dynamic': 0.0, 'Subthres... |
nilai = 9
if (nilai > 7):
print ("Selamat Anda Jadi programmer")
if (nilai > 10):
print ("Selamat Anda Jadi programmer handal") | nilai = 9
if nilai > 7:
print('Selamat Anda Jadi programmer')
if nilai > 10:
print('Selamat Anda Jadi programmer handal') |
# list all array connections
res = client.get_array_connections()
print(res)
if type(res) == pypureclient.responses.ValidResponse:
print(list(res.items))
# list all array connections with remote name "otherarray"
res = client.get_array_connections(remote_names=["otherarray"])
print(res)
if type(res) == pypureclient... | res = client.get_array_connections()
print(res)
if type(res) == pypureclient.responses.ValidResponse:
print(list(res.items))
res = client.get_array_connections(remote_names=['otherarray'])
print(res)
if type(res) == pypureclient.responses.ValidResponse:
print(list(res.items))
res = client.get_array_connections(... |
kanto, johto, hoenn = input().split()
catch_kanto, catch_johto, catch_hoenn = input().split()
total_kanto = int(kanto) + int(catch_kanto)
total_johto = int(johto) + int(catch_johto)
total_hoenn = int(hoenn) + int(catch_hoenn)
print(f"{total_kanto} {total_johto} {total_hoenn}") | (kanto, johto, hoenn) = input().split()
(catch_kanto, catch_johto, catch_hoenn) = input().split()
total_kanto = int(kanto) + int(catch_kanto)
total_johto = int(johto) + int(catch_johto)
total_hoenn = int(hoenn) + int(catch_hoenn)
print(f'{total_kanto} {total_johto} {total_hoenn}') |
{
'variables':
{
'external_libmediaserver%' : '<!(echo $LIBMEDIASERVER)',
'external_libmediaserver_include_dirs%' : '<!(echo $LIBMEDIASERVER_INCLUDE)',
},
"targets":
[
{
"target_name": "medooze-fake-h264-encoder",
"cflags":
[
"-march=native",
"-fexceptions",
"-O3",
... | {'variables': {'external_libmediaserver%': '<!(echo $LIBMEDIASERVER)', 'external_libmediaserver_include_dirs%': '<!(echo $LIBMEDIASERVER_INCLUDE)'}, 'targets': [{'target_name': 'medooze-fake-h264-encoder', 'cflags': ['-march=native', '-fexceptions', '-O3', '-g', '-Wno-unused-function -Wno-comment'], 'cflags_cc': ['-fex... |
class Solution:
def reverseVowels(self, s: str) -> str:
vowels = {"a", "e", "i", "o", "u", "A", "E", "I", "O", "U"}
ns = [e for e in s]
left, right = 0, len(s) - 1
while right > left:
while s[left] not in vowels and left < right:
left += 1
... | class Solution:
def reverse_vowels(self, s: str) -> str:
vowels = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'}
ns = [e for e in s]
(left, right) = (0, len(s) - 1)
while right > left:
while s[left] not in vowels and left < right:
left += 1
... |
def reverse(string):
return string[::-1]
print('Gimmie some word')
s = input()
print(reverse(s))
| def reverse(string):
return string[::-1]
print('Gimmie some word')
s = input()
print(reverse(s)) |
# Roman Ramirez, rr8rk@virginia.edu
# Advent of Code 2021, Day 14: Extended Polymerization
#%% LONG INPUT
my_input = []
with open('input.txt', 'r') as f:
for line in f:
my_input.append(line.strip('\n'))
#%% EXAMPLE INPUT
my_input = [
'NNCB',
'',
'CH -> B',
'HH -> N',
'CB -> H',
... | my_input = []
with open('input.txt', 'r') as f:
for line in f:
my_input.append(line.strip('\n'))
my_input = ['NNCB', '', 'CH -> B', 'HH -> N', 'CB -> H', 'NH -> C', 'HB -> C', 'HC -> B', 'HN -> C', 'NN -> C', 'BH -> H', 'NC -> B', 'NB -> B', 'BN -> B', 'BB -> N', 'BC -> B', 'CC -> N', 'CN -> C']
polymer = m... |
board = sum([list(input()) for _ in range(3)], [])
assert(board[4] == '1')
rest = list(range(2, 10))
clock = [1, 2, 5, 0, -1, 8, 3, 6, 7]
cclock = [3, 0, 1, 6, -1, 2, 7, 8, 5]
for start in [1, 3, 5, 7]:
for next_idx in [clock, cclock]:
now = start
ans = board[:]
for i in rest:
if... | board = sum([list(input()) for _ in range(3)], [])
assert board[4] == '1'
rest = list(range(2, 10))
clock = [1, 2, 5, 0, -1, 8, 3, 6, 7]
cclock = [3, 0, 1, 6, -1, 2, 7, 8, 5]
for start in [1, 3, 5, 7]:
for next_idx in [clock, cclock]:
now = start
ans = board[:]
for i in rest:
if ... |
# -*- coding: utf-8 -*-
'''
Created on 1983. 08. 09.
@author: Hye-Churn Jang, CMBU Specialist in Korea, VMware [jangh@vmware.com]
'''
name = 'Project' # custom resource name
sdk = 'vra' # imported SDK at common directory
inputs = {
'create': {
'VraManager': 'constant'
},
'read': {
... | """
Created on 1983. 08. 09.
@author: Hye-Churn Jang, CMBU Specialist in Korea, VMware [jangh@vmware.com]
"""
name = 'Project'
sdk = 'vra'
inputs = {'create': {'VraManager': 'constant'}, 'read': {}, 'update': {'VraManager': 'constant'}, 'delete': {'VraManager': 'constant'}}
properties = {'name': {'type': 'string', 'tit... |
class TextBoxBase(FocusWidget):
def getCursorPos(self):
try :
elem = self.getElement()
tr = elem.document.selection.createRange()
if tr.parentElement().uniqueID != elem.uniqueID:
return -1
return -tr.move("character", -65535)
except:
... | class Textboxbase(FocusWidget):
def get_cursor_pos(self):
try:
elem = self.getElement()
tr = elem.document.selection.createRange()
if tr.parentElement().uniqueID != elem.uniqueID:
return -1
return -tr.move('character', -65535)
except:
... |
def shape(A):
num_rows = len(A)
num_cols=len(A[0]) if A else 0
return num_rows, num_cols
A=[
[1,2,3],
[3,4,5],
[4,5,6],
[6,7,8]
]
print(shape(A))
| def shape(A):
num_rows = len(A)
num_cols = len(A[0]) if A else 0
return (num_rows, num_cols)
a = [[1, 2, 3], [3, 4, 5], [4, 5, 6], [6, 7, 8]]
print(shape(A)) |
INT_LITTLE_ENDIAN = '<i' # little-endian with 4 bytes
INT_BIG_ENDIAN = '>i' # big-endian with 4 bytes
SHORT_LITTLE_ENDIAN = '<h' # little-endian with 2 bytes
SHORT_BIG_ENDIAN = '<h' # big-endian with 2 bytes
| int_little_endian = '<i'
int_big_endian = '>i'
short_little_endian = '<h'
short_big_endian = '<h' |
'''
lab2
'''
#3.1
my_name = 'Tom'
print(my_name.upper())
#3.
my_id = 123
print(my_id)
#3.3
#123=my_id
my_id=your_id=123
print(my_id)
print(your_id)
#3.4
my_id_str = '123'
print(my_id_str)
#3.5
#print(my_name=my_id)
#3.6
print(my_name+my_id_str)
#3.7
print(my_name*3)
#3.8
print('hello, world. This is my first... | """
lab2
"""
my_name = 'Tom'
print(my_name.upper())
my_id = 123
print(my_id)
my_id = your_id = 123
print(my_id)
print(your_id)
my_id_str = '123'
print(my_id_str)
print(my_name + my_id_str)
print(my_name * 3)
print('hello, world. This is my first python string.'.split('.'))
message = "Tom's id is 123"
print(message) |
def vampire_test(x, y):
product = x * y
if len(str(x) + str(y)) != len(str(product)):
return False
for i in str(x) + str(y):
if i in str(product):
return True
else:
return False
| def vampire_test(x, y):
product = x * y
if len(str(x) + str(y)) != len(str(product)):
return False
for i in str(x) + str(y):
if i in str(product):
return True
else:
return False |
#!/usr/bin/env python
class Config(object):
GABRIEL_IP='128.2.213.107'
RECEIVE_FRAME=True
VIDEO_STREAM_PORT = 9098
RESULT_RECEIVING_PORT = 9101
TOKEN=1
| class Config(object):
gabriel_ip = '128.2.213.107'
receive_frame = True
video_stream_port = 9098
result_receiving_port = 9101
token = 1 |
def isEvilNumber(n):
count = 0
for char in str(bin(n)[2:]):
if char == '1':
count += 1
if count % 2 == 0:
return True
else:
return False
print(isEvilNumber(4)) | def is_evil_number(n):
count = 0
for char in str(bin(n)[2:]):
if char == '1':
count += 1
if count % 2 == 0:
return True
else:
return False
print(is_evil_number(4)) |
b1 >> fuzz([0, 2, 3, 5], dur=1/2, amp=0.8, lpf=linvar([100, 1000], 12), lpr=0.4, oct=3).every(16, "shuffle").every(8, "bubble")
d1 >> play("x o [xx] oxx o [xx] {oO} ", room=0.4).every(16, "shuffle")
d2 >> play("[--]", amp=[1.3, 0.5, 0.5, 0.5], hpf=linvar([6000, 10000], 8), hpr=0.4, spin=4)
p1 >> pasha([0, 2, 3, 5], dur... | b1 >> fuzz([0, 2, 3, 5], dur=1 / 2, amp=0.8, lpf=linvar([100, 1000], 12), lpr=0.4, oct=3).every(16, 'shuffle').every(8, 'bubble')
d1 >> play('x o [xx] oxx o [xx] {oO} ', room=0.4).every(16, 'shuffle')
d2 >> play('[--]', amp=[1.3, 0.5, 0.5, 0.5], hpf=linvar([6000, 10000], 8), hpr=0.4, spin=4)
p1 >> pasha([0, 2, 3, 5], d... |
class Dog:
def __init__(self, age, name, is_male, weight):
self.age = age
self.name = name
self.is_male = is_male # Boolean. True if Male, False if Female.
self.weight = weight
# Create your instance below this line
my_dog = Dog(5, "Yogi", True, 15)
| class Dog:
def __init__(self, age, name, is_male, weight):
self.age = age
self.name = name
self.is_male = is_male
self.weight = weight
my_dog = dog(5, 'Yogi', True, 15) |
# https://www.codechef.com/viewsolution/36973732
for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(n):
for j in range(i + 1, n):
if a[i] & a[j] == a[i]:
count += 1
print(count) | for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(n):
for j in range(i + 1, n):
if a[i] & a[j] == a[i]:
count += 1
print(count) |
# This should be an enum once we make our own buildkite AMI with py3
class SupportedPython:
V3_8 = "3.8.1"
V3_7 = "3.7.6"
V3_6 = "3.6.10"
V3_5 = "3.5.8"
V2_7 = "2.7.17"
SupportedPythons = [
SupportedPython.V2_7,
SupportedPython.V3_5,
SupportedPython.V3_6,
SupportedPython.V3_7,
... | class Supportedpython:
v3_8 = '3.8.1'
v3_7 = '3.7.6'
v3_6 = '3.6.10'
v3_5 = '3.5.8'
v2_7 = '2.7.17'
supported_pythons = [SupportedPython.V2_7, SupportedPython.V3_5, SupportedPython.V3_6, SupportedPython.V3_7, SupportedPython.V3_8]
supported_pythons_no38 = [SupportedPython.V2_7, SupportedPython.V3_5,... |
print(
3 + 4,
3 - 4,
3 * 4,
3 / 4,
3 ** 4,
3 // 4,
3 % 4) # 2
| print(3 + 4, 3 - 4, 3 * 4, 3 / 4, 3 ** 4, 3 // 4, 3 % 4) |
#Project Euler Problem 14
y=True
i=1
maxz=0
while i <= 1000000:
i=i+1
c=0
y=True
n=i
while y:
if n % 2 == 0:
n=n/2
else :
n=3 * n + 1
c=c+1
if c > maxz:
maxz=c
x=i
if n == 1:
y=False
print("max: ",max... | y = True
i = 1
maxz = 0
while i <= 1000000:
i = i + 1
c = 0
y = True
n = i
while y:
if n % 2 == 0:
n = n / 2
else:
n = 3 * n + 1
c = c + 1
if c > maxz:
maxz = c
x = i
if n == 1:
y = False
print('max: ... |
# -*- coding: utf-8 -*-
TESTING = True
SECURITY_PASSWORD_HASH = 'plaintext'
SQLALCHEMY_DATABASE_URI = 'sqlite://'
SLIM_FILE_LOGGING_LEVEL = None
# LOGIN_DISABLED = True
# PRESERVE_CONTEXT_ON_EXCEPTION = False
| testing = True
security_password_hash = 'plaintext'
sqlalchemy_database_uri = 'sqlite://'
slim_file_logging_level = None |
# File: atbash_cipher.py
# Purpose: Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Thursday 3rd September 2016, 09:15 PM
alpha = "abcdefghijklmnopqrstuvwxyz"
rev = list(alpha)[::-1]
sto... | alpha = 'abcdefghijklmnopqrstuvwxyz'
rev = list(alpha)[::-1]
store = dict(zip(alpha, rev))
def decode(string):
dec = ''
for x in string:
dec += str(store[x])
return dec
def encode(string):
enc = ''
for x in string:
enc += str(store.keys[x])
return enc |
def _root_path(f):
if f.is_source:
return f.owner.workspace_root
return "/".join([f.root.path, f.owner.workspace_root])
def _colon_paths(data):
return ":".join([
f.path
for f in sorted(data)
])
def encode_named_generators(named_generators):
return ",".join([k + "=" + v for ... | def _root_path(f):
if f.is_source:
return f.owner.workspace_root
return '/'.join([f.root.path, f.owner.workspace_root])
def _colon_paths(data):
return ':'.join([f.path for f in sorted(data)])
def encode_named_generators(named_generators):
return ','.join([k + '=' + v for (k, v) in sorted(named... |
class DBRouter(object):
def db_for_read(self, model, **hints):
if model._meta.app_label == 'panglao':
return 'panglao'
if model._meta.app_label == 'cheapcdn':
return 'cheapcdn'
if model._meta.app_label == 'lifecycle':
return 'lifecycle'
return 'def... | class Dbrouter(object):
def db_for_read(self, model, **hints):
if model._meta.app_label == 'panglao':
return 'panglao'
if model._meta.app_label == 'cheapcdn':
return 'cheapcdn'
if model._meta.app_label == 'lifecycle':
return 'lifecycle'
return 'de... |
# -*- coding: utf-8 -*-
def echofilter():
print("OK, 'echofilter()' function executed!")
| def echofilter():
print("OK, 'echofilter()' function executed!") |
test_cases = int(input().strip())
def recursion(n, value):
global result
if value >= result:
return
if n == N:
result = min(result, value)
return
for i in range(N):
if not visited[i]:
visited[i] = True
recursion(n + 1, value + mat[n][i])
... | test_cases = int(input().strip())
def recursion(n, value):
global result
if value >= result:
return
if n == N:
result = min(result, value)
return
for i in range(N):
if not visited[i]:
visited[i] = True
recursion(n + 1, value + mat[n][i])
... |
class LRUCache:
def __init__(self, capacity: int):
self.capacity = capacity
self.items = []
self.indexes = dict()
def get(self, key: int) -> int:
if self.indexes.get(key) is None:
return -1
index = self.indexes[key]
value = self.items[index]... | class Lrucache:
def __init__(self, capacity: int):
self.capacity = capacity
self.items = []
self.indexes = dict()
def get(self, key: int) -> int:
if self.indexes.get(key) is None:
return -1
index = self.indexes[key]
value = self.items[index]
... |
# coding=utf-8
# autogenerated using ms_props_generator.py
DATA_TYPE_MAP = {
"0x0000": "PtypUnspecified",
"0x0001": "PtypNull",
"0x0002": "PtypInteger16",
"0x0003": "PtypInteger32",
"0x0004": "PtypFloating32",
"0x0005": "PtypFloating64",
"0x0006": "PtypCurrency",
"0x0007": "PtypFloating... | data_type_map = {'0x0000': 'PtypUnspecified', '0x0001': 'PtypNull', '0x0002': 'PtypInteger16', '0x0003': 'PtypInteger32', '0x0004': 'PtypFloating32', '0x0005': 'PtypFloating64', '0x0006': 'PtypCurrency', '0x0007': 'PtypFloatingTime', '0x000A': 'PtypErrorCode', '0x000B': 'PtypBoolean', '0x000D': 'PtypObject', '0x0014': ... |
print(' a string that you "dont" have to escape \n This \n is a multi-line \n heredoc string -------> example')
| print(' a string that you "dont" have to escape \n This \n is a multi-line \n heredoc string -------> example') |
def GetXSection(fileName): #[pb]
if fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_mtop1695_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8") !=-1 : return 70.89
elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_mtop1715_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8") !=-1 : return 69.66
elif fil... | def get_x_section(fileName):
if fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_mtop1695_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8') != -1:
return 70.89
elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_mtop1715_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8') != -1:
return... |
#
# PySNMP MIB module HH3C-LswMAM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-LswMAM-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:15:14 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... | (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, single_value_constraint, constraints_intersection, value_size_constraint, constraints_union) ... |
#
# elkme - the command-line sms utility
# see main.py for the main entry-point
#
__version__ = '0.6.0'
__release_date__ = '2017-07-17'
| __version__ = '0.6.0'
__release_date__ = '2017-07-17' |
#
# add leapfrog's template loader
#
TEMPLATE_LOADERS = (
'leapfrog.loaders.Loader',
# then the default template loaders
# ...
)
#
# enable the leapfrog app
#
INSTALLED_APPS = (
# ...
# all your other apps, plus south and the sentry apps:
'south',
'indexer',
'paging',
'sentry',
... | template_loaders = ('leapfrog.loaders.Loader',)
installed_apps = ('south', 'indexer', 'paging', 'sentry', 'sentry.client', 'leapfrog')
template_context_processors = ('django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_process... |
class BinaryOption:
def __init__(self):
self.__data = None
def SetData(self, bit):
self.__data = bit
def Has(self, value):
return (self.__data & value)
def Set(self, value):
self.__data = self.__data | value
@staticmethod
def Create(value):
... | class Binaryoption:
def __init__(self):
self.__data = None
def set_data(self, bit):
self.__data = bit
def has(self, value):
return self.__data & value
def set(self, value):
self.__data = self.__data | value
@staticmethod
def create(value):
result = bi... |
#!/usr/bin/env python3
n, p, *a = map(int, open(0).read().split())
c = 0
for a, b in zip(a, a[n:]):
c += min(p+a, b)
p = a - max(min(b-p, a), 0)
print(c) | (n, p, *a) = map(int, open(0).read().split())
c = 0
for (a, b) in zip(a, a[n:]):
c += min(p + a, b)
p = a - max(min(b - p, a), 0)
print(c) |
var2 = {
# Video Only files
'.webm' : ('WebM', 'Free and libre format created for HTML5 video.'),
'.mkv' : ('Matroska', ''),
'.flv' : ('Flash Video', 'Use of the H.264 and AAC compression formats in the FLV file format has some limitations and authors of Flash Player strongly encourage everyone to embrace the new stan... | var2 = {'.webm': ('WebM', 'Free and libre format created for HTML5 video.'), '.mkv': ('Matroska', ''), '.flv': ('Flash Video', 'Use of the H.264 and AAC compression formats in the FLV file format has some limitations and authors of Flash Player strongly encourage everyone to embrace the new standard F4V file format.[2]... |
def example_1():
###### 0123456789012345678901234567890123456789012345678901234567890
record = ' 100 513.25 '
cost = int(record[20:32]) * float(record[40:48])
print(cost)
SHARES = slice(20, 32)
PRICE = slice(40, 48)
cost = int(record[SHARE... | def example_1():
record = ' 100 513.25 '
cost = int(record[20:32]) * float(record[40:48])
print(cost)
shares = slice(20, 32)
price = slice(40, 48)
cost = int(record[SHARES]) * float(record[PRICE])
print(cost)
def example_2():
items = [0, ... |
name = 'Escape'
movies = [
{'title': 'My Neighbor Totoro', 'year': '1988'},
{'title': 'Dead Poets Society', 'year': '1989'},
{'title': 'A Perfect World', 'year': '1993'},
{'title': 'Leon', 'year': '1994'},
{'title': 'Mahjong', 'year': '1996'},
{'title': 'Swallowtail Butterfly', 'year': '1996'},... | name = 'Escape'
movies = [{'title': 'My Neighbor Totoro', 'year': '1988'}, {'title': 'Dead Poets Society', 'year': '1989'}, {'title': 'A Perfect World', 'year': '1993'}, {'title': 'Leon', 'year': '1994'}, {'title': 'Mahjong', 'year': '1996'}, {'title': 'Swallowtail Butterfly', 'year': '1996'}, {'title': 'King of Comedy... |
def calculated_quadratic_equation(a = 0, b = 0, c = 0):
r = a ** 2 + b + c
return r
print(calculated_quadratic_equation())
| def calculated_quadratic_equation(a=0, b=0, c=0):
r = a ** 2 + b + c
return r
print(calculated_quadratic_equation()) |
# %%
__depends__ = []
__dest__ = ['../../data/']
# %% | __depends__ = []
__dest__ = ['../../data/'] |
class WorkCli:
def __init__(self, workbranch):
self.workbranch = workbranch
def add_subparser(self, subparsers):
work_parser = subparsers.add_parser('work', help="Keep track of a currently important branch")
work_parser.add_argument("current", nargs="?", type=str, default=None, help="... | class Workcli:
def __init__(self, workbranch):
self.workbranch = workbranch
def add_subparser(self, subparsers):
work_parser = subparsers.add_parser('work', help='Keep track of a currently important branch')
work_parser.add_argument('current', nargs='?', type=str, default=None, help='S... |
class Scope:
def __init__ (self, parent=None):
self.parent = parent
self.elements = dict()
def get_element (self, name, type, current=False):
r = self.elements.get(type, None)
if r != None:
r = r.get(name, None)
if r == None and self.parent ... | class Scope:
def __init__(self, parent=None):
self.parent = parent
self.elements = dict()
def get_element(self, name, type, current=False):
r = self.elements.get(type, None)
if r != None:
r = r.get(name, None)
if r == None and self.parent != None and (not cu... |
# Fibonacci: Sum of the last two numbers gives the next one.
# Series: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610 .....
# Works only with positive integers
# Step1: Recursive Case
# fibonacci(n) = fibonacci(n-1) + fibonacci(n-2)
# Step2: Base Case
# fibonacci(0) = 0
# fibonacci(1) = 1
# S... | def fibonacci(n):
if n in [0, 1]:
return n
else:
return fibonacci(n - 1) + fibonacci(n - 2)
def is_int(n, is_pos=False):
try:
n = int(n)
if is_pos:
if n > 0:
return True
else:
return False
else:
retu... |
'''
URL: https://leetcode.com/problems/count-the-number-of-consistent-strings/
Difficulty: Easy
Description: Count the Number of Consistent Strings
You are given a string allowed consisting of distinct characters and an array of strings words. A string is consistent if all characters in the string appear in the stri... | """
URL: https://leetcode.com/problems/count-the-number-of-consistent-strings/
Difficulty: Easy
Description: Count the Number of Consistent Strings
You are given a string allowed consisting of distinct characters and an array of strings words. A string is consistent if all characters in the string appear in the stri... |
board_width, board_length = list(map(int, input().split()))
domino_length = 2
if board_width % 2 == 0:
print((board_width // domino_length) * board_length)
elif board_length % 2 == 0:
print((board_length // domino_length) * board_width)
else:
print((board_width * board_length) // domino_length)
| (board_width, board_length) = list(map(int, input().split()))
domino_length = 2
if board_width % 2 == 0:
print(board_width // domino_length * board_length)
elif board_length % 2 == 0:
print(board_length // domino_length * board_width)
else:
print(board_width * board_length // domino_length) |
class VehiclesDataset:
def __init__(self):
self.num_vehicle = 0
self.num_object = 0
self.num_object_with_kp = 0
self.vehicles = dict()
self.valid_ids = set()
self.mean_shape = None
self.pca_comp = None
self.camera_mtx = None
self.image_names = ... | class Vehiclesdataset:
def __init__(self):
self.num_vehicle = 0
self.num_object = 0
self.num_object_with_kp = 0
self.vehicles = dict()
self.valid_ids = set()
self.mean_shape = None
self.pca_comp = None
self.camera_mtx = None
self.image_names =... |
class UrineProcessorAssembly:
name = "Urine Processor Assembly"
params = [
{
"key": "max_urine_consumed_per_hour",
"label": "",
"units": "kg/hr",
"private": False,
"value": 0.375,
"confidence": 0,
"notes": "9 kg/day / 24... | class Urineprocessorassembly:
name = 'Urine Processor Assembly'
params = [{'key': 'max_urine_consumed_per_hour', 'label': '', 'units': 'kg/hr', 'private': False, 'value': 0.375, 'confidence': 0, 'notes': '9 kg/day / 24 per wikipedia', 'source': 'https://en.wikipedia.org/wiki/ISS_ECLSS'}, {'key': 'min_urine_cons... |
n=6
while n >0:
n-=1
if n % 2 ==0:
print(n, end ="")
if n % 3 == 0:
print(n, end='') | n = 6
while n > 0:
n -= 1
if n % 2 == 0:
print(n, end='')
if n % 3 == 0:
print(n, end='') |
#https://www.wwpdb.org/documentation/file-format-content/format23/v2.3.html
def line_is_ATOM_record(line):
return line.startswith('ATOM ')
def line_is_HETATM_record(line):
return line.startswith('HETATM')
def get_fields_from_ATOM_record(record):
fields={}
fields['ATOM '] = record[0:6]
fields... | def line_is_atom_record(line):
return line.startswith('ATOM ')
def line_is_hetatm_record(line):
return line.startswith('HETATM')
def get_fields_from_atom_record(record):
fields = {}
fields['ATOM '] = record[0:6]
fields['serial'] = int(record[6:11])
fields['name'] = record[12:16]
fields['... |
class Calculator:
def __init__(self):
self.calculation = 0
self.operation = None
def plus(self, num):
self.calculation += num
def minus(self, num):
self.calculation -= num
def multiply(self, num):
self.calculation *= num
def divide(self, num):
... | class Calculator:
def __init__(self):
self.calculation = 0
self.operation = None
def plus(self, num):
self.calculation += num
def minus(self, num):
self.calculation -= num
def multiply(self, num):
self.calculation *= num
def divide(self, num):
sel... |
# Apache License Version 2.0
#
# Copyright (c) 2021., Redis Labs Modules
# All rights reserved.
#
def create_extract_arguments(parser):
parser.add_argument(
"--redis-url",
type=str,
default="redis://localhost:6379",
help="The url for Redis connection",
)
parser.add_argum... | def create_extract_arguments(parser):
parser.add_argument('--redis-url', type=str, default='redis://localhost:6379', help='The url for Redis connection')
parser.add_argument('--output-tags-json', type=str, default='extracted_tags.json', help='output filename containing the extracted tags from redis.')
parse... |
####################################################################
#
# Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Filename - globaldefinesrsaformat.py
# Description - This file contains global defines used in the RSA
# F... | param_mod = 1
param_priv_exp = 2
param_exp = 3
pem_start = '-----BEGIN RSA PRIVATE KEY-----\n'
pem_end = '\n-----END RSA PRIVATE KEY-----\n'
pem_header_size_bytes = 4
pem_version_size_bytes = 3
param_header_integer_type = 2
param_length_indication_bit = 7
param_length_indication = 1 << PARAM_LENGTH_INDICATION_BIT
param... |
class Trie(object):
def __init__(self):
self.child = {}
def insert(self, word):
word = word.strip()
current = self.child
for l in word:
if l not in current:
current[l] = {}
current = current[l]
current['#']=1
def search(self, word):
word = wo... | class Trie(object):
def __init__(self):
self.child = {}
def insert(self, word):
word = word.strip()
current = self.child
for l in word:
if l not in current:
current[l] = {}
current = current[l]
current['#'] = 1
def search(sel... |
def SB_BinaryStats(y,binaryMethod = 'diff'):
yBin = BF_Binarize(y,binaryMethod)
N = len(yBin)
outDict = {}
outDict['pupstat2'] = np.sum((yBin[math.floor(N /2):] == 1)) / np.sum((yBin[:math.floor(N /2)] == 1))
stretch1 = []
stretch0 = []
count = 1
for i in range(1,N):
if... | def sb__binary_stats(y, binaryMethod='diff'):
y_bin = bf__binarize(y, binaryMethod)
n = len(yBin)
out_dict = {}
outDict['pupstat2'] = np.sum(yBin[math.floor(N / 2):] == 1) / np.sum(yBin[:math.floor(N / 2)] == 1)
stretch1 = []
stretch0 = []
count = 1
for i in range(1, N):
if yBin[... |
#
# PySNMP MIB module LINKSYS-WLAN-ACCESS-POINT-REF-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/LINKSYS-WLAN-ACCESS-POINT-REF-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:07:23 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using P... | (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_union, value_range_constraint, constraints_intersection, value_size_constraint) ... |
print("The variable Pp/Ptot, i.e. the fraction of paused polymerases, seems to provide the best contrast between its minimal and maximal values as K_3 varies, regardless of the values of K_1 and K_2. In this example, it is not very surprising. Sometimes it is more difficult to find which model output is the most sensit... | print('The variable Pp/Ptot, i.e. the fraction of paused polymerases, seems to provide the best contrast between its minimal and maximal values as K_3 varies, regardless of the values of K_1 and K_2. In this example, it is not very surprising. Sometimes it is more difficult to find which model output is the most sensit... |
def F():
a,b = 0,1
while True:
yield a
a, b = b, a + b
def SubFib(startNumber, endNumber):
for cur in F():
if cur > endNumber: return
if cur >= startNumber:
yield cur
# for i in SubFib(10, 200):
# print(i)
def fib(x):
if x < 2:
return [i for i... | def f():
(a, b) = (0, 1)
while True:
yield a
(a, b) = (b, a + b)
def sub_fib(startNumber, endNumber):
for cur in f():
if cur > endNumber:
return
if cur >= startNumber:
yield cur
def fib(x):
if x < 2:
return [i for i in range(x + 1)]
a... |
#!/usr/bin/python3
Rectangle = __import__('2-rectangle').Rectangle
my_rectangle = Rectangle(2, 4)
print("Area: {} - Perimeter: {}".format(my_rectangle.area(), my_rectangle.perimeter()))
print("--")
my_rectangle.width = 10
my_rectangle.height = 3
print("Area: {} - Perimeter: {}".format(my_rectangle.area(), my_rectang... | rectangle = __import__('2-rectangle').Rectangle
my_rectangle = rectangle(2, 4)
print('Area: {} - Perimeter: {}'.format(my_rectangle.area(), my_rectangle.perimeter()))
print('--')
my_rectangle.width = 10
my_rectangle.height = 3
print('Area: {} - Perimeter: {}'.format(my_rectangle.area(), my_rectangle.perimeter())) |
a = b = c = d = e = f = 12
x, y = 1, 2 # unpacking tuple
print(x)
print(y)
print('unpack tuple - or any sequence type')
data = (1, 2, 3)
a, b, c = data
print(a)
print(b)
print(c)
print('unpack list - or any sequence type')
data_list = [4, 5, 6]
a, b, c = data_list
print(a)
print(b)
print(c)
| a = b = c = d = e = f = 12
(x, y) = (1, 2)
print(x)
print(y)
print('unpack tuple - or any sequence type')
data = (1, 2, 3)
(a, b, c) = data
print(a)
print(b)
print(c)
print('unpack list - or any sequence type')
data_list = [4, 5, 6]
(a, b, c) = data_list
print(a)
print(b)
print(c) |
def calcu():
pass
def calc_add(a,b):
return a+b
def calc_minus(a,b):
return a-b
| def calcu():
pass
def calc_add(a, b):
return a + b
def calc_minus(a, b):
return a - b |
def has_cycle(head):
slowref=head
if not slowref or not slowref.next:
return False
fastref=head.next.next
while slowref != fastref:
slowref=slowref.next
if not slowref or not slowref.next:
return False
fastref=fastref.next.next
return True | def has_cycle(head):
slowref = head
if not slowref or not slowref.next:
return False
fastref = head.next.next
while slowref != fastref:
slowref = slowref.next
if not slowref or not slowref.next:
return False
fastref = fastref.next.next
return True |
def main():
# input
S = list(input())
# compute
N = len(S)
cnt = 0
while ''.join(S).count('BW') != 0:
for i in range(N-1):
if S[i]=='B' and S[i+1]=='W':
S[i], S[i+1] = S[i+1], S[i]
cnt += 1
print(cnt, ''.join(S))
# output
... | def main():
s = list(input())
n = len(S)
cnt = 0
while ''.join(S).count('BW') != 0:
for i in range(N - 1):
if S[i] == 'B' and S[i + 1] == 'W':
(S[i], S[i + 1]) = (S[i + 1], S[i])
cnt += 1
print(cnt, ''.join(S))
print(cnt)
if __name_... |
class Solution:
def reverse(self, x: int) -> int:
# get the sign of x
if x == 0:
return x
sign = abs(x) / x
x = abs(x)
# reverse number
num = 0
# reverse process
while x != 0:
temp = x % 10
num = num * 10 + temp
... | class Solution:
def reverse(self, x: int) -> int:
if x == 0:
return x
sign = abs(x) / x
x = abs(x)
num = 0
while x != 0:
temp = x % 10
num = num * 10 + temp
x = x // 10
num = int(sign * num)
return num if -2 ** ... |
#* Asked in Uber
#? You are given a string of parenthesis. Return the minimum number of parenthesis that would need to be removed
#? in order to make the string valid. "Valid" means that each open parenthesis has a matching closed parenthesis.
#! Example:
# "()())()"
#? The following input should return 1.
# ")"... | def count_invalid_parenthesis(string):
count = 0
for i in string:
if i == '(' or i == '[' or i == '{':
count += 1
elif i == ')' or i == ']' or i == '}':
count -= 1
return abs(count)
print(count_invalid_parenthesis('()())()')) |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/config.ipynb (unless otherwise specified).
__all__ = ['AppConfig', 'PathConfig', 'TrainConfig']
# Cell
class AppConfig:
SEED = 8080
NUM_CLASSES = 7
class PathConfig:
# DATA_PATH = '/content/data'
# IMAGE_PATH = '/content/data/images'
# ... | __all__ = ['AppConfig', 'PathConfig', 'TrainConfig']
class Appconfig:
seed = 8080
num_classes = 7
class Pathconfig:
data_path = '/Work/Workspace/ML/HAM10000/data'
image_path = DATA_PATH + '/images'
csv_path = DATA_PATH + '/HAM10000_metadata.csv'
class Trainconfig:
batch_size = 64
epochs =... |
#accessibility numbers for science. Pretty sure fosscord just hardcodes this as 128.
class ACCESSIBILITY_FEATURES:
SCREENREADER = 1 << 0
REDUCED_MOTION = 1 << 1
REDUCED_TRANSPARENCY = 1 << 2
HIGH_CONTRAST = 1 << 3
BOLD_TEXT = 1 << 4
GRAYSCALE = 1 << 5
INVERT_COLORS = 1 << 6
PREFERS_COLOR_SCHEME_LIGHT = 1 << 7
... | class Accessibility_Features:
screenreader = 1 << 0
reduced_motion = 1 << 1
reduced_transparency = 1 << 2
high_contrast = 1 << 3
bold_text = 1 << 4
grayscale = 1 << 5
invert_colors = 1 << 6
prefers_color_scheme_light = 1 << 7
prefers_color_scheme_dark = 1 << 8
chat_font_scale_inc... |
#!/usr/bin/python
# --------------------------------------- #
# Cara Define Sebuah Function pada Python #
# --------------------------------------- #
# def functionname( parameters ): #
# "function_docstring" #
# function_suite #
# return [expression] #
# --------------------------... | def changeme(mylist):
"""This changes a passed list into this function"""
mylist.append([1, 2, 3, 4])
print('Values inside the function: ', mylist)
return
mylist = [10, 20, 30]
changeme(mylist)
print('Values outside the function: ', mylist) |
class Custom(
):
pass | class Custom:
pass |
def primitive_triplets():
pass
def triplets_in_range():
pass
def is_triplet():
pass
| def primitive_triplets():
pass
def triplets_in_range():
pass
def is_triplet():
pass |
n, m = map(int, input().split())
for i in range(n):
if i % 2 == 0:
print('#' * m)
else:
if (i + 1) % 4 == 0:
print('#' + '.' * (m - 1))
else:
print('.' * (m - 1) + '#') | (n, m) = map(int, input().split())
for i in range(n):
if i % 2 == 0:
print('#' * m)
elif (i + 1) % 4 == 0:
print('#' + '.' * (m - 1))
else:
print('.' * (m - 1) + '#') |
# Copyright 2015 VMware, 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 appl... | compact = 'compact'
large = 'large'
xlarge = 'xlarge'
quadlarge = 'quadlarge'
service_edge = 'service'
vdr_edge = 'vdr'
inter_edge_purpose = 'inter_edge_net' |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
fb_native = struct(
android_aar = native.android_aar,
android_app_modularity = native.android_app_modularity,
android_binary = nat... | fb_native = struct(android_aar=native.android_aar, android_app_modularity=native.android_app_modularity, android_binary=native.android_binary, android_build_config=native.android_build_config, android_bundle=native.android_bundle, android_instrumentation_apk=native.android_instrumentation_apk, android_instrumentation_t... |
def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Education, obj[4]: Occupation, obj[5]: Bar, obj[6]: Coffeehouse, obj[7]: Restaurant20to50, obj[8]: Direction_same, obj[9]: Distance
# {"feature": "Coupon", "instances": 8148, "metric_value": 0.4751, "depth": 1}
if obj[2]>1:
# {"feature... | def find_decision(obj):
if obj[2] > 1:
if obj[6] > 0.0:
if obj[9] <= 2:
if obj[0] <= 2:
if obj[1] <= 3:
if obj[5] <= 3.0:
if obj[8] <= 0:
if obj[4] > 0:
... |
del_items(0x80124F0C)
SetType(0x80124F0C, "void GameOnlyTestRoutine__Fv()")
del_items(0x80124F14)
SetType(0x80124F14, "int vecleny__Fii(int a, int b)")
del_items(0x80124F38)
SetType(0x80124F38, "int veclenx__Fii(int a, int b)")
del_items(0x80124F64)
SetType(0x80124F64, "void GetDamageAmt__FiPiT1(int i, int *mind, int *... | del_items(2148683532)
set_type(2148683532, 'void GameOnlyTestRoutine__Fv()')
del_items(2148683540)
set_type(2148683540, 'int vecleny__Fii(int a, int b)')
del_items(2148683576)
set_type(2148683576, 'int veclenx__Fii(int a, int b)')
del_items(2148683620)
set_type(2148683620, 'void GetDamageAmt__FiPiT1(int i, int *mind, i... |
info = {
'driver_path' : "\\\\webdriver\\\\content\\\\geckodriver.exe",
'profile_path' : "\\\\webdriver\\\\content\\\\firefox_profile",
'primary_url' : "https://web.whatsapp.com",
'send_url' : "https://web.whatsapp.com/send?phone={}&text={}",
'send_button_class_name' : "_2Ujuu"
}
| info = {'driver_path': '\\\\webdriver\\\\content\\\\geckodriver.exe', 'profile_path': '\\\\webdriver\\\\content\\\\firefox_profile', 'primary_url': 'https://web.whatsapp.com', 'send_url': 'https://web.whatsapp.com/send?phone={}&text={}', 'send_button_class_name': '_2Ujuu'} |
config = {
"colors": {
"WHITE": (255, 255, 255),
"RED": (255, 0, 0),
"GREEN": (0, 255, 0),
"BLACK": (0, 0, 0)
},
"globals": {
"WIDTH": 600,
"HEIGHT": 400,
"BALL_RADIUS": 20,
"PAD_WIDTH": 8,
"PAD_HEIGHT": 80
}
}
| config = {'colors': {'WHITE': (255, 255, 255), 'RED': (255, 0, 0), 'GREEN': (0, 255, 0), 'BLACK': (0, 0, 0)}, 'globals': {'WIDTH': 600, 'HEIGHT': 400, 'BALL_RADIUS': 20, 'PAD_WIDTH': 8, 'PAD_HEIGHT': 80}} |
#!/usr/bin/env python
# Income Share Agreement
min = 50000.0
max = 88235.3
max_pay = 30000.0
max_income = 2117647.06
monthly_increment = (max - min)/23
print('\n24 months maximum payment with a minimum of $50,000 annual income')
print('Maximum income for 24 month repayment is $88,235.30\n')
print('For incomes exc... | min = 50000.0
max = 88235.3
max_pay = 30000.0
max_income = 2117647.06
monthly_increment = (max - min) / 23
print('\n24 months maximum payment with a minimum of $50,000 annual income')
print('Maximum income for 24 month repayment is $88,235.30\n')
print('For incomes exceeding $88,235.30 see chart below,\nfor reduced pa... |
#
# PySNMP MIB module IANA-IPPM-METRICS-REGISTRY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IANA-IPPM-METRICS-REGISTRY-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:38:44 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python ... | (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, value_size_constraint, single_value_constraint, constraints_intersection, constraints_union) ... |
# colorsystem.py is the full list of colors that can be used to easily create themes.
class Gray:
B0 = '#000000'
B10 = '#19232D'
B20 = '#293544'
B30 = '#37414F'
B40 = '#455364'
B50 = '#54687A'
B60 = '#60798B'
B70 = '#788D9C'
B80 = '#9DA9B5'
B90 = '#ACB1B6'
B100 = '#B9BDC1'
... | class Gray:
b0 = '#000000'
b10 = '#19232D'
b20 = '#293544'
b30 = '#37414F'
b40 = '#455364'
b50 = '#54687A'
b60 = '#60798B'
b70 = '#788D9C'
b80 = '#9DA9B5'
b90 = '#ACB1B6'
b100 = '#B9BDC1'
b110 = '#C9CDD0'
b120 = '#CED1D4'
b130 = '#E0E1E3'
b140 = '#FAFAFA'
... |
# Power Drive System
# Controlword common bits.
IL_MC_CW_SO = (1 << 0)
IL_MC_CW_EV = (1 << 1)
IL_MC_CW_QS = (1 << 2)
IL_MC_CW_EO = (1 << 3)
IL_MC_CW_FR = (1 << 7)
IL_MC_CW_H = (1 << 8)
# Statusword common bits.
IL_MC_SW_RTSO = (1 << 0)
IL_MC_SW_SO = (1 << 1)
IL_MC_SW_OE = (1 << 2)
IL_MC_SW_F = (1 << 3)
IL_MC_SW_VE = (1... | il_mc_cw_so = 1 << 0
il_mc_cw_ev = 1 << 1
il_mc_cw_qs = 1 << 2
il_mc_cw_eo = 1 << 3
il_mc_cw_fr = 1 << 7
il_mc_cw_h = 1 << 8
il_mc_sw_rtso = 1 << 0
il_mc_sw_so = 1 << 1
il_mc_sw_oe = 1 << 2
il_mc_sw_f = 1 << 3
il_mc_sw_ve = 1 << 4
il_mc_sw_qs = 1 << 5
il_mc_sw_sod = 1 << 6
il_mc_sw_w = 1 << 7
il_mc_sw_rm = 1 << 9
il_mc... |
class base_graph_style():
NAME:str = ''
class default_graph_style(base_graph_style):
NAME:str = 'default'
# Task Nodes:
TASK_NODE_STYLE = 'filled'
TASK_NODE_SHAPE = 'box3d'
TASK_NODE_PENWIDTH = 1,
TASK_NODE_FONTCOLOR = 'black'
DISABLED_TASK_COLOR = 'dimgrey'
DISABLED_TASK_FONTCOL... | class Base_Graph_Style:
name: str = ''
class Default_Graph_Style(base_graph_style):
name: str = 'default'
task_node_style = 'filled'
task_node_shape = 'box3d'
task_node_penwidth = (1,)
task_node_fontcolor = 'black'
disabled_task_color = 'dimgrey'
disabled_task_fontcolor = TASK_NODE_FONT... |
num1 = int(input('Enter number 1: '))
num2 = int(input('Enter number 2: '))
num3 = int(input('Enter number 3: '))
if num1 > num2 and num1 > num3:
print(str(num1) + ' is the greatest!')
if num2 > num3 and num2 > num1:
print(str(num2) + ' is the greatest!')
if num3 > num1 and num3 > num2:
print(str(num3) +... | num1 = int(input('Enter number 1: '))
num2 = int(input('Enter number 2: '))
num3 = int(input('Enter number 3: '))
if num1 > num2 and num1 > num3:
print(str(num1) + ' is the greatest!')
if num2 > num3 and num2 > num1:
print(str(num2) + ' is the greatest!')
if num3 > num1 and num3 > num2:
print(str(num3) + ' ... |
MainWindow.clearData()
MainWindow.openPost3D()
PostProcess.script_openFile(-1,"Post3D","%examplesPath%/water.vtk")
PostProcess.script_openFile(-1,"Post3D","%examplesPath%/platform.vtk")
PostProcess.script_applyClicked(-1,"Post3D")
PostProcess.script_Properties_streamline_integration_direction(-1,"Post3D",3,2)
PostProce... | MainWindow.clearData()
MainWindow.openPost3D()
PostProcess.script_openFile(-1, 'Post3D', '%examplesPath%/water.vtk')
PostProcess.script_openFile(-1, 'Post3D', '%examplesPath%/platform.vtk')
PostProcess.script_applyClicked(-1, 'Post3D')
PostProcess.script_Properties_streamline_integration_direction(-1, 'Post3D', 3, 2)
P... |
class deques():
def __init__(self):
self.items = []
def addFront(self,item):
return self.items.append(item)
def addRear(self,item):
return self.items.insert(0,item)
def removeFront(self):
return self.items.pop()
def removeRear(self):
return self.items.pop(... | class Deques:
def __init__(self):
self.items = []
def add_front(self, item):
return self.items.append(item)
def add_rear(self, item):
return self.items.insert(0, item)
def remove_front(self):
return self.items.pop()
def remove_rear(self):
return self.item... |
Despesas = float(input("Quanto foi gasto?"))
Gorjeta = Despesas / 100 * 10
Total = Despesas + Gorjeta
print("--------------------------------------- \n O total foi de R${:.2f} \n Com uma gorjeta de R${:.2f} \n --------------------------------------- ".format(Total, Gorjeta))
| despesas = float(input('Quanto foi gasto?'))
gorjeta = Despesas / 100 * 10
total = Despesas + Gorjeta
print('--------------------------------------- \n O total foi de R${:.2f} \n Com uma gorjeta de R${:.2f} \n --------------------------------------- '.format(Total, Gorjeta)) |
def cc_lint_test_impl(ctx):
args = " ".join(
[ctx.expand_make_variables("cmd", arg, {})
for arg in ctx.attr.linter_args])
ctx.file_action(
content = "%s %s %s" % (
ctx.executable.linter.short_path,
args,
" ".join([src.short_path for src in ctx.files.srcs])),
... | def cc_lint_test_impl(ctx):
args = ' '.join([ctx.expand_make_variables('cmd', arg, {}) for arg in ctx.attr.linter_args])
ctx.file_action(content='%s %s %s' % (ctx.executable.linter.short_path, args, ' '.join([src.short_path for src in ctx.files.srcs])), output=ctx.outputs.executable, executable=True)
return... |
fname = input('Enter a file name:')
try :
fhand = open('ch07\\' + fname)
except :
print('File cannot be opened:',fname)
quit()
for str in fhand :
print(str.upper().rstrip())
try :
fhand.close()
except :
pass | fname = input('Enter a file name:')
try:
fhand = open('ch07\\' + fname)
except:
print('File cannot be opened:', fname)
quit()
for str in fhand:
print(str.upper().rstrip())
try:
fhand.close()
except:
pass |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.