content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
routes = {
'{"command": "stats"}' : {"STATUS":[{"STATUS":"S","When":1553711204,"Code":70,"Msg":"BMMiner stats","Description":"bmminer 1.0.0"}],"STATS":[{"BMMiner":"2.0.0","Miner":"16.8.1.3","CompileTime":"Fri Nov 17 17:37:49 CST 2017","Type":"Antminer S9"},{"STATS":0,"ID":"BC50","Elapsed":248,"Calls":0,"Wait":0.00000... | routes = {'{"command": "stats"}': {'STATUS': [{'STATUS': 'S', 'When': 1553711204, 'Code': 70, 'Msg': 'BMMiner stats', 'Description': 'bmminer 1.0.0'}], 'STATS': [{'BMMiner': '2.0.0', 'Miner': '16.8.1.3', 'CompileTime': 'Fri Nov 17 17:37:49 CST 2017', 'Type': 'Antminer S9'}, {'STATS': 0, 'ID': 'BC50', 'Elapsed': 248, 'C... |
def folder_to_dict(folder):
return {
'id': folder.folder_id,
'name': folder.name,
'class': folder.folder_class,
'total_count': folder.total_count,
'child_folder_count': folder.child_folder_count,
'unread_count': folder.unread_count
}
def item_to_dict(item, inclu... | def folder_to_dict(folder):
return {'id': folder.folder_id, 'name': folder.name, 'class': folder.folder_class, 'total_count': folder.total_count, 'child_folder_count': folder.child_folder_count, 'unread_count': folder.unread_count}
def item_to_dict(item, include_body=False):
result = {'id': item.item_id, 'chan... |
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
config_type='sweetberry'
# the names j2, j3, and j4 are the white banks on sweetberry
# Note that here the bank name in the mux position is optional
# as... | config_type = 'sweetberry'
inas = [('sweetberry', '0x40:3', 'j2_1', 5.0, 0.01, 'j2', False), ('sweetberry', '0x40:1', 'j2_2', 5.0, 0.01, 'j2', False), ('sweetberry', '0x40:2', 'j2_3', 5.0, 0.01, 'j2', False), ('sweetberry', '0x40:0', 'j2_4', 5.0, 0.01, 'j2', False), ('sweetberry', '0x41:3', 'j2_5', 5.0, 0.01, 'j2', Fal... |
# Project Euler Problem 4
# Pranav Mital
# function to check if a number is a palindrome
def isPalindrome(n):
flag = 0
str_n = str(n)
for i in range((len(str_n)//2)):
if str_n[i] != str_n[len(str_n)-1-i]:
flag += 1
if flag != 0:
return False
else:
return True
#... | def is_palindrome(n):
flag = 0
str_n = str(n)
for i in range(len(str_n) // 2):
if str_n[i] != str_n[len(str_n) - 1 - i]:
flag += 1
if flag != 0:
return False
else:
return True
largest_palindrome = 0
for i in range(100, 1000):
for j in range(100, 1000):
... |
class PyFileBuilder:
def __init__(self, name):
self._import_line = None
self._file_funcs = []
self.name = name
def add_imports(self, *modules_names):
import_list = []
for module in modules_names:
import_list.append("import " + module)
if len(import... | class Pyfilebuilder:
def __init__(self, name):
self._import_line = None
self._file_funcs = []
self.name = name
def add_imports(self, *modules_names):
import_list = []
for module in modules_names:
import_list.append('import ' + module)
if len(import_l... |
# Create a program such that when given a non-negative number input, output whether or not if the number is 2 away from a multiple of 10.
# input
num = int(input('Enter a positive number: '))
# processing & output
if (num + 2) % 10 == 0:
print(num, 'is 2 away from a multiple of 10.')
elif (num - 2) % 10 == 0:
... | num = int(input('Enter a positive number: '))
if (num + 2) % 10 == 0:
print(num, 'is 2 away from a multiple of 10.')
elif (num - 2) % 10 == 0:
print(num, 'is 2 away from a multiple of 10.')
else:
print(num, 'is not 2 away from a multiple of 10.') |
#URL:https://www.hackerrank.com/challenges/balanced-brackets/problem?h_r=profile
def check_close(top, ch):
if ch =="(" and top ==")":
return True
if ch =="[" and top =="]":
return True
if ch =="{" and top =="}":
return True
return False
def isBalanced(s):
stack=[]
for ... | def check_close(top, ch):
if ch == '(' and top == ')':
return True
if ch == '[' and top == ']':
return True
if ch == '{' and top == '}':
return True
return False
def is_balanced(s):
stack = []
for ch in s:
if ch == '(' or ch == '[' or ch == '{':
stack... |
def tickets(disabled,users):
'''
cheks if disabeld or not
'''
a = input("are you disabled or not: ")
if a == 'disabled':
disabled = 200
return disabled
elif a == 'not':
users = 500
return users
tickets(200,500)
| def tickets(disabled, users):
"""
cheks if disabeld or not
"""
a = input('are you disabled or not: ')
if a == 'disabled':
disabled = 200
return disabled
elif a == 'not':
users = 500
return users
tickets(200, 500) |
class Solution:
# 1st solution, Lagrange's four square theorem
# O(sqart(n)) time | O(1) space
def numSquares(self, n: int) -> int:
if int(sqrt(n))**2 == n: return 1
for j in range(int(sqrt(n)) + 1):
if int(sqrt(n - j*j))**2 == n - j*j: return 2
while n % 4 =... | class Solution:
def num_squares(self, n: int) -> int:
if int(sqrt(n)) ** 2 == n:
return 1
for j in range(int(sqrt(n)) + 1):
if int(sqrt(n - j * j)) ** 2 == n - j * j:
return 2
while n % 4 == 0:
n >>= 2
if n % 8 == 7:
re... |
#
# PySNMP MIB module CISCO-ATM-SWITCH-FR-RM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ATM-SWITCH-FR-RM-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:33:34 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version ... | (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, value_size_constraint, single_value_constraint, constraints_union, constraints_intersection) ... |
# Credentials for your Twitter bot account
# 1. Sign into Twitter or create new account
# 2. Make sure your mobile number is listed at twitter.com/settings/devices
# 3. Head to apps.twitter.com and select Keys and Access Tokens
CONSUMER_KEY = '6gTma2ITYHEh7MZMRJaflnxK7'
CONSUMER_SECRET = 'a20hHEbN1qudaR6RAdMCHtPKdOjp... | consumer_key = '6gTma2ITYHEh7MZMRJaflnxK7'
consumer_secret = 'a20hHEbN1qudaR6RAdMCHtPKdOjpjiiNKabXjhj52Ajb4uHz2S'
access_token = '1051987549487534081-quzVSEUw33JJiImQ7mSnyvZvdTsmln'
access_secret = 'Uz5w4bC3heTN3efnA5yuh7lOZZMzYzkZYThykqRgnZUtu' |
numbers=list(range(1,21,2))
for i in range(len(numbers)):
print(numbers[i])
| numbers = list(range(1, 21, 2))
for i in range(len(numbers)):
print(numbers[i]) |
#for c in range(2, 52, 2):
#print(c, end=' ')
#print('Acabo')
for c in range(1, 11):
print(c +c)
| for c in range(1, 11):
print(c + c) |
class Table:
def __init__(self, table):
self._table = table
@property
def name(self):
return self._table.__name__
@property
def thead(self):
all_fields = self._table._meta.fields
return [
field.verbose_name for field in all_fields if field.verbose_name !... | class Table:
def __init__(self, table):
self._table = table
@property
def name(self):
return self._table.__name__
@property
def thead(self):
all_fields = self._table._meta.fields
return [field.verbose_name for field in all_fields if field.verbose_name != 'ID']
... |
in_data = {
u'deliveryOrder': {
u'warehouseCode': u'OTHER',
u'deliveryOrderCode': u'3600120100000',
u'receiverInfo': {
u'detailAddress': u'\u5927\u5382\u680818\u53f7101',
u'city': u'\u4e94\u8fde',
u'province': u'\u5c71\u4e1c',
u'area': u'\u592... | in_data = {u'deliveryOrder': {u'warehouseCode': u'OTHER', u'deliveryOrderCode': u'3600120100000', u'receiverInfo': {u'detailAddress': u'大厂栈18号101', u'city': u'五连', u'province': u'山东', u'area': u'大厂'}, u'senderInfo': {u'detailAddress': u'文三路172号', u'city': u'杭州'}}, u'orderLines': {u'orderLine': [{u'itemId': u'0192010101... |
pkgname = "firmware-ipw2100"
pkgver = "1.3"
pkgrel = 0
pkgdesc = "Firmware for the Intel PRO/Wireless 2100 wifi cards"
maintainer = "q66 <q66@chimera-linux.org>"
license = "custom:ipw2100"
url = "http://ipw2100.sourceforge.net"
source = f"http://firmware.openbsd.org/firmware-dist/ipw2100-fw-{pkgver}.tgz"
sha256 = "e110... | pkgname = 'firmware-ipw2100'
pkgver = '1.3'
pkgrel = 0
pkgdesc = 'Firmware for the Intel PRO/Wireless 2100 wifi cards'
maintainer = 'q66 <q66@chimera-linux.org>'
license = 'custom:ipw2100'
url = 'http://ipw2100.sourceforge.net'
source = f'http://firmware.openbsd.org/firmware-dist/ipw2100-fw-{pkgver}.tgz'
sha256 = 'e110... |
'''Generates a javascript string to display flot graphs.
Please read README_flot_grapher.txt
Eliane Stampfer: eliane.stampfer@gmail.com
April 2009'''
class FlotGraph(object):
#constructor. Accepts an array of data, a title, an array of toggle-able data, and the
#width and height of the graph. All of these valu... | """Generates a javascript string to display flot graphs.
Please read README_flot_grapher.txt
Eliane Stampfer: eliane.stampfer@gmail.com
April 2009"""
class Flotgraph(object):
def __init__(self, data=[], title='', toggle_data=[], width='600', height='300'):
self.display_title = title
self.title = ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
class Decode:
def __init__(self, length, K, n, weight):
self.K = K
self.length = length
self.n = n
self.weight = weight
self.solution = [False for i in range(0, n + 1)]
def Search(self):
... | class Decode:
def __init__(self, length, K, n, weight):
self.K = K
self.length = length
self.n = n
self.weight = weight
self.solution = [False for i in range(0, n + 1)]
def search(self):
insert = [[False for k in range(0, self.K + 2)] for i in range(0, self.n + ... |
lines = []
with open('input.txt','r') as INPUT:
lines = INPUT.readlines()
M = int(lines[0])
stack = [None]*M
stack_head = -1
with open('output.txt', 'w') as OUTPUT:
for op in lines[1:]:
if op.startswith('+'):
stack_head += 1
stack[stack_head] = op[2:]
eli... | lines = []
with open('input.txt', 'r') as input:
lines = INPUT.readlines()
m = int(lines[0])
stack = [None] * M
stack_head = -1
with open('output.txt', 'w') as output:
for op in lines[1:]:
if op.startswith('+'):
stack_head += 1
stack[stack_head] = op[2:]
elif op.startswit... |
class BaseScraper:
pass
| class Basescraper:
pass |
k = int(input())
s = input()
prevlen = 0
ans = 0
for i in range(k, len(s)):
if s[i] == s[i - k]:
prevlen += 1
ans += prevlen
else:
prevlen = 0
print(ans)
| k = int(input())
s = input()
prevlen = 0
ans = 0
for i in range(k, len(s)):
if s[i] == s[i - k]:
prevlen += 1
ans += prevlen
else:
prevlen = 0
print(ans) |
# Equality checks should behave the same way as assignment
# Variable equality check
bar == {'a': 1, 'b':2}
bar == {
'a': 1,
'b': 2,
}
# Function equality check
foo() == {
'a': 1,
'b': 2,
'c': 3,
}
foo(1, 2, 3) == {
'a': 1,
'b': 2,
'c': 3,
}
| bar == {'a': 1, 'b': 2}
bar == {'a': 1, 'b': 2}
foo() == {'a': 1, 'b': 2, 'c': 3}
foo(1, 2, 3) == {'a': 1, 'b': 2, 'c': 3} |
class Solution:
def largestRectangleArea(self, heights: List[int]) -> int:
heights.append(0) # here to make sure stack pop off
stack = [-1]
ans = 0
for i in range(len(heights)):
while heights[i] < heights[stack[-1]]:
h = heights[stack.pop()]
... | class Solution:
def largest_rectangle_area(self, heights: List[int]) -> int:
heights.append(0)
stack = [-1]
ans = 0
for i in range(len(heights)):
while heights[i] < heights[stack[-1]]:
h = heights[stack.pop()]
w = i - stack[-1] - 1
... |
class TicTacToe:
def __init__(self):
self.cells = [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']
self.matrix = [self.cells[0:3], self.cells[3:6], self.cells[6:9]]
# Vertical lines list, to be divided in 3 inner lists:
self.v_lines = []
# Diagonal lines:
self.d1_line = ... | class Tictactoe:
def __init__(self):
self.cells = [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']
self.matrix = [self.cells[0:3], self.cells[3:6], self.cells[6:9]]
self.v_lines = []
self.d1_line = [self.matrix[0][0], self.matrix[1][1], self.matrix[2][2]]
self.d2_line = [self.m... |
#coding=utf-8
'''
Created on 2015-9-24
@author: Devuser
'''
class CITestingTaskPropertyNavBar(object):
'''
classdocs
'''
def __init__(self,request,**args):
self.request=request
self.ci_task=args['ci_task']
if args['property_nav_action'] == 'history':
self.result_ac... | """
Created on 2015-9-24
@author: Devuser
"""
class Citestingtaskpropertynavbar(object):
"""
classdocs
"""
def __init__(self, request, **args):
self.request = request
self.ci_task = args['ci_task']
if args['property_nav_action'] == 'history':
self.result_active = '... |
msg = str(input('Digite uma mensagem'))
n = 0
n = len(msg)
def escreva():
print('-'*n)
print(msg)
print('-'*n)
escreva()
| msg = str(input('Digite uma mensagem'))
n = 0
n = len(msg)
def escreva():
print('-' * n)
print(msg)
print('-' * n)
escreva() |
class UVWarpModifier:
axis_u = None
axis_v = None
bone_from = None
bone_to = None
center = None
object_from = None
object_to = None
uv_layer = None
vertex_group = None
| class Uvwarpmodifier:
axis_u = None
axis_v = None
bone_from = None
bone_to = None
center = None
object_from = None
object_to = None
uv_layer = None
vertex_group = None |
#
# Copyright Cloudlab URV 2020
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | _set = set
lithops_config = 'LITHOPS_CONFIG'
stream_stdout = 'STREAM_STDOUT'
redis_expiry_time = 'REDIS_EXPIRY_TIME'
redis_connection_type = 'REDIS_CONNECTION_TYPE'
_default_config = {LITHOPS_CONFIG: {}, STREAM_STDOUT: False, REDIS_EXPIRY_TIME: 300, REDIS_CONNECTION_TYPE: 'pubsubconn'}
_config = _DEFAULT_CONFIG
def se... |
'''
Vasya the Hipster
red blue socks
simple one
'''
socks = list(map(int, input().split(' ')))
socks.sort()
diff = socks[0]
left = socks[1]-socks[0]
same = left//2
#output format
s = str(diff) + ' ' + str(same)
print(s)
| """
Vasya the Hipster
red blue socks
simple one
"""
socks = list(map(int, input().split(' ')))
socks.sort()
diff = socks[0]
left = socks[1] - socks[0]
same = left // 2
s = str(diff) + ' ' + str(same)
print(s) |
def fun(a, b, c, d):
return a + b + c + d
def inc(a):
return a + 1
def add(a, b):
return a + b
| def fun(a, b, c, d):
return a + b + c + d
def inc(a):
return a + 1
def add(a, b):
return a + b |
x_arr = []
y_arr = []
for _ in range(3):
x, y = map(int, input().split())
x_arr.append(x)
y_arr.append(y)
for i in range(3):
if x_arr.count(x_arr[i]) == 1:
x4 = x_arr[i]
if y_arr.count(y_arr[i]) == 1:
y4 = y_arr[i]
print(f'{x4} {y4}') | x_arr = []
y_arr = []
for _ in range(3):
(x, y) = map(int, input().split())
x_arr.append(x)
y_arr.append(y)
for i in range(3):
if x_arr.count(x_arr[i]) == 1:
x4 = x_arr[i]
if y_arr.count(y_arr[i]) == 1:
y4 = y_arr[i]
print(f'{x4} {y4}') |
# Methods of Tuple in Python:
# Declaring tuple
tuple = (3, 4, 6, 8, 10, 1, 67)
# Code for printing the length of a tuple
tuple2 = ('Apple', 'Bannana', 'Kiwi')
print('length of tuple2 :', len(tuple2))
# Deleting the tuple
del tuple2
# Printing tuple till 2 index excluding 2
print('tuple[0:2]:', tuple[0:2])
# Disp... | tuple = (3, 4, 6, 8, 10, 1, 67)
tuple2 = ('Apple', 'Bannana', 'Kiwi')
print('length of tuple2 :', len(tuple2))
del tuple2
print('tuple[0:2]:', tuple[0:2])
print('tuple[::-1]:', tuple[::-1])
print('maximum element in tuple:', max(tuple))
print('minimum element in tuple:', min(tuple))
print('Number of times 7 repeated:',... |
encoded_bytes=bytes.fromhex("664B564276757A7274796D477A4D4C7A545057456D47575971566F75585A694F4F454B677771647053544E5452654C6F434C544F6E702E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2... | encoded_bytes = bytes.fromhex('664B564276757A7274796D477A4D4C7A545057456D47575971566F75585A694F4F454B677771647053544E5452654C6F434C544F6E702E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2... |
def solve(data):
result = 0
# Iterates through each value of the list and sums it to the result
for number in data:
result += number
# Returns result (total sum)
return result | def solve(data):
result = 0
for number in data:
result += number
return result |
A = int(input())
B = int(input())
PROD = A*B
print("PROD = " + str(PROD))
| a = int(input())
b = int(input())
prod = A * B
print('PROD = ' + str(PROD)) |
def towerOfHanoi(n, source, auxiliary, destination):
if n == 0:
return 0
# Move n-1 from source to auxiliary using destination
stepCnt1 = towerOfHanoi(n-1, source, destination, auxiliary)
# Move nth disc from source to destination
print(f"{n} {source} -> {destination}")
# move n-1 fro... | def tower_of_hanoi(n, source, auxiliary, destination):
if n == 0:
return 0
step_cnt1 = tower_of_hanoi(n - 1, source, destination, auxiliary)
print(f'{n} {source} -> {destination}')
step_cnt2 = tower_of_hanoi(n - 1, auxiliary, source, destination)
return 1 + stepCnt1 + stepCnt2
tower_of_hanoi... |
# Manas Dash
# 24th July 2020
# the usage of set and max function
# which number is repeated most number of time
numbers = [1, 3, 4, 6, 3, 7, 3, 8, 6, 5, 9, 5, 3, 6, 3, 2, 3]
max_repeated = max(set(numbers), key=numbers.count)
print(f"The number {max_repeated} is repeated maximum number of time in the given list")
... | numbers = [1, 3, 4, 6, 3, 7, 3, 8, 6, 5, 9, 5, 3, 6, 3, 2, 3]
max_repeated = max(set(numbers), key=numbers.count)
print(f'The number {max_repeated} is repeated maximum number of time in the given list') |
class ZileanBackuper(object):
def __init__(self):
self._machines = None
self._linked_databases = None
@classmethod
def backup_linked_databases(cls):
pass
@classmethod
def backup_database(cls, db):
pass
| class Zileanbackuper(object):
def __init__(self):
self._machines = None
self._linked_databases = None
@classmethod
def backup_linked_databases(cls):
pass
@classmethod
def backup_database(cls, db):
pass |
def test_content_create(api_client_authenticated):
response = api_client_authenticated.post(
"/content/",
json={
"title": "hello test",
"text": "this is just a test",
"published": True,
"tags": ["test", "hello"],
},
)
assert response.st... | def test_content_create(api_client_authenticated):
response = api_client_authenticated.post('/content/', json={'title': 'hello test', 'text': 'this is just a test', 'published': True, 'tags': ['test', 'hello']})
assert response.status_code == 200
result = response.json()
assert result['slug'] == 'hello-... |
[
[0.26982777, 0.20175242, 0.10614473, 0.17290444, 0.22056401],
[0.18268971, 0.2363915, 0.26958793, 0.29282782, 0.36225248],
[0.31735855, 0.30254544, 0.28661105, 0.33136132, 0.40489719],
[0.0, 0.0, 0.0, 0.0, 0.0],
[0.15203597, 0.32214688, 0.40445594, 0.45318467, 0.44650059],
[0.20070068, 0.31904... | [[0.26982777, 0.20175242, 0.10614473, 0.17290444, 0.22056401], [0.18268971, 0.2363915, 0.26958793, 0.29282782, 0.36225248], [0.31735855, 0.30254544, 0.28661105, 0.33136132, 0.40489719], [0.0, 0.0, 0.0, 0.0, 0.0], [0.15203597, 0.32214688, 0.40445594, 0.45318467, 0.44650059], [0.20070068, 0.31904263, 0.40822282, 0.487387... |
t=int(input())
for k in range(t):
n=int(input())
a=list(map(int,input().strip().split()))
stack=[]
res={}
for i in a:
res[i]=-1
for j in a:
if len(stack)==0:
stack.append(j)
else:
while len(stack)>0 and stack[-1]<j:
res[stack.pop()]... | t = int(input())
for k in range(t):
n = int(input())
a = list(map(int, input().strip().split()))
stack = []
res = {}
for i in a:
res[i] = -1
for j in a:
if len(stack) == 0:
stack.append(j)
else:
while len(stack) > 0 and stack[-1] < j:
... |
print(int('3') + 3)
print(float('3.2') + 3.5)
print(str(3) + '2')
| print(int('3') + 3)
print(float('3.2') + 3.5)
print(str(3) + '2') |
# Copyright 2019 Eficent Business and IT Consulting Services
# Copyright 2017-2018 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Purchase Stock Picking Return Invoicing",
"summary": "Add an option to refund returned pickings",
"version": "12.0.1.0.1",... | {'name': 'Purchase Stock Picking Return Invoicing', 'summary': 'Add an option to refund returned pickings', 'version': '12.0.1.0.1', 'category': 'Purchases', 'website': 'https://github.com/OCA/account-invoicing', 'author': 'Eficent,Tecnativa,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'installable': True, '... |
def get_regr_coeffs(X, y):
n = X.shape[0]
p = n*(X**2).sum() - X.sum()**2
a = ( n*(X*y).sum() - X.sum()*y.sum() ) / p
b = ( y.sum()*(X**2).sum() - X.sum()*(X*y).sum() ) / p
return a,b
| def get_regr_coeffs(X, y):
n = X.shape[0]
p = n * (X ** 2).sum() - X.sum() ** 2
a = (n * (X * y).sum() - X.sum() * y.sum()) / p
b = (y.sum() * (X ** 2).sum() - X.sum() * (X * y).sum()) / p
return (a, b) |
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def sumOfLeftLeaves(self, root: TreeNode) -> int:
if root is None:
return 0
layer = [root]
res = 0
whil... | class Treenode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def sum_of_left_leaves(self, root: TreeNode) -> int:
if root is None:
return 0
layer = [root]
res = 0
while layer:
node = laye... |
# Binary Search Tree (BST) Implementation
class BSTNode:
def __init__(selfNode, nodeData): # Node Structure
selfNode.nodeData = nodeData
selfNode.left = None
selfNode.right = None
selfNode.parent = None
# Insertion Operation
def insert(selfNode, node):
if selfNode.nod... | class Bstnode:
def __init__(selfNode, nodeData):
selfNode.nodeData = nodeData
selfNode.left = None
selfNode.right = None
selfNode.parent = None
def insert(selfNode, node):
if selfNode.nodeData > node.nodeData:
if selfNode.left is None:
selfNo... |
class Stack:
def __init__(self,size=None,limit=1000):
self.top_item = []
self.size = 0
self.limit = limit
def peek(self):
if not self.is_empty():
return self.value[-1]
else:
print("Stack is empty")
def push(self,value):
#print("Current... | class Stack:
def __init__(self, size=None, limit=1000):
self.top_item = []
self.size = 0
self.limit = limit
def peek(self):
if not self.is_empty():
return self.value[-1]
else:
print('Stack is empty')
def push(self, value):
if self.ha... |
with open("part1.txt", "r") as file:
checksum = 0
for row in file:
large, small = 0, 9999
for entry in row.split("\t"):
entry = int(entry)
if entry > large:
large = entry
if entry < small:
small = entry
checksum += larg... | with open('part1.txt', 'r') as file:
checksum = 0
for row in file:
(large, small) = (0, 9999)
for entry in row.split('\t'):
entry = int(entry)
if entry > large:
large = entry
if entry < small:
small = entry
checksum += l... |
# BUILD FILE SYNTAX: SKYLARK
SE_VERSION = '3.141.59-atlassian-1'
| se_version = '3.141.59-atlassian-1' |
# Python translation of QuadTree from Risk.Platform.Standard
class QuadTree(object): # in decimal degrees dist from centroid to edge
def __init__(self, latDim, longDim, minLatCentroid, minLongCentroid, baseSize):
self.__longDim = longDim
self.__latDim = latDim
self.__minLong = minLongCent... | class Quadtree(object):
def __init__(self, latDim, longDim, minLatCentroid, minLongCentroid, baseSize):
self.__longDim = longDim
self.__latDim = latDim
self.__minLong = minLongCentroid
self.__baseSize = baseSize
self.__minLat = minLatCentroid
self.__baseGrid = [[quad... |
def length(t1, n):
t2=t1*n
l=len(t2)
print("Tuple {} has length: {}", t2, l)
length(('1',(5,3)),2)
#Tuple {} length: ('1',(5,3)'1',(5,3)) 4
#note: here .format is missing
def length(t1, n):
t2=t1*n
l=len(t2)
print("Tuple {} has length: {}". format(t2, l))
length(('1',(5,3)),2)
... | def length(t1, n):
t2 = t1 * n
l = len(t2)
print('Tuple {} has length: {}', t2, l)
length(('1', (5, 3)), 2)
def length(t1, n):
t2 = t1 * n
l = len(t2)
print('Tuple {} has length: {}'.format(t2, l))
length(('1', (5, 3)), 2) |
__author__ = 'Igor Davydenko <playpauseandstop@gmail.com>'
__description__ = 'Flask-Dropbox test project'
__license__ = 'BSD License'
__version__ = '0.3'
| __author__ = 'Igor Davydenko <playpauseandstop@gmail.com>'
__description__ = 'Flask-Dropbox test project'
__license__ = 'BSD License'
__version__ = '0.3' |
# @dependency 001-main/002-createrepository.py
SHA1 = "66f25ae79dcc5e200b136388771b5924a1b5ae56"
with repository.workcopy() as work:
REMOTE_URL = instance.repository_url("alice")
work.run(["checkout", "-b", "008-branch", SHA1])
work.run(["rebase", "--force-rebase", "HEAD~5"])
work.run(["push", REMOTE... | sha1 = '66f25ae79dcc5e200b136388771b5924a1b5ae56'
with repository.workcopy() as work:
remote_url = instance.repository_url('alice')
work.run(['checkout', '-b', '008-branch', SHA1])
work.run(['rebase', '--force-rebase', 'HEAD~5'])
work.run(['push', REMOTE_URL, '008-branch'])
sha1 = work.run(['rev-par... |
# ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: h5part.py
#
# Programmer: Gunther Weber
# Date: January, 2009
#
# Modifications:
# Mark C. Miller, Wed Jan 21 09:36:13 PST 2009
# Took Gunther's original code and integrated it with test ... | required_database_plugin('H5Part')
turn_off_all_annotations()
open_database(data_path('h5part_test_data/sample.h5part'), 0)
add_plot('Pseudocolor', 'GaussianField', 1, 0)
draw_plots()
test('h5part_01')
change_active_plots_var('LinearField')
view3_d_atts = get_view3_d()
View3DAtts.viewNormal = (1.0, 0.0, 0.0)
View3DAtts... |
def artist():
return "The Hardkiss"
def genre():
return "Pop"
def year():
return 2014
def restrictedContent():
return False
def forGeneralAudiences():
return True
| def artist():
return 'The Hardkiss'
def genre():
return 'Pop'
def year():
return 2014
def restricted_content():
return False
def for_general_audiences():
return True |
# -*- mode: python; -*-
# Return the pathname of the calling package.
# (This is used to recover the directory name to pass to cc -I<dir>, when
# choosing from among alternative header files for different platforms.)
def pkg_path_name():
return "./" + Label(REPOSITORY_NAME + "//" + PACKAGE_NAME +
... | def pkg_path_name():
return './' + label(REPOSITORY_NAME + '//' + PACKAGE_NAME + ':nsync').workspace_root + '/' + PACKAGE_NAME |
# Play = 'play'
# Pass = 'pass'
Draw = 'draw'
Discard = 'discard'
TutorDeck = 'tutor_deck'
TutorDiscard = 'tutor_discard'
Create = 'create'
Shuffle = 'shuffle'
Mill = 'mill'
Top = 'top'
# Resolve = 'resolve'
# Win = 'win'
# Lose = 'lose'
# Tie = 'tie'
#
# Build = 'build'
# Inspire = 'inspire'
# Nourish = 'nourish'
#
#... | draw = 'draw'
discard = 'discard'
tutor_deck = 'tutor_deck'
tutor_discard = 'tutor_discard'
create = 'create'
shuffle = 'shuffle'
mill = 'mill'
top = 'top' |
def Fibonacci_Tail(n, acc0= 0, acc1= 1):
# Base-Case(s): F(0) = 0, F(1) = 1
if(n == 0):
return acc0
if(n == 1):
return acc1
# Recursion
return Fibonacci_Tail(n-1, acc1, acc1+acc0)
n = 0
while(n <= 10):
get = Fibonacci_Tail(n)
print(f"Fibonacci({n}) = {get}")
... | def fibonacci__tail(n, acc0=0, acc1=1):
if n == 0:
return acc0
if n == 1:
return acc1
return fibonacci__tail(n - 1, acc1, acc1 + acc0)
n = 0
while n <= 10:
get = fibonacci__tail(n)
print(f'Fibonacci({n}) = {get}')
n = n + 1 |
#
# PySNMP MIB module Juniper-Notification-Log-CONF (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-Notification-Log-CONF
# Produced by pysmi-0.3.4 at Mon Apr 29 19:52:48 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python ve... | (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_intersection, constraints_union, value_range_constraint, value_size_constraint) ... |
# pylint: skip-file
#- @A defines/binding ClassA
#- @object ref vname("module.object", _, _, "pytd:__builtin__", _)
#- ClassA.node/kind class
class A(object):
pass
#- @B defines/binding ClassB
#- @A ref ClassA
#- ClassB.node/kind class
class B(A):
pass
#- @Foo defines/binding ClassFoo
#- @A ref ClassA
#- @B re... | class A(object):
pass
class B(A):
pass
class Foo(A, B):
pass |
## A note on unneecssary complexity
# We have gone through a few different standards on naming Julia's build artifacts.
# The latest, as of this writing, is the `sf/consistent_distnames` branch on github,
# and simplifies things relative to earlier versions. However, this buildbot needs
# to be able to build/upload Ju... | @util.renderer
def make_julia_version_command(props_obj):
command = ['usr/bin/julia', '-e', 'println("$(VERSION.major).$(VERSION.minor).$(VERSION.patch)\\n$(Base.GIT_VERSION_INFO.commit[1:10])")']
if is_windows(props_obj):
command[0] += '.exe'
return command
def parse_julia_version(return_code, std... |
try:
num = float(input("Enter a number : "))
def real_nums(x):
if x > 0:
return "The number is POSITIVE"
elif x == 0:
return "The number is ZERO"
elif x < 0:
return "The number is NEGATIVE"
else:
return "Enter a valid numb... | try:
num = float(input('Enter a number : '))
def real_nums(x):
if x > 0:
return 'The number is POSITIVE'
elif x == 0:
return 'The number is ZERO'
elif x < 0:
return 'The number is NEGATIVE'
else:
return 'Enter a valid number!'
... |
#Finding number of hansu which is under n
def number_of_hansu(n):
out = 0
digit_difference = 0
for i in range(1, n + 1):
#Number under 100 is always hansu
if i < 100:
out += 1
else:
#First digit difference
digit_difference = digits(i)[1] - digits... | def number_of_hansu(n):
out = 0
digit_difference = 0
for i in range(1, n + 1):
if i < 100:
out += 1
else:
digit_difference = digits(i)[1] - digits(i)[0]
for j in range(len(digits(i)) - 1):
if digits(i)[j + 1] - digits(i)[j] != digit_differe... |
criteria = [
{
'name': 'Price',
'inc': "Two thousand dollars is a lot of Ramen.",
'just': "A high price tag will be a deal breaker no matter what."
},
{
'name': 'User Rating',
'inc': "User ratings indicate reliability and general satisfaction of previous customers.",
... | criteria = [{'name': 'Price', 'inc': 'Two thousand dollars is a lot of Ramen.', 'just': 'A high price tag will be a deal breaker no matter what.'}, {'name': 'User Rating', 'inc': 'User ratings indicate reliability and general satisfaction of previous customers.', 'just': 'This is the only way to determine quality witho... |
#
# PySNMP MIB module A3COM-HUAWEI-DNS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-HUAWEI-DNS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 16:49:29 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... | (h3c_common,) = mibBuilder.importSymbols('A3COM-HUAWEI-OID-MIB', 'h3cCommon')
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, value_size_constrain... |
DEBUG = False
PORT = 8080
PROPAGATE_EXCEPTIONS = True
SQLALCHEMY_ECHO = False
SQLALCHEMY_DATABASE_URI = ""
SQLALCHEMY_POOL_SIZE = 15
| debug = False
port = 8080
propagate_exceptions = True
sqlalchemy_echo = False
sqlalchemy_database_uri = ''
sqlalchemy_pool_size = 15 |
class Workpiece:
def __init__(self, id):
self.id = id
# self.status = "awaiting production"
self.status = "awaiting next step"
self.actual_quality = None
self.source = None
self.sink = None
self.location = "wc_0" # Starting point. Location refers to workcell... | class Workpiece:
def __init__(self, id):
self.id = id
self.status = 'awaiting next step'
self.actual_quality = None
self.source = None
self.sink = None
self.location = 'wc_0'
self.step_idx = None
self.pos = None
self.count_down = 0 |
def add_filters_to_legend():
pass
def extend_data_from_recs():
pass
def find_errors():
'''find errors such as restricted works, etc. where data needs to be entered manually'''
pass
| def add_filters_to_legend():
pass
def extend_data_from_recs():
pass
def find_errors():
"""find errors such as restricted works, etc. where data needs to be entered manually"""
pass |
QWERTY_KEYMAP = bytearray.fromhex('000000000000000000000000760f00d4ffffffc7000000782c1e3420212224342627252e362d3738271e1f202122232425263333362e37381f0405060708090a0b0c0d0e0f101112131415161718191a1b1c1d2f3130232d350405060708090a0b0c0d0e0f101112131415161718191a1b1c1d2f313035')
print(QWERTY_KEYMAP)
print(type(QWERTY_KEY... | qwerty_keymap = bytearray.fromhex('000000000000000000000000760f00d4ffffffc7000000782c1e3420212224342627252e362d3738271e1f202122232425263333362e37381f0405060708090a0b0c0d0e0f101112131415161718191a1b1c1d2f3130232d350405060708090a0b0c0d0e0f101112131415161718191a1b1c1d2f313035')
print(QWERTY_KEYMAP)
print(type(QWERTY_KEYMA... |
# MIT License
#
# Copyright (c) [2018] [Victor Manuel Cajes Gonzalez - vcajes@gmail.com]
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation th... | environment_sandbox = 'sandbox'
environment_production = 'production'
bancard_allowed_currencies = ['PYG']
bancard_base_url_sandbox = 'https://vpos.infonet.com.py:8888'
bancard_base_url_production = 'https://vpos.infonet.com.py'
rollback_key = 'rollback'
charge_token_generator_key = 'single_buy'
payment_web_url_key = '... |
def printadj(table,g):
print(" ",end="")
print(" ".join(table))
for i in table:
strout = ""
print(i,end=" : ")
for j in table:
l = g.get(i,None)
if not l :
strout+="0, "
elif j in l:
strout+="1, "
els... | def printadj(table, g):
print(' ', end='')
print(' '.join(table))
for i in table:
strout = ''
print(i, end=' : ')
for j in table:
l = g.get(i, None)
if not l:
strout += '0, '
elif j in l:
strout += '1, '
... |
class Solution:
def twoSum(self, nums, target):
for n in nums:
print("n = {}".format(n))
indexN = nums.index(n)
print("indexN = {}".format(indexN))
for p in nums[1:]:
print("p = {}".format(p))
indexP = nums.index(p)
print("indexP = {}".format(indexP))
if inde... | class Solution:
def two_sum(self, nums, target):
for n in nums:
print('n = {}'.format(n))
index_n = nums.index(n)
print('indexN = {}'.format(indexN))
for p in nums[1:]:
print('p = {}'.format(p))
index_p = nums.index(p)
... |
'''
Binary Seach works on only sorted collection.
Time : O(log n)
Space : O(1)
'''
def binarySearch(arr, target):
left = 0
right = len(arr)-1
while(left <= right):
mid = (left + right) // 2
if(arr[mid] == target):
return mid
#if target is greater th... | """
Binary Seach works on only sorted collection.
Time : O(log n)
Space : O(1)
"""
def binary_search(arr, target):
left = 0
right = len(arr) - 1
while left <= right:
mid = (left + right) // 2
if arr[mid] == target:
return mid
elif arr[mid] < target:
... |
t=int(input())
for qwerty in range(t):
#n,a,b,c=input().split()
#n,a,b,c=int(n),int(a),int(b),int(c)
#n=int(input())
arr1=list(map(int,input().split()))
arr2=list(map(int,input().split()))
n1,n2=len(arr1),len(arr2)
arr3=[]
i=0
j... | t = int(input())
for qwerty in range(t):
arr1 = list(map(int, input().split()))
arr2 = list(map(int, input().split()))
(n1, n2) = (len(arr1), len(arr2))
arr3 = []
i = 0
j = 0
k = 0
while i < n1 and j < n2:
if arr1[i] < arr2[j]:
arr3.append(arr1[i])
i += 1
... |
expected_output ={
"vrf": {
"tn-L2-PBR:vrf-L2-PBR": {
"address_family": {
"ipv4": {
"routes": {
"192.168.1.0/24": {
"route": "192.168.1.0/24",
"active": True,
... | expected_output = {'vrf': {'tn-L2-PBR:vrf-L2-PBR': {'address_family': {'ipv4': {'routes': {'192.168.1.0/24': {'route': '192.168.1.0/24', 'active': True, 'ubest': 1, 'mbest': 0, 'attached': True, 'direct': True, 'pervasive': True, 'metric': 0, 'route_preference': 1, 'tag': 4294967294, 'next_hop': {'next_hop_list': {1: {... |
'''
Fixed XOR
Write a function that takes two equal-length buffers and produces their XOR combination.
If your function works properly, then when you feed it the string:
1c0111001f010100061a024b53535009181c
... after hex decoding, and when XOR'd against:
686974207468652062756c6c277320657965
... should produce:
7468... | """
Fixed XOR
Write a function that takes two equal-length buffers and produces their XOR combination.
If your function works properly, then when you feed it the string:
1c0111001f010100061a024b53535009181c
... after hex decoding, and when XOR'd against:
686974207468652062756c6c277320657965
... should produce:
7468... |
CAPACITY = 100
class Heap:
def __init__(self):
self.heap_size = 0
self.heap = [0]*CAPACITY
def insert(self, item):
if self.heap_size == CAPACITY:
return
self.heap[self.heap_size] = item
self.heap_size = self.heap_size + 1
self.fix_up(self.heap_si... | capacity = 100
class Heap:
def __init__(self):
self.heap_size = 0
self.heap = [0] * CAPACITY
def insert(self, item):
if self.heap_size == CAPACITY:
return
self.heap[self.heap_size] = item
self.heap_size = self.heap_size + 1
self.fix_up(self.heap_siz... |
def HI():
print("=======================================")
print("= = = =")
print("= = =")
print("= ====== = =")
print("= = = = =")
print("= = = = =")
p... | def hi():
print('=======================================')
print('= = = =')
print('= = =')
print('= ====== = =')
print('= = = = =')
print('= = = = ... |
def makeminutes(time):
h, m = time.split(':')
return int(h)*60+int(m)
def check_buses(n, m, lines):
cntbuses = [0]*(n+1)
busbalance = [0]*(n+1)
events = []
overnight = 0
for line in lines:
cdep, deptime, carr, arrtime = line.split()
cdep = int(cdep)
carr = int(carr)... | def makeminutes(time):
(h, m) = time.split(':')
return int(h) * 60 + int(m)
def check_buses(n, m, lines):
cntbuses = [0] * (n + 1)
busbalance = [0] * (n + 1)
events = []
overnight = 0
for line in lines:
(cdep, deptime, carr, arrtime) = line.split()
cdep = int(cdep)
c... |
#!/usr/bin/env python
class DataProcessingException(Exception):
pass
| class Dataprocessingexception(Exception):
pass |
class Solution:
def distinctSubseqII(self, S):
res, end = 0, collections.Counter()
for c in S:
res, end[c] = res * 2 + 1 - end[c], res + 1
return res % (10**9 + 7) | class Solution:
def distinct_subseq_ii(self, S):
(res, end) = (0, collections.Counter())
for c in S:
(res, end[c]) = (res * 2 + 1 - end[c], res + 1)
return res % (10 ** 9 + 7) |
inter_,gremio_ = input().split()
inter = int(inter_)
gremio = int(gremio_)
a = 0
contador = 1
v_inter = 0
v_gremio = 0
empate = 0
if inter > gremio:
v_inter += 1
elif inter == gremio:
empate += 1
else:
v_gremio += 1
while a == 0:
print("Novo grenal (1-sim 2-nao)")
cond = int(input())
if co... | (inter_, gremio_) = input().split()
inter = int(inter_)
gremio = int(gremio_)
a = 0
contador = 1
v_inter = 0
v_gremio = 0
empate = 0
if inter > gremio:
v_inter += 1
elif inter == gremio:
empate += 1
else:
v_gremio += 1
while a == 0:
print('Novo grenal (1-sim 2-nao)')
cond = int(input())
if cond ... |
valor1 = float(input("Digite o primeiro valor: "))
dobro = valor1 *2
triplo = valor1 *3
raiz = valor1 **0.5
print("O dobro {} o triplo {} e a raiz quadrada {}".format(dobro,triplo,raiz)) | valor1 = float(input('Digite o primeiro valor: '))
dobro = valor1 * 2
triplo = valor1 * 3
raiz = valor1 ** 0.5
print('O dobro {} o triplo {} e a raiz quadrada {}'.format(dobro, triplo, raiz)) |
#!/usr/bin/env python
#-----------------------------------------------------------------------
# tag.py
# Author: Olivia Zhang, Zoe Barnswell, Lyra Katzman
#-----------------------------------------------------------------------
#-----------------------------------------------------------------------
class Tag:
... | class Tag:
def __init__(self, tagID):
self.tagID = tagID
self.numArticles = 0 |
TARGET_URL = '/{tail:.*}'
EXCLUDED_HEADERS = {
# 'Accept-CH',
# 'Accept-CH-Lifetime',
# 'Cache-Control',
# 'Content-Encoding',
# 'Content-Security-Policy',
# 'Content-Type',
# 'Date',
# 'Expires',
# 'Last-Modified',
# 'P3P',
# 'Set-Cookie',
'Transfer-Encoding',
'X-Tar... | target_url = '/{tail:.*}'
excluded_headers = {'Transfer-Encoding', 'X-Target-Url', 'Content-Length'} |
# author: alex o
def counting_sort_int(array, base, col):
# initialise count array
count_array = [0]*base
# get the digit in position column and add them into "buckets"
for elem in array:
digit = elem // 10 ** (col)
count_array[digit % base] += 1
# initialise position array
po... | def counting_sort_int(array, base, col):
count_array = [0] * base
for elem in array:
digit = elem // 10 ** col
count_array[digit % base] += 1
position = [0] * base
position[0] = 1
for i in range(1, base):
position[i] = position[i - 1] + count_array[i - 1]
output = [0] * l... |
a = []
b = []
c = a
a.append(1)
b.append(2)
c.append(3)
print(f'{a=}, {b=}, {c=}')
#print(a is c)
| a = []
b = []
c = a
a.append(1)
b.append(2)
c.append(3)
print(f'a={a!r}, b={b!r}, c={c!r}') |
class Element:
mass = 0.0
def __init__(self, params):
self.mass = params["mass"]
def molar_mass_kilograms(self):
return self.mass / 1000
hydrogen = Element({"mass": 1.00794})
| class Element:
mass = 0.0
def __init__(self, params):
self.mass = params['mass']
def molar_mass_kilograms(self):
return self.mass / 1000
hydrogen = element({'mass': 1.00794}) |
# Here I will attempt to count the occurences of a kmer in a patter
def count_kmer(kmer, pattern):
num_matches = 0
for num, _ in enumerate(kmer):
window = kmer[num: (num+len(pattern))]
if window == pattern:
num_matches = num_matches + 1
return num_matches
count_kme... | def count_kmer(kmer, pattern):
num_matches = 0
for (num, _) in enumerate(kmer):
window = kmer[num:num + len(pattern)]
if window == pattern:
num_matches = num_matches + 1
return num_matches
count_kmer('ACAACTATGCATACTATCGGGAACTATCCT', 'ACTAT')
kmer_to_match = 'GGAGGATTCTCCTGAAAAGG... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
#Filename: range.py
for i in [0, 1, 2, 3, 4, 5]:
print (i ** 2)
# >>> 0
# 1
# 4
# 9
# 16
# 25
for i in range(6):
print (i ** 2)
| for i in [0, 1, 2, 3, 4, 5]:
print(i ** 2)
for i in range(6):
print(i ** 2) |
if __name__ == '__main__':
n = int(input())
arr = list(map(int, input().split()))
f = arr[0]
p = -100000
for i in arr:
if i>f:
p=f
f=i;
elif i<f and i>p:
p=i
print(p)
| if __name__ == '__main__':
n = int(input())
arr = list(map(int, input().split()))
f = arr[0]
p = -100000
for i in arr:
if i > f:
p = f
f = i
elif i < f and i > p:
p = i
print(p) |
load(
"//scala:scala_cross_version.bzl",
_default_maven_server_urls = "default_maven_server_urls",
)
load("//third_party/repositories:repositories.bzl", "repositories")
def junit_repositories(
maven_servers = _default_maven_server_urls(),
fetch_sources = True):
repositories(
for_art... | load('//scala:scala_cross_version.bzl', _default_maven_server_urls='default_maven_server_urls')
load('//third_party/repositories:repositories.bzl', 'repositories')
def junit_repositories(maven_servers=_default_maven_server_urls(), fetch_sources=True):
repositories(for_artifact_ids=['io_bazel_rules_scala_junit_juni... |
class DynamicalSystem:
def __init__(self, a1, b1, c1, alpha1, beta1, a2, b2, c2, alpha2, beta2):
self.a1 = a1
self.b1 = b1
self.c1 = c1
self.alpha1 = alpha1
self.beta1 = beta1
self.a2 = a2
self.b2 = b2
self.c2 = c2
self.alpha2 = alpha2
... | class Dynamicalsystem:
def __init__(self, a1, b1, c1, alpha1, beta1, a2, b2, c2, alpha2, beta2):
self.a1 = a1
self.b1 = b1
self.c1 = c1
self.alpha1 = alpha1
self.beta1 = beta1
self.a2 = a2
self.b2 = b2
self.c2 = c2
self.alpha2 = alpha2
... |
#WAP to read two numbers from the keyboard and display the larger one on the screen.
num1 = input("enter the number one")
num2 = input("enter the number two")
if(num1>num2):
largest = num1
print("number is ", largest)
else:
largest = num2
print("number is ",largest)
| num1 = input('enter the number one')
num2 = input('enter the number two')
if num1 > num2:
largest = num1
print('number is ', largest)
else:
largest = num2
print('number is ', largest) |
__all__ = [
"bgl_preprocessor",
"open_source_logs",
]
| __all__ = ['bgl_preprocessor', 'open_source_logs'] |
def minesweeper(matrix):
row = len(matrix)
col = len(matrix[0])
def neighbouring_squares(i, j):
return sum(
matrix[x][y]
for x in range(i - 1, i + 2)
if 0 <= x < row
for y in range(j - 1, j + 2)
if 0 <= y < col
if i != x or j !... | def minesweeper(matrix):
row = len(matrix)
col = len(matrix[0])
def neighbouring_squares(i, j):
return sum((matrix[x][y] for x in range(i - 1, i + 2) if 0 <= x < row for y in range(j - 1, j + 2) if 0 <= y < col if i != x or j != y))
return [[neighbouring_squares(i, j) for j in range(col)] for i... |
ASSEMBLY_HUMAN = "Homo_sapiens.GRCh38.104"
ASSEMBLY_MOUSE = "Mus_musculus.GRCm39.104"
CELLTYPES = ["adventitial cell", "endothelial cell", "acinar cell", "pancreatic PP cell", "type B pancreatic cell"]
CL_VERSION = "v2021-08-10"
| assembly_human = 'Homo_sapiens.GRCh38.104'
assembly_mouse = 'Mus_musculus.GRCm39.104'
celltypes = ['adventitial cell', 'endothelial cell', 'acinar cell', 'pancreatic PP cell', 'type B pancreatic cell']
cl_version = 'v2021-08-10' |
CONFIG_DIR = '__config__'
DATA_ROOT_DIR = '__data__'
RESULTS_ROOT_DIR = '__results__'
TB_DIR = '__runs__'
WEIGHTS_DIR = '__weights__'
NOISE_ROOT_DIR = "__noise__"
| config_dir = '__config__'
data_root_dir = '__data__'
results_root_dir = '__results__'
tb_dir = '__runs__'
weights_dir = '__weights__'
noise_root_dir = '__noise__' |
# Map source standard name to command code
# Note that the source names may be aliased in the device
# The names that come back from the device in a feedback
# message are the aliases
ROTEL_RSP1570_SOURCES = {
" CD": "SOURCE_CD",
"TUNER": "SOURCE_TUNER",
"TAPE": "SOURCE_TAPE",
"VIDEO 1": "SOURCE_VIDEO_1... | rotel_rsp1570_sources = {' CD': 'SOURCE_CD', 'TUNER': 'SOURCE_TUNER', 'TAPE': 'SOURCE_TAPE', 'VIDEO 1': 'SOURCE_VIDEO_1', 'VIDEO 2': 'SOURCE_VIDEO_2', 'VIDEO 3': 'SOURCE_VIDEO_3', 'VIDEO 4': 'SOURCE_VIDEO_4', 'VIDEO 5': 'SOURCE_VIDEO_5', 'MULTI': 'SOURCE_MULTI_INPUT'} |
# Copyright 2016 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.
DEPS = [
'chromium',
'depot_tools/bot_update',
'depot_tools/gclient',
'file',
'gsutil',
'recipe_engine/path',
'recipe_engine/prop... | deps = ['chromium', 'depot_tools/bot_update', 'depot_tools/gclient', 'file', 'gsutil', 'recipe_engine/path', 'recipe_engine/properties', 'recipe_engine/python', 'recipe_engine/raw_io', 'recipe_engine/step']
def linux_builder_steps(api):
build_properties = api.properties.legacy()
src_cfg = api.gclient.make_conf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.