content stringlengths 7 1.05M |
|---|
CSS_BUNDLES = {
'common': (
'css/normalize.css',
'less/style.less',
),
'profile': (
'less/profile.less',
)
}
JS_BUNDLES = {
'common': (
'js/standup.js',
)
}
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
def singleton(cls, *args, **kwargs):
"""单例模式装饰器
参数:
cls: 类的对象
*args, **kwargs: 需要带入的其他参数
"""
instances = {}
def __func(*args, **kwargs):
if cls not in instances:
instances[cls] = cls(*args, **kwargs)
retu... |
"""Initialize proj-template module."""
# __version__ should be updated only by utils/release
__version__ = "0.2.1"
|
#
# PySNMP MIB module BIANCA-BRICK-TDRC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BIANCA-BRICK-TDRC-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:38:47 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... |
[
[
1.00000000e00,
9.50744855e-01,
7.61580875e-01,
1.45494511e-03,
1.35271514e-04,
2.75262668e-03,
9.40575477e-01,
4.90755141e-01,
3.16822332e-03,
6.38672254e-01,
3.44275537e-05,
],
[
1.00000000e00,
2.345... |
# © https://sudipghimire.com.np
# %% [markdown]
"""
Nested Loops
- Nested loops are loops inside loops
"""
# %% nested loop basic syntax
lang = {
'low level': ['Machine Level', 'Assembly'],
'high level': ['C++', 'Java', 'Python']
}
for lang_type in lang:
for lng in lang[lang_type]:
print(f'The {lan... |
"""AI Engines
Here is a set of AI- and ML-patterns for adavanced research of business data.
"""
|
def solution(s):
answer = True
tmp = ''
li = []
for c in s:
if c == '(':
li.append(c)
else:
if len(li) == 0:
return False
tmp = li.pop()
if tmp == '':
return False
return len(li) == 0
|
# Copyright (c) 2020-2021 Matematyka dla Ciekawych Świata (http://ciekawi.icm.edu.pl/)
# Copyright (c) 2020-2021 Robert Ryszard Paciorek <rrp@opcode.eu.org>
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Soft... |
# Created by MechAviv
# Violetta's Charming Damage Skin | (2433251)
if sm.addDamageSkin(2433251):
sm.chat("'Violetta's Charming Damage Skin' Damage Skin has been added to your account's damage skin collection.")
sm.consumeItem() |
class MultiVariateTrainer:
def __init__(self, trainers):
self._trainers = trainers
def fit(self, parameters, values):
for n, trainer in enumerate(self._trainers):
trainer.fit(parameters, values[:,n])
@property
def models(self):
return [trainer.model for trainer in ... |
def addTwoNumbers(a, b):
return a + b
firstNumber = input("What is the first number?")
secondNumber = input("What is the second number?")
result = addTwoNumbers(firstNumber, secondNumber)
print(result) # Why are the two numbers not added correctly?
# Example of type casting
result = addTwoNumbers(int(firstNumber... |
# Copyright 2014 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.
# A top level slice of a presentation.main thread can cause the webapp to behave
# unresponsively if its thread duration is greater than or equals to
# USER... |
"""
binclf clfviz
==================================
Utils library to visualize decision trees.
Author: Casokaks (https://github.com/Casokaks/)
Created on: Nov 1st 2018
"""
def xgb_visualize(clf, tree_idx=0, with_stats=False, dump_format='text'):
booster = clf.get_booster()
dumps = booster.get... |
subnet_create_payload = {
"nickname": "Test Python Subnet"
}
subnet_update_payload = {
"allowed": "LOCKED"
}
|
def rev_order(s: str):
return ' '.join(s.split(' ')[::-1])
def test1():
print(rev_order('Technical Interview Preparation')
== 'Preparation Interview Technical')
def main():
test1()
if __name__ == '__main__':
main()
|
#Ahmed Mousa: 201601381
#Eman Adel: 201902302
#These functions are for taking file names, reading, writing, and closing files
def inputfile():
return input('Enter input file name: ')
def openinput(x):
return open(x, 'r')
def readinput(x):
return x.read()
def outputfile():
return input('Enter o... |
#!/usr/bin/env python2
def xutf8len(x):
if x < 0x80: return 1
if x < 0x800: return 2
if x < 0x10000: return 3
if x < 0x200000: return 4
if x < 0x4000000: return 5
if x < 0x80000000: return 6
return 7
def enci32(x):
if x >= 0: return x
return (-x) * 2 + 1
def skipadjust(x):
if ... |
#!/usr/bin/env python3
# these are the last few bytes of the file
o = [int(x, 16) for x in '70 69 63 6f 43 54 4b 80 6b 35 7a 73 69 64 36 71 5f 65 65 61 65 63 34 38 62 7d'.split(' ')]
flag = []
for i in range(5):
flag.append(o.pop(0))
for i in range(6, 0xf + 1):
flag.append(o.pop(0) - 5)
flag.append(o.pop(0... |
n = int(input())
for b in range(1, n+1, 3):
print(b)
|
__all__ = ['simulator', 'screen']
__version__ = '0.0' # See also below and setup.py
__revision__ = "$Id$"
# New software should look at this instead of at __version__ above.
version_info = (0, 0, 0, 'experimental', 0) # See also above and setup.py
|
def computepay(h,r):
if h <= 40:
return h * r
else:
return ((h-40) * (r * 1.5)) + (40 * r)
hrs = float(input("Enter Hours: "))
rs = float(input("Enter Rate: "))
p = computepay(hrs,rs)
print("Pay",p)
|
# 方法1
# 用O(n)的辅助数组
# def get_duplicate_num(l):
# l1 = [0 for _ in range(len(l))]
# for i in l:
# l1[i] += 1
# if l1[i] > 1:
# return i
# return False
# 方法2: 二分查找
def get_duplicate_num(l):
start = 1
end = len(l)-1
while start <= end:
middle = (end-start)/2 + ... |
'''Crie uma tupla preenchida com os 20 primeiros colocados na Tabela do Campeonato Brasileiro de Futebol,
na ordem de colocação. Depois mostre:
Apenas os 5 primeiros colocados.
b) Os últimos 4 colocados da tabela;
c)Uma lista com os times em ordem alfabética
d) Em que posição da tabela está o time da Chapecoense'''
br... |
# 374. Guess Number Higher or Lower
# ttungl@gmail.com
# The guess API is already defined for you.
# @param num, your guess
# @return -1 if my number is lower, 1 if my number is higher, otherwise return 0
# def guess(num):
class Solution(object):
def guessNumber(self, n):
"""
:type n: int
... |
N = int(input())
A = list(map(int, input().split()))
ans = [0] * N
for i in A:
ans[i - 1] += 1
for i in ans:
print(i)
|
def leiaint(msg='', min=-100, max=100):
while True:
valor = str(input(msg))
if valor.isnumeric():
valor = int(valor)
if min <= valor <= max:
break
else:
print('\033[1;31mERRO! Digite um valor válido.\033[m')
else:
... |
FILE_TYPE_OPTIONS = {}
USAGE_RIGHT_OPTIONS = {}
ASPECT_RATIO_OPTIONS = {'tall': 't', 'square': 's', 'wide': 'w',
'panoramic': 'xw'}
IMAGE_SIZE_OPTIONS = {'any': '', 'icon': 'i', 'medium': 'm', 'large': 'l',
'exactly': 'ex', '400x300+': 'qsvga', '640x480+': 'vga',
... |
# Exibindo tamanho da lista nomes_paises
nomes_paises = ['Brasil', 'Argentina', 'China', 'Canadá', 'Japão']
tamanho_nomes_paises = len(nomes_paises)
print(len(nomes_paises))
print(type(len(nomes_paises)))
|
def cipher(text, shift, encrypt=True):
"""
Encrypts and decrypts words written using a Caesar cipher, which replaces a letter with
another letter a given number of places away in the alphabet.
Parameters
----------
text : String
The String that should be processed in the function
sh... |
d={}
while True:
s=input().split()
if s == ["-1"]:
break
else:
id,subject=s[0],s[1:]
for sub in subject:
if sub not in d:
d[sub]={id}
else:
d[sub].add(id)
class1,class2=input().split()
if (class1 in d) and (class2 in d):
two... |
class Solution:
# @param A : list of integers
# @param B : integer
# @return an integer
def solve(self, A, B):
n = len(A)
left = 0
right = n - 1
count = 0
while (left <= right):
mid = int((right + left) / 2)
# Check if middle element is ... |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def mergeInBetween(self, list1: ListNode, a: int, b: int, list2: ListNode) -> ListNode:
fakeNode = ListNode()
fakeNode.next = list1
... |
# variável que armazena o número favorito
num1 = 7
# mostra mensagem com o número favorito
print(f'\nMeu número favorito é: {num1}\n')
|
'''
Given an array of integers arr, return true if and only if it is a valid mountain array.
Recall that arr is a mountain array if and only if:
arr.length >= 3
There exists some i with 0 < i < arr.length - 1 such that:
arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
Examp... |
# Choose the GNN architecture between "DeepSet", "GCN", "EdgeNet", "PointNet", "MetaNet"
#use_model = "DeepSet"
#use_model = "GCN"
use_model = "EdgeNet"
#use_model = "PointNet"
#use_model = "EdgePoint"
#use_model = "MetaNet"
# Learning rate
learning_rate = 0.0006303742576368124
# Weight decay
weight_decay = 1.991127... |
"""
"""
load("@bazel_skylib//rules:copy_file.bzl", _copy_file = "copy_file")
def path_concat(*args):
"""Concatenate a list of paths
Args:
*args: The paths to concatenate.
Returns:
A path that consists of the individual path segments but concatenated.
"""
path = ""
for arg in args... |
age = 22
# if age >= 18:
# message = "Eligible"
# else:
# message = "Not eligible"
message = "Eligible" if age >= 18 else "Not eligible"
print(message)
|
"""
Given an array of strings A[], determine if the strings can be chained together to form a circle.
A string X can be chained together with another string Y if the last character of X is same as first character of Y.
If every string of the array can be chained, it will form a circle.
For eg
for the array arr[] = {"f... |
# -*- encoding: utf-8 -*-
class ErrorCode:
"""Codigos de Denegación de Bancos.
- EXPIRED_CARD
Tarjeta vencida. La tarjeta está vencida o la fecha de vencimiento
ingresada es incorrecta.
- STOLEN_CARD
Tarjeta robada. La tarjeta fue bloqueada y reportada al banco emisor
como una tarj... |
"""
Exercise Python 076:
Crie um programa que tenha uma tupla única com nomes de produtos
e seus respectivos preços, na sequência.
No final, mostre uma listagem de preços, organizando os dados em forma tabular.
"""
priceList = ('pencil', 1.75, 'eraser', 2.00, 'pen', 1.00, 'notebook', 12.50)
print('-' * 50)
print('\t\... |
"""Given an integer n, return any array containing n unique integers such that they add up to 0.
Example 1:
Input: n = 5
Output: [-7,-1,1,3,4]
Explanation: These arrays also are accepted [-5,-1,1,2,3] , [-3,-1,2,-2,4]."""
n = 5
list = []
for i in range(1, (n // 2) + 1):
posi = i
neg = -1 * i
list.appe... |
def mult (x,y):
return (x*y)
def div (x,y):
return (x/y)
|
__author__ = 'Fule Liu'
PROTEIN = "ACDEFGHIKLMNPQRSTVWY"
DNA = "ACGT"
RNA = "ACGU"
didna_list = ['Base stacking', 'Protein induced deformability', 'B-DNA twist', 'Dinucleotide GC Content', 'A-philicity',
'Propeller twist', 'Duplex stability:(freeenergy)',
'Duplex tability(disruptenergy)', ... |
class Solution:
def XXX(self, a: str, b: str) -> str:
a, b = a[::-1], b[::-1]
if len(a) < len(b):
a, b = b, a
b += "0" * (len(a) - len(b))
res = ""
carrier = 0
for i, j in zip(a, b):
cur = (int(i) + int(j) + carrier) % 2
carrier = (... |
class Solution:
def numDistinct(self, s: str, t: str) -> int:
dp = []
dp.append([1] * (len(s) + 1))
for i in range(len(t)):
dp.append([0] * (len(s) + 1))
for i in range(1, len(t) + 1):
for j in range(1, len(s) + 1):
dp[i][j] = dp[i][j-... |
'''https://leetcode.com/problems/rotate-image/
48. Rotate Image
Medium
6773
413
Add to List
Share
You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).
You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate a... |
file=open("C:\\Users\minjie\Desktop\data_label.txt","r",encoding="utf-8")
file1=open("data_test.txt","w",encoding="utf-8")
sentence=""
label=""
sen=[]
lab=[]
text=[]
ignored_words=['!','\"','$','%','\'','(',')','*','+',',','.','..','@','#','&','?','/']
for line in file:
line=line.lower()
if(line[0]=='\"'):
... |
class Assembler:
def __init__(self, output_file):
self._output_file = output_file
def load_register_with_value(self, reg_index, reg_value):
opcode = 0x6000
opcode |= ((reg_index & 0xF) << 8)
opcode |= (reg_value & 0xFF)
self._write_opcode(opcode)
def load_font(self... |
flag = "rarctf{See,ThatWasn'tSoHard-1eb519ed}"
out = []
key = [0x13, 0x37]
for c in flag:
c = ord(c)
out.append((c ^ key[0]) + key[1])
key = key[::-1]
# print(', '.join([chr(c) for c in out]))
print(', '.join([hex(c) for c in out]))
|
'''
Statement
Given a two-digit integer, print its left digit (a tens digit) and then its right digit (a ones digit). Use the operator of integer division for obtaining the tens digit and the operator of taking remainder for obtaining the ones digit.
Example input
79
Example output
7 9
'''
num = int(input())
print(nu... |
class MergeEntry:
def __init__(self, log_entry):
self.sha1 = ''
self.action = ''
self.description = ''
self.issue = 0
def set_with(self, log_entry):
self.sha1 = log_entry[0:8]
def extract_substring_surrounded_by(self, char):
pass
|
rec={}
n=int(input("enter no. of students:"))
i=1
while i<=n:
name=input("enter student name:")
marks=input("enter % of marks of student:")
rec[name]=marks
i=i+1
print("name of students","\t","% of marks")
for x in rec:
print("\t",x,"\t\t",rec[x]) |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 18 14:50:56 2019
@author: ajand
"""
# Function to sort the words
# in ascending order
def sortedSentence(Sentence):
# Spliting the Sentence into words
words = Sentence.split(" ")
# Sorting the words
words.sort()
... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
'''
* @author: ashwek
* @date: 20/12/2018
'''
n = int(input("Enter limit : "))
for i in range(1, n+1):
output = ""
if i%3 == 0 :
output = "Fizz"
if i%5 == 0:
output += "Buzz"
if output :
print(output)
else:
print(i)
|
'''
@author: l4zyc0d3r
People who are happy makes other happy. I am gonna finish it slowly but definitely.cdt
'''
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def detectCycle(self, head: ListNode) -> ListNode:... |
#
# @lc app=leetcode.cn id=773 lang=python3
#
# [773] 滑动谜题
#
# https://leetcode-cn.com/problems/sliding-puzzle/description/
#
# algorithms
# Hard (54.38%)
# Likes: 33
# Dislikes: 0
# Total Accepted: 1.1K
# Total Submissions: 1.9K
# Testcase Example: '[[1,2,3],[4,0,5]]'
#
# 在一个 2 x 3 的板上(board)有 5 ... |
class Vocab:
def __init__(self, vocab_path):
self.word2id = dict()
self.id2word = list()
for ln in open(vocab_path):
wid, word, freq = ln.strip().split("\t")
self.word2id[word] = int(wid)
self.id2word.append(word)
if len(self.id2word) == 50... |
# Атрибутами класса могут быть и функции
# Класс, описывающий человека
class Person:
# Первый аргумент, который указывает на текущий экземпляр класса,
# принято называть self
def print_info(self):
print(self.name, 'is', self.age)
# Создание экземпляров класса
alex = Person()
alex.... |
print('== Estágio 1 ==')
peso1 = float(input('Peso? '))
nota1 = float(input('Nota? '))
print('== Estágio 2 ==')
peso2 = float(input('Peso? '))
nota2 = float(input('Nota? '))
print('== Estágio 3 ==')
peso3 = float(input('Peso? '))
nota3 = float(input('Nota? '))
media_parcial = (nota1 * peso1) + (nota2 * peso2) + ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 6 07:54:08 2018
@author: tuheenahmmed
"""
def calculateHandlen(hand):
"""
Returns the length (number of letters) in the current hand.
hand: dictionary (string-> int)
returns: integer
"""
length =0
for letter in ha... |
class MaxRetriesExceeded(Exception):
pass
class HTTPMethodNotFound(Exception):
pass
|
# Revisiting map
# • Map, zip, filter, reduce, etc. can all be implemented using recursion
# denna är knepig...
'''
def my_map(f, iterable):
try:
arg, *rest = iterable
except ValueError:
return []
result = my_map(f, rest)
return [f(arg), *result]
print(my_map(lambda x: x + 10, [1, 2, ... |
"""
Summary of ``hexagon_grid.py``
------------------------------
Text-based definition of a SQL function to create a hexagon grid overlay
"""
def sql_to_make_hex_grid(
extent_table: str,
epsg: int,
output_table_name: str,
size: float
):
"""
This function returns a string wit... |
test_list = ['NINE', 'Geeky', 'Computers', 'Algorithms']
print ("The original list is : " + str(test_list))
subs = 'ELEPHANTINE '
chars = set('NINE')
if any((c in chars) for c in test_list):
print('Found')
else:
print('Not Found')
|
#
# @lc app=leetcode.cn id=240 lang=python3
#
# [240] search-a-2d-matrix-ii
#
None
# @lc code=end |
nums = [10,9,2]
print(nums)
print(nums[0])
print(nums[1])
print(nums[2])
for i in nums:
print(i)
it = iter(nums)
print(it.__next__())
print(it.__next__())
print(it.__next__())
print(next(it))
print(next(it))
print(next(it)) |
# Copyright 2014 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
'''
Task 6.
Продолжить работу над вторым заданием.
Реализуйте механизм валидации вводимых пользователем данных.
Например, для указания количества принтеров, отправленных на склад, нельзя использовать строковый тип данных.
Подсказка:
постарайтесь по возможности реализовать в проекте «Склад оргтехники» максимум возможн... |
# test10.py
a = _n('a')
b = _n('b')
root = (a^b)*inv(a^b) |
"""A module defining the third party dependency GMP"""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
def gmp_repositories():
maybe(
http_archive,
name = "GMP_lib",
build_file = Label("@//third_party/GMP:B... |
#
# @lc app=leetcode id=100 lang=python3
#
# [100] Same Tree
#
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def isSameTree(self, p: TreeNode, q: TreeNode) -> bool:
if p is No... |
L, Q = map(int, input().split())
w = {"0": L}
plist = [0]
for _ in range(Q):
c, x = map(int, input().split())
if c == 1:
target_p = None
for p in plist:
if p < x:
target_p = p
else:
break
w[str(x)] = target_p + w[str(target_p)] -... |
#!/usr/bin/python
# ==============================================================================
# Author: Tao Li (taoli@ucsd.edu)
# Date: May 3, 2015
# Question: 038-Count-and-Say
# Link: https://leetcode.com/problems/count-and-say/
# ========================================================================... |
def stop(track, pos, start_speed):
max_speed = len(track)-1
solutions = {}
for posistion in range(len(track)):
if track[posistion]:
solutions[posistion] = set([0])
for posistion in reversed(range(pos, len(track))):
if not track[posistion]:
continue
... |
class level(object):
bg = pygame.image.load(os.path.abspath(os.path.join(os.path.dirname(__file__),'images/bg.png')))
def __init__(self,currentpos,levellength):
self.currentpos = currentpos
self.fulllength = fulllength
self.vel = velocity
def draw(self, win):
... |
#Criar um programa que recebe 3 inteiros e imprime a soma e o produto entre eles
n1=int(input("Digite um valor: "))
n2=int(input("Digite um valor: "))
n3=int(input("Digite um valor: "))
soma=n1+n2+n3
produto=n1*n2*n3
print(f"A soma entre eles é {soma} e o produto entre eles é {produto}")
|
config_dict = {
"out_path": "~/daily_counts.json",
"trackers": [
{
"name": "Hex.pm (Elixir/Erlang)",
"url": "https://hex.pm/packages",
"regex": ">(\\d+) Results Found"
},
{
"name": "DUB (dlang)",
"url": "https://code.dlang.org",
"regex": "<p>Found (\\d+) packages.<\/... |
class Solution:
def solve(self, nums, M, K):
n = len(nums)
r = -99999
for i in range(n - M * K):
r = max(r, sum(nums[i: i + M * K + 1: K + 1]))
return r
def solve2(self, N, R, points):
M = len(R)
S = len(points)
R.sort(reverse=True)
p... |
# This is an example of a comment that Python ignores. Use these to make notes as you write your code. You will also fill out the top comment with any help or resources you use.
# Collaborators: (fill this is on every assignment, even if the answer is "none")
print('Hello world')
name='Keelie'
print(f'Hel... |
# -*- coding: utf-8 -*-
"""
idfy_rest_client.models.konsern_link
This file was automatically generated for Idfy by APIMATIC v2.0 ( https://apimatic.io )
"""
class KonsernLink(object):
"""Implementation of the 'KonsernLink' model.
TODO: type model description here.
Attributes:
... |
# Asks for a file name and tries to find it and adds a file extention to the
# input name. If it is not found, tell and try again untill it is found
def enterFile():
# initialisation
notFound = True
# while the file isn't found, keep asking for a filename
while notFound:
# input filename need... |
# Title : TODO
# Objective : TODO
# Created by: Wenzurk
# Created on: 2018/2/8
alien_0 = {'color': 'green', 'point': 5}
# print(alien_0['color'])
# print(alien_0['point'])
# new_points = alien_0['point']
# print("You just earned " + str(new_points) + " points.")
print(alien_0)
#
# alien_0['x_position'] = 0
# al... |
expected_output = {
"bgp_id": 5918,
"vrf": {
"L3VPN-1151": {
"neighbor": {
"192.168.10.253": {
"address_family": {
"vpnv4": {
"activity_paths": "5564978/1540171",
"activity_pre... |
class Solution:
def numDifferentIntegers(self, word: str) -> int:
s = "".join([char if char.isdigit() else " " for char in word])
return len({int(num) for num in s.split()})
|
if __name__ == '__main__':
print("hello, world")
|
'''
给定一个二叉树和一个目标和,找到所有从根节点到叶子节点路径总和等于给定目标和的路径。
说明: 叶子节点是指没有子节点的节点。
示例:
给定如下二叉树,以及目标和 sum = 22,
5
/ \
4 8
/ / \
11 13 4
/ \ / \
7 2 5 1
返回:
[
[5,4,11,2],
[5,8,4,5]
]
'''
# Definition for a binary tree node.
# class Tre... |
num = c = resultado = 0
while True:
print('-=' * 40)
num = int(input('Quer saber a tabuada de qual número [Número negativo para parar]: '))
if num < 0 :
break
for c in range(1,11) :
resultado = c * num
print(f'{c} x {num:} = {resultado}')
|
'''
ATOMIC WEIGHTS OF THE ELEMENTS (2019)
from the IUPAC Commission on Isotopic Abundances and Atomic Weights
Based on the following reports:
- Pure Appl. Chem., 2016, 88, 265-291 (https://doi.org/10.1515/pac-2015-0305)
- Chem. Eng. News, 2015, 93(37), 9 (https://doi.org/10.1021/cen-09337-notw9)
... |
# -*- coding: utf-8 -*-
# @Author: Nate
# @Date: 2020-02-20 08:25:21
# @Last Modified by: Nate
# @Last Modified time: 2021-12-12 15:54:04
path = 'V:\crawler\manga_crawler\download\cartoonmad'
|
'''Common restriction sites.'''
fallback_enzymes = {'AflII': ('CTTAAG', (1, 5)),
'AgeI': ('ACCGGT', (1, 5)),
'BamHI': ('GGATCC', (1, 5)),
'DpnI': ('GATC', (2, 2)),
'DraI': ('TTTAAA', (3, 3)),
'EcoRI': ('GAATTC', (1, 5)... |
def subsets(nums):
res = []
dfs(nums, [], res)
return res
def dfs(nums, path, res):
res.append(path)
for i in range(len(nums)):
dfs(nums[i + 1 :], path + [nums[i]], res)
return res
def subsets2(nums):
res = [[]]
for num in sorted(nums):
print(res)
res += [item... |
"""Useful utilities used internally or useful to extensions."""
def tpl_cons(hd, tl):
yield hd
for x in tl:
yield x
def contains_ellipsis(idx):
if idx is Ellipsis:
return True
elif isinstance(idx, tuple):
for item in idx:
if item is Ellipsis:
retu... |
soma = 0
conta = 0
c = 0
while not c == 999:
c = int(input('digite um valor : [ 999 para PARAR ] :'))
conta += 1
if c != 999:
soma = (soma + c)
print('vc digitou {} numeros e a soma entre eles e {}'.format(conta - 1, soma))
|
# -*- encoding: utf-8 -*-
# Ref: https://github.com/dissemin/wikiciteparser/blob/master/wikiciteparser/en/__init__.py
"""
List of citation templates which are going to be extracted
"""
CITATION_TEMPLATES = set([
'citation',
'cite arxiv',
'cite av media',
'cite av media notes',
'cite book',
'c... |
# Copyright (c) 2020-2021 Matematyka dla Ciekawych Świata (http://ciekawi.icm.edu.pl/)
# Copyright (c) 2020-2021 Robert Ryszard Paciorek <rrp@opcode.eu.org>
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Soft... |
def logging_detector(funct):
def wrapper(*args, **kwargs):
print(f'The function called was {funct.__name__}')
print('Arguments passed:')
for arg in args:
print(arg)
print(funct(*args))
return wrapper
@logging_detector
def homer(name, day, rating):
return 'HOMER... |
"""Manages print format for GOEA results."""
__copyright__ = "Copyright (C) 2016-2018, DV Klopfenstein, H Tang, All rights reserved."
__author__ = "DV Klopfenstein"
# import collections as cx
class PrtFmt(object):
"""Manages print format for GOEA results."""
# Default Excel table column widths for GOEA res... |
class Solution:
def getModifiedArray(self, length, updates):
"""
:type length: int
:type updates: List[List[int]]
:rtype: List[int]
"""
result=[0] * length
for operation in updates:
result[operation[0]] = result[operation[0]] + operation[2]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.