content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
#!/usr/bin/env python3
def has_dups(data):
for i in data:
if data.count(i) > 1:
return True
else:
return False
print(has_dups([1, 2, 3]))
print(has_dups([1,1,2,3])) | def has_dups(data):
for i in data:
if data.count(i) > 1:
return True
else:
return False
print(has_dups([1, 2, 3]))
print(has_dups([1, 1, 2, 3])) |
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | """Configures repositories required by repo-infra."""
load('@bazel_gazelle//:deps.bzl', 'gazelle_dependencies', 'go_repository')
load('@bazel_skylib//lib:versions.bzl', 'versions')
load('@bazel_toolchains//rules:rbe_repo.bzl', 'rbe_autoconfig')
load('@com_google_protobuf//:protobuf_deps.bzl', 'protobuf_deps')
load('@io... |
# In practice, this is just a number-base changer, where the number not in base 10 is represented as an array.
# Created to transform binary output arrays of a multilabel classifier into a single base 10 int.
def mux(array, array_base=2):
"""Multiplex array containing digits of given base into base-10 int
Arg... | def mux(array, array_base=2):
"""Multiplex array containing digits of given base into base-10 int
Args:
array (numpy.ndarray): 1-d array of digits of base "base".
base (int, optional): Base of digits in array. Defaults to 2.
Returns:
int: multiplexed number
"""
s = 0
f... |
headers = {'User-Agent': 'Mozilla/5.0 Chrome/86.0.4240.75'}
# Enter the URL of the product page on flipkart
PRODUCT_URL = 'enter_url_here'
# Enter the threshhold price of the product
THRESHHOLD = 6969.0
# Enter your email address
MY_EMAIL = ''
# Enter your password (Check readme.md for steps to get app password)
MY_APP... | headers = {'User-Agent': 'Mozilla/5.0 Chrome/86.0.4240.75'}
product_url = 'enter_url_here'
threshhold = 6969.0
my_email = ''
my_app_password = ''
check_again = 60 * 30
receiver_email = '' |
"""
This file transform the SQL produced by MySQL on SQL that can execute on PostgreSQL
"""
__READ_SQL_FILE__ = "original_schema_msql.sql"
__OUTPUT_SQL_FILE__ = "02_create_schema_db_for_postgresql.sql"
code_to_add_in_top_of_file = ["""
-- delete all tables in public schema, with exception of the spatial_ref_sys
-... | """
This file transform the SQL produced by MySQL on SQL that can execute on PostgreSQL
"""
__read_sql_file__ = 'original_schema_msql.sql'
__output_sql_file__ = '02_create_schema_db_for_postgresql.sql'
code_to_add_in_top_of_file = ["\n-- delete all tables in public schema, with exception of the spatial_ref_sys\n-- SOUR... |
# Key Arbitrary
def build_profile(first, last, **user_info):
profile = {}
profile['first'] = first
profile['last'] = last
for key, value in user_info.items():
profile[key] = value
return profile
user_profile0 = build_profile('albert', 'einstein', location = 'princeton', field = 'physics')
user_profile1 = build_... | def build_profile(first, last, **user_info):
profile = {}
profile['first'] = first
profile['last'] = last
for (key, value) in user_info.items():
profile[key] = value
return profile
user_profile0 = build_profile('albert', 'einstein', location='princeton', field='physics')
user_profile1 = buil... |
COMMIT="12c255d13729fb571e4964f4f0a97ddba4bbe0d2"
VERSION="1.1-53-g12c255d"
DICTCOMMIT="8f414ce140263ac8c378d4e7bc97c035ade85aa7"
DICTVERSION="0.2.0"
| commit = '12c255d13729fb571e4964f4f0a97ddba4bbe0d2'
version = '1.1-53-g12c255d'
dictcommit = '8f414ce140263ac8c378d4e7bc97c035ade85aa7'
dictversion = '0.2.0' |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def isSameTree(self, p: 'TreeNode', q: 'TreeNode') -> 'bool':
def helper(p,q):
if not p and not q:
... | class Solution:
def is_same_tree(self, p: 'TreeNode', q: 'TreeNode') -> 'bool':
def helper(p, q):
if not p and (not q):
return True
if not p and q or (p and (not q)) or p.val != q.val:
return False
return helper(p.left, q.left) and helper... |
text_based = ["perspective_score", "identity_attack",
"sentiment",
"Please", "Please_start", "HASHEDGE",
"Indirect_(btw)",
"Hedges",
"Factuality", "Deference", "Gratitude", "Apologizing",
"1st_person_pl.", "1... | text_based = ['perspective_score', 'identity_attack', 'sentiment', 'Please', 'Please_start', 'HASHEDGE', 'Indirect_(btw)', 'Hedges', 'Factuality', 'Deference', 'Gratitude', 'Apologizing', '1st_person_pl.', '1st_person', '1st_person_start', '2nd_person', '2nd_person_start', 'Indirect_(greeting)', 'Direct_question', 'Dir... |
#Submitted by thr3sh0ld
#logic: Readable code
class Solution:
def largestDivisibleSubset(self, nums: List[int]) -> List[int]:
if len(nums) == 0 or len(nums) == 1:
return nums
nums.sort(reverse= False)
l = len(nums)
count = [1 for i in range(l)] #dp
prev = [-1 f... | class Solution:
def largest_divisible_subset(self, nums: List[int]) -> List[int]:
if len(nums) == 0 or len(nums) == 1:
return nums
nums.sort(reverse=False)
l = len(nums)
count = [1 for i in range(l)]
prev = [-1 for i in range(l)]
max_ind = 0
for i... |
int('0x7e0', 0)
# 2016
int('7e0', 16)
# 2016
hex(2016)
# '0x7e0' | int('0x7e0', 0)
int('7e0', 16)
hex(2016) |
#!/usr/bin/env python3.6.4
# encoding: utf-8
# @Time : 2018/6/24 14:40
# @Author : penghaibo
# @contact: xxxx@qq.com
# @Site :
# @File : config.py
# @Software: PyCharm
appkey = "d391709bada01c89be6dba753752bcd5"
host = "http://v.juhe.cn/historyWeather/" | appkey = 'd391709bada01c89be6dba753752bcd5'
host = 'http://v.juhe.cn/historyWeather/' |
#
# PySNMP MIB module A100-R1-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A100-R1-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 16:48:46 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 0... | (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_intersection, value_range_constraint, constraints_union, value_size_constraint) ... |
#
# PySNMP MIB module HPN-ICF-DOT11-LIC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-DOT11-LIC-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:25:45 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... | (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, single_value_constraint, value_size_constraint, constraints_union, constraints_intersection) ... |
lista_alunos=[]
lista_notas=[]
n1=0
n2=1
n3=2
n4=3
for i in range(0,10,1):
lista_alunos.append(str(input('Digite seu nome:')))
for i in range(0,1,1):
lista_notas.append(float(input('Digite a primeira nota:')))
lista_notas.append(float(input('Digite a segunda nota:')))
lista_notas.append(... | lista_alunos = []
lista_notas = []
n1 = 0
n2 = 1
n3 = 2
n4 = 3
for i in range(0, 10, 1):
lista_alunos.append(str(input('Digite seu nome:')))
for i in range(0, 1, 1):
lista_notas.append(float(input('Digite a primeira nota:')))
lista_notas.append(float(input('Digite a segunda nota:')))
lis... |
def simple_generator():
for i in range(5):
yield i
def run_simple_generator():
for j in simple_generator():
print(f"For loop: {j}")
sg = simple_generator()
print(f"Next value: {next(sg)}")
print(f"Next value: {next(sg)}")
print(f"Next value: {next(sg)}")
my_gen = simple_... | def simple_generator():
for i in range(5):
yield i
def run_simple_generator():
for j in simple_generator():
print(f'For loop: {j}')
sg = simple_generator()
print(f'Next value: {next(sg)}')
print(f'Next value: {next(sg)}')
print(f'Next value: {next(sg)}')
my_gen = simple_gene... |
my_variable = 'hello'
my_list_variable = ['hello', 'hi', 'nice to meet you']
my_tuple_variable = ('hello', 'hi', 'nice to meet you') # we can not increase the size of a tuple, it's immutable
my_set_variable = {'hello', 'hi', 'nice to meet you'} # Unique and unordered
print(my_list_variable)
print(my_tuple_variable)
pr... | my_variable = 'hello'
my_list_variable = ['hello', 'hi', 'nice to meet you']
my_tuple_variable = ('hello', 'hi', 'nice to meet you')
my_set_variable = {'hello', 'hi', 'nice to meet you'}
print(my_list_variable)
print(my_tuple_variable)
print(my_set_variable)
my_short_tuple_variable = ('hello',)
another_short_tuple_vari... |
# -*- coding: utf-8 -*-
DEFAULT_SETTINGS_MODULE = True
APP_B_FOO = "foo"
| default_settings_module = True
app_b_foo = 'foo' |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'use_system_sqlite%': 0,
},
'target_defaults': {
'defines': [
'SQLITE_CORE',
'SQLITE_ENABLE_BROKEN_FTS3',
... | {'variables': {'use_system_sqlite%': 0}, 'target_defaults': {'defines': ['SQLITE_CORE', 'SQLITE_ENABLE_BROKEN_FTS3', 'DSQLITE_ENABLE_FTS3_PARENTHESIS', 'SQLITE_ENABLE_FTS3', 'SQLITE_ENABLE_FTS4', 'SQLITE_ENABLE_MEMORY_MANAGEMENT', 'SQLITE_SECURE_DELETE', 'SQLITE_SEPARATE_CACHE_POOLS', 'THREADSAFE', '_HAS_EXCEPTIONS=0']... |
# Copyright (c) 2018 Fortinet, 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 requir... | get_version = '\n{\n {% if sn is defined %}\n "path": "/version?sn={{ sn }}",\n {% else %}\n "path": "/version/",\n {% endif %} \n "method": "GET"\n}\n'
get_realm = '\n{\n {% if id is defined %}\n {% if sn is defined %}\n "path": "/api/v1/realm/{{ id }}?sn={{ sn }}",\n ... |
seriffont = {"Width": 6, "Height": 8, "Start": 32, "End": 127, "Data": bytearray([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, #0x00,
0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, #0x00,
0x03, 0x00, 0x03, 0x00, 0x00, 0x00, #0x00,
0x12, 0x3F, 0x12, 0x3F, 0x12, 0x00, #0x00,
0x26, 0x7F, 0x32, 0x00, 0x00, 0x00, #0x00,
0x13, 0x0... | seriffont = {'Width': 6, 'Height': 8, 'Start': 32, 'End': 127, 'Data': bytearray([0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 0, 18, 63, 18, 63, 18, 0, 38, 127, 50, 0, 0, 0, 19, 11, 52, 50, 0, 0, 26, 37, 26, 40, 0, 0, 3, 0, 0, 0, 0, 0, 126, 129, 0, 0, 0, 0, 129, 126, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 8, 28, 8, 0, 0... |
London_walk = ox.graph_from_place('London, UK', network_type='walk')
London_walk_simple=nx.Graph(London_walk)
street_bus=London_walk_simple.copy()
street_bus.add_nodes_from(BN.nodes(data=True))
street_bus.add_edges_from(BN.edges(data=True))
# create tree
street_nodes=[]
for node,data in London_walk_simple.nodes(data=... | london_walk = ox.graph_from_place('London, UK', network_type='walk')
london_walk_simple = nx.Graph(London_walk)
street_bus = London_walk_simple.copy()
street_bus.add_nodes_from(BN.nodes(data=True))
street_bus.add_edges_from(BN.edges(data=True))
street_nodes = []
for (node, data) in London_walk_simple.nodes(data=True):
... |
# 18 > = Adult
# 5-17 = Child
# >0 - 5 = Infant
your_age = int(input("Enter you age : "))
if your_age >= 18 :
print("ADULT")
elif your_age > 5 :
print("CHILD")
else :
print("INFANT")
| your_age = int(input('Enter you age : '))
if your_age >= 18:
print('ADULT')
elif your_age > 5:
print('CHILD')
else:
print('INFANT') |
class Solution:
def solve(self, matrix):
dp = [[[None,0,0,0] for x in range(len(matrix[0])+1)] for y in range(len(matrix)+1)]
ans = 0
for y in range(len(matrix)):
for x in range(len(matrix[0])):
coeff0 = 1 if matrix[y][x] == dp[y-1][x][0] == dp[y][x-1][0] == dp[y-1][x-... | class Solution:
def solve(self, matrix):
dp = [[[None, 0, 0, 0] for x in range(len(matrix[0]) + 1)] for y in range(len(matrix) + 1)]
ans = 0
for y in range(len(matrix)):
for x in range(len(matrix[0])):
coeff0 = 1 if matrix[y][x] == dp[y - 1][x][0] == dp[y][x - 1]... |
class Solution:
def bitwiseComplement(self, N: int) -> int:
if N == 0:
return 1
tmp = []
while N:
t = N % 2
N //= 2
tmp.append(1-t)
ans = 0
for k in range(len(tmp)-1, -1, -1):
ans += tmp[k] * 2**k
return ans
... | class Solution:
def bitwise_complement(self, N: int) -> int:
if N == 0:
return 1
tmp = []
while N:
t = N % 2
n //= 2
tmp.append(1 - t)
ans = 0
for k in range(len(tmp) - 1, -1, -1):
ans += tmp[k] * 2 ** k
ret... |
def closest_row(dataframe, column, value):
"""
Function which takes a dataframe and returns the row that is closest to the specified value of the specified column.
:param dataframe: Dataframe object
:param column: String which matches to a column in the dataframe in which you would like to find the cl... | def closest_row(dataframe, column, value):
"""
Function which takes a dataframe and returns the row that is closest to the specified value of the specified column.
:param dataframe: Dataframe object
:param column: String which matches to a column in the dataframe in which you would like to find the clos... |
"""IO subpackage.
Modules and functions for input / output file and data processing
"""
| """IO subpackage.
Modules and functions for input / output file and data processing
""" |
#
# PySNMP MIB module ACMEPACKET-ENVMON-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ACMEPACKET-ENVMON-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:13:15 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... | (acmepacket_mgmt,) = mibBuilder.importSymbols('ACMEPACKET-SMI', 'acmepacketMgmt')
(ap_redundancy_state, ap_hardware_module_family, ap_phy_port_type, ap_presence) = mibBuilder.importSymbols('ACMEPACKET-TC', 'ApRedundancyState', 'ApHardwareModuleFamily', 'ApPhyPortType', 'ApPresence')
(object_identifier, integer, octet_s... |
#
# PySNMP MIB module M2000-V1 (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/M2000-V1
# Produced by pysmi-0.3.4 at Mon Apr 29 19:59:02 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:1... | (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, single_value_constraint, value_range_constraint, constraints_union, value_size_constraint) ... |
Experiment(description='More kernels but no RQ',
data_dir='../data/tsdl/',
max_depth=8,
random_order=False,
k=1,
debug=False,
local_computation=False,
n_rand=9,
sd=4,
max_jobs=400,
verbose=False,
... | experiment(description='More kernels but no RQ', data_dir='../data/tsdl/', max_depth=8, random_order=False, k=1, debug=False, local_computation=False, n_rand=9, sd=4, max_jobs=400, verbose=False, make_predictions=False, skip_complete=True, results_dir='../results/2013-08-14-no-rq/', iters=500, base_kernels='IBM,IBMLin,... |
"""
############################################################################
## High Altitude Balloon Club
############################################################################
"""
| """
############################################################################
## High Altitude Balloon Club
############################################################################
""" |
class Solution:
def deleteDuplicates(self, head):
if head:
p = head.next
while p and p.val == head.val:
p = p.next
head.next = self.deleteDuplicates(p)
return head
| class Solution:
def delete_duplicates(self, head):
if head:
p = head.next
while p and p.val == head.val:
p = p.next
head.next = self.deleteDuplicates(p)
return head |
# getting these names wrong on the mocks will result in always passing tests
# instead of calling methods on the mock, call these (where typos will fail)
def assert_called_once_with(mock, *args, **kwargs):
mock.assert_called_once_with(*args, **kwargs)
def assert_called_with(mock, *args, **kwargs):
mock.ass... | def assert_called_once_with(mock, *args, **kwargs):
mock.assert_called_once_with(*args, **kwargs)
def assert_called_with(mock, *args, **kwargs):
mock.assert_called_with(*args, **kwargs)
def assert_has_calls(mock, *args, **kwargs):
mock.assert_has_calls(*args, **kwargs) |
#
# PySNMP MIB module CTRON-SSR-HARDWARE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CTRON-SSR-HARDWARE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:31:24 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (d... | (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, value_range_constraint, constraints_intersection, single_value_constraint, constraints_union) ... |
# Area and perimeter of a rectangle in the plane
# A rectangle is given by the coordinates of two of its opposite angles (x1, y1) - (x2, y2).
# Calculate its area and perimeter . The input is read from the console. The numbers x1, y1, x2 and y2 are given one per line.
# The output is displayed on the console and must c... | x1 = float(input())
y1 = float(input())
x2 = float(input())
y2 = float(input())
side_1 = abs(x2 - x1)
side_2 = abs(y2 - y1)
area = side_1 * side_2
perimeter = 2 * (side_1 + side_2)
print(area)
print(perimeter) |
def fuel(x):
tot = 0
while True:
f = x//3 - 2
if f <= 0:
break
x = f
tot += f
return tot
input = """
123265
68442
94896
94670
145483
93807
88703
139755
53652
52754
128052
81533
56602
96476
87674
102510
95735
69174
136331
51266
148009
72417
52577
86813
60803
14923... | def fuel(x):
tot = 0
while True:
f = x // 3 - 2
if f <= 0:
break
x = f
tot += f
return tot
input = '\n123265\n68442\n94896\n94670\n145483\n93807\n88703\n139755\n53652\n52754\n128052\n81533\n56602\n96476\n87674\n102510\n95735\n69174\n136331\n51266\n148009\n72417\n5... |
#
# PySNMP MIB module CPQSTSYS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CPQSTSYS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:27:26 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,... | (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, single_value_constraint, constraints_intersection, value_range_constraint, constraints_union) ... |
def encoded_from_base10(number, base, digit_map):
'''
This function returns a string encoding in the "base" for the the "number" using the "digit_map"
Conditions that this function must satisfy:
- 2 <= base <= 36 else raise ValueError
- invalid base ValueError must have relevant information
- di... | def encoded_from_base10(number, base, digit_map):
"""
This function returns a string encoding in the "base" for the the "number" using the "digit_map"
Conditions that this function must satisfy:
- 2 <= base <= 36 else raise ValueError
- invalid base ValueError must have relevant information
- di... |
"""
Configuration file for Greedy Schedule Algorithm global variables
"""
FILE_TO_READ = "test_input.csv"
OUTPUT_FILE = "output.csv"
# Allowable overlap time in minutes
ALLOWABLE_OVERLAP = 23
# The limit of the total value number in hours
TOTAL_VALUE_LIMIT = 13
# List of column headers of columns w... | """
Configuration file for Greedy Schedule Algorithm global variables
"""
file_to_read = 'test_input.csv'
output_file = 'output.csv'
allowable_overlap = 23
total_value_limit = 13
parse_dates = ['Start', 'End'] |
#config.py
#Enable Flask"s debugging features. should be False in production
DEBUG = True | debug = True |
# Problem Statement: https://www.hackerrank.com/challenges/ginorts/problem
S = ''.join(sorted(input(), key=lambda x: (not x.islower(),
not x.isupper(),
not x in '13579',
x)))
print(S) | s = ''.join(sorted(input(), key=lambda x: (not x.islower(), not x.isupper(), not x in '13579', x)))
print(S) |
class InitCommands(object):
COPY = 'copy'
CREATE = 'create'
DELETE = 'delete'
@classmethod
def is_copy(cls, command):
return command == cls.COPY
@classmethod
def is_create(cls, command):
return command == cls.CREATE
@classmethod
def is_delete(cls, command):
... | class Initcommands(object):
copy = 'copy'
create = 'create'
delete = 'delete'
@classmethod
def is_copy(cls, command):
return command == cls.COPY
@classmethod
def is_create(cls, command):
return command == cls.CREATE
@classmethod
def is_delete(cls, command):
... |
hm_epoch = 5 # Number of epoch in training
lag_range = 1 # Lag range
lag_epoch_num = 1 # Number of epoch while finding lag
learning_rate = 0.001 # Default learning rate
| hm_epoch = 5
lag_range = 1
lag_epoch_num = 1
learning_rate = 0.001 |
#
# PySNMP MIB module NOKIA-HWM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NOKIA-HWM-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:23:29 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... | (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, constraints_union, constraints_intersection, single_value_constraint, value_range_constraint) ... |
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to ... | definition = {'type': 'table', 'displayName': 'TEST_Fire Period Table', 'outputFile': './FirePeriodTable.txt', 'constantVariable': 'TimePeriod', 'rowVariable': 'EditArea', 'columnVariable': 'WeatherElement', 'beginningText': 'Fire Period Table for %TimePeriod. \n\n', 'endingText': '', 'defaultEditAreas': [('area1', 'Ar... |
# 20
num = 1
for i in range(100):
num *= i + 1
print(sum(int(n) for n in str(num)))
| num = 1
for i in range(100):
num *= i + 1
print(sum((int(n) for n in str(num)))) |
#
# PySNMP MIB module ADIC-INTELLIGENT-STORAGE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ADIC-INTELLIGENT-STORAGE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:13:36 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python vers... | (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, value_range_constraint, single_value_constraint, constraints_intersection, constraints_union) ... |
description = 'Q range displaying devices'
group = 'lowlevel'
includes = ['detector', 'det1', 'sans1_det', 'alias_lambda']
devices = dict(
QRange = device('nicos_mlz.sans1.devices.resolution.Resolution',
description = 'Current q range',
detector = 'det1',
beamstop = 'bs1',
wavelen... | description = 'Q range displaying devices'
group = 'lowlevel'
includes = ['detector', 'det1', 'sans1_det', 'alias_lambda']
devices = dict(QRange=device('nicos_mlz.sans1.devices.resolution.Resolution', description='Current q range', detector='det1', beamstop='bs1', wavelength='wl', detpos='det1_z')) |
pkgname = "gsettings-desktop-schemas"
pkgver = "42.0"
pkgrel = 0
build_style = "meson"
configure_args = ["-Dintrospection=true"]
hostmakedepends = [
"meson", "pkgconf", "glib-devel", "gobject-introspection"
]
makedepends = ["libglib-devel"]
depends = [
"fonts-cantarell-otf", "fonts-source-code-pro-otf", "adwait... | pkgname = 'gsettings-desktop-schemas'
pkgver = '42.0'
pkgrel = 0
build_style = 'meson'
configure_args = ['-Dintrospection=true']
hostmakedepends = ['meson', 'pkgconf', 'glib-devel', 'gobject-introspection']
makedepends = ['libglib-devel']
depends = ['fonts-cantarell-otf', 'fonts-source-code-pro-otf', 'adwaita-icon-them... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
class GpioData:
_count = 0
_modNum = 8
_specMap = {}
_freqMap = {}
_mapList = []
_modeMap = {}
_smtMap = {}
_map_table = {}
def __init__(self):
self.__defMode = 0
self.__eintMode = False
self.__modeVec = ['0', '0', ... | class Gpiodata:
_count = 0
_mod_num = 8
_spec_map = {}
_freq_map = {}
_map_list = []
_mode_map = {}
_smt_map = {}
_map_table = {}
def __init__(self):
self.__defMode = 0
self.__eintMode = False
self.__modeVec = ['0', '0', '0', '0', '0', '0', '0', '0']
... |
class Solution:
def smallestRepunitDivByK(self, k: int) -> int:
if k % 2 == 0 or k % 5 == 0:
return -1
if k == 1:
return 1
count = 1
n = 1
while (n % k > 0):
n = (n % k) * 10 + 1
count += 1
return count
| class Solution:
def smallest_repunit_div_by_k(self, k: int) -> int:
if k % 2 == 0 or k % 5 == 0:
return -1
if k == 1:
return 1
count = 1
n = 1
while n % k > 0:
n = n % k * 10 + 1
count += 1
return count |
"""Exceptions for ocean_utils """
# Copyright 2018 Ocean Protocol Foundation
# SPDX-License-Identifier: Apache-2.0
class OceanInvalidContractAddress(Exception):
"""Raised when an invalid address is passed to the contract loader."""
class OceanDIDUnknownValueType(Exception):
"""Raised when a requested DI... | """Exceptions for ocean_utils """
class Oceaninvalidcontractaddress(Exception):
"""Raised when an invalid address is passed to the contract loader."""
class Oceandidunknownvaluetype(Exception):
"""Raised when a requested DID or a DID in the chain cannot be found."""
class Oceandidalreadyexist(Exception):
... |
class PiggyBank:
# create __init__ and add_money methods
def __init__(self, dollars, cents):
self.dollars = dollars
self.cents = cents
def add_money(self, deposit_dollars, deposit_cents):
self.dollars += deposit_dollars
self.cents += deposit_cents
if self.cents >= 10... | class Piggybank:
def __init__(self, dollars, cents):
self.dollars = dollars
self.cents = cents
def add_money(self, deposit_dollars, deposit_cents):
self.dollars += deposit_dollars
self.cents += deposit_cents
if self.cents >= 100:
to_dollar = int(self.cents /... |
class Solution:
def countAndSay(self, n: int) -> str:
s = '1'
for _ in range(1, n):
nextS = ''
countC = 1
for i in range(1, len(s) + 1):
if i == len(s) or s[i] != s[i - 1]:
nextS += str(countC) + s[i - 1]
cou... | class Solution:
def count_and_say(self, n: int) -> str:
s = '1'
for _ in range(1, n):
next_s = ''
count_c = 1
for i in range(1, len(s) + 1):
if i == len(s) or s[i] != s[i - 1]:
next_s += str(countC) + s[i - 1]
... |
def convert_to_int(integer_string_with_commas):
comma_separated_parts = integer_string_with_commas.split(",")
for i in range(len(comma_separated_parts)):
if len(comma_separated_parts[i]) > 3:
return None
if i != 0 and len(comma_separated_parts[i]) != 3:
return None
in... | def convert_to_int(integer_string_with_commas):
comma_separated_parts = integer_string_with_commas.split(',')
for i in range(len(comma_separated_parts)):
if len(comma_separated_parts[i]) > 3:
return None
if i != 0 and len(comma_separated_parts[i]) != 3:
return None
in... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""USB constant definitions.
"""
class DescriptorType(object):
"""Descriptor Types.
See Universal Serial Bus Specification Revision 2.0 Table 9-5.
"... | """USB constant definitions.
"""
class Descriptortype(object):
"""Descriptor Types.
See Universal Serial Bus Specification Revision 2.0 Table 9-5.
"""
device = 1
configuration = 2
string = 3
interface = 4
endpoint = 5
qualifier = 6
other_speed_configuration = 7
class Deviceclass(o... |
class Component:
def update(self):
return self
def print_to(self, x, y, media):
return media
| class Component:
def update(self):
return self
def print_to(self, x, y, media):
return media |
""" Python program for implementation of Quicksort Sort
This function takes last element as pivot, places
the pivot element at its correct position in sorted
array, and places all smaller (smaller than pivot)
to left of pivot and all greater elements to right
of pivot"""
def partition(arr, low, high):
... | """ Python program for implementation of Quicksort Sort
This function takes last element as pivot, places
the pivot element at its correct position in sorted
array, and places all smaller (smaller than pivot)
to left of pivot and all greater elements to right
of pivot"""
def partition(arr, low, high):
i = low... |
# CAPWATCH downloader config variables
## Copyright 2017 Marshall E. Giguere
##
## 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
... | uid = ''
passwd = ''
unit = 'NER-NH-001'
dl_filepath = ''
timeout = 5
dom_timeout = 50
batch = False |
class FakeCustomerRepository:
def __init__(self):
self.customers = []
def get_by_id(self, customer_id):
return next(
(customer for customer in self.customers if customer.id == customer_id),
None,
)
def get_by_email(self, email):
return next(
... | class Fakecustomerrepository:
def __init__(self):
self.customers = []
def get_by_id(self, customer_id):
return next((customer for customer in self.customers if customer.id == customer_id), None)
def get_by_email(self, email):
return next((customer for customer in self.customers if... |
#
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | class Runtimeconfig(object):
work_mode = None
job_queue = None
use_local_database = False
@staticmethod
def init_config(**kwargs):
for (k, v) in kwargs.items():
if hasattr(RuntimeConfig, k):
setattr(RuntimeConfig, k, v) |
#
# PySNMP MIB module CISCO-ENTITY-SENSOR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ENTITY-SENSOR-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:39:57 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 ... | (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, value_range_constraint, constraints_intersection, constraints_union, single_value_constraint) ... |
INSTALLED_APPS += (
'social_auth',
)
AUTHENTICATION_BACKENDS = (
'social_auth.backends.twitter.TwitterBackend',
'social_auth.backends.facebook.FacebookBackend',
'django.contrib.auth.backends.ModelBackend',
)
TEMPLATE_CONTEXT_PROCESSORS += (
'social_auth.context_processors.social_auth_backends',
... | installed_apps += ('social_auth',)
authentication_backends = ('social_auth.backends.twitter.TwitterBackend', 'social_auth.backends.facebook.FacebookBackend', 'django.contrib.auth.backends.ModelBackend')
template_context_processors += ('social_auth.context_processors.social_auth_backends', 'social_auth.context_processor... |
num_waves = 4
num_eqn = 5
# Conserved quantities
density = 0
x_momentum = 1
y_momentum = 2
energy = 3
tracer = 4
| num_waves = 4
num_eqn = 5
density = 0
x_momentum = 1
y_momentum = 2
energy = 3
tracer = 4 |
class Solution:
def circularArrayLoop(self, nums: List[int]) -> bool:
N = len(nums)
for i, num in enumerate(nums):
if num == 0: continue
cur = i
flag = num / abs(num)
seen = set()
while nums[cur] * flag > 0:
nx = (cur + nums... | class Solution:
def circular_array_loop(self, nums: List[int]) -> bool:
n = len(nums)
for (i, num) in enumerate(nums):
if num == 0:
continue
cur = i
flag = num / abs(num)
seen = set()
while nums[cur] * flag > 0:
... |
N, M = map(int, input().split())
for i in range(1, N, 2):
print(''.join(['.|.'] * i).center(M, '-'))
print("WELCOME".center(M, '-'))
for i in range(N-2, -1, -2):
print(''.join(['.|.'] * i).center(M, '-'))
| (n, m) = map(int, input().split())
for i in range(1, N, 2):
print(''.join(['.|.'] * i).center(M, '-'))
print('WELCOME'.center(M, '-'))
for i in range(N - 2, -1, -2):
print(''.join(['.|.'] * i).center(M, '-')) |
class SVGFilterInputs:
SourceGraphic = 'SourceGraphic'
SourceAlpha = 'SourceAlpha'
BackgroundImage = 'BackgroundImage'
BackgroundAlpha = 'BackgroundAlpha'
FillPaint = 'FillPaint'
StrokePaint = 'StrokePaint'
class SVGFilter:
def __init__(self, svg):
self.svg = svg
def render... | class Svgfilterinputs:
source_graphic = 'SourceGraphic'
source_alpha = 'SourceAlpha'
background_image = 'BackgroundImage'
background_alpha = 'BackgroundAlpha'
fill_paint = 'FillPaint'
stroke_paint = 'StrokePaint'
class Svgfilter:
def __init__(self, svg):
self.svg = svg
def ren... |
#coding:utf-8
bind = 'unix:/var/run/gunicorn.sock'
workers = 4
# you should change this
user = 'root'
# maybe you like error
loglevel = 'warning'
errorlog = '-'
secure_scheme_headers = {
'X-SCHEME': 'https',
}
x_forwarded_for_header = 'X-FORWARDED-FOR'
### gunicorn -c settings.py -b 0.0.0.0:9000 wsgi:app
| bind = 'unix:/var/run/gunicorn.sock'
workers = 4
user = 'root'
loglevel = 'warning'
errorlog = '-'
secure_scheme_headers = {'X-SCHEME': 'https'}
x_forwarded_for_header = 'X-FORWARDED-FOR' |
def get_count_A_C_G_and_T_in_string(dna_string):
'''
Create a function named get_count_A_C_G_and_T_in_string with a parameter named dna_string.
:param dna_string: a DNA string
:return: the count of As, Cs, Gs, and Ts in the dna_string
'''
A_count=0
C_count=0
G_count=0
T_count=0
... | def get_count_a_c_g_and_t_in_string(dna_string):
"""
Create a function named get_count_A_C_G_and_T_in_string with a parameter named dna_string.
:param dna_string: a DNA string
:return: the count of As, Cs, Gs, and Ts in the dna_string
"""
a_count = 0
c_count = 0
g_count = 0
t_count ... |
for i in range(10):
a = i
print(a)
| for i in range(10):
a = i
print(a) |
# LeetCode 897. Increasing Order Search Tree `E`
# 1sk | 89% | 19'
# A~0v10
# 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 increasingBST(self, root: T... | class Solution:
def increasing_bst(self, root: TreeNode) -> TreeNode:
ans = self.tree = tree_node(None)
self.inorder(root)
return ans.right
def inorder(self, node):
if not node:
return
self.inorder(node.left)
node.left = None
self.tree.right ... |
# -*- coding: utf-8 -*-
class Saludo(object):
"""docstring for Saludo"""
def __init__(self):
super(Saludo, self).__init__()
print('\n Estoy saludando ..')
Saludo()
| class Saludo(object):
"""docstring for Saludo"""
def __init__(self):
super(Saludo, self).__init__()
print('\n Estoy saludando ..')
saludo() |
# Python program to print positive Numbers in a List
# list of numbers
list1 = [10, -21, 4, -45, -66, -93]
# using list comprehension
positive_nos = [num for num in list1 if num <= 0]
print("positive numbers in the list: ", positive_nos)
# Remove multiple elements from list
l = [3, 5, 7, 4, 8, 4, 3]
l.sort()
pri... | list1 = [10, -21, 4, -45, -66, -93]
positive_nos = [num for num in list1 if num <= 0]
print('positive numbers in the list: ', positive_nos)
l = [3, 5, 7, 4, 8, 4, 3]
l.sort()
print('l=', l)
l = [1, 2, 3, 4]
l.reverse()
print(l) |
# nested try's
try:
print("try 1")
try:
print("try 2")
foo()
except:
print("except 2")
bar()
except:
print("except 1")
try:
print("try 1")
try:
print("try 2")
foo()
except TypeError:
print("except 2")
bar()
except NameError:
print... | try:
print('try 1')
try:
print('try 2')
foo()
except:
print('except 2')
bar()
except:
print('except 1')
try:
print('try 1')
try:
print('try 2')
foo()
except TypeError:
print('except 2')
bar()
except NameError:
print('except 1')
def... |
__all__ = [
'fullname',
'starts_with'
]
# https://stackoverflow.com/questions/2020014/get-fully-qualified-class-name-of-an-object-in-python
def fullname(o):
if o is None:
return None
module = o.__class__.__module__
if module is None or module == str.__class__.__module__:
return o... | __all__ = ['fullname', 'starts_with']
def fullname(o):
if o is None:
return None
module = o.__class__.__module__
if module is None or module == str.__class__.__module__:
return o.__class__.__name__
else:
return module + '.' + o.__class__.__name__
def starts_with(collection, tex... |
config_prefix = '='
config_description = 'Use =help to get started!'
config_owner_id = 311661241406062592
config_bot_log_channel = 741486105173688351
config_command_log_channel = 741486105173688351
config_error_log_channel = 741486105173688351
config_guild_log_channel = 741486105173688351
| config_prefix = '='
config_description = 'Use =help to get started!'
config_owner_id = 311661241406062592
config_bot_log_channel = 741486105173688351
config_command_log_channel = 741486105173688351
config_error_log_channel = 741486105173688351
config_guild_log_channel = 741486105173688351 |
#Number analysis program
NUMBER_SERIES = 20
def main():
#here is the mathematical algorithm/code
numbers = get_numbers()
total = calculate_total(numbers)
average = total / len(numbers)
highest_number = max(numbers)
lowest_number = min(numbers)
print()
print_details(numbers,total,averag... | number_series = 20
def main():
numbers = get_numbers()
total = calculate_total(numbers)
average = total / len(numbers)
highest_number = max(numbers)
lowest_number = min(numbers)
print()
print_details(numbers, total, average, highest_number, lowest_number)
def get_numbers():
number_list... |
def eastern_boundaries(lon,lat):
m = Basemap(projection='cyl')
boundaries = []
last_l_is_land = m.is_land(lon[0],lat)
for l in lon[1:]:
current_l_is_land = m.is_land(l,lat)
if last_l_is_land and not current_l_is_land:
boundaries.append(l)
last_l_is_land = current_l_is... | def eastern_boundaries(lon, lat):
m = basemap(projection='cyl')
boundaries = []
last_l_is_land = m.is_land(lon[0], lat)
for l in lon[1:]:
current_l_is_land = m.is_land(l, lat)
if last_l_is_land and (not current_l_is_land):
boundaries.append(l)
last_l_is_land = current... |
def counter(start, stop):
x=start
if start>stop:
return_string = "Counting down: "
while x != stop:
return_string += str(x)
if x!=stop:
return_string += ","
else:
return_string = "Counting up: "
while x !=stop:
return_string += str(x)
... | def counter(start, stop):
x = start
if start > stop:
return_string = 'Counting down: '
while x != stop:
return_string += str(x)
if x != stop:
return_string += ','
else:
return_string = 'Counting up: '
while x != stop:
return... |
number = 9
print(type(number)) # print type of variable "number"
float_number = 9.0
print(float_number)
print(int(float_number))
| number = 9
print(type(number))
float_number = 9.0
print(float_number)
print(int(float_number)) |
""" This file contains temporary hard-coded holiday overrides that are not in Workalendar.
It is only intended to be temporary, and Workalendar should be updated to hold the
"correct" dates as the source of truth. """
OVERRIDES = {} | """ This file contains temporary hard-coded holiday overrides that are not in Workalendar.
It is only intended to be temporary, and Workalendar should be updated to hold the
"correct" dates as the source of truth. """
overrides = {} |
# https://www.codechef.com/problems/FLOW005
for T in range(int(input())):
a,n,s = [100,50,10,5,2,1],int(input()),0
for i in a: s,n = s+(n//i),n%i
print(s) | for t in range(int(input())):
(a, n, s) = ([100, 50, 10, 5, 2, 1], int(input()), 0)
for i in a:
(s, n) = (s + n // i, n % i)
print(s) |
def fibonacci(num):
if num < 0:
print("Make it a positive number")
elif num == 1:
return 0
elif num == 2:
return 1
else:
return fibonacci(num-1)+fibonacci(num-2)
| def fibonacci(num):
if num < 0:
print('Make it a positive number')
elif num == 1:
return 0
elif num == 2:
return 1
else:
return fibonacci(num - 1) + fibonacci(num - 2) |
def close2zero(t):
try:
i,j = sorted(map(int, set(t.split())),
key = lambda x: abs(int(x)))[:2]
return max(i,j) if abs(i)==abs(j) else i
except:
return 0
| def close2zero(t):
try:
(i, j) = sorted(map(int, set(t.split())), key=lambda x: abs(int(x)))[:2]
return max(i, j) if abs(i) == abs(j) else i
except:
return 0 |
styleDict = {
'clear': f'\033[0m',
'bold': f'\033[1m',
'dim': f'\033[2m',
'italic': f'\033[3m',
'underline': f'\033[4m',
'blinking': f'\033[5m',
'anarch': f'\033[38;2;255;106;51m',
'criminal': f'\033[38;2;65;105;255m',
'shaper': f'\033[38;2;50;205;50m',
'haas-bioroid': f'\033[3... | style_dict = {'clear': f'\x1b[0m', 'bold': f'\x1b[1m', 'dim': f'\x1b[2m', 'italic': f'\x1b[3m', 'underline': f'\x1b[4m', 'blinking': f'\x1b[5m', 'anarch': f'\x1b[38;2;255;106;51m', 'criminal': f'\x1b[38;2;65;105;255m', 'shaper': f'\x1b[38;2;50;205;50m', 'haas-bioroid': f'\x1b[38;2;138;43;226m', 'jinteki': f'\x1b[38;2;2... |
DB_HOST = 'localhost'
DB_PORT = 5432
DB_USER = 'platappform'
DB_PASSWORD = 'development'
DB_DATABASE = 'platappform_dev'
DB_POOL_MIN_SIZE = 5 #default
DB_POOL_MAX_SIZE = 10 #default
| db_host = 'localhost'
db_port = 5432
db_user = 'platappform'
db_password = 'development'
db_database = 'platappform_dev'
db_pool_min_size = 5
db_pool_max_size = 10 |
"""
200. Number of Islands
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.
Example 1:
Input:
11110
11010
1100... | """
200. Number of Islands
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.
Example 1:
Input:
11110
11010
1100... |
class Component:
def __init__(self, position):
self.position = position
self.dirty = True
self.focus = False
def update(self, screen):
if self.dirty:
screen.blit(self.surface, self.position)
self.dirty = False
| class Component:
def __init__(self, position):
self.position = position
self.dirty = True
self.focus = False
def update(self, screen):
if self.dirty:
screen.blit(self.surface, self.position)
self.dirty = False |
#
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
#
# get the configuration propertie... | params = {'url': configuration.url, 'username': configuration.username, 'password': configuration.password, 'proxyHost': configuration.proxyHost, 'proxyPort': configuration.proxyPort, 'proxyUsername': configuration.proxyUsername, 'proxyPassword': configuration.proxyPassword}
response = http_request(params).get('/api/v4... |
title = ' MULTIPLICATION TABLES '
line = len(title) * '-'
print('{}\n{}'.format(title, line))
for x in range(1,13):
for i in range(1,13):
f = i
i = i * x
print(' {} x {} = {}'.format(x,f,i))
print('')
| title = ' MULTIPLICATION TABLES '
line = len(title) * '-'
print('{}\n{}'.format(title, line))
for x in range(1, 13):
for i in range(1, 13):
f = i
i = i * x
print(' {} x {} = {}'.format(x, f, i))
print('') |
def list_view(tree):
print("Listing\n")
movies = tree.list_by_name()
if movies:
print("Every movie in tree:")
for movie in movies:
print(movie)
else:
print("Empty tree.")
input("ENTER to continue")
| def list_view(tree):
print('Listing\n')
movies = tree.list_by_name()
if movies:
print('Every movie in tree:')
for movie in movies:
print(movie)
else:
print('Empty tree.')
input('ENTER to continue') |
class GameObject:
def __init__(self, id, bounds_offsets, width, height, pos_x, pos_y, speed):
self.id = id
self.bounds_offsets = bounds_offsets
self.bounds = []
for offset_array in bounds_offsets:
self.bounds.append({})
self.width = width # In meters
... | class Gameobject:
def __init__(self, id, bounds_offsets, width, height, pos_x, pos_y, speed):
self.id = id
self.bounds_offsets = bounds_offsets
self.bounds = []
for offset_array in bounds_offsets:
self.bounds.append({})
self.width = width
self.height = he... |
#
# Copyright (c) 2017-2018 Joy Diamond. All rights reserved.
#
@gem('Sapphire.UnaryExpression')
def gem():
require_gem('Sapphire.Tree')
@share
class UnaryExpression(SapphireTrunk):
__slots__ = ((
'a', # Expression
))
class_order = ... | @gem('Sapphire.UnaryExpression')
def gem():
require_gem('Sapphire.Tree')
@share
class Unaryexpression(SapphireTrunk):
__slots__ = ('a',)
class_order = CLASS_ORDER__UNARY_EXPRESSION
is_colon = false
is_special_operator = false
def __init__(t, a):
t.a = a
... |
list_of_lists = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']]
string = ''
for l in list_of_lists:
max_i = len(l)
for i in range(len(l)):
if i < max_i - 1:
string += l[i]+','
else:
string += l[i]+'\n'
print(string)
| list_of_lists = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']]
string = ''
for l in list_of_lists:
max_i = len(l)
for i in range(len(l)):
if i < max_i - 1:
string += l[i] + ','
else:
string += l[i] + '\n'
print(string) |
# encoding: utf-8
# module _functools
# from (built-in)
# by generator 1.145
""" Tools that operate on functions. """
# no imports
# functions
def cmp_to_key(*args, **kwargs): # real signature unknown
""" Convert a cmp= function into a key= function. """
pass
def reduce(function, sequence, initial=None): # r... | """ Tools that operate on functions. """
def cmp_to_key(*args, **kwargs):
""" Convert a cmp= function into a key= function. """
pass
def reduce(function, sequence, initial=None):
"""
reduce(function, sequence[, initial]) -> value
Apply a function of two arguments cumulatively to the items of ... |
quant = int(input())
for c in range(quant):
num_estudantes = int(input())
nomes = input().split(' ')
registro = input().split(' ')
reprovados = []
contador = 0
for frequencia in registro:
media = 0
tam = len(frequencia)
for letra in frequencia:
if letra == "P"... | quant = int(input())
for c in range(quant):
num_estudantes = int(input())
nomes = input().split(' ')
registro = input().split(' ')
reprovados = []
contador = 0
for frequencia in registro:
media = 0
tam = len(frequencia)
for letra in frequencia:
if letra == 'P'... |
# -*- coding: utf8 -*-
# Copyright (c) 2020 Nicholas de Jong
__title__ = "arpwitch"
__author__ = "Nicholas de Jong <contact@nicholasdejong.com>"
__version__ = '0.3.9'
__license__ = "BSD2"
__logger_default_level__ = 'info'
__sniff_batch_size__ = 16
__sniff_batch_timeout__ = 2
__save_data_interval__default__ = 30
__nm... | __title__ = 'arpwitch'
__author__ = 'Nicholas de Jong <contact@nicholasdejong.com>'
__version__ = '0.3.9'
__license__ = 'BSD2'
__logger_default_level__ = 'info'
__sniff_batch_size__ = 16
__sniff_batch_timeout__ = 2
__save_data_interval__default__ = 30
__nmap__exec__ = 'nmap -n -T4 -Pn -oX ' + __title__ + '-nmap-{IP}-{t... |
category_dict_icml15 = {
"Bandit Learning" : [["Bandits"]],
"Bayesian Nonparametrics" : [["Baysian Nonparametrics"]],
"Bayesian Optimization" : [["Optimization"], ["Baysian Optimization"]],
"Causality" : [["Causality"]],
"Clustering" : [["Clustering"]],
"Computational Advertising And Social Scie... | category_dict_icml15 = {'Bandit Learning': [['Bandits']], 'Bayesian Nonparametrics': [['Baysian Nonparametrics']], 'Bayesian Optimization': [['Optimization'], ['Baysian Optimization']], 'Causality': [['Causality']], 'Clustering': [['Clustering']], 'Computational Advertising And Social Science': [['Computational Adverti... |
class Solution:
def subsets(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
result = []
ln = len(nums)
selectors = [0] * ln
for time in range(2 ** ln):
# Append new Item
result_item = []
for index,... | class Solution:
def subsets(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
result = []
ln = len(nums)
selectors = [0] * ln
for time in range(2 ** ln):
result_item = []
for (index, selector) in enumerate(sele... |
# --------------------------------------
# CSCI 127, Lab 4
# May 29, 2020
# Your Name
# --------------------------------------
def process_season(season, games_played, points_earned):
print("Season: " + str(season) + ", Games Played: " + str(games_played) +
", Points earned: " + str(points_earned... | def process_season(season, games_played, points_earned):
print('Season: ' + str(season) + ', Games Played: ' + str(games_played) + ', Points earned: ' + str(points_earned))
print('Possible Win-Tie-Loss Records')
print('-----------------------------')
pass
print()
def process_seasons(seasons):
p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.