content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
nombreFichero = "fases.txt";
print("Ingresa los datos solicitados");
f1 = input("Ingresa la primera frase: ");
f2 = input("Ingresa la segunda frase: ");
f3 = input("Ingresa la tercera frase: ");
fichero = open(nombreFichero, "w");
fichero.write("%s\n" % f1);
fichero.write("%s\n" % f2);
fichero.write("%s\n" % f3);
fic... | nombre_fichero = 'fases.txt'
print('Ingresa los datos solicitados')
f1 = input('Ingresa la primera frase: ')
f2 = input('Ingresa la segunda frase: ')
f3 = input('Ingresa la tercera frase: ')
fichero = open(nombreFichero, 'w')
fichero.write('%s\n' % f1)
fichero.write('%s\n' % f2)
fichero.write('%s\n' % f3)
fichero.close... |
expected_output = {
"rollback_timer_reason": "no ISSU operation is in progress",
"rollback_timer_state": "inactive",
}
| expected_output = {'rollback_timer_reason': 'no ISSU operation is in progress', 'rollback_timer_state': 'inactive'} |
class VerificateInterface:
def __init__(self, inputfile, outputfile, correctoutput):
self.inputfile = inputfile
self.outputfile = outputfile
self.correctoutput = correctoutput
self._status = None
self._message = None
def verificate(self, isolator):
raise NotImple... | class Verificateinterface:
def __init__(self, inputfile, outputfile, correctoutput):
self.inputfile = inputfile
self.outputfile = outputfile
self.correctoutput = correctoutput
self._status = None
self._message = None
def verificate(self, isolator):
raise NotImpl... |
haarcascade_frontalface_Path = "./faceApi/models/OpenCV/haarcascade_frontalface_default.xml" # for cascade method
# 8 bit Quantized version using Tensorflow ( 2.7 MB )
TFmodelFile = "./faceApi/models/OpenCV/tensorflow/TF_faceDetectorModel_uint8.pb"
TFconfigFile = "./faceApi/models/OpenCV/tensorflow/TF_faceDetectorCon... | haarcascade_frontalface__path = './faceApi/models/OpenCV/haarcascade_frontalface_default.xml'
t_fmodel_file = './faceApi/models/OpenCV/tensorflow/TF_faceDetectorModel_uint8.pb'
t_fconfig_file = './faceApi/models/OpenCV/tensorflow/TF_faceDetectorConfig.pbtxt'
caff_emodel_file = './faceApi/models/OpenCV/caffe/FaceDetect_... |
# Series data
tune_series = ["open", "high", "low", "close", "volume"]
# Parameters to tune
tune_params = [
"acceleration",
"accelerationlong",
"accelerationshort",
"atr_length",
"atr_period",
"average_lenght",
"average_length",
"bb_length",
"channel_lenght",
"channel_length",
... | tune_series = ['open', 'high', 'low', 'close', 'volume']
tune_params = ['acceleration', 'accelerationlong', 'accelerationshort', 'atr_length', 'atr_period', 'average_lenght', 'average_length', 'bb_length', 'channel_lenght', 'channel_length', 'chikou_period', 'd', 'ddof', 'ema_fast', 'ema_slow', 'er', 'fast', 'fast_peri... |
"""Data creating and managing."""
def file2text(filepath, verbose=True):
"""Read all lines of a file into a string.
Note that we destroy all the new line characters
and all the whitespace charecters on both ends
of the line. Note that this is very radical
for source code of progra... | """Data creating and managing."""
def file2text(filepath, verbose=True):
"""Read all lines of a file into a string.
Note that we destroy all the new line characters
and all the whitespace charecters on both ends
of the line. Note that this is very radical
for source code of program... |
class UltrasonicRegisterTypes:
CONFIG = 0
DATA = 1
UltrasonicA1 = {
UltrasonicRegisterTypes.CONFIG: 0x0C,
UltrasonicRegisterTypes.DATA: 0x0E,
}
UltrasonicA3 = {
UltrasonicRegisterTypes.CONFIG: 0x0D,
UltrasonicRegisterTypes.DATA: 0x0F,
}
UltrasonicRegisters = {
"A1": UltrasonicA1,
"A... | class Ultrasonicregistertypes:
config = 0
data = 1
ultrasonic_a1 = {UltrasonicRegisterTypes.CONFIG: 12, UltrasonicRegisterTypes.DATA: 14}
ultrasonic_a3 = {UltrasonicRegisterTypes.CONFIG: 13, UltrasonicRegisterTypes.DATA: 15}
ultrasonic_registers = {'A1': UltrasonicA1, 'A3': UltrasonicA3}
ultrasonic_config_setti... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | class Kcharactertype(object):
"""
Const Class
Constants to identify the character type.
Returned by XCharacterClassification.getCharacterType() and XCharacterClassification.getStringType()
See Also:
`API KCharacterType <https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1s... |
expected_output = {
'vrf': {
'default': {
'address_family': {
'ipv6': {
'routes': {
'2001:db8:1234::8/128': {
'active': True,
'metric': 1,
'next_hop':... | expected_output = {'vrf': {'default': {'address_family': {'ipv6': {'routes': {'2001:db8:1234::8/128': {'active': True, 'metric': 1, 'next_hop': {'next_hop_list': {1: {'index': 1, 'next_hop': 'fe80::5054:ff:fef2:a625', 'outgoing_interface': 'GigabitEthernet0/0/0/1', 'updated': '00:03:00'}}}, 'route': '2001:db8:1234::8/1... |
DNA_TO_RNA_MAPPER = {
'G' : 'C',
'C' : 'G',
'T' : 'A',
'A' : 'U'
}
def to_rna(dna_strand):
return ''.join([DNA_TO_RNA_MAPPER[letter] for letter in dna_strand])
| dna_to_rna_mapper = {'G': 'C', 'C': 'G', 'T': 'A', 'A': 'U'}
def to_rna(dna_strand):
return ''.join([DNA_TO_RNA_MAPPER[letter] for letter in dna_strand]) |
#program to check whether a given integer is a palindrome or not.
def is_Palindrome(n):
return str(n) == str(n)[::-1]
print(is_Palindrome(100))
print(is_Palindrome(252))
print(is_Palindrome(-838))
print(is_Palindrome('swims'))
print(is_Palindrome(1001)) | def is__palindrome(n):
return str(n) == str(n)[::-1]
print(is__palindrome(100))
print(is__palindrome(252))
print(is__palindrome(-838))
print(is__palindrome('swims'))
print(is__palindrome(1001)) |
class CardType(object):
NUMBER_CARD = 'number_card'
PLUS = 'plus'
PLUS_2 = 'plus_2'
STOP = 'stop'
CHANGE_DIRECTION = 'change_direction'
CHANGE_COLOR = 'change_color'
TAKI = 'taki'
SUPER_TAKI = 'super_taki'
| class Cardtype(object):
number_card = 'number_card'
plus = 'plus'
plus_2 = 'plus_2'
stop = 'stop'
change_direction = 'change_direction'
change_color = 'change_color'
taki = 'taki'
super_taki = 'super_taki' |
# Values.
name = "Monty"
order = [
{"qty": 1, "name": "Widget"},
{"qty": 3, "name": "Carpets"}
]
# Our home-grown template language, based on
# Python's string format syntax.
fancy_templ = """
Hello {name},
You ordered:
{{ for item in order }}
* {item[qty]} x {item[name]}
{{ endfor }}
Thank you.
"""
def form... | name = 'Monty'
order = [{'qty': 1, 'name': 'Widget'}, {'qty': 3, 'name': 'Carpets'}]
fancy_templ = '\nHello {name},\nYou ordered:\n{{ for item in order }}\n* {item[qty]} x {item[name]}\n{{ endfor }}\nThank you.\n'
def format_template(template: str, values: dict) -> str:
"""
Function to process `for` loops in o... |
# The tail of the list uses its next reference to point back to the head of the
# list.
class CircularQueue:
"""Queue implementation using circular linked list for storage."""
class _Node:
"""Lightweight, nonpublic class for storing a singly linked node."""
__slot__ = '_element', '_next'
... | class Circularqueue:
"""Queue implementation using circular linked list for storage."""
class _Node:
"""Lightweight, nonpublic class for storing a singly linked node."""
__slot__ = ('_element', '_next')
def __init__(self, element, next):
self._element = element
... |
#Define Class
class Student:
__name = ""
__math = 0
__science = 0
__english = 0
__grade_average = 0
__grade_status = ""
__status = True
def __init__(self, name, math, science, english):
try:
self.__name = str(name)
self.__math = float(math)
... | class Student:
__name = ''
__math = 0
__science = 0
__english = 0
__grade_average = 0
__grade_status = ''
__status = True
def __init__(self, name, math, science, english):
try:
self.__name = str(name)
self.__math = float(math)
self.__science =... |
"""
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
"""
def get_rows_and_columns(sparql_results):
if type(sparql_results) is not dict:
return None
if 'head' in sparql_results and 'vars' in sparql_results['head'] and 'results' in sparql_results an... | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
"""
def get_rows_and_columns(sparql_results):
if type(sparql_results) is not dict:
return None
if 'head' in sparql_results and 'vars' in sparql_results['head'] and ('results' in sparql_results) an... |
# Databricks notebook source
# MAGIC %md # CCU002_03-D02-patient_skinny_unassembled
# MAGIC
# MAGIC **Description** Gather together the records for each patient in primary and secondary care before they are assembled into a skinny record for CCU002. The output of this is a global temp View which is then used by **CCU0... | hes_apc_data = 'ccu002_03_hes_apc_all_years'
hes_op_data = 'ccu002_03_hes_op_all_years'
hes_ae_data = 'ccu002_03_hes_ae_all_years'
gdppr_data = 'ccu002_03_gdppr_dars_nic_391419_j3w9t'
deaths_data = 'ccu002_03_deaths_dars_nic_391419_j3w9t'
dbutils.widgets.removeAll()
(database_name, collab_database_name, datawrang_datab... |
def sync_consume():
while True:
print(q.get())
q.task_done()
def sync_produce():
consumer = Thread(target=sync_consume, daemon=True)
consumer.start()
for i in range(10):
q.put(i)
q.join()
sync_produce() | def sync_consume():
while True:
print(q.get())
q.task_done()
def sync_produce():
consumer = thread(target=sync_consume, daemon=True)
consumer.start()
for i in range(10):
q.put(i)
q.join()
sync_produce() |
list1 = [15, -1, 11, -5, -5, 5, 3, -1, -7, 13, -11, -11, 7, 13] # Base list
even_list = [] # Creates blank list
# Problem 3 code
for i in list1: # Iterates through list1 assigning i to the next value each time through
if i % 2 == 0: # If 'i' is divisible by 2 (even) then:
even_list.append(i) # Add the... | list1 = [15, -1, 11, -5, -5, 5, 3, -1, -7, 13, -11, -11, 7, 13]
even_list = []
for i in list1:
if i % 2 == 0:
even_list.append(i)
print(even_list)
smallest = even_list[0]
for x in even_list:
if x < smallest:
smallest = x
else:
pass
print(smallest) |
#* Asked in Microsoft
#? You 2 integers n and m representing an n by m grid, determine the number of ways you can get
#? from the top-left to the bottom-right of the matrix y going only right or down.
#? Example:
#? n = 2, m = 2
#? This should return 2, since the only possible routes are:
#? Right, down
... | def num_ways(n, m):
if n == 1 or m == 1:
return 1
else:
count = 0
count += num_ways(n - 1, m)
count += num_ways(n, m - 1)
return count
def num_ways_hm(n, m):
hash = [[0 for i in range(m + 1)] for j in range(n + 1)]
return nw(n, m, hash)
def nw(n, m, hash):
i... |
class Solution:
def wordBreak(self, s, wordDict):
"""
:type s: str
:type wordDict: List[str]
:rtype: bool
"""
dp = [False] * (len(s) + 1)
dp[0] = True
for i in range(0, len(s)):
if dp[i]:
for word in wordDict:
... | class Solution:
def word_break(self, s, wordDict):
"""
:type s: str
:type wordDict: List[str]
:rtype: bool
"""
dp = [False] * (len(s) + 1)
dp[0] = True
for i in range(0, len(s)):
if dp[i]:
for word in wordDict:
... |
#
# PySNMP MIB module Juniper-IPsec-Tunnel-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-IPsec-Tunnel-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:03:12 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.... | (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, value_size_constraint, value_range_constraint, single_value_constraint, constraints_intersection) ... |
# -*- coding: utf-8 -*-
"""
OCR Utility Functions
@author: Shiv Deepak <idlecool@gmail.com>
"""
# Store ocr metadata into the database
#def shn_ocr_store_metadata(source, filename, comment):
# module = "doc"
# resourcename = "document"
# tablename = "%s_%s" % (module, resourcename)
# stream = St... | """
OCR Utility Functions
@author: Shiv Deepak <idlecool@gmail.com>
"""
def shn_ocr_downloadpdf(tablename):
""" Generate 'Print PDF' button in the view """
try:
formelements = []
pdfenable = 1
directprint = 0
formelementsls = ['en', 'es']
if len(formelementsls) ... |
"""Print all the multiplication tables with numbers from 1 to 10"""
def solution() -> None:
for n in range(11):
multiplicand = n
for i in range(11):
multiplier = i
print(f'{multiplicand} x {multiplier} = {multiplicand * multiplier}')
print()
solution()
| """Print all the multiplication tables with numbers from 1 to 10"""
def solution() -> None:
for n in range(11):
multiplicand = n
for i in range(11):
multiplier = i
print(f'{multiplicand} x {multiplier} = {multiplicand * multiplier}')
print()
solution() |
# coding:utf-8
"""
Name : __init__.py.py
Author : blu
Time : 2022/3/7 17:39
Desc :
"""
| """
Name : __init__.py.py
Author : blu
Time : 2022/3/7 17:39
Desc :
""" |
n = int(input())
give = list(map(int, input().split()))
take = [0]*n
for i in range(n):
take[i] = give.index(i+1) + 1
print(*take, sep = " ") | n = int(input())
give = list(map(int, input().split()))
take = [0] * n
for i in range(n):
take[i] = give.index(i + 1) + 1
print(*take, sep=' ') |
"""Sphinx configuration."""
project = "example-package-lth"
author = "Le Tuan Hai"
copyright = f"2022, {author}"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx_autodoc_typehints",
]
| """Sphinx configuration."""
project = 'example-package-lth'
author = 'Le Tuan Hai'
copyright = f'2022, {author}'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx_autodoc_typehints'] |
class FailedToSendMessage(Exception):
""""""
class CannotSendMessages(Exception):
""""""
class Forbidden(Exception):
""""""
class RedisNotConnected(RuntimeError):
""""""
| class Failedtosendmessage(Exception):
""""""
class Cannotsendmessages(Exception):
""""""
class Forbidden(Exception):
""""""
class Redisnotconnected(RuntimeError):
"""""" |
count = 0
while True:
index = int(input())
if index == 0: break
aldo, beto = 0, 0
count += 1
for i in range(index):
x, y = map(int, input().split(' '))
beto += y
aldo += x
print("Teste %d" % count)
if beto > aldo:
print("Beto\n")
else:
print("Aldo\n") | count = 0
while True:
index = int(input())
if index == 0:
break
(aldo, beto) = (0, 0)
count += 1
for i in range(index):
(x, y) = map(int, input().split(' '))
beto += y
aldo += x
print('Teste %d' % count)
if beto > aldo:
print('Beto\n')
else:
... |
#
# Copyright (c) 2017-2018 Joy Diamond. All rights reserved.
#
@gem('Pearl.Atom')
def gem():
require_gem('Pearl.ClassOrder')
require_gem('Pearl.Method')
require_gem('Pearl.Nub')
lookup_atom = lookup_normal_token
provide_atom = provide_normal_token
def count_newlines__zero(t):
as... | @gem('Pearl.Atom')
def gem():
require_gem('Pearl.ClassOrder')
require_gem('Pearl.Method')
require_gem('Pearl.Nub')
lookup_atom = lookup_normal_token
provide_atom = provide_normal_token
def count_newlines__zero(t):
assert t.ends_in_newline is t.line_marker is false and t.newlines is 0
... |
class Nanote():
"""Implementation of some Nanote logic in python for server-side validation"""
sikrit = 895175784877
charsets = [" etaoinsrhl"," 1234567890"," 1234567890'"," etaoinsrhl'"," 1234567890'"," etaoinsrhl'"," 1234567890'"," etaoinsrhl'"," 1234567890]"," etaoinsrhl]"," 1234567890["," etaoinsrhl[","... | class Nanote:
"""Implementation of some Nanote logic in python for server-side validation"""
sikrit = 895175784877
charsets = [' etaoinsrhl', ' 1234567890', " 1234567890'", " etaoinsrhl'", " 1234567890'", " etaoinsrhl'", " 1234567890'", " etaoinsrhl'", ' 1234567890]', ' etaoinsrhl]', ' 1234567890[', ' etaoi... |
def gaussianQuadrature(function, a, b):
"""
Perform a Gaussian quadrature approximation of the integral of a function
from a to b.
"""
# Coefficient values can be found at pomax.github.io/bezierinfo/legendre-gauss.html
A = (b - a)/2
B = (b + a)/2
return A * (
0.2955242247147529*function(-A*0.1488743389816312 ... | def gaussian_quadrature(function, a, b):
"""
Perform a Gaussian quadrature approximation of the integral of a function
from a to b.
"""
a = (b - a) / 2
b = (b + a) / 2
return A * (0.2955242247147529 * function(-A * 0.1488743389816312 + B) + 0.2955242247147529 * function(+A * 0.1488743389816312 + B) +... |
routes = []
def list_gizmos():
return 'Listing Gizmos'
routes.append(dict(
rule='/gizmos',
view_func=list_gizmos))
def add_gizmo():
return 'Add Gizmo'
routes.append(dict(
rule='/gizmo',
view_func=add_gizmo,
options=dict(methods=['POST'])))
def update_gizmo():
return 'Update Gizmo'
rou... | routes = []
def list_gizmos():
return 'Listing Gizmos'
routes.append(dict(rule='/gizmos', view_func=list_gizmos))
def add_gizmo():
return 'Add Gizmo'
routes.append(dict(rule='/gizmo', view_func=add_gizmo, options=dict(methods=['POST'])))
def update_gizmo():
return 'Update Gizmo'
routes.append(dict(rule='... |
SOFTWARE_DEVELOPMENT = "Software Development"
ELECTRICAL_ENGINEERING = "Electrical Engineering"
IT_OPERATIONS = "IT Operations & Helpdesk"
INFORMATION_DESIGN_AND_DOCUMENTATION = "Information Design & Documentation"
PROJECT_MANAGEMENT = "Project Management"
| software_development = 'Software Development'
electrical_engineering = 'Electrical Engineering'
it_operations = 'IT Operations & Helpdesk'
information_design_and_documentation = 'Information Design & Documentation'
project_management = 'Project Management' |
N, *p = map(int, open(0).read().split())
for x in p:
if x == 2:
print(2)
else:
print((x - 1) * (x - 1))
| (n, *p) = map(int, open(0).read().split())
for x in p:
if x == 2:
print(2)
else:
print((x - 1) * (x - 1)) |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 14 16:20:05 2020
@author: Ashish
"""
friends = ["Rolf", "Bob", "Jen"]
print("Jen" in friends)
# --
movies_watched = {"The Matrix", "Green Book", "Her"}
user_movie = input("Enter something you've watched recently: ")
print(user_movie in movies_watched)... | """
Created on Tue Jul 14 16:20:05 2020
@author: Ashish
"""
friends = ['Rolf', 'Bob', 'Jen']
print('Jen' in friends)
movies_watched = {'The Matrix', 'Green Book', 'Her'}
user_movie = input("Enter something you've watched recently: ")
print(user_movie in movies_watched) |
# (c) Copyright 2021 Aaron Kimball
"""
Version info for Arduino Debugger.
"""
# This module **must not** import anything else!
DBG_VERSION = [0, 3, 0]
DBG_VERSION_STR = '.'.join(map(str, DBG_VERSION))
FULL_DBG_VERSION_STR = f'Arduino Debugger (adbg) version {DBG_VERSION_STR}'
LICENSE = """Copyright 2022 Aaron Kimbal... | """
Version info for Arduino Debugger.
"""
dbg_version = [0, 3, 0]
dbg_version_str = '.'.join(map(str, DBG_VERSION))
full_dbg_version_str = f'Arduino Debugger (adbg) version {DBG_VERSION_STR}'
license = 'Copyright 2022 Aaron Kimball\n\nRedistribution and use in source and binary forms, with or without modification, are... |
def parse_cds_header(header_str):
data = header_str.split('|')
data_count = len(data)
data_dict = dict(zip(data[0:data_count:2], data[1:data_count:2]))
return data_dict
def parse_nt_header(header_str):
data = header_str.split('|')
data_dict = {}
data_dict['gi'] = int(data[1])
data_dict['accession'] = data[3]
... | def parse_cds_header(header_str):
data = header_str.split('|')
data_count = len(data)
data_dict = dict(zip(data[0:data_count:2], data[1:data_count:2]))
return data_dict
def parse_nt_header(header_str):
data = header_str.split('|')
data_dict = {}
data_dict['gi'] = int(data[1])
data_dict[... |
"""
https://leetcode.com/problems/4sum-ii
"""
# define an input for testing purposes
A = [1, 2]
B = [-2, -1]
C = [-1, 2]
D = [0, 2]
# actual code to submit
tracker = {}
solution = 0
for i in range(len(A)):
for z in range(len(B)):
num = A[i] + B[z]
if num in tracker:
tracker[num] = tra... | """
https://leetcode.com/problems/4sum-ii
"""
a = [1, 2]
b = [-2, -1]
c = [-1, 2]
d = [0, 2]
tracker = {}
solution = 0
for i in range(len(A)):
for z in range(len(B)):
num = A[i] + B[z]
if num in tracker:
tracker[num] = tracker[num] + 1
else:
tracker[num] = 1
for y in ... |
# Count Binary Substrings: https://leetcode.com/problems/count-binary-substrings/
# Give a binary string s, return the number of non-empty substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings are grouped consecutively.
# Substrings that occur multiple times are count... | class Solution:
def count_binary_substrings(self, s: str) -> int:
(prev_count, result, cur_count) = (0, 0, 1)
for index in range(1, len(s)):
if s[index - 1] != s[index]:
result += min(curCount, prevCount)
(prev_count, cur_count) = (curCount, 1)
... |
#!/usr/bin/python
"""
Copyright (c) 2014 tilt (https://github.com/AeonDave/sir)
See the file 'LICENSE' for copying permission
"""
pass
| """
Copyright (c) 2014 tilt (https://github.com/AeonDave/sir)
See the file 'LICENSE' for copying permission
"""
pass |
# create he following pattern
# ['h']
# ['h', 'e']
# ['h', 'e', 'l']
# ['h', 'e', 'l', 'l']
# ['h', 'e', 'l', 'l', 'o']
text='hello'
my_list=[]
for char in text:
my_list.append(char)
print(my_list) | text = 'hello'
my_list = []
for char in text:
my_list.append(char)
print(my_list) |
class Input(object):
"""This class represents inputs. Mainly, this class used to be able to distinguish between inputs and outputs."""
def __init__(self, value):
super(Input, self).__init__()
self.value = value
def __str__(self):
return 'in(' + str(self.value) + ')'
def __repr__(self):
return str(self) | class Input(object):
"""This class represents inputs. Mainly, this class used to be able to distinguish between inputs and outputs."""
def __init__(self, value):
super(Input, self).__init__()
self.value = value
def __str__(self):
return 'in(' + str(self.value) + ')'
def __repr... |
age = input("Enter birthdate in dd/mm/yyyy format? ")
age_year = age[-4:]
age_in_2021 = 2021-int(age_year)
last_character=age_in_2021 % 10
c=" "*7+"_"*(5-int(last_character/2))+"i"*last_character+"_"*(5-int(last_character/2))+" "*7
print(c)
a=""" |:H:a:p:p:y:|
__|___________|__
|^^^^^^^^^^^^^^^^^|
|:... | age = input('Enter birthdate in dd/mm/yyyy format? ')
age_year = age[-4:]
age_in_2021 = 2021 - int(age_year)
last_character = age_in_2021 % 10
c = ' ' * 7 + '_' * (5 - int(last_character / 2)) + 'i' * last_character + '_' * (5 - int(last_character / 2)) + ' ' * 7
print(c)
a = ' |:H:a:p:p:y:|\n __|___________|__... |
class AllianzeAccountCreator:
"""
Allianze Account Creator
"""
def __init__(self, allanze_account_command):
self.allanze_account_command = allanze_account_command
def __call__(self):
self.__repo.update_or_create()
allianze_serializer = AllianzeAccountSerializer(data=request.d... | class Allianzeaccountcreator:
"""
Allianze Account Creator
"""
def __init__(self, allanze_account_command):
self.allanze_account_command = allanze_account_command
def __call__(self):
self.__repo.update_or_create()
allianze_serializer = allianze_account_serializer(data=request.data)... |
# Basic Addition Calculator Program
# Takes input from the user and outputs the sum of those two numbers.
num1 = input("Enter a number: ")
num2 = input("Enter another number: ")
# Python by default converts inputs into strings a function is used to convert them into numbers.
# Float is used to allow the use of decimal... | num1 = input('Enter a number: ')
num2 = input('Enter another number: ')
result = float(num1) + float(num2)
print(result) |
def append_file(password, file_path):
try:
password_file = open(file_path, "a+")
password_file.write(password + "\r\n")
password_file.close()
except PermissionError as Err:
print("Error creating file: {}".format(Err))
| def append_file(password, file_path):
try:
password_file = open(file_path, 'a+')
password_file.write(password + '\r\n')
password_file.close()
except PermissionError as Err:
print('Error creating file: {}'.format(Err)) |
def mean(interactions, _):
"""Computes the mean interaction of the user (if user_based == true) or the mean
interaction of the item (item user_based == false). It simply sums the interaction
values of the neighbours and divides by the total number of neighbours."""
count, interaction_sum = 0, 0
for... | def mean(interactions, _):
"""Computes the mean interaction of the user (if user_based == true) or the mean
interaction of the item (item user_based == false). It simply sums the interaction
values of the neighbours and divides by the total number of neighbours."""
(count, interaction_sum) = (0, 0)
... |
LANGUAGES = ['cs', 'da', 'de', 'en', 'es', 'et', 'fi',
'fr', 'it', 'nl', 'ro', 'pt', 'el', 'lt', 'lv']
LANGUAGE_DICTIONARY = {'cs' : 'Czech',
'da' : 'Danish',
'de' : 'German',
'en' : 'English',
'es' : 'Spanis... | languages = ['cs', 'da', 'de', 'en', 'es', 'et', 'fi', 'fr', 'it', 'nl', 'ro', 'pt', 'el', 'lt', 'lv']
language_dictionary = {'cs': 'Czech', 'da': 'Danish', 'de': 'German', 'en': 'English', 'es': 'Spanish', 'et': 'Estonian', 'fi': 'Finnish', 'fr': 'French', 'it': 'Italian', 'nl': 'Dutch', 'ro': 'Romanian', 'pt': 'Portu... |
class MacOsJob:
def __init__(self, os_version, is_build=False, is_test=False, extra_props=tuple()):
# extra_props is tuple type, because mutable data structures for argument defaults
# is not recommended.
self.os_version = os_version
self.is_build = is_build
self.is_test = is... | class Macosjob:
def __init__(self, os_version, is_build=False, is_test=False, extra_props=tuple()):
self.os_version = os_version
self.is_build = is_build
self.is_test = is_test
self.extra_props = dict(extra_props)
def gen_tree(self):
non_phase_parts = ['pytorch', 'macos... |
# Problem: Longest Palindrome
# Difficulty: Easy
# Category: String
# Leetcode 409: https://leetcode.com/problems/longest-palindrome/description/
# Description:
"""
Given a string which consists of lowercase or uppercase letters,
find the length of the longest palindromes that can be built with those letters.
This is c... | """
Given a string which consists of lowercase or uppercase letters,
find the length of the longest palindromes that can be built with those letters.
This is case sensitive, for example "Aa" is not considered a palindrome here.
Note:
Assume the length of given string will not exceed 1,010.
Example:
Input:
"abccccdd"
Ou... |
__all__ = [
"job_poll",
"single_job",
]
| __all__ = ['job_poll', 'single_job'] |
"""
Module: 'flowlib.faces._calc' on M5 FlowUI v1.4.0-beta
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v1.11-284-g5d8e1c867 on 2019-08-30', machine='ESP32 module with ESP32')
# Stubber: 1.3.1
class Calc:
''
def _available():
pass
def _update():
pass
def c... | """
Module: 'flowlib.faces._calc' on M5 FlowUI v1.4.0-beta
"""
class Calc:
""""""
def _available():
pass
def _update():
pass
def clear_str():
pass
def deinit():
pass
def delete_str_last():
pass
def is_new_key_press():
pass
def read_... |
class Solution:
def generateTheString(self, n):
ans=[]
if n%2==0:
ans=['a' for i in range(n-1)]
ans.append('b')
else:
ans=['a' for i in range(n)]
return ans | class Solution:
def generate_the_string(self, n):
ans = []
if n % 2 == 0:
ans = ['a' for i in range(n - 1)]
ans.append('b')
else:
ans = ['a' for i in range(n)]
return ans |
"""
As the original oauth2_provider models are overwritten and users are forced to inherit from
the new models here in drf_integrations, every migration in oauth2_provider must be
replicated here, and it has to be added as a dependency to the migration.
For example, migration 0002 here has as a dependency the migratio... | """
As the original oauth2_provider models are overwritten and users are forced to inherit from
the new models here in drf_integrations, every migration in oauth2_provider must be
replicated here, and it has to be added as a dependency to the migration.
For example, migration 0002 here has as a dependency the migratio... |
# singleton tuple <- singleton tuple
x, = 0,
print(x)
# singleton tuple <- singleton list
x, = [-1]
print(x)
# binary tuple <- binary tuple
x,y = 1,2
print(x,y)
# binary tuple swap
x,y = y,x
print(x,y)
# ternary tuple <- ternary tuple
x,y,z = 3,4,5
print(x,y,z)
# singleton list <- singleton list
[x] = [42]
print(x)
# s... | (x,) = (0,)
print(x)
(x,) = [-1]
print(x)
(x, y) = (1, 2)
print(x, y)
(x, y) = (y, x)
print(x, y)
(x, y, z) = (3, 4, 5)
print(x, y, z)
[x] = [42]
print(x)
[x] = (43,)
print(x)
[x, y] = [6, 7]
[x, y] = [44, 45]
print(x, y)
(x, y) = [7, 8]
print(x, y)
(x, y) = (lambda : (9, 10))()
print(x, y)
((x, y), z) = ((11, 12), 13)... |
def f1():
pass
def f2():
pass
def f3():
def f35():
pass
| def f1():
pass
def f2():
pass
def f3():
def f35():
pass |
n = int(input())
print('*'*n)
for _ in range(n-2):
print(f'*{" " * (n - 2)}*')
print('*'*n)
| n = int(input())
print('*' * n)
for _ in range(n - 2):
print(f"*{' ' * (n - 2)}*")
print('*' * n) |
# Copyright (c) 2010 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.
{
'targets': [
{
'target_name': 'ceee_ie_all',
'type': 'none',
'dependencies': [
'common/common.gyp:*',
'broker/b... | {'targets': [{'target_name': 'ceee_ie_all', 'type': 'none', 'dependencies': ['common/common.gyp:*', 'broker/broker.gyp:*', 'plugin/bho/bho.gyp:*', 'plugin/scripting/scripting.gyp:*', 'plugin/toolband/toolband.gyp:*', 'ie_unittests', 'mediumtest_ie']}, {'target_name': 'testing_invoke_executor', 'type': 'executable', 'so... |
expected_output = {
"fsol_packet_drop": 0,
"cac_status": "Not Dropping",
"cac_state": "ACTIVE",
"total_call_session_charges": 0,
"cac_duration": 372898,
"calls_accepted": 48667,
"current_actual_cpu": 3,
"call_limit": 350,
"cpu_limit": 80,
"calls_rejected": 3381,
"cac_events":... | expected_output = {'fsol_packet_drop': 0, 'cac_status': 'Not Dropping', 'cac_state': 'ACTIVE', 'total_call_session_charges': 0, 'cac_duration': 372898, 'calls_accepted': 48667, 'current_actual_cpu': 3, 'call_limit': 350, 'cpu_limit': 80, 'calls_rejected': 3381, 'cac_events': {'reject_reason': {'low_platform_resources':... |
# TODO Introduce DesignViolation escalation system
class DictAttrs(object):
def __init__(self, **dic):
self.__dict__.update(dic)
def __iter__(self):
return self.__dict__.__iter__()
def __getitem__(self, item):
return self.__dict__.__getitem__(item)
def __getattr__(self, item):
if not item in self.__dic... | class Dictattrs(object):
def __init__(self, **dic):
self.__dict__.update(dic)
def __iter__(self):
return self.__dict__.__iter__()
def __getitem__(self, item):
return self.__dict__.__getitem__(item)
def __getattr__(self, item):
if not item in self.__dict__:
... |
class Solution:
def uniqueOccurrences(self, arr: List[int]) -> bool:
occ = {}
for num in arr:
if num not in occ:
occ[num] = 1
else:
occ[num] += 1
x = list(occ.values())
return len(set(x)) == len(x) | class Solution:
def unique_occurrences(self, arr: List[int]) -> bool:
occ = {}
for num in arr:
if num not in occ:
occ[num] = 1
else:
occ[num] += 1
x = list(occ.values())
return len(set(x)) == len(x) |
n = int(input())
class Tree:
left_node = None
right_node = None
node_dict = dict([])
for i in range(n):
root, left, right = input().split()
node_dict[root] = Tree()
node_dict[root].left_node = left
node_dict[root].right_node = right
def prefix(root):
left = node_dict[root].left_n... | n = int(input())
class Tree:
left_node = None
right_node = None
node_dict = dict([])
for i in range(n):
(root, left, right) = input().split()
node_dict[root] = tree()
node_dict[root].left_node = left
node_dict[root].right_node = right
def prefix(root):
left = node_dict[root].left_node
... |
class Solution:
def rob(self, nums: List[int]) -> int:
if len(nums) == 0:
return 0
if len(nums) <= 2:
return max(nums)
cache = [0] * len(nums)
cache[0] = nums[0]
cache[1] = max(nums[1], nums[0])
for i in range(2, len(nums) - 1... | class Solution:
def rob(self, nums: List[int]) -> int:
if len(nums) == 0:
return 0
if len(nums) <= 2:
return max(nums)
cache = [0] * len(nums)
cache[0] = nums[0]
cache[1] = max(nums[1], nums[0])
for i in range(2, len(nums) - 1):
ca... |
class Solution:
def maxLengthBetweenEqualCharacters(self, s: str) -> int:
char_dict = {}
max = 0
for i in range(len(s)):
t = char_dict.get(s[i],-1)
if t==-1:
char_dict[s[i]] = i
else:
if i-t>max:
... | class Solution:
def max_length_between_equal_characters(self, s: str) -> int:
char_dict = {}
max = 0
for i in range(len(s)):
t = char_dict.get(s[i], -1)
if t == -1:
char_dict[s[i]] = i
elif i - t > max:
max = i - t
... |
def make_car(manufacturer, model_name, **arguments):
new_car = {
'manufacturer': manufacturer,
'model_name': model_name,
}
for key, value in arguments.items():
new_car[key] = value
return new_car
car = make_car('subaru', 'outback', color='blue', tow_package=True)
print(car... | def make_car(manufacturer, model_name, **arguments):
new_car = {'manufacturer': manufacturer, 'model_name': model_name}
for (key, value) in arguments.items():
new_car[key] = value
return new_car
car = make_car('subaru', 'outback', color='blue', tow_package=True)
print(car) |
class Node:
"""node class for linked list"""
def __init__(self, data):
self.data = data # Node data
self.next = None # Reference for next node
class LinkedList:
"""Linked List Class"""
def __init__(self):
self.head = None # the first node(head node)
self.tail = None... | class Node:
"""node class for linked list"""
def __init__(self, data):
self.data = data
self.next = None
class Linkedlist:
"""Linked List Class"""
def __init__(self):
self.head = None
self.tail = None
def append(self, data):
"""Append new node to linked li... |
################################################################################
# Design Automation #
################################################################################
'''
Author: Sean Lam
Contact: seanlm@student.ubc.ca
''' | """
Author: Sean Lam
Contact: seanlm@student.ubc.ca
""" |
# # below is Okceg v0.1
#
# def is_num(jerry):
# try:
# int(jerry)
# except:
# try:
# float(jerry)
# except:
# return False
# else:
# return True
# else:
# return True
#
# print('\nInteractive Okceg Shell!\npowered by python\n')
#
#... | __author__ = 'Vibius Vibidius Zosimus'
__version__ = '.2'
print('\n')
print('Okceg IS: interactive shell of Okceg, based on python\n')
print("now i am going to say 'hello_world!'.\nhello_world!\n")
print("help:\n\tinput anything and hit 'enter';\n\tinput '1' and hit 'enter' to quit;\n")
while 1:
user_input = input(... |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def oddEvenList(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
if head is None or head.next is None:
... | class Solution:
def odd_even_list(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
if head is None or head.next is None:
return head
odd = head
even_head = head.next
even = head.next
cur = head.next
index = 2
... |
c.Authenticator.admin_users = {'jupyterhub'}
c.JupyterHub.services = [
{
'command': [
'/opt/conda/bin/comsoljupyter', 'web',
'-s', '/srv/jupyterhub',
'12345', 'http://jupyter.radiasoft.org:8000',
],
'name': 'comsol',
'url': 'http://127.0.0.1:12345... | c.Authenticator.admin_users = {'jupyterhub'}
c.JupyterHub.services = [{'command': ['/opt/conda/bin/comsoljupyter', 'web', '-s', '/srv/jupyterhub', '12345', 'http://jupyter.radiasoft.org:8000'], 'name': 'comsol', 'url': 'http://127.0.0.1:12345'}] |
'''
Aim: Given a base-10 integer, n, convert it to binary (base-2). Then find and print the
base-10 integer denoting the maximum number of consecutive 1's in n's binary representation.
'''
n = int(input()) # getting input
remainder = []
while n > 0:
rm = n % 2
n = n//2 ... | """
Aim: Given a base-10 integer, n, convert it to binary (base-2). Then find and print the
base-10 integer denoting the maximum number of consecutive 1's in n's binary representation.
"""
n = int(input())
remainder = []
while n > 0:
rm = n % 2
n = n // 2
remainder.append(rm)
(count, result) = (0, 0)
for... |
class node:
def __init__(self,key):
self.left=self.right=None
self.val=key
def printlevel(root,level):
if root==None:
return
if level==0:
print(root.val,end=' ')
else:
printlevel(root.left,level-1)
printlevel(root.right,level-1)
root=node(1)
roo... | class Node:
def __init__(self, key):
self.left = self.right = None
self.val = key
def printlevel(root, level):
if root == None:
return
if level == 0:
print(root.val, end=' ')
else:
printlevel(root.left, level - 1)
printlevel(root.right, level - 1)
root =... |
"""This file contains custom Exceptions for pysradb
"""
class MissingQueryException(Exception):
"""Exception raised when the user did not supply any query fields.
Attributes:
message: string
Error message for this Exception
"""
def __init__(self):
self.message = (
... | """This file contains custom Exceptions for pysradb
"""
class Missingqueryexception(Exception):
"""Exception raised when the user did not supply any query fields.
Attributes:
message: string
Error message for this Exception
"""
def __init__(self):
self.message = 'No valid... |
n=int(input())
for i in range(n):
x=input()
l=len(x);li=[]
for i in range(l):
li.append(x[i])
j=0
sum=0
while j<len(li):
if li[j]=='4':
sum+=1
else:
pass
j+=1
print(sum)
| n = int(input())
for i in range(n):
x = input()
l = len(x)
li = []
for i in range(l):
li.append(x[i])
j = 0
sum = 0
while j < len(li):
if li[j] == '4':
sum += 1
else:
pass
j += 1
print(sum) |
__title__ = 'aiolo'
__version__ = '4.1.1'
__description__ = 'asyncio-friendly Python bindings for liblo'
__url__ = 'https://github.com/elijahr/aiolo'
__author__ = 'Elijah Shaw-Rutschman'
__author_email__ = 'elijahr+aiolo@gmail.com'
| __title__ = 'aiolo'
__version__ = '4.1.1'
__description__ = 'asyncio-friendly Python bindings for liblo'
__url__ = 'https://github.com/elijahr/aiolo'
__author__ = 'Elijah Shaw-Rutschman'
__author_email__ = 'elijahr+aiolo@gmail.com' |
"""
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
"""
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
return ... | """
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
"""
class Solution:
def two_sum(self, nums: List[int], target: int) -> List[int]:
retur... |
customers = {
"name": "Taen Ahammed",
"age": 20,
"is_verified": True
}
print(customers["name"])
# print(customers["birthdate"])
# print(customers["Name"])
customers["name"] = "Taen"
print(customers.get("name"))
print(customers.get("birthdate"))
print(customers.get("birthdate", "Dec 12 1998"))
customers[... | customers = {'name': 'Taen Ahammed', 'age': 20, 'is_verified': True}
print(customers['name'])
customers['name'] = 'Taen'
print(customers.get('name'))
print(customers.get('birthdate'))
print(customers.get('birthdate', 'Dec 12 1998'))
customers['isMarried'] = False
print(customers['isMarried']) |
class Scrapable():
def __parse(self, html=None):
"""todo: documentation"""
pass
async def scrap(self):
"""todo: documentation"""
pass
| class Scrapable:
def __parse(self, html=None):
"""todo: documentation"""
pass
async def scrap(self):
"""todo: documentation"""
pass |
def correct_sentence(text):
'''
For the input of your function, you will be given one sentence. You have to return a corrected version, that starts with a capital letter and ends with a period (dot).
Pay attention to the fact that not all of the fixes are necessary. If a sentence already ends with a period (do... | def correct_sentence(text):
"""
For the input of your function, you will be given one sentence. You have to return a corrected version, that starts with a capital letter and ends with a period (dot).
Pay attention to the fact that not all of the fixes are necessary. If a sentence already ends with a period (do... |
def get_arrangement_count(free_spaces):
if not free_spaces:
return 1
elif free_spaces < 2:
return 0
arrangements = 0
if free_spaces >= 3:
arrangements += (2 + get_arrangement_count(free_spaces - 3))
arrangements += (2 + get_arrangement_count(free_spaces - 2))
return arr... | def get_arrangement_count(free_spaces):
if not free_spaces:
return 1
elif free_spaces < 2:
return 0
arrangements = 0
if free_spaces >= 3:
arrangements += 2 + get_arrangement_count(free_spaces - 3)
arrangements += 2 + get_arrangement_count(free_spaces - 2)
return arrangeme... |
# ------------------------------
# 397. Integer Replacement
#
# Description:
# Given a positive integer n and you can do operations as follow:
#
# If n is even, replace n with n/2.
# If n is odd, you can replace n with either n + 1 or n - 1.
# What is the minimum number of replacements needed for n to become 1?
#
# ... | class Solution:
def integer_replacement(self, n: int) -> int:
if n == 1:
return 0
replace_count = {1: 0}
def dp(n: int) -> int:
if n in replaceCount:
return replaceCount[n]
if n % 2 == 0:
res = dp(n / 2) + 1
el... |
class Solution:
def judgePoint24(self, cards: List[int]) -> bool:
"""Backtracking.
"""
if len(cards) == 1 and abs(cards[0] - 24.0) < 0.0001:
return True
for i in range(1, len(cards)):
for j in range(0, i):
copy = cards[:]
a, b =... | class Solution:
def judge_point24(self, cards: List[int]) -> bool:
"""Backtracking.
"""
if len(cards) == 1 and abs(cards[0] - 24.0) < 0.0001:
return True
for i in range(1, len(cards)):
for j in range(0, i):
copy = cards[:]
(a, ... |
__copyright__ = "Copyright (C) 2020 shimakaze-git"
__version__ = "0.0.1"
__license__ = "MIT"
__author__ = "shimakaze-git"
__author_email__ = "shimakaze.soft+github@googlemail.com"
__url__ = "http://github.com/shimakaze-git/django-jp-birthday"
__all__ = ["fields", "managers", "models"]
| __copyright__ = 'Copyright (C) 2020 shimakaze-git'
__version__ = '0.0.1'
__license__ = 'MIT'
__author__ = 'shimakaze-git'
__author_email__ = 'shimakaze.soft+github@googlemail.com'
__url__ = 'http://github.com/shimakaze-git/django-jp-birthday'
__all__ = ['fields', 'managers', 'models'] |
"""termination: A library for first-order term-rewriting."""
__version__ = '0.0.2'
__author__ = 'Chris Bouchard <chris@upliftinglemma.net>'
| """termination: A library for first-order term-rewriting."""
__version__ = '0.0.2'
__author__ = 'Chris Bouchard <chris@upliftinglemma.net>' |
#Manifest example.
{
'author':'Campo y Tierra del Jerte S.A.',
'name':'Test Module',
'depends':[
'base',
'account',
],
'summary':'Module for testing odooo',
'description':"""
This is an *extended description* for the module that is testing our
skills developing in... | {'author': 'Campo y Tierra del Jerte S.A.', 'name': 'Test Module', 'depends': ['base', 'account'], 'summary': 'Module for testing odooo', 'description': '\n This is an *extended description* for the module that is testing our\n skills developing in **odoo**. With this we learn:\n \n * Basic ... |
blist = [ 1, 2, 3, 255 ]
# byte is immutable
the_bytes = bytes( blist )
# b'\x01\x02\x03\xff'
print( the_bytes )
the_byte_array = bytearray( blist )
# bytearray(b'\x01\x02\x03\xff')
print( the_byte_array )
# bytearray is mutable
the_byte_array = bytearray( blist )
print( the_byte_array )
the_byte_array[0] = 127
p... | blist = [1, 2, 3, 255]
the_bytes = bytes(blist)
print(the_bytes)
the_byte_array = bytearray(blist)
print(the_byte_array)
the_byte_array = bytearray(blist)
print(the_byte_array)
the_byte_array[0] = 127
print(the_byte_array)
the_bytes = bytes(range(0, 256))
the_byte_array = bytearray(range(0, 256))
'\nb\'\x00\x01\x02\x03... |
"""
CFG has many blocks
blocks has many nodes
nodes may jump into blocks (if else)
"""
class CFG(object):
def __init__(self):
self.startingBlockIndex = 0
self.blocks = []
self.arguments = []
self.vars = set()
self.name = None
self.returnVariables = []
def setName(self,name):
self.name = name
def ad... | """
CFG has many blocks
blocks has many nodes
nodes may jump into blocks (if else)
"""
class Cfg(object):
def __init__(self):
self.startingBlockIndex = 0
self.blocks = []
self.arguments = []
self.vars = set()
self.name = None
self.returnVariables = []
def set... |
total=0
n=int(input())
for i in range(9):
t=int(input())
total+=t
print(n-total) | total = 0
n = int(input())
for i in range(9):
t = int(input())
total += t
print(n - total) |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 26 15:47:44 2020
@author: alexi
"""
| """
Created on Wed Feb 26 15:47:44 2020
@author: alexi
""" |
class ImeMode(Enum,IComparable,IFormattable,IConvertible):
"""
Specifies a value that determines the Input Method Editor (IME) status of an object when the object is selected.
enum ImeMode,values: Alpha (8),AlphaFull (7),Close (11),Disable (3),Hangul (10),HangulFull (9),Hiragana (4),Inherit (-1),Katakana (5)... | class Imemode(Enum, IComparable, IFormattable, IConvertible):
"""
Specifies a value that determines the Input Method Editor (IME) status of an object when the object is selected.
enum ImeMode,values: Alpha (8),AlphaFull (7),Close (11),Disable (3),Hangul (10),HangulFull (9),Hiragana (4),Inherit (-1),Katakana (... |
matrix_line_color = '#fff'
matrix_background_color = '#eee'
matrix_border_color = '#888'
matrix_border_width = 0.18
cc = { # cycle colors
'axis': 'ff0000',
'maindiag': '00438a',
'bigcyc': 'ba1000',
'with0': 'ff5500',
'without0': 'e23287',
'lighttetra': 'da691e',
'darktetra': '7b2e13'
}
id... | matrix_line_color = '#fff'
matrix_background_color = '#eee'
matrix_border_color = '#888'
matrix_border_width = 0.18
cc = {'axis': 'ff0000', 'maindiag': '00438a', 'bigcyc': 'ba1000', 'with0': 'ff5500', 'without0': 'e23287', 'lighttetra': 'da691e', 'darktetra': '7b2e13'}
id_colors_dict = {'white': '#ffffff', 'yellow': '#... |
# http://59.23.150.58/30stair/q_r/q_r.php?pname=q_r
a, b = map(int, input().split())
print(int(a/b), a%b) | (a, b) = map(int, input().split())
print(int(a / b), a % b) |
# -*- coding: utf-8 -*-
"""Release information for Python Package."""
# Consider change to: ska-tangods-sdpsubarray ?
NAME = "ska-sdp-subarray"
# For version names see: https://www.python.org/dev/peps/pep-0440/
VERSION = "0.7.0"
VERSION_INFO = VERSION.split(".")
AUTHOR = "ORCA team, Sim Team"
LICENSE = 'License :: OSI... | """Release information for Python Package."""
name = 'ska-sdp-subarray'
version = '0.7.0'
version_info = VERSION.split('.')
author = 'ORCA team, Sim Team'
license = 'License :: OSI Approved :: BSD License'
copyright = 'BSD-3-Clause' |
#
# PySNMP MIB module HPN-ICF-LswRSTP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-LswRSTP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:40:01 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... | (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, single_value_constraint, value_range_constraint, constraints_union, constraints_intersection) ... |
"""
A number is strobogrammatic if the number looks the same, when rotate by 180 degrees,
upside down
"""
def is_strobogrammatic(num):
"""
:type num: str
:rtype: bool
It has to be palindromic stylish and we should also be able to swap / interchange.
That's the intuition
Args:
num:
... | """
A number is strobogrammatic if the number looks the same, when rotate by 180 degrees,
upside down
"""
def is_strobogrammatic(num):
"""
:type num: str
:rtype: bool
It has to be palindromic stylish and we should also be able to swap / interchange.
That's the intuition
Args:
num:
R... |
"""
Advent of Code Day 1
https://adventofcode.com/2021/day/1
(c) JAnxO, 2021
"""
| """
Advent of Code Day 1
https://adventofcode.com/2021/day/1
(c) JAnxO, 2021
""" |
class Track:
def __init__(self, _id, data: dict):
self.id = _id
self.data = data
self.title = data.get("title")
self.author = data.get("author")
self.length = data.get("length")
self.yt_id = data.get("identifier")
self.uri = data.get("uri")
self.is_st... | class Track:
def __init__(self, _id, data: dict):
self.id = _id
self.data = data
self.title = data.get('title')
self.author = data.get('author')
self.length = data.get('length')
self.yt_id = data.get('identifier')
self.uri = data.get('uri')
self.is_st... |
{
"variables": {
"base_path": "C:/msys64/mingw64"
},
"targets": [
{
"target_name": "expand",
"sources": [
"src/expand.cc"
],
"libraries": ["-llibpostal"],
"library_dirs": ["<(base_path)/bin"],
"include_di... | {'variables': {'base_path': 'C:/msys64/mingw64'}, 'targets': [{'target_name': 'expand', 'sources': ['src/expand.cc'], 'libraries': ['-llibpostal'], 'library_dirs': ['<(base_path)/bin'], 'include_dirs': ['<!(node -e "require(\'nan\')")', '<(base_path)/include']}, {'target_name': 'parser', 'sources': ['src/parser.cc'], '... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
if __name__ == '__main__':
name = input('please input your name:')
print('hello,', name)
| if __name__ == '__main__':
name = input('please input your name:')
print('hello,', name) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.