content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
high_income = True
low_income = False
if high_income == True and low_income == False:
print("u little bitch ")
#above code is noob kind of code
#bettter way
if high_income and low_income:
print("u little bitch")
#high_income and low_income are already boolean so we don't need to compare it with == True and ==... | high_income = True
low_income = False
if high_income == True and low_income == False:
print('u little bitch ')
if high_income and low_income:
print('u little bitch')
age = 45
if age > 10 and age < 65:
print('Eligible')
message = 'Eligible' if age > 18 and age < 65 else 'Not Eligible'
print(message)
if 18 <=... |
def print_artist(album):
print(album['Artist_Name'])
def change_list(list_from_user):
list_from_user[2] = 5
def print_name(album):
print(album["Album_Title"])
def make_album(name, title, numSongs=10):
album = {'Artist_Name': name, 'Album_Title': title}
if numSongs:
album["Song_Count"] = n... | def print_artist(album):
print(album['Artist_Name'])
def change_list(list_from_user):
list_from_user[2] = 5
def print_name(album):
print(album['Album_Title'])
def make_album(name, title, numSongs=10):
album = {'Artist_Name': name, 'Album_Title': title}
if numSongs:
album['Song_Count'] = n... |
class Vector:
"""
Constructor
self: a reference to the object we are creating
vals: a list of integers which are the contents of our vector
"""
def __init__(self, vals):
self.vals = vals
# print("Assigned values ", vals, " to vector.")
"""
String Function
Converts... | class Vector:
"""
Constructor
self: a reference to the object we are creating
vals: a list of integers which are the contents of our vector
"""
def __init__(self, vals):
self.vals = vals
'\n String Function\n\n Converts the object to a string in readable format for programmer... |
class Block:
def __init__(self, block_id, alignment):
self.id = block_id
self.alignment = alignment
self.toroot = self # parent in find-union tree
self.shift = 0 # order relative to parent
self.reorder_shift = 0 # modification caused by edges inserted within group
sel... | class Block:
def __init__(self, block_id, alignment):
self.id = block_id
self.alignment = alignment
self.toroot = self
self.shift = 0
self.reorder_shift = 0
self.orient = 1
self.flanks = {-1: 0, 1: 0}
def find(self):
if self.toroot is self:
... |
def get_major_dot_minor_version(version):
"""
Convert full VERSION Django tuple to
a dotted string containing MAJOR.MINOR.
For example, (1, 9, 3, 'final', 0) will result in '1.9'
"""
return '.'.join([str(v) for v in version[:2]])
def get_module_short_name(klass):
"""
Return the short ... | def get_major_dot_minor_version(version):
"""
Convert full VERSION Django tuple to
a dotted string containing MAJOR.MINOR.
For example, (1, 9, 3, 'final', 0) will result in '1.9'
"""
return '.'.join([str(v) for v in version[:2]])
def get_module_short_name(klass):
"""
Return the short m... |
result = []
for line in DATA.splitlines():
d, t, lvl, msg = line.strip().split(', ', maxsplit=3)
d = date.fromisoformat(d)
t = time.fromisoformat(t)
dt = datetime.combine(d, t)
result.append({'when': dt, 'level': lvl, 'message': msg})
| result = []
for line in DATA.splitlines():
(d, t, lvl, msg) = line.strip().split(', ', maxsplit=3)
d = date.fromisoformat(d)
t = time.fromisoformat(t)
dt = datetime.combine(d, t)
result.append({'when': dt, 'level': lvl, 'message': msg}) |
#!/usr/bin/env python
#####################################
# Installation module for ike-scan
#####################################
# AUTHOR OF MODULE NAME
AUTHOR="Jason Ashton (ninewires)"
# DESCRIPTION OF THE MODULE
DESCRIPTION="This module will install/update ike-scan - a command-line tool for discovering, finger... | author = 'Jason Ashton (ninewires)'
description = 'This module will install/update ike-scan - a command-line tool for discovering, fingerprinting and testing IPsec VPN systems'
install_type = 'GIT'
repository_location = 'https://github.com/royhills/ike-scan.git'
install_location = 'ike-scan'
debian = 'git,gcc,make'
fed... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File: __init__.py.py
Author: limingdong
Date: 12/31/14
Description:
""" | """
File: __init__.py.py
Author: limingdong
Date: 12/31/14
Description:
""" |
"""
Vicki Langer
Class: CS 521 - Fall 1
Date: 28 Sep 2021
Homework Problem # 4_1
taking a list of integers and creating a new one
with sum of nearest neighbors and itself
"""
INPUT_LIST = list(range(55, 0, -10)) # [55, 45, 35, 25, 15, 5]
max_index = len(INPUT_LIST) - 1
# output: 55+45=100 55+45+35=135 45+35+25=105 ... | """
Vicki Langer
Class: CS 521 - Fall 1
Date: 28 Sep 2021
Homework Problem # 4_1
taking a list of integers and creating a new one
with sum of nearest neighbors and itself
"""
input_list = list(range(55, 0, -10))
max_index = len(INPUT_LIST) - 1
output_list = []
current_index = 0
while len(output_list) < len(INPUT_LIST):... |
nr=int(input())
for i in range(1,nr+1):
print("*"*i)
| nr = int(input())
for i in range(1, nr + 1):
print('*' * i) |
# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | all_preflight_checks_dag_name = 'preflight'
armada_build_dag_name = 'armada_build'
destroy_server_dag_name = 'destroy_server'
drydock_build_dag_name = 'drydock_build'
validate_site_design_dag_name = 'validate_site_design'
relabel_nodes_dag_name = 'relabel_nodes'
action_xcom = 'action_xcom'
armada_test_releases = 'armad... |
name = 'geo5038801mod'
apical_dendriteEnd = 79
total_user5 = 70
f = open(name + '.hoc','r')
new_ls = ''
for line in f:
if 'user5[' in line and 'create' not in line and 'append' not in line:
parts = line.split('user5[')
#sdfs
if '{user5[51] connect user5[52](0),... | name = 'geo5038801mod'
apical_dendrite_end = 79
total_user5 = 70
f = open(name + '.hoc', 'r')
new_ls = ''
for line in f:
if 'user5[' in line and 'create' not in line and ('append' not in line):
parts = line.split('user5[')
if '{user5[51] connect user5[52](0), 1}' in line:
pass
... |
"""
"""
data = """dataone: 81070
arxiv_oai: 72681
crossref: 71312
pubmed: 47506
figshare: 36462
scitech: 18362
clinicaltrials: 10244
plos: 9555
mit: 2488
vtech: 713
cmu: 601
columbia: 386
calpoly: 377
opensiuc: 293
doepages: 123
stcloud: 47
spdataverse: 40
trinity: 32
texasstate: 31
valposcholar: 2... | """
"""
data = 'dataone: 81070\n\narxiv_oai: 72681\n\ncrossref: 71312\n\npubmed: 47506\n\nfigshare: 36462\n\nscitech: 18362\n\nclinicaltrials: 10244\n\nplos: 9555\n\nmit: 2488\n\nvtech: 713\n\ncmu: 601\n\ncolumbia: 386\n\ncalpoly: 377\n\nopensiuc: 293\n\ndoepages: 123\n\nstcloud: 47\n\nspdataverse: 40\n\ntrinity: 32\n... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Automated Action Rules',
'version': '1.0',
'category': 'Sales/Sales',
'description': """
This module allows to implement action rules for any object.
===========================================... | {'name': 'Automated Action Rules', 'version': '1.0', 'category': 'Sales/Sales', 'description': '\nThis module allows to implement action rules for any object.\n============================================================\n\nUse automated actions to automatically trigger actions for various screens.\n\n**Example:** A le... |
#!/usr/bin/env python
command += maketx("../common/textures/mandrill.tif --wrap clamp -o mandrill.tx")
command += testshade("-g 64 64 --center -od uint8 -o Cblack black.tif -o Cclamp clamp.tif -o Cperiodic periodic.tif -o Cmirror mirror.tif -o Cdefault default.tif test")
outputs = [ "out.txt", "black.tif", "clamp.tif... | command += maketx('../common/textures/mandrill.tif --wrap clamp -o mandrill.tx')
command += testshade('-g 64 64 --center -od uint8 -o Cblack black.tif -o Cclamp clamp.tif -o Cperiodic periodic.tif -o Cmirror mirror.tif -o Cdefault default.tif test')
outputs = ['out.txt', 'black.tif', 'clamp.tif', 'periodic.tif', 'mirro... |
#!usr/bin/env python
#-*- coding:utf-8 -*-
class Model(object):
"""
DNN LM
"""
def __init__(self, model_path):
pass
def score(self, sentence):
pass
def PPL(self, sentence):
pass
| class Model(object):
"""
DNN LM
"""
def __init__(self, model_path):
pass
def score(self, sentence):
pass
def ppl(self, sentence):
pass |
"""
This is the PyTurbSim package. For more information visit the `PyTurbSim home page <http://lkilcher.github.io/pyTurbSim/>`_.
"""
#from api import *
| """
This is the PyTurbSim package. For more information visit the `PyTurbSim home page <http://lkilcher.github.io/pyTurbSim/>`_.
""" |
class Solution(object):
def findDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
return self.noExtraSpace(nums)
def extraSpace(self, nums):
count = {}
for i in range(len(nums)):
count[nums[i]] = count.setdefault(nums[i],... | class Solution(object):
def find_duplicates(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
return self.noExtraSpace(nums)
def extra_space(self, nums):
count = {}
for i in range(len(nums)):
count[nums[i]] = count.setdefault(nums[... |
# You are given two non-empty linked lists representing two non-negative integers.
# The digits are stored in reverse order and each of their nodes contain a single digit.
# Add the two numbers and return it as a linked list.
# You may assume the two numbers do not contain any leading zero, except the number 0 itself.... | class Listnode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def add_two_numbers(self, l1: ListNode, l2: ListNode) -> ListNode:
(num1, num2) = (0, 0)
(i, j) = (0, 0)
while l1:
num1 += l1.val * 10 ** i
i += 1
l... |
source_data = 'day17/input.txt'
with open(source_data, 'r') as f:
input = [x.replace('\n', '') for x in f.readlines()]
target = [[int(y) for y in x.split('=')[1].split('..')] for x in input[0].split(',')]
x = target[0]
y = target[1]
options = {}
testing_velocities = range(-200, 200)
for x_test in testing_veloci... | source_data = 'day17/input.txt'
with open(source_data, 'r') as f:
input = [x.replace('\n', '') for x in f.readlines()]
target = [[int(y) for y in x.split('=')[1].split('..')] for x in input[0].split(',')]
x = target[0]
y = target[1]
options = {}
testing_velocities = range(-200, 200)
for x_test in testing_velocities... |
def strip_name_amount(arg: str):
"""
Strip the name and the last position integer
Args:
arg: string
Returns:
string and integer with the default value 1
"""
strings = arg.split()
try:
first = ' '.join(strings[:-1])
second = int(strings[-1])
except (V... | def strip_name_amount(arg: str):
"""
Strip the name and the last position integer
Args:
arg: string
Returns:
string and integer with the default value 1
"""
strings = arg.split()
try:
first = ' '.join(strings[:-1])
second = int(strings[-1])
except (Val... |
atributes = [
{"name":"color", "value":{'amarillo': 0, 'morado': 1, 'azul': 2, 'verde': 3, 'naranja': 4, 'rojo': 5}},
{"name":"size", "value":{'m': 2, 's': 1, 'xxl': 5, 'xs': 0, 'l': 3, 'xl': 4}},
{"name":"brand", "value":{'blue': 0, 'polo': 1, 'adidas': 2, 'zara': 3, 'nike': 4}},
{"name": "precio", "value": {2... | atributes = [{'name': 'color', 'value': {'amarillo': 0, 'morado': 1, 'azul': 2, 'verde': 3, 'naranja': 4, 'rojo': 5}}, {'name': 'size', 'value': {'m': 2, 's': 1, 'xxl': 5, 'xs': 0, 'l': 3, 'xl': 4}}, {'name': 'brand', 'value': {'blue': 0, 'polo': 1, 'adidas': 2, 'zara': 3, 'nike': 4}}, {'name': 'precio', 'value': {2333... |
def repeated(words):
distance = float('inf')
d = {}
for i, word in enumerate(words):
if word in d:
temp = abs(d[word] - i)
if temp < distance:
distance = temp
d[word] = i
return distance
| def repeated(words):
distance = float('inf')
d = {}
for (i, word) in enumerate(words):
if word in d:
temp = abs(d[word] - i)
if temp < distance:
distance = temp
d[word] = i
return distance |
class Skin(object):
menu_positions = ["left", "right"]
height_decrement = 150
def get_base_template(self, module):
t = self.base_template
if module and module.has_local_nav():
t = self.local_nav_template
return t
def initialize(self, appshell):
pass
| class Skin(object):
menu_positions = ['left', 'right']
height_decrement = 150
def get_base_template(self, module):
t = self.base_template
if module and module.has_local_nav():
t = self.local_nav_template
return t
def initialize(self, appshell):
pass |
# Day5 of my 100DaysOfCode Challenge
# Program to learn is and in
# use of is
number = None
if (number is None):
print("Yes")
else:
print("No")
# use of in
list = [45, 34, 67, 99]
print(34 in list) | number = None
if number is None:
print('Yes')
else:
print('No')
list = [45, 34, 67, 99]
print(34 in list) |
def multiplication(factor, multiplier):
product = factor * multiplier
if (product % 1) == 0:
return int(product)
else:
return product
| def multiplication(factor, multiplier):
product = factor * multiplier
if product % 1 == 0:
return int(product)
else:
return product |
[ ## this file was manually modified by jt
{
'functor' : {
'description' : ['returns a scalar integer value composed by the highiest bits.',
'of each vector element'],
'module' : 'boost',
'arity' : '1',
'call_types' : [],
'ret_arity' : '0',... | [{'functor': {'description': ['returns a scalar integer value composed by the highiest bits.', 'of each vector element'], 'module': 'boost', 'arity': '1', 'call_types': [], 'ret_arity': '0', 'rturn': {'default': 'T'}, 'special': ['reduction'], 'type_defs': [], 'types': ['real_', 'signed_int_', 'unsigned_int_']}, 'info'... |
class Source:
source_list = []
def __init__(self, id, description, url, category):
self.id = id
self.description = description
self.url = url
self.category = category
class Articles:
def __init__(self, id,author, title, urlToImage, url):
self.id = id
s... | class Source:
source_list = []
def __init__(self, id, description, url, category):
self.id = id
self.description = description
self.url = url
self.category = category
class Articles:
def __init__(self, id, author, title, urlToImage, url):
self.id = id
self.... |
#! /usr/bin/python
def _zeros(size):
out = [[0 for _ in range(size)] for _ in range(size)]
return out
def _enforce_self_dist(dist_matrix, scale):
longest = max((max(row) for row in dist_matrix))
longest *= scale
for i in range(len(dist_matrix)):
dist_matrix[i][i] = longest
return di... | def _zeros(size):
out = [[0 for _ in range(size)] for _ in range(size)]
return out
def _enforce_self_dist(dist_matrix, scale):
longest = max((max(row) for row in dist_matrix))
longest *= scale
for i in range(len(dist_matrix)):
dist_matrix[i][i] = longest
return dist_matrix
def build_di... |
# Parameters template.
#
# This should agree with the current params.ini with the exception of the
# fields we wish to modify.
#
# This template is called by run_sample.py for producing many outputs that are
# needed to run a convergence study.
finess_data_template = '''
; Parameters common to FINESS applications
[fi... | finess_data_template = '\n; Parameters common to FINESS applications\n[finess]\nndims = 2 ; 1, 2, or 3\nnout = 1 ; number of output times to print results\ntfinal = 1.0 ; final time\ninitial_dt = 1.0 ; initial dt\nmax_dt = 1.0 ; max allowable dt \nmax_cfl ... |
# https://leetcode.com/problems/sort-colors/
class Solution:
def sortColors(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
if len(nums) < 2: return
l, r = 0, len(nums) - 1
while l < r:
... | class Solution:
def sort_colors(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
if len(nums) < 2:
return
(l, r) = (0, len(nums) - 1)
while l < r:
while l < r and nums[l] in ... |
class AST:
def __init__(self, root_symbol, rule, *children):
self.root_symbol = root_symbol
self.rule = rule
self.children = children
def __str__(self):
return str(self.root_symbol)
class Leaf(AST):
def __init__(self, root_symbol, actual_input):
super(L... | class Ast:
def __init__(self, root_symbol, rule, *children):
self.root_symbol = root_symbol
self.rule = rule
self.children = children
def __str__(self):
return str(self.root_symbol)
class Leaf(AST):
def __init__(self, root_symbol, actual_input):
super(Leaf, self).... |
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license
"""
OpenSfM to kapture import and export.
"""
| """
OpenSfM to kapture import and export.
""" |
product = 1
i = 1
while product > 0.5:
product *= (365.0 - i) / 365.0
i += 1
print(product, i)
| product = 1
i = 1
while product > 0.5:
product *= (365.0 - i) / 365.0
i += 1
print(product, i) |
class Direcao:
def __init__(self):
self.posicoes = ("Norte", "Leste", "Sul", "Oeste")
self.direcao_atual = 0
def girar_a_direita(self):
self.direcao_atual += 1
self.direcao_atual = min(3, self.direcao_atual)
#if self.direcao_atual > 3:
#self.direcao_atual = ... | class Direcao:
def __init__(self):
self.posicoes = ('Norte', 'Leste', 'Sul', 'Oeste')
self.direcao_atual = 0
def girar_a_direita(self):
self.direcao_atual += 1
self.direcao_atual = min(3, self.direcao_atual)
def girar_a_esquerda(self):
self.direcao_atual -= 1
... |
br, bc = map(int, input().split())
dr, dc = map(int, input().split())
jr, jc = map(int, input().split())
bessie = max(abs(br - jr), abs(bc - jc))
daisy = abs(dr - jr) + abs(dc - jc)
if bessie == daisy:
print('tie')
elif bessie < daisy:
print('bessie')
else:
print('daisy')
| (br, bc) = map(int, input().split())
(dr, dc) = map(int, input().split())
(jr, jc) = map(int, input().split())
bessie = max(abs(br - jr), abs(bc - jc))
daisy = abs(dr - jr) + abs(dc - jc)
if bessie == daisy:
print('tie')
elif bessie < daisy:
print('bessie')
else:
print('daisy') |
# we write a function that computes x factorial recursively
def recursiveFactorial(x):
# we check that x is positive
if x < 0:
raise exception("factorials of non-negative numbers only")
# we check if x is either 0 or 1
if x <= 1:
# we return the asnwer 1
return 1
else:
# we recurse
return x * recurs... | def recursive_factorial(x):
if x < 0:
raise exception('factorials of non-negative numbers only')
if x <= 1:
return 1
else:
return x * recursive_factorial(x - 1) |
#!/bin/python3
def hackerrankInString(s):
find = "hackerrank"
i = 0
for c in s:
if find[i] == c:
i += 1
if i >= len(find):
return("YES")
return("NO")
if __name__ == "__main__":
q = int(input().strip())
for a0 in range(q):
s = input().... | def hackerrank_in_string(s):
find = 'hackerrank'
i = 0
for c in s:
if find[i] == c:
i += 1
if i >= len(find):
return 'YES'
return 'NO'
if __name__ == '__main__':
q = int(input().strip())
for a0 in range(q):
s = input().strip()
resul... |
filein = input('Input an email log txt file please: ')
emaillog = open(filein)
days = dict()
for x in emaillog:
if 'From ' in x:
array = x.split()
day = array[1]
day = day.split('@')
day = day[1]
days[day] = days.get(day, 0)+1
else:
continue
print(days)
# most = ... | filein = input('Input an email log txt file please: ')
emaillog = open(filein)
days = dict()
for x in emaillog:
if 'From ' in x:
array = x.split()
day = array[1]
day = day.split('@')
day = day[1]
days[day] = days.get(day, 0) + 1
else:
continue
print(days) |
known = {}
def binomial_coeff_memoized(n, k):
"""Uses recursion to compute the binomial coefficient "n choose k", sped up by memoization
n: number of trials
k: number of successes
returns: int
"""
breakpoint()
if k == 0:
return 1
if n == 0:
return 0
if (n, k) in know... | known = {}
def binomial_coeff_memoized(n, k):
"""Uses recursion to compute the binomial coefficient "n choose k", sped up by memoization
n: number of trials
k: number of successes
returns: int
"""
breakpoint()
if k == 0:
return 1
if n == 0:
return 0
if (n, k) in know... |
def attack(encrypt_oracle, decrypt_oracle, iv, c, t):
"""
Uses a chosen-ciphertext attack to decrypt the ciphertext.
:param encrypt_oracle: the encryption oracle
:param decrypt_oracle: the decryption oracle
:param iv: the initialization vector
:param c: the ciphertext
:param t: the tag corre... | def attack(encrypt_oracle, decrypt_oracle, iv, c, t):
"""
Uses a chosen-ciphertext attack to decrypt the ciphertext.
:param encrypt_oracle: the encryption oracle
:param decrypt_oracle: the decryption oracle
:param iv: the initialization vector
:param c: the ciphertext
:param t: the tag corre... |
# 21303 - [Job Adv] (Lv.60) Aran
sm.setSpeakerID(1203001)
sm.sendNext("*Sob sob* #p1203001# is sad. #p1203001# is mad. #p1203001# cries. *Sob sob*")
sm.setPlayerAsSpeaker()
sm.sendNext("Wh...What's wrong?")
sm.setSpeakerID(1203001)
sm.sendNext("#p1203001# made gem. #bGem as red as apple#k. But #rthief#k stole gem. #p... | sm.setSpeakerID(1203001)
sm.sendNext('*Sob sob* #p1203001# is sad. #p1203001# is mad. #p1203001# cries. *Sob sob*')
sm.setPlayerAsSpeaker()
sm.sendNext("Wh...What's wrong?")
sm.setSpeakerID(1203001)
sm.sendNext('#p1203001# made gem. #bGem as red as apple#k. But #rthief#k stole gem. #p1203001# no longer has gem. #p12030... |
pkgname = "efl"
pkgver = "1.26.1"
pkgrel = 0
build_style = "meson"
configure_args = [
"-Dbuild-tests=false",
"-Dbuild-examples=false",
"-Dembedded-lz4=false",
"-Dcrypto=openssl",
"-Decore-imf-loaders-disabler=scim",
# rlottie (json) is pretty useless and unstable so keep that off
"-Devas-loa... | pkgname = 'efl'
pkgver = '1.26.1'
pkgrel = 0
build_style = 'meson'
configure_args = ['-Dbuild-tests=false', '-Dbuild-examples=false', '-Dembedded-lz4=false', '-Dcrypto=openssl', '-Decore-imf-loaders-disabler=scim', '-Devas-loaders-disabler=json', '-Dlua-interpreter=lua', '-Dbindings=cxx', '-Dopengl=es-egl', '-Dphysics=... |
description = 'FOV linear axis for the large box (300 x 300)'
group = 'optional'
excludes = ['fov_100x100', 'fov_190x190']
includes = ['frr']
devices = dict(
fov_300_mot = device('nicos.devices.generic.VirtualReferenceMotor',
description = 'FOV motor',
visibility = (),
abslimits = (275, 9... | description = 'FOV linear axis for the large box (300 x 300)'
group = 'optional'
excludes = ['fov_100x100', 'fov_190x190']
includes = ['frr']
devices = dict(fov_300_mot=device('nicos.devices.generic.VirtualReferenceMotor', description='FOV motor', visibility=(), abslimits=(275, 950), userlimits=(276, 949), refswitch='l... |
para_str = """this is a long string that is made up of
several lines and non-printable characters such as
TAB ( \t ) and they will show up that way when displayed.
NEWLINEs within the string, whether explicitly given like
this within the brackets [ \n ], or just a NEWLINE within
the variable assignment will also show u... | para_str = 'this is a long string that is made up of\nseveral lines and non-printable characters such as\nTAB ( \t ) and they will show up that way when displayed.\nNEWLINEs within the string, whether explicitly given like\nthis within the brackets [ \n ], or just a NEWLINE within\nthe variable assignment will also sho... |
'''
.remove(x)
This operation removes element from the set.
If element does not exist, it raises a KeyError.
The .remove(x) operation returns None.
Example
>>> s = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
>>> s.remove(5)
>>> print s
set([1, 2, 3, 4, 6, 7, 8, 9])
>>> print s.remove(4)
None
>>> print s
set([1, 2, 3, 6, 7, 8, ... | """
.remove(x)
This operation removes element from the set.
If element does not exist, it raises a KeyError.
The .remove(x) operation returns None.
Example
>>> s = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
>>> s.remove(5)
>>> print s
set([1, 2, 3, 4, 6, 7, 8, 9])
>>> print s.remove(4)
None
>>> print s
set([1, 2, 3, 6, 7, 8, ... |
class Article():
def __init__(self, title, authors, link, date):
self.title = title
self.authors = authors
self.link = link
self.date = date
| class Article:
def __init__(self, title, authors, link, date):
self.title = title
self.authors = authors
self.link = link
self.date = date |
# A part of pdfrw (https://github.com/pmaupin/pdfrw)
# Copyright (C) 2006-2015 Patrick Maupin, Austin, Texas
# MIT license -- See LICENSE.txt for details
class _NotLoaded(object):
pass
class PdfIndirect(tuple):
''' A placeholder for an object that hasn't been read in yet.
The object itself is the (o... | class _Notloaded(object):
pass
class Pdfindirect(tuple):
""" A placeholder for an object that hasn't been read in yet.
The object itself is the (object number, generation number) tuple.
The attributes include information about where the object is
referenced from and the file object to r... |
'''Write a program that returns a list that contains common
elements between two input lists without duplicates. Ensure
it works for lists of two different sizes.'''
# list of random numbers
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
# newlist:
# sets ensure unique v... | """Write a program that returns a list that contains common
elements between two input lists without duplicates. Ensure
it works for lists of two different sizes."""
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
newlist = list(set([i for i in a if i in b]))
print(newlist) |
class StrategyStateMachine :
def discovery() :
pass
def composition() :
pass
def usage() :
pass
def end() :
pass
| class Strategystatemachine:
def discovery():
pass
def composition():
pass
def usage():
pass
def end():
pass |
# This file is generated by sync-deps, do not edit!
load("@rules_jvm_external//:defs.bzl", "maven_install")
load("@rules_jvm_external//:specs.bzl", "maven")
def default_install(artifacts, repositories, excluded_artifacts = []):
maven_install(
artifacts = artifacts,
fetch_sources = True,
rep... | load('@rules_jvm_external//:defs.bzl', 'maven_install')
load('@rules_jvm_external//:specs.bzl', 'maven')
def default_install(artifacts, repositories, excluded_artifacts=[]):
maven_install(artifacts=artifacts, fetch_sources=True, repositories=repositories, excluded_artifacts=excluded_artifacts, maven_install_json='... |
skill = input()
command = input()
while command != "For Azeroth":
command = command.split(" ")
command = command[0]
if command == "GladiatorStance":
skill = skill.upper()
print(skill)
break
elif command == "DefensiveStance":
skill = skill.lower()
print(skill)
... | skill = input()
command = input()
while command != 'For Azeroth':
command = command.split(' ')
command = command[0]
if command == 'GladiatorStance':
skill = skill.upper()
print(skill)
break
elif command == 'DefensiveStance':
skill = skill.lower()
print(skill)
... |
class DropboxException(Exception):
"""All errors related to making an API request extend this."""
def __init__(self, request_id, *args, **kwargs):
# A request_id can be shared with Dropbox Support to pinpoint the exact
# request that returns an error.
super(DropboxException, self).__ini... | class Dropboxexception(Exception):
"""All errors related to making an API request extend this."""
def __init__(self, request_id, *args, **kwargs):
super(DropboxException, self).__init__(request_id, *args, **kwargs)
self.request_id = request_id
def __str__(self):
return repr(self)
... |
{
"targets": [
{
"target_name": "waznutilities",
"sources": [
"src/main.cc",
"src/cryptonote_core/cryptonote_format_utils.cpp",
"src/crypto/tree-hash.c",
"src/crypto/crypto.cpp",
"src/crypto/crypto-ops.c"... | {'targets': [{'target_name': 'waznutilities', 'sources': ['src/main.cc', 'src/cryptonote_core/cryptonote_format_utils.cpp', 'src/crypto/tree-hash.c', 'src/crypto/crypto.cpp', 'src/crypto/crypto-ops.c', 'src/crypto/crypto-ops-data.c', 'src/crypto/hash.c', 'src/crypto/keccak.c', 'src/common/base58.cpp'], 'include_dirs': ... |
# We must set a certain amount of money
my_money = 13
# We make a decision
if my_money > 20:
print("I'm going to the cinema and buy popcorn!")
elif my_money > 10:
print("I'm going to the cinema, but not buy popcorn!")
else:
print("I'm staying home!")
| my_money = 13
if my_money > 20:
print("I'm going to the cinema and buy popcorn!")
elif my_money > 10:
print("I'm going to the cinema, but not buy popcorn!")
else:
print("I'm staying home!") |
ix.enable_command_history()
app = ix.application
clarisse_win = app.get_event_window()
app.open_rename_item_window(clarisse_win)
ix.disable_command_history() | ix.enable_command_history()
app = ix.application
clarisse_win = app.get_event_window()
app.open_rename_item_window(clarisse_win)
ix.disable_command_history() |
# Input: 2D array of "map"
# Output: Shortest distance to exit from cell
# Revision 2 with help from my python book and some documentation
class deque(object):
# A custom implementation of collections.deque that is about 0.4s faster
def __init__(self, iterable=(), maxsize=-1):
if not hasattr(self, 'data'... | class Deque(object):
def __init__(self, iterable=(), maxsize=-1):
if not hasattr(self, 'data'):
self.left = self.right = 0
self.data = {}
self.maxsize = maxsize
self.extend(iterable)
def append(self, x):
self.data[self.right] = x
self.right += 1
... |
# encoding=utf-8
class Expression(object):
pass
| class Expression(object):
pass |
# -*- coding: utf-8 -*-
"""
This software is licensed under the License (MIT) located at
https://github.com/ephreal/rollbot/Licence
Please see the license for any restrictions or rights granted to you by the
License.
"""
def check_author(author):
"""
Checks to see if the author of a message is the same as th... | """
This software is licensed under the License (MIT) located at
https://github.com/ephreal/rollbot/Licence
Please see the license for any restrictions or rights granted to you by the
License.
"""
def check_author(author):
"""
Checks to see if the author of a message is the same as the author
passed in.
... |
# -*- coding: utf-8 -*-
'''Snippets for combination.
'''
# Usage:
# combination = Combination(max_value=10 ** 5 + 100)
# combination.count_nCr(n, r)
class Combination:
''' Count the total number of combinations.
nCr % mod.
nHr % mod = (n + r - 1)Cr % mod.
Args:
... | """Snippets for combination.
"""
class Combination:
""" Count the total number of combinations.
nCr % mod.
nHr % mod = (n + r - 1)Cr % mod.
Args:
max_value: Max size of list. The default is 500,050
mod : Modulo. The default is 10 ** 9 + 7.
Landau notat... |
class Command(object):
"""
Abstract command class
"""
name = ''
description = ''
parser = None
def __init__(self, args):
self.args = args
@classmethod
def create_parser(cls, subparsers):
cls.parser = subparsers.add_parser(cls.name, help=cls.description)
cls... | class Command(object):
"""
Abstract command class
"""
name = ''
description = ''
parser = None
def __init__(self, args):
self.args = args
@classmethod
def create_parser(cls, subparsers):
cls.parser = subparsers.add_parser(cls.name, help=cls.description)
cls.... |
# -*- coding: utf-8 -*-
class Student(object):
def __init__(self, name, score):
self.__name = name
self.__score = score
def print_score(self):
print('%s: %s' % (self.__name, self.__score))
def get_name(self):
return self.__name
def get_score(self):
return sel... | class Student(object):
def __init__(self, name, score):
self.__name = name
self.__score = score
def print_score(self):
print('%s: %s' % (self.__name, self.__score))
def get_name(self):
return self.__name
def get_score(self):
return self.__score
def set_sc... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author:_defined
@Time: 2018/8/28 19:18
@Description:
"""
__all__ = ["Timeout", "NoCookiesException", "VerificationCodeError",
"OverrideAttrException", "NoTaskException", "SpiderBanError"]
class Timeout(Exception):
"""
Functions run out of time
... | """
@Author:_defined
@Time: 2018/8/28 19:18
@Description:
"""
__all__ = ['Timeout', 'NoCookiesException', 'VerificationCodeError', 'OverrideAttrException', 'NoTaskException', 'SpiderBanError']
class Timeout(Exception):
"""
Functions run out of time
"""
class Nocookiesexception(Exception):
"""
Ha... |
# import simplejson as json
# import pandas as pd
# import numpy as np
# import psycopg2
# from itertools import repeat
# from psycopg2.extras import RealDictCursor, DictCursor
def execSql(cursor):
out = None
sqlString = '''
set search_path to demounit1;
-- GstInputAll (ExtGstTranD only) based on "isIn... | def exec_sql(cursor):
out = None
sql_string = '\n set search_path to demounit1;\n -- GstInputAll (ExtGstTranD only) based on "isInput"\n with cte1 as (\n\tselect "tranDate", "autoRefNo", "userRefNo", "tranType", "gstin", d."amount" - "cgst" - "sgst" - "igst" as "aggregate", "cgst", "sgst", "igst", d."... |
class ListenKeyExpired:
def __init__(self):
self.eventType = ''
self.eventTime = 0
@staticmethod
def json_parse(json_data):
result = ListenKeyExpired()
result.eventType = json_data.get_string('e')
result.eventTime = json_data.get_int('E')
return r... | class Listenkeyexpired:
def __init__(self):
self.eventType = ''
self.eventTime = 0
@staticmethod
def json_parse(json_data):
result = listen_key_expired()
result.eventType = json_data.get_string('e')
result.eventTime = json_data.get_int('E')
return result |
class Option:
"""Description of a single configurable option.
Args:
name: The name of the option, i.e. its key in the config.
description: Description of the option.
default: Default value of the option.
path: Path segments to the option in the config.
"""
def __init__(s... | class Option:
"""Description of a single configurable option.
Args:
name: The name of the option, i.e. its key in the config.
description: Description of the option.
default: Default value of the option.
path: Path segments to the option in the config.
"""
def __init__(... |
self.description = "Remove a package with a modified file marked for backup and has existing pacsaves"
self.filesystem = ["etc/dummy.conf.pacsave",
"etc/dummy.conf.pacsave.1",
"etc/dummy.conf.pacsave.2"]
p1 = pmpkg("dummy")
p1.files = ["etc/dummy.conf*"]
p1.backup = ["etc/dummy.c... | self.description = 'Remove a package with a modified file marked for backup and has existing pacsaves'
self.filesystem = ['etc/dummy.conf.pacsave', 'etc/dummy.conf.pacsave.1', 'etc/dummy.conf.pacsave.2']
p1 = pmpkg('dummy')
p1.files = ['etc/dummy.conf*']
p1.backup = ['etc/dummy.conf']
self.addpkg2db('local', p1)
self.a... |
"""
Exercise 3
PART 1: Gather Information
Gather information about the source of the error and paste your findings here. E.g.:
- What is the expected vs. the actual output?
- What error message (if any) is there?
- What line number is causing the error?
- What can you deduce about the cause of the error?
PART 2: Sta... | """
Exercise 3
PART 1: Gather Information
Gather information about the source of the error and paste your findings here. E.g.:
- What is the expected vs. the actual output?
- What error message (if any) is there?
- What line number is causing the error?
- What can you deduce about the cause of the error?
PART 2: Sta... |
# =====================================
# generator=datazen
# version=2.1.0
# hash=ae83e4ad65b0e39560e7ca039248aa55
# =====================================
"""
Useful defaults and other package metadata.
"""
DESCRIPTION = "Simplify project workflows by standardizing use of GNU Make."
PKG_NAME = "vmklib"
VERSION = "1.... | """
Useful defaults and other package metadata.
"""
description = 'Simplify project workflows by standardizing use of GNU Make.'
pkg_name = 'vmklib'
version = '1.6.6' |
def quote():
# TODO store to indexes.json
indexes = [
{ source : 'BOVESPA', ticker:'IBOV'},
{ source : 'CRYPTO', ticker:'BTCBRL'}
]
return indexes | def quote():
indexes = [{source: 'BOVESPA', ticker: 'IBOV'}, {source: 'CRYPTO', ticker: 'BTCBRL'}]
return indexes |
class AttributeRange(object):
# value_start: float
# value_end: float
# duration_seconds: int
def __init__(self, left: float,
right: float, duration_seconds: int):
self.left = left
self.right = right
self.duration_seconds = duration_seconds
def __iter__(s... | class Attributerange(object):
def __init__(self, left: float, right: float, duration_seconds: int):
self.left = left
self.right = right
self.duration_seconds = duration_seconds
def __iter__(self):
yield self.left
yield self.right
@property
def reverse(self):
... |
# coding=utf-8
"""
**The brief introduction**:
This package (:py:mod:`poco.sdk.interfaces`) defines the main standards for communication interfaces between poco and
poco-sdk. If poco-sdk is integrated with an app running on another host or in different language, then poco-sdk is
called `remote runtime`. The implement... | """
**The brief introduction**:
This package (:py:mod:`poco.sdk.interfaces`) defines the main standards for communication interfaces between poco and
poco-sdk. If poco-sdk is integrated with an app running on another host or in different language, then poco-sdk is
called `remote runtime`. The implementation of these i... |
'''
Filippo Aleotti
filippo.aleotti2@unibo.it
29 November 2019
I PROFESSIONAL MASTER'S PROGRAM, II LEVEL "SIMUR", Imola 2019
Modify the function realised in the previous exercise to return (inside the dict, using the key min) also the value with minimum frequency.
If more values have the same minimum frequency, then... | """
Filippo Aleotti
filippo.aleotti2@unibo.it
29 November 2019
I PROFESSIONAL MASTER'S PROGRAM, II LEVEL "SIMUR", Imola 2019
Modify the function realised in the previous exercise to return (inside the dict, using the key min) also the value with minimum frequency.
If more values have the same minimum frequency, then... |
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"say_hello": "test_example.ipynb",
"say_goodbye": "00_core.ipynb"}
modules = ["core.py",
"test_example.py"]
doc_url = "https://daviderzmann.github.io/designkit_test/"
git_url = "https:/... | __all__ = ['index', 'modules', 'custom_doc_links', 'git_url']
index = {'say_hello': 'test_example.ipynb', 'say_goodbye': '00_core.ipynb'}
modules = ['core.py', 'test_example.py']
doc_url = 'https://daviderzmann.github.io/designkit_test/'
git_url = 'https://github.com/daviderzmann/designkit_test/tree/master/'
def custo... |
n=int(input())
S=input()
k=int(input())
i=S[k-1]
for s in S:print(s if s==i else "*",end="") | n = int(input())
s = input()
k = int(input())
i = S[k - 1]
for s in S:
print(s if s == i else '*', end='') |
class Solution:
def findPoisonedDuration(self, timeSeries: List[int], duration: int) -> int:
if len(timeSeries) == 0:
return 0
total_poisoned = 0
for i in range(len(timeSeries)-1):
total_poisoned += min(duration, timeSeries[i+1] - timeSeries[i])
total_poisoned... | class Solution:
def find_poisoned_duration(self, timeSeries: List[int], duration: int) -> int:
if len(timeSeries) == 0:
return 0
total_poisoned = 0
for i in range(len(timeSeries) - 1):
total_poisoned += min(duration, timeSeries[i + 1] - timeSeries[i])
total_p... |
#
# PySNMP MIB module CISCO-LWAPP-RF-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-LWAPP-RF-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:06:16 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, ... | (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, value_range_constraint, value_size_constraint, single_value_constraint, constraints_intersection) ... |
def bubble_sort(array):
for i in range(len(array)):
for j in range(len(array) - 1):
if array[j] > array[j + 1]:
array[j], array[j + 1] = array[j + 1], array[j]
| def bubble_sort(array):
for i in range(len(array)):
for j in range(len(array) - 1):
if array[j] > array[j + 1]:
(array[j], array[j + 1]) = (array[j + 1], array[j]) |
class FilePathSimilarityCalculator:
"""
This class handles file path similarity score calculating operations.
"""
@staticmethod
def path_separator(file_string):
return file_string.split("/")
def longest_common_prefix_similarity(self, file1, file2):
file1 = self.path_separator(f... | class Filepathsimilaritycalculator:
"""
This class handles file path similarity score calculating operations.
"""
@staticmethod
def path_separator(file_string):
return file_string.split('/')
def longest_common_prefix_similarity(self, file1, file2):
file1 = self.path_separator(f... |
n=int(input())
if n<3:
print("NO")
else:
a=[]
b=[]
asum=0
bsum=0
for i in range(n,0,-1):
if asum<bsum:
asum+=i
a.append(i)
else:
bsum+=i
b.append(i)
if asum==bsum:
print("YES")
print(len(a))
print(' '.joi... | n = int(input())
if n < 3:
print('NO')
else:
a = []
b = []
asum = 0
bsum = 0
for i in range(n, 0, -1):
if asum < bsum:
asum += i
a.append(i)
else:
bsum += i
b.append(i)
if asum == bsum:
print('YES')
print(len(a))... |
DESCRIPTION = "sets a variable for the current module"
def autocomplete(shell, line, text, state):
# todo, here we can provide some defaults for bools/enums? i.e. True/False
if len(line.split(" ")) >= 3:
return None
env = shell.plugins[shell.state]
options = [x.name + " " for x in env.options... | description = 'sets a variable for the current module'
def autocomplete(shell, line, text, state):
if len(line.split(' ')) >= 3:
return None
env = shell.plugins[shell.state]
options = [x.name + ' ' for x in env.options.options if x.name.upper().startswith(text.upper()) and (not x.hidden)]
optio... |
"""
RSA Private/Public Key Parameters
----------------------------------
KEY_BIT_SIZE: bit size of keys
e: exponent
"""
KEY_BIT_SIZE = 4000
e = int("""130499359017053281556458431345533123778363781651270565436082977439613579949
54717322917425749364642943354291308521375017815197673634269952642064... | """
RSA Private/Public Key Parameters
----------------------------------
KEY_BIT_SIZE: bit size of keys
e: exponent
"""
key_bit_size = 4000
e = int('130499359017053281556458431345533123778363781651270565436082977439613579949\n 5471732291742574936464294335429130852137501781519767363426995264206489... |
class When_we_have_a_test:
def when_things_happen(self):
pass
def it_should_do_this_test(self):
assert 1 == 1
def test_we_still_run_regular_pytest_scripts():
assert 2 == 2
| class When_We_Have_A_Test:
def when_things_happen(self):
pass
def it_should_do_this_test(self):
assert 1 == 1
def test_we_still_run_regular_pytest_scripts():
assert 2 == 2 |
######################## Errors ##########################
PAYLOAD_NOT_FOUND_ERROR = 'Payload can not be found.'
KEYWORD_NOT_FOUND_ERROR = "Keywords can to be empty."
TYPE_NOT_CORRECT_ERROR = 'Payload type is incorrect, please upload text.'
MODEL_NOT_FOUND_ERROR = 'The ML model not found. (default name: en_core_web_sm)... | payload_not_found_error = 'Payload can not be found.'
keyword_not_found_error = 'Keywords can to be empty.'
type_not_correct_error = 'Payload type is incorrect, please upload text.'
model_not_found_error = 'The ML model not found. (default name: en_core_web_sm)'
data_model_error = 'Data model, text or source ML model h... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This is Webmention tools!
"""
__version__ = '0.4.1'
| """
This is Webmention tools!
"""
__version__ = '0.4.1' |
class Solution:
def findLengthOfLCIS(self, nums: List[int]) -> int:
if not nums:
return 0
dp = [1] * len(nums)
if len(nums) < 2:
return 1
result = 1
for i in range(1, len(nums)):
if nums[i] > nums[i - 1]:
dp[i] = dp... | class Solution:
def find_length_of_lcis(self, nums: List[int]) -> int:
if not nums:
return 0
dp = [1] * len(nums)
if len(nums) < 2:
return 1
result = 1
for i in range(1, len(nums)):
if nums[i] > nums[i - 1]:
dp[i] = dp[i - ... |
class Symbol:
key = '#'
author = '@'
goto = '>'
condition = '?'
action = '!'
comment = '%'
left = '{'
right = '}'
def prefixcount(string, prefix):
i = 0
while string[i] == prefix:
i += 1
return i
def extract(string, startsymbol, endsymbol):
if not startsymbol in string and endsymbol in string:
return... | class Symbol:
key = '#'
author = '@'
goto = '>'
condition = '?'
action = '!'
comment = '%'
left = '{'
right = '}'
def prefixcount(string, prefix):
i = 0
while string[i] == prefix:
i += 1
return i
def extract(string, startsymbol, endsymbol):
if not startsymbol in... |
#value=input().split()
#B,G=value
#B=int(B) #B=ball
#G=int(G) #G=need
B=int(input())
G=int(input())
result = G//2
also_need=result-B
if (result<=B):
print("Amelia tem todas bolinhas!")
else:
print("Faltam",also_need,"bolinha(s)") | b = int(input())
g = int(input())
result = G // 2
also_need = result - B
if result <= B:
print('Amelia tem todas bolinhas!')
else:
print('Faltam', also_need, 'bolinha(s)') |
def GenerateCombination(N, ObjectNumber):
# initiate the object B and C positions
# Get all permutations of length 2
combinlist = []
for i in range(N):
if i < N-1:
j = i + 1
else:
j = 0
combin = [ObjectNumber, i, j]
combinlist.append(combin)
r... | def generate_combination(N, ObjectNumber):
combinlist = []
for i in range(N):
if i < N - 1:
j = i + 1
else:
j = 0
combin = [ObjectNumber, i, j]
combinlist.append(combin)
return combinlist |
class OTBDeepConfig:
fhog_params = {'fname': 'fhog',
'num_orients': 9,
'cell_size': 4,
'compressed_dim': 10,
# 'nDim': 9 * 3 + 5 -1
}
#cn_params = {"fname": 'cn',
# "table_name": "CNnorm",
... | class Otbdeepconfig:
fhog_params = {'fname': 'fhog', 'num_orients': 9, 'cell_size': 4, 'compressed_dim': 10}
cnn_params = {'fname': 'cnn-resnet50', 'compressed_dim': [16, 64]}
features = [fhog_params, cnn_params]
normalize_power = 2
normalize_size = True
normalize_dim = True
square_root_norm... |
DECOY_PREFIX = 'decoy_'
HEADER_SPECFILE = '#SpecFile'
HEADER_SCANNR = 'ScanNum'
HEADER_SPECSCANID = 'SpecID'
HEADER_CHARGE = 'Charge'
HEADER_PEPTIDE = 'Peptide'
HEADER_PROTEIN = 'Protein'
HEADER_GENE = 'Gene ID'
HEADER_SYMBOL = 'Gene Name'
HEADER_DESCRIPTION = 'Description'
HEADER_PRECURSOR_MZ = 'Precursor'
HEADER_PRE... | decoy_prefix = 'decoy_'
header_specfile = '#SpecFile'
header_scannr = 'ScanNum'
header_specscanid = 'SpecID'
header_charge = 'Charge'
header_peptide = 'Peptide'
header_protein = 'Protein'
header_gene = 'Gene ID'
header_symbol = 'Gene Name'
header_description = 'Description'
header_precursor_mz = 'Precursor'
header_prec... |
# The path to the ROM file to load:
# SpaceInvaders starts to render visible pixels when
# the cpu halfClkCount reaches about 11000
#romFile = 'roms/SpaceInvaders.bin'
#romFile = 'roms/Pitfall.bin'
romFile = 'roms/DonkeyKong.bin'
# 8kb ROM, spins reading 0x282 switches
#romFile = 'roms/Asteroids.bin'
# 2kb ROM
#... | rom_file = 'roms/DonkeyKong.bin'
image_output_dir = 'outFrames'
chip6502_file = 'chips/net_6502.pkl'
chip_tia_file = 'chips/net_TIA.pkl'
num_tia_half_clocks_per_render = 128
mos6502_wire_init = [['A', 737, 1234, 978, 162, 727, 858, 1136, 1653], ['X', 1216, 98, 1, 1648, 85, 589, 448, 777], ['Y', 64, 1148, 573, 305, 989,... |
def setStringLength(string,length,align:"left"):
"""
:param string: A str which is you want to set length
:param length: Integer
:param align: left, mid or right
:return:
"""
real_str_len=len(string)
if real_str_len<length:
if align=="left":
text_which_add=""
... | def set_string_length(string, length, align: 'left'):
"""
:param string: A str which is you want to set length
:param length: Integer
:param align: left, mid or right
:return:
"""
real_str_len = len(string)
if real_str_len < length:
if align == 'left':
text_which_add... |
class RegionModel:
def __init__(self, dbRow):
self.ID = dbRow["ID"]
self.RegionName = dbRow["RegionName"]
self.RegionCode = dbRow["RegionCode"]
self.RegionChat = dbRow["RegionChat"] | class Regionmodel:
def __init__(self, dbRow):
self.ID = dbRow['ID']
self.RegionName = dbRow['RegionName']
self.RegionCode = dbRow['RegionCode']
self.RegionChat = dbRow['RegionChat'] |
def test_correct_abi_right_padding(tester, w3, get_contract_with_gas_estimation):
selfcall_code_6 = """
@external
def hardtest(arg1: Bytes[64], arg2: Bytes[64]) -> Bytes[128]:
return concat(arg1, arg2)
"""
c = get_contract_with_gas_estimation(selfcall_code_6)
assert c.hardtest(b"hello" * 5, b"hell... | def test_correct_abi_right_padding(tester, w3, get_contract_with_gas_estimation):
selfcall_code_6 = '\n@external\ndef hardtest(arg1: Bytes[64], arg2: Bytes[64]) -> Bytes[128]:\n return concat(arg1, arg2)\n '
c = get_contract_with_gas_estimation(selfcall_code_6)
assert c.hardtest(b'hello' * 5, b'hello'... |
def primera_letra(lista_de_palabras):
primeras_letras = []
for palabra in lista_de_palabras:
assert type(palabra) == str, f'{palabra} no es str'
assert len(palabra) > 0, 'No se permiten str vacios'
primeras_letras.append(palabra[0])
return primeras_letras | def primera_letra(lista_de_palabras):
primeras_letras = []
for palabra in lista_de_palabras:
assert type(palabra) == str, f'{palabra} no es str'
assert len(palabra) > 0, 'No se permiten str vacios'
primeras_letras.append(palabra[0])
return primeras_letras |
load("@bazel_skylib//lib:paths.bzl", "paths")
load(":common.bzl", "declare_caches", "write_cache_manifest")
load("//dotnet/private:context.bzl", "dotnet_exec_context", "make_builder_cmd")
load("//dotnet/private:providers.bzl", "DotnetPublishInfo")
def pack(ctx):
info = ctx.attr.target[DotnetPublishInfo]
restor... | load('@bazel_skylib//lib:paths.bzl', 'paths')
load(':common.bzl', 'declare_caches', 'write_cache_manifest')
load('//dotnet/private:context.bzl', 'dotnet_exec_context', 'make_builder_cmd')
load('//dotnet/private:providers.bzl', 'DotnetPublishInfo')
def pack(ctx):
info = ctx.attr.target[DotnetPublishInfo]
restor... |
#===============================================================
# DMXIS Macro (c) 2010 db audioware limited
#===============================================================
RgbColour(255,127,80)
| rgb_colour(255, 127, 80) |
def remote_pip_install_simple(name, silent):
return remote_pip_install(name, True, 'python3', 'pip3', silent)
def remote_pip_install(name, usermode, py, pip, silent):
return lib_install(name, usermode=usermode, py=py, pip=pip, silent=silent)
| def remote_pip_install_simple(name, silent):
return remote_pip_install(name, True, 'python3', 'pip3', silent)
def remote_pip_install(name, usermode, py, pip, silent):
return lib_install(name, usermode=usermode, py=py, pip=pip, silent=silent) |
class RandomObjects:
prefix = ''
postfix = ''
def __init__(self):
self.displacements = {}
self.velocities = {}
self.accelerations = {}
self.load_vectors = {}
self.spc_forces = {}
self.mpc_forces = {}
self.crod_force = {}
self.conrod_force = {}... | class Randomobjects:
prefix = ''
postfix = ''
def __init__(self):
self.displacements = {}
self.velocities = {}
self.accelerations = {}
self.load_vectors = {}
self.spc_forces = {}
self.mpc_forces = {}
self.crod_force = {}
self.conrod_force = {}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.