content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
add_user_permissions_response = { 'user': 'enterprise_search', 'permissions': ['permission1'] }
add_user_permissions_response = {'user': 'enterprise_search', 'permissions': ['permission1']}
# # Function for program annotation-to-outline. Responsible for writing the # LaTex structure to file. # def writeToLatex(fileName, outlineContents, defContents, titleContents): # Write contents to .tex file f = open(fileName, 'w') # file object # write LaTex preamble to file f.write("\\documentcla...
def write_to_latex(fileName, outlineContents, defContents, titleContents): f = open(fileName, 'w') f.write('\\documentclass[10pt,a4paper,draft]{report}\n \\usepackage{geometry}\\geometry{a4paper, left=22mm,\n right=22mm,\n top=25mm,\n bottom=30mm,\n ...
dist1={0: 460146, 1: 211769, 2: 89768, 3: 41207, 4: 21465, 5: 10368, 6: 6336, 7: 3640, 8: 2378, 9: 1440, 10: 1068, 11: 694, 12: 483, 13: 336, 14: 237, 15: 155, 16: 153, 17: 128, 18: 94, 19: 81, 20: 123, 21: 71, 22: 89, 23: 40, 24: 44, 25: 43, 26: 25, 27: 15, 28: 19, 29: 19, 30: 23, 31: 19, 32: 6, 33: 13, 34: 8, 35: 3, ...
dist1 = {0: 460146, 1: 211769, 2: 89768, 3: 41207, 4: 21465, 5: 10368, 6: 6336, 7: 3640, 8: 2378, 9: 1440, 10: 1068, 11: 694, 12: 483, 13: 336, 14: 237, 15: 155, 16: 153, 17: 128, 18: 94, 19: 81, 20: 123, 21: 71, 22: 89, 23: 40, 24: 44, 25: 43, 26: 25, 27: 15, 28: 19, 29: 19, 30: 23, 31: 19, 32: 6, 33: 13, 34: 8, 35: 3...
class SpaceAge: def __init__(self, seconds: float): self.seconds = seconds def _space_age(self, ratio: float = 1.0, ndigits: int = 2) -> float: return round(self.seconds / 31557600.0 / ratio, ndigits) def on_mercury(self) -> float: return self._space_age(0.2408467) def on_ven...
class Spaceage: def __init__(self, seconds: float): self.seconds = seconds def _space_age(self, ratio: float=1.0, ndigits: int=2) -> float: return round(self.seconds / 31557600.0 / ratio, ndigits) def on_mercury(self) -> float: return self._space_age(0.2408467) def on_venus(s...
# This program demonstrates the repetition operator. def main(): # Print nine rows increasing in length. for count in range(1, 10): print('Z' * count) # Print nine rows decreasing in length. for count in range(8, 0, -1): print('Z' * count) # Call the main function. main()
def main(): for count in range(1, 10): print('Z' * count) for count in range(8, 0, -1): print('Z' * count) main()
#num = 1 # #while num < 10: # print(num) # num = num+1 #nome = 'cecilia' # #for letra in nome: # print(letra) #for num in range(1,6): # print(num) lista = [1,2,3,4,5,6] for num in lista: print(num)
lista = [1, 2, 3, 4, 5, 6] for num in lista: print(num)
s = input('as: ') print(s)
s = input('as: ') print(s)
class Solution: def match(self, pattern, strs): words = strs.split() patterns = list(pattern) patternList = self.getPattern(patterns) wordList = self.getPattern(words) return patternList == wordList def getPattern(self, strList): index = 1 tmpDict = {} ...
class Solution: def match(self, pattern, strs): words = strs.split() patterns = list(pattern) pattern_list = self.getPattern(patterns) word_list = self.getPattern(words) return patternList == wordList def get_pattern(self, strList): index = 1 tmp_dict = ...
def getAverageOverPercentage(n, score): avg = sum(score) / n std = 0 for i in score: if i > avg: std += 1 return round(std / n * 100, 3) for _ in range(int(input())): data = list(map(int, input().split())) result = getAverageOverPercentage(data[0], data[1:]) print("%.3f"%result + '%')
def get_average_over_percentage(n, score): avg = sum(score) / n std = 0 for i in score: if i > avg: std += 1 return round(std / n * 100, 3) for _ in range(int(input())): data = list(map(int, input().split())) result = get_average_over_percentage(data[0], data[1:]) print('...
# We explicitly test here that the constructor is not included in the signatures. @abstract class Abstract: x: int def __init__(self, x: int) -> None: self.x = x __book_url__ = "dummy" __book_version__ = "dummy"
@abstract class Abstract: x: int def __init__(self, x: int) -> None: self.x = x __book_url__ = 'dummy' __book_version__ = 'dummy'
__author__ = 'chira' # for-loop : when number of iterations known # while-loop : when iteration depends on condition for i in range(5,10): print(i) print("------------"); i = 5 while i < 10: print(i) i += 1 print("------------");
__author__ = 'chira' for i in range(5, 10): print(i) print('------------') i = 5 while i < 10: print(i) i += 1 print('------------')
class keyBox: def __init__(self): self.wallet_addresses = [] self.private_keys = [] #for testing self.private_keys.append(b'p.Oids\xedb\xa3\x93\xc5\xad\xb9\x8d\x92\x94\x00\x06\xb9\x82\xde\xb9\xbdBg\\\x82\xd4\x90W\xd0\xd5') self.private_keys.append(b'\x16\xc3\xb37\xb8\x8aG`\xdf\xad\xe3},\x9a\xb4...
class Keybox: def __init__(self): self.wallet_addresses = [] self.private_keys = [] self.private_keys.append(b'p.Oids\xedb\xa3\x93\xc5\xad\xb9\x8d\x92\x94\x00\x06\xb9\x82\xde\xb9\xbdBg\\\x82\xd4\x90W\xd0\xd5') self.private_keys.append(b'\x16\xc3\xb37\xb8\x8aG`\xdf\xad\xe3},\x9a\xb4~...
for i in range(1, 6): for j in range(1, i + 1): print('* ', end='') print() for i in range(4, 0, -1): for j in range(1, i + 1): print('* ', end='') print()
for i in range(1, 6): for j in range(1, i + 1): print('* ', end='') print() for i in range(4, 0, -1): for j in range(1, i + 1): print('* ', end='') print()
class Solution: # @param num, a list of integer # @return an integer def findPeakElement(self, num): l, r = 0, len(num)-1 while l < r: m = (l+r) / 2 if m == 0 or num[m] > num[m-1]: if m == r or num[m] > num[m+1]: return m ...
class Solution: def find_peak_element(self, num): (l, r) = (0, len(num) - 1) while l < r: m = (l + r) / 2 if m == 0 or num[m] > num[m - 1]: if m == r or num[m] > num[m + 1]: return m l = m + 1 else: ...
OPENSEARCH_GIT_RAW = "gits" OPENSEARCH_GIT_GITHUB_CLEAN = "git_github_clean" OPENSEARCH_INDEX_GITHUB_COMMITS = "github_commits" OPENSEARCH_INDEX_GITHUB_ISSUES = "github_issues" OPENSEARCH_INDEX_GITHUB_ISSUES_COMMENTS = "github_issues_comments" OPENSEARCH_INDEX_GITHUB_ISSUES_TIMELINE = "github_issues_timeline" OPENSEAR...
opensearch_git_raw = 'gits' opensearch_git_github_clean = 'git_github_clean' opensearch_index_github_commits = 'github_commits' opensearch_index_github_issues = 'github_issues' opensearch_index_github_issues_comments = 'github_issues_comments' opensearch_index_github_issues_timeline = 'github_issues_timeline' opensearc...
Dataset_Path = dict( CULane = "/workspace/CULANE_DATASET", Tusimple = "/workspace/TUSIMPLE_DATASET", bdd100k = "/workspace/BDD100K_DATASET" )
dataset__path = dict(CULane='/workspace/CULANE_DATASET', Tusimple='/workspace/TUSIMPLE_DATASET', bdd100k='/workspace/BDD100K_DATASET')
code = [input() for _ in range(610)] for i in range(len(code)-1): if code[i][:3] == 'jmp': code[i] = 'nop' + code[i][3:] elif code[i][:3] == 'nop': code[i] = 'jmp' + code[i][3:] instr_idx = 0 acc_value = 0 executed_ops = set() while instr_idx not in executed_ops and instr_idx ...
code = [input() for _ in range(610)] for i in range(len(code) - 1): if code[i][:3] == 'jmp': code[i] = 'nop' + code[i][3:] elif code[i][:3] == 'nop': code[i] = 'jmp' + code[i][3:] instr_idx = 0 acc_value = 0 executed_ops = set() while instr_idx not in executed_ops and instr_idx <...
array = [1,2,3,4,5] result = [5,1,4,2,3] # in-place replacement def rearrange_sorted_max_min_2(arr): max_index = len(arr) - 1 min_index = 0 max_elem = arr[max_index] + 1 # orig element of stored as remainder, max or min element stored # as multiplier, this allows to swap numbers in place, finally...
array = [1, 2, 3, 4, 5] result = [5, 1, 4, 2, 3] def rearrange_sorted_max_min_2(arr): max_index = len(arr) - 1 min_index = 0 max_elem = arr[max_index] + 1 for i in range(len(arr)): if i % 2 is 0: arr[i] += arr[max_index] % max_elem * max_elem max_index -= 1 else:...
n = int(input()) sv = sq = 0 for i in range(n): sv += float(input()) q = len(str(input()).split()) sq += q print('day {}: {} kg'.format(i + 1, q)) print('{:.2f} kg by day'.format(float(sq / n))) print('R$ {:.2f} by day'.format(float(sv / n)))
n = int(input()) sv = sq = 0 for i in range(n): sv += float(input()) q = len(str(input()).split()) sq += q print('day {}: {} kg'.format(i + 1, q)) print('{:.2f} kg by day'.format(float(sq / n))) print('R$ {:.2f} by day'.format(float(sv / n)))
# variables dependent on your setup boardType = "atmega2560" # atmega168 | atmega328p | atmega2560 | atmega1280 | atmega32u4 comPort = "COM3" # com4 for atmega328 com8 for mega2560 SHIFT = 47 LATCH = 48 DATA = 49 # start Arduino service named arduino arduino = Runtime.createAndStart("arduino", "Arduino") arduino.se...
board_type = 'atmega2560' com_port = 'COM3' shift = 47 latch = 48 data = 49 arduino = Runtime.createAndStart('arduino', 'Arduino') arduino.setBoard(boardType) arduino.connect(comPort) arduino.pinMode(SHIFT, Arduino.OUTPUT) arduino.pinMode(LATCH, Arduino.OUTPUT) arduino.pinMode(DATA, Arduino.OUTPUT) def shift_out(value...
airline = pd.read_csv('data/international-airline-passengers.csv', parse_dates=['Month'], sep=';') airline.set_index('Month', inplace=True) ax = airline.plot(legend=False) ax.set_xlabel('Date') ax.set_ylabel('Passengers')
airline = pd.read_csv('data/international-airline-passengers.csv', parse_dates=['Month'], sep=';') airline.set_index('Month', inplace=True) ax = airline.plot(legend=False) ax.set_xlabel('Date') ax.set_ylabel('Passengers')
n=int(input()) if n>=0: sum=int((n*(n+1))/2) print(sum) else: print("Invalid Input")
n = int(input()) if n >= 0: sum = int(n * (n + 1) / 2) print(sum) else: print('Invalid Input')
def moving_average(timeseries, k): result = [] for begin_index in range(0, len(timeseries) - k): end_index = begin_index + k current_sum = 0 for v in timeseries[begin_index:end_index]: current_sum += v current_avg = current_sum / k result.append(curren...
def moving_average(timeseries, k): result = [] for begin_index in range(0, len(timeseries) - k): end_index = begin_index + k current_sum = 0 for v in timeseries[begin_index:end_index]: current_sum += v current_avg = current_sum / k result.append(curren...
class Cord: homepage = ( 1, 42, 529,984 ) question = ( 42,317,519,426 ) answer1 = ( 48,487,510,558 ) answer2 = ( 48,573,510,645 ) answer3 = ( 48,660,510,732 ) answer1_clk = ( 94,524 ) answer2_clk = ( 94,609 ) answer3_clk = ( 94,694 )
class Cord: homepage = (1, 42, 529, 984) question = (42, 317, 519, 426) answer1 = (48, 487, 510, 558) answer2 = (48, 573, 510, 645) answer3 = (48, 660, 510, 732) answer1_clk = (94, 524) answer2_clk = (94, 609) answer3_clk = (94, 694)
#Exercise 4-2 - Animals animals = ['lion', 'tiger', 'cat'] for animal in animals: print(animal.title(), "it's a feline.") print('Only one is a great pet.')
animals = ['lion', 'tiger', 'cat'] for animal in animals: print(animal.title(), "it's a feline.") print('Only one is a great pet.')
PICTURE_DEFAULT = { "image": { "url": str, "name": str }, "thumbnail": { "url": str, "name": str } }
picture_default = {'image': {'url': str, 'name': str}, 'thumbnail': {'url': str, 'name': str}}
# Python3 function to calculate number of possible stairs arrangements with given number of boxes/bricks def solution(n): dp=[[0 for x in range(n + 5)] for y in range(n + 5)] for i in range(n+1): for j in range (n+1): dp[i][j]=0 dp[3][2]=1 dp[4][2]=1 for i in range(5...
def solution(n): dp = [[0 for x in range(n + 5)] for y in range(n + 5)] for i in range(n + 1): for j in range(n + 1): dp[i][j] = 0 dp[3][2] = 1 dp[4][2] = 1 for i in range(5, n + 1): for j in range(2, i + 1): if j == 2: dp[i][j] = dp[i - j][j] ...
class PdfDoc(): def __init__(self, filename): self.filename = filename self.pages = [] def page_count(self): return len(self.pages)
class Pdfdoc: def __init__(self, filename): self.filename = filename self.pages = [] def page_count(self): return len(self.pages)
arquivo =open('mobydick.txt', 'r') saida = open('saida.txt', 'w') texto = arquivo.readlines()[:] for linha in texto: if linha == '\n': continue else: linha = linha.split() for palavra in linha: saida.write(f'{palavra} ') saida.write('\n') arquivo.close() saida.close()
arquivo = open('mobydick.txt', 'r') saida = open('saida.txt', 'w') texto = arquivo.readlines()[:] for linha in texto: if linha == '\n': continue else: linha = linha.split() for palavra in linha: saida.write(f'{palavra} ') saida.write('\n') arquivo.close() saida.close()
file = open('signalsAndNoise_input.txt', 'r') lines_read = file.readlines() message_length = len(lines_read[0].strip()) letter_frequencies = [None] * message_length for index in range(message_length): letter_frequencies[index] = dict() for line in lines_read: line = line.strip() for i in range(len(line))...
file = open('signalsAndNoise_input.txt', 'r') lines_read = file.readlines() message_length = len(lines_read[0].strip()) letter_frequencies = [None] * message_length for index in range(message_length): letter_frequencies[index] = dict() for line in lines_read: line = line.strip() for i in range(len(line)): ...
# Python - 3.6.0 def testing(actual, expected): Test.assert_equals(actual, expected) Test.describe('opstrings') Test.it('Basic tests vert_mirror') testing(oper(vert_mirror, 'hSgdHQ\nHnDMao\nClNNxX\niRvxxH\nbqTVvA\nwvSyRu'), 'QHdgSh\noaMDnH\nXxNNlC\nHxxvRi\nAvVTqb\nuRySvw') testing(oper(vert_mirror, 'IzOTWE\nkkbeC...
def testing(actual, expected): Test.assert_equals(actual, expected) Test.describe('opstrings') Test.it('Basic tests vert_mirror') testing(oper(vert_mirror, 'hSgdHQ\nHnDMao\nClNNxX\niRvxxH\nbqTVvA\nwvSyRu'), 'QHdgSh\noaMDnH\nXxNNlC\nHxxvRi\nAvVTqb\nuRySvw') testing(oper(vert_mirror, 'IzOTWE\nkkbeCM\nWuzZxM\nvDddJw\n...
# (C) Datadog, Inc. 2018 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) def headers(agentConfig, **kwargs): # Build the request headers res = { 'User-Agent': 'Datadog Agent/%s' % agentConfig.get('version', '0.0.0'), 'Content-Type': 'application/x-www-form-url...
def headers(agentConfig, **kwargs): res = {'User-Agent': 'Datadog Agent/%s' % agentConfig.get('version', '0.0.0'), 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'text/html, */*'} if 'http_host' in kwargs: res['Host'] = kwargs['http_host'] return res
for i in range(101): if i % 3 == 0: print(i)
for i in range(101): if i % 3 == 0: print(i)
to_solve = '' with open('input.txt') as f: to_solve = f.readlines() to_solve = list(map(lambda x: x.split(': '), to_solve)) temp = [] for i in to_solve: ttemp = i[0].split(' ') tttemp = ttemp[0].split('-') ttttemp = {'char': ttemp[1], 'passwd': i[1], 'min': int(tttemp[0]), 'max': int(tttemp[1])} temp.append(ttt...
to_solve = '' with open('input.txt') as f: to_solve = f.readlines() to_solve = list(map(lambda x: x.split(': '), to_solve)) temp = [] for i in to_solve: ttemp = i[0].split(' ') tttemp = ttemp[0].split('-') ttttemp = {'char': ttemp[1], 'passwd': i[1], 'min': int(tttemp[0]), 'max': int(tttemp[1])} tem...
# http://codingbat.com/prob/p194053 def combo_string(a, b): if len(a) > len(b): return b + a + b else: return a + b + a
def combo_string(a, b): if len(a) > len(b): return b + a + b else: return a + b + a
def fibonacci(n): if n == 1 or n == 2: return 1 return fibonacci(n-1) + fibonacci(n-2)
def fibonacci(n): if n == 1 or n == 2: return 1 return fibonacci(n - 1) + fibonacci(n - 2)
class Solution: # @return an integer def maxArea(self, height): n = len(height) i = 0 j = n - 1 max_area = 0 while i < j: max_area = max(max_area, (j - i) * min(height[i], height[j])) if height[i] <= height[j]: i += 1 el...
class Solution: def max_area(self, height): n = len(height) i = 0 j = n - 1 max_area = 0 while i < j: max_area = max(max_area, (j - i) * min(height[i], height[j])) if height[i] <= height[j]: i += 1 else: j -...
def isnotebook(): try: shell = get_ipython().__class__.__name__ if shell == 'ZMQInteractiveShell': return True # Jupyter notebook or qtconsole elif shell == 'TerminalInteractiveShell': return False # Terminal running IPython else: return...
def isnotebook(): try: shell = get_ipython().__class__.__name__ if shell == 'ZMQInteractiveShell': return True elif shell == 'TerminalInteractiveShell': return False else: return False except NameError: return False
l = [*map(int, input().split())] l.sort() if l[0]+l[3] == l[1]+l[2] or l[3] == l[0]+l[1]+l[2]: print("YES") else: print("NO")
l = [*map(int, input().split())] l.sort() if l[0] + l[3] == l[1] + l[2] or l[3] == l[0] + l[1] + l[2]: print('YES') else: print('NO')
def is_positive(num): if int(num) > 0: return True else: return False def is_negative(num): if int(num) < 0: return True else: return False def is_zero(num): if int(num) == 0: return True else: return False def is_odd(num): if int(num) <=...
def is_positive(num): if int(num) > 0: return True else: return False def is_negative(num): if int(num) < 0: return True else: return False def is_zero(num): if int(num) == 0: return True else: return False def is_odd(num): if int(num) <= 0:...
def factorial(curr): g = 1 for i in range(1, curr + 1): g *= i return g def non_recurrsion(): num = 1 try: row = int(input("Enter number of rows:")) except: print("Invalid input. Please enter an integer") exit(1) for i in range(1, row + 1): for j in...
def factorial(curr): g = 1 for i in range(1, curr + 1): g *= i return g def non_recurrsion(): num = 1 try: row = int(input('Enter number of rows:')) except: print('Invalid input. Please enter an integer') exit(1) for i in range(1, row + 1): for j in r...
def can_build(env, platform): return platform == "windows" # For now, GGPO isn't available on linux or mac def configure(env): env.Append(CPPPATH=["#modules/godotggpo/sdk/include/"]) if env["platform"] == "windows": if env["CC"] == "cl": env.Append(LINKFLAGS=["GGPO.lib"]) ...
def can_build(env, platform): return platform == 'windows' def configure(env): env.Append(CPPPATH=['#modules/godotggpo/sdk/include/']) if env['platform'] == 'windows': if env['CC'] == 'cl': env.Append(LINKFLAGS=['GGPO.lib']) env.Append(LIBPATH=['#modules/godotggpo/sdk/bin'])...
print("find greatest common divisor:") def gcd(m, n): cf = [] for i in range (1,min(m,n)+1): if (m%i) == 0 and (n%i) == 0 : cf.append(i) print(cf) print(cf[-1]) gcd(int(input()), int(input()))
print('find greatest common divisor:') def gcd(m, n): cf = [] for i in range(1, min(m, n) + 1): if m % i == 0 and n % i == 0: cf.append(i) print(cf) print(cf[-1]) gcd(int(input()), int(input()))
def object_function_apply_by_key(object_to_apply, key_to_find, function_to_apply): if object_to_apply: if isinstance(object_to_apply, list) and len(object_to_apply) > 0: for item in object_to_apply: object_function_apply_by_key(item, key_to_find, function_to_apply) el...
def object_function_apply_by_key(object_to_apply, key_to_find, function_to_apply): if object_to_apply: if isinstance(object_to_apply, list) and len(object_to_apply) > 0: for item in object_to_apply: object_function_apply_by_key(item, key_to_find, function_to_apply) elif i...
r="" for _ in range(int(input())): x=int(input()) if abs(x)%2==0: r+=str(x)+" is even\n" else: r+=str(x)+" is odd\n" print(r,end="")
r = '' for _ in range(int(input())): x = int(input()) if abs(x) % 2 == 0: r += str(x) + ' is even\n' else: r += str(x) + ' is odd\n' print(r, end='')
# Dictionaries # Giving a key value and calling my_stuff = {'key1': "123", "key2": "Value of key2"} print(my_stuff['key1']) print(my_stuff['key2']) # Something nexted my_stuff2 = {'key1': "123", "key2": "Value of key2", 'key3': {'key4': [1, 3, 2]}} print(my_stuff2['key3']) print(my_stuff2['key3']['key4']) # This wil...
my_stuff = {'key1': '123', 'key2': 'Value of key2'} print(my_stuff['key1']) print(my_stuff['key2']) my_stuff2 = {'key1': '123', 'key2': 'Value of key2', 'key3': {'key4': [1, 3, 2]}} print(my_stuff2['key3']) print(my_stuff2['key3']['key4']) print(my_stuff, '= Dictionary 1') print(my_stuff2, '= Dictionary 2') my_stuff3 =...
# Copyright 2018, The Android Open Source Project # # 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 agree...
i0 = input('i0', ('TENSOR_FLOAT32', [2, 2])) o1 = output('o1', ('TENSOR_FLOAT32', [1, 2])) o2 = output('o2', ('TENSOR_FLOAT32', [2, 1])) o3 = output('o3', ('TENSOR_FLOAT32', [1])) model1 = model().Operation('MEAN', i0, [0], 1).To(o1) model2 = model().Operation('MEAN', i0, [1], 1).To(o2) model3 = model().Operation('MEAN...
# auth.signature add default fields like the created on/ create by/ modified by/ modified on db.define_table('blog_post', Field('title', requires=IS_NOT_EMPTY()), Field('body', 'text', requires=IS_NOT_EMPTY()), Field('photo', 'upload'), auth.signature) db.define_table('blog_comment', Field('blog_post', 'referenc...
db.define_table('blog_post', field('title', requires=is_not_empty()), field('body', 'text', requires=is_not_empty()), field('photo', 'upload'), auth.signature) db.define_table('blog_comment', field('blog_post', 'reference blog_post'), field('comments', 'text', requires=is_not_empty()), auth.signature) db.blog_post.titl...
# ------------------------------------------------------------------ # Copyright (c) 2020 PyInstaller Development Team. # # This file is distributed under the terms of the GNU General Public # License (version 2.0 or later). # # The full license is available in LICENSE.GPL.txt, distributed with # this software. # # SPD...
hiddenimports = ['sklearn.neighbors.typedefs', 'sklearn.utils._cython_blas', 'sklearn.neighbors.quad_tree', 'sklearn.tree._utils']
pkgname = "libxshmfence" pkgver = "1.3" pkgrel = 0 build_style = "gnu_configure" configure_args = ["--with-shared-memory-dir=/dev/shm"] hostmakedepends = ["pkgconf"] makedepends = ["xorgproto"] pkgdesc = "X SyncFence synchronization primitive" maintainer = "q66 <q66@chimera-linux.org>" license = "MIT" url = "https://xo...
pkgname = 'libxshmfence' pkgver = '1.3' pkgrel = 0 build_style = 'gnu_configure' configure_args = ['--with-shared-memory-dir=/dev/shm'] hostmakedepends = ['pkgconf'] makedepends = ['xorgproto'] pkgdesc = 'X SyncFence synchronization primitive' maintainer = 'q66 <q66@chimera-linux.org>' license = 'MIT' url = 'https://xo...
nombre_archivo = input("Ingrese el nombre del archivo que contiene las palabras: ") archivo = open(nombre_archivo,"r") texto = archivo.read() palabras = texto.split() ocurrencias = {} for palabra in palabras: if ocurrencias.get(palabra): ocurrencias[palabra]+=1 else: ocurrencias[palabra]=1 ...
nombre_archivo = input('Ingrese el nombre del archivo que contiene las palabras: ') archivo = open(nombre_archivo, 'r') texto = archivo.read() palabras = texto.split() ocurrencias = {} for palabra in palabras: if ocurrencias.get(palabra): ocurrencias[palabra] += 1 else: ocurrencias[palabra] = 1 ...
#!/usr/bin/python # ============================================================================== # Author: Tao Li (taoli@ucsd.edu) # Date: May 1, 2015 # Question: 009-Palindrome-Number # Link: https://leetcode.com/problems/palindrome-number/ # ================================================================...
class Solution: def is_palindrome(self, x): if x < 0: return False tmp_str = str(x) for i in range(0, len(tmp_str) / 2): if tmp_str[i] != tmp_str[-(i + 1)]: return False return True
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def trellis_deps(): maybe( http_archive, name = "ecal", build_file = Label("//third_party:ecal.BUILD"), sha256 = "1d83d3accfb4a936ffd343524e4a626f0265e...
load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive') load('@bazel_tools//tools/build_defs/repo:utils.bzl', 'maybe') def trellis_deps(): maybe(http_archive, name='ecal', build_file=label('//third_party:ecal.BUILD'), sha256='1d83d3accfb4a936ffd343524e4a626f0265e600226d6e997b3dbbd7f62eaac6', strip_pre...
# VOLTAGE and CURRENT #: Unit for Voltage UNIT_VOLT = 'V' #: Unit for Voltage*10^-3 UNIT_MILLI_VOLT = 'mV' #: Unit for Current UNIT_AMPERE = 'A' #: Unit for Current*10^-3 UNIT_MILLI_AMPERE = 'mA' #: Unit for Current*10^-6 UNIT_MICRO_AMPERE = 'uA' # FREQUENCY #: Unit for Frequencies UNIT_HERTZ = 'Hz' #: Unit for Freque...
unit_volt = 'V' unit_milli_volt = 'mV' unit_ampere = 'A' unit_milli_ampere = 'mA' unit_micro_ampere = 'uA' unit_hertz = 'Hz' unit_kilo_hertz = 'kHz' unit_volt_ampere = 'VA' unit_milli_watt = 'mW' unit_watt = 'W' unit_kilo_watt = 'kW' unit_kilo_watt_hours = 'kWh' unit_seconds = 's' unit_milli_seconds = 'ms' unit_micro_s...
players = ['Nicola', 'Penny', 'Dom', 'Nathan', 'Josie'] print(f"Friends: {players[0]}, {players[1]}, {players[2]}, {players[3]}, {players[4]}") find = input("Who did you find? ") if find in players: print(f"{find} has turned into a zombie!") players[players.index(find)] = "Zombie" print(f"Remaining players:...
players = ['Nicola', 'Penny', 'Dom', 'Nathan', 'Josie'] print(f'Friends: {players[0]}, {players[1]}, {players[2]}, {players[3]}, {players[4]}') find = input('Who did you find? ') if find in players: print(f'{find} has turned into a zombie!') players[players.index(find)] = 'Zombie' print(f'Remaining players:...
WINDOW_WIDTH = 560 MODE_SELECTOR_HEIGHT = 50 CONTROLS_FRAME_HEIGHT = 80 KEYBOARD_HEIGHT = 160 SCORE_DISPLAY_HEIGHT = 110 WINDOW_HEIGHT = KEYBOARD_HEIGHT + CONTROLS_FRAME_HEIGHT + MODE_SELECTOR_HEIGHT + SCORE_DISPLAY_HEIGHT CHOICES = ['Scales','Chords','Chord Progressions']
window_width = 560 mode_selector_height = 50 controls_frame_height = 80 keyboard_height = 160 score_display_height = 110 window_height = KEYBOARD_HEIGHT + CONTROLS_FRAME_HEIGHT + MODE_SELECTOR_HEIGHT + SCORE_DISPLAY_HEIGHT choices = ['Scales', 'Chords', 'Chord Progressions']
''' Writing and reading files using w+ ''' f=open("foo.txt","w+") f.writelines(["Hello\n","This is a new line"]) f.flush() f.seek(0) print(f.read()) f.close()
""" Writing and reading files using w+ """ f = open('foo.txt', 'w+') f.writelines(['Hello\n', 'This is a new line']) f.flush() f.seek(0) print(f.read()) f.close()
class Solution: def buildTree(self, inorder: List[int], postorder: List[int]) -> TreeNode: def _build(l1, r1, l2, r2): if l1 > r1: return None if l1 == r1 or l2 == r2: return TreeNode(postorder[l2]) root = TreeNode(postorder[r2]) ...
class Solution: def build_tree(self, inorder: List[int], postorder: List[int]) -> TreeNode: def _build(l1, r1, l2, r2): if l1 > r1: return None if l1 == r1 or l2 == r2: return tree_node(postorder[l2]) root = tree_node(postorder[r2]) ...
class ProductFileMetadata(object): def __init__(self, output_name, local_path, media_type=None, remote_path=None, data_start=None, data_end=None, geojson=None): self.data_start = data_start self.data_end = data_end self.geojson = geojson self.local_path = local_path...
class Productfilemetadata(object): def __init__(self, output_name, local_path, media_type=None, remote_path=None, data_start=None, data_end=None, geojson=None): self.data_start = data_start self.data_end = data_end self.geojson = geojson self.local_path = local_path self.med...
{ "name": "PersianTweets", "version": "2020", "task": "Corpus", "splits": [], "description": "LSCP: Enhanced Large Scale Colloquial Persian Language Understanding <br>\nLearn more about this study at https://iasbs.ac.ir/~ansari/lscp/", "size": 20665964, "filenames": ["lscp-0.5-fa-normalized.txt"] }
{'name': 'PersianTweets', 'version': '2020', 'task': 'Corpus', 'splits': [], 'description': 'LSCP: Enhanced Large Scale Colloquial Persian Language Understanding <br>\nLearn more about this study at https://iasbs.ac.ir/~ansari/lscp/', 'size': 20665964, 'filenames': ['lscp-0.5-fa-normalized.txt']}
class LoginLimiter(object): # use an array to keep track of most recent 10 requests def __init__(self): self.rctCalls = [] # receive timestamp of a call attempt # return true if call is allowed def isAllowed(self, ts): if len(self.rctCalls) < 10: # when client has made l...
class Loginlimiter(object): def __init__(self): self.rctCalls = [] def is_allowed(self, ts): if len(self.rctCalls) < 10: self.rctCalls.append(ts) print('Call API at timestamp %s' % ts) return True elif ts - self.rctCalls[0] < 60: print('E...
class Node_Types: image_texture = 'TEX_IMAGE' pbr_node = 'BSDF_PRINCIPLED' mapping = 'MAPPING' normal_map = 'NORMAL_MAP' bump_map = 'BUMP' material_output = 'OUTPUT_MATERIAL' class Shader_Node_Types: emission = "ShaderNodeEmission" image_texture = "ShaderNodeTexImage" mapping = "Sh...
class Node_Types: image_texture = 'TEX_IMAGE' pbr_node = 'BSDF_PRINCIPLED' mapping = 'MAPPING' normal_map = 'NORMAL_MAP' bump_map = 'BUMP' material_output = 'OUTPUT_MATERIAL' class Shader_Node_Types: emission = 'ShaderNodeEmission' image_texture = 'ShaderNodeTexImage' mapping = 'Sha...
# https://www.codewars.com/kata/52b757663a95b11b3d00062d/ ''' Instructions : Write a function toWeirdCase (weirdcase in Ruby) that accepts a string, and returns the same string with all even indexed characters in each word upper cased, and all odd indexed characters in each word lower cased. The indexing just explain...
""" Instructions : Write a function toWeirdCase (weirdcase in Ruby) that accepts a string, and returns the same string with all even indexed characters in each word upper cased, and all odd indexed characters in each word lower cased. The indexing just explained is zero based, so the zero-ith index is even, therefore ...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'chromium_code': 1, }, 'targets': [ { 'target_name': 'device_hid', 'type': 'static_library', 'include_dirs':...
{'variables': {'chromium_code': 1}, 'targets': [{'target_name': 'device_hid', 'type': 'static_library', 'include_dirs': ['../..'], 'dependencies': ['../../components/components.gyp:device_event_log_component', '../../net/net.gyp:net', '../core/core.gyp:device_core'], 'sources': ['hid_collection_info.cc', 'hid_collectio...
''' Abstract base class for audio speech and sound command processing. Provides methods shared among all platform implementations. Copyright (c) 2008 Carolina Computer Assistive Technology Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided tha...
""" Abstract base class for audio speech and sound command processing. Provides methods shared among all platform implementations. Copyright (c) 2008 Carolina Computer Assistive Technology Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided tha...
text = input().split(" ") even_words = [i for i in text if len(i) % 2 == 0] for word in even_words: print(word)
text = input().split(' ') even_words = [i for i in text if len(i) % 2 == 0] for word in even_words: print(word)
# Definition for singly-linked list. class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def insertionSortList(self, head: ListNode) -> ListNode: if head == None or head.next == None: return head cur = head roo...
class Listnode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def insertion_sort_list(self, head: ListNode) -> ListNode: if head == None or head.next == None: return head cur = head root = None while cur != No...
# # PySNMP MIB module APCUPS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/APCUPS-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:07:20 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, 09:...
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, single_value_constraint, value_range_constraint, value_size_constraint, constraints_intersection) ...
class frodo: def __init__(self,x): self.x = x def __less__(self,other): if self.x < other.x: return False else: return True a = frodo(10) b = frodo(50) print(a<b)
class Frodo: def __init__(self, x): self.x = x def __less__(self, other): if self.x < other.x: return False else: return True a = frodo(10) b = frodo(50) print(a < b)
better_eyesight = False gold_mult = 1 legday_mult = 1 lifesteal_mult = 0 max_health_mult = 1 acid_blood_mult = 0 bleeding = 0 soul_collector = False soul_eater = False soul_blast = False damage_mult = 1 knockback_mult = 1 resistance_mult = 1 enemy_health_mult = 1 def reset_multipliers(): global better_eyesight, go...
better_eyesight = False gold_mult = 1 legday_mult = 1 lifesteal_mult = 0 max_health_mult = 1 acid_blood_mult = 0 bleeding = 0 soul_collector = False soul_eater = False soul_blast = False damage_mult = 1 knockback_mult = 1 resistance_mult = 1 enemy_health_mult = 1 def reset_multipliers(): global better_eyesight, go...
countdown_3_grid = [{(11, 16): 2, (4, 18): 2, (7, 16): 2, (11, 14): 2, (9, 18): 2, (7, 15): 2, (5, 18): 2, (10, 18): 2, (4, 13): 2, (11, 18): 2, (11, 13): 2, (7, 14): 2, (6, 18): 2, (4, 14): 2, (7, 18): 2, (4, 16): 2, (11, 17): 2, (20, 2): 3, (4, 15): 2, (4, 17): 2, (8, 18): 2, (7, 17): 2, (11, 15): 2}, (20, 2)] countd...
countdown_3_grid = [{(11, 16): 2, (4, 18): 2, (7, 16): 2, (11, 14): 2, (9, 18): 2, (7, 15): 2, (5, 18): 2, (10, 18): 2, (4, 13): 2, (11, 18): 2, (11, 13): 2, (7, 14): 2, (6, 18): 2, (4, 14): 2, (7, 18): 2, (4, 16): 2, (11, 17): 2, (20, 2): 3, (4, 15): 2, (4, 17): 2, (8, 18): 2, (7, 17): 2, (11, 15): 2}, (20, 2)] countd...
description = 'Kompass standard instrument' group = 'basic' includes = ['mono', 'guidefocus', 'selector', 'astrium', 'sample', 'reactor', #'detector', ]
description = 'Kompass standard instrument' group = 'basic' includes = ['mono', 'guidefocus', 'selector', 'astrium', 'sample', 'reactor']
# Use this to take notes on the Edpuzzle video. Try each example rather than just watching it - you will get much more out of it! # Most things are commented out because they can't all coexist without a syntax error user = {"name": "Kasey", "age": 15, "courses": ["History, CompSci"]} for key, value in user.items(): ...
user = {'name': 'Kasey', 'age': 15, 'courses': ['History, CompSci']} for (key, value) in user.items(): print(key, value) 'user.update({"name": "Bob", "age": 25, "phone": "888-8888"})\nuser[\'phone\'] = \'888-8888\'\nuser[\'name\']=\'Bob'
class Solution: def createTargetArray(self, nums: List[int], index: List[int]) -> List[int]: target = [] for i, num in enumerate(nums): idx = index[i] target = target[:idx] + [num] + target[idx:] return target
class Solution: def create_target_array(self, nums: List[int], index: List[int]) -> List[int]: target = [] for (i, num) in enumerate(nums): idx = index[i] target = target[:idx] + [num] + target[idx:] return target
class MySQLClimateQuery: @staticmethod def drop_sport_climates(): return 'DROP TABLE IF EXISTS sport_climates' @staticmethod def create_sport_climates(): return ('CREATE TABLE sport_climates (' 'sport_id int NOT NULL,' 'climate_name varchar(50) NOT NULL,...
class Mysqlclimatequery: @staticmethod def drop_sport_climates(): return 'DROP TABLE IF EXISTS sport_climates' @staticmethod def create_sport_climates(): return 'CREATE TABLE sport_climates (sport_id int NOT NULL,climate_name varchar(50) NOT NULL,PRIMARY KEY (sport_id, climate_name),FO...
#!/usr/bin/env python3 # TODO nedd develop logic for handling strucutre with figure element class FilterModule(object): def filters(self): return { 'json_select': self.json_select } def jmagik(self, jbody, jpth, jfil): if jpth != "" and type(jpth) is not int: jv...
class Filtermodule(object): def filters(self): return {'json_select': self.json_select} def jmagik(self, jbody, jpth, jfil): if jpth != '' and type(jpth) is not int: jvar = jbody for i in jpth: jvar = jvar[i] elif type(jpth) is int: j...
__pycmd_map = {} def register_pycmd(name, pycmd): __pycmd_map[name] = pycmd def get_pycmd(name): if isinstance(name, str) and name in __pycmd_map: return __pycmd_map[name] elif callable(name): return name else: return None class PyCmdOption(object): def __init__(self, globals, locals): se...
__pycmd_map = {} def register_pycmd(name, pycmd): __pycmd_map[name] = pycmd def get_pycmd(name): if isinstance(name, str) and name in __pycmd_map: return __pycmd_map[name] elif callable(name): return name else: return None class Pycmdoption(object): def __init__(self, glo...
def format_words(words): if not words: return "" while "" in words: words.remove("") if not words: return "" elif len(words)==1: return words[0] return ", ".join(words[:-1])+" and "+words[-1]
def format_words(words): if not words: return '' while '' in words: words.remove('') if not words: return '' elif len(words) == 1: return words[0] return ', '.join(words[:-1]) + ' and ' + words[-1]
class Solution: def removeDuplicates(self, nums): i = 0 while i < len(nums): if i == 0: lastNum = nums[i] else: if lastNum != nums[i]: lastNum = nums[i] else: nums.pop(i) ...
class Solution: def remove_duplicates(self, nums): i = 0 while i < len(nums): if i == 0: last_num = nums[i] elif lastNum != nums[i]: last_num = nums[i] else: nums.pop(i) continue i = i + ...
data = ( 'You ', # 0x00 'Yang ', # 0x01 'Lu ', # 0x02 'Si ', # 0x03 'Jie ', # 0x04 'Ying ', # 0x05 'Du ', # 0x06 'Wang ', # 0x07 'Hui ', # 0x08 'Xie ', # 0x09 'Pan ', # 0x0a 'Shen ', # 0x0b 'Biao ', # 0x0c 'Chan ', # 0x0d 'Mo ', # 0x0e 'Liu ', # 0x0f 'Jian ', # 0x10 'P...
data = ('You ', 'Yang ', 'Lu ', 'Si ', 'Jie ', 'Ying ', 'Du ', 'Wang ', 'Hui ', 'Xie ', 'Pan ', 'Shen ', 'Biao ', 'Chan ', 'Mo ', 'Liu ', 'Jian ', 'Pu ', 'Se ', 'Cheng ', 'Gu ', 'Bin ', 'Huo ', 'Xian ', 'Lu ', 'Qin ', 'Han ', 'Ying ', 'Yong ', 'Li ', 'Jing ', 'Xiao ', 'Ying ', 'Sui ', 'Wei ', 'Xie ', 'Huai ', 'Hao ', '...
# -*- coding: utf-8 -*- def main(): n = int(input()) mod = 10 ** 9 + 7 ans = 0 for i in range(n): ans += ((i + 1) ** 10 - i ** 10) * (n // (i + 1)) ** 10 ans %= mod print(ans) if __name__ == '__main__': main()
def main(): n = int(input()) mod = 10 ** 9 + 7 ans = 0 for i in range(n): ans += ((i + 1) ** 10 - i ** 10) * (n // (i + 1)) ** 10 ans %= mod print(ans) if __name__ == '__main__': main()
Import("env") print("Extra Script (Pre): common_pre.py") # Get build flags values from env def get_build_flag_value(flag_name): build_flags = env.ParseFlags(env['BUILD_FLAGS']) flags_with_value_list = [build_flag for build_flag in build_flags.get('CPPDEFINES') if type(build_flag) == list] defines = {k: v...
import('env') print('Extra Script (Pre): common_pre.py') def get_build_flag_value(flag_name): build_flags = env.ParseFlags(env['BUILD_FLAGS']) flags_with_value_list = [build_flag for build_flag in build_flags.get('CPPDEFINES') if type(build_flag) == list] defines = {k: v for (k, v) in flags_with_value_list...
KONSTANT = "KONSTANT" def funktion(value): print(value) class Klass: def method(self): funktion(KONSTANT) Klass().method()
konstant = 'KONSTANT' def funktion(value): print(value) class Klass: def method(self): funktion(KONSTANT) klass().method()
conf = { 'version': 1, 'disable_existing_loggers': False, 'filters': { 'isAccessLog': { '()': 'utils.CustomLogFilter.AccessLogFilter' }, 'isHuntLog': { '()': 'utils.CustomLogFilter.HuntLogFilter' }, 'isHuntResultLog': { '()': 'utils...
conf = {'version': 1, 'disable_existing_loggers': False, 'filters': {'isAccessLog': {'()': 'utils.CustomLogFilter.AccessLogFilter'}, 'isHuntLog': {'()': 'utils.CustomLogFilter.HuntLogFilter'}, 'isHuntResultLog': {'()': 'utils.CustomLogFilter.HuntResultLogFilter'}}, 'root': {'level': 'DEBUG', 'handlers': ['consoleHandle...
def isPerfectCube(num): ans = 0 while ans**3 < abs(num): ans += 1 if ans**3 != abs(num): print("Not a perfect cube") else: if num < 0: ans = -ans print(ans, "is a cube root of", num) def main(): if __name__ == "__main__": print(isPerfectCube(8), "a...
def is_perfect_cube(num): ans = 0 while ans ** 3 < abs(num): ans += 1 if ans ** 3 != abs(num): print('Not a perfect cube') else: if num < 0: ans = -ans print(ans, 'is a cube root of', num) def main(): if __name__ == '__main__': print(is_perfect_cu...
NORMALIZED_POWERS = { 191: ('1x127', '1.5'), 200: ('1x133', '1.5'), 330: ('1x220', '1.5'), 345: ('1x230', '1.5'), 381: ('1x127', '3'), 399: ('1x133', '3'), 445: ('1x127', '3.5'), 466: ('1x133', '3.5'), 572: ('3x220/127', '1.5'), 598: ('3x230/133', '1.5'), 635: ('1x127', '5'),...
normalized_powers = {191: ('1x127', '1.5'), 200: ('1x133', '1.5'), 330: ('1x220', '1.5'), 345: ('1x230', '1.5'), 381: ('1x127', '3'), 399: ('1x133', '3'), 445: ('1x127', '3.5'), 466: ('1x133', '3.5'), 572: ('3x220/127', '1.5'), 598: ('3x230/133', '1.5'), 635: ('1x127', '5'), 660: ('1x220', '3'), 665: ('1x133', '5'), 69...
dict_camera = {'wfpc1': 1, 'wfpc1_planetary': 2, 'wfpc1_foc_f48': 3, 'wfpc1_foc_f48': 4, 'wfpc2': 5, 'wfpc2_planetary': 6, 'wfpc2_foc_f48': 7, 'wfpc2_foc_f48': 8, 'nicmos1_precryo': 9, 'nicmos2_precryo': 10, 'nicmos3_precryo': 11, 'stis_ccd': 12, 'stis_nuv': 13, 'stis_fuv': 14, 'acs_widefield': 15, 'acs_highres': 16,...
dict_camera = {'wfpc1': 1, 'wfpc1_planetary': 2, 'wfpc1_foc_f48': 3, 'wfpc1_foc_f48': 4, 'wfpc2': 5, 'wfpc2_planetary': 6, 'wfpc2_foc_f48': 7, 'wfpc2_foc_f48': 8, 'nicmos1_precryo': 9, 'nicmos2_precryo': 10, 'nicmos3_precryo': 11, 'stis_ccd': 12, 'stis_nuv': 13, 'stis_fuv': 14, 'acs_widefield': 15, 'acs_highres': 16, '...
def log_error(error): ''' This logging function just print a formated error message ''' print(error)
def log_error(error): """ This logging function just print a formated error message """ print(error)
host = 'Your SMTP server host here' port = 25 # Your SMTP server port here username = 'Your SMTP server username here' password = 'Your SMTP server password here' encryption = 'required' # Your SMTP server security policy here. Must be one of 'required', 'optional', or 'ssl' __all__ = ['host', 'port', 'username', '...
host = 'Your SMTP server host here' port = 25 username = 'Your SMTP server username here' password = 'Your SMTP server password here' encryption = 'required' __all__ = ['host', 'port', 'username', 'password', 'encryption']
class Solution: # @param {string} a a number # @param {string} b a number # @return {string} the result def addBinary(self, a, b): # Write your code here alen, blen = len(a), len(b) if alen > blen: b = '0' * (alen - blen) + b nlen = alen else: ...
class Solution: def add_binary(self, a, b): (alen, blen) = (len(a), len(b)) if alen > blen: b = '0' * (alen - blen) + b nlen = alen else: a = '0' * (blen - alen) + a nlen = blen (res, c) = ('', 0) for i in range(nlen - 1, -1, -...
palettes = { "material_design": { "red_500": 0xF44336, "pink_500": 0xE91E63, "purple_500": 0x9C27B0, "deep_purple_500": 0x673AB7, "indigo_500": 0x3F51B5, "blue_500": 0x2196F3, "light_blue_500": 0x03A9F4, "cyan_500": 0x00BCD4, "teal_500": 0x0096...
palettes = {'material_design': {'red_500': 16007990, 'pink_500': 15277667, 'purple_500': 10233776, 'deep_purple_500': 6765239, 'indigo_500': 4149685, 'blue_500': 2201331, 'light_blue_500': 240116, 'cyan_500': 48340, 'teal_500': 38536, 'green_500': 5025616, 'light_green_500': 9159498, 'lime_500': 13491257, 'yellow_500':...
def main(request, response): try: name = "recon_fail_" + request.GET.first("id") headers = [("Content-Type", "text/event-stream")] cookie = request.cookies.first(name, None) state = cookie.value if cookie is not None else None if state == 'opened': status = (200...
def main(request, response): try: name = 'recon_fail_' + request.GET.first('id') headers = [('Content-Type', 'text/event-stream')] cookie = request.cookies.first(name, None) state = cookie.value if cookie is not None else None if state == 'opened': status = (200, ...
# Python - 3.6.0 paradise = God() test.assert_equals(isinstance(paradise[0], Man), True, 'First object are a man')
paradise = god() test.assert_equals(isinstance(paradise[0], Man), True, 'First object are a man')
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- # pylint:...
def step_create(test, checks=None, cache_num=1): if checks is None: checks = [] if test.kwargs.get('no_database'): test.cmd('az redisenterprise create --cluster-name "{cluster}" --sku "EnterpriseFlash_F300" --tags tag1="value1" --no-database --resource-group "{rg}"', checks=checks) elif test...
#input # 15 # 2 4 3 6 7 9 1 5 8 # 9 3 7 8 6 1 5 2 4 # 1 4 9 5 6 3 2 8 7 # 1 6 8 3 4 2 9 7 5 # 7 4 6 5 1 9 3 8 2 # 8 1 7 5 6 3 9 2 4 # 2 4 3 9 7 8 5 1 6 # 6 3 1 9 2 7 4 5 8 # 1 4 7 6 8 9 5 3 2 # 7 9 1 8 5 6 3 2 4 # 1 3 9 6 8 2 5 7 4 # 8 5 4 6 3 7 2 1 9 # 7 2 4 5 8 1 9 3 6 # 5 2 6 1 8 4 9 3 7 # 4 8 5 3 2 6 1 7 9 class G...
class Game: board = [] def initialize(self): self.board = [] for i in range(0, 3): self.board.append([None, None, None]) def mark(self, pos, p): self.board[pos // 3][pos % 3] = p def is_game_over(self): for i in range(0, 3): if self.board[i][0] ...
load( "//ruby/private/tools:deps.bzl", _transitive_deps = "transitive_deps", ) load( "//ruby/private:providers.bzl", "RubyGem", "RubyLibrary", ) def _get_transitive_srcs(srcs, deps): return depset( srcs, transitive = [dep[RubyLibrary].transitive_ruby_srcs for dep in deps], )...
load('//ruby/private/tools:deps.bzl', _transitive_deps='transitive_deps') load('//ruby/private:providers.bzl', 'RubyGem', 'RubyLibrary') def _get_transitive_srcs(srcs, deps): return depset(srcs, transitive=[dep[RubyLibrary].transitive_ruby_srcs for dep in deps]) def _rb_gem_impl(ctx): gemspec = ctx.actions.de...
def average_price_per_year(dates,prices): year = '' counter = 0 accumulator = 0 average_year_years = [] average_year_prices = [] # for every date in the date list # do the following for index in range(len(dates)): # Set the first year. if year == '': year = da...
def average_price_per_year(dates, prices): year = '' counter = 0 accumulator = 0 average_year_years = [] average_year_prices = [] for index in range(len(dates)): if year == '': year = dates[index][6:10] accumulator += float(prices[index]) counter += 1 ...
# The maximum size of a WebSocket message that can be sent or received # by the Determined agent and trial-runner. The master uses a different limit, # because it uses the uwsgi WebSocket implementation; see # `websocket-max-size` in `uwsgi.ini`. MAX_WEBSOCKET_MSG_SIZE = 128 * 1024 * 1024 # The maximum HTTP request si...
max_websocket_msg_size = 128 * 1024 * 1024 max_http_request_size = 128 * 1024 * 1024 max_encoded_size = min(MAX_WEBSOCKET_MSG_SIZE, MAX_HTTP_REQUEST_SIZE) // 8 * 6 max_context_size = MAX_ENCODED_SIZE - 1 * 1024 * 1024 default_determined_user = 'determined' default_determined_password = '' default_checkpoint_path = 'che...
def avaliarSituacao(media): if media >= 6: print('aprovado') else: print('reprovado') def calcularMedia(p1, p2): media = (p1 + p2) / 2 avaliarSituacao(media) def main(): p1 = float(input('Digite a primeira nota: ')) p2 = float(input('Digite a segunda nota: ')) calcularM...
def avaliar_situacao(media): if media >= 6: print('aprovado') else: print('reprovado') def calcular_media(p1, p2): media = (p1 + p2) / 2 avaliar_situacao(media) def main(): p1 = float(input('Digite a primeira nota: ')) p2 = float(input('Digite a segunda nota: ')) calcular_m...
# i = 4, tallest library building ''' Nearly complete building_coordinations = [[(-0.126585027793863,16.8195412372661), (-1.26360571382314,26.9366491540346), (-15.8471949722061,25.2976587627339), (-14.7101742861769,15.1805508459654)], [(-23.0767794626376,16.8481382394501), (-15.1990122585185,17.6...
""" Nearly complete building_coordinations = [[(-0.126585027793863,16.8195412372661), (-1.26360571382314,26.9366491540346), (-15.8471949722061,25.2976587627339), (-14.7101742861769,15.1805508459654)], [(-23.0767794626376,16.8481382394501), (-15.1990122585185,17.6638842108194), (-16.293620537...