content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# Largest palindrome product DIGITS = 3 def solve(): return max(p for x in range(10**(DIGITS - 1), 10**DIGITS) for y in range(x, 10**DIGITS) if str(p := x * y) == str(p)[::-1]) if __name__ == "__main__": print(solve())
digits = 3 def solve(): return max((p for x in range(10 ** (DIGITS - 1), 10 ** DIGITS) for y in range(x, 10 ** DIGITS) if str((p := (x * y))) == str(p)[::-1])) if __name__ == '__main__': print(solve())
def format_list(my_list): """ :param my_list: :type: list :return: list separated with ', ' & before the last item add the word 'and ' :rtype: list """ new_list = ', '.join(my_list[0:len(my_list)-1:2]) + " and " + my_list[len(my_list)-1] return new_list def main(): print(format_lis...
def format_list(my_list): """ :param my_list: :type: list :return: list separated with ', ' & before the last item add the word 'and ' :rtype: list """ new_list = ', '.join(my_list[0:len(my_list) - 1:2]) + ' and ' + my_list[len(my_list) - 1] return new_list def main(): print(format_...
# -*- coding: utf-8 -*- """ Created on Sat Jul 3 11:20:06 2021 @author: Easin """ in1 = input() list1 = [] for elem in range(len(in1)): if in1[elem] != "+": list1.append(in1[elem]) #print(list1) list1.sort() str1 = "" for elem in range(len(list1)): str1 += list1[elem]+ "+" print...
""" Created on Sat Jul 3 11:20:06 2021 @author: Easin """ in1 = input() list1 = [] for elem in range(len(in1)): if in1[elem] != '+': list1.append(in1[elem]) list1.sort() str1 = '' for elem in range(len(list1)): str1 += list1[elem] + '+' print(str1[:-1])
def find_longest_palindrome(string): if is_palindrome(string): return string left = find_longest_palindrome(string[:-1]) right = find_longest_palindrome(string[1:]) middle = find_longest_palindrome(string[1:-1]) if len(left) >= len(right) and len(left) >= len(middle): return left ...
def find_longest_palindrome(string): if is_palindrome(string): return string left = find_longest_palindrome(string[:-1]) right = find_longest_palindrome(string[1:]) middle = find_longest_palindrome(string[1:-1]) if len(left) >= len(right) and len(left) >= len(middle): return left ...
class Solution: def mySqrt(self, x: int) -> int: if x < 0 or x>(2**31): return False ans = 0 for i in range(0, x+1): if i**2<=x: ans = i else: break return ans
class Solution: def my_sqrt(self, x: int) -> int: if x < 0 or x > 2 ** 31: return False ans = 0 for i in range(0, x + 1): if i ** 2 <= x: ans = i else: break return ans
# Copyright 2020 The Kythe Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
load('@bazel_skylib//lib:paths.bzl', 'paths') load('@bazel_tools//tools/cpp:toolchain_utils.bzl', 'find_cpp_toolchain') load('//kythe/go/indexer:testdata/go_indexer_test.bzl', 'go_verifier_test') load('//tools/build_rules/verifier_test:verifier_test.bzl', 'KytheEntries') def _rust_extract_impl(ctx): cc_toolchain =...
class Participant: def __init__(self, pa_name, pa_has_somebody_to_gift=False): self._name = pa_name # I don't use this property in my algorithm :P self._has_somebody_to_gift = pa_has_somebody_to_gift @property def name(self): return self._name @name.setter def name...
class Participant: def __init__(self, pa_name, pa_has_somebody_to_gift=False): self._name = pa_name self._has_somebody_to_gift = pa_has_somebody_to_gift @property def name(self): return self._name @name.setter def name(self, pa_name): self._name = pa_name @pro...
def trint(inthing): try: outhing = int(inthing) except: outhing = None return outhing def trfloat(inthing, scale): try: outhing = float(inthing) * scale except: outhing = None return outhing class IMMA: def __init__(self): # Standard instance obj...
def trint(inthing): try: outhing = int(inthing) except: outhing = None return outhing def trfloat(inthing, scale): try: outhing = float(inthing) * scale except: outhing = None return outhing class Imma: def __init__(self): self.data = {} def re...
class Solution: def removeDuplicates(self, nums: List[int]) -> int: count = 1 i = 0 while i <len(nums)-1: if nums[i]!=nums[i+1]: count=1 else: count+=1 if count==2: i+=1 ...
class Solution: def remove_duplicates(self, nums: List[int]) -> int: count = 1 i = 0 while i < len(nums) - 1: if nums[i] != nums[i + 1]: count = 1 else: count += 1 if count == 2: i += 1 ...
# START LAB EXERCISE 02 print('Lab Exercise 02 \n') # SETUP sandwich_string = 'chicken, bread, lettuce, onion, olives' # END SETUP # PROBLEM 1 (4 Points) sandwich_replace = sandwich_string.replace('olives', 'tomato') # PROBLEM 2 (4 Points) # Don't have heavy_cream need to replace with milk sandwich_list = sandwic...
print('Lab Exercise 02 \n') sandwich_string = 'chicken, bread, lettuce, onion, olives' sandwich_replace = sandwich_string.replace('olives', 'tomato') sandwich_list = sandwich_replace.split(', ') sandwich_list.pop(0) sandwich_list.append('cheese') last_item = sandwich_list[-1]
conf_nova_compute_conf = """[DEFAULT] compute_driver = libvirt.LibvirtDriver glance_api_version = 2 [libvirt] virt_type = kvm inject_password = False inject_key = False inject_partition = -2 images_type = rbd images_rbd_pool = vms images_rbd_ceph_conf = /etc/ceph/ceph.conf rbd_user = cinder rbd_secret_uuid = {{ rbd_sec...
conf_nova_compute_conf = '[DEFAULT]\ncompute_driver = libvirt.LibvirtDriver\nglance_api_version = 2\n[libvirt]\nvirt_type = kvm\ninject_password = False\ninject_key = False\ninject_partition = -2\nimages_type = rbd\nimages_rbd_pool = vms\nimages_rbd_ceph_conf = /etc/ceph/ceph.conf\nrbd_user = cinder\nrbd_secret_uuid = ...
compilers_ = { "python": "cpython-head", "c++": "gcc-head", "cpp": "gcc-head", "c": "gcc-head", "c#": "mono-head", "javascript": "nodejs-head", "js": "nodejs-head", "coffeescript": "coffeescript-head", "cs": "coffeescript-head", "java": "openjdk-head", "haskell": "ghc-8.4.2",...
compilers_ = {'python': 'cpython-head', 'c++': 'gcc-head', 'cpp': 'gcc-head', 'c': 'gcc-head', 'c#': 'mono-head', 'javascript': 'nodejs-head', 'js': 'nodejs-head', 'coffeescript': 'coffeescript-head', 'cs': 'coffeescript-head', 'java': 'openjdk-head', 'haskell': 'ghc-8.4.2', 'bash': 'bash', 'cmake': 'cmake-head', 'crys...
"""Contains some helper functions to display time as a nicely formatted string""" intervals = ( ('weeks', 604800), # 60 * 60 * 24 * 7 ('days', 86400), # 60 * 60 * 24 ('hours', 3600), # 60 * 60 ('minutes', 60), ('seconds', 1), ) def display_time(seconds, granularity=2): """Display ti...
"""Contains some helper functions to display time as a nicely formatted string""" intervals = (('weeks', 604800), ('days', 86400), ('hours', 3600), ('minutes', 60), ('seconds', 1)) def display_time(seconds, granularity=2): """Display time as a nicely formatted string""" result = [] if seconds == 0: ...
class News(object): news_id: int title: str image: str def __init__(self, news_id: int, title: str, image: str): self.news_id = news_id self.title = title self.image = image class NewsContent(object): news_id: int title: str content: str def __init__(self, new...
class News(object): news_id: int title: str image: str def __init__(self, news_id: int, title: str, image: str): self.news_id = news_id self.title = title self.image = image class Newscontent(object): news_id: int title: str content: str def __init__(self, news...
class Error(Exception): """ Base class for exceptions in this module """ pass class InstrumentError(Error): """ Exception raised when trying to access a pyvisa instrument that is not connected Attributes ---------- _resourceAddress: str The address of the resource _r...
class Error(Exception): """ Base class for exceptions in this module """ pass class Instrumenterror(Error): """ Exception raised when trying to access a pyvisa instrument that is not connected Attributes ---------- _resourceAddress: str The address of the resource _reso...
""" Programme additionnant une liste de nombres """ def addition(nombres): somme = 0 for nombre in nombres: somme += nombre return somme # Exemple print(addition([1, 2, 3])) # >>> 6
""" Programme additionnant une liste de nombres """ def addition(nombres): somme = 0 for nombre in nombres: somme += nombre return somme print(addition([1, 2, 3]))
numbers = input() list_of_nums = numbers.split(',') tuple_of_nums = tuple(list_of_nums) print(list_of_nums) print(tuple_of_nums)
numbers = input() list_of_nums = numbers.split(',') tuple_of_nums = tuple(list_of_nums) print(list_of_nums) print(tuple_of_nums)
# Generated by h2py z /usr/include/sys/cdio.h CDROM_LBA = 0x01 CDROM_MSF = 0x02 CDROM_DATA_TRACK = 0x04 CDROM_LEADOUT = 0xAA CDROM_AUDIO_INVALID = 0x00 CDROM_AUDIO_PLAY = 0x11 CDROM_AUDIO_PAUSED = 0x12 CDROM_AUDIO_COMPLETED = 0x13 CDROM_AUDIO_ERROR = 0x14 CDROM_AUDIO_NO_STATUS = 0x15 CDROM_DA_NO_SUBCODE = 0x00 CDROM_DA...
cdrom_lba = 1 cdrom_msf = 2 cdrom_data_track = 4 cdrom_leadout = 170 cdrom_audio_invalid = 0 cdrom_audio_play = 17 cdrom_audio_paused = 18 cdrom_audio_completed = 19 cdrom_audio_error = 20 cdrom_audio_no_status = 21 cdrom_da_no_subcode = 0 cdrom_da_subq = 1 cdrom_da_all_subcode = 2 cdrom_da_subcode_only = 3 cdrom_xa_da...
""" A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given: 1/2 = 0.5 1/3 = 0.(3) 1/4 = 0.25 1/5 = 0.2 1/6 = 0.1(6) 1/7 = 0.(142857) 1/8 = 0.125 1/9 = 0.(1) 1/10 = 0.1 Where 0.1(6) means 0...
""" A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given: 1/2 = 0.5 1/3 = 0.(3) 1/4 = 0.25 1/5 = 0.2 1/6 = 0.1(6) 1/7 = 0.(142857) 1/8 = 0.125 1/9 = 0.(1) 1/10 = 0.1 Where 0.1(6) means 0...
""" General-purpose helpers not related to the framework itself (neither to the reactor nor to the engines nor to the structs), which are used to prepare and control the runtime environment. These are things that should better be in the standard library or in the dependencies. Utilities do not depend on anything in t...
""" General-purpose helpers not related to the framework itself (neither to the reactor nor to the engines nor to the structs), which are used to prepare and control the runtime environment. These are things that should better be in the standard library or in the dependencies. Utilities do not depend on anything in t...
def can_build(platform): return platform != "android" def configure(env): pass
def can_build(platform): return platform != 'android' def configure(env): pass
# Divide and Conquer algorithm def find_max(nums, left, right): """ find max value in list :param nums: contains elements :param left: index of first element :param right: index of last element :return: max in nums >>> nums = [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] >>> find_max(nums, 0, len...
def find_max(nums, left, right): """ find max value in list :param nums: contains elements :param left: index of first element :param right: index of last element :return: max in nums >>> nums = [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] >>> find_max(nums, 0, len(nums) - 1) == max(nums) Tr...
""" Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list. The first node is considered odd, and the second node is even, and so on. Note that the relative order inside both the even and odd groups should remain as ...
""" Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list. The first node is considered odd, and the second node is even, and so on. Note that the relative order inside both the even and odd groups should remain as ...
# Copyright 2014 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
load('//go/private:context.bzl', 'go_context') load('//go/private:common.bzl', 'asm_exts', 'cgo_exts', 'go_exts') load('//go/private:providers.bzl', 'GoLibrary', 'GoSDK') load('//go/private/rules:transition.bzl', 'go_transition_rule') load('//go/private:mode.bzl', 'LINKMODE_PLUGIN', 'LINKMODE_SHARED') def _go_binary_i...
#!/bin/env python3 def gift_area(l, w, h): side_a = l*w side_b = w*h side_c = l*h return 2*side_a+2*side_b+2*side_c+min((side_a, side_b, side_c)) def gift_ribbon(l, w, h): side_a = 2*l+2*w side_b = 2*w+2*h side_c = 2*l+2*h ribbon = min((side_a, side_b, side_c)) ribbon += l*w*h r...
def gift_area(l, w, h): side_a = l * w side_b = w * h side_c = l * h return 2 * side_a + 2 * side_b + 2 * side_c + min((side_a, side_b, side_c)) def gift_ribbon(l, w, h): side_a = 2 * l + 2 * w side_b = 2 * w + 2 * h side_c = 2 * l + 2 * h ribbon = min((side_a, side_b, side_c)) ribb...
class C: pass def method(x): pass c = C() method(1)
class C: pass def method(x): pass c = c() method(1)
tb = [54, 0,55,54,61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 0,64,66,61, 0, 0, 0, 0, 0, 0 ,0, 0, 0, 0, 0, 54, 0,55,54,61, 0,66, 0,64] expander = lambda i: [i, 300] if i > 0 else [0,0] tkm = [expander(i) for i in tb] print(tkm)
tb = [54, 0, 55, 54, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 0, 64, 66, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 55, 54, 61, 0, 66, 0, 64] expander = lambda i: [i, 300] if i > 0 else [0, 0] tkm = [expander(i) for i in tb] print(tkm)
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
def enclose_param(param: str) -> str: """ Replace all single quotes in parameter by two single quotes and enclose param in single quote. .. seealso:: https://docs.snowflake.com/en/sql-reference/data-types-text.html#single-quoted-string-constants Examples: .. code-block:: python e...
class MenuItem(Menu, IComponent, IDisposable): """ Represents an individual item that is displayed within a System.Windows.Forms.MainMenu or System.Windows.Forms.ContextMenu. Although System.Windows.Forms.ToolStripMenuItem replaces and adds functionality to the System.Windows.Forms.MenuItem control of previous v...
class Menuitem(Menu, IComponent, IDisposable): """ Represents an individual item that is displayed within a System.Windows.Forms.MainMenu or System.Windows.Forms.ContextMenu. Although System.Windows.Forms.ToolStripMenuItem replaces and adds functionality to the System.Windows.Forms.MenuItem control of previous ver...
class Reflector: alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" def __init__(self, permutation): """ :param permutation: string, mono-alphabetic permutation of the alphabet i.e. YRUHQSLDPXNGOKMIEBFZCWVJAT """ self.permutation = permutation def calc(self, c): """ S...
class Reflector: alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' def __init__(self, permutation): """ :param permutation: string, mono-alphabetic permutation of the alphabet i.e. YRUHQSLDPXNGOKMIEBFZCWVJAT """ self.permutation = permutation def calc(self, c): """ Sw...
if __name__ == '__main__': with open("../R/problem_module.R") as filename: lines = filename.readlines() for line in lines: if "<- function(" in line: function_name = line.split("<-")[0] print(f"### {function_name.strip()}\n") print("#### Ma...
if __name__ == '__main__': with open('../R/problem_module.R') as filename: lines = filename.readlines() for line in lines: if '<- function(' in line: function_name = line.split('<-')[0] print(f'### {function_name.strip()}\n') print('#### Ma...
for t in range(int(input())): word=input() ispalin=True for i in range(int(len(word)/2)): if word[i]=="*" or word[len(word)-1-i]=="*": break elif word[i]!=word[len(word)-1-i]: ispalin=False print(f"#{t+1} Not exist") break else: ...
for t in range(int(input())): word = input() ispalin = True for i in range(int(len(word) / 2)): if word[i] == '*' or word[len(word) - 1 - i] == '*': break elif word[i] != word[len(word) - 1 - i]: ispalin = False print(f'#{t + 1} Not exist') bre...
''' Program implemented to count number of 1's in its binary number ''' def countSetBits(n): if n == 0: return 0 else: return (n&1) + countSetBits(n>>1) n = int(input()) print(countSetBits(n))
""" Program implemented to count number of 1's in its binary number """ def count_set_bits(n): if n == 0: return 0 else: return (n & 1) + count_set_bits(n >> 1) n = int(input()) print(count_set_bits(n))
#in=42 #golden=8 n = input_int() c = 0 while (n > 1): c = c + 1 if n % 2 == 0: n = n // 2 else: n = 3 * n + 1 print(c)
n = input_int() c = 0 while n > 1: c = c + 1 if n % 2 == 0: n = n // 2 else: n = 3 * n + 1 print(c)
#!/usr/bin/env python # -*- coding: utf-8 -*- """Supported media formats. https://kodi.wiki/view/Features_and_supported_formats Media containers: AVI, MPEG, WMV, ASF, FLV, MKV/MKA (Matroska), QuickTime, MP4, M4A, AAC, NUT, Ogg, OGM, RealMedia RAM/RM/RV/RA/RMVB, 3gp, VIVO, PVA, NUV, NSV, NSA, FLI, FLC, DVR-MS, WTV, TRP...
"""Supported media formats. https://kodi.wiki/view/Features_and_supported_formats Media containers: AVI, MPEG, WMV, ASF, FLV, MKV/MKA (Matroska), QuickTime, MP4, M4A, AAC, NUT, Ogg, OGM, RealMedia RAM/RM/RV/RA/RMVB, 3gp, VIVO, PVA, NUV, NSV, NSA, FLI, FLC, DVR-MS, WTV, TRP and F4V """ class Mediacontainers(object): ...
""" ALWAYS START WITH DOCUMENTATION! This code provides functions for calculating area of different shapes Author: Caitlin C. Bannan U.C. Irvine Mobley Group """ def area_square(length): """ Calculates the area of a square. Parameters ---------- length (float or int) length of one side of a sq...
""" ALWAYS START WITH DOCUMENTATION! This code provides functions for calculating area of different shapes Author: Caitlin C. Bannan U.C. Irvine Mobley Group """ def area_square(length): """ Calculates the area of a square. Parameters ---------- length (float or int) length of one side of a squ...
def outer(): a = 0 b = 1 def inner(): print(a) b=4 print(b) # b += 1 # A #b = 4 # B inner() outer() for i in range(10): print(i) print(i)
def outer(): a = 0 b = 1 def inner(): print(a) b = 4 print(b) inner() outer() for i in range(10): print(i) print(i)
class MyClass: count = 0 def __init__(self, val): self.val = self.filterint(val) MyClass.count += 1 @staticmethod def filterint(value): if not isinstance(value, int): print("Entered value is not an INT, value set to 0") return 0 else: ...
class Myclass: count = 0 def __init__(self, val): self.val = self.filterint(val) MyClass.count += 1 @staticmethod def filterint(value): if not isinstance(value, int): print('Entered value is not an INT, value set to 0') return 0 else: ...
# # PySNMP MIB module RETIX-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RETIX-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:47:44 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...
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, constraints_union, value_range_constraint, single_value_constraint, value_size_constraint) ...
class StudentAssignmentService: def __init__(self, student, AssignmentClass): self.assignment = AssignmentClass() self.assignment.student = student self.attempts = 0 self.correct_attempts = 0 def check(self, code): self.attempts += 1 result = self.assignment.chec...
class Studentassignmentservice: def __init__(self, student, AssignmentClass): self.assignment = assignment_class() self.assignment.student = student self.attempts = 0 self.correct_attempts = 0 def check(self, code): self.attempts += 1 result = self.assignment.ch...
# get the dimension of the query location i.e. latitude and logitude # raise an exception of the given query Id not found in the input file def getDimensionsofQueryLoc(inputFile, queryLocId): with open(inputFile) as infile: header = infile.readline().strip() headerIndex={ headerName.lower...
def get_dimensionsof_query_loc(inputFile, queryLocId): with open(inputFile) as infile: header = infile.readline().strip() header_index = {headerName.lower(): index for (index, header_name) in enumerate(header.split(','))} for line in infile: values = line.strip().split(',') ...
n = int(input()) s = input().lower() output = 'YES' for letter in 'abcdefghijklmnopqrstuvwxyz': if letter not in s: output = 'NO' break print(output)
n = int(input()) s = input().lower() output = 'YES' for letter in 'abcdefghijklmnopqrstuvwxyz': if letter not in s: output = 'NO' break print(output)
num1, num2 = 5,0 try: quotient = num1/num2 message = "Quotient is" + ' ' + str(quotient) where (quotient = num1/num2) except ZeroDivisionError: message = "Cannot divide by zero" print(message)
(num1, num2) = (5, 0) try: quotient = num1 / num2 message = 'Quotient is' + ' ' + str(quotient) where(quotient=num1 / num2) except ZeroDivisionError: message = 'Cannot divide by zero' print(message)
''' Created on 30-Oct-2017 @author: Gokulraj ''' def mergesort(a,left,right): if len(right)-len(left)<=1: return(left) elif right-left>1: mid=(right+left)//2; l=a[left:mid] r=a[mid+1:right] mergesort(a,l,r) mergesort(a,l,r) merge(a,l,r) d...
""" Created on 30-Oct-2017 @author: Gokulraj """ def mergesort(a, left, right): if len(right) - len(left) <= 1: return left elif right - left > 1: mid = (right + left) // 2 l = a[left:mid] r = a[mid + 1:right] mergesort(a, l, r) mergesort(a, l, r) merge(...
class UnknownTagFormat(Exception): """ occurs when a tag's contents violate expected format """ pass class MalformedLine(Exception): """ occurs when an nbib line doesn't conform to the standard {Tag|spaces}-value format """ pass
class Unknowntagformat(Exception): """ occurs when a tag's contents violate expected format """ pass class Malformedline(Exception): """ occurs when an nbib line doesn't conform to the standard {Tag|spaces}-value format """ pass
""" keys for data from config.yml """ LIQUID = "Liquid" INVEST = "Investment" COLOR_NAME = "color_name" COLOR_INDEX = "color_index" ACCOUNTS = "accounts"
""" keys for data from config.yml """ liquid = 'Liquid' invest = 'Investment' color_name = 'color_name' color_index = 'color_index' accounts = 'accounts'
class Enum: def __init__(self, name, value): self.name = name self.value = value def __init_subclass__(cls): cls._enum_names_ = {} cls._enum_values_ = {} for key, value in cls.__dict__.items(): if not key.startswith('_') and isinstance(value, cls._enum_type_...
class Enum: def __init__(self, name, value): self.name = name self.value = value def __init_subclass__(cls): cls._enum_names_ = {} cls._enum_values_ = {} for (key, value) in cls.__dict__.items(): if not key.startswith('_') and isinstance(value, cls._enum_typ...
# config.sample.py # Rename this file to config.py before running this application and change the database values below # LED GPIO Pin numbers - these are the default values, feel free to change them as needed LED_PINS = { 'green': 12, 'yellow': 25, 'red': 18 } EMAIL_CONFIG = { 'username':...
led_pins = {'green': 12, 'yellow': 25, 'red': 18} email_config = {'username': '<USERNAME>', 'password': '<PASSWORD>', 'smtpServer': 'smtp.gmail.com', 'port': 465, 'sender': 'Email of who will send it', 'recipient': 'Email of who will receive it'} database_config = {'host': 'localhost', 'dbname': 'uptime', 'dbuser': 'DA...
def selection_sort(A: list): for i in range(len(A) - 1): smallest_index = i for j in range(i + 1, len(A)): if A[i] > A[j]: smallest_index = j A[i], A[smallest_index] = A[smallest_index], A[i] A = [4, 2, 1, 5, 62, 5] B = [3, 3, 2, 4, 6, 65, 8, 5] C = [5, 4, 3, 2,...
def selection_sort(A: list): for i in range(len(A) - 1): smallest_index = i for j in range(i + 1, len(A)): if A[i] > A[j]: smallest_index = j (A[i], A[smallest_index]) = (A[smallest_index], A[i]) a = [4, 2, 1, 5, 62, 5] b = [3, 3, 2, 4, 6, 65, 8, 5] c = [5, 4, 3, ...
inventory = [ {"name": "apples", "quantity": 2}, {"name": "bananas", "quantity": 0}, {"name": "cherries", "quantity": 5}, {"name": "oranges", "quantity": 10}, {"name": "berries", "quantity": 7}, ] def checkIfFruitPresent(foodlist: list, target: str): # Check if the name is present ins the list ...
inventory = [{'name': 'apples', 'quantity': 2}, {'name': 'bananas', 'quantity': 0}, {'name': 'cherries', 'quantity': 5}, {'name': 'oranges', 'quantity': 10}, {'name': 'berries', 'quantity': 7}] def check_if_fruit_present(foodlist: list, target: str): print(f'We keep {target} inventory') if target in list(map(lambd...
""" A Trie is a special data structure used to store strings that can be visualized like a graph. It consists of nodes and edges. Each node consists of at max 26 children and edges connect each parent node to its children. These 26 pointers are nothing but pointers for each of the 26 letters of the English alphabet A...
""" A Trie is a special data structure used to store strings that can be visualized like a graph. It consists of nodes and edges. Each node consists of at max 26 children and edges connect each parent node to its children. These 26 pointers are nothing but pointers for each of the 26 letters of the English alphabet A...
# The goal is divide a bill print("Let's go divide the bill in Brazil. Insert the values and insert '0' for finish") sum = 0 valor = 1 while valor != 0: valor = float(input('Enter the value here in R$: ')) sum = sum + valor p = float(input('Enter the number of payers: ')) print(input('The total was R$ {}. Getti...
print("Let's go divide the bill in Brazil. Insert the values and insert '0' for finish") sum = 0 valor = 1 while valor != 0: valor = float(input('Enter the value here in R$: ')) sum = sum + valor p = float(input('Enter the number of payers: ')) print(input('The total was R$ {}. Getting R$ {:.2f} for each person...
#SearchEmployeeScreen BACK_BUTTON_TEXT = u"Back" CODE_TEXT = u"Code" DEPARTMENT_TEXT = u"Department" DOB_TEXT = u"DOB" DROPDOWN_DEPARTMENT_TEXT = u"Department" DROPDOWN_DOB_TEXT = u"DOB" DROPDOWN_EMPCODE_TEXT = u"Employee Code" DROPDOWN_NAME_TEXT = u"Name" DROPDOWN_SALARY_TEXT = u"Salary" GENDER_TEXT = u"Gender" HELP...
back_button_text = u'Back' code_text = u'Code' department_text = u'Department' dob_text = u'DOB' dropdown_department_text = u'Department' dropdown_dob_text = u'DOB' dropdown_empcode_text = u'Employee Code' dropdown_name_text = u'Name' dropdown_salary_text = u'Salary' gender_text = u'Gender' help_option_text = u'Here yo...
print ("Pythagorean Triplets with smaller side upto 10 -->") # form : (m^2 - n^2, 2*m*n, m^2 + n^2) # generate all (m, n) pairs such that m^2 - n^2 <= 10 # if we take (m > n), for m >= 6, m^2 - n^2 will always be greater than 10 # so m ranges from 1 to 5 and n ranges from 1 to m-1 pythTriplets = [(m*m - n*n, 2*m*n, m*m...
print('Pythagorean Triplets with smaller side upto 10 -->') pyth_triplets = [(m * m - n * n, 2 * m * n, m * m + n * n) for (m, n) in [(x, y) for x in range(1, 6) for y in range(1, x)] if m * m - n * n <= 10] print(pythTriplets)
print("What is your name?") name = input() print("How old are you?") age = int(input()) print("Where do you live?") residency = input() print("This is `{0}` \nIt is `{1}` \n(S)he live in `{2}` ".format(name, age, residency))
print('What is your name?') name = input() print('How old are you?') age = int(input()) print('Where do you live?') residency = input() print('This is `{0}` \nIt is `{1}` \n(S)he live in `{2}` '.format(name, age, residency))
#!/usr/bin/env python3 class TypeCacher(): def __init__(self): self.cached_types = {} self.num_cached_types = 0 def get_cached_type_str(self, type_str): if type_str in self.cached_types: cached_type_str = 'cached_type_%d' % self.cached_types[type_str] else: ...
class Typecacher: def __init__(self): self.cached_types = {} self.num_cached_types = 0 def get_cached_type_str(self, type_str): if type_str in self.cached_types: cached_type_str = 'cached_type_%d' % self.cached_types[type_str] else: cached_type_str = 'ca...
def txt_category_to_dict(category_str): """ Parameters ---------- category_str: str of nominal values from dataset meta information Returns ------- dict of the nominal values and their one letter encoding Example ------- "bell=b, convex=x" -> {"bell": "b", "convex": "x"} ""...
def txt_category_to_dict(category_str): """ Parameters ---------- category_str: str of nominal values from dataset meta information Returns ------- dict of the nominal values and their one letter encoding Example ------- "bell=b, convex=x" -> {"bell": "b", "convex": "x"} ""...
#!/usr/bin/env python # coding: utf-8 # In[172]: #Algorithm: S(A) is like a Pascal's Triangle #take string "ZY" for instance #S(A) of "ZY" can look like this: row 0 " " # row 1 Z Y # row 2 ZZ ZY YZ YY # row 3 ZZZ Z...
repetition = [] def generate_words(N, A): global repetition l = list(A) if N == 0: return L else: new_list = [] for elem in repetition: l1 = [e + elem for e in L] new_list = newList + L1 return generate_words(N - 1, newList) def append_words(A): ...
def Psychiatrichelp(thoughts, eyes, eye, tongue): return f""" {thoughts} ____________________ {thoughts} | | {thoughts} | PSYCHIATRIC | {thoughts} | HELP | {thoughts} |____________________| ...
def psychiatrichelp(thoughts, eyes, eye, tongue): return f"\n {thoughts} ____________________\n {thoughts} | |\n {thoughts} | PSYCHIATRIC |\n {thoughts} | HELP |\n {thoughts} |____________________|\n ...
SECRET_KEY = '' DEBUG = False ALLOWED_HOSTS = [ #"example.com" ]
secret_key = '' debug = False allowed_hosts = []
# Sort Alphabetically presenters=[ {'name': 'Arthur', 'age': 9}, {'name': 'Nathaniel', 'age': 11} ] presenters.sort(key=lambda item: item['name']) print('--Alphabetically--') print(presenters) # Sort by length (Shortest to longest ) presenters.sort(key=lambda item: len (item['name'])) print('-- length --') pri...
presenters = [{'name': 'Arthur', 'age': 9}, {'name': 'Nathaniel', 'age': 11}] presenters.sort(key=lambda item: item['name']) print('--Alphabetically--') print(presenters) presenters.sort(key=lambda item: len(item['name'])) print('-- length --') print(presenters)
class SingletonMeta(type): _instance = {} def __call__(cls, *args, **kwargs): if cls not in cls._instance: cls._instance[cls] = super(SingletonMeta, cls).__call__(*args, **kwargs) return cls._instance[cls]
class Singletonmeta(type): _instance = {} def __call__(cls, *args, **kwargs): if cls not in cls._instance: cls._instance[cls] = super(SingletonMeta, cls).__call__(*args, **kwargs) return cls._instance[cls]
# Created by MechAviv # Full of Stars Damage Skin (30 Day) | (2436479) if sm.addDamageSkin(2436479): sm.chat("'Full of Stars Damage Skin (30 Day)' Damage Skin has been added to your account's damage skin collection.") sm.consumeItem()
if sm.addDamageSkin(2436479): sm.chat("'Full of Stars Damage Skin (30 Day)' Damage Skin has been added to your account's damage skin collection.") sm.consumeItem()
# -*- coding: utf-8 -*- """ Created on 2020/12/21 15:04 @author: pipazi """ def L1_1_1(a): return a + 1
""" Created on 2020/12/21 15:04 @author: pipazi """ def l1_1_1(a): return a + 1
FIREWALL_FORWARDING = 1 FIREWALL_INCOMING_ALLOW = 2 FIREWALL_INCOMING_BLOCK = 3 FIREWALL_OUTGOING_BLOCK = 4 FIREWALL_CFG_PATH = '/etc/clearos/firewall.conf' def getFirewall(fw_type): with open(FIREWALL_CFG_PATH,'r') as f: lines = f.readlines() lines = [line.strip('\t\r\n\\ ') for line in lines] ...
firewall_forwarding = 1 firewall_incoming_allow = 2 firewall_incoming_block = 3 firewall_outgoing_block = 4 firewall_cfg_path = '/etc/clearos/firewall.conf' def get_firewall(fw_type): with open(FIREWALL_CFG_PATH, 'r') as f: lines = f.readlines() lines = [line.strip('\t\r\n\\ ') for line in lines] ...
# SPDX-License-Identifier: MIT # Copyright (c) 2021 Akumatic # # https://adventofcode.com/2021/day/02 def read_file() -> list: with open(f"{__file__.rstrip('code.py')}input.txt", "r") as f: return [(s[0], int(s[1])) for s in (line.split() for line in f.read().strip().split("\n"))] def part1(commands: list...
def read_file() -> list: with open(f"{__file__.rstrip('code.py')}input.txt", 'r') as f: return [(s[0], int(s[1])) for s in (line.split() for line in f.read().strip().split('\n'))] def part1(commands: list) -> int: (position, depth) = (0, 0) for com in commands: if com[0] == 'forward': ...
#!/usr/bin/env python # coding: utf-8 # #### We create a function cleanQ so we can do the cleaning and preperation of our data # #### INPUT: String # #### OUTPUT: Cleaned String def cleanQ(query): query = query.lower() tokenizer = RegexpTokenizer(r'\w+') tokens = tokenizer.tokenize(query) stemmer=[p...
def clean_q(query): query = query.lower() tokenizer = regexp_tokenizer('\\w+') tokens = tokenizer.tokenize(query) stemmer = [ps.stem(i) for i in tokens] filtered_q = [w for w in stemmer if not w in stopwords.words('english')] return filtered_Q def compute_tf(doc_words): bow = 0 for (k, ...
#5times range print('my name i') for i in range (5): print('jimee my name ('+ str(i) +')')
print('my name i') for i in range(5): print('jimee my name (' + str(i) + ')')
class Node(): def __init__(self, val): self.val = val self.left = None self.right = None class BST(): def __init__(self): self.root = Node(None) def insert(self, new_data): if self.root is None: self.root = Node(new_data) else: if...
class Node: def __init__(self, val): self.val = val self.left = None self.right = None class Bst: def __init__(self): self.root = node(None) def insert(self, new_data): if self.root is None: self.root = node(new_data) elif self.root.val < new_d...
# https://app.codesignal.com/arcade/code-arcade/loop-tunnel/xzeZqCQjpfDJuN72S def additionWithoutCarrying(param1, param2): # Add the values of each column of each number without carrying. # Order them smaller and larger value. param1, param2 = sorted([param1, param2]) # Convert both values to strings. ...
def addition_without_carrying(param1, param2): (param1, param2) = sorted([param1, param2]) (str1, str2) = (str(param1), str(param2)) str1 = '0' * (len(str2) - len(str1)) + str1 res = '' for i in range(len(str2)): res += str((int(str1[i]) + int(str2[i])) % 10) return int(res)
# Author: @Iresharma # https://leetcode.com/problems/reverse-integer/ """ Runtime: 20 ms, faster than 99.38% of Python3 online submissions for Reverse Integer. Memory Usage: 14.2 MB, less than 71.79% of Python3 online submissions for Reverse Integer. """ class Solution: def reverse(self, x: int) -> int: i...
""" Runtime: 20 ms, faster than 99.38% of Python3 online submissions for Reverse Integer. Memory Usage: 14.2 MB, less than 71.79% of Python3 online submissions for Reverse Integer. """ class Solution: def reverse(self, x: int) -> int: if abs(x) > 2147483648: return 0 s = str(x) ...
# 1137. N-th Tribonacci Number # Runtime: 32 ms, faster than 35.84% of Python3 online submissions for N-th Tribonacci Number. # Memory Usage: 14.3 MB, less than 15.94% of Python3 online submissions for N-th Tribonacci Number. class Solution: # Space Optimisation - Dynamic Programming def tribonacci(self, n:...
class Solution: def tribonacci(self, n: int) -> int: if n < 3: return 1 if n else 0 (x, y, z) = (0, 1, 1) for _ in range(n - 2): (x, y, z) = (y, z, x + y + z) return z
# Exercise2.p1 # Variables, Strings, Ints and Print Exercise # Given two variables - name and age. # Use the format() function to create a sentence that reads: # "Hi my name is Julie and I am 42 years old" # Set that equal to the variable called sentence name = "Julie" age = "42" sentence = "Hi my name is {} and i ...
name = 'Julie' age = '42' sentence = 'Hi my name is {} and i am {} years old'.format(name, age) print(sentence)
def ordinal(num): suffixes = {1: 'st', 2: 'nd', 3: 'rd'} if 10 <= num % 100 <= 20: suffix = 'th' else: suffix = suffixes.get(num % 10, 'th') return str(num) + suffix def num_to_text(num): texts = { 1: 'first', 2: 'second', 3: 'third', 4: 'fourth', ...
def ordinal(num): suffixes = {1: 'st', 2: 'nd', 3: 'rd'} if 10 <= num % 100 <= 20: suffix = 'th' else: suffix = suffixes.get(num % 10, 'th') return str(num) + suffix def num_to_text(num): texts = {1: 'first', 2: 'second', 3: 'third', 4: 'fourth', 5: 'fifth', 6: 'sixth', 7: 'seventh'...
#To reverse a given number def ReverseNo(num): num = str(num) reverse = ''.join(reversed(num)) print(reverse) Num = int(input('N= ')) ReverseNo(Num)
def reverse_no(num): num = str(num) reverse = ''.join(reversed(num)) print(reverse) num = int(input('N= ')) reverse_no(Num)
def age_assignment(*args, **kwargs): answer = {} for arg in args: for k, v in kwargs.items(): if arg[0] == k: answer[arg] = v return answer
def age_assignment(*args, **kwargs): answer = {} for arg in args: for (k, v) in kwargs.items(): if arg[0] == k: answer[arg] = v return answer
class Solution: def restoreString(self, s: str, indices: List[int]) -> str: answer = "" for i in range(len(indices)): answer += s[indices.index(i)] return answer
class Solution: def restore_string(self, s: str, indices: List[int]) -> str: answer = '' for i in range(len(indices)): answer += s[indices.index(i)] return answer
{ ".py": { "from osv import osv, fields": [regex("^from osv import osv, fields$"), "from odoo import models, fields, api"], "from osv import fields, osv": [regex("^from osv import fields, osv$"), "from odoo import models, fields, api"], "(osv.osv)": [regex("\(osv\.osv\)"), "(models.Model)"],...
{'.py': {'from osv import osv, fields': [regex('^from osv import osv, fields$'), 'from odoo import models, fields, api'], 'from osv import fields, osv': [regex('^from osv import fields, osv$'), 'from odoo import models, fields, api'], '(osv.osv)': [regex('\\(osv\\.osv\\)'), '(models.Model)'], 'from osv.orm import excep...
# 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 findTarget(self, root: Optional[TreeNode], k: int) -> bool: nums = [] self.nodeValueExtr...
class Solution: def find_target(self, root: Optional[TreeNode], k: int) -> bool: nums = [] self.nodeValueExtract(root, nums) for i in range(len(nums)): if k - nums[i] in nums[i + 1:]: return True return False def node_value_extract(self, root, nums):...
""" Define your BigQuery tables as dataclasses. """ __version__ = "0.4"
""" Define your BigQuery tables as dataclasses. """ __version__ = '0.4'
# -*- coding: utf-8 -*- """ BlueButtonFHIR_API FILE: __init__.py Created: 12/15/15 4:42 PM """ __author__ = 'Mark Scrimshire:@ekivemark'
""" BlueButtonFHIR_API FILE: __init__.py Created: 12/15/15 4:42 PM """ __author__ = 'Mark Scrimshire:@ekivemark'
# Encapsulation: intance variables and methods can be kept private. # Abtraction: each object should only expose a high level mechanism # for using it. It should hide internal implementation details and only # reveal operations relvant for other objects. # ex. HR dept setting salary using setter method class Software...
class Softwareengineer: def __init__(self, name, age): self.name = name self.age = age self._salary = None self.__salary = 5000 self._nums_bugs_solved = 0 def code(self): self._nums_bugs_solved += 1 def _calcluate_salary(self, base_value): if self._...
n, m = map(int, input().split()) student = [tuple(map(int, input().split())) for _ in range(n)] check_points = [tuple(map(int, input().split())) for _ in range(m)] for a, b in student: dst_min = float('inf') ans = float('inf') for i, (c, d) in enumerate(check_points): now = abs(a - c) + abs(b - d) ...
(n, m) = map(int, input().split()) student = [tuple(map(int, input().split())) for _ in range(n)] check_points = [tuple(map(int, input().split())) for _ in range(m)] for (a, b) in student: dst_min = float('inf') ans = float('inf') for (i, (c, d)) in enumerate(check_points): now = abs(a - c) + abs(b ...
# # Copyright Soramitsu Co., Ltd. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # grantable = { 'can_add_my_signatory': 'kAddMySignatory', 'can_remove_my_signatory': 'kRemoveMySignatory', 'can_set_my_account_detail': 'kSetMyAccountDetail', 'can_set_my_quorum': 'kSetMyQuorum', 'can_tran...
grantable = {'can_add_my_signatory': 'kAddMySignatory', 'can_remove_my_signatory': 'kRemoveMySignatory', 'can_set_my_account_detail': 'kSetMyAccountDetail', 'can_set_my_quorum': 'kSetMyQuorum', 'can_transfer_my_assets': 'kTransferMyAssets'} role = {'can_add_asset_qty': 'kAddAssetQty', 'can_add_domain_asset_qty': 'kAddD...
def printName(): print("I absolutely \nlove coding \nwith Python!".format()) if __name__ == '__main__': printName()
def print_name(): print('I absolutely \nlove coding \nwith Python!'.format()) if __name__ == '__main__': print_name()
#Solution def two_out_of_three(nums1, nums2, nums3): stored_master = {} stored_1 = {} stored_2 = {} stored_3 = {} for i in range(0, len(nums1)): if nums1[i] not in stored_1: stored_1[nums1[i]] = 1 stored_master[nums1[i]] = 1 else: pass for i in range(0, len(nums2)): ...
def two_out_of_three(nums1, nums2, nums3): stored_master = {} stored_1 = {} stored_2 = {} stored_3 = {} for i in range(0, len(nums1)): if nums1[i] not in stored_1: stored_1[nums1[i]] = 1 stored_master[nums1[i]] = 1 else: pass for i in range(0, ...
# Time: O(n), n is the number of cells # Space: O(n) class Solution(object): def cleanRoom(self, robot): """ :type robot: Robot :rtype: None """ directions = [(0, 1), (1, 0), (0, -1), (-1, 0)] def goBack(robot): robot.turnLeft() robot.turnLe...
class Solution(object): def clean_room(self, robot): """ :type robot: Robot :rtype: None """ directions = [(0, 1), (1, 0), (0, -1), (-1, 0)] def go_back(robot): robot.turnLeft() robot.turnLeft() robot.move() robot.turn...
#!/bin/python3 __author__ = "Adam Karl" """The Collatz sequence is defined by: if n is even, divide it by 2 if n is odd, triple it and add 1 given N, which number less than or equal to N has the longest chain before hitting 1?""" #first line t number of test cases, then t lines of values for N #Constraints: 1 <= T <= ...
__author__ = 'Adam Karl' 'The Collatz sequence is defined by:\nif n is even, divide it by 2\nif n is odd, triple it and add 1\ngiven N, which number less than or equal to N has the longest chain before hitting 1?' maximum = 5000000 + 1 steps = [None] * MAXIMUM answers = [0] * MAXIMUM def update(n): """Update the a...
""" Defaults for deployment. """ # Default work path default_work_path: str = "" # Default config var names config_const: str = "const" config_options: str = "options" config_arg: str = "arg" config_var: str = "var" config_alias: str = "alias" config_stage: str = "stage"
""" Defaults for deployment. """ default_work_path: str = '' config_const: str = 'const' config_options: str = 'options' config_arg: str = 'arg' config_var: str = 'var' config_alias: str = 'alias' config_stage: str = 'stage'
#6 uniform distribution p=[0.2, 0.2, 0.2, 0.2, 0.2] print(p) #7 generalized uniform distribution p=[] n=5 for i in range(n): p.append(1/n) print(p) #11 pHit and pMiss # not elegent but does the job pHit=0.6 pMiss=0.2 p[0]=p[0]*pMiss p[1]=p[1]*pHit p[2]=p[2]*pHit p[3]=p[3]*pMiss p[4]=p[4]*pMiss ...
p = [0.2, 0.2, 0.2, 0.2, 0.2] print(p) p = [] n = 5 for i in range(n): p.append(1 / n) print(p) p_hit = 0.6 p_miss = 0.2 p[0] = p[0] * pMiss p[1] = p[1] * pHit p[2] = p[2] * pHit p[3] = p[3] * pMiss p[4] = p[4] * pMiss print(p) print(sum(p)) p = [0.2, 0.2, 0.2, 0.2, 0.2] world = ['green', 'red', 'red', 'green', 'gr...
BASE_DEPS = [ "//jflex", "//jflex:testing", "//java/jflex/testing/testsuite", "//third_party/com/google/truth", ] def jflex_testsuite(**kwargs): args = update_args(kwargs) native.java_test(**args) def update_args(kwargs): if ("deps" in kwargs): kwargs["deps"] = kwargs["deps"] + BAS...
base_deps = ['//jflex', '//jflex:testing', '//java/jflex/testing/testsuite', '//third_party/com/google/truth'] def jflex_testsuite(**kwargs): args = update_args(kwargs) native.java_test(**args) def update_args(kwargs): if 'deps' in kwargs: kwargs['deps'] = kwargs['deps'] + BASE_DEPS else: ...
# Time: O(m * n) # Space: O(1) class Solution(object): def isToeplitzMatrix(self, matrix): """ :type matrix: List[List[int]] :rtype: bool """ return all(i == 0 or j == 0 or matrix[i-1][j-1] == val for i, row in enumerate(matrix) ...
class Solution(object): def is_toeplitz_matrix(self, matrix): """ :type matrix: List[List[int]] :rtype: bool """ return all((i == 0 or j == 0 or matrix[i - 1][j - 1] == val for (i, row) in enumerate(matrix) for (j, val) in enumerate(row))) class Solution2(object): def ...
ISCSI_CONNECTIVITY_TYPE = "iscsi" FC_CONNECTIVITY_TYPE = "fc" SPACE_EFFICIENCY_THIN = 'thin' SPACE_EFFICIENCY_COMPRESSED = 'compressed' SPACE_EFFICIENCY_DEDUPLICATED = 'deduplicated' SPACE_EFFICIENCY_THICK = 'thick' SPACE_EFFICIENCY_NONE = 'none' # volume context CONTEXT_POOL = "pool"
iscsi_connectivity_type = 'iscsi' fc_connectivity_type = 'fc' space_efficiency_thin = 'thin' space_efficiency_compressed = 'compressed' space_efficiency_deduplicated = 'deduplicated' space_efficiency_thick = 'thick' space_efficiency_none = 'none' context_pool = 'pool'
bch_code_parameters = { 3:{ 1:4 }, 4:{ 1:11, 2:7, 3:5 }, 5:{ 1:26, 2:21, 3:16, 5:11, 7:6 }, 6:{ 1:57, 2:51, 3:45, 4:39, 5:36, 6:30, 7:24, 10:18, 11:...
bch_code_parameters = {3: {1: 4}, 4: {1: 11, 2: 7, 3: 5}, 5: {1: 26, 2: 21, 3: 16, 5: 11, 7: 6}, 6: {1: 57, 2: 51, 3: 45, 4: 39, 5: 36, 6: 30, 7: 24, 10: 18, 11: 16, 13: 10, 15: 7}, 7: {1: 120, 2: 113, 3: 106, 4: 99, 5: 92, 6: 85, 7: 78, 9: 71, 10: 64, 11: 57, 13: 50, 14: 43, 15: 36, 21: 29, 23: 22, 27: 15, 31: 8}, 8: ...
XXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX
""" A collection of update operations for TinyDB. They are used for updates like this: >>> db.update(delete('foo'), where('foo') == 2) This would delete the ``foo`` field from all documents where ``foo`` equals 2. """ def delete(field): """ Delete a given field from the document. """ def transform(...
""" A collection of update operations for TinyDB. They are used for updates like this: >>> db.update(delete('foo'), where('foo') == 2) This would delete the ``foo`` field from all documents where ``foo`` equals 2. """ def delete(field): """ Delete a given field from the document. """ def transform(...
CONFIGS = { "session": "1", "store_location": ".", "folder": "Estudiante_1", "video": True, "audio": False, "mqtt_hostname": "10.42.0.1", "mqtt_username" : "james", "mqtt_password" : "james", "mqtt_port" : 1883, "dev_id": "1", "rap_server": "10.42.0.1" } CAMERA = { "brig...
configs = {'session': '1', 'store_location': '.', 'folder': 'Estudiante_1', 'video': True, 'audio': False, 'mqtt_hostname': '10.42.0.1', 'mqtt_username': 'james', 'mqtt_password': 'james', 'mqtt_port': 1883, 'dev_id': '1', 'rap_server': '10.42.0.1'} camera = {'brightness': 60, 'saturation': -60, 'contrast': 0, 'resolut...
""" # Sample code to perform I/O: name = input() # Reading input from STDIN print('Hi, %s.' % name) # Writing output to STDOUT # Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail """ # Write your code here n = int(input()) directions = list(map(int,...
""" # Sample code to perform I/O: name = input() # Reading input from STDIN print('Hi, %s.' % name) # Writing output to STDOUT # Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail """ n = int(input()) directions = list(map(int, input().strip().split()...
def solution(A): exchange_0 = exchange_1 = pos = -1 idx = 1 while idx < len(A): if A[idx] < A[idx - 1]: if exchange_0 == -1: exchange_0 = A[idx - 1] exchange_1 = A[idx] else: return False if exchange_0 > 0: if A[idx] > exchange_0: if A[idx - 1] > exchan...
def solution(A): exchange_0 = exchange_1 = pos = -1 idx = 1 while idx < len(A): if A[idx] < A[idx - 1]: if exchange_0 == -1: exchange_0 = A[idx - 1] exchange_1 = A[idx] else: return False if exchange_0 > 0: i...
### WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ### ### This file MUST be edited properly and copied to settings.py in order for ### SMS functionality to work. Get set up on Twilio.com for the required API ### keys and phone number settings. ### ### WARNING WARNING WARNING WARNING WARNING WA...
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' auth_token = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' phone_from = '+1213XXXYYYY' phone_to = '+1808XXXYYYY'