content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
#GCD a = int(input("Enter a: ")) b = int(input('Enter b: ')) gcd = 1 #initial gcd k = 2 #possible gcd while k <= a and k <= b: if a%k == 0 and b%k == 0: gcd = k k += 1 print(gcd)
a = int(input('Enter a: ')) b = int(input('Enter b: ')) gcd = 1 k = 2 while k <= a and k <= b: if a % k == 0 and b % k == 0: gcd = k k += 1 print(gcd)
ABCDE = list(map(int, input().split())) t = [] for i in range(3): for j in range(i + 1, 4): for k in range(j + 1, 5): t.append(ABCDE[i] + ABCDE[j] + ABCDE[k]) t.sort() print(t[-3])
abcde = list(map(int, input().split())) t = [] for i in range(3): for j in range(i + 1, 4): for k in range(j + 1, 5): t.append(ABCDE[i] + ABCDE[j] + ABCDE[k]) t.sort() print(t[-3])
class CredentialsError(Exception): pass class InvalidSetup(Exception): pass
class Credentialserror(Exception): pass class Invalidsetup(Exception): pass
number_of_test_cases = int(input()) for i in range(number_of_test_cases): number_of_candies = int(input()) one_gram_candies_number = 0 two_grams_candies_number = 0 for weight in map(int, input().split()): if weight == 1: one_gram_candies_number += 1 else: two_g...
number_of_test_cases = int(input()) for i in range(number_of_test_cases): number_of_candies = int(input()) one_gram_candies_number = 0 two_grams_candies_number = 0 for weight in map(int, input().split()): if weight == 1: one_gram_candies_number += 1 else: two_gram...
"""Roman numerals """ def convert_roman_to_int(rn): mapping = { "I": 1, "IV": 4, "V": 5, "IX": 9, "X": 10, "XL": 40, "L": 50, "XC": 90, "C": 100, "CD": 400, "D": 500, "CM": 900, "M": 1000 ...
"""Roman numerals """ def convert_roman_to_int(rn): mapping = {'I': 1, 'IV': 4, 'V': 5, 'IX': 9, 'X': 10, 'XL': 40, 'L': 50, 'XC': 90, 'C': 100, 'CD': 400, 'D': 500, 'CM': 900, 'M': 1000} prev_digit = mapping[rn[0]] s = prev_digit for i in range(1, len(rn)): val = mapping[rn[i]] if val ...
# Project Euler Problem 3 ############################### # Find the largest prime factor # of the number 600851475143 ############################### #checks if a natural number n is prime #returns boolean def prime_check(n): assert type(n) is int, "Non int passed" assert n > 0, "No negative values allowed, o...
def prime_check(n): assert type(n) is int, 'Non int passed' assert n > 0, 'No negative values allowed, or zero' if n == 1: return False i = 2 while i * i < n + 1: if n != i and n % i == 0: return False i += 1 return True def generate_primes(n): assert typ...
#!/usr/bin/env python # coding=utf-8 ''' Author: John Email: johnjim0816@gmail.com Date: 2020-08-09 08:40:38 LastEditor: John LastEditTime: 2020-08-10 10:38:59 Discription: Environment: ''' # Source : https://leetcode.com/problems/as-far-from-land-as-possible/ # Author : JohnJim0816 # Date : 2020-08-09 ###########...
""" Author: John Email: johnjim0816@gmail.com Date: 2020-08-09 08:40:38 LastEditor: John LastEditTime: 2020-08-10 10:38:59 Discription: Environment: """ class Solution: def max_distance(self, grid: List[List[int]]) -> int: (m, n) = (len(grid), len(grid[0])) steps = -1 island_pos = [(i, j...
# Given an array of integers arr, return true if and only if it is a valid mountain array. # More info: https://leetcode.com/explore/learn/card/fun-with-arrays/527/searching-for-items-in-an-array/3251/ class Solution: def is_mountain_array(self, arr: list([int])) -> bool: if len(arr) < 3: retur...
class Solution: def is_mountain_array(self, arr: list([int])) -> bool: if len(arr) < 3: return False going_down = False going_up = arr[0] < arr[1] if not going_up: return False prev_val = -1 for elem in arr: if elem > prev_val and ...
# # PySNMP MIB module A3COM-SWITCHING-SYSTEMS-ROUTEPOLICY-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-SWITCHING-SYSTEMS-ROUTEPOLICY-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 16:53:41 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwan...
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_size_constraint, value_range_constraint, constraints_intersection, constraints_union) ...
#This function prints the initial menu def print_program_menu(): print("\n") print("Welcome to the probability & statistics calculator. Please, choose an option:") print("1. Descripive Statistics") #print("2. ") #print("3. ") #print("4. ") #print("5. ") print("6. Exit") #Checks if optio...
def print_program_menu(): print('\n') print('Welcome to the probability & statistics calculator. Please, choose an option:') print('1. Descripive Statistics') print('6. Exit') def identify_option(option): if option.isdigit(): numeric_option = int(option) if numeric_option >= 1 and n...
# 10. Write a program to check whether an year is leap year or not. year=int(input("Enter an year : ")) if (year%4==0) and (year%100!=0) or (year%400==0): print(f"{year} is a leap year.") else: print(f"{year} is not a leap year.")
year = int(input('Enter an year : ')) if year % 4 == 0 and year % 100 != 0 or year % 400 == 0: print(f'{year} is a leap year.') else: print(f'{year} is not a leap year.')
def findone(L): left = 0 right = len(L) - 1 while left < right: mid = (left+right)// 2 isone = len(L[left:mid]) % 2 if L[mid] != L[mid-1] and L[mid] != L[mid+1]: return L[mid] if isone and L[mid] == L[mid-1]: left = mid + 1 elif isone and L[mi...
def findone(L): left = 0 right = len(L) - 1 while left < right: mid = (left + right) // 2 isone = len(L[left:mid]) % 2 if L[mid] != L[mid - 1] and L[mid] != L[mid + 1]: return L[mid] if isone and L[mid] == L[mid - 1]: left = mid + 1 elif isone ...
class BinarySearch: def search(self, array, element): first = 0 last = len(array) - 1 while first <= last: mid = (first + last)//2 if array[mid] == element: return mid else: if element < array[mid]: last...
class Binarysearch: def search(self, array, element): first = 0 last = len(array) - 1 while first <= last: mid = (first + last) // 2 if array[mid] == element: return mid elif element < array[mid]: last = mid - 1 ...
""" Given a singly linked list of n nodes and find the smallest and largest elements in linked list. """ class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next def print_list(head): while head: print(f" {head.val} ->", end=" ") head = head.next ...
""" Given a singly linked list of n nodes and find the smallest and largest elements in linked list. """ class Listnode: def __init__(self, val=0, next=None): self.val = val self.next = next def print_list(head): while head: print(f' {head.val} ->', end=' ') head = head.next ...
MAX_RESULTS = '50' CHANNELS_PART = 'brandingSettings,contentDetails,contentOwnerDetails,id,localizations,snippet,statistics,status,topicDetails' VIDEOS_PART = 'contentDetails,id,liveStreamingDetails,localizations,player,recordingDetails,snippet,statistics,status,topicDetails' SEARCH_PARTS = 'snippet' COMMENT_THREAD...
max_results = '50' channels_part = 'brandingSettings,contentDetails,contentOwnerDetails,id,localizations,snippet,statistics,status,topicDetails' videos_part = 'contentDetails,id,liveStreamingDetails,localizations,player,recordingDetails,snippet,statistics,status,topicDetails' search_parts = 'snippet' comment_threads_pa...
# -*- coding: utf-8 -*- """db/tests/collection_test.py By David J. Thomas, thePortus.com, dave.a.base@gmail.com Unit test for the Collection, Publisher, Subject, and many-to-many tables that join them """
"""db/tests/collection_test.py By David J. Thomas, thePortus.com, dave.a.base@gmail.com Unit test for the Collection, Publisher, Subject, and many-to-many tables that join them """
heroes = { "*Adagio*": "Adagio", "*Alpha*": "Alpha", "*Ardan*": "Ardan", "*Baron*": "Baron", "*Blackfeather*": "Blackfeather", "*Catherine*": "Catherine", "*Celeste*": "Celeste", "*Flicker*": "Flicker", "*Fortress*": "Fortress", "*Glaive*": "Glaive", "*Gwen*": "Gwen", "*K...
heroes = {'*Adagio*': 'Adagio', '*Alpha*': 'Alpha', '*Ardan*': 'Ardan', '*Baron*': 'Baron', '*Blackfeather*': 'Blackfeather', '*Catherine*': 'Catherine', '*Celeste*': 'Celeste', '*Flicker*': 'Flicker', '*Fortress*': 'Fortress', '*Glaive*': 'Glaive', '*Gwen*': 'Gwen', '*Krul*': 'Krul', '*Hero009*': 'Krul', '*Skaarf*': '...
# Generated by h2py from /usr/include/netinet/in.h # Included from net/nh.h # Included from sys/machine.h LITTLE_ENDIAN = 1234 BIG_ENDIAN = 4321 PDP_ENDIAN = 3412 BYTE_ORDER = BIG_ENDIAN DEFAULT_GPR = 0xDEADBEEF MSR_EE = 0x8000 MSR_PR = 0x4000 MSR_FP = 0x2000 MSR_ME = 0x1000 MSR_FE = 0x0800 MSR_FE0 = 0x0800 MSR_SE = ...
little_endian = 1234 big_endian = 4321 pdp_endian = 3412 byte_order = BIG_ENDIAN default_gpr = 3735928559 msr_ee = 32768 msr_pr = 16384 msr_fp = 8192 msr_me = 4096 msr_fe = 2048 msr_fe0 = 2048 msr_se = 1024 msr_be = 512 msr_ie = 256 msr_fe1 = 256 msr_al = 128 msr_ip = 64 msr_ir = 32 msr_dr = 16 msr_pm = 4 default_msr =...
characterMapNurse = { "nurse_be1_001": "nurse_be1_001", # Auto: Same "nurse_be1_002": "nurse_be1_002", # Auto: Same "nurse_be1_003": "nurse_be1_003", # Auto: Same "nurs...
character_map_nurse = {'nurse_be1_001': 'nurse_be1_001', 'nurse_be1_002': 'nurse_be1_002', 'nurse_be1_003': 'nurse_be1_003', 'nurse_be1_full_001': 'nurse_be1_full_001', 'nurse_be1_full_002': 'nurse_be1_full_002', 'nurse_be1_full_003': 'nurse_be1_full_003', 'nurse_be1_full_naked_001': 'nurse_be1_full_naked_001', 'nurse_...
nombre="roberto" edad=25 persona=["jorge","peralta",34256643,1987,0] print(persona) clave_personal=persona[2] * persona[-2] print(clave_personal) persona[-1]=clave_personal print(persona)
nombre = 'roberto' edad = 25 persona = ['jorge', 'peralta', 34256643, 1987, 0] print(persona) clave_personal = persona[2] * persona[-2] print(clave_personal) persona[-1] = clave_personal print(persona)
Mystring = "Castlevania" Mystring2 = "C a s t l e v a n i a" Otherstring = "Mankind" # Comando dir -> Sacar Metodos # print(dir(Mystring)) # print(Mystring.title()) # print(Mystring.upper()) # print(Otherstring.lower()) # print(Mystring.lower()) # print(Mystring.swapcase()) # print(Otherstring.replace("Mankind", "Pale...
mystring = 'Castlevania' mystring2 = 'C a s t l e v a n i a' otherstring = 'Mankind' print(f'My favorite game is {Mystring}') print('My favorite game is ' + Mystring) print('My favorite game is {0}'.format(Mystring)) print(f'{Otherstring} in spanish is Humanidad')
# define the paths to the image directory IMAGES_PATH = "../dataset/kaggle_dogs_vs_cats/train" # since we do not have the validation data or acces to the testing # labels we need to take a number of images from the training # data and use them instead NUM_CLASSES = 2 NUM_VALIDATION_IMAGES = 1250 * NUM_CLASSES NUM_TEST...
images_path = '../dataset/kaggle_dogs_vs_cats/train' num_classes = 2 num_validation_images = 1250 * NUM_CLASSES num_test_images = 1250 * NUM_CLASSES train_hdf5 = '../dataset/kaggle_dogs_vs_cats/hdf5/train.hdf5' validation_hdf5 = '../dataset/kaggle_dogs_vs_cats/hdf5/validation.hdf5' test_hdf5 = '../dataset/kaggle_dogs_v...
## ## code ## pmLookup = { b'00': 'Film', b'01': 'Cinema', b'02': 'Animation', b'03': 'Natural', b'04': 'HDR10', b'06': 'THX', b'0B': 'FrameAdaptHDR', b'0C': 'User1', b'0D': 'User2', b'0E': 'User3', b'0F': 'User4', b'10': 'User5', b'11': 'User6', b'14': 'HLG', ...
pm_lookup = {b'00': 'Film', b'01': 'Cinema', b'02': 'Animation', b'03': 'Natural', b'04': 'HDR10', b'06': 'THX', b'0B': 'FrameAdaptHDR', b'0C': 'User1', b'0D': 'User2', b'0E': 'User3', b'0F': 'User4', b'10': 'User5', b'11': 'User6', b'14': 'HLG', b'16': 'PanaPQ'} def get_picture_mode(bin): if bin in pmLookup: ...
# Copyright 2019 The Vearch 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 ...
port = 4101 batch_size = 16 detect_model = 'yolo3' extract_model = 'vgg16' gpu = '0' ip_address = 'http://****' ip_scheme = ip_address + ':443/space' ip_insert = ip_address + ':80' database_name = 'test' table_name = 'test'
class Test_2020(object): def __init__(self): self.a = 1 print(f'success') def add_a(self): self.a += 1
class Test_2020(object): def __init__(self): self.a = 1 print(f'success') def add_a(self): self.a += 1
# # PySNMP MIB module ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALCATEL-IND1-VIRTUAL-FLOW-CONTROL-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:01:40 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 #...
(softent_ind1_vfc,) = mibBuilder.importSymbols('ALCATEL-IND1-BASE', 'softentIND1Vfc') (object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_range_...
## While loop # like if but it indicates the sequence of statements might be executed many times as long as the condition remains true theSum = 0 data = input("Enter a number: ") while (data!= ""): number = float(data) theSum += number data = input("Enter a number or enter to quit: ") print(f"the sum is:...
the_sum = 0 data = input('Enter a number: ') while data != '': number = float(data) the_sum += number data = input('Enter a number or enter to quit: ') print(f'the sum is: {theSum:,.2f}') the_sum = 0 for number in range(1, 10001): the_sum += number print(theSum) the_sum = 0 number = 1 while number < 100...
# -*- coding: utf-8 -*- API_BASE_URL = 'https://b-api.cardioqvark.ru:1443/' API_PORT = 1443 CLIENT_CERT_PATH = '/tmp/' QVARK_CA_CERT_NAME = 'qvark_ca.pem'
api_base_url = 'https://b-api.cardioqvark.ru:1443/' api_port = 1443 client_cert_path = '/tmp/' qvark_ca_cert_name = 'qvark_ca.pem'
def dynamically_import(): mod = __import__('my_package.my_module', fromlist=['my_class']) klass = getattr(mod, 'my_class') if '__main__' == __name__: dynamically_import()
def dynamically_import(): mod = __import__('my_package.my_module', fromlist=['my_class']) klass = getattr(mod, 'my_class') if '__main__' == __name__: dynamically_import()
class Mandatory: def __init__(self, mandatory1, mandatory2): self.mandatory1 = mandatory1 self.mandatory2 = mandatory2 def get_args(self): return self.mandatory1, self.mandatory2 class Defaults: def __init__(self, mandatory, default1='value', default2=None): self.mandato...
class Mandatory: def __init__(self, mandatory1, mandatory2): self.mandatory1 = mandatory1 self.mandatory2 = mandatory2 def get_args(self): return (self.mandatory1, self.mandatory2) class Defaults: def __init__(self, mandatory, default1='value', default2=None): self.mandat...
#!/usr/bin/env python3 def apples_and_oranges(pair): first, second = pair if first == "apples": return True elif second == "oranges": return True else: return False
def apples_and_oranges(pair): (first, second) = pair if first == 'apples': return True elif second == 'oranges': return True else: return False
# 1) a = [1, 4, 5, 7, 8, -2, 0, -1] # 2) print('At index 3:', a[3]) print('At index 5:', a[5]) # 3) a_sorted = sorted(a, reverse = True) print('Sorted a:', a_sorted) # 4) print('1...3:', a_sorted[1:4]) print('2...6:', a_sorted[2:7]) # 5) del a_sorted[2:4] # 6) print('Sorted a:', a_sorted) # 7) b = ['grape...
a = [1, 4, 5, 7, 8, -2, 0, -1] print('At index 3:', a[3]) print('At index 5:', a[5]) a_sorted = sorted(a, reverse=True) print('Sorted a:', a_sorted) print('1...3:', a_sorted[1:4]) print('2...6:', a_sorted[2:7]) del a_sorted[2:4] print('Sorted a:', a_sorted) b = ['grapes', 'Potatoes', 'tomatoes', 'Orange', 'Lemon', 'Bro...
#encoding:utf-8 subreddit = 'PolHumor' t_channel = '@r_PolHumor' def send_post(submission, r2t): return r2t.send_simple(submission)
subreddit = 'PolHumor' t_channel = '@r_PolHumor' def send_post(submission, r2t): return r2t.send_simple(submission)
""" Tools for validating inputs or variables according to specifications detailing what format, datatype, etc. the data must be. TODO: - Add common specifications already created - Change date, time and datetime to use isValid date, time and datetime methods so can call externally - Change true_false to error if not o...
""" Tools for validating inputs or variables according to specifications detailing what format, datatype, etc. the data must be. TODO: - Add common specifications already created - Change date, time and datetime to use isValid date, time and datetime methods so can call externally - Change true_false to error if not o...
""" LC 775 You are given an integer array nums of length n which represents a permutation of all the integers in the range [0, n - 1]. The number of global inversions is the number of the different pairs (i, j) where: 0 <= i < j < n nums[i] > nums[j] The number of local inversions is the number of indices i where: 0...
""" LC 775 You are given an integer array nums of length n which represents a permutation of all the integers in the range [0, n - 1]. The number of global inversions is the number of the different pairs (i, j) where: 0 <= i < j < n nums[i] > nums[j] The number of local inversions is the number of indices i where: 0...
print("this is a test for branching") print("this is on loopbranch") #this will be added on the new file with out modifing the code before l = list() for i in range(6): l.append(i) print(l)
print('this is a test for branching') print('this is on loopbranch') l = list() for i in range(6): l.append(i) print(l)
"""Exceptions used by the FlickrAPI module.""" class IllegalArgumentException(ValueError): """Raised when a method is passed an illegal argument. More specific details will be included in the exception message when thrown. """ class FlickrError(Exception): """Raised when a Flickr method fails. ...
"""Exceptions used by the FlickrAPI module.""" class Illegalargumentexception(ValueError): """Raised when a method is passed an illegal argument. More specific details will be included in the exception message when thrown. """ class Flickrerror(Exception): """Raised when a Flickr method fails. ...
# -*- coding: utf-8 -*- """Top-level package for napari-aicsimageio.""" __author__ = "Jackson Maxfield Brown" __email__ = "jacksonb@alleninstitute.org" # Do not edit this string manually, always use bumpversion # Details in CONTRIBUTING.md __version__ = "0.4.0" def get_module_version() -> str: return __version_...
"""Top-level package for napari-aicsimageio.""" __author__ = 'Jackson Maxfield Brown' __email__ = 'jacksonb@alleninstitute.org' __version__ = '0.4.0' def get_module_version() -> str: return __version__
def show_dict(D): for i,j in D.items(): print(f"{i}: {j}") def sort_by_values(D): L = sorted(D.items(), key=lambda kv: kv[1]) return L
def show_dict(D): for (i, j) in D.items(): print(f'{i}: {j}') def sort_by_values(D): l = sorted(D.items(), key=lambda kv: kv[1]) return L
# coding = utf-8 # Create date: 2018-10-29 # Author :Bowen Lee def test_dhcp_hostname(ros_kvm_init, cloud_config_url): command = 'hostname' feed_back = 'rancher' kwargs = dict(cloud_config='{url}test_dncp_hostname.yml'.format(url=cloud_config_url), is_install_to_hard_drive=True) tupl...
def test_dhcp_hostname(ros_kvm_init, cloud_config_url): command = 'hostname' feed_back = 'rancher' kwargs = dict(cloud_config='{url}test_dncp_hostname.yml'.format(url=cloud_config_url), is_install_to_hard_drive=True) tuple_return = ros_kvm_init(**kwargs) client = tuple_return[0] (stdin, stdout, ...
condition = 1 while condition < 10: print(condition) condition += 1 while True: print('santhosh')
condition = 1 while condition < 10: print(condition) condition += 1 while True: print('santhosh')
class ParsingError(Exception): pass class CastError(Exception): original_exception = None def __init__(self, exception): if isinstance(exception, Exception): message = str(exception) self.original_exception = exception else: message = str(exception) ...
class Parsingerror(Exception): pass class Casterror(Exception): original_exception = None def __init__(self, exception): if isinstance(exception, Exception): message = str(exception) self.original_exception = exception else: message = str(exception) ...
"""Python library for Lyapunov Estimation and Policy Augmentation (LEAP). controllers - All controller classes. examples - Example implementations, simulations, and plotting code. learning - Learning utilities. lyapunov_functions - All Lyapunov function classes. outputs - All output classes. systems - All system class...
"""Python library for Lyapunov Estimation and Policy Augmentation (LEAP). controllers - All controller classes. examples - Example implementations, simulations, and plotting code. learning - Learning utilities. lyapunov_functions - All Lyapunov function classes. outputs - All output classes. systems - All system class...
# dataset settings dataset_type = 'S3DISSegDataset' data_root = './data/s3dis/' class_names = ('ceiling', 'floor', 'wall', 'beam', 'column', 'window', 'door', 'table', 'chair', 'sofa', 'bookcase', 'board', 'clutter') num_points = 4096 train_area = [1, 2, 3, 4, 6] test_area = 5 train_pipeline = [ dict...
dataset_type = 'S3DISSegDataset' data_root = './data/s3dis/' class_names = ('ceiling', 'floor', 'wall', 'beam', 'column', 'window', 'door', 'table', 'chair', 'sofa', 'bookcase', 'board', 'clutter') num_points = 4096 train_area = [1, 2, 3, 4, 6] test_area = 5 train_pipeline = [dict(type='LoadPointsFromFile', coord_type=...
# my_module.py is about the use of modules in python # I did random things that came to mind # makes use of the type function # returns the type as expected from the type function # # put the bracket around a sequence of numbers before you cast, # when you are looking for the type of the casted obj # that is, pass it...
def get_obj_type(obj): """ returns the type of an object """ return type(obj) def get_obj_len(obj): """ returns the length of an object """ number_types = [int, float] if get_obj_type(obj) in number_types: return len(str(obj)) elif get_obj_type(obj) == bool: return 1 i...
def wind_stress_curl(Tx, Ty, x, y): """Calculate the curl of wind stress (Tx, Ty). Args: Tx, Ty: Wind stress components (N/m^2), 3d x, y: Coordinates in lon, lat (degrees), 1d. Notes: Curl(Tx,Ty) = dTy/dx - dTx/dy The different constants come from oblateness of the ellip...
def wind_stress_curl(Tx, Ty, x, y): """Calculate the curl of wind stress (Tx, Ty). Args: Tx, Ty: Wind stress components (N/m^2), 3d x, y: Coordinates in lon, lat (degrees), 1d. Notes: Curl(Tx,Ty) = dTy/dx - dTx/dy The different constants come from oblateness of the ellipsoid....
p = int(input("Enter a number: ")) def expand_x_1(p): if p == 1: print('Neither composite nor prime') exit() elif p < 1 or (p - int(p)) != 0: print('Invalid Input') exit() coefficient = [1] for i in range(p): coefficient.append(coefficient[-1] * -(p ...
p = int(input('Enter a number: ')) def expand_x_1(p): if p == 1: print('Neither composite nor prime') exit() elif p < 1 or p - int(p) != 0: print('Invalid Input') exit() coefficient = [1] for i in range(p): coefficient.append(coefficient[-1] * -(p - i) / (i + 1))...
class CFG: random_state = 42 shuffle = True test_size = 0.3 no_of_fold = 5 use_gpu = False
class Cfg: random_state = 42 shuffle = True test_size = 0.3 no_of_fold = 5 use_gpu = False
def extractJapmtlWordpressCom(item): ''' Parser for 'japmtl.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('one day, the engagement was suddenly cancelled. ......my little sister\...
def extract_japmtl_wordpress_com(item): """ Parser for 'japmtl.wordpress.com' """ (vol, chp, frag, postfix) = extract_vol_chapter_fragment_postfix(item['title']) if not (chp or vol) or 'preview' in item['title'].lower(): return None tagmap = [("one day, the engagement was suddenly cancelled. ....
"""\ Imposer ======= Main promise class for use of barriers/shared states. """ class Imposer: def __init__(self, env): self.env = env return def resolve(self): """Notify the states are ready""" return def reject(self): """Notify its rejection with exceptions""" ...
"""Imposer ======= Main promise class for use of barriers/shared states. """ class Imposer: def __init__(self, env): self.env = env return def resolve(self): """Notify the states are ready""" return def reject(self): """Notify its rejection with exceptions""" ...
class DataGridViewCellPaintingEventArgs(HandledEventArgs): """ Provides data for the System.Windows.Forms.DataGridView.CellPainting event. DataGridViewCellPaintingEventArgs(dataGridView: DataGridView,graphics: Graphics,clipBounds: Rectangle,cellBounds: Rectangle,rowIndex: int,columnIndex: int,cellState: Data...
class Datagridviewcellpaintingeventargs(HandledEventArgs): """ Provides data for the System.Windows.Forms.DataGridView.CellPainting event. DataGridViewCellPaintingEventArgs(dataGridView: DataGridView,graphics: Graphics,clipBounds: Rectangle,cellBounds: Rectangle,rowIndex: int,columnIndex: int,cellState: DataG...
# # PySNMP MIB module HPN-ICF-DHCPR-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-DHCPR-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:25:26 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Ma...
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, value_size_constraint, constraints_intersection, single_value_constraint, constraints_union) ...
def sort_contacts(contacts): newcontacts=[] keys = contacts.keys() for key in sorted(keys): data = (key, contacts[key][0], contacts[key][1]) newcontacts.append(data) return newcontacts contacts = input("Please input the contacts.") print(sort_contacts(contacts))
def sort_contacts(contacts): newcontacts = [] keys = contacts.keys() for key in sorted(keys): data = (key, contacts[key][0], contacts[key][1]) newcontacts.append(data) return newcontacts contacts = input('Please input the contacts.') print(sort_contacts(contacts))
color = input("Enter a color: ") plural_noun = input("Enter a plural noun: ") celebrity = input("Enter the name of a Celebrity: ") print("Roses are " + color) print(plural_noun + " are blue") print("I love " + celebrity) ## Mad Lib 1 date = input("Enter a date: ") full_name = input("Enter a full name: ") a_place = i...
color = input('Enter a color: ') plural_noun = input('Enter a plural noun: ') celebrity = input('Enter the name of a Celebrity: ') print('Roses are ' + color) print(plural_noun + ' are blue') print('I love ' + celebrity) date = input('Enter a date: ') full_name = input('Enter a full name: ') a_place = input('Enter the ...
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'flapper_version_h_file%': 'flapper_version.h', 'flapper_binary_files%': [], 'conditions': [ [ 'branding == "Chrome"...
{'variables': {'flapper_version_h_file%': 'flapper_version.h', 'flapper_binary_files%': [], 'conditions': [['branding == "Chrome"', {'conditions': [['OS == "linux" and target_arch == "ia32"', {'flapper_version_h_file%': 'symbols/ppapi/linux/flapper_version.h', 'flapper_binary_files%': ['binaries/ppapi/linux/libpepflash...
# 204. Count Primes # Runtime: 4512 ms, faster than 43.85% of Python3 online submissions for Count Primes. # Memory Usage: 52.8 MB, less than 90.72% of Python3 online submissions for Count Primes. class Solution: # Sieve of Eratosthenes def countPrimes(self, n: int) -> int: if n <= 2: re...
class Solution: def count_primes(self, n: int) -> int: if n <= 2: return 0 is_prime = [True] * n count = 0 for i in range(2, n): if is_prime[i]: count += 1 for j in range(i * i, n, i): is_prime[j] = False ...
""" Asked by: Google [Hard]. Given a string, split it into as few strings as possible such that each string is a palindrome. For example, given the input string racecarannakayak, return ["racecar", "anna", "kayak"]. Given the input string abc, return ["a", "b", "c"]. """
""" Asked by: Google [Hard]. Given a string, split it into as few strings as possible such that each string is a palindrome. For example, given the input string racecarannakayak, return ["racecar", "anna", "kayak"]. Given the input string abc, return ["a", "b", "c"]. """
def ErrorHandler(function): def wrapper(*args, **kwargs): try: return function(*args, **kwargs) except Exception as e: # pragma: no cover pass return wrapper
def error_handler(function): def wrapper(*args, **kwargs): try: return function(*args, **kwargs) except Exception as e: pass return wrapper
# # # Copyright 2016 Kirk A Jackson DBA bristoSOFT all rights reserved. All methods, # techniques, algorithms are confidential trade secrets under Ohio and U.S. # Federal law owned by bristoSOFT. # # Kirk A Jackson dba bristoSOFT # 4100 Executive Park Drive # Suite 11 # Cincinnati, OH 45241 # Phone (513) 401-9114 # e...
""" This control package includes all the modules needed for bristoSOFT Contacts. """
"""Top-level package for investment_tracker.""" __author__ = """Ranko Liang""" __email__ = "rankoliang@gmail.com" __version__ = "0.1.0"
"""Top-level package for investment_tracker.""" __author__ = 'Ranko Liang' __email__ = 'rankoliang@gmail.com' __version__ = '0.1.0'
class Metadata: def __init__(self, network, code, position, name, source=None): self.network = network self.code = code self.position = position self.name = name self.source = source self.enabled = True class Polarization: def __init__(self): ...
class Metadata: def __init__(self, network, code, position, name, source=None): self.network = network self.code = code self.position = position self.name = name self.source = source self.enabled = True class Polarization: def __init__(self): self.azimu...
class CommandNotFound(Exception): def __init__(self, command_name): self.name = command_name def __str__(self): return f"Command with name {self.name} not found"
class Commandnotfound(Exception): def __init__(self, command_name): self.name = command_name def __str__(self): return f'Command with name {self.name} not found'
def _merge(left, right, cmp): res = [] leftI , rightI = 0, 0 while leftI<len(left) and rightI<len(right): if cmp(left[leftI], right[rightI])<=0: res.append(left[leftI]) leftI += 1 else: res.append(right[rightI]) rightI += 1 while leftI<len(left): res.append(left[leftI]) leftI += 1 while righ...
def _merge(left, right, cmp): res = [] (left_i, right_i) = (0, 0) while leftI < len(left) and rightI < len(right): if cmp(left[leftI], right[rightI]) <= 0: res.append(left[leftI]) left_i += 1 else: res.append(right[rightI]) right_i += 1 whi...
tokentype = { 'INT': 'INT', 'FLOAT': 'FLOAT', 'STRING': 'STRING', 'CHAR': 'CHAR', '+': 'PLUS', '-': 'MINUS', '*': 'MUL', '/': 'DIV', '=': 'ASSIGN', '%': 'MODULO', ':': 'COLON', ';': 'SEMICOLON', '<': 'LT', '>': 'GT', '[': 'O_BRACKET', ']': 'C_BRACKET', ...
tokentype = {'INT': 'INT', 'FLOAT': 'FLOAT', 'STRING': 'STRING', 'CHAR': 'CHAR', '+': 'PLUS', '-': 'MINUS', '*': 'MUL', '/': 'DIV', '=': 'ASSIGN', '%': 'MODULO', ':': 'COLON', ';': 'SEMICOLON', '<': 'LT', '>': 'GT', '[': 'O_BRACKET', ']': 'C_BRACKET', '(': 'O_PAREN', ')': 'C_PAREN', '{': 'O_BRACE', '}': 'C_BRACE', '&':...
''' Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct. ''' class Solution: def containsDuplicate(self, nums): """ :type nums: List[int] ...
""" Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct. """ class Solution: def contains_duplicate(self, nums): """ :type nums: List[int...
# Takes the following input :- number of items, a weights array, a value array, and the capacity of knap_sack def knap_sack(n, w, v, c): if n == 0 or w == 0: return 0 if w[n - 1] > c: return knap_sack(n - 1, w, v, c) else: return max(v[n - 1] + knap_sack(n - 1, w, v, c - w[n - 1]...
def knap_sack(n, w, v, c): if n == 0 or w == 0: return 0 if w[n - 1] > c: return knap_sack(n - 1, w, v, c) else: return max(v[n - 1] + knap_sack(n - 1, w, v, c - w[n - 1]), knap_sack(n - 1, w, v, c)) val = [60, 100, 120] wt = [10, 20, 30] w = 50 n = len(val) print(knap_sack(n, wt, va...
def maxXorSum(n, k): if k == 1: return n res = 1 l = [1] while res <= n: res <<= 1 l.append(res) print(l) # return res - 1 n, k = map(int, input().split()) maxXorSum(n, k)
def max_xor_sum(n, k): if k == 1: return n res = 1 l = [1] while res <= n: res <<= 1 l.append(res) print(l) (n, k) = map(int, input().split()) max_xor_sum(n, k)
#Gasolina t=float(input()) v=float(input()) l=(t*v) /12 print("{:.3f}".format(l) )
t = float(input()) v = float(input()) l = t * v / 12 print('{:.3f}'.format(l))
# Code Listing #5 """ Borg - Pattern which allows class instances to share state without the strict requirement of Singletons """ class Borg(object): """ I ain't a Singleton """ __shared_state = {} def __init__(self): print("self: ", self) self.__dict__ = self.__shared_state class IBo...
""" Borg - Pattern which allows class instances to share state without the strict requirement of Singletons """ class Borg(object): """ I ain't a Singleton """ __shared_state = {} def __init__(self): print('self: ', self) self.__dict__ = self.__shared_state class Iborg(Borg): """ I ...
# Copyright 2021 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. register_npcx_project( project_name="volteer", zephyr_board="volteer", dts_overlays=[ "bb_retimer.dts", "cbi_eeprom.dts", ...
register_npcx_project(project_name='volteer', zephyr_board='volteer', dts_overlays=['bb_retimer.dts', 'cbi_eeprom.dts', 'fan.dts', 'gpio.dts', 'keyboard.dts', 'motionsense.dts', 'pwm.dts', 'pwm_leds.dts', 'usbc.dts'])
# We could use f'' string but it is lunched after version 3.5 # So before f'' string developers are used format specifier. name = 'Amresh' channel = 'TechieDuo' # a = f'Good morning, {name}' # a = 'Good morning, {}\nWelcome to {}, Chief'.format(name, channel) # customize the position a = 'Good morning, {1}\nWelc...
name = 'Amresh' channel = 'TechieDuo' a = 'Good morning, {1}\nWelcome to {0}, Chief'.format(name, channel) print(a)
class Solution: def romanToInt(self, s: str) -> int: roman_dict = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000} temp = roman_dict[s[-1]] summation = temp for i in s[:-1][::-1]: value = roman_dict[i] if value >= temp: summati...
class Solution: def roman_to_int(self, s: str) -> int: roman_dict = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000} temp = roman_dict[s[-1]] summation = temp for i in s[:-1][::-1]: value = roman_dict[i] if value >= temp: summ...
np.random.seed(2020) # set random seed # sweep through values for lambda lambdas = np.arange(0.05, 0.95, 0.01) empirical_variances = np.zeros_like(lambdas) analytical_variances = np.zeros_like(lambdas) sig = 0.87 # compute empirical equilibrium variance for i, lam in enumerate(lambdas): empirical_variances[i] = ...
np.random.seed(2020) lambdas = np.arange(0.05, 0.95, 0.01) empirical_variances = np.zeros_like(lambdas) analytical_variances = np.zeros_like(lambdas) sig = 0.87 for (i, lam) in enumerate(lambdas): empirical_variances[i] = ddm_eq_var(5000, x0, xinfty, lambdas[i], sig) analytical_variances = sig ** 2 / (1 - lambdas *...
class SubscriptionSubstitutionTag(object): """The subscription substitution tag of an SubscriptionTracking.""" def __init__(self, subscription_substitution_tag=None): """Create a SubscriptionSubstitutionTag object :param subscription_substitution_tag: A tag that will be replaced with ...
class Subscriptionsubstitutiontag(object): """The subscription substitution tag of an SubscriptionTracking.""" def __init__(self, subscription_substitution_tag=None): """Create a SubscriptionSubstitutionTag object :param subscription_substitution_tag: A tag that will be replaced with ...
# No Copyright @u@ TaskType={ "classification":0, "SANclassification":1 } TaskID = { "csqa":0, "mcscript2":1, "cosmosqa":2 } TaskName = ["csqa","mcscript2","cosmosqa"]
task_type = {'classification': 0, 'SANclassification': 1} task_id = {'csqa': 0, 'mcscript2': 1, 'cosmosqa': 2} task_name = ['csqa', 'mcscript2', 'cosmosqa']
def open_file(): while True: file_name = input("Enter input file name>>> ") try: fhand = open(file_name, "r") break except FileNotFoundError: print("Couldn't open file, Invalid name or file doesn't exist!") continue return fhand def proce...
def open_file(): while True: file_name = input('Enter input file name>>> ') try: fhand = open(file_name, 'r') break except FileNotFoundError: print("Couldn't open file, Invalid name or file doesn't exist!") continue return fhand def proces...
data = [[0,1.5],[2,1.7],[3,2.1],[5,2.2],[6,2.8],[7,2.9],[9,3.2],[11,3.7]] def dEa(a, b): sum = 0 for i in data: sum += i[0] * (i[0]*a + b - i[1]) return sum def dEb(a, b): sum = 0 for i in data: sum += i[0]*a + b - i[1] return sum eta = 0.006 # study rate a, b = 2,1 # start for i in range(0,200)...
data = [[0, 1.5], [2, 1.7], [3, 2.1], [5, 2.2], [6, 2.8], [7, 2.9], [9, 3.2], [11, 3.7]] def d_ea(a, b): sum = 0 for i in data: sum += i[0] * (i[0] * a + b - i[1]) return sum def d_eb(a, b): sum = 0 for i in data: sum += i[0] * a + b - i[1] return sum eta = 0.006 (a, b) = (2, 1...
print('hi all') print ('hello world') print('hi') print('hii') print('hello2')
print('hi all') print('hello world') print('hi') print('hii') print('hello2')
grocery = ["rice", "water", "tomato", "onion", "ginger"] for i in range(2, len(grocery), 2): print(grocery[i])
grocery = ['rice', 'water', 'tomato', 'onion', 'ginger'] for i in range(2, len(grocery), 2): print(grocery[i])
# coding: utf-8 # author: Fei Gao <leetcode.com@feigao.xyz> # Problem: verify preorder serialization of a binary tree # # One way to serialize a binary tree is to use pre-order traversal. When we # encounter a non-null node, we record the node's value. If it is a null node, # we record using a sentinel value such as ...
class Solution(object): def is_valid_serialization(self, preorder): """ :type preorder: str :rtype: bool """ tree = ''.join(('n' if c != '#' else '#' for c in preorder.split(','))) while tree.count('n##'): tree = tree.replace('n##', '#') return tr...
#!/usr/bin/env python3.4 class Board: """Represents one board to a Tic-Tac-Toe game.""" def __init__(self): """Initializes a new board. A board is a dictionary which the key is the position in the board and the value can be 'X', 'O' or ' ' (representing an empty position in the ...
class Board: """Represents one board to a Tic-Tac-Toe game.""" def __init__(self): """Initializes a new board. A board is a dictionary which the key is the position in the board and the value can be 'X', 'O' or ' ' (representing an empty position in the board.)""" self.b...
class FMSAPIEventRankingsParser(object): def parse(self, response): """ This currently only works for the 2015 game. """ rankings = [['Rank', 'Team', 'Qual Avg', 'Auto', 'Container', 'Coopertition', 'Litter', 'Tote', 'Played']] for team in response['Rankings']: r...
class Fmsapieventrankingsparser(object): def parse(self, response): """ This currently only works for the 2015 game. """ rankings = [['Rank', 'Team', 'Qual Avg', 'Auto', 'Container', 'Coopertition', 'Litter', 'Tote', 'Played']] for team in response['Rankings']: r...
class Database(): def __init__(self, connector, id): self.connector = connector self.id = id self.base_url = 'https://api.devicemagic.com/api/forms' \ '/{0}/device_magic_database.json'.format(self.id) def json(self, *args): return self._filtered_query(ar...
class Database: def __init__(self, connector, id): self.connector = connector self.id = id self.base_url = 'https://api.devicemagic.com/api/forms/{0}/device_magic_database.json'.format(self.id) def json(self, *args): return self._filtered_query(args) if args else self._basic_qu...
description = """ Adds Oracle database settings to your project. For more information, visit: http://cx-oracle.sourceforge.net/ """
description = '\nAdds Oracle database settings to your project.\n\nFor more information, visit:\nhttp://cx-oracle.sourceforge.net/\n'
expected_output = { "program": { "rcp_fs": { "instance": { "default": { "active": "0/0/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1168", "standby": "N...
expected_output = {'program': {'rcp_fs': {'instance': {'default': {'active': '0/0/CPU0', 'active_state': 'RUNNING', 'group': 'central-services', 'jid': '1168', 'standby': 'NONE', 'standby_state': 'NOT_SPAWNED'}}}, 'ospf': {'instance': {'1': {'active': '0/0/CPU0', 'active_state': 'RUNNING', 'group': 'v4-routing', 'jid':...
number = 5 def summation(first, second): total = first + second + number return total outer_total = summation(10, 20) print("The first number we initialised was " + str(number)) print("The total after summation s " + str(outer_total))
number = 5 def summation(first, second): total = first + second + number return total outer_total = summation(10, 20) print('The first number we initialised was ' + str(number)) print('The total after summation s ' + str(outer_total))
"""Tests for CharLSTM class.""" def test_forward(char_cnn, vocab_dataset): """Test `CharLSTM.forward()` method.""" _, dataset = vocab_dataset for src, tgt in dataset: res = char_cnn(*src[:-2]) n_words, dim = res.size() assert n_words == tgt.size()[0] assert dim == char_cnn....
"""Tests for CharLSTM class.""" def test_forward(char_cnn, vocab_dataset): """Test `CharLSTM.forward()` method.""" (_, dataset) = vocab_dataset for (src, tgt) in dataset: res = char_cnn(*src[:-2]) (n_words, dim) = res.size() assert n_words == tgt.size()[0] assert dim == char...
def checkio(number): result = [] if number % 3 == 0: result.append('Fizz') if number % 5 == 0: result.append('Buzz') if result: return ' '.join(result) return str(number) # These "asserts" using only for self-checking and not necessary for # auto-testing if __name__ == '__m...
def checkio(number): result = [] if number % 3 == 0: result.append('Fizz') if number % 5 == 0: result.append('Buzz') if result: return ' '.join(result) return str(number) if __name__ == '__main__': assert checkio(15) == 'Fizz Buzz', '15 is divisible by 3 and 5' assert...
# By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, # we can see that the 6th prime is 13. # What is the 10 001st prime number? def is_prime(n: int) -> bool: if n <= 3: return n > 1 elif not(n%2 and n%3): return False i = 5 while i**2 <= n: if not(n%i and n%(i+2)): return False ...
def is_prime(n: int) -> bool: if n <= 3: return n > 1 elif not (n % 2 and n % 3): return False i = 5 while i ** 2 <= n: if not (n % i and n % (i + 2)): return False i += 6 return True def solution(number: int) -> int: (i, count) = (1, 0) while cou...
"""dloud_ads - Abstract Data Structures commonly used in CS scenarios. Implemented by Data Loud Labs!""" __version__ = '0.0.2' __author__ = 'Pedro Sousa <pjgs.sousa@gmail.com>' __all__ = []
"""dloud_ads - Abstract Data Structures commonly used in CS scenarios. Implemented by Data Loud Labs!""" __version__ = '0.0.2' __author__ = 'Pedro Sousa <pjgs.sousa@gmail.com>' __all__ = []
class Regularizer(object): """Regularizer base class.""" def __call__(self, x): return self.call(x) def call(self, x): """Invokes the `Regularizer` instance.""" return 0.0 def gradient(self, x): """Compute gradient for the `Regularizer` instance.""" return 0.0
class Regularizer(object): """Regularizer base class.""" def __call__(self, x): return self.call(x) def call(self, x): """Invokes the `Regularizer` instance.""" return 0.0 def gradient(self, x): """Compute gradient for the `Regularizer` instance.""" return 0.0
data1 = "10" # String data2 = 5 # Int data3 = 5.23 # Float data4 = False # Bool print(data1) print(data2) print(data3) print(data4)
data1 = '10' data2 = 5 data3 = 5.23 data4 = False print(data1) print(data2) print(data3) print(data4)
def setup_module(module): pass def teardown_module(module): print("TD MO") def test_passing(): assert True def test_failing(): assert False class TestClassPassing(object): def setup_method(self, method): pass def teardown_method(self, method): pass def test_passing(...
def setup_module(module): pass def teardown_module(module): print('TD MO') def test_passing(): assert True def test_failing(): assert False class Testclasspassing(object): def setup_method(self, method): pass def teardown_method(self, method): pass def test_passing(sel...
#!/usr/bin/python35 s1 = '12345' s2 = 'abcde' print('s1 = %s, id(s1) = %d' %(s1, id(s1))) print('s2 = %s, id(s2) = %d' %(s2, id(s2))) s2 = '12345' print('') print('s1 = %s, id(s1) = %d' %(s1, id(s1))) print('s2 = %s, id(s2) = %d' %(s2, id(s2)))
s1 = '12345' s2 = 'abcde' print('s1 = %s, id(s1) = %d' % (s1, id(s1))) print('s2 = %s, id(s2) = %d' % (s2, id(s2))) s2 = '12345' print('') print('s1 = %s, id(s1) = %d' % (s1, id(s1))) print('s2 = %s, id(s2) = %d' % (s2, id(s2)))
# MIT License # (C) Copyright 2021 Hewlett Packard Enterprise Development LP. # # pauseOrchestration : Set or get appliances nePks which are paused from # orchestration def get_pause_orchestration(self) -> dict: """Get appliances currently paused for orchestration .. list-table:: :header-rows: 1 ...
def get_pause_orchestration(self) -> dict: """Get appliances currently paused for orchestration .. list-table:: :header-rows: 1 * - Swagger Section - Method - Endpoint * - pauseOrchestration - GET - /pauseOrchestration :return: Returns dicti...
"""Generated definition of rust_grpc_library.""" load("//rust:rust_grpc_compile.bzl", "rust_grpc_compile") load("//internal:compile.bzl", "proto_compile_attrs") load("//rust:rust_proto_lib.bzl", "rust_proto_lib") load("@rules_rust//rust:defs.bzl", "rust_library") def rust_grpc_library(name, **kwargs): # buildifier: ...
"""Generated definition of rust_grpc_library.""" load('//rust:rust_grpc_compile.bzl', 'rust_grpc_compile') load('//internal:compile.bzl', 'proto_compile_attrs') load('//rust:rust_proto_lib.bzl', 'rust_proto_lib') load('@rules_rust//rust:defs.bzl', 'rust_library') def rust_grpc_library(name, **kwargs): name_pb = na...
if __name__ == "__main__": with open('input.txt') as data: numbers = [int(number) for number in data.readlines()] current_freq = 0 idx = 0 past_frequencies = set() while True: if idx == len(numbers): idx = 0 if current_freq in past_freq...
if __name__ == '__main__': with open('input.txt') as data: numbers = [int(number) for number in data.readlines()] current_freq = 0 idx = 0 past_frequencies = set() while True: if idx == len(numbers): idx = 0 if current_freq in past_freq...
test = { 'name': 'q42', 'points': 3, 'suites': [ { 'cases': [ { 'code': '>>> ' 'print(np.round(model.coef_, ' '3))\n' '[ 0.024 0.023 -0.073 0.001 ' ...
test = {'name': 'q42', 'points': 3, 'suites': [{'cases': [{'code': '>>> print(np.round(model.coef_, 3))\n[ 0.024 0.023 -0.073 0.001 -0.263 -0.016 0.289 0.011 -0.438 0.066\n -0.274 -0.026 0.126 -0.019 -0.276 -0.418 0.223 -0.022 -0.215 -0.997\n 0.946 0.21 -0.021 -0.366 -0.121 -0.399 0.823 -0.282 -0.229 -0.392\...
def main(j, args, params, tags, tasklet): doc = params.doc e = params.requestContext.env addr = j.core.portal.runningPortal.ipaddr querystr = e["QUERY_STRING"] querystr = querystr.replace("&format=text", "") querystr = querystr.replace("&key=,", "") querystr = querystr.replace("&key=", ...
def main(j, args, params, tags, tasklet): doc = params.doc e = params.requestContext.env addr = j.core.portal.runningPortal.ipaddr querystr = e['QUERY_STRING'] querystr = querystr.replace('&format=text', '') querystr = querystr.replace('&key=,', '') querystr = querystr.replace('&key=', '') ...
# Title : Number of tuple equal to a user specified value # Author : Kiran raj R. # Date : 31:10:2020 def find_tuple(list_in, sum_in): length = len(list_in) count_tup = 0 list_tuples = [] if(sum(list_in) < sum_in) | length < 1: print(f"Cannot find any combination of sum {sum_in}") for ...
def find_tuple(list_in, sum_in): length = len(list_in) count_tup = 0 list_tuples = [] if (sum(list_in) < sum_in) | length < 1: print(f'Cannot find any combination of sum {sum_in}') for i in range(length - 2): tuple_with_sum = set() current_sum = sum_in - list_in[i] fo...