content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
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...
""" @author Wildo Monges Grid was provided as an initial skeleton of the project. Note: This was a project that I did for the course of Artificial Intelligence in Edx.org To run it, just execute GameManager.py """ class BaseAI: def get_move(self, grid): pass
""" @author Wildo Monges Grid was provided as an initial skeleton of the project. Note: This was a project that I did for the course of Artificial Intelligence in Edx.org To run it, just execute GameManager.py """ class Baseai: def get_move(self, grid): pass
""" defined: _exec(cmd, input="", pipe_from_memory=False) : executes a command and returns output _absrelerr(actual, expected, eps=1e-6): check if floating point absrel error is below epsilon tmp_path : temporary file the problem definition may use (e.g. input file for other program) verbose : if verbose mode activat...
""" defined: _exec(cmd, input="", pipe_from_memory=False) : executes a command and returns output _absrelerr(actual, expected, eps=1e-6): check if floating point absrel error is below epsilon tmp_path : temporary file the problem definition may use (e.g. input file for other program) verbose : if verbose mode activat...
""" Define the ChangeEvent class """ class ChangeEvent: """ A class to represents a change in the website """ def __init__(self, did_change=False, whitelisted_words=[], blacklisted_words=[]): """Hold information about the change in a site Args: did_change (bool, optional): Did the...
""" Define the ChangeEvent class """ class Changeevent: """ A class to represents a change in the website """ def __init__(self, did_change=False, whitelisted_words=[], blacklisted_words=[]): """Hold information about the change in a site Args: did_change (bool, optional): Did th...
# -*- coding: utf-8 -*- """ The models in directory default have been added as a pure convenience and for demonstration purpose. Whenever there is a need to use a modified version, copy one of these models into the projects model directory and adopt it to your needs. Otherwise just import the model into your own models...
""" The models in directory default have been added as a pure convenience and for demonstration purpose. Whenever there is a need to use a modified version, copy one of these models into the projects model directory and adopt it to your needs. Otherwise just import the model into your own models.py file without using i...
""" This function is intended to wrap the rewards returned by the CityLearn RL environment, and is meant to be modified by the participants of The CityLearn Challenge. CityLearn returns the energy consumption of each building as a reward. This reward_function takes all the electrical demands of all the buildings and ...
""" This function is intended to wrap the rewards returned by the CityLearn RL environment, and is meant to be modified by the participants of The CityLearn Challenge. CityLearn returns the energy consumption of each building as a reward. This reward_function takes all the electrical demands of all the buildings and ...
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...
####################### # Dennis MUD # # list_users.py # # Copyright 2018-2020 # # Michael D. Reiley # ####################### # ********** # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal i...
name = 'list users' categories = ['users'] aliases = ['who'] usage = 'list users' description = 'List all online users in the world.\n\nIf you are a wizard, you will see a list of all registered users, including offline users.' def command(console, args): if not COMMON.check(NAME, console, args, argc=0): r...
""" Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". click to show clarification. Clarification: What constitutes a word? A sequence of non-space characters constitutes a word. Could the input string contain leading or trailing spaces? Yes. H...
""" Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". click to show clarification. Clarification: What constitutes a word? A sequence of non-space characters constitutes a word. Could the input string contain leading or trailing spaces? Yes. H...
# 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...
# Created by MechAviv # ID :: [4000022] # Maple Road : Adventurer Training Center 1 sm.showFieldEffect("maplemap/enter/1010100", 0)
sm.showFieldEffect('maplemap/enter/1010100', 0)
# simplify_fraction.py def validate_input_simplify(fraction): if type(fraction) is not tuple: raise Exception('Argument can only be of type "tuple".') if len(fraction) != 2: raise Exception('Tuple can only contain 2 elements.') if type(fraction[0]) != int or type(fraction[1]) != int: raise Exception('Tuple ca...
def validate_input_simplify(fraction): if type(fraction) is not tuple: raise exception('Argument can only be of type "tuple".') if len(fraction) != 2: raise exception('Tuple can only contain 2 elements.') if type(fraction[0]) != int or type(fraction[1]) != int: raise exception('Tuple...
items3 = ["Mic", "Phone", 323.12, 3123.123, "Justin", "Bag", "Cliff Bars", 134] def my_sum_and_count(my_num_list): total = 0 count = 0 for i in my_num_list: if isinstance(i, float) or isinstance(i, int): total += i count += 1 return total, count def my_avg(my_num_lis...
items3 = ['Mic', 'Phone', 323.12, 3123.123, 'Justin', 'Bag', 'Cliff Bars', 134] def my_sum_and_count(my_num_list): total = 0 count = 0 for i in my_num_list: if isinstance(i, float) or isinstance(i, int): total += i count += 1 return (total, count) def my_avg(my_num_list...
# coding: utf-8 PI = [58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7]...
pi = [58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7] cp_1 = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2...
"""D.""" def fun(a, b, name): print(a, b , name) x = (1, 2) fun(*x, 'fuck') print(F)
"""D.""" def fun(a, b, name): print(a, b, name) x = (1, 2) fun(*x, 'fuck') print(F)
"""Errors specific to this library""" class ScreenConnectError(Exception): """ Base class for ScreenConnect errors """ @property def message(self): """ Returns provided message to construct error """ return self.args[0]
"""Errors specific to this library""" class Screenconnecterror(Exception): """ Base class for ScreenConnect errors """ @property def message(self): """ Returns provided message to construct error """ return self.args[0]
# -*- coding: utf-8 -*- """ pagarmeapisdk This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). """ class CreateBankAccountRequest(object): """Implementation of the 'CreateBankAccountRequest' model. Request for creating a bank account Attributes: ...
""" pagarmeapisdk This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). """ class Createbankaccountrequest(object): """Implementation of the 'CreateBankAccountRequest' model. Request for creating a bank account Attributes: holder_name (string): Bank account holder ...
"""Python implementations of built-in fprime types This package provides the modules necessary for the representation of fprime types (Fw/Types) package in a Python context. These standard types are represented as Python classes representing each individual type. Example: U32 is represented by fprime.common.modul...
"""Python implementations of built-in fprime types This package provides the modules necessary for the representation of fprime types (Fw/Types) package in a Python context. These standard types are represented as Python classes representing each individual type. Example: U32 is represented by fprime.common.modul...
# Instructions: The following code example would print the data type of x, what data type would that be? x = 20.5 print(type(x)) ''' Solution: float The inexact numbers are float type. Read more here: https://www.w3schools.com/python/python_datatypes.asp '''
x = 20.5 print(type(x)) '\nSolution: \nfloat\nThe inexact numbers are float type. Read more here: https://www.w3schools.com/python/python_datatypes.asp\n'
def print_sth(s): print('print from module2: {}'.format(s)) if __name__ == "__main__": s = 'test in main' print_sth(s)
def print_sth(s): print('print from module2: {}'.format(s)) if __name__ == '__main__': s = 'test in main' print_sth(s)
# # PySNMP MIB module FC-MGMT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/FC-MGMT-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:05:00 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, 0...
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_size_constraint, single_value_constraint, value_range_constraint, constraints_intersection) ...
EXPOSED_CRED_POLICY = 'AWSExposedCredentialPolicy_DO_NOT_REMOVE' def rule(event): request_params = event.get('requestParameters', {}) if request_params: return (event['eventName'] == 'PutUserPolicy' and request_params.get('policyName') == EXPOSED_CRED_POLICY) return False def ded...
exposed_cred_policy = 'AWSExposedCredentialPolicy_DO_NOT_REMOVE' def rule(event): request_params = event.get('requestParameters', {}) if request_params: return event['eventName'] == 'PutUserPolicy' and request_params.get('policyName') == EXPOSED_CRED_POLICY return False def dedup(event): retur...
"""462. Total Occurrence of Target """ class Solution: """ @param A: A an integer array sorted in ascending order @param target: An integer @return: An integer """ def totalOccurrence(self, A, target): # write your code here ### Practice: if not A: return 0 ...
"""462. Total Occurrence of Target """ class Solution: """ @param A: A an integer array sorted in ascending order @param target: An integer @return: An integer """ def total_occurrence(self, A, target): if not A: return 0 index = self.binarySearch(A, target) ...
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def levelOrderBottom(self, root: Optional[TreeNode]) -> List[List[int]]: result = [] depth =...
class Solution: def level_order_bottom(self, root: Optional[TreeNode]) -> List[List[int]]: result = [] depth = -1 def backtrack(root, curr): nonlocal depth if not root: return if curr > depth: result.append([]) ...
""" LJM library error codes. """ # Success NOERROR = 0 # Warnings: WARNINGS_BEGIN = 200 WARNINGS_END = 399 FRAMES_OMITTED_DUE_TO_PACKET_SIZE = 201 DEBUG_LOG_FAILURE = 202 USING_DEFAULT_CALIBRATION = 203 DEBUG_LOG_FILE_NOT_OPEN = 204 # Modbus Errors: MODBUS_ERRORS_BEGIN = 1200 MODBUS_ERRORS_END...
""" LJM library error codes. """ noerror = 0 warnings_begin = 200 warnings_end = 399 frames_omitted_due_to_packet_size = 201 debug_log_failure = 202 using_default_calibration = 203 debug_log_file_not_open = 204 modbus_errors_begin = 1200 modbus_errors_end = 1216 mbe1_illegal_function = 1201 mbe2_illegal_data_address =...
# # Copyright (C) 2019 Red Hat, Inc. # # 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 ofthe License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
class Packetinjection(object): """ Definition of a Skydive packet injection. """ def __init__(self, uuid='', src='', dst='', srcip='', dstip='', srcmac='', dstmac='', srcport=0, dstport=0, type='icmp4', payload='', trackingid='', icmpid=0, count=1, interval=0, mode='unique', starttime='', ttl=64): ...
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: # @param {TreeNode} root # @return {string[]} def binaryTreePaths(self, root): if not root: return [] ...
class Solution: def binary_tree_paths(self, root): if not root: return [] if not root.left and (not root.right): return [str(root.val)] return map(lambda x: str(root.val) + '->' + x, self.binaryTreePaths(root.left)) + map(lambda x: str(root.val) + '->' + x, self.bina...
def inc(x): return x + 1 def dec(x): return x - 1 def floor(par): x = 0 y = 1 for i in par: x = inc(x) if i == "(" else dec(x) if x == -1: return y y += 1 return x print(floor( "((((()(()(((((((()))(((()((((()())(())()(((()((((((()((()(()(((()(()((()...
def inc(x): return x + 1 def dec(x): return x - 1 def floor(par): x = 0 y = 1 for i in par: x = inc(x) if i == '(' else dec(x) if x == -1: return y y += 1 return x print(floor('((((()(()(((((((()))(((()((((()())(())()(((()((((((()((()(()(((()(()((())))()((()...
""" https://www.hackerrank.com/challenges/no-idea There is an array of integers. There are also disjoint sets, and , each containing integers. You like all the integers in set and dislike all the integers in set . Your initial happiness is . For each integer in the array, if , you add to your happiness. If , yo...
""" https://www.hackerrank.com/challenges/no-idea There is an array of integers. There are also disjoint sets, and , each containing integers. You like all the integers in set and dislike all the integers in set . Your initial happiness is . For each integer in the array, if , you add to your happiness. If , yo...
#!/usr/bin/env python # -*- coding: utf-8 -*- def get_input(path): with open(path) as infile: return [line.rstrip('\n') for line in infile]
def get_input(path): with open(path) as infile: return [line.rstrip('\n') for line in infile]
# # PySNMP MIB module JUNIPER-SMI (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/JUNIPER-SMI # Produced by pysmi-0.3.4 at Wed May 1 11:37:53 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, 0...
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, value_size_constraint, constraints_union, constraints_intersection, single_value_constraint) ...
class TcpUtils: """ Stores constants related to TCP protocol and utility methods """ TCP_HEADER_LENGTH = 5 TCP_HEADER_LENGTH_BYTES = TCP_HEADER_LENGTH * 4 TCP_OPTIONS_MAX_LENGTH_BYTES = 40 @staticmethod def validate_options_length(options): length = len(options) if leng...
class Tcputils: """ Stores constants related to TCP protocol and utility methods """ tcp_header_length = 5 tcp_header_length_bytes = TCP_HEADER_LENGTH * 4 tcp_options_max_length_bytes = 40 @staticmethod def validate_options_length(options): length = len(options) if lengt...
# -*- coding: utf-8 -*- """ Created on Tue May 19 13:26:07 2020 @author: admin """ #Fibonacci last digit n=int(input()) n1=0 n2=1 for i in range(2,n+1): nex=n1+n2 n1=n2 n2=nex print(nex%10)
""" Created on Tue May 19 13:26:07 2020 @author: admin """ n = int(input()) n1 = 0 n2 = 1 for i in range(2, n + 1): nex = n1 + n2 n1 = n2 n2 = nex print(nex % 10)
""" This test makes sure that the implicit rule dependencies are discoverable by an IDE. We stuff all dependencies into _scala_toolchain so we just need to make sure the targets we expect are there. """ attr_aspects = ["_scala_toolchain", "deps"] def _aspect_impl(target, ctx): visited = [str(target.label)] for...
""" This test makes sure that the implicit rule dependencies are discoverable by an IDE. We stuff all dependencies into _scala_toolchain so we just need to make sure the targets we expect are there. """ attr_aspects = ['_scala_toolchain', 'deps'] def _aspect_impl(target, ctx): visited = [str(target.label)] for...
# Hexadecimal print(hex(12)) print(hex(512)) # Binary print(bin(128)) print(bin(512)) # Exponential print(pow(2, 4)) print(pow(2, 4, 3)) # Absolute value print(abs(2)) # Round print(round(3.6)) # Round up print(round(3.4)) # Round down print(round(3.4, 2)) # Round down
print(hex(12)) print(hex(512)) print(bin(128)) print(bin(512)) print(pow(2, 4)) print(pow(2, 4, 3)) print(abs(2)) print(round(3.6)) print(round(3.4)) print(round(3.4, 2))
def update_matches(matches, nubank_month_data, mobills_month_data): """ Changes done in place. NuBank and Mobills expenses with match will be removed from original object. """ # Filter matches to only items that still exist matches_cleaned = [] for match in matches: [nubank_ids, mobill...
def update_matches(matches, nubank_month_data, mobills_month_data): """ Changes done in place. NuBank and Mobills expenses with match will be removed from original object. """ matches_cleaned = [] for match in matches: [nubank_ids, mobills_ids] = (match['nubank'], match['mobills']) n...
def nonConstructibleChange(coins): if len(coins) == 0: return 1 coins.sort() change = 0 for coin in coins: if coin > change + 1: return change + 1 change += coin return change + 1
def non_constructible_change(coins): if len(coins) == 0: return 1 coins.sort() change = 0 for coin in coins: if coin > change + 1: return change + 1 change += coin return change + 1
# -*- coding: utf-8 -*- """The-lost-planet.py: A text-based interactive game.""" __author__ = "Razique Mahroua" __copyright__ = "Copyright 20459, Planet GC-1450" class ParseError(Exception): pass class Sentence(object): def __init__(self, subject, verb, object): self.subject = subject[1] se...
"""The-lost-planet.py: A text-based interactive game.""" __author__ = 'Razique Mahroua' __copyright__ = 'Copyright 20459, Planet GC-1450' class Parseerror(Exception): pass class Sentence(object): def __init__(self, subject, verb, object): self.subject = subject[1] self.verb = verb[1] ...
for i in range(int(input())): n = int(input()) a = [] for j in range(n): l,r = [int(k) for k in input().split()] a.append((l,0)) a.append((r,1)) a.sort() c = 0 f = 0 m = 1e5 for j in a: if(j[1]): f=1 c-=1 else: i...
for i in range(int(input())): n = int(input()) a = [] for j in range(n): (l, r) = [int(k) for k in input().split()] a.append((l, 0)) a.append((r, 1)) a.sort() c = 0 f = 0 m = 100000.0 for j in a: if j[1]: f = 1 c -= 1 else: ...
class MyData: def __del__(self): print('test __del__ OK') data = MyData()
class Mydata: def __del__(self): print('test __del__ OK') data = my_data()
def validate_dog_age(letter): """this function takes a letter as age and returns a tuple or range of ages""" if "b" or "y" or "a" or "s" in letter: return (1, 97) elif "b" or "y" in letter: return (1, 26) elif "a" or "s" in letter: return (25, 97) elif 'b' in letter: ...
def validate_dog_age(letter): """this function takes a letter as age and returns a tuple or range of ages""" if 'b' or 'y' or 'a' or ('s' in letter): return (1, 97) elif 'b' or 'y' in letter: return (1, 26) elif 'a' or 's' in letter: return (25, 97) elif 'b' in letter: ...
map_sokoban = { "x" : 5, "y" : 5 } player = { "x" : 0, "y" : 4 } boxes = [ {"x" : 1, "y" : 1}, {"x" : 2, "y" : 2}, {"x" : 3, "y" : 3} ] destinations = [ {"x" : 2, "y" : 1}, {"x" : 3, "y" : 2}, {"x" : 4, "y" : 3} ] while True: for y in range(map_sokoban["y"]): for x...
map_sokoban = {'x': 5, 'y': 5} player = {'x': 0, 'y': 4} boxes = [{'x': 1, 'y': 1}, {'x': 2, 'y': 2}, {'x': 3, 'y': 3}] destinations = [{'x': 2, 'y': 1}, {'x': 3, 'y': 2}, {'x': 4, 'y': 3}] while True: for y in range(map_sokoban['y']): for x in range(map_sokoban['x']): box_is_here = False ...
input = """ edge(a,b,1). edge(a,c,3). edge(c,b,2). edge(b,d,3). edge(b,c,1). edge(c,d,3). town(T) :- edge(T,_,_). town(T) :- edge(_,T,_). """ output = """ edge(a,b,1). edge(a,c,3). edge(c,b,2). edge(b,d,3). edge(b,c,1). edge(c,d,3). town(T) :- edge(T,_,_). town(T) :- edge(_,T,_). """
input = '\nedge(a,b,1).\nedge(a,c,3).\nedge(c,b,2).\nedge(b,d,3).\nedge(b,c,1).\nedge(c,d,3).\n\ntown(T) :- edge(T,_,_).\ntown(T) :- edge(_,T,_).\n' output = '\nedge(a,b,1).\nedge(a,c,3).\nedge(c,b,2).\nedge(b,d,3).\nedge(b,c,1).\nedge(c,d,3).\n\ntown(T) :- edge(T,_,_).\ntown(T) :- edge(_,T,_).\n'
class Queue: def __init__(self): self.queue = [] def enqueue(self, item): self.queue.insert(0, item) def dequeue(self): return self.queue.pop() def size(self): return len(self.queue) def is_empty(self): return self.queue == []
class Queue: def __init__(self): self.queue = [] def enqueue(self, item): self.queue.insert(0, item) def dequeue(self): return self.queue.pop() def size(self): return len(self.queue) def is_empty(self): return self.queue == []
class Solution: def addToArrayForm(self, A, K): for i in range(len(A))[::-1]: A[i], K = (A[i] + K) % 10, (A[i] + K) // 10 return [int(i) for i in str(K)] + A if K else A
class Solution: def add_to_array_form(self, A, K): for i in range(len(A))[::-1]: (A[i], k) = ((A[i] + K) % 10, (A[i] + K) // 10) return [int(i) for i in str(K)] + A if K else A
# use a func to create the matrix def create_matrix(rows): result = [] for _ in range(rows): result.append(list(int(el) for el in input().split())) return result #read input rows, columns = [int(el) for el in input().split()] matrix = create_matrix(rows) max_sum_square = -9999999999999 #create fo...
def create_matrix(rows): result = [] for _ in range(rows): result.append(list((int(el) for el in input().split()))) return result (rows, columns) = [int(el) for el in input().split()] matrix = create_matrix(rows) max_sum_square = -9999999999999 for r in range(rows - 2): for c in range(columns - ...
def gnome_sort(a): i, j, size = 1, 2, len(a) while i < size: if a[i-1] <= a[i]: i, j = j, j+1 else: a[i-1], a[i] = a[i], a[i-1] i -= 1 if i == 0: i, j = j, j+1 return a
def gnome_sort(a): (i, j, size) = (1, 2, len(a)) while i < size: if a[i - 1] <= a[i]: (i, j) = (j, j + 1) else: (a[i - 1], a[i]) = (a[i], a[i - 1]) i -= 1 if i == 0: (i, j) = (j, j + 1) return a
# iteracyjne obliczanie silni def silnia(n): s = 1 for i in range(2,n+1): s = s*i return s silnia(20)
def silnia(n): s = 1 for i in range(2, n + 1): s = s * i return s silnia(20)
class Solution(object): def isPalindrome(self, x): """ :type x: int :rtype: bool """ if x == 0: return True if x < 0 or x % 10 == 0: return False l = len(str(x)) i = 1 x1 = x2 = x while i <= l / 2: le...
class Solution(object): def is_palindrome(self, x): """ :type x: int :rtype: bool """ if x == 0: return True if x < 0 or x % 10 == 0: return False l = len(str(x)) i = 1 x1 = x2 = x while i <= l / 2: ...
def is_primel_4(n): if n == 2: return True # 2 is prime if n % 2 == 0: print(n, "is divisible by 2") return False # all even numbers except 2 are not prime if n < 2: return False # numbers less then 2 are not prime prime = True m = n // 2 + 1 for x in range(3, ...
def is_primel_4(n): if n == 2: return True if n % 2 == 0: print(n, 'is divisible by 2') return False if n < 2: return False prime = True m = n // 2 + 1 for x in range(3, m, 2): if n % x == 0: print(n, 'is divisible by', x) prime = F...
# # PySNMP MIB module NETSCREEN-RESOURCE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NETSCREEN-RESOURCE-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:20:16 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (d...
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_intersection, constraints_union, single_value_constraint, value_range_constraint) ...
class OrderDetail(object): def __init__(self, pro_id, pro_count, storage_detail, half_storage_detail): self.pro_id = pro_id self.pro_count = pro_count self.storage_count = storage_detail.get(pro_id=self.pro_id).pro_count self.half_storage_count = half_storage_detail.get(half_id=self...
class Orderdetail(object): def __init__(self, pro_id, pro_count, storage_detail, half_storage_detail): self.pro_id = pro_id self.pro_count = pro_count self.storage_count = storage_detail.get(pro_id=self.pro_id).pro_count self.half_storage_count = half_storage_detail.get(half_id=self...
x = [1,2,3,1] print(type(x)) print(dir(x)) print('count:',x.count(1)) # 2, number of times the input occurs print('index:',x.index(1)) # returns location of input (first occurance) print(x,' : x') try: x[0] = 1.2 # lists are mutable except(TypeError) as e: print(e) print(x,' : x[0]= 1.2') x.append(7) print(x,' ...
x = [1, 2, 3, 1] print(type(x)) print(dir(x)) print('count:', x.count(1)) print('index:', x.index(1)) print(x, ' : x') try: x[0] = 1.2 except TypeError as e: print(e) print(x, ' : x[0]= 1.2') x.append(7) print(x, ' : x.append(7) - on end') x.extend([2, 3]) print(x, ' : x.extend([2,3]) - on end') x.insert(3, 10)...
def solveQuestion(inputPath): fileP = open(inputPath, 'r') fileLines = fileP.readlines() fileP.close() instructions = {} toChangeInstructions = [] counter = 0 for valueLine in fileLines: [instruction, value] = valueLine.strip('\n').split(' ') instructions[counter] =...
def solve_question(inputPath): file_p = open(inputPath, 'r') file_lines = fileP.readlines() fileP.close() instructions = {} to_change_instructions = [] counter = 0 for value_line in fileLines: [instruction, value] = valueLine.strip('\n').split(' ') instructions[counter] = [in...
# Definition for singly-linked list. #class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def oddEvenList(self, head): """ :type head: ListNode :rtype: ListNode """ if head is None: return he...
class Solution(object): def odd_even_list(self, head): """ :type head: ListNode :rtype: ListNode """ if head is None: return head if head.next is None: return head (odd, even_head) = (head, head.next) even = even_head c...
class EWMA: """ Exponentially weighted moving average """ def __init__(self, momentum=0.98): # set params self._running_val = None self._momentum = momentum def update(self, new_val): # update running val if self._running_val is not None: self._ru...
class Ewma: """ Exponentially weighted moving average """ def __init__(self, momentum=0.98): self._running_val = None self._momentum = momentum def update(self, new_val): if self._running_val is not None: self._running_val = self._momentum * self._running_val + ...
""" To understand what's going on: 1. The Merge Sort Recursively breaks down a list of size N to left and right, each of size N/2; 2. The new sliced lists are fed to cmp_sort that rearranges the fed total list of size N with index to be sorted in the original list. Since, Original list is Mutable - This Original list c...
""" To understand what's going on: 1. The Merge Sort Recursively breaks down a list of size N to left and right, each of size N/2; 2. The new sliced lists are fed to cmp_sort that rearranges the fed total list of size N with index to be sorted in the original list. Since, Original list is Mutable - This Original list c...
ERROR_API_VERSION_NOT_FOUND = ("API version found in neither request path (/api/v#) nor 'Accept' " 'header (version=#)') ERROR_API_VERSION_UNSUPPORTED = 'Unsupported API version' ERROR_EMPTY_REQUEST_BODY = 'Empty request body - valid JSON required' ERROR_ONLY_JSON_REQUESTS = 'WandAPI on...
error_api_version_not_found = "API version found in neither request path (/api/v#) nor 'Accept' header (version=#)" error_api_version_unsupported = 'Unsupported API version' error_empty_request_body = 'Empty request body - valid JSON required' error_only_json_requests = 'WandAPI only supports JSON encoded requests' err...
# Code generated by font_to_py.py. # Font: Ubuntu-R.ttf # Cmd: font_to_py.py /usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf 16 -x ubuntu16.py version = '0.33' def height(): return 16 def baseline(): return 13 def max_width(): return 15 def hmap(): return True def reverse(): return False def mon...
version = '0.33' def height(): return 16 def baseline(): return 13 def max_width(): return 15 def hmap(): return True def reverse(): return False def monospaced(): return False def min_ch(): return 32 def max_ch(): return 126 _font = b'\x06\x00\x00\x008D\x04\x04\x18 \x00\x00 \x...
MERCADO_ABERTO = 1 MERCADO_FECHADO = 2 CAMPEONATO = 'campeonato' TURNO = 'turno' MES = 'mes' RODADA = 'rodada' PATRIMONIO = 'patrimonio'
mercado_aberto = 1 mercado_fechado = 2 campeonato = 'campeonato' turno = 'turno' mes = 'mes' rodada = 'rodada' patrimonio = 'patrimonio'
firstname = input("Enter first person name:") secondname = input("Enter second person name:") name = firstname + secondname name = name.replace(" ","") #print(name) list = [] for x in name: count = name.count(x) if count > 0: list.append(count) name = name.replace(x,"").strip() #print(list) d...
firstname = input('Enter first person name:') secondname = input('Enter second person name:') name = firstname + secondname name = name.replace(' ', '') list = [] for x in name: count = name.count(x) if count > 0: list.append(count) name = name.replace(x, '').strip() def addnums(list): newl...
DEPOSIT = "deposit" DEPOSIT_STABLE = "deposit_stable" MINT = "mint" SEND = "send"
deposit = 'deposit' deposit_stable = 'deposit_stable' mint = 'mint' send = 'send'
data = ( 'ke', # 0x00 'keg', # 0x01 'kegg', # 0x02 'kegs', # 0x03 'ken', # 0x04 'kenj', # 0x05 'kenh', # 0x06 'ked', # 0x07 'kel', # 0x08 'kelg', # 0x09 'kelm', # 0x0a 'kelb', # 0x0b 'kels', # 0x0c 'kelt', # 0x0d 'kelp', # 0x0e 'kelh', # 0x0f 'kem', # 0x10 'keb', # ...
data = ('ke', 'keg', 'kegg', 'kegs', 'ken', 'kenj', 'kenh', 'ked', 'kel', 'kelg', 'kelm', 'kelb', 'kels', 'kelt', 'kelp', 'kelh', 'kem', 'keb', 'kebs', 'kes', 'kess', 'keng', 'kej', 'kec', 'kek', 'ket', 'kep', 'keh', 'kyeo', 'kyeog', 'kyeogg', 'kyeogs', 'kyeon', 'kyeonj', 'kyeonh', 'kyeod', 'kyeol', 'kyeolg', 'kyeolm',...
Scale.default = Scale.chromatic Root.default = 0 Clock.bpm = 80 print(Scale.names()) print(SynthDefs) print(Samples) print(FxList) print(Attributes) print(PatternMethods) print(Clock.playing) var.ch = var([7,0,5,0,3],[4,4,4,4,8]) ~p1 >> play('x..t', room=1) ~p2 >> play('f', dur=PDur(3,16)*2, room=1) ~p3 >> play('<V>...
Scale.default = Scale.chromatic Root.default = 0 Clock.bpm = 80 print(Scale.names()) print(SynthDefs) print(Samples) print(FxList) print(Attributes) print(PatternMethods) print(Clock.playing) var.ch = var([7, 0, 5, 0, 3], [4, 4, 4, 4, 8]) ~p1 >> play('x..t', room=1) ~p2 >> play('f', dur=p_dur(3, 16) * 2, room=1) ~p3 >>...
hnefatafl = """50022222005 00000200000 00000000000 20000100002 20001110002 22011711022 20001110002 20000100002 00000000000 00000200000 50022222005""" brandubh = """5002005 0002000 0001000 2217122 0001000 0002000 5002005""" hnefatafl_args = (hnefatafl, False) brandubh_args = (brandubh, True)
hnefatafl = '50022222005\n00000200000\n00000000000\n20000100002\n20001110002\n22011711022\n20001110002\n20000100002\n00000000000\n00000200000\n50022222005' brandubh = '5002005\n0002000\n0001000\n2217122\n0001000\n0002000\n5002005' hnefatafl_args = (hnefatafl, False) brandubh_args = (brandubh, True)
#!/usr/bin/env python # -*- coding: utf-8 -*- class Process: """ this class is representing the process""" def __init__(self, idt, arr, exc): self.idt = idt self.arr = arr self.arr_aux = arr self.exc = exc self.prt = -1 self.start_exc = -1 def idt(self): return self.idt def arr(self): return self....
class Process: """ this class is representing the process""" def __init__(self, idt, arr, exc): self.idt = idt self.arr = arr self.arr_aux = arr self.exc = exc self.prt = -1 self.start_exc = -1 def idt(self): return self.idt def arr(self): ...
""" Moved to seperate py2pydantic package """ raise DeprecationWarning("Moved to front.py2pydantic")
""" Moved to seperate py2pydantic package """ raise deprecation_warning('Moved to front.py2pydantic')
# # PySNMP MIB module CPQHSV-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CPQHSV-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:27:33 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:...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_range_constraint, constraints_union, constraints_intersection, value_size_constraint) ...
# Python Program To Create Emp Class # And Make All The Members Of The Emp Class Available To Another Class ie. Myclass ''' Function Name : This Class Contain Employee Details. Function Date : 17 Sep 2020 Function Author : Prasad Dangare Input : String,Integer Output : String,...
""" Function Name : This Class Contain Employee Details. Function Date : 17 Sep 2020 Function Author : Prasad Dangare Input : String,Integer Output : String,Integer """ class Emp: def __init__(self, id, name, salary): self.id = id self.name = name self.sala...
pi = 3.1456 def funcao1(a, b): return a + b
pi = 3.1456 def funcao1(a, b): return a + b
# -*- coding: utf-8 -*- class Solution(object): def moveZeroes(self, nums): """ :type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead. """ pos = 0 for i in range(len(nums)): if nums[i]: nums[i], nums[pos]...
class Solution(object): def move_zeroes(self, nums): """ :type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead. """ pos = 0 for i in range(len(nums)): if nums[i]: (nums[i], nums[pos]) = (nums[pos], nums[i]...
# 2. Sum Matrix Columns # Write a program that reads a matrix from the console and prints the sum for each column on separate lines. # On the first line, you will get matrix sizes in format "{rows}, {columns}". # On the next rows, you will get elements for each column separated with a single space. # rows, cols = [int...
(rows, cols) = [int(el) for el in input().split(', ')] matrix = [] for row in range(rows): matrix.append([int(el) for el in input().split()]) for col in range(cols): sum_col = 0 for row in range(rows): sum_col += matrix[row][col] print(sum_col)
__all__ = ( "TagScriptError", "WorkloadExceededError", "ProcessError", "EmbedParseError", "BadColourArgument", ) class TagScriptError(Exception): """Base class for all module errors.""" class WorkloadExceededError(TagScriptError): """Raised when the interpreter goes over its passed charac...
__all__ = ('TagScriptError', 'WorkloadExceededError', 'ProcessError', 'EmbedParseError', 'BadColourArgument') class Tagscripterror(Exception): """Base class for all module errors.""" class Workloadexceedederror(TagScriptError): """Raised when the interpreter goes over its passed character limit.""" class Pro...
class RawSecurityDescriptor(GenericSecurityDescriptor): """ Represents a security descriptor. A security descriptor includes an owner,a primary group,a Discretionary Access Control List (DACL),and a System Access Control List (SACL). RawSecurityDescriptor(flags: ControlFlags,owner: SecurityIdentifier,gr...
class Rawsecuritydescriptor(GenericSecurityDescriptor): """ Represents a security descriptor. A security descriptor includes an owner,a primary group,a Discretionary Access Control List (DACL),and a System Access Control List (SACL). RawSecurityDescriptor(flags: ControlFlags,owner: SecurityIdentifier,group: S...
##Patterns: E0100 class Test(): ##Err: E0100 def __init__(self): for i in (1, 2, 3): yield i * i
class Test: def __init__(self): for i in (1, 2, 3): yield (i * i)
class ChromaprintNotFoundException(Exception): pass class FingerprintGenerationError(Exception): pass class WebServiceError(Exception): pass class FileNotIdentifiedException(Exception): pass
class Chromaprintnotfoundexception(Exception): pass class Fingerprintgenerationerror(Exception): pass class Webserviceerror(Exception): pass class Filenotidentifiedexception(Exception): pass
class Sample(): # class object attribute # same for any instant of a class species = 'mammal' def __init__(self, my_breed, name, spots): # attributes # we take in the argument # Assign it using self.attribute_name self.breed = my_breed self.name = name #...
class Sample: species = 'mammal' def __init__(self, my_breed, name, spots): self.breed = my_breed self.name = name self.spots = spots def bark(self, number): print('Woof! My name is {} and number is {}'.format(self.name, number)) my_dog = sample(my_breed='Lab', name='Sammy'...
# 23049 - WH 4th job advancement BELLE = 2159111 GELIMERS_KEY_CARD = 4032743 SECRET_PLAZA = 310010000 sm.setSpeakerID(BELLE) sm.sendNext("Did you destroy the Black Wings' new weapon? Nice work. I'm proud to have you in the Resistance.") if sm.sendAskYesNo("But it's too early to celebrate. #p2154009# will show up with...
belle = 2159111 gelimers_key_card = 4032743 secret_plaza = 310010000 sm.setSpeakerID(BELLE) sm.sendNext("Did you destroy the Black Wings' new weapon? Nice work. I'm proud to have you in the Resistance.") if sm.sendAskYesNo("But it's too early to celebrate. #p2154009# will show up with his goons when he hears the news. ...
# ---------------------------------------------------------------------------- # CLASSES: nightly # # Test Case: bov.py # # Tests: mesh - 3D rectilinear, multiple domain # plots - Pseudocolor, Subset, Label, Contour # operators - Slice # # Programmer: Brad Whitlock # Date: ...
def save_test_image(name): backup = get_save_window_attributes() swa = save_window_attributes() swa.width = 500 swa.height = 500 swa.screenCapture = 0 test(name, swa) set_save_window_attributes(backup) def test_bov_divide(prefix, db, doSubset): open_database(db) if doSubset: ...
def record(data, source, target="_use_source_"): if source in data: # get source var value: source_var_value = data[source] # get target var name: if target == "_use_source_": target = source # record variable: _ttp_["vars"].update({target: source_var_valu...
def record(data, source, target='_use_source_'): if source in data: source_var_value = data[source] if target == '_use_source_': target = source _ttp_['vars'].update({target: source_var_value}) _ttp_['global_vars'].update({target: source_var_value}) return (data, None...
def print_formatted(number): align = len(bin(number)[2:]) for num in range(1, number + 1): n_dec = str(num) n_oct = oct(num)[2:] n_hex = hex(num)[2:].upper() n_bin = bin(num)[2:] print(n_dec.rjust(align), n_oct.rjust(align), n_hex.rjust(align), n_bin.rjust(align))
def print_formatted(number): align = len(bin(number)[2:]) for num in range(1, number + 1): n_dec = str(num) n_oct = oct(num)[2:] n_hex = hex(num)[2:].upper() n_bin = bin(num)[2:] print(n_dec.rjust(align), n_oct.rjust(align), n_hex.rjust(align), n_bin.rjust(align))
#T# the following code shows how to do an algebraic determination that a quadrilateral is a parallelogram #T# create the points of the quadrilateral A = (0, 0) B = (5, 0) C = (8, 2.4) D = (3, 2.4) #T# calculate the slopes of the four sides m_AB = (B[1] - A[1])/(B[0] - A[0]) # 0.0 m_BC = (C[1] - B[1])/(C[0] - B[0]) # ...
a = (0, 0) b = (5, 0) c = (8, 2.4) d = (3, 2.4) m_ab = (B[1] - A[1]) / (B[0] - A[0]) m_bc = (C[1] - B[1]) / (C[0] - B[0]) m_cd = (D[1] - C[1]) / (D[0] - C[0]) m_da = (A[1] - D[1]) / (A[0] - D[0]) bool_ab_cd = m_AB == m_CD bool_bc_da = m_BC == m_DA
EXPECTED_CREATE_REQUEST = { 'ServiceDeskPlus(val.ID===obj.ID)': { 'Request': { 'Subject': 'Create request test', 'Mode': { 'name': 'E-Mail', 'id': '123640000000006665' }, 'IsRead': False, 'CancellationRequested': Fal...
expected_create_request = {'ServiceDeskPlus(val.ID===obj.ID)': {'Request': {'Subject': 'Create request test', 'Mode': {'name': 'E-Mail', 'id': '123640000000006665'}, 'IsRead': False, 'CancellationRequested': False, 'IsTrashed': False, 'Id': '123456789', 'Group': {'site': None, 'deleted': False, 'name': 'Network', 'id':...
# Declaracion de constantes. PESO_HOT_WHEELS_REMOLQUE_TIBURON = 300 PESO_FUNKO_FELPA = 390 PRECIO_BARRA_PAN = 8.90 DESCUENTO_PAN_VIEJO = 0.20
peso_hot_wheels_remolque_tiburon = 300 peso_funko_felpa = 390 precio_barra_pan = 8.9 descuento_pan_viejo = 0.2
# From https://github.com/RLBot/RLBot/blob/master/src/main/python/rlbot/version.py # Store the version here so: # 1) we don't load dependencies by storing it in __init__.py # 2) we can import it in setup.py for the same reason # 3) we can import it into your module module # https://stackoverflow.com/questions/458550/st...
__version__ = '1.0.3' release_notes = {'1.0.3': '\n - Updated to include all utils from RLGym\n ', '1.0.2': '\n - Fixed car_id\n ', '1.0.1': '\n - Fixed on_ground bug\n ', '1.0.0': '\n Initial Release\n - Tested with RLGym 0.4.1\n '} def get_current_release_notes(): if __version__ in rel...
# Copyright 2010-2018, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and ...
{'variables': {'relative_dir': 'renderer', 'gen_out_dir': '<(SHARED_INTERMEDIATE_DIR)/<(relative_dir)', 'conditions': [['branding=="GoogleJapaneseInput"', {'renderer_product_name_win': 'GoogleIMEJaRenderer'}, {'renderer_product_name_win': 'mozc_renderer'}]]}, 'targets': [{'target_name': 'table_layout', 'type': 'static_...
class EventHook(object): def __init__(self): self.__handlers = [] def __iadd__(self, handler): self.__handlers.append(handler) return self def __isub__(self, handler): self.__handlers.remove(handler) return self def fire(self, *args, **keywargs): for h...
class Eventhook(object): def __init__(self): self.__handlers = [] def __iadd__(self, handler): self.__handlers.append(handler) return self def __isub__(self, handler): self.__handlers.remove(handler) return self def fire(self, *args, **keywargs): for h...
# lec10prob2.py # In lecture, we saw a version of linear search that used the fact that a set # of elements is sorted in increasing order. Here is the code from lecture: def search(L, e): for i in range(len(L)): if L[i] == e: return True if L[i] > e: return False return...
def search(L, e): for i in range(len(L)): if L[i] == e: return True if L[i] > e: return False return False def search1(L, e): for i in L: if i == e: return True if i > e: return False return False print(search([2, 5, 7, 10,...
TEMPLATES_LOADED = "app.templates.loaded" EXAMS_LOADED = "app.exams.loaded" TEMPLATE_DIALOG_PATH_KEY = "template.dialog.path" REPORT_DIALOG_PATH_KEY = "report.dialog.path" EXAM_DIALOG_PATH_KEY = "exam.dialog.path" PROCEED_TEMPLATE_DIALOG_PATH_KEY = "exam.proceed.dialog.path" TEMPLATE_IMAGE_ZOOM = "template.image.zoom" ...
templates_loaded = 'app.templates.loaded' exams_loaded = 'app.exams.loaded' template_dialog_path_key = 'template.dialog.path' report_dialog_path_key = 'report.dialog.path' exam_dialog_path_key = 'exam.dialog.path' proceed_template_dialog_path_key = 'exam.proceed.dialog.path' template_image_zoom = 'template.image.zoom' ...
#!/usr/bin/env python # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
class Notfound(Exception): pass class Launchnodepoolexception(Exception): statsd_key = 'error.nodepool' class Launchstatusexception(Exception): statsd_key = 'error.status' class Launchnetworkexception(Exception): statsd_key = 'error.network' class Launchkeyscanexception(Exception): statsd_key = ...
resultados = str(input()) apuesta = str(input()) aciertos = 0 mirar = 0 hola = apuesta[3] for x in resultados: if x == apuesta[mirar]: aciertos += 1 mirar += 1 print(aciertos)
resultados = str(input()) apuesta = str(input()) aciertos = 0 mirar = 0 hola = apuesta[3] for x in resultados: if x == apuesta[mirar]: aciertos += 1 mirar += 1 print(aciertos)
l = open('input.txt').read().splitlines() draw = list(map(int, l[0].split(','))) boards = [] for i in range((len(l) - 1) // 6): b = [] for j in range(5): b.append(list(map(int, l[i * 6 + j + 2].split()))) boards.append(b) # transform to sets board_sets = [] for b in boards: cur_sets = [set(r) f...
l = open('input.txt').read().splitlines() draw = list(map(int, l[0].split(','))) boards = [] for i in range((len(l) - 1) // 6): b = [] for j in range(5): b.append(list(map(int, l[i * 6 + j + 2].split()))) boards.append(b) board_sets = [] for b in boards: cur_sets = [set(r) for r in b] cur_se...
""" Given a m * n matrix of distinct numbers, return all lucky numbers in the matrix in any order. A lucky number is an element of the matrix such that it is the minimum element in its row and maximum in its column. """ class Solution: def luckyNumbers (self, matrix: List[List[int]]) -> List[int]: m = len(...
""" Given a m * n matrix of distinct numbers, return all lucky numbers in the matrix in any order. A lucky number is an element of the matrix such that it is the minimum element in its row and maximum in its column. """ class Solution: def lucky_numbers(self, matrix: List[List[int]]) -> List[int]: m = le...
# -*- coding: utf-8 -*- """ Created on Fri Oct 1 09:03:04 2021 @author: shubhransu """ print(3*3+3/3-3)
""" Created on Fri Oct 1 09:03:04 2021 @author: shubhransu """ print(3 * 3 + 3 / 3 - 3)
# -*- coding: utf-8 -*- """ Created on Sat Mar 19 01:36:17 2022 @author: henry """
""" Created on Sat Mar 19 01:36:17 2022 @author: henry """
alien_0 = {'color': 'green', 'points':5} print(alien_0['color']) print(alien_0['points']) print(alien_0) alien_0['x_position'] = 0 alien_0['y_position'] = 25 print(alien_0) alien_0 = {} alien_0['color'] = 'green' alien_0['points'] =5 print(alien_0) alien_0 = {'color':'green'} print(f"The alien is {alien_0['color']}."...
alien_0 = {'color': 'green', 'points': 5} print(alien_0['color']) print(alien_0['points']) print(alien_0) alien_0['x_position'] = 0 alien_0['y_position'] = 25 print(alien_0) alien_0 = {} alien_0['color'] = 'green' alien_0['points'] = 5 print(alien_0) alien_0 = {'color': 'green'} print(f"The alien is {alien_0['color']}....
""" Django settings for data_backend project. Generated by 'django-admin startproject' using Django 2.1.3. For more information on this file, see https://docs.djangoproject.com/en/2.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/settings/ """ # SECUR...
""" Django settings for data_backend project. Generated by 'django-admin startproject' using Django 2.1.3. For more information on this file, see https://docs.djangoproject.com/en/2.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/settings/ """ secret_k...
error_msg = { "usedemail": "Email has already been used", "email_format": "Please input a valid email.", "no_email": "Please provide an email", "usedname": "Username has already been taken", "shortname": "Username must have at least three characters", "no_letter": "Username should have a letter....
error_msg = {'usedemail': 'Email has already been used', 'email_format': 'Please input a valid email.', 'no_email': 'Please provide an email', 'usedname': 'Username has already been taken', 'shortname': 'Username must have at least three characters', 'no_letter': 'Username should have a letter.', 'special_character': '...