content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# # PySNMP MIB module NSCPS32-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NSCPS32-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:15:28 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, 0...
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, single_value_constraint, value_range_constraint, constraints_union, value_size_constraint) ...
def popen(command, mode='r', bufsize=-1): pass class _wrap_close: def close(self): pass
def popen(command, mode='r', bufsize=-1): pass class _Wrap_Close: def close(self): pass
[ ## this file was manually modified by jt { 'functor' : { 'description' : ['Returns the exponent bits of the floating input as an integer value.', 'the other bits (sign and mantissa) are just masked.', '\par', 'The sign \\\...
[{'functor': {'description': ['Returns the exponent bits of the floating input as an integer value.', 'the other bits (sign and mantissa) are just masked.', '\\par', 'The sign \\\\f$ \\\\pm \\\\f$, exponent e and mantissa m of a floating point entry a are related by', '\\\\f$a = \\\\pm m\\\\times 2^e\\\\f$, with m betw...
a,b,c = [float(x) for x in input().split()] delta = ((b**2)-(4*a*c)) if a != 0 and delta > 0: sqrt_delta = (delta)**(1/2) r1 = (-b + sqrt_delta)/(2*a) r2 = (-b - sqrt_delta)/(2*a) print("R1 = {0:.5f}".format(r1)) print("R2 = {0:.5f}".format(r2)) else: print("Impossivel calcular")
(a, b, c) = [float(x) for x in input().split()] delta = b ** 2 - 4 * a * c if a != 0 and delta > 0: sqrt_delta = delta ** (1 / 2) r1 = (-b + sqrt_delta) / (2 * a) r2 = (-b - sqrt_delta) / (2 * a) print('R1 = {0:.5f}'.format(r1)) print('R2 = {0:.5f}'.format(r2)) else: print('Impossivel calcular')
def On(A, B): return ("On", A, B) def Clear(A): return ("Clear", A) def Smaller(A, B): return ("Smaller", A, B) class Towers(object): Pole1 = 'Pole1' Pole2 = 'Pole2' Pole3 = 'Pole3' POLES = ['Pole1', 'Pole2', 'Pole3'] @classmethod def On(cls, A, B): r...
def on(A, B): return ('On', A, B) def clear(A): return ('Clear', A) def smaller(A, B): return ('Smaller', A, B) class Towers(object): pole1 = 'Pole1' pole2 = 'Pole2' pole3 = 'Pole3' poles = ['Pole1', 'Pole2', 'Pole3'] @classmethod def on(cls, A, B): return on(A, B) @...
class Solution: @staticmethod def naive(nums,target): dp = [0]*(target+1) dp[0]=1 for i in range(1,target+1): for n in nums: if i-n>=0: dp[i]+=dp[i-n] return dp[target]
class Solution: @staticmethod def naive(nums, target): dp = [0] * (target + 1) dp[0] = 1 for i in range(1, target + 1): for n in nums: if i - n >= 0: dp[i] += dp[i - n] return dp[target]
mylist = [1,2,3] print(mylist) mylist.append(4) print(mylist) print(mylist.pop()) print(mylist) mylist.reverse() print(mylist) newlist = mylist mylist.reverse() print(newlist) print(mylist) mylist = mylist*3 print(mylist) mylist = mylist + newlist print(mylist) print(mylist[2:3]) print(mylist[4:5]) createlist = list([...
mylist = [1, 2, 3] print(mylist) mylist.append(4) print(mylist) print(mylist.pop()) print(mylist) mylist.reverse() print(mylist) newlist = mylist mylist.reverse() print(newlist) print(mylist) mylist = mylist * 3 print(mylist) mylist = mylist + newlist print(mylist) print(mylist[2:3]) print(mylist[4:5]) createlist = lis...
class Container(object): """ Holds hashable objects. Objects may occur 0 or more times """ def __init__(self): """ Creates a new container with no objects in it. I.e., any object occurs 0 times in self. """ self.vals = {} def insert(self, e): """ assumes e is hashable ...
class Container(object): """ Holds hashable objects. Objects may occur 0 or more times """ def __init__(self): """ Creates a new container with no objects in it. I.e., any object occurs 0 times in self. """ self.vals = {} def insert(self, e): """ assumes e is hashable ...
""" # UNIQUE PATHS II A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below). Now consider if some obst...
""" # UNIQUE PATHS II A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below). Now consider if some obst...
class SimpleMean: def solution(self, value1, value2): mean = ((value1 * 3.5) + (value2 * 7.5)) / 11 return "MEDIA = " + "%.5f" % (mean)
class Simplemean: def solution(self, value1, value2): mean = (value1 * 3.5 + value2 * 7.5) / 11 return 'MEDIA = ' + '%.5f' % mean
#Basic Data Types Challenge 3: Temperature Conversion App print("Welcome to the Temperature Conversion App") #Gather user input temp_f = float(input("\nWhat is the given temperature in degrees Fahrenheit: ")) #Convert temps temp_c = (5/9)*(temp_f - 32) temp_k = temp_c + 273.15 #Round temps temp_f = round(temp_f, 4...
print('Welcome to the Temperature Conversion App') temp_f = float(input('\nWhat is the given temperature in degrees Fahrenheit: ')) temp_c = 5 / 9 * (temp_f - 32) temp_k = temp_c + 273.15 temp_f = round(temp_f, 4) temp_c = round(temp_c, 4) temp_k = round(temp_k, 4) print('\nDegrees Fahrenheit:\t' + str(temp_f)) print('...
# compare class # print class # -*- coding:utf-8 -*- def key_func(n): return n.score class TestClass: def __init__(self, code, name, score): self.code = code self.name = name self.score = score # can be printed if define __str__ def __str__(self): return '({}, {}, ...
def key_func(n): return n.score class Testclass: def __init__(self, code, name, score): self.code = code self.name = name self.score = score def __str__(self): return '({}, {}, {})'.format(self.code, self.name, self.score) l = [test_class(1, 'Python', 100), test_class(2, '...
#!/usr/bin/python3 """ A rectangle class defination """ class Rectangle: """ A Rectangular class """ def __init__(self, width=0, height=0): """ Initialize the class""" self.width = width self.height = height @property def width(self): """ width getter method """ ...
""" A rectangle class defination """ class Rectangle: """ A Rectangular class """ def __init__(self, width=0, height=0): """ Initialize the class""" self.width = width self.height = height @property def width(self): """ width getter method """ return self.__wid...
# coding=utf8 ROOT_RULE = 'statement -> [mquery]' GRAMMAR_DICTIONARY = {} GRAMMAR_DICTIONARY["statement"] = ['(mquery ws)'] GRAMMAR_DICTIONARY["mquery"] = [ '(ws select_clause ws from_clause ws where_clause ws groupby_clause ws having_clause ws orderby_clause ws limit)', '(ws select_clause ws from_clause ws ...
root_rule = 'statement -> [mquery]' grammar_dictionary = {} GRAMMAR_DICTIONARY['statement'] = ['(mquery ws)'] GRAMMAR_DICTIONARY['mquery'] = ['(ws select_clause ws from_clause ws where_clause ws groupby_clause ws having_clause ws orderby_clause ws limit)', '(ws select_clause ws from_clause ws where_clause ws groupby_cl...
""" Copyright (C) 2019 Interactive Brokers LLC. All rights reserved. This code is subject to the terms and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable. """ """ High level IB message info. """ # field types INT = 1 STR = 2 FLT = 3 # incoming msg id's class IN: ...
""" Copyright (C) 2019 Interactive Brokers LLC. All rights reserved. This code is subject to the terms and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable. """ '\nHigh level IB message info.\n' int = 1 str = 2 flt = 3 class In: tick_price = 1 tick_size = 2 o...
class SystemTopology(object): def __init__(self, topology, resolution="martini"): if resolution == "martini": lipid_indices = topology.select("all and not (name BB or (name =~ 'SC[1-9]'))") proteins_indices = topology.select("name BB or (name BB or (name =~ 'SC[1-9]'))") ...
class Systemtopology(object): def __init__(self, topology, resolution='martini'): if resolution == 'martini': lipid_indices = topology.select("all and not (name BB or (name =~ 'SC[1-9]'))") proteins_indices = topology.select("name BB or (name BB or (name =~ 'SC[1-9]'))") sel...
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # 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 ...
created = 'created' updated = 'updated' deleted = 'deleted' promoted = 'promoted' viewed = 'viewed' stats = 'stats' cloned = 'cloned' resumed = 'resumed' started = 'started' restarted = 'restarted' copied = 'copied' succeeded = 'succeeded' failed = 'failed' done = 'done' stopped = 'stopped' approved = 'approved' invali...
class ActionBatchSm(object): def __init__(self): super(ActionBatchSm, self).__init__() def deleteNetworkSmUserAccessDevice(self, networkId: str, userAccessDeviceId: str): """ **Delete a User Access Device** https://developer.cisco.com/meraki/api-v1/#!delete-network-sm-user-acc...
class Actionbatchsm(object): def __init__(self): super(ActionBatchSm, self).__init__() def delete_network_sm_user_access_device(self, networkId: str, userAccessDeviceId: str): """ **Delete a User Access Device** https://developer.cisco.com/meraki/api-v1/#!delete-network-sm-user...
''' 09 - Facetting multiple regressions lmplot() allows us to facet the data across multiple rows and columns. In the previous plot, the multiple lines were difficult to read in one plot. We can try creating multiple plots by Region to see if that is a more useful visualization. Instructions - Use lmplot() to look ...
""" 09 - Facetting multiple regressions lmplot() allows us to facet the data across multiple rows and columns. In the previous plot, the multiple lines were difficult to read in one plot. We can try creating multiple plots by Region to see if that is a more useful visualization. Instructions - Use lmplot() to look ...
# -*- coding: utf-8 -*- # vi: set ft=python sw=4 : """SLRD base exception classes. This module defines main types of exceptions raised in SLRD project. The base class SLRDException indicates that the exception is related to SLRD program and was a result of program-specific causes. SLRDRuntimeException is a base class...
"""SLRD base exception classes. This module defines main types of exceptions raised in SLRD project. The base class SLRDException indicates that the exception is related to SLRD program and was a result of program-specific causes. SLRDRuntimeException is a base class for exceptions that happen due to a dynimic input ...
def get_context_vars(): return {"entity_type": "user", "date": "2018-10-20", "batch_size": "daily"} def get_metadata(): return { "extractor": {"params": {"input_path": "user/p_year=2018/p_month=10/p_day=20"}, "name": "JSONExtractor"}, "transformers": [ {"params": {"exploded_elem_na...
def get_context_vars(): return {'entity_type': 'user', 'date': '2018-10-20', 'batch_size': 'daily'} def get_metadata(): return {'extractor': {'params': {'input_path': 'user/p_year=2018/p_month=10/p_day=20'}, 'name': 'JSONExtractor'}, 'transformers': [{'params': {'exploded_elem_name': 'friends_element', 'path_t...
def conv_output_shape(h_w, kernel_size=1, stride=1, pad=0, dilation=1): """ Utility function for computing output of convolutions takes a tuple of (h,w) and returns a tuple of (h,w) """ if type(h_w) is not tuple: h_w = (h_w, h_w) if type(kernel_size) is not tuple: kernel_size = ...
def conv_output_shape(h_w, kernel_size=1, stride=1, pad=0, dilation=1): """ Utility function for computing output of convolutions takes a tuple of (h,w) and returns a tuple of (h,w) """ if type(h_w) is not tuple: h_w = (h_w, h_w) if type(kernel_size) is not tuple: kernel_size = (...
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ VERSION = "11.1.1" # type: str SDK_MONIKER = "search-documents/{}".format(VERSION) # type: str
version = '11.1.1' sdk_moniker = 'search-documents/{}'.format(VERSION)
class Solution: def lastStoneWeight(self, stones: List[int]) -> int: stones.sort() while len(stones) > 1: first = stones.pop() second = stones.pop() if first == second: continue else: diff = first - sec...
class Solution: def last_stone_weight(self, stones: List[int]) -> int: stones.sort() while len(stones) > 1: first = stones.pop() second = stones.pop() if first == second: continue else: diff = first - second ...
""" This file provides functions for converting deeprobust data to pytorch geometric data. """
""" This file provides functions for converting deeprobust data to pytorch geometric data. """
def set_qmxgraph_debug(enabled): """ Enables/disables checks and other helpful debug features globally in QmxGraph. :param bool enabled: If enabled or not. """ global _QGRAPH_DEBUG _QGRAPH_DEBUG = bool(enabled) def is_qmxgraph_debug_enabled(): """ :rtype: bool :return: Are Qmx...
def set_qmxgraph_debug(enabled): """ Enables/disables checks and other helpful debug features globally in QmxGraph. :param bool enabled: If enabled or not. """ global _QGRAPH_DEBUG _qgraph_debug = bool(enabled) def is_qmxgraph_debug_enabled(): """ :rtype: bool :return: Are QmxG...
B = [['m', 'm', '_', '_', '_'], ['m', 'm', '_', '_', '_'], ['_', '_', 'm', '_', '_']] M = len(B); N = len(B[0]) answer = [] for row in range(M): new_row = [] for column in range(N): if B[row][column]=='m': new_row.append('m') else: mine_number=0 ...
b = [['m', 'm', '_', '_', '_'], ['m', 'm', '_', '_', '_'], ['_', '_', 'm', '_', '_']] m = len(B) n = len(B[0]) answer = [] for row in range(M): new_row = [] for column in range(N): if B[row][column] == 'm': new_row.append('m') else: mine_number = 0 if row > 0 ...
def getPeople(): """ In practice, here I would have a reference of a collection in the database. The collection can be stored in a variable like config of the app, and later retrieved here using current_app module of Flask. Then on that collection we can perform a query. """ return 'Hello'
def get_people(): """ In practice, here I would have a reference of a collection in the database. The collection can be stored in a variable like config of the app, and later retrieved here using current_app module of Flask. Then on that collection we can perform a query. """ return 'Hello'
# DUNDER METHODS IS METHODS WITH __example___ class Number: def __init__(self, num): self.num = num def __add__(self, num2): print("lets add") return self.num + num2.num def __mul__(self, num2): print("lets multiply") return self.num * num2.num def __str__...
class Number: def __init__(self, num): self.num = num def __add__(self, num2): print('lets add') return self.num + num2.num def __mul__(self, num2): print('lets multiply') return self.num * num2.num def __str__(self): return f'Decimal Number: {self.num...
class RecipeScrapersExceptions(Exception): def __init__(self, message): self.message = message super().__init__(message) def __str__(self): return f"recipe-scrapers exception: {self.message}" class WebsiteNotImplementedError(RecipeScrapersExceptions): """Error when website is not ...
class Recipescrapersexceptions(Exception): def __init__(self, message): self.message = message super().__init__(message) def __str__(self): return f'recipe-scrapers exception: {self.message}' class Websitenotimplementederror(RecipeScrapersExceptions): """Error when website is not ...
# -*- coding: utf-8 -*- """Functional tests using WebTest. See: http://webtest.readthedocs.org/ """ class TestHome: """Home page.""" def test_get_homepage_returns_200(self, testapp): """Get homepage successful.""" # Goes to homepage res = testapp.get('/') assert res.status_co...
"""Functional tests using WebTest. See: http://webtest.readthedocs.org/ """ class Testhome: """Home page.""" def test_get_homepage_returns_200(self, testapp): """Get homepage successful.""" res = testapp.get('/') assert res.status_code == 200 class Testabout: """About page.""" ...
def dfs(i): if visited[i]: return visited[i] = 1 for nbr in graph[i]: dfs(nbr) n,e = map(int,input().split()) graph = dict() visited = [0 for i in range(n+1)] for i in range(1,n+1): graph[i] = [] for i in range(e): u,v = map(int,input().split()) graph[u].append(v) graph[...
def dfs(i): if visited[i]: return visited[i] = 1 for nbr in graph[i]: dfs(nbr) (n, e) = map(int, input().split()) graph = dict() visited = [0 for i in range(n + 1)] for i in range(1, n + 1): graph[i] = [] for i in range(e): (u, v) = map(int, input().split()) graph[u].append(v) ...
""" A huge map of every Twitter API endpoint to a function definition in \ Twython. Parameters that need to be embedded in the URL are treated with mustaches,\ e.g: {{version}}, etc When creating new endpoint definitions, keep in mind that the name of the\ mustache will be replaced with the keyword t...
""" A huge map of every Twitter API endpoint to a function definition in Twython. Parameters that need to be embedded in the URL are treated with mustaches, e.g: {{version}}, etc When creating new endpoint definitions, keep in mind that the name of the mustache will be replaced with the keyword that ge...
class Vote(object): def __init__(self, candidates_running, candidate_preferences): self.candidate_preferences = filter( lambda candidate: candidate in candidates_running, candidate_preferences ) self.value = 1 def is_exhausted(self): """ Returns t...
class Vote(object): def __init__(self, candidates_running, candidate_preferences): self.candidate_preferences = filter(lambda candidate: candidate in candidates_running, candidate_preferences) self.value = 1 def is_exhausted(self): """ Returns true if this vote has no preferred...
"""sci_analysis module: graph Classes: Graph - The super class all other sci_analysis graphing classes descend from. GraphHisto - Draws a histogram. GraphScatter - Draws an x-by-y scatter plot. GraphBoxplot - Draws box plots of the provided data as well as an optional probability plot. """ # TODO: Add ...
"""sci_analysis module: graph Classes: Graph - The super class all other sci_analysis graphing classes descend from. GraphHisto - Draws a histogram. GraphScatter - Draws an x-by-y scatter plot. GraphBoxplot - Draws box plots of the provided data as well as an optional probability plot. """ _colors = ((...
class Repeater: def __init__(self, value): self.value = value def __iter__(self): return RepeaterIterator(self) class RepeaterIterator: def __init__(self, source): self.source = source def __next__(self): return self.source.value
class Repeater: def __init__(self, value): self.value = value def __iter__(self): return repeater_iterator(self) class Repeateriterator: def __init__(self, source): self.source = source def __next__(self): return self.source.value
#### Init service_domain = data.get('service_domain') service = data.get('service') service_data_increase = data.get('service_data_increase') service_data_decrease = data.get('service_data_decrease') # fan speed data speed = data.get('fan_speed') speed_count = data.get('fan_speed_count') fan_speed_entity = hass...
service_domain = data.get('service_domain') service = data.get('service') service_data_increase = data.get('service_data_increase') service_data_decrease = data.get('service_data_decrease') speed = data.get('fan_speed') speed_count = data.get('fan_speed_count') fan_speed_entity = hass.states.get(data.get('fan_speed_ent...
class Error(Exception): """Base class for other exceptions""" def __init__(self, message): self.message = message super().__init__(self.message) def __str__(self): return self.message class ElasticSearchError(Error): """Raised when elasticsearch error"""
class Error(Exception): """Base class for other exceptions""" def __init__(self, message): self.message = message super().__init__(self.message) def __str__(self): return self.message class Elasticsearcherror(Error): """Raised when elasticsearch error"""
word = input() while word != "Stop": print(word) word = input()
word = input() while word != 'Stop': print(word) word = input()
# Copyright 2019 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
"""Starlark transition support for Apple rules.""" load('@bazel_skylib//lib:dicts.bzl', 'dicts') def _cpu_string(*, cpu, platform_type, settings): """Generates a <platform>_<arch> string for the current target based on the given parameters. Args: cpu: A valid Apple cpu command line option as a string,...
# -*- coding: utf-8 -*- ''' File name: code\number_mind\sol_185.py Author: Vaidic Joshi Date created: Oct 20, 2018 Python Version: 3.x ''' # Solution to Project Euler Problem #185 :: Number Mind # # For more information see: # https://projecteuler.net/problem=185 # Problem Statement ''' The game Nu...
""" File name: code umber_mind\\sol_185.py Author: Vaidic Joshi Date created: Oct 20, 2018 Python Version: 3.x """ "\nThe game Number Mind is a variant of the well known game Master Mind.\nInstead of coloured pegs, you have to guess a secret sequence of digits. After each guess you're only told in how m...
# Copyright 2020 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. # generates fennel_rev0 revs = [0] inas = [ ('ina3221', '0x40:0', 'ppvar_sys', 7.7, 0.020, 'rem', True), # R91200 ('ina3221', '0x40:1', ...
revs = [0] inas = [('ina3221', '0x40:0', 'ppvar_sys', 7.7, 0.02, 'rem', True), ('ina3221', '0x40:1', 'vbat', 7.7, 0.02, 'rem', True), ('ina3221', '0x40:2', 'pp1800_h1', 1.8, 0.05, 'rem', True), ('ina3221', '0x41:0', 'ppvar_bl', 7.7, 0.1, 'rem', True), ('ina3221', '0x41:1', 'pp1800_ec', 1.8, 0.05, 'rem', True), ('ina322...
tx_zips = [] with open('../data/texas-zip-codes.csv', 'r') as fin: reader = fin.readlines() i = 0 for row in reader: newrow = row.split(',') state = newrow[4].strip('"') if state == 'TX': tx_zips.append(newrow[0].strip('"')) i += 1 with open('tx-zips.txt', 'w...
tx_zips = [] with open('../data/texas-zip-codes.csv', 'r') as fin: reader = fin.readlines() i = 0 for row in reader: newrow = row.split(',') state = newrow[4].strip('"') if state == 'TX': tx_zips.append(newrow[0].strip('"')) i += 1 with open('tx-zips.txt', 'w') as...
# Hello World program in Python print("Python Dictionaries\n") print("In Python dictionaries are written with curly brackets, and they have keys and values.\n") # Create and print a dictionary: thisdict = { "name": "Alex", "roll_number": "234566", "passing_year": 1964 } print(thisdict) # You can access t...
print('Python Dictionaries\n') print('In Python dictionaries are written with curly brackets, and they have keys and values.\n') thisdict = {'name': 'Alex', 'roll_number': '234566', 'passing_year': 1964} print(thisdict) x = thisdict['roll_number'] print(x) x = thisdict.get('roll_number') print(x) thisdict['passing_year...
def convert_token(token): cursor = 0 converted_token = '' while cursor < len(token): if cursor > 0 and token[cursor].isupper() and token[cursor - 1] != '_': converted_token += '_' + token[cursor].lower() elif cursor > 0 and token[cursor - 1].isupper() and converted_token[-1].islo...
def convert_token(token): cursor = 0 converted_token = '' while cursor < len(token): if cursor > 0 and token[cursor].isupper() and (token[cursor - 1] != '_'): converted_token += '_' + token[cursor].lower() elif cursor > 0 and token[cursor - 1].isupper() and converted_token[-1].is...
__author__ = 'fengyuyao' class Template(object): def __init__(self, source): pass def render(self, **kwargs): pass
__author__ = 'fengyuyao' class Template(object): def __init__(self, source): pass def render(self, **kwargs): pass
# # PySNMP MIB module CNTAU-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CNTAU-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:09:32 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23...
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, constraints_union, single_value_constraint, value_range_constraint, value_size_constraint) ...
class Location: __name: str = None def __init__(self, name: str) -> None: if type(name) != str: raise TypeError('name of Location must be a string') elif len(name) <= 0: raise ValueError("name of Location must be non-empty") self.__name = name @property ...
class Location: __name: str = None def __init__(self, name: str) -> None: if type(name) != str: raise type_error('name of Location must be a string') elif len(name) <= 0: raise value_error('name of Location must be non-empty') self.__name = name @property ...
asset_permissions = {} asset_permissions["charge_market_fee"] = 0x01 asset_permissions["white_list"] = 0x02 asset_permissions["override_authority"] = 0x04 asset_permissions["transfer_restricted"] = 0x08 asset_permissions["disable_force_settle"] = 0x10 asset_permissions["global_settle"] = 0x20 asset_permissions["disable...
asset_permissions = {} asset_permissions['charge_market_fee'] = 1 asset_permissions['white_list'] = 2 asset_permissions['override_authority'] = 4 asset_permissions['transfer_restricted'] = 8 asset_permissions['disable_force_settle'] = 16 asset_permissions['global_settle'] = 32 asset_permissions['disable_confidential'] ...
#!/usr/bin/env python # -*- coding: utf-8 -*- url = 'http://practiapinta.me/tepinta' sender = 'practiatepinta@practia.global' password = '' smtp = 'owa.pragmaconsultores.net' body = ''
url = 'http://practiapinta.me/tepinta' sender = 'practiatepinta@practia.global' password = '' smtp = 'owa.pragmaconsultores.net' body = ''
def main(): with open('input.txt') as file: data = file.read().strip().split('\n') n = int(data[0]) symbols = data[1] number = int(data[2]) cleaned_sumbols = '' for symbol in symbols: if symbol != ' ': cleaned_sumbols += symbol outp...
def main(): with open('input.txt') as file: data = file.read().strip().split('\n') n = int(data[0]) symbols = data[1] number = int(data[2]) cleaned_sumbols = '' for symbol in symbols: if symbol != ' ': cleaned_sumbols += symbol outp...
test = { 'name': 'q3_3_1', 'points': 1, 'suites': [ { 'cases': [ { 'code': r""" >>> # Fill in the row; >>> # time = ...; >>> # with something like:; >>> # time = 4.567; >>> # (except with the right number).; >>> time != .....
test = {'name': 'q3_3_1', 'points': 1, 'suites': [{'cases': [{'code': '\n >>> # Fill in the row;\n >>> # time = ...;\n >>> # with something like:;\n >>> # time = 4.567;\n >>> # (except with the right number).;\n >>> time != ...\n True\n ', 'hid...
# File: windowsdefenderatp_consts.py # Copyright (c) 2019 Splunk Inc. # # Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) # DEFENDERATP_PHANTOM_BASE_URL = '{phantom_base_url}rest' DEFENDERATP_PHANTOM_SYS_INFO_URL = '/system_info' DEFENDERATP_PHANTOM_ASSET_INFO_URL = '/asset/{asset_id}' DEFE...
defenderatp_phantom_base_url = '{phantom_base_url}rest' defenderatp_phantom_sys_info_url = '/system_info' defenderatp_phantom_asset_info_url = '/asset/{asset_id}' defenderatp_login_base_url = 'https://login.microsoftonline.com' defenderatp_server_token_url = '/{tenant_id}/oauth2/token' defenderatp_authorize_url = '/{te...
class Delete(object): def __init__(self, graphConnector, userPrincipalName='me'): """The Delete class deletes a message from a users mailbox. NOTE: Please note that this will do a soft delete and it is only recoverable via "Recoverable Items" feature on a mailbox. This a...
class Delete(object): def __init__(self, graphConnector, userPrincipalName='me'): """The Delete class deletes a message from a users mailbox. NOTE: Please note that this will do a soft delete and it is only recoverable via "Recoverable Items" feature on a mailbox. This also...
count=0 total=0 print('before', count,total) for numbers in [9,41,12,3,74,15]: count=count+1 total=total+numbers print (count,total,numbers) print('After', count, total, total/count)
count = 0 total = 0 print('before', count, total) for numbers in [9, 41, 12, 3, 74, 15]: count = count + 1 total = total + numbers print(count, total, numbers) print('After', count, total, total / count)
def karatsuba_multiplication(x, y): x_digits = len(str(x)) y_digits = len(str(y)) # Base case for the recursion. if (x_digits == 1 or y_digits == 1): return x * y # Figure out where to split. n2 = max(x_digits, y_digits) / 2 factor = int(10 ** n2) # Break up the number into p...
def karatsuba_multiplication(x, y): x_digits = len(str(x)) y_digits = len(str(y)) if x_digits == 1 or y_digits == 1: return x * y n2 = max(x_digits, y_digits) / 2 factor = int(10 ** n2) a = x // factor b = x % factor c = y // factor d = y % factor z2 = karatsuba_multiplic...
#!/usr/bin/env python active = { 'url': 'https://<SUBDOMAIN>.carbonblack.io/api/v1/process', 'key': '<API KEY>' } # ====================================================================== # Place API key and URL in 'active' to use with the cmdline-search.py # ===================================================...
active = {'url': 'https://<SUBDOMAIN>.carbonblack.io/api/v1/process', 'key': '<API KEY>'} env1 = {'url': 'https://<SUBDOMAIN>.carbonblack.io/api/v1/process', 'key': '<API KEY>'} env2 = {'url': 'https://<SUBDOMAIN>.carbonblack.io/api/v1/process', 'key': '<API KEY>'} etc = {'url': 'https://<SUBDOMAIN>.carbonblack.io/api/...
ctr = 1 while ctr != -1 : try: ctr = int(input('Enter a number ( -1 to exit) : ')) except ValueError: print("That was not a number") else: #Only executed when no exception happens print("No exception happened") finally: print("finally executed")
ctr = 1 while ctr != -1: try: ctr = int(input('Enter a number ( -1 to exit) : ')) except ValueError: print('That was not a number') else: print('No exception happened') finally: print('finally executed')
# # PySNMP MIB module CISCO-ATM-IF-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ATM-IF-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:33:08 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar ...
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, constraints_intersection, single_value_constraint, value_size_constraint, value_range_constraint) ...
DEBUG = False LANGUAGES = (("en", "English"),) LANGUAGE_CODE = "en" USE_TZ = False USE_I18N = True SECRET_KEY = "fake-key" PASSWORD_EXPIRE_SECONDS = 10 * 60 # 10 minutes PASSWORD_EXPIRE_WARN_SECONDS = 5 * 60 # 5 minutes INSTALLED_APPS = [ "django.contrib.auth", "django.contrib.contenttypes", "django.con...
debug = False languages = (('en', 'English'),) language_code = 'en' use_tz = False use_i18_n = True secret_key = 'fake-key' password_expire_seconds = 10 * 60 password_expire_warn_seconds = 5 * 60 installed_apps = ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', '...
# Copyright (c) 2020 DDN. All rights reserved. # Use of this source code is governed by a MIT-style # license that can be found in the LICENSE file. """ Shell-based scheduler which records process name and user id. """ FIELDS = "name", "user" def fetch(ids): "Generate process names and user ids." for id in...
""" Shell-based scheduler which records process name and user id. """ fields = ('name', 'user') def fetch(ids): """Generate process names and user ids.""" for id in ids: yield dict(zip(FIELDS, id.rsplit('.', 1)))
def test_image_name(add_product_with_image, find_product_image): print(type(find_product_image)) print(find_product_image) assert 'macbook_pro' in find_product_image
def test_image_name(add_product_with_image, find_product_image): print(type(find_product_image)) print(find_product_image) assert 'macbook_pro' in find_product_image
# yahoo.py # Trevor Pottinger # Fri Oct 18 22:57:23 PDT 2019 class Yahoo(object): @classmethod async def gen_s_and_p_history() -> None: url = 'https://finance.yahoo.com/quote/%5EGSPC/history?period1=1413529200&period2=1571295600&interval=1d&filter=history&frequency=1d'
class Yahoo(object): @classmethod async def gen_s_and_p_history() -> None: url = 'https://finance.yahoo.com/quote/%5EGSPC/history?period1=1413529200&period2=1571295600&interval=1d&filter=history&frequency=1d'
# https://leetcode.com/problems/decode-string/ # Given an encoded string, return it's decoded string. # # The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer. # # You may assume that the input ...
class Solution(object): def rle_decoding(self, strs): (res_list, cnt_list, res_str, cnt, i) = ([], [], '', 0, 0) while i < len(strs): if strs[i].isdigit(): cnt = cnt * 10 + int(strs[i]) i += 1 continue else: j =...
# OOBE Stages OOBE_ASK_PHONE_TYPE = 0 OOBE_DOWNLOAD_MESSAGE = 1 OOBE_WAITING_ON_PHONE_TO_ENTER_CODE = 2 OOBE_WAITING_ON_PHONE_TO_ACCEPT_PAIRING = 3 OOBE_PAIRING_SUCCESS = 4 OOBE_CHECKING_FOR_UPDATE = 5 OOBE_STARTING_UPDATE = 6 OOBE_UPDATE_COMPLETE = 7 OOBE_WAITING_ON_PHONE_TO_COMPLETE_OOBE = 8 OOBE_PRESS_ACTION_BUTTON ...
oobe_ask_phone_type = 0 oobe_download_message = 1 oobe_waiting_on_phone_to_enter_code = 2 oobe_waiting_on_phone_to_accept_pairing = 3 oobe_pairing_success = 4 oobe_checking_for_update = 5 oobe_starting_update = 6 oobe_update_complete = 7 oobe_waiting_on_phone_to_complete_oobe = 8 oobe_press_action_button = 9 oobe_error...
''' - Leetcode problem: 22 - Difficulty: Medium - Brief problem description: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: [ "((()))", "(()())", "(())()", "()(())", "()()()" ] - Solution Summary: ...
""" - Leetcode problem: 22 - Difficulty: Medium - Brief problem description: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: [ "((()))", "(()())", "(())()", "()(())", "()()()" ] - Solution Summary: ...
""" Interface for swappable strategies used for dealing with transactions in QueryManager Based on the strategy pattern https://en.wikipedia.org/wiki/Strategy_patter """ class QueryManagerStrategy(object): def account_balances_for_dates(self, company_id, account_ids, dates, with_counterparties, excl_interco, excl_co...
""" Interface for swappable strategies used for dealing with transactions in QueryManager Based on the strategy pattern https://en.wikipedia.org/wiki/Strategy_patter """ class Querymanagerstrategy(object): def account_balances_for_dates(self, company_id, account_ids, dates, with_counterparties, excl_interco, exc...
""" Placeholders for missing VQ dependencies. """ C_INI_MEDIA_C_CODECS = None dictc01bit = {} v1_quant = None v2_quant = None v_codecs = None v_bits_sample = None def encode_vq(*args, **kwargs): return None def get_codebook_from_serial(*args, **kwargs): return None def get_vq_decoded_samples(*args, **kwargs...
""" Placeholders for missing VQ dependencies. """ c_ini_media_c_codecs = None dictc01bit = {} v1_quant = None v2_quant = None v_codecs = None v_bits_sample = None def encode_vq(*args, **kwargs): return None def get_codebook_from_serial(*args, **kwargs): return None def get_vq_decoded_samples(*args, **kwargs)...
class Solution: def isPerfectSquare(self, num: int) -> bool: left, right = 0, num while left <= right: mid = left + (right - left) // 2 if mid * mid == num: return True elif mid * mid > num: right = mid - 1 else: ...
class Solution: def is_perfect_square(self, num: int) -> bool: (left, right) = (0, num) while left <= right: mid = left + (right - left) // 2 if mid * mid == num: return True elif mid * mid > num: right = mid - 1 else: ...
# 1-2_find_num.py def solution(input_str): # - # - # - # - # - # - # - # - # - # - # - # - # - # - # # Write your code here. answer = "" for i in range(10): if str(i) in input_str: pass else: answer = str(i) break return answer # - # - # - # - # - # - # - # - # - # - # - # - # - # - # input_str1 ...
def solution(input_str): answer = '' for i in range(10): if str(i) in input_str: pass else: answer = str(i) break return answer input_str1 = '012345678' input_str2 = '483750219' input_str3 = '242810485760109726496' print(solution(input_str1) + ', ' + solut...
"""Library of helper classes of optimizer.""" class GradientsClipOption: """Gradients clip option for optimizer class. Attributes: clipnorm: float. If set, the gradient of each weight is individually clipped so that its norm is no higher than this value. clipvalue: float. If set, the gradient of ea...
"""Library of helper classes of optimizer.""" class Gradientsclipoption: """Gradients clip option for optimizer class. Attributes: clipnorm: float. If set, the gradient of each weight is individually clipped so that its norm is no higher than this value. clipvalue: float. If set, the gradient of e...
"""Roaring Years.""" def reader(): return int(input()) def check_n(Y, n): if len(Y) == n: return True A = Y[-n:] Y = Y[:-n] if A[0] == "0": return False A = int(A) if len(str(A - 1)) != n: n -= 1 if len(Y) < n: return False B = int(Y[-n:]) if B...
"""Roaring Years.""" def reader(): return int(input()) def check_n(Y, n): if len(Y) == n: return True a = Y[-n:] y = Y[:-n] if A[0] == '0': return False a = int(A) if len(str(A - 1)) != n: n -= 1 if len(Y) < n: return False b = int(Y[-n:]) if B =...
class Person: def __init__(self, name, race): self.name = name self.race = race self.stamina = 100 self.agility = 100 self.strenght = 100 self.health = 100 self.intellegence = 100 self.level = 1 self.armor = 20 self.speed = 20 ...
class Person: def __init__(self, name, race): self.name = name self.race = race self.stamina = 100 self.agility = 100 self.strenght = 100 self.health = 100 self.intellegence = 100 self.level = 1 self.armor = 20 self.speed = 20 ...
# -*- coding: utf-8 -*- """ Created on Sun Oct 18 15:53:10 2020 Error Handling @author: Ashish """ try: number = float(input("Enter a number: ")) print("The number is: ", number) except: print("Invalid number")
""" Created on Sun Oct 18 15:53:10 2020 Error Handling @author: Ashish """ try: number = float(input('Enter a number: ')) print('The number is: ', number) except: print('Invalid number')
def parse_instruction(line): instruction, step = line.split() return (instruction, int(step)) def parse_program(lines): return [parse_instruction(line) for line in lines] def gen_alt_programs(program): for i in range(len(program)): ins, step = program[i] if ins == "jmp": ...
def parse_instruction(line): (instruction, step) = line.split() return (instruction, int(step)) def parse_program(lines): return [parse_instruction(line) for line in lines] def gen_alt_programs(program): for i in range(len(program)): (ins, step) = program[i] if ins == 'jmp': ...
class Solution(object): def lengthOfLongestSubstring(self, s): """ :type s: str :rtype: int """ substr = [] curr = [] for i in range(0, len(s)): letter = s[i:i+1] if letter in curr: if len(curr) > len(substr): ...
class Solution(object): def length_of_longest_substring(self, s): """ :type s: str :rtype: int """ substr = [] curr = [] for i in range(0, len(s)): letter = s[i:i + 1] if letter in curr: if len(curr) > len(substr): ...
class converter: def convertParagraph(self,st): st = st.replace("two dollars","$2") st = st.replace("C M","CM") st = st.replace("Triple A","AAA") st = st.replace("United State of America","USA") return st
class Converter: def convert_paragraph(self, st): st = st.replace('two dollars', '$2') st = st.replace('C M', 'CM') st = st.replace('Triple A', 'AAA') st = st.replace('United State of America', 'USA') return st
class Solution: def minSwap(self, A: List[int], B: List[int]) -> int: n = len(A) # swap[i]: minimum swap times to make A[:i], B[:i] increasing, with swap on A[i] and B[i] # notSwap[i]: minimum swap times to make A[:i], B[:i] increasing, without swap on A[i] and B[i] swap = [n] * n ...
class Solution: def min_swap(self, A: List[int], B: List[int]) -> int: n = len(A) swap = [n] * n not_swap = [n] * n swap[0] = 1 notSwap[0] = 0 for i in range(1, n): if A[i] > A[i - 1] and B[i] > B[i - 1]: notSwap[i] = notSwap[i - 1] ...
__version_info__ = __version__ = version = VERSION = '0.1.0' def get_version(): return version
__version_info__ = __version__ = version = version = '0.1.0' def get_version(): return version
# Challenge 39 Easy # https://www.reddit.com/r/dailyprogrammer/comments/s6bas/4122012_challenge_39_easy/ # Takes parameter n # Prints number on each line, except # if n % 3, print Fizz, n % 5 Buzz, both, FizzBuzz def nprint(n): for i in range(1, n+1): if i % 3 == 0 and i % 5 == 0: prin...
def nprint(n): for i in range(1, n + 1): if i % 3 == 0 and i % 5 == 0: print('FizzBuzz') elif i % 3 == 0: print('Fizz') elif i % 5 == 0: print('Buzz') else: print(i)
class PlayViewTickFeature: def playv_tick(game): if game.tile_at_player == None: # skip graphics game.tick return if type(game.tile_at_player) == tuple: if game.tile_at_player[1] == 'a': # The player has encountered a cliff game.ti...
class Playviewtickfeature: def playv_tick(game): if game.tile_at_player == None: return if type(game.tile_at_player) == tuple: if game.tile_at_player[1] == 'a': game.tile_at_player = game.tile_at_player[0] game.focus_camera(game.player) ...
# Copyright 2012-2018 Ben Lambert # 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 writing...
""" Just a class to represent a sentence or utterance. """ class Sentence(object): """Represents a sentence or utterance.""" def __init__(self, id_, words, acscore=None, lmscore=None, lmscores=None, acscores=None): """Constructor. ID and words are required.""" self.id_ = id_ self.word...
# coding: utf-8 class Config(object): def __init__(self): pass def initialize(self): pass def exit(self): pass
class Config(object): def __init__(self): pass def initialize(self): pass def exit(self): pass
""" Basic Insertionsort program. """ def insertion_sort(arr): # Traverse through 1 to len(arr) for i in range(1, len(arr)): key = arr[i] # Move element of arr[0...i-1], that are greater than key, # to one position ahead of their current position j = i - 1 while j >= 00 ...
""" Basic Insertionsort program. """ def insertion_sort(arr): for i in range(1, len(arr)): key = arr[i] j = i - 1 while j >= 0 and key < arr[j]: arr[j + 1] = arr[j] j -= 1 arr[j + 1] = key return arr
#!/usr/bin/env python # -*- coding: utf-8 -*- # instance configs PRIMARY_OS = 'Ubuntu-16.04' PRIMARY = '''#!/bin/sh FQDN="{fqdn}" export DEBIAN_FRONTEND=noninteractive # locale sudo locale-gen en_US.UTF-8 # hostname hostnamectl set-hostname $FQDN sed -i "1 c\\127.0.0.1 $FQDN localhost" /etc/hosts # required packa...
primary_os = 'Ubuntu-16.04' primary = '#!/bin/sh\n\nFQDN="{fqdn}"\n\nexport DEBIAN_FRONTEND=noninteractive\n\n# locale\nsudo locale-gen en_US.UTF-8\n\n# hostname\nhostnamectl set-hostname $FQDN\nsed -i "1 c\\127.0.0.1 $FQDN localhost" /etc/hosts\n\n# required packages\napt-get update\napt-get install -y -q slapd ldap-u...
config = { # + # This is where you specify your dataset: # whether it's CVS or MongoDB, the connect parameters, etc. # # To experiment with this, replace the CSV file with any dataset that you # wish to analyze. Or point this to a MongoDB collection. # # This particular dataset contains...
config = {'data': {'type': 'CSV', 'collection': 'FY11Leads.csv', 'dbname': None, 'query': {}, 'host': 'localhost', 'port': 27017, 'username': None, 'password': None, 'noid': True}, 'collection': {'label_outputs': ['Recruitment Failure', 'Recruitment Success'], 'cat_features': ['GENDER', 'RACE', 'STATE'], 'cont_features...
__author__ = 'Arseniy' class Project: def __init__(self, name="", description=""): self.name = name self.description = description def __repr__(self): return "%s; %s" % (self.name, self.description) def __eq__(self, other): return self.name == other.name def name(se...
__author__ = 'Arseniy' class Project: def __init__(self, name='', description=''): self.name = name self.description = description def __repr__(self): return '%s; %s' % (self.name, self.description) def __eq__(self, other): return self.name == other.name def name(sel...
class credentials: ''' Class that generates new instances of credentials ''' credentials_list = [] def __init__(self, user_name, password): self.user_name = user_name self.password = password ''' __init__method that helps define properties for our objects. ...
class Credentials: """ Class that generates new instances of credentials """ credentials_list = [] def __init__(self, user_name, password): self.user_name = user_name self.password = password '\n __init__method that helps define properties for our objects.\n ...
# Python implementation of puzzle 5 # Probably should add string ops to Lavender STL def main(str): seq = list(map(lambda x: int(x), str.split())) count = 0 pos = 0 while pos >= 0 and pos < len(seq): tmp = pos pos += seq[pos] seq[tmp] += 1 count += 1 return count ...
def main(str): seq = list(map(lambda x: int(x), str.split())) count = 0 pos = 0 while pos >= 0 and pos < len(seq): tmp = pos pos += seq[pos] seq[tmp] += 1 count += 1 return count def main2(str): seq = list(map(lambda x: int(x), str.split())) count = 0 pos...
text = type(type) print(text)
text = type(type) print(text)
#C1 = int(input()) #N1 = int(input()) #V1 = float(input()) #C2 = int(input()) #N2 = int(input()) #V2 = float(input()) #soma1 = N1 * V1 #soma2 = N2 * V2 #resultado = soma1 + soma2 #print('VALOR A PAGAR: R$ %.2f' % resultado) linha = input().split() C1 = int(linha[0]) N1 = int(linha[1]) V1 = float(linha[2]) linha2 ...
linha = input().split() c1 = int(linha[0]) n1 = int(linha[1]) v1 = float(linha[2]) linha2 = input().split() c2 = int(linha2[0]) n2 = int(linha2[1]) v2 = float(linha2[2]) resultado = N1 * V1 + N2 * V2 print('VALOR A PAGAR: R$ %.2f' % resultado)
class AccessingNonExistingUserError(Exception): def __init__(self, uid): self.message = (f"User with ID {uid} can not be accessed as this user", " does not exist or is not registered") super().__init__(self.message)
class Accessingnonexistingusererror(Exception): def __init__(self, uid): self.message = (f'User with ID {uid} can not be accessed as this user', ' does not exist or is not registered') super().__init__(self.message)
def get_count(queryset): """Determine an object count in optimized manner. Incompatible with custom values/distinct/group by""" try: return queryset.values('pk').order_by().count() except (AttributeError, TypeError): return len(queryset)
def get_count(queryset): """Determine an object count in optimized manner. Incompatible with custom values/distinct/group by""" try: return queryset.values('pk').order_by().count() except (AttributeError, TypeError): return len(queryset)
class Token: """ A simple token representation, keeping track of the token's text, offset in the passage it was taken from, POS tag, dependency relation, and similar information. These fields match spacy's exactly, so we can just use a spacy token for this. Parameters ---------- text : ``s...
class Token: """ A simple token representation, keeping track of the token's text, offset in the passage it was taken from, POS tag, dependency relation, and similar information. These fields match spacy's exactly, so we can just use a spacy token for this. Parameters ---------- text : ``s...
# Copyright (c) 2019 AT&T Intellectual Property. 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 ...
global_injected_appmgr_ip_addr = '127.0.0.1' global_injected_appmgr_user = 'test' global_injected_appmgr_password = 'test' global_injected_e2_mgr_ip_addr = '127.0.0.1' global_injected_e2_mgr_user = 'test' global_injected_e2_mgr_password = 'test' global_injected_properties = {'GLOBAL_INJECTED_APPMGR_IP_ADDR': '127.0.0.1...
expected_output = { 1: { "groupname": "2c", "sec_model": "v1", "contextname": "none", "storage_type": "volatile", "readview": "none", "writeview": "none", "notifyview": "*tv.FFFF58bf.eaFF58bf.eaFFFFFF.F", "row_status": {"status": "active"}, }, ...
expected_output = {1: {'groupname': '2c', 'sec_model': 'v1', 'contextname': 'none', 'storage_type': 'volatile', 'readview': 'none', 'writeview': 'none', 'notifyview': '*tv.FFFF58bf.eaFF58bf.eaFFFFFF.F', 'row_status': {'status': 'active'}}, 2: {'groupname': '2c', 'sec_model': 'v2c', 'contextname': 'none', 'storage_type'...
load( "@ecosia_bazel_rules_nodejs_contrib//internal/nodejs_jest_test:test_sources_aspect.bzl", "test_sources_aspect", ) load("@build_bazel_rules_nodejs//internal/common:module_mappings.bzl", "module_mappings_runtime_aspect") load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect")...
load('@ecosia_bazel_rules_nodejs_contrib//internal/nodejs_jest_test:test_sources_aspect.bzl', 'test_sources_aspect') load('@build_bazel_rules_nodejs//internal/common:module_mappings.bzl', 'module_mappings_runtime_aspect') load('@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl', 'sources_aspect') load('@bui...
def day06a(input_path): responses = [line.strip() for line in open(input_path)] group_response = set() total = 0 for response in responses: if not response: total += len(group_response) group_response = set() else: group_response |= set(response) ...
def day06a(input_path): responses = [line.strip() for line in open(input_path)] group_response = set() total = 0 for response in responses: if not response: total += len(group_response) group_response = set() else: group_response |= set(response) t...
def exponentiation(a, n): '''log(n) time exponentiation''' if n == 0: return 1 elif n % 2: # odd return a*exponentiation(a, n-1) else: # even return exponentiation(a*a, n/2) def test_one(a, n, res_exp): an = exponentiation(a, n) print("exponentiation(%d, %d) = %d" % (...
def exponentiation(a, n): """log(n) time exponentiation""" if n == 0: return 1 elif n % 2: return a * exponentiation(a, n - 1) else: return exponentiation(a * a, n / 2) def test_one(a, n, res_exp): an = exponentiation(a, n) print('exponentiation(%d, %d) = %d' % (a, n, an...
# Copyright (c) 2016, Quang-Nhat Hoang-Xuan # # 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 t...
"""Base Proxy class.""" class Baseproxy: """Base proxy class.""" def proxify(self, uid, role, execution_id): """The methods that needs to be overridden by implementations.""" raise NotImplementedError def unproxify(self, uid, role, execution_id): """The methods that needs to be ov...