content
stringlengths
7
1.05M
class InterfaceError(Exception): def __init__(self, message, human_message=None): super().__init__(message) if human_message is None: self.human_message = message else: self.human_message = human_message
class Solution: def compress(self, chars: List[str]) -> int: read = 0 while read < len(chars) - 1: count = 1 read_next = read + 1 while read < len(chars) - 1 and chars[read_next] == chars[read]: del chars[read_next] count += 1 ...
class RunnerException(Exception): def __init__(self, message=''): super().__init__() self.message = message class ArgumentError(RunnerException): def __str__(self): return 'ArgumentError: %s' % self.message
"""StompListener: base class for a listener which will be invoked upon message arrival """ class StompListener(object): """StompListener: base class for a listener which will be invoked upon message arrival """ def on_message(self, frame): """Called by the STOMP receiver thread upon message a...
words = "Life is short" def lazy_print(text): return lambda: print(text) task = lazy_print(words) task()
""" Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. top() -- Get the top element. empty() -- Return whether the stack is empty. Notes: You must use only standard operations of a queue -- which means only push to back,...
g = int(input().strip()) for _ in range(g): n = int(input().strip()) s = [int(x) for x in input().strip().split(' ')] x = 0 for i in s: x ^= i if x: print("First") else:#x=0 print("Second")
# Write your solution here: class SuperHero: def __init__(self, name: str, superpowers: str): self.name = name self.superpowers = superpowers def __str__(self): return f'{self.name}, superpowers: {self.superpowers}' class SuperGroup: def __init__(self, name: str, location: str): ...
#!/usr/bin/python # list_comprehension.py a = [1, 2, 3, 4, 5, 6, 7, 8, 9] b = [e for e in a if e % 2] print (b)
numbers = list(map(int, input().split())) d = dict() for n in numbers: d[n] = 0 for n in numbers: d[n] += 1 result = "" for n in d: if d[n] == 1: result += f"{n} " print(result)
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def reverseBetween(self, head, m, n): """ :type head: ListNode :type m: int :type n: int :rtype: ListNode ...
def coverDebts(s, debts, interests): items = list(zip(interests, debts)) items.sort(reverse=True) n = len(items) ans = 0 for i in range(len(debts)): items[i] = list(items[i]) while True: amount = s*0.1 isEmpty = True for i in range(n): if items[i][1] >...
__author__ = 'shijianliu' host = 'http://223.252.199.7' server_host='127.0.0.1' server_port=9999 username = 'liverliu' password = 'liu90shi12jian21' headers = {} headers['Accept'] = '*/*' headers['Accept-Encoding'] = 'gzip, deflate, sdch' headers['Accept-Language'] = 'zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4,zh-TW;q=0.2' ...
# -*- coding: utf-8 -*- # # Copyright (C) 2020-2021 Graz University of Technology. # # invenio-config-tugraz is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. """ Records permission policies. Default policies for records: .. code-blo...
def df_corr_pearson(data, y, excluded_list=False): '''One-by-One Correlation Based on the input data, returns a dictionary where each column is provided a correlation coefficient and number of unique values. Columns with non-numeric values will have None as their coefficient. data : dataframe ...
class Argument: """Parses a python argument as string. All whitespace before and after the argument text itself is stripped off and saved for later reformatting. """ def __init__(self, original: str): original.lstrip() start = 0 end = len(original) - 1 while orig...
# Sem zip a = [17, 28, 30] b = [99, 16, 8] alice = 0 bob = 0 # for i in range(len(a)): # if a[i] > b[i]: # alice += 1 # elif a[i] < b[i]: # bob += 1 # print(alice, bob) #Com Zip for x, y in zip(a, b): if x > y: alice += 1 elif x < y: bob += 1 print(alice, bob)
''' Set of functions to provide managed input for Python programs. Uses the input and print standard input functions to read, but provides ranged checked input functions, and also handles CTRL+C input which would normally break a Python application. CTRL+C handling can be turned off by setting DEBUG_MODE to True so th...
""" rules_binaries implements a set of rules for dealing with external binary dependencies in a Bazel project. """ load( "//internal:def.bzl", _binary = "binary", _binary_location = "binary_location", ) binary = _binary binary_location = _binary_location
''' This package contains material and attributes class ''' # ---------- # Attributes # ---------- class Attributes(): '''Attributes is the base class for all attributes container. `Environment` and `Material` are attribute container ''' def __init__(self, attributes=None): ''' *Param...
# ENTER TIME CONTROLLER # This allows a user to enter a time of the day, in hours, minutes, and AM/PM # # INPUTS: # temp_inside # temp_outside # humidity # gas # motion # timestamp # # OUTPUTS: # line1 # line2 # # CONTEXT: # action(start_in_minutes, end_in_minutes) -> function(inputs, state, settings) -> new_state, set...
# n0 = int(input('Digite o primeiro numero: ')) # n1 = int(input('Digite o segundo numero: ')) # n2 = int(input('Digite o terceiro numero: ')) # n3 = int(input('Digite o quarto numero: ')) # tulipa = (n0, n1, n2, n3) tulipa = (int(input('Digite o primeiro numero: ')), int(input('Digite o segundo numero: ')), int(input...
# Time between two pictures are taken in seconds, Raspberry Pi needs ca. 3 seconds to take one # picture with the current setting, so this value should be at least 3 CAMERA_INTERVAL_SECONDS = 3600 # Settings used for Serial communication with Arduino SERIAL_BAND_RATE = 9600 # times of retry when searing for the cor...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Union of rectangles # jill-jenn vie et christoph durr - 2014-2018 # snip{ cover-query class Cover_query: """Segment tree to maintain a set of integer intervals and permitting to query the size of their union. """ def __init__(self, L): """create...
''' Used by __init__.py to set the MongoDB configuration for the whole app The app can then be references/imported by other script using the __init__.py ''' DEBUG = True TESTING = True # mongo db SECRET_KEY = "vusualyzerrrrrrrr" MONGO_URI = "mongodb://localhost:27017/vus" # debug bar DEBUG_TB_INTERCEPT_REDIRECTS = F...
#Contributed by @Hinal-Srivastava def binary_search(list,item): first = 0 last = len(list)-1 flag = False while( first<=last and not flag): mid = (first + last)//2 if list[mid] == item : flag = True print("Element found at ", mid," after sorting the list") ...
# compute voltage drops top-bottom of H16, so for black. loops = 100 # iterations of voltage computation # 18 nodes in graph after black capture and dead cell removal Nbrs = [ [1,2,3,4], [0,4,5], [0,5,6], [0,6,7], [0,1,5,10,13], [1,2,4,6,10,13], [2,3,5,7,8], [3,6,8,9], [6,7,9,10,11], [7,8,11,12], [4,5,8,11,13,14], ...
TARGET = 'embox' ARCH = 'x86' CFLAGS = ['-O0', '-g'] CFLAGS += ['-m32', '-march=i386', '-fno-stack-protector', '-Wno-array-bounds'] LDFLAGS = ['-N', '-g', '-m', 'elf_i386' ]
""" Given a number with N digits, write a program to get the smallest number possible after removing k digits from number N. """ def get_smallest(num: int, k: int) -> int: num_lst = [int(n) for n in list(str(num))] stack = [] index = 0 size = len(num_lst) while index < size and k > 0: if ...
TITLE = "DoodleHop" # screen dims WIDTH = 480 HEIGHT = 600 # frames per second FPS = 60 # colors WHITE = (255, 255, 255) BLACK = (0,0,0) REDDISH = (240,55,66) SKY_BLUE = (0, 0, 0) FONT_NAME = 'arial' SPRITESHEET = "spritesheet_jumper.png" # data files HS_FILE = "highscore.txt" # player settings PLAYER_ACC = 0.5 PLAYER_...
""" if condition_1: code code elif condition_2: code elif condition_3: code .. .. .. else: code elif not compulsory else not compulsory """ number = int(input()) if number == 0: print('i am in the if block') print('i am leaving') elif number < 10: print('small number') elif number < ...
# -*- coding: utf-8 -*- """This module contains Exceptions specific to :mod:`mass` module.""" class MassSBMLError(Exception): """SBML error class.""" class MassSimulationError(Exception): """Simulation error class.""" class MassEnsembleError(Exception): """Simulation error class.""" __all__ = ( ...
height = int(input()) for i in range(1,height+1): for j in range(1,height+1): if(i < height//2+1): print(0,end=" ") else: print(1,end=" ") print() # Sample Input :- 5 # Output :- # 0 0 0 0 0 # 0 0 0 0 0 # 1 1 1 1 1 # 1 1 1 1 1 # 1 1 1 1 1
# -*- coding: utf-8 -*- """ *************************************************************************** ProviderActions.py ------------------- Date : April 2017 Copyright : (C) 2017 by Nyall Dawson Email : nyall dot dawson at gmail dot com *****************...
class FsharpPackage(GitHubTarballPackage): def __init__(self): GitHubTarballPackage.__init__(self, 'fsharp', 'fsharp', '3.0.27', 'f3c8ea8bf4831ce6dc30581558fa4a45a078cd55', configure = '') def build(self): self.sh ('autoreconf') self.sh ('./configure --prefix="%{prefix}"') self.sh ('make') Fsha...
# key: symbol, charge, number of !'s (hypervalent marker) VALENCE = { ("H", 0, 0): 1, ("H", 1, 0): 0, ("He", 0, 0): 0, ("Li", 1, 0): 0, ("Li", 0, 0): 1, ("Be", 2, 0): 0, ("B", 0, 0): 3, ("B", -1, 0): 4, ("C", 0, 0): 4, ("C", -1, 0): 3, ("C", 1, 0): 3, ("N", 0, 0): 3, ...
# -*- coding: utf-8 -*- # @Time : 2020/8/25-10:03 # @Author : TuringEmmy # @Email : yonglonggeng@163.com # @WeChat : csy_lgy # @File : sort012.py # @Project : Happy-Algorithm # 75. 颜色分类 # https://leetcode-cn.com/problems/sort-colors/ def sort_0_1_2(nums): """ 阳光出行,有点鄙视非科班人 :param nums: ...
# 235 Lowest Common Ancestor of a Binary Search Tree # Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def lowestCommonAncestor(self, root, p, q): if root.val == p.val or root.val == q.val:...
class GeneticProgramError(Exception): """ Encapsulating graceful exception handling during evolutionary runs. Args: message (str): Message to print. exit (bool): Whether to hard exit the process or not (default = False). """ def __init__(self, message : str, exit : bool = False): ...
def checkout_values(counter_of_items, dict_of_deals): # loops through trying to find best deal on items # does this by subtracting max until it can do no more, pops the max and # loops with second max and so on... value = 0 for item in counter_of_items: if item in dict_of_deals: ...
# This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. # """Deal with Affymetrix related data such as cel files. """ __docformat__ = "restructuredtext en"
class DatabaseData: ''' Representation of data read or to write in a no-sql database Attributes: category : str Which document or root element this data belongs to values : dict Data to insert into the document or under the root element ''' def __init__(self,...
print('{:=^30}'.format('Calculadora de Média')) nota1 = float(input('\nDigite a primeira nota:')) nota2 = float(input('Digite a segunda nota:')) media = ((nota1 + nota2) / 2) print(f'\nA média entre {nota1:.2f} e {nota2:.2f} é igual a {media:.2f}')
BLACK = ( 0, 0, 0) WHITE = ( 255, 255, 255) GREEN = ( 0, 255, 0) RED = ( 255, 0, 0) GREY = ( 100, 100, 100) SCREEN_WIDTH = 900 SCREEN_HEIGHT = 600
""" knn.py ~~~~~~~~~~~~~~~ Kth Nearest Neighbors implementation. This module contains functions that can be used for kNN classification. Call kNN(modelData, instance, k) on an existing modelData of training data to classify a new instance based on the k nearest neighbors. Example: $ python knn.py >>> imp...
class check_anagram: def __init__(self,s1,s2): self.s1=s1 self.s2=s2 def check(self): # the sorted strings are checked if(sorted(self.s1)== sorted(self.s2)): print("The strings are anagrams.") else: print("The strings aren't anagrams.") ...
class CiphertextMessage(Message): def __init__(self, text): ''' Initializes a CiphertextMessage object text (string): the message's text a CiphertextMessage object has two attributes: self.message_text (string, determined by input text) ...
n = int(input()) p = list(map(int,input().split())) p.sort() sum_ = 0 for i in range(len(p)+1): sum_ += sum(p[:i]) print(sum_)
def initialize_database_skeleton(db): ############################### # DROP ALL TABLES # ############################### print('Dropping any residual tables') db.query("DROP TABLE IF EXISTS messages") db.commit() db.query("DROP TABLE IF EXISTS digital_media") db.commit()...
#!/usr/bin/env python # START OMIT i = 3 while i != 0: print(i) i -= 1 # END OMIT
# Copyright (c) 2012 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, # These files lists are shared with the GN build. 'ash_sources': [ 'accelerators/accelerator_com...
############################################################################## # # attachment_large_object module for OpenERP, # Copyright (C) 2014 Anybox (http://anybox.fr) Georges Racinet # # This file is a part of attachment_large_object # # anybox_perf is free software: you can redistribute it and/or mod...
class Ksztalty: # definicja konstruktora def __init__(self, x, y): # deklarujemy atrybuty # self wskazuje że chodzi o zmienne właśnie definiowanej klasy self.x=x self.y=y self.opis = "To będzie klasa dla ogólnych kształtów" def pole(self): return self.x * sel...
templates = { # HTTP Error 'htmlError': """<html> <head></head> <body> <h2>{}</h2> </body> </html>""", # XML DISCOVER # with help from https://github.com/ZeWaren/python-upnp-ssdp-example 'xmlDiscover': """<root xmlns="urn:schemas-upnp-org:device-1-0"> <specVersion> <major>1</majo...
class Entity: def __init__(self, start, end, text, entity_type, confidence=1): """ :param start: start position of the entity in the source text :param end: end position of the entity in the source text :param text: entity text :param entity_type: type of the entity :...
file = open('input.txt', 'r') inputCodes = file.readline().split(',') def processCode(codeIndex): result = 0 if (inputCodes[codeIndex] == '1'): result = int(inputCodes[int(inputCodes[codeIndex+1])]) + int(inputCodes[int(inputCodes[codeIndex+2])]) inputCodes[int(inputCodes[codeIndex+3])] = str(...
expected_output = { "vlan_id": { "100": {"access_map_tag": "karim"}, "3": {"access_map_tag": "mordred"}, "15": {"access_map_tag": "mordred"}, "5": {"access_map_tag": "mordred"}, } }
class ASCReader: def __init__ (self, fileName): self.FileName = fileName self.Options = self.parse_config ( ) self.Time, self.Amplitude = self.parse_data(); def getParameterByName (self, Name ): return self.Options[Name] def getTime ( self, us=False ): if us: ...
animals = ['bear', 'python3.6', 'peacock', 'kangaroo', 'whale', 'platypus'] bear = animals[0] python = animals[1] peacock = animals[2] kangaroo = animals[3] whale = animals[4] platypus = animals[5] print(f"The first animal is at 0 and is a {bear}") print(f"The third animal is at 2 and is a {peacock}") print(f"The firs...
""" Problem Link: https://binarysearch.io/problems/Second-Place """ # class Tree: # def __init__(self, val, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def solve(self, root): # Write your code here if root is None: ...
""" Dump attributes of an object From: https://blender.stackexchange.com/questions/1879/is-it-possible-to-dump-an-objects-properties-and-methods """ def dumpAttr(obj): """ Dump attributes of the object """ for attr in dir(obj): if hasattr( obj, attr ): print(f'obj.{attr} = {getatt...
def multiply(x, y): ''' Multiply two numbers x and y ''' print('multiplying x: {} * y: {}'.format(x, y))
for i in range(50,81): if i%2==0: print(i) else: break
class TestAccomodation: def test_list_accomodation(self, client): response = client.get('/accomodation') assert response.status_code == 200 def test_update_accomodation(client): pass
class Edge: def __init__(self, u, v, w): self.u = u self.v = v self.w = w def __eq__(self, edge): if self.u.id == edge.u.id and self.v.id == edge.v.id: return True return False def __ge__(self, v): return True if self.w > v.w else F...
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """This m...
description = 'setup for the status monitor' group = 'special' instrs = sorted(['BioDiff', 'DNS', 'Panda', 'JNSE', 'KWS1', 'KWS2', 'KWS3', 'Poli', 'Maria', 'Treff', 'Spheres']) blocks = [] plotfields = [] for instr in instrs: key = instr.lower() + '_cooling_' fields = [Field(name='T_in', dev=...
x = int(input("enter first number\n")) if(x>=0): print(x,"is positive") else: print(x,"is negative")
salario = float (input ('Digite seu salário: R$')) if salario > 1250: print ('Seu salário com aumento ficou R${:.2f}'.format(salario + (salario * 10 / 100))) else: print ('Seu salário com aumento ficou R${:.2f}'.format(salario + (salario * 15 / 100)))
# -*- coding: utf-8 -*- """Top-level package for Training Logger.""" __author__ = """Fermin Hernandez Gil""" __email__ = 'fermin.hdez@gmail.com' __version__ = '0.1.0'
def reward_function(params): """ Reward function focused on making the agent to stay inside the two borders of the track while increasing speed having even more reward than inside_lane_fast """ # Read input parameters all_wheels_on_track = params['all_wheels_on_track'] distance_from_center ...
config = { 'metadata_version': '1.0', 'module_name': 'nifake', 'module_version': '1.1.1.dev0', 'c_function_prefix': 'niFake_', 'driver_name': 'NI-FAKE', 'session_class_description': 'An NI-FAKE session to a fake MI driver whose sole purpose is to test nimi-python code generation', 'session_h...
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors # # This module is part of GitDB and is released under # the New BSD License: http://www.opensource.org/licenses/bsd-license.php """Module containing information about types known to the database""" str_blob_type = b'blob' str_commit_type...
palavra = input("Digite uma palavra: ") #concatenar print(palavra + 'oi') #tamanho print(len(palavra)) #primeiro caractere print(f'Primeiro caractere da string {palavra}: {palavra[0]}') #ultimo caractere print(f'Ultimo caractere da string {palavra}: {palavra[-1]}') # 3 primeiros elementos da strings print(f'Três p...
n = 4 C=[[10,20,12,5],[3,14,9,1],[13,8,6,9],[7,15,6,9]] X=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]] C1=[[10,20,12,5],[3,14,9,1],[13,8,6,9],[7,15,6,9]] min_element=10**5 for i in range(n): for j in range(n): if C1[i][j]<min_element: min_element=C1[i][j] for j in range(n): C1[i][j]=...
power = {'BUSES': {'Area': 1.33155, 'Bus/Area': 1.33155, 'Bus/Gate Leakage': 0.00662954, 'Bus/Peak Dynamic': 0.0, 'Bus/Runtime Dynamic': 0.0, 'Bus/Subthreshold Leakage': 0.0691322, 'Bus/Subthreshold Leakage with power gating': 0.0259246, 'Gate...
def solve(): print(5) def calc_new_grid(grid): ans = grid.copy() for i in range(len(grid)): for j in range(len(grid[i])): if grid[i][j] == '.': ans[i] = ans[i][0:j] + '.' + ans[i][j+1:] continue ctr = 0 if ((i > 0 and i < len(gr...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `staff_info` package."""
# # Copyright (c) 2014, Multyvac All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the fo...
''' 给定一个包含 n 个整数的数组 nums 和一个目标值 target,判断 nums 中是否存在四个元素 a,b,c 和 d ,使得 a + b + c + d 的值与 target 相等?找出所有满足条件且不重复的四元组。 注意: 答案中不可以包含重复的四元组。 示例: 给定数组 nums = [1, 0, -1, 0, -2, 2],和 target = 0。 满足要求的四元组集合为: [ [-1, 0, 0, 1], [-2, -1, 1, 2], [-2, 0, 0, 2] ] ''' class Solution: def fourSum(self, nums: List[int]...
{ 'includes': ['../../common.gypi'], 'targets': [ { 'target_name': 'harfbuzz', 'type': 'static_library', 'defines': [ 'HAVE_FREETYPE', 'HAVE_FT_GET_VAR_BLEND_COORDINATES', 'HAVE_INTEL_ATOMIC_PRIMITIVES', 'HAVE_OT', '...
print('===== DESAFIO 085 =====') num = 0 for p in range(0, 7): num = int(input('digite um numero: '))
sites_dict = { 'forbes': '(.*)forbes.com(.*)', 'hnews': '(.*)news.ycombinator.com(.*)', 'reddit': '(.*)reddit.com(.*)', 'hackaday': '(.*)hackaday.com(.*)', }
''' This module works with the board for skyscrapers game. https://github.com/cosssec/skyscrapers ''' def read_input(path: str): """ Read game board file from path. Return list of str. """ digits = [] with open(path, 'r') as data: for line in data: line = ...
# Python Program To Insert A New Elements Into A Tuple Of Elements At A Specified Position ''' Function Name : Insert New Element Into Tuple At Any Position. Function Date : 12 Sep 2020 Function Author : Prasad Dangare Input : String,Integer Output : String,Integer ''' print...
############################################### # # # PoC: Smartshark # # # # USAGE: # # # # Script to clean dataset...
class Solution(object): def convertToTitle(self, n): """ :type n: int :rtype: str """ res = '' base = ord('A') - 1 while n > 0: rem = n % 26 rem = 26 if rem == 0 else rem res = chr(rem + base) + res n = (n - rem)...
#chamar 5 valores #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #analisando os valores passados.. #1 2 3 Foram informados 3 valores ao todos. #o maior valor informado foi 3. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #se for zero o maior valor vai ser zero def valores(*n): maior = menor = 0 print('-'*35) print('Analisando o...
#!/usr/bin/env python3 inputStr = input() map1Str = input() map2Str = input() outputStr = '' for i in inputStr: match = False for mapCharIndex, mapChar in enumerate( map1Str ): if i == mapChar: outputStr += map2Str[mapCharIndex] match = True break for mapCharIndex, mapChar in enumerate( map2Str ):...
class spexxyException(Exception): def __init__(self, message=""): self.message = message class spexxyValueTooLowException(spexxyException): pass class spexxyValueTooHighException(spexxyException): pass
coordinates_E0E1E1 = ((127, 121), (128, 121), (129, 105), (129, 107), (129, 121), (130, 103), (130, 104), (130, 108), (130, 121), (130, 123), (131, 100), (131, 105), (131, 106), (131, 107), (131, 109), (131, 120), (131, 122), (132, 100), (132, 103), (132, 104), (132, 105), (132, 106), (132, 108), (132, 119), (132, 12...
{ "name": "Web Refresher", "version": "14.0.1.0.0", "author": "Compassion Switzerland, Odoo Community Association (OCA)", "license": "AGPL-3", "website": "https://github.com/OCA/web", "qweb": ["templates/pager_button.xml"], "depends": ["web"], "installable": True, "auto_install": Fal...
"""Example Celery application and worker configuration.""" # URL to listen for tasks broker_url = 'amqp://' # URL to save task results result_backend = 'redis://' # Tasks must take care of saving results task_ignore_result = False # Save tasks timestamp in UTC enable_utc = True # Local timezone timezone = 'UTC' #...
# functions for handling the diagnose file. # - reading with "parse" def automata_line(state, line): """ Automata parsing knowledges. 0: waiting for knowledge block 1: seen the heading of a knowledge block 2: we are in a knowledge block """ if state == 0 and "Undefined knowledges" in line:...
load("//github.com/gogo/protobuf:gogofaster_grpc_compile.bzl", "gogofaster_grpc_compile") load("@io_bazel_rules_go//go:def.bzl", "go_library") load("//go:utils.bzl", "get_importmappings") wkt_mappings = get_importmappings({ "google/protobuf/any.proto": "github.com/gogo/protobuf/types", "google/protobuf/duration.prot...
class Solution: def transpose(self, A: List[List[int]]) -> List[List[int]]: l=[] i=0 while(i!=len(A[0])): x=[] j=0 while(j<len(A)): x.append(A[j][i]) j+=1 if(x!=[]): l.append(x) i+=1 ...
class Automobil(object): # Oberklasse / Superklasse antrieb = "Ottomotor" leistung_in_kw = 120 def ausgabe(self): print("Antrieb: ", self.antrieb) print("Leistung: ", self.leistung_in_kw) class PKW(Automobil): # Unterklasse / Subklasse pass print("Automobil a: ") a = Automobil() a...
roc_table = ''' Таблица значений метрик в каждой точке для данной группирующей переменной. TP (True Positives) — верно классифицированные положительные примеры. TN (True Negatives) — верно классифицированные отрицательные примеры. FN (False Negatives) — положительные примеры, классифицированные как отрицательные. F...
print("I will now count my chickens:") print("Hens", 25 + 30 / 6) print(f"Roosters {100 - 25 * 3 % 4}")
''' import pandas as pd from bokeh.plotting import figure, show, ColumnDataSource from bokeh.layouts import column from bokeh.models import CustomJS, Slider df = pd.DataFrame([[1,2,3,4,5],[2,20,3,10,20]], columns = ['1','21','22','31','32']) source_available = ColumnDataSource(df) source_visible = ColumnDataSource(da...