content stringlengths 7 1.05M |
|---|
#
# PySNMP MIB module TIARA-GENERIC-HDLC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TIARA-GENERIC-HDLC-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:08:59 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (d... |
#!/opt/homebrew/opt/python@3.10/bin/python
indata = []
with open("input") as infile:
for line in infile:
line = line.strip()
indata.append(line)
o2_gen_rating = 1
vals = indata.copy()
for i in range(len(indata[0])):
zeroes = 0
ones = 0
for val in vals:
if val[i] == "0":
... |
number = int(input('Please insert any number'))
if number % 2 == 0 :
print('this number is par')
else:
print('this number is impar') |
first = 'Hello World. This is python string tutorial'
string_methods = ['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len_... |
NO_TYPE_PENALTY_TYPES_1 = ["SPE1", "SPE2", "REL", "SIMI"]
NO_TYPE_PENALTY_TYPES_2 = ["SPE1", "SPE2", "SIMI"]
NO_TYPE_PENALTY_EQUI_2 = ["EQUI"]
class F1Metrics:
def __init__(self, predicted_types, predicted_scores, target_types, target_scores, num_tokens):
self._predicted_types = predicted_types
... |
#!/usr/bin/python
class FilterModule(object):
def filters(self):
return {
'get_mid_stages' : self.get_mid_stages,
'get_preprod' : self.get_preprod
}
def get_preprod(self, stages):
for i in range(len(stages)):
if stages[i]["name"] == "prod" :
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Dice(object):
"""
This class is used to store information about
a dice that is detected on the grid.
"""
def __init__(self, x, y, top_face):
"""
This initializes the values of a detected dice.
:param row: The where the di... |
# Replace the below values with your values
NEXMO_API_KEY = "<your-api-key>"
NEXMO_API_SECRET = "<your-api-secret>"
NEXMO_NUMBER = "+447512345678"
NEXMO_APPLICATION_ID = "<nexmo-application-id>"
NEXMO_PRIVATE_KEY = '''-----BEGIN PRIVATE KEY-----
<your-private-key>
-----END PRIVATE KEY-----'''
# You will have to sign u... |
a=m=''
for x in input()[::-1]:
if x>=m: a+=x
m=max(m,x)
print(a[::-1])
|
fhand = open('mbox-short_1.txt')
count = 0
for line in fhand:
words = line.split()
#print('Debug: ', words)
if len(words) > 2 and words[0] == 'From' :
print(words[2]) |
"""
BaseClass module for Numerical Methods
for Non-Linear root finding
"""
class Nu_Meth:
_max_iter = 500 # maximum iteriation before the solver quits
_tol = 0.0001 # tolerance
def __init__():
pass
def execute(self):
raise NotImplemented
def set_tol(self,tol):
... |
# 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 tree2str(self, t: TreeNode) -> str:
# def buildTree(node):
# ans = ''
# ... |
class Tier:
def __init__(self):
self.children = [None] * 26
self.complete_word = 0
def __str__(self):
return f'{self.children} and {self.complete_word}'
class WordDictionary:
def __init__(self):
self.root = Tier()
self.found = list()
def get_index(self, char):... |
class Node:
def __init__(self, val):
self.value = val
self.next = None
class LinkedList(object):
def __init__(self, Node):
self.head = Node
# Insert Node at the front.
def push(self, val):
# Allocate the new node
new_node = Node(val)
# Point the new nod... |
"""
DoJo Challenge for April 4, 2019 - for experienced Python developers.
A knight's tour is a sequence of moves by a knight on a chessboard such that
all squares are visited once.
Given N, write a function to return the number of knight's tours on an N by
N chessboard.
Source: Daily Coding Problems (https://www.da... |
"""
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=1500 ] = 0.107
Average Precision (AP) @[ IoU=0.25 | area= all | maxDets=1500 ] = -1.000
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=1500 ] = 0.251
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=1500 ] = 0... |
"""Interop with cc_* rules
These rules are temporary and will be deprecated in the future.
"""
load(":providers.bzl",
"HaskellPackageInfo",
"CcSkylarkApiProviderHacked",
)
load(":set.bzl", "set")
def cc_headers(ctx):
"""Bring in scope the header files of dependencies, if any.
*Internal function - do ... |
# Complete the compareTriplets function below.
def compareTriplets(a, b):
pointa = 0
pointb = 0
for i in range(0, 3):
if a[i] > b[i]:
pointa += 1
elif a[i] < b[i]:
pointb += 1
return (pointa, pointb)
if __name__ == '__main__':
a = list(map(int, input().rstri... |
def fact(n):
if n==1:
return 1
return n*fact(n-1)
print(fact(2))
|
"""Decrease a key in of a Binary Heap """
class Heap:
def __init__(self, cap):
self.capacity = cap
self.arr = [0 for _ in range(cap)]
self.size = 0
def insert(self, val):
if self.capacity > self.size:
self.size += 1
self.arr[self.size - 1] = val
... |
r=[]
for _ in range(int(input())):
n,z,y,x=input().split()
x,y,z=int(x),int(y),int(z)
r.append((x,y,z,n))
r.sort()
print(r[-1][3])
print(r[0][3]) |
def get_eth1_data(block: Eth1Block) -> Eth1Data:
"""
A stub function return mocking Eth1Data.
"""
return Eth1Data(
deposit_root=block.deposit_root,
deposit_count=block.deposit_count,
block_hash=hash_tree_root(block))
def cache_this(key_fn, value_fn, lru_size): # type: ignore
... |
#
# PySNMP MIB module Juniper-IP-TUNNEL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-IP-TUNNEL-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:03:07 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... |
height = int(input())
c = 1
for i in range(1,height-1):
for j in range(1,i+1):
if(c <= 9):
print("",c,end=" ")
else:
print(c,end=" ")
c += 1
print()
for i in range(height-1,0,-1):
for j in range(height,height-i,-1):
if(c <= 9):
... |
# Exercise 062 - Super Arithmetic Progression v3.0
"""Improve CHALLENGE 061 by asking the user if he wants to show some more terms.
The program will terminate when it says it wants to display 0 terms."""
"""The difference between this program and the previous one is that
we create two new flags and add one more loop... |
# Obtenga la entrada del usuario usando input
# ("Escribe elnombre de una fruta:"). Si una fruta
# no existe en la lista, agregue la fruta
# a la lista e imprima la lista modificada.
# Si la fruta existe print('Esa fruta ya existe en la lista')
# La siguiente lista contiene algunas frutas:
# fruits = ['platano', 'naran... |
indices = [i for i in range(1,58)]
#If some of the trajectories crash you can discard them in the following way
#indices.remove(54)
#indices.remove(53)
f1 = open('metadatafile.in','w')
for i in indices:
print('US_data/US_%d_data.dat'%i, '%0.1f'%(31.5+0.5*float(i)), 4.0, 50.0, file=f1)
#The above line wrtites ... |
# https://leetcode.com/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
def _dfs(root1: TreeNode, root2: TreeNode, target1: TreeN... |
# Multiple assignments
#name = "Sai"
#age = 18
#attractive = True
name, age, attractive="Sai", 18, True
gg=ss=ff=1000
print(name)
print(age)
print(attractive)
|
#
# PySNMP MIB module RUCKUS-PRODUCTS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RUCKUS-PRODUCTS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:50:43 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... |
_base_to_bit = {
'T': '00', 't': '00',
'C': '01', 'c': '01',
'A': '10', 'a': '10',
'G': '11', 'g': '11',
'N': '00'} # Like T in two bits
_bits_to_base = {
0: 'T',
1: 'C',
2: 'A',
3: 'G',
4: 'N'} # Like T in two bits
_bits_to_comp = {
... |
def OptimizedNativePatternSearch(pat,txt):
M = len(pat)
N = len(txt)
i = 0
while i < N-M:
j = 0
while j < M:
if txt[i+j] != pat[j]:
break
j += 1
if j == M:
print("The pattern starts from index", i)
... |
# from math import floor
#
#
# def decom(x, y):
# if y > x/2:
# return 1
# else:
# counter = 1
# for i in range(y, floor(x/2) + 1):
# counter += chart[x - i - 1][i - 1]
# return counter
#
# # a = 61
# # k = 1
# # while k != 0:
# # print(a)
# # ... |
# Enter your code here. Read input from STDIN. Print output to STDOUT
i = input()
values = []
weights = []
values = list(map(int,input().split()))
weights = list(map(int,input().split()))
s = 0
for x, y in zip(values, weights):
s += x * y
weighted_avg = round(s / sum(weights), 1)
print(weighted_avg)
|
class YOLOV3CustomTraining:
"""YOLO V3 Custom Training API
Parameters
---------
classes: iterable of str
Names of custom foreground classes. `len(classes)` is the number of foreground classes.
train_data: RecordFileDetection
Instance of RecordFileDetection with training data
val_... |
class QueueEvent:
def __init__(self, delay, event_name, event_object):
self.delay = delay
self.event_name = event_name
self.event_object = event_object
self.done = False
class Queue:
def __init__(self):
self.events = []
def tick(self):
for event in self.eve... |
#
# PySNMP MIB module VDSL-LINE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/VDSL-LINE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:57:23 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... |
n = int(input())
a = [[0] * n for i in range(n)]
for i in range(n):
for j in range(n):
a[i][j] = abs(i - j)
for line in a:
print(*line) |
#
# This file contains the Python code from Program 7.17 of
# "Data Structures and Algorithms
# with Object-Oriented Design Patterns in Python"
# by Bruno R. Preiss.
#
# Copyright (c) 2003 by Bruno R. Preiss, P.Eng. All rights reserved.
#
# http://www.brpreiss.com/books/opus7/programs/pgm07_17.txt
#
class OrderedListA... |
def longestPalindromicSubstring(str):
n=len(str)
dp=[[0 for x in range(n)] for y in range(n)]
maxlength,start=1,0
for i in range(n):
dp[i][i]=True
i=0
while i<n-1:
if str[i]==str[i+1]:
dp[i][i+1]=True
start=i
maxlength=2
i+=1
... |
"""
57 - Faça um programa que conte quantos números primos existirem entre a e b, onde a e b são números informados pelo usuário.
"""
i, j, k = 0, 0, 0 # Declarando as variáveis
a = int(input('Digite um número para a: '))
b = int(input('Digite um número para b maior que a: '))
cont = 0
for i in range(a, b + 1):
... |
extensions = []
source_suffix = '.rst'
master_doc = 'index'
project = u'Confit'
copyright = u'2012, Adrian Sampson'
version = '0.1'
release = '0.1.0'
exclude_patterns = ['_build']
pygments_style = 'sphinx'
# -- Options for HTML output ---------------------------------------------------
html_theme = 'default'
html... |
with open("Chinese_c_cpp.txt") as f:
s = f.read() + '\n'
print(repr(s))
|
def square(x):
"""Return the square of x.
>>> square(2)
4
>>> square(-2)
4
>>> square(2.0)
4
>>> square(-2.0)
4
>>> square(1j)
(-1 + 0j)
>>> square('2')
TypeError
"""
return x * x
|
class Solution:
def longestPalindrome(self, s: str) -> str:
n = len(s)
la = 0
ra = 1
l = 0
r = n
while l < r:
if r - l > ra - la:
ok = True
lt = l
rt = r
while lt < rt:
if... |
#
# PySNMP MIB module CMC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CMC-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:25:10 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, 09:23:15)... |
class Solution:
def minimumLengthEncoding(self, words: 'List[str]') -> 'int':
trie = []
def insert(s, si=0, next_i=0):
if si == len(s): return
if next_i == len(trie): trie.append({})
if s[si] not in trie[next_i]:
trie.append({})
... |
# regular expressions used by QCbot-B
IDS = dict(
p1=r'b\d{8}[0-9|x]',
p2=r'o\d{7}[0-9|x]')
SUBJECT_PERSON_FALSE = r'-- Fiction\.|-- Juvenile fiction\.' \
r'|-- Drama\.|-- Juvenile drama\.' \
r'|-- Poetry\.|-- Juvenile poetry\.'
SUBJECT_PERSON = [
r'^880-\d{... |
class Solution(object):
def findRelativeRanks(self, nums):
"""
:type nums: List[int]
:rtype: List[str]
"""
sorted_nums = sorted(nums)[::-1]
rank = ["Gold Medal", "Silver Medal", "Bronze Medal"] \
+ map(str, range(4, len(nums) + 1))
return map(dict(... |
# Can also use command line to set these. Command line arguments will take priority
# Board Config options
bc_number = "10451.1"
#test_type = "crid0"
test_type = "crid1fullsuite"
board_type = "N1100FX"
mac_address = "000af7314300" # used for MAC ID
# Files copied from local to remote
bnxtmt_bnxt_en_bundle_path = "..... |
#!/usr/bin/env python3
class Solution(object):
def findWords(self, board, words):
trie = dict()
for word in words:
current_dict = trie
for c in word:
current_dict = current_dict.setdefault(c, {})
current_dict['$'] = word
nr, nc = len(board... |
#
# PySNMP MIB module CISCO-GGSN-CAPABILITY (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-GGSN-CAPABILITY
# Produced by pysmi-0.3.4 at Wed May 1 11:59:01 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... |
class Solution(object):
def firstMissingPositive(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
n = len(nums)
arr = [True for i in range(n+2)]
arr[0] = False
for num in nums:
if 0<num<=(n+1):
arr[num]=False
... |
class Arrays:
def __init__(self, size):
self.n = size # Size of static array
self.arr = []
self.arr[:self.n] = 'o' * (size + 1) # 'o' is the empty marker
self.end = 0 # Position of end of file marker
def insert(self, element, index=None):
''' Inserting element ... |
"""
0152. Maximum Product Subarray
Medium
Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product.
Example 1:
Input: [2,3,-2,4]
Output: 6
Explanation: [2,3] has the largest product 6.
Example 2:
Input: [-2,0,-1]
Output: 0
Explanation: ... |
# coding:utf-8
'''
@author = super_fazai
@File : queue_utils.py
@connect : superonesfazai@gmail.com
'''
"""
queue utils
"""
|
# For 4, 3 will return:
# [
# [1,1,1,1],
# [2,1,1],
# [2,2],
# [3,1]
# ]
def seqs(ones, mx, seq=[]):
mx = mx if mx <= ones else ones
if ones > 0:
sqs = []
for i in range(1, mx+1):
sqs.extend(seqs(ones-i, i, seq + [i]))
return sqs
else:
return [seq]
# Cal... |
def factorial(n):
if n == 1:
return 1
return n * factorial(n - 1)
def get_digits(n):
for digit in str(n):
yield int(digit)
print(sum(get_digits(factorial(10))))
print(sum(get_digits(factorial(100))))
|
class Solution:
def smallestRepunitDivByK(self, K: int) -> int:
if K % 10 not in {1, 3, 7, 9}: return -1
MOD, MOD_SET = 0, set()
for length in range(1, K + 1):
MOD = (10 * MOD + 1) % K
if MOD == 0: return length
if MOD... |
# OpenWeatherMap API Key
weather_api_key = "eeb909dcaefe8f86bd5b42aac61797bc"
# Google API Key
g_key = "AIzaSyB2LzrZz7y9I-0AeDPiR8EckxUQd54T9eo"
|
#
# PySNMP MIB module ALTEON-CHEETAH-NETWORK-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALTEON-CHEETAH-NETWORK-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:20:58 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version ... |
# Wrong answer
c, e, m = map(int, input().split())
if c == 4:
surface = (c + e + m) ** 0.5
if surface == int(surface):
print(int(surface), int(surface), flush=True)
else:
root1 = (-(e / 2) / 2) + ((((e / 2) / 2) ** 2 - m) ** 0.5)
root2 = (-(e / 2) / 2) - ((((e / 2) / 2) ** 2 - m) *... |
filename = "../Docs/crickets.txt"
print('host', 'IP', 'root_pwd')
lines = [line.rstrip('\n') for line in open(filename)]
for line in lines:
a = line.split()
cron_file = a[1] + "_cron"
cfile = open(cron_file, 'w')
#arr = a[1].split('et')
for i in range(1,61):
cricket = a[1] + "_" + str(i)
... |
#!/usr/bin/env python3
'''
Faça um programa que receba dois números inteiros e gere os números inteiros que estão no intervalo compreendido por eles.
'''
#FOR
for num in range(int(input("Digite o 1º número: "))+1,int(input("Digite o 2º número: ")),1):
print(num)
#WHILE
#num1=int(input("Digite o 1º número: "))
#nu... |
class BaseBackend(object):
"""Backends should implement this interface."""
def count(self, request, ip=True, field=None, period=60):
raise NotImplementedError
def limit(self, request, ip=True, field=None, count=5):
raise NotImplementedError
|
{
"targets": [
{
"target_name": "node_sketch_bridge",
"sources": [
"main.m"
],
"conditions": [
[
"OS=='mac'",
{
"defines": [
"__MACOSX_CORE__"
],
"link_settings": {
"libraries": [
... |
'''
어렵다. 그냥 찍자.
'''
print("1") #10
print("4") #10
|
x={}
y={"apple"}
print(type(x))
print(type(y))
# add set item in x
# x.add("orange")
x["color"]="red"
x["type"]="apple"
x["price"]=1000.0
print(type(x), x)
for i,j in x.items():
print(i,j);
|
# -*- coding: utf-8 -*-
# 2021/11/6
# create by: snower
class DataValuerLoaderOption:
pass
class DataValuerOutputerOption:
def __init__(self, changed_require_update=False):
self.changed_require_update = changed_require_update
|
def organizar(vetor):
quantidade_trocas = 0
i = 1
while i < len(vetor):
while vetor[i] != i:
quantidade_trocas += 1
tmp = vetor[i]
vetor[i] = vetor[tmp]
vetor[tmp] = tmp
i += 1
return quantidade_trocas
jogadores = ['Finn'... |
#
# PySNMP MIB module HH3C-USER-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-USER-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:17:26 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: illuz <iilluzen[at]gmail.com>
# File: AC_map_nlogn.py
# Create Date: 2015-10-24 23:02:14
# Usage: AC_map_nlogn.py
# Descripton:
class Solution(object):
def wordPattern(self, pattern, str):
"""
:type pattern: str
:type str... |
# -*- coding: utf-8 -*-
class ParsingError(Exception):
"""Used when dotenv file has incorrect grammar and cannot be parsed."""
|
# 54. Spiral Matrix
# Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
# Example 1:
# Input:
# [
# [ 1, 2, 3 ],
# [ 4, 5, 6 ],
# [ 7, 8, 9 ]
# ]
# Output: [1,2,3,6,9,8,7,4,5]
# Example 2:
# Input:
# [
# [1, 2, 3, 4],
# [5, 6, 7, 8],
# [9,10,11,12]
# ]
... |
'''for c in range(1, 5):
n = int(input('Digite um valor: '))
print('FIM')
* Usamos for quando sabemos o inicio e o final *
'''
#Usamos while quando nao sabemos o final
n = 1
# FLAG - Condição de parada - PONTO DE PARADA
while n != 0:
n = int(input('Digite um valor: '))
print('FIM')
# -----------------------------... |
"""
day12-part2.py
Created on 2020-12-12
Updated on 2020-12-12
Copyright © Ryan Kan
"""
# INPUT
with open("input.txt", "r") as f:
lines = [line.strip() for line in f.readlines()]
instructions = [(line[0], int(line[1:])) for line in lines]
f.close()
# COMPUTATION
# Execute instructions in order
movements... |
# -*- coding: utf-8 -*-
raise NotImplementedError(
'No Nuke context yet...feel free to contribute!'
)
|
class Celula():
def __init__(self, conteudo):
self.conteudo = conteudo
self.proximo = None
class Lista_ligada():
def __init__(self):
self.__inicio = None
self.__quantidade: int = 0
@property
def inicio(self):
return self.__inicio
@property
def quantid... |
def sec_2_hms(t):
hms = '%02dh%02dm%02ds' % (t/3600, t/60 % 60 , t%60)
return hms
steps_per_second = 10
want_steps = 5e5 #2e6 # 2M
t_str = sec_2_hms(want_steps / steps_per_second)
print(t_str) |
# Sometimes our contracts can be type alias like List[int] and in that case it's
# unfortunately much harder to check these things, so here we just cover the simple case
def type_check_derived_type_when_possible(parentType, derived_type):
if type(parentType) == type and type(derived_type) == type:
assert ... |
def main(file_name="data.txt", n=7):
# Code
pass
if __name__ == "__main__":
main(file_name="data_sym.txt", n=7)
|
# $Header$
def generate(env, **kw):
if not kw.get('depsOnly', 0):
env.Tool('addLibrary', library = ['CRflux'])
env.Tool('addLibrary', library = env['cfitsioLibs'])
env.Tool('addLibrary', library = env['clhepLibs'])
env.Tool('EventLib')
env.Tool('addLibrary', library = env['xercesLibs'])
... |
TEST_EXECUTION_ENDPOINT = '/rest/raven/2.0/import/execution'
DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S%z'
XRAY_PLUGIN = "JIRA_XRAY"
XRAY_MARKER_NAME = "xray"
PREFIX = 'xr_'
XRAY_CONFIG = 'xr_config'
ENABLE = 'xray-sync'
class MetaData(type):
""" MetaClass for Constant storing"""
def __iter__(self):
for at... |
class BST:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
def insert(self, value):
if value < self.value:
if self.left is None:
self.left = BST(value)
else:
self.left.insert(value)
... |
# -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... |
# Reverse Cipher
message = 'Three can keep a secret, if two of them are dead.'
translated = ''
i = len(message) - 1
while i >=0:
translated += message[i]
i -= 1
print(translated)
|
a=[[" "," "," "],[" "," "," "],[" "," "," "]]
def conditions():
test=0
for i in range(len(a)):
if a[i][0]==a[i][1]==a[i][2]!=" ":
if a[i][0]==1:
print(players_names[1], "won the match")
return 0
else:
print(players_names[0], "won the match")
return 0
if a[0][i]=... |
#
# PySNMP MIB module MERITAGE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MERITAGE-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:00:59 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,... |
# -*- coding: utf-8 -*-
# Copyright (c) A 2017 Adam M. Rafuse - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential
"""
Archived detection definitions.
"""
__author__ = 'Adam Rafuse <$(echo nqnz.enshfr#tznvy.pbz | tr a-z# n-za-m@)>'
# Buy det... |
"""
* @section LICENSE
*
* @copyright
* Copyright (c) 2015-2017 Intel Corporation
*
* @copyright
* 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
*
* @copyright
* http://www.apach... |
#these are used to prevent acces and to private methods and variables to be modified or used
#encapsulation is that which can prevent modification of some methods and variables
class Speed:
def __init__(self):
self.speed = 80
self.__speed_2 = 100#private varible that can be accesed only ... |
def main():
balance = 484
annualInterestRate = 0.2
monthlyPaymentRate = 0.04
for i in range(12):
balance = round(balance - round(balance*monthlyPaymentRate,2),2)
balance = round(balance + round(balance*annualInterestRate/12,2),2)
print("Remaining balance: ", balance)
main()
|
# Esse é o nosso façade
class jogar:
def __init__(self):
print('O que é preciso pra jogar RPG?')
def organizar(self):
self.hoteleiro = Hoteleiro()
self.hoteleiro.reseva_hotel()
self.fornecedor = Fornecedor()
self.fornecedor.set_cozinha()
self.fl... |
a = ()
b = {}
f()
f(b)
f(b=c)
f(*a)
f(c, *a)
f(c=1, *b)
f(*a, c=1)
f(**b)
f(c, *a, **b)
f(c, *a, x, **b)
f(c, a=1, **b)
f(a := 1)
f(**b, a=1)
f(i for i in range(10))
|
class SubHandler(object):
def __init__(self):
self.var = None
self.change = False
def hasChanged(self):
if self.change:
change = True
else:
change = False
self.change = False
return change
def getVar(self):
return self.var
... |
class Notes(object):
"""Description here"""
@staticmethod
def get_guitar_notes_six_string():
notes = ('ELow', 'A', 'D', 'G', 'B', 'EHigh')
return notes
@staticmethod
def get_guitar_notes_twelve_string():
notes = ('ELow', 'A', 'D', 'G', 'B', 'EHigh')
... |
class Solution:
def colorBorder(self, grid, r0, c0, color):
def border(x, y, grid):
row = len(grid)
col = len(grid[0])
if x == 0 or x == row-1or y == 0 or y == col-1:
return True
if grid[x][y] == grid[x][y-1] and grid[x][... |
print('Calculando Equação do Segundo Grau')
a = float(input('Digite o valor de A: '))
b = float(input('Digite o valor de B: '))
c = float(input('Digite o valor de C: '))
delta = (b**2)+4*a*c
print('▲ = Ax² + Bx + C = 0')
print('▲ = {}² - 4 x {} X {} = 0'.format(b, a, c))
print('▲ = {}'.format(delta))
print()
print('Com... |
ROOT_SCOPE_METHOD( MC( ARG( CW( 'do' ), CG( 'LIST', 'phrase' ) ), """
JUMP__this( $CA(FRAME__DO_new( CONTEXT, PARAM_phrase )), CONTEXT ) ;
""" ) )
TEST( """ do [ . 1 ] do [ . 2 ] """ )
FRAME( 'DO',
attributes = [
A( 'ANY', 'phrase' ),
],
methods = [
MS( ARG( CW( 'return' ), CG( 'ANY', 'value' ) ),... |
#!/usr/bin/env python3
#
# util/generate_small_constants_test.py
#
# Copyright (c) 2018 David Creswick
#
# Licensed under the Apache License, Version 2.0
# <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT
# license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. All files... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.