content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# Function for checking the divisibility # Notice the indentation after function declaration # and if and else statements def checkDivisibility(a, b): if a % b == 0 : print ("a is divisible by b") else: print ("a is not divisible by b") #Driver program to test the above function checkDivisibilit...
def check_divisibility(a, b): if a % b == 0: print('a is divisible by b') else: print('a is not divisible by b') check_divisibility(5, 2)
OPEN = { '{': '}', '[': ']', '(': ')', '<': '>', } CLOSED = {v: k for k, v in OPEN.items()} def check_balanced(s): """Check for balanced parentheses, braces and brackets.""" stack = [] for i, c in enumerate(s): if c in OPEN: stack.append((i, c)) elif c in CLOSED...
open = {'{': '}', '[': ']', '(': ')', '<': '>'} closed = {v: k for (k, v) in OPEN.items()} def check_balanced(s): """Check for balanced parentheses, braces and brackets.""" stack = [] for (i, c) in enumerate(s): if c in OPEN: stack.append((i, c)) elif c in CLOSED: tr...
class Tri(object): p1 = PVector(0,0) p2 = PVector(0,0) p3 = PVector(0,0) w = 10 h = 10 def __init__(self, _p1, _p2, _p3): #constructor self.p1 = _p1 self.p2 = _p2 self.p3 = _p3 def display_lines(self, col): # method of class display fill(col,1...
class Tri(object): p1 = p_vector(0, 0) p2 = p_vector(0, 0) p3 = p_vector(0, 0) w = 10 h = 10 def __init__(self, _p1, _p2, _p3): self.p1 = _p1 self.p2 = _p2 self.p3 = _p3 def display_lines(self, col): fill(col, 100) begin_shape() vertex(self.p...
class AbstractEnv: def reset(self): raise NotImplementedError() def step(self): raise NotImplementedError() def setup_test(self): raise NotImplementedError()
class Abstractenv: def reset(self): raise not_implemented_error() def step(self): raise not_implemented_error() def setup_test(self): raise not_implemented_error()
num = int(input()) for i in range(num): person = int(input()) hshake = person*(person - 1)//2 print(hshake)
num = int(input()) for i in range(num): person = int(input()) hshake = person * (person - 1) // 2 print(hshake)
class Solution: def longestDupSubstring(self, S: str) -> str: nums = [ord(S[i])-ord('a') for i in range(len(S))] left, right = 1, len(S)-1 while left<=right: mid = left+(right-left)//2 if self.helper(mid, nums)!=-1: left = mid + 1 else: ...
class Solution: def longest_dup_substring(self, S: str) -> str: nums = [ord(S[i]) - ord('a') for i in range(len(S))] (left, right) = (1, len(S) - 1) while left <= right: mid = left + (right - left) // 2 if self.helper(mid, nums) != -1: left = mid + 1 ...
class IProvider(object): def normalizedAlias(self, metaStr, aliasStr): raise NotImplementedError("Subclass must implement this method!") def aggr(self): raise NotImplementedError("Subclass must implement this method!")
class Iprovider(object): def normalized_alias(self, metaStr, aliasStr): raise not_implemented_error('Subclass must implement this method!') def aggr(self): raise not_implemented_error('Subclass must implement this method!')
opt_xgb = "xgb" opt_cut_negatives = "cut_negatives" opt_validation_size_negatives = "validation_size" opt_validation_size_positives = "validation_size_gt" opt_predict_test = "predict_test" opt_num_boost_round = "num_boost_round" opt_early_stopping_rounds = "early_stopping_rounds" opt_verbose_eval = "verbose_eval" opt_p...
opt_xgb = 'xgb' opt_cut_negatives = 'cut_negatives' opt_validation_size_negatives = 'validation_size' opt_validation_size_positives = 'validation_size_gt' opt_predict_test = 'predict_test' opt_num_boost_round = 'num_boost_round' opt_early_stopping_rounds = 'early_stopping_rounds' opt_verbose_eval = 'verbose_eval' opt_p...
#!/usr/bin/env python3 # Get the input file with open('input', 'r') as input_file: input_list = [line.strip() for line in input_file.readlines()] answer_p1 = 0 answer_p2 = 0 # Pre-process our input answers_list = [] curr_line = "" for line in input_list: # If we have a empty line, then the info about this answer i...
with open('input', 'r') as input_file: input_list = [line.strip() for line in input_file.readlines()] answer_p1 = 0 answer_p2 = 0 answers_list = [] curr_line = '' for line in input_list: if line == '': answers_list.append(curr_line) curr_line = '' elif curr_line == '': curr_line = li...
""" Module containing submodules and/or scripts covering downloading, generation, processing or cleaning of data. Author ------ Tom Fleet License ------- MIT """
""" Module containing submodules and/or scripts covering downloading, generation, processing or cleaning of data. Author ------ Tom Fleet License ------- MIT """
class Solution: def productExceptSelf(self, nums: List[int]) -> List[int]: dt=Counter(nums) op=[] for i in nums: dt[i]-=1 tp=1 if dt[i]==0: del dt[i] for t in dt.keys(): tp*=t**dt[t] op.append(tp) ...
class Solution: def product_except_self(self, nums: List[int]) -> List[int]: dt = counter(nums) op = [] for i in nums: dt[i] -= 1 tp = 1 if dt[i] == 0: del dt[i] for t in dt.keys(): tp *= t ** dt[t] ...
# Write a short Python function, is_even(k), that takes an integer value and returns True if k is even, and False otherwise. However, your function cannot use modulo, multiplication, or division operators def is_even(k): temp = str(k)[-1] return temp == '0' or temp == '2' or temp == '4' or temp == '6' or temp ...
def is_even(k): temp = str(k)[-1] return temp == '0' or temp == '2' or temp == '4' or (temp == '6') or (temp == '8') k = input('Enter number: ') print(is_even(k))
# key: value dict1 = {x: x**2 for x in range(10)} print(dict1) # nur gerade dict2 = {x: x**2 for x in range(10) if x % 2 == 0} print(dict2) # wenn > 5 quadrieren ansonsten hoch 1/2 dict3 = {x: x**2 if x > 5 else x**(1/2) for x in range(10) if x % 2 == 0} print(dict3) friends = ['hans', 'peter', 'max'] friend_keys = ...
dict1 = {x: x ** 2 for x in range(10)} print(dict1) dict2 = {x: x ** 2 for x in range(10) if x % 2 == 0} print(dict2) dict3 = {x: x ** 2 if x > 5 else x ** (1 / 2) for x in range(10) if x % 2 == 0} print(dict3) friends = ['hans', 'peter', 'max'] friend_keys = ['firstname', 'lastname', 'birthday'] "\nmy_friend_dict = {\...
def hail_friend(name): print("Hail, " + name + "!") def add_numbers(num1, num2): return num1+num2
def hail_friend(name): print('Hail, ' + name + '!') def add_numbers(num1, num2): return num1 + num2
class Employee: 'Common base class for all employees' emp_count = 0 def __init__(self, name, salary): self.name = name self.salary = salary Employee.emp_count += 1 def display_count(self): print("Total Employee %d" % Employee.emp_count) def display_employee(self): print...
class Employee: """Common base class for all employees""" emp_count = 0 def __init__(self, name, salary): self.name = name self.salary = salary Employee.emp_count += 1 def display_count(self): print('Total Employee %d' % Employee.emp_count) def display_employee(sel...
m_start = 'Hello! \nYou are in an anonymous dating chat! \n' \ 'Press the button below to start chatting with the patner. '\ 'If you want to get to know a person better - press the like button and with mutual sympathy ' \ 'you will be able to find out the nickname of the par...
m_start = "Hello! \nYou are in an anonymous dating chat! \nPress the button below to start chatting with the patner. If you want to get to know a person better - press the like button and with mutual sympathy you will be able to find out the nickname of the partner. If you don't like the patner, then feel free to press...
''' File: __init__.py Project: metrics File Created: Monday, 17th August 2020 3:14:39 pm Author: Sparsh Dutta (sparsh.dtt@gmail.com) ----- Last Modified: Monday, 17th August 2020 3:14:39 pm Modified By: Sparsh Dutta (sparsh.dtt@gmail.com>) ----- Copyright 2020 Sparsh Dutta '''
""" File: __init__.py Project: metrics File Created: Monday, 17th August 2020 3:14:39 pm Author: Sparsh Dutta (sparsh.dtt@gmail.com) ----- Last Modified: Monday, 17th August 2020 3:14:39 pm Modified By: Sparsh Dutta (sparsh.dtt@gmail.com>) ----- Copyright 2020 Sparsh Dutta """
"""A class with an instance variable.""" class MyClass(object): def __init__(myself, value): #print(value) myself.instance_var = value myself.var2 = 2 def print_me(myself): myself.var3 = 1234 print(myself.instance_var) def add(self, x): print(x+2) def ...
"""A class with an instance variable.""" class Myclass(object): def __init__(myself, value): myself.instance_var = value myself.var2 = 2 def print_me(myself): myself.var3 = 1234 print(myself.instance_var) def add(self, x): print(x + 2) def print_again(self): ...
x = 10 y = 20 z = x+y print('z is: %s' % z)
x = 10 y = 20 z = x + y print('z is: %s' % z)
# 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 verticalTraversal(self, root: Optional[TreeNode]) -> List[List[int]]: # method for preorder tra...
class Solution: def vertical_traversal(self, root: Optional[TreeNode]) -> List[List[int]]: def preorder(root, row, col): if col in coord: coord[col].append((row, root.val)) else: coord[col] = [(row, root.val)] if root.left: ...
### SET x = {1,2,3} x.add(4) print(x) x.remove(2) print(x) x.discard(100) print(x) x= {1,2,4} y ={"Three",4} print(x.intersection(y)) x.update(y) print(x) x = set('aAbcd') y =set('Ax') print(x-y) print(x|y) print(x&y) print(x^y) # Practice any other methods from SET
x = {1, 2, 3} x.add(4) print(x) x.remove(2) print(x) x.discard(100) print(x) x = {1, 2, 4} y = {'Three', 4} print(x.intersection(y)) x.update(y) print(x) x = set('aAbcd') y = set('Ax') print(x - y) print(x | y) print(x & y) print(x ^ y)
class TwoSum(object): def __init__(self): """ initialize your data structure here """ self.internal = [] self.dic = {} def add(self, number): """ Add the number to an internal data structure. :rtype: nothing """ self.internal.appe...
class Twosum(object): def __init__(self): """ initialize your data structure here """ self.internal = [] self.dic = {} def add(self, number): """ Add the number to an internal data structure. :rtype: nothing """ self.internal.appe...
# d - cijeli broj # f - realni broj # s - string #primjer formatiranog ispisa a=3.12345 print('{0:f},{1:0.1f}'.format(a, a))
a = 3.12345 print('{0:f},{1:0.1f}'.format(a, a))
x = 1 y = 2 print("x is {}".format(x)) print("y is {}".format(y)) print("swapping... ") (x, y) = (y, x) # a, b, c = foo() returning multiple print('swapped.') print("x is {}".format(x)) print("y is {}".format(y))
x = 1 y = 2 print('x is {}'.format(x)) print('y is {}'.format(y)) print('swapping... ') (x, y) = (y, x) print('swapped.') print('x is {}'.format(x)) print('y is {}'.format(y))
# -*- coding: utf-8 -*- """ Created on Wed Mar 13 11:30:05 2019 @author: Jongmin Sung custom_funcs.py In projectname/projectname/custom_funcs.py, we can put in custom code that gets used across more than notebook. One example would be downstream data preprocessing that is only necessary for a subset of not...
""" Created on Wed Mar 13 11:30:05 2019 @author: Jongmin Sung custom_funcs.py In projectname/projectname/custom_funcs.py, we can put in custom code that gets used across more than notebook. One example would be downstream data preprocessing that is only necessary for a subset of notebooks. # custom_funcs.py """ ...
# The goal is sum the digits. valor = int(input('Enter a whole number: ')) sum = 0 while valor > 0: rest = valor % 10 valor = (valor - rest) / 10 sum += rest print(int(sum))
valor = int(input('Enter a whole number: ')) sum = 0 while valor > 0: rest = valor % 10 valor = (valor - rest) / 10 sum += rest print(int(sum))
def add(filename, siglas, carrera): with open(filename, 'a') as f_obj: f_obj.write(f'\n{siglas} {carrera}') def sacacarrera(linea): siglas = '' carrera = '' counter = 0 for c in linea: if c == ' ': counter=1 if counter != 1: siglas+=c if count...
def add(filename, siglas, carrera): with open(filename, 'a') as f_obj: f_obj.write(f'\n{siglas} {carrera}') def sacacarrera(linea): siglas = '' carrera = '' counter = 0 for c in linea: if c == ' ': counter = 1 if counter != 1: siglas += c if c...
NODE, EDGE, ATTR = range(3) class Node: def __init__(self, name, attrs): self.name = name self.attrs = attrs def __eq__(self, other): return self.name == other.name and self.attrs == other.attrs class Edge: def __init__(self, src, dst, attrs): self.src = src self...
(node, edge, attr) = range(3) class Node: def __init__(self, name, attrs): self.name = name self.attrs = attrs def __eq__(self, other): return self.name == other.name and self.attrs == other.attrs class Edge: def __init__(self, src, dst, attrs): self.src = src se...
prov_cap = { "Hebei": "Shijiazhuang", "Shanxi": "Taiyuan", "Liaoning": "Shenyang", "Jilin": "Changchun", "Heilongjiang": "Harbin", "Jiangsu": "Nanjing", "Zhejiang": "Hangzhou", "Anhui": "Hefei", "Fujian": "Fuzhou", "Jiangxi": "Nanchang", "Shandong": "Jinan", "Henan": "Zhe...
prov_cap = {'Hebei': 'Shijiazhuang', 'Shanxi': 'Taiyuan', 'Liaoning': 'Shenyang', 'Jilin': 'Changchun', 'Heilongjiang': 'Harbin', 'Jiangsu': 'Nanjing', 'Zhejiang': 'Hangzhou', 'Anhui': 'Hefei', 'Fujian': 'Fuzhou', 'Jiangxi': 'Nanchang', 'Shandong': 'Jinan', 'Henan': 'Zhengzhou', 'Hubei': 'Wuhan', 'Hunan': 'Changsha', '...
# Get the aggregated number of a specific POI category per H3 index at a given resolution def get_pois_by_category_in_polygon( dbt_controller, category, resolution, polygon_coords ): return dbt_controller.run_macro( macro_category="poi", macro_name="get_pois_in_polygon", args="{" + f"h3_...
def get_pois_by_category_in_polygon(dbt_controller, category, resolution, polygon_coords): return dbt_controller.run_macro(macro_category='poi', macro_name='get_pois_in_polygon', args='{' + f"h3_resolution: {str(resolution)}, category: {category}, polygon_coords: '{polygon_coords}'" + '}') def get_popularity_in_po...
__all__ = [ "sis_vs_smc", "ekf_vs_ukf", "ekf_vs_ukf_mlp", "eekf_logistic_regression", "ekf_mlp_anim", "linreg_kf", "kf_parallel", "kf_continuous_circle", "kf_spiral", "kf_tracking", "bootstrap_filter", "pendulum_1d", "ekf_continuous" ]
__all__ = ['sis_vs_smc', 'ekf_vs_ukf', 'ekf_vs_ukf_mlp', 'eekf_logistic_regression', 'ekf_mlp_anim', 'linreg_kf', 'kf_parallel', 'kf_continuous_circle', 'kf_spiral', 'kf_tracking', 'bootstrap_filter', 'pendulum_1d', 'ekf_continuous']
''' representations qumis/qasm input: script ordered list: arrays containing the 1Q and the 2Q steps rotation list: arrays, but instead of strings, su2 operations on the same mw step are packed into one euler list: arrays, but instead of su2 rotations, we already have their szxz representation compiled list: z gates ar...
""" representations qumis/qasm input: script ordered list: arrays containing the 1Q and the 2Q steps rotation list: arrays, but instead of strings, su2 operations on the same mw step are packed into one euler list: arrays, but instead of su2 rotations, we already have their szxz representation compiled list: z gates ar...
n=int(input())*300 n1=int(input())*1500 n2=int(input())*600 n3=int(input())*1000 n4=int(input())*150 resp=(n+n1+n2+n3+n4)+225 print(resp)
n = int(input()) * 300 n1 = int(input()) * 1500 n2 = int(input()) * 600 n3 = int(input()) * 1000 n4 = int(input()) * 150 resp = n + n1 + n2 + n3 + n4 + 225 print(resp)
myinput=list(input("Enter a String : " )) word = "" for x in myinput: if (myinput.index(x) % 2 == 0): word += x print(word)
myinput = list(input('Enter a String : ')) word = '' for x in myinput: if myinput.index(x) % 2 == 0: word += x print(word)
class BindingsCollection(BaseCollection,ICollection,IEnumerable): """ Represents a collection of System.Windows.Forms.Binding objects for a control. """ def Add(self,*args): """ Add(self: BindingsCollection,binding: Binding) Adds the specified binding to the collection. binding: The System.W...
class Bindingscollection(BaseCollection, ICollection, IEnumerable): """ Represents a collection of System.Windows.Forms.Binding objects for a control. """ def add(self, *args): """ Add(self: BindingsCollection,binding: Binding) Adds the specified binding to the collection. binding: The Sy...
def alphabet_position(text): alphabet = {} chars = [chr(x) for x in range(97, 123)] for i in range(len(chars)): alphabet[chars[i]] = str(i+1) return ' '.join([alphabet[x] for x in text.lower() if x in alphabet])
def alphabet_position(text): alphabet = {} chars = [chr(x) for x in range(97, 123)] for i in range(len(chars)): alphabet[chars[i]] = str(i + 1) return ' '.join([alphabet[x] for x in text.lower() if x in alphabet])
""" T="/Users/james/cache/hg18/align/multiz28way/chr10.maf" def test(): s = os.stat( T ).st_size real_f = open( T ) f = filecache.FileCache( real_f, s ) for i in range( 1000 ): f.readline() def test_random_seeking(): s = os.stat( T ).st_size raw = open( T ) f = filecache.FileCache...
""" T="/Users/james/cache/hg18/align/multiz28way/chr10.maf" def test(): s = os.stat( T ).st_size real_f = open( T ) f = filecache.FileCache( real_f, s ) for i in range( 1000 ): f.readline() def test_random_seeking(): s = os.stat( T ).st_size raw = open( T ) f = filecache.FileCache(...
class HypothesisSpace: def __init__(self, *params, **kw_params): self.hypotheses = self.create_hypothesis_space(*params, **kw_params) def __len__(self): return len(self.hypotheses) def __iter__(self): return self.hypotheses.__iter__() def create_hypothesis_space(self, *params...
class Hypothesisspace: def __init__(self, *params, **kw_params): self.hypotheses = self.create_hypothesis_space(*params, **kw_params) def __len__(self): return len(self.hypotheses) def __iter__(self): return self.hypotheses.__iter__() def create_hypothesis_space(self, *params...
load("@rules_jvm_external//:defs.bzl", "maven_install") load("@rules_jvm_external//:specs.bzl", "maven") def selenium_java_deps(): netty_version = "4.1.63.Final" opentelemetry_version = "1.2.0" maven_install( artifacts = [ "com.beust:jcommander:1.81", "com.github.javaparser...
load('@rules_jvm_external//:defs.bzl', 'maven_install') load('@rules_jvm_external//:specs.bzl', 'maven') def selenium_java_deps(): netty_version = '4.1.63.Final' opentelemetry_version = '1.2.0' maven_install(artifacts=['com.beust:jcommander:1.81', 'com.github.javaparser:javaparser-core:3.22.0', maven.artif...
### Noisy DQN Pong_ML-Agents Config ### env = {"name": "pong_mlagent", "train_mode": True} agent = { "name": "noisy", "network": "noisy", "gamma": 0.99, "explore_ratio": 0.1, "buffer_size": 50000, "batch_size": 32, "start_train_step": 25000, "target_update_period": 1000, # noisy ...
env = {'name': 'pong_mlagent', 'train_mode': True} agent = {'name': 'noisy', 'network': 'noisy', 'gamma': 0.99, 'explore_ratio': 0.1, 'buffer_size': 50000, 'batch_size': 32, 'start_train_step': 25000, 'target_update_period': 1000, 'noise_type': 'factorized'} optim = {'name': 'adam', 'lr': 0.00025} train = {'training': ...
class Solution: def preorderTraversal(self, root: TreeNode) -> List[int]: res = [] self.traverse(root, res) return res def traverse(self, root, res) : if not root: return res.append(root.val) self.traverse(root.left, res) self.traverse(roo...
class Solution: def preorder_traversal(self, root: TreeNode) -> List[int]: res = [] self.traverse(root, res) return res def traverse(self, root, res): if not root: return res.append(root.val) self.traverse(root.left, res) self.traverse(root.r...
CELERY_BROKER_URL_DOCKER = 'amqp://admin:mypass@rabbit:5672/' CELERY_BROKER_URL_LOCAL = 'amqp://localhost/' CM_REGISTER_Q = 'rpc_queue_CM_register' CM_NAME = 'CM - Heat load profiles' RPC_CM_ALIVE= 'rpc_queue_CM_ALIVE' RPC_Q = 'rpc_queue_CM_compute' # Do no change this value CM_ID = 9 PORT_LOCAL = int('500' + str(C...
celery_broker_url_docker = 'amqp://admin:mypass@rabbit:5672/' celery_broker_url_local = 'amqp://localhost/' cm_register_q = 'rpc_queue_CM_register' cm_name = 'CM - Heat load profiles' rpc_cm_alive = 'rpc_queue_CM_ALIVE' rpc_q = 'rpc_queue_CM_compute' cm_id = 9 port_local = int('500' + str(CM_ID)) port_docker = 80 celer...
class Box: def __init__(self, length, width, height): self.length = length self.width = width self.height = height def pack(self, something): print(f"pack {something}")
class Box: def __init__(self, length, width, height): self.length = length self.width = width self.height = height def pack(self, something): print(f'pack {something}')
# This is a python script for adding package information # To modify syntax rule, you must: # 1. modify JavaParser.g4 # 2. Execute `antlr4 JavaParser.g4` # 3. Run this script # import os # os.chdir('./src/main/java/mastery.translator/java') # import subprocess # subprocess.run(['antlr4', 'JavaParser.g4'], stdout=subp...
names = ['JavaParser.java', 'JavaParserBaseListener.java', 'JavaParserListener.java'] for filename in names: with open(filename, 'r') as f: content = f.read() with open(filename, 'w') as f: f.write('package mastery.translator.java;\n\n') f.write(content)
''' Description: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below). How many possible unique paths...
""" Description: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below). How many possible unique paths...
# Dua buah data yang tersimpan dalam tipe list data1 = [70, 70, 70, 100, 100, 100, 120, 120, 150, 150] data2 = [50, 60, 60, 50, 70, 70, 100, 80, 100, 90] # Definisikan fungsi hitng_rata_rata def hitung_rata_rata(data): jumlah = 0 for item in data: jumlah += item rata_rata = jumlah/len(data) retu...
data1 = [70, 70, 70, 100, 100, 100, 120, 120, 150, 150] data2 = [50, 60, 60, 50, 70, 70, 100, 80, 100, 90] def hitung_rata_rata(data): jumlah = 0 for item in data: jumlah += item rata_rata = jumlah / len(data) return rata_rata print('Rata-rata data1:') print(hitung_rata_rata(data1)) print('Rata...
GITHUB_OAUTH_CLIENT_ID = "XXXXX" GITHUB_OAUTH_CLIENT_SECRET = "XXXXX" GITHUB_TOKEN = "XXXXX" DISQUS_TOKEN = "XXXXX" SECRET_KEY = "XXXXX"
github_oauth_client_id = 'XXXXX' github_oauth_client_secret = 'XXXXX' github_token = 'XXXXX' disqus_token = 'XXXXX' secret_key = 'XXXXX'
# HARD # build 2 stacks store successor and predecssor with O(H) time # merge 2 stack with O(K) time # Time: O(H) class Solution: def closestKValues(self, root: TreeNode, target: float, k: int) -> List[int]: def initSucc(root,tar): large = [] while root: if root.v...
class Solution: def closest_k_values(self, root: TreeNode, target: float, k: int) -> List[int]: def init_succ(root, tar): large = [] while root: if root.val == tar: large.append(root) break elif root.val > tar:...
def ex_situ_hardxray(t=1): # samples = ['PLA2','PLA1','CON6','CON5', 'CON4','CON3','CON2','CON1', # '05_Ca_1', '05_Ca_2', '05_UT_1', '05_UT_2', 'PLA6','PLA4','PLA3', # ] # samples = ['B5_1','B5_2','B5_3', 'B6_1','B6_2','B6_3','B7_1','B7_2','B7_3','B12_1','B12_2','B12_3'] # x_list = [45550, 41200, ...
def ex_situ_hardxray(t=1): samples = ['D13_51', 'D13_52', 'D13_53', 'D14_54', 'D14_55', 'D14_56', 'D15_57', 'D15_58', 'D15_59', 'D16_60', 'D16_61', 'D16_62', 'D16_63', 'D16_64', 'D17_65', 'D17_66', 'D17_67'] x_list = [43700, 38400, 34000, 25200, 20000, 15400, 6700, 2500, -2300, -6800, -14000, -19000, -23300, -2...
class Sources: ''' source class that defines the news source ''' def __init__(self,id,name,description,url,category,language,country): self.id=id self.name=name self.description=description self.url=url self.category=category self.language=l...
class Sources: """ source class that defines the news source """ def __init__(self, id, name, description, url, category, language, country): self.id = id self.name = name self.description = description self.url = url self.category = category self.languag...
class Solution: def smallestRangeII(self, A, K): """ :type A: List[int] :type K: int :rtype: int """ # + 0 or 2 * K # to which index: add 2 * K A.sort() res = A[-1] - A[0] for i in range(0, len(A) - 1): mn = min(A[0] + 2 * K...
class Solution: def smallest_range_ii(self, A, K): """ :type A: List[int] :type K: int :rtype: int """ A.sort() res = A[-1] - A[0] for i in range(0, len(A) - 1): mn = min(A[0] + 2 * K, A[i + 1]) mx = max(A[-1], A[i] + 2 * K) ...
# # @lc app=leetcode id=918 lang=python3 # # [918] Maximum Sum Circular Subarray # # @lc code=start class Solution: def maxSubarraySumCircular(self, A: List[int]) -> int: def ka(nums): res = float('-inf') current = float('-inf') for num in nums: current =...
class Solution: def max_subarray_sum_circular(self, A: List[int]) -> int: def ka(nums): res = float('-inf') current = float('-inf') for num in nums: current = max(0, current) + num res = max(res, current) return res if...
def configure(configuration_context): third_party_node = configuration_context.path.make_node('bugengine/3rdparty') for category in third_party_node.listdir(): if category[0] != '.': category_node = third_party_node.make_node(category) for third_party in category_node.listdir(): ...
def configure(configuration_context): third_party_node = configuration_context.path.make_node('bugengine/3rdparty') for category in third_party_node.listdir(): if category[0] != '.': category_node = third_party_node.make_node(category) for third_party in category_node.listdir(): ...
# Copyright 2021 Code Intelligence GmbH # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
def java_fuzz_target_test(name, target_class=None, deps=[], hook_classes=[], data=[], sanitizer=None, visibility=None, tags=[], fuzzer_args=[], srcs=[], size=None, timeout=None, env=None, verify_crash_input=True, verify_crash_reproducer=True, execute_crash_reproducer=False, **kwargs): target_name = name + '_target'...
_base_ = '/home/jj/Documents/mmdetection/configs/_base_/models/faster_rcnn_r50_fpn.py' # model settings model = dict( neck=[ dict( type='FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, num_outs=5), dict( type='BFP', ...
_base_ = '/home/jj/Documents/mmdetection/configs/_base_/models/faster_rcnn_r50_fpn.py' model = dict(neck=[dict(type='FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, num_outs=5), dict(type='BFP', in_channels=256, num_levels=5, refine_level=2, refine_type='non_local')], roi_head=dict(bbox_head=dict(loss_bbox=...
def print1ToN(n): if n<=1: print("1",end =" ") return 0 print1ToN(n-1) print(n,end = " ") def printNto1(n): if n<=1: print("1",end =" ") return 0 print(n,end = " ") printNto1(n-1) n = int(input("Enter Input : ")) print1ToN(n) printNto1(n)
def print1_to_n(n): if n <= 1: print('1', end=' ') return 0 print1_to_n(n - 1) print(n, end=' ') def print_nto1(n): if n <= 1: print('1', end=' ') return 0 print(n, end=' ') print_nto1(n - 1) n = int(input('Enter Input : ')) print1_to_n(n) print_nto1(n)
users = [ { 'id': 0, 'photo': 'img0.jpg', 'firstname':'calvin', 'lastname':'settachatgul', 'nickname':'cal', 'email': 'calvin.settachatgul@gmail.com', 'aboutme': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In condimentum neque a enim bibendum tempus. Proin condimentum, nisi s...
users = [{'id': 0, 'photo': 'img0.jpg', 'firstname': 'calvin', 'lastname': 'settachatgul', 'nickname': 'cal', 'email': 'calvin.settachatgul@gmail.com', 'aboutme': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In condimentum neque a enim bibendum tempus. Proin condimentum, nisi sed sagittis suscipit, ex lacu...
# # PySNMP MIB module FDDI-SMT73-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/FDDI-SMT73-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 16:53:32 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, value_size_constraint, constraints_union, value_range_constraint, single_value_constraint) ...
#!/usr/bin/python """ This module contains helper functions to parser Multi2Sim trace """ def parser(keyword, line): """ Main parser function """ try: for item in line.split(' '): if keyword in item: return item.split('=')[1] except IndexError: return "[ERR] par...
""" This module contains helper functions to parser Multi2Sim trace """ def parser(keyword, line): """ Main parser function """ try: for item in line.split(' '): if keyword in item: return item.split('=')[1] except IndexError: return '[ERR] parser: ' + line def ...
class ODLIRD(): def load_odl_ird(self, odl_ird): self.content = odl_ird return self def rfc_ird(self): return { 'meta': self.to_rfc_meta(self.content['meta']), 'resources': self.to_rfc_resources(self.content['resources']) } def to_rfc_meta(self, odl_...
class Odlird: def load_odl_ird(self, odl_ird): self.content = odl_ird return self def rfc_ird(self): return {'meta': self.to_rfc_meta(self.content['meta']), 'resources': self.to_rfc_resources(self.content['resources'])} def to_rfc_meta(self, odl_meta): return {'cost-types'...
N, A, B, C = map(int, input().split()) l_list = [int(input()) for _ in range(N)] inf = float("inf") def dfs(cur, a, b, c): if cur == N: return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else inf ans0 = dfs(cur + 1, a, b, c) ans1 = dfs(cur + 1, a + l_list[cur], b, c) + 10 an...
(n, a, b, c) = map(int, input().split()) l_list = [int(input()) for _ in range(N)] inf = float('inf') def dfs(cur, a, b, c): if cur == N: return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else inf ans0 = dfs(cur + 1, a, b, c) ans1 = dfs(cur + 1, a + l_list[cur], b, c) + 10 an...
class Pickleable(object): """ Base class that implements getstate/setstate, since most of the classes are overriding getattr. """ def __getstate__(self): return self.__dict__ def __setstate__(self, data): self.__dict__.update(data)
class Pickleable(object): """ Base class that implements getstate/setstate, since most of the classes are overriding getattr. """ def __getstate__(self): return self.__dict__ def __setstate__(self, data): self.__dict__.update(data)
conditions = { 'test_project_ids': ['*'], 'test_suite_ids': ['*'], 'test_names': ['logout'], } def post_test_run(): pass
conditions = {'test_project_ids': ['*'], 'test_suite_ids': ['*'], 'test_names': ['logout']} def post_test_run(): pass
__author__ = 'tilmannbruckhaus' class Pandigital: def __init__(self, digits): self.p = digits self.N = len(self.p) def find(self, n): for i in range(n - 1): self.step() return self.get() def step(self): # The algorithm is described in E. W. Dijkstra, A...
__author__ = 'tilmannbruckhaus' class Pandigital: def __init__(self, digits): self.p = digits self.N = len(self.p) def find(self, n): for i in range(n - 1): self.step() return self.get() def step(self): i = self.N - 1 while self.p[i - 1] >= sel...
""" 151. Reverse Words in a String Medium Given an input string s, reverse the order of the words. A word is defined as a sequence of non-space characters. The words in s will be separated by at least one space. Return a string of the words in reverse order concatenated by a single space. Note that s may contain l...
""" 151. Reverse Words in a String Medium Given an input string s, reverse the order of the words. A word is defined as a sequence of non-space characters. The words in s will be separated by at least one space. Return a string of the words in reverse order concatenated by a single space. Note that s may contain l...
""" Module: 'io' on LEGO EV3 v1.0.0 """ # MCU: sysname=ev3, nodename=ev3, release=('v1.0.0',), version=('0.0.0',), machine=ev3 # Stubber: 1.3.2 class BytesIO: '' def close(): pass def flush(): pass def getvalue(): pass def read(): pass def readinto(): ...
""" Module: 'io' on LEGO EV3 v1.0.0 """ class Bytesio: """""" def close(): pass def flush(): pass def getvalue(): pass def read(): pass def readinto(): pass def readline(): pass def seek(): pass def write(): pas...
"""Some additional journal abbreviations which are not provided by Crossref.""" JOURNAL_ABBRVS = { "American Journal of Mathematics": "Am. J. Math.", "American Journal of Physics": "Am. J. Phys", "Annals of Physics": "Ann. Phys.", "Communications in Mathematical Physics": "Commun. Math. Phys.", "Jo...
"""Some additional journal abbreviations which are not provided by Crossref.""" journal_abbrvs = {'American Journal of Mathematics': 'Am. J. Math.', 'American Journal of Physics': 'Am. J. Phys', 'Annals of Physics': 'Ann. Phys.', 'Communications in Mathematical Physics': 'Commun. Math. Phys.', 'Journal of Mathematical ...
class Config: def __init__(self, **kwargs): self.protocol = kwargs.get('protocol') self.ip = kwargs.get('ip') self.port = kwargs.get('port') self.heavy_traffic = kwargs.get('heavy_traffic') self.time_patterns = kwargs.get('time_patterns') self.start_time = kwargs.get(...
class Config: def __init__(self, **kwargs): self.protocol = kwargs.get('protocol') self.ip = kwargs.get('ip') self.port = kwargs.get('port') self.heavy_traffic = kwargs.get('heavy_traffic') self.time_patterns = kwargs.get('time_patterns') self.start_time = kwargs.get...
x = [0] print(x) x.__setitem__(0,1) print(x) x.__setitem__(0,2) print(x) x = [4,5,6] x.__setitem__(1,7) print(x) x.__setitem__(2,8) print(x)
x = [0] print(x) x.__setitem__(0, 1) print(x) x.__setitem__(0, 2) print(x) x = [4, 5, 6] x.__setitem__(1, 7) print(x) x.__setitem__(2, 8) print(x)
for row in range(1,11): for col in range(1,21): prod = row*col if prod < 10: print('','', prod, '',end='') elif prod < 100: print('', prod, '',end='') else: print(prod, '',end='') print()
for row in range(1, 11): for col in range(1, 21): prod = row * col if prod < 10: print('', '', prod, '', end='') elif prod < 100: print('', prod, '', end='') else: print(prod, '', end='') print()
a=100 class A: b=200 def fn(self,a=1): print("fn in A") def mfn(): print("Inside mfn") print("Mod1")
a = 100 class A: b = 200 def fn(self, a=1): print('fn in A') def mfn(): print('Inside mfn') print('Mod1')
{ "targets": [ { "target_name": "node_shoom", "include_dirs": [ "vendor/shoom/include", "<!(node -e \"require('nan')\")" ], "sources": [ "addon.cc", "node_shoom.cc" ], "conditions": [ ["OS == 'win'", ...
{'targets': [{'target_name': 'node_shoom', 'include_dirs': ['vendor/shoom/include', '<!(node -e "require(\'nan\')")'], 'sources': ['addon.cc', 'node_shoom.cc'], 'conditions': [["OS == 'win'", {'sources': ['vendor/shoom/src/shoom_win32.cc']}], ["OS != 'win'", {'sources': ['vendor/shoom/src/shoom_unix_darwin.cc']}]]}]}
def split_annotation(annotation: dict): context = annotation['@context'] body = annotation['body'] target = annotation['target'] custom_keys = [ key for key in annotation if key not in ['body', 'target', '@context', 'id', 'type'] ] custom = {k: annotation[k] for k in cust...
def split_annotation(annotation: dict): context = annotation['@context'] body = annotation['body'] target = annotation['target'] custom_keys = [key for key in annotation if key not in ['body', 'target', '@context', 'id', 'type']] custom = {k: annotation[k] for k in custom_keys} if isinstance(con...
requirements = [ 'marshmallow==3.5.1', 'bumpversion==0.6.0' ]
requirements = ['marshmallow==3.5.1', 'bumpversion==0.6.0']
# -*- coding: utf-8 -*- DEBUG = True SQLALCHEMY_ECHO = True SQLALCHEMY_DATABASE_URI = 'mysql://root:123456@127.0.0.1/food_db?charset=utf8mb4' SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_ENCODING = "utf8mb4"
debug = True sqlalchemy_echo = True sqlalchemy_database_uri = 'mysql://root:123456@127.0.0.1/food_db?charset=utf8mb4' sqlalchemy_track_modifications = False sqlalchemy_encoding = 'utf8mb4'
k1 = input("birinci kelime:") k2 = input("ikinci kelime:") temp1 = k1[0:2] temp2 = k2[0:2] for i in k2[2:]: temp1 += i for i in k1[2:]: temp2 += i print(temp2) print(temp1)
k1 = input('birinci kelime:') k2 = input('ikinci kelime:') temp1 = k1[0:2] temp2 = k2[0:2] for i in k2[2:]: temp1 += i for i in k1[2:]: temp2 += i print(temp2) print(temp1)
def hr(n): if n % 2 == 0: return int(n // 2) else: return 3 * n + 1 while True: n = int(input()) if n == 0: break m = n while n != 1: if m < n: m = n n = hr(n) print(m)
def hr(n): if n % 2 == 0: return int(n // 2) else: return 3 * n + 1 while True: n = int(input()) if n == 0: break m = n while n != 1: if m < n: m = n n = hr(n) print(m)
class Solution: def largestOverlap(self, A: List[List[int]], B: List[List[int]]) -> int: C = [[0 for _ in range(len(B[0]) * 3 - 2)] for _ in range(len(B) * 3 - 2)] for i in range(len(B)): for j in range(len(B[0])): C[i + len(B) - 1][j + len(B[0]) - 1] = B[i]...
class Solution: def largest_overlap(self, A: List[List[int]], B: List[List[int]]) -> int: c = [[0 for _ in range(len(B[0]) * 3 - 2)] for _ in range(len(B) * 3 - 2)] for i in range(len(B)): for j in range(len(B[0])): C[i + len(B) - 1][j + len(B[0]) - 1] = B[i][j] ...
PROXMOX_CLUSTER_SCHEMA = { 'type': 'object', 'properties': { 'name': {'type': 'string'}, 'nodes': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'name': {'type': 'string'}, 'ip': {'ty...
proxmox_cluster_schema = {'type': 'object', 'properties': {'name': {'type': 'string'}, 'nodes': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'ip': {'type': 'string'}, 'host': {'type': 'string'}, 'user': {'type': 'string'}, 'password': {'type': 'string'}, 'key_filename': {'typ...
n = int(input('Provide a number: ')) nums = [] for i in range(1, n+1): nums.append(i) print(*nums, sep=", ")
n = int(input('Provide a number: ')) nums = [] for i in range(1, n + 1): nums.append(i) print(*nums, sep=', ')
""" MicroPython MAX44009 Ambient Light Sensor https://github.com/mcauser/micropython-max44009 MIT License Copyright (c) 2020 Mike Causer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without re...
""" MicroPython MAX44009 Ambient Light Sensor https://github.com/mcauser/micropython-max44009 MIT License Copyright (c) 2020 Mike Causer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without re...
t = int(input()) while t: N, X = map(int, input().split()) S = input() arr = [] arr.append(X) for i in S: if i=='R': X += 1 arr.append(X) if i=='L': X -= 1 arr.append(X) arr = set(arr) print(len(arr)) t = t-...
t = int(input()) while t: (n, x) = map(int, input().split()) s = input() arr = [] arr.append(X) for i in S: if i == 'R': x += 1 arr.append(X) if i == 'L': x -= 1 arr.append(X) arr = set(arr) print(len(arr)) t = t - 1
netron_link = "https://lutzroeder.github.io/netron" cors_proxy = "https://cors-anywhere.herokuapp.com" release_url = "https://github.com/larq/zoo/releases/download" def html_format(source, language, css_class, options, md): return f'<a href="{netron_link}/?url={cors_proxy}/{release_url}/{source}">Interactive arch...
netron_link = 'https://lutzroeder.github.io/netron' cors_proxy = 'https://cors-anywhere.herokuapp.com' release_url = 'https://github.com/larq/zoo/releases/download' def html_format(source, language, css_class, options, md): return f'<a href="{netron_link}/?url={cors_proxy}/{release_url}/{source}">Interactive archi...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Helpers for referring to React Native open source code. This lets us build React Native: - At Facebook by running buck from the root of t...
"""Helpers for referring to React Native open source code. This lets us build React Native: - At Facebook by running buck from the root of the fb repo - Outside of Facebook by running buck in the root of the git repo """ _debug_preprocessor_flags = [] _apple_compiler_flags = [] def get_apple_compiler_flags(): r...
class Stack(list): def __getitem__(self,key): try: return super(Stack, self).__getitem__(key) except IndexError: return 0 def pop(self): try: return super(Stack, self).pop() except: return 0
class Stack(list): def __getitem__(self, key): try: return super(Stack, self).__getitem__(key) except IndexError: return 0 def pop(self): try: return super(Stack, self).pop() except: return 0
class ValidPalindrome: def isPalindrome(self, s): if len(s) == 0: return True else: s = "".join([i for i in s.lower() if i.isalnum()]) i= 0 j=len(s)-1 while j>i: if s[i] != s[j]: return False ...
class Validpalindrome: def is_palindrome(self, s): if len(s) == 0: return True else: s = ''.join([i for i in s.lower() if i.isalnum()]) i = 0 j = len(s) - 1 while j > i: if s[i] != s[j]: return False ...
arr = [] for arr_i in range(6): arr_t = [int(arr_temp) for arr_temp in input().split(' ')] arr.append(arr_t) #print (arr) hourglass_sums = [] for i in range(4): for j in range(4): hourglass_sums.append(sum(arr[i][j:j+3]) + arr[i+1][j+1] + sum(arr[i+2][j:j+3])) print (max(hourglass_sums))
arr = [] for arr_i in range(6): arr_t = [int(arr_temp) for arr_temp in input().split(' ')] arr.append(arr_t) hourglass_sums = [] for i in range(4): for j in range(4): hourglass_sums.append(sum(arr[i][j:j + 3]) + arr[i + 1][j + 1] + sum(arr[i + 2][j:j + 3])) print(max(hourglass_sums))
############################################################################### '''''' ############################################################################### class CoProperty(property): def __set_name__(self, owner, name): self.cooperators = tuple( # pylint: disable=W0201 acls.__dic...
"""""" class Coproperty(property): def __set_name__(self, owner, name): self.cooperators = tuple((acls.__dict__[name] for acls in owner.__bases__ if name in acls.__dict__)) def allyield(self, instance, owner): for coop in self.cooperators: yield from coop.allyield(instance, owner)...
""" This module contains the result sentences and intents for the English version of the Pick something random app. """ # Result sentences and their parts: RESULT_HEADS = "Heads" RESULT_TAILS = "Tails" # See the following documentation for the format codes: # https://arrow.readthedocs.io/en/latest/#format RESULT_MONTH...
""" This module contains the result sentences and intents for the English version of the Pick something random app. """ result_heads = 'Heads' result_tails = 'Tails' result_month_day = 'MMMM D' result_date_already_picked = 'It looks like you already picked a date. Are you trying to trick me?' result_numbers_wrong_order...
"""Helper functions Consists of functions to typically be used within templates, but also available to Controllers. This module is available to both as 'h'. """
"""Helper functions Consists of functions to typically be used within templates, but also available to Controllers. This module is available to both as 'h'. """
banner = """ _ _ _ _ _____ _ | | | | | | (_) |_ _| (_) | | | | __ _| | ___ _ __ _ ___ | | ___ __ _ _ __ ___ _________...
banner = "\n _ _ _ _ _____ _ \n| | | | | | (_) |_ _| (_) \n| | | | __ _| | ___ _ __ _ ___ | | ___ __ _ _ __ ___ ________...
class Node: def __init__(self,data): self.data = data self.left = self.right = None def sorted_array(nums): if not nums: return mid = len(nums)//2 root = Node(nums[mid]) root.left = sorted_array(nums[:mid]) root.right = sorted_array(nums[mid+1:]) ...
class Node: def __init__(self, data): self.data = data self.left = self.right = None def sorted_array(nums): if not nums: return mid = len(nums) // 2 root = node(nums[mid]) root.left = sorted_array(nums[:mid]) root.right = sorted_array(nums[mid + 1:]) return root d...
for _ in range(int(input())): n=input() if len(n)>10: print("{}{}{}".format(n[0],len(n)-2,n[-1])) else: print(n)
for _ in range(int(input())): n = input() if len(n) > 10: print('{}{}{}'.format(n[0], len(n) - 2, n[-1])) else: print(n)
"""Provides a redirection point for platform specific implementations of Starlark utilities.""" load( "//tensorflow/core/profiler/builds/oss:build_config.bzl", _tf_profiler_alias = "tf_profiler_alias", ) tf_profiler_alias = _tf_profiler_alias def if_profiler_oss(if_true, if_false = []): return select({ ...
"""Provides a redirection point for platform specific implementations of Starlark utilities.""" load('//tensorflow/core/profiler/builds/oss:build_config.bzl', _tf_profiler_alias='tf_profiler_alias') tf_profiler_alias = _tf_profiler_alias def if_profiler_oss(if_true, if_false=[]): return select({'//tensorflow/core/...
ONOS_ORIGIN = "ONOS Community" ONOS_GROUP_ID = "org.onosproject" ONOS_VERSION = "1.14.0-SNAPSHOT" DEFAULT_APP_CATEGORY = "Utility" ONOS_ARTIFACT_BASE = "onos-" APP_PREFIX = ONOS_GROUP_ID + "."
onos_origin = 'ONOS Community' onos_group_id = 'org.onosproject' onos_version = '1.14.0-SNAPSHOT' default_app_category = 'Utility' onos_artifact_base = 'onos-' app_prefix = ONOS_GROUP_ID + '.'
# souce from https://stackoverflow.com/a/25471508 '''Stub for fcntl. only for Windows dev/testing.''' def fcntl(fd, op, arg=0): return 0 def ioctl(fd, op, arg=0, mutable_flag=True): if mutable_flag: return 0 else: return "" def flock(fd, op): return def lockf(fd, operation, length=0,...
"""Stub for fcntl. only for Windows dev/testing.""" def fcntl(fd, op, arg=0): return 0 def ioctl(fd, op, arg=0, mutable_flag=True): if mutable_flag: return 0 else: return '' def flock(fd, op): return def lockf(fd, operation, length=0, start=0, whence=0): return
class prdError(Exception): """Base error raised by pyramdeconv.""" class MainDelegatorError(prdError): """Raised when a method in the main delegator fails.""" class DataBaseError(prdError): """Raised when interaction with the default database fails"""
class Prderror(Exception): """Base error raised by pyramdeconv.""" class Maindelegatorerror(prdError): """Raised when a method in the main delegator fails.""" class Databaseerror(prdError): """Raised when interaction with the default database fails"""
for i in range(0,6): if i !=3: print(i) result = 1 for i in range(1,6): result =result*i print(result) result = 0 for i in range(1,6): result = result +i print(result) result=0 for word in 'this is my 6th string'.split(): result = result+1 print(result)
for i in range(0, 6): if i != 3: print(i) result = 1 for i in range(1, 6): result = result * i print(result) result = 0 for i in range(1, 6): result = result + i print(result) result = 0 for word in 'this is my 6th string'.split(): result = result + 1 print(result)
# config.py # DEBUG = False # SQLALCHEMY_ECHO = False # instance/config.py DEBUG = True SQLALCHEMY_ECHO = True ARCFACE_PREBATCHNORM_LAYER_INDEX = -4 ARCFACE_POOLING_LAYER_INDEX = -3
debug = True sqlalchemy_echo = True arcface_prebatchnorm_layer_index = -4 arcface_pooling_layer_index = -3
class RequestInfoList(object): """A data stream from any platform/hub: """ def __init__(self): self.requests = [] def __len__(self): return len(self.requests)
class Requestinfolist(object): """A data stream from any platform/hub: """ def __init__(self): self.requests = [] def __len__(self): return len(self.requests)