content stringlengths 7 1.05M |
|---|
SPIDER_MODULES = ['pumpkin.spiders']
MEDIA_ALLOW_REDIRECTS = True
ITEM_PIPELINES = {'pumpkin.pipelines.SongFilesPipeline': 100}
FILES_STORE = 'songs'
|
def dwgVars(argument):
print()
print("Привет, меня зовут dwgVars и я не реализована")
print()
def dwgVars_print(ProcData):
print()
print("Привет, меня зовут dwgVars")
print("Мне передали аргументы:")
for i in ProcData:
print(i)
print()
|
a=int(input("Enter the first number"))
b=int(input("Enter the second number"))
c=int(input("Enter the third number"))
d=int(input("Enter the fourth number"))
total=a+b+c+d
average=total/4
print("Total of the four numbers=",total,"\naverage of the four numbers=",average)
|
"""Utilities directly related to the `generate` step of `cargo-bazel`."""
load(":common_utils.bzl", "CARGO_BAZEL_ISOLATED", "cargo_environ", "execute")
CARGO_BAZEL_GENERATOR_SHA256 = "CARGO_BAZEL_GENERATOR_SHA256"
CARGO_BAZEL_GENERATOR_URL = "CARGO_BAZEL_GENERATOR_URL"
CARGO_BAZEL_REPIN = "CARGO_BAZEL_REPIN"
REPIN = ... |
class HashTableOpenAddressing:
TOMBSTONE = 'RIP'
MINSIZE = 8
def __init__(self, **initial_values):
self._buckets = [() for _ in range(self.MINSIZE)]
for k, v in initial_values.items():
self.insert(k, v)
def get(self, key):
_, myid = self._computeHash(key)
b... |
# output from elife00013.xml
expected = [
{
"type": "author",
"equal-contrib": "yes",
"id": "author-1668",
"surname": "Alegado",
"given-names": "Rosanna A",
"references": {
"affiliation": ["aff1"],
"equal-contrib": ["equal-contrib"],
... |
#
# @lc app=leetcode id=118 lang=python3
#
# [118] Pascal's Triangle
#
# https://leetcode.com/problems/pascals-triangle/description/
#
# algorithms
# Easy (61.80%)
# Likes: 4609
# Dislikes: 188
# Total Accepted: 684.3K
# Total Submissions: 1.1M
# Testcase Example: '5'
#
# Given an integer numRows, return the fir... |
# hello3.py
def hello():
print("Hello, world!")
# A test:
hello() |
#!/usr/bin/python
# https://practice.geeksforgeeks.org/problems/save-ironman/0
def sol(s):
n = len(s)
#print(s[0], s[-1])
l = 0
r = n-1
while l < r:
lv = False
rv = False
cl = s[l].lower()
cr = s[r].lower()
if cl.isdigit() or cl.isalpha():
... |
"""
This file will contain different constraint propagators to be used within
bt_search.
propagator == a function with the following template
propagator(csp, newly_instantiated_variable=None)
==> returns (True/False, [(Variable, Value), (Variable, Value) ...]
csp is a CSP object---the pro... |
# Repear n/2 iterations. Replace 4 points in one go.
class Solution:
def rotate(self, matrix: List[List[int]]) -> None:
"""
Do not return anything, modify matrix in-place instead.
"""
n = len(matrix[0])
iterations = n//2
for itr in range(iterations):
... |
model = 'basic'
train_file = 'data/jersey_crops_trash_train.txt'
val_file = 'data/jersey_crops_trash_val.txt'
exp = 'basic_newdata_trash_32'
batch_size = 32
learning_rate = 0.01
decay_steps = 10000
decay_rate = 0.9
img_size = 40
crop_size = 32
inter_size = 5 |
def order(choice,location = "Mohakhali"):
menu = {
"BBQ Chicken Cheese Burger": 250,
"Beef Burger": 170,
"Naga Drums":200
}
item = menu[choice]
item += item * 0.08
if location == "Mohakhali":
item += 40
else:
item += 60
return item
item = input... |
class Shape:
def __init__(self, x, y):
self.x = x
self.y = y
self.description = "defined later"
self.author = "Nobody as of yet"
#methods
def area(self):
return self.x * self.y
def perimeter(self):
return 2 * self.x + 2 * self.y
def describe(self, tex... |
# @dploy endpoint xyz
# @dploy json_to_kwargs
def xyz(a, b, c):
return a + b + c
|
# 现场
def curve_pre():
a = 25
def curve(x):
return a*x*x
return curve
a = 10
f = curve_pre()
print(f.__closure__)
print(f.__closure__[0].cell_contents)
print(f(2)) |
ACKGNOWLEDGE_MSG = [
"Roger, will assign the task to a teammate",
"Hang tight, we will find someone for you request shortly",
"Okey-dokey, one teammember for your request coming up :ack:",
]
CALL_TO_ACTION_MSG = [
"Are you up for it?",
"GO GO GO (...?) :runner:",
"Prove to the world how awesome... |
class Character:
def __init__(slef):
# Physically Defining Characteristics
self.name = "Default Name"
self.age = ''
self.sex = ''
self.species = 'human'
# Interpersonal Characteristics
self.agression = ''
# Object Data
sel... |
pkgname = "fonts-liberation"
pkgver = "2.1.5"
pkgrel = 0
build_style = "makefile"
make_cmd = "gmake"
hostmakedepends = ["gmake", "fontforge-cli", "python-fonttools"]
depends = ["mkfontscale"]
pkgdesc = "Liberation family of fonts - OpenType"
maintainer = "q66 <q66@chimera-linux.org>"
license = "OFL-1.1"
url = "https://... |
class TextInput:
def __init__(self, id, initial, placeholder, readonly, style=None):
self.id = id
self._impl = None
self.initial = initial
self.placeholder = placeholder
self.readonly = readonly
self.style = style
def __html__(self):
return (
... |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 21 10:20:55 2020
@author: celine.gross
"""
with open('input_day17.txt', 'r') as file:
puzzle = [[l for l in line.strip()] for line in file]
# Part 1
def create_positions(data):
active = set()
for x, row in enumerate(data):
for y, col in enumerate(r... |
class Payload:
def __init__(self, host: str, port: int, strs: list):
self.host, self.port, self.strs = host, port, strs
def create(self):
return """
def {sendfile}(file, conn):\n\tconn.send("!!!".encode("UTF-8"))
\twith open(file , 'rb') as f:
\t\tconn.send(str(len(f.read())).encode("UTF-8"))\n... |
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
"""pgagent helper... |
def leiaint(msg):
while True:
try:
v = int(input(msg))
except(ValueError, TypeError):
print('\033[0;31mERRO! Digite um valor inteiro.\033[m')
continue
else:
return v
def leiafloat(msg):
while True:
try:
v = float(input... |
# Copyright 2019 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.
"""Presubmit script for changes affecting //ui/views.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the... |
owner_id = 1221558981
bot_token = "1641954476:AAG-EBjPfq8mj7OI6odusgtAa13j9xCQyOo"
bot_id = 1641954476
# Leave it as it is
ARQ_API_BASE_URL = "https://thearq.tech"
|
n=int(input())
su=0
ma=0
for x in range(0,n):
s=input()
s=s.split(' ')
su=su-int(s[0])+int(s[1])
if ma<su:
ma=su
print(ma) |
test = []
test.append('Ian')
test.append(17)
galera = []
galera.append(test[:])
test[0] = 'Mário'
test[1] = 29
galera.append(test)
print(galera) |
#encoding:utf-8
subreddit = 'netflixbestof+bestofnetflix+movie_club+truefilm+shittymoviedetails+ijustwatched'
t_channel = '@r_movieclub'
def send_post(submission, r2t):
return r2t.send_simple(submission)
|
class Solution:
def isAnagram(self, s, t):
"""
:type s: str
:type t: str
:rtype: bool
"""
if len(s) != len(t):
return False
m = {}
for c in s:
m[c] = m.get(c, 0) + 1
for c in t:
if not c in m:
... |
def validSolution(board):
temp = []
for row in board:
for i in range(1, 10):
if i not in row:
return False
for column in range(0, 9):
temp = []
for row in board:
temp.append(row[column])
for i in range(1, 10):
if i not in... |
# intentions
PLAY = 0
DISCARD = 1
KEEP = 2
def utility(intention, card, state, knowledge):
"""
return a utility for a single card of a given realisation
from various realisations
"""
def CardUseless(card, fireworks):
"""
return True if the card can be surely discarded
"""
... |
def main():
position = [0, 0]
with open("day_2_input.txt") as f:
for line in f.readlines():
cmd, unit = line.split()
if cmd == "forward":
position[0] += int(unit)
elif cmd == "down":
position[1] += int(unit)
elif cmd == "up"... |
#시험 점수를 입력받아 90 ~ 100점은 A, 80 ~ 89점은 B, 70 ~ 79점은 C, 60 ~ 69점은 D, 나머지 점수는 F를 출력하는 프로그램을 작성하시오.
#첫째 줄에 시험 점수가 주어진다. 시험 점수는 0보다 크거나 같고, 100보다 작거나 같은 정수이다.
#시험 성적을 출력한다.
a = input()
a = int(a)
if a >= 90:
print("A")
elif 80 <= a <= 89:
print("B")
elif 70 <= a <= 79:
print("C")
elif 60 <= a <= 69:
print("D"... |
"""Script to be called by Abaqus CAE upon a session starting.
This script is meant to be called upon Abaqus opening a new session,
to run batch commands automatically.
Developed by Rodrigo Rivero.
https://github.com/rodrigo1392
"""
print('EXECUTING FIRST SCRIPT') |
#convert units of the same type and different scales
def scaleUnits(initial_unit, final_unit, unit_dict):
initial_factor = unit_dict[initial_unit]['factor']
final_factor = unit_dict[final_unit]['factor']
return lambda x : (x / initial_factor) * final_factor
#convert unit to standard unit for unit type
def... |
# Programa que tem uma função chamada ficha(), que receba dois parâmetros opcionais: o nome de um jogador
# e quantos gols ele marcou. O programa deverá ser capaz de mostrar a ficha do jogador, mesmo que algum
# dado não tenha sido informado corretamente.
def ficha(jogador='<Desconhecido>', gols=0):
print(f'O {jo... |
# Only used for PyTorch open source BUCK build
# @lint-ignore-every BUCKRESTRICTEDSYNTAX
load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary")
def fb_python_binary(**kwgs):
if read_config("pt", "is_oss", "0") == "0":
fail("This file is for open source pytorch build. Do not use it in fbsour... |
def add(x, y):
return x+y
def sub(x, y):
return x-y
|
def wrap(string, max_width):
"""
Takes in a string of length n and an integer
max_width < n, and returns the string wrapped
with lines no longer then max_width chars.
Parameters
----------
string : string
Input string.
max_width : int
Max number of chars before insertin... |
class StlParser():
def file_open(self, file_path):
with open(file_path) as f:
l = f.readlines()
return l
def format_stl_vertex_to_str(self, stl_vertex):
### "vertex xx yy zz" >> "xx,yy,zz"
stl_vertex_rm = stl_vertex.replace("\n",... |
allComands:dict = {
"~help" : "Mostrar comandos do bot.\n",
"~mensagem" : "Manda uma mensagem aleatória inpiradora.\n",
"~flood <n> <mensagem>" : "Spama uma mensagem n vezes no servidor.\n",
... |
# -*- coding: utf-8 -*-
# 经营体检
class DiagnosisService:
__client = None
def __init__(self, client):
self.__client = client
def get_shop_diagnosis(self, shop_id, date):
"""
根据商户ID查询商户经营体检信息
:param shopId:店铺ID
:param date:体检日期(最多查到7天内的体检数据)
"""
retur... |
# Created by Egor Kostan.
# GitHub: https://github.com/ikostan
# LinkedIn: https://www.linkedin.com/in/egor-kostan/
def is_palindrome(s: str) -> bool:
"""
Write function isPalindrome that checks if
a given string (case insensitive) is a palindrome.
:param s:
:return:
"""
s = s.lower()
... |
filename_prefix = 'SawyerPush-Abl-Alpha-ASR'
xlabel = 'Environment steps (1.2M)'
ylabel = "Average Success Rate"
max_step = 1200000
max_y_axis_value = 1.0
legend = True
data_key = "train_ep/episode_success"
bc_y_value = 0
plot_labels = {
r'log($\alpha$): 0.5': ['abl._3DPush_ours_log_alpha_0.5_upbeat-serenity-599']... |
"""
File: abstract.py
Author: Come Bertrand
Email: bertrand.cosme@gmail.com
Github: https://github.com/ComeBertrand
Description: Base classes for the Metaheuristics.
"""
class Metaheuristic(object):
"""Optimization computer that will work on a Problem.
Args:
problem (Problem): the problem to be optim... |
valor = int(input('Digite um valor: '))
x1 = valor * 1
x2 = valor * 2
x3 = valor * 3
x4 = valor * 4
x5 = valor * 5
x6 = valor * 6
x7 = valor * 7
x8 = valor * 8
x9 = valor * 9
x10 = valor * 10
print('1 x {} = {}'.format(valor, x1))
print('2 x {} = {}'.format(valor, x2))
print('3 x {} = {}'.format(valor, x3))
print('4 ... |
timezone = node.metadata.get('timezone', 'UTC')
actions = {
'systemd-daemon-reload': {
'command': 'systemctl daemon-reload',
'triggered': True,
'needed_by': ['svc_systemd:'],
},
'timedatectl-set-timezone': {
'command': 'timedatectl set-timezone ' + timezone,
'unless'... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 7 07:27:08 2020
@author: Ciaran
"""
|
{
"targets": [
{
"includes": [
"auto.gypi"
],
"sources": [
"lib/Patricia.cc",
"lib/PatriciaCursor.cc",
"lib/Namespace.cc",
"lib/ParserConfig.cc",
"lib/Parser.cc"
]
}
],
"includes": [
"auto-top.gypi"
]
}
|
RAWDATA_DIR = '/staging/as/skchoudh/re-ribo-datasets/GRCz11/SRP033369'
OUT_DIR = '/staging/as/skchoudh/re-ribo-analysis/GRCz11/SRP033369'
GENOME_FASTA = '/home/cmb-06/as/skchoudh/genomes/GRCz11/fasta/Danio_rerio.GRCz11.dna.primary_assembly.fa'
CHROM_SIZES = '/home/cmb-06/as/skchoudh/genomes/GRCz11/fasta/Danio_rerio.GRC... |
def iot_gen():
print("iot_gen 1")
yield 'a'
print("iot_gen 2")
print("iot_gen 2")
yield 'b'
print("iot_gen 3")
print("iot_gen 3")
print("iot_gen 3")
yield 'c'
print(next(iot_gen()))
print(next(iot_gen()))
print(next(iot_gen()))
gen = iot_gen()
print(next(gen))
print(next(gen))
pri... |
for _ in range(int(input())):
candidate = int(input())
if (candidate == 2):
print("Prime")
elif (candidate % 2 == 0 or candidate < 2):
print("Not prime")
else:
for i in range(3, int(candidate ** (1 / 2)) + 1, 2):
if candidate % i == 0:
print("Not prime... |
n = int(input('Informe um número: '))
x = 1
print('-'*12)
while x <= 10:
print('{} x {:2} = {}'.format(n, x, n*x))
x = x + 1
print('-'*12)
|
def ordenInsercion(lista):
for i in range(len(lista)-1):
if lista[i+1]<lista[i]:
reubicar(lista, i+1)
print(lista)
def reubicar(lista,p):
v=lista[p]
j=p
while j>0 and v<lista[j-1]:
lista[j]=lista[j-1]
j-=1
lista[j]=v |
cities = [
'Adamsville',
'Albion',
'Ashaway',
'Barrington',
'Block Island',
'Bradford',
'Bristol',
'Carolina',
'Central Falls',
'Charlestown',
'Chepachet',
'Clayville',
'Coventry',
'Cranston',
'Cumberland',
'East Greenwich',
'East Providence',
'Exe... |
#This script is used to analyze the sequencing error profile
if __name__=="__main__":
f=open('error_profile_reads.txt',"r") # Opens file for reading
output = open('error_profile_reads_processed.txt', 'w')
i=0
for line in f:
if i==0:
i=i+1
output.write(line)
co... |
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
# dicts are hashmaps
hashmap = {}
for i in range(len(nums)):
compl = target - nums[i]
if compl in hashmap:
return [i,hashmap[compl]]
hashmap[nums[i]] = i |
n = int(input("Enter the number : "))
i=1
s=""
while(i<n+1):
s += str(i)
i+=1
print(s)
|
"""
Semi-Quantum Conference Key Agreement (SQCKA)
Author:
- Ruben Andre Barreiro (r.barreiro@campus.fct.unl.pt)
Supervisors:
- Andre Nuno Souto (ansouto@fc.ul.pt)
- Antonio Maria Ravara (aravara@fct.unl.pt)
Acknowledgments:
- Paulo Alexandre Mateus (pmat@math.ist.utl.pt)
"""
# Class for IBM Qiskit's Round for the ... |
# Time: O(n)
# Space: O(h)
class Solution(object):
def findBottomLeftValue(self, root):
"""
:type root: TreeNode
:rtype: int
"""
def findBottomLeftValueHelper(root, curr_depth, max_depth, bottom_left_value):
if not root:
return max_dep... |
# Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Generic fallback configuration
#
site_configuration = {
'systems': [
{
'name': 'generic',
... |
# flake8: noqa
# type: ignore
"""Mock linters."""
# pylint: skip-file
__all__ = ['mgl']
class Implementation:
class Error(Exception):
"""ModernGL Error."""
filename = None
function = None
line = None
def strsize(self, *args) -> int:
"""strsize."""
return 0
... |
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load("@rules_cc//cc:toolchain_utils.bzl", "find_cpp_toolchain")
def _nanopb_proto_library_impl(ctx):
# This is the folder we will place all our generation artifacts in
generation_folder_name = ctx.attr.name + "_nanopb_gen/"
# Generate import flags for the ... |
#
# PySNMP MIB module STN-PRODUCTS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/STN-PRODUCTS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:11:35 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar ... |
"""
check some imp module functions (unfinished)
"""
""" Does not work, will never work.
import sys
import imp
fm = imp.find_module("test095m")
print fm
r = imp.load_module("test095m", fm[0], fm[1], fm[2])
print r
print "her1"
print r.__dict__.keys()
print r.__dict__['__path__']
print sys.modules['test095m']
""" |
nama = input("Nama Mhs:")
nim = input("Nim Mhs:")
prodi = input("Prodi:")
kelas = input("Kelas:")
if(prodi == "informatika"):
semester = 1
if(kelas == "A"):
matkul = "algoritma pemrograman"
elif(kelas == "B"):
matkul = "algoritma struktur data"
elif(kelas == "C"):
ma... |
#https://leetcode.com/problems/delete-node-in-a-bst/submissions/
# 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 findMinimum(self , root):
cur... |
# -*- coding: utf-8 -*-
'''
Created on 15/02/2012
@author: chra
'''
def busqueda_lineal_w(v, L):
'''Devuelve el índice de la primera ocurrencia del valor v en la lista L
o devuelve len(L) si v no está en L
'''
i = 0
while i != len(L) and L[i] != v:
i += 1
return i
def busqueda_lineal... |
# coding=utf-8
"""
module document
"""
class a(object):
"""
class document
"""
def __init__(self):
"""
init document
"""
pass
def func_a(self, arg1):
"""
func_a document
:param arg1: arg1 document
:return: return document
... |
class ATM:
def __init__(self, balance, bank_name):
self.balance = balance
self.bank_name = bank_name
self.withdrawals_list = []
def calcul(self,request):
self.withdrawals_list.append(request)
self.balance -= request
notes =[100,50,10,5]
for note i... |
def backwards(filename):
source = makeSound(filename)
target = makeSound(filename)
sourceIndex = getLength(source)
for targetIndex in range(1, getLength(target)+1):
sourceValue = getSampleValueAt(source, sourceIndex)
setSampleValueAt(target, targetIndex, sourceValue)
sourceIndex = sourceIndex - 1
... |
"""
--- Day 5: Binary Boarding ---
You board your plane only to discover a new problem: you dropped your boarding pass! You aren't sure which seat is yours, and all of the flight attendants are busy with the flood of people that suddenly made it through passport control.
You write a quick program to use your phone's ... |
'''A rectangular array of quantities or expressions in rows and columns that is treated as a single entity and manipulated according to particular rules.'''
'''
Representation: List of Lists
Properties: rows, cols, A
Methods:
row Swap - Elementary Row Operation
row Multiply - Elementary Row operation
row S... |
a, b, c, k = map(int, input().split())
if k % 2 == 0:
print(a - b)
else:
print(b - a)
|
#!/usr/bin/python3
text={
"smart-upload": "smart-upload",
"maintanence": "maintanence",
}
|
# O(n) time | O(h) space - where n is the number of nodes in the Binary Tree and h is the height of the Binary Tree
def nodeDepths(root):
sumOfDepth = 0
stack = [{'node': root, 'depth': 0}]
while len(stack) > 0:
nodeInfo = stack.pop()
node, depth = nodeInfo['node'], nodeInfo['depth']
# moves onto next loop, do... |
"""
read raw_data from files
"""
# !/usr/bin/env python
# coding=utf-8
# Read data and read tree fuctions for INFORMS data
# attributes ['age', 'workcalss', 'final_weight', 'education', 'education_num', 'matrital_status',
# 'occupation','relationship', 'race', 'sex', 'capital_gain', 'capital_loss', 'hours_per_week', ... |
def selection_sort(l, start, end, hook_func=None):
'''
@brief 选择排序算法[start, end]
@param l 需要进行排序的list
@param start 开始位置
@param end 结束位置
@param hook_func 进行可视化的函数
'''
count = 0
for i in range(start, end + 1):
minindex = i
for j in range(i + 1, end + 1):
... |
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 16 15:58:22 2018
@author: user
"""
|
'd'
class Ccc:
'd'
def __init__(self, c):
pass
class Ddd:
'd'
def __init__(self):
self.ccc = Ccc(1)
|
nome = str(input('Digite seu nome completo: '))
separado = nome.split()
n = len(separado)
print(f'''Nome: \033[34m{nome}\033[m
Primeiro nome: \033[34m{separado[0]}\033[m
Último nome: \033[34m{separado[n-1]}\033[m''')
#Também poderia ser feito assim no final: print(f'último nome: {separado[len(separado) - 1]}') pra eco... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : 730.py
@Contact : huanghoward@foxmail.com
@Modify Time : 2022/6/10 13:48
------------
"""
class Solution:
def countPalindromicSubsequences(self, s: str) -> int:
n = len(s)
ans = set()
for i in range(n):
... |
add_library('sound')
mic = None
amp = None
def setup():
global mic, amp
size(440, 440)
background(0)
mic = AudioIn(this, 0)
mic.start()
amp = Amplitude(this)
amp.input(mic)
def draw():
noStroke()
fill(26, 76, 102, 10)
rect(0, 0, width, height)
diameter ... |
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Input File !!!
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Propagation method [can be CCS, MCEv1, MCEv2, or MCE12 (u... |
#!/usr/bin/python3
max_integer = __import__('9-max_integer').max_integer
my_list = [1, 90, 2, 13, 34, 5, -13, 3]
max_value = max_integer(my_list)
print("Max: {}".format(max_value))
|
def _impl(ctx):
outputs = []
for src in ctx.files.srcs:
name = src.basename
idx = name.find(".")
if idx >= 0:
name = name[:idx]
out = ctx.actions.declare_file(name + ".html")
outputs.append(out)
ctx.actions.run_shell(
inputs = [src],
... |
# --* encoding:utf-8 *--
def show(goods, flag=0):
tr = "+" + "-" * 5 + "+" + "-" * 10 + "+" + "-" * 15 + "+" + "-" * 5 + "+"
heading = "|{:^5s}|{:^7s}|{:^13s}|{:^3s}|".format("id", "商品名", "售价", "数量")
print(tr + "\n" + heading + "\n" + tr + "\n")
if flag == 0:
# flag为0,直接展示所有商品
for _ in... |
def MERGE(list, p, q, r):
L = list[p:q]
R = list[q:r]
i = j = 0
while i < len(L) and j < len(R):
if L[i] <= R[j]:
list[p] = L[i]
i += 1
else:
list[p] = R[j]
j += 1
p += 1
if i > j:
for j in range(j, len(R)):
... |
# 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... |
company, n = map(int, input().split())
locations = list(map(int, input().split()))
companyLocations = {c: locations[c-1] for c in range(1, company + 1)}
for _ in range(n):
sign, a, b = map(int, input().split())
if sign == 1:
companyLocations[a] = b
else:
print(abs(companyLocations[a] - comp... |
# Quick script to combine files + add positioning tokens
filenames = ['mtg_encoded1.txt', 'mtg_encoded2.txt', 'mtg_encoded3.txt', 'mtg_encoded4.txt', 'mtg_encoded5.txt',
'mtg_encoded6.txt', 'mtg_encoded7.txt', 'mtg_encoded8.txt', 'mtg_encoded9.txt', 'mtg_encoded10.txt']
with open('concat_mtg_encoded.txt', ... |
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
{
'name': 'Database Auto Backup',
'author': 'Khubab & Ghazali',
'summary': 'Database auto backup application.',
'version': '1.0',
'license': 'OPL-1',
'category': 'Tools',
'description': """
Database Auto Backup
========
""",
'depends': ['w... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Author:
"""
class Roboter:
def __init__(self, name, baujahr):
self._name = name
self.__baujahr = baujahr
print("__init__ von Roboter wurde ausgeführt")
def get_name(self):
return self._name
def set_name(self, name):
... |
#
# Local customizations
#
# Where to find the Universal Header include files:
MWERKSDIR="Macintosh HD:SWDev:Codewarrior Pro 5:Metrowerks CodeWarrior:"
INCLUDEDIR=MWERKSDIR + "MacOS Support:Universal:Interfaces:CIncludes:"
# Where to put the python definitions file:
TOOLBOXDIR="Macintosh HD:SWDev:Jack:Python:Mac:Lib:... |
""" String processing utilities
"""
def ranges_to_list(range_str):
""" ranges_to_list("1-3,5-7") == [1,2,3,5,6,7] """
num_list = []
for rng in range_str.split(','):
a, b = map(int, rng.split('-'))
num_list.extend(range(a, b+1))
return num_list
|
#!/usr/bin/env python
# Copyright 2019 Bruno P. Kinoshita
#
# 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... |
# Copyright 2018 AT&T Intellectual Property. All other 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... |
class Status:
def is_informational(self, code):
return code >= 100 and code <= 199
def is_success(self, code):
return code >= 200 and code <= 299
def is_redirect(self, code):
return code >= 300 and code <= 399
def is_client_error(self, code):
return code >= 400 and c... |
print("Hi I am Nexon Bot !!! I am a chat bot")
print("First let's get u signed up")
person=input('Type ur Email here- ')
print("Great !!! So what is ur name")
person=input('Your name- ')
print("Great !!! My name is Avyansh and ur custom tag is 0001")
person=input('Do u like it ? Yes/Yes-')
print("I know u will like it"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.