content
stringlengths
7
1.05M
class Solution: def minSubArrayLen(self, s, nums): """ :type s: int :type nums: List[int] :rtype: int ------------------------------ 15 / 15 test cases passed. Status: Accepted Runtime: 72 ms """ l, sum, res = 0, 0, len(nums) + 1 ...
def get_paginated_result(query, page, per_page, field, timestamp): new_query = query if page != 1 and timestamp != None: new_query = query.filter( field < timestamp ) try: return new_query.paginate( per_page=per_page, page=page ).items, 20...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Errors for Invenio-Records module.""" class RecordsError(Exception): """Base...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 功能实现:创建平面字典中所有键的平面列表。 解读: 使用dict.keys()返回给定字典中的键值。 返回前一个结果的list()。 """ def keys_only(flat_dict): return list(flat_dict.keys()) # Examples ages = { 'Peter': 10, 'Isabel': 11, 'Anna': 9, } print(keys_only(ages)) # output: # ['Peter', 'Isabel', 'Anna'...
#!/usr/bin/env python3 # encoding: utf-8 def _subclasses(cls): try: return cls.__subclasses__() except TypeError: return type.__subclasses__(cls) class _SubclassNode: __slots__ = frozenset(('cls', 'children')) def __init__(self, cls, children=None): self.cls = cls self.children = children or [] def __r...
def longest_uppercase(input,k): final_out = 0 for i in input: test_letters = i for j in input: if len(test_letters) == k : break if test_letters.find(j) >= 0: pass else: test_letters += j max = 0 count = 0 for m in input : if test_letters.find(m) ...
# The following dependencies were calculated from: # # generate_workspace --artifact=io.opencensus:opencensus-api:0.12.2 --artifact=io.opencensus:opencensus-contrib-zpages:0.12.2 --artifact=io.opencensus:opencensus-exporter-trace-logging:0.12.2 --artifact=io.opencensus:opencensus-impl:0.12.2 --repositories=http://repo....
''' Write a program that asks the user how many Fibonnaci numbers to generate and then generates them. Take this opportunity to think about how you can use functions. Make sure to ask the user to enter the number of numbers in the sequence to generate.(Hint: The Fibonnaci seqence is a sequence of numbers where the nex...
# -- Project information ----------------------------------------------------- project = 'showyourwork' copyright = '2021, Rodrigo Luger' author = 'Rodrigo Luger' release = '1.0.0' # -- General configuration --------------------------------------------------- extensions = [] templates_path = ['_templates'] exclude_p...
#!/usr/bin/env python3 """ Bubble Sort Script """ def bubble_sort(L): """ Sorts a list in increasing order. Because of lists are mutable this function does not have to return something. This algorithm uses bubble sort. @param L: a list (in general unsorted) """ for i in...
class ScriptMessageSent: """ Triggered when a message is sent using the ScriptConnector message:str - the message that was sent index:int - the index into the script (agent.messages) """ def __init__(self, message, index): self.message = message self.index = index def __str...
''' #3-1 b=0 c=0 while 1 : a=input("Enthe an integer, the input ends if it is :") if((a>0)|(a<0)): if a>0: b=a else: c=-a if(a==0): print("zheng shu {},fushu {},pingjunshu {}".format(b,c,(b+c))) break ''' ''' #3-2 j = 0 for i in range(15): s = 10...
def mergeSort(myList): print("Splitting ",myList) if (len(myList) > 1): mid = len(myList)//2 leftList = myList[:mid] rightList = myList[mid:] mergeSort(leftList) mergeSort(rightList) i = 0 j = 0 k = 0 while ((i < len(leftList)) and (j < len(rightList))): if (leftList[i] < rightList[j]): ...
while True: relax = master.relax() relax.optimize() pi = [c.Pi for c in relax.getConstrs()] knapsack = Model("KP") knapsack.ModelSense=-1 y = {} for i in range(m): y[i] = knapsack.addVar(ub=q[i], vtype="I", name="y[%d]"%i) knapsack.update() knapsack.addConstr(quicksum(w[i]*y[...
def hasDoubleDigits(p): previous = '' for c in p: if c == previous: return True previous = c return False def neverDecreases(p): previous = -1 for c in p: current = int(c) if current < previous: return False previous = current ret...
# a red shadow with some blur and a offset cmykShadow((3, 3), 10, (1, 0, 0, 0)) # draw a rect rect(100, 100, 30, 30)
# # PySNMP MIB module NSLDAP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NSLDAP-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:25:08 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:...
H, W = map(int, input().split()) S = [] for _ in range(H): tmp = list(input()) S.append(tmp) for h in range(H): for w in range(W): if S[h][w] == '#': # 上 if h > 0 and S[h-1][w] == '#': continue # 下 elif h < H-1 and S[h+1][w] == '#': ...
def deleteDigit(n): n = str(n) return max([int(n[:index] + n[index + 1:]) for index in range(len(n))]) print(deleteDigit(152))
''' Desenvolva um programa que leia quatro valores pelo teclado e guarde-os em uma tupla. No final, mostre: a) Quantas vezes apareceu o valor 9 b) Em que posição foi digitado o primeiro valor 3 c) Quais foram os números pares ''' n = (int(input('Digite um número: ')), int(input('Digite um número: ')), int(in...
#coding:utf-8 def replace(): line=open('templates/space.html').read() str='<div class="hex grid-3 tertiary"><a href="{{hrefadd}}" title="播放类型"><div class="inner"><img src="../static/assets/img/hex-img-3@2x.png" width="140" height="77" alt="Info on Buffalo\'s Website dev process" /></div><div class="hex-1"><span...
# SPDX-FileCopyrightText: 2021 Neradoc NeraOnGit@ri1.fr # # SPDX-License-Identifier: MIT """ Extended list of consumer controls. """ __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/Neradoc/Circuitpython_Keyboard_Layouts.git" class ConsumerControlExtended: UNASSIGNED = 0x00 CONSUMER_CONTROL = 0x01 NUM...
''' Maximum sum with modified positions Status: Accepted ''' ############################################################################### def main(): """Read input and print output""" _ = input() numbers = list(map(int, input().split())) unmoved, zero_index = 0, numbers.index(0) for coeff, i...
name = 'tinymce' authors = 'Joost Cassee' version = 'trunk' release = version
n = input('Digite o seu nome completo: ') .strip() print('Seu nome com todas as letras maiúsculas: {}.'.format(n.upper())) print('Seu nome com todas as letras minúsculas: {}.' .format(n.lower())) print('Seu nome tem {} letras.' .format(len(n.replace(' ', '')))) print('Seu primeiro nome tem {} letras.' .format(len(n.spl...
# # PySNMP MIB module PPVPN-TC (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/PPVPN-TC # Produced by pysmi-0.3.4 at Mon Apr 29 20:33:05 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:23:1...
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def removeElements(self, head, val): """ :type head: ListNode :type val: int :rtype: ListNode """ cur...
# DESAFIO 043 # Desenvolva uma lógica que leia o peso e a altura de uma pessoa, calcule seu IMC e mostre seu status, # de acordo com a tabela abaixo: # Abaixo de 18.5: ABAIXO DO PESO, entre 18.5 e 25: PESO IDEAL, 25 a 30: SOBREPESO # 30 até 40: OBESIDADE, acima de 40: OBESIDADE MÓRBIDA. peso = float(input('Qual seu pe...
with open('../input.txt','rt') as f: lst = set(map(int,f.readlines())) for x in lst: if 2020-x in lst: print(x*(2020-x))
print("Calculator has started") while True: a = float(input("Enter first number ")) b = float(input("Enter second number ")) chooseop=1 while (chooseop == 1) | (chooseop == 2) | (chooseop == 3) | (chooseop == 4): chooseop = int(input("Enter 1 for addition, 2 for subtraction, 3 for multipli...
class node: def __init__(self,value=None): self.value=value self.left_child=None self.right_child=None self.parent=None # pointer to parent node in tree self.height=1 # height of node in tree (max dist. to leaf) NEW FOR AVL class AVLTree: def __init__(self): self.root=None def __repr__(self): if self...
""" Bubbles_R-Us Inc As pesquisas contínua da empresa Bubbles_R-Us Inc garantem que as várias máquinas de bolhas espalhadas por várias partes do páis produzam as melhores bolhas de sabão. Hoje eles estão testando uma nova amostragem o "fator bolhas" de inúmeras formulações diferentes de sua solução nova de bolhas de ...
# for i in range(1, 5): # n = int(input('\tDigite um valor: ')) # print('\n\tFIM') # n = -1 # while n != 0: # n = int(input('\tDigite um valor (0 para finalizar): ')) # print('\n\tFIM') resp = 'sim' while resp == 'sim': n = int(input('\n\tDigite um valor: ')) resp = input('\tDeseja continuar? (sim / n...
class Solution: def lexicalOrder(self, n): """ :type n: int :rtype: List[int] """ results = [n for n in range(1, n+1)] results.sort(key= lambda x: str(x)) return results
class Boid(): def __init__(self, x,y,width,height): self.position = Vector(x,y)
if __name__ == '__main__': print('集合Set') # 集合特性: # 集合中元素无序; # 集合中不存在重复元素; # 任意元素一定存在或不存在一个集合中; # 集合的成员运算在性能上要优于列表的成员运算,这是集合的底层存储特性(哈希存储)决定的 # 创建集合 # 创建集合的字面量语法(重复元素不会出现在集合中) # {}中需要至少有一个元素,因为没有元素的{}并不是空集合而是一个空字典 set1 = {1, 2, 3, 3, 3, 2} print(set1) # {1, 2, 3} print(len(set1)) # 3 # 创建集合的构造器语法(后面会讲到什么是构造器) ...
class PaginationType: LIMIT = 'limit' OFFSET = 'offset' PAGINATION_LIMIT = 100 class Pagination: """ """ LIMIT = 20 OFFSET = 0 @staticmethod def validate(pagination_type, value): """ :param pagination_type: :param value: :return: """ t...
# Area of a Triangle print("Write a function that takes the base and height of a triangle and return its area.") def area(): base = float(int(input("Enter the Base of the Triangle : "))) height = float(int(input("Enter the height of the Triangle : "))) total_area = (base * height)/2 print(total_area) ...
'''Faça um Programa para uma loja de tintas. O programa deverá pedir o tamanho em metros quadrados da área a ser pintada. Considere que a cobertura da tinta é de 1 litro para cada 6 metros quadrados e que a tinta é vendida em latas de 18 litros, que custam R$ 80,00 ou em galões de 3,6 litros, que custam R$ 25,00....
""" Exercise: <font color='red'>(⏰ 5 min) Define a function that takes as input an RGB image and a pair of coordinates (row, column), and returns a copy with a green letter H overlaid at those coordinates. The coordinates point to the top-left corner of the H. The arms and strut of the H should have a width of 3 pixel...
""" Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example: Input: [1,2,3,null,5,null,4] Output: [1, 3, 4] Explanation: 1 <--- / \ 2 3 <--- \ \ 5 4 <--- """ # Definition for...
def make_pizza(*toppings): print(toppings) # for item in toppings: # print("Add " + item)
class Solution: def numSplits(self, s: str) -> int: answer=0 left=[0]*26 right=[0]*26 for x in s: right[ord(x)-ord('a')]+=1 leftNum=0 rightNum=sum(x > 0 for x in right) for x in s: index=ord(x)-ord('a') if left[in...
#!/usr/bin/python3 # -*- mode: python; coding: utf-8 -*- VERSION=1 TEMPLATE_KEY_PREFIX = 'jflow.template' SEPARATOR_KEY = '.' KEY_VERSION = 'version' KEY_FORK = 'fork' KEY_UPSTREAM = 'upstream' KEY_PUBLIC = 'public' KEY_DEBUG = 'debug' KEY_REMOTE = 'remote' KEY_MERGE_TO = 'merge-to' KEY_EXTRA = 'extra' # Template...
""" Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example, Given nums = [0, 1, 3] return 2. Note: Your algorithm should run in linear runtime complexity. Could you implement it using only constant extra space complexity? """ __author__ = 'Dan...
while True: print('Who are you?') name=input() if name!='Joe': continue print('Hello,Joe.What is the password?(it is a fish)') password=input() if password=='swordfish': break print('Access granted')
""" Dinghy daily digest tool. """ __version__ = "0.12.0"
class SearchQuery(dict): """ A specialized dict which has helpers for creating and modifying a Search Query document. Example usage: >>> from globus_sdk import SearchClient, SearchQuery >>> sc = SearchClient(...) >>> index_id = ... >>> query = (SearchQuery(q='example query') >>> ...
def GenerateConfig(context): resources = [] haEnabled = context.properties['num_instances'] > 1 # Enabling services services = { 'name': 'enable_services', 'type': 'enable_services.py', 'properties': { 'services': context.properties['services'] } } # N...
# -*- encoding: utf-8 -*- class UnWellcomeException(Exception): """ Base exception for all exceptions raised by this library. """ pass
# -*- encoding: utf-8 -*- # Copyright (c) 2020 Modist Team <admin@modist.io> # ISC License <https://choosealicense.com/licenses/isc> """Contains packaging information for the module.""" __name__ = "modist-client" __repo__ = "https://github.com/modist-io/modist-client" __version__ = "0.0.1" __description__ = "The loc...
minutos=int(input("digite os minutos de ligações: ")) if minutos<= 200: conta=(minutos*0.20) print("conta:R$ %.2f Reais" %conta) if minutos >200<400: conta=(minutos*0.18) print("conta:R$ %.2f Reias" %conta) elif minutos >400<800: conta=(minutos*0.15) print("conta:R$ %.2f Reais" %conta) elif minu...
def is_equivalent(str_a, str_b): if len(str_a) % 2 != 0 or len(str_b) % 2 != 0: if str_a == str_b: return True return False elif str_a == str_b: return True else: len_a = len(str_a) len_b = len(str_b) a1_i, a1_j = 0, (len_a // 2) a2_i, a2_...
def test_nogarbage_fixture(testdir): testdir.makepyfile(""" def test_fail(nogarbage): assert False def test_pass(nogarbage): pass def test_except(nogarbage): try: assert False except AssertionError: pass ...
def main(): # Store the total sum of multiples of 3 and 5 sum_multiples = 0 # Loop through every number less than 1000 for num in range(1,1000): # Check if number is divisible by 3 or 5, i.e. a multiple if num % 3 == 0 or num % 5 == 0: sum_multiples += num p...
# 177 # 10 # print(divmod(177, 10)) user = int(input()) user2 = int(input()) a = divmod(user, user2) print(a[0]) print(a[1]) # for i in a: # print(''.join(a[i])) print(divmod(user,user2)) # print(divmod(user))
''' Here we'll define exceptions to raise in the qtstyles package ''' class QtStylesError(Exception): """ Base-class for all exceptions raised by this module. """ class SheetPathTypeError(QtStylesError): ''' The style sheet path must be a string. ''' def __init__(self): super(SheetPa...
{ "targets": [{ "target_name": "node_hge", "sources": [ "src/entry.cpp" ], "include_dirs": [ "src/hge181/include", "<!(node -e \"require('nan')\")" ], "libraries": [ "../src/hge181/lib/vc/hge.lib", "../src/hge181/lib/vc/hgehelp.lib" ], "libra...
question_replaceable_special_characters = {',', "'", '"', ';', '?', ':', '-', '(', ')', '[', ']', '{', '}'} special_characters = ['*', '$'] punctuations = set() pickled_questions_dir = "bin/data/questions" pickle_files_extension = ".pickle" questions_per_segment = 100 debug_print_len = 25
"""This problem was asked by Google. Implement a key value store, where keys and values are integers, with the following methods: update(key, vl): updates the value at key to val, or sets it if doesn't exist get(key): returns the value with key, or None if no such value exists max_key(val): returns the largest key wi...
# program r1_04.py obiekt = 10 print(id(obiekt)) obiekt = "Wartość tekstowa" print(id(obiekt)) obiekt = 3.14 print(id(obiekt)) obiekt = True print(id(obiekt)) obiekt = [ 3, 22.1, "Adam", ] print(id(obiekt)) obiekt = (33, "Linux", 5.873) print(id(obiekt)) obiekt = { 2: "System", "B": "Operacyjn...
class LoopiaError(Exception): _exceptions = {} code = None message = None def __init__(self, response=None): super(LoopiaError, self).__init__(self.message) self.response = response @classmethod def register(cls, exception): if exception.code in cls._exceptions: ...
def paperwork(n, m): if n < 0 or m < 0 : return 0 else: return n * m print(paperwork(5,0))
def clocks(x, y, a, b, x2, y2): a = a - x b = b - y if b < 0: b = 60 + b a = a - 1 if a < 0: a = 24 + a a2 = x2 + a b2 = y2 + b if b2 >= 60: b2 = b2 - 60 a2 = a2 + 1 if a2 >= 24: a2 = a2 - 24 print(a2, b2) clocks(int(input()), int(input...
#!/usr/bin/env python3 # # Copyright (c) 2015, Roberto Riggio # 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, t...
#_*_ coding: utf-8 -*- { 'name': "Project Management", 'summary': """ It allows to manage the projects to be carried out in a company and jobs.""", 'description': """ This module allows you to manage the projects of a company from departments, employees and projects. """, 'author': "Carlos Morale...
n=6 a,b=0,0 arr=[1,2,4,4,5,6] for i in range(int(n-1)): if arr[i-1]>=arr[i]<=arr[i+1]: a=a+1 if arr[i-1]<=arr[i]>=arr[i+1]: b=b+1 print(b if a>b else a) def howMany(sentence): i = 0 ans = 0 n = len(sentence) while (i < n): c = 0 c2 = 0 c3 = 0 ...
def currency(x, pos): """The two args are the value and tick position""" if x >= 1e6: s = '${:1.1f}M'.format(x*1e-6) else: s = '${:1.0f}K'.format(x*1e-3) return s
# Parameters for compute_reference.py # mpmath maximum precision when computing hypergeometric function values. MAXPREC = 100000 # Range of a and b. PTS should be an odd number, since # a = 0 and b = 0 are included in addition to positive and negative values. UPPER = 2.3 PTS = 401 # Range of the logarithm of z valu...
'''064 - SOMANDO VÁRIOS VALORES Crie um programa que leia vários números inteiros pelo teclado. O programa só vai parar quando o usuário digitar o valor 999, que é a condição de parada. No final, mostre quantos números foram digitados e qual foi a soma entre eles (desconsiderando o flag).''' soma = 0 contador = 0 nume...
#coding:utf-8 class Checker: def __init__(self, check_type, length=-1): self.type = check_type self.length = length def check(self,value): ''' 返回参数: 状态类型, 错误信息 ''' status = 1 # okay message = "" if type(value) != self.type: ...
''' 09 - Dictionary of lists Some more data just came in! This time, you'll use the dictionary of lists method, parsing the data column by column. |date | small_sold | large_sold | |-------------+---------------+------------| |"2019-11-17" | 10859987 | 7674135 | |"2019-12-01" | 9291631 | 6238096 ...
# -*- coding: utf-8 -*- """rackio/exception.py This module defines all exceptions handle by Rackio. """ class RackioError(Exception): """Base class for other exceptions""" pass class InvalidTagNameError(RackioError): """Raised when an invalid tag name is defined""" pass class TagNotFoundError(Rack...
n = int(input()) friends = list(input().split()) sum = 0 for i in friends: sum += int(i) ways = 0 for i in range(1,6): if (sum+i)%(n+1) != 1: ways += 1 print(ways)
# Rotate Array class Solution: def rotate(self, nums, k): """ Do not return anything, modify nums in-place instead. """ length = len(nums) k = k % length if k == 0: return front = nums[length - k:] index = length - k - 1 while ind...
""" Main TACA module """ __version__ = '0.9.3'
tanya_list = [ 'kenapa', 'bila', 'siapa', 'mengapa', 'apa', 'bagaimana', 'berapa', 'mana'] perintah_list = [ 'jangan', 'sila', 'tolong', 'harap', 'usah', 'jemput', 'minta'] pangkal_list = [ 'maka', 'alkisah', 'arakian', 'syahdah', 'adapun',...
# International morse code (sample) Morse = { # Letters "a": ".-", "b": "-...", "c": "-.-.", "d": "-..", "e": ".", "f": "..-.", "g": "--.", "h": "....", "i": "..", "j": ".---", "k": "-.-", "l": ".-..", "m": "--", "n": "-.", "o": "---", "p": ".--.", ...
N = int(input()) result = 0 for i in range(1, N + 1): if i % 3 == 0 or i % 5 == 0: continue result += i print(result)
def findDecision(obj): #obj[0]: Coupon, obj[1]: Education # {"feature": "Education", "instances": 127, "metric_value": 0.987, "depth": 1} if obj[1]<=2: # {"feature": "Coupon", "instances": 91, "metric_value": 0.9355, "depth": 2} if obj[0]>1: return 'True' elif obj[0]<=1: return 'True' else: return 'True...
def ngram(text, n): list = [] tsize = len(text) for i in range(tsize - n + 1): list.append(text[i:i + n]) return list a = "paraparaparadise" b = "paragraph" abi = set(ngram(a, 2)) bbi = set(ngram(b, 2)) print(abi | bbi) #和集合 print(abi & bbi) #積集合 print(abi - bbi) #差集合 print("ok" if "se" i...
class Solution: def minimumTotal(self, triangle: List[List[int]]) -> int: n = len(triangle) if n == 1: return min(triangle[0]) row_curr = triangle[n-1] for row in range(n-2, -1, -1): row_up = triangle[row] for ind in range(len(row_up)): ...
extensions = dict( required_params=['training_frame', 'x'], validate_required_params="", set_required_params=""" parms$training_frame <- training_frame if(!missing(x)){ parms$ignored_columns <- .verify_datacols(training_frame, x)$cols_ignore if(!missing(fold_column)){ parms$ignored_columns <- setdif...
#Accessing specific elemnts from a dictionary Breakfast={ "Name":"dosa", "cost": 45, "Proteins": 4, "Fat":2 } #Finding the cost of Breakfast p=Breakfast.get("cost") print(p)
NPKT = 100000 # def getselfaddr(): # return socket.getaddrinfo(None, PORT, socket.AF_INET6, socket.SOCK_DGRAM,socket.IPPROTO_IP)[0]
"""Feature vector creation approaches for persistence diagrams. This module contains feature vector creation approaches for persistence diagrams that permit the use in modern machine learning algorithms. """ def _persistence(x, y): """Auxiliary function for calculating persistence of a tuple.""" return abs(x...
""" Configuration of flask application. Everything that could be different between running on your development platform or on ix.cs.uoregon.edu (or on a different deployment target) shoudl be here. """ DEBUG = True # Cookie key was obtained by: # import uuid # str(uuid.uuid4()) # We do it just once so that multiple...
deliver_states = { 'DEFAULT': ['1', 'PENDING_ORDERS', 'ACCEPT_PENDING_JOLLOF', 'ACCEPT_PENDING_DELICACY', 'TO_PICKUP', 'PICKED_UP_JOLLOF', 'PICKED_UP_DELICACY', 'TO_DROPOFF', 'DROPPED_OFF_JOLLOF', 'DROPPED_OFF_DELICACY'], 'CANCELLED': ['DEFAULT'], 'FLASH_LOCATION': ['FLASH_LOCATION', 'CANCELLED'], 'REQ...
class Synonym: def __init__(self, taxon_id, name_id, id='', name_phrase='', according_to_id='', status='synonym', reference_id='', page_reference_id='', link='',...
# ---------------------------------------------------------------------- # CISCO-VPDN-MGMT-MIB # Compiled MIB # Do not modify this file directly # Run ./noc mib make-cmib instead # ---------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for details ...
N = int(input()) positions = [] for x in range(N): input_line = input().split() positions.append([int(input_line[0]), int(input_line[1])]) sorted_positions = sorted(positions) minRadius = 1000000 for x in range(len(sorted_positions)-1): if sorted_positions[x][1] == 0 and sorted_positions[x-1...
# Implementation of a simple "Calculator" program # The calculator consists of four functions: add, subtract, multiply and divide def add(x, y): """ Function to add two numbers Parameters ---------- x : int/float First number to be added y : int/float Second number to b...
"""Modules handling environment data. For example: types for transitions/trajectories; methods to compute rollouts; buffers to store transitions; helpers for these modules. """
# Payable-related constants PAYABLE_FIRST_ROW = 20 PAYABLE_FIRST_COL = 2 PAYABLE_LAST_COL = 25 PAYABLE_SORT_BY = 3 PAYABLE_PAYPAL_ID_COL = 18 PAYABLE_FIELDS = [ 'timestamp', 'requester', 'department', 'item', 'detail', 'event_date', 'payment_type', 'use_of_funds', 'notes', ...
# -*- coding: utf-8 -*- """ Paraxial optical calculations """
operadores = ('+', '-', '*', '/', '%', '=', '>', '<', '>=', '<=', '!', '!=', '==', '&', '|', '++', '--', '+=', '-=', '/=', '*=') comentario = '//' comentario_inicio = '/*' comentario_fim = '*/' aspas = '"' aspasSimples = "'" delimitadores = (';', '{', '}', '(', ')', '[', ']', comentario, comentario_inic...
class TestLinkController(object): def test_create_shortlink_with_correct_request_body(self, client): """create_shortlink() with a correct request body should respond with a success 200. """ form = {"provider": "tinyurl", "url": "http://example.com"} response = client....
class pycacheNotFoundError(Exception): def __init__(self, msg): self.msg = msg super().__init__(self.msg) class installModulesFailedError(Exception): def __init__(self): self.msg = "The modules could not be installed! Some error occurred!" super().__init__(self.msg)
# A python source file with exotic characters # -*- coding: utf-8 -*- upside_down = "ʎd˙ǝbɐɹǝʌoɔ" surrogate = "db40,dd00: x󠄀"
# Auto-generated pytest file class TestInit: def test___init__(self): fail() class TestEnter: def test___enter__(self): fail() class TestExit: def test___exit__(self): fail() class TestGetSearchResultCount: def test_get_search_result_count(self): fail() class Tes...