content stringlengths 7 1.05M |
|---|
"""--------------------------------------------------------------------
* $Id: GUI_definition.py $
*
* This file is part of libRadtran.
* Copyright (c) 1997-2012 by Arve Kylling, Bernhard Mayer,
* Claudia Emde, Robert Buras
*
* ######### Contact info: http://www.libradtran.org #######... |
test = {
'name': 'What Would Scheme Display?',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
scm> (- 10 4)
6
scm> (* 7 6)
42
scm> (+ 1 2 3 4)
10
scm> (/ 8 2 2)
2
scm> (quotient 29 5)
... |
MODAL_REQUEST = {
"callback_id": "change_request_review",
"type": "modal",
"title": {
"type": "plain_text",
"text": "Switcher Change Request"
},
"submit": {
"type": "plain_text",
"text": "Submit"
},
"close": {
"type": "plain_text",
"text": "Cancel"
},
"blocks": [
{
"type": "context",
"eleme... |
class DataHelper:
""" ctpbee开发的数据读取器 ‘
针对各自csv数据以及json或者 数据库里面的数据
需要你提供数据地图以及如何进行字段转换
"""
def __init__(self, mapping: str):
self.mapping = mapping
def read_json(self, json_path: str):
raise NotImplemented
def read_csv(self, csv_path: str):
raise NotImplemented
|
def calculate_sleep_time_for_djymi(minutes_for_finished):
# сколько всего минут будет отведено на сон
st = minutes_for_finished // 2
# сколько целых часов будет длится сон
h = st // 60
# сколько минут (учитывая часы) будет длится сон
m = st % 60
return h, m
def hh_mm_to_str(hh, mm):
if ... |
# File: wildfire_consts.py
#
# Copyright (c) 2016-2022 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
birds = ( ('Passerculus sandwichensis','Savannah sparrow',18.7),
('Delichon urbica','House martin',19),
('Junco phaeonotus','Yellow-eyed junco',19.5),
('Junco hyemalis','Dark-eyed junco',19.6),
('Tachycineata bicolor','Tree swallow',20.2),
)
#(1) Write three separate li... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 29 22:07:42 2019
@author: CLIENTE
"""
#pega o heroi.txt
with open('C:\\Users\\CLIENTE\\Desktop\\heroi.txt','r',encoding='utf8') as arquivo:
dados = arquivo.readlines()
for i in range(len(dados)):
dados[i] = dados[i].rstrip('\n').split(';')
#cria o a... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 21 16:19:46 2018
@author: Sherry
Done
"""
def CorsairStats():
#Get base stats
Agility = 7 + d6()
Alertness = 3 + d6()
Charm = 2 + d6()
Cunning = 12 + d6()
Dexterity = 13 + d6()
Fate = 4 + d6()
Intelligence = 10 + d6()
... |
COLORS = {
'PROBLEM': 'red',
'RECOVERY': 'green',
'UP': 'green',
'ACKNOWLEDGEMENT': 'purple',
'FLAPPINGSTART': 'yellow',
'WARNING': 'yellow',
'UNKNOWN': 'gray',
'CRITICAL': 'red',
'FLAPPINGEND': 'green',
'FLAPPINGSTOP': 'green',
'FLAPPINGDISABLED': 'purple',
'DOWNTIMESTAR... |
def load(h):
return ({'abbr': 0,
'code': 0,
'title': 'Mass density (concentration)',
'units': 'kg m-3'},
{'abbr': 1,
'code': 1,
'title': 'Column-integrated mass density',
'units': 'kg m-2'},
{'abbr': 2,
... |
#===========================================================================
#
# Port to use for the web server. Configure the Eagle to use this
# port as it's 'cloud provider' using http://host:PORT
#
#===========================================================================
httpPort = 22042
#=====================... |
def runUserScript(func, params, paramTypes):
if (len(params) != len(paramTypes)):
onParameterError()
newParams = []
for i, val in enumerate(params):
newParams.append(parseParameter(i, paramTypes[i], val))
func(*newParams)
class Node:
def __init__(self, val, left, right,... |
def readlines(fname):
try:
with open(fname, 'r') as fpt:
return fpt.readlines()
except:
return []
def convert(data):
for i in range(len(data)):
try:
data[i] = float(data[i])
except ValueError:
continue
def csv_lst(fname):
l = readli... |
def functionA(A: torch.Tensor, B: torch.Tensor) -> torch.Tensor:
## TODO for students
output = A.sum(axis = 0) * B.sum()
return output
def functionB(C: torch.Tensor) -> torch.Tensor:
# TODO flatten the tensor C
C = C.flatten()
# TODO create the idx tensor to be concatenated to C
# here we're going ... |
minimum_points = 100
data_points = 150
if data_points >= minimum_points:
print("There are enough data points!")
if data_points < minimum_points:
print("Keep collecting data.") |
class restaurant:
yiyecek = {
"balık":20,
"tavk":17,
"köfte":15
}
icecek = {
"kola":3,
"ayran":1,
"su":1
}
tatli = {
"baklava":8,
"künefe":10,
"şöbiyet":8
}
def __init__(self, czd):
self.cz = 0
def yk(self, s... |
class Hand:
def __init__(self):
self.cards = []
self.value = 0
def add_card(self, card):
self.cards.append(card)
def calculate_value(self):
self.value = 0
has_ace = False
for card in self.cards:
if card.value.isnumeric():
self.val... |
# This module is used in `test_doctest`.
# It must not have a docstring.
def func_with_docstring():
"""Some unrelated info."""
def func_without_docstring():
pass
def func_with_doctest():
"""
This function really contains a test case.
>>> func_with_doctest.__name__
'func_with_doctest'
"... |
# -*- coding: utf-8 -*-
"""
pyalgs
~~~~~
pyalgs provides the python implementation of the Robert Sedgwick's Coursera course on Algorithms (Part I and Part II).
:copyright: (c) 2017 by Xianshun Chen.
:license: BSD, see LICENSE for more details.
"""
__version__ = '0.01-dev' |
#
# PySNMP MIB module GSM7312-QOS-ACL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/GSM7312-QOS-ACL-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:20:03 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... |
class AttributeUsageAttribute(Attribute,_Attribute):
"""
Specifies the usage of another attribute class. This class cannot be inherited.
AttributeUsageAttribute(validOn: AttributeTargets)
"""
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__... |
"""
Backports of library components from newer python versions.
For internal use only.
"""
|
'''
UFCG
PROGRAMAÇÃO 1
JOSE ARTHUR NEVES DE BRITO - 119210204
CONSTRUCAO CONDOMINIO
'''
l1 = float(input())
l2 = float(input())
area = float(input())
area_terreno = l1 * l2
qtd_casas = area_terreno // area
print('{} casa(s) pode(m) ser construída(s) no terreno.'.format(int(qtd_casas)))
|
settings = {
"ARCHIVE" : True,
"MAX_POSTS" : 5000
}
|
def minim(lst):
min = 100000
minI = 99999
for i in range(len(lst)):
if lst[i]<min:
min = lst[i]
minI=i
return min,minI
lst = list(map(int, input().split()))
lst2 = len(lst)*[0]
min = lst[1]
for i in range(len(lst)):
x,y = minim(lst)
lst2.append(x)
# print(minim... |
class CapacityMixin:
@staticmethod
def get_capacity(capacity, amount):
if amount > capacity:
return "Capacity reached!"
return capacity - amount
|
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'program',
'type': 'executable',
'msvs_cygwin_shell': 0,
'sources': [
'program.c',... |
jogadores = []
jogador = {}
gols = []
somagols = gol = 0
while True:
jogador['nome'] = str(input('Nome do jogador: ')).strip().title()
partidas = int(input(f'Quantas partidas {jogador["nome"]} jogou? '))
for p in range(0, partidas):
gol = int(input(f'Quantos gols na partida {p + 1}? '))
som... |
print("Enter Num 1 : ")
num1 = int(input())
print("Enter Num 2 : ")
num2 = int(input())
print("Sum = ", num1+num2)
print("This is important") |
def likelihood(theta_hat, x, y):
"""The likelihood function for a linear model with noise sampled from a
Gaussian distribution with zero mean and unit variance.
Args:
theta_hat (float): An estimate of the slope parameter.
x (ndarray): An array of shape (samples,) that contains the input values.
... |
UI={
'new_goal':{
't':'Send me the name of your goal'
}
}
|
"""
Write a Python program to count occurrences of a substring in a string.
"""
str1 = "This pandemic is something serious, in the sense that a virus can spread while lockdown is on. Let's re_examine this virus please."
print("The Text is:", str1)
print()
print("The Number of occurence of the word virus is: ",str1.cou... |
#if customizations are required when doing the update of the code of the jpackage
def main(j,jp,force=False):
recipe=jp.getCodeMgmtRecipe()
recipe.update(force=force)
|
"""Targets for generating TensorFlow Python API __init__.py files."""
# keep sorted
TENSORFLOW_API_INIT_FILES = [
# BEGIN GENERATED FILES
"__init__.py",
"app/__init__.py",
"bitwise/__init__.py",
"compat/__init__.py",
"data/__init__.py",
"debugging/__init__.py",
"distributions/__init__.p... |
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# 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 a... |
def maximo(x, y):
if x > y:
return x
else:
return y
|
########
# PART 1
def get_layers(data, width = 25, height = 6):
layers = []
while data:
layer = []
for _ in range(width * height):
layer.append(data.pop(0))
layers.append(layer)
return layers
def count_digit_on_layer(layer, digit):
return sum([1 for val in layer if v... |
# System phrases
started: str = "Bot {} started"
closed: str = "Bot disabled"
loaded_cog: str = "Load cog - {}"
loading_failed: str = "Failed to load cog - {}\n{}"
kill: str = "Bot disabled"
# System errors
not_owner: str = "You have to be bot's owner to use this command"
# LanguageService
lang_changed: str = "Langua... |
wordlist = [
"a's",
"able",
"about",
"above",
"according",
"accordingly",
"across",
"actually",
"after",
"afterwards",
"again",
"against",
"ain't",
"all",
"allow",
"allows",
"almost",
"alone",
"along",
"already",
"also",
"although",... |
sample_trajectory = [[[8.29394929e-01, 2.94382693e-05, 1.24370992e+00], [0.8300607, 0.00321705, 1.24627523],
[0.83197002, 0.01345206, 1.25535293], [0.83280536, 0.02711211, 1.26502481],
[0.83431212, 0.04126721, 1.27488879], [0.83557291, 0.05575593, 1.28517274],
... |
###
# Copyright 2019 Hewlett Packard Enterprise, Inc. 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 ... |
# https://binarysearch.com/
# GGA 2020.12.04
"""
User Problem
You Have:
You Need:
You Must:
Input/Output Example:
Solution (Feature/Product)
(Edge cases)
Reflect On, Improvements, Comparisons with other Solutions:
I learned:
"""
# function counting 'only-children' in tree
class Solution:
def solve(se... |
#-*- coding: utf-8 -*-
# https://github.com/Kodi-vStream/venom-xbmc-addons
class iHoster:
def getDisplayName(self):
raise NotImplementedError()
def setDisplayName(self, sDisplayName):
raise NotImplementedError()
def setFileName(self, sFileName):
raise NotImplementedError()
d... |
"""
LC887 -- super egg drop
You are given K eggs, and you have access to a building with N floors from 1 to N.
Each egg is identical in function, and if an egg breaks, you cannot drop it again.
You know that there exists a floor F with 0 <= F <= N such that any egg dropped at a floor higher than F will break, and an... |
expected_output={
"drops":{
"IN_US_CL_V4_PKT_FAILED_POLICY":{
"drop_type":8,
"packets":11019,
},
"IN_US_V4_PKT_SA_NOT_FOUND_SPI":{
"drop_type":4,
"p... |
lista = list()
lista_par = list()
lista_impar = list()
while True:
lista.append(int(input("Introduza um nr: ")))
continuar = input("Deseja continuar? (S/N) _").strip().upper()[0]
if continuar == "N":
break
for c in lista:
if c % 2 == 0:
lista_par.append(c)
else:
lista_impar.append(c)
pri... |
# coding=utf8
class Unavailability(object):
'''
Classe Unavailabitily définissant une indisponibilité
attributs publics :
- worker : l'ouvrier de l'affectation (Worker.Worker)
- phase : la phase de l'affectation (Phase.Phase)
'''
def __init__(self, idWorker=-1, numWeek=-1, numYear=-1,... |
#
# PySNMP MIB module FASTPATH-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/FASTPATH-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:12:15 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019,... |
# python3.7
"""Configuration for StyleGAN training demo.
All settings are particularly used for one replica (GPU), such as `batch_size`
and `num_workers`.
"""
runner_type = 'StyleGANRunner'
gan_type = 'stylegan'
resolution = 64
batch_size = 4
val_batch_size = 32
total_img = 100_000
# Training dataset is repeated at ... |
"""Planets"""
LIGHT_GREY = (220, 220, 220)
ORANGE = (255, 128, 0)
BLUE = (0, 0, 255)
RED = (255, 0, 0)
YELLOW = (255, 255, 0)
LIGHT_BLUE = (0, 255, 255)
class Planet:
"""Planet"""
def __init__(self, name, mass, diameter, density, gravity, esc_velocity, rotation_period, day_length, from_sun, perihelion, aphel... |
# Time: O(1)
# Space: O(1)
#
# Write a function to delete a node (except the tail) in a singly linked list,
# given only access to that node.
#
# Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node
# with value 3, the linked list should become 1 -> 2 -> 4 after calling your function.
#
# Defi... |
#sum in python
'''
weight = float(input("Weight:"))
height = float(input("height"))
total = weight + height
print(total)
'''
#cal monthly salary
'''
import math
age= 17
pi= 3.14
print(type(age),age)
print(type(pi),pi)
print(math.pi)
salary = float(input('Salary: ')) #float convert text(string) to number with decima... |
# Time: O(n)
# Space: O(1)
# Write a program that outputs the string representation of numbers from 1 to n.
#
# But for multiples of three it should output “Fizz” instead of the number and for
# the multiples of five output “Buzz”. For numbers which are multiples of both three
# and five output “FizzBuzz”.
#
# Exampl... |
nonverified_users = ['calvin klein','ralph lauren','christian dior','donna karran']
verified_users = []
#verifying if there are new users and moving them to a verified list
while nonverified_users:
current_user = nonverified_users.pop()
print(f"\nVerifying user: {current_user}")
verified_users.append(curre... |
# from ..interpreter import model
# Commented out to make static node recovery be used
# @model('map_server', 'map_server')
def map_server(c):
c.read('~frame_id', 'map')
c.read('~negate', 0)
c.read('~occupied_thresh', 0.65)
c.read('~free_thresh', 0.196)
c.provide('static_map', 'nav_msgs/GetMap')
... |
def func1():
def func2():
return True
return func2()
if(func1()):
print("Acabou")
|
fname = input('Enter File: ')
if len(fname) < 1:
fname = 'clown.txt'
hand = open(fname)
di = dict()
for lin in hand:
lin = lin.rstrip()
wds = lin.split()
#print(wds)
for w in wds:
# if the key is not there the count is zero
#print(w)
#print('**',w,di.get(w,-99))
#... |
'''
Square Root of Integer
Asked in:
Facebook
Amazon
Microsoft
Given an integar A.
Compute and return the square root of A.
If A is not a perfect square, return floor(sqrt(A)).
DO NOT USE SQRT FUNCTION FROM STANDARD LIBRARY
Input Format
The first and only argument given is the integer A.
Output Format
Return ... |
# buildifier: disable=module-docstring
load("//bazel/platform:transitions.bzl", "risc0_transition")
# https://github.com/bazelbuild/bazel/blob/master/src/main/starlark/builtins_bzl/common/cc/cc_library.bzl
CC_TOOLCHAIN_TYPE = "@bazel_tools//tools/cpp:toolchain_type"
def _get_compilation_contexts_from_deps(deps):
... |
# Merge sort is a divide and conquer type of algorithm that consists of two steps.
# 1) Continuously divide the unsorted list until you have N sublists, where each sublist has 1 element that is “unsorted” and N is the number of elements in the original array.
# 2) Repeatedly merge i.e conquer the sublists togethe... |
"""Cornershop Models.
"""
class Aisle:
"""Model for an aisle.
"""
def __init__(self, data:dict):
for key in data:
setattr(self, key, data[key])
self.products = [Product(p) for p in self.products]
def __repr__(self) -> str:
return f'<cornershop.models.Aisle: {... |
# 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... |
"""
==========================
kikola.contrib.basicsearch
==========================
Application to lightweight search over models, existed in your project.
Installation
============
1. Add ``kikola.contrib.basicsearch`` to your project's ``settings``
``INSTALLED_APPS`` var.
2. Set up ``SEARCH_MODELS`` var in yo... |
"""
##################################################################################################
# Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved.
# Filename : lgpma_pub.py
# Abstract : Model settings for LGPMA detector on PubTabNet
# Current Ver... |
class Solution:
def findLHS(self, nums: List[int]) -> int:
d=collections.defaultdict(lambda:0)
for i in range(0,len(nums)):
d[nums[i]]+=1
maxi=0
for i in d.keys():
if(d.get(i+1,"E")!="E"):
maxi=max(maxi,d[i]+d[i+1])
return maxi
|
telugumap = {
0: u"సున్న",
1: u"ఒకటి",
2: u"రెండు",
3: u"మూడు",
4: u"నాలుగు",
5: u"ఐదు",
6: u"ఆరు",
7: u"ఏడు",
8: u"ఎనిమిది",
9: u"తొమ్మిది",
10: u"పది",
11: u"పదకొండు",
12: u"పన్నెండు",
13: u"పదమూడు",
14: u"పద్నాలుగు",
15: u"పదిహేను",
16: u"పదహారు",
... |
model_config = {}
# alpha config
model_config['alpha_jump_mode'] = "linear"
model_config['iter_alpha_jump'] = []
model_config['alpha_jump_vals'] = []
model_config['alpha_n_jumps'] = [0, 600, 600, 600, 600, 600, 600, 600, 600]
model_config['alpha_size_jumps'] = [0, 32, 32, 32, 32, 32, 32, 32, 32, 32]
# base config
mod... |
"""
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 multiples_sum():
return sum(i for i in range(1000) if (i % 3 == 0 or i % 5 == 0))
|
class LineItem(object):
def __init__(self, description, weight, price):
self.description = description
self.set_weight(weight)
self.price = price
def subtotal(self):
return self.get_weight() * self.price
def get_weight(self):
return self.__weight
def set_weigh... |
_out_ = ""
_in_ = ""
_err_ = ""
_root_ = "" |
class FrontMiddleBackQueue:
def __init__(self):
self.queue = []
def pushFront(self, val: int):
self.queue.insert(0,val)
def pushMiddle(self, val: int):
self.queue.insert(len(self.queue) // 2,val)
def pushBack(self, val: int):
self.queue.append(val)
d... |
# Right click functions and operators
def dump(obj, text):
print('-'*40, text, '-'*40)
for attr in dir(obj):
if hasattr( obj, attr ):
print( "obj.%s = %s" % (attr, getattr(obj, attr)))
def split_path(str):
"""Splits a data path into rna + id.
This is the core of creating controls f... |
# alternative characters
T = input()
lst = []
results = []
if T >= 1 and T <= 10:
for i in range(T):
lst.append(raw_input())
lst = filter(lambda x: len(x) >= 1 and len(x) <= 10**5, lst)
for cst in lst:
delct = 0
for j in range(len(cst)-1):
if cst[j] == cst[j+1]:
... |
a = int(input())
c = int(input())
s = True
for b in range(a - 1):
if int(input()) >= c:
s = False
if s:
print("YES")
else:
print("NO") |
n, m = map(int, input().split())
shops = [tuple(map(int, input().split())) for _ in range(n)]
shops.sort(key=lambda x: x[0])
ans = 0
for a, b in shops:
if m <= b:
ans += a * m
break
else:
ans += a * b
m -= b
print(ans) |
'''
Power of Two
Solution
Given an integer, write a function to determine if it is a power of two.
Example 1:
Input: 1
Output: true
Explanation: 20 = 1
Example 2:
Input: 16
Output: true
Explanation: 24 = 16
Example 3:
Input: 218
Output: false'''
n = int(input())
if n <= 0 :
print('false')... |
# Copyright 2017 Lawrence Kesteloot
#
# 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... |
# eerste negen cijfers van ISBN-10 code inlezen en omzetten naar integers
x1 = int(input())
x2 = int(input())
x3 = int(input())
x4 = int(input())
x5 = int(input())
x6 = int(input())
x7 = int(input())
x8 = int(input())
x9 = int(input())
# controlecijfer berekenen
x10 = (x1 + 2 * x2 + 3 * x3 + 4 * x4 + 5 * x5 + 6 * x6 +... |
def get_attr_or_callable(obj, name):
target = getattr(obj, name)
if callable(target):
return target()
return target
|
SAMPLE_NRTM_V3 = """
% NRTM v3 contains serials per object.
% Another comment
%START Version: 3 TEST 11012700-11012701
ADD 11012700
person: NRTM test
address: NowhereLand
source: TEST
DEL 11012701
inetnum: 192.0.2.0 - 192.0.2.255
source: TEST
%END TEST
"""
# NRTM v1 has no serials per object
SAMPLE_NRTM_V1 = ""... |
class Packager:
"""
Packager class.
This class is used to generate the required XML to send back to the client.
"""
def __init__(self):
self.xml_version = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
self.begin_root = "<kevlar>"
self.end_root = "</kevlar>"
def generate_... |
# These are the "Tableau 20" colors as RGB.
tableau20 = [(31, 119, 180), (174, 199, 232), (255, 127, 14), (255, 187, 120),
(44, 160, 44), (152, 223, 138), (214, 39, 40), (255, 152, 150),
(148, 103, 189), (197, 176, 213), (140, 86, 75), (196, 156, 148),
(227, 119, 1... |
"""Utility functions for RtMidi backend.
These are in a separate file so they can be tested without
the `python-rtmidi` package.
"""
def expand_alsa_port_name(port_names, name):
"""Expand ALSA port name.
RtMidi/ALSA includes client name and client:port number in
the port name, for example:
TiM... |
# -*- coding: utf-8 -*-
# Which templates don't you want to generate? (You can use regular expressions here!)
# Use strings (with single or double quotes), and separate each template/regex in a line terminated with a comma.
IGNORE_JINJA_TEMPLATES = [
'.*base.jinja',
'.*tests/.*'
]
# Do you have any additional... |
c = ('\033[m' # 0 - SEN COR
'\033[0;30;41m', # 1 - VERMELHO
'\033[0;30;42m', # 2 - VERDE
'\033[0;30;43m', # 3 - AMARELO
'\033[0;30;44m', # 4 - AZUL
'\033[7;30mm', #6 - BRANCO
'\033[0;30;45m', # 5 - ROXO
);
def ajudainterativa(com):
titulo('Acessando o manual do co... |
class Solution(object):
# def removeDuplicates(self, nums):
# """
# :type nums: List[int]
# :rtype: int
# """
# ls = len(nums)
# if ls <= 1:
# return ls
# last = nums[0]
# pos = 1
# for t in nums[1:]:
# ... |
class Solution:
def combine(self, n: int, k: int) -> List[List[int]]:
results = []
def dfs (elements, start: int, k: int):
if k == 0:
results.append(elements[:])
for i in range (start, n+1):
elements.... |
load(
"@build_bazel_rules_apple//apple:providers.bzl",
"AppleBundleInfo",
"AppleResourceInfo",
"IosFrameworkBundleInfo",
)
load(
"@build_bazel_rules_apple//apple/internal:resources.bzl",
"resources",
)
load(
"//rules:providers.bzl",
"AvoidDepsInfo",
)
load(
"@build_bazel_rules_apple/... |
text = 'Writing to a file which\n'
fileis = open('hello.txt', 'w')
fileis.write(text)
fileis.close() |
def gcd(p, q):
pTrue = isinstance(p,int)
qTrue = isinstance(q,int)
if pTrue and qTrue:
if q == 0:
return p
r = p%q
return gcd(q,r)
else:
print("Error!")
return 0 |
# -*- coding: utf-8 -*-
keywords = {
"abbrev",
"abs",
"abstime",
"abstimeeq",
"abstimege",
"abstimegt",
"abstimein",
"abstimele",
"abstimelt",
"abstimene",
"abstimeout",
"abstimerecv",
"abstimesend",
"aclcontains",
"aclinsert",
"aclitemeq",
"aclitemin... |
# 231A - Team
# http://codeforces.com/problemset/problem/231/A
n = int(input())
c = 0
for i in range(n):
arr = [x for x in input().split() if int(x) == 1]
if len(arr) >= 2:
c += 1
print(c)
|
"""Base class for Node and LinkedLists"""
class BaseLinkedList:
def __init__(self):
pass
class BaseNode:
def __init__(self, val=0, next_node=None):
self._val = val
self._next_node = next_node
def __repr__(self):
return f"Node({self.val, self._next_node})" |
description = 'XCCM'
group = 'basic'
includes = [
# 'source',
# 'table',
# 'detector',
'virtual_sample_motors',
'virtual_detector_motors',
'virtual_optic_motors',
'virtual_IOcard',
'optic_tool_switch',
'virtual_capillary_motors',
'capillary_selector'
]
|
""" https://www.hackerrank.com/challenges/binary-search-tree-insertion/problem """
# CODE PROVIDED BY TASK STARTS
class Node:
def __init__(self, info):
self.info = info
self.left = None
self.right = None
self.level = None
def __str__(self):
return str(self.info)
def... |
"""Triples are a way to define information about a platform/system. This module provides
a way to convert a triple string into a well structured object to avoid constant string
parsing in starlark code.
Triples can be described at the following link:
https://clang.llvm.org/docs/CrossCompilation.html#target-triple
"""... |
# -*- coding:utf-8 -*-
"""
Description:
Script OP Code
Usage:
from AntShares.Core.Scripts.ScriptOp import ScriptOp
"""
class ScriptOp(object):
# Constants
OP_0 = 0x00 # An empty array of bytes is pushed onto the stack. (This is not a no-op: an item is added to the stack.)
OP_FALSE = OP_0
OP_PU... |
def triplewise(it):
try:
a, b = next(it), next(it)
except StopIteration:
return
for c in it:
yield a, b, c
a, b = b, c
def inc_count(values):
last = None
count = 0
for v in values:
if last is not None and v > last:
count += 1
last = v... |
definitions = {
"StringArray": {
"type": "array",
"items": {
"type": "string",
}
},
"AudioEncoding": {
"type": "string",
"enum": ["LINEAR16", "ALAW", "MULAW", "LINEAR32F", "RAW_OPUS", "MPEG_AUDIO"]
},
"VoiceActivityDetectionConfig": {
"type... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.