content stringlengths 7 1.05M |
|---|
myfile= open("running-config.cfg")
def process_line(word):
str=word.split()
lst=str[2:]
mytpl = tuple(lst)
return(mytpl)
def check(line):
if "no ip address" in line:
return
elif "ip address" in line:
return(process_line(line))
else:
return
myfinlist=[]
for line in myfile:
mytpl3=check(line)
if mytp... |
"""Config for sending email via Mailgun"""
MAILGUN = {
"from": "XXXX",
"url": "XXXX",
"api_key": "XXXX"
}
NOTIFICATIONS = ["XX@XX.com"]
|
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def postorderTraversal(self, root):
"""
:type root: TreeNode
:rtype: List[int]
"""
... |
# Create two lists of zeros; rows and cols. Keep incrementing count in the lists. Increment total_odd by r+c%2==1
class Solution:
def oddCells(self, n: int, m: int, indices: List[List[int]]) -> int:
rows, cols = [0]*n, [0]*m
for i in indices:
rows[i[0]] += 1
... |
# PROGRESSÃO ARITMÉTICA
# Desenvolva um programa que leia o primeiro termo e a razão de uma PA. No final, mostre os 10 primeiros termos dessa progressão.
termo = int(input('Digite o primeiro termo: '))
razao = int(input('Digite a razão: '))
decimo = termo + (10-1) * razao
for c in range(termo, decimo, razao):
pri... |
I=input('Enter String: ')
if I.count('4')==0 and I.count('7')==0:
print('Output:',-1)
else:
if I.count('4')>=I.count('7'):
print('Output:',4)
else:
print('Output:',7)
|
# Window-handling features of PyAutoGUI
# UNDER CONSTRUCTION
"""
Window handling features:
- pyautogui.getWindows() # returns a dict of window titles mapped to window IDs
- pyautogui.getWindow(str_title_or_int_id) # returns a "Win" object
- win.move(x, y)
- win.resize(width, height)
- win.maximize()
- wi... |
def can_build(env, platform):
return (platform == "x11")
# for futur: or platform == "windows" or platform == "osx" or platform == "android"
def configure(env):
pass
def get_doc_classes():
return [
"Bluetooth",
"NetworkedMultiplayerBt",
]
def get_doc_path():
return "doc_cla... |
def fib(n):
if(n <= 1): return n
return fib(n-1) + fib(n-2)
print(fib(30))
|
NAME = 'Little Wolf'
def extract_upper(phrase):
return list(filter(str.isupper, phrase))
def extract_lower(phrase):
return list(filter(str.islower, phrase))
|
def main() -> None:
N, M, K = map(int, input().split())
A = [0] * M
B = [0] * M
for i in range(M):
A[i], B[i] = map(int, input().split())
X = list(map(int, input().split()))
assert 2 <= N <= 50
assert 1 <= M <= (N * (N - 1))
assert 1 <= K <= 10
assert len(X) == N
asse... |
{
'targets': [{
'target_name': 'talib',
'sources': [
'src/talib.cpp'
],
"include_dirs": [
"<!(node -e \"require('nan')\")"
],
'conditions': [
['OS=="linux"', {
"libraries": [
"../src/lib/lib/libta... |
n = input("Enter a number: ")
n = int(n)
if n > 1000:
print("PLEASE ENTER A NUMBER THAT IS LESS THAN 1000!")
else:
n = str(n)
if len(n) == 2:
if n[0] == "2":
a = "Twenty"
if n[0] == "3":
a = "Thirty"
if n[0] == "4":
a = "Fourty"
if n[0] == ... |
def test1(foo, bar):
foo = 3
def test2(quix):
foo = 4
test2(123)
print(foo)
# Should be 3
|
MONTH_IN_YEAR = 12
LOAN_STATE_TEMPLATE = '{body:<15}|{pay:<15}|{percentage_pay:<15}|{body_pay:<15}'
LOAN_REPORT_ROW_TEMPLATE = '{payment_num:<10}|' + LOAN_STATE_TEMPLATE
REPORT_HEADER = LOAN_REPORT_ROW_TEMPLATE.format(
payment_num='Payment №',
body='Remaining body',
pay='Payment',
percentage_pay='% pay... |
temp: int = int(input())
temp_range: int = 0 if (10 <= temp <= 18) else 1 if (18 < temp <= 24) else 2
day_time: int = ('Morning', 'Afternoon', 'Evening',).index(input())
options: tuple = (
(('Sweatshirt', 'Sneakers',),('Shirt','Moccasins',),('Shirt','Moccasins',),),
(('Shirt','Moccasins',),('T-Shirt','Sandals',... |
def tmembership(my_tuple1,my_tuple2):
for item in my_tuple1:
# membership in and not in operator in tuple
if item in my_tuple2:
print(str(item) + ' in my_tuple2')
if item not in my_tuple2:
print(str(item) + ' not in my_tuple2')
print(tmembership((1, 2, 3, 4, 5), (1,... |
# Exceptions
# Problem Link: https://www.hackerrank.com/challenges/exceptions/problem
for _ in range(int(input())):
try:
a, b = [int(x) for x in input().split()]
print(a // b)
except Exception as e:
print("Error Code:", e)
|
TYPEKRUISING = {
1: "aquaduct",
2: "brug",
3: "duiker",
4: "sifon",
5: "hevel",
6: "bypass"
}
MATERIAALKUNSTWERK = {
1: "aluminium",
2: "asbestcement",
3: "beton",
4: "gegolfd plaatstaal",
5: "gewapend beton",
6: "gietijzer",
7: "glad staal",
8: ... |
'''
Implement a queue using an array¶
In this notebook, we'll look at one way to implement a queue by using an array. First, check out the walkthrough for an overview of the concepts, and then we'll take a look at the code.
OK, so those are the characteristics of a queue, but how would we implement those characteristic... |
# -*- coding: utf-8 -*-
EMPTY_STR = ""
def is_empty(word):
return bool(word == EMPTY_STR)
def is_empty_strip(word):
return bool(str(word).strip() == EMPTY_STR)
|
"""
0849. Maximize Distance to Closest Person
Easy
In a row of seats, 1 represents a person sitting in that seat, and 0 represents that the seat is empty.
There is at least one empty seat, and at least one person sitting.
Alex wants to sit in the seat such that the distance between him and the closest person to him... |
# This is a sample module used for testing doctest.
#
# This module is for testing how doctest handles a module with no
# docstrings.
class Foo(object):
# A class with no docstring.
def __init__(self):
pass
|
# generating magic square
# note only works with odd number input
# conditions and procedure in readme.md file at https://github.com/ThayalanGR/competitive-programs
def generateMagicSquare(n):
mSquare = [[0 for _ in range(n)] for _ in range(n)]
# initialize row and col value
i = int(n/2)
j = n-1
... |
# Created by MechAviv
# Map ID :: 940012010
# Hidden Street : Decades Later
sm.curNodeEventEnd(True)
sm.setTemporarySkillSet(0)
sm.setInGameDirectionMode(True, True, False, False)
sm.removeSkill(60011219)
if not "1" in sm.getQRValue(25807):
sm.levelUntil(10)
sm.setJob(6500)
sm.createQuestWithQRValue(25807... |
'''
Joe Walter
difficulty: 15%
run time: 0:01
answer: 402
***
074 Digit Factorial Chains
The number 145 is well known for the property that the sum of the factorial of its digits is equal to 145:
1! + 4! + 5! = 1 + 24 + 120 = 145
Perhaps less well known is 169, in that it produces the longest chain of numb... |
def tabuada(num):
for x in range (11):
print(num*x)
num = int(input('Digite um valor: '))
tabuada(num)
|
"""
Simplified Josephus
Given n people find the survivor, starting from the first person he kills the person to the left and the next surviving person kills the person to his left, this keeps happening until 1 person survives return that person's number.
Examples
josephus(1) ➞ 1
josephus(8) ➞ 1
josephus(41) ➞ 19
Not... |
class Environment:
def __init__(self, rows, columns, turns, drones_count, drone_max_payload):
self.rows = rows
self.columns = columns
self.turns = turns
self.drones_count = drones_count
self.drone_max_payload = drone_max_payload
|
class DeviceInfo(object):
"""Device Info class"""
@staticmethod
def get_serial():
# Extract serial from cpuinfo file
cpuserial = "0000000000000000"
try:
f = open('/proc/cpuinfo','r')
for line in f:
if line[0:6]=='Serial':
c... |
#Uma empresa deve aumentar em 5% os salários de todos os seus programadores.
# Faça um algoritmo que calcule o valor do novo salário
# sabendo que o atual salário de um programador é de 3500$.
salario_programador = 3500
novo_salario = 3500+3500*(0.5)
print(f'\033[036mNovo salário dos programadores: \033[032m${novo_sal... |
# Time: O(nlog*n) ~= O(n), n is the length of the positions
# Space: O(n)
# In this problem, a rooted tree is a directed graph such that,
# there is exactly one node (the root) for
# which all other nodes are descendants of this node, plus every node has exactly one parent,
# except for the root node which has no par... |
f1 = open("slurm-3101.out", 'r')
lines = f1.readlines()
count = 0
d = {}
for line in lines:
s = line.split(' + ')
s.remove('\n')
print(s)
count += 1
for x in s:
s1 = x.split('A^')
if (float(s1[0]) != 0 or int(s1[1]) != 0):
print(s1)
res = d.get(int(s1[1]))
... |
input = """
bk(a,b).
bk(b,c).
bk(m,m).
bk(x,y).
"""
output = """
bk(a,b).
bk(b,c).
bk(m,m).
bk(x,y).
"""
|
#!/usr/bin/env python
# coding: utf-8
# In[1]:
#Lara Betül Arslantaş-180401024
def polinoma_cevirme(derece,veriler):
matris = []
a = 0
for i in range(derece+1):
satir = []
for j in range(derece+1):
toplam = 0
for k in range(1,len(veriler)+1):
topl... |
#recursive factorial
def factorial(n):
if (n == 0):
return 1
else:
return n * factorial(n - 1)
#iterative factorial
def factorial(n):
total = 1
for i in range(1,n+1,1):
total *= i
return total
#recursive greatest common divisor
def gcd(a,b):
if (b == 0):
return ... |
# Extended Euclid's Algorithm for Modular Multiplicative Inverse
def euclidean_mod_inverse(a, b):
temp = b
# Initialize variables
t1, t2 = 0, 1
if b == 1:
return 0
# Perform extended Euclid's algorithm until a > 1
while a > 1:
quotient, remainder = divmod(a, b)
a, b = ... |
"""
Given the array nums, obtain a subsequence of the array whose sum of
elements is strictly greater than the sum of the non included elements in
such subsequence.
If there are multiple solutions, return the subsequence with minimum size
and if there still exist multiple solutions, return the ... |
"""
Класс для работы с дампами в формате mct (Mifare Classic Tool).
Представляет собой текстовый файл с hex-дампом. Каждый блок с отдельной строки. Дополнительно указаны номера секторов.
Пример:
+Sector: 0
DB5AA4B0950804006263646566676869
140103E103E103E103E103E103E103E1
03E103E103E103E103E103E103E103E1
A0A1A2A3A4A578... |
budget = float(input("Enter the budget: "))
amount_of_video_card = int(input("Enter the number of video cards: "))
amount_of_processor = int(input("Enter the number of processors: "))
amount_of_ram_memory = int(input("Enter the number of ram memory: "))
video_card_price_per_one = 250
video_card_total_price = amount_of... |
pysmt_op = ["forall", "exists", "and", "or", "not", "=>", "iff", "symbol", "function", "real_constant", "bool_constant",
"int_constant", "str_constant", "+", "-", "*", "<=", "<", "=", "ite", "toreal", "bv_constant", "bvnot", "bvand",
"bvor", "bvxor", "concat", "extract", "bvult", "bvule", "bvneg", "bvadd", ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
If we list all the natural numbers below 10 that are multiples of 3 or 5,
we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
"""
def main():
x = 0
for n in range(1, 1000):
if n % 3 == 0:
x += n
eli... |
"""
limis core - environment
Environment variables set for a project.
"""
LIMIS_PROJECT_NAME_ENVIRONMENT_VARIABLE = 'LIMIS_PROJECT_NAME'
LIMIS_PROJECT_SETTINGS_ENVIRONMENT_VARIABLE = 'LIMIS_PROJECT_SETTINGS'
|
# coding=utf-8
class ErreurRepertoire(Exception):
def __init__(self, *args):
super().__init__(*args)
class FonctionnaliteNonImplementee(Exception):
def __init__(self, *args):
super().__init__(*args)
class CreaturesNonTrouvees(Exception):
def __init__(self):
super().__init__(
... |
class CyclicQ(object):
'''
Queue.
read parameter is next scheduled for dequeue, write parameter is
most recently queued.
'''
def __init__(self, length):
self.width = length
self.length = 0
self.array = [None] * length
self.read = 0
self.write = -1
... |
# 课程作业1函数
def action1_fun():
sum = 0
for num in range(2, 101, 2):
sum = sum + num
print("Sum is", sum)
if __name__ == '__main__':
action1_fun()
|
########################################################
# Copyright (c) 2015-2017 by European Commission. #
# All Rights Reserved. #
########################################################
extends("BaseKPI.py")
"""
Marginal costs statistics (euro/MWh)
---------------------------... |
def response_json(target):
def decorator(*args, **kwargs):
response = target(*args, **kwargs)
# TODO: you can add your error handling in here
return response.json()
return decorator
|
NON_CORE_DEPDENDENT_TASKS_FIRST_PRIORITY = 9999
# MessageProcessor
# priority constants for message processors between modules
ASSETS_PRIORITY_PARSE_ISSUANCE = NON_CORE_DEPDENDENT_TASKS_FIRST_PRIORITY - 0
ASSETS_PRIORITY_PARSE_DESTRUCTION = NON_CORE_DEPDENDENT_TASKS_FIRST_PRIORITY - 1
ASSETS_PRIORITY_BALANCE_CHANGE =... |
# Übungsaufgabe: Auto mit Booster in Python
class Booster:
powerOn = False # erzeugt und initialisiert eine Instanzvariable
def __init__(self, stufe): # Konstruktor
self.stufe = stufe # self ist 'this' in Java/C# -> erzeugt eine Instanzvariable
def getPower(self): # Meth... |
#coding: utf8
def get_data_by_binary_search(target, source_list):
min=0
max=len(source_list)-1
while min<=max:
mid=(min+max)//2
if source_list[mid]==target:
return mid
if source_list[mid]>target:
max=mid-1
else:
min=mid+1
if __name__==... |
# -*- coding: utf-8 -*-
"""Binary Search.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1pgYTs84FYj7s3soy6YSyOLeeo6y34p0U
"""
def binary_search(arr, target):
first = 0
last = len(arr)-1
found = False
while first <= last and not found:
... |
# # WAP accept a number and check even or odd..
number = int(input("Enter number: "))
if(number == 0):
print("Zero")
elif(number % 2 == 0):
print("Even")
else:
print("Odd")
# # WAP accept three subject marks . Calculate % marks. and display grade as per following condition...
# # 80 - 100 > A... ..... 60... |
pizzas = ['hawaiian', 'pepperoni', 'margherita']
friend_pizzas = pizzas[:]
pizzas.append('marinara')
friend_pizzas.append('vegetariana')
print("My favorite pizzas are:")
for pizza in pizzas:
print(pizza)
print("\nMy friend's favorite pizzas are:")
for pizza in friend_pizzas:
print(pizza) |
class Lang:
""" Содержит языковые константы. """
CPP = 'cpp'
PYTHON = 'python'
JAVA = 'java'
SIM_LANGS = CPP, JAVA
PYCODE_LANGS = PYTHON
CHOICES = (
(CPP, CPP),
(PYTHON, PYTHON),
(JAVA, JAVA)
)
|
#
# PySNMP MIB module DOCS-IETF-BPI2-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DOCS-IETF-BPI2-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:43:47 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, ... |
grid = []
n = int(raw_input())
for i in range(n):
arr = []
s = raw_input()
for j in range(n):
arr.append(s[j])
grid.append(arr)
status = True
for i in range(n):
b = 0
c = 0
lastChar = ' '
lastCount = 0
for x in range(n):
if grid[x][i] == 'B': b += 1
else: c +=... |
# This program/script perform usual conversion.
# function Choosing a conversion category (distance, flow, volume, Area, pressure, Liquid Flow, Speed, Gas Flow)
def conversion_cat():
while True:
print("welcome to the Unit Converter!\n")
print('Choose a category from the list below? (Enter c... |
#This is a simple class definition to hold information about each judge. Is used by other files, and is not to be run directly.
class judge(object):
#initialized using a "line". This should be a line from the .csv file produced by judgeMetaDataExtractor.py
def __init__(self,line):
parts = line.strip().spl... |
USER_CREDENTIALS = [
("user1", "user1@example.com", "pass1"),
("user2", "user2@example.com", "pass2"),
("user3", "user3@example.com", "pass3"),
("user4", "user4@example.com", "pass4"),
("user5", "user5@example.com", "pass5")
] |
def _compute_lcs(source, target):
"""Computes the Longest Common Subsequence (LCS).
Description of the dynamic programming algorithm:
https://www.algorithmist.com/index.php/Longest_Common_Subsequence
Args:
source: List of source tokens.
target: List of target tokens.
Returns:
List ... |
##defines
SWARM = ["SeqSwarm", "PyramidSwarm", "RingSwarm", "LocalSwarm"]
FUNCTION = ["Sphere", "Rastrigin", "Rosenbrock", "Schaffer", "Griewank","Ackley", "Schwefel", "Levy No.5"]
DISPLAYDIGITS = 3
##end defines
class PsoParameter:
steps = 0
stepwidth = 1
runs = 0
#the actual settings for the batch r... |
'''
@description 2019/09/02 22:21
'''
# while循环九九乘法表
'''
1 * 1 = 1
1 * 2 = 2 2 * 2 = 4
1 * 3 = 3 2 * 3 = 6 3 * 3 = 9
.....
'''
print('test....')
print('1 * 2 = 2', end=" ")
print('2 * 2 = 4')
print('test finished....')
# 行
rows = 1
# 列
columns = 1
print('while start....')
# 第一个循环:行
while rows <= 9:
while co... |
a, b, c, d, e, f, g, h = '00000000'
cell = ''
with open(input('What file to execute?> '), 'r') as F:
for row in F:
for x in str(row):
if x == '!':
if cell == '': cell = 'a'
elif 'a' <= cell <= 'g': cell = chr(ord(cell) + 1)
elif cell == 'h': cell = ''
if x == '?':... |
# noinspection SpellCheckingInspection
"""
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number
of rows like this:
(you may want to display this pattern in a fixed font for better legibility)
P A H N
A P L S I I G
Y I R
And then read line by line: "PAHNAPLSIIGYIR"
Write the code tha... |
person = {
"first_name": "Bob",
"last_name": "Smith"
}
# for key in person:
# print(key)
# for key in person.keys():
# print(key)
# for value in person.values():
# print(value)
# for key, value in person.items():
# print(key, value)
the_keys = person.keys()
person["age"] = 23
print(the_ke... |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 2 10:24:30 2020
@author: roger luo
"""
def example():
"""show example code
Returns
-------
None.
Example
--------
>>> 1+2
3
>>> d = sum([1,2,3])
>>>
pd.Series([1,2,3])
Out[15]:
0 1
1 2
2 3
d... |
WELCOME_BRIEF = "Configures welcoming people to the server."
WELCOME_DESCRIPTION = "Configures welcoming people to the server, what channel it occurs and, and what welcome " \
"messages are sent."
WELCOME_INFO_BRIEF = "Lists basic Welcome info for this server."
WELCOME_ENABLE_BRIEF = "Enables Welc... |
def thread_colorize(area, lexer, theme, index, stopindex):
for pos, token, value in lexer.get_tokens_unprocessed(area.get(index, stopindex)):
area.tag_add(str(token), '%s +%sc' % (index, pos),
'%s +%sc' % (index, pos + len(value)))
yield
def matrix_step(map):
count, offse... |
#!/usr/bin/env python3
def solution(array):
"""
Finds the number of combinations (ai, aj), given:
- ai == 0
- aj == 1
- j > i
Time Complexity: O(n), as we go through the array only once (in reverse order)
Space Complexity O(1), as we store three variables and create one iterator
"""
... |
# mysql 数据库配置信息
HOST = ''
PORT = ''
USER = ''
PASSWORD = ''
DATABASE = ''
# 网页cookie信息
COOKIE = 's_fid=16EA47F34D0C27D1-3D49C0C1B807C69C; s_dslv=1588085362157; s_vn=1619487134855%26vn%3D2; s_nr=1592356504313-Repeat; regStatus=pre-register; x-wl-uid=1oFkJghyA05X3g0aAQ4KsIIeQQrGiyWDznKUVwLKDcTSdrE2BKMaYDs9LhL2UdTb2e07S... |
# coding=utf-8
# # vigane variant
def isprime(n):
for i in range(n):
if n % i == 0:
return False
return True
# # Parandatud variant
# def isprime(n):
# for i in range(2, n):
# if n % i == 0:
# return False
# return True
# # 0 ja 1 haldamine
# def isprime(n... |
# parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'ACCEPTING COMMA ENVIRONMENT EQUALS FILE INCLUDE INPUTS INPUT_ENABLED INPUT_STATES LEFT_BRACE LEFT_BRACKET LEFT_PAREN LIVENESS NAME OUTPUTS OUTPUT_STATES PROCESS RECEIVE... |
'''for c in range(1, 10): #usar este comando apenas quando vc sabe o limite, ponto final, caso não saiba usa-se while
print(c)
print('FIM')'''
# USANDO WHILE, bom usar quando não sabemos o limite final do loob, ou seja, até que ponto chegar
'''c = 1 #COMEÇA NO 1
while c < 10: #ENQUANTO FOR MENOR QUE 10, CONTINUE ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------
# Arquivo de configuração
# -------------------
# URL para ser minerada
website = "http://gmasson.com.br/"
# TAG á ser minerada
tag_open = "<title"
tag_close = "</title>"
|
#1. get input
#2. store each character into an array
#3. convert to ascii
#4. change even to odd and odd to even
#5. convert from ascii to char
#6. convert array to string
#7. print string
#1
"""
print("#1")
text = input("Enter text for encryption or decryption")
#2
print("#2")
letters = []
character = text.split()
fo... |
# Class Hero, containig all the
# current information about the hero
class Hero:
"""Hero"""
def __init__(self, health=100, magic=0):
self.health = health
self.magic = magic
self.x = None
self.y = None
def printH(self):
print('Health: {0}, Magic: ... |
class Heap:
def __init__(self,maxSize):
self.heapList = (maxSize+1)*[None]
self.heapSize = 0
self.maxSize = maxSize
def __str__(self):
return str(self.heapList)
def size(self,root):
return root.heapSize
def peek(self,root):
if root.heapList[... |
class Lock:
def __init__(self):
self.locked = False
def lock(self, msg):
assert not self.locked, msg
self.locked = True
def unlock(self):
self.locked = False |
# Author: Luka Maletin
class GraphError(Exception):
pass
class Graph(object):
class Vertex(object):
def __init__(self, x):
self._element = x
def element(self):
return self._element
def __hash__(self):
return hash(id(self))
class Edge(object)... |
def add(*lists_of_numbers):
lengths = set(tuple(tuple(len(sublist) for sublist in outer_list) for outer_list in lists_of_numbers))
if len(lengths) != 1:
raise ValueError
return [[sum(p) for p in zip(*sublists)] for sublists in zip(*lists_of_numbers)]
|
# 8zxx xxxx - Mobile, Data Services, New Numbers and Prepaid Numbers
# 9yxx xxxx - Mobile, Data Services and Pager (until May 2012)
# x denotes 0 to 9
# y denotes 0 to 8 only
# z denotes 1 to 8 only
min8range = 81000000
max8range = 88000000
min9range = 90000000
max9range = 98000000
eight = []
for i ... |
"""
A file containing validator functions to make sure
the input from SQS Message is correct.
Every function follows the logic of checking the values and
returning True or False depending on whether or not they are correct.
"""
supported_input_formats = [
"WAV",
"FLAC",
"MP3",
"AIFF",
"AAC",
"... |
if True:
print("It's IF!!!")
while True:
print("It's WHILE!!!") |
POSTS = [
[
'Microsoft Is Hiring!',
'We are looking for a delivry driver to work at our Haifa office',
'Bill Gates',
True,
'Delivery driver',
],
[
'Apple Is Hiring!',
'We are looking for a web developer to work at our Tel Aviv office',
'Tim Coo... |
#!/usr/bin/env python3
# go = False
go = True
pieces_seeds = ['BRU','FRU','RFF','LFUDF','DRBB','BDRB']
# optimisable en mettant les 3 pièces de volume 5 avant les 3 pièces de volume 4 dans pieces_seeds
# TO DO
# tester parties
# check that Rzx=RyxRzyRxy
# afficher une solution sur un graphique 3D coloré par piè... |
class TextureNodeTexBlend:
pass
|
num1=10
num2=20
num3=30
num4=40
|
# lc643.py
# LeetCode 643. Maximum Average Subarray I `E`
# 1sk | 98% | 9'
# A~0g17
class Solution:
def findMaxAverage(self, nums: List[int], k: int) -> float:
maxsum = cursum = sum(nums[0:k])
for i in range(len(nums)-k):
cursum += nums[i+k] - nums[i]
maxsum = max(cursum, m... |
class_names = [
'agricultural',
'airplane',
'baseballdiamond',
'beach',
'buildings',
'chaparral',
'denseresidential',
'forest',
'freeway',
'golfcourse',
'harbor',
'intersection',
'mediumresidential',
'mobilehomepark',
'overpass',
'parkinglot',
'river',
'runway',
'sparseresidential',
'storagetanks',
... |
#! /usr/bin/env python3
# func.py -- This script calls the hello function 10 times.
# Author -- Prince Oppong Boamah<regioths@gmail.com>
# Date -- 27th August, 2015
def hello():
print("Hello world!")
print("I am going to call the hello function 10 times")
for i in range(10):
print("hello")
|
#########################################YOLOV3##################################################################
yolov3_params={
'good_model_path' :'/home/ai/model/freezer/ep3587-loss46.704-val_loss52.474.h5',
'anchors_path' :'./goods/freezer/keras_yolo3/model_data/yolo_anchors.txt',
'classes_path' : './go... |
class RestApiException(Exception):
def __init__(self, message, status_code):
super(RestApiException, self).__init__(message)
self.status_code = status_code
self.message = message
def __unicode__(self, ):
return "%s" % self.message
def __repr__(self, ):
return "%s"... |
QUERIES = {
'add_service':
'insert into services(name, type, repeat_period, metadata, status) values("{name}", {type}, {repeat_period}, "{metadata}", 1)',
'services_last_row_id': 'select max(id) from services',
'get_active_services': 'select services.id, services.name, services.type, service_types.T... |
# 循环链表实现
class ListNode:
def __init__(self, val):
self.val = val
self.prev = None
self.next = None
class LinkedList:
def __init__(self):
self.head = None
self.tail = None
self.size = 0
# 添加元素至链表尾部
def add(self, val: int):
node = ListNode(val... |
adj_descriptions = {
'STR': {
'short': [
'Atk Mod',
'Dmg Adj',
'Test',
'Feat',
],
'long': [
'Melee Attack',
'Damage Adjustment',
'Test of STR',
'Feat of STR',
],
},
'DEX': {
... |
def permutationWCaseChangeUtil(input_string, output_string):
if len(input_string) == 0:
print(output_string, end=', ')
return
modified_output_string1 = output_string + input_string[0].upper()
modified_output_string2 = output_string + input_string[0]
modified_input_string = input... |
# function = a block of code which is executed only when it is called
name = input("What's your name? ")
age = str(input("What is your age? "))
def trevi(name, age):
print(f'Hello {name}!')
if age == "0":
print(f'Keep Pounding {name}!')
elif age == "1":
print(f'Proud of you {name}. Keep go... |
def non_capitalized():
"""
compute the MACD (Moving Average Convergence/Divergence) using ...
"""
def capitalized():
"""
Compute the MACD (Moving Average Convergence/Divergence) using ...
"""
|
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def reorderList(self, head):
if head:
arr = []
while head:
arr += head,
head = head.next
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.