content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# # PySNMP MIB module RAPID-HA-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RAPID-HA-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:51:59 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,...
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, constraints_intersection, single_value_constraint, value_size_constraint, constraints_union) ...
test = { 'name': 'q1c', 'points': 3, 'suites': [ { 'cases': [ { 'code': r""" >>> manhattan_taxi.shape (82800, 9) """, 'hidden': False, 'locked': False }, { 'code': r""" >>> sum(manhattan_taxi['duratio...
test = {'name': 'q1c', 'points': 3, 'suites': [{'cases': [{'code': '\n >>> manhattan_taxi.shape\n (82800, 9)\n ', 'hidden': False, 'locked': False}, {'code': "\n >>> sum(manhattan_taxi['duration'])\n 54551565\n ", 'hidden': False, 'locked': False}, {'code': "\n ...
# Ex056.2 """Develop a program that reads the name, age and sex of for people. At the end of the program, show: The average age of the group, What's the name of the older man, How many women are under 20""" total_age = 0 older_man = 0 name_over_man = '' women20_cont = 0 for n in range(1, 4 + 1): print(f'\033[32mPers...
"""Develop a program that reads the name, age and sex of for people. At the end of the program, show: The average age of the group, What's the name of the older man, How many women are under 20""" total_age = 0 older_man = 0 name_over_man = '' women20_cont = 0 for n in range(1, 4 + 1): print(f'\x1b[32mPerson number...
def get_date_from_zip(zip_name: str) -> str: """ Helper function to parse a date from a ROM zip's name """ return zip_name.split("-")[-1].split(".")[0] def get_metadata_from_zip(zip_name: str) -> (str, str, str, str): """ Helper function to parse some data from ROM zip's name """ d...
def get_date_from_zip(zip_name: str) -> str: """ Helper function to parse a date from a ROM zip's name """ return zip_name.split('-')[-1].split('.')[0] def get_metadata_from_zip(zip_name: str) -> (str, str, str, str): """ Helper function to parse some data from ROM zip's name """ da...
filt_dict = { 'db': [['Emissions', '(Kyoto Gases|co2)$', '(|Energy and Industrial Processes|AFOLU)$', '', '(world|r5.*)'], ['Policy cost', '(Additional Total Energy System Cost|consumption Loss|gdp Loss)', '', '', '(world|r5.*)'], ['Price', 'Carbon', '$', '', '(world|r5.*)'], ], }
filt_dict = {'db': [['Emissions', '(Kyoto Gases|co2)$', '(|Energy and Industrial Processes|AFOLU)$', '', '(world|r5.*)'], ['Policy cost', '(Additional Total Energy System Cost|consumption Loss|gdp Loss)', '', '', '(world|r5.*)'], ['Price', 'Carbon', '$', '', '(world|r5.*)']]}
# https://leetcode.com/problems/insert-interval/ # Given a set of non-overlapping intervals, insert a new interval into the # intervals (merge if necessary). # You may assume that the intervals were initially sorted according to their start # times. ###################################################################...
class Solution: def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]: if not intervals: return [newInterval] ans = [] inserted = False for interval in intervals: if interval[1] < newInterval[0]: ans.append(in...
#!/usr/bin/env python3 def merge(L1, L2): L3 = L1+L2 for j in range(len(L3)): for i in range(0, len(L3)-j-1): if L3[i]> L3[i+1]: L3[i],L3[i+1] = L3[i+1] , L3[i] return (L3) def main(): print((merge([1,2,3],[1,6,7]))) pass if __name__ == "__main__": main(...
def merge(L1, L2): l3 = L1 + L2 for j in range(len(L3)): for i in range(0, len(L3) - j - 1): if L3[i] > L3[i + 1]: (L3[i], L3[i + 1]) = (L3[i + 1], L3[i]) return L3 def main(): print(merge([1, 2, 3], [1, 6, 7])) pass if __name__ == '__main__': main()
class ControllerBase: @staticmethod def base(): return True
class Controllerbase: @staticmethod def base(): return True
__author__ = 'fatih' class SQL(): """ This class includes all using database commands such as insert, remove, select etc. Only need to do is you will write your sql command and format it into running command by given values """ #insert commands SQL_INSERT_CONFIG = "INSERT INTO apc_confi...
__author__ = 'fatih' class Sql: """ This class includes all using database commands such as insert, remove, select etc. Only need to do is you will write your sql command and format it into running command by given values """ sql_insert_config = "INSERT INTO apc_config(name, description, ip...
''' You are given an array of length n which only contains the elements 0,1 and 2. You are supposed to sort the array in ascending order without the use of any sorting algorithms. Minimize time complexity. Input Format: The first line of input contains the value of n i.e. size of array. The next line contains n space...
""" You are given an array of length n which only contains the elements 0,1 and 2. You are supposed to sort the array in ascending order without the use of any sorting algorithms. Minimize time complexity. Input Format: The first line of input contains the value of n i.e. size of array. The next line contains n space...
""" author: Akshay Chawla (https://github.com/akshaychawla) TEST:rs Test convert.py's ability to handle Deconvolution and Crop laye by converting voc-fcn8s .prototxt and .caffemodel present in the caffe/models/segmentation folder """ # import os # import inspect # import numpy as np # import keras.caffe.convert as conv...
""" author: Akshay Chawla (https://github.com/akshaychawla) TEST:rs Test convert.py's ability to handle Deconvolution and Crop laye by converting voc-fcn8s .prototxt and .caffemodel present in the caffe/models/segmentation folder """ '\npath = os.path.dirname(inspect.getfile(inspect.currentframe()))\nassert os.path.exi...
class BlocoMemoria: palavra: list endBlock: int atualizado: bool custo: int cacheHit: int ultimoUso: int def __init__(self): self.endBlock = -1 self.atualizado = False self.custo = 0 self.cacheHit = 0 ultimoUso: 2**31-1
class Blocomemoria: palavra: list end_block: int atualizado: bool custo: int cache_hit: int ultimo_uso: int def __init__(self): self.endBlock = -1 self.atualizado = False self.custo = 0 self.cacheHit = 0 ultimo_uso: 2 ** 31 - 1
AzToolchainInfo = provider( doc = "Azure toolchain rule parameters", fields = [ "az_tool_path", "az_tool_target", "azure_extension_dir", "az_extensions_installed", "jq_tool_path", ], ) AzConfigInfo = provider( fields = [ "debug", "global_args", ...
az_toolchain_info = provider(doc='Azure toolchain rule parameters', fields=['az_tool_path', 'az_tool_target', 'azure_extension_dir', 'az_extensions_installed', 'jq_tool_path']) az_config_info = provider(fields=['debug', 'global_args', 'subscription', 'verbose'])
# Copyright 2018- The Pixie Authors. # # 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 or agreed to in w...
def _fetch_licenses_impl(ctx): args = ctx.actions.args() args.add('--github_token', ctx.file.oauth_token) args.add('--modules', ctx.file.src) if ctx.attr.use_pkg_dev_go: args.add('--try_pkg_dev_go') if ctx.attr.disallow_missing: args.add('--fatal_if_missing') args.add('--json_man...
package(default_visibility = [ "//visibility:public" ]) load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "net_import_library", "core_import_library") net_import_library( name = "net45", src = "lib/netstandard1.0/System.Threading.Tasks.Extensions.dll", ) core_import_library( name = "netcore", src = "lib/netstan...
package(default_visibility=['//visibility:public']) load('@io_bazel_rules_dotnet//dotnet:defs.bzl', 'net_import_library', 'core_import_library') net_import_library(name='net45', src='lib/netstandard1.0/System.Threading.Tasks.Extensions.dll') core_import_library(name='netcore', src='lib/netstandard2.0/System.Threading.T...
class Solution: def repeatedStringMatch(self, A: str, B: str) -> int: if B in A: return 0 counter = 1 repeatedA = A while len(repeatedA) < len(B)*2: repeatedA += A if B in repeatedA: return counter counter += 1 r...
class Solution: def repeated_string_match(self, A: str, B: str) -> int: if B in A: return 0 counter = 1 repeated_a = A while len(repeatedA) < len(B) * 2: repeated_a += A if B in repeatedA: return counter counter += 1 ...
WIDTH = 50 HEIGHT = 10 MAX_WIDTH = WIDTH - 2 MAX_HEIGHT = HEIGHT - 2
width = 50 height = 10 max_width = WIDTH - 2 max_height = HEIGHT - 2
# coding: utf-8 class CorpusInterface(object): def load_corpus(self, corpus): pass def read_corpus(self, filename): pass class Corpus(object): def load_corpus(self, corpus): raise NotImplementedError() def read_corpus(self, filename): raise NotImplementedError()
class Corpusinterface(object): def load_corpus(self, corpus): pass def read_corpus(self, filename): pass class Corpus(object): def load_corpus(self, corpus): raise not_implemented_error() def read_corpus(self, filename): raise not_implemented_error()
x = int(input()) for i in range(1, 11): resultado = i * x print("{} x {} = {}".format(i, x, resultado))
x = int(input()) for i in range(1, 11): resultado = i * x print('{} x {} = {}'.format(i, x, resultado))
patches = [ # Rename AWS::Lightsail::Instance.Disk to AWS::Lightsail::Instance.DiskProperty { "op": "move", "from": "/PropertyTypes/AWS::Lightsail::Instance.Disk", "path": "/PropertyTypes/AWS::Lightsail::Instance.DiskProperty", }, { "op": "replace", "path": "/Prop...
patches = [{'op': 'move', 'from': '/PropertyTypes/AWS::Lightsail::Instance.Disk', 'path': '/PropertyTypes/AWS::Lightsail::Instance.DiskProperty'}, {'op': 'replace', 'path': '/PropertyTypes/AWS::Lightsail::Instance.Hardware/Properties/Disks/ItemType', 'value': 'DiskProperty'}, {'op': 'remove', 'path': '/PropertyTypes/AW...
maximum = float("-inf") def max_path_sum(root): helper(root) return maximum def helper(root): if not root: return 0 left = helper(root.left) right = helper(root.right) maximum = max(maximum, left+right+root.val) return root.val + max(left, right)
maximum = float('-inf') def max_path_sum(root): helper(root) return maximum def helper(root): if not root: return 0 left = helper(root.left) right = helper(root.right) maximum = max(maximum, left + right + root.val) return root.val + max(left, right)
fruit = input() size_set = input() count_sets = float(input()) price_set = 0 if fruit == 'Watermelon': if size_set == 'small': price_set = count_sets * 56 * 2 elif size_set == 'big': price_set = count_sets * 28.7 * 5 elif fruit == 'Mango': if size_set == 'small': price_set = count_s...
fruit = input() size_set = input() count_sets = float(input()) price_set = 0 if fruit == 'Watermelon': if size_set == 'small': price_set = count_sets * 56 * 2 elif size_set == 'big': price_set = count_sets * 28.7 * 5 elif fruit == 'Mango': if size_set == 'small': price_set = count_se...
def test_socfaker_timestamp_in_the_past(socfaker_fixture): assert socfaker_fixture.timestamp.in_the_past() def test_socfaker_timestamp_in_the_future(socfaker_fixture): assert socfaker_fixture.timestamp.in_the_future() def test_socfaker_timestamp_current(socfaker_fixture): assert socfaker_fixture.timestamp...
def test_socfaker_timestamp_in_the_past(socfaker_fixture): assert socfaker_fixture.timestamp.in_the_past() def test_socfaker_timestamp_in_the_future(socfaker_fixture): assert socfaker_fixture.timestamp.in_the_future() def test_socfaker_timestamp_current(socfaker_fixture): assert socfaker_fixture.timestamp...
""" NewsTrader - a framework of news trading for individual investors This package is inspired by many other awesome Python packages """ # Shortcuts for key modules or functions __VERSION__ = "0.0.1"
""" NewsTrader - a framework of news trading for individual investors This package is inspired by many other awesome Python packages """ __version__ = '0.0.1'
releases = [ { "ocid": "A", "id": "1", "date": "2014-01-01", "tag": ["tender"], "tender": { "items": [ { "id": "1", "description": "Item 1", "quantity": 1 }, { "id": "2", "desc...
releases = [{'ocid': 'A', 'id': '1', 'date': '2014-01-01', 'tag': ['tender'], 'tender': {'items': [{'id': '1', 'description': 'Item 1', 'quantity': 1}, {'id': '2', 'description': 'Item 2', 'quantity': 1}]}}, {'ocid': 'A', 'id': '2', 'date': '2014-01-02', 'tag': ['tender'], 'tender': {'items': [{'id': '1', 'description'...
# -*- coding: utf-8 -*- """ exceptions.py Exceptions raised by the Kite Connect client. :copyright: (c) 2017 by Zerodha Technology. :license: see LICENSE for details. """ class KiteException(Exception): """ Base exception class representing a Kite client exception. Every specific Kite c...
""" exceptions.py Exceptions raised by the Kite Connect client. :copyright: (c) 2017 by Zerodha Technology. :license: see LICENSE for details. """ class Kiteexception(Exception): """ Base exception class representing a Kite client exception. Every specific Kite client exception is a subc...
__title__ = "PyMatting" __version__ = "1.1.3" __author__ = "The PyMatting Developers" __email__ = "pymatting@gmail.com" __license__ = "MIT" __uri__ = "https://pymatting.github.io" __summary__ = "Python package for alpha matting."
__title__ = 'PyMatting' __version__ = '1.1.3' __author__ = 'The PyMatting Developers' __email__ = 'pymatting@gmail.com' __license__ = 'MIT' __uri__ = 'https://pymatting.github.io' __summary__ = 'Python package for alpha matting.'
"""Chapter 12 - Be a pythonista""" # vars def dump(func): """Print input arguments and output value(s)""" def wrapped(*args, **kwargs): print("Function name: %s" % func.__name__) print("Input arguments: %s" % ' '.join(map(str, args))) print("Input keyword arguments: %s" % kwargs.items(...
"""Chapter 12 - Be a pythonista""" def dump(func): """Print input arguments and output value(s)""" def wrapped(*args, **kwargs): print('Function name: %s' % func.__name__) print('Input arguments: %s' % ' '.join(map(str, args))) print('Input keyword arguments: %s' % kwargs.items()) ...
class Matrix: def __init__(self, mat): l_size = len(mat[0]) for line in mat: if l_size != len(line): raise ValueError('invalid matrix sizes') self._raw = mat @property def raw(self): return self._raw @property def trace(self): if ...
class Matrix: def __init__(self, mat): l_size = len(mat[0]) for line in mat: if l_size != len(line): raise value_error('invalid matrix sizes') self._raw = mat @property def raw(self): return self._raw @property def trace(self): i...
# todo remove in next major release as we no longer support django < 3.2 anyway. Note this would make dj-stripe unuseable for djang0 < 3.2 # for django < 3.2 default_app_config = "djstripe.apps.DjstripeAppConfig"
default_app_config = 'djstripe.apps.DjstripeAppConfig'
with open("mynewtextfile.txt","w+") as f: f.writelines("\nOtus we are learning python\nOtus we are learning python\nOtus we are learning python") f.seek(0) print(f.readlines()) print("Is readable:", f.readable()) print("Is writeable:", f.writable()) print("File no:", f.fileno()) print("Is co...
with open('mynewtextfile.txt', 'w+') as f: f.writelines('\nOtus we are learning python\nOtus we are learning python\nOtus we are learning python') f.seek(0) print(f.readlines()) print('Is readable:', f.readable()) print('Is writeable:', f.writable()) print('File no:', f.fileno()) print('Is c...
class Solution: def traverse(self, node: TreeNode, deep: int): if node is None: return deep deep += 1 if node.left is None: return self.traverse(node.right, deep) elif node.right is None: return self.traverse(node.left, deep) else: left_de...
class Solution: def traverse(self, node: TreeNode, deep: int): if node is None: return deep deep += 1 if node.left is None: return self.traverse(node.right, deep) elif node.right is None: return self.traverse(node.left, deep) else: ...
def rotation_saxs(t = 1): #sample = ['Hopper2_AGIB_AuPd_top', 'Hopper2_AGIB_AuPd_mid', 'Hopper2_AGIB_AuPd_bot'] #Change filename sample = ['AGIB3N_1top', 'AGIB3N_1mid', 'AGIB3N_1cen'] #Change filename #y_list = [-6.06, -6.04, -6.02] #hexapod is in mm #y_list = [-10320, -10300, -10280] #SmarAct i...
def rotation_saxs(t=1): sample = ['AGIB3N_1top', 'AGIB3N_1mid', 'AGIB3N_1cen'] y_list = [4760, 4810, 4860] assert len(y_list) == len(sample), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' dets = [pil1M, pil300KW] prs_range = [-90, 90, 91] waxs_ra...
def factory(classToInstantiate): def f(*arg): def g(): return classToInstantiate(*arg) return g return f
def factory(classToInstantiate): def f(*arg): def g(): return class_to_instantiate(*arg) return g return f
class EmailBuilder: def __init__(self): self.message = {} def set_from_email(self, email): self.message['from'] = email return self def set_receiver_email(self, email): self.message['receiver'] = email def set_cc_emails(self, emails): self.message['cc'] = email...
class Emailbuilder: def __init__(self): self.message = {} def set_from_email(self, email): self.message['from'] = email return self def set_receiver_email(self, email): self.message['receiver'] = email def set_cc_emails(self, emails): self.message['cc'] = emai...
# -*- coding: utf-8 -*- # Copyright 2018 ICON Foundation # # 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 o...
test_request_transfer_icx = {'jsonrpc': '2.0', 'method': 'icx_sendTransaction', 'id': 1234, 'params': {'version': '0x3', 'from': 'hxbe258ceb872e08851f1f59694dac2558708ece11', 'to': 'hx5bfdb090f43a808005ffc27c25b213145e80b7cd', 'value': '0xde0b6b3a7640000', 'stepLimit': '0x12345', 'timestamp': '0x563a6cf330136', 'nid': ...
#! /usr/bin/env python3 def main(): try: name = input('\nHello! What is your name? ') if name: print(f'\nWell, {name}, it is nice to meet you!\n') except: print('\n\nSorry. Something went wrong, please try again.\n') if __name__ == '__main__': main()
def main(): try: name = input('\nHello! What is your name? ') if name: print(f'\nWell, {name}, it is nice to meet you!\n') except: print('\n\nSorry. Something went wrong, please try again.\n') if __name__ == '__main__': main()
meta_pickups={ 'aux_domains': lambda r, common, data: { 'pos': r['head_pos'], 'head': r['head'], 'head_word': r['head_word'], **common, **data}, 'root_domains': lambda r, common, data: {'pos': r['upos'], 'rel': r['rel'], **common, **data}, 'verb_domains': lambda r, common, data: {'pos': r['u...
meta_pickups = {'aux_domains': lambda r, common, data: {'pos': r['head_pos'], 'head': r['head'], 'head_word': r['head_word'], **common, **data}, 'root_domains': lambda r, common, data: {'pos': r['upos'], 'rel': r['rel'], **common, **data}, 'verb_domains': lambda r, common, data: {'pos': r['upos'], 'rel': r['rel'], **co...
# # PySNMP MIB module CISCO-WAN-BBIF-ATM-CONN-STAT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-WAN-BBIF-ATM-CONN-STAT-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:03:57 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Pyt...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_range_constraint, value_size_constraint, constraints_intersection, constraints_union) ...
things = ['a', 'b', 'c', 'd'] print(things) print(things[1]) things[1] = 'z' print(things[1]) print(things) things = ['a', 'b', 'c', 'd'] print("=" * 50) stuff = {'name' : 'Jinkyu', 'age' : 40, 'height' : 6 * 12 + 2} print(stuff) print(stuff['name']) print(stuff['age']) print(stuff['height']) stuff['city'] = "SF" print...
things = ['a', 'b', 'c', 'd'] print(things) print(things[1]) things[1] = 'z' print(things[1]) print(things) things = ['a', 'b', 'c', 'd'] print('=' * 50) stuff = {'name': 'Jinkyu', 'age': 40, 'height': 6 * 12 + 2} print(stuff) print(stuff['name']) print(stuff['age']) print(stuff['height']) stuff['city'] = 'SF' print(st...
class Solution(object): def canVisitAllRooms(self, rooms): """ :type rooms: List[List[int]] :rtype: bool """ seen = [False] * len(rooms) seen[0] = True stack = [0, ] while stack: roomIdx = stack.pop() for key in rooms[roomIdx]: ...
class Solution(object): def can_visit_all_rooms(self, rooms): """ :type rooms: List[List[int]] :rtype: bool """ seen = [False] * len(rooms) seen[0] = True stack = [0] while stack: room_idx = stack.pop() for key in rooms[roomIdx...
# https://leetcode.com/problems/surface-area-of-3d-shapes class Solution: def surfaceArea(self, grid): N = len(grid) ans = 0 for i in range(N): for j in range(N): if grid[i][j] == 0: continue height = grid[i][j] ...
class Solution: def surface_area(self, grid): n = len(grid) ans = 0 for i in range(N): for j in range(N): if grid[i][j] == 0: continue height = grid[i][j] ans += 2 for h in range(1, height + 1): ...
USERDV = [ "USER_NAME", "USER_USERNAME", "USER_ID", "USER_PIC", "USER_BIO" ] class UserConfig(object): def UserName(self): """returns name of user""" return self.getdv("USER_NAME") or self.USER_NAME or self.name or None def UserUsername(self): """returns username of user""" return self.getdv("USER...
userdv = ['USER_NAME', 'USER_USERNAME', 'USER_ID', 'USER_PIC', 'USER_BIO'] class Userconfig(object): def user_name(self): """returns name of user""" return self.getdv('USER_NAME') or self.USER_NAME or self.name or None def user_username(self): """returns username of user""" re...
tempo = int(input()) velocida_media = int(input()) gasto_carro = 12 distancia = velocida_media * tempo print(f'{distancia / 12:.3f}')
tempo = int(input()) velocida_media = int(input()) gasto_carro = 12 distancia = velocida_media * tempo print(f'{distancia / 12:.3f}')
rows, cols = [int(n) for n in input().split(", ")] matrix = [] for _ in range(rows): matrix.append([int(n) for n in input().split(" ")]) for j in range(cols): total = 0 for row in matrix: total += row[j] print(total)
(rows, cols) = [int(n) for n in input().split(', ')] matrix = [] for _ in range(rows): matrix.append([int(n) for n in input().split(' ')]) for j in range(cols): total = 0 for row in matrix: total += row[j] print(total)
# Available methods METHODS = { # Dummy for HF "hf": ["hf"], "ricc2": ["rimp2", "rimp3", "rimp4", "ricc2"], # Hardcoded XC-functionals that can be selected from the dft submenu # of define. "dft_hardcoded": [ # Hardcoded in V7.3 "s-vwn", "s-vwn_Gaussian", "pwlda",...
methods = {'hf': ['hf'], 'ricc2': ['rimp2', 'rimp3', 'rimp4', 'ricc2'], 'dft_hardcoded': ['s-vwn', 's-vwn_Gaussian', 'pwlda', 'b-lyp', 'b-vwn', 'b-p', 'pbe', 'tpss', 'bh-lyp', 'b3-lyp', 'b3-lyp_Gaussian', 'pbe0', 'tpssh', 'pw6b95', 'm06', 'm06-l', 'm06-2x', 'lhf', 'oep', 'b97-d', 'pbeh-3c', 'b97-3c', 'lh07t-svwn', 'lh0...
class Config: ''' General configuration parent class ''' NEWS_API_BASE_URL ='https://newsapi.org/v2/sources?apiKey={}' ARTICLE_API_BASE_URL = 'https://newsapi.org/v2/everything?sources={}&apiKey={}' class ProdConfig(Config): ''' Production configuration child class Args: Config: The parent con...
class Config: """ General configuration parent class """ news_api_base_url = 'https://newsapi.org/v2/sources?apiKey={}' article_api_base_url = 'https://newsapi.org/v2/everything?sources={}&apiKey={}' class Prodconfig(Config): """ Production configuration child class Args: Config: The parent...
def main() -> None: K, X = map(int, input().split()) assert 1 <= K <= 100 assert 1 <= X <= 10**5 if __name__ == '__main__': main()
def main() -> None: (k, x) = map(int, input().split()) assert 1 <= K <= 100 assert 1 <= X <= 10 ** 5 if __name__ == '__main__': main()
# Copyright (c) The PyAMF Project. # See LICENSE.txt for details. """ Remoting tests. @since: 0.1.0 """
""" Remoting tests. @since: 0.1.0 """
# Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def sumNumsR(self, root, s): if root is None: return 0 s = s * 10 + root.val if not root.left and not root.rig...
class Treenode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def sum_nums_r(self, root, s): if root is None: return 0 s = s * 10 + root.val if not root.left and (not root.right): return s ...
# Copyright 2018 Google Inc. 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 or a...
""" This template creates a Runtime Configurator with the associated resources. """ def generate_config(context): """ Entry point for the deployment resources. """ resources = [] properties = context.properties project_id = properties.get('projectId', context.env['project']) name = properties.get('...
__all__ = ('ascii_art_title_4client', 'ascii_art_title_4server') ascii_art_title_4client = r""" /$$$$$$ /$$ /$$ /$$__ $$| $$ | $$ /$$$$$$ /$...
__all__ = ('ascii_art_title_4client', 'ascii_art_title_4server') ascii_art_title_4client = '\n /$$$$$$ /$$ /$$ \n /$$__ $$| $$ | $$ \n /$$$$$$ /$$...
# -*- coding: utf-8 -*- description = "Setup for the LakeShore 340 temperature controller" group = "optional" includes = ["alias_T"] tango_base = "tango://phys.kws3.frm2:10000/kws3" tango_ls340 = tango_base + "/ls340" devices = dict( T_ls340 = device("nicos.devices.entangle.TemperatureController", descr...
description = 'Setup for the LakeShore 340 temperature controller' group = 'optional' includes = ['alias_T'] tango_base = 'tango://phys.kws3.frm2:10000/kws3' tango_ls340 = tango_base + '/ls340' devices = dict(T_ls340=device('nicos.devices.entangle.TemperatureController', description='Temperature regulation', tangodevic...
def response(status, message, data, status_code=200): return { "status": status, "message": message, "data": data, }, status_code
def response(status, message, data, status_code=200): return ({'status': status, 'message': message, 'data': data}, status_code)
""" Blocks TODO: * Avoid newline/indent on certain tags, like Blank/Pre: self.__class__.__name__ != "Pre" (necessary?) * Fixed: () popped len(token) twice """ ## +block def indented_block(self): print(f"Indent-dependent {self.tag} block started") start_O_line = self.O.line_number block_indent = self.I....
""" Blocks TODO: * Avoid newline/indent on certain tags, like Blank/Pre: self.__class__.__name__ != "Pre" (necessary?) * Fixed: () popped len(token) twice """ def indented_block(self): print(f'Indent-dependent {self.tag} block started') start_o_line = self.O.line_number block_indent = self.I.indent_count ...
x = 0 for n in range(10): x = x + 1 assert x == 10
x = 0 for n in range(10): x = x + 1 assert x == 10
#Queue.py #20 Oct 2017 #Written By Amin Dehghan #DS & Algorithms With Python class Queue: def __init__(self): self.items=[] self.fronIdx=0 def __compress(self): newlst=[] for i in range(self.frontIdx,len(self.items)): newlst.append(self.items[i]) ...
class Queue: def __init__(self): self.items = [] self.fronIdx = 0 def __compress(self): newlst = [] for i in range(self.frontIdx, len(self.items)): newlst.append(self.items[i]) self.items = newlst self.frontIdx = 0 def dequeue(self): if ...
patches = [ { "op": "move", "from": "/ResourceTypes/AWS::Transfer::Server/Properties/Protocols/ItemType", "path": "/ResourceTypes/AWS::Transfer::Server/Properties/Protocols/PrimitiveItemType", }, { "op": "replace", "path": "/ResourceTypes/AWS::Transfer::Server/Propert...
patches = [{'op': 'move', 'from': '/ResourceTypes/AWS::Transfer::Server/Properties/Protocols/ItemType', 'path': '/ResourceTypes/AWS::Transfer::Server/Properties/Protocols/PrimitiveItemType'}, {'op': 'replace', 'path': '/ResourceTypes/AWS::Transfer::Server/Properties/Protocols/PrimitiveItemType', 'value': 'String'}, {'o...
def foo(x): if x == 0: return 1 elif x % 2 == 0: return 2 * x * foo(x - 2) else: return (x -3) * x * foo(x + 1) print(foo(4))
def foo(x): if x == 0: return 1 elif x % 2 == 0: return 2 * x * foo(x - 2) else: return (x - 3) * x * foo(x + 1) print(foo(4))
def diff(n, mid) : if (n > (mid * mid * mid)) : return (n - (mid * mid * mid)) else : return ((mid * mid * mid) - n) # Returns cube root of a no n def cubicRoot(n) : # Set start and end for binary # search start = 0 end = n # Set precision ...
def diff(n, mid): if n > mid * mid * mid: return n - mid * mid * mid else: return mid * mid * mid - n def cubic_root(n): start = 0 end = n e = 1e-07 while True: mid = (start + end) / 2 error = diff(n, mid) if error <= e: return mid if ...
# Base Parameters assets = asset_list('FX') # Trading Parameters horizon = 'H1' pair = 0 # Mass Imports my_data = mass_import(pair, horizon) # Parameters long_ema = 26 short_ema = 12 signal_ema = 9 def ma(Data, lookback, close, where): Data = adder(Data, 1) for i in ...
assets = asset_list('FX') horizon = 'H1' pair = 0 my_data = mass_import(pair, horizon) long_ema = 26 short_ema = 12 signal_ema = 9 def ma(Data, lookback, close, where): data = adder(Data, 1) for i in range(len(Data)): try: Data[i, where] = Data[i - lookback + 1:i + 1, close].mean() ...
x = 'heLLo world' print("Swap the case: " + x.swapcase()) print("Set all cast to upper: " + x.upper()) print("Set all cast to lower: " + x.lower()) print("Set all cast to lower aggresivly: " + x.casefold()) print("Set every word\'s first letter to upper: " + x.title()) print("Set the first word\'s first letter to...
x = 'heLLo world' print('Swap the case: ' + x.swapcase()) print('Set all cast to upper: ' + x.upper()) print('Set all cast to lower: ' + x.lower()) print('Set all cast to lower aggresivly: ' + x.casefold()) print("Set every word's first letter to upper: " + x.title()) print("Set the first word's first letter to upper i...
''' constants for the project ''' TRAIN_LOSS = 0 TRAIN_ACCURACY = 1 VAL_LOSS = 2 VAL_ACCURACY = 3
""" constants for the project """ train_loss = 0 train_accuracy = 1 val_loss = 2 val_accuracy = 3
# -*- coding: utf-8 -*- STATSD_ENABLED = False STATSD_HOST = "localhost" STATSD_PORT = 8125 STATSD_LOG_PERIODIC = True STATSD_LOG_EVERY = 5 STATSD_HANDLER = "scrapy_statsd_extension.handlers.StatsdBase" STATSD_PREFIX = "scrapy" STATSD_LOG_ONLY = [] STATSD_TAGGING = False STATSD_TAGS = {"spider_name": True} STATSD_IGNOR...
statsd_enabled = False statsd_host = 'localhost' statsd_port = 8125 statsd_log_periodic = True statsd_log_every = 5 statsd_handler = 'scrapy_statsd_extension.handlers.StatsdBase' statsd_prefix = 'scrapy' statsd_log_only = [] statsd_tagging = False statsd_tags = {'spider_name': True} statsd_ignore = []
N, r = map(int, input().split()) for i in range(N): R = int(input()) if R>=r: print('Good boi') else: print('Bad boi')
(n, r) = map(int, input().split()) for i in range(N): r = int(input()) if R >= r: print('Good boi') else: print('Bad boi')
# WRITE YOUR SOLUTION HERE: class Employee: def __init__(self, name: str): self.name = name self.subordinates = [] def add_subordinate(self, employee: 'Employee'): self.subordinates.append(employee) def count_subordinates(employee: Employee): count = len(employee.subordinates) ...
class Employee: def __init__(self, name: str): self.name = name self.subordinates = [] def add_subordinate(self, employee: 'Employee'): self.subordinates.append(employee) def count_subordinates(employee: Employee): count = len(employee.subordinates) if len(employee.subordinate...
#!/usr/bin/env python3 def palindrome(x): return str(x) == str(x)[::-1] def number_palindrome(n, base): if base == 2: binary = bin(n)[2:] return palindrome(binary) if base == 10: return palindrome(n) return False def double_base_palindrome(x): return number_palindrome(x...
def palindrome(x): return str(x) == str(x)[::-1] def number_palindrome(n, base): if base == 2: binary = bin(n)[2:] return palindrome(binary) if base == 10: return palindrome(n) return False def double_base_palindrome(x): return number_palindrome(x, 10) and number_palindrome...
#for request headers headers = { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET', 'Access-Control-Allow-Headers': 'Content-Type', 'Access-Control-Max-Age': '3600', 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0' }
headers = {'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET', 'Access-Control-Allow-Headers': 'Content-Type', 'Access-Control-Max-Age': '3600', 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0'}
# Create an array for the points of the line line_points = [ {"x":5, "y":5}, {"x":70, "y":70}, {"x":120, "y":10}, {"x":180, "y":60}, {"x":240, "y":10}] # Create style style_line = lv.style_t() style_line.init() style_line.set_line_width(8) style_line....
line_points = [{'x': 5, 'y': 5}, {'x': 70, 'y': 70}, {'x': 120, 'y': 10}, {'x': 180, 'y': 60}, {'x': 240, 'y': 10}] style_line = lv.style_t() style_line.init() style_line.set_line_width(8) style_line.set_line_color(lv.palette_main(lv.PALETTE.BLUE)) style_line.set_line_rounded(True) line1 = lv.line(lv.scr_act()) line1.s...
# In case it's not obvious, a list comprehension produces a list, but # it doesn't have to be given a list to iterate over. # # You can use a list comprehension with any iterable type, so we'll # write a comprehension to convert dimensions from inches to centimetres. # # Our dimensions will be represented by a tuple, f...
inch_measurement = (3, 8, 20) cm_measurement = [x * 2.54 for x in inch_measurement] print(cm_measurement) cm_measurement = [(x, x * 2.54) for x in inch_measurement] print(cm_measurement) cm_measurement = tuple((x * 2.54 for x in inch_measurement)) print(cm_measurement)
r=s=t=1 #--- I1 print(r + s + t) r=s=t='1' #--- I2 print(r + s + t)
r = s = t = 1 print(r + s + t) r = s = t = '1' print(r + s + t)
"""Genetic Programming in Python, with a scikit-learn inspired API ``gplearn`` is a set of algorithms for learning genetic programming models. """ __version__ = '0.4.dev0' __all__ = ['genetic', 'functions', 'fitness'] print("GPLEARN MOD")
"""Genetic Programming in Python, with a scikit-learn inspired API ``gplearn`` is a set of algorithms for learning genetic programming models. """ __version__ = '0.4.dev0' __all__ = ['genetic', 'functions', 'fitness'] print('GPLEARN MOD')
_base_ = '../../base.py' # model settings model = dict( type='Classification', pretrained=None, backbone=dict( type='ResNet', depth=50, out_indices=[4], # 4: stage-4 norm_cfg=dict(type='BN')), head=dict( type='ClsHead', with_avg_pool=True, in_channels=2048, num_c...
_base_ = '../../base.py' model = dict(type='Classification', pretrained=None, backbone=dict(type='ResNet', depth=50, out_indices=[4], norm_cfg=dict(type='BN')), head=dict(type='ClsHead', with_avg_pool=True, in_channels=2048, num_classes=10)) data_source_cfg = dict(type='Cifar10', root='/root/data/zq/data/cifar/') datas...
class BruteForceProtectionException(Exception): pass class BruteForceProtectionBanException(BruteForceProtectionException): pass class BruteForceProtectionCaptchaException(BruteForceProtectionException): pass
class Bruteforceprotectionexception(Exception): pass class Bruteforceprotectionbanexception(BruteForceProtectionException): pass class Bruteforceprotectioncaptchaexception(BruteForceProtectionException): pass
string = "John Doe lives at 221B Baker Street." pattern = re.compile(r""" ([a-zA-Z ]+) # Save as many letters and spaces as possible to group 1 \ lives\ at\ # Match " lives at " (?P<address>.*) # Save everything in between as a group named `address` \. # Match the period at th...
string = 'John Doe lives at 221B Baker Street.' pattern = re.compile('\n ([a-zA-Z ]+) # Save as many letters and spaces as possible to group 1\n \\ lives\\ at\\ # Match " lives at "\n (?P<address>.*) # Save everything in between as a group named `address`\n \\. # Match the period ...
class LanguageModel: def infer(x): """Run language model on input x Args: x (str): Prompt to run inference on Returns: (str) Output of inference """ return prompt
class Languagemodel: def infer(x): """Run language model on input x Args: x (str): Prompt to run inference on Returns: (str) Output of inference """ return prompt
# Copyright 2016 x620 <https://github.com/x620> # Copyright 2016,2020 Ivan Yelizariev <https://it-projects.info/team/yelizariev> # Copyright 2018 Ruslan Ronzhin # Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73/> # License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html). { "name": """Show mess...
{'name': 'Show message recipients', 'summary': 'Allows you be sure, that all discussion participants were notified', 'category': 'Discuss', 'images': ['images/1.png'], 'version': '12.0.1.1.1', 'author': 'IT-Projects LLC, Pavel Romanchenko', 'support': 'apps@itpp.dev', 'website': 'https://itpp.dev', 'license': 'LGPL-3',...
"""Config file tools for edx_lint.""" def merge_configs(main, tweaks): """Merge tweaks into a main config file.""" for section in tweaks.sections(): for option in tweaks.options(section): value = tweaks.get(section, option) if option.endswith("+"): option = optio...
"""Config file tools for edx_lint.""" def merge_configs(main, tweaks): """Merge tweaks into a main config file.""" for section in tweaks.sections(): for option in tweaks.options(section): value = tweaks.get(section, option) if option.endswith('+'): option = optio...
model = Model() i1 = Input("input", "TENSOR_FLOAT32", "{1, 2, 2, 1}") axis = Parameter("axis", "TENSOR_INT32", "{1}", [2]) keepDims = False output = Output("output", "TENSOR_FLOAT32", "{1, 2, 1}") model = model.Operation("REDUCE_MIN", i1, axis, keepDims).To(output) # Example 1. Input in operand 0, input0 = {i1: # inp...
model = model() i1 = input('input', 'TENSOR_FLOAT32', '{1, 2, 2, 1}') axis = parameter('axis', 'TENSOR_INT32', '{1}', [2]) keep_dims = False output = output('output', 'TENSOR_FLOAT32', '{1, 2, 1}') model = model.Operation('REDUCE_MIN', i1, axis, keepDims).To(output) input0 = {i1: [2.0, 1.0, 3.0, 4.0]} output0 = {output...
# https://leetcode.com/problems/subrectangle-queries class SubrectangleQueries: def __init__(self, rectangle): self.rectangle = rectangle def updateSubrectangle(self, row1, col1, row2, col2, newValue): for row in range(row1, row2 + 1): for col in range(col1, col2 + 1): ...
class Subrectanglequeries: def __init__(self, rectangle): self.rectangle = rectangle def update_subrectangle(self, row1, col1, row2, col2, newValue): for row in range(row1, row2 + 1): for col in range(col1, col2 + 1): self.rectangle[row][col] = newValue def get...
entries = [ { "env-title": "atari-alien", "env-variant": "No-op start", "score": 6482.10, }, { "env-title": "atari-amidar", "env-variant": "No-op start", "score": 833, }, { "env-title": "atari-assault", "env-variant": "No-op start", ...
entries = [{'env-title': 'atari-alien', 'env-variant': 'No-op start', 'score': 6482.1}, {'env-title': 'atari-amidar', 'env-variant': 'No-op start', 'score': 833}, {'env-title': 'atari-assault', 'env-variant': 'No-op start', 'score': 11013.5}, {'env-title': 'atari-asterix', 'env-variant': 'No-op start', 'score': 36238.5...
class BaseViewTemplate(): def get_template(self): if self.request.user.is_authenticated: template = "core/base.html" else: template = "core/base-nav.html" return template
class Baseviewtemplate: def get_template(self): if self.request.user.is_authenticated: template = 'core/base.html' else: template = 'core/base-nav.html' return template
{ "roadMapId" : "2", "mapIds" : { "1" : { "parameter" : [ "-l" ], "code" : "import json\ndef eventHandler(event, context, callback):\n\tjsonString = json.dumps(event)\n\tprint(jsonString)\n\tif event[\"present\"] == \"person\":\n\t\tprint(\"OK\")...
{'roadMapId': '2', 'mapIds': {'1': {'parameter': ['-l'], 'code': 'import json\ndef eventHandler(event, context, callback):\n\tjsonString = json.dumps(event)\n\tprint(jsonString)\n\tif event["present"] == "person":\n\t\tprint("OK")\n\telse:\n\t\tprint("None")', 'deviceId': 'deviceId1', 'serverId': 'serverId1', 'brokerId...
# program to converte API text file to markdown for wiki. all_apis = [] with open("stepspy_api.txt","rt") as fid_api: api = [] line = fid_api.readline().strip() api.append(line) while True: line = fid_api.readline() if len(line)==0: if len(api) != 0: all_apis....
all_apis = [] with open('stepspy_api.txt', 'rt') as fid_api: api = [] line = fid_api.readline().strip() api.append(line) while True: line = fid_api.readline() if len(line) == 0: if len(api) != 0: all_apis.append(tuple(api)) break else: ...
type_input = input() symbol = input() def int_type(num): number = int(num) result = number * 2 print(result) def real_type(num): number = float(num) result = number * 1.5 print(f"{result:.2f}") def string_type(text): string = "$" + text + "$" print(string) if type_input == "int":...
type_input = input() symbol = input() def int_type(num): number = int(num) result = number * 2 print(result) def real_type(num): number = float(num) result = number * 1.5 print(f'{result:.2f}') def string_type(text): string = '$' + text + '$' print(string) if type_input == 'int': ...
class Wrapper: "Wrapper to disable commit in sqla" def __init__(self, obj): self.obj = obj def __getattr__(self, attr): if attr in ["commit", "rollback"]: return lambda *args, **kwargs: None obj = getattr(self.obj, attr) if attr not in ["cursor", "execute"]: ...
class Wrapper: """Wrapper to disable commit in sqla""" def __init__(self, obj): self.obj = obj def __getattr__(self, attr): if attr in ['commit', 'rollback']: return lambda *args, **kwargs: None obj = getattr(self.obj, attr) if attr not in ['cursor', 'execute']:...
load("@bazel_skylib//lib:paths.bzl", "paths") load("@bazel_skylib//lib:shell.bzl", "shell") load("@fbcode_macros//build_defs/config:read_configs.bzl", "read_choice") load("@fbcode_macros//build_defs/lib:allocators.bzl", "allocators") load("@fbcode_macros//build_defs/lib:build_info.bzl", "build_info") load("@fbcode_macr...
load('@bazel_skylib//lib:paths.bzl', 'paths') load('@bazel_skylib//lib:shell.bzl', 'shell') load('@fbcode_macros//build_defs/config:read_configs.bzl', 'read_choice') load('@fbcode_macros//build_defs/lib:allocators.bzl', 'allocators') load('@fbcode_macros//build_defs/lib:build_info.bzl', 'build_info') load('@fbcode_macr...
''' Given a list of non negative integers, arrange them such that they form the largest number. Example 1: Input: [10,2] Output: "210" Example 2: Input: [3,30,34,5,9] Output: "9534330" Note: The result may be very large, so you need to return a string instead of an integer. ''' class Solution(object): def large...
""" Given a list of non negative integers, arrange them such that they form the largest number. Example 1: Input: [10,2] Output: "210" Example 2: Input: [3,30,34,5,9] Output: "9534330" Note: The result may be very large, so you need to return a string instead of an integer. """ class Solution(object): def larg...
class Solution: def findAndReplacePattern(self, words: List[str], pattern: str) -> List[str]: result = [] if not words or not pattern: return result for word in words: mapping = {} isMapped = True for i, c in enum...
class Solution: def find_and_replace_pattern(self, words: List[str], pattern: str) -> List[str]: result = [] if not words or not pattern: return result for word in words: mapping = {} is_mapped = True for (i, c) in enumerate(word): ...
CONSUMER_KEY = 'WVQrIJcorH11hQoP6mHKvXIZJ' CONSUMER_SECRET = 'Ui3V1dEsa5owJnhu3nLNyqdz2hFf6HmvICPObiShmkzBszKnah' ACCESS_TOKEN = '218405160-0iabe9XqpwAJ4z4BYsaXwH3ydKpFZhnzj5xpHxpI' ACCESS_SECRET = 'PdPNfcgkc5x7TO54cxVjGOjSrqY2jbcaayV46ys9IkLj3'
consumer_key = 'WVQrIJcorH11hQoP6mHKvXIZJ' consumer_secret = 'Ui3V1dEsa5owJnhu3nLNyqdz2hFf6HmvICPObiShmkzBszKnah' access_token = '218405160-0iabe9XqpwAJ4z4BYsaXwH3ydKpFZhnzj5xpHxpI' access_secret = 'PdPNfcgkc5x7TO54cxVjGOjSrqY2jbcaayV46ys9IkLj3'
var.nexus_allowAllDigitNames = True # put it somewhere else var.doCheckForDuplicateSequences = False t = var.trees[0] a = var.alignments[0] t.data = Data() t.model.dump() print('\nAfter optimizing, the composition of the model for the non-root nodes is:') print(t.model.parts[0].comps[0].val) print('...and:') prin...
var.nexus_allowAllDigitNames = True var.doCheckForDuplicateSequences = False t = var.trees[0] a = var.alignments[0] t.data = data() t.model.dump() print('\nAfter optimizing, the composition of the model for the non-root nodes is:') print(t.model.parts[0].comps[0].val) print('...and:') print(t.model.parts[0].comps[1].va...
""" A very basic study on variables, their types and some operators """ # defining variables and values integer_value, floatValue, boolean_value = 36, 5.3, True adition = integer_value + floatValue division = integer_value / floatValue exponention1 = 3 ** 3 exponention2 = 27 ** (1 / 3) floor = integer_value // flo...
""" A very basic study on variables, their types and some operators """ (integer_value, float_value, boolean_value) = (36, 5.3, True) adition = integer_value + floatValue division = integer_value / floatValue exponention1 = 3 ** 3 exponention2 = 27 ** (1 / 3) floor = integer_value // floatValue modulo = 50 % 9 stri...
# # PySNMP MIB module HUAWEI-DATASYNC-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-DATASYNC-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:43:58 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_union, value_size_constraint, value_range_constraint, constraints_intersection) ...
def main(name="User", name2="Your Pal"): print(f"Hello, {name}! I am {name2}!") if __name__=="__main__": main()
def main(name='User', name2='Your Pal'): print(f'Hello, {name}! I am {name2}!') if __name__ == '__main__': main()
def _dup(file,mode,checked=True): """Replacement for perl built-in open function when the mode contains '&'.""" global OS_ERROR, TRACEBACK, AUTODIE try: if isinstance(file, io.IOBase): # file handle file.flush() return os.fdopen(os.dup(file.fileno()), mode, encodi...
def _dup(file, mode, checked=True): """Replacement for perl built-in open function when the mode contains '&'.""" global OS_ERROR, TRACEBACK, AUTODIE try: if isinstance(file, io.IOBase): file.flush() return os.fdopen(os.dup(file.fileno()), mode, encoding=file.encoding, errors...
# -*- coding: utf-8 -*- """ Created on Tue Jul 14 16:15:05 2020 Logical condition: If statement @author: Ashish """ day_of_week = input("What day of the week is it today? ") if day_of_week == "Monday": print("Have a great start to your week!") elif day_of_week == "Friday": print("It's ok to finish a...
""" Created on Tue Jul 14 16:15:05 2020 Logical condition: If statement @author: Ashish """ day_of_week = input('What day of the week is it today? ') if day_of_week == 'Monday': print('Have a great start to your week!') elif day_of_week == 'Friday': print("It's ok to finish a bit early!") else: print('Full ...
class PeekableIterator: def __init__(self, nums): self.nums = nums self.i = 0 def peek(self): return self.nums[self.i] def next(self): self.i += 1 return self.nums[self.i-1] def hasnext(self): return self.i < len(self.nums)
class Peekableiterator: def __init__(self, nums): self.nums = nums self.i = 0 def peek(self): return self.nums[self.i] def next(self): self.i += 1 return self.nums[self.i - 1] def hasnext(self): return self.i < len(self.nums)
# DADSA - Assignment 1 # Reece Benson class Player(): _id = None _name = None _gender = None _score = None _points = None def __init__(self, _name, _gender, _id): self._id = _id self._name = _name self._gender = _gender self._score = { } self._points = 0...
class Player: _id = None _name = None _gender = None _score = None _points = None def __init__(self, _name, _gender, _id): self._id = _id self._name = _name self._gender = _gender self._score = {} self._points = 0 def __cmp__(self, other): ""...
_champernownes_constant = "" def _calculate_champernownes_nth_decimal(length): res = [] curr_length = 0 i = 1 while curr_length < length: res += [str(i)] curr_length += len(res[-1]) i += 1 return "".join(res) def champernownes_nth_decimal(n): global _champernownes_con...
_champernownes_constant = '' def _calculate_champernownes_nth_decimal(length): res = [] curr_length = 0 i = 1 while curr_length < length: res += [str(i)] curr_length += len(res[-1]) i += 1 return ''.join(res) def champernownes_nth_decimal(n): global _champernownes_const...
class Solution: solution = [] def inorderTraversal(self, root: TreeNode) -> List[int]: if (root == None): return self.solution = [] self.inorderHelper(root) return self.solution def inorderHelper(self, root: TreeNode): if (root == None): ...
class Solution: solution = [] def inorder_traversal(self, root: TreeNode) -> List[int]: if root == None: return self.solution = [] self.inorderHelper(root) return self.solution def inorder_helper(self, root: TreeNode): if root == None: return...