content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to ... | definition = {'type': 'table', 'displayName': 'TEST_Fire Period Table', 'outputFile': './FirePeriodTable.txt', 'constantVariable': 'TimePeriod', 'rowVariable': 'EditArea', 'columnVariable': 'WeatherElement', 'beginningText': 'Fire Period Table for %TimePeriod. \n\n', 'endingText': '', 'defaultEditAreas': [('area1', 'Ar... |
# 20
num = 1
for i in range(100):
num *= i + 1
print(sum(int(n) for n in str(num)))
| num = 1
for i in range(100):
num *= i + 1
print(sum((int(n) for n in str(num)))) |
#
# PySNMP MIB module ADIC-INTELLIGENT-STORAGE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ADIC-INTELLIGENT-STORAGE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:13:36 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python vers... | (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, value_range_constraint, single_value_constraint, constraints_intersection, constraints_union) ... |
description = 'Q range displaying devices'
group = 'lowlevel'
includes = ['detector', 'det1', 'sans1_det', 'alias_lambda']
devices = dict(
QRange = device('nicos_mlz.sans1.devices.resolution.Resolution',
description = 'Current q range',
detector = 'det1',
beamstop = 'bs1',
wavelen... | description = 'Q range displaying devices'
group = 'lowlevel'
includes = ['detector', 'det1', 'sans1_det', 'alias_lambda']
devices = dict(QRange=device('nicos_mlz.sans1.devices.resolution.Resolution', description='Current q range', detector='det1', beamstop='bs1', wavelength='wl', detpos='det1_z')) |
pkgname = "gsettings-desktop-schemas"
pkgver = "42.0"
pkgrel = 0
build_style = "meson"
configure_args = ["-Dintrospection=true"]
hostmakedepends = [
"meson", "pkgconf", "glib-devel", "gobject-introspection"
]
makedepends = ["libglib-devel"]
depends = [
"fonts-cantarell-otf", "fonts-source-code-pro-otf", "adwait... | pkgname = 'gsettings-desktop-schemas'
pkgver = '42.0'
pkgrel = 0
build_style = 'meson'
configure_args = ['-Dintrospection=true']
hostmakedepends = ['meson', 'pkgconf', 'glib-devel', 'gobject-introspection']
makedepends = ['libglib-devel']
depends = ['fonts-cantarell-otf', 'fonts-source-code-pro-otf', 'adwaita-icon-them... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
class GpioData:
_count = 0
_modNum = 8
_specMap = {}
_freqMap = {}
_mapList = []
_modeMap = {}
_smtMap = {}
_map_table = {}
def __init__(self):
self.__defMode = 0
self.__eintMode = False
self.__modeVec = ['0', '0', ... | class Gpiodata:
_count = 0
_mod_num = 8
_spec_map = {}
_freq_map = {}
_map_list = []
_mode_map = {}
_smt_map = {}
_map_table = {}
def __init__(self):
self.__defMode = 0
self.__eintMode = False
self.__modeVec = ['0', '0', '0', '0', '0', '0', '0', '0']
... |
class Solution:
def smallestRepunitDivByK(self, k: int) -> int:
if k % 2 == 0 or k % 5 == 0:
return -1
if k == 1:
return 1
count = 1
n = 1
while (n % k > 0):
n = (n % k) * 10 + 1
count += 1
return count
| class Solution:
def smallest_repunit_div_by_k(self, k: int) -> int:
if k % 2 == 0 or k % 5 == 0:
return -1
if k == 1:
return 1
count = 1
n = 1
while n % k > 0:
n = n % k * 10 + 1
count += 1
return count |
class PiggyBank:
# create __init__ and add_money methods
def __init__(self, dollars, cents):
self.dollars = dollars
self.cents = cents
def add_money(self, deposit_dollars, deposit_cents):
self.dollars += deposit_dollars
self.cents += deposit_cents
if self.cents >= 10... | class Piggybank:
def __init__(self, dollars, cents):
self.dollars = dollars
self.cents = cents
def add_money(self, deposit_dollars, deposit_cents):
self.dollars += deposit_dollars
self.cents += deposit_cents
if self.cents >= 100:
to_dollar = int(self.cents /... |
class Solution:
def countAndSay(self, n: int) -> str:
s = '1'
for _ in range(1, n):
nextS = ''
countC = 1
for i in range(1, len(s) + 1):
if i == len(s) or s[i] != s[i - 1]:
nextS += str(countC) + s[i - 1]
cou... | class Solution:
def count_and_say(self, n: int) -> str:
s = '1'
for _ in range(1, n):
next_s = ''
count_c = 1
for i in range(1, len(s) + 1):
if i == len(s) or s[i] != s[i - 1]:
next_s += str(countC) + s[i - 1]
... |
def convert_to_int(integer_string_with_commas):
comma_separated_parts = integer_string_with_commas.split(",")
for i in range(len(comma_separated_parts)):
if len(comma_separated_parts[i]) > 3:
return None
if i != 0 and len(comma_separated_parts[i]) != 3:
return None
in... | def convert_to_int(integer_string_with_commas):
comma_separated_parts = integer_string_with_commas.split(',')
for i in range(len(comma_separated_parts)):
if len(comma_separated_parts[i]) > 3:
return None
if i != 0 and len(comma_separated_parts[i]) != 3:
return None
in... |
class Component:
def update(self):
return self
def print_to(self, x, y, media):
return media
| class Component:
def update(self):
return self
def print_to(self, x, y, media):
return media |
# CAPWATCH downloader config variables
## Copyright 2017 Marshall E. Giguere
##
## 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
... | uid = ''
passwd = ''
unit = 'NER-NH-001'
dl_filepath = ''
timeout = 5
dom_timeout = 50
batch = False |
class FakeCustomerRepository:
def __init__(self):
self.customers = []
def get_by_id(self, customer_id):
return next(
(customer for customer in self.customers if customer.id == customer_id),
None,
)
def get_by_email(self, email):
return next(
... | class Fakecustomerrepository:
def __init__(self):
self.customers = []
def get_by_id(self, customer_id):
return next((customer for customer in self.customers if customer.id == customer_id), None)
def get_by_email(self, email):
return next((customer for customer in self.customers if... |
#
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | class Runtimeconfig(object):
work_mode = None
job_queue = None
use_local_database = False
@staticmethod
def init_config(**kwargs):
for (k, v) in kwargs.items():
if hasattr(RuntimeConfig, k):
setattr(RuntimeConfig, k, v) |
#
# PySNMP MIB module CISCO-ENTITY-SENSOR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ENTITY-SENSOR-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:39:57 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 ... | (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, value_range_constraint, constraints_intersection, constraints_union, single_value_constraint) ... |
INSTALLED_APPS += (
'social_auth',
)
AUTHENTICATION_BACKENDS = (
'social_auth.backends.twitter.TwitterBackend',
'social_auth.backends.facebook.FacebookBackend',
'django.contrib.auth.backends.ModelBackend',
)
TEMPLATE_CONTEXT_PROCESSORS += (
'social_auth.context_processors.social_auth_backends',
... | installed_apps += ('social_auth',)
authentication_backends = ('social_auth.backends.twitter.TwitterBackend', 'social_auth.backends.facebook.FacebookBackend', 'django.contrib.auth.backends.ModelBackend')
template_context_processors += ('social_auth.context_processors.social_auth_backends', 'social_auth.context_processor... |
num_waves = 4
num_eqn = 5
# Conserved quantities
density = 0
x_momentum = 1
y_momentum = 2
energy = 3
tracer = 4
| num_waves = 4
num_eqn = 5
density = 0
x_momentum = 1
y_momentum = 2
energy = 3
tracer = 4 |
class Solution:
def circularArrayLoop(self, nums: List[int]) -> bool:
N = len(nums)
for i, num in enumerate(nums):
if num == 0: continue
cur = i
flag = num / abs(num)
seen = set()
while nums[cur] * flag > 0:
nx = (cur + nums... | class Solution:
def circular_array_loop(self, nums: List[int]) -> bool:
n = len(nums)
for (i, num) in enumerate(nums):
if num == 0:
continue
cur = i
flag = num / abs(num)
seen = set()
while nums[cur] * flag > 0:
... |
N, M = map(int, input().split())
for i in range(1, N, 2):
print(''.join(['.|.'] * i).center(M, '-'))
print("WELCOME".center(M, '-'))
for i in range(N-2, -1, -2):
print(''.join(['.|.'] * i).center(M, '-'))
| (n, m) = map(int, input().split())
for i in range(1, N, 2):
print(''.join(['.|.'] * i).center(M, '-'))
print('WELCOME'.center(M, '-'))
for i in range(N - 2, -1, -2):
print(''.join(['.|.'] * i).center(M, '-')) |
class SVGFilterInputs:
SourceGraphic = 'SourceGraphic'
SourceAlpha = 'SourceAlpha'
BackgroundImage = 'BackgroundImage'
BackgroundAlpha = 'BackgroundAlpha'
FillPaint = 'FillPaint'
StrokePaint = 'StrokePaint'
class SVGFilter:
def __init__(self, svg):
self.svg = svg
def render... | class Svgfilterinputs:
source_graphic = 'SourceGraphic'
source_alpha = 'SourceAlpha'
background_image = 'BackgroundImage'
background_alpha = 'BackgroundAlpha'
fill_paint = 'FillPaint'
stroke_paint = 'StrokePaint'
class Svgfilter:
def __init__(self, svg):
self.svg = svg
def ren... |
#coding:utf-8
bind = 'unix:/var/run/gunicorn.sock'
workers = 4
# you should change this
user = 'root'
# maybe you like error
loglevel = 'warning'
errorlog = '-'
secure_scheme_headers = {
'X-SCHEME': 'https',
}
x_forwarded_for_header = 'X-FORWARDED-FOR'
### gunicorn -c settings.py -b 0.0.0.0:9000 wsgi:app
| bind = 'unix:/var/run/gunicorn.sock'
workers = 4
user = 'root'
loglevel = 'warning'
errorlog = '-'
secure_scheme_headers = {'X-SCHEME': 'https'}
x_forwarded_for_header = 'X-FORWARDED-FOR' |
def get_count_A_C_G_and_T_in_string(dna_string):
'''
Create a function named get_count_A_C_G_and_T_in_string with a parameter named dna_string.
:param dna_string: a DNA string
:return: the count of As, Cs, Gs, and Ts in the dna_string
'''
A_count=0
C_count=0
G_count=0
T_count=0
... | def get_count_a_c_g_and_t_in_string(dna_string):
"""
Create a function named get_count_A_C_G_and_T_in_string with a parameter named dna_string.
:param dna_string: a DNA string
:return: the count of As, Cs, Gs, and Ts in the dna_string
"""
a_count = 0
c_count = 0
g_count = 0
t_count ... |
for i in range(10):
a = i
print(a)
| for i in range(10):
a = i
print(a) |
# LeetCode 897. Increasing Order Search Tree `E`
# 1sk | 89% | 19'
# A~0v10
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def increasingBST(self, root: T... | class Solution:
def increasing_bst(self, root: TreeNode) -> TreeNode:
ans = self.tree = tree_node(None)
self.inorder(root)
return ans.right
def inorder(self, node):
if not node:
return
self.inorder(node.left)
node.left = None
self.tree.right ... |
# Python program to print positive Numbers in a List
# list of numbers
list1 = [10, -21, 4, -45, -66, -93]
# using list comprehension
positive_nos = [num for num in list1 if num <= 0]
print("positive numbers in the list: ", positive_nos)
# Remove multiple elements from list
l = [3, 5, 7, 4, 8, 4, 3]
l.sort()
pri... | list1 = [10, -21, 4, -45, -66, -93]
positive_nos = [num for num in list1 if num <= 0]
print('positive numbers in the list: ', positive_nos)
l = [3, 5, 7, 4, 8, 4, 3]
l.sort()
print('l=', l)
l = [1, 2, 3, 4]
l.reverse()
print(l) |
# nested try's
try:
print("try 1")
try:
print("try 2")
foo()
except:
print("except 2")
bar()
except:
print("except 1")
try:
print("try 1")
try:
print("try 2")
foo()
except TypeError:
print("except 2")
bar()
except NameError:
print... | try:
print('try 1')
try:
print('try 2')
foo()
except:
print('except 2')
bar()
except:
print('except 1')
try:
print('try 1')
try:
print('try 2')
foo()
except TypeError:
print('except 2')
bar()
except NameError:
print('except 1')
def... |
__all__ = [
'fullname',
'starts_with'
]
# https://stackoverflow.com/questions/2020014/get-fully-qualified-class-name-of-an-object-in-python
def fullname(o):
if o is None:
return None
module = o.__class__.__module__
if module is None or module == str.__class__.__module__:
return o... | __all__ = ['fullname', 'starts_with']
def fullname(o):
if o is None:
return None
module = o.__class__.__module__
if module is None or module == str.__class__.__module__:
return o.__class__.__name__
else:
return module + '.' + o.__class__.__name__
def starts_with(collection, tex... |
config_prefix = '='
config_description = 'Use =help to get started!'
config_owner_id = 311661241406062592
config_bot_log_channel = 741486105173688351
config_command_log_channel = 741486105173688351
config_error_log_channel = 741486105173688351
config_guild_log_channel = 741486105173688351
| config_prefix = '='
config_description = 'Use =help to get started!'
config_owner_id = 311661241406062592
config_bot_log_channel = 741486105173688351
config_command_log_channel = 741486105173688351
config_error_log_channel = 741486105173688351
config_guild_log_channel = 741486105173688351 |
#Number analysis program
NUMBER_SERIES = 20
def main():
#here is the mathematical algorithm/code
numbers = get_numbers()
total = calculate_total(numbers)
average = total / len(numbers)
highest_number = max(numbers)
lowest_number = min(numbers)
print()
print_details(numbers,total,averag... | number_series = 20
def main():
numbers = get_numbers()
total = calculate_total(numbers)
average = total / len(numbers)
highest_number = max(numbers)
lowest_number = min(numbers)
print()
print_details(numbers, total, average, highest_number, lowest_number)
def get_numbers():
number_list... |
def eastern_boundaries(lon,lat):
m = Basemap(projection='cyl')
boundaries = []
last_l_is_land = m.is_land(lon[0],lat)
for l in lon[1:]:
current_l_is_land = m.is_land(l,lat)
if last_l_is_land and not current_l_is_land:
boundaries.append(l)
last_l_is_land = current_l_is... | def eastern_boundaries(lon, lat):
m = basemap(projection='cyl')
boundaries = []
last_l_is_land = m.is_land(lon[0], lat)
for l in lon[1:]:
current_l_is_land = m.is_land(l, lat)
if last_l_is_land and (not current_l_is_land):
boundaries.append(l)
last_l_is_land = current... |
def counter(start, stop):
x=start
if start>stop:
return_string = "Counting down: "
while x != stop:
return_string += str(x)
if x!=stop:
return_string += ","
else:
return_string = "Counting up: "
while x !=stop:
return_string += str(x)
... | def counter(start, stop):
x = start
if start > stop:
return_string = 'Counting down: '
while x != stop:
return_string += str(x)
if x != stop:
return_string += ','
else:
return_string = 'Counting up: '
while x != stop:
return... |
number = 9
print(type(number)) # print type of variable "number"
float_number = 9.0
print(float_number)
print(int(float_number))
| number = 9
print(type(number))
float_number = 9.0
print(float_number)
print(int(float_number)) |
# https://www.codechef.com/problems/FLOW005
for T in range(int(input())):
a,n,s = [100,50,10,5,2,1],int(input()),0
for i in a: s,n = s+(n//i),n%i
print(s) | for t in range(int(input())):
(a, n, s) = ([100, 50, 10, 5, 2, 1], int(input()), 0)
for i in a:
(s, n) = (s + n // i, n % i)
print(s) |
def fibonacci(num):
if num < 0:
print("Make it a positive number")
elif num == 1:
return 0
elif num == 2:
return 1
else:
return fibonacci(num-1)+fibonacci(num-2)
| def fibonacci(num):
if num < 0:
print('Make it a positive number')
elif num == 1:
return 0
elif num == 2:
return 1
else:
return fibonacci(num - 1) + fibonacci(num - 2) |
def close2zero(t):
try:
i,j = sorted(map(int, set(t.split())),
key = lambda x: abs(int(x)))[:2]
return max(i,j) if abs(i)==abs(j) else i
except:
return 0
| def close2zero(t):
try:
(i, j) = sorted(map(int, set(t.split())), key=lambda x: abs(int(x)))[:2]
return max(i, j) if abs(i) == abs(j) else i
except:
return 0 |
styleDict = {
'clear': f'\033[0m',
'bold': f'\033[1m',
'dim': f'\033[2m',
'italic': f'\033[3m',
'underline': f'\033[4m',
'blinking': f'\033[5m',
'anarch': f'\033[38;2;255;106;51m',
'criminal': f'\033[38;2;65;105;255m',
'shaper': f'\033[38;2;50;205;50m',
'haas-bioroid': f'\033[3... | style_dict = {'clear': f'\x1b[0m', 'bold': f'\x1b[1m', 'dim': f'\x1b[2m', 'italic': f'\x1b[3m', 'underline': f'\x1b[4m', 'blinking': f'\x1b[5m', 'anarch': f'\x1b[38;2;255;106;51m', 'criminal': f'\x1b[38;2;65;105;255m', 'shaper': f'\x1b[38;2;50;205;50m', 'haas-bioroid': f'\x1b[38;2;138;43;226m', 'jinteki': f'\x1b[38;2;2... |
DB_HOST = 'localhost'
DB_PORT = 5432
DB_USER = 'platappform'
DB_PASSWORD = 'development'
DB_DATABASE = 'platappform_dev'
DB_POOL_MIN_SIZE = 5 #default
DB_POOL_MAX_SIZE = 10 #default
| db_host = 'localhost'
db_port = 5432
db_user = 'platappform'
db_password = 'development'
db_database = 'platappform_dev'
db_pool_min_size = 5
db_pool_max_size = 10 |
class Component:
def __init__(self, position):
self.position = position
self.dirty = True
self.focus = False
def update(self, screen):
if self.dirty:
screen.blit(self.surface, self.position)
self.dirty = False
| class Component:
def __init__(self, position):
self.position = position
self.dirty = True
self.focus = False
def update(self, screen):
if self.dirty:
screen.blit(self.surface, self.position)
self.dirty = False |
#
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
#
# get the configuration propertie... | params = {'url': configuration.url, 'username': configuration.username, 'password': configuration.password, 'proxyHost': configuration.proxyHost, 'proxyPort': configuration.proxyPort, 'proxyUsername': configuration.proxyUsername, 'proxyPassword': configuration.proxyPassword}
response = http_request(params).get('/api/v4... |
title = ' MULTIPLICATION TABLES '
line = len(title) * '-'
print('{}\n{}'.format(title, line))
for x in range(1,13):
for i in range(1,13):
f = i
i = i * x
print(' {} x {} = {}'.format(x,f,i))
print('')
| title = ' MULTIPLICATION TABLES '
line = len(title) * '-'
print('{}\n{}'.format(title, line))
for x in range(1, 13):
for i in range(1, 13):
f = i
i = i * x
print(' {} x {} = {}'.format(x, f, i))
print('') |
def list_view(tree):
print("Listing\n")
movies = tree.list_by_name()
if movies:
print("Every movie in tree:")
for movie in movies:
print(movie)
else:
print("Empty tree.")
input("ENTER to continue")
| def list_view(tree):
print('Listing\n')
movies = tree.list_by_name()
if movies:
print('Every movie in tree:')
for movie in movies:
print(movie)
else:
print('Empty tree.')
input('ENTER to continue') |
class GameObject:
def __init__(self, id, bounds_offsets, width, height, pos_x, pos_y, speed):
self.id = id
self.bounds_offsets = bounds_offsets
self.bounds = []
for offset_array in bounds_offsets:
self.bounds.append({})
self.width = width # In meters
... | class Gameobject:
def __init__(self, id, bounds_offsets, width, height, pos_x, pos_y, speed):
self.id = id
self.bounds_offsets = bounds_offsets
self.bounds = []
for offset_array in bounds_offsets:
self.bounds.append({})
self.width = width
self.height = he... |
#
# Copyright (c) 2017-2018 Joy Diamond. All rights reserved.
#
@gem('Sapphire.UnaryExpression')
def gem():
require_gem('Sapphire.Tree')
@share
class UnaryExpression(SapphireTrunk):
__slots__ = ((
'a', # Expression
))
class_order = ... | @gem('Sapphire.UnaryExpression')
def gem():
require_gem('Sapphire.Tree')
@share
class Unaryexpression(SapphireTrunk):
__slots__ = ('a',)
class_order = CLASS_ORDER__UNARY_EXPRESSION
is_colon = false
is_special_operator = false
def __init__(t, a):
t.a = a
... |
list_of_lists = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']]
string = ''
for l in list_of_lists:
max_i = len(l)
for i in range(len(l)):
if i < max_i - 1:
string += l[i]+','
else:
string += l[i]+'\n'
print(string)
| list_of_lists = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']]
string = ''
for l in list_of_lists:
max_i = len(l)
for i in range(len(l)):
if i < max_i - 1:
string += l[i] + ','
else:
string += l[i] + '\n'
print(string) |
quant = int(input())
for c in range(quant):
num_estudantes = int(input())
nomes = input().split(' ')
registro = input().split(' ')
reprovados = []
contador = 0
for frequencia in registro:
media = 0
tam = len(frequencia)
for letra in frequencia:
if letra == "P"... | quant = int(input())
for c in range(quant):
num_estudantes = int(input())
nomes = input().split(' ')
registro = input().split(' ')
reprovados = []
contador = 0
for frequencia in registro:
media = 0
tam = len(frequencia)
for letra in frequencia:
if letra == 'P'... |
# -*- coding: utf8 -*-
# Copyright (c) 2020 Nicholas de Jong
__title__ = "arpwitch"
__author__ = "Nicholas de Jong <contact@nicholasdejong.com>"
__version__ = '0.3.9'
__license__ = "BSD2"
__logger_default_level__ = 'info'
__sniff_batch_size__ = 16
__sniff_batch_timeout__ = 2
__save_data_interval__default__ = 30
__nm... | __title__ = 'arpwitch'
__author__ = 'Nicholas de Jong <contact@nicholasdejong.com>'
__version__ = '0.3.9'
__license__ = 'BSD2'
__logger_default_level__ = 'info'
__sniff_batch_size__ = 16
__sniff_batch_timeout__ = 2
__save_data_interval__default__ = 30
__nmap__exec__ = 'nmap -n -T4 -Pn -oX ' + __title__ + '-nmap-{IP}-{t... |
category_dict_icml15 = {
"Bandit Learning" : [["Bandits"]],
"Bayesian Nonparametrics" : [["Baysian Nonparametrics"]],
"Bayesian Optimization" : [["Optimization"], ["Baysian Optimization"]],
"Causality" : [["Causality"]],
"Clustering" : [["Clustering"]],
"Computational Advertising And Social Scie... | category_dict_icml15 = {'Bandit Learning': [['Bandits']], 'Bayesian Nonparametrics': [['Baysian Nonparametrics']], 'Bayesian Optimization': [['Optimization'], ['Baysian Optimization']], 'Causality': [['Causality']], 'Clustering': [['Clustering']], 'Computational Advertising And Social Science': [['Computational Adverti... |
# --------------------------------------
# CSCI 127, Lab 4
# May 29, 2020
# Your Name
# --------------------------------------
def process_season(season, games_played, points_earned):
print("Season: " + str(season) + ", Games Played: " + str(games_played) +
", Points earned: " + str(points_earned... | def process_season(season, games_played, points_earned):
print('Season: ' + str(season) + ', Games Played: ' + str(games_played) + ', Points earned: ' + str(points_earned))
print('Possible Win-Tie-Loss Records')
print('-----------------------------')
pass
print()
def process_seasons(seasons):
p... |
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def rob(self, root: TreeNode) -> int:
def helper(root):
if root... | class Treenode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def rob(self, root: TreeNode) -> int:
def helper(root):
if root is None:
return [0, 0]
x = helper(root.... |
# Made by Wallee#8314/Red-exe-Engineer
# Thanks @Bigjango helping :p
Block = {
"Air": [0, 0],
"Stone": [1, 0],
"Grass": [2, 0],
"Dirt": [3, 0],
"Cobblestone": [4, 0],
"Wooden Planks": [5, 0],
"Saplin":[6, 0],
"Oak Saplin": [6, 0],
"Spruce Saplin": [6, 1],
"Birch Saplin": [6, 2],... | block = {'Air': [0, 0], 'Stone': [1, 0], 'Grass': [2, 0], 'Dirt': [3, 0], 'Cobblestone': [4, 0], 'Wooden Planks': [5, 0], 'Saplin': [6, 0], 'Oak Saplin': [6, 0], 'Spruce Saplin': [6, 1], 'Birch Saplin': [6, 2], 'Bedrock': [7, 0], 'Water': [8, 0], 'Water Stationary': [9, 0], 'Lava': [10, 0], 'Lava Staionary': [11, 0], '... |
CONFIG_BINDIR="<CONFIG_BINDIR>"
CONFIG_LIBDIR="<CONFIG_LIBDIR>"
CONFIG_LOCALSTATEDIR="<CONFIG_LOCALSTATEDIR>"
CONFIG_SYSCONFDIR="<CONFIG_SYSCONFDIR>"
CONFIG_SYSCONFDIR_DSC="<CONFIG_SYSCONFDIR_DSC>"
CONFIG_OAAS_CERTPATH="<OAAS_CERTPATH>"
OMI_LIB_SCRIPTS="<OMI_LIB_SCRIPTS>"
PYTHON_PID_DIR="<PYTHON_PID_DIR>"
DSC_NAMESPACE... | config_bindir = '<CONFIG_BINDIR>'
config_libdir = '<CONFIG_LIBDIR>'
config_localstatedir = '<CONFIG_LOCALSTATEDIR>'
config_sysconfdir = '<CONFIG_SYSCONFDIR>'
config_sysconfdir_dsc = '<CONFIG_SYSCONFDIR_DSC>'
config_oaas_certpath = '<OAAS_CERTPATH>'
omi_lib_scripts = '<OMI_LIB_SCRIPTS>'
python_pid_dir = '<PYTHON_PID_DIR... |
h, m = map(int, input().split())
fullMin = (h * 60) + m
hour = (fullMin - 45) // 60
minu = (fullMin - 45) % 60
if hour == -1:
hour = 23
print(f'{hour} {minu}')
else:
print(f'{hour} {minu}')
| (h, m) = map(int, input().split())
full_min = h * 60 + m
hour = (fullMin - 45) // 60
minu = (fullMin - 45) % 60
if hour == -1:
hour = 23
print(f'{hour} {minu}')
else:
print(f'{hour} {minu}') |
def get_attribute_or_key(obj, name):
if isinstance(obj, dict):
return obj.get(name)
return getattr(obj, name, None)
| def get_attribute_or_key(obj, name):
if isinstance(obj, dict):
return obj.get(name)
return getattr(obj, name, None) |
#
# PySNMP MIB module FASTPATH-QOS-AUTOVOIP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/FASTPATH-QOS-AUTOVOIP-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:58:28 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.... | (object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_union, value_range_constraint, value_size_constraint, constraints_intersection) ... |
{
"midi_fname": "sample_music/effrhy_131.mid",
"video_fname": "tests/test_out/start_size.mp4",
"note_start_height": 0.0,
# "note_end_height": 0.0,
}
| {'midi_fname': 'sample_music/effrhy_131.mid', 'video_fname': 'tests/test_out/start_size.mp4', 'note_start_height': 0.0} |
par = list()
impar = list()
num = list()
for i in range(1, 8):
num.append(int(input(f'Digite o {i} numero: ')))
for a in num:
if a % 2 == 0:
par.append(a)
else:
impar.append(a)
print(num)
print(par)
print(impar) | par = list()
impar = list()
num = list()
for i in range(1, 8):
num.append(int(input(f'Digite o {i} numero: ')))
for a in num:
if a % 2 == 0:
par.append(a)
else:
impar.append(a)
print(num)
print(par)
print(impar) |
class Solution:
def scheduleCourse(self, courses: List[List[int]]) -> int:
time = 0
maxHeap = []
for duration, lastDay in sorted(courses, key=lambda x: x[1]):
heapq.heappush(maxHeap, -duration)
time += duration
# if current course could not be taken, check if it's able to swap with a
... | class Solution:
def schedule_course(self, courses: List[List[int]]) -> int:
time = 0
max_heap = []
for (duration, last_day) in sorted(courses, key=lambda x: x[1]):
heapq.heappush(maxHeap, -duration)
time += duration
if time > lastDay:
time... |
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"get_data": "01_core.ipynb",
"Dataset": "01_core.ipynb",
"DataBunch": "01_core.ipynb",
"Learner": "01_core.ipynb",
"get_dls": "01_core.ipynb",
"get_model": "01_cor... | __all__ = ['index', 'modules', 'custom_doc_links', 'git_url']
index = {'get_data': '01_core.ipynb', 'Dataset': '01_core.ipynb', 'DataBunch': '01_core.ipynb', 'Learner': '01_core.ipynb', 'get_dls': '01_core.ipynb', 'get_model': '01_core.ipynb', 'get_learner': '01_core.ipynb', 'accuracy': '01_core.ipynb', 'camel2snake': ... |
#function that allows user to filter photos based on ranking
def filterPhotos(photoAlbum, userchoice):
if userchoice:
#display photos in ascending order
return;
else:
#display photos in descending order
return;
return;
| def filter_photos(photoAlbum, userchoice):
if userchoice:
return
else:
return
return |
def test_about_should_return_200(client):
rv = client.get('/about')
assert rv.status_code == 200
assert rv.headers['Content-type'] == 'text/html; charset=utf-8'
| def test_about_should_return_200(client):
rv = client.get('/about')
assert rv.status_code == 200
assert rv.headers['Content-type'] == 'text/html; charset=utf-8' |
# dfs
class Solution:
def numIslands(self, grid: 'List[List[str]]') -> 'int':
if grid == []: return 0
def dfs(i, j, n, m):
if i < 0 or j < 0 or i >= n or j >= m or grid[i][j] == "0" or grid[i][j] == "-1": return
grid[i][j] = "-1"
dfs(i + 1, j, n, m)
d... | class Solution:
def num_islands(self, grid: 'List[List[str]]') -> 'int':
if grid == []:
return 0
def dfs(i, j, n, m):
if i < 0 or j < 0 or i >= n or (j >= m) or (grid[i][j] == '0') or (grid[i][j] == '-1'):
return
grid[i][j] = '-1'
dfs... |
#
# Copyright (c) 2017 Joy Diamond. All rights reserved.
#
@gem('Topaz.Cache')
def gem():
require_gem('Gem.Cache2')
require_gem('Topaz.Core')
require_gem('Topaz.CacheSupport')
#
# Specific instances
#
eight = conjure_number('eight', 8)
five = conjure_number('five', 5)
four ... | @gem('Topaz.Cache')
def gem():
require_gem('Gem.Cache2')
require_gem('Topaz.Core')
require_gem('Topaz.CacheSupport')
eight = conjure_number('eight', 8)
five = conjure_number('five', 5)
four = conjure_number('four', 4)
nine = conjure_number('nine', 9)
one = conjure_number('one', 1)
se... |
ENV = 'directory that defines e.g. the boxes'
WORKSPACE = 'workspace directory'
BEAD_REF = '''
bead to load data from
- either an archive file name or a bead name
'''
INPUT_NICK = (
'name of input,'
+ ' its workspace relative location is "input/%(metavar)s"')
BOX = 'Name of box to store bead'
| env = 'directory that defines e.g. the boxes'
workspace = 'workspace directory'
bead_ref = '\n bead to load data from\n - either an archive file name or a bead name\n'
input_nick = 'name of input,' + ' its workspace relative location is "input/%(metavar)s"'
box = 'Name of box to store bead' |
a = []
assert a[:] == []
assert a[:2**100] == []
assert a[-2**100:] == []
assert a[::2**100] == []
assert a[10:20] == []
assert a[-20:-10] == []
b = [1, 2]
assert b[:] == [1, 2]
assert b[:2**100] == [1, 2]
assert b[-2**100:] == [1, 2]
assert b[2**100:] == []
assert b[::2**100] == [1]
assert b[-10:1] == [1]
assert b[... | a = []
assert a[:] == []
assert a[:2 ** 100] == []
assert a[-2 ** 100:] == []
assert a[::2 ** 100] == []
assert a[10:20] == []
assert a[-20:-10] == []
b = [1, 2]
assert b[:] == [1, 2]
assert b[:2 ** 100] == [1, 2]
assert b[-2 ** 100:] == [1, 2]
assert b[2 ** 100:] == []
assert b[::2 ** 100] == [1]
assert b[-10:1] == [1... |
class Class:
__students_count = 22
def __init__(self, name):
self.name = name
self.students = []
self.grades = []
def add_student(self, name, grade):
if self.__students_count != 0:
self.students.append(name)
self.grades.append(float(grade))
... | class Class:
__students_count = 22
def __init__(self, name):
self.name = name
self.students = []
self.grades = []
def add_student(self, name, grade):
if self.__students_count != 0:
self.students.append(name)
self.grades.append(float(grade))
... |
#!/usr/bin/env python3
#p3_180824_2354.py
# Search synonym #2
# Format:
# Number_of_lines
# Key (space) Value
# Key_word
def main():
num = input()
myDictionary = getDictionary(num)
word = input()
#wordToSearch = getKeySearchWord(myDictionary)
checkDictionary(myDictionary, word)
# Fill dictionary w... | def main():
num = input()
my_dictionary = get_dictionary(num)
word = input()
check_dictionary(myDictionary, word)
def get_dictionary(numberOfLines):
my_dictionary = dict()
list_temp = list()
for i in range(int(numberOfLines)):
listTemp.append(input().split(' '))
my_dictionary = ... |
__title__ = 'cli_command_parser'
__description__ = 'CLI Command Parser'
__url__ = 'https://github.com/dskrypa/cli_command_parser'
__version__ = '2022.06.06'
__author__ = 'Doug Skrypa'
__author_email__ = 'dskrypa@gmail.com'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2022 Doug Skrypa'
| __title__ = 'cli_command_parser'
__description__ = 'CLI Command Parser'
__url__ = 'https://github.com/dskrypa/cli_command_parser'
__version__ = '2022.06.06'
__author__ = 'Doug Skrypa'
__author_email__ = 'dskrypa@gmail.com'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2022 Doug Skrypa' |
altitude=int(input("enter the current altitude : "))
if altitude<=1000:
print(" SAFE to land")
elif altitude>1000 and altitude<=5000:
print("bring it down to 1000ft")
else:
print("turn around") | altitude = int(input('enter the current altitude : '))
if altitude <= 1000:
print(' SAFE to land')
elif altitude > 1000 and altitude <= 5000:
print('bring it down to 1000ft')
else:
print('turn around') |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def hasCycle(self, head: Optional[ListNode]) -> bool:
cs = head
cf = head
if head == None:
return False
if cf.next == Non... | class Solution:
def has_cycle(self, head: Optional[ListNode]) -> bool:
cs = head
cf = head
if head == None:
return False
if cf.next == None:
return False
else:
cf = cf.next
while cf.next != None and cf != cs:
cs = cs.ne... |
# ***************************************
# ******** Manual Configurations ********
# ***************************************
# ----------------------------------------------------------------
# -------- Part 1, meta-network generation settings -----... | blast_results_path = 'C:/Users/Tokuriki Lab/Documents/Sync/Projects/MBL SSN 2020/mbl_cdhit50_all_by_all/'
blast_results_files = None
query_col = 0
subject_col = 1
bitscore_col = 3
filter_path = 'input/filters/'
filter_files = []
output_label = 'mbl_full_cdhit50'
output_dir = 'metaSSN_v4_test/'
mapping_path = 'C:/Users/... |
sbox0 = [
0X3e, 0x72, 0x5b, 0x47, 0xca, 0xe0, 0x00, 0x33, 0x04, 0xd1, 0x54, 0x98, 0x09, 0xb9, 0x6d, 0xcb,
0X7b, 0x1b, 0xf9, 0x32, 0xaf, 0x9d, 0x6a, 0xa5, 0xb8, 0x2d, 0xfc, 0x1d, 0x08, 0x53, 0x03, 0x90,
0X4d, 0x4e, 0x84, 0x99, 0xe4, 0xce, 0xd9, 0x91, 0xdd, 0xb6, 0x85, 0x48, 0x8b, 0x29, 0x6e, 0xac,
0Xcd, ... | sbox0 = [62, 114, 91, 71, 202, 224, 0, 51, 4, 209, 84, 152, 9, 185, 109, 203, 123, 27, 249, 50, 175, 157, 106, 165, 184, 45, 252, 29, 8, 83, 3, 144, 77, 78, 132, 153, 228, 206, 217, 145, 221, 182, 133, 72, 139, 41, 110, 172, 205, 193, 248, 30, 115, 67, 105, 198, 181, 189, 253, 57, 99, 32, 212, 56, 118, 125, 178, 167, 2... |
# Description: Raw Strings
if __name__ == '__main__':
# Escape characters are honoured
a_string = "this is\na string split\t\tand tabbed"
print(a_string)
# Raw string is printed as it is without interpreting the escape characters.
# This is used a lot in regular expressions
raw_string = r"this... | if __name__ == '__main__':
a_string = 'this is\na string split\t\tand tabbed'
print(a_string)
raw_string = 'this is\\na string split\\t\\tand tabbed'
print(raw_string)
b_string = 'this is' + chr(10) + 'a string split' + chr(9) + chr(9) + 'and tabbed'
print(b_string)
backslash_string = 'this ... |
class Board():
def __init__(self, matrix):
self.matrix = matrix
self.cols = len(matrix)
self.rows = len(matrix[0])
self.last = None
self.matches = []
for i in range(self.rows):
self.matches.append([False] * self.cols)
def is_winner(self):
for... | class Board:
def __init__(self, matrix):
self.matrix = matrix
self.cols = len(matrix)
self.rows = len(matrix[0])
self.last = None
self.matches = []
for i in range(self.rows):
self.matches.append([False] * self.cols)
def is_winner(self):
for r... |
DATABASE_ENGINE = 'sqlite3'
ROOT_URLCONF = 'tests.urls'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'tests.app',
]
| database_engine = 'sqlite3'
root_urlconf = 'tests.urls'
installed_apps = ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'tests.app'] |
# using return in functions
def my_function(name,surname):
full_name = name.title() + " " + surname.title()
return full_name
print(my_function('selim', 'mh'))
| def my_function(name, surname):
full_name = name.title() + ' ' + surname.title()
return full_name
print(my_function('selim', 'mh')) |
class Solution:
def reverseWords(self, s: str) -> str:
q = []
raw_split = s.split(' ')
for raw_w in raw_split:
w = raw_w.strip()
if w:
q.append(w)
return ' '.join(q[::-1])
| class Solution:
def reverse_words(self, s: str) -> str:
q = []
raw_split = s.split(' ')
for raw_w in raw_split:
w = raw_w.strip()
if w:
q.append(w)
return ' '.join(q[::-1]) |
class RaddarException(Exception):
pass
class FailedToCloneRepoException(RaddarException):
pass
class FailedToWriteRepoException(RaddarException):
pass
| class Raddarexception(Exception):
pass
class Failedtoclonerepoexception(RaddarException):
pass
class Failedtowriterepoexception(RaddarException):
pass |
QUERIES = {}
QUERIES['1A'] = '''
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id, agerange
from vw_cpims_registration {ocbos} {oareas} {odate}
group by gender, agerange
'''
QUERIES['1B'] = '''
SELECT count(distinct(cpims_ovc_id)) as dcount,
gender as sex_id,
CASE exit_status WHEN 'ACTIVE' THEN 'Activ... | queries = {}
QUERIES['1A'] = '\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id, agerange\nfrom vw_cpims_registration {ocbos} {oareas} {odate}\ngroup by gender, agerange\n'
QUERIES['1B'] = "\nSELECT count(distinct(cpims_ovc_id)) as dcount,\ngender as sex_id,\nCASE exit_status WHEN 'ACTIVE' THEN 'Activ... |
def countingSort(array, place):
size = len(array)
output = [0] * size
count = [0] * 10
for i in range(0, size):
index = array[i] // place
count[index % 10] += 1
for i in range(1, 10):
count[i] += count[i - 1]
i = size - 1
while i >= 0:
index = array... | def counting_sort(array, place):
size = len(array)
output = [0] * size
count = [0] * 10
for i in range(0, size):
index = array[i] // place
count[index % 10] += 1
for i in range(1, 10):
count[i] += count[i - 1]
i = size - 1
while i >= 0:
index = array[i] // pla... |
#######################################################################################
# 2.1
# change what is stored in the variables to another types of data
# if a variable stores a string, change it to an int, or a boolean, or a float
some_var = "hi"
some_var2 = 1
some_var3 = True
some_var4 = 1.32
#############... | some_var = 'hi'
some_var2 = 1
some_var3 = True
some_var4 = 1.32
a = 10
b = 2
c = 3
d = 12 |
load("@build_bazel_integration_testing//tools:import.bzl", "bazel_external_dependency_archive")
def bazel_external_dependencies(rules_scala_version, rules_scala_version_sha256):
bazel_external_dependency_archive(
name = "io_bazel_rules_scala_test",
srcs = {
rules_scala_version_sha256: [
... | load('@build_bazel_integration_testing//tools:import.bzl', 'bazel_external_dependency_archive')
def bazel_external_dependencies(rules_scala_version, rules_scala_version_sha256):
bazel_external_dependency_archive(name='io_bazel_rules_scala_test', srcs={rules_scala_version_sha256: ['https://github.com/wix/rules_scal... |
class Line:
pic = None
color = -1
def __init__(self, pic, color):
self.pic = pic
self.color = color
def oct1(self, x0, y0, x1, y1):
if (x0 > x1):
x0, y0, x1, y1 = x1, y1, x0, y0
x = x0
y = y0
A = y1 - y0
B = x0 - x1
d = 2 * A... | class Line:
pic = None
color = -1
def __init__(self, pic, color):
self.pic = pic
self.color = color
def oct1(self, x0, y0, x1, y1):
if x0 > x1:
(x0, y0, x1, y1) = (x1, y1, x0, y0)
x = x0
y = y0
a = y1 - y0
b = x0 - x1
d = 2 * ... |
def test_signal_url_total_length(ranker):
rank = lambda url: ranker.client.get_signal_value_from_url("url_total_length", url)
rank_long = rank("http://www.verrrryyyylongdomain.com/very-long-url-xxxxxxxxxxxxxx.html")
rank_short = rank("https://en.wikipedia.org/wiki/Maceo_Parker")
rank_min = rank("http://t.co")... | def test_signal_url_total_length(ranker):
rank = lambda url: ranker.client.get_signal_value_from_url('url_total_length', url)
rank_long = rank('http://www.verrrryyyylongdomain.com/very-long-url-xxxxxxxxxxxxxx.html')
rank_short = rank('https://en.wikipedia.org/wiki/Maceo_Parker')
rank_min = rank('http://... |
terms=int(input("Enter the number of terms:"))
a, b= 0, 1
count=0
if terms <= 0:
print("Please enter a positive number")
elif terms == 1:
print("The fibonacci series upto",terms)
print(a)
else:
print("The fabinocci series upto",terms,"terms is:")
while count < terms:
print(a, end=" ")
... | terms = int(input('Enter the number of terms:'))
(a, b) = (0, 1)
count = 0
if terms <= 0:
print('Please enter a positive number')
elif terms == 1:
print('The fibonacci series upto', terms)
print(a)
else:
print('The fabinocci series upto', terms, 'terms is:')
while count < terms:
print(a, end... |
OV2640_JPEG_INIT = [
[ 0xff, 0x00 ],
[ 0x2c, 0xff ],
[ 0x2e, 0xdf ],
[ 0xff, 0x01 ],
[ 0x3c, 0x32 ],
[ 0x11, 0x04 ],
[ 0x09, 0x02 ],
[ 0x04, 0x28 ],
[ 0x13, 0xe5 ],
[ 0x14, 0x48 ],
[ 0x2c, 0x0c ],
[ 0x33, 0x78 ],
[ 0x3a, 0x33 ],
[ 0x3b, 0xfB ],
[ 0x3e, 0x00 ],
[ 0x43, 0x11 ],
[ 0x16,... | ov2640_jpeg_init = [[255, 0], [44, 255], [46, 223], [255, 1], [60, 50], [17, 4], [9, 2], [4, 40], [19, 229], [20, 72], [44, 12], [51, 120], [58, 51], [59, 251], [62, 0], [67, 17], [22, 16], [57, 146], [53, 218], [34, 26], [55, 195], [35, 0], [52, 192], [54, 26], [6, 136], [7, 192], [13, 135], [14, 65], [76, 0], [72, 0]... |
class Parent:
value1="This is value 1"
value2="This is value 2"
class Child(Parent):
pass
parent=Parent()
child=Child()
print(parent.value1)
print(child.value2)
| class Parent:
value1 = 'This is value 1'
value2 = 'This is value 2'
class Child(Parent):
pass
parent = parent()
child = child()
print(parent.value1)
print(child.value2) |
begin_unit
comment|'# Copyright (c) 2016 Intel, Inc.'
nl|'\n'
comment|'# Copyright (c) 2013 OpenStack Foundation'
nl|'\n'
comment|'# All Rights Reserved.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in ... | begin_unit
comment | '# Copyright (c) 2016 Intel, Inc.'
nl | '\n'
comment | '# Copyright (c) 2013 OpenStack Foundation'
nl | '\n'
comment | '# All Rights Reserved.'
nl | '\n'
comment | '#'
nl | '\n'
comment | '# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl | '\n'
comment | '# not us... |
class Frame:
__slots__ = ("name", "class_name", "line_no", "file_path")
def __init__(self, name, class_name=None, line_no=None, file_path=None):
self.name = name
self.class_name = class_name
self.line_no = line_no
self.file_path = file_path
| class Frame:
__slots__ = ('name', 'class_name', 'line_no', 'file_path')
def __init__(self, name, class_name=None, line_no=None, file_path=None):
self.name = name
self.class_name = class_name
self.line_no = line_no
self.file_path = file_path |
# 6.Input and Range
# Given an integer n, write a program that generates a dictionary with
# entries from 1 to n. For each key i, the corresponding value should
# be i*i.
def range_dict(_max):
my_dict = {}
for i in range(1, _max + 1):
my_dict[i] = i ** 2
return my_dict
# or with dictionary Comp... | def range_dict(_max):
my_dict = {}
for i in range(1, _max + 1):
my_dict[i] = i ** 2
return my_dict
def range_dict2(_max):
return {i: i ** 2 for i in range(1, _max + 1)}
print(range_dict(10))
print(range_dict2(10)) |
# Holds permission data for a private race room
def get_permission_info(server, race_private_info):
permission_info = PermissionInfo()
for admin_name in race_private_info.admin_names:
for role in server.roles:
if role.name.lower() == admin_name.lower():
permission_info.admi... | def get_permission_info(server, race_private_info):
permission_info = permission_info()
for admin_name in race_private_info.admin_names:
for role in server.roles:
if role.name.lower() == admin_name.lower():
permission_info.admin_roles.append(role)
for member in server... |
WORDLIST =\
('dna',
'vor',
'how',
'hot',
'yud',
'fir',
'fit',
'fix',
'dsc',
'ate',
'ira',
'cup',
'fre',
'fry',
'had',
'has',
'hat',
'hav',
'old',
'fou',
'for',
'fox',
'foe',
'fob',
'foi',
'soo',
'son',
'pet',
'veo',
'vel',
'jim',
'bla',
'one',
'san',
'sad',
'say',
'sap',
'saw',
'sat',
'cim',
'ivy',
'wpi',
'pop',
'act',... | wordlist = ('dna', 'vor', 'how', 'hot', 'yud', 'fir', 'fit', 'fix', 'dsc', 'ate', 'ira', 'cup', 'fre', 'fry', 'had', 'has', 'hat', 'hav', 'old', 'fou', 'for', 'fox', 'foe', 'fob', 'foi', 'soo', 'son', 'pet', 'veo', 'vel', 'jim', 'bla', 'one', 'san', 'sad', 'say', 'sap', 'saw', 'sat', 'cim', 'ivy', 'wpi', 'pop', 'act', ... |
n1 = float(input("Type the first number: "))
n2 = float(input("Type the second number: "))
print("Are equals?", n1 == n2)
print("Are different?", n1 != n2)
print("First number is greater than Second number? =", n1 > n2)
print("Second is greater or equal than First number ? =", n2 >= n1)
strTest = input("Type a string:... | n1 = float(input('Type the first number: '))
n2 = float(input('Type the second number: '))
print('Are equals?', n1 == n2)
print('Are different?', n1 != n2)
print('First number is greater than Second number? =', n1 > n2)
print('Second is greater or equal than First number ? =', n2 >= n1)
str_test = input('Type a string:... |
track = dict(
author_username='ryanholbrook',
course_name='Computer Vision',
course_url='https://www.kaggle.com/ryanholbrook/computer-vision',
course_forum_url='https://www.kaggle.com/learn-forum',
)
TOPICS = [
'The Convolutional Classifier',
'Convolution and ReLU',
'Maximum Pooling',
'... | track = dict(author_username='ryanholbrook', course_name='Computer Vision', course_url='https://www.kaggle.com/ryanholbrook/computer-vision', course_forum_url='https://www.kaggle.com/learn-forum')
topics = ['The Convolutional Classifier', 'Convolution and ReLU', 'Maximum Pooling', 'The Moving Window', 'Custom Convnets'... |
'''
PythonExercicios\from math import factorial
number = int(input('Choose a number: '))
result = factorial(number)
print('The factorial of {}! is = {}'.format(number, result))
'''
number = int(input('Choose a number: '))
control = number
result = 1
print('Calculating {}! = '.format(number), end='')
while control > 0:
... | """
PythonExercicios\x0crom math import factorial
number = int(input('Choose a number: '))
result = factorial(number)
print('The factorial of {}! is = {}'.format(number, result))
"""
number = int(input('Choose a number: '))
control = number
result = 1
print('Calculating {}! = '.format(number), end='')
while control > 0... |
exclusions = ['\bCHAPTER (\d*|M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3}))\.*\b',
'CHAPTER',
'\bChapter \d*\b',
'\d{2}:\d{2}:\d{2},\d{3}\s-->\s\d{2}:\d{2}:\d{2},\d{3}',
'^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})\.?\n',
'^[^\w... | exclusions = ['\x08CHAPTER (\\d*|M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3}))\\.*\x08', 'CHAPTER', '\x08Chapter \\d*\x08', '\\d{2}:\\d{2}:\\d{2},\\d{3}\\s-->\\s\\d{2}:\\d{2}:\\d{2},\\d{3}', '^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})\\.?\n', '^[^\\w\\d\\s]*\n', '^(CLOV|HAMM|NAGG|NELL)\\s\\([\\w\... |
class Agent:
def __init__(self, env, q_function, action_selector, logger):
self.__env = env
self.__q_function = q_function
self.__action_selector = action_selector
self.__logger = logger
def train(self, steps, episodes, filepath, filename):
episode_reward = 0
tot... | class Agent:
def __init__(self, env, q_function, action_selector, logger):
self.__env = env
self.__q_function = q_function
self.__action_selector = action_selector
self.__logger = logger
def train(self, steps, episodes, filepath, filename):
episode_reward = 0
to... |
student = {"name":"Rolf", "grades":(89,9,93,78,90)}
def average(seq):
return sum(seq)/len(seq)
print(average(student["grades"]))
class Student:
def __init__(self,name,grades):
self.name = name
self.grades = grades
def averageGrade(self):
return sum(self.grades)/len(self.grades)
... | student = {'name': 'Rolf', 'grades': (89, 9, 93, 78, 90)}
def average(seq):
return sum(seq) / len(seq)
print(average(student['grades']))
class Student:
def __init__(self, name, grades):
self.name = name
self.grades = grades
def average_grade(self):
return sum(self.grades) / len(s... |
VERSION = '2.0b9'
DEFAULT_TIMEOUT = 60000
REQUEST_ID_HEADER = 'Cko-Request-Id'
API_VERSION_HEADER = 'Cko-Version'
| version = '2.0b9'
default_timeout = 60000
request_id_header = 'Cko-Request-Id'
api_version_header = 'Cko-Version' |
#Leia um numero real e imprima a quinta parte deste numero
n=float(input("Informe um numero real: "))
n=n/5
print(n) | n = float(input('Informe um numero real: '))
n = n / 5
print(n) |
expected_output = {
'instance': {
'default': {
'vrf': {
'red': {
'address_family': {
'': {
'prefixes': {
'11.11.11.11/32': {
'avail... | expected_output = {'instance': {'default': {'vrf': {'red': {'address_family': {'': {'prefixes': {'11.11.11.11/32': {'available_path': '1', 'best_path': '1', 'index': {1: {'binding_sid': {'color': '7', 'sid': '22', 'state': 'UP'}, 'cluster_list': '8.8.8.9', 'ext_community': 'RT:2:2 Color:1 Color:2 Color:3 Color:4 Color:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.