content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
class Relogio:
def __init__(self):
self.horas = 6
self.minutos = 0
self.dia = 1
def __str__(self):
return f"{self.horas:02d}:{self.minutos:02d} do dia {self.dia:02d}"
def avancaTempo(self, minutos):
self.minutos += minutos
while(self.minutos >= 60):... | class Relogio:
def __init__(self):
self.horas = 6
self.minutos = 0
self.dia = 1
def __str__(self):
return f'{self.horas:02d}:{self.minutos:02d} do dia {self.dia:02d}'
def avanca_tempo(self, minutos):
self.minutos += minutos
while self.minutos >= 60:
... |
# https://www.geeksforgeeks.org/write-a-program-to-reverse-an-array-or-string/
# Time: O(n)
# Space: 1
def reverseByMiddles(arr):
n = len(arr)
limit = n//2
for i in range(limit):
temp = arr[i]
arr[i] = arr[(n-1)-i]
arr[(n-1)-i] = temp
return arr
arr = [1,2,3]
result = reverseByMiddles(arr)
print(r... | def reverse_by_middles(arr):
n = len(arr)
limit = n // 2
for i in range(limit):
temp = arr[i]
arr[i] = arr[n - 1 - i]
arr[n - 1 - i] = temp
return arr
arr = [1, 2, 3]
result = reverse_by_middles(arr)
print(result)
print(reverse_by_middles(arr=[1, 2, 3, 4])) |
coordinates_01EE00 = ((121, 126),
(121, 132), (121, 134), (121, 135), (121, 137), (121, 138), (121, 139), (121, 140), (121, 141), (122, 114), (122, 115), (122, 116), (122, 117), (122, 119), (122, 125), (122, 127), (122, 128), (122, 142), (123, 110), (123, 111), (123, 112), (123, 113), (123, 120), (123, 124), (123, 12... | coordinates_01_ee00 = ((121, 126), (121, 132), (121, 134), (121, 135), (121, 137), (121, 138), (121, 139), (121, 140), (121, 141), (122, 114), (122, 115), (122, 116), (122, 117), (122, 119), (122, 125), (122, 127), (122, 128), (122, 142), (123, 110), (123, 111), (123, 112), (123, 113), (123, 120), (123, 124), (123, 126... |
cars = 100
space_in_a_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars -drivers
cars_driven = drivers
carpool_carpacity = cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven
print("There are", cars, "cars available")
print("There are only", drivers, "drivers available")
prin... | cars = 100
space_in_a_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_carpacity = cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven
print('There are', cars, 'cars available')
print('There are only', drivers, 'drivers available')
prin... |
course = "Python Programming"
print(course.upper())
print(course.lower())
print(course.title())
course = " Python Programming"
print(course)
print(course.strip())
print(course.find("Pro"))
print(course.find("pro"))
print(course.replace("P", "-"))
print("Programming" in course)
print("Programming" not in course)
| course = 'Python Programming'
print(course.upper())
print(course.lower())
print(course.title())
course = ' Python Programming'
print(course)
print(course.strip())
print(course.find('Pro'))
print(course.find('pro'))
print(course.replace('P', '-'))
print('Programming' in course)
print('Programming' not in course) |
def init():
# Set locale environment
# Set config
# Set user and group
# init logger
pass | def init():
pass |
def determinant(matA):
dimA = []
# find dimensions of arrA
a = matA
while type(a) == list:
dimA.append(len(a))
a = a[0]
#is it square
if dimA[0] != dimA[1]:
raise Exception("Matrix is not square")
#find determinant
total = 0
if dimA[0] == 2:
total = ma... | def determinant(matA):
dim_a = []
a = matA
while type(a) == list:
dimA.append(len(a))
a = a[0]
if dimA[0] != dimA[1]:
raise exception('Matrix is not square')
total = 0
if dimA[0] == 2:
total = matA[0][0] * matA[1][1] - matA[1][0] * matA[0][1]
return total
... |
#
# PySNMP MIB module BAY-STACK-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BAY-STACK-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:19:06 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... | (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_union, constraints_intersection, value_size_constraint, value_range_constraint) ... |
objects = {}
def instantiate():
# This function is called once during server startup. Modify the global 'objects' dict with of instantiated
# shared objects that you wish to store in the parent process and have access to from child request handler
# processes. Each object must support being shared via... | objects = {}
def instantiate():
return |
host = "localhost"
port = 9999
dboptions = {
"host": "194.67.198.163",
"user": "postgres",
"password": "werdwerd2012",
"database": "zno_bot",
'migrate': True
}
API_PATH = '/api/'
API_VERSION = 'v1'
API_URL = API_PATH + API_VERSION
| host = 'localhost'
port = 9999
dboptions = {'host': '194.67.198.163', 'user': 'postgres', 'password': 'werdwerd2012', 'database': 'zno_bot', 'migrate': True}
api_path = '/api/'
api_version = 'v1'
api_url = API_PATH + API_VERSION |
class Frequency:
def __init__(self):
self.frequency = 0
def increment(self, i):
self.frequency = self.frequency + i
def decrement(self, i):
self.frequency = self.frequency - i
def __str__(self):
return str(self.frequency)
def __repr__(self):
return str(self.fr... | class Frequency:
def __init__(self):
self.frequency = 0
def increment(self, i):
self.frequency = self.frequency + i
def decrement(self, i):
self.frequency = self.frequency - i
def __str__(self):
return str(self.frequency)
def __repr__(self):
return str(se... |
'''
Created on Mar 30, 2019
@author: PIKU
'''
def justSayHello():
print("Hello ...")
def getHello():
return "Hello guys"
if __name__ == '__main__':
justSayHello()
x = getHello()
print(x)
| """
Created on Mar 30, 2019
@author: PIKU
"""
def just_say_hello():
print('Hello ...')
def get_hello():
return 'Hello guys'
if __name__ == '__main__':
just_say_hello()
x = get_hello()
print(x) |
DATA_S3 = "bioanalyze-ec2-test-nf-rnaseq-06o3qdtm7v"
JOB_S3 = DATA_S3
# These come from the terraform code in auto-deployment/terraform
ECR = "dabbleofdevops/nextflow-rnaseq-tutorial"
COMPUTE_ENVIRONMENT = "bioanalyze-ec2-test-nf-rnaseq"
JOB_DEF_NAME = "bioanalyze-ec2-test-nf-rnaseq"
JOB_QUEUE_NAME = "bioanalyze-ec2-... | data_s3 = 'bioanalyze-ec2-test-nf-rnaseq-06o3qdtm7v'
job_s3 = DATA_S3
ecr = 'dabbleofdevops/nextflow-rnaseq-tutorial'
compute_environment = 'bioanalyze-ec2-test-nf-rnaseq'
job_def_name = 'bioanalyze-ec2-test-nf-rnaseq'
job_queue_name = 'bioanalyze-ec2-test-nf-rnaseq-default-job-queue'
job_role = 'arn:aws:iam::018835827... |
#!/usr/bin/env python3
class stressTestPV:
def __init__( self, pvName ):
self._pvName = pvName
self._tsValues = {} # Dict of collected values, keys are float timestamps
self._tsRates = {} # Dict of collection rates, keys are int secPastEpoch values
self._tsMissR... | class Stresstestpv:
def __init__(self, pvName):
self._pvName = pvName
self._tsValues = {}
self._tsRates = {}
self._tsMissRates = {}
self._timeoutRates = {}
self._numMissed = 0
self._numTimeouts = 0
self._startTime = None
self._endTime = None
... |
_base_ = ['./rotated-detection_static.py', '../_base_/backends/tensorrt.py']
onnx_config = dict(
output_names=['dets', 'labels'],
input_shape=None,
dynamic_axes={
'input': {
0: 'batch',
2: 'height',
3: 'width'
},
'dets': {
0: 'batch',
... | _base_ = ['./rotated-detection_static.py', '../_base_/backends/tensorrt.py']
onnx_config = dict(output_names=['dets', 'labels'], input_shape=None, dynamic_axes={'input': {0: 'batch', 2: 'height', 3: 'width'}, 'dets': {0: 'batch', 1: 'num_dets'}, 'labels': {0: 'batch', 1: 'num_dets'}})
backend_config = dict(common_confi... |
#!/usr/bin/env python
class Solution:
def twoCitySchedCost(self, costs):
N = len(costs)//2
costs = list(sorted(costs, key=lambda c: c[0]-c[1]))
s = 0
for i, c in enumerate(costs):
s += c[0] if i < N else c[1]
return s
costs = [[10,20],[30,200],[400,50],[30,20]]
... | class Solution:
def two_city_sched_cost(self, costs):
n = len(costs) // 2
costs = list(sorted(costs, key=lambda c: c[0] - c[1]))
s = 0
for (i, c) in enumerate(costs):
s += c[0] if i < N else c[1]
return s
costs = [[10, 20], [30, 200], [400, 50], [30, 20]]
sol = s... |
pdu_objects = [
{
'header': {
'command_length': 0,
'command_id': 'bind_transmitter',
'command_status': 'ESME_ROK',
'sequence_number': 0,
},
'body': {
'mandatory_parameters': {
'system_id': 'test_system',
... | pdu_objects = [{'header': {'command_length': 0, 'command_id': 'bind_transmitter', 'command_status': 'ESME_ROK', 'sequence_number': 0}, 'body': {'mandatory_parameters': {'system_id': 'test_system', 'password': 'abc123', 'system_type': '', 'interface_version': '34', 'addr_ton': 1, 'addr_npi': 1, 'address_range': ''}}}, {... |
#!/usr/bin/env python
# -*- coding: utf-8 -*--
# Copyright (c) 2021, 2022 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
class Parser:
@property
def pos(self):
raise NotImplementedError()
@property
def no... | class Parser:
@property
def pos(self):
raise not_implemented_error()
@property
def noun(self):
raise not_implemented_error()
@property
def adjective(self):
raise not_implemented_error()
@property
def adverb(self):
raise not_implemented_error()
@pr... |
def strategy(history, memory):
round = history.shape[1]
GRUDGE = 0
LASTACTION = 1
if round == 0:
mem = []
mem.append(False)
mem.append(0)
return "cooperate", mem
mem = memory
if mem[GRUDGE]:
return "defect", mem
if round >= 5:
sin = 0
f... | def strategy(history, memory):
round = history.shape[1]
grudge = 0
lastaction = 1
if round == 0:
mem = []
mem.append(False)
mem.append(0)
return ('cooperate', mem)
mem = memory
if mem[GRUDGE]:
return ('defect', mem)
if round >= 5:
sin = 0
... |
test = [
'nop +0',
'acc +1',
'jmp +4',
'acc +3',
'jmp -3',
'acc -99',
'acc +1',
'jmp -4',
'acc +6',
]
actual = [
'acc +17',
'acc +37',
'acc -13',
'jmp +173',
'nop +100',
'acc -7',
'jmp +447',
'nop +283',
'acc +41',
'acc +32',
'jmp +1',... | test = ['nop +0', 'acc +1', 'jmp +4', 'acc +3', 'jmp -3', 'acc -99', 'acc +1', 'jmp -4', 'acc +6']
actual = ['acc +17', 'acc +37', 'acc -13', 'jmp +173', 'nop +100', 'acc -7', 'jmp +447', 'nop +283', 'acc +41', 'acc +32', 'jmp +1', 'jmp +585', 'jmp +1', 'acc -5', 'nop +71', 'acc +49', 'acc -18', 'jmp +527', 'jmp +130',... |
class Solution:
def generateMatrix(self, n):
matrix = []
num = 1
for i in range(n):
matrix.append([0 for i in range(n)])
top = 0
bottom = n - 1
left = 0
right = n - 1
while top <= bottom and left <= right:
for i in range(left, r... | class Solution:
def generate_matrix(self, n):
matrix = []
num = 1
for i in range(n):
matrix.append([0 for i in range(n)])
top = 0
bottom = n - 1
left = 0
right = n - 1
while top <= bottom and left <= right:
for i in range(left,... |
# classification related details
classification_datasets = ['imagenet', 'coco']
classification_schedulers = ['fixed', 'clr', 'hybrid', 'linear', 'poly']
classification_models = ['espnetv2', 'dicenet', 'shufflenetv2']
classification_exp_choices = ['main', 'ablation']
# segmentation related details
segmentation_schedule... | classification_datasets = ['imagenet', 'coco']
classification_schedulers = ['fixed', 'clr', 'hybrid', 'linear', 'poly']
classification_models = ['espnetv2', 'dicenet', 'shufflenetv2']
classification_exp_choices = ['main', 'ablation']
segmentation_schedulers = ['poly', 'fixed', 'clr', 'linear', 'hybrid']
segmentation_da... |
def checkrot(str1,str2):
if len(str1)==len(str2):
str3=str1+str1
ad=str3.__contains__(str2)
if ad==True:
print("it is right rotate")
else:
print("It is not right rotate ")
else:
print("It is invalid string.Out of range")
def main():
str1=input(" Enter the first String : ")
str2=input("Enter the s... | def checkrot(str1, str2):
if len(str1) == len(str2):
str3 = str1 + str1
ad = str3.__contains__(str2)
if ad == True:
print('it is right rotate')
else:
print('It is not right rotate ')
else:
print('It is invalid string.Out of range')
def main():
... |
#
# This file is part of the Ingram Micro CloudBlue Connect EaaS Extension Runner.
#
# Copyright (c) 2021 Ingram Micro. All Rights Reserved.
#
class EaaSError(Exception):
pass
class MaintenanceError(EaaSError):
pass
class CommunicationError(EaaSError):
pass
class StopBackoffError(EaaSError):
pass
| class Eaaserror(Exception):
pass
class Maintenanceerror(EaaSError):
pass
class Communicationerror(EaaSError):
pass
class Stopbackofferror(EaaSError):
pass |
a=int(input('enter a:'))
b=int(input('enter b:'))
c=int(input('enter c:'))
min_value= a if a<b and a<c else b if b<c else c
print(min_value) | a = int(input('enter a:'))
b = int(input('enter b:'))
c = int(input('enter c:'))
min_value = a if a < b and a < c else b if b < c else c
print(min_value) |
class Animals:
def comer(self):
print("Comiendo")
def dormir(self):
print("Durmiendo")
class Perro:
def __init__(self, nombre):
self.nombre = nombre
def comer(self):
print("Comiendo")
def dormir(self):
print("Durmiendo")
def ladrar(self):
print("Ladrando")
print("----------------------... | class Animals:
def comer(self):
print('Comiendo')
def dormir(self):
print('Durmiendo')
class Perro:
def __init__(self, nombre):
self.nombre = nombre
def comer(self):
print('Comiendo')
def dormir(self):
print('Durmiendo')
def ladrar(self):
pr... |
_base_ = [
'../_base_/models/resnet50.py', '../_base_/datasets/cancer_bs32_pil_resize.py',
'../_base_/schedules/imagenet_bs256_coslr.py', '../_base_/default_runtime.py'
]
model = dict(
head=dict(
num_classes=2,
topk=(1,))
)
data = dict(
train=dict(
data_prefix='/data3/zzhang/tmp... | _base_ = ['../_base_/models/resnet50.py', '../_base_/datasets/cancer_bs32_pil_resize.py', '../_base_/schedules/imagenet_bs256_coslr.py', '../_base_/default_runtime.py']
model = dict(head=dict(num_classes=2, topk=(1,)))
data = dict(train=dict(data_prefix='/data3/zzhang/tmp/classification/train'), val=dict(data_prefix='/... |
XPAHS_CONSULT = {
'jobs_urls': '//div[contains(@class, "listResults")]//div[contains(@data-jobid, "")]//h2//a/@href',
'results': '//span[@class="description fc-light fs-body1"]//text()',
'pagination_indicator': '//a[contains(@class, "s-pagination--item")][last()]//span[contains(text(), "next")]',
'pagi... | xpahs_consult = {'jobs_urls': '//div[contains(@class, "listResults")]//div[contains(@data-jobid, "")]//h2//a/@href', 'results': '//span[@class="description fc-light fs-body1"]//text()', 'pagination_indicator': '//a[contains(@class, "s-pagination--item")][last()]//span[contains(text(), "next")]', 'pagination_url': '//a[... |
# https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
# https://docs.djangoproject.com/en/dev/ref/settings/#secure-ssl-redirect
SECURE_SSL_REDIRECT = True
# https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-secure
SES... | secure_proxy_ssl_header = ('HTTP_X_FORWARDED_PROTO', 'https')
secure_ssl_redirect = True
session_cookie_secure = True
csrf_cookie_secure = True
secure_hsts_preload = True
secure_hsts_include_subdomains = True
secure_hsts_seconds = 31536000
secure_content_type_nosniff = True |
# The `Environment` class represents the dynamic environment of McCarthy's original Lisp. The creation of
# this class is actually an interesting story. As many of you probably know, [Paul Graham wrote a paper and
# code for McCarthy's original Lisp](http://www.paulgraham.com/rootsoflisp.html) and it was my first e... | class Environment:
def __init__(self, par=None, bnd=None):
if bnd:
self.binds = bnd
else:
self.binds = {}
self.parent = par
if par:
self.level = self.parent.level + 1
else:
self.level = 0
def get(self, key):
if key... |
class Exercises:
def __init__(self, topic, course_name, judge_contest_link, problems):
self.topic = topic
self.course_name = course_name
self.judge_contest_link = judge_contest_link
self.problems = [*problems]
def get_info(self):
info = f'Exercises: {self.topic}\n' \
... | class Exercises:
def __init__(self, topic, course_name, judge_contest_link, problems):
self.topic = topic
self.course_name = course_name
self.judge_contest_link = judge_contest_link
self.problems = [*problems]
def get_info(self):
info = f'Exercises: {self.topic}\nProble... |
# =================================================
# SERVER CONFIGURATIONS
# =================================================
CLIENT_ID=''
CLIENT_SECRET=''
REDIRECT_URI='http://ROCKOPY/'
# =================================================
# SERVER CONFIGURATIONS
# =================================================
S... | client_id = ''
client_secret = ''
redirect_uri = 'http://ROCKOPY/'
server_ip = '127.0.0.1'
server_port = 5043
tracks_to_search = 5 |
allData = {'AK': {'Aleutians East': {'pop': 3141, 'tracts': 1},
'Aleutians West': {'pop': 5561, 'tracts': 2},
'Anchorage': {'pop': 291826, 'tracts': 55},
'Bethel': {'pop': 17013, 'tracts': 3},
'Bristol Bay': {'pop': 997, 'tracts': 1},
'Denali': {'pop': 1826, 'tracts': 1},
... | all_data = {'AK': {'Aleutians East': {'pop': 3141, 'tracts': 1}, 'Aleutians West': {'pop': 5561, 'tracts': 2}, 'Anchorage': {'pop': 291826, 'tracts': 55}, 'Bethel': {'pop': 17013, 'tracts': 3}, 'Bristol Bay': {'pop': 997, 'tracts': 1}, 'Denali': {'pop': 1826, 'tracts': 1}, 'Dillingham': {'pop': 4847, 'tracts': 2}, 'Fai... |
#code https://practice.geeksforgeeks.org/problems/swap-and-maximize/0
for _ in range(int(input())):
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
max = 0
for i in range(n//2):
max -= 2*arr[i]
max += 2*arr[n-i-1]
print(max) | for _ in range(int(input())):
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
max = 0
for i in range(n // 2):
max -= 2 * arr[i]
max += 2 * arr[n - i - 1]
print(max) |
# for loops
# for letter in "Cihat Salik":
# print(letter)
friends = ["Hasan", "Mahmut", "Ali", "Veli"]
for friend in friends:
print(friend)
for index in range(3, 10):
print(index)
for index in range(len(friends)):
print(friends[index])
for index in range(5):
if index == 0:
print("Fi... | friends = ['Hasan', 'Mahmut', 'Ali', 'Veli']
for friend in friends:
print(friend)
for index in range(3, 10):
print(index)
for index in range(len(friends)):
print(friends[index])
for index in range(5):
if index == 0:
print('First Iteration')
else:
print('Not first') |
"Used to reference the nested workspaces for examples in /WORKSPACE"
ALL_EXAMPLES = [
"angular",
"app",
"kotlin",
"nestjs",
"parcel",
"protocol_buffers",
"user_managed_deps",
"vendored_node",
"vendored_node_and_yarn",
"web_testing",
"webapp",
"worker",
]
| """Used to reference the nested workspaces for examples in /WORKSPACE"""
all_examples = ['angular', 'app', 'kotlin', 'nestjs', 'parcel', 'protocol_buffers', 'user_managed_deps', 'vendored_node', 'vendored_node_and_yarn', 'web_testing', 'webapp', 'worker'] |
def decode_lines(lines_bytes, encoding: str):
if isinstance(lines_bytes[0], bytes):
lines_str = [line.decode(encoding) for line in lines_bytes]
elif isinstance(lines_bytes[0], str):
lines_str = lines_bytes
else:
raise TypeError(type(lines_bytes[0]))
return lines_str
| def decode_lines(lines_bytes, encoding: str):
if isinstance(lines_bytes[0], bytes):
lines_str = [line.decode(encoding) for line in lines_bytes]
elif isinstance(lines_bytes[0], str):
lines_str = lines_bytes
else:
raise type_error(type(lines_bytes[0]))
return lines_str |
# Fitness monday variables
morning_1 = "10:00"
morning_2 = "8:00"
afternoon_1 = "13:00"
afternoon_2 = "14:30"
afternoon_3 = "15:30"
afternoon_4 = "17:55"
evening_1 = "20:30"
evening_2 = "21:10"
date_announce = [1, 2, 3, 4, 5]
image_file_list = [
'Exercise_Three.png',
'Exercise_Two_2.png'
]
... | morning_1 = '10:00'
morning_2 = '8:00'
afternoon_1 = '13:00'
afternoon_2 = '14:30'
afternoon_3 = '15:30'
afternoon_4 = '17:55'
evening_1 = '20:30'
evening_2 = '21:10'
date_announce = [1, 2, 3, 4, 5]
image_file_list = ['Exercise_Three.png', 'Exercise_Two_2.png']
morning_1_msg = 'Do some stretches! @everyone.'
morning_2_... |
#!/usr/bin/python3
# from time import time
# from math import sqrt
# with open("inp.txt", "r") as f:
# a, b = list(i for i in f.read().split())
a, b = input().split()
# print(a,b,c, type(a), type(int(a)))
a = int(a)
b = int(b)
# st = time()
# -----
s1 = a * (a - 1) // 2
cuoi = b - 2
dau = b - a
s2 = (dau + cuoi) *... | (a, b) = input().split()
a = int(a)
b = int(b)
s1 = a * (a - 1) // 2
cuoi = b - 2
dau = b - a
s2 = (dau + cuoi) * (a - 1) // 2
result = s1 + s2
print(result) |
n = int(input())
a = input().split()
a = [str(m) for m in a]
for i in a:
if i == "Y":
print("Four")
exit()
print("Three") | n = int(input())
a = input().split()
a = [str(m) for m in a]
for i in a:
if i == 'Y':
print('Four')
exit()
print('Three') |
# Copyright 2020 Thomas Rogers
# SPDX-License-Identifier: Apache-2.0
LOWER_LINK_TAG = 6
UPPER_LINK_TAG = 7
UPPER_WATER_TAG = 9
LOWER_WATER_TAG = 10
UPPER_STACK_TAG = 11
LOWER_STACK_TAG = 12
UPPER_GOO_TAG = 13
LOWER_GOO_TAG = 14
LOWER_LINK_TYPES = {LOWER_LINK_TAG, LOWER_WATER_TAG, LOWER_STACK_TAG, LOWER_GOO_TAG}
UP... | lower_link_tag = 6
upper_link_tag = 7
upper_water_tag = 9
lower_water_tag = 10
upper_stack_tag = 11
lower_stack_tag = 12
upper_goo_tag = 13
lower_goo_tag = 14
lower_link_types = {LOWER_LINK_TAG, LOWER_WATER_TAG, LOWER_STACK_TAG, LOWER_GOO_TAG}
upper_link_types = {UPPER_LINK_TAG, UPPER_WATER_TAG, UPPER_STACK_TAG, UPPER_... |
def pattern(n):
res=""
for i in range(n,0,-1):
for j in range(i):
res+=str(n-j)
res+="\n"
return res[:-1] | def pattern(n):
res = ''
for i in range(n, 0, -1):
for j in range(i):
res += str(n - j)
res += '\n'
return res[:-1] |
# Copyright (c) 2016 SwiftStack, Inc.
#
# 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 w... | class Metamiddleware(object):
def __init__(self, app, conf):
self.app = app
def __call__(self, env, start_response):
h_to_del = list()
v_to_add = list()
for h in env:
if h.upper() == 'HTTP_X_PROXYFS_BIMODAL':
hToDel.append(h)
vToAdd.a... |
class call_if(object):
def __init__(self, cond):
self.condition = cond
def __call__(self, func):
def inner(*args, **kwargs):
if getattr(args[0], self.condition):
return func(*args, **kwargs)
else:
return None
return inner | class Call_If(object):
def __init__(self, cond):
self.condition = cond
def __call__(self, func):
def inner(*args, **kwargs):
if getattr(args[0], self.condition):
return func(*args, **kwargs)
else:
return None
return inner |
# -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------------
# Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softw... | hostname = 'http://localhost'
qq_oauth_state = 'openhackathon'
hackathon_api_endpoint = 'http://localhost:15000'
github_client_id = 'b44f3d47bdeb26b9c4e6'
github_client_secret = '98de14161c4b2ed3ea7a19787d62cda73b8e292c'
qq_client_id = '101200890'
qq_client_secret = '88ad67bd4521c4cc47136854781cb9b5'
qq_meta_content = ... |
def multiple(first,second):
return first * second
def add(x,y):
return x+y
| def multiple(first, second):
return first * second
def add(x, y):
return x + y |
# Copyright 2020 BlueCat Networks. All rights reserved.
# -*- coding: utf-8 -*-
type = 'ui'
sub_pages = [
{
'name' : 'get_audit_info_page',
'title' : u'Get Audit Info',
'endpoint' : 'get_audit_info/get_audit_info_endpoint',
'description' : u'get_audit_info'
},
]
| type = 'ui'
sub_pages = [{'name': 'get_audit_info_page', 'title': u'Get Audit Info', 'endpoint': 'get_audit_info/get_audit_info_endpoint', 'description': u'get_audit_info'}] |
a = str(input('Enter the number you want to reverse:'))
b = (a[::-1])
c = int(b)
print('the reversed number is',c)
| a = str(input('Enter the number you want to reverse:'))
b = a[::-1]
c = int(b)
print('the reversed number is', c) |
class BaseHandler:
def send(self, data, p):
pass
def recv(self, data, p):
pass
def shutdown(self, p, direction=2):
pass
def close(self):
pass
| class Basehandler:
def send(self, data, p):
pass
def recv(self, data, p):
pass
def shutdown(self, p, direction=2):
pass
def close(self):
pass |
enru=open('en-ru.txt','r')
input=open('input.txt','r')
output=open('output.txt','w')
s=enru.read()
x=''
prov={'q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m'}
slovar={}
s=s.replace('\t-\t',' ')
while len(s)>0:
slovar[s[:s.index(' ')]]=s[s.index(' '):s.index('\... | enru = open('en-ru.txt', 'r')
input = open('input.txt', 'r')
output = open('output.txt', 'w')
s = enru.read()
x = ''
prov = {'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm'}
slovar = {}
s = s.replace('\t-\t', ' ')
while len(s) > 0:
slo... |
def conv(x):
return int(''.join(t[c] for c in x))
b = input().split()
N = int(input())
a = [input() for _ in range(N)]
t = {b[i]: str(i) for i in range(10)}
a.sort(key = lambda x: conv(x))
print(*a, sep='\n')
| def conv(x):
return int(''.join((t[c] for c in x)))
b = input().split()
n = int(input())
a = [input() for _ in range(N)]
t = {b[i]: str(i) for i in range(10)}
a.sort(key=lambda x: conv(x))
print(*a, sep='\n') |
IS_TEST = True
REPOSITORY = 'cms-sw/cmssw'
def get_repo_url():
return 'https://github.com/' + REPOSITORY + '/'
CERN_SSO_CERT_FILE = 'private/cert.pem'
CERN_SSO_KEY_FILE = 'private/cert.key'
CERN_SSO_COOKIES_LOCATION = 'private/'
TWIKI_CONTACTS_URL = 'https://ppdcontacts.web.cern.ch/PPDContacts/ppd_contacts'
TWI... | is_test = True
repository = 'cms-sw/cmssw'
def get_repo_url():
return 'https://github.com/' + REPOSITORY + '/'
cern_sso_cert_file = 'private/cert.pem'
cern_sso_key_file = 'private/cert.key'
cern_sso_cookies_location = 'private/'
twiki_contacts_url = 'https://ppdcontacts.web.cern.ch/PPDContacts/ppd_contacts'
twiki_... |
# parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'leftIMPLIESSIMPLIESleftANDORleftRPARENLPARENrightNEGATIONALPHABET AND IMPLIES LPAREN NEGATION OR PREDICATE RPAREN SIMPLIESexpr : expr AND exprexpr : ALPHABETexpr : expr... | _tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'leftIMPLIESSIMPLIESleftANDORleftRPARENLPARENrightNEGATIONALPHABET AND IMPLIES LPAREN NEGATION OR PREDICATE RPAREN SIMPLIESexpr : expr AND exprexpr : ALPHABETexpr : expr OR exprexpr : NEGATION exprexpr : expr IMPLIES exprexpr : expr SIMPLIES exprexpr : LPAREN exp... |
def find_paths(start, connections, visited=None, small_cave_visited_twice=False):
if visited is None:
visited = ["start"]
possible_connections = [e for s, e in connections if s == start] + [s for s, e in connections if e == start]
paths = []
if not possible_connections:
raise ValueErro... | def find_paths(start, connections, visited=None, small_cave_visited_twice=False):
if visited is None:
visited = ['start']
possible_connections = [e for (s, e) in connections if s == start] + [s for (s, e) in connections if e == start]
paths = []
if not possible_connections:
raise value_e... |
class Tree:
def __init__(self, val,left = None, right = None):
self.val = val
self.left = left
self.right = right
root = Tree(4, left = Tree(3), right=Tree(5, left= Tree(4)))
#InOrderTraversal
def InOrderTraversal(root, res = []):
if root is None:
return res
... | class Tree:
def __init__(self, val, left=None, right=None):
self.val = val
self.left = left
self.right = right
root = tree(4, left=tree(3), right=tree(5, left=tree(4)))
def in_order_traversal(root, res=[]):
if root is None:
return res
in_order_traversal(root.left, res)
... |
def groups_for_user(environ, user):
if user == 'feng':
return ['secret-agents']
return ['']
| def groups_for_user(environ, user):
if user == 'feng':
return ['secret-agents']
return [''] |
SOLIDITY_TO_BQ_TYPES = {
'address': 'STRING',
}
table_description = ''
def abi_to_table_definitions_for_solana(
abi,
dataset_name,
contract_name,
contract_address=None,
include_functions=False
):
result = {}
for a in abi.get('events') if abi.get('events') else []:
... | solidity_to_bq_types = {'address': 'STRING'}
table_description = ''
def abi_to_table_definitions_for_solana(abi, dataset_name, contract_name, contract_address=None, include_functions=False):
result = {}
for a in abi.get('events') if abi.get('events') else []:
parser_type = 'log'
table_name = cr... |
roman_dict = {
"I" : 1,
"V" : 5,
"X" : 10,
"L" : 50,
"C" : 100,
"D" : 500,
"M" : 1000
}
class Solution:
def romanToInt(self, s: str) -> int:
previous = 0
current = 0
result = 0
for x in s[::-1]:
current = roman_dict[x]
if (previous > current):
... | roman_dict = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}
class Solution:
def roman_to_int(self, s: str) -> int:
previous = 0
current = 0
result = 0
for x in s[::-1]:
current = roman_dict[x]
if previous > current:
result ... |
# Usage: execute
# $ python support/generate.py
# at wpt/upgrade-insecure-requests/.
#
# Note: Some tests (link-upgrade.sub.https.html and
# websocket-upgrade.https.html) are not covered by this generator script.
template = '''<!DOCTYPE html>
<html>
<head>
<!-- Generated by wpt/upgrade-insecure-requests/support/genera... | template = '<!DOCTYPE html>\n<html>\n<head>\n<!-- Generated by wpt/upgrade-insecure-requests/support/generate.py -->%(additionalMeta)s\n<title>Upgrade Insecure Requests: %(name)s.</title>\n<script src="/resources/testharness.js"></script>\n<script src="/resources/testharnessreport.js"></script>\n<script src="./support/... |
#!usr/bin/env python3
color_chart = {
'1C1':[13.24, 88.89, 228.98, 0.], '1N1':[14.2, 95.37, 233.82, 0.], '1N2':[12.95, 91.79, 219.5, 0.],
'1W1':[14.67, 103.64, 229.41, 0.], '1W2':[14.69, 106.34, 227.28, 0.], '2C0':[15.73, 134.68, 222.32, 0.],
'2C1':[14.57, 125.89, 220.69, 0.], '2C3':[13.7, 103.72, 199.4... | color_chart = {'1C1': [13.24, 88.89, 228.98, 0.0], '1N1': [14.2, 95.37, 233.82, 0.0], '1N2': [12.95, 91.79, 219.5, 0.0], '1W1': [14.67, 103.64, 229.41, 0.0], '1W2': [14.69, 106.34, 227.28, 0.0], '2C0': [15.73, 134.68, 222.32, 0.0], '2C1': [14.57, 125.89, 220.69, 0.0], '2C3': [13.7, 103.72, 199.46, 0.0], '2N1': [15.0, 1... |
# !!!!!!! This file is OBSOLETE. Its content has been absorbed into pilotController.py in the autopilot repository.
# !!!!!!! Questions to Torre Wenaus.
PandaSiteIDs = {
'AGLT2' : {'nickname':'AGLT2-condor','status':'OK'},
'ALBERTA-LCG2' : {'nickname':'ALBERTA-LCG2-lcgce01-atlas-lcgpb... | panda_site_i_ds = {'AGLT2': {'nickname': 'AGLT2-condor', 'status': 'OK'}, 'ALBERTA-LCG2': {'nickname': 'ALBERTA-LCG2-lcgce01-atlas-lcgpbs', 'status': 'OK'}, 'ANALY_AGLT2': {'nickname': 'ANALY_AGLT2-condor', 'status': 'OK'}, 'ANALY_ALBERTA': {'nickname': 'ALBERTA-LCG2-lcgce01-atlas-lcgpbs', 'status': 'OK'}, 'ANALY_BEIJI... |
class ScenarioError(Exception):
pass
class ScenarioTxError(ScenarioError):
pass
class TokenRegistrationError(ScenarioTxError):
pass
class ChannelError(ScenarioError):
pass
class TransferFailed(ScenarioError):
pass
class NodesUnreachableError(ScenarioError):
pass
class RESTAPIError(Sc... | class Scenarioerror(Exception):
pass
class Scenariotxerror(ScenarioError):
pass
class Tokenregistrationerror(ScenarioTxError):
pass
class Channelerror(ScenarioError):
pass
class Transferfailed(ScenarioError):
pass
class Nodesunreachableerror(ScenarioError):
pass
class Restapierror(Scenario... |
def convertToHEXForChar(charList):
convertedCharList = []
for message in charList:
convertedCharList.append(ord(message))
return convertedCharList
def displayChar(line, *args):
concatedList = []
for argItem in args:
concatedList.extend(argItem)
print(len(concatedList))
for message in c... | def convert_to_hex_for_char(charList):
converted_char_list = []
for message in charList:
convertedCharList.append(ord(message))
return convertedCharList
def display_char(line, *args):
concated_list = []
for arg_item in args:
concatedList.extend(argItem)
print(len(concatedList))
... |
# ------------------------------------------------------- class: Constants ------------------------------------------------------- #
class Constants:
# --------------------------------------------------- Public properties -------------------------------------------------- #
USER_AGENT_FILE_NAME = 'ua.... | class Constants:
user_agent_file_name = 'ua.txt'
general_cookies_folder_name = 'cookies'
general_profile_folder_name = 'selenium-python-profile'
default_profile_id = 'test'
default_find_func_timeout = 2.5 |
expected = [
{
"abstract_type": None,
"content": "RET can be activated in cis or trans by its co-receptors and ligands in vitro, but the physiological roles of trans signaling are unclear. Rapidly adapting (RA) mechanoreceptors in dorsal root ganglia (DRGs) express Ret and the co-receptor Gfr\u03b12... | expected = [{'abstract_type': None, 'content': 'RET can be activated in cis or trans by its co-receptors and ligands in vitro, but the physiological roles of trans signaling are unclear. Rapidly adapting (RA) mechanoreceptors in dorsal root ganglia (DRGs) express Ret and the co-receptor Gfrα2 and depend on Ret for surv... |
# Prim's Algorithm in Python
INF = 9999999
# number of vertices in graph
V = 5
# create a 2d array of size 5x5
# for adjacency matrix to represent graph
G = [
[0, 9, 75, 0, 0],
[9, 0, 95, 19, 42],
[75, 95, 0, 51, 66],
[0, 19, 51, 0, 31],
[0, 42, 66, 31, 0],
]
# create a array to track... | inf = 9999999
v = 5
g = [[0, 9, 75, 0, 0], [9, 0, 95, 19, 42], [75, 95, 0, 51, 66], [0, 19, 51, 0, 31], [0, 42, 66, 31, 0]]
selected = [0, 0, 0, 0, 0]
no_edge = 0
selected[0] = True
print('Edge : Weight\n')
while no_edge < V - 1:
minimum = INF
x = 0
y = 0
for i in range(V):
if selected[i]:
... |
def func(a, b):
return a + b
def func2(a):
print(a)
print("Hello")
| def func(a, b):
return a + b
def func2(a):
print(a)
print('Hello') |
# Dimmer Switch class
class DimmerSwitch():
def __init__(self, label):
self.label = label
self.isOn = False
self.brightness = 0
def turnOn(self):
self.isOn = True
# turn the light on at self.brightness
def turnOff(self):
self.isOn = False
# ... | class Dimmerswitch:
def __init__(self, label):
self.label = label
self.isOn = False
self.brightness = 0
def turn_on(self):
self.isOn = True
def turn_off(self):
self.isOn = False
def raise_level(self):
if self.brightness < 10:
self.brightnes... |
print(list(range(10, 0, -2)))
# if start > end and step > 0:
# a list generated from start to no more than end with step as constant increment
# if start > end and step < 0:
# an empty list generated
# if start < end and step > 0:
# an empty list generated
# if start < end and step < 0
# a list generated from start to ... | print(list(range(10, 0, -2))) |
start = 104200
end = 702648265
for arm1 in range(start, end + 1):
exp = len(str(arm1))
num_sum = 0
c = arm1
while c > 0:
num = c % 10
num_sum += num ** exp
c //= 10
if arm1 != num_sum:
continue
else:
if arm1 == num_sum:
... | start = 104200
end = 702648265
for arm1 in range(start, end + 1):
exp = len(str(arm1))
num_sum = 0
c = arm1
while c > 0:
num = c % 10
num_sum += num ** exp
c //= 10
if arm1 != num_sum:
continue
else:
if arm1 == num_sum:
print('The first... |
def _do_set(env, name, value):
if env.contains(name):
env.set(name, value)
elif env.parent is not None:
_do_set(env.parent, name, value)
else:
raise Exception(
"Attempted to set name '%s' but it does not exist." %
name
)
def set_(env, symbol_name, va... | def _do_set(env, name, value):
if env.contains(name):
env.set(name, value)
elif env.parent is not None:
_do_set(env.parent, name, value)
else:
raise exception("Attempted to set name '%s' but it does not exist." % name)
def set_(env, symbol_name, value):
if symbol_name[0] != 'str... |
def email_subject(center_name):
return f"[Urgent Reminder] Vaccine slot is now available at {center_name}"
def email_body(email_data):
return f"Hi, \n" \
f"Vaccine slot is available for below centers \n " \
f"Center name and available data \n {email_data} \n" \
f"Please regis... | def email_subject(center_name):
return f'[Urgent Reminder] Vaccine slot is now available at {center_name}'
def email_body(email_data):
return f'Hi, \nVaccine slot is available for below centers \n Center name and available data \n {email_data} \nPlease register at cowin website https://cowin.gov.in \nHave a l... |
# -*- coding: utf-8 -*-
#
# Copyright Contributors to the Conu project.
# SPDX-License-Identifier: MIT
#
# TODO: move this line to some generic constants, instead of same in
# docker and nspawn
CONU_ARTIFACT_TAG = 'CONU.'
CONU_IMAGES_STORE = "/opt/conu-nspawn-images/"
CONU_NSPAWN_BASEPACKAGES = [
"dnf",
"ipro... | conu_artifact_tag = 'CONU.'
conu_images_store = '/opt/conu-nspawn-images/'
conu_nspawn_basepackages = ['dnf', 'iproute', 'dhcp-client', 'initscripts', 'passwd', 'systemd', 'rpm', 'bash', 'shadow-utils', 'sssd-client', 'util-linux', 'libcrypt', 'sssd-client', 'coreutils', 'glibc-all-langpacks', 'vim-minimal']
bootstrap_... |
def get_p_distance(list1, list2):
count = 0
i = 0
while i < len(list1):
if (list1[i] != list2[i]):
count += .1
i += 1
return count
def get_p_distance_matrix(list1, list2, list3, list4):
dna1 = get_p_distance(list1, list1), get_p_distance(list1, list2), get_p_distance(lis... | def get_p_distance(list1, list2):
count = 0
i = 0
while i < len(list1):
if list1[i] != list2[i]:
count += 0.1
i += 1
return count
def get_p_distance_matrix(list1, list2, list3, list4):
dna1 = (get_p_distance(list1, list1), get_p_distance(list1, list2), get_p_distance(lis... |
#
# PySNMP MIB module ZHONE-COM-IP-FILTER-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZHONE-COM-IP-FILTER-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:47:04 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 ... | (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, single_value_constraint, value_range_constraint, constraints_union, constraints_intersection) ... |
# https://leetcode.com/problems/contains-duplicate/
# We are forming whole set always which isn't optimal though time complexity is O(n).
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
return len(nums) != len(set(nums)) | class Solution:
def contains_duplicate(self, nums: List[int]) -> bool:
return len(nums) != len(set(nums)) |
a=''
n=int(input())
while n != 0:
a=str(n%2)+a
n//=2
print(a)
| a = ''
n = int(input())
while n != 0:
a = str(n % 2) + a
n //= 2
print(a) |
class UniErrors(Exception):
pass
class SetupErrors(UniErrors):
pass
class SettingErrors(UniErrors):
pass
class ConfigureSyntaxErrors(UniErrors):
pass
class NoLocationErrors(UniErrors):
pass
class ImportedErrors(UniErrors):
pass
class KernelWaresSettingsErrors(UniErrors):
pass
c... | class Unierrors(Exception):
pass
class Setuperrors(UniErrors):
pass
class Settingerrors(UniErrors):
pass
class Configuresyntaxerrors(UniErrors):
pass
class Nolocationerrors(UniErrors):
pass
class Importederrors(UniErrors):
pass
class Kernelwaressettingserrors(UniErrors):
pass
class Re... |
def string_to_list(string,array):
x=input(string)
i=1
while x[i]!=']':
if x[i]!=',':
j=i
temp=''
while x[j]!=',':
if x[j]==']':
break
temp+=x[j]
j+=1
i=j
array.append(i... | def string_to_list(string, array):
x = input(string)
i = 1
while x[i] != ']':
if x[i] != ',':
j = i
temp = ''
while x[j] != ',':
if x[j] == ']':
break
temp += x[j]
j += 1
i = j
... |
# You are given an array (which will have a length of at least 3, but could be very large) containing integers. The array is either entirely comprised of odd integers or entirely comprised of even integers except for a single integer N. Write a method that takes the array as an argument and returns this "outlier" N.
#... | def find_outlier(integers):
l = list(filter(lambda x: x % 2 == 0, integers))
return list(filter(lambda x: x % 2, integers))[0] if len(l) > 1 else l[0] |
#
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PR... | class Bootpriority:
def get_boot_priority(aName=None, aType=None, aWriteOnly=0):
return 1 |
#Assignment 9.4
#print('Hello World')
fname = input('Enter name: ')
if len(fname) < 1 : fname = 'mbox-short.txt'
handle = open(fname)
di = {} #create an empty dictionary
for line in handle:
line = line.rstrip()
wds = line.split()
#the second for-loop to print each word in the list
for w in wds :
... | fname = input('Enter name: ')
if len(fname) < 1:
fname = 'mbox-short.txt'
handle = open(fname)
di = {}
for line in handle:
line = line.rstrip()
wds = line.split()
for w in wds:
di[w] = di.get(w, 0) + 1
largest = -1
theword = None
for (k, v) in di.items():
print(k, v)
if v > largest:
... |
class TypeRef:
'''Represents temporary type references by an integer; to be resolved
to actual types later
'''
def __init__(self, type_ref: int):
self.type_ref = type_ref
def __hash__(self):
return hash(self.type_ref)
def __eq__(self, other):
return isinstance(other,... | class Typeref:
"""Represents temporary type references by an integer; to be resolved
to actual types later
"""
def __init__(self, type_ref: int):
self.type_ref = type_ref
def __hash__(self):
return hash(self.type_ref)
def __eq__(self, other):
return isinstance(other... |
#!/usr/bin/env python
# encoding: utf-8
def run(whatweb, pluginname):
whatweb.recog_from_file(pluginname, "doc/page/login.asp", "Hikvision")
| def run(whatweb, pluginname):
whatweb.recog_from_file(pluginname, 'doc/page/login.asp', 'Hikvision') |
wt1_10_10 = {'192.168.122.110': [5.5754, 5.5952, 9.2422, 8.5338, 9.0058, 8.4025, 8.7557, 8.4405, 8.1397, 8.1318, 8.0657, 7.8501, 8.1701, 8.0757, 7.8899, 7.7329, 7.6153, 7.9967, 7.9363, 7.838, 8.7936, 8.6351, 8.5151, 8.6381, 8.7262, 8.816, 8.8984, 8.7799, 8.8584, 8.9543, 8.8833, 8.794, 8.6935, 8.735, 8.635, 8.5429, 8.6... | wt1_10_10 = {'192.168.122.110': [5.5754, 5.5952, 9.2422, 8.5338, 9.0058, 8.4025, 8.7557, 8.4405, 8.1397, 8.1318, 8.0657, 7.8501, 8.1701, 8.0757, 7.8899, 7.7329, 7.6153, 7.9967, 7.9363, 7.838, 8.7936, 8.6351, 8.5151, 8.6381, 8.7262, 8.816, 8.8984, 8.7799, 8.8584, 8.9543, 8.8833, 8.794, 8.6935, 8.735, 8.635, 8.5429, 8.61... |
#!/usr/bin/env python3
def simulate(reg_0, find_non_loop):
seen = set()
c = 0
last_unique_c = -1
while True:
a = c | 65536
c = reg_0
while True:
c = (((c + (a & 255)) & 16777215) * 65899) & 16777215
if a < 256:
if find_non_loop:
... | def simulate(reg_0, find_non_loop):
seen = set()
c = 0
last_unique_c = -1
while True:
a = c | 65536
c = reg_0
while True:
c = (c + (a & 255) & 16777215) * 65899 & 16777215
if a < 256:
if find_non_loop:
return c
... |
# Directions
UP = 'UP'
DOWN = 'DOWN'
LEFT = 'LEFT'
RIGHT = 'RIGHT'
# Colors
RED = (255, 0, 0)
BLACK = (0, 0, 0)
GREEN = (0, 255, 0)
WHITE = (255, 255, 255)
| up = 'UP'
down = 'DOWN'
left = 'LEFT'
right = 'RIGHT'
red = (255, 0, 0)
black = (0, 0, 0)
green = (0, 255, 0)
white = (255, 255, 255) |
#!/usr/bin/env python3
flags = ['QCTF{2a5576bc51a5c3feb82c96fe80d3a520}', 'QCTF{eb2ddbf0e318812ede843e8ecec6144f}', 'QCTF{5cdf65c6069a6b815352c3f1b4d09a56}', 'QCTF{69d7b7deb23746b8bd18b22f3eb92b50}', 'QCTF{44e37938c0bc05393b5b33a70c5a70db}', 'QCTF{3b37a953391e38ce0b8e168e9eaa6ec5}', 'QCTF{ee2848cb73236007d36cb5ae75c4... | flags = ['QCTF{2a5576bc51a5c3feb82c96fe80d3a520}', 'QCTF{eb2ddbf0e318812ede843e8ecec6144f}', 'QCTF{5cdf65c6069a6b815352c3f1b4d09a56}', 'QCTF{69d7b7deb23746b8bd18b22f3eb92b50}', 'QCTF{44e37938c0bc05393b5b33a70c5a70db}', 'QCTF{3b37a953391e38ce0b8e168e9eaa6ec5}', 'QCTF{ee2848cb73236007d36cb5ae75c4d2bf}', 'QCTF{8dceee7e583... |
def transaccion(retiro, saldo):
if retiro % 5 != 0:
return(saldo)
elif (saldo - retiro) < 0:
return(saldo)
elif saldo == retiro:
return(saldo)
else:
return(saldo - retiro - 0.5)
def main():
entrada = open("input.txt","r")
salida = open("output.txt","w")
T = ... | def transaccion(retiro, saldo):
if retiro % 5 != 0:
return saldo
elif saldo - retiro < 0:
return saldo
elif saldo == retiro:
return saldo
else:
return saldo - retiro - 0.5
def main():
entrada = open('input.txt', 'r')
salida = open('output.txt', 'w')
t = int(e... |
_base_config_ = ["base.py"]
generator = dict(
input_cse=True,
use_cse=True
)
discriminator=dict(
pred_only_cse=False,
pred_only_semantic=True
)
loss = dict(
gan_criterion=dict(type="segmentation", seg_weight=.1)
)
| _base_config_ = ['base.py']
generator = dict(input_cse=True, use_cse=True)
discriminator = dict(pred_only_cse=False, pred_only_semantic=True)
loss = dict(gan_criterion=dict(type='segmentation', seg_weight=0.1)) |
# Python - 3.4.3
Test.it('Basic Tests')
Test.assert_equals(invert([1, 2, 3, 4, 5]), [-1, -2, -3, -4, -5])
Test.assert_equals(invert([1, -2, 3, -4, 5]), [-1, 2, -3, 4, -5])
Test.assert_equals(invert([]), [])
| Test.it('Basic Tests')
Test.assert_equals(invert([1, 2, 3, 4, 5]), [-1, -2, -3, -4, -5])
Test.assert_equals(invert([1, -2, 3, -4, 5]), [-1, 2, -3, 4, -5])
Test.assert_equals(invert([]), []) |
__title__ = 'logxs'
__description__ = 'Replacing with build-in `print` with nice formatting.'
__url__ = 'https://github.com/minlaxz/logxs'
__version__ = '0.3.2'
__author__ = 'Min Latt'
__author_email__ = 'minminlaxz@gmail.com'
__license__ = 'MIT' | __title__ = 'logxs'
__description__ = 'Replacing with build-in `print` with nice formatting.'
__url__ = 'https://github.com/minlaxz/logxs'
__version__ = '0.3.2'
__author__ = 'Min Latt'
__author_email__ = 'minminlaxz@gmail.com'
__license__ = 'MIT' |
num = input()
lucky = 0
for i in num:
if i == '4' or i == '7':
lucky += 1
counter = 0
for c in str(lucky):
if c == '4' or c == '7':
counter += 1
if counter == len(str(lucky)):
print("YES")
else:
print("NO")
| num = input()
lucky = 0
for i in num:
if i == '4' or i == '7':
lucky += 1
counter = 0
for c in str(lucky):
if c == '4' or c == '7':
counter += 1
if counter == len(str(lucky)):
print('YES')
else:
print('NO') |
s=str(input())
a=[]
for i in range(len(s)):
si=s[i]
a.append(si)
b=[]
n=str(input())
for j in range(len(n)):
sj=n[j]
b.append(sj)
p={}
for pi in range(len(s)):
key=s[pi]
p[key]=0
j1=0
for i in range(0,len(a)):
key=a[i]
while j1<len(b):
bj=b[0]
if key in p:
p[k... | s = str(input())
a = []
for i in range(len(s)):
si = s[i]
a.append(si)
b = []
n = str(input())
for j in range(len(n)):
sj = n[j]
b.append(sj)
p = {}
for pi in range(len(s)):
key = s[pi]
p[key] = 0
j1 = 0
for i in range(0, len(a)):
key = a[i]
while j1 < len(b):
bj = b[0]
i... |
N, *A = map(int, open(0).read().split())
A.sort()
for i in range(N):
if i == A[i] - 1:
continue
print('No')
break
else:
print('Yes')
| (n, *a) = map(int, open(0).read().split())
A.sort()
for i in range(N):
if i == A[i] - 1:
continue
print('No')
break
else:
print('Yes') |
class status(Exception):
def __init__(self, code=200, response=None):
super().__init__("season.core.CLASS.RESPONSE.STATUS")
self.code = code
self.response = response
def get_response(self):
return self.response, self.code | class Status(Exception):
def __init__(self, code=200, response=None):
super().__init__('season.core.CLASS.RESPONSE.STATUS')
self.code = code
self.response = response
def get_response(self):
return (self.response, self.code) |
#!/usr/bin/env python3
def calculate():
ans = sum(1
for i in range(1, 10000000)
if get_terminal(i) == 89)
return str(ans)
TERMINALS = (1, 89)
def get_terminal(n):
while n not in TERMINALS:
n = square_digit_sum(n)
return n
def square_digit_sum(n):
result = 0
... | def calculate():
ans = sum((1 for i in range(1, 10000000) if get_terminal(i) == 89))
return str(ans)
terminals = (1, 89)
def get_terminal(n):
while n not in TERMINALS:
n = square_digit_sum(n)
return n
def square_digit_sum(n):
result = 0
while n > 0:
result += sq_sum[n % 1000]
... |
def gen_doc_html(version, api_list):
doc_html = f'''
<!DOCTYPE html>
<html>
<head><meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
body{{margin:40px auto;
max-width:650px; line-height:1.6;
font... | def gen_doc_html(version, api_list):
doc_html = f"""\n <!DOCTYPE html>\n <html>\n <head><meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <style type="text/css">\n body{{margin:40px auto;\n max-width:650px; line-height:1.6;\n ... |
countries = {'Russia' : 'Europe', 'Germany' : 'Europe', 'Australia' : 'Australia'}
sqrs = {}
sqrs[1] = 1
sqrs[2] = 4
sqrs[10] = 100
print(sqrs)
myDict = dict([['key1', 'value1'], ('key2', 'value2')])
print(myDict)
phones = {'police' : 102, 'ambulance' : 103, 'firefighters' : 101}
print(phones['police'])
phones = {'... | countries = {'Russia': 'Europe', 'Germany': 'Europe', 'Australia': 'Australia'}
sqrs = {}
sqrs[1] = 1
sqrs[2] = 4
sqrs[10] = 100
print(sqrs)
my_dict = dict([['key1', 'value1'], ('key2', 'value2')])
print(myDict)
phones = {'police': 102, 'ambulance': 103, 'firefighters': 101}
print(phones['police'])
phones = {'police': ... |
def f(x):
'''Does nothing.
:type x: a.C
'''
pass
| def f(x):
"""Does nothing.
:type x: a.C
"""
pass |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.