content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
class EmployeeTaskLink:
def __init__(self, linkID, empID, taskID):
self.linkID = linkID
self.empID = empID
self.taskID = taskID
def get_employee(self, list):
for emp in list:
if emp.empID == self.empID:
return emp
def get_task(self, list):
... | class Employeetasklink:
def __init__(self, linkID, empID, taskID):
self.linkID = linkID
self.empID = empID
self.taskID = taskID
def get_employee(self, list):
for emp in list:
if emp.empID == self.empID:
return emp
def get_task(self, list):
... |
def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Gender, obj[4]: Age, obj[5]: Children, obj[6]: Education, obj[7]: Occupation, obj[8]: Bar, obj[9]: Coffeehouse, obj[10]: Restaurant20to50, obj[11]: Direction_same, obj[12]: Distance
# {"feature": "Age", "instances": 34, "metric_value": 0.... | def find_decision(obj):
if obj[4] <= 4:
if obj[0] <= 1:
if obj[6] <= 4:
if obj[1] <= 1:
return 'False'
elif obj[1] > 1:
if obj[12] <= 1:
if obj[7] > 1:
return 'False'
... |
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | """Helper functions for shared behavior."""
def topic_name_from_path(path, project):
"""Validate a topic URI path and get the topic name.
:type path: string
:param path: URI path for a topic API request.
:type project: string
:param project: The project associated with the request. It is
... |
"""
Errors about channels.
"""
class FetchChannelFailed(Exception):
"""Raises when fetching a channel is failed."""
pass
class FetchChannelMessagesFailed(Exception):
"""Raises when fetching messages from channel is failed."""
pass
class FetchChannelMessageFailed(Exception):
"""Raises when fe... | """
Errors about channels.
"""
class Fetchchannelfailed(Exception):
"""Raises when fetching a channel is failed."""
pass
class Fetchchannelmessagesfailed(Exception):
"""Raises when fetching messages from channel is failed."""
pass
class Fetchchannelmessagefailed(Exception):
"""Raises when fetchin... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
class Constants:
SYS_BOOLEAN: str = "boolean"
SYS_BOOLEAN_TRUE: str = "boolean-true"
SYS_BOOLEAN_FALSE: str = "boolean-false"
| class Constants:
sys_boolean: str = 'boolean'
sys_boolean_true: str = 'boolean-true'
sys_boolean_false: str = 'boolean-false' |
t = int(input())
while t:
A, B = map(int, input().split())
c = 1
while(c>0):
if(c%2==0):
B -= c
else:
A -= c
if(A<0):
print("Bob")
break
if(B<0):
print("Limak")
break
c += 1
t = t-1
| t = int(input())
while t:
(a, b) = map(int, input().split())
c = 1
while c > 0:
if c % 2 == 0:
b -= c
else:
a -= c
if A < 0:
print('Bob')
break
if B < 0:
print('Limak')
break
c += 1
t = t - 1 |
## Uppercase is BOLT
# to use: from utils.beautyfy import *
def red(string):
return '\033[1;91m {}\033[00m'.format(string)
def RED(string):
return '\033[1;91m {}\033[00m'.format(string)
def yellow(string):
return '\033[93m {}\033[00m'.format(string)
def YELLOW(string):
return '\033[1;93m {}\033[00m'... | def red(string):
return '\x1b[1;91m {}\x1b[00m'.format(string)
def red(string):
return '\x1b[1;91m {}\x1b[00m'.format(string)
def yellow(string):
return '\x1b[93m {}\x1b[00m'.format(string)
def yellow(string):
return '\x1b[1;93m {}\x1b[00m'.format(string)
def blue(string):
return '\x1b[94m {}\x1... |
# 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, software
# distrib... | """Server v2 API library"""
resource_key = 'server'
resources_key = 'servers'
base_path = '/servers'
def list(session, endpoint, long=False, all_data=False, marker=None, limit=None, end_marker=None, **params):
if all_data:
data = listing = list(session, endpoint, long=long, marker=marker, limit=limit, end_... |
# Time: O(n log n); Space: O(1)
def ship_within_days(weights, days):
low = max(weights)
high = sum(weights)
min_capacity = high
while low <= high:
mid = low + (high - low) // 2
cur_days, cur_daily_weight = 1, 0
for w in weights:
if cur_daily_weight + w > mid:
... | def ship_within_days(weights, days):
low = max(weights)
high = sum(weights)
min_capacity = high
while low <= high:
mid = low + (high - low) // 2
(cur_days, cur_daily_weight) = (1, 0)
for w in weights:
if cur_daily_weight + w > mid:
cur_days += 1
... |
# -*- coding: utf-8 -*-
"""Top-level package for nola."""
__author__ = """Raghuveer Naraharisetti"""
__email__ = 'raghuveernaraharisetti@gmail.com'
__version__ = '0.1.0'
| """Top-level package for nola."""
__author__ = 'Raghuveer Naraharisetti'
__email__ = 'raghuveernaraharisetti@gmail.com'
__version__ = '0.1.0' |
# config.py
DEBUG = True
DBHOST = '130.211.198.107'
DBPASS = "gregb00th"
DBPORT = 3306
DBUSER = 'root'
DBNAME = 'baseball_2018'
CLOUDSQL_PROJECT = "Baseball-2018"
CLOUDSQL_INSTANCE = "personalwebsite-165915:us-central1:baseball-2018"
CLOUD_STORAGE_BUCKET = 'analytics_data_extraction'
MAX_CONTENT_LENGTH = 8... | debug = True
dbhost = '130.211.198.107'
dbpass = 'gregb00th'
dbport = 3306
dbuser = 'root'
dbname = 'baseball_2018'
cloudsql_project = 'Baseball-2018'
cloudsql_instance = 'personalwebsite-165915:us-central1:baseball-2018'
cloud_storage_bucket = 'analytics_data_extraction'
max_content_length = 8 * 1024 * 1024
allowed_ex... |
def get_certified_by(filing_data: dict):
user_id = filing_data.get('u_user_id')
if user_id:
first_name = filing_data.get('u_first_name')
middle_name = filing_data.get('u_middle_name')
last_name = filing_data.get('u_last_name')
if first_name or middle_name or last_name:
... | def get_certified_by(filing_data: dict):
user_id = filing_data.get('u_user_id')
if user_id:
first_name = filing_data.get('u_first_name')
middle_name = filing_data.get('u_middle_name')
last_name = filing_data.get('u_last_name')
if first_name or middle_name or last_name:
... |
file_path = '/esdata/test/11.log'
with open(file_path, 'w') as file:
num = 1000
val = 0
while val <= num:
file.write("{:x}\n".format(val).zfill(12))
val += 1
| file_path = '/esdata/test/11.log'
with open(file_path, 'w') as file:
num = 1000
val = 0
while val <= num:
file.write('{:x}\n'.format(val).zfill(12))
val += 1 |
load_modules = {
########### Attacker
'uds_engine_auth_baypass': {
'id_command': 0x71
},
'gen_ping' : {},
'uds_tester_ecu_engine':{
'id_uds': 0x701,
'uds_shift': 0x08,
'uds_key':''
},
'hw_TCP2CAN': {'port': 1111, 'mode': 'client', 'address':'127.0.... | load_modules = {'uds_engine_auth_baypass': {'id_command': 113}, 'gen_ping': {}, 'uds_tester_ecu_engine': {'id_uds': 1793, 'uds_shift': 8, 'uds_key': ''}, 'hw_TCP2CAN': {'port': 1111, 'mode': 'client', 'address': '127.0.0.1', 'debug': 3}, 'hw_TCP2CAN~1': {'port': 1112, 'mode': 'client', 'address': '127.0.0.1', 'debug': ... |
# More indentation included to distinguish this from the rest.
def server(
host='localhost', port=443, secure=True,
username='admin', password='admin'):
return locals()
# Aligned with opening delimiter.
connection = server(host='localhost', port=443, secure=True,
username='admi... | def server(host='localhost', port=443, secure=True, username='admin', password='admin'):
return locals()
connection = server(host='localhost', port=443, secure=True, username='admin', password='admin')
connection = server(host='localhost', port=443, secure=True, username='admin', password='admin')
connection = serv... |
# yacon.definitions.py
#
# This file contains common values that aren't usually changed per
# installation and therefore shouldn't go in the django settings file
# max length of slugs
SLUG_LENGTH = 25
# max length of title
TITLE_LENGTH = 50
# bleach constants
ALLOWED_TAGS = [
'a',
'address',
'b',
'br... | slug_length = 25
title_length = 50
allowed_tags = ['a', 'address', 'b', 'br', 'blockquote', 'code', 'div', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'img', 'i', 'li', 'ol', 'p', 'pre', 'span', 'strike', 'strong', 'sub', 'sup', 'table', 'tbody', 'thead', 'tr', 'td', 'u', 'ul']
allowed_attributes = {'a': ['href', '... |
''' Break statement
''' | """ Break statement
""" |
"""
Statically define whether the measurementheaders should be enabled
TODO: Make this adjustable at runtime
"""
class Measurement_Headers():
Active : bool = True | """
Statically define whether the measurementheaders should be enabled
TODO: Make this adjustable at runtime
"""
class Measurement_Headers:
active: bool = True |
#greatest among 3
a=int(input("Enter no:"))
b=int(input("Enter no:"))
c=int(input("Enter no:"))
if a>b:
if a>c:
print(a)
else:
print(c)
else:
if b>c:
print(b)
else:
print(c)
| a = int(input('Enter no:'))
b = int(input('Enter no:'))
c = int(input('Enter no:'))
if a > b:
if a > c:
print(a)
else:
print(c)
elif b > c:
print(b)
else:
print(c) |
# -*- coding: utf-8 -*-
def file_decrypt(data,mode,storetype):
return data
| def file_decrypt(data, mode, storetype):
return data |
# not yet finished
H, M = input().split()
H, M = int(H), int(M)
N = int(input())
m = N % 60
H += N // 60
H %= 24
M = m
# for _ in range(N):
# M += 1
# if M == 60:
# M = 0
# H += 1
# if H == 24:
# H = 0
print(H, M) | (h, m) = input().split()
(h, m) = (int(H), int(M))
n = int(input())
m = N % 60
h += N // 60
h %= 24
m = m
print(H, M) |
"""
53. Maximum Subarray
Easy
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
A subarray is a contiguous part of an array.
Example 1:
Input: nums = [-2,1,-3,4,-1,2,1,-5,4]
Output: 6
Explanation: [4,-1,2,1] has the largest s... | """
53. Maximum Subarray
Easy
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
A subarray is a contiguous part of an array.
Example 1:
Input: nums = [-2,1,-3,4,-1,2,1,-5,4]
Output: 6
Explanation: [4,-1,2,1] has the largest s... |
#!/usr/bin/env python3
def part_one():
result = str(1113122113)
for i in range(40):
result = say(result)
return len(result)
def part_two():
result = str(1113122113)
for i in range(50):
result = say(result)
return len(result)
def say(input):
"""
>>> say(1)
... | def part_one():
result = str(1113122113)
for i in range(40):
result = say(result)
return len(result)
def part_two():
result = str(1113122113)
for i in range(50):
result = say(result)
return len(result)
def say(input):
"""
>>> say(1)
11
>>> say(11)
21
>>>... |
""" The problem is that we want to reverse a T[] array in O(N) linear
time complexity and we want the algorithm to be in-place as well!
For example: input is [1,2,3,4,5] then the output is [5,4,3,2,1]
"""
arr = [1, 2, 3, 4, 5, 6]
for i in range(len(arr) // 2):
arr[i], arr[len(arr)-1-i] = arr[len(arr)-1-i... | """ The problem is that we want to reverse a T[] array in O(N) linear
time complexity and we want the algorithm to be in-place as well!
For example: input is [1,2,3,4,5] then the output is [5,4,3,2,1]
"""
arr = [1, 2, 3, 4, 5, 6]
for i in range(len(arr) // 2):
(arr[i], arr[len(arr) - 1 - i]) = (arr[len(arr... |
"""
Class: Create peripheral objects whenever a new device is found
Methods: Send connection request to given device, disconnect from given device, handle discovery of advertisments
List all available characteristics (services that contain more characteristics)
"""
| """
Class: Create peripheral objects whenever a new device is found
Methods: Send connection request to given device, disconnect from given device, handle discovery of advertisments
List all available characteristics (services that contain more characteristics)
""" |
def starify_pval(pval):
if pval > 0.05:
return ""
else:
if pval <= 0.001:
return "***"
if pval <= 0.01:
return "**"
if pval <= 0.05:
return "*"
| def starify_pval(pval):
if pval > 0.05:
return ''
else:
if pval <= 0.001:
return '***'
if pval <= 0.01:
return '**'
if pval <= 0.05:
return '*' |
codes = {
"reset": "\u001b[0m",
"black": "\u001b[30m",
"red": "\u001b[31m",
"green": "\u001b[32m",
"light_yellow": "\u001b[93m",
"yellow": "\u001b[33m",
"yellow_background": "\u001b[43m",
"blue": "\u001b[34m",
"purple": "\u001b[35m",
"cyan": "\u001b[36m",
"white": "\u001b[37m... | codes = {'reset': '\x1b[0m', 'black': '\x1b[30m', 'red': '\x1b[31m', 'green': '\x1b[32m', 'light_yellow': '\x1b[93m', 'yellow': '\x1b[33m', 'yellow_background': '\x1b[43m', 'blue': '\x1b[34m', 'purple': '\x1b[35m', 'cyan': '\x1b[36m', 'white': '\x1b[37m', 'bold': '\x1b[1m', 'unbold': '\x1b[21m', 'underline': '\x1b[4m',... |
################################################################################
# Copyright: Tobias Weber 2020
#
# Apache 2.0 License
#
# This file contains code related to all breadp module
#
################################################################################
class ChecksNotRunException(Exception):
... | class Checksnotrunexception(Exception):
pass |
#
# PySNMP MIB module LIGO-GENERIC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/LIGO-GENERIC-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:56:36 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar ... | (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_union, constraints_intersection, value_size_constraint, value_range_constraint) ... |
class Solution:
def bitwiseComplement(self, N: int) -> int:
if N == 0:
return 1
ret = i = 0
while N:
ret |= (((N & 1) ^ 1) << i)
i += 1
N >>= 1
return ret
| class Solution:
def bitwise_complement(self, N: int) -> int:
if N == 0:
return 1
ret = i = 0
while N:
ret |= (N & 1 ^ 1) << i
i += 1
n >>= 1
return ret |
# table definition
table = {
'table_name' : 'ap_pmt_batch',
'module_id' : 'ap',
'short_descr' : 'Ap batch of payments',
'long_descr' : 'Ap batch of payments by due date',
'sub_types' : None,
'sub_trans' : None,
'sequence' : None,
'tree_params' : None,
'roll... | table = {'table_name': 'ap_pmt_batch', 'module_id': 'ap', 'short_descr': 'Ap batch of payments', 'long_descr': 'Ap batch of payments by due date', 'sub_types': None, 'sub_trans': None, 'sequence': None, 'tree_params': None, 'roll_params': None, 'indexes': None, 'ledger_col': 'ledger_row_id', 'defn_company': None, 'data... |
# Given a binary tree, return all root-to-leaf paths.
#
# Note: A leaf is a node with no children.
#
# Example:
#
# Input:
#
# 1
# / \
# 2 3
# \
# 5
#
# Output: ["1->2->5", "1->3"]
#
# Explanation: All root-to-leaf paths are: 1->2->5, 1->3
# Definition for a binary tree node.
class TreeNode:
def __i... | class Treenode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
def binary_tree_paths(root_node: TreeNode) -> [str]:
paths = []
if not root_node:
return paths
return get_path(root_node, '', paths)
def get_path(node: TreeNode, path: str, paths: [s... |
"""
This is a dedicated editor for specifying camera set rigs. It allows
the artist to preset a multi-rig type. They can then use the
create menus for quickly creating complicated rigs.
"""
class BaseUI:
"""
Each region of the editor UI is abstracted into a UI class that
contains all of the widgets for t... | """
This is a dedicated editor for specifying camera set rigs. It allows
the artist to preset a multi-rig type. They can then use the
create menus for quickly creating complicated rigs.
"""
class Baseui:
"""
Each region of the editor UI is abstracted into a UI class that
contains all of the widgets for t... |
a=input()
b=a[::-1]
if a==b:
print("yes")
else:
print("no")
| a = input()
b = a[::-1]
if a == b:
print('yes')
else:
print('no') |
def getBMR(weightLBS, heightINCHES, age):
weightKG = weightLBS*.453592
heightCM = heightINCHES*2.54
BMR = 10*weightKG+.25*heightCM-5*age+5
return BMR
| def get_bmr(weightLBS, heightINCHES, age):
weight_kg = weightLBS * 0.453592
height_cm = heightINCHES * 2.54
bmr = 10 * weightKG + 0.25 * heightCM - 5 * age + 5
return BMR |
class SocialErrorMessages:
"""
Create SocialErrorMessages object
"""
def __init__(self, base_url: str):
self._full_messages = {
"email facebook error": f"""<p>We can't get your email. Please, check <a href=\"https://facebook.com/settings\">your facebook settings</a>. Make sure you h... | class Socialerrormessages:
"""
Create SocialErrorMessages object
"""
def __init__(self, base_url: str):
self._full_messages = {'email facebook error': f'''<p>We can't get your email. Please, check <a href="https://facebook.com/settings">your facebook settings</a>. Make sure you have email there... |
n = int(input("Please Enter a value for N:\n"))
count = 0
sum = 0
while count <= n :
sum = sum+count
count +=1
print("Sum of N natural numbers: " + str(sum)) | n = int(input('Please Enter a value for N:\n'))
count = 0
sum = 0
while count <= n:
sum = sum + count
count += 1
print('Sum of N natural numbers: ' + str(sum)) |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 21 16:50:47 2020
@author: ucobiz
"""
inputObj = open("newfile.txt")
outputObj = open("output-newfile.txt", "w")
# convert the sentence into UPPERCASE
for sentence in inputObj:
newSentenceUpper = sentence.upper()
outputObj.writelines(newSentenceUppe... | """
Created on Wed Oct 21 16:50:47 2020
@author: ucobiz
"""
input_obj = open('newfile.txt')
output_obj = open('output-newfile.txt', 'w')
for sentence in inputObj:
new_sentence_upper = sentence.upper()
outputObj.writelines(newSentenceUpper)
inputObj.close()
outputObj.close() |
# subsets 78
# ttungl@gmail.com
# Given a set of distinct integers, nums, return all possible subsets (the power set).
# Note: The solution set must not contain duplicate subsets.
# For example,
# If nums = [1,2,3], a solution is:
# [
# [3],
# [1],
# [2],
# [1,2,3],
# [1,3],
# [2,3],
# [1,2],
# []
# ... | class Solution(object):
def subsets(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
res = [[]]
for i in nums:
res += [j + [i] for j in res]
return res
def dfs(nums, index, path, res):
res.append(path)
... |
# integer = int(input("Please fill number:"))
integer = 12
result = tuple()
for i in range(0,integer,2 ):
result = result + (i,)
print(result) | integer = 12
result = tuple()
for i in range(0, integer, 2):
result = result + (i,)
print(result) |
APIS = {
'apis',
'keyvaluemaps',
'targetservers',
'caches',
'developers',
'apiproducts',
'apps',
'userroles',
}
class Struct:
def __init__(self, **entries):
self.__dict__.update(entries)
def __repr__(self):
return f"{self.__dict__}"
def empty_snapshot():
r... | apis = {'apis', 'keyvaluemaps', 'targetservers', 'caches', 'developers', 'apiproducts', 'apps', 'userroles'}
class Struct:
def __init__(self, **entries):
self.__dict__.update(entries)
def __repr__(self):
return f'{self.__dict__}'
def empty_snapshot():
return struct(apis={}, keyvaluemaps=... |
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
GDAL_LIBRARY_PATH = "/Applications/Postgres.app/Contents/Versions/9.4/lib/libgdal.dylib"
GEOS_LIBRARY_PATH = "/Applications/Postgres.app/Contents/Versions/9.4/lib/libgeos_c.dylib"
DATABASES = {
'default': {
'ENGINE': 'django.contr... | gdal_library_path = '/Applications/Postgres.app/Contents/Versions/9.4/lib/libgdal.dylib'
geos_library_path = '/Applications/Postgres.app/Contents/Versions/9.4/lib/libgeos_c.dylib'
databases = {'default': {'ENGINE': 'django.contrib.gis.db.backends.postgis', 'NAME': 'tor_nodes_map', 'USER': '', 'PASSWORD': '', 'HOST': ''... |
INTERACTIVE_TEXT_BUTTON_ACTION = "doTextButtonAction"
INTERACTIVE_IMAGE_BUTTON_ACTION = "doImageButtonAction"
INTERACTIVE_BUTTON_PARAMETER_KEY = "param_key"
def _respons_text_card(type,title,text):
return {
'actionResponse': {'type': type},
"cards": [
{
... | interactive_text_button_action = 'doTextButtonAction'
interactive_image_button_action = 'doImageButtonAction'
interactive_button_parameter_key = 'param_key'
def _respons_text_card(type, title, text):
return {'actionResponse': {'type': type}, 'cards': [{'header': {'title': title, 'subtitle': 'City of Edmonton chatb... |
class Solution(object):
def moveZeroes(self, nums):
"""
:type nums: List[int]
:rtype: None Do not return anything, modify nums in-place instead.
"""
l = 0
lis =[]
for i in nums:
if i != 0:
lis.append(i)
for i in lis:
... | class Solution(object):
def move_zeroes(self, nums):
"""
:type nums: List[int]
:rtype: None Do not return anything, modify nums in-place instead.
"""
l = 0
lis = []
for i in nums:
if i != 0:
lis.append(i)
for i in lis:
... |
data = '''
Letters : abcdefghijklmnopqurtuvwxyz
Capital Letters : ABCDEFGHIJKLMNOPQRSTUVWXYZ
Numbers : 1234567890
Words : regular expresion
Need to be escaped
Meta Characters : . ^ $ * + ? { } [ ] \ | ( )
Websites : qaviton.com yonadavking.com idangay.com
Phone Numbers:
... | data = "\nLetters : abcdefghijklmnopqurtuvwxyz\nCapital Letters : ABCDEFGHIJKLMNOPQRSTUVWXYZ\nNumbers : 1234567890\nWords : regular expresion \nNeed to be escaped\nMeta Characters : . ^ $ * + ? { } [ ] \\ | ( )\nWebsites : qaviton.com yonadavking.com idangay.com\n\nPhone Num... |
class PipelineNode(object):
def __init__(self, module_path, params):
self.module_path = module_path
self.params = params
| class Pipelinenode(object):
def __init__(self, module_path, params):
self.module_path = module_path
self.params = params |
script = """
from vapory import *
scene = Scene(
camera = Camera('location', [0, 2, -3], 'look_at', [0, 1, 2]),
objects = [
LightSource([2, 4, -3], 'color', [1, 1, 1]),
Background('color', [1, 1, 1]),
Sphere([0, 1, 2], 2, Texture(Pigment('color', ([1, 0, 1])))),
Box([{0}, -1.5, ... | script = "\nfrom vapory import *\n\nscene = Scene(\n camera = Camera('location', [0, 2, -3], 'look_at', [0, 1, 2]),\n objects = [\n LightSource([2, 4, -3], 'color', [1, 1, 1]),\n Background('color', [1, 1, 1]),\n Sphere([0, 1, 2], 2, Texture(Pigment('color', ([1, 0, 1])))),\n Box([{0},... |
if __name__ == "__main__":
filename = "ecm_flash_attempt2.in"
f = open(filename)
arr = []
i = 0
f2 = open(filename + ".dat", "w")
for line in f:
line = line.strip()
pieces = line.split(',')
can_data = pieces[3]
idh = can_data[0:5].replace(' '... | if __name__ == '__main__':
filename = 'ecm_flash_attempt2.in'
f = open(filename)
arr = []
i = 0
f2 = open(filename + '.dat', 'w')
for line in f:
line = line.strip()
pieces = line.split(',')
can_data = pieces[3]
idh = can_data[0:5].replace(' ', '').strip()
... |
def login():
result = auth_jwt.jwt_token_manager()
if result and "token" in result:
response.headers["x-gg-userid"] = auth.user_id
return result
def register():
request.vars.email = request.vars.username
request.vars.password = db.auth_user.password.validate(request.vars.password)[0]
re... | def login():
result = auth_jwt.jwt_token_manager()
if result and 'token' in result:
response.headers['x-gg-userid'] = auth.user_id
return result
def register():
request.vars.email = request.vars.username
request.vars.password = db.auth_user.password.validate(request.vars.password)[0]
re... |
class Solution:
def largestAltitude(self, gain: List[int]) -> int:
max_alt = 0
curr = 0
for alt in gain:
curr += alt
if max_alt < curr:
max_alt = curr
return max_alt | class Solution:
def largest_altitude(self, gain: List[int]) -> int:
max_alt = 0
curr = 0
for alt in gain:
curr += alt
if max_alt < curr:
max_alt = curr
return max_alt |
fields = 'Incorrect some fields'
login = 'Incorrect password or login'
location = 'Incorrect location'
wrong = 'Something goes wrong. Maybe some fields are incorrect. Please connect with administrations'
load = 'not loaded'
change = 'Somefing change on site. Please connect with administrations'
not_found = 'Article not... | fields = 'Incorrect some fields'
login = 'Incorrect password or login'
location = 'Incorrect location'
wrong = 'Something goes wrong. Maybe some fields are incorrect. Please connect with administrations'
load = 'not loaded'
change = 'Somefing change on site. Please connect with administrations'
not_found = 'Article not... |
class Color:
def __init__(self, red, green, blue):
self.red = red
self.green = green
self.blue = blue
def get_color(self):
return self.red, self.green, self.blue
class BlockColor:
darkblue = Color(0, 0, 139)
yellow = Color(255, 255, 0)
green = Color(0, 128, 0)
... | class Color:
def __init__(self, red, green, blue):
self.red = red
self.green = green
self.blue = blue
def get_color(self):
return (self.red, self.green, self.blue)
class Blockcolor:
darkblue = color(0, 0, 139)
yellow = color(255, 255, 0)
green = color(0, 128, 0)
... |
'''
Pattern:
Enter a number: 5
E
E D
E D C
E D C B
E D C B A
E D C B
E D C
E D
E
'''
print('Alphabet Pattern: ')
number_rows = int(input("Enter a number: "))
for row in range(1,number_rows+1):
for column in range(1,row+1):
print(chr(65+number_rows-column),end=" ")
print()
fo... | """
Pattern:
Enter a number: 5
E
E D
E D C
E D C B
E D C B A
E D C B
E D C
E D
E
"""
print('Alphabet Pattern: ')
number_rows = int(input('Enter a number: '))
for row in range(1, number_rows + 1):
for column in range(1, row + 1):
print(chr(65 + number_rows - column), end=' ')
print()
for row in... |
# You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically contact the police if two adjacent houses were broken into ... | class Solution:
def rob(self, nums: List[int]) -> int:
if len(nums) == 0:
return 0
if len(nums) < 3:
return max(nums)
nums[1] = max(nums[0], nums[1])
for i in range(2, len(nums)):
nums[i] = max(nums[i] + nums[i - 2], nums[i - 1])
return nu... |
# python3
def lps(pattern):
pattern = '#'+pattern
length = len(pattern)
table = [0 for i in range(length)]
table[1] = 0
for i in range(2, length):
j = table[i-1]
while pattern[j+1] != pattern[i] and j>0:
j = table[j]
if pattern[j+1... | def lps(pattern):
pattern = '#' + pattern
length = len(pattern)
table = [0 for i in range(length)]
table[1] = 0
for i in range(2, length):
j = table[i - 1]
while pattern[j + 1] != pattern[i] and j > 0:
j = table[j]
if pattern[j + 1] == pattern[i]:
tabl... |
"""DLPack is a protocol for sharing arrays between deep learning frameworks."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
tf_http_archive(
name = "dlpack",
strip_prefix = "dlpack-3efc489b55385936531a06ff83425b719387ec63",
sha256 = "b59586ce69bcf3efdbf3cf4803fadfeaae4948... | """DLPack is a protocol for sharing arrays between deep learning frameworks."""
load('//third_party:repo.bzl', 'tf_http_archive')
def repo():
tf_http_archive(name='dlpack', strip_prefix='dlpack-3efc489b55385936531a06ff83425b719387ec63', sha256='b59586ce69bcf3efdbf3cf4803fadfeaae4948044e2b8d89cf912194cf28f233', url... |
#!/usr/bin/env python
# coding: utf-8
# In[6]:
def Secant(f,a,b,nMax,epsilon):
fa=f(a)
fb=f(b)
if abs(fa) > abs(fb):
atemp = a
fatemp = fa
a = b
b = atemp
fa = fb
fb = fatemp
return None
print(0,a,fa)
print(1,b,fb)
for n in range(2,nMax)... | def secant(f, a, b, nMax, epsilon):
fa = f(a)
fb = f(b)
if abs(fa) > abs(fb):
atemp = a
fatemp = fa
a = b
b = atemp
fa = fb
fb = fatemp
return None
print(0, a, fa)
print(1, b, fb)
for n in range(2, nMax):
if abs(fa) > abs(fb):
... |
#grade of steel
a=int(input("Hardness:"))
b=float(input("Carbon content:"))
c=int(input("Tensile strength:"))
if a>50 and b<0.7 and c>5600:
print("10")
elif a>50 and b<0.7:
print("9")
elif b<0.7 and c>5600:
print("8")
elif a>50 and c>5600:
print("7")
elif a>50 or b<0.7 or c>5600:
print(... | a = int(input('Hardness:'))
b = float(input('Carbon content:'))
c = int(input('Tensile strength:'))
if a > 50 and b < 0.7 and (c > 5600):
print('10')
elif a > 50 and b < 0.7:
print('9')
elif b < 0.7 and c > 5600:
print('8')
elif a > 50 and c > 5600:
print('7')
elif a > 50 or b < 0.7 or c > 5600:
pri... |
def format_inequality_result_string(and_or_expr):
result = []
if and_or_expr.__class__.__name__ == 'Or':
if not and_or_expr.args:
raise ValueError('Recieved empty Or expression. Dafk?')
for expr in and_or_expr.args:
# TODO: This will fail when dealing with more complex bo... | def format_inequality_result_string(and_or_expr):
result = []
if and_or_expr.__class__.__name__ == 'Or':
if not and_or_expr.args:
raise value_error('Recieved empty Or expression. Dafk?')
for expr in and_or_expr.args:
result.append(expr.args)
elif and_or_expr.__class__... |
n = int(input())
M=[]
m = input().split()
for i in range(n -1):
for j in range(i+1,n):
if int(m[i])<int(m[j]):
M.append(m[j])
break
if len(M) < i+1:
M.append('*')
M.append('*')
m2 = ' '.join(M)
print(m2)
| n = int(input())
m = []
m = input().split()
for i in range(n - 1):
for j in range(i + 1, n):
if int(m[i]) < int(m[j]):
M.append(m[j])
break
if len(M) < i + 1:
M.append('*')
M.append('*')
m2 = ' '.join(M)
print(m2) |
# Function to calculate the
# electricity bill
def calculateBill(units):
# Condition to find the charges
# bar in which the units consumed
# is fall
if (units <= 150):
return units * 5.50;
elif (151<=units<=300):
return ((150* 5.50... | def calculate_bill(units):
if units <= 150:
return units * 5.5
elif 151 <= units <= 300:
return 150 * 5.5 + (units - 150) * 6
elif 301 <= units <= 500:
return 150 * 5.5 + 150 * 6 + (units - 300) * 6.5
elif units > 500:
return 150 * 5.5 + 150 * 6 + 150 * 6.5 + (units - 450... |
def compute_list_average(number_list):
return sum(number_list) / len(number_list)
number_list = []
for i in range(5):
number_list.append(float(input("Give a number: ")))
print(compute_list_average(number_list)) | def compute_list_average(number_list):
return sum(number_list) / len(number_list)
number_list = []
for i in range(5):
number_list.append(float(input('Give a number: ')))
print(compute_list_average(number_list)) |
# -*- coding: utf-8 -*-
"""
Created on Tue May 5 08:58:36 2020
@author: Shivadhar SIngh
"""
global_X = 27
def my_function(param1=123, param2="hi mom"):
local_X = 654.321
print("\n=== local namespace ===") # line 1
for name,val in list(locals().items()):
print("name:", name, "value:", val)
p... | """
Created on Tue May 5 08:58:36 2020
@author: Shivadhar SIngh
"""
global_x = 27
def my_function(param1=123, param2='hi mom'):
local_x = 654.321
print('\n=== local namespace ===')
for (name, val) in list(locals().items()):
print('name:', name, 'value:', val)
print('=======================')
... |
###############################################################################
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"). #
... | def transform_params(params_in):
"""Splits input parameter into parameter key and value.
Args:
params_in (dict): Python dict of input params e.g.
{
"principal_role": "$[alfred_ssm_/org/primary/service_catalog/
principal/role_arn]"
}
Return:
params_out... |
a = int(input())
b = int(input())
c = int(input())
if a == b == c:
print(3)
elif (a == b and a != c) or (a == c and a != b) or (b == c and a != c):
print(2)
else:
print(0)
| a = int(input())
b = int(input())
c = int(input())
if a == b == c:
print(3)
elif a == b and a != c or (a == c and a != b) or (b == c and a != c):
print(2)
else:
print(0) |
#triangular star pattern
'''
Print the following pattern for the given N number of rows.
Pattern for N = 4
*
**
***
****
'''
rows=int(input())
for i in range(rows):
for j in range(i+1):
print("*",end="")
print()
| """
Print the following pattern for the given N number of rows.
Pattern for N = 4
*
**
***
****
"""
rows = int(input())
for i in range(rows):
for j in range(i + 1):
print('*', end='')
print() |
class ContestError(Exception):
def __init__(self, message: str = 'UGrade Error', *args) -> None:
super(ContestError, self).__init__(message, *args)
class NoSuchLanguageError(ContestError):
def __init__(self, message: str = 'No Such Language') -> None:
super(NoSuchLanguageError, self).__init__(... | class Contesterror(Exception):
def __init__(self, message: str='UGrade Error', *args) -> None:
super(ContestError, self).__init__(message, *args)
class Nosuchlanguageerror(ContestError):
def __init__(self, message: str='No Such Language') -> None:
super(NoSuchLanguageError, self).__init__(mes... |
"""Using two methods from Stack, accomplish enqueue and dequeue."""
# from .. stack.stack import Stack
# from .. stack.stack import Node
class Node(object):
"""This class is set up to create new Nodes."""
def __init__(self, value, next_node=None):
self.value = value
self.next_node = next_node
... | """Using two methods from Stack, accomplish enqueue and dequeue."""
class Node(object):
"""This class is set up to create new Nodes."""
def __init__(self, value, next_node=None):
self.value = value
self.next_node = next_node
def __str__(self):
return f'{self.value}'
def __rep... |
n = int(input())
if n % 2 == 1 or 6 <= n <= 20:
print('Weird')
elif 2 <= n <= 5 or n > 20:
print('Not Weird')
| n = int(input())
if n % 2 == 1 or 6 <= n <= 20:
print('Weird')
elif 2 <= n <= 5 or n > 20:
print('Not Weird') |
class Solution:
def sumOddLengthSubarrays(self, arr: List[int]) -> int:
n = len(arr)
k = 1
m = 0
total_sum = 0
while k <= n:
for i in range(n - m):
total_sum = total_sum + sum(arr[i:i + k])
if k <= n:
k += 2
... | class Solution:
def sum_odd_length_subarrays(self, arr: List[int]) -> int:
n = len(arr)
k = 1
m = 0
total_sum = 0
while k <= n:
for i in range(n - m):
total_sum = total_sum + sum(arr[i:i + k])
if k <= n:
k += 2
... |
arquivo = open("exercicio_1.txt", "w")
arquivo.write("\nTeste 3")
arquivo.write("\nTeste 4")
arquivo.close()
arquivo = open("exercicio_1.txt", "a")
arquivo.write("\nTeste 5")
arquivo.write("\nTeste 6")
arquivo.close()
arquivo = open("exercicio_1.txt", "w")
arquivo.write("\nTeste 7")
arquivo.write("\nTeste 8")
arquivo... | arquivo = open('exercicio_1.txt', 'w')
arquivo.write('\nTeste 3')
arquivo.write('\nTeste 4')
arquivo.close()
arquivo = open('exercicio_1.txt', 'a')
arquivo.write('\nTeste 5')
arquivo.write('\nTeste 6')
arquivo.close()
arquivo = open('exercicio_1.txt', 'w')
arquivo.write('\nTeste 7')
arquivo.write('\nTeste 8')
arquivo.c... |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def sortList(self, head: Optional[ListNode]) -> Optional[ListNode]:
temp=head
dd=[]
## looping through the LInklist ... | class Solution:
def sort_list(self, head: Optional[ListNode]) -> Optional[ListNode]:
temp = head
dd = []
while temp:
dd.append(temp.val)
temp = temp.next
dd.sort()
temp = head
for i in dd:
temp.val = i
temp = temp.next
... |
class Report:
def __init__(self):
self.set_age('')
self.set_date('')
self.set_cause('')
self.set_location('')
self.set_remarks('')
self.set_source('')
def clear():
self.data = []
def empty(self):
return (len(self.name) == 0)
... | class Report:
def __init__(self):
self.set_age('')
self.set_date('')
self.set_cause('')
self.set_location('')
self.set_remarks('')
self.set_source('')
def clear():
self.data = []
def empty(self):
return len(self.name) == 0
def get_name(... |
# -*- coding: utf-8 -*-
class Type(object):
""" Class who define a rule.
yml files are read from heimdall/conf/rules/type_name.yml and used for Type Object instantiation
Keyword Args:
:param: name: type's name.
:param: id: type's id.
:param: desc: type's d... | class Type(object):
""" Class who define a rule.
yml files are read from heimdall/conf/rules/type_name.yml and used for Type Object instantiation
Keyword Args:
:param: name: type's name.
:param: id: type's id.
:param: desc: type's description.
:... |
class AbstractMiddleware:
def send_data(self):
pass
#def process_middleware_response(self):
# pass
| class Abstractmiddleware:
def send_data(self):
pass |
# mock.py: module providing mock 10xGenomics data for testing
# Copyright (C) University of Manchester 2018 Peter Briggs
#
########################################################################
QC_SUMMARY_JSON = """{
"10x_software_version": "cellranger 2.2.0",
"PhiX_aligned": null,
"PhiX_error_... | qc_summary_json = '{\n "10x_software_version": "cellranger 2.2.0", \n "PhiX_aligned": null, \n "PhiX_error_worst_tile": null, \n "bcl2fastq_args": "bcl2fastq --minimum-trimmed-read-length 8 --mask-short-adapter-reads 8 --create-fastq-for-index-reads --ignore-missing-positions --ignore-missing-filter --ignor... |
# Lab 3: String Data Type
# Exercise 1: The String Data Type
myString="This is a string."
print(myString)
print(type(myString))
print(myString + " is of data type " + str(type(myString)))
# Exercise 2: String Concatenation
firstString="water"
secondString="fall"
thirdString= firstString + secondString
... | my_string = 'This is a string.'
print(myString)
print(type(myString))
print(myString + ' is of data type ' + str(type(myString)))
first_string = 'water'
second_string = 'fall'
third_string = firstString + secondString
print(thirdString)
name = input('What is your name? ')
print(name)
color = input('What is your favorit... |
"""this module produces a SyntaxError at execution time"""
__revision__ = None
def run():
"""simple function"""
if True:
continue
else:
break
if __name__ == '__main__':
run()
| """this module produces a SyntaxError at execution time"""
__revision__ = None
def run():
"""simple function"""
if True:
continue
else:
break
if __name__ == '__main__':
run() |
def filter_child_dictionary(dictionary, key, value):
newdict = {}
for child_name in dictionary:
child = dictionary[child_name]
if not key in child:
continue
if str(child[key]) != str(value):
continue
newdict[child_name] = child
return newdict
def filter_child_attr(dictionary, key, ava... | def filter_child_dictionary(dictionary, key, value):
newdict = {}
for child_name in dictionary:
child = dictionary[child_name]
if not key in child:
continue
if str(child[key]) != str(value):
continue
newdict[child_name] = child
return newdict
def filt... |
"""
Merged String Checker
http://www.codewars.com/kata/54c9fcad28ec4c6e680011aa/train/python
"""
def is_merge(s, part1, part2):
result = list(s)
def findall(part):
pointer = 0
for c in part:
found = False
for i in range(pointer, len(result)):
if result... | """
Merged String Checker
http://www.codewars.com/kata/54c9fcad28ec4c6e680011aa/train/python
"""
def is_merge(s, part1, part2):
result = list(s)
def findall(part):
pointer = 0
for c in part:
found = False
for i in range(pointer, len(result)):
if result[... |
# x = 0x0a
# y = 0x02
# z = x & y
# print(f'Hex: x = {x:02X}, y = {y:02X}, z = {z:02X}')
# print(f'Bin: x = {x:08b}, y = {y:08b}, z = {z:08b}')
x = 0x0a
y = 0x05
z = x ^ y
print(f'Hex: x = {x:02X}, y = {y:02X}, z = {z:02X}')
print(f'Bin: x = {x:08b}, y = {y:08b}, z = {z:08b}')
# x = 0x0a
# y = 0x02
# z ... | x = 10
y = 5
z = x ^ y
print(f'Hex: x = {x:02X}, y = {y:02X}, z = {z:02X}')
print(f'Bin: x = {x:08b}, y = {y:08b}, z = {z:08b}') |
"""Top-level package for Python Boilerplate."""
__author__ = """Evgeny Skosarev"""
__email__ = 'skosarew@mail.ru'
__version__ = '0.1.0'
| """Top-level package for Python Boilerplate."""
__author__ = 'Evgeny Skosarev'
__email__ = 'skosarew@mail.ru'
__version__ = '0.1.0' |
## Script (Python) "getFotos"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
root = context.portal_url.getPortalObject().getPhysicalPath()[1]
path = '/' + root + '/multimidia/fotos'
fotos = context.portal_catalog.searchRe... | root = context.portal_url.getPortalObject().getPhysicalPath()[1]
path = '/' + root + '/multimidia/fotos'
fotos = context.portal_catalog.searchResults(Type='Image', path=path)
return fotos |
# Exercise 8.5
def rotate_char(c, n):
"""Rotate a single character n places in the alphabet
n is an integer
"""
# alpha_number and new_alpha_number will represent the
# place in the alphabet (as distinct from the ASCII code)
# So alpha_number('a')==0
# alpha_base is the ASCII code for the ... | def rotate_char(c, n):
"""Rotate a single character n places in the alphabet
n is an integer
"""
if c.islower():
alpha_base = ord('a')
elif c.isupper():
alpha_base = ord('A')
else:
return c
alpha_number = ord(c) - alpha_base
new_alpha_number = (alpha_number + n) %... |
selfish_mining_strategy = \
[
[ # irrelevant
['*', '*', '*', '*', '*', '*', '*', '*', '*', '*'],
['w', '*', 'a', '*', '*', '*', '*', '*', '*', '*'],
['w', 'w', '*', 'a', '*', '*', '*', '*', '*', '*'],
['w', 'w', 'w', '*', 'a', '*', '*', '*', '*', '*'],
['w', 'w', 'w', 'w', '... | selfish_mining_strategy = [[['*', '*', '*', '*', '*', '*', '*', '*', '*', '*'], ['w', '*', 'a', '*', '*', '*', '*', '*', '*', '*'], ['w', 'w', '*', 'a', '*', '*', '*', '*', '*', '*'], ['w', 'w', 'w', '*', 'a', '*', '*', '*', '*', '*'], ['w', 'w', 'w', 'w', '*', 'a', '*', '*', '*', '*'], ['w', 'w', 'w', 'w', 'w', '*', '... |
'''An example of an internal module within the package
Although the intenals are not explicity exposed, they are still available via
import mhlib
mhlib.eg.MhEg().runMhEg()
import mhlib.l2.l2
mhlib.l2.l2.L2EG_VAR
'''
| """An example of an internal module within the package
Although the intenals are not explicity exposed, they are still available via
import mhlib
mhlib.eg.MhEg().runMhEg()
import mhlib.l2.l2
mhlib.l2.l2.L2EG_VAR
""" |
# argparse
TRAIN_ARGS = [
'-i', 'flowers',
'-o', 'checkpoints',
'-a', 'resnet101',
'--input_size', '2048',
'--output_size', '102',
'--hidden_layers', '1024', '512',
'--learning_rate', '0.001',
'--epochs', '3',
'--gpu'
]
PREDICT_ARGS = [
'--input_img', 'flowers/test/1/image_06743... | train_args = ['-i', 'flowers', '-o', 'checkpoints', '-a', 'resnet101', '--input_size', '2048', '--output_size', '102', '--hidden_layers', '1024', '512', '--learning_rate', '0.001', '--epochs', '3', '--gpu']
predict_args = ['--input_img', 'flowers/test/1/image_06743.jpg', '--checkpoint', 'checkpoints/checkpoint.pth', '-... |
"""
the file was left blank
with much intent and purpose
Poetry needs it
"""
| """
the file was left blank
with much intent and purpose
Poetry needs it
""" |
def ResponseModel(data,message):
return {
"data":[data],
"code":200,
"message":message
}
def ResponseCreateModel(message):
return {
"data": 1,
"code":201,
"message":message
}
def ErrorResponseModel(error,code,message):
return {
"error":error... | def response_model(data, message):
return {'data': [data], 'code': 200, 'message': message}
def response_create_model(message):
return {'data': 1, 'code': 201, 'message': message}
def error_response_model(error, code, message):
return {'error': error, 'code': code, 'message': message} |
__author__ = 'davidl'
class BaseMonitorDriver(object):
def notify(self,fixture_id, info):
print (info)
def notify_blocking_request(self,fixture_id, info):
print (info)
return True
| __author__ = 'davidl'
class Basemonitordriver(object):
def notify(self, fixture_id, info):
print(info)
def notify_blocking_request(self, fixture_id, info):
print(info)
return True |
new_list = []
people = ['agnes', 'andrew','jane','peter']
for person in people:
if person[0] == 'a':
new_list.append(person)
print(new_list) | new_list = []
people = ['agnes', 'andrew', 'jane', 'peter']
for person in people:
if person[0] == 'a':
new_list.append(person)
print(new_list) |
"""
This file contains a function used to assign the correct type
on a user entered equation.
"""
def type_check(some_input, memory):
"""
Assign the correct type on a user entered equation to avoid
accomodate a failure to input numbers in an equation.
:param some_input: an element from the user input... | """
This file contains a function used to assign the correct type
on a user entered equation.
"""
def type_check(some_input, memory):
"""
Assign the correct type on a user entered equation to avoid
accomodate a failure to input numbers in an equation.
:param some_input: an element from the user input ... |
# -*- coding: utf-8 -*-
#from gluon import *
#from s3 import *
# =============================================================================
class Daily():
""" Daily Maintenance Tasks """
def __call__(self):
# @ToDo: cleanup scheduler logs
return
# END ===================================... | class Daily:
""" Daily Maintenance Tasks """
def __call__(self):
return |
#------------------------------------------------------------------------------
# Copyright (c) 2007 by Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------
""" Plug-ins for the Envisage application framework.
Part of the EnvisagePlugins project of t... | """ Plug-ins for the Envisage application framework.
Part of the EnvisagePlugins project of the Enthought Tool Suite.
""" |
try:
num1 = int(input("TELL ME YOUR AGE\n"))
num2 = int(input("TELL ME YOUR name\n"))
print(num1 + num2)
# print(num2)
except Exception as dfdfe:
print(dfdfe)
print("HELLO\n")
| try:
num1 = int(input('TELL ME YOUR AGE\n'))
num2 = int(input('TELL ME YOUR name\n'))
print(num1 + num2)
except Exception as dfdfe:
print(dfdfe)
print('HELLO\n') |
#
# PySNMP MIB module DFRAP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DFRAP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:42:12 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23... | (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, constraints_intersection, value_size_constraint, constraints_union, single_value_constraint) ... |
#!/opt/evawiz/python/bin/python
#normal python defination code here
def pyAdd(x,y):
return abs(x)+abs(y)
| def py_add(x, y):
return abs(x) + abs(y) |
class Solution:
def scheduleCourse(self, courses: List[List[int]]) -> int:
best = 0
timeSpent = 0
h = []
current = 0
courses.sort(key=lambda x: x[1])
for duration, last in courses:
heapq.heappush(h, -duration)
timeSpent += duration
... | class Solution:
def schedule_course(self, courses: List[List[int]]) -> int:
best = 0
time_spent = 0
h = []
current = 0
courses.sort(key=lambda x: x[1])
for (duration, last) in courses:
heapq.heappush(h, -duration)
time_spent += duration
... |
"""
Approach 1: Brute Force
- O(n), O(1)
Approach 2: Binary Search
- O(log n), O(1)
Approach 3: Binary Search on Evens Indexes Only
- O(log n), O(1)
"""
class Solution:
def singleNonDuplicate1(self, nums: List[int]) -> int:
for i in range(0, len(nums) - 2, 2):
if nums[i] != nums[i + 1]:
... | """
Approach 1: Brute Force
- O(n), O(1)
Approach 2: Binary Search
- O(log n), O(1)
Approach 3: Binary Search on Evens Indexes Only
- O(log n), O(1)
"""
class Solution:
def single_non_duplicate1(self, nums: List[int]) -> int:
for i in range(0, len(nums) - 2, 2):
if nums[i] != nums[i + 1]:
... |
modlist = [
("Pmv","SLCommands","""None"""),
("Pmv","amberCommands","""None"""),
("Pmv","artCommands","""None"""),
("Pmv","bondsCommands","""None"""),
("Pmv","colorCommands","""
This Module implements commands to color the current selection different ways.
for example:
by atoms.
by residues.
by chains.
... | modlist = [('Pmv', 'SLCommands', 'None'), ('Pmv', 'amberCommands', 'None'), ('Pmv', 'artCommands', 'None'), ('Pmv', 'bondsCommands', 'None'), ('Pmv', 'colorCommands', '\nThis Module implements commands to color the current selection different ways.\nfor example:\n by atoms.\n by residues.\n by chains.\n etc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.