content stringlengths 7 1.05M |
|---|
class dotRebarEndDetailStrip_t(object):
# no doc
RebarHookData=None
RebarStrip=None
RebarThreading=None
|
x = 1
if x == 1:
print("x is 1")
else:
print("x is not 1")
|
# lextab.py. This file automatically created by PLY (version 3.4). Don't edit!
_tabversion = "3.4"
_lextokens = {
"SHORT": 1,
"BOOLCONSTANT": 1,
"USHORT": 1,
"UBYTE": 1,
"DUBCONSTANT": 1,
"FILE_IDENTIFIER": 1,
"ULONG": 1,
"FILE_EXTENSION": 1,
"LONG": 1,
"UNION": 1,
"TABLE": 1... |
#
# Copyright (c) 2017 Amit Green. All rights reserved.
#
@gem('Gem.Core')
def gem():
@export
def execute(f):
f()
return execute
#
# intern_arrange
#
@built_in
def intern_arrange(format, *arguments):
return intern_string(format % arguments)
#
# lin... |
set_name(0x8013923C, "PreGameOnlyTestRoutine__Fv", SN_NOWARN)
set_name(0x8013B300, "DRLG_PlaceDoor__Fii", SN_NOWARN)
set_name(0x8013B7D4, "DRLG_L1Shadows__Fv", SN_NOWARN)
set_name(0x8013BBEC, "DRLG_PlaceMiniSet__FPCUciiiiiii", SN_NOWARN)
set_name(0x8013C058, "DRLG_L1Floor__Fv", SN_NOWARN)
set_name(0x8013C144, "StoreBlo... |
#!/usr/bin/env python3
#############################################################################
# #
# Program purpose: Test whether a number is within 100 of 1000 or #
# 2000. ... |
STATS = [
{
"num_node_expansions": 5758,
"plan_cost": 130,
"plan_length": 130,
"search_time": 10.8434,
"total_time": 11.515
},
{
"num_node_expansions": 9619,
"plan_cost": 127,
"plan_length": 127,
"search_time": 21.8034,
"total_t... |
'''
This program will do the following:
1. Ask for input of the amount of organisms
2. Ask for input of the daily population increase in percent
3. Ask for input of the maximum days the organism multiplies
4. Calculate the total population per day
5. Print the results for each day
'''
# ===Begin Loop
whi... |
def bool_strings():
bools = []
for b in ['T', 'true', 'True', 'TRUE', 'F', 'false', 'False', 'FALSE']:
bools.append((b.lower().startswith('t'), b))
return bools
def test_bool_scalars(tmp_path, helpers):
helpers.do_test_scalar(tmp_path, bool_strings())
def test_bool_one_d_arrays(tmp_path, help... |
class Pessoa:
nome = 'Nome Padrão'
p1 = Pessoa()
p2 = Pessoa()
p1.nome = 'Valdir'
print(p1.nome) # Valdir
print(p2.nome) # Nome Padrão
print(Pessoa.nome) # Nome Padrão
print('\n===============\n')
Pessoa.nome = 'SEM NOME'
print(p1.nome) # Valdir (inseri na própria instância, logo, só muda quando eu mudar ... |
# Modifique a classe Televisão de forma que, se pedirmos para mudar o canal para baixo, além do mínimo, ela vá para o canal máximo
# Se mudarmos para cima, além do canal máximo, que volte ao canal mínimo
# Exemplo:
# >>> tv = Televisão(2, 10)
# >>> tv.muda_canal_para_baixo()
# >>> tv.canal
# 10
# >>> tv.muda_canal_para... |
"""Additional Commandline option for pytest."""
MPI_SESSION_ARGUMENT = "--in_mpi_session"
"""
Argument added to the command line arguments useable with pytest.
/cf :any:`pytest_addoption`
"""
_IN_MPI_SESSION = False
"""Indicates whether the current test is run with the mpi session argument"""
def in_mpi_session():... |
def trapping_rain(buildings):
rain_block = 0
for i in range(1, len(buildings) - 1):
max_left = max(buildings[:i])
max_right = max(buildings[i + 1:])
height = max_right
if max_left < max_right:
height = max_left
if height <= buildings[i]:
continue... |
class Solution:
def containsCycle(self, grid: List[List[str]]) -> bool:
rows, cols, visited, directions = len(grid), len(grid[0]), set(), [(0, 1), (1, 0), (0, -1), (-1, 0)]
def dfs(row, col, parentX, parentY, length):
visited.add((row, col))
for dirX, dirY in directi... |
#
# @lc app=leetcode.cn id=678 lang=python3
#
# [678] 有效的括号字符串
#
# https://leetcode-cn.com/problems/valid-parenthesis-string/description/
#
# algorithms
# Medium (35.18%)
# Total Accepted: 34.3K
# Total Submissions: 91.8K
# Testcase Example: '"()"'
#
# 给定一个只包含三种字符的字符串:( ,) 和 *,写一个函数来检验这个字符串是否为有效字符串。有效字符串具有如下规则:
#
#... |
print(
min(
filter(
lambda x: x % 2 != 0,
map(
int,
input().split()
)
)
)
)
|
X = 1
def nester():
X = 2
print(X)
class C:
X = 3
print(X)
def method1(self):
print(X)
print(self.X)
def method2(self):
X = 4
print(X)
self.X = 5
print(self.X)
I = C()
I.method1()
I.method2(... |
animals = { 'a': ['aardvark'], 'b': ['baboon'], 'c': ['coati']}
animals['d'] = ['donkey']
animals['d'].append('dog')
animals['d'].append('dingo')
"""
def howMany(aDict):
i = 0
result = []
values = aDict.values()
print (values)
for w in values:
result.append(w)
for word in result:
... |
#from django import http
# adapted from http://djangosnippets.org/snippets/2472/
class CloudMiddleware(object):
def process_request(self, request):
if 'HTTP_X_FORWARDED_PROTO' in request.META:
if request.META['HTTP_X_FORWARDED_PROTO'] == 'https':
request.is_secure = lambda: Tru... |
tot = tot1000 = menor = cont = 0
barato = ' '
while True:
produto = str(input('Nome do produto: '))
preco = float(input('Preço: R$ '))
cont += 1
tot += preco
if preco > 1000:
tot1000 += 1
if cont == 1 or preco < menor:
menor = preco
barato = produto
op = ' '
while... |
'''
A simple script for printing numbers
'''
def func1():
'''
func1 is simple methdo which shows the number which are entered inside.
'''
first_num = 1
second_num = 2
print(first_num)
print(second_num)
func1()
# When we run this program using pylint then we can get our code evaluted.
# I... |
class Solution:
def dfs(self, image: List[List[int]], sr: int, sc: int, newColor: int, DIR: List[List[int]], startColor: int) -> List[List[int]]:
image[sr][sc] = newColor
visited = set()
visited.add((sr,sc))
for direction in DIR:
newRow, newCol = sr + di... |
"""
Construya un programa en Python que, dados como datos la categoría y el sueldo bruto
del trabajador, calcule el aumento correspondiente teniendo en cuenta la siguiente tabla:
Como salida, mostrar la categoría del trabajador y su nuevo sueldo bruto.
"""
SueldoBruto=int(input("Ingrese Sueldo Bruto: "))
if(SueldoBruto... |
# Author : Babu Baskaran
# Date : 05/04/2019 Time : 17:00 pm
# Solution for problem number 1
# taking user input
user1=int (input("Please Enter a Positive Integer : "))
# assigning user input into a variable
start = user1
# set i start value into 1
i = 1
# set value of variable ans to zero
ans = 0
# check the i val... |
"""
https://leetcode.com/problems/implement-strstr/
Return the first occurence of needle in haystack, or -1 if not found. Return 0 when needle is an empty string.
haystack and needle are both strings
"""
class Solution:
def strStr(self, haystack: str, needle: str) -> int:
if len(needle) == 0:
... |
units = {
"DecimalDegrees": "degrees",
"WGS_1984": "WGS84",
"Meters": "meters",
"": "",
"Unknown": "Unknown",
}
|
class CommandResponse(object):
def __init__(self):
self.messages = []
self.named = {}
self.errors = []
def __getitem__(self, name):
return self.get_named_data(name)
@property
def active_user(self):
return self.get_named_data('active_user')
@property
... |
print('-=-' * 9)
print(' \033[35m--- BANCO GUANABARA ---\033[m ')
print('-=-' * 9)
valor = int(input('Qual valor você quer sacar? (Cédulas disponíveis: 100, 50, 20 e 10): '))
for nota in [100, 50, 20, 10]:
qtde = valor // nota
valor = valor % nota
if qtde > 0:
print('Cédulas de R$ {},00: \033[33m{}... |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def findTilt(self, root: TreeNode) -> int:
sum_tree, tilt_tree = self.sum_and_tilt(root)
return tilt_tree
def sum_an... |
'''
Comparison data as seen here,
http://www.nand2tetris.org/
'''
'''------------------------- Arithmetic gates -------------------------'''
k_halfAdder = [
# [ a, b, ( sum, carry ) ]
[ 0, 0, ( 0, 0 ) ],
[ 0, 1, ( 1, 0 ) ],
[ 1, 0, ( 1, 0 ) ],
[ 1, 1, ( 0, 1 ) ],
]
k_fullAdder = [
# [ a, b, c, ( sum, carry ... |
class QuizBrain:
def __init__(self,question_list):
self.question_number = 0
self.score = 0
self.question_list = question_list
def next_question(self):
self.guess = input(f"Q{self.question_number + 1}: {self.question_list[self.question_number].question} True or False: ")
... |
mooniswap_abi = [
{
"inputs": [
{"internalType": "contract IERC20", "name": "_token0", "type": "address"},
{"internalType": "contract IERC20", "name": "_token1", "type": "address"},
{"internalType": "string", "name": "name", "type": "string"},
{"internalType":... |
msg = None
if msg:
print(msg)
|
# Each time we introduce new functionality into the game, we’ll typically
# create some new settings as well. Instead of adding settings throughout
# the code, let’s write a module called settings that contains a class called
# Settings to store all these values in one place
class Settings:
def __init__(self):
... |
print("")
media = 0
m_menor = 0
h_maior = 0
for i in range(4):
print("------- {}ª Pessoa -------".format(i+1))
nome = input("Nome: ")
idade = int(input("Idade: "))
sexo = input("Sexo [M/F]: ")
media += idade
if (sexo == 'F' and idade < 20): m_menor += 1
if (sexo == 'M'):
... |
class NoTasksError(Exception):
"""Exception raised when there are no tasks passed"""
pass
class TaskResultKeyAlreadyExists(Exception):
"""Exception raised when two tasks produce same key-ed result"""
pass
class TaskResultObjectMissing(Exception):
"""Exception raised when one or more expected inp... |
def counter(c_var):
while True:
try:
c_var = c_var + 1
except KeyboardInterrupt:
print('Counter now at: ' + str(c_var))
def counter_p(c_var):
while True:
c_var = c_var + 1
print(c_var) |
# Type definiton for (type, data) tuples representing a value
# See http://androidxref.com/9.0.0_r3/xref/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h#262
# The 'data' is either 0 or 1, specifying this resource is either
# undefined or empty, respectively.
TYPE_NULL = 0x00
# The 'data' holds a ResTa... |
#Requisitado: NOME e IDADE do homem mais velho, quantas mulheres como menos de 20 anos
media = 0
idadeH = 0
nomeH = ''
msub20 = 0
n = int(input('Quantas pessoas vc deseja analisar? '))
for c in range(1, n+1):
print(f'----- {c}ª pessoa -----')
nome = str(input('Nome: '))
idade = int(input('Idade: '))
med... |
words=['Aaron',
'Ab',
'Abba',
'Abbe',
'Abbey',
'Abbie',
'Abbot',
'Abbott',
'Abby',
'Abdel',
'Abdul',
'Abe',
'Abel',
'Abelard',
'Abeu',
'Abey',
'Abie',
'Abner',
'Abraham',
'Abrahan',
'Abram',
'Abramo',
'Abran',
'Ad',
'Adair',
'Adam',
'Adamo',
'Adams',
'Adan',
'Addie',
'Addison',
'Addy',
'Ade',
'Adelbert',
'Adham',
'Adla... |
class Solution(object):
def removeDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
pre,cur = 0,1
while cur < len(nums):
if nums[pre] == nums[cur]:
nums.pop(cur)
else:
pre,cur = pre + 1, cu... |
# by Kami Bigdely
# Extract class
class Actor:
def __init__(self, first_name, last_name, birth_year, movies, email) -> None:
self.first_name = first_name
self.last_name = last_name
self.birth_year = birth_year
self.movies = movies
self.email = email
def send_hiring_... |
#creating a function
def cal(one,two):
three=float(one)-float(two)
print(three)
return
cal(1,4)
|
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def __init__(self):
self.plus1 = 0
def copyTheResults(self, node, result):
while node != None:
result.next = ListNod... |
class XYZfileWrongFormat(Exception):
pass
class XYZfileDidNotExist(Exception):
pass
|
def number_length(a: int) -> int:
# your code here
# algorithm
# 1) Will recive an argument called "a" of datatype "int"
# 2) Convert the integer into a string
# 3) Calculate the length of the string
# 4) Return the Length of the string
return len(str(a))
def number_length_two(a: int) -> in... |
# URI Online Judge 2152
N = int(input())
for n in range(N):
entrada = [int(i) for i in input().split()]
if entrada[2] == 0: estado = 'fechou'
else: estado = 'abriu'
print('{:02d}:{:02d} - A porta {}!'.format(entrada[0], entrada[1], estado)) |
# -*- coding: utf-8 -*-
"""
lswifi.ie
~~~~~~~~~
schema definition for information element
"""
class InformationElement:
"""Base class for Information Elements"""
def __init__(
self,
element,
element_id,
element_id_extension=None,
extensible=None,
fragmentable... |
# Count and display the number of vowels,
# consonants, uppercase, lowercase characters in string
def countCharacterType(s):
vowels = 0
consonant = 0
lowercase = 0
uppercase = 0
for i in range(0, len(s)):
ch = s[i]
if ((ch >= 'a' and ch <= 'z') or
(ch >= 'A' and ch... |
class Solution:
def __init__(self, N: int, blacklist: List[int]):
self.validRange = N - len(blacklist)
self.dict = {}
for b in blacklist:
self.dict[b] = -1
for b in blacklist:
if b < self.validRange:
while N - 1 in self.dict:
N -= 1
self.dict[b] = N - 1
... |
class Node(object):
def __init__(self, key, value):
self.key = key
self.value = value
self.pre = None
self.next = None
class LRUCache(object):
def __init__(self, capacity):
"""
:type capacity: int
"""
self.capacity = capacity
self.hkeys ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright 2020, Yutong Xie, UIUC.
Iteratively reverse a singly linked list
'''
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution(object... |
totalelements=int(input())
numeratorele=[int(ele) for ele in input().split()]
denomele=[int(ele) for ele in input().split()]
resnumerator=0
if len(numeratorele) == len(denomele):
for i in range(totalelements):
cal=numeratorele[i]*denomele[i]
resnumerator+=cal
print(round(resnumerator/sum(denomele)... |
def foo():
'''
>>> from mod import Good as Good
'''
pass # Ignore PyUnusedCodeBear
|
class Node:
def __init__(self):
self.children = {}
self.endOfWord = False
class Trie:
def __init__(self):
"""
Initialize your data structure here.
"""
# Trie intializes with a Node
self.root = Node()
def insert(self, word: str) -> None:
"""
... |
#!/usr/bin/env python3
# Conditional statements check for a condition,
# and act accordingly.
# Python uses the `if/elif/else` structure for this.
# Example 1
if 2 > 1:
print("2 greater than 1")
# Example 2
var1 = 1
var2 = 10
if var1 > var2:
print("var1 greater than var2")
else:
print("var2 greater than ... |
# 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 isBalanced(self, root):
"""
:type root: TreeNode
:rtype: bool
"""
def _treeDe... |
class Rollout:
'''
Usage: rollout = Rollout(state)
'''
def __init__(self, state):
self.state_list = [state]
self.action_list = []
self.reward_list = []
self.act_val_list = []
self.done = False
def append(self, state, action, reward, done, act_val):
... |
#!/usr/bin/env python
TEST_PUBLIC_KEY = 5764801
CARD_PUBLIC_KEY = 18499292
DOOR_PUBLIC_KEY = 8790390
def find_loop_size(
target_key,
subject=7,
starting_value=1,
):
value = starting_value
loop_size = 0
while value != target_key:
value = value * subject
value = value % 20201227... |
class BaseDerivative:
def __init__(self, config, instance, *args, **kwargs):
self.config = config
self.instance = instance
|
# display characters
BLANK_STR = ' '
PLAYER_1_STR = ' X '
PLAYER_2_STR = ' O '
LEFT_PAD_STR = ' '
HORIZ_BOARD_STR = '-'
HORIZ_BOARD_STR_THREE = ''.join(HORIZ_BOARD_STR for x in xrange(3))
VERTICAL_BOARD_STR = '|'
assert len(BLANK_STR) == len(PLAYER_1_STR) == len(PLAYER_2_STR)
def get_board_display(board_state, deb... |
class Solution:
def reorderedPowerOf2(self, N: int) -> bool:
x="".join(i for i in sorted(str(N)))
for i in range(30):
s="".join(i for i in sorted(str(2**i)))
if s==x:
print(s)
return True
return False
|
def tr_rav(lenguaje, dato, **kwarg):
data = {
'es': {
"comment": "[C]Comentario enviado. (っ•̀ω•̀)╮ =͟͟͞ 💗\n\n\n[C]Gracias por usar el\n[C]servicio de mensaje\n[C]Ravnin. (ง •᷄ω•)ว",
"Id_Amino": f"El ID del link es: {kwarg.get('ID')}",
"destacar": f"¡Post {kwarg.get('Tit... |
#-----------------------------------------------------------------------------
# Copyright (c) 2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... |
# -*- coding: utf-8 -*-
class Question:
def __init__(self, title, selectors, redirect):
self.title = title
self.selectors = selectors
self.redirect = redirect
@property
def serialize(self):
return {
"title": self.title,
"selectors": self.selectors,... |
def bbox_mk(p1, p2, offset=(0, 0)):
x1 = min(p1[0], p2[0]) - offset[0]
x2 = max(p1[0], p2[0]) + offset[0]
y1 = min(p1[1], p2[1]) - offset[1]
y2 = max(p1[1], p2[1]) + offset[1]
return (x1, y1), (x2, y2)
def bbox_add_point(bbox, p, offset=(0, 0)):
x1 = min(bbox[0][0], p[0] - offset[0])
x2 ... |
#!/usr/bin/python3
def isprime(n):
if n == 1:
return False
for x in range(2, n):
if n % x == 0:
return False
else:
return True
def primes(n = 1):
while(True):
if isprime(n): yield n
n += 1
for n in primes():
if n > 100: break
print(n)
|
""" This problem was asked by Uber.
Given an array of integers, return a new array such that each element at index i
of the new array is the product of all the numbers in the original array except
the one at i.For example, if our input was [1, 2, 3, 4, 5], the expected output
would be [120, 60, 40, 30, 24]. If our inpu... |
#!/usr/bin/env python
class Service(object):
pass
|
# dynmaic programming
class Solution:
def lengthOfLIS(self, nums: List[int]) -> int:
if not nums:
return 0
dp = [1] * len(nums)
for i in range(len(nums)):
for j in range(i):
if nums[j] < nums[i]:
dp[i] = max(dp[i], dp[j] + 1)
... |
model_params = dict(
image_shape=(1, 256, 256),
n_part_caps=30,
n_obj_caps=16,
scae_regression_params=dict(
is_active=True,
loss='mse',
attention_hp=1,
),
scae_classification_params=dict(
is_active=False,
n_classes=1,
),
pcae_cnn_encoder_params=dic... |
# -*- coding: utf-8 -*-
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
def __eq__(self, other):
return (
other is not None and
self.val == other.val and
self.left == other.left and
self.rig... |
class Solution:
def longestPalindrome(self, s: str) -> int:
str_dict={}
for each in s:
if each not in str_dict:
str_dict[each]=0
str_dict[each]+=1
result=0
odd=0
for k, v in str_dict.items():
if v%2==0:
resul... |
for desi in Parameters.GetAllDesignPoints():
for message in GetMessages():
if (DateTime.Compare(message.DateTimeStamp, startTime) == 1) and (message.DesignPoint == desi.Name):
desi.Retained = False
break
|
def solve(heads,legs):
for i in range(heads+1):
j=heads-i
if (2*i)+(4*j)==legs:
print (i,j)
return
print("No solution")
#Start writing your code here
#Populate the variables: chicken_count and rabbit_count
# Use the below given print stateme... |
class Controller():
def __init__(self):
self.debugger = None
def get_cmd(self):
pass |
class Solution:
def countDigitOne(self, n: int) -> int:
if n <= 0:
return 0
ln = len(str(n))
if ln == 1:
return 1
tmp1 = 10 ** (ln - 1)
firstnum = n // tmp1
fone = n % tmp1 + 1 if firstnum == 1 else tmp1
other = firstnum * (ln - 1) * (t... |
class PathNameChecker(object):
def check(self, pathname: str):
pass
|
"""
``fish_http_status`` 包含最通用的一些网络状态码
https://github.com/openstack/swift/blob/master/swift/common/http.py
"""
def is_informational(status):
"""
检查状态码是否信息提示
:param:
* status: http 状态码
:return:
* result: True or False
"""
return 100 <= status <= 199
def is_success(status):... |
#! env/bin/python3.6
# -*- coding: utf8 -*-
"""Инициализация пакета API версии 0."""
|
total = 0
line = input()
while line != "NoMoreMoney":
current = float(line)
if current < 0:
print("Invalid operation!")
break
total += current
print(f"Increase: {current:.2f}")
line = input()
print(f"Total: {total:.2f}")
|
#
# PySNMP MIB module PAIRGAIN-DSLAM-ALARM-SEVERITY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/PAIRGAIN-DSLAM-ALARM-SEVERITY-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:36:34 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using P... |
"""
In Fractional Knapsack, we can break items for maximizing the total value of knapsack.
This problem in which we can break an item is also called the fractional knapsack problem.
Input:
Items as (value, weight) pairs
arr[] = {{60, 10}, {100, 20}, {120, 30}}
Knapsack Capacity, W = 50;
Output :
Maximum possi... |
#Day 2:
#Prime or Not:
#Step 1: Intialize the variable a and count to zero
#Step 2: Read the input
#Step 3: Set a to n//2 (// in python implies integer division) , we can make a to square root of number to make it more efficient
#Step 4: iterate through 2 to a+1 and check whether it is divisible by i or not
#Step 5 : ... |
"""
Profile ../profile-datasets-py/standard54lev_co2o3ref/004.py
file automaticaly created by prof_gen.py script
"""
self["ID"] = "../profile-datasets-py/standard54lev_co2o3ref/004.py"
self["Q"] = numpy.array([ 1.39778700e+00, 2.03491300e+00, 2.66180300e+00,
3.22654500e+00, 3.85401500e+00,... |
# -*- coding: utf-8 -*-
def main():
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)][::-1]
memo = [0 for _ in range(n + 1)]
for ai in a:
if memo[ai] == 1:
continue
else:
memo[ai] = 1
print(ai)
for index, m in... |
nome = input('Qual é o seu nome completo? ').strip()
cores = {'limpa':'\033[m',
'verde':'\033[32m',
'vermelho':'\033[31m'}
print('Seu nome tem Silva? {}{}{}'.format(cores['vermelho'],'silva' in nome.lower(), cores['limpa'])) |
#!/usr/bin/env python
# Parse key mapping
keymap = {}
with open('reverb.keymap', 'r') as mapping:
content = mapping.read()
for line in content.split("\n"):
if len(line) > 0:
fields = line.split("\t")
keymap[fields[0]] = fields[1] + "\t" + fields[2] + "\t" + fields[3]
# Training data
train = []
wit... |
# AUTHOR: Akash Rajak
# Python3 Concept: Matrix Transpose
# GITHUB: https://github.com/akash435
# Add your python3 concept below
def matrix_transpose():
for i in range(len(A)):
for j in range(len(A[0])):
res[i][j] = A[j][i]
A=[]
print("Enter N:")
n = int(input())
print("Enter Matrix A:")
for... |
# CALENDARIO CHINO
year=int(input("Año: "))
if year % 12 == 8:
animal = "Dragon"
if year % 12 == 9:
animal = "Serpiente"
if year % 12 == 10:
animal = "Caballo"
if year % 12 == 11:
animal = "Oveja"
if year % 12 == 0:
animal = "Mono"
if year % 12 == 1:
animal = "Gall... |
first_name = "Bob"
last_name = "Daily"
#first_name[0] = "R"
fixed_first_name = "R" + first_name[-2:]
print(fixed_first_name)
|
class Solution(object):
def uniquePathsWithObstacles(self, grid):
"""
:type obstacleGrid: List[List[int]]
:rtype: int
"""
m = len(grid)
n = len(grid[0])
dp = [[0 for _ in range(n)] for _ in range(m)]
for i in range(n):
... |
del_items(0x80127F74)
SetType(0x80127F74, "struct Creds CreditsTitle[6]")
del_items(0x8012811C)
SetType(0x8012811C, "struct Creds CreditsSubTitle[28]")
del_items(0x801285B8)
SetType(0x801285B8, "struct Creds CreditsText[35]")
del_items(0x801286D0)
SetType(0x801286D0, "int CreditsTable[224]")
del_items(0x80129900)
SetTy... |
# MIT OC - CS600 - Introduction to Computer Science and Programming
# Problem Set 1: 3 Simple Problems - Problem 2 Pay off debt in 1 year
# Name: Luke Young
# Collaborators: None
# Time Spent: 01:00 (hr:min)
# 2018 04 22 20:27
# Program: Finding the minimum payment required to pay off the debt
#
# Write a program th... |
"""
Othello game written in Python using Textual as TUI in Bash for Linux.
"""
# Setup game
# Ask player name
# Ask white or black
# Initial board
# Check if player can make a move
# Take player input for placing piece
# Check if move is valid input
# Place piece and flip opponents pieces affected
# Update score
# Keep... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def get_func(tag):
def func(s):
group = tag, s
return group
return func
|
"""Make an infinite loop.
Write a loop which has no end clause.
Source: programming-idioms.org
"""
# Implementation author: JackStouffer
# Created on 2016-02-18T16:57:59.907374Z
# Last modified on 2016-02-18T16:57:59.907374Z
# Version 1
while True:
pass
|
# pip install -U imbalanced-learn
# 处理不均衡数据
"""
欠采样 under_sampling 把多的砍掉
上/过采样 Over sampling 把少的数据样本补齐
联合采样
集成采样
""" |
# container-service-extension
# Copyright (c) 2019 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
# End point of Vmware Analytics staging server
# TODO() : This URL should reflect production server during release
VAC_URL = "https://vcsa.vmware.com/ph-stg/api/hyper/send/"
# Value of collecto... |
quit = False
flag = False
while not quit :
num = int(input(""))
if num == 42:
quit = True;
else:
print(num)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.