content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# Python Program to find Area of a Triangle a = float(input('Please Enter the First side of a Triangle: ')) b = float(input('Please Enter the Second side of a Triangle: ')) c = float(input('Please Enter the Third side of a Triangle: ')) # calculate the Perimeter Perimeter = a + b + c # calculate the semi-perimeter s...
a = float(input('Please Enter the First side of a Triangle: ')) b = float(input('Please Enter the Second side of a Triangle: ')) c = float(input('Please Enter the Third side of a Triangle: ')) perimeter = a + b + c s = (a + b + c) / 2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 print('\n The Perimeter of Traiangle ...
#Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. #This program is free software; you can redistribute it and/or modify it under the terms of the BSD 0-Clause License. #This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of ...
class Sensor: def __init__(self, black_level, saturation, ccm, camera_name): self.black_level = black_level self.saturation = saturation self.ccm = ccm self.camera_name = camera_name def to_dict(self): return {'camera_name': self.camera_name, 'black_level': self.black_l...
# Copyright (c) Project Jupyter. # Distributed under the terms of the Modified BSD License. __version__ = '0.7.16'
__version__ = '0.7.16'
# encoding: utf-8 # module Autodesk.Revit.UI.Macros calls itself Macros # from RevitAPIUI, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null # by generator 1.145 # no doc # no imports # no functions # classes class ApplicationEntryPoint(UIApplication, IDisposable, IEntryPoint): """ For Revit ...
class Applicationentrypoint(UIApplication, IDisposable, IEntryPoint): """ For Revit Macros use only. ApplicationEntryPoint() """ def create_ribbon_panel(self, *__args): """ CreateRibbonPanel(self: ApplicationEntryPoint, tabName: str, panelName: str) -> RibbonPanel Cr...
# # PySNMP MIB module CISCO-FABRICPATH-TOPOLOGY-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-FABRICPATH-TOPOLOGY-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:57:56 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python ve...
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, value_size_constraint, constraints_union, value_range_constraint, single_value_constraint) ...
def mdc(m,n): if n==0: return m return mdc(n,m%n) for k in range(int(input())): A = input().split() op = A[3] A[0] = int(A[0]) A[1] = int(A[2]) A[2] = int(A[4]) A[3] = int(A[6]) res = [[],[]] if op == '+': res[0] = A[0]*A[3]+A[2]*A[1] res[1] = A[1]*A[3] elif ...
def mdc(m, n): if n == 0: return m return mdc(n, m % n) for k in range(int(input())): a = input().split() op = A[3] A[0] = int(A[0]) A[1] = int(A[2]) A[2] = int(A[4]) A[3] = int(A[6]) res = [[], []] if op == '+': res[0] = A[0] * A[3] + A[2] * A[1] res[1] =...
class Solution: def numBusesToDestination(self, routes: List[List[int]], source: int, target: int) -> int: """BFS. """ d = defaultdict(list) for i in range(len(routes)): for stop in routes[i]: d[stop].append(i) q = deque([(source, 0)]) v = ...
class Solution: def num_buses_to_destination(self, routes: List[List[int]], source: int, target: int) -> int: """BFS. """ d = defaultdict(list) for i in range(len(routes)): for stop in routes[i]: d[stop].append(i) q = deque([(source, 0)]) ...
''' Jonatan Paschoal 11/05/2020 - Crie um programa que receba nome de uma pessoa e verifique se ela te silva''' print('---------------'*3) nome = input('Digite o seu nome: ') #------------------------------------------------------------ x = nome.lower() y = 'silva' in x #----------------------------------------------...
""" Jonatan Paschoal 11/05/2020 - Crie um programa que receba nome de uma pessoa e verifique se ela te silva""" print('---------------' * 3) nome = input('Digite o seu nome: ') x = nome.lower() y = 'silva' in x print('Para o nome Silva, temos {}. '.format(y)) print('---------------' * 3)
description = 'Julabo F25 for the Huginn-sans.' pv_root = 'SES-HGNSANS-01:WTctrl-JUL25HL-001:' devices = dict( T_julabo=device( 'nicos.devices.epics.pva.EpicsAnalogMoveable', description='The temperature', readpv='{}TEMP'.format(pv_root), writepv='{}TEMP:SP1'.format(pv_root), ...
description = 'Julabo F25 for the Huginn-sans.' pv_root = 'SES-HGNSANS-01:WTctrl-JUL25HL-001:' devices = dict(T_julabo=device('nicos.devices.epics.pva.EpicsAnalogMoveable', description='The temperature', readpv='{}TEMP'.format(pv_root), writepv='{}TEMP:SP1'.format(pv_root), targetpv='{}TEMP:SP1:RBV'.format(pv_root), ep...
__all__ = ["ExpressionError", "EmptySubExpressionError", "ParenthesisError", "BadEscapedSymbolError", "UnexpectedEndError"] class ExpressionError(Exception): """Type for all errors which can happen while parsing.""" pass class EmptySubExpressionError(ExpressionError): pass class ...
__all__ = ['ExpressionError', 'EmptySubExpressionError', 'ParenthesisError', 'BadEscapedSymbolError', 'UnexpectedEndError'] class Expressionerror(Exception): """Type for all errors which can happen while parsing.""" pass class Emptysubexpressionerror(ExpressionError): pass class Parenthesiserror(Expressi...
class Solution: def checkRecord(self, n: int) -> int: if n == 0: return 0 if n == 1: return 3 if n == 2: return 8 MAX = 1000000007 dp = [1, 2, 4] i = 3 while i < n: dp.append((dp[i - 1] + dp[i - 2] + dp[i - 3]) % MAX) i += 1 ...
class Solution: def check_record(self, n: int) -> int: if n == 0: return 0 if n == 1: return 3 if n == 2: return 8 max = 1000000007 dp = [1, 2, 4] i = 3 while i < n: dp.append((dp[i - 1] + dp[i - 2] + dp[i - 3])...
def make_version_string(version_info): """ Turn a version tuple in to a version string, taking in to account any pre, post, and dev release tags, formatted according to PEP 440. """ version_info = list(version_info) numbers = [] while version_info and isinstance(version_info[0], int): ...
def make_version_string(version_info): """ Turn a version tuple in to a version string, taking in to account any pre, post, and dev release tags, formatted according to PEP 440. """ version_info = list(version_info) numbers = [] while version_info and isinstance(version_info[0], int): ...
class House: def __init__(self, price): self._price = price @property def price(self): return self._price @price.setter def price(self, new_price): if new_price > 0 and isinstance(new_price, float): self._price = new_price else: print("Pleas...
class House: def __init__(self, price): self._price = price @property def price(self): return self._price @price.setter def price(self, new_price): if new_price > 0 and isinstance(new_price, float): self._price = new_price else: print('Pleas...
class FE_SCRIPTS: _fesname = "" _miniDesc = "" _totalDesc = "" _Opt = {} _author = "" def __init__(self, fesname,miniDesc,totalDesc,Opt,author): self._fesname = fesname self._miniDesc = miniDesc self._totalDesc = totalDesc self._Opt = Opt self._...
class Fe_Scripts: _fesname = '' _mini_desc = '' _total_desc = '' __opt = {} _author = '' def __init__(self, fesname, miniDesc, totalDesc, Opt, author): self._fesname = fesname self._miniDesc = miniDesc self._totalDesc = totalDesc self._Opt = Opt self._aut...
class HTMLParseError(Exception): """ A generic HTML parsing errors validators can throw. """ message: str def __init__(self, message: str): self.message = message def __str__(self): return "Parse Error: {}".format(self.message)
class Htmlparseerror(Exception): """ A generic HTML parsing errors validators can throw. """ message: str def __init__(self, message: str): self.message = message def __str__(self): return 'Parse Error: {}'.format(self.message)
''' import asyncio import functools import json import platform import re import secrets import time from pathlib import Path from aiohttp import web import aiohttp import multidict from gd.typing import ( Any, Awaitable, Callable, Dict, Generator, Iterable, List, Optional, Sequen...
''' import asyncio import functools import json import platform import re import secrets import time from pathlib import Path from aiohttp import web import aiohttp import multidict from gd.typing import ( Any, Awaitable, Callable, Dict, Generator, Iterable, List, Optional, Sequen...
# # PySNMP MIB module MERU-CONFIG-QOS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MERU-CONFIG-QOS-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:01:10 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default...
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, single_value_constraint, value_size_constraint, constraints_intersection, constraints_union) ...
argent = int(input()) prixLivre = int(input()) print(argent // prixLivre)
argent = int(input()) prix_livre = int(input()) print(argent // prixLivre)
class Solution: def maxWidthOfVerticalArea(self, points): xs = sorted([x for x, y in points]) ans = 0 for i in range(len(xs) - 1): ans = max(ans, xs[i+1] - xs[i]) return ans
class Solution: def max_width_of_vertical_area(self, points): xs = sorted([x for (x, y) in points]) ans = 0 for i in range(len(xs) - 1): ans = max(ans, xs[i + 1] - xs[i]) return ans
def meu_maximo(a=0, b=0, c=0, d=0, e=0): return max((a, b, c, d, e)) def meu_maximo_infinito(**kwargs): return max(kwargs.values()) dicionario = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5} print(meu_maximo(**dicionario)) print(meu_maximo_infinito(**dicionario))
def meu_maximo(a=0, b=0, c=0, d=0, e=0): return max((a, b, c, d, e)) def meu_maximo_infinito(**kwargs): return max(kwargs.values()) dicionario = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5} print(meu_maximo(**dicionario)) print(meu_maximo_infinito(**dicionario))
while True: try: n = int(input()) v = [] for i in range(n): v.append(float(input())) print(sorted(v)[0]) except EOFError: break
while True: try: n = int(input()) v = [] for i in range(n): v.append(float(input())) print(sorted(v)[0]) except EOFError: break
BOARD = 1 OUT = 1 IN = 1 HIGH = 1 LOW = 1 def setmode(*args, **kwargs): print('moch gpio setmode') def setup(*args, **kwargs): print('moch gpio setup') def output(*args, **kwargs): print('moch gpio output') def cleanup(): print('moch gpio clean up') def setwarnings(*args, **kwargs): print('set...
board = 1 out = 1 in = 1 high = 1 low = 1 def setmode(*args, **kwargs): print('moch gpio setmode') def setup(*args, **kwargs): print('moch gpio setup') def output(*args, **kwargs): print('moch gpio output') def cleanup(): print('moch gpio clean up') def setwarnings(*args, **kwargs): print('set ...
""" function 1 : find_pairs @param list : list of numbers @param sum : sum to find @return pairs : list of pairs @author : Josue Lubaki """ def find_pairs(list, sum): pairs = [] for (i, a) in enumerate(list): for (_, b) in enumerate(list[i+1:]): if a + b == sum: ...
""" function 1 : find_pairs @param list : list of numbers @param sum : sum to find @return pairs : list of pairs @author : Josue Lubaki """ def find_pairs(list, sum): pairs = [] for (i, a) in enumerate(list): for (_, b) in enumerate(list[i + 1:]): if a + b == sum: ...
class Shirt: PRICE = 500 def __init__(self, quantity): self._total_cost = quantity * Shirt.PRICE print("Total cost:", self._total_cost) if __name__ == "__main__": shirt = Shirt(5);
class Shirt: price = 500 def __init__(self, quantity): self._total_cost = quantity * Shirt.PRICE print('Total cost:', self._total_cost) if __name__ == '__main__': shirt = shirt(5)
# structure of a node in a doubly linked list class Node: def __init__(self, val, next_node=None, prev_node=None): """ Node constructor, next and prev are optional """ self.val = val self.next_node = next_node self.prev_node = prev_node def __str__(self): ...
class Node: def __init__(self, val, next_node=None, prev_node=None): """ Node constructor, next and prev are optional """ self.val = val self.next_node = next_node self.prev_node = prev_node def __str__(self): nn = 'None' if self.next_node is None else s...
class GlobusError(Exception): """ Root of the Globus Exception hierarchy. Stub class. """ class GlobusSDKUsageError(GlobusError, ValueError): """ A ``GlobusSDKUsageError`` may be thrown in cases in which the SDK detects that it is being used improperly. These errors typically indicate...
class Globuserror(Exception): """ Root of the Globus Exception hierarchy. Stub class. """ class Globussdkusageerror(GlobusError, ValueError): """ A ``GlobusSDKUsageError`` may be thrown in cases in which the SDK detects that it is being used improperly. These errors typically indicate ...
__all__ = ["adjust_energy", "check_imputed_energies", "csv2hdf5", "mergetelescopes.py", "merge_wrapper", "normalisation", "process_star", "process_superstar", "root2csv", "newmultidirs.py", "remove_events", ...
__all__ = ['adjust_energy', 'check_imputed_energies', 'csv2hdf5', 'mergetelescopes.py', 'merge_wrapper', 'normalisation', 'process_star', 'process_superstar', 'root2csv', 'newmultidirs.py', 'remove_events', 'process', 'melibea']
def lint_output(tool_xml, lint_ctx): outputs = tool_xml.findall("./outputs/data") if not outputs: lint_ctx.warn("Tool contains no outputs, most tools should produce outputs.") return num_outputs = 0 for output in outputs: num_outputs += 1 output_attrib = output.attrib ...
def lint_output(tool_xml, lint_ctx): outputs = tool_xml.findall('./outputs/data') if not outputs: lint_ctx.warn('Tool contains no outputs, most tools should produce outputs.') return num_outputs = 0 for output in outputs: num_outputs += 1 output_attrib = output.attrib ...
BASE_URL = "https://www.codewars.com/" USERNAME = "_behelit" HEADERS = { "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " "AppleWebKit/537.36 (KHTML, like Gecko) " "Chrome/76.0.3809.100 " "Safari/537.36", } DATA = { "utf8": "", "user[remember_me]": "true", }
base_url = 'https://www.codewars.com/' username = '_behelit' headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36'} data = {'utf8': '', 'user[remember_me]': 'true'}
class DataObject: header = '' def __init__(self, name): self.name = name if self.name == None: self.name = '' self.print_str = ' ' * 20 self.calories = 0 self.cal_carbs = 0 self.cal_fat = 0 self.cal_protein = 0 self.carbs = 0 ...
class Dataobject: header = '' def __init__(self, name): self.name = name if self.name == None: self.name = '' self.print_str = ' ' * 20 self.calories = 0 self.cal_carbs = 0 self.cal_fat = 0 self.cal_protein = 0 self.carbs = 0 s...
__all__ = ["Definition", "find_file"] class Definition(object): ''' All Definitions should inherit this. For a given subject and session within the API, the definition is used to create a given mask, map, etc. Definitions have an init function which the users uses to specify how they want the ...
__all__ = ['Definition', 'find_file'] class Definition(object): """ All Definitions should inherit this. For a given subject and session within the API, the definition is used to create a given mask, map, etc. Definitions have an init function which the users uses to specify how they want the d...
""" Design a data structure that supports the following two operations: void addWord(word) bool search(word) search(word) can search a literal word or a regular expression string containing only letters a-z or .. A . means it can represent any one letter. For example: addWord("bad") addWord("dad") addWord("mad") sea...
""" Design a data structure that supports the following two operations: void addWord(word) bool search(word) search(word) can search a literal word or a regular expression string containing only letters a-z or .. A . means it can represent any one letter. For example: addWord("bad") addWord("dad") addWord("mad") sea...
def is_valid(i): # check if the number at index i is valid, i.e. the sum of two numbers in the previous 25 numbers test_range = xmas_data[i - preamble:i] test_value = xmas_data[i] for a in test_range: if (b := test_value - a) in test_range and a != b: return True return False ...
def is_valid(i): test_range = xmas_data[i - preamble:i] test_value = xmas_data[i] for a in test_range: if (b := (test_value - a)) in test_range and a != b: return True return False f_name = 'input.txt' with open(f_name, 'r') as f: xmas_data = [int(x.strip('\n')) for x in f.readli...
class ClassB(object): def kw_1(self): pass
class Classb(object): def kw_1(self): pass
def qt(a): res = 0 n = len(a) ldial, rdial = {}, {} threat = [] for i in range(n): j = a[i] threat.append(0) if i + j in ldial: threat[i] += 1 pre = ldial[i + j][-1] threat[pre] += 1 if threat[pre] == 4: return 4...
def qt(a): res = 0 n = len(a) (ldial, rdial) = ({}, {}) threat = [] for i in range(n): j = a[i] threat.append(0) if i + j in ldial: threat[i] += 1 pre = ldial[i + j][-1] threat[pre] += 1 if threat[pre] == 4: retu...
# https://leetcode.com/problems/maximum-population-year def maximum_population(logs): population_by_year = {} for [birth, death] in logs: for year in range(birth, death): if year in population_by_year: population_by_year[year] += 1 else: popu...
def maximum_population(logs): population_by_year = {} for [birth, death] in logs: for year in range(birth, death): if year in population_by_year: population_by_year[year] += 1 else: population_by_year[year] = 1 earliest_year = 0 max_populat...
n=5 for i in range (n): for j in range (i,n-1): print(' ', end='') for k in range (i+1): print('* ', end='') for l in range (i+1, n): print(' ', end=' ') for m in range (i+1): print('* ', end='') print()
n = 5 for i in range(n): for j in range(i, n - 1): print(' ', end='') for k in range(i + 1): print('* ', end='') for l in range(i + 1, n): print(' ', end=' ') for m in range(i + 1): print('* ', end='') print()
# Basic config for stuff that can be easily changed, but which is git-managed. # See also apikeys_sample.py for the configs which are _not_ git-managed. #server_domain = "http://www.infiniteglitch.net" server_domain = "http://50.116.55.59" http_port = 8888 # Port for the main web site, in debug mode renderer_port = 88...
server_domain = 'http://50.116.55.59' http_port = 8888 renderer_port = 8889 max_track_length = 400 min_track_length = 90
# Definition for singly-linked list. class ListNode: def __init__(self, val): self.val = val self.next = None # the pointer node1 = ListNode(2) node2 = ListNode(5) node3 = ListNode(7) node1.next = node2 # 2->5 node2.next = node3 # 5->7 # the entire linked list : 2->5->7 while node1: pr...
class Listnode: def __init__(self, val): self.val = val self.next = None node1 = list_node(2) node2 = list_node(5) node3 = list_node(7) node1.next = node2 node2.next = node3 while node1: print(node1.val) node1 = node1.next
#To Calculate Surface area of a cylinder #Formula = (2*3.14*r*h)+( 2*3.14*r*r) r=float(input('Enter the radius of the Cylinder: ')) h=float(input('Enter the height of the Cylinder: ')) SA= (2*3.14*r*h) + ( 2*3.14*r*r) print('The Surface Area is:', SA,'sq. m')
r = float(input('Enter the radius of the Cylinder: ')) h = float(input('Enter the height of the Cylinder: ')) sa = 2 * 3.14 * r * h + 2 * 3.14 * r * r print('The Surface Area is:', SA, 'sq. m')
# see credits.txt aliceblue = "#F0F8FF" antiquewhite = "#FAEBD7" aqua = "#00FFFF" aquamarine = "#7FFFD4" azure = "#F0FFFF" beige = "#F5F5DC" bisque = "#FFE4C4" blanchedalmond = "#FFEBCD" blue = "#0000FF" blueviolet = "#8A2BE2" brown = "#A52A2A" burlywood = "#DEB887" cadetblue = "#5F9EA0" chocolate = "#D2691E" coral = ...
aliceblue = '#F0F8FF' antiquewhite = '#FAEBD7' aqua = '#00FFFF' aquamarine = '#7FFFD4' azure = '#F0FFFF' beige = '#F5F5DC' bisque = '#FFE4C4' blanchedalmond = '#FFEBCD' blue = '#0000FF' blueviolet = '#8A2BE2' brown = '#A52A2A' burlywood = '#DEB887' cadetblue = '#5F9EA0' chocolate = '#D2691E' coral = '#FF7F50' cornflowe...
courses = {} line = input() while line != "end": course_info = line.split(" : ") type_course = course_info[0] student_name = course_info[1] courses.setdefault(type_course, []).append(student_name) line = input() sorted_courses = dict(sorted(courses.items(), key=lambda x: (-len(x[1])))) for curr...
courses = {} line = input() while line != 'end': course_info = line.split(' : ') type_course = course_info[0] student_name = course_info[1] courses.setdefault(type_course, []).append(student_name) line = input() sorted_courses = dict(sorted(courses.items(), key=lambda x: -len(x[1]))) for current_cou...
def saveThePrisoner(n, m, s): if (m+s-1)%n==0: print(n) else: print((m+s-1)%n) if __name__ == '__main__': t = int(input()) for t_itr in range(t): nms = input().split() n = int(nms[0]) m = int(nms[1]) s = int(nms[2]) saveThePrisoner(n, m, s) ...
def save_the_prisoner(n, m, s): if (m + s - 1) % n == 0: print(n) else: print((m + s - 1) % n) if __name__ == '__main__': t = int(input()) for t_itr in range(t): nms = input().split() n = int(nms[0]) m = int(nms[1]) s = int(nms[2]) save_the_prisone...
del_items(0x8009F828) SetType(0x8009F828, "void VID_OpenModule__Fv()") del_items(0x8009F8E8) SetType(0x8009F8E8, "void InitScreens__Fv()") del_items(0x8009F9D8) SetType(0x8009F9D8, "void MEM_SetupMem__Fv()") del_items(0x8009FA04) SetType(0x8009FA04, "void SetupWorkRam__Fv()") del_items(0x8009FA94) SetType(0x8009FA94, "...
del_items(2148137000) set_type(2148137000, 'void VID_OpenModule__Fv()') del_items(2148137192) set_type(2148137192, 'void InitScreens__Fv()') del_items(2148137432) set_type(2148137432, 'void MEM_SetupMem__Fv()') del_items(2148137476) set_type(2148137476, 'void SetupWorkRam__Fv()') del_items(2148137620) set_type(21481376...
xa = {1, 2, 31, 41, 5} pp = {1, 2, 3, 4, 5, 6} pp = xa.clear() # Complementary to Intersection print("XA:\n", xa, "\nPP:\n", pp)
xa = {1, 2, 31, 41, 5} pp = {1, 2, 3, 4, 5, 6} pp = xa.clear() print('XA:\n', xa, '\nPP:\n', pp)
# -*- coding: utf-8 -*- """Top-level package for Docker Auto Labels.""" __author__ = """Sebastian Ramirez""" __email__ = 'tiangolo@gmail.com' __version__ = '0.2.3'
"""Top-level package for Docker Auto Labels.""" __author__ = 'Sebastian Ramirez' __email__ = 'tiangolo@gmail.com' __version__ = '0.2.3'
""" @generated cargo-raze generated Bazel file. DO NOT EDIT! Replaced on runs of cargo-raze """ load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") # buildifier: disable=load load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # buildifier: disable=load load("@bazel_tools//too...
""" @generated cargo-raze generated Bazel file. DO NOT EDIT! Replaced on runs of cargo-raze """ load('@bazel_tools//tools/build_defs/repo:git.bzl', 'new_git_repository') load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive') load('@bazel_tools//tools/build_defs/repo:utils.bzl', 'maybe') _dependencies = {...
class ConnectionError(Exception): def __init__(self, response, content=None, message=None): self.response = response self.content = content self.message = message def __str__(self): message = "Failed." if hasattr(self.response, 'status_code'): message += " R...
class Connectionerror(Exception): def __init__(self, response, content=None, message=None): self.response = response self.content = content self.message = message def __str__(self): message = 'Failed.' if hasattr(self.response, 'status_code'): message += ' R...
HOST = '0.0.0.0' PORT = '8160' #opencv supported formats IMAGE_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'jpe', 'jp2', 'bmp', 'dip', 'pbm', 'pgm', 'ppm', 'sr', 'ras', 'tiff', 'tif', 'exr'])
host = '0.0.0.0' port = '8160' image_extensions = set(['png', 'jpg', 'jpeg', 'jpe', 'jp2', 'bmp', 'dip', 'pbm', 'pgm', 'ppm', 'sr', 'ras', 'tiff', 'tif', 'exr'])
def unique_num(arr): new = [] for val in arr: if val not in new: new.append(val) return new print(unique_num([2, 3, 3, 2, 1, 4, 5]))
def unique_num(arr): new = [] for val in arr: if val not in new: new.append(val) return new print(unique_num([2, 3, 3, 2, 1, 4, 5]))
# Usage: # ip, status_code = parse_line(line) def parse_line(line): parts = line.split() return (parts[0], int(parts[8])) class AccessLog(object): def __init__(self, path_to_logfile): # TODO: Implement self.ip_set = set([]) self.status_count = {} # open file , do parse_lin...
def parse_line(line): parts = line.split() return (parts[0], int(parts[8])) class Accesslog(object): def __init__(self, path_to_logfile): self.ip_set = set([]) self.status_count = {} f = open('access.log', 'r') while 1: row = f.readline() if not row:...
class KafqaStoreNode: """ Implements a distributed key-value store's node. """ def __init__(self, name, host, port='80'): self.name = name self.host = host self.port = port self.hashtable = dict() self.reverse_lookup_hashtables = dict() return d...
class Kafqastorenode: """ Implements a distributed key-value store's node. """ def __init__(self, name, host, port='80'): self.name = name self.host = host self.port = port self.hashtable = dict() self.reverse_lookup_hashtables = dict() return de...
# coding=utf-8 class message(object): '''Wrapper class for the messages sent in the blockchain. It has a header of type 'message_header' and a payload of type 'message_payload' The content type matches the message 'type' attribute''' def __init__(self, header, payload): self.check_types(header,...
class Message(object): """Wrapper class for the messages sent in the blockchain. It has a header of type 'message_header' and a payload of type 'message_payload' The content type matches the message 'type' attribute""" def __init__(self, header, payload): self.check_types(header, payload) ...
class Vehicle: def __init__(self, type, model, price): self.type = type self.model = model self.price = price self.owner = None def buy(self, money: int, name: str): if self.price > money: return "Sorry, not enough money" elif self.owner: ...
class Vehicle: def __init__(self, type, model, price): self.type = type self.model = model self.price = price self.owner = None def buy(self, money: int, name: str): if self.price > money: return 'Sorry, not enough money' elif self.owner: ...
def count_list(lists): count = 0 for num in lists: if num == 4: count += 1 return count new_list = [34, 4, 56, 4, 22] print (count_list(new_list))
def count_list(lists): count = 0 for num in lists: if num == 4: count += 1 return count new_list = [34, 4, 56, 4, 22] print(count_list(new_list))
# -*- coding: utf-8 -*- while True: res = 0 d = {} n = int(input()) if n == 0: break v = list(map(int, input().split())) for num in v: if str(num) not in d.keys(): d[str(num)] = 1 else: d[str(num)] += 1 for k in d: if d[...
while True: res = 0 d = {} n = int(input()) if n == 0: break v = list(map(int, input().split())) for num in v: if str(num) not in d.keys(): d[str(num)] = 1 else: d[str(num)] += 1 for k in d: if d[k] % 2 != 0: res = int(k) ...
# Author: Bhavith C # Python Programming print("Hello World!")
print('Hello World!')
class AttachmentSchema: media_url: str filename: str dimensions: dict class Attachment: def __init__(self, attachment: AttachmentSchema, client): self.media_url = attachment.get("media_url") self.filename = attachment.get("filename") self.dimensions = attachment.get("...
class Attachmentschema: media_url: str filename: str dimensions: dict class Attachment: def __init__(self, attachment: AttachmentSchema, client): self.media_url = attachment.get('media_url') self.filename = attachment.get('filename') self.dimensions = attachment.get('dimensions...
""" Add datascience """ name = "20201030143800_add_datascience" dependencies = ["20201008172100_issue_name_index"] def upgrade(db): db.teams.insert_one({"name": "datascience"}) def downgrade(db): db.teams.delete_one({'name': 'datascience'})
""" Add datascience """ name = '20201030143800_add_datascience' dependencies = ['20201008172100_issue_name_index'] def upgrade(db): db.teams.insert_one({'name': 'datascience'}) def downgrade(db): db.teams.delete_one({'name': 'datascience'})
{ "targets": [ { "include_dirs": [ "<!(node -e \"require('nan')\")" ], "cflags_cc": [ "-O2" ], "libraries": [ ], "target_name": "addon", "sources": [ ...
{'targets': [{'include_dirs': ['<!(node -e "require(\'nan\')")'], 'cflags_cc': ['-O2'], 'libraries': [], 'target_name': 'addon', 'sources': ['./src/native/main.cpp', './src/native/deviceinfo.cpp', './src/native/devicecontrol.cpp', './src/native/ipforward_entry.cpp', './src/native/create_device_file.cpp', './src/native/...
class Rect(object): def __init__(self, *args): try: if len(args) == 4: self.x, self.y, self.w, self.h = args elif len(args) == 2: self.x, self.y = args[0] self.w, self.h = args[1] else: raise Exception() ...
class Rect(object): def __init__(self, *args): try: if len(args) == 4: (self.x, self.y, self.w, self.h) = args elif len(args) == 2: (self.x, self.y) = args[0] (self.w, self.h) = args[1] else: raise exception...
def Solve(board): board.Draw() find = Find_Empty(board) if not find: return True else: row, col = find for i in range(1, 10): if Valid(board, i, (row, col)): board.Get_Board()[row][col] = i if Solve(board): return True bo...
def solve(board): board.Draw() find = find__empty(board) if not find: return True else: (row, col) = find for i in range(1, 10): if valid(board, i, (row, col)): board.Get_Board()[row][col] = i if solve(board): return True bo...
# parsetab.py # This file is automatically generated. Do not edit. _tabversion = '3.2' _lr_method = 'LALR' _lr_signature = '|\x03\xc9\x8fL\xea\xa0\xa2`v\xc7\xe5\xf6L\xd3\xd2' _lr_action_items = {'NUMBER':([3,8,12,15,33,35,39,40,43,50,52,54,55,56,57,58,63,64,65,67,68,69,71,73,74,76,77,78,79,80,81,82,83,84,85,86,...
_tabversion = '3.2' _lr_method = 'LALR' _lr_signature = '|\x03É\x8fLê\xa0¢`vÇåöLÓÒ' _lr_action_items = {'NUMBER': ([3, 8, 12, 15, 33, 35, 39, 40, 43, 50, 52, 54, 55, 56, 57, 58, 63, 64, 65, 67, 68, 69, 71, 73, 74, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 96, 98, 100, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,...
def solution(A): counter = {} for num in range(1,len(A)+1): counter[num] = 0 for num in A: if num in counter: counter[num] += 1 if counter[num] > 1: return 0 else: return 0 return 1 A = [4, 1, 3, 2] solution(A)
def solution(A): counter = {} for num in range(1, len(A) + 1): counter[num] = 0 for num in A: if num in counter: counter[num] += 1 if counter[num] > 1: return 0 else: return 0 return 1 a = [4, 1, 3, 2] solution(A)
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'test_db', 'USER':'postgres', 'PASSWORD': 'Cat.iquality@gmail.com', 'HOST': '127.0.0.1', 'PORT': '5432' } }
databases = {'default': {'ENGINE': 'django.db.backends.postgresql', 'NAME': 'test_db', 'USER': 'postgres', 'PASSWORD': 'Cat.iquality@gmail.com', 'HOST': '127.0.0.1', 'PORT': '5432'}}
MAIN_SECTOR = [ 'Government', 'Private', 'NGO', 'Entrepreneur', 'Farmer', 'Student', 'Other', ] SUBSECTOR = [ 'Central Government', 'IAS', 'IPS', 'IFoS', 'Other UPSC Services', 'ICAR', 'State-Agriculture', 'State-Forestry', 'State-Revenue', 'State-Pol...
main_sector = ['Government', 'Private', 'NGO', 'Entrepreneur', 'Farmer', 'Student', 'Other'] subsector = ['Central Government', 'IAS', 'IPS', 'IFoS', 'Other UPSC Services', 'ICAR', 'State-Agriculture', 'State-Forestry', 'State-Revenue', 'State-Police', 'State-Cooperatives', 'State-Corporations', 'State-Other bodies', '...
# # PySNMP MIB module COM21-HCXVOICE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/COM21-HCXVOICE-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:26:26 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, ...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, value_size_constraint, single_value_constraint, constraints_intersection, constraints_union) ...
GET = 'GET' POST = 'POST' PUT = 'PUT' DELETE = 'DELETE'
get = 'GET' post = 'POST' put = 'PUT' delete = 'DELETE'
#!/usr/bin/env python # Prasanna Sritharan, February 2019 # Adapted from Line Tweetbot by Mark Jordan, https://github.com/mjordan/linetweetbot #from tweepy import * """ Config variables """ # Set up authentication for this Twitter app. oa_access_token = '' oa_access_token_secret = '' consumer_key = '' consumer_sec...
""" Config variables """ oa_access_token = '' oa_access_token_secret = '' consumer_key = '' consumer_secret = '' max_tweet_length = 280 data_file_name = 'walkersmanlyexer00walk_0_djvu.txt' tweet_separator = ' [...]' '\nFunctions\n' def get_chunks(line): """ Breaks lines up into chunks of a maximum of 140 chara...
SETTING_FILENAME = 'filename' SETTING_RECENT_FILES = 'recentFiles' SETTING_WIN_SIZE = 'window/size' SETTING_WIN_POSE = 'window/position' SETTING_WIN_GEOMETRY = 'window/geometry' SETTING_LINE_COLOR = 'line/color' SETTING_FILL_COLOR = 'fill/color' SETTING_ADVANCE_MODE = 'advanced' SETTING_WIN_STATE = 'window/state' SETTI...
setting_filename = 'filename' setting_recent_files = 'recentFiles' setting_win_size = 'window/size' setting_win_pose = 'window/position' setting_win_geometry = 'window/geometry' setting_line_color = 'line/color' setting_fill_color = 'fill/color' setting_advance_mode = 'advanced' setting_win_state = 'window/state' setti...
# Source and destination file names. test_source = "data/math.txt" test_destination = "math_output_latex.html" # Keyword parameters passed to publish_file. reader_name = "standalone" parser_name = "rst" writer_name = "html" # Settings settings_overrides['math_output'] = 'latex' # local copy of default stylesheet: set...
test_source = 'data/math.txt' test_destination = 'math_output_latex.html' reader_name = 'standalone' parser_name = 'rst' writer_name = 'html' settings_overrides['math_output'] = 'latex' settings_overrides['stylesheet_path'] = 'functional/input/data/html4css1.css'
# -*- coding: utf-8 -*- # Copyright 2019 Cohesity Inc. class BasicClusterInfo(object): """Implementation of the 'BasicClusterInfo' model. Specifies basic information about the Cohesity Cluster. Attributes: authentication_type (AuthenticationTypeEnum): Specifies the authentication sc...
class Basicclusterinfo(object): """Implementation of the 'BasicClusterInfo' model. Specifies basic information about the Cohesity Cluster. Attributes: authentication_type (AuthenticationTypeEnum): Specifies the authentication scheme for the cluster. 'kPasswordOnly' indicates ...
A,B,C= input().split() if (A==B) and (B==C): print('Yes') else: print('No')
(a, b, c) = input().split() if A == B and B == C: print('Yes') else: print('No')
""" Utilities for handling English Language rules. """ def add_indefinite_article(phrase): """ Given a word, choose the appropriate indefinite article (e.g., "a" or "an") and add it the front of the word. Matches the original word's capitalization. Args: phrase (str): The phrase to get t...
""" Utilities for handling English Language rules. """ def add_indefinite_article(phrase): """ Given a word, choose the appropriate indefinite article (e.g., "a" or "an") and add it the front of the word. Matches the original word's capitalization. Args: phrase (str): The phrase to get th...
def escreva(msg): print('^' * (len(msg) + 4)) print(f' {msg}') print('^' * (len(msg) + 4)) escreva('oii')
def escreva(msg): print('^' * (len(msg) + 4)) print(f' {msg}') print('^' * (len(msg) + 4)) escreva('oii')
# x and y store the position of the ellipse x = 0 y = 0 # the x and y speed of the ellipse x_speed = 5 y_speed = 5 # the dimensions of the ellipse ellipse_width = 100 ellipse_height = 50 # setup gets called once def setup(): # the global keyword must be used as x and y are getting changed and they are global var...
x = 0 y = 0 x_speed = 5 y_speed = 5 ellipse_width = 100 ellipse_height = 50 def setup(): global x, y size(1280, 720) x = width / 2 y = height / 2 def draw(): global x, y background(0) no_stroke() ellipse(x, y, ellipse_width, ellipse_height) check_edges() x += x_speed y += y...
print('Ingrese:') cadena=input() cadena=cadena.split(' ') terminales=['void','int','float','a','{','}','(',')','return','instrucciones'] no_terminales=['S','TipoDato','Identificador','Letra','RestoLetra','Retorno','$'] tabla = {"S":{"void":["void","Identificador","(",")","{","instrucciones","}"], "int":["T...
print('Ingrese:') cadena = input() cadena = cadena.split(' ') terminales = ['void', 'int', 'float', 'a', '{', '}', '(', ')', 'return', 'instrucciones'] no_terminales = ['S', 'TipoDato', 'Identificador', 'Letra', 'RestoLetra', 'Retorno', '$'] tabla = {'S': {'void': ['void', 'Identificador', '(', ')', '{', 'instrucciones...
class Tuple3d(): """docstring for Tuple3D""" x = 0.0 y = 0.0 z = 0.0 def __init__(self, x: float, y: float, z: float): self.x = x self.y = y self.z = z @classmethod def fromTuple3d(self, parent: "Tuple3d") -> "Tuple3d": return Tuple3d(parent.x, parent.y, pa...
class Tuple3D: """docstring for Tuple3D""" x = 0.0 y = 0.0 z = 0.0 def __init__(self, x: float, y: float, z: float): self.x = x self.y = y self.z = z @classmethod def from_tuple3d(self, parent: 'Tuple3d') -> 'Tuple3d': return tuple3d(parent.x, parent.y, pare...
def binary_search(arr: list, left: int, right: int, key: int) -> int: """Iterative Binary Search""" if left > right: return -1 while left <= right: mid = left + (right - left) // 2 if arr[mid] == key: return mid elif arr[mid] < key: left = mid + 1 ...
def binary_search(arr: list, left: int, right: int, key: int) -> int: """Iterative Binary Search""" if left > right: return -1 while left <= right: mid = left + (right - left) // 2 if arr[mid] == key: return mid elif arr[mid] < key: left = mid + 1 ...
def saddle_points(m): if len(m) == 0: return set() if any(len(m[0]) != len(m[i]) for i in range(1, len(m))): raise ValueError('irregular matrix') rowMaxs = [sorted(r, reverse=True)[0] for r in m] colMins = [sorted(c)[0] for c in [[m[r][c] for r in r...
def saddle_points(m): if len(m) == 0: return set() if any((len(m[0]) != len(m[i]) for i in range(1, len(m)))): raise value_error('irregular matrix') row_maxs = [sorted(r, reverse=True)[0] for r in m] col_mins = [sorted(c)[0] for c in [[m[r][c] for r in range(len(m))] for c in range(len(m...
class SurrogateModelSimulator(): """ This class may be used as a surrogate for other simulation models. It has a dictionary that represents the current state and a set of :class:`SimulationMetaModels <MetaModelSimulator>` that may mimic the output functions of the original model. :param params: d...
class Surrogatemodelsimulator: """ This class may be used as a surrogate for other simulation models. It has a dictionary that represents the current state and a set of :class:`SimulationMetaModels <MetaModelSimulator>` that may mimic the output functions of the original model. :param params: dict...
# for @security_policy @playready @security_level SECURITY_LEVEL = (150, 2000, 3000) LEVEL_150 = SECURITY_LEVEL[0] # 'LEVEL_150', LEVEL_2000 = SECURITY_LEVEL[1] # 'LEVEL_2000' LEVEL_3000 = SECURITY_LEVEL[2] # 'LEVEL_3000' def check(playready_security_level) -> bool: return playready_security_level in SECURITY_...
security_level = (150, 2000, 3000) level_150 = SECURITY_LEVEL[0] level_2000 = SECURITY_LEVEL[1] level_3000 = SECURITY_LEVEL[2] def check(playready_security_level) -> bool: return playready_security_level in SECURITY_LEVEL
#!/usr/bin/python3 STATE = { 'running' : True, 'paused' : False, 'text' : False, 'explore' : True } TEXT = { 'file' : 'text_settings.txt', 'type' : 'dict', 'data' : { 'int' : { 'type' : 'int', 'data' : { ...
state = {'running': True, 'paused': False, 'text': False, 'explore': True} text = {'file': 'text_settings.txt', 'type': 'dict', 'data': {'int': {'type': 'int', 'data': {'': 0}}, 'float': {'type': 'float', 'data': {'spd': 0.06, 'dly': 0.0}}, 'list': {'type': 'list', 'data': {'type': 'int', 'data': {'player_clr': [255, 2...
# This sample tests for/else loops for cases where variables # are potentially unbound. # For with no break and no else. def func1(): for x in []: a = 0 # This should generate a "potentially unbound" error. print(a) # This should generate a "potentially unbound" error. print(x) # For w...
def func1(): for x in []: a = 0 print(a) print(x) def func2(): for x in []: a = 0 else: b = 0 print(a) print(b) print(x) def func3(): for x in []: a = 0 break else: b = 0 print(a) print(b) print(x)
class ConstraintError(Exception): pass class ValidationError(Exception): pass
class Constrainterror(Exception): pass class Validationerror(Exception): pass
# 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 search(self, node): if not node: return None if not node.left and not node....
class Solution: def search(self, node): if not node: return None if not node.left and (not node.right): return node ret = self.search(node.left) if node.left: node.left.right = node node.left.left = node.right node.left = None ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'WMS Accounting', 'version': '1.1', 'summary': 'Inventory, Logistic, Valuation, Accounting', 'description': """ WMS Accounting module ====================== This module makes the link between th...
{'name': 'WMS Accounting', 'version': '1.1', 'summary': 'Inventory, Logistic, Valuation, Accounting', 'description': "\nWMS Accounting module\n======================\nThis module makes the link between the 'stock' and 'account' modules and allows you to create accounting entries to value your stock movements\n\nKey Fea...
EXTRACTORS = { "dlib-hog-face5": {"type": "dlib", "detector": "hog", "keypoints": "face5",}, "dlib-hog-face68": {"type": "dlib", "detector": "hog", "keypoints": "face68",}, "dlib-cnn-face5": {"type": "dlib", "detector": "cnn", "keypoints": "face5",}, "dlib-cnn-face68": {"type": "dlib", "detector": "cnn"...
extractors = {'dlib-hog-face5': {'type': 'dlib', 'detector': 'hog', 'keypoints': 'face5'}, 'dlib-hog-face68': {'type': 'dlib', 'detector': 'hog', 'keypoints': 'face68'}, 'dlib-cnn-face5': {'type': 'dlib', 'detector': 'cnn', 'keypoints': 'face5'}, 'dlib-cnn-face68': {'type': 'dlib', 'detector': 'cnn', 'keypoints': 'face...
algorithm='ddpg' env_class='Gym' model_class='LowDim2x' environment = { 'name': 'BipedalWalker-v2' } model = { 'state_size': 24, 'action_size': 4 } agent = { 'action_size': 4, 'evaluation_only': True } train = { 'n_episodes': 10000, 'max_t': 2000, 'solve_score': 300.0 }
algorithm = 'ddpg' env_class = 'Gym' model_class = 'LowDim2x' environment = {'name': 'BipedalWalker-v2'} model = {'state_size': 24, 'action_size': 4} agent = {'action_size': 4, 'evaluation_only': True} train = {'n_episodes': 10000, 'max_t': 2000, 'solve_score': 300.0}
# Category description for the widget registry NAME = "Wofry ESRF Extension" DESCRIPTION = "Widgets for Wofry" BACKGROUND = "#ada8a8" ICON = "icons/esrf2.png" PRIORITY = 14
name = 'Wofry ESRF Extension' description = 'Widgets for Wofry' background = '#ada8a8' icon = 'icons/esrf2.png' priority = 14
# Enter your code here. Read input from STDIN. Print output to STDOUT def isprime(x): if x == 1: return False elif x == 2: return True else: if x % 2 == 0: return False else: bound = int(x**0.5) for counter in range(3, bound+1, 2): if x % c...
def isprime(x): if x == 1: return False elif x == 2: return True elif x % 2 == 0: return False else: bound = int(x ** 0.5) for counter in range(3, bound + 1, 2): if x % counter == 0: return False return True size = int(input()) ...
# Let's use christmas date as an example # Who doesn't like christmas? :) # 2021-12-25 YYYY_MM_DD = "%Y-%m-%d" # 25-12-2021 DD_MM_YYYY = "%d-%m-%Y" # 12-25-2021 MM_DD_YYYY = "%m-%d-%Y" # 12-2021 MM_YYYY = "%m-%Y" # 2021-12 YYYY_MM = "%Y-%m" # December 25, 2021 MONTH_SPACE_DD_COMA_SPACE_YYYY = "%B %d, %Y"
yyyy_mm_dd = '%Y-%m-%d' dd_mm_yyyy = '%d-%m-%Y' mm_dd_yyyy = '%m-%d-%Y' mm_yyyy = '%m-%Y' yyyy_mm = '%Y-%m' month_space_dd_coma_space_yyyy = '%B %d, %Y'
NAME = 'drf-querystringfilter' VERSION = __version__ = "2.1.0" __author__ = 'sax'
name = 'drf-querystringfilter' version = __version__ = '2.1.0' __author__ = 'sax'
def main(): while True: num = int(input()) print(num ** 2, flush = True) if num < 0: return if __name__ == '__main__': main()
def main(): while True: num = int(input()) print(num ** 2, flush=True) if num < 0: return if __name__ == '__main__': main()
''' The MIT License (MIT) Copyright (c) 2016 WavyCloud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, p...
""" The MIT License (MIT) Copyright (c) 2016 WavyCloud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, p...
class Motor: def __init__(self, cilindros, tipo='gasolina') -> None: self.cilindros = cilindros self.tipo = tipo self.__temperatura = 0 def inyecta_gasolina(self, cantidad): pass
class Motor: def __init__(self, cilindros, tipo='gasolina') -> None: self.cilindros = cilindros self.tipo = tipo self.__temperatura = 0 def inyecta_gasolina(self, cantidad): pass
#encoding:utf-8 subreddit = 'gtaonline' t_channel = '@redditgtaonline' def send_post(submission, r2t): return r2t.send_simple(submission)
subreddit = 'gtaonline' t_channel = '@redditgtaonline' def send_post(submission, r2t): return r2t.send_simple(submission)
filename = 'programming.txt' with open(filename, 'a') as file_object: file_object.write("I also love finding meaning in large datasets.\n") file_object.write("I love creating apps that can run in a browser.\n")
filename = 'programming.txt' with open(filename, 'a') as file_object: file_object.write('I also love finding meaning in large datasets.\n') file_object.write('I love creating apps that can run in a browser.\n')
class Model(object): def predict(self, X, feature_names): print(X) return X
class Model(object): def predict(self, X, feature_names): print(X) return X
def dErrors(X, y, y_hat): DErrorsDx1 = [X[i][0]*(y[i]-y_hat[i]) for i in range(len(y))] DErrorsDx2 = [X[i][1]*(y[i]-y_hat[i]) for i in range(len(y))] DErrorsDb = [y[i]-y_hat[i] for i in range(len(y))] return DErrorsDx1, DErrorsDx2, DErrorsDb def gradientDescentStep(X, y, W, b, learn_rate = 0.01): y...
def d_errors(X, y, y_hat): d_errors_dx1 = [X[i][0] * (y[i] - y_hat[i]) for i in range(len(y))] d_errors_dx2 = [X[i][1] * (y[i] - y_hat[i]) for i in range(len(y))] d_errors_db = [y[i] - y_hat[i] for i in range(len(y))] return (DErrorsDx1, DErrorsDx2, DErrorsDb) def gradient_descent_step(X, y, W, b, lear...