content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# Solution for the problem "Constructing a Number" # https://www.hackerrank.com/contests/hourrank-25/challenges/constructing-a-number/problem # Number of test cases t = int(input()) for x in range(t): # Number of items. We are not actually using this in our approach n = int(input()) # We are replacing all...
t = int(input()) for x in range(t): n = int(input()) num = int(input().replace(' ', '')) print('Yes' if num % 3 == 0 else 'No')
name_score = 0 def cal_name_score(n, list_a): global name_score name_s = 0 for i in list_a[n]: name_s += ord(i.lower()) - 96 name_score += name_s * (n+1) return name_score if __name__ == '__main__': with open('p022_names.txt') as f: name_list = f.readlines() clear_list = ...
name_score = 0 def cal_name_score(n, list_a): global name_score name_s = 0 for i in list_a[n]: name_s += ord(i.lower()) - 96 name_score += name_s * (n + 1) return name_score if __name__ == '__main__': with open('p022_names.txt') as f: name_list = f.readlines() clear_list = n...
# Nested For Loop # User input for number of rows rows = int(input("Enter the rows:")) # Outer loop will print number of rows for i in range(0, rows+1): # Inner loop will print number of Astrisk for j in range(i): print("*",end = '') print() # Program to print number pyramid rows = int(inp...
rows = int(input('Enter the rows:')) for i in range(0, rows + 1): for j in range(i): print('*', end='') print() rows = int(input('Enter the rows')) for i in range(0, rows + 1): for j in range(i): print(i, end='') print() i = 2 while i < 20: j = 2 while j <= i / j: if not ...
select_guilds = """select * from servers where discord_id = %s""" insert_guild = """ INSERT INTO public.servers( discord_id, discord_name) VALUES (%s, %s); """ select_users = """ select * from public.users where server_id = (select id from public.servers where discord_id = %s) and user_id =...
select_guilds = 'select * from servers where discord_id = %s' insert_guild = ' INSERT INTO public.servers(\n discord_id, discord_name)\n VALUES (%s, %s);\n ' select_users = ' select * from public.users where server_id = (select id from public.servers where discord_id = %s) and user_id = %s' inse...
class Automovel: cor = "" marca = "" qtdegasolina = 45 def __init__(self, c, m): self.cor = c self.marca = m def abastecerCarro(qtdeLitros): qtdegasolina = qtdegasolina + qtdeLitros uno = Automovel("Verde","Fiat") print(uno) hondafit = Automovel("Preta", "Honda") prin...
class Automovel: cor = '' marca = '' qtdegasolina = 45 def __init__(self, c, m): self.cor = c self.marca = m def abastecer_carro(qtdeLitros): qtdegasolina = qtdegasolina + qtdeLitros uno = automovel('Verde', 'Fiat') print(uno) hondafit = automovel('Preta', 'Honda') print(ho...
class Solution: def decodeString(self, s: str) -> str: def dfs(s, i): res, multi = "", 0 while i < len(s): if '0' <= s[i] <= '9': multi = multi * 10 + int(s[i]) elif s[i] == '[': i, tmp = dfs(s, i + 1) ...
class Solution: def decode_string(self, s: str) -> str: def dfs(s, i): (res, multi) = ('', 0) while i < len(s): if '0' <= s[i] <= '9': multi = multi * 10 + int(s[i]) elif s[i] == '[': (i, tmp) = dfs(s, i + 1) ...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/test_nbdev_define_in_subfolder/01 define in multiple_nbs 1.ipynb (unless otherwise specified). __all__ = ['defined_in_multiple_nbs', 'defined_in_multiple_nbs'] # Cell def defined_in_multiple_nbs(): print("This function was defined on notebook 01") # Cell def defi...
__all__ = ['defined_in_multiple_nbs', 'defined_in_multiple_nbs'] def defined_in_multiple_nbs(): print('This function was defined on notebook 01') def defined_in_multiple_nbs(): print('This function was defined on notebook 02')
#!/usr/bin/env python def part_one() -> None: buffer = [0] idx = 0 for i in range(1, 2018): idx = step(buffer, idx) buffer.insert(idx + 1, i) idx += 1 print('Part 1: ', buffer[buffer.index(2017) + 1]) def step(buffer: list, start: int) -> int: steps = 359 return (step...
def part_one() -> None: buffer = [0] idx = 0 for i in range(1, 2018): idx = step(buffer, idx) buffer.insert(idx + 1, i) idx += 1 print('Part 1: ', buffer[buffer.index(2017) + 1]) def step(buffer: list, start: int) -> int: steps = 359 return (steps + start) % len(buffer) ...
#page contains functions that locates data about things on the webpage #add locators def body_element_locator(browser): return browser.find_element_by_tag_name('body') def get_tweets(browser): return browser.find_elements_by_class_name('tweet-text')
def body_element_locator(browser): return browser.find_element_by_tag_name('body') def get_tweets(browser): return browser.find_elements_by_class_name('tweet-text')
class WorkflowException(Exception): pass class UnsupportedRequirement(WorkflowException): pass
class Workflowexception(Exception): pass class Unsupportedrequirement(WorkflowException): pass
# zop = Zen of python zop = '''Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality be...
zop = "Beautiful is better than ugly.\nExplicit is better than implicit.\nSimple is better than complex.\nComplex is better than complicated.\nFlat is better than nested.\nSparse is better than dense.\nReadability counts.\nSpecial cases aren't special enough to break the rules.\nAlthough practicality beats purity.\nErr...
""" # PROBLEM 2 Even Fibonacci numbers Problem 2 Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four millio...
""" # PROBLEM 2 Even Fibonacci numbers Problem 2 Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four millio...
img_width = 48 img_height = 48 img_depth = 1 batch_size = 32 epochs = 500
img_width = 48 img_height = 48 img_depth = 1 batch_size = 32 epochs = 500
# -*- coding: utf-8 -*- class PasswordError(Exception): """symmetric encrypt wrong password error. """ class SignatureError(Exception): """asymmetric encrypt wrong signature error. """
class Passworderror(Exception): """symmetric encrypt wrong password error. """ class Signatureerror(Exception): """asymmetric encrypt wrong signature error. """
t = int(input().strip()) for a0 in range(t): n = int(input().strip()) a = list(map(int, input().strip().split(' '))) occur = {} count = 0 for i in a: if i in occur: count += occur[i] * 2 occur[i] += 1 else: occur[i] = 1 print(count)
t = int(input().strip()) for a0 in range(t): n = int(input().strip()) a = list(map(int, input().strip().split(' '))) occur = {} count = 0 for i in a: if i in occur: count += occur[i] * 2 occur[i] += 1 else: occur[i] = 1 print(count)
""" round """ print(round(233.33333)) print(round(233.33333, 2)) print(round(233.33333, -2))
""" round """ print(round(233.33333)) print(round(233.33333, 2)) print(round(233.33333, -2))
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- _ER...
_error_page_blob_size_alignment = 'Invalid page blob size: {0}. ' + 'The size must be aligned to a 512-byte boundary.' _error_page_blob_start_alignment = 'start_range must align with 512 page size' _error_page_blob_end_alignment = 'end_range must align with 512 page size' _error_invalid_block_id = 'All blocks in block ...
""" types: '.' = water '#' = island '1' or other number = number square rules: squares are connected up,down,right,and left island sqaure can only have one numbered square numbered squre can contain itself + island square(s) ex) '2' means itself + 1 island My thought process: check 2x2 block of water ex) [i+1][j],[i]...
""" types: '.' = water '#' = island '1' or other number = number square rules: squares are connected up,down,right,and left island sqaure can only have one numbered square numbered squre can contain itself + island square(s) ex) '2' means itself + 1 island My thought process: check 2x2 block of water ex) [i+1][j],[i]...
img_norm_cfg = dict( mean=[127.5, 127.5, 127.5], std=[127.5, 127.5, 127.5], to_rgb=False) crop_size = (288, 960) # KITTI config kitti_train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', sparse=True), dict( type='ColorJitter', asymmetric_prob=0.0, bri...
img_norm_cfg = dict(mean=[127.5, 127.5, 127.5], std=[127.5, 127.5, 127.5], to_rgb=False) crop_size = (288, 960) kitti_train_pipeline = [dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', sparse=True), dict(type='ColorJitter', asymmetric_prob=0.0, brightness=0.4, contrast=0.4, saturation=0.4, hue=0.5 / 3.14), ...
# utils.py """ Odds and ends that might be useful in other files.""" # custom exception for a failing regex class NoGpuError(Exception): """ No GPU string was found in the file name! This error is raised when a run is done without GPUs (meaning it uses only CPUs for Tensorflow predictions, which is, in t...
""" Odds and ends that might be useful in other files.""" class Nogpuerror(Exception): """ No GPU string was found in the file name! This error is raised when a run is done without GPUs (meaning it uses only CPUs for Tensorflow predictions, which is, in theory, possible). """ class Missingdataerror(...
maxdepth = 0 def depth(elem, level): global maxdepth # your code goes her # print(elem," :::") # print(level," [[[]]]") if (level == maxdepth): maxdepth += 1 # print(elem) for child in elem: # print(child) depth(child, level + 1)
maxdepth = 0 def depth(elem, level): global maxdepth if level == maxdepth: maxdepth += 1 for child in elem: depth(child, level + 1)
class InvalidKeyType(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) class KeyValueStoreDumpException(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs)
class Invalidkeytype(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) class Keyvaluestoredumpexception(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs)
# This file is automatically generated during the generation of setup.py # Copyright 2020, Caer author = 'Jason Dsouza <jasmcaus@gmail.com>' version = '1.7.8' full_version = '1.7.8' release = True contributors = ['Jason Dsouza <jasmcaus@gmail.com>']
author = 'Jason Dsouza <jasmcaus@gmail.com>' version = '1.7.8' full_version = '1.7.8' release = True contributors = ['Jason Dsouza <jasmcaus@gmail.com>']
"""Create Phone Number Kata from Codewars.""" def phone(x): """Create the phone number.""" if len(x) < 10: raise ValueError('List needs to contain 10 numbers') elif len(x) > 10: raise ValueError('List needs to contain 10 numbers') first = x[0:3] second = x[3:6] third = x[6:] ...
"""Create Phone Number Kata from Codewars.""" def phone(x): """Create the phone number.""" if len(x) < 10: raise value_error('List needs to contain 10 numbers') elif len(x) > 10: raise value_error('List needs to contain 10 numbers') first = x[0:3] second = x[3:6] third = x[6:] ...
# Variables and Functions # Variable names names = "Python" job_title = "Software Engineer" populated_countries_list = [] # Nonmangling names _books = {} # variable name to define private __dict = [] # prevent name mangling with python in-build lib """You should use one underscore(_) as a prefix for the internal var...
names = 'Python' job_title = 'Software Engineer' populated_countries_list = [] _books = {} __dict = [] "You should use one underscore(_) as a prefix for the internal variable\nof a class, where you don't want an outside class to access the variable.\nThis is just a convention; Python doesn't make a variable with a sing...
# My solution def merge_lists(a, b): res = [] a_cur = 0 b_cur = 0 a_min = a[a_cur] b_min = b[b_cur] a_done = False b_done = False for i in range(len(a) + len(b)): if (a_min <= b_min or b_done) and (a_cur < len(a)): res.append(a_min) a_cur += 1 if (a_cur < len(a)): a_min = a...
def merge_lists(a, b): res = [] a_cur = 0 b_cur = 0 a_min = a[a_cur] b_min = b[b_cur] a_done = False b_done = False for i in range(len(a) + len(b)): if (a_min <= b_min or b_done) and a_cur < len(a): res.append(a_min) a_cur += 1 if a_cur < len(a...
YOLO = dict() # Datasets Parameter YOLO['classes'] = ["aeroplane", "bicycle", "bird", "boat", "bottle"] YOLO['datasets_path'] = '/home/tshzzz/disk_m2/jinnan_round2/datasets/round1_train/' YOLO['anno_path'] = '/home/tshzzz/disk_m2/jinnan_round2/datasets/round1_train/jinnan_round1_train.json' YOLO['val_path'] = '/home/...
yolo = dict() YOLO['classes'] = ['aeroplane', 'bicycle', 'bird', 'boat', 'bottle'] YOLO['datasets_path'] = '/home/tshzzz/disk_m2/jinnan_round2/datasets/round1_train/' YOLO['anno_path'] = '/home/tshzzz/disk_m2/jinnan_round2/datasets/round1_train/jinnan_round1_train.json' YOLO['val_path'] = '/home/tshzzz/disk_m2/jinnan_r...
''' Manages the ingestion rollback File: rollback.py Contains: Singleton - metaclass for the Singleton pattern implementation Rollback - a class storing and executing rollback commands @author: livia ''' class Singleton(type): '''Metaclass to create Singleton classes _instances - s...
""" Manages the ingestion rollback File: rollback.py Contains: Singleton - metaclass for the Singleton pattern implementation Rollback - a class storing and executing rollback commands @author: livia """ class Singleton(type): """Metaclass to create Singleton classes _instances - s...
#!/usr/bin/env python3 file_contents = open('in.idf').read().upper() if 'HVACTEMPLATE' in file_contents: open('expanded.idf', 'w').write('HI') open('BasementGHTIn.idf', 'w').write('HI') open('GHTIn.idf', 'w').write('HI') open('EPObjects.TXT', 'w').write('HI') open('RunINPUT.TXT', 'w').write('HI') ...
file_contents = open('in.idf').read().upper() if 'HVACTEMPLATE' in file_contents: open('expanded.idf', 'w').write('HI') open('BasementGHTIn.idf', 'w').write('HI') open('GHTIn.idf', 'w').write('HI') open('EPObjects.TXT', 'w').write('HI') open('RunINPUT.TXT', 'w').write('HI') open('RunDEBUGOUT.TXT...
BID_VALUE = 'BID_VALUE' PASS = "PASS" MIN_BID_VALUE = "MIN_BID_VALUE" FIRST_ROUND_HONORS_MIN= "FIRST_ROUND_HONORS_MIN" SECOND_ROUND_HONORS_MIN="SECOND_ROUND_HONORS_MIN" TRUMP_CARD_ABBREVIATION= "CARD_ABBREVIATION"
bid_value = 'BID_VALUE' pass = 'PASS' min_bid_value = 'MIN_BID_VALUE' first_round_honors_min = 'FIRST_ROUND_HONORS_MIN' second_round_honors_min = 'SECOND_ROUND_HONORS_MIN' trump_card_abbreviation = 'CARD_ABBREVIATION'
def quick_sort(ARRAY): ARRAY_LENGTH = len(ARRAY) if( ARRAY_LENGTH <= 1): return ARRAY else: PIVOT = ARRAY[0] GREATER = [ element for element in ARRAY[1:] if element > PIVOT ] LESSER = [ element for element in ARRAY[1:] if element <= PIVOT ] return quick_sort(LESSER) +...
def quick_sort(ARRAY): array_length = len(ARRAY) if ARRAY_LENGTH <= 1: return ARRAY else: pivot = ARRAY[0] greater = [element for element in ARRAY[1:] if element > PIVOT] lesser = [element for element in ARRAY[1:] if element <= PIVOT] return quick_sort(LESSER) + [PIVO...
# Python - 3.6.0 def is_triangle_number(number): if type(number) != int: return False n, d = 0, 1 while n < number: n += d d += 1 return (number == n) or (number == 0)
def is_triangle_number(number): if type(number) != int: return False (n, d) = (0, 1) while n < number: n += d d += 1 return number == n or number == 0
#!/usr/bin/env python3 class Module: def __init__(self, name, method, options): self.name = name self.run = method self.hasoptions = options def processD(self, data, options): return self.run(data, options) def process(self, data): return self.run(data) def ge...
class Module: def __init__(self, name, method, options): self.name = name self.run = method self.hasoptions = options def process_d(self, data, options): return self.run(data, options) def process(self, data): return self.run(data) def get_name(self): ...
""" This is my first attempt at fibbonaci from memory. I used cursors similar to how we work with linked lists. """ def fib_iterative(n): prevprev = 0 prev = 1 curr = 0 # base cases if n == 0: return 0 if n == 1: return 0 if n == 2: return 1 # algorithm fo...
""" This is my first attempt at fibbonaci from memory. I used cursors similar to how we work with linked lists. """ def fib_iterative(n): prevprev = 0 prev = 1 curr = 0 if n == 0: return 0 if n == 1: return 0 if n == 2: return 1 for i in range(2, n): curr = p...
def find_matches(s): s = s + s[0] m = [] for i in range(0, len(s) - 1): if s[i] == s[i+1]: m.append(int(s[i])) return m def captcha(s): return sum(find_matches(s)) if __name__ == '__main__': s = "428122498997587283996116951397957933569136949848379417125362532269869461185743...
def find_matches(s): s = s + s[0] m = [] for i in range(0, len(s) - 1): if s[i] == s[i + 1]: m.append(int(s[i])) return m def captcha(s): return sum(find_matches(s)) if __name__ == '__main__': s = '42812249899758728399611695139795793356913694984837941712536253226986946118574...
PRED_DIR = './../../../predictions' # # TEST # # MultiRC # Test Predictions MULTIRC_TEST_BB_S1 = 'multirc_bert_blackbox_predictions_test.jsonl' MULTIRC_TEST_BB_S2 = 'multirc_bert_blackbox_seed2_predictions_test.jsonl' MULTIRC_TEST_BB_S3 = 'multirc_bert_blackbox_seed3_predictions_test.jsonl' MULTIRC_TEST_BB_S4 = 'multi...
pred_dir = './../../../predictions' multirc_test_bb_s1 = 'multirc_bert_blackbox_predictions_test.jsonl' multirc_test_bb_s2 = 'multirc_bert_blackbox_seed2_predictions_test.jsonl' multirc_test_bb_s3 = 'multirc_bert_blackbox_seed3_predictions_test.jsonl' multirc_test_bb_s4 = 'multirc_bert_blackbox_seed4_predictions_test.j...
def main(): word = input() print(''.join([word[0] if ord('A') <= ord(word[0]) <= ord( 'Z') else chr(ord(word[0]) - (ord('a') - ord('A')))] + list(word[1:]))) main()
def main(): word = input() print(''.join([word[0] if ord('A') <= ord(word[0]) <= ord('Z') else chr(ord(word[0]) - (ord('a') - ord('A')))] + list(word[1:]))) main()
class Solution: def isBalanced(self, root: Optional[TreeNode]) -> bool: if not root: return True def maxDepth(root: Optional[TreeNode]) -> int: if not root: return 0 leftHeight = maxDepth(root.left) if leftHeight == -1: return -1 rightHeight = maxDepth(root.righ...
class Solution: def is_balanced(self, root: Optional[TreeNode]) -> bool: if not root: return True def max_depth(root: Optional[TreeNode]) -> int: if not root: return 0 left_height = max_depth(root.left) if leftHeight == -1: ...
def render_lines(lines_count): s = "abcdefghijklmnopqrstuvwxyz" yield from ("%d: %s" % (i + 1, s) for i in range(lines_count)) def render_text(lines_count): return "\n".join(render_lines(lines_count)) #######################################################################################################...
def render_lines(lines_count): s = 'abcdefghijklmnopqrstuvwxyz' yield from ('%d: %s' % (i + 1, s) for i in range(lines_count)) def render_text(lines_count): return '\n'.join(render_lines(lines_count)) def lines_width_height(lines): (w, h) = (0, 0) for ln in lines: w = max(w, len(ln)) ...
class FileLogger: def __init__(self, file_path): self.file_path = file_path def log(self, data): string = ' '.join(["%s=%s" % (key, value) for key, value in data.items()]) string += '\r\n' self.write(string) # TODO: make write function async <<< def write(self, s...
class Filelogger: def __init__(self, file_path): self.file_path = file_path def log(self, data): string = ' '.join(['%s=%s' % (key, value) for (key, value) in data.items()]) string += '\r\n' self.write(string) def write(self, string): """ Not async :(( """ ...
salt_email = "1e698bd5135c4e0321b40c8842bb0f8b9217ffdd3ca1e56d5b9ac5abbbb3136c" d = {} with open('imdb-1.csv', 'r') as f: for line in f.readlines(): sp = line.split(',') movie = sp[1] date = sp[2].strip() rating = sp[3].strip() if date + "," + rating in d: d[date + "," + rating].append(movi...
salt_email = '1e698bd5135c4e0321b40c8842bb0f8b9217ffdd3ca1e56d5b9ac5abbbb3136c' d = {} with open('imdb-1.csv', 'r') as f: for line in f.readlines(): sp = line.split(',') movie = sp[1] date = sp[2].strip() rating = sp[3].strip() if date + ',' + rating in d: d[date ...
class CoffeeMachine: def __init__(self, water=0, milk=0, coffee=0, cups=0, money=0): self.water = water self.milk = milk self.coffee = coffee self.cups = cups self.money = money @classmethod def coffee_params(cls, param): dict_param = {"1": (250, 0, 16, 1, 4)...
class Coffeemachine: def __init__(self, water=0, milk=0, coffee=0, cups=0, money=0): self.water = water self.milk = milk self.coffee = coffee self.cups = cups self.money = money @classmethod def coffee_params(cls, param): dict_param = {'1': (250, 0, 16, 1, 4...
#list creation l1=list() for i in range(5): l1.append(input("enter name:")) print(l1)
l1 = list() for i in range(5): l1.append(input('enter name:')) print(l1)
class Number: def __init__(self, num) -> None: self.num = num def __iter__(self): return self def __next__(self): if self.num < 10: x = self.num self.num += 1 return x else: raise StopIteration my_number = Number(5) my_number_iterator = iter(my_number) for n in my_numb...
class Number: def __init__(self, num) -> None: self.num = num def __iter__(self): return self def __next__(self): if self.num < 10: x = self.num self.num += 1 return x else: raise StopIteration my_number = number(5) my_number...
""" @version: 2.0 @author: Chao Chen @contact: cchao@didiglobal.com """
""" @version: 2.0 @author: Chao Chen @contact: cchao@didiglobal.com """
{ 'targets': [ { 'target_name': 'memwatch', 'include_dirs': [ ], 'variables': { 'node_ver': '<!(node --version | sed -e "s/^v\([0-9]*\\.[0-9]*\).*$/\\1/")' }, 'sources': [ 'src/heapdiff.cc', 'src/init.cc', 'src/memwatch.cc', 'src/util.cc'...
{'targets': [{'target_name': 'memwatch', 'include_dirs': [], 'variables': {'node_ver': '<!(node --version | sed -e "s/^v\\([0-9]*\\.[0-9]*\\).*$/\\1/")'}, 'sources': ['src/heapdiff.cc', 'src/init.cc', 'src/memwatch.cc', 'src/util.cc'], 'target_conditions': [['node_ver=="0.8"', {'defines': ['NEW_COMPACTION_BEHAVIOR']}]]...
# -*- coding: utf-8 -*- # Copyright (2017) Hewlett Packard Enterprise Development LP # # 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...
class Oneviewredfisherror(Exception): def __init__(self, msg): self.msg = msg class Oneviewredfishresourcenotfounderror(OneViewRedfishError): def __init__(self, resource_name, resource_type): self.msg = '{} {} not found'.format(resource_type, resource_name) class Oneviewredfishresourcenotacc...
UA = ["Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; AcooBrowser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Acoo Browser; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506)", "Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.5; AOLBuild 4337.35; Wind...
ua = ['Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; AcooBrowser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Acoo Browser; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506)', 'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.5; AOLBuild 4337.35; Wind...
#http://shell-storm.org/shellcode/files/shellcode-165.php #I can use it .. """ 00000000 EB2B jmp short 0x2d 00000002 5E pop esi 00000003 31C0 xor eax,eax 00000005 88460B mov [esi+0xb],al 00000008 884629 mov [esi+0x29],al 0000000B 50 ...
""" 00000000 EB2B jmp short 0x2d 00000002 5E pop esi 00000003 31C0 xor eax,eax 00000005 88460B mov [esi+0xb],al 00000008 884629 mov [esi+0x29],al 0000000B 50 push eax 0000000C B009 mov al,0x9 0000000E 50 p...
def display(board_state): n = board_state.shape[0] print(" ", end="") for y in range(n): print(chr(ord('a') + y),"", end="") print("") print(" ", end="") for _ in range(n): print ("-", end="-") print("--") for x in range(n): print(x, "|",end="") # print the...
def display(board_state): n = board_state.shape[0] print(' ', end='') for y in range(n): print(chr(ord('a') + y), '', end='') print('') print(' ', end='') for _ in range(n): print('-', end='-') print('--') for x in range(n): print(x, '|', end='') for y ...
first_name = "Feng" last_name = "Li" #################################################### # Repetitions of string full_name = first_name * 3 print(full_name, "binggo", sep='|')
first_name = 'Feng' last_name = 'Li' full_name = first_name * 3 print(full_name, 'binggo', sep='|')
#!/usr/bin/env python """Docstring""" __author__ = "Petar Stoyanov" def main(): """Docstring""" if __name__ == '__main__': main()
"""Docstring""" __author__ = 'Petar Stoyanov' def main(): """Docstring""" if __name__ == '__main__': main()
x = int(input()) a = int(input()) b = int(input()) t = x - a k = 0 while t - b * k >= 0: k += 1 print(t - b * (k - 1))
x = int(input()) a = int(input()) b = int(input()) t = x - a k = 0 while t - b * k >= 0: k += 1 print(t - b * (k - 1))
# pylint: disable=all class MockResponse: def __init__(self, status_code, json_data): self.json_data = json_data self.status_code = status_code def json(self): return self.json_data GOOD_MANIFEST = MockResponse( 200, { "@context": "http://iiif.io/api/presentation/2/c...
class Mockresponse: def __init__(self, status_code, json_data): self.json_data = json_data self.status_code = status_code def json(self): return self.json_data good_manifest = mock_response(200, {'@context': 'http://iiif.io/api/presentation/2/context.json', 'label': "Sinai Arabic 352. ...
# Filenames input_configuation_filename = "config.ini" data_file_directory = "data" log_file_directory = data_file_directory status_file_directory = data_file_directory log_file_name = "log" database_file_name = 'cryptoData.db' status_file_name = 'status.ini' appNameDirectory = 'CMCLogger' # Configuration file section...
input_configuation_filename = 'config.ini' data_file_directory = 'data' log_file_directory = data_file_directory status_file_directory = data_file_directory log_file_name = 'log' database_file_name = 'cryptoData.db' status_file_name = 'status.ini' app_name_directory = 'CMCLogger' api_section_name = 'CMC_API' api_option...
n, m = map(int, input().split()) l = [] for i in range(n): line = input().split() for x in line: l.append(x) s = set(l) ans = [x for x in s if l.count(x) == n] print(len(ans)) for x in sorted(ans): print(x)
(n, m) = map(int, input().split()) l = [] for i in range(n): line = input().split() for x in line: l.append(x) s = set(l) ans = [x for x in s if l.count(x) == n] print(len(ans)) for x in sorted(ans): print(x)
PRACTICE = False with open("test.txt" if PRACTICE else "input.txt", "r") as f: content = f.read().strip() grid = [list(row) for row in content.split("\n")] height = len(grid) width = len(grid[0]) move_num = 0 while True: move_occurred = False for i, row in enumerate(grid): to_move_east = set() ...
practice = False with open('test.txt' if PRACTICE else 'input.txt', 'r') as f: content = f.read().strip() grid = [list(row) for row in content.split('\n')] height = len(grid) width = len(grid[0]) move_num = 0 while True: move_occurred = False for (i, row) in enumerate(grid): to_move_east = set() ...
def test_hello_world(): message = "Hello, world!" assert message == "Hello, world!"
def test_hello_world(): message = 'Hello, world!' assert message == 'Hello, world!'
# URI Online Judge 3209 N = int(input()) for n in range(N): entrada = [int(i) for i in input().split()] K = entrada[0] O = entrada[1:] saida = sum(O) - len(O) + 1 print(saida)
n = int(input()) for n in range(N): entrada = [int(i) for i in input().split()] k = entrada[0] o = entrada[1:] saida = sum(O) - len(O) + 1 print(saida)
def menorpos(numeros): cont = menor = pos = 0 for c, i in enumerate(numeros): cont = cont + 1 if cont == 1: menor = i pos = c else: if i < menor: menor = i pos = c return pos v = [3, 5, 1, 30, 50, 100] print(menorp...
def menorpos(numeros): cont = menor = pos = 0 for (c, i) in enumerate(numeros): cont = cont + 1 if cont == 1: menor = i pos = c elif i < menor: menor = i pos = c return pos v = [3, 5, 1, 30, 50, 100] print(menorpos(v))
def load(h): return ({'bit': 0, 'on': 0, 'title': 'bit0_off'}, {'bit': 0, 'on': 1, 'title': 'bit0_on'}, {'bit': 1, 'on': 0, 'title': 'bit1_off'}, {'bit': 1, 'on': 1, 'title': 'bit1_on'}, {'bit': 2, 'on': 0, 'title': 'bit2_off'}, {'bit': 2, 'on': 1, 'title'...
def load(h): return ({'bit': 0, 'on': 0, 'title': 'bit0_off'}, {'bit': 0, 'on': 1, 'title': 'bit0_on'}, {'bit': 1, 'on': 0, 'title': 'bit1_off'}, {'bit': 1, 'on': 1, 'title': 'bit1_on'}, {'bit': 2, 'on': 0, 'title': 'bit2_off'}, {'bit': 2, 'on': 1, 'title': 'bit2_on'}, {'bit': 3, 'on': 0, 'title': 'bit3_off'}, {'bi...
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: def get_number(head): number = 0 while head: numb...
class Solution: def add_two_numbers(self, l1: ListNode, l2: ListNode) -> ListNode: def get_number(head): number = 0 while head: number = number * 10 + head.val head = head.next return number def reverse_list(node): pr...
# To input 10 random numbers & find how many of them are even and odd print("============You have to enter 10 random numbers===================") even = 0 odd = 0 for i in range(1,11): num = int(input("Enter the number: ")) if(num%2==0): even = even + 1 else: ...
print('============You have to enter 10 random numbers===================') even = 0 odd = 0 for i in range(1, 11): num = int(input('Enter the number: ')) if num % 2 == 0: even = even + 1 else: odd = odd + 1 print('Total even no. = ', even) print('Total odd no. = ', odd)
def CheckingNeededVars(list_vars): #for var in list_vars: # if var is None: # print 'Variable Needed' pass
def checking_needed_vars(list_vars): pass
"""Top-level package for gitown.""" __author__ = """Milind Shakya""" __email__ = 'sh.milind@gmail.com' __version__ = '0.1.0'
"""Top-level package for gitown.""" __author__ = 'Milind Shakya' __email__ = 'sh.milind@gmail.com' __version__ = '0.1.0'
# -*- coding: utf-8 -*- class HelperSet(object): def __init__(self, helpers=None): helpers = helpers or [] self.__helpers = {} self.__command = None if isinstance(helpers, (list, tuple)): for helper in helpers: self.set(helper, None) else: ...
class Helperset(object): def __init__(self, helpers=None): helpers = helpers or [] self.__helpers = {} self.__command = None if isinstance(helpers, (list, tuple)): for helper in helpers: self.set(helper, None) else: for (alias, helper)...
db_dir = 'financial_db' db_tables = [ '''security ( ticker TEXT PRIMARY KEY, company INT, exchange INT, currency TEXT )''', '''exchange ( acronym TEXT PRIMARY KEY, n...
db_dir = 'financial_db' db_tables = ['security ( ticker TEXT PRIMARY KEY,\n company INT,\n exchange INT,\n currency TEXT\n )', 'exchange ( acronym TEXT PRIMARY KEY,\n name TEXT,\n ...
# -*- coding: utf-8 -*- """Top-level package for Pretty upper.""" __author__ = """Nick Mavrakis""" __email__ = 'mavrakis.n@gmail.com' __version__ = '0.3.1'
"""Top-level package for Pretty upper.""" __author__ = 'Nick Mavrakis' __email__ = 'mavrakis.n@gmail.com' __version__ = '0.3.1'
nums = int(input("Enter range :")) def getfectnum(nums): for i in range(1, nums+1): sumdiv = 0 for a in findalldivs(i): sumdiv = a + sumdiv if sumdiv == i: print(i) def findalldivs(num): ls = list() for x in range(1,num): if num % x ...
nums = int(input('Enter range :')) def getfectnum(nums): for i in range(1, nums + 1): sumdiv = 0 for a in findalldivs(i): sumdiv = a + sumdiv if sumdiv == i: print(i) def findalldivs(num): ls = list() for x in range(1, num): if num % x == 0: ...
def merge_sort(nums): if len(nums) <= 1: return nums mid = (0 + len(nums)) // 2 left = merge_sort(nums[:mid]) right = merge_sort(nums[mid:]) return merge_iterative(left, right) def merge_iterative(nums1, nums2): if nums1 == []: return nums2 if nums2 == []: re...
def merge_sort(nums): if len(nums) <= 1: return nums mid = (0 + len(nums)) // 2 left = merge_sort(nums[:mid]) right = merge_sort(nums[mid:]) return merge_iterative(left, right) def merge_iterative(nums1, nums2): if nums1 == []: return nums2 if nums2 == []: return num...
""" Paint House https://leetcode.com/problems/paint-house/ There is a row of n houses, where each house can be painted one of three colors: red, blue, or green. The cost of painting each house with a certain color is different. You have to paint all the houses such that no two adjacent houses have the same color. The...
""" Paint House https://leetcode.com/problems/paint-house/ There is a row of n houses, where each house can be painted one of three colors: red, blue, or green. The cost of painting each house with a certain color is different. You have to paint all the houses such that no two adjacent houses have the same color. The...
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # Full license terms provided in LICENSE.md file. CHECKPOINT_DIR = 'data/checkpoints/' FROZEN_GRAPHS_DIR = 'data/frozen_graphs/' UFF_DIR = 'data/uff/' NETS = { 'vgg_16': { 'num_classes': 1000, 'input_name': 'input', 'output_na...
checkpoint_dir = 'data/checkpoints/' frozen_graphs_dir = 'data/frozen_graphs/' uff_dir = 'data/uff/' nets = {'vgg_16': {'num_classes': 1000, 'input_name': 'input', 'output_names': ['vgg_16/fc8/BiasAdd'], 'input_width': 224, 'input_height': 224, 'input_channels': 3, 'preprocess_fn': 'preprocess_vgg', 'checkpoint_filenam...
''' Created on 27 Oct 2018 @author: vahanoi ''' class Player: ''' classdocs ''' # TODO: create object Player with all details def __init__(self, name, emailaddress): ''' Constructor ''' age=0 return(None)
""" Created on 27 Oct 2018 @author: vahanoi """ class Player: """ classdocs """ def __init__(self, name, emailaddress): """ Constructor """ age = 0 return None
class Zillion: def __init__(self,digits): self.digits = digits self.List = [] self.toList() def toList(self): badBoolean=False #Kludge if len(self.digits) == 0 : raise RuntimeError #Cannot make a list of nothing for n in range (0,len(self.digits)): if self.digits...
class Zillion: def __init__(self, digits): self.digits = digits self.List = [] self.toList() def to_list(self): bad_boolean = False if len(self.digits) == 0: raise RuntimeError for n in range(0, len(self.digits)): if self.digits[n] is not...
MAX_NUMBER_ONE_CLASS = 2 MAX_WIDTH = 200 CPU_CORE = 8 RANSAC_THRESHOLD = 5.0
max_number_one_class = 2 max_width = 200 cpu_core = 8 ransac_threshold = 5.0
def getarea(XYZ): # prism is A,B,C # X=A+B Y=B+C Z=A+C X,Y,Z = XYZ #A=2(wl+hl+hw) A = ((X+Z)-Y)/2 B = ((X+Y)-Z)/2 C = ((Y+Z)-X)/2 return 2*(A*B+C*B+C*A) if __name__ == "__main__": for tc in xrange(int(raw_input())): print("%.2f" % round(getarea(map(float,raw_input().spli...
def getarea(XYZ): (x, y, z) = XYZ a = (X + Z - Y) / 2 b = (X + Y - Z) / 2 c = (Y + Z - X) / 2 return 2 * (A * B + C * B + C * A) if __name__ == '__main__': for tc in xrange(int(raw_input())): print('%.2f' % round(getarea(map(float, raw_input().split())), 2))
""" Flatten List from nested list __author__ = Pavan Maradia __version__ = v1.0 """ class ListFlatten(object): """ Flat Nested list in single list """ def __init__(self): """ Initialize class object """ self.resp_list = list() self.response = dict() def ...
""" Flatten List from nested list __author__ = Pavan Maradia __version__ = v1.0 """ class Listflatten(object): """ Flat Nested list in single list """ def __init__(self): """ Initialize class object """ self.resp_list = list() self.response = dict() def c...
NPC_IDS = [ 3, 6, 30, 36, 38, 40, 43, 46, 48, 54, 60, 61, 66, 68, 69, 74, 78, 79, 80, 92, 94, 95, 97, 98, 99, 100, 103, 113, 114, 115, 116, 117, 118, 121, 122, 123, 124, 125, 126, 127, 151, 152, 154, 157, 167, 171, 190, 193,...
npc_ids = [3, 6, 30, 36, 38, 40, 43, 46, 48, 54, 60, 61, 66, 68, 69, 74, 78, 79, 80, 92, 94, 95, 97, 98, 99, 100, 103, 113, 114, 115, 116, 117, 118, 121, 122, 123, 124, 125, 126, 127, 151, 152, 154, 157, 167, 171, 190, 193, 196, 197, 198, 199, 202, 203, 205, 206, 210, 212, 213, 215, 217, 218, 222, 223, 225, 226, 227, 2...
""" A variety of functions for converting to and from camelCase and snake_case. """ def snake_to_camel_case(string): words = [word.capitalize() for word in string.split("_")] words[0] = words[0].lower() return "".join(words) def camel_to_snake_case(string): words = [] start_index = 0 for ind...
""" A variety of functions for converting to and from camelCase and snake_case. """ def snake_to_camel_case(string): words = [word.capitalize() for word in string.split('_')] words[0] = words[0].lower() return ''.join(words) def camel_to_snake_case(string): words = [] start_index = 0 for (inde...
""" Task : Given an integer, , perform the following conditional actions: If is odd, print Weird If is even and in the inclusive range of to , print Not Weird If is even and in the inclusive range of to , print Weird If is even and greater than , print Not Weird """ number = int(input().strip()) if (6 <= numbe...
""" Task : Given an integer, , perform the following conditional actions: If is odd, print Weird If is even and in the inclusive range of to , print Not Weird If is even and in the inclusive range of to , print Weird If is even and greater than , print Not Weird """ number = int(input().strip()) if 6 <= number <...
T = int(input()) for i in range(T): RS = input().split() R = int(RS[0]) S = RS[1] P = '' for i in S: P += (i * R) print(P)
t = int(input()) for i in range(T): rs = input().split() r = int(RS[0]) s = RS[1] p = '' for i in S: p += i * R print(P)
config = some.Structure( globalMap = { 103310322020340: [100000031211103,101042000320420,100100001202021,112320301100420,110101024402203,112001202000203,112101112010031,102130400200010,100401014300441,103000401422033], 110040120003212: [114413100031332,102101001412002,100210000032130,214000110100040...
config = some.Structure(globalMap={103310322020340: [100000031211103, 101042000320420, 100100001202021, 112320301100420, 110101024402203, 112001202000203, 112101112010031, 102130400200010, 100401014300441, 103000401422033], 110040120003212: [114413100031332, 102101001412002, 100210000032130, 214000110100040, 1030314201...
LOG_RECORD_PROPERTIES = { "application_name": {"type": "keyword"}, "environment": {"type": "keyword"}, "logfile": {"type": "keyword"}, "data_pipeline": { "properties": { "id": {"type": "keyword"}, "component": {"type": "keyword"}, "instance": {"type": "keyword...
log_record_properties = {'application_name': {'type': 'keyword'}, 'environment': {'type': 'keyword'}, 'logfile': {'type': 'keyword'}, 'data_pipeline': {'properties': {'id': {'type': 'keyword'}, 'component': {'type': 'keyword'}, 'instance': {'type': 'keyword'}, 'attempt': {'type': 'keyword'}}}, 'emr_cluster': {'properti...
class Solution(object): def findPoisonedDuration(self, timeSeries, duration): """ :type timeSeries: List[int] :type duration: int :rtype: int """ prev_end = None ans = 0 for t in timeSeries: end = t + duration t = max(prev_end, ...
class Solution(object): def find_poisoned_duration(self, timeSeries, duration): """ :type timeSeries: List[int] :type duration: int :rtype: int """ prev_end = None ans = 0 for t in timeSeries: end = t + duration t = max(prev_en...
# from module_1 import add_number # from module_1 import print_number # from module_1 import number number = 0 def number_in_function(): def add_number_func(number): number = 2 print(f'Number in function - {number}') add_number_func(number) print(f'Number out of the function - {number}') def add_di...
number = 0 def number_in_function(): def add_number_func(number): number = 2 print(f'Number in function - {number}') add_number_func(number) print(f'Number out of the function - {number}') def add_directly(): global number number = 3 print(number) add_direc...
class BaseEnvironment: def getResponseDistribution(self, hour, minute, day, stateLocation, stateActivity, lastNotificationTime): """ This function returns user's internal perception of notifications (i.e., at this given context, how likely the user is going to answer the not...
class Baseenvironment: def get_response_distribution(self, hour, minute, day, stateLocation, stateActivity, lastNotificationTime): """ This function returns user's internal perception of notifications (i.e., at this given context, how likely the user is going to answer the notification.) ...
word_list = [ 'ratt', 'poison', 'twisted sister', 'skid row', 'guns n roses', 'slaughter', 'kix', 'van halen', 'tora tora', 'ozzy osbourne', 'lita ford', 'vixen', 'dangerous toys', 'blue murder', 'damn yankees', 'def leppard', 'tesla', 'warrant', 'motley crue' ]
word_list = ['ratt', 'poison', 'twisted sister', 'skid row', 'guns n roses', 'slaughter', 'kix', 'van halen', 'tora tora', 'ozzy osbourne', 'lita ford', 'vixen', 'dangerous toys', 'blue murder', 'damn yankees', 'def leppard', 'tesla', 'warrant', 'motley crue']
# -*- coding: utf-8 -*- """Define project metadata """ __title__ = "hashfs" __summary__ = "A content-addressable file management system." __url__ = "https://github.com/dgilland/hashfs" __version__ = "0.7.2" __install_requires__ = [] __tests_require__ = ["tox"] __author__ = "Derrick Gilland" __email__ = "dgilland@gm...
"""Define project metadata """ __title__ = 'hashfs' __summary__ = 'A content-addressable file management system.' __url__ = 'https://github.com/dgilland/hashfs' __version__ = '0.7.2' __install_requires__ = [] __tests_require__ = ['tox'] __author__ = 'Derrick Gilland' __email__ = 'dgilland@gmail.com' __license__ = 'MIT ...
def change(amount): if amount is None or amount < 24 or amount > 1000: raise ValueError('"' + str(amount) + '" must be a integer between 24 and 1000') return _get_change(amount) def _get_change(amount): if amount % 7 == 0: return [7] * int(amount/7) coins = _get_change(amount - 5) ...
def change(amount): if amount is None or amount < 24 or amount > 1000: raise value_error('"' + str(amount) + '" must be a integer between 24 and 1000') return _get_change(amount) def _get_change(amount): if amount % 7 == 0: return [7] * int(amount / 7) coins = _get_change(amount - 5) ...
class Solution(object): def minOperations(self, s): """ :type s: str :rtype: int """ # Runtime: 52 ms # Memory: 13.4 Mb return min(self.check(s, "0", "1"), self.check(s, "1", "0")) def check(self, string, char_even, char_odd): changes = 0 ...
class Solution(object): def min_operations(self, s): """ :type s: str :rtype: int """ return min(self.check(s, '0', '1'), self.check(s, '1', '0')) def check(self, string, char_even, char_odd): changes = 0 for (idx, char) in enumerate(string): ...
def extractWeleTranslation(item): """ """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or 'preview' in item['title'].lower(): return None if item['title'].lower().startswith('sin city'): return buildReleaseMessageWithType(item, 'Sin City', vol, chp, frag=frag, ...
def extract_wele_translation(item): """ """ (vol, chp, frag, postfix) = extract_vol_chapter_fragment_postfix(item['title']) if not (chp or vol) or 'preview' in item['title'].lower(): return None if item['title'].lower().startswith('sin city'): return build_release_message_with_type(ite...
""" An english to pig latin translator made without the use of machine learning. """ s = input('Enter a string to translate to Pig Latin: ') end = '' vowels = ['a', 'e', 'i', 'o', 'u'] n = 0 for i in range(len(s)): if s[i] in vowels: n = i break else: end += s[i] print(s[n:]+end+'ay')...
""" An english to pig latin translator made without the use of machine learning. """ s = input('Enter a string to translate to Pig Latin: ') end = '' vowels = ['a', 'e', 'i', 'o', 'u'] n = 0 for i in range(len(s)): if s[i] in vowels: n = i break else: end += s[i] print(s[n:] + end + 'ay'...
with open("headers.txt", 'r') as file: headers_unformatted = [header.strip() for header in file] organized_headers = dict() for header in headers_unformatted: key, value = header.split(": ") organized_headers[key] = value print("{") for k, v in organized_headers.items(): print(f"'{k}'", ...
with open('headers.txt', 'r') as file: headers_unformatted = [header.strip() for header in file] organized_headers = dict() for header in headers_unformatted: (key, value) = header.split(': ') organized_headers[key] = value print('{') for (k, v) in organized_headers.items(): print(f"'{k}'", ':', f"'{v}'...
with open("in.txt", "r") as f: s = f.read() with open("out.txt", "w") as f: for x in s.split("\n"): if len(x) > 0: print("# " + x[3:], file=f) if __name__ == "__main__": pass
with open('in.txt', 'r') as f: s = f.read() with open('out.txt', 'w') as f: for x in s.split('\n'): if len(x) > 0: print('# ' + x[3:], file=f) if __name__ == '__main__': pass
class PostureAidConfig: __conf = { "PAD_X": 30, "PAD_Y": 30, "MODEL": 101, "CAM_ID": 0, "CORRECT_POS": (0,0,0,0), "SCALE_FACTOR": 0.7125, "ALARM_FILE": './data/audio/alarm_audio.wav' } __setters = [] @staticmethod def config(key): retu...
class Postureaidconfig: __conf = {'PAD_X': 30, 'PAD_Y': 30, 'MODEL': 101, 'CAM_ID': 0, 'CORRECT_POS': (0, 0, 0, 0), 'SCALE_FACTOR': 0.7125, 'ALARM_FILE': './data/audio/alarm_audio.wav'} __setters = [] @staticmethod def config(key): return PostureAidConfig.__conf[key] @staticmethod def ...
# Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
class Byteordererror(Exception): def __init__(self, order=''): self.byte_order = order def __str__(self): return repr(self.byte_order) class Dm3Fileversionerror(Exception): def __init__(self, value=''): self.dm3_version = value def __str__(self): return repr(self.dm3...
def nthMax(nums, n): maxs = [] for i in range(n): m = None for num in nums: if (m is None or num > m) and (num not in maxs): m = num maxs.append(m) return maxs[-1] if maxs[-1] is not None else maxs[0] class Solution(object): def thirdMax(se...
def nth_max(nums, n): maxs = [] for i in range(n): m = None for num in nums: if (m is None or num > m) and num not in maxs: m = num maxs.append(m) return maxs[-1] if maxs[-1] is not None else maxs[0] class Solution(object): def third_max(self, nums):...
def main(request, response): allow = request.GET.first(b"allow", b"false") headers = [(b"Content-Type", b"application/javascript")] if allow != b"false": headers.append((b"Access-Control-Allow-Origin", b"*")) body = b""" function handleRejectedPromise(promise) { promise.catch(() => ...
def main(request, response): allow = request.GET.first(b'allow', b'false') headers = [(b'Content-Type', b'application/javascript')] if allow != b'false': headers.append((b'Access-Control-Allow-Origin', b'*')) body = b'\n \tfunction handleRejectedPromise(promise) {\n \t\tpromise.catch(() =>...
psys_game_rain = 0 psys_game_snow = 1 psys_game_blood = 2 psys_game_blood_2 = 3 psys_game_hoof_dust = 4 psys_game_hoof_dust_snow = 5 psys_game_hoof_dust_mud = 6 psys_game_water_splash_1 = 7 psys_game_water_splash_2 = 8 psys_game_water_splash_3 = 9 psys_torch_fire = 10 psys_fire_glow_1 = 11 psys_fire_glow_fixed = 12 psy...
psys_game_rain = 0 psys_game_snow = 1 psys_game_blood = 2 psys_game_blood_2 = 3 psys_game_hoof_dust = 4 psys_game_hoof_dust_snow = 5 psys_game_hoof_dust_mud = 6 psys_game_water_splash_1 = 7 psys_game_water_splash_2 = 8 psys_game_water_splash_3 = 9 psys_torch_fire = 10 psys_fire_glow_1 = 11 psys_fire_glow_fixed = 12 psy...
HTML_CLUSTER_DATA_DIRECTORY = 'html-cluster-data' SPLASH_URL = 'http://localhost:8050' USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36' # NOQA SPLASH_TIMEOUT = 30 ALLOW_STATUS_CODE = [200]
html_cluster_data_directory = 'html-cluster-data' splash_url = 'http://localhost:8050' user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36' splash_timeout = 30 allow_status_code = [200]