content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
##########################################################################################
#
# Asteroid Version
#
# (c) University of Rhode Island
##########################################################################################
VERSION = "0.1.0"
| version = '0.1.0' |
class User:
def __init__(self,account_name,card,pin):
self.account_name = account_name
self.card = card
self.pin = pin | class User:
def __init__(self, account_name, card, pin):
self.account_name = account_name
self.card = card
self.pin = pin |
CFG = {
'in_ch': 3,
'out_ch': 24,
'kernel_size': 3,
'stride': 2,
'width_mult': 1,
'divisor': 8,
'actn_layer': None,
'layers': [
{'channels': 24, 'expansion': 1, 'kernel_size': 3, 'stride': 1,
'nums': 2, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2,
... | cfg = {'in_ch': 3, 'out_ch': 24, 'kernel_size': 3, 'stride': 2, 'width_mult': 1, 'divisor': 8, 'actn_layer': None, 'layers': [{'channels': 24, 'expansion': 1, 'kernel_size': 3, 'stride': 1, 'nums': 2, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': True, ... |
READ_DOCSTRING = """
Read the input ``table`` and return the table. Most of
the default behavior for various parameters is determined by the Reader
class.
See also:
- http://docs.astropy.org/en/stable/io/ascii/
- http://docs.astropy.org/en/stable/io/ascii/read.html
Parameters
-------... | read_docstring = "\n Read the input ``table`` and return the table. Most of\n the default behavior for various parameters is determined by the Reader\n class.\n\n See also:\n\n - http://docs.astropy.org/en/stable/io/ascii/\n - http://docs.astropy.org/en/stable/io/ascii/read.html\n\n Parameters\n ... |
# -*- coding: utf-8 -*-
"""
Internal exceptions
===================
"""
class NotRegisteredError(KeyError):
pass
class UnknowConfigError(KeyError):
pass
class UnknowModeError(KeyError):
pass
class UnknowThemeError(KeyError):
pass
class CodeMirrorFieldBundleError(KeyError):
pass
| """
Internal exceptions
===================
"""
class Notregisterederror(KeyError):
pass
class Unknowconfigerror(KeyError):
pass
class Unknowmodeerror(KeyError):
pass
class Unknowthemeerror(KeyError):
pass
class Codemirrorfieldbundleerror(KeyError):
pass |
pod_examples = [
dict(
apiVersion='v1',
kind='Pod',
metadata=dict(
name='good',
namespace='default'
),
spec=dict(
serviceAccountName='default'
)
),
dict(
apiVersion='v1',
kind='Pod',
metadata=dict(
... | pod_examples = [dict(apiVersion='v1', kind='Pod', metadata=dict(name='good', namespace='default'), spec=dict(serviceAccountName='default')), dict(apiVersion='v1', kind='Pod', metadata=dict(name='bad', namespace='default'), spec=dict(serviceAccountName='bad')), dict(apiVersion='v1', kind='Pod', metadata=dict(name='raise... |
######################################################################
#
# Copyright (C) 2013
# Associated Universities, Inc. Washington DC, USA,
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Fo... | logprint('Starting EVLA_pipe_targetflag_lines.py', logfileout='logs/targetflag.log')
time_list = runtiming('checkflag', 'start')
qa2_targetflag = 'Pass'
logprint('Checking RFI flagging of all targets', logfileout='logs/targetflag.log')
default('flagdata')
vis = ms_active
mode = 'rflag'
field = ''
correlation = 'ABS_' +... |
regularServingPancakes = 24
cupsOfFlourrPer24Pancakes = 4.5
noOfEggsPer24Pancakes = 4
litresOfMilkPer24Pancakes = 1
noOfPancakes = float(input("How many pancakes do you want to make: "))
expectedCupsOfFlour = ( noOfPancakes / regularServingPancakes ) * \
cupsOfFlourrPer24Pancakes
expect... | regular_serving_pancakes = 24
cups_of_flourr_per24_pancakes = 4.5
no_of_eggs_per24_pancakes = 4
litres_of_milk_per24_pancakes = 1
no_of_pancakes = float(input('How many pancakes do you want to make: '))
expected_cups_of_flour = noOfPancakes / regularServingPancakes * cupsOfFlourrPer24Pancakes
expected_no_of_eggs = noOf... |
def generated_per_next_split(max_day):
# generate a table saying how many lanternfish result from a lanternfish
# which next split is on a given day
table = {}
for i in range(max_day+10, 0, -1):
table[i] = 1 if i >= max_day else (table[i+7] + table[i+9])
return table
def solve(next_splits... | def generated_per_next_split(max_day):
table = {}
for i in range(max_day + 10, 0, -1):
table[i] = 1 if i >= max_day else table[i + 7] + table[i + 9]
return table
def solve(next_splits, max_day):
table = generated_per_next_split(max_day)
return sum([table[next_split] for next_split in next_s... |
n = int(input())
xs = []
ys = []
numToPosX = dict()
numToPosY = dict()
for i in range(n):
x, y = list(map(float, input().split()))
numToPosX.setdefault(x, i)
numToPosY.setdefault(y, i)
xs.append(x)
ys.append(y)
xs.sort()
ys.sort()
resX = [0] * n
resY = [0] * n
for i in range(n):
resX[numT... | n = int(input())
xs = []
ys = []
num_to_pos_x = dict()
num_to_pos_y = dict()
for i in range(n):
(x, y) = list(map(float, input().split()))
numToPosX.setdefault(x, i)
numToPosY.setdefault(y, i)
xs.append(x)
ys.append(y)
xs.sort()
ys.sort()
res_x = [0] * n
res_y = [0] * n
for i in range(n):
resX[n... |
def setup():
size(400,400)
stroke(225)
background(192, 64, 0)
def draw():
line(200, 200, mouseX, mouseY)
def mousePressed():
saveFrame("Output.png")
| def setup():
size(400, 400)
stroke(225)
background(192, 64, 0)
def draw():
line(200, 200, mouseX, mouseY)
def mouse_pressed():
save_frame('Output.png') |
class random:
def __init__(self, animaltype, name, canfly):
self.animaltype = animaltype
self.name = name
self.fly = canfly
def getanimaltype(self):
return self.animaltype
def getobjects(self):
print('{} {} {}'.format(self.animaltype, self.name, self.fly))
ok = random('bird', 'penguin',... | class Random:
def __init__(self, animaltype, name, canfly):
self.animaltype = animaltype
self.name = name
self.fly = canfly
def getanimaltype(self):
return self.animaltype
def getobjects(self):
print('{} {} {}'.format(self.animaltype, self.name, self.fly))
ok = ran... |
class ValidationResult:
def __init__(self, is_success, error_message=None):
self.is_success = is_success
self.error_message = error_message
@classmethod
def success(cls):
return cls(True)
@classmethod
def error(cls, error_message):
return cls(False, error_message)
... | class Validationresult:
def __init__(self, is_success, error_message=None):
self.is_success = is_success
self.error_message = error_message
@classmethod
def success(cls):
return cls(True)
@classmethod
def error(cls, error_message):
return cls(False, error_message)
... |
def eval_chunk_size(rm):
chunks = []
chunk_size = 0
for row in range(rm.max_row):
for col in range(rm.max_col):
if (rm.seats[row][col] == None or rm.seats[row][col].sid == -1) and chunk_size > 0:
chunks.append(chunk_size)
chunk_size = 0
else:
... | def eval_chunk_size(rm):
chunks = []
chunk_size = 0
for row in range(rm.max_row):
for col in range(rm.max_col):
if (rm.seats[row][col] == None or rm.seats[row][col].sid == -1) and chunk_size > 0:
chunks.append(chunk_size)
chunk_size = 0
else:
... |
class Circle:
def __init__(self,d):
self.diameter=d
self.__pi=3.14
def calculate_circumference(self):
c=self.__pi*self.diameter
return c
def calculate_area(self):
r=self.diameter/2
return self.__pi*(r*r)
def calculate_area_of_sector(self,angle):
... | class Circle:
def __init__(self, d):
self.diameter = d
self.__pi = 3.14
def calculate_circumference(self):
c = self.__pi * self.diameter
return c
def calculate_area(self):
r = self.diameter / 2
return self.__pi * (r * r)
def calculate_area_of_sector(se... |
# cxd
class Solution:
def threeSumClosest(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
nums.sort()
ret = nums[0] + nums[1] + nums[-1]
value = abs(nums[0] + nums[1] + nums[-1] - target)
i = 0
while i... | class Solution:
def three_sum_closest(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
nums.sort()
ret = nums[0] + nums[1] + nums[-1]
value = abs(nums[0] + nums[1] + nums[-1] - target)
i = 0
while i < le... |
class Solution:
def coinChange(self, coins: List[int], amount: int) -> int:
amounts = [float('inf')] * (amount + 1)
amounts[0] = 0
for coin in coins:
for amt in range(coin, amount + 1):
amounts[amt] = min(amounts[amt], amounts[amt - coin] + 1)
if amounts... | class Solution:
def coin_change(self, coins: List[int], amount: int) -> int:
amounts = [float('inf')] * (amount + 1)
amounts[0] = 0
for coin in coins:
for amt in range(coin, amount + 1):
amounts[amt] = min(amounts[amt], amounts[amt - coin] + 1)
if amounts... |
""" Lottery module """
class Astro:
""" Create an Astro ticket """
def __init__(self):
"""
Initialize Astro ticket
"""
self.name = "Astro"
| """ Lottery module """
class Astro:
""" Create an Astro ticket """
def __init__(self):
"""
Initialize Astro ticket
"""
self.name = 'Astro' |
"""
Tests if nose can see the test directory
"""
def test_true():
assert True
| """
Tests if nose can see the test directory
"""
def test_true():
assert True |
"""
This script contains some global variables that are used throughout this specific dataset.
"""
# Dataset file names
raw_input_file_all = '/home/travail/datasets/urban_tracker/sherbrooke/sherbrooke_annotations/sherbrooke_gt.sqlite'
input_raw_image_frame_path = '/home/travail/datasets/urban_tracker/sherbrooke/sherbr... | """
This script contains some global variables that are used throughout this specific dataset.
"""
raw_input_file_all = '/home/travail/datasets/urban_tracker/sherbrooke/sherbrooke_annotations/sherbrooke_gt.sqlite'
input_raw_image_frame_path = '/home/travail/datasets/urban_tracker/sherbrooke/sherbrooke_frames/'
raw_inpu... |
if __name__ == "__main__":
s = 'A\tB\tC'
print(len(s))
print(ord('\n'))
s = 'A\0B\0C'
print(len(s))
print(s)
print('-' * 50)
msg = """
aaaaaaaaa
bbbbbb''''bbbbb
ccccccc
"""
print(msg)
| if __name__ == '__main__':
s = 'A\tB\tC'
print(len(s))
print(ord('\n'))
s = 'A\x00B\x00C'
print(len(s))
print(s)
print('-' * 50)
msg = "\n aaaaaaaaa\n bbbbbb''''bbbbb\n ccccccc\n "
print(msg) |
def partial_async_gen(f, *args):
"""
Returns an async generator function which is equalivalent to the passed in function,
but only takes in one parameter (the first one).
"""
async def inner(first_param):
async for x in f(first_param, *args):
yield x
return inner
... | def partial_async_gen(f, *args):
"""
Returns an async generator function which is equalivalent to the passed in function,
but only takes in one parameter (the first one).
"""
async def inner(first_param):
async for x in f(first_param, *args):
yield x
return inner
def partia... |
names = ["Katya", "Max", "Oleksii", "Olesya", "Oleh", "Yaroslav", "Anastasiia"]
age = [25, 54, 18, 23, 45, 21, 21]
isPaid = [True, False, True, True, False, True, False]
namesFromDatabaseClear = names.index("Max")
ageMax = age[namesFromDatabaseClear]
print(ageMax)
| names = ['Katya', 'Max', 'Oleksii', 'Olesya', 'Oleh', 'Yaroslav', 'Anastasiia']
age = [25, 54, 18, 23, 45, 21, 21]
is_paid = [True, False, True, True, False, True, False]
names_from_database_clear = names.index('Max')
age_max = age[namesFromDatabaseClear]
print(ageMax) |
# -*- coding: utf-8 -*-
SEXO = (
('F', 'Feminino'),
('M', 'Masculino'),
) | sexo = (('F', 'Feminino'), ('M', 'Masculino')) |
"""Exports Standard Interface Template boundary conditions."""
# 1. Standard python modules
# 2. Third party modules
# 3. Aquaveo modules
# 4. Local modules
__copyright__ = "(C) Copyright Aquaveo 2020"
__license__ = "All rights reserved"
class BoundaryConditionsWriter:
"""A class for writing out boundary cond... | """Exports Standard Interface Template boundary conditions."""
__copyright__ = '(C) Copyright Aquaveo 2020'
__license__ = 'All rights reserved'
class Boundaryconditionswriter:
"""A class for writing out boundary condition data for the Standard Interface Template."""
def __init__(self, file_name, arc_to_ids, a... |
"""This package contains modules for working with Fireplace devices."""
__all__ = (
"fireplace",
"fireplace_device",
"fireplace_light_exception",
"fireplace_pilot_light_event",
"fireplace_state",
"fireplace_state_change_event",
"fireplace_timeout_event"
)
| """This package contains modules for working with Fireplace devices."""
__all__ = ('fireplace', 'fireplace_device', 'fireplace_light_exception', 'fireplace_pilot_light_event', 'fireplace_state', 'fireplace_state_change_event', 'fireplace_timeout_event') |
"""
Instruction names
"""
POP_TOP = 'POP_TOP'
ROT_TWO = 'ROT_TWO'
ROT_THREE = 'ROT_THREE'
DUP_TOP = 'DUP_TOP'
DUP_TOP_TWO = 'DUP_TOP_TWO'
NOP = 'NOP'
UNARY_POSITIVE = 'UNARY_POSITIVE'
UNARY_NEGATIVE = 'UNARY_NEGATIVE'
UNARY_NOT = 'UNARY_NOT'
UNARY_INVERT = 'UNARY_INVERT'
BINARY_MATRIX_MULTIPLY = 'BINARY_MATRIX_MULTIPL... | """
Instruction names
"""
pop_top = 'POP_TOP'
rot_two = 'ROT_TWO'
rot_three = 'ROT_THREE'
dup_top = 'DUP_TOP'
dup_top_two = 'DUP_TOP_TWO'
nop = 'NOP'
unary_positive = 'UNARY_POSITIVE'
unary_negative = 'UNARY_NEGATIVE'
unary_not = 'UNARY_NOT'
unary_invert = 'UNARY_INVERT'
binary_matrix_multiply = 'BINARY_MATRIX_MULTIPLY... |
cats_path = "python_crash_course/exceptions/cats.txt"
dogs_path = "python_crash_course/exceptions/dogs.txt"
try:
with open(cats_path) as file_object:
cats = file_object.read()
print("Koty:")
print(cats)
except FileNotFoundError:
pass
try:
with open(dogs_path) as file_object:
dogs =... | cats_path = 'python_crash_course/exceptions/cats.txt'
dogs_path = 'python_crash_course/exceptions/dogs.txt'
try:
with open(cats_path) as file_object:
cats = file_object.read()
print('Koty:')
print(cats)
except FileNotFoundError:
pass
try:
with open(dogs_path) as file_object:
dogs = f... |
def has_unique_chars(string: str) -> bool:
if len(string) == 1:
return True
unique = []
for item in string:
if item not in unique:
unique.append(item)
else:
return False
return True | def has_unique_chars(string: str) -> bool:
if len(string) == 1:
return True
unique = []
for item in string:
if item not in unique:
unique.append(item)
else:
return False
return True |
#
# PySNMP MIB module ChrComPmSonetSNT-PFE-Interval-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ChrComPmSonetSNT-PFE-Interval-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:20:44 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using P... | (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, constraints_intersection, value_size_constraint, single_value_constraint, value_range_constraint) ... |
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'local_database.db',
'TEST_NAME': ':memory:',
}
}
SECRET_KEY = '9(-c^&tzdv(d-*x$cefm2pddz=0!_*8iu*i8fh+krpa!5ebk)+'
ROOT_URLCONF = 'test_project.urls'
TEMPLATE_DIRS = (
'templates',
)
INSTALL... | debug = True
databases = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'local_database.db', 'TEST_NAME': ':memory:'}}
secret_key = '9(-c^&tzdv(d-*x$cefm2pddz=0!_*8iu*i8fh+krpa!5ebk)+'
root_urlconf = 'test_project.urls'
template_dirs = ('templates',)
installed_apps = ('django.contrib.auth', 'django.contri... |
class Course:
def __init__(self, link, code, title, credits, campus, dept, year, semester, semester_code, faculty, courselvl, description, prereq, coreq, exclusion, breadth, apsc, flags):
self.link = link.strip()
self.code = code.strip()
self.title = title.strip()
self.credits = credits.strip()
self.campus ... | class Course:
def __init__(self, link, code, title, credits, campus, dept, year, semester, semester_code, faculty, courselvl, description, prereq, coreq, exclusion, breadth, apsc, flags):
self.link = link.strip()
self.code = code.strip()
self.title = title.strip()
self.credits = cre... |
# Generates comments with the specified indentation and wrapping-length
def generateComment(comment, length=100, indentation=""):
out = ""
for commentChunk in [
comment[i : i + length] for i in range(0, len(comment), length)
]:
out += indentation + "// " + commentChunk + "\n"
return out
... | def generate_comment(comment, length=100, indentation=''):
out = ''
for comment_chunk in [comment[i:i + length] for i in range(0, len(comment), length)]:
out += indentation + '// ' + commentChunk + '\n'
return out
def get_data_reference(element, root):
for parent in root.iter():
if elem... |
"""Error definitions."""
class VictimsDBError(Exception):
"""Generic VictimsDB error."""
class ParseError(VictimsDBError):
"""Error parsing YAML files."""
| """Error definitions."""
class Victimsdberror(Exception):
"""Generic VictimsDB error."""
class Parseerror(VictimsDBError):
"""Error parsing YAML files.""" |
# -*- coding: utf-8 -*-
class Solution:
def exist(self, board, word):
visited = set()
for i in range(len(board)):
for j in range(len(board[0])):
if self.startsHere(board, word, visited, 0, i, j):
return True
return False
def startsHere(s... | class Solution:
def exist(self, board, word):
visited = set()
for i in range(len(board)):
for j in range(len(board[0])):
if self.startsHere(board, word, visited, 0, i, j):
return True
return False
def starts_here(self, board, word, visite... |
"""
1. Clarification
2. Possible solutions
- Brute force
- HashSet
3. Coding
4. Tests
"""
# # T=O(mn), S=O(1)
# class Solution:
# def numJewelsInStones(self, jewels: str, stones: str) -> int:
# return sum(s in jewels for s in stones)
# T=O(m+n), S=O(m)
class Solution:
def numJewelsInStones(s... | """
1. Clarification
2. Possible solutions
- Brute force
- HashSet
3. Coding
4. Tests
"""
class Solution:
def num_jewels_in_stones(self, jewels: str, stones: str) -> int:
jewels_set = set(jewels)
return sum((s in jewelsSet for s in stones)) |
#-------------------------------------------------------------------------------
# Name: Removing duplicates
# Purpose:
#
# Author: Ben Jones
#
# Created: 03/02/2022
# Copyright: (c) Ben Jones 2022
#-------------------------------------------------------------------------------
new_menu = [... | new_menu = ['Hawaiian', 'Margherita', 'Mushroom', 'Prosciutto', 'Meat Feast', 'Hawaiian', 'Bacon', 'Black Olive Special', 'Sausage', 'Sausage']
final_new_menu = list(dict.fromkeys(new_menu))
print(final_new_menu) |
word_size = 8
num_words = 256
num_banks = 1
tech_name = "freepdk45"
process_corners = ["TT"]
supply_voltages = [1.0]
temperatures = [25]
| word_size = 8
num_words = 256
num_banks = 1
tech_name = 'freepdk45'
process_corners = ['TT']
supply_voltages = [1.0]
temperatures = [25] |
# Definition for a binary tree node.
# class Node(object):
# def __init__(self, val=" ", left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def checkEquivalence(self, root1: 'Node', root2: 'Node') -> bool:
def post_order(node):
... | class Solution:
def check_equivalence(self, root1: 'Node', root2: 'Node') -> bool:
def post_order(node):
ans = collections.Counter()
if node is None:
return ans
if node.left is None and node.right is None:
ans[node.val] += 1
e... |
# Panel settings: /project/<default>/api_access
PANEL_DASHBOARD = 'project'
PANEL_GROUP = 'default'
PANEL = 'api_access'
# The default _was_ "overview", but that gives 403s.
# Make this the default in this dashboard.
DEFAULT_PANEL = 'api_access'
| panel_dashboard = 'project'
panel_group = 'default'
panel = 'api_access'
default_panel = 'api_access' |
"""
Representing a single file in a commit
@name name of file
@loc lines of code in file
@authors all authors of the file
@nuc number of unique changes made to the file
"""
class CommitFile:
def __init__(self, name, loc, authors, lastchanged, owner,co_commited_files,adev):
self.name = name ... | """
Representing a single file in a commit
@name name of file
@loc lines of code in file
@authors all authors of the file
@nuc number of unique changes made to the file
"""
class Commitfile:
def __init__(self, name, loc, authors, lastchanged, owner, co_commited_files, adev):
self.name = name
... |
# python stack using list #
my_Stack = [10, 12, 13, 11, 33, 24, 56, 78, 13, 56, 31, 32, 33, 10, 15] # array #
print(my_Stack)
print(my_Stack.pop())
# think python simple just pop and push #
print(my_Stack.pop())
print(my_Stack.pop())
print(my_Stack.pop())
| my__stack = [10, 12, 13, 11, 33, 24, 56, 78, 13, 56, 31, 32, 33, 10, 15]
print(my_Stack)
print(my_Stack.pop())
print(my_Stack.pop())
print(my_Stack.pop())
print(my_Stack.pop()) |
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
del dict['Name'] # remove entry with key 'Name'
dict.clear() # remove all entries in dict
del dict # delete entire dictionary
print ("dict['Age']: ", dict['Age'])
print ("dict['School']: ", dict['School']) | dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
del dict['Name']
dict.clear()
del dict
print("dict['Age']: ", dict['Age'])
print("dict['School']: ", dict['School']) |
'''
URL: https://leetcode.com/problems/maximum-nesting-depth-of-the-parentheses/
Difficulty: Easy
Description: Maximum Nesting Depth of the Parentheses
A string is a valid parentheses string (denoted VPS) if it meets one of the following:
It is an empty string "", or a single character not equal to "(" or ")",
It c... | """
URL: https://leetcode.com/problems/maximum-nesting-depth-of-the-parentheses/
Difficulty: Easy
Description: Maximum Nesting Depth of the Parentheses
A string is a valid parentheses string (denoted VPS) if it meets one of the following:
It is an empty string "", or a single character not equal to "(" or ")",
It c... |
# example of except/from exception usage
try:
1 / 0
except Exception as E:
raise NameError('bad') from E
"""
Traceback (most recent call last):
File "except_from.py", line 4, in <module>
1 / 0
ZeroDivisionError: division by zero
The above exception was the direct cause of the following exception:
Trac... | try:
1 / 0
except Exception as E:
raise name_error('bad') from E
'\nTraceback (most recent call last):\n File "except_from.py", line 4, in <module>\n 1 / 0\nZeroDivisionError: division by zero\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n Fi... |
#
# PySNMP MIB module CISCO-EVC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-EVC-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:57:43 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... | (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_intersection, value_range_constraint, constraints_union, value_size_constraint) ... |
"""
A module to show off dictionary comprehension.
Dictionary comprehension is similar to list comprehension
except that you put the generator expression inside of {}
instead of [].
Author: Walker M. White (wmw2)
Date: October 28, 2020
"""
GRADES = {'jrs1':80,'jrs2':92,'wmw2':50,'abc1':95}
def histogram(s):
"... | """
A module to show off dictionary comprehension.
Dictionary comprehension is similar to list comprehension
except that you put the generator expression inside of {}
instead of [].
Author: Walker M. White (wmw2)
Date: October 28, 2020
"""
grades = {'jrs1': 80, 'jrs2': 92, 'wmw2': 50, 'abc1': 95}
def histogram(s):
... |
""" Model a record """
class Record(object):
def __init__(self, gps_lat=None, gps_long=None, company_name=None, search_url=None,
xpath_pattern=None, company_email=None):
self.gps_lat = gps_lat
self.gps_long = gps_long
self.company_name = company_name
self.search_u... | """ Model a record """
class Record(object):
def __init__(self, gps_lat=None, gps_long=None, company_name=None, search_url=None, xpath_pattern=None, company_email=None):
self.gps_lat = gps_lat
self.gps_long = gps_long
self.company_name = company_name
self.search_url = search_url
... |
#
# PySNMP MIB module ALPHA-RECTIFIER-SYS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALPHA-RECTIFIER-SYS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:20:50 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 ... | (simple, scaled_number) = mibBuilder.importSymbols('ALPHA-RESOURCE-MIB', 'simple', 'ScaledNumber')
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constr... |
# O(n) time | O(1) space
def twoNumberSum(array, targetSum):
# Write your code here.
result = []
for num in array:
offset = targetSum - num
if offset in array:
result = [offset, num]
return result
# def twoNumberSum(array, targetSum):
# for i in range(len(array)-1):
# for k in range(i+1, len(array)... | def two_number_sum(array, targetSum):
result = []
for num in array:
offset = targetSum - num
if offset in array:
result = [offset, num]
return result |
class MockMail:
def __init__(self):
self.inbox = []
def send_mail(self, recipient_list, **kwargs):
for recipient in recipient_list:
self.inbox.append({
'recipient': recipient,
'subject': kwargs['subject'],
'message': kwargs['message']
... | class Mockmail:
def __init__(self):
self.inbox = []
def send_mail(self, recipient_list, **kwargs):
for recipient in recipient_list:
self.inbox.append({'recipient': recipient, 'subject': kwargs['subject'], 'message': kwargs['message']})
def clear(self):
self.inbox[:] = ... |
class Text:
""" The Plot Text Text Template
"""
def __init__(self, text=""):
"""
Initializes the plot text Text
:param text: plot text text
:type text: str
"""
self.text = text
self.template = '\ttext = "{text}";\n'
def to_str(self):
"""
... | class Text:
""" The Plot Text Text Template
"""
def __init__(self, text=''):
"""
Initializes the plot text Text
:param text: plot text text
:type text: str
"""
self.text = text
self.template = '\ttext = "{text}";\n'
def to_str(self):
"""
... |
for x in range(0, 11):
for c in range(0, 11):
print(x, 'x', c, '= {}'.format(x * c))
print('\t')
| for x in range(0, 11):
for c in range(0, 11):
print(x, 'x', c, '= {}'.format(x * c))
print('\t') |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 19 17:53:46 2017
@author: benjaminsmith
"""
#do the regression in the
#we need a design matrix
#with linear, square, cubic time point regressors
#plus intercept
#plus whatever Design_Matrix files we want to put in.
onsets_convolved.head()
onsets... | """
Created on Sat Aug 19 17:53:46 2017
@author: benjaminsmith
"""
onsets_convolved.head()
onsets_convolved['linearterm'] = range(1, 361)
onsets_convolved['quadraticterm'] = [pow(x, 2) for x in onsets_convolved['linearterm']]
onsets_convolved['cubicterm'] = [pow(x, 3) for x in onsets_convolved['linearterm']]
onsets_co... |
# Main network and testnet3 definitions
params = {
'argentum_main': {
'pubkey_address': 23,
'script_address': 5,
'genesis_hash': '88c667bc63167685e4e4da058fffdfe8e007e5abffd6855de52ad59df7bb0bb2'
},
'argentum_test': {
'pubkey_address': 111,
'script_address': 196,
... | params = {'argentum_main': {'pubkey_address': 23, 'script_address': 5, 'genesis_hash': '88c667bc63167685e4e4da058fffdfe8e007e5abffd6855de52ad59df7bb0bb2'}, 'argentum_test': {'pubkey_address': 111, 'script_address': 196, 'genesis_hash': 'f5ae71e26c74beacc88382716aced69cddf3dffff24f384e1808905e0188f68f'}} |
""" Utilities for Cloud Backends """
def parse_remote_path(remote_path):
"""
Parses a remote pathname into its protocol, bucket, and key. These
are fields required by the current cloud backends
"""
# Simple, but should work
fields = remote_path.split("/")
assert len(fields) > 3, "Improper... | """ Utilities for Cloud Backends """
def parse_remote_path(remote_path):
"""
Parses a remote pathname into its protocol, bucket, and key. These
are fields required by the current cloud backends
"""
fields = remote_path.split('/')
assert len(fields) > 3, 'Improper remote path (needs more fields)... |
def add_time(start, duration, day=None):
hour, minutes = start.split(':')
minutes, am_pm = minutes.split()
add_hour, add_min = duration.split(":")
hour = int(hour)
minutes = int(minutes)
add_hour = int(add_hour)
add_min = int(add_min)
n = add_hour // 24
rem_hour = add_hour % 24
n... | def add_time(start, duration, day=None):
(hour, minutes) = start.split(':')
(minutes, am_pm) = minutes.split()
(add_hour, add_min) = duration.split(':')
hour = int(hour)
minutes = int(minutes)
add_hour = int(add_hour)
add_min = int(add_min)
n = add_hour // 24
rem_hour = add_hour % 24... |
string = '<option value="1" >Malda</option><option value="2" >Hooghly</option><option value="3" >Calcutta</option><option value="4" >Jalpaiguri</option><option value="6" >Coochbehar</option><option value="7" >Paschim Medinpur</option><option value="8" >Birbhum</option><option value="9" >Purba Medinipur</option><option ... | string = '<option value="1" >Malda</option><option value="2" >Hooghly</option><option value="3" >Calcutta</option><option value="4" >Jalpaiguri</option><option value="6" >Coochbehar</option><option value="7" >Paschim Medinpur</option><option value="8" >Birbhum</option><option value="9" >Purba Medinipur</option><option ... |
class Calls(object):
def __init__(self):
self.calls = []
def addCall(self, call):
self.calls.append(call)
def endCall(self, call):
for c in self.calls:
if call.ID == c.ID:
self.calls.remove(call)
def searchCall(self, call_id):
for c in self.... | class Calls(object):
def __init__(self):
self.calls = []
def add_call(self, call):
self.calls.append(call)
def end_call(self, call):
for c in self.calls:
if call.ID == c.ID:
self.calls.remove(call)
def search_call(self, call_id):
for c in s... |
# Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite
# restaurants represented by strings.
# You need to help them find out their common interest with the least list index sum. If there is a
# choice tie between answers, output all of them with no order requirement. Yo... | class Solution:
def find_restaurant(self, list1: 'list[str]', list2: 'list[str]') -> 'list[str]':
places_map = {}
min_sum = float('inf')
res = []
for (i, cur) in enumerate(list1):
placesMap[cur] = i
for (i, cur) in enumerate(list2):
if cur in placesMa... |
def gcd(a,b):
if a < b:
a, b = b, a
if b == 0:
return a
return gcd(b, a %b)
def gcdlist(l):
if len(l) == 2:
return gcd(l[0], l[1])
f = l.pop()
s = l.pop()
m = gcd(f, s)
l.append(m)
return gcdlist(l)
def main():
n, x = map(int, input().split())
a = [... | def gcd(a, b):
if a < b:
(a, b) = (b, a)
if b == 0:
return a
return gcd(b, a % b)
def gcdlist(l):
if len(l) == 2:
return gcd(l[0], l[1])
f = l.pop()
s = l.pop()
m = gcd(f, s)
l.append(m)
return gcdlist(l)
def main():
(n, x) = map(int, input().split())
... |
#! /bin/env python3
''' Class that represents a bit mask.
It has methods representing all
the bitwise operations plus some
additional features. The methods
return a new BitMask object or
a boolean result. See the bits
module for more on the operations
provided.
'''
class BitMask(int):
def AND(self,bm):
r... | """ Class that represents a bit mask.
It has methods representing all
the bitwise operations plus some
additional features. The methods
return a new BitMask object or
a boolean result. See the bits
module for more on the operations
provided.
"""
class Bitmask(int):
def and(self, bm):
return bit_mask(... |
n,reqsum=map(int,input().split())
a=list(map(int,input().split()))
arr=[]
for i in range(1,n+1):
arr.append([i,a[i-1]])
arr=sorted(arr,key=lambda x:x[1])
#print(arr)
i=0
j=n-1
while(i<=j and i!=j):
#print("{}+{}={}".format(arr[i][1],arr[j][1],arr[i][1]+arr[j][1]))
if(arr[i][1]+arr[j][1]==reqsum):
pr... | (n, reqsum) = map(int, input().split())
a = list(map(int, input().split()))
arr = []
for i in range(1, n + 1):
arr.append([i, a[i - 1]])
arr = sorted(arr, key=lambda x: x[1])
i = 0
j = n - 1
while i <= j and i != j:
if arr[i][1] + arr[j][1] == reqsum:
print('{} {}'.format(arr[i][0], arr[j][0]))
... |
# 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 flatten(self, root: TreeNode) -> None:
preorderList = list()
def preorderTraversal(root... | class Solution:
def flatten(self, root: TreeNode) -> None:
preorder_list = list()
def preorder_traversal(root: TreeNode):
if root:
preorderList.append(root)
preorder_traversal(root.left)
preorder_traversal(root.right)
preorder_tra... |
str = "Python Program"
print(str[0])
print(str[1])
print(str[2])
print(str[3])
print(str[4])
print(str[5])
print(str[0:8])
print(str[::-1]) #to reverse the string | str = 'Python Program'
print(str[0])
print(str[1])
print(str[2])
print(str[3])
print(str[4])
print(str[5])
print(str[0:8])
print(str[::-1]) |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | polyaxon_docker_template = '\nFROM {{ image }}\n\n{% if lang_env -%}\nENV LC_ALL {{ lang_env }}\nENV LANG {{ lang_env }}\nENV LANGUAGE {{ lang_env }}\n{% endif -%}\n\n{% if shell %}\nENV SHELL {{ shell }}\n{% endif -%}\n\n{% if path -%}\n{% for path_step in path -%}\nENV PATH="${PATH}:{{ path_step }}"\n{% endfor -%}\n{... |
class BaseContext(object):
"""
Base class for contexts.
Most views in this app will use a database connection. This class will
add an instance attribute for the database session and the request.
"""
def __init__(self, request):
self._request = request
self._db = self._request... | class Basecontext(object):
"""
Base class for contexts.
Most views in this app will use a database connection. This class will
add an instance attribute for the database session and the request.
"""
def __init__(self, request):
self._request = request
self._db = self._request.d... |
class Solution:
def countOrders(self, n: int) -> int:
"""
n! * (1 * 2 * 3 * (2n - 1))
n == 3
==> (1 * 2 * 3) * (1 * 3 * 5)
==> 1 * 1 * 2 * 3 * 3 * 5
result = 1
for i: 1 to n
result *= i * (2*n - 1)
"""
result = 1
... | class Solution:
def count_orders(self, n: int) -> int:
"""
n! * (1 * 2 * 3 * (2n - 1))
n == 3
==> (1 * 2 * 3) * (1 * 3 * 5)
==> 1 * 1 * 2 * 3 * 3 * 5
result = 1
for i: 1 to n
result *= i * (2*n - 1)
"""
result = 1
... |
"""
Mycroft Holmes core
"""
VERSION = '0.3'
| """
Mycroft Holmes core
"""
version = '0.3' |
vid_parttern = r''
class Video:
def __init__(self):
pass
| vid_parttern = ''
class Video:
def __init__(self):
pass |
expected_output = {
'Node number is ': '1',
'Node status is ': 'NODE_STATUS_UP',
'Tunnel status is ': 'NODE_TUNNEL_UP',
'Node Sudi is ': '11 FDO25390VQP',
'Node Name is ': '4 Node',
'Node type is ': 'CLUSTER_NODE_TYPE_MASTER',
'Node role is ': 'CLUSTER_NODE_ROLE_LEADER'
}
| expected_output = {'Node number is ': '1', 'Node status is ': 'NODE_STATUS_UP', 'Tunnel status is ': 'NODE_TUNNEL_UP', 'Node Sudi is ': '11 FDO25390VQP', 'Node Name is ': '4 Node', 'Node type is ': 'CLUSTER_NODE_TYPE_MASTER', 'Node role is ': 'CLUSTER_NODE_ROLE_LEADER'} |
# def get_sql(cte, params, company, conn, gl_code):
#
# sql = cte + ("""
# SELECT
# a.op_date AS "[DATE]", a.cl_date AS "[DATE]"
# , SUM(COALESCE(b.tran_tot, 0)) AS "[REAL2]"
# , SUM(COALESCE(c.tran_tot, 0) - COALESCE(b.tran_tot, 0)) AS "[REAL2]"
# , SUM(COA... | def get_sql(cte, params, company, conn, gl_code):
sql = cte + '\n SELECT \n a.op_date AS "[DATE]", a.cl_date AS "[DATE]"\n , b.gl_code\n , SUM(COALESCE(a.op_tot, 0)) AS "[REAL2]"\n , SUM(COALESCE(a.cl_tot, 0) - COALESCE(a.op_tot, 0)) AS "[REAL2]"\n , SUM... |
class Service:
def __init__(self):
self.base = 7
def set_val(self, val):
self.func_val = val
def get_val(self):
return self.func_val
class Service2(Service):
def __init__(self): # pragma: no cover
self.base = 8
| class Service:
def __init__(self):
self.base = 7
def set_val(self, val):
self.func_val = val
def get_val(self):
return self.func_val
class Service2(Service):
def __init__(self):
self.base = 8 |
__author__ = 'roeiherz'
"""
Write a method to return all subsets of a set
"""
def power_set(subset):
n = len(subset)
# Stop case
if n != 0:
print(subset)
for i in range(n):
new_lst = subset[:i] + subset[i + 1:]
power_set(new_lst)
def power_set_memo(subset, mem):
n = len... | __author__ = 'roeiherz'
'\nWrite a method to return all subsets of a set\n'
def power_set(subset):
n = len(subset)
if n != 0:
print(subset)
for i in range(n):
new_lst = subset[:i] + subset[i + 1:]
power_set(new_lst)
def power_set_memo(subset, mem):
n = len(subset)
if n != 0... |
vowels = "aeiou"
#user input
word = input("Enter a word ('quit' to quit): ")
word = word.lower()
if word == 'quit':
quit()
#mainloop
while word != 'quit':
if word[0] in vowels:
word = word + "way"
#if word is one letter consonant
elif word[0] not in vowels and len(word) == 1:
word =... | vowels = 'aeiou'
word = input("Enter a word ('quit' to quit): ")
word = word.lower()
if word == 'quit':
quit()
while word != 'quit':
if word[0] in vowels:
word = word + 'way'
elif word[0] not in vowels and len(word) == 1:
word = word + 'ay'
else:
for (i, ch) in enumerate(word):
... |
class Event:
def __init__(self, event_date, event_type, machine_name, user):
self.date = event_date
self.type = event_type
self.machine = machine_name
self.user = user
| class Event:
def __init__(self, event_date, event_type, machine_name, user):
self.date = event_date
self.type = event_type
self.machine = machine_name
self.user = user |
pkgname = "python-urllib3"
pkgver = "1.26.9"
pkgrel = 0
build_style = "python_module"
hostmakedepends = ["python-setuptools"]
depends = ["python-six"]
pkgdesc = "HTTP library with thread-safe connection pooling"
maintainer = "q66 <q66@chimera-linux.org>"
license = "MIT"
url = "https://urllib3.readthedocs.io"
source = f... | pkgname = 'python-urllib3'
pkgver = '1.26.9'
pkgrel = 0
build_style = 'python_module'
hostmakedepends = ['python-setuptools']
depends = ['python-six']
pkgdesc = 'HTTP library with thread-safe connection pooling'
maintainer = 'q66 <q66@chimera-linux.org>'
license = 'MIT'
url = 'https://urllib3.readthedocs.io'
source = f... |
"""Kaprekar's Constant.
Have the function KaprekarsConstant(num) take the num parameter being passed which will be a
4-digit number with at least two distinct digits.
Your program should perform the following routine on the number:
Arrange the digits in descending order and in ascending order (adding leading zeroes if... | """Kaprekar's Constant.
Have the function KaprekarsConstant(num) take the num parameter being passed which will be a
4-digit number with at least two distinct digits.
Your program should perform the following routine on the number:
Arrange the digits in descending order and in ascending order (adding leading zeroes if... |
___assertEqual(0**17, 0)
___assertEqual(17**0, 1)
___assertEqual(0**0, 1)
___assertEqual(17**1, 17)
___assertEqual(2**10, 1024)
___assertEqual(2**-2, 0.25)
| ___assert_equal(0 ** 17, 0)
___assert_equal(17 ** 0, 1)
___assert_equal(0 ** 0, 1)
___assert_equal(17 ** 1, 17)
___assert_equal(2 ** 10, 1024)
___assert_equal(2 ** (-2), 0.25) |
record4 = [[({'t4.103.114.0': {'wcet': 1, 'period': 10, 'deadline': 9}, 't3.103.114.0': {'wcet': 2, 'period': 10, 'deadline': 8}, 't5.103.114.0': {'wcet': 3, 'period': 15, 'deadline': 12}}, {'t4.103.114.0': [0.559, 10.0], 't3.103.114.0': [0.733, 5.0], 't5.103.114.0': [0.413, 5.0]}), 'newmec-3'], [({'t5.103.114.1': {'w... | record4 = [[({'t4.103.114.0': {'wcet': 1, 'period': 10, 'deadline': 9}, 't3.103.114.0': {'wcet': 2, 'period': 10, 'deadline': 8}, 't5.103.114.0': {'wcet': 3, 'period': 15, 'deadline': 12}}, {'t4.103.114.0': [0.559, 10.0], 't3.103.114.0': [0.733, 5.0], 't5.103.114.0': [0.413, 5.0]}), 'newmec-3'], [({'t5.103.114.1': {'wc... |
class MemberStore:
"""docstring for MemberStore"""
members = []
last_id = 1
def get_all(self):
return MemberStore.members
def add(self, member):
member.id = MemberStore.last_id
self.members.append(member)
MemberStore.last_id += 1
def get_by_id(self, id):
all_mem = self.get_all()
res = None
for me... | class Memberstore:
"""docstring for MemberStore"""
members = []
last_id = 1
def get_all(self):
return MemberStore.members
def add(self, member):
member.id = MemberStore.last_id
self.members.append(member)
MemberStore.last_id += 1
def get_by_id(self, id):
... |
# Initialize step_end
step_end = 10
# Loop for step_end steps
for step in range(step_end):
# Compute value of t
t = step * dt
# Compute value of i at this time step
i = i_mean * (1 + np.sin((t * 2 * np.pi) / 0.01))
# Print value of t and i
print(f'{t:.3f} {i:.4e}') | step_end = 10
for step in range(step_end):
t = step * dt
i = i_mean * (1 + np.sin(t * 2 * np.pi / 0.01))
print(f'{t:.3f} {i:.4e}') |
"""
##########################################
## Developed By:Mustafa Raad Mutashar ##
## mustafa.raad.7@gmail.com 2020 ##
##########################################
"""
| """
##########################################
## Developed By:Mustafa Raad Mutashar ##
## mustafa.raad.7@gmail.com 2020 ##
##########################################
""" |
# OpenWeatherMap API Key
weather_api_key = "229c3f533e63b8b69792de2ba65d3645"
# Google API Key
g_key = "AIzaSyCv1BWR1Jm0cxoY8oqWxYHWU2g6Aq91SvE"
| weather_api_key = '229c3f533e63b8b69792de2ba65d3645'
g_key = 'AIzaSyCv1BWR1Jm0cxoY8oqWxYHWU2g6Aq91SvE' |
# get stem leaf plot in dictionary
def stemleaf(data):
stem_leaf = {}
for x in data:
x_str = str(x)
if (len(x_str) == 1):
x_str = "0" + x_str
stem = int(x_str[:-1])
leaf = int(x_str[-1])
if (stem not in stem_leaf):
stem_leaf[stem] = [leaf]
else:
stem_leaf[stem] = stem_leaf[stem] + [leaf]
ret... | def stemleaf(data):
stem_leaf = {}
for x in data:
x_str = str(x)
if len(x_str) == 1:
x_str = '0' + x_str
stem = int(x_str[:-1])
leaf = int(x_str[-1])
if stem not in stem_leaf:
stem_leaf[stem] = [leaf]
else:
stem_leaf[stem] = ste... |
"""
A small set of functions for math operations
"""
# Write a function named add that adds two values
def add(A, B):
"""
Just writing this comment because it will pop up when asked for help
"""
C=A+B
return C
def mult(A,B):
"""
A*B
"""
return A*B
def div(A,B):
"""
A/B
... | """
A small set of functions for math operations
"""
def add(A, B):
"""
Just writing this comment because it will pop up when asked for help
"""
c = A + B
return C
def mult(A, B):
"""
A*B
"""
return A * B
def div(A, B):
"""
A/B
"""
return A / B
def exp(A, B):
... |
f1 = 'bully_and_attack_mode'
f2 = 'happy_child_mode'
f3 = 'punishing_parent_mode'
f4 = 'vulnerable_child_mode'
f5 = 'demanding_parent_mode'
f6 = 'compliand_surrender_mode'
f7 = 'self_aggrandizer_mode'
f8 = 'impulsive_child_mode'
f9 = 'undiscilined_child_mode'
f10 = 'engraed_child_mode'
f11 = 'healthyy_adult_mode'
f12 ... | f1 = 'bully_and_attack_mode'
f2 = 'happy_child_mode'
f3 = 'punishing_parent_mode'
f4 = 'vulnerable_child_mode'
f5 = 'demanding_parent_mode'
f6 = 'compliand_surrender_mode'
f7 = 'self_aggrandizer_mode'
f8 = 'impulsive_child_mode'
f9 = 'undiscilined_child_mode'
f10 = 'engraed_child_mode'
f11 = 'healthyy_adult_mode'
f12 =... |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'target_defaults': {
'variables': {
'chromium_code': 1,
'enable_wexit_time_destructors': 1,
},
'include_dirs': [
'<(DEPT... | {'target_defaults': {'variables': {'chromium_code': 1, 'enable_wexit_time_destructors': 1}, 'include_dirs': ['<(DEPTH)', '<(SHARED_INTERMEDIATE_DIR)'], 'defines': ['COMPILE_CONTENT_STATICALLY', 'SECURITY_WIN32', 'STRICT', '_ATL_APARTMENT_THREADED', '_ATL_CSTRING_EXPLICIT_CONSTRUCTORS', '_ATL_NO_COM_SUPPORT', '_ATL_NO_A... |
'''all custom exceptions should go here'''
class EmptyP2THDirectory(Exception):
'''no transactions on this P2TH directory'''
class P2THImportFailed(Exception):
'''Importing of PeerAssets P2TH privkeys failed.'''
class InvalidDeckIssueModeCombo(Exception):
'''When verfiying deck issue_mode combinations... | """all custom exceptions should go here"""
class Emptyp2Thdirectory(Exception):
"""no transactions on this P2TH directory"""
class P2Thimportfailed(Exception):
"""Importing of PeerAssets P2TH privkeys failed."""
class Invaliddeckissuemodecombo(Exception):
"""When verfiying deck issue_mode combinations.""... |
class Templates:
@staticmethod
def simple_react_class_component(name):
return """import {{ Component }} from "react";
import React from "react";
export default class {0} extends Component {{
render() {{
return <div>{{this.props.children}}</div>;
}}
}}
""".format(name)
@staticmethod
def... | class Templates:
@staticmethod
def simple_react_class_component(name):
return 'import {{ Component }} from "react";\nimport React from "react";\n\nexport default class {0} extends Component {{\n render() {{\n return <div>{{this.props.children}}</div>;\n }}\n}}\n'.format(name)
@staticmethod
... |
"""
Configuration for docs
"""
# source_link = "https://github.com/[org_name]/wmo"
# docs_base_url = "https://[org_name].github.io/wmo"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"
def get_context(context):
context.brand_html = "World Memon Organization... | """
Configuration for docs
"""
def get_context(context):
context.brand_html = 'World Memon Organization' |
class Sack:
def __init__(self, wt, val):
self.wt = wt
self.val = val
self.cost = val // wt
def __lt__(self, other):
return self.cost < other.cost
def knapsack(wt, val, W):
item = []
for i in range(len(wt)):
item.append(Sack(wt[i], val[i]))
i... | class Sack:
def __init__(self, wt, val):
self.wt = wt
self.val = val
self.cost = val // wt
def __lt__(self, other):
return self.cost < other.cost
def knapsack(wt, val, W):
item = []
for i in range(len(wt)):
item.append(sack(wt[i], val[i]))
item.sort(reverse... |
"""Constants for all the OCR post-correction experiments with the multisource model.
These can be modified for different languages/settings as needed.
Copyright (c) 2021, Shruti Rijhwani
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of t... | """Constants for all the OCR post-correction experiments with the multisource model.
These can be modified for different languages/settings as needed.
Copyright (c) 2021, Shruti Rijhwani
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of t... |
'''
It is time now to piece together everything you have learned so far into a pipeline for classification! Your job in this exercise is to build a pipeline that includes scaling and hyperparameter tuning to classify wine quality.
You'll return to using the SVM classifier you were briefly introduced to earlier in this... | """
It is time now to piece together everything you have learned so far into a pipeline for classification! Your job in this exercise is to build a pipeline that includes scaling and hyperparameter tuning to classify wine quality.
You'll return to using the SVM classifier you were briefly introduced to earlier in this... |
m: int; n: int
m = int(input("Quantas linhas vai ter cada matriz? "))
n = int(input("Quantas colunas vai ter cada matriz? "))
a: [[int]] = [[0 for x in range(n)] for x in range(m)]
b: [[int]] = [[0 for x in range(n)] for x in range(m)]
c: [[int]] = [[0 for x in range(n)] for x in range(m)]
print("Digite os valores d... | m: int
n: int
m = int(input('Quantas linhas vai ter cada matriz? '))
n = int(input('Quantas colunas vai ter cada matriz? '))
a: [[int]] = [[0 for x in range(n)] for x in range(m)]
b: [[int]] = [[0 for x in range(n)] for x in range(m)]
c: [[int]] = [[0 for x in range(n)] for x in range(m)]
print('Digite os valores da ma... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: ying jun
@email: wandy1208@live.com
@time: 2021/12/12 22:55
"""
| """
@author: ying jun
@email: wandy1208@live.com
@time: 2021/12/12 22:55
""" |
"""
Application constants
"""
REQUEST_TIMEOUT = 100
CONNECTION_TIMEOUT = 30
BASE_URL = 'https://graph.microsoft.com/v1.0'
SDK_VERSION = '0.0.3'
# Used as the key for AuthMiddlewareOption in MiddlewareControl
AUTH_MIDDLEWARE_OPTIONS = 'AUTH_MIDDLEWARE_OPTIONS'
| """
Application constants
"""
request_timeout = 100
connection_timeout = 30
base_url = 'https://graph.microsoft.com/v1.0'
sdk_version = '0.0.3'
auth_middleware_options = 'AUTH_MIDDLEWARE_OPTIONS' |
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - <short description>
<what this stuff does ... - verbose enough>
@copyright: 2007 MoinMoin:YourNameHere
@license: GNU GPL, see COPYING for details.
"""
| """
MoinMoin - <short description>
<what this stuff does ... - verbose enough>
@copyright: 2007 MoinMoin:YourNameHere
@license: GNU GPL, see COPYING for details.
""" |
objetivo = int(input('Escoge un numero: '))
epsilon = 0.0001
paso = epsilon**2
respuesta = 0.0
while abs(respuesta**2 - objetivo) >= epsilon and respuesta <= objetivo:
print(abs(respuesta**2 - objetivo), respuesta)
respuesta += paso
if abs(respuesta**2 - objetivo) >= epsilon:
print(f'No se encontro la ra... | objetivo = int(input('Escoge un numero: '))
epsilon = 0.0001
paso = epsilon ** 2
respuesta = 0.0
while abs(respuesta ** 2 - objetivo) >= epsilon and respuesta <= objetivo:
print(abs(respuesta ** 2 - objetivo), respuesta)
respuesta += paso
if abs(respuesta ** 2 - objetivo) >= epsilon:
print(f'No se encontro ... |
# -*- coding: utf-8 -*-
class ImdbScraperPipeline(object):
def process_item(self, item, spider):
return item
| class Imdbscraperpipeline(object):
def process_item(self, item, spider):
return item |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.