content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
# -*- coding: utf-8 -*-
'''
Management of Gitlab resources
==============================
:depends: - python-gitlab Python module
:configuration: See :py:mod:`salt.modules.gitlab` for setup instructions.
Enforce the project/repository
------------------------------
.. code-block:: yaml
gitlab_project:
g... | """
Management of Gitlab resources
==============================
:depends: - python-gitlab Python module
:configuration: See :py:mod:`salt.modules.gitlab` for setup instructions.
Enforce the project/repository
------------------------------
.. code-block:: yaml
gitlab_project:
gitlab.project_present:
... |
#
# PySNMP MIB module CISCO-LWAPP-MESH-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-LWAPP-MESH-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:48:49 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... | (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, single_value_constraint, value_range_constraint, constraints_union, constraints_intersection) ... |
# parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = "NUM PAL\n lista : '[' conteudo ']'\n\n conteudo :\n | elementos\n\n elementos : elem\n | elem ',' elementos\n\n elem : NUM\n ... | _tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = "NUM PAL\n lista : '[' conteudo ']'\n\n conteudo :\n | elementos\n\n elementos : elem\n | elem ',' elementos\n\n elem : NUM\n | PAL\n | lista\n\n "
_lr_action_items = {'[': ([0, 2, 10], [2, 2, 2]), '$end': (... |
def create_connection(db_file):
""" create a database connection to a SQLite database """
conn = None
try:
conn = sqlite3.connect(db_file)
print(sqlite3.version)
except Error as e:
print(e)
finally:
if conn:
conn.close()
def execute_query(conn... | def create_connection(db_file):
""" create a database connection to a SQLite database """
conn = None
try:
conn = sqlite3.connect(db_file)
print(sqlite3.version)
except Error as e:
print(e)
finally:
if conn:
conn.close()
def execute_query(conn, create_tab... |
numberMap = {}
maxValueKey= None
with open('data.txt', 'r') as data :
for line in data :
number = int(line)
value = None
if number in numberMap :
value = numberMap[number] + 1
else :
value = 1
numberMap[number] = value
if maxValueKey == None... | number_map = {}
max_value_key = None
with open('data.txt', 'r') as data:
for line in data:
number = int(line)
value = None
if number in numberMap:
value = numberMap[number] + 1
else:
value = 1
numberMap[number] = value
if maxValueKey == None or... |
class Elasticity(object):
def __init__(self, young_module, contraction, temperature):
self.__temperature = temperature
self.__contraction = contraction
self.__young_module = young_module
def get_temperature(self):
return self.__temperature
def get_contraction(self):
... | class Elasticity(object):
def __init__(self, young_module, contraction, temperature):
self.__temperature = temperature
self.__contraction = contraction
self.__young_module = young_module
def get_temperature(self):
return self.__temperature
def get_contraction(self):
... |
########################################
# AssemblerBssElement ##################
########################################
class AssemblerBssElement:
""".bss element, representing a memory area that would go to .bss section."""
def __init__(self, name, size, und_symbols = None):
"""Constructor."""
self.__... | class Assemblerbsselement:
""".bss element, representing a memory area that would go to .bss section."""
def __init__(self, name, size, und_symbols=None):
"""Constructor."""
self.__name = name
self.__size = size
self.__und = und_symbols and name in und_symbols
def get_name(... |
"""
Frozen subpackages for meta release.
"""
frozen_packages = { "libpysal": "4.3.0",
"access": "1.1.1",
"esda": "2.3.1",
"giddy": "2.3.3",
"inequality": "1.0.0",
"pointpats": "2.2.0",
"segregation": "1.3.0",
"spaghetti": "1.5.0",
"mgwr": "2.1.1",
"spglm": "1.0.7",
"spint": "... | """
Frozen subpackages for meta release.
"""
frozen_packages = {'libpysal': '4.3.0', 'access': '1.1.1', 'esda': '2.3.1', 'giddy': '2.3.3', 'inequality': '1.0.0', 'pointpats': '2.2.0', 'segregation': '1.3.0', 'spaghetti': '1.5.0', 'mgwr': '2.1.1', 'spglm': '1.0.7', 'spint': '1.0.6', 'spreg': '1.1.1', 'spvcm': '0.3.0', '... |
class Node:
def __init__(self, data):
self.data = data
self.next = None
class CircularLinkedList:
def __init__(self):
self.head = None
def print_list(self):
cur = self.head
while cur:
print(cur.data)
cur=cur.next
if cur == self... | class Node:
def __init__(self, data):
self.data = data
self.next = None
class Circularlinkedlist:
def __init__(self):
self.head = None
def print_list(self):
cur = self.head
while cur:
print(cur.data)
cur = cur.next
if cur == sel... |
# https://leetcode.com/problems/linked-list-cycle-ii/
# Given a linked list, return the node where the cycle begins. If there is no
# cycle, return null.
# There is a cycle in a linked list if there is some node in the list that can be
# reached again by continuously following the next pointer. Internally, pos is
# u... | class Solution:
def detect_cycle(self, head: ListNode) -> ListNode:
if not head or not head.next:
return None
is_cycle = False
(slow, fast) = (head, head)
while fast.next and fast.next.next:
slow = slow.next
fast = fast.next.next
if sl... |
# -*- coding: utf-8 -*-
class KriegspielException(Exception):
pass
| class Kriegspielexception(Exception):
pass |
""" Base class for set of data stores and connection provider for them """
class StoreSet:
connection_provider = None
context_store = None
user_store = None
messagelog_store = None
| """ Base class for set of data stores and connection provider for them """
class Storeset:
connection_provider = None
context_store = None
user_store = None
messagelog_store = None |
class Edge:
# edge for polygon
def __init__(self):
self.id = -1
# polygon vertex id
self.v0_id = -1
self.v1_id = -1
# connected polygon node id
self.node0_id = -1
self.node1_id = -1
# the lane id this edge cross
self.cross_lane_id = -1
... | class Edge:
def __init__(self):
self.id = -1
self.v0_id = -1
self.v1_id = -1
self.node0_id = -1
self.node1_id = -1
self.cross_lane_id = -1
def init_edge(self, v0_id, v1_id, node0_id, node1_id):
assert v0_id != v1_id
self.v0_id = v0_id
sel... |
# encoding: utf8
class End(object):
def __init__(self, connection=None):
self.connection = connection
self.__point = None
def paint(self, painter, point):
self.connection.paint(painter, self, point)
def set_point(self, point):
self.__point = point
def get_point(self)... | class End(object):
def __init__(self, connection=None):
self.connection = connection
self.__point = None
def paint(self, painter, point):
self.connection.paint(painter, self, point)
def set_point(self, point):
self.__point = point
def get_point(self):
return s... |
# Straight down to your spine(After u crash into a "PROTEIN THINGNY" by E235 at 65km/h, imagine that high-speed and safe brought u by JR East and ATC/ATS)
# Be "straight" here for sure: This is for some external features that I just want to share around the repo and test it out
# Btw, remenber what this repo for?
def... | def unwrap(incoming: str):
dump = incoming
try:
head = dump.index('{')
except Exception:
return IOError
try:
tail = dump.index('};')
except Exception:
return IOError
dump = dump[head - 1:tail - 1]
raw_val = dump.split(';')
counter = 0
backed_val = {}
... |
num = float(input())
if (100 > num or num > 200) and num != 0:
print("invalid")
elif num == 0:
print()
| num = float(input())
if (100 > num or num > 200) and num != 0:
print('invalid')
elif num == 0:
print() |
# 21300 - [Job Adv] (Lv.60) Aran
sm.setSpeakerID(1510009)
sm.sendNext("How is the training going? Hm, Lv. 60? You still ahve a long way to go, but it's definitely praiseworthy compared to the first time I met you. Continue to train diligently, and I'm sure you'll regain your strength soon!")
if sm.sendAskYesNo("But f... | sm.setSpeakerID(1510009)
sm.sendNext("How is the training going? Hm, Lv. 60? You still ahve a long way to go, but it's definitely praiseworthy compared to the first time I met you. Continue to train diligently, and I'm sure you'll regain your strength soon!")
if sm.sendAskYesNo('But first, you must head to #b#m14000000... |
i = 0
while True:
print(i)
i = i + 1
| i = 0
while True:
print(i)
i = i + 1 |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findBottomLeftValue(self, root):
"""
:type root: TreeNode
:rtype: int
"""... | class Solution(object):
def find_bottom_left_value(self, root):
"""
:type root: TreeNode
:rtype: int
"""
def dfs(root, h, w):
if not root:
return (float('inf'), float('inf'), None)
left = dfs(root.left, h - 1, w - 1)
right... |
# Please be warned, that when turning on the "saving_enabled" feature, it will consume a lot of ram while it is saving
# The frames. This is because every single frame that is played during the animation is recorded into the memory
# At the moment, I dont see any other way to output a gif straight out of pygame. ... | saving_enabled = False
optimization_level = 1
duration = 8
display_stats = True
display_grid = True
silhouette = True
brush_size = 3
res = (800, 600)
tile_size = 5
lerp_speed = 0.1
output_name = 'out'
colors = [(255, 0, 0), (0, 255, 0), (0, 0, 255), (170, 0, 210), (0, 130, 200), (255, 128, 128), (255, 255, 255)]
defaul... |
# EDITION
# PLAYING WITH NUMBERS
my_var_int = 1234
my_var_int = my_var_int + 20
print(f"my_var_int: {my_var_int}")
my_var_int += 20# my_var_int = my_var_int + 20
print(f"my_var_int: {my_var_int}")
my_var_int = my_var_int - 75 # substraction
print(f"my_var_int: {my_var_int}")
my_var_int = my_var_int / 2 # division
print... | my_var_int = 1234
my_var_int = my_var_int + 20
print(f'my_var_int: {my_var_int}')
my_var_int += 20
print(f'my_var_int: {my_var_int}')
my_var_int = my_var_int - 75
print(f'my_var_int: {my_var_int}')
my_var_int = my_var_int / 2
print(f'my_var_int: {my_var_int}')
my_var_int = my_var_int * 10
print(f'my_var_int: {my_var_in... |
# Copyright 2012 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 ... | {'variables': {'chromium_code': 1}, 'targets': [{'target_name': 'core_lib', 'type': 'static_library', 'sources': ['address.cc', 'address.h', 'address_filter.h', 'address_filter_impl.h', 'address_range.cc', 'address_range.h', 'address_space.cc', 'address_space.h', 'address_space_internal.h', 'disassembler.cc', 'disassem... |
class MinStack:
def __init__(self):
"""
initialize your data structure here.
"""
self.l = []
self.min_stack = [math.inf]
def push(self, x: int) -> None:
self.l.append(x)
self.min_stack.append(min(x, self.min_stack[-1]))
def pop(self) -> None:
... | class Minstack:
def __init__(self):
"""
initialize your data structure here.
"""
self.l = []
self.min_stack = [math.inf]
def push(self, x: int) -> None:
self.l.append(x)
self.min_stack.append(min(x, self.min_stack[-1]))
def pop(self) -> None:
... |
r=int(input("enter radius\n"))
area=3.14*r*r
print(area)
r=int(input("enter radius\n"))
circumference=2*3.14*r
print(circumference)
| r = int(input('enter radius\n'))
area = 3.14 * r * r
print(area)
r = int(input('enter radius\n'))
circumference = 2 * 3.14 * r
print(circumference) |
"""
pythonbible-parser is a Python library for parsing Bible texts in various formats
and convert them into a format for easy and efficient use in Python.
"""
__version__ = "0.0.3"
| """
pythonbible-parser is a Python library for parsing Bible texts in various formats
and convert them into a format for easy and efficient use in Python.
"""
__version__ = '0.0.3' |
plugins_modules = [
"authorization",
"anonymous",
]
| plugins_modules = ['authorization', 'anonymous'] |
SEND_TEXT = 'send_text'
SEND_IMAGE = 'send_image'
SEND_TEXT_AND_BUTTON = 'send_text_and_button'
CHECK_STATUS_MESSAGES = 'check_status_messages'
API = [SEND_TEXT, SEND_IMAGE, SEND_TEXT_AND_BUTTON, CHECK_STATUS_MESSAGES]
API_CHOICES = [(api, api) for api in API] | send_text = 'send_text'
send_image = 'send_image'
send_text_and_button = 'send_text_and_button'
check_status_messages = 'check_status_messages'
api = [SEND_TEXT, SEND_IMAGE, SEND_TEXT_AND_BUTTON, CHECK_STATUS_MESSAGES]
api_choices = [(api, api) for api in API] |
def reverse(list):
if len(list) < 2:
return list
return [list[-1]] + reverse(list[:-1])
assert reverse([]) == []
assert reverse([2]) == [2]
assert reverse([2, 6, 5]) == [5, 6, 2] | def reverse(list):
if len(list) < 2:
return list
return [list[-1]] + reverse(list[:-1])
assert reverse([]) == []
assert reverse([2]) == [2]
assert reverse([2, 6, 5]) == [5, 6, 2] |
class Arvore():
def __init__(self, valor, esq=None, dir=None):
self.dir = dir
self.esq = esq
self.valor = valor
def __iter__(self):
yield self.valor
if self.esq:
for valor in self.esq:
yield valor
if self.dir:
for valor in ... | class Arvore:
def __init__(self, valor, esq=None, dir=None):
self.dir = dir
self.esq = esq
self.valor = valor
def __iter__(self):
yield self.valor
if self.esq:
for valor in self.esq:
yield valor
if self.dir:
for valor in s... |
#4
row=0
while row<10:
col=0
while col<9:
if col+row==6 or row==6 or (col==6):
print("*",end=" ")
else:
print(" ",end=" ")
col +=1
row +=1
print()
| row = 0
while row < 10:
col = 0
while col < 9:
if col + row == 6 or row == 6 or col == 6:
print('*', end=' ')
else:
print(' ', end=' ')
col += 1
row += 1
print() |
def hex(number):
if number == 0:
return '0'
res = ''
while number > 0:
digit = number % 16
if digit <= 9:
digit = str(digit)
elif digit <= 13:
if digit <= 11:
if digit == 10:
digit = 'A'
else:
... | def hex(number):
if number == 0:
return '0'
res = ''
while number > 0:
digit = number % 16
if digit <= 9:
digit = str(digit)
elif digit <= 13:
if digit <= 11:
if digit == 10:
digit = 'A'
else:
... |
class Singleton(type):
_instances = {}
def __call__(cls, tree):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(tree)
instance = cls._instances[cls]
instance.tree = tree # update tree
return instance
def clear(cls):
tr... | class Singleton(type):
_instances = {}
def __call__(cls, tree):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(tree)
instance = cls._instances[cls]
instance.tree = tree
return instance
def clear(cls):
try:
... |
#Joe is a prisoner who has been sentenced to hard labor for his crimes. Each day he is given a pile of large rocks to break into tiny rocks. To make matters worse, they do not provide any tools to work with. Instead, he must use the rocks themselves. He always picks up the largest two stones and smashes them together... | a_count = int(input().strip())
a = []
for _ in range(a_count):
a_item = int(input().strip())
a.append(a_item)
def last_stone_weight(a):
print(f'before sort: {a}')
a.sort()
print(f'after sort: {a}')
b = a[0]
for i in range(len(a)):
if len(a) >= 2:
b = abs(a[-1] - a[-2])
... |
#! python3
"""A number n is called deficient if the sum of its proper divisors is less
than n and it is called abundant if this sum exceeds n.
Find the sum of all the positive integers which cannot
be written as the sum of two abundant numbers."""
mn, mx = 12, 28123
def sdivisors_until(m):
"""Sum of divisors gene... | """A number n is called deficient if the sum of its proper divisors is less
than n and it is called abundant if this sum exceeds n.
Find the sum of all the positive integers which cannot
be written as the sum of two abundant numbers."""
(mn, mx) = (12, 28123)
def sdivisors_until(m):
"""Sum of divisors generator"""... |
# (C) Datadog, Inc. 2020 - Present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
GENERIC_METRICS = {
'go_gc_duration_seconds': 'go.gc_duration_seconds',
'go_goroutines': 'go.goroutines',
'go_info': 'go.info',
'go_memstats_alloc_bytes': 'go.memstats.alloc_bytes',
'go_m... | generic_metrics = {'go_gc_duration_seconds': 'go.gc_duration_seconds', 'go_goroutines': 'go.goroutines', 'go_info': 'go.info', 'go_memstats_alloc_bytes': 'go.memstats.alloc_bytes', 'go_memstats_alloc_bytes_total': 'go.memstats.alloc_bytes_total', 'go_memstats_buck_hash_sys_bytes': 'go.memstats.buck_hash_sys_bytes', 'go... |
N, M = list(map(int, input().split()))
a_list = [[0 for _ in range(M)] for _ in range(N)]
for i in range(N):
a_list[i] = list(map(int, input().split()))
ans = 0
for t1 in range(M-1):
for t2 in range(t1+1, M):
score = 0
for i in range(N):
score += max(a_list[i][t1], a_list[i][t2])
... | (n, m) = list(map(int, input().split()))
a_list = [[0 for _ in range(M)] for _ in range(N)]
for i in range(N):
a_list[i] = list(map(int, input().split()))
ans = 0
for t1 in range(M - 1):
for t2 in range(t1 + 1, M):
score = 0
for i in range(N):
score += max(a_list[i][t1], a_list[i][t2... |
a = int(input())
b = int(input())
c = int(input())
max = a
if max < b:
max = b
if max < c:
max = c
elif max < c:
max = c
print(max) | a = int(input())
b = int(input())
c = int(input())
max = a
if max < b:
max = b
if max < c:
max = c
elif max < c:
max = c
print(max) |
students = {
"males" : ["joseph", "stephen", "theophilus"],
"females" : ["kara", "sharon", "lois"]
}
print(students["males"])
print(students["females"]) | students = {'males': ['joseph', 'stephen', 'theophilus'], 'females': ['kara', 'sharon', 'lois']}
print(students['males'])
print(students['females']) |
def hourglassSum(arr):
dic = {}
top = 0
mid = 1
bot = 2
top_one = 0
mid_one = 1
bot_one = 0
num = 0
max = float('-inf')
while bot < len(arr):
while bot_one < len(arr[-1])-2:
dic[num] = sum(arr[top][top_one : top_one + 3]) + arr[mid][mid_one] + sum(arr... | def hourglass_sum(arr):
dic = {}
top = 0
mid = 1
bot = 2
top_one = 0
mid_one = 1
bot_one = 0
num = 0
max = float('-inf')
while bot < len(arr):
while bot_one < len(arr[-1]) - 2:
dic[num] = sum(arr[top][top_one:top_one + 3]) + arr[mid][mid_one] + sum(arr[bot][bo... |
'''
Various utility methods for building html attributes.
'''
def styles(*styles):
'''Join multiple "conditional styles" and return a single style attribute'''
return '; '.join(filter(None, styles))
def classes(*classes):
'''Join multiple "conditional classes" and return a single class attribute'''
return ' '.joi... | """
Various utility methods for building html attributes.
"""
def styles(*styles):
"""Join multiple "conditional styles" and return a single style attribute"""
return '; '.join(filter(None, styles))
def classes(*classes):
"""Join multiple "conditional classes" and return a single class attribute"""
r... |
SNOW_START = -100
SNOW_END = 0
GRASS_START = 0
GRASS_END = 40
SAND_START = 40
SAND_END = 100
def color_rgb(r,g,b):
"""r,g,b are intensities of red, green, and blue in range(256)
Returns color specifier string for the resulting color"""
return "#%02x%02x%02x" % (r,g,b)
def climate_color(temperature, brig... | snow_start = -100
snow_end = 0
grass_start = 0
grass_end = 40
sand_start = 40
sand_end = 100
def color_rgb(r, g, b):
"""r,g,b are intensities of red, green, and blue in range(256)
Returns color specifier string for the resulting color"""
return '#%02x%02x%02x' % (r, g, b)
def climate_color(temperature, br... |
class Solution:
def smallestSubsequence(self, s: str) -> str:
stack, seen, lastOccurence = deque([]), set(), {char: index for index, char in enumerate(s)}
for index, char in enumerate(s):
if char not in seen:
while stack and char < stack[-1] and index < lastOccurence[stac... | class Solution:
def smallest_subsequence(self, s: str) -> str:
(stack, seen, last_occurence) = (deque([]), set(), {char: index for (index, char) in enumerate(s)})
for (index, char) in enumerate(s):
if char not in seen:
while stack and char < stack[-1] and (index < lastOc... |
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate... | power = {'BUSES': {'Area': 1.33155, 'Bus/Area': 1.33155, 'Bus/Gate Leakage': 0.00662954, 'Bus/Peak Dynamic': 0.0, 'Bus/Runtime Dynamic': 0.0, 'Bus/Subthreshold Leakage': 0.0691322, 'Bus/Subthreshold Leakage with power gating': 0.0259246, 'Gate Leakage': 0.00662954, 'Peak Dynamic': 0.0, 'Runtime Dynamic': 0.0, 'Subthres... |
print('Hello World')
# This code supports my weekly habit of seeing if I can
# afford a ferrari. The general algorithm is to compare
# my bank account amount to the current cost of a ferrari.
"""
:)
:|
:(
"""
bank_balance = 100
ferrari_cost = 50
if bank_balance >= ferrari_cost:
# If it's greater I can finally bu... | print('Hello World')
'\n:)\n:|\n:(\n'
bank_balance = 100
ferrari_cost = 50
if bank_balance >= ferrari_cost:
print('Why not?')
print('Go ahead, buy it')
else:
print('Sorry')
print('Try again next week') |
def study_template(p):
study_regex = r"Study"
for template in p.filter_templates(matches=study_regex):
if template.name.strip() == study_regex:
return template
return None
| def study_template(p):
study_regex = 'Study'
for template in p.filter_templates(matches=study_regex):
if template.name.strip() == study_regex:
return template
return None |
"""
Version of platform_services
"""
__version__ = '0.19.0'
| """
Version of platform_services
"""
__version__ = '0.19.0' |
'''
*Book Record Management in Python*
With this project a used can Add/Delete/Update/View the book records
the project is implement in python
Inbuilt data structures used: LIST
concepts of functions, try-catch statements, if else statements and loops are used in this pr... | """
*Book Record Management in Python*
With this project a used can Add/Delete/Update/View the book records
the project is implement in python
Inbuilt data structures used: LIST
concepts of functions, try-catch statements, if else statements and loops are used in this program.
... |
DEPS = [
'archive',
'depot_tools/bot_update',
'chromium',
'chromium_tests',
'chromium_android',
'commit_position',
'file',
'depot_tools/gclient',
'isolate',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/step',
'swarming',... | deps = ['archive', 'depot_tools/bot_update', 'chromium', 'chromium_tests', 'chromium_android', 'commit_position', 'file', 'depot_tools/gclient', 'isolate', 'recipe_engine/path', 'recipe_engine/platform', 'recipe_engine/properties', 'recipe_engine/python', 'recipe_engine/step', 'swarming', 'test_utils', 'trigger', 'depo... |
class Configs:
def __init__(self, client_id, client_secret, tenant_id):
"""
Configs(...)
configs = Configs()
Initializes client_id, client_secret and tenant_id.
Required arguments:
client_id: client_id of application
client_secret: client_secret of appl... | class Configs:
def __init__(self, client_id, client_secret, tenant_id):
"""
Configs(...)
configs = Configs()
Initializes client_id, client_secret and tenant_id.
Required arguments:
client_id: client_id of application
client_secret: client_secret ... |
### All lines that are commented out (and some that aren't) are optional ###
### Telegram Settings
### Get your own api_id and api_hash from https://my.telegram.org, under API Development
### Default vaules are exmaple and will not work
API_ID = 123456 # Int value, example: 123456
API_HASH = 'e59ffe6c16bfaafb682... | api_id = 123456
api_hash = 'e59ffe6c16bfaafb6821a629fd057bc8'
filter_gym_name = 'Rib Cage Sculpture|Potting Garden|Tamarind Road Playground'
forward_id = 50000001 |
class DatasetParameter:
def __init__(self, db_url, **dataset_kwargs):
self.db_url = db_url
self.dataset_kwargs = dataset_kwargs
@property
def DbUrl(self): return self.db_url
@property
def DbKwargs(self): return self.dataset_kwargs
| class Datasetparameter:
def __init__(self, db_url, **dataset_kwargs):
self.db_url = db_url
self.dataset_kwargs = dataset_kwargs
@property
def db_url(self):
return self.db_url
@property
def db_kwargs(self):
return self.dataset_kwargs |
"""
Patient Tracking
"""
module = request.controller
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# -----------------------------------------------------------------------------
def index():
"Module's Home Page"
module_name = settings.modules[module].get("... | """
Patient Tracking
"""
module = request.controller
if not settings.has_module(module):
raise http(404, body='Module disabled: %s' % module)
def index():
"""Module's Home Page"""
module_name = settings.modules[module].get('name_nice')
response.title = module_name
return dict(module_name=module... |
# This program demonstrates variable reassignment.
# Assign a value to the dollars variable.
dollars = 2.75
print('I have', dollars, 'in my account.')
# Reassign dollars so it references
# a different value.
dollars = 99.95
print('But now I have', dollars, 'in my account!')
| dollars = 2.75
print('I have', dollars, 'in my account.')
dollars = 99.95
print('But now I have', dollars, 'in my account!') |
suffix_slang_3 = {
'ine': '9',
'aus': 'oz',
'ate': '8',
'for': '4',
}
suffix_slang_4 = {
'ause': 'oz',
'fore': '4',
}
general_slang = {
'you': 'u',
'for': '4',
'thanks': 'thnx',
'are': 'r',
'they': 'dey',
'... | suffix_slang_3 = {'ine': '9', 'aus': 'oz', 'ate': '8', 'for': '4'}
suffix_slang_4 = {'ause': 'oz', 'fore': '4'}
general_slang = {'you': 'u', 'for': '4', 'thanks': 'thnx', 'are': 'r', 'they': 'dey', 'this': 'dis', 'that': 'dat'}
prefix_slang_3 = {'for': '4'}
prefix_slang_4 = {'fore': '4'}
abbreviations = {'away from the... |
def ClumpFinder(k,L,t,Genome):
#Length of Genome
N = len(Genome)
#Storing Frequent patterns
freq_patterns = []
for i in range(N-L+1):
#choosing region of length L in the Genome
region = Genome[i:i+L]
#Calculating the Frequency array in the first iteration
if... | def clump_finder(k, L, t, Genome):
n = len(Genome)
freq_patterns = []
for i in range(N - L + 1):
region = Genome[i:i + L]
if i == 0:
freq_dict = {}
for j in range(L - k + 1):
kmer = region[j:j + k]
freq_dict[kmer] = freq_dict.get(kmer, ... |
PDBCUTOFF = 33.0
DSSPCUTOFF = 0.55
TEST=False
three2oneAA={
"ALA": "A",
"ARG": "R",
"ASN": "N",
"ASP": "D",
"CYS": "C",
"GLN": "Q",
"GLU": "E",
"GLY": "G",
"HIS": "H",
"ILE": "I",
"LEU": "L",
"LYS": "K",
"MET": "M",
"PHE": "F",
"PRO": "P",
"SER": "S",
"THR": "T",
"TRP": "W",
"TYR": "Y",
"VAL": "V"
... | pdbcutoff = 33.0
dsspcutoff = 0.55
test = False
three2one_aa = {'ALA': 'A', 'ARG': 'R', 'ASN': 'N', 'ASP': 'D', 'CYS': 'C', 'GLN': 'Q', 'GLU': 'E', 'GLY': 'G', 'HIS': 'H', 'ILE': 'I', 'LEU': 'L', 'LYS': 'K', 'MET': 'M', 'PHE': 'F', 'PRO': 'P', 'SER': 'S', 'THR': 'T', 'TRP': 'W', 'TYR': 'Y', 'VAL': 'V'}
'\nMaximum Allow... |
price, size = map(int, input().split())
dislikes = list(map(int, input().split()))
likes = list(set(range(10)) - set(dislikes))
digits = [int(digit) for digit in str(price)]
r_digits = list(reversed(digits))
res = []
for i in range(len(r_digits)):
if r_digits[i] in likes:
res.append(r_digits[i])
... | (price, size) = map(int, input().split())
dislikes = list(map(int, input().split()))
likes = list(set(range(10)) - set(dislikes))
digits = [int(digit) for digit in str(price)]
r_digits = list(reversed(digits))
res = []
for i in range(len(r_digits)):
if r_digits[i] in likes:
res.append(r_digits[i])
elif ... |
# # Literate Programming in Markdown
# ---------------------------------------------------------------------------
# Literate Programming in Markdown takes a markdown file and converts it into a programming language. Traditional programming often begins with writing code, followed by adding comments. The Literate Pr... | input_file_name = str(input('Type the Input File:'))
output_file_name = str(input('Output File Name (.py added automatically):'))
with open(inputFile_name) as input_file:
input_file_data = list(inputFile)
new_file_string = str()
inside_code_block = False
for line in inputFile_data:
if line[:3] == '~~~':
... |
# -*- coding: utf-8 -*-
"""
awsecommerceservice
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class ItemSearchRequest(object):
"""Implementation of the 'ItemSearchRequest' model.
TODO: type model description here.
Attributes:
actor (string): TODO:... | """
awsecommerceservice
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class Itemsearchrequest(object):
"""Implementation of the 'ItemSearchRequest' model.
TODO: type model description here.
Attributes:
actor (string): TODO: type description here.
... |
class Solution(object):
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1
for i in range(2, n + 1):
dp[i] = dp[i - 1] + dp[i - 2]
return dp[-1]
| class Solution(object):
def climb_stairs(self, n):
"""
:type n: int
:rtype: int
"""
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1
for i in range(2, n + 1):
dp[i] = dp[i - 1] + dp[i - 2]
return dp[-1] |
class UserNotValidException(Exception):
pass
class PhoneNotValidException(Exception):
pass
class ConfigFileParseException(Exception):
pass
class DuplicateUserException(Exception):
pass
class IndexOutofRangeException(Exception):
pass
class IndexNotGivenException(Exception):
pass | class Usernotvalidexception(Exception):
pass
class Phonenotvalidexception(Exception):
pass
class Configfileparseexception(Exception):
pass
class Duplicateuserexception(Exception):
pass
class Indexoutofrangeexception(Exception):
pass
class Indexnotgivenexception(Exception):
pass |
class User:
def __init__(self, user_id, username):
self.id = user_id
self.username = username
self.followers = 0
self.following = 0
def follow(self, user):
user.followers += 1
self.following += 1
user_1 = User("001", "nuno")
user_2 = User("003", "paula")
... | class User:
def __init__(self, user_id, username):
self.id = user_id
self.username = username
self.followers = 0
self.following = 0
def follow(self, user):
user.followers += 1
self.following += 1
user_1 = user('001', 'nuno')
user_2 = user('003', 'paula')
user_1.... |
#Eliminar
conjuntos = set()
conjuntos = {1,2,3,"brian", 4.6}
conjuntos.discard(3)
print (conjuntos)
("==================================================================================")
| conjuntos = set()
conjuntos = {1, 2, 3, 'brian', 4.6}
conjuntos.discard(3)
print(conjuntos)
'==================================================================================' |
#The code is implemented to print the range of numbers from 100-15000
for x in range(50,750):
x = x * 2
print(x)
print("Even number") | for x in range(50, 750):
x = x * 2
print(x)
print('Even number') |
# class for tiles
class Tile:
def __init__(self, name, items=None, player_on=False, mob_on=False):
if name == 'w' or name == 'mt' or name == 'sb':
self.obstacle = True
else:
self.obstacle = False
self.name = name
self.items = items
self.player_on = player_on
self.mob_on = mob_on
self.mob = None
s... | class Tile:
def __init__(self, name, items=None, player_on=False, mob_on=False):
if name == 'w' or name == 'mt' or name == 'sb':
self.obstacle = True
else:
self.obstacle = False
self.name = name
self.items = items
self.player_on = player_on
se... |
def draw_event_cb(e):
dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param())
if dsc.part == lv.PART.TICKS and dsc.id == lv.chart.AXIS.PRIMARY_X:
month = ["Jan", "Febr", "March", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec"]
# dsc.text is defined char text[16], I must therefore ... | def draw_event_cb(e):
dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param())
if dsc.part == lv.PART.TICKS and dsc.id == lv.chart.AXIS.PRIMARY_X:
month = ['Jan', 'Febr', 'March', 'Apr', 'May', 'Jun', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']
dsc.text = bytes(month[dsc.value], 'ascii')
chart = lv.... |
"""
## Call graph rbreak
Build a function call graph of the non-dynamic functions of an executable.
This implementation is very slow for very large projects, where `rbreak .` takes forever to complete.
- http://stackoverflow.com/questions/9549693/gdb-list-of-all-function-calls-made-in-an-application
- http://stackov... | """
## Call graph rbreak
Build a function call graph of the non-dynamic functions of an executable.
This implementation is very slow for very large projects, where `rbreak .` takes forever to complete.
- http://stackoverflow.com/questions/9549693/gdb-list-of-all-function-calls-made-in-an-application
- http://stackov... |
class Params:
"""Model parameters."""
NUM_HIDDEN = 75
NUM_LAYERS = 3
KEEP_PROB = 0.5
EPOCH = 50
BATCH_SIZE = 400
MAX_LENGTH = 100
ERROR = 0.5
def __init__(self):
self.num_hidden = self.NUM_HIDDEN
self.num_layers = self.NUM_LAYERS
self.keep_prob = self.KEEP_PR... | class Params:
"""Model parameters."""
num_hidden = 75
num_layers = 3
keep_prob = 0.5
epoch = 50
batch_size = 400
max_length = 100
error = 0.5
def __init__(self):
self.num_hidden = self.NUM_HIDDEN
self.num_layers = self.NUM_LAYERS
self.keep_prob = self.KEEP_PR... |
## bisenetv2
cfg = dict(
model_type='bisenetv2',
num_aux_heads=4,
lr_start = 5e-2,
weight_decay=5e-4,
warmup_iters = 1000,
max_iter = 150000,
im_root='/remote-home/source/Cityscapes/',
train_im_anns='../datasets/cityscapes/train.txt',
val_im_anns='../datasets/cityscapes/val.txt',
... | cfg = dict(model_type='bisenetv2', num_aux_heads=4, lr_start=0.05, weight_decay=0.0005, warmup_iters=1000, max_iter=150000, im_root='/remote-home/source/Cityscapes/', train_im_anns='../datasets/cityscapes/train.txt', val_im_anns='../datasets/cityscapes/val.txt', scales=[0.25, 2.0], cropsize=[512, 1024], ims_per_gpu=8, ... |
def factorials(number: int, iteratively=True) -> int:
"""
Calculates factorials iteratively as well as recursively. Default iteratively. Takes linear time.
Args:
- ``number`` (int): Number for which you want to get a factorial.
- ``iteratively`` (bool): Set this to False you want... | def factorials(number: int, iteratively=True) -> int:
"""
Calculates factorials iteratively as well as recursively. Default iteratively. Takes linear time.
Args:
- ``number`` (int): Number for which you want to get a factorial.
- ``iteratively`` (bool): Set this to False you want... |
LOOKUPS = {
"AirConditioning": {
"C":"Central",
"F":"Free Standing",
"M":"Multi-Zone",
"N":"None",
"T":"Through the Wall",
"U":"Unknown Type",
"W":"Window Units",
},
"Borough": {
"BK":"Brooklyn",
"BX":"Bronx",
"NY":"Manhattan",
"QN":"Queens",
"SI":"Staten Island",
},
"B... | lookups = {'AirConditioning': {'C': 'Central', 'F': 'Free Standing', 'M': 'Multi-Zone', 'N': 'None', 'T': 'Through the Wall', 'U': 'Unknown Type', 'W': 'Window Units'}, 'Borough': {'BK': 'Brooklyn', 'BX': 'Bronx', 'NY': 'Manhattan', 'QN': 'Queens', 'SI': 'Staten Island'}, 'BuildingAccess': {'A': 'Attended Elevator', 'E... |
class DotDictMeta(type):
def __repr__(cls):
return cls.__name__
class DotDict(dict, metaclass=DotDictMeta):
"""Dictionary that supports dot notation as well as dictionary access notation.
Use the dot motation only for get values, not for setting.
usage:
>>> d1 = DotDict()
>>> d['val2'... | class Dotdictmeta(type):
def __repr__(cls):
return cls.__name__
class Dotdict(dict, metaclass=DotDictMeta):
"""Dictionary that supports dot notation as well as dictionary access notation.
Use the dot motation only for get values, not for setting.
usage:
>>> d1 = DotDict()
>>> d['val2'... |
token = ''
Whitelist = 'whitelist.txt'
Masterkey = '1bc45'
Students = 'students.txt'
| token = ''
whitelist = 'whitelist.txt'
masterkey = '1bc45'
students = 'students.txt' |
"""
Package version
"""
__version__ = "0.1.0"
| """
Package version
"""
__version__ = '0.1.0' |
# define constants
DETALHE_FILE_NAME = 'detalhe_votacao_secao'
MUNZONA_FILE_NAME = 'detalhe_votacao_zona'
DC_CODE = '58335'
TURNO = '2'
SECAO_FILE = 'detalhe_votacao_secao_2016_RJ.txt'
BOLETIM_FILE = 'bweb_2t_RJ_31102016134235.txt'
COLUMNS_TO_DETALHE_SECAO = [
'codigo_municipio',
'secao',
'zona',
... | detalhe_file_name = 'detalhe_votacao_secao'
munzona_file_name = 'detalhe_votacao_zona'
dc_code = '58335'
turno = '2'
secao_file = 'detalhe_votacao_secao_2016_RJ.txt'
boletim_file = 'bweb_2t_RJ_31102016134235.txt'
columns_to_detalhe_secao = ['codigo_municipio', 'secao', 'zona', 'aptos', 'abstencoes', 'nao_considerados',... |
class Singleton:
__instance = None
def __new__(cls, val=None):
if Singleton.__instance is None:
Singleton.__instance = object.__new__(cls)
Singleton.__instance.val = val
return Singleton.__instance
| class Singleton:
__instance = None
def __new__(cls, val=None):
if Singleton.__instance is None:
Singleton.__instance = object.__new__(cls)
Singleton.__instance.val = val
return Singleton.__instance |
with open("input.txt") as f:
card_public, door_public = [int(x) for x in f.readlines()]
def transform_once(subject: int, num: int) -> int:
return (subject * num) % 20201227
num = 1
i = 0
while num != door_public:
i += 1
num = transform_once(7, num)
door_loop = i
num = 1
for _ in range(door_loop):
... | with open('input.txt') as f:
(card_public, door_public) = [int(x) for x in f.readlines()]
def transform_once(subject: int, num: int) -> int:
return subject * num % 20201227
num = 1
i = 0
while num != door_public:
i += 1
num = transform_once(7, num)
door_loop = i
num = 1
for _ in range(door_loop):
n... |
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def insertIntoBST(self, root: TreeNode, val: int) -> TreeNode:
# Iteration (1): Time O(h) Space O(1)
... | class Treenode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def insert_into_bst(self, root: TreeNode, val: int) -> TreeNode:
if not root:
return tree_node(val)
node = root
whil... |
class Student:
"""This is a very simple Student class"""
course_marks = {}
name = ""
family = ""
def __init__(self, name, family):
self.name = name
self.family = family
def addCourseMark(self, course, mark):
"""Add the course to the course dictionary,
this will overide the old mark if one exists."""
... | class Student:
"""This is a very simple Student class"""
course_marks = {}
name = ''
family = ''
def __init__(self, name, family):
self.name = name
self.family = family
def add_course_mark(self, course, mark):
"""Add the course to the course dictionary,
this will over... |
""" This file handles default application config settings for Flask-User.
:copyright: (c) 2013 by Ling Thio
:author: Ling Thio (ling.thio@gmail.com)
:license: Simplified BSD License, see LICENSE.txt for more details."""
def set_default_settings(user_manager, app_config):
""" Set default app.config se... | """ This file handles default application config settings for Flask-User.
:copyright: (c) 2013 by Ling Thio
:author: Ling Thio (ling.thio@gmail.com)
:license: Simplified BSD License, see LICENSE.txt for more details."""
def set_default_settings(user_manager, app_config):
""" Set default app.config set... |
def setup_application():
# Example to change config stuff, call this method before everything else.
# config.cache_config.cache_dir = "abc"
a = 1
| def setup_application():
a = 1 |
# Databricks notebook source
GFMGVNZKIYBRLMUHVQJSGYOCQYAYFKD
NATXOZQANOZFMUPBDEBUCJBHQ
BJWJMKDTNLLWEEQGCDJHHROEXMTBAULGXCRKMKPAOIFSOXERBMUOUQBBIVEWZHMSYRLVABWGSRFDRZXZCVSGFRALYARODLWSCWHPCCCYDSNEVCUWSKZJHCKBJDB
HRYAMXRDXHYWHJVTVBJEHAQTXYHBGBHHTNXU
OICSMCKGDPDCHROEZXHBROAOVOMOHKSZQSTZHZOBOUBKWKFQJFW
XVYHXHBOYUJCZFNBKYBK... | GFMGVNZKIYBRLMUHVQJSGYOCQYAYFKD
NATXOZQANOZFMUPBDEBUCJBHQ
BJWJMKDTNLLWEEQGCDJHHROEXMTBAULGXCRKMKPAOIFSOXERBMUOUQBBIVEWZHMSYRLVABWGSRFDRZXZCVSGFRALYARODLWSCWHPCCCYDSNEVCUWSKZJHCKBJDB
HRYAMXRDXHYWHJVTVBJEHAQTXYHBGBHHTNXU
OICSMCKGDPDCHROEZXHBROAOVOMOHKSZQSTZHZOBOUBKWKFQJFW
XVYHXHBOYUJCZFNBKYBKR
TEWCCYBEPDI
DEFSCRSOVVPZHNI... |
DEFAULT_DOTENV_KWARGS = dict(
driver='MSDSS_DATABASE_DRIVER',
user='MSDSS_DATABASE_USER',
password='MSDSS_DATABASE_PASSWORD',
host='MSDSS_DATABASE_HOST',
port='MSDSS_DATABASE_PORT',
database='MSDSS_DATABASE_NAME',
env_file='./.env',
key_path=None,
defaults=dict(
driver='postg... | default_dotenv_kwargs = dict(driver='MSDSS_DATABASE_DRIVER', user='MSDSS_DATABASE_USER', password='MSDSS_DATABASE_PASSWORD', host='MSDSS_DATABASE_HOST', port='MSDSS_DATABASE_PORT', database='MSDSS_DATABASE_NAME', env_file='./.env', key_path=None, defaults=dict(driver='postgresql', user='msdss', password='msdss123', hos... |
class param:
"""
Copyright (c) 2018 van Ovost Automatisering b.v.
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 re... | class Param:
"""
Copyright (c) 2018 van Ovost Automatisering b.v.
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 req... |
# Enter your code here. Read input from STDIN. Print output to STDOUT
dateActually, monthActually, yearActually = list(map(int, input().split()))
dateExpected, monthExpected, yearExpected = list(map(int, input().split()))
fine = 0
if (yearActually > yearExpected):
fine = 10000
elif (yearActually == yearExpected):
... | (date_actually, month_actually, year_actually) = list(map(int, input().split()))
(date_expected, month_expected, year_expected) = list(map(int, input().split()))
fine = 0
if yearActually > yearExpected:
fine = 10000
elif yearActually == yearExpected:
if monthActually > monthExpected:
fine = (monthActual... |
"""Util functions and classes."""
# Copyright 2013-2018 The Home Assistant Authors
# https://github.com/home-assistant/home-assistant/blob/master/LICENSE.md
class Registry(dict):
"""Registry of items."""
def register(self, name):
"""Return decorator to register item with a specific name."""
... | """Util functions and classes."""
class Registry(dict):
"""Registry of items."""
def register(self, name):
"""Return decorator to register item with a specific name."""
def decorator(func):
"""Register decorated function."""
self[name] = func
return func
... |
x = int(input())
numbers = 0
while numbers < x:
y = int(input())
numbers += y
print(numbers)
| x = int(input())
numbers = 0
while numbers < x:
y = int(input())
numbers += y
print(numbers) |
# def f():
# x=10
if 1:
x=10
print(x) | if 1:
x = 10
print(x) |
def add(matrix_a, matrix_b):
rows = len(matrix_a)
columns = len(matrix_a[0])
matrix_c = []
for i in range(rows):
list_1 = []
for j in range(columns):
val = matrix_a[i][j] + matrix_b[i][j]
list_1.append(val)
matrix_c.append(list_1)
return matrix_c
def... | def add(matrix_a, matrix_b):
rows = len(matrix_a)
columns = len(matrix_a[0])
matrix_c = []
for i in range(rows):
list_1 = []
for j in range(columns):
val = matrix_a[i][j] + matrix_b[i][j]
list_1.append(val)
matrix_c.append(list_1)
return matrix_c
def ... |
# EDIT THESE WITH YOUR OWN DATASET/TABLES
billing_project_id = 'project_id'
billing_dataset_id = 'billing_dataset'
billing_table_name = 'billing_data'
output_dataset_id = 'output_dataset'
output_table_name = 'transformed_table'
# You can leave this unless you renamed the file yourself.
sql_file_path = 'cud_sud_attrib... | billing_project_id = 'project_id'
billing_dataset_id = 'billing_dataset'
billing_table_name = 'billing_data'
output_dataset_id = 'output_dataset'
output_table_name = 'transformed_table'
sql_file_path = 'cud_sud_attribution_query.sql'
allocation_method = 'P_method_2_commitment_cost' |
# testing the bargaining power proxy
def barPower(budget, totalBudget, N):
'''
(float, float, integer) => float
computes bargaining power within a project
'''
bP = ( N * budget - totalBudget) / (N * totalBudget)
return bP
projects = []
project1 = [10, 10, 10, 10, 1000]
project2 = [50, 50, 5... | def bar_power(budget, totalBudget, N):
"""
(float, float, integer) => float
computes bargaining power within a project
"""
b_p = (N * budget - totalBudget) / (N * totalBudget)
return bP
projects = []
project1 = [10, 10, 10, 10, 1000]
project2 = [50, 50, 50]
project3 = [70, 40, 57, 3, 190]
proje... |
"""
This module houses the GDAL & SRS Exception objects, and the
check_err() routine which checks the status code returned by
GDAL/OGR methods.
"""
# #### GDAL & SRS Exceptions ####
class GDALException(Exception):
pass
class SRSException(Exception):
pass
# #### GDAL/OGR error checking c... | """
This module houses the GDAL & SRS Exception objects, and the
check_err() routine which checks the status code returned by
GDAL/OGR methods.
"""
class Gdalexception(Exception):
pass
class Srsexception(Exception):
pass
ogrerr_dict = {1: (GDALException, 'Not enough data.'), 2: (GDALException, 'Not enough ... |
class Solution:
def maxDepth(self, s: str) -> int:
z=0
m=0
for i in s:
if i=="(":
z+=1
elif i==")":
z-=1
m=max(m,z)
return m
| class Solution:
def max_depth(self, s: str) -> int:
z = 0
m = 0
for i in s:
if i == '(':
z += 1
elif i == ')':
z -= 1
m = max(m, z)
return m |
## Animal is-a object
class Animal(object):
pass
## Dog is-a Animal
class Dog(Animal):
def __init__(self, name):
## Dog has-a name
self.name = name
## Cat is-a Animal
class Cat(Animal):
def __init__(self, name):
## Cat has-a name
self.name = name
## Person is-a object... | class Animal(object):
pass
class Dog(Animal):
def __init__(self, name):
self.name = name
class Cat(Animal):
def __init__(self, name):
self.name = name
class Person(object):
def __init__(self, name):
self.name = name
self.pet = None
class Employee(Person):
def ... |
class Project:
def __init__(self, name=None, description=None, id=None):
self.name = name
self.description = description
self.id = id | class Project:
def __init__(self, name=None, description=None, id=None):
self.name = name
self.description = description
self.id = id |
__all__ = [
"max",
"min",
"pow",
"sqrt",
"exp",
"log",
"sin",
"cos",
"tan",
"arcsin",
"arccos",
"arctan",
"fabs",
"floor",
"ceil",
"isinf",
"isnan",
]
def max(a: float, b: float) -> float:
raise NotImplementedError
def min(a: float, b: float) -... | __all__ = ['max', 'min', 'pow', 'sqrt', 'exp', 'log', 'sin', 'cos', 'tan', 'arcsin', 'arccos', 'arctan', 'fabs', 'floor', 'ceil', 'isinf', 'isnan']
def max(a: float, b: float) -> float:
raise NotImplementedError
def min(a: float, b: float) -> float:
raise NotImplementedError
def pow(base: float, exp: float) ... |
class Message(object):
""" Implements a Windows message. """
def Instance(self):
""" This function has been arbitrarily put into the stubs"""
return Message()
@staticmethod
def Create(hWnd,msg,wparam,lparam):
"""
Create(hWnd: IntPtr,msg: int,wparam: IntPtr,lparam: IntPtr) -> Message
Crea... | class Message(object):
""" Implements a Windows message. """
def instance(self):
""" This function has been arbitrarily put into the stubs"""
return message()
@staticmethod
def create(hWnd, msg, wparam, lparam):
"""
Create(hWnd: IntPtr,msg: int,wparam: IntPtr,lparam: IntPtr) ... |
# These contain production data that impacts logic
# no dependencies (besides DB migration)
ESSENTIAL_DATA_FIXTURES = (
'counties',
'organizations',
'addresses',
'groups',
'template_options',
)
# These contain fake accounts for each org
# depends on ESSENTIAL_DATA_FIXTURES
MOCK_USER_ACCOUNT_FIXTURE... | essential_data_fixtures = ('counties', 'organizations', 'addresses', 'groups', 'template_options')
mock_user_account_fixtures = ('mock_profiles',)
mock_application_fixtures = ('mock_2_submissions_to_a_pubdef', 'mock_2_submissions_to_ebclc', 'mock_2_submissions_to_cc_pubdef', 'mock_2_submissions_to_sf_pubdef', 'mock_2_s... |
#!/usr/bin/env python
"""
Copyright 2014-2015 Taxamo, Ltd.
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 app... | """
Copyright 2014-2015 Taxamo, Ltd.
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 ... |
"""used to check if data existed in database already
"""
def duplicate_checker(tuple1,list_all):
return tuple1 in list_all
| """used to check if data existed in database already
"""
def duplicate_checker(tuple1, list_all):
return tuple1 in list_all |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.