content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
# Created by MechAviv
# Quest ID :: 34925
# Not coded yet
sm.setSpeakerID(3001508)
sm.setSpeakerType(3)
sm.flipDialogue()
sm.setBoxChat()
sm.boxChatPlayerAsSpeaker()
sm.setBoxOverrideSpeaker()
sm.flipBoxChat()
sm.flipBoxChatPlayerAsSpeaker()
sm.setColor(1)
sm.sendNext("#face0#We've got to find it. Looks like we've got... | sm.setSpeakerID(3001508)
sm.setSpeakerType(3)
sm.flipDialogue()
sm.setBoxChat()
sm.boxChatPlayerAsSpeaker()
sm.setBoxOverrideSpeaker()
sm.flipBoxChat()
sm.flipBoxChatPlayerAsSpeaker()
sm.setColor(1)
sm.sendNext("#face0#We've got to find it. Looks like we've got no choice but to form a recovery team.")
sm.setSpeakerID(3... |
n = int(input())
a = [int(input()) for _ in range(n)]
pushed = [False] * n
cnt = 0
index = 0
while not (pushed[index]):
cnt += 1
pushed[index] = True
if index == 1:
cnt -= 1
print(cnt)
exit()
index = a[index] - 1
print(-1)
| n = int(input())
a = [int(input()) for _ in range(n)]
pushed = [False] * n
cnt = 0
index = 0
while not pushed[index]:
cnt += 1
pushed[index] = True
if index == 1:
cnt -= 1
print(cnt)
exit()
index = a[index] - 1
print(-1) |
def neural_control (output):
lat_stick = (output[0] - output[1]) * 21.5
pull = (output[2] - output[3]) * 25
control = [1.0, pull, lat_stick, 0.0]
return control | def neural_control(output):
lat_stick = (output[0] - output[1]) * 21.5
pull = (output[2] - output[3]) * 25
control = [1.0, pull, lat_stick, 0.0]
return control |
a = input("Geef een waarde (geen 0) ")
try:
a = int(a)
b = 100 / a
print(b)
except:
print("Ik zei nog zo: geen 0")
finally:
print("Bedankt voor het meedoen")
| a = input('Geef een waarde (geen 0) ')
try:
a = int(a)
b = 100 / a
print(b)
except:
print('Ik zei nog zo: geen 0')
finally:
print('Bedankt voor het meedoen') |
#https://www.acmicpc.net/problem/2475
n = map(int, input().split())
sum = 0
for i in n:
sum += (i**2)
print(sum%10) | n = map(int, input().split())
sum = 0
for i in n:
sum += i ** 2
print(sum % 10) |
__author__ = 'mcxiaoke'
class Bird(object):
feather=True
class Chicken(Bird):
fly=False
def __init__(self,age):
self.age=age
ck=Chicken(2)
print(Bird.__dict__)
print(Chicken.__dict__)
print(ck.__dict__)
| __author__ = 'mcxiaoke'
class Bird(object):
feather = True
class Chicken(Bird):
fly = False
def __init__(self, age):
self.age = age
ck = chicken(2)
print(Bird.__dict__)
print(Chicken.__dict__)
print(ck.__dict__) |
t=int(input())
l=list(map(int,input().split()))
l=sorted(l)
ans=0
c=0
for i in l:
if i>=c:
ans+=1
c+=i
print(ans) | t = int(input())
l = list(map(int, input().split()))
l = sorted(l)
ans = 0
c = 0
for i in l:
if i >= c:
ans += 1
c += i
print(ans) |
names = ["shiva", "sai", "azim", "mathews", "philips", "samule"]
items = [name.capitalize() for name in names]
print(items)
items = [len(name) for name in names]
print(items)
def get_list_comprehensions(lambda_expression, value):
return [lambda_expression(x) for x in range(value)]
data = get_list_comprehensions... | names = ['shiva', 'sai', 'azim', 'mathews', 'philips', 'samule']
items = [name.capitalize() for name in names]
print(items)
items = [len(name) for name in names]
print(items)
def get_list_comprehensions(lambda_expression, value):
return [lambda_expression(x) for x in range(value)]
data = get_list_comprehensions(la... |
TILESIZE = 29
PLAYER_LAYER = 4
ENEMY_LAYER = 3
BLOCK_LAYER = 2
GROUND_LAYER = 1
PLAYER_SPEED = 3
player_speed = 0
WHITE = (255, 255, 255)
BLUE = (0, 0, 255)
RED = (255, 0, 0)
BLACK = (0, 0, 0)
tilemap = [
'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB',
'B............................... | tilesize = 29
player_layer = 4
enemy_layer = 3
block_layer = 2
ground_layer = 1
player_speed = 3
player_speed = 0
white = (255, 255, 255)
blue = (0, 0, 255)
red = (255, 0, 0)
black = (0, 0, 0)
tilemap = ['BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB', 'B........................................... |
def moveDisk(poles, disk, pole):
# move disk to pole
if(disk == 0):
# base case of recursive algorithm
return 0, poles
# find the pole the disk is currently on
diskIsOn = 0
if disk in poles[1]:
diskIsOn = 1
if disk in poles[2]:
diskIsOn = 2
# make list of al... | def move_disk(poles, disk, pole):
if disk == 0:
return (0, poles)
disk_is_on = 0
if disk in poles[1]:
disk_is_on = 1
if disk in poles[2]:
disk_is_on = 2
disks_to_move = []
for d in poles[diskIsOn] + poles[pole]:
if d < disk:
disksToMove.insert(0, d)
... |
TOKEN_URL = 'https://discordapp.com/api/oauth2/token'
GROUP_DM_URL = 'https://discordapp.com/api/users/@me/channels'
RPC_TOKEN_URL_FRAGMENT = '/rpc'
RPC_HOSTNAME = 'ws://127.0.0.1:'
RPC_QUERYSTRING = '?v=1&encoding=json&client_id='
CLIENT_ID = ''
CLIENT_SECRET = ''
REDIRECT_URI = ''
RPC_ORIGIN = ''
BOT_TOKEN = ''
| token_url = 'https://discordapp.com/api/oauth2/token'
group_dm_url = 'https://discordapp.com/api/users/@me/channels'
rpc_token_url_fragment = '/rpc'
rpc_hostname = 'ws://127.0.0.1:'
rpc_querystring = '?v=1&encoding=json&client_id='
client_id = ''
client_secret = ''
redirect_uri = ''
rpc_origin = ''
bot_token = '' |
## Automatically adapted for numpy Apr 14, 2006 by convertcode.py
ARCSECTORAD = float('4.8481368110953599358991410235794797595635330237270e-6')
RADTOARCSEC = float('206264.80624709635515647335733077861319665970087963')
SECTORAD = float('7.2722052166430399038487115353692196393452995355905e-5')
RADTOSEC = float('1... | arcsectorad = float('4.8481368110953599358991410235794797595635330237270e-6')
radtoarcsec = float('206264.80624709635515647335733077861319665970087963')
sectorad = float('7.2722052166430399038487115353692196393452995355905e-5')
radtosec = float('13750.987083139757010431557155385240879777313391975')
radtodeg = float('57... |
CONTENT_TYPE_CHOICES = (
('Company', 'Company'),
('Job', 'Job'),
('Topic', 'Topic'),
) | content_type_choices = (('Company', 'Company'), ('Job', 'Job'), ('Topic', 'Topic')) |
class Solution:
def summaryRanges(self, nums):
summary = []
i = 0
for j in range(len(nums)):
if j + 1 < len(nums) and nums[j + 1] == nums[j] + 1:
continue
if i == j:
summary.append(str(nums[i]))
else:
summar... | class Solution:
def summary_ranges(self, nums):
summary = []
i = 0
for j in range(len(nums)):
if j + 1 < len(nums) and nums[j + 1] == nums[j] + 1:
continue
if i == j:
summary.append(str(nums[i]))
else:
summa... |
# import copy
class Solution:
def numIslands(self, grid: List[List[str]]) -> int:
if not grid:
return 0
# copyGrid = copy.deepcopy(grid)
copyGrid = grid
m = len(grid)
n = len(grid[0])
res = 0
for i in range(m):
for j in range(n):
... | class Solution:
def num_islands(self, grid: List[List[str]]) -> int:
if not grid:
return 0
copy_grid = grid
m = len(grid)
n = len(grid[0])
res = 0
for i in range(m):
for j in range(n):
if copyGrid[i][j] == '1':
... |
BAD_CREDENTIALS = "Unauthorized: The credentials were provided incorrectly or did not match any existing,\
active credentials."
PAYMENT_REQUIRED = "Payment Required: There is no active subscription\
for the account associated with the credentials submitted with the request."
FORBIDDEN = "Because the international s... | bad_credentials = 'Unauthorized: The credentials were provided incorrectly or did not match any existing, active credentials.'
payment_required = 'Payment Required: There is no active subscription for the account associated with the credentials submitted with the request.'
forbidden = 'Because the international service... |
#!/usr/bin/env python3
# coding: utf-8
def foreachcsv(filename, callback):
with open(filename, 'rb') as f:
while True:
line = f.readline().strip()
if not line:
break
callback(line)
def fdata2list(filename):
with open(filename, 'r') as f:
da... | def foreachcsv(filename, callback):
with open(filename, 'rb') as f:
while True:
line = f.readline().strip()
if not line:
break
callback(line)
def fdata2list(filename):
with open(filename, 'r') as f:
data = [line.strip() for line in f.readlines... |
class Person:
def __init__(self, name):
self.name = name
def display1(self):
print('End of the Statement')
class Student(Person):
def __init__(self, name, usn, branch):
super().__init__(name)
self.name = name
self.usn = usn
self.branch = branch
def dis... | class Person:
def __init__(self, name):
self.name = name
def display1(self):
print('End of the Statement')
class Student(Person):
def __init__(self, name, usn, branch):
super().__init__(name)
self.name = name
self.usn = usn
self.branch = branch
def di... |
#
# @lc app=leetcode id=61 lang=python3
#
# [61] Rotate List
#
# @lc code=start
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def rotateRight(self, head: ListNode, k: int) -> ListNode:
curr = head
... | class Solution:
def rotate_right(self, head: ListNode, k: int) -> ListNode:
curr = head
length = 0
while curr:
length += 1
curr = curr.next
if length == 0:
return None
k = k % length
if k == 0:
return head
left ... |
# https://programmers.co.kr/learn/courses/30/lessons/42584
def solution(prices):
answer = []
length = len(prices)
for i in range(length):
now_value = prices[i]
for j in range(i+1, length):
if prices[j] < now_value or j == length -1:
answer.append(j-i)
... | def solution(prices):
answer = []
length = len(prices)
for i in range(length):
now_value = prices[i]
for j in range(i + 1, length):
if prices[j] < now_value or j == length - 1:
answer.append(j - i)
break
answer.append(0)
return answer |
###############################################################################
# Done: READ the code below. TRACE (by hand) the execution of the code,
# predicting what will get printed. Then run the code
# and compare your prediction to what actually was printed.
# Then mark this _TODO_ as DONE and commit-and-push ... | def main():
hello('Snow White')
goodbye('Bashful')
hello('Grumpy')
hello('Sleepy')
hello_and_goodbye('Magic Mirror', 'Cruel Queen')
def hello(friend):
print('Hello,', friend, '- how are things?')
def goodbye(friend):
print('Goodbye,', friend, '- see you later!')
print(' Ciao!')
p... |
i = 0
while True:
open(f'{i}', 'w')
i += 1
| i = 0
while True:
open(f'{i}', 'w')
i += 1 |
# Example: Fetch a single transcription on a recording
my_transcription = api.get_transcription('recordingId', 'transcriptionId')
print(my_transcription)
## {
## 'chargeableDuration': 11,
## 'id' : '{transcriptionId}',
## 'state' : 'completed',
## 'text' : 'Hey t... | my_transcription = api.get_transcription('recordingId', 'transcriptionId')
print(my_transcription) |
class Solution:
def singleNumber(self, nums: List[int]) -> int:
nums.sort()
i=0
while i <len(nums):
if ((i<len(nums)-2) and nums[i]==nums[i+1] ):
i+=2
else:
return nums[i]
break | class Solution:
def single_number(self, nums: List[int]) -> int:
nums.sort()
i = 0
while i < len(nums):
if i < len(nums) - 2 and nums[i] == nums[i + 1]:
i += 2
else:
return nums[i]
break |
class Solution:
def minPathSum(self, grid: List[List[int]]) -> int:
m = len(grid[0])
n = len(grid)
if m == 0 or n == 0:
return 0
for i in range(m):
if i != 0:
grid[0][i] += grid[0][i-1]
for j in range(... | class Solution:
def min_path_sum(self, grid: List[List[int]]) -> int:
m = len(grid[0])
n = len(grid)
if m == 0 or n == 0:
return 0
for i in range(m):
if i != 0:
grid[0][i] += grid[0][i - 1]
for j in range(n):
if j != 0:
... |
print("Keep Talking And Nobody Explodes - Kronorox Solvers")
print("On the Subject of Passwords")
print("Version 1.01")
print(" ")
print("Remember to rack through the first six(using the arrows), then move to the second set of letters, and so on")
#Loading the file, opening it, then adding it to the list, then clo... | print('Keep Talking And Nobody Explodes - Kronorox Solvers')
print('On the Subject of Passwords')
print('Version 1.01')
print(' ')
print('Remember to rack through the first six(using the arrows), then move to the second set of letters, and so on')
def loadwords():
words = open('passwordslist.txt', 'r')
wordlis... |
class BeaxyIOError(IOError):
def __init__(self, msg, response, result, *args, **kwargs):
self.response = response
self.result = result
super(BeaxyIOError, self).__init__(msg, *args, **kwargs)
| class Beaxyioerror(IOError):
def __init__(self, msg, response, result, *args, **kwargs):
self.response = response
self.result = result
super(BeaxyIOError, self).__init__(msg, *args, **kwargs) |
class Solution(object):
def lengthOfLongestSubstring(self, s):
if not s:
return 0
start, end = 0, 0
seen = set()
ans = 0
while end < len(s):
if s[end] not in seen:
seen.add(s[end])
... | class Solution(object):
def length_of_longest_substring(self, s):
if not s:
return 0
(start, end) = (0, 0)
seen = set()
ans = 0
while end < len(s):
if s[end] not in seen:
seen.add(s[end])
ans = max(ans, end - start + 1)... |
# generated from genmsg/cmake/pkg-genmsg.context.in
messages_str = "/home/mayur/ros jade files/catkin_ws/src/Udacity-SDC-Radar-Driver-Micro-Challenge/ros/src/sensing/drivers/can/packages/kvaser/msg/CANESR.msg"
services_str = ""
pkg_name = "kvaser"
dependencies_str = "std_msgs;visualization_msgs"
langs = "gencpp;geneus... | messages_str = '/home/mayur/ros jade files/catkin_ws/src/Udacity-SDC-Radar-Driver-Micro-Challenge/ros/src/sensing/drivers/can/packages/kvaser/msg/CANESR.msg'
services_str = ''
pkg_name = 'kvaser'
dependencies_str = 'std_msgs;visualization_msgs'
langs = 'gencpp;geneus;genlisp;gennodejs;genpy'
dep_include_paths_str = 'kv... |
file = open("input", "r")
good_passwords = 0
for line in file.readlines():
poss, char, word = line.strip().split()
pos_one, pos_two = poss.split("-")
char = char[0]
if (word[int(pos_one) - 1] == char) != (word[int(pos_two) - 1] == char):
good_passwords += 1
print(good_passwords)
| file = open('input', 'r')
good_passwords = 0
for line in file.readlines():
(poss, char, word) = line.strip().split()
(pos_one, pos_two) = poss.split('-')
char = char[0]
if (word[int(pos_one) - 1] == char) != (word[int(pos_two) - 1] == char):
good_passwords += 1
print(good_passwords) |
# Hotel Receptionist (1061100) | Sleepywood Hotel
array = [# Name, MesoCost, Map ID
["Regular", 499, 105000011],
["VIP", 999, 105000012]
]
sm.sendNext("Welcome. We're the Sleepywood Hotel. "
"Our hotel works hard to serve you the best at all times. "
"If you are tired ... | array = [['Regular', 499, 105000011], ['VIP', 999, 105000012]]
sm.sendNext("Welcome. We're the Sleepywood Hotel. Our hotel works hard to serve you the best at all times. If you are tired and worn out from hunting, how about a relaxing stay at our hotel?")
selection = sm.sendNext('We offer two kinds of rooms for our ser... |
def init_parse(init):
dicinit = {}
init = open('%s'%init,'r')
lines = init.readlines()
lines = [x.strip( ) for x in lines]
for line in lines:
if line.startswith('#'):
pass
else:
try:
dicinit[line.split(' ')[0]] = line.split(' ')[2]
... | def init_parse(init):
dicinit = {}
init = open('%s' % init, 'r')
lines = init.readlines()
lines = [x.strip() for x in lines]
for line in lines:
if line.startswith('#'):
pass
else:
try:
dicinit[line.split(' ')[0]] = line.split(' ')[2]
... |
try:
print("Enter the 20 input Number to get summary")
num=[]
for i in range(0, 20):
temp = int(input())
num.append(temp)
print(f"List with Number's : {num}\nlength :{len(num)}")
count_p=0
count_n=0
count_odd=0
count_even=0
count_zero=0
for i in num:
if i>... | try:
print('Enter the 20 input Number to get summary')
num = []
for i in range(0, 20):
temp = int(input())
num.append(temp)
print(f"List with Number's : {num}\nlength :{len(num)}")
count_p = 0
count_n = 0
count_odd = 0
count_even = 0
count_zero = 0
for i in num:
... |
class Solution:
def solve(self, strs):
return sorted(strs, reverse = True)
| class Solution:
def solve(self, strs):
return sorted(strs, reverse=True) |
before_array_dict = [
{"theRealCat": "unavailable",
"code": "callback-http-failure-status",
"nestedDeeply": {
"stillNesting": {
"yetStillNesting": {
"wowSuchNest": True
}
}
},
"details": [{"nextId": "ued-abc123",
"nam... | before_array_dict = [{'theRealCat': 'unavailable', 'code': 'callback-http-failure-status', 'nestedDeeply': {'stillNesting': {'yetStillNesting': {'wowSuchNest': True}}}, 'details': [{'nextId': 'ued-abc123', 'name': 'callnextId', 'superValue': 'c-abc123'}, {'nextId': 'ued-abc123', 'name': 'callbackStatusCode', 'superValu... |
class Solution:
def findTheWinner(self, n: int, k: int) -> int:
# edge cases
if n == 1: return 1
if k == 1: return n
# general cases
circle = [i for i in range(1,n+1)]
start = 0
while len(circle) > 1:
start = (start + k -1) % len(circle)
... | class Solution:
def find_the_winner(self, n: int, k: int) -> int:
if n == 1:
return 1
if k == 1:
return n
circle = [i for i in range(1, n + 1)]
start = 0
while len(circle) > 1:
start = (start + k - 1) % len(circle)
del circle[s... |
def list_of_multiples (num, length):
return [i*num for i in range(1,length+1)]
#Problem statement: Create a function that takes two numbers as arguments (num, length) and returns a list of multiples of num up to length.
#Problem Link: https://edabit.com/challenge/BuwHwPvt92yw574zB
| def list_of_multiples(num, length):
return [i * num for i in range(1, length + 1)] |
__author__ = 'wangjian'
| __author__ = 'wangjian' |
#CB 03/03/2019
#GMIT Data Analytics Programming & Scripting Module 2019
#Problem Sets
#Problem Set 1
#Setting up a user-defined variable 'i', and asking the user to enter a positive integer as 'i'
i = int(input("Please enter a positive integer: "))
#Setting up the 'total' variable, which will track the output value i... | i = int(input('Please enter a positive integer: '))
total = 0
while i > 0:
total = total + i
i = i - 1
print(total) |
class NumArray:
def __init__(self, nums: 'List[int]'):
self.sums = [0]
for num in nums:
self.sums.append(self.sums[-1] + num)
def sumRange(self, i: int, j: int) -> int:
return self.sums[j + 1] - self.sums[i]
if __name__ == '__main__':
num_array = NumArray([-... | class Numarray:
def __init__(self, nums: 'List[int]'):
self.sums = [0]
for num in nums:
self.sums.append(self.sums[-1] + num)
def sum_range(self, i: int, j: int) -> int:
return self.sums[j + 1] - self.sums[i]
if __name__ == '__main__':
num_array = num_array([-2, 0, 3, -... |
# Requires mock server set up on localhost:3000
# Try out Mockoon for this: https://github.com/mockoon/mockoon
# They even provide sample responses for each API: https://github.com/mockoon/mock-samples
SPOTIFY_WEB_API = "http://localhost:3000/v1"
SPOTIFY_AUTH_API = "http://localhost:3000/v1/auth"
GROUPS_TABLE = "Smoot... | spotify_web_api = 'http://localhost:3000/v1'
spotify_auth_api = 'http://localhost:3000/v1/auth'
groups_table = 'SmoothieGroupsDev' |
def cartpole_analytical_derivatives(model, data, x, u=None):
if u is None:
u = model.unone
# Getting the state and control variables
y, th, ydot, thdot = x[0].item(), x[1].item(), x[2].item(), x[3].item()
f = u[0].item()
# Shortname for system parameters
m1, m2, l, g = model.m1, model.... | def cartpole_analytical_derivatives(model, data, x, u=None):
if u is None:
u = model.unone
(y, th, ydot, thdot) = (x[0].item(), x[1].item(), x[2].item(), x[3].item())
f = u[0].item()
(m1, m2, l, g) = (model.m1, model.m2, model.l, model.g)
(s, c) = (np.sin(th), np.cos(th))
m = m1 + m2
... |
plays = ['Hamlet', 'Macbeth', 'King Lear']
plays.insert(1, 'Julius Caesar')
print(plays)
plays.insert(0, 'Romeo & Juliet')
print(plays)
plays.insert(10, "A Midsummer Night's Dreams")
print(plays) | plays = ['Hamlet', 'Macbeth', 'King Lear']
plays.insert(1, 'Julius Caesar')
print(plays)
plays.insert(0, 'Romeo & Juliet')
print(plays)
plays.insert(10, "A Midsummer Night's Dreams")
print(plays) |
se_colors = {
'TV Application Layer': '#D9D9D9',
'Second Screen Framework': '#B67272',
'Audio Mining': '#F23A3A',
'Content Optimisation': '#00B0F0',
'HbbTV Application Toolkit': '#FF91C4',
'Open City Database': '#61DDFF',
'POIProxy': '#C8F763',
'App Generator': ... | se_colors = {'TV Application Layer': '#D9D9D9', 'Second Screen Framework': '#B67272', 'Audio Mining': '#F23A3A', 'Content Optimisation': '#00B0F0', 'HbbTV Application Toolkit': '#FF91C4', 'Open City Database': '#61DDFF', 'POIProxy': '#C8F763', 'App Generator': '#1EC499', 'Fusion Engine': '#ECA2F5', 'OpenDataSoft': '#36... |
class HashTable:
def __init__(self):
self.table = [[] for x in range(13)]
def hash(self, key):
chrcodes = sum([ord(x) for x in key])
return chrcodes % 13
def insert(self, key, data):
# try to get existing key
print(self.hash(key))
for item in self.table[sel... | class Hashtable:
def __init__(self):
self.table = [[] for x in range(13)]
def hash(self, key):
chrcodes = sum([ord(x) for x in key])
return chrcodes % 13
def insert(self, key, data):
print(self.hash(key))
for item in self.table[self.hash(key)]:
if item[... |
# Get the plain text matrix (1 * 3 from a 3 letter word)
def get_plain_text_matrix(plain_text):
return [(ord(plain_text[i]) - 65) for i in range(3)]
# Get the key matrix (3 * 3 mtx from a 9 letter word)
def get_key_matrix(key):
mtx = [[0] * 3 for _ in range(3)]
counter = 0
for i in range(3):
f... | def get_plain_text_matrix(plain_text):
return [ord(plain_text[i]) - 65 for i in range(3)]
def get_key_matrix(key):
mtx = [[0] * 3 for _ in range(3)]
counter = 0
for i in range(3):
for j in range(3):
mtx[i][j] = ord(key[counter]) - 65
counter += 1
return mtx
def get_... |
class ShaderNodeBsdfTransparent:
pass
| class Shadernodebsdftransparent:
pass |
'''
Copyright [2017] [taurus.ai]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... | """
Copyright [2017] [taurus.ai]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... |
class Employee():
def __init__(self, name, salary):
self.name = name
self.salary = salary
self.is_db_connected = False
def __enter__(self):
print("entered")
self.is_db_connected = True
# must return self because in the with employee as e: e becomes the value re... | class Employee:
def __init__(self, name, salary):
self.name = name
self.salary = salary
self.is_db_connected = False
def __enter__(self):
print('entered')
self.is_db_connected = True
return self
def __exit__(self, type, value, traceback):
print('exi... |
##x = input()
##if str(x)[::-1] == str(x):
## print("yes")
##else:
## print("no")
x = input()
x.replace(" ", "")
l = 0
r = len(x) - 1
output = 'yes'
while l < r:
if x[l] != x[r]:
output = 'no'
break
else:
l += 1
r -= 1
print(output)
| x = input()
x.replace(' ', '')
l = 0
r = len(x) - 1
output = 'yes'
while l < r:
if x[l] != x[r]:
output = 'no'
break
else:
l += 1
r -= 1
print(output) |
string1 = input("")
string2 = input("")
lenStrings = len(string1)
arr = [[0]*(lenStrings+1) for n in range(lenStrings+1)]
for i in range(1,lenStrings+1):
for j in range(1,lenStrings+1):
match = arr[i-1][j-1]
if string1[i-1] == string2[j-1]:
match += 1
arr[i][j] = max(arr[i][j-... | string1 = input('')
string2 = input('')
len_strings = len(string1)
arr = [[0] * (lenStrings + 1) for n in range(lenStrings + 1)]
for i in range(1, lenStrings + 1):
for j in range(1, lenStrings + 1):
match = arr[i - 1][j - 1]
if string1[i - 1] == string2[j - 1]:
match += 1
arr[i][... |
class Solution:
def findMaxAverage(self, nums, k: int) -> float:
# Avoid computations by working with a window of 1. We find the
# average of k-1 elements and add/remove values from the ends.
limit = k-1
start, max_avg = sum(nums[:limit]) / k, -(10 << 30)
for i in range(limit... | class Solution:
def find_max_average(self, nums, k: int) -> float:
limit = k - 1
(start, max_avg) = (sum(nums[:limit]) / k, -(10 << 30))
for i in range(limit, len(nums)):
final_value = nums[i] / k
candidate = start + final_value
if candidate > max_avg:
... |
# Section 5.15 snippets
# Finding the Minimum and Maximum Values Using a Key Function
'Red' < 'orange'
ord('R')
ord('o')
colors = ['Red', 'orange', 'Yellow', 'green', 'Blue']
min(colors, key=lambda s: s.lower())
max(colors, key=lambda s: s.lower())
# Iterating Backwards Through a Sequence
numbers = [10, 3, 7, 1,... | 'Red' < 'orange'
ord('R')
ord('o')
colors = ['Red', 'orange', 'Yellow', 'green', 'Blue']
min(colors, key=lambda s: s.lower())
max(colors, key=lambda s: s.lower())
numbers = [10, 3, 7, 1, 9, 4, 2, 8, 5, 6]
reversed_numbers = [item ** 2 for item in reversed(numbers)]
reversed_numbers
names = ['Bob', 'Sue', 'Amanda']
grad... |
#!/usr/bin/python
def Fibonaci_iter(n):
if (n == 0):
return 0
elif (n == 1):
return 1
elif (n > 1):
fn = 0
fn1 = 1
fn2 = 1
while n > 2:
fn = fn1 + fn2
fn1 = fn2
fn2 = fn
n = n - 1
return fn
print(Fibo... | def fibonaci_iter(n):
if n == 0:
return 0
elif n == 1:
return 1
elif n > 1:
fn = 0
fn1 = 1
fn2 = 1
while n > 2:
fn = fn1 + fn2
fn1 = fn2
fn2 = fn
n = n - 1
return fn
print(fibonaci_iter(5)) |
# Copyright 2021 The Perkeepy Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | class Camlisig:
@staticmethod
def from_armored_gpg_signature(armored_gpg_signature: str) -> str:
armored_gpg_signature = armored_gpg_signature.strip()
start_index: int = armored_gpg_signature.index('\n\n')
end_index: int = armored_gpg_signature.index('\n-----')
signature: str = ... |
#
# PySNMP MIB module TIMETRA-TC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TIMETRA-TC-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:01:12 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, single_value_constraint, constraints_union, value_range_constraint, value_size_constraint) ... |
{
"cells": [
{
"cell_type": "code",
"execution_count": 108,
"id": "25569a41",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import csv \n",
"from statistics import mean"
]
},
{
"cell_type": "code",
"execution_count": 109,
"id": "2cbb873b",
"metadata": {},... | {'cells': [{'cell_type': 'code', 'execution_count': 108, 'id': '25569a41', 'metadata': {}, 'outputs': [], 'source': ['import os\n', 'import csv \n', 'from statistics import mean']}, {'cell_type': 'code', 'execution_count': 109, 'id': '2cbb873b', 'metadata': {}, 'outputs': [{'data': {'text/plain': ["'Resources/budget_da... |
#
# PySNMP MIB module CISCO-QLLC01-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-QLLC01-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:53:38 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar ... | (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, constraints_union, constraints_intersection, single_value_constraint, value_size_constraint) ... |
def capitalize(string):
new = ''
for i in range(0,len(string)):
if i == 0:
new += string[i].upper()
elif string[i - 1] == ' ':
new += string[i].upper()
else :
new += string[i]
return new | def capitalize(string):
new = ''
for i in range(0, len(string)):
if i == 0:
new += string[i].upper()
elif string[i - 1] == ' ':
new += string[i].upper()
else:
new += string[i]
return new |
numbers = (input("").split())
a=int(numbers[0])
b=int(numbers[1])
if a == b:
print(0)
else:
print(1) | numbers = input('').split()
a = int(numbers[0])
b = int(numbers[1])
if a == b:
print(0)
else:
print(1) |
@bot.command()
async def meme(ctx):
msg = await ctx.send("<a:loading:900379618924716052> Processing")
r = requests.get('https://meme-api.herokuapp.com/gimme')
x = r.text
y = json.loads(x)
title = y["title"]
url = y["url"]
author = y["author"]
embed = discord.Embed(title=f"{title}", color... | @bot.command()
async def meme(ctx):
msg = await ctx.send('<a:loading:900379618924716052> Processing')
r = requests.get('https://meme-api.herokuapp.com/gimme')
x = r.text
y = json.loads(x)
title = y['title']
url = y['url']
author = y['author']
embed = discord.Embed(title=f'{title}', color... |
# Constructor with arguments or parameters default
class Point:
def __init__(self, x=0, y=0):
self.x = x
self.y = y
def distance(self, point2):
"Calculates distance between current point to given point2"
x = point2.x - self.x
y = point2.y - self.y
d = x**2 ... | class Point:
def __init__(self, x=0, y=0):
self.x = x
self.y = y
def distance(self, point2):
"""Calculates distance between current point to given point2"""
x = point2.x - self.x
y = point2.y - self.y
d = x ** 2 + y ** 2
return d ** 0.5
p2 = point(3, 4)
... |
def encode(content: bytes):
p = list(content)
oa = ord('a')
oz = ord('z')
oA = ord('A')
oZ = ord('Z')
for i in range(len(p)):
if oa <= p[i] <= oz:
p[i] = oa + 25 - p[i] + oa
elif oA <= p[i] <= oZ:
p[i] = oA + 25 - p[i] + oA
return bytes(p)
def decode... | def encode(content: bytes):
p = list(content)
oa = ord('a')
oz = ord('z')
o_a = ord('A')
o_z = ord('Z')
for i in range(len(p)):
if oa <= p[i] <= oz:
p[i] = oa + 25 - p[i] + oa
elif oA <= p[i] <= oZ:
p[i] = oA + 25 - p[i] + oA
return bytes(p)
def decod... |
# Write a function def equals(a, b) that checks whether two lists have the same
# elements in the same order.
# FUNCTIONS
def equals(listA, listB):
if len(listA) < len(listB) or len(listA) > len(listB):
return False
equalBool = False
for i in range(len(listA)):
if listA[i] == listB[i]:
... | def equals(listA, listB):
if len(listA) < len(listB) or len(listA) > len(listB):
return False
equal_bool = False
for i in range(len(listA)):
if listA[i] == listB[i]:
equal_bool = True
else:
return False
return equalBool
def main():
example_list_a = [1... |
def old_test():
core = Core(User='',Password='',ip='192.168.61.2')
core.start()
#gain = Control(parent=core,Name='gain',ValueType=int)
cg = ChangeGroup(parent=core,Id='mygroup')
#create some control objects
for i in range(1,10):
l = Control(parent=core,Name='Mixer6x9Output{}Label'... | def old_test():
core = core(User='', Password='', ip='192.168.61.2')
core.start()
cg = change_group(parent=core, Id='mygroup')
for i in range(1, 10):
l = control(parent=core, Name='Mixer6x9Output{}Label'.format(i), ValueType=str)
cg.AddControl(l)
m = control(parent=core, Name='Mi... |
NODE_STATS_UPDATE_INTERVAL_SECONDS = 1
UPDATE_NODES_INTERVAL_SECONDS = 5
MAX_COUNT_OF_GCS_RPC_ERROR = 10
MAX_LOGS_TO_CACHE = 10000
LOG_PRUNE_THREASHOLD = 1.25
| node_stats_update_interval_seconds = 1
update_nodes_interval_seconds = 5
max_count_of_gcs_rpc_error = 10
max_logs_to_cache = 10000
log_prune_threashold = 1.25 |
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"kcred": "extract.ipynb",
"unzip": "extract.ipynb",
"download_kaggle_dataset": "extract.ipynb"}
modules = ["loader.py"]
doc_url = "https://talosiot-will.github.io/agora/"
git_url = "https... | __all__ = ['index', 'modules', 'custom_doc_links', 'git_url']
index = {'kcred': 'extract.ipynb', 'unzip': 'extract.ipynb', 'download_kaggle_dataset': 'extract.ipynb'}
modules = ['loader.py']
doc_url = 'https://talosiot-will.github.io/agora/'
git_url = 'https://github.com/talosiot-will/agora/tree/master/'
def custom_do... |
def generate_python(fields):
pkgSize = 0
pkgStr = '<'
for field in fields:
pkgSize += field.fieldType.length
pkgStr += field.fieldType.charCode
pyStr = 'PACKAGE_LEN = '+str(pkgSize)+'\n'
pyStr += 'PACKAGE_CODE = "'+pkgStr+'"\n'
pyStr += 'PACKAGE_FIELDS = ' + list(
m... | def generate_python(fields):
pkg_size = 0
pkg_str = '<'
for field in fields:
pkg_size += field.fieldType.length
pkg_str += field.fieldType.charCode
py_str = 'PACKAGE_LEN = ' + str(pkgSize) + '\n'
py_str += 'PACKAGE_CODE = "' + pkgStr + '"\n'
py_str += 'PACKAGE_FIELDS = ' + list(m... |
PLATFORM_COMPILER_FLAGS = [
'-std=c++14',
'-Wall',
'-Wextra',
# For TestCommon.h
'-Wno-pragmas',
]
| platform_compiler_flags = ['-std=c++14', '-Wall', '-Wextra', '-Wno-pragmas'] |
x = 0
score = x
# Question One
print("What are the plants and trees release into the air?")
answer_1 = input("a)air\nb)oxygen\nc)music\nd)zak's fart \n:")
if answer_1.lower() == "b" or answer_1.lower() == "oxygen":
print("Correct")
x = x + 1
else:
print("Incorrect, it's oxygen")
# Question Two
print("... | x = 0
score = x
print('What are the plants and trees release into the air?')
answer_1 = input("a)air\nb)oxygen\nc)music\nd)zak's fart \n:")
if answer_1.lower() == 'b' or answer_1.lower() == 'oxygen':
print('Correct')
x = x + 1
else:
print("Incorrect, it's oxygen")
print('What color is the trash can you put ... |
class BaseMarkupEngine(object):
def __init__(self, message, obj=None):
self.message = message
self.obj = obj
class BaseQuoteEngine(object):
def __init__(self, post, username):
self.post = post
self.username = username
| class Basemarkupengine(object):
def __init__(self, message, obj=None):
self.message = message
self.obj = obj
class Basequoteengine(object):
def __init__(self, post, username):
self.post = post
self.username = username |
__author__ = "Cauani Castro"
__copyright__ = "Copyright 2015, Cauani Castro"
__credits__ = ["Cauani Castro"]
__license__ = "Apache License 2.0"
__version__ = "1.0"
__maintainer__ = "Cauani Castro"
__email__ = "cauani.castro@hotmail.com"
__status__ = "Examination program"
#funcao recursiva que acumula o resultado em va... | __author__ = 'Cauani Castro'
__copyright__ = 'Copyright 2015, Cauani Castro'
__credits__ = ['Cauani Castro']
__license__ = 'Apache License 2.0'
__version__ = '1.0'
__maintainer__ = 'Cauani Castro'
__email__ = 'cauani.castro@hotmail.com'
__status__ = 'Examination program'
def base3_para10(b3, exp, b10):
if b3 % 10 ... |
people_waiting = int(input())
wagon_state = input().split()
len_ = len(wagon_state)
counter = 0
is_full = False
if people_waiting == 0:
print(*wagon_state)
exit(0)
for el in range(len_):
counter = int(wagon_state[el])
if counter == 4:
is_full = True
continue
for people in range(4):
... | people_waiting = int(input())
wagon_state = input().split()
len_ = len(wagon_state)
counter = 0
is_full = False
if people_waiting == 0:
print(*wagon_state)
exit(0)
for el in range(len_):
counter = int(wagon_state[el])
if counter == 4:
is_full = True
continue
for people in range(4):
... |
name, age = "Shelby De Oliveira", 29
username = "shelb-doc"
print ('Hello!')
print("Name: {}\nAge: {}\nUsername: {}".format(name, age, username))
| (name, age) = ('Shelby De Oliveira', 29)
username = 'shelb-doc'
print('Hello!')
print('Name: {}\nAge: {}\nUsername: {}'.format(name, age, username)) |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# coding: utf8
class Room():
def __init__(self, serv, room_name, admin_username, bot_username, lutra_username, website_url, user_list):
# Class attributes
self.serv = serv
self.room_name = room_name
self.admin_username = admin_username
... | class Room:
def __init__(self, serv, room_name, admin_username, bot_username, lutra_username, website_url, user_list):
self.serv = serv
self.room_name = room_name
self.admin_username = admin_username
self.bot_username = bot_username
self.lutra_username = lutra_username
... |
class Solution:
def productExceptSelf(self, nums: list[int]) -> list[int]:
result = [1] * len(nums)
prefix = 1
for i in range(len(nums)):
result[i] *= prefix
prefix *= nums[i]
postfix = 1
for i in range(len(nums) - 1, -1, -1):
result[i] *= ... | class Solution:
def product_except_self(self, nums: list[int]) -> list[int]:
result = [1] * len(nums)
prefix = 1
for i in range(len(nums)):
result[i] *= prefix
prefix *= nums[i]
postfix = 1
for i in range(len(nums) - 1, -1, -1):
result[i] ... |
'''
from os.path import expanduser, exists, split
if __name__ == '__main__':
print('[TPL] Test Extern Features')
import multiprocessing
multiprocessing.freeze_support()
def ensure_hotspotter():
import matplotlib
matplotlib.use('Qt4Agg', warn=True, force=True)
# Look for hotspott... | """
from os.path import expanduser, exists, split
if __name__ == '__main__':
print('[TPL] Test Extern Features')
import multiprocessing
multiprocessing.freeze_support()
def ensure_hotspotter():
import matplotlib
matplotlib.use('Qt4Agg', warn=True, force=True)
# Look for hotspott... |
MONGO_URI = 'mongodb://steemit:steemit@mongo1.steemdata.com:27017/SteemData'
MONGO_DBNAME = 'SteemData'
# 50 items per page by default
PAGINATION_DEFAULT = 50
# allow 1000 requests per minute
RATE_LIMIT_GET = (1000, 60)
# change status message
STATUS_ERR = 'ERROR'
# change default response fields
EXTRA_RESPONSE_FIE... | mongo_uri = 'mongodb://steemit:steemit@mongo1.steemdata.com:27017/SteemData'
mongo_dbname = 'SteemData'
pagination_default = 50
rate_limit_get = (1000, 60)
status_err = 'ERROR'
extra_response_fields = ['ID_FIELD']
allow_unknown = True
x_domains = '*'
domain = {'Accounts': {'id_field': 'name', 'item_lookup': True, 'addi... |
def wait(c):
m = None
while m != 'GO':
m = (c.recv(300).decode().replace('\n','').strip())
pass | def wait(c):
m = None
while m != 'GO':
m = c.recv(300).decode().replace('\n', '').strip()
pass |
def pesquisa_binaria(lista, item):
baixo = 0
alto = len(lista) - 1
while baixo <= alto:
meio = (baixo + alto) // 2
chute = lista[meio]
if chute == item:
return meio
elif chute > item:
alto = meio - 1
elif chute < item:
baixo = m... | def pesquisa_binaria(lista, item):
baixo = 0
alto = len(lista) - 1
while baixo <= alto:
meio = (baixo + alto) // 2
chute = lista[meio]
if chute == item:
return meio
elif chute > item:
alto = meio - 1
elif chute < item:
baixo = meio ... |
# _*_coding : UTF_8_*_
# Author :Jie Shen
# CreatTime :2022/1/17 20:53
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class BuildTree:
def __init__(self):
pass
def build_by_array(self, arr) -> ListNode:
if arr is None... | class Listnode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Buildtree:
def __init__(self):
pass
def build_by_array(self, arr) -> ListNode:
if arr is None or len(arr) == 0:
return None
head = list_node(arr[0])
nod... |
# CAN THE WORD BE CONSTRUCTED?
# Write a function 'can_construct(target, word_bank)' that accepts a
# target string and an array of strings.
#
# The function should return a boolean indicating whether ot not the
# 'target' can be constructed by concatenating elements of the 'word_bank' array.
#
# You may reuse e... | def can_construct_brute(target, word_bank):
if target == '':
return True
for word in word_bank:
if target.startswith(word):
suffix = target[len(word):]
if can_construct_brute(suffix, word_bank) == True:
return True
return False
def can_construct_dp(ta... |
class Mesh(object):
'Common class for all Mesh of the Finite Element Method.'
def __init__(self):
pass
| class Mesh(object):
"""Common class for all Mesh of the Finite Element Method."""
def __init__(self):
pass |
# @Author Justin Noddell
# def pagerank( G ):
# params G *** a dict of pages and their respective links
# returns a dict of pages and their respective pagerank values
#
# the purpose of this function is to execute the PageRank function
def pagerank( G ):
P = G.keys() # pages
L = G.values() ... | def pagerank(G):
p = G.keys()
l = G.values()
i = dict()
r = dict()
lambda = 0.2
tau = 0.02
for p in P:
I[p] = 1 / len(P)
R[p] = 0
converged = False
while not converged:
converged = True
for r in R:
R[r] = LAMBDA / len(P)
for p in P:... |
'''
MSDP Genie Ops Object Outputs for IOSXE
'''
class MsdpOutput(object):
# 'show ip msdp peer'
ShowIpMsdpPeer = {
'vrf': {
'default': {
'peer': {
'10.1.100.4': {
'session_state': 'Up',
'pe... | """
MSDP Genie Ops Object Outputs for IOSXE
"""
class Msdpoutput(object):
show_ip_msdp_peer = {'vrf': {'default': {'peer': {'10.1.100.4': {'session_state': 'Up', 'peer_as': 1, 'resets': '0', 'connect_source': 'Loopback0', 'connect_source_address': '10.1.100.2', 'elapsed_time': '00:41:18', 'statistics': {'queue': ... |
word = input()
while not word == "end":
print(f"{word} = {word[::-1]}")
word = input()
# text = input()
# while text != "end":
# text_reversed = ""
# for ch in reversed(text):
# text_reversed += ch
# print(text + " = " + text_reversed)
# text = input()
| word = input()
while not word == 'end':
print(f'{word} = {word[::-1]}')
word = input() |
entrada = int(input())
for i in range(0, entrada):
A, B = input().split(" ")
x, y = int(A), int(B)
if y == 0:
print("divisao impossivel")
else:
resultado = x / y
print(f"{resultado:.1f}")
| entrada = int(input())
for i in range(0, entrada):
(a, b) = input().split(' ')
(x, y) = (int(A), int(B))
if y == 0:
print('divisao impossivel')
else:
resultado = x / y
print(f'{resultado:.1f}') |
def generate_state(state, desired_len):
while len(state) < desired_len:
b = "".join(str((int(s) + 1) % 2) for s in reversed(state))
state = state + "0" + b
return state[:desired_len]
def checksum(state):
res = []
f = True
while f or len(state) % 2 == 0:
f = False
r... | def generate_state(state, desired_len):
while len(state) < desired_len:
b = ''.join((str((int(s) + 1) % 2) for s in reversed(state)))
state = state + '0' + b
return state[:desired_len]
def checksum(state):
res = []
f = True
while f or len(state) % 2 == 0:
f = False
r... |
SCHEDULE_NONE = None
SCHEDULE_HOURLY = '0 * * * *'
SCHEDULE_DAILY = '0 0 * * *'
SCHEDULE_WEEKLY = '0 0 * * 0'
SCHEDULE_MONTHLY = '0 0 1 * *'
SCHEDULE_YEARLY = '0 0 1 1 *'
| schedule_none = None
schedule_hourly = '0 * * * *'
schedule_daily = '0 0 * * *'
schedule_weekly = '0 0 * * 0'
schedule_monthly = '0 0 1 * *'
schedule_yearly = '0 0 1 1 *' |
l = [*map(int, input().split())]
r = 0
for i in l:
if i > 0:
r += 1
print(r)
| l = [*map(int, input().split())]
r = 0
for i in l:
if i > 0:
r += 1
print(r) |
class Carbure:
SUCCESS = "success"
ERROR = "error"
class CarbureError:
INVALID_REGISTRATION_FORM = "Invalid registration form"
INVALID_LOGIN_CREDENTIALS = "Invalid login or password"
ACCOUNT_NOT_ACTIVATED = "Account not activated"
OTP_EXPIRED_CODE = "OTP Code Expired"
OTP_INVALID_CODE = "OT... | class Carbure:
success = 'success'
error = 'error'
class Carbureerror:
invalid_registration_form = 'Invalid registration form'
invalid_login_credentials = 'Invalid login or password'
account_not_activated = 'Account not activated'
otp_expired_code = 'OTP Code Expired'
otp_invalid_code = 'OT... |
### Score - Linux
P1_Wins = 0
CPU_Wins = 0
Game_Draws = 0
| p1__wins = 0
cpu__wins = 0
game__draws = 0 |
# Merge Sort
'''
Divide and Conquer Algorithm
-> Divide: Divide equally until one element: each individual element is sorted
-> Conquer: Combine elements by comparing
'''
# Conquer
def merge(arr,low,mid,high):
# Create two arrays for two halves
n1 = mid - low + 1;
n2 = high - mid;
# Declaring empty arr... | """
Divide and Conquer Algorithm
-> Divide: Divide equally until one element: each individual element is sorted
-> Conquer: Combine elements by comparing
"""
def merge(arr, low, mid, high):
n1 = mid - low + 1
n2 = high - mid
left = list()
right = list()
for i in range(n1):
Left.append(0)
... |
DEFAULT_EQUIPMENT = [
("Dumbbells","Generic dumbbells."),
("Barbell","Generic barbell with plate weights."),
("Squat Rack","Generic squat rack."),
("Leg Curl Machine","Generic machine to do leg curls on."),
("Leg Extension Machine","Generic machine to do leg extensions on."),
("Pull up bar","Generic horizontal bar to ... | default_equipment = [('Dumbbells', 'Generic dumbbells.'), ('Barbell', 'Generic barbell with plate weights.'), ('Squat Rack', 'Generic squat rack.'), ('Leg Curl Machine', 'Generic machine to do leg curls on.'), ('Leg Extension Machine', 'Generic machine to do leg extensions on.'), ('Pull up bar', 'Generic horizontal bar... |
d = {2:0, 3:0, 4:0, 5:0}
input()
v = [int(x) for x in input().split()]
for i in v:
if i % 2 == 0: d[2] += 1
if i % 3 == 0: d[3] += 1
if i % 4 == 0: d[4] += 1
if i % 5 == 0: d[5] += 1
print(d[2], 'Multiplo(s) de 2')
print(d[3], 'Multiplo(s) de 3')
print(d[4], 'Multiplo(s) de 4')
print(d[5], 'Multiplo(s) ... | d = {2: 0, 3: 0, 4: 0, 5: 0}
input()
v = [int(x) for x in input().split()]
for i in v:
if i % 2 == 0:
d[2] += 1
if i % 3 == 0:
d[3] += 1
if i % 4 == 0:
d[4] += 1
if i % 5 == 0:
d[5] += 1
print(d[2], 'Multiplo(s) de 2')
print(d[3], 'Multiplo(s) de 3')
print(d[4], 'Multiplo... |
def findDecision(obj): #obj[0]: Passanger, obj[1]: Weather, obj[2]: Time, obj[3]: Coupon, obj[4]: Coupon_validity, obj[5]: Gender, obj[6]: Age, obj[7]: Children, obj[8]: Education, obj[9]: Occupation, obj[10]: Income, obj[11]: Bar, obj[12]: Coffeehouse, obj[13]: Restaurant20to50, obj[14]: Direction_same, obj[15]: Dista... | def find_decision(obj):
if obj[10] <= 5:
if obj[13] <= 2.0:
if obj[12] <= 3.0:
if obj[9] > 5:
if obj[3] > 3:
return 'False'
elif obj[3] <= 3:
if obj[4] <= 0:
return... |
# cook your dish here
try:
n = int(input())
print(n)
except:
pass
| try:
n = int(input())
print(n)
except:
pass |
a, b = map(int, input().split())
if a+b < 24:
print(a+b)
else:
print((a+b)-24)
| (a, b) = map(int, input().split())
if a + b < 24:
print(a + b)
else:
print(a + b - 24) |
#
# PySNMP MIB module POLICY-DEVICE-AUX-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/POLICY-DEVICE-AUX-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:41:12 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... | (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, constraints_union, value_range_constraint, value_size_constraint, single_value_constraint) ... |
{
'targets': [
{
'target_name': 'binding',
'sources': [ './src/fb-bindings.cc', './src/fb-bindings-blob.cc',
'./src/fb-bindings-fbresult.cc',
'./src/fb-bindings-connection.cc','./src/fb-bindings-eventblock.cc',
'./src/fb-bindings-fbeventemitter.... | {'targets': [{'target_name': 'binding', 'sources': ['./src/fb-bindings.cc', './src/fb-bindings-blob.cc', './src/fb-bindings-fbresult.cc', './src/fb-bindings-connection.cc', './src/fb-bindings-eventblock.cc', './src/fb-bindings-fbeventemitter.cc', './src/fb-bindings-statement.cc', './src/fb-bindings-transaction.cc'], 'i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.