content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
__version__ = "2.0.1"
__version_info__ = tuple(int(num) for num in __version__.split("."))
default_app_config = "dbfiles.apps.DBFilesConfig"
| __version__ = '2.0.1'
__version_info__ = tuple((int(num) for num in __version__.split('.')))
default_app_config = 'dbfiles.apps.DBFilesConfig' |
fo = open("list.txt", "r")
lines = fo.readlines()
outf = open("out.txt", "w")
for line in lines:
l = line.replace("\n","")
ls = l.split(",")
pl = "first: " + ls[0] + " second: " + ls[1] + " third: " + ls[2]
outf.write(pl)
outf.close()
| fo = open('list.txt', 'r')
lines = fo.readlines()
outf = open('out.txt', 'w')
for line in lines:
l = line.replace('\n', '')
ls = l.split(',')
pl = 'first: ' + ls[0] + ' second: ' + ls[1] + ' third: ' + ls[2]
outf.write(pl)
outf.close() |
# coding: utf-8
# created by Martin Haese, Tel FRM 10763
# last modified 01.02.2018
# to call it
# ssh -X refsans@refsansctrl01 oder 02
# cd /refsanscontrol/src/nicos-core
# INSTRUMENT=nicos_mlz.refsans bin/nicos-monitor -S monitor_scatgeo
description = 'REFSANS scattering geometry monitor'
group = 'special'
# Legen... | description = 'REFSANS scattering geometry monitor'
group = 'special'
_componentpositioncol = column(block(' x: component position in beam direction ', [block_row(field(name='goniometer', dev='goniometer_x', width=14, unit='mm'), field(name='sample center', dev='sample_x', width=14, unit='mm'), field(name='monitor pos... |
#!/usr/bin/env python
'''
--- Day 12: Passage Pathing ---
With your submarine's subterranean subsystems subsisting suboptimally, the only way you're getting
out of this cave anytime soon is by finding a path yourself. Not just a path - the only way to
know if you've found the best path is to find all of them.
Fortun... | """
--- Day 12: Passage Pathing ---
With your submarine's subterranean subsystems subsisting suboptimally, the only way you're getting
out of this cave anytime soon is by finding a path yourself. Not just a path - the only way to
know if you've found the best path is to find all of them.
Fortunately, the sensors are s... |
intervals = [(2, 15), (36, 45), (9, 29), (16, 23), (4, 9)]
def room_num(intervals):
intervals_sorted = sorted(intervals, key=lambda x: x[0])
rooms = 1
room_open_time = [intervals_sorted[0][1]]
for interval in intervals_sorted[1:]:
if interval[0] < min(room_open_time):
rooms += 1
... | intervals = [(2, 15), (36, 45), (9, 29), (16, 23), (4, 9)]
def room_num(intervals):
intervals_sorted = sorted(intervals, key=lambda x: x[0])
rooms = 1
room_open_time = [intervals_sorted[0][1]]
for interval in intervals_sorted[1:]:
if interval[0] < min(room_open_time):
rooms += 1
... |
def merge(pic_1, pic_2):
return {
'id': pic_1['id'] + pic_2['id'],
'tags': pic_1['tags'] | pic_2['tags'],
}
def get_score_table(pics):
score_table = {}
for i in range(len(pics)):
for j in range(i + 1, len(pics)):
r = len(pics[i]['tags'] & pics[j]['tags'])
... | def merge(pic_1, pic_2):
return {'id': pic_1['id'] + pic_2['id'], 'tags': pic_1['tags'] | pic_2['tags']}
def get_score_table(pics):
score_table = {}
for i in range(len(pics)):
for j in range(i + 1, len(pics)):
r = len(pics[i]['tags'] & pics[j]['tags'])
p = len(pics[i]['tags'... |
def part1(inp):
drawn_numbers = [int(x) for x in inp.pop(0).split(",")]
boards = []
for i in range(len(inp) // 6):
inp.pop(0)
board = [[int(x) for x in inp.pop(0).split()] for j in range(5)]
boards.append(board)
for num in drawn_numbers:
for board in boards:
... | def part1(inp):
drawn_numbers = [int(x) for x in inp.pop(0).split(',')]
boards = []
for i in range(len(inp) // 6):
inp.pop(0)
board = [[int(x) for x in inp.pop(0).split()] for j in range(5)]
boards.append(board)
for num in drawn_numbers:
for board in boards:
m... |
class Version(str):
SEPARATOR = '.'
def __new__(cls, version=""):
obj = str.__new__(cls, version)
obj._list = None
return obj
@property
def list(self):
if self._list is None:
self._list = []
for item in self.split(Version.SEPARATOR):
... | class Version(str):
separator = '.'
def __new__(cls, version=''):
obj = str.__new__(cls, version)
obj._list = None
return obj
@property
def list(self):
if self._list is None:
self._list = []
for item in self.split(Version.SEPARATOR):
... |
# MEDIUM
# this is like Word Break => DFS + Memoization
# define a lambda x,y: x {+,-,*} y
# scan the string s:
# break at operators "+-*" => left = s[:operator] right = s[operator+1:]
# recurse each left, right:
# try every possible operations of left and right
# Time O(N!) Space O(N)
class Solut... | class Solution:
def diff_ways_to_compute(self, input: str) -> List[int]:
self.memo = {}
self.ops = {'+': lambda x, y: x + y, '-': lambda x, y: x - y, '*': lambda x, y: x * y}
return self.dfs(input)
def dfs(self, s):
result = []
if s in self.memo:
return self... |
git_response = {
"login": "dimddev",
"id": 57534,
"node_id": "MdQ6VXnlc4U3NTM0NDA=",
"avatar_url": "https://avatars1.githubusercontent.com/u/5753440?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dimddev",
"html_url": "https://github.com/dimddev",
"followers_url": "https:/... | git_response = {'login': 'dimddev', 'id': 57534, 'node_id': 'MdQ6VXnlc4U3NTM0NDA=', 'avatar_url': 'https://avatars1.githubusercontent.com/u/5753440?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/dimddev', 'html_url': 'https://github.com/dimddev', 'followers_url': 'https://api.github.com/users/dimddev/fol... |
#
# user-statistician: Github action for generating a user stats card
#
# Copyright (c) 2021 Vincent A Cicirello
# https://www.cicirello.org/
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal... | color_mapping = {'dark': {'bg': '#090c10', 'border': '#0d419d', 'icons': '#79c0ff', 'text': '#c9d1d9', 'title': '#f0f6fc'}, 'dark-dimmed': {'bg': '#1e2228', 'border': '#1b4b91', 'icons': '#6cb6ff', 'text': '#adbac7', 'title': '#cdd9e5'}, 'light': {'bg': '#f6f8fa', 'border': '#c8e1ff', 'icons': '#0366d6', 'text': '#2429... |
# These default settings initally apply to all installations of the config_app.
#
# This file _is_ and should remain under version control.
#
DEBUG = False
SQLALCHEMY_ECHO = False
SECRET_KEY = b'default_SECRET_KEY'
#
# IMPORTANT: Do _not_ edit this file.
# Instead, over-ride with settings in the instance/c... | debug = False
sqlalchemy_echo = False
secret_key = b'default_SECRET_KEY' |
class Solution:
def getHint(self, secret: str, guess: str) -> str:
index = 0
secret = list(secret)
guess = list(guess)
A = 0
while index < len(secret):
# count A
if secret[index] == guess[index]:
secret = secret[:index] + secret[index +... | class Solution:
def get_hint(self, secret: str, guess: str) -> str:
index = 0
secret = list(secret)
guess = list(guess)
a = 0
while index < len(secret):
if secret[index] == guess[index]:
secret = secret[:index] + secret[index + 1:]
... |
COLOMBIA_PLACES_FILTERS = [
# Colombia
{'country': 'CO', 'location': 'Bogota'},
{'country': 'CO', 'location': 'Medellin'},
# TODO: solve issue, meetup is not returning results for cali even though it actually exist a django group
{'country': 'CO', 'location': 'Cali'},
{'country': 'CO', 'location... | colombia_places_filters = [{'country': 'CO', 'location': 'Bogota'}, {'country': 'CO', 'location': 'Medellin'}, {'country': 'CO', 'location': 'Cali'}, {'country': 'CO', 'location': 'Barranquilla'}, {'country': 'CO', 'location': 'Santa marta'}, {'country': 'CO', 'location': 'Pasto'}]
latam_places_filters = [{'country': '... |
# -*- coding: utf-8 -*-
n = int(input())
t = []
for _ in range(n):
t.append(int(input()))
for i in range(n):
if i > 0 and i < n - 1:
print(sum(t[i - 1:i + 2]))
elif i == 0:
print(sum(t[:2]))
else:
print(sum(t[i - 1:])) | n = int(input())
t = []
for _ in range(n):
t.append(int(input()))
for i in range(n):
if i > 0 and i < n - 1:
print(sum(t[i - 1:i + 2]))
elif i == 0:
print(sum(t[:2]))
else:
print(sum(t[i - 1:])) |
N = int(input())
lst = [list(map(int,input().split())) for i in range(N)]
for i in range(N-2):
for j in range(i+1,N-1):
for k in range(j+1,N):
x0,y0 = lst[i]
x1,y1 = lst[j]
x2,y2 = lst[k]
x0 -= x2
x1 -= x2
y0 -= y2
y1 -= y2... | n = int(input())
lst = [list(map(int, input().split())) for i in range(N)]
for i in range(N - 2):
for j in range(i + 1, N - 1):
for k in range(j + 1, N):
(x0, y0) = lst[i]
(x1, y1) = lst[j]
(x2, y2) = lst[k]
x0 -= x2
x1 -= x2
y0 -= y2
... |
class ConsoleLine:
body = None
current_character = None
type = None
| class Consoleline:
body = None
current_character = None
type = None |
class KeyExReturn:
def __init__(self):
self._status_code = None
self._msg = None
def __call__(self):
return self._msg, self._status_code
def status_code(self):
return self._status_code
def message(self):
return self._msg
class OK(KeyExReturn):
def __init_... | class Keyexreturn:
def __init__(self):
self._status_code = None
self._msg = None
def __call__(self):
return (self._msg, self._status_code)
def status_code(self):
return self._status_code
def message(self):
return self._msg
class Ok(KeyExReturn):
def __in... |
# Radix sort in Python
def counting_sort(array, place):
size = len(array)
output = [0] * size
count = [0] * 10
for i in range(0, size):
index = array[i] // place
count[index % 10] += 1
for i in range(1, 10):
count[i] += count[i - 1]
i = size - 1
while i >= 0:
... | def counting_sort(array, place):
size = len(array)
output = [0] * size
count = [0] * 10
for i in range(0, size):
index = array[i] // place
count[index % 10] += 1
for i in range(1, 10):
count[i] += count[i - 1]
i = size - 1
while i >= 0:
index = array[i] // pla... |
class Fields:
#rearrange the field order at will
#if renaming or adding additional fields modifying target.csv is required
values = ['Timestamp', 'Transaction Id', 'Payment ID', 'Note', 'Receive/Send Address', 'Debit', 'Credit', 'Network Fee', 'Balance', 'Currency']
| class Fields:
values = ['Timestamp', 'Transaction Id', 'Payment ID', 'Note', 'Receive/Send Address', 'Debit', 'Credit', 'Network Fee', 'Balance', 'Currency'] |
FILENAME = "input.txt"
class Expression:
def __init__(self, expression_str: str):
expression_list = expression_str.split()
if len(expression_list) == 1:
self.parse_expression(None, None, expression_list[0])
elif len(expression_list) == 2:
self.parse_expression(Non... | filename = 'input.txt'
class Expression:
def __init__(self, expression_str: str):
expression_list = expression_str.split()
if len(expression_list) == 1:
self.parse_expression(None, None, expression_list[0])
elif len(expression_list) == 2:
self.parse_expression(None,... |
# generated from genmsg/cmake/pkg-genmsg.context.in
messages_str = "/workspace/src/ros_control/controller_manager_msgs/msg/ControllerState.msg;/workspace/src/ros_control/controller_manager_msgs/msg/ControllerStatistics.msg;/workspace/src/ros_control/controller_manager_msgs/msg/ControllersStatistics.msg;/workspace/src/... | messages_str = '/workspace/src/ros_control/controller_manager_msgs/msg/ControllerState.msg;/workspace/src/ros_control/controller_manager_msgs/msg/ControllerStatistics.msg;/workspace/src/ros_control/controller_manager_msgs/msg/ControllersStatistics.msg;/workspace/src/ros_control/controller_manager_msgs/msg/HardwareInter... |
a=[]
while True:
b=input("Enter Number(Break Using String):")
if b.isalpha():
break
else:
a.append(int(b))
continue
c=a[0]
for x in a:
if c>x:
c=x
else:
continue
d=0
if c in a:
d=a.index(c)
print ("Index:",d)
print ("Number:",c)
| a = []
while True:
b = input('Enter Number(Break Using String):')
if b.isalpha():
break
else:
a.append(int(b))
continue
c = a[0]
for x in a:
if c > x:
c = x
else:
continue
d = 0
if c in a:
d = a.index(c)
print('Index:', d)
print('Number:', c) |
'''
PROBLEM: Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word (last word means the last appearing word if we loop from left to right) in the string.
If the last word does not exist, return 0.
Note: A word is defined as a maxima... | """
PROBLEM: Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word (last word means the last appearing word if we loop from left to right) in the string.
If the last word does not exist, return 0.
Note: A word is defined as a maxima... |
#
# PySNMP MIB module RBN-TC (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RBN-TC
# Produced by pysmi-0.3.4 at Wed May 1 14:52: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, 09:23:15)
... | (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, value_range_constraint, constraints_union, constraints_intersection, value_size_constraint) ... |
# Copyright (C) 2019 SignalFx, Inc. All rights reserved.
name = 'signalfx_serverless_gcf'
version = '0.0.1'
user_agent = 'signalfx_serverless/' + version
packages = ['signalfx_gcf', 'signalfx_gcf.serverless']
| name = 'signalfx_serverless_gcf'
version = '0.0.1'
user_agent = 'signalfx_serverless/' + version
packages = ['signalfx_gcf', 'signalfx_gcf.serverless'] |
print("Hello! I am a script in python");
def Hi(firstName, lastName):
print("Hello " + firstName + " " + lastName)
| print('Hello! I am a script in python')
def hi(firstName, lastName):
print('Hello ' + firstName + ' ' + lastName) |
class GN3:
def __init__(self):
self.name = 'GN3'
def __str__(self):
return self.name | class Gn3:
def __init__(self):
self.name = 'GN3'
def __str__(self):
return self.name |
# Specialization: Google IT Automation with Python
# Course 01: Crash Course with Python
# Week 2 Module Part 1 Exercise 02
# Student: Shawn Solomon
# Learning Platform: Coursera.org
# Practice writing some expressions and conversions yourself.
# In this scenario, we have a directory with 5 files in it. Each ... | total = 2048 + 4357 + 97658 + 125 + 8
files = 5
average = total / files
print('The average size is: ' + str(average)) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of xy-cli.
# https://github.com/exiahuang/xy-cli
# Licensed under the Apache License 2.0:
# http://www.opensource.org/licenses/Apache-2.0
# Copyright (c) 2020, exiahuang <exia.huang@outlook.com>
__version__ = '0.8' # NOQA
__desc__ = 'xy command tools... | __version__ = '0.8'
__desc__ = 'xy command tools' |
class Stack:
def __init__(self) -> None:
self.elements = []
def push(self, element):
self.elements.append(element)
def size(self):
return len(self.elements)
def pop(self):
result = self.elements[self.size()-1]
self.elements = self.elements[:self.size()-1]
... | class Stack:
def __init__(self) -> None:
self.elements = []
def push(self, element):
self.elements.append(element)
def size(self):
return len(self.elements)
def pop(self):
result = self.elements[self.size() - 1]
self.elements = self.elements[:self.size() - 1]
... |
# Lets attempt to draw two points and have them move also
pos_1 = 0
velo_1 = 1
pos_2 = 9
velo_2 = -1
line = 10*[' ']
# The code is beginning to be clustered and hard to read
for i in range(10):
line[pos_1] = '*'
line[pos_2] = '*'
print("".join(line))
line[pos_1] = ' '
line[pos_2] = ' '
pos_... | pos_1 = 0
velo_1 = 1
pos_2 = 9
velo_2 = -1
line = 10 * [' ']
for i in range(10):
line[pos_1] = '*'
line[pos_2] = '*'
print(''.join(line))
line[pos_1] = ' '
line[pos_2] = ' '
pos_1 += velo_1
pos_2 += velo_2
print(pos_1, pos_2)
print(''.join(line)) |
a = int(input("Enter a -: "))
b = int(input("Enter b -: "))
print("A, B se bada ya barabar h bhai") if a >= b else print(
"B, A se bada h bhai")
| a = int(input('Enter a -: '))
b = int(input('Enter b -: '))
print('A, B se bada ya barabar h bhai') if a >= b else print('B, A se bada h bhai') |
# A postgres database url
# postgresql://[user[:password]@][netloc][:port][/dbname]
DATABASE_URL=""
# Your discord bot token
TOKEN=""
| database_url = ''
token = '' |
def gcd(a,b):
return gcd(b,a%b) if b>0 else a
a,b,c=map(int,input().split())
if a*b//gcd(a,b) <=c:
print("yes")
else:
print("no") | def gcd(a, b):
return gcd(b, a % b) if b > 0 else a
(a, b, c) = map(int, input().split())
if a * b // gcd(a, b) <= c:
print('yes')
else:
print('no') |
load("@io_bazel_rules_go//go:def.bzl", "go_context", "go_rule")
load("@bazel_skylib//lib:shell.bzl", "shell")
def _go_vendor(ctx):
go = go_context(ctx)
out = ctx.actions.declare_file(ctx.label.name + ".sh")
substitutions = {
"@@GO@@": shell.quote(go.go.path),
"@@GAZELLE@@": shell.quote(ctx.e... | load('@io_bazel_rules_go//go:def.bzl', 'go_context', 'go_rule')
load('@bazel_skylib//lib:shell.bzl', 'shell')
def _go_vendor(ctx):
go = go_context(ctx)
out = ctx.actions.declare_file(ctx.label.name + '.sh')
substitutions = {'@@GO@@': shell.quote(go.go.path), '@@GAZELLE@@': shell.quote(ctx.executable._gazel... |
#
# PySNMP MIB module CTRON-SFPS-COMMON-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CTRON-SFPS-COMMON-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:30:50 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... | (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_union, single_value_constraint, constraints_intersection) ... |
print("git UNT ")
print("git lunes")
| print('git UNT ')
print('git lunes') |
def metaLine2metaDict(metaLine):
metaDict = {}
fields = metaLine.split(';')
for field in fields:
fl = field.split('=')
subfieldName = fl[0]
fieldInfo = fl[1]
metaDict[subfieldName] = fieldInfo
return metaDict
def getGeneInformationFromGFFline(line, field):
result = False
if not line.startswith('#'):
l... | def meta_line2meta_dict(metaLine):
meta_dict = {}
fields = metaLine.split(';')
for field in fields:
fl = field.split('=')
subfield_name = fl[0]
field_info = fl[1]
metaDict[subfieldName] = fieldInfo
return metaDict
def get_gene_information_from_gf_fline(line, field):
... |
s=input('Enter Main String:')
subs=input('Enter Substring to search:')
if subs in s:
print(subs, 'Is found in Main String')
else:
print(subs, 'is not found in Main String')
| s = input('Enter Main String:')
subs = input('Enter Substring to search:')
if subs in s:
print(subs, 'Is found in Main String')
else:
print(subs, 'is not found in Main String') |
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: FBS
class FByteDataType(object):
UINT8 = 0
FLOAT16 = 1
FLOAT32 = 2
PNG = 3
JPEG = 4
Other = 5
| class Fbytedatatype(object):
uint8 = 0
float16 = 1
float32 = 2
png = 3
jpeg = 4
other = 5 |
FILE_PATH = './Day4/input.txt'
def parseData(recordData):
record = {}
for data in recordData:
fieldPairs = data.split(' ')
for fieldPair in fieldPairs:
field, value = fieldPair.split(':')
record[field] = value
if field not in ['byr', 'iyr', 'eyr', 'hgt', '... | file_path = './Day4/input.txt'
def parse_data(recordData):
record = {}
for data in recordData:
field_pairs = data.split(' ')
for field_pair in fieldPairs:
(field, value) = fieldPair.split(':')
record[field] = value
if field not in ['byr', 'iyr', 'eyr', 'hgt',... |
print(60*'=')
print(' CAIXA ELETRONICO ')
print(60*'=')
total = int(input('Que valor deseja sacar ? R$ '))
cedula = 50
totalced = 0
while True:
if total >= cedula:
total-=cedula
totalced+=1
print(total)
else:
if totalced>0:
print(f'Total de {tota... | print(60 * '=')
print(' CAIXA ELETRONICO ')
print(60 * '=')
total = int(input('Que valor deseja sacar ? R$ '))
cedula = 50
totalced = 0
while True:
if total >= cedula:
total -= cedula
totalced += 1
print(total)
else:
if totalced > 0:
print(f'Total de {totalce... |
class BaseRandomizer():
def __init__(self, projectName=None, seed=None, programMode=True) -> None:
self.seed = seed
if programMode:
self.inputPath = f'projects/{projectName}/tmp/text/'
else:
self.inputPath = f'projects/{projectName}/text/' | class Baserandomizer:
def __init__(self, projectName=None, seed=None, programMode=True) -> None:
self.seed = seed
if programMode:
self.inputPath = f'projects/{projectName}/tmp/text/'
else:
self.inputPath = f'projects/{projectName}/text/' |
def padlindromic_date1(date1):
d,m,y = date1.split('/')
return (d+y)[::-1] == y and (m+d) [::-1] == y
def padlindromic_date2(date2):
dd,mm,yyyy = date2.split('/')
date11 = ''.join([dd,mm,yyyy])
date12 = ''.join([mm,dd,yyyy])
return date11 == date11[::-1] and date12 == date12[::-1]
def ... | def padlindromic_date1(date1):
(d, m, y) = date1.split('/')
return (d + y)[::-1] == y and (m + d)[::-1] == y
def padlindromic_date2(date2):
(dd, mm, yyyy) = date2.split('/')
date11 = ''.join([dd, mm, yyyy])
date12 = ''.join([mm, dd, yyyy])
return date11 == date11[::-1] and date12 == date12[::-1... |
sum = 0
for i in range(1,1000):
if i%3==0 or i%5==0:
sum += i
print(sum)
| sum = 0
for i in range(1, 1000):
if i % 3 == 0 or i % 5 == 0:
sum += i
print(sum) |
class ORMBaseException(Exception):
def __init__(self):
self.message = ""
super().__init__()
def __str__(self):
return self.message
class FieldDoesNotExist(ORMBaseException):
def __init__(self, field: str):
self.message = f"This field '{field}' is not avaible"
| class Ormbaseexception(Exception):
def __init__(self):
self.message = ''
super().__init__()
def __str__(self):
return self.message
class Fielddoesnotexist(ORMBaseException):
def __init__(self, field: str):
self.message = f"This field '{field}' is not avaible" |
#Translation table for atomic numbers to element names and vice versa
#Note that the NIST database provides data up to atomic number 92 (= Uranium)
#Last column contains material densities
ElementaryData = [
(0, "Void", "X", 0),
(1, "Hydrogen", "H", 8.375E-05),
(2, "Helium", ... | elementary_data = [(0, 'Void', 'X', 0), (1, 'Hydrogen', 'H', 8.375e-05), (2, 'Helium', 'He', 0.0001663), (3, 'Lithium', 'Li', 0.534), (4, 'Beryllium', 'Be', 1.848), (5, 'Boron', 'B', 2.37), (6, 'Carbon', 'C', 1.7), (7, 'Nitrogen', 'N', 0.001165), (8, 'Oxygen', 'O', 0.001332), (9, 'Fluorine', 'F', 0.00158), (10, 'Neon',... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Phoenix1327'
a = 'ABC'
b = a
a = 'XYZ'
print(b)
# a --> 'ABC'
# b --> a --> 'ABC'(i.e. b --> 'ABC')
# a --> 'XYZ'
#exercise
n = 123
f = 456.789
s1 = 'Hello, world'
s2 = 'Hello, \'Adam\''
s3 = r'Hello, "Bart"'
s4 = r'''Hello,
Lisa!'''
print (n)
print (f)
p... | __author__ = 'Phoenix1327'
a = 'ABC'
b = a
a = 'XYZ'
print(b)
n = 123
f = 456.789
s1 = 'Hello, world'
s2 = "Hello, 'Adam'"
s3 = 'Hello, "Bart"'
s4 = 'Hello,\nLisa!'
print(n)
print(f)
print(s1)
print(s2)
print(s3)
print(s4) |
class URL(object):
BASE_URL = 'https://uatapi.nimbbl.tech/api'
ORDER_URL = "/orders"
AUTHURL = "v2/generate-token";
ORDER_CREATE = "v2/create-order";
ORDER_GET = "v2/get-order";
ORDER_LIST = "orders/many?f=&pt=yes";
LIST_QUERYPARAM1 = "f";
LIST_QUERYPARAM2 = "pt";
NO = "no";... | class Url(object):
base_url = 'https://uatapi.nimbbl.tech/api'
order_url = '/orders'
authurl = 'v2/generate-token'
order_create = 'v2/create-order'
order_get = 'v2/get-order'
order_list = 'orders/many?f=&pt=yes'
list_queryparam1 = 'f'
list_queryparam2 = 'pt'
no = 'no'
empty = ''
... |
#!/usr/bin/python
# encoding: utf-8
def search(key, *args, kwargs):
pass
if __name__ == "__main__":
pass
| def search(key, *args, kwargs):
pass
if __name__ == '__main__':
pass |
# -*- coding: utf-8 -*-
# @Author: rish
# @Date: 2020-08-02 23:03:40
# @Last Modified by: rish
# @Last Modified time: 2020-08-04 01:20:05
def info():
print(
'er_extractor module - functionality for data collection of exchange\
rates based on provided arguments and persistence of data collected\
into the da... | def info():
print('er_extractor module - functionality for data collection of exchange\t\trates based on provided arguments and persistence of data collected\t\tinto the database.') |
class Node(object):
def __init__(self, value = None, leftChild = None, rightChild = None):
self.value = value
self.leftChild = leftChild
self.rightChild = rightChild
| class Node(object):
def __init__(self, value=None, leftChild=None, rightChild=None):
self.value = value
self.leftChild = leftChild
self.rightChild = rightChild |
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def lowestCommonAncestor(self, root, p, q):
if root is None or root == p or root == q:
return root
l = self.lowestCommonAncestor(root.left, p, q)
... | class Treenode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def lowest_common_ancestor(self, root, p, q):
if root is None or root == p or root == q:
return root
l = self.lowestCommonAncestor(root.left, p, q)
... |
class Writing:
'''
--help = This class provides the working of TOEFL Writing section.
'''
def question(self):
pass
def __init__(self):
pass
## TODO: Label - instructions, question
## TODO: Text Field - Write answerd
| class Writing:
"""
--help = This class provides the working of TOEFL Writing section.
"""
def question(self):
pass
def __init__(self):
pass |
class GameObject:
def __init__(self, data, localizer):
# self.key will be set prior to invoking _name()
self.key = self._key(data)
self.name = self._name(localizer)
self.prerequisites = self._prerequisites(data[self.key])
def _name(self, localizer):
return localizer.get(... | class Gameobject:
def __init__(self, data, localizer):
self.key = self._key(data)
self.name = self._name(localizer)
self.prerequisites = self._prerequisites(data[self.key])
def _name(self, localizer):
return localizer.get(self.key)
def _key(self, data):
return list... |
ALL_LETTERS = [
letter.lower()
for letter in [
"E",
"A",
"R",
"I",
"O",
"T",
"N",
"S",
"L",
"C",
"U",
"D",
"P",
"M",
"H",
"G",
"B",
"F",
"Y",
"W",
... | all_letters = [letter.lower() for letter in ['E', 'A', 'R', 'I', 'O', 'T', 'N', 'S', 'L', 'C', 'U', 'D', 'P', 'M', 'H', 'G', 'B', 'F', 'Y', 'W', 'K', 'V', 'X', 'Z', 'J', 'Q']]
class Gamestate:
def __init__(self, word_length=5):
self.word_length = word_length
self.unexplored_letters = ALL_LETTERS
... |
class PistonResponse:
def __init__(self, data: dict) -> None:
self.ran = data.get("ran")
self.language = data.get("language")
self.version = data.get("version")
self.stdout = data.get("stdout")
self.stderr = data.get("stderr")
self.output = data.get("output"... | class Pistonresponse:
def __init__(self, data: dict) -> None:
self.ran = data.get('ran')
self.language = data.get('language')
self.version = data.get('version')
self.stdout = data.get('stdout')
self.stderr = data.get('stderr')
self.output = data.get('output')
de... |
# 066 - TRATANDO VARIOS VALORES V1.0
# LER VARIOS NUMEROS INTEIROS, PARA QUANDO FOR DIGITADO 999 E SOMAR TODOS DIGITADOS
# DESCONSIDERANDO 999
somar = qtd = 0
while True:
n = int(input('Digite um numero: [Digite 999 para parar[: '))
if n == 999:
break
somar += n
qtd += 1
print(f'Foram digitado... | somar = qtd = 0
while True:
n = int(input('Digite um numero: [Digite 999 para parar[: '))
if n == 999:
break
somar += n
qtd += 1
print(f'Foram digitados {qtd} numeros, com o total de {somar}') |
class MissingVenvException(Exception):
def __init__(self, msg=''):
super().__init__(msg)
class CantRunProgramException(Exception):
def __init__(self, msg=''):
super().__init__(msg)
class NoPythonExeFound(Exception):
def __init__(self, msg=''):
super().__init__(msg='')
class N... | class Missingvenvexception(Exception):
def __init__(self, msg=''):
super().__init__(msg)
class Cantrunprogramexception(Exception):
def __init__(self, msg=''):
super().__init__(msg)
class Nopythonexefound(Exception):
def __init__(self, msg=''):
super().__init__(msg='')
class Nop... |
# Sem else Condicao simples
# Com else Condicao composta
nome = str(input('Qual eh o seu nome: '))
if nome == 'Rafael':
print('Que nome lindo voce tem!')
else:
print('Seu nome eh tao normal!')
print('Bom dia, {}' .format(nome)) | nome = str(input('Qual eh o seu nome: '))
if nome == 'Rafael':
print('Que nome lindo voce tem!')
else:
print('Seu nome eh tao normal!')
print('Bom dia, {}'.format(nome)) |
class Cliente:
def __init__(self, nome, sexo, data_nascimento, email, profissao, endereco):
self.__nome = nome
self.__sexo = sexo
self.__data_nascimento = data_nascimento
self.__email = email
self.__profissao = profissao
self.__endereco = endereco
@property
d... | class Cliente:
def __init__(self, nome, sexo, data_nascimento, email, profissao, endereco):
self.__nome = nome
self.__sexo = sexo
self.__data_nascimento = data_nascimento
self.__email = email
self.__profissao = profissao
self.__endereco = endereco
@property
... |
# 3.3 Write a program to prompt for a score between 0.0 and 1.0.
# If the score is out of range, print an error.
# If the score is between 0.0 and 1.0, print a grade using the following table:
# Score Grade
# >= 0.9 A
# >= 0.8 B
# >= 0.7 C
# >= 0.6 D
# < 0.6 F
# If the user enters a value out of range,
# print a sui... | score = float(input('Enter the score between 0.0 and 1.0'))
if score > 1.0 and score < 0.0:
print('Error out of range input.')
elif score >= 0.9:
print('A')
elif score >= 0.8:
print('B')
elif score >= 0.7:
print('C')
elif score >= 0.6:
print('D')
elif score < 0.6:
print('F')
else:
print('Inv... |
num_1 = int(input("Enter a number: "))
num_3 = 0
while num_1 > 0:
num_2 = num_1 % 10
print(num_2,end = "")
num_1 = num_1 // 10
num_3 = num_3 + num_2
print(" ",num_2**3)
print(" ")
print(num_3)
| num_1 = int(input('Enter a number: '))
num_3 = 0
while num_1 > 0:
num_2 = num_1 % 10
print(num_2, end='')
num_1 = num_1 // 10
num_3 = num_3 + num_2
print(' ', num_2 ** 3)
print(' ')
print(num_3) |
class Solution:
def maximalRectangle(self, matrix):
res, m, n = 0, len(matrix), len(matrix and matrix[0])
for i in range(m):
for j in range(n):
if matrix[i][j] != "0":
if j > 0 and matrix[i][j - 1] != "0":
matrix[i][j] = matrix[... | class Solution:
def maximal_rectangle(self, matrix):
(res, m, n) = (0, len(matrix), len(matrix and matrix[0]))
for i in range(m):
for j in range(n):
if matrix[i][j] != '0':
if j > 0 and matrix[i][j - 1] != '0':
matrix[i][j] = m... |
database = {
'name': 'splice_auth_db',
'user': 'postgres',
'password': '#100100Borjan',
'host': '127.0.0.1',
'port': 5432,
}
mail = {
'host': 'localhost',
'port': 25,
'user': '',
'password': '#100100Borjan',
'tls': False,
'ssl': False,
}
| database = {'name': 'splice_auth_db', 'user': 'postgres', 'password': '#100100Borjan', 'host': '127.0.0.1', 'port': 5432}
mail = {'host': 'localhost', 'port': 25, 'user': '', 'password': '#100100Borjan', 'tls': False, 'ssl': False} |
class State(object):
def __init__(self, data):
self.data = data
pass
def change_data(self, data):
self.data = data
| class State(object):
def __init__(self, data):
self.data = data
pass
def change_data(self, data):
self.data = data |
# coding=utf-8
KEYBOARD_URL_MAPS = {
'default': [
[
'Site wide shortcuts', # keyboard category
[
# ('keyboard shortcut', 'keyboard info')
('s', 'Focus search bar'),
('g n', 'Go to Notifications'),
('g h', 'Go to person... | keyboard_url_maps = {'default': [['Site wide shortcuts', [('s', 'Focus search bar'), ('g n', 'Go to Notifications'), ('g h', 'Go to personal page'), ('?', 'Bring up this help dialog')]], ['Registration and login', [('l r', 'Open register window'), ('l o', 'Open login window'), ('l t', 'Logout'), ('l c', 'Close register... |
class Files:
path = './coordinates/'
qatar = 'qatar.csv'
western_sahara = 'western_sahara.csv'
uruguay = 'uruguay.csv'
djibouti = 'djibouti.csv'
random_10_cities = 'random_10_cities.csv'
random_20_cities = 'random_20_cities.csv'
random_30_cities = 'random_30_cities.csv'
# config
class ... | class Files:
path = './coordinates/'
qatar = 'qatar.csv'
western_sahara = 'western_sahara.csv'
uruguay = 'uruguay.csv'
djibouti = 'djibouti.csv'
random_10_cities = 'random_10_cities.csv'
random_20_cities = 'random_20_cities.csv'
random_30_cities = 'random_30_cities.csv'
class Enconfig:
... |
number = int(input("Which number do you want to check? "))
if number % 2==0:
print("Even")
else:
print("Odd")
| number = int(input('Which number do you want to check? '))
if number % 2 == 0:
print('Even')
else:
print('Odd') |
class DataRandomAccess():
def __init__(self, dataset):
self._dataset = dataset
self._scheme = dataset._scheme
def __getitem__(self, slice):
return self._scheme.ra(slice) | class Datarandomaccess:
def __init__(self, dataset):
self._dataset = dataset
self._scheme = dataset._scheme
def __getitem__(self, slice):
return self._scheme.ra(slice) |
num = int(input())
num2 = int(input())
soma = num + num2
print('X = {}'.format(soma))
| num = int(input())
num2 = int(input())
soma = num + num2
print('X = {}'.format(soma)) |
print('hey its a calculator')
print('select from thr below')
print('select 1 for addtion, 2 for multiplication, 3 for division, 4 for substract')
while True:
try:
opearation = int(input('select 1 or 2 or 3 or 4 : '))
break
except ValueError:
print("pls enter a number")
while True:
... | print('hey its a calculator')
print('select from thr below')
print('select 1 for addtion, 2 for multiplication, 3 for division, 4 for substract')
while True:
try:
opearation = int(input('select 1 or 2 or 3 or 4 : '))
break
except ValueError:
print('pls enter a number')
while True:
tr... |
# Column/Label Types
NULL = 'null'
CATEGORICAL = 'categorical'
TEXT = 'text'
NUMERICAL = 'numerical'
ENTITY = 'entity'
# Feature Types
ARRAY = 'array'
| null = 'null'
categorical = 'categorical'
text = 'text'
numerical = 'numerical'
entity = 'entity'
array = 'array' |
class Driver:
def __init__(self, cores: int) -> None:
self._cores = cores
def shield_cpu(self, *cpu):
pass
def unshield_cpu(self, *cpu):
pass
| class Driver:
def __init__(self, cores: int) -> None:
self._cores = cores
def shield_cpu(self, *cpu):
pass
def unshield_cpu(self, *cpu):
pass |
i = 40 - 3
for j in range(3, 12, 2):
print(j)
i = i + 1
print(i)
| i = 40 - 3
for j in range(3, 12, 2):
print(j)
i = i + 1
print(i) |
#qualquer coisa
c =10
d =2
print(c/d)
a = c + d
e = c + d | c = 10
d = 2
print(c / d)
a = c + d
e = c + d |
# Jim Lawless
# License: https://github.com/jimlawless/AoC2020/LICENSE
x=0
y=0
# treat N,W as -1, S,W as +1.
# NESW
directions=[-1,1,1,-1]
# begin with East
direction=1
infile = open("input.txt","r")
for line in infile:
line=line.rstrip()
cmd=line[0:1]
arg=int(line[1:])
if cmd=="F":
... | x = 0
y = 0
directions = [-1, 1, 1, -1]
direction = 1
infile = open('input.txt', 'r')
for line in infile:
line = line.rstrip()
cmd = line[0:1]
arg = int(line[1:])
if cmd == 'F':
if direction == 0 or direction == 2:
y = y + directions[direction] * arg
else:
x = x +... |
print(4 + 4)
print(10 - 2)
print(2 * 4)
print(int(64 / 8))
| print(4 + 4)
print(10 - 2)
print(2 * 4)
print(int(64 / 8)) |
def next0(A,n,x):
while x<n and A[x]!=0:
x+=1
return x
n=int(input())
A=[int(j) for j in input().split()]
b=0
for i in range(n):
if A[i]==1:
b=next0(A,n,max(b,i))
if b==n:
break
A[i],A[b]=A[b],A[i]
for i in A:
print(i,end=" ")
| def next0(A, n, x):
while x < n and A[x] != 0:
x += 1
return x
n = int(input())
a = [int(j) for j in input().split()]
b = 0
for i in range(n):
if A[i] == 1:
b = next0(A, n, max(b, i))
if b == n:
break
(A[i], A[b]) = (A[b], A[i])
for i in A:
print(i, end=' ') |
c = get_config() # get the config object
c.IPKernelApp.pylab = 'inline' # in-line figure when using Matplotlib
c.NotebookApp.ip = '*'
c.NotebookApp.allow_remote_access = True # allow access from outside localhost
c.NotebookApp.open_browser = False # do not open a browser window by default when using notebooks
c.Note... | c = get_config()
c.IPKernelApp.pylab = 'inline'
c.NotebookApp.ip = '*'
c.NotebookApp.allow_remote_access = True
c.NotebookApp.open_browser = False
c.NotebookApp.notebook_dir = '/notebooks'
c.NotebookApp.allow_root = True |
class Solution:
def reverse(self, x: int) -> int:
reverse = ''
num = x
if num < 0:
neg = True
num = -1 * (num)
num = str(num)
for i in range (len(num),0,-1):
reverse += num[i-1]
final = (-1 * int(reverse))
... | class Solution:
def reverse(self, x: int) -> int:
reverse = ''
num = x
if num < 0:
neg = True
num = -1 * num
num = str(num)
for i in range(len(num), 0, -1):
reverse += num[i - 1]
final = -1 * int(reverse)
el... |
def groupAnagrams(strs):
x=[[i,tuple(sorted(list(i)))] for i in strs]
# print(x)
d= {}
for i,j in x:
if j not in d:
d[j] = [i]
else:
d[j].append(i)
return(d.values()) | def group_anagrams(strs):
x = [[i, tuple(sorted(list(i)))] for i in strs]
d = {}
for (i, j) in x:
if j not in d:
d[j] = [i]
else:
d[j].append(i)
return d.values() |
number = "9,223,372,036,854,775,807"
cleanedNumber = ''
for i in range(0, len(number)):
if number[i] in '0123456789':
cleanedNumber = number[i]
newNumber = int(cleanedNumber)
print("The number is {} ".format(newNumber))
x = 23
x += 1
print(x)
x -= 4
print(x)
x *= 5
print(x)
x /= 4
print(x)
x **=2
p... | number = '9,223,372,036,854,775,807'
cleaned_number = ''
for i in range(0, len(number)):
if number[i] in '0123456789':
cleaned_number = number[i]
new_number = int(cleanedNumber)
print('The number is {} '.format(newNumber))
x = 23
x += 1
print(x)
x -= 4
print(x)
x *= 5
print(x)
x /= 4
print(x)
x **= 2
print(... |
n, l, r = map(int, input().split())
box = []
for i in range(n):
box += [list(map(int, input().split()))]
total = 0
for i in range(n):
firstX = box[i][0] + box[i][1]
lastX = box[i][2] + box[i][3]
fx, lx = max(firstX, l), min(lastX, r)
uly = min(lx - box[i][2], box[i][3])
dly = max(box[i][3]+(lx... | (n, l, r) = map(int, input().split())
box = []
for i in range(n):
box += [list(map(int, input().split()))]
total = 0
for i in range(n):
first_x = box[i][0] + box[i][1]
last_x = box[i][2] + box[i][3]
(fx, lx) = (max(firstX, l), min(lastX, r))
uly = min(lx - box[i][2], box[i][3])
dly = max(box[i][... |
#
D = {4:5, "apple":6, (4,3):"test"}
print(D)
print('\n')
for key in D:
print(key,D[key])
print('\n')
for item in D.items():
print(item)
print('\n')
for key,value in D.items():
print(key,value)
print('\n')
for value in D.values():
print(value)
print('\n')
L = [4 , 5, 7]
for ind,item in enumerat... | d = {4: 5, 'apple': 6, (4, 3): 'test'}
print(D)
print('\n')
for key in D:
print(key, D[key])
print('\n')
for item in D.items():
print(item)
print('\n')
for (key, value) in D.items():
print(key, value)
print('\n')
for value in D.values():
print(value)
print('\n')
l = [4, 5, 7]
for (ind, item) in enumerat... |
# From : https://en.wikipedia.org/wiki/Computation_of_cyclic_redundancy_checks
# Most significant bit first (big-endian)
# x^16+x^12+x^5+1 = (1) 0001 0000 0010 0001 = 0x1021
def crc16(data):
rem = 0
n = 16
# A popular variant complements rem here
for d in data:
rem = rem ^ (d << (n-8)) # n... | def crc16(data):
rem = 0
n = 16
for d in data:
rem = rem ^ d << n - 8
for j in range(1, 8):
if rem & 32768:
rem = rem << 1 ^ 4129
else:
rem = rem << 1
rem = rem & 65535
return rem |
flash_size_table = {}
flash_size_table['4'] = 16
flash_size_table['6'] = 32
flash_size_table['8'] = 64
flash_size_table['B'] = 128
flash_size_table['C'] = 256
flash_size_table['D'] = 384
flash_size_table['E'] = 512
flash_size_table['F'] = 768
flash_size_table['G'] = 1024
flash_size_table['I'] = 2048
flash_si... | flash_size_table = {}
flash_size_table['4'] = 16
flash_size_table['6'] = 32
flash_size_table['8'] = 64
flash_size_table['B'] = 128
flash_size_table['C'] = 256
flash_size_table['D'] = 384
flash_size_table['E'] = 512
flash_size_table['F'] = 768
flash_size_table['G'] = 1024
flash_size_table['I'] = 2048
flash_size_table['K... |
def test():
assert (
"import Doc, Span" in __solution__ or "import Span, Doc" in __solution__
), "Did you import the Doc and Span correctly?"
assert doc.text == "I like David Bowie", "Did you create the Doc correctly?"
assert span.text == "David Bowie", "Did you create the span correctly?"
a... | def test():
assert 'import Doc, Span' in __solution__ or 'import Span, Doc' in __solution__, 'Did you import the Doc and Span correctly?'
assert doc.text == 'I like David Bowie', 'Did you create the Doc correctly?'
assert span.text == 'David Bowie', 'Did you create the span correctly?'
assert span.label... |
# mensagens que aparecem no "sistema"
# instructions
INPUT_INST = "Enter info:"
VAL1 = "FIRST VALUE"
VAL2 = "SECOND VALUE"
VAL3 = "THIRD VALUE"
op1 = "1 TO TEST A SAMPLE"
op2 = "2 TO END CONECTION"
# success
CONNECTED = "CONNECTED TO... | input_inst = 'Enter info:'
val1 = 'FIRST VALUE'
val2 = 'SECOND VALUE'
val3 = 'THIRD VALUE'
op1 = '1 TO TEST A SAMPLE'
op2 = '2 TO END CONECTION'
connected = 'CONNECTED TO SERVER.'
processing = '10 - Data received, PROCESSING...'
ok = '20 - OK'
connection_error = '53 - Service Unavailable :('
server_error = '50 - Intern... |
pos=-1
def binarysearch(lst,num):
'''Function that returns True and index number of element if found else returns False and -1'''
lst.sort()#any sort algorithm can be used
print(lst)
l=0
u=len(lst)-1
while l<= u:
mid=(u+l)//2
if lst[mid] == num:
global pos
pos=mid
return True,pos
else:
... | pos = -1
def binarysearch(lst, num):
"""Function that returns True and index number of element if found else returns False and -1"""
lst.sort()
print(lst)
l = 0
u = len(lst) - 1
while l <= u:
mid = (u + l) // 2
if lst[mid] == num:
global pos
pos = mid
... |
suffix = ['', 'K', 'M', 'B', 'T', 'P']
def human_format(num):
num = float('{:.3g}'.format(num))
magnitude = 0
while abs(num) >= 1000:
magnitude += 1
num /= 1000.0
return '{}{}'.format('{:f}'.format(num).rstrip('0').rstrip('.'), suffix[magnitude])
| suffix = ['', 'K', 'M', 'B', 'T', 'P']
def human_format(num):
num = float('{:.3g}'.format(num))
magnitude = 0
while abs(num) >= 1000:
magnitude += 1
num /= 1000.0
return '{}{}'.format('{:f}'.format(num).rstrip('0').rstrip('.'), suffix[magnitude]) |
#
# PySNMP MIB module NNCEXTSPVC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NNCEXTSPVC-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:22:57 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, constraints_intersection, single_value_constraint, value_size_constraint, value_range_constraint) ... |
# Client Messages
disconnectServer = "[x] Server disconnected."
keysUnpacked = "[+] Symmetric keys unpacked."
keysUnpackFail = "[x] Keys not unpacked. Try again."
welcome = "@Yo: You're in. Welcome to the underground."
# Default Commands
bootNoUser = "[!] Which user do you want to boot? Eg: /boot <user>"
bootUserNotFo... | disconnect_server = '[x] Server disconnected.'
keys_unpacked = '[+] Symmetric keys unpacked.'
keys_unpack_fail = '[x] Keys not unpacked. Try again.'
welcome = "@Yo: You're in. Welcome to the underground."
boot_no_user = '[!] Which user do you want to boot? Eg: /boot <user>'
boot_user_not_found = '[x] No one here by tha... |
# name: csc_devices.py
# desc: lists all devices with devicename, IP, username, password, secret
router_013 = {'device_name': 'router_013', 'device_type': 'cisco_nxos', 'ip': '1.1.1.10', 'username': 'dummy_username', 'password': 'dummy_password', 'port': 22, 'verbose': False, 'secret': 'dummy_secret', }
router_023... | router_013 = {'device_name': 'router_013', 'device_type': 'cisco_nxos', 'ip': '1.1.1.10', 'username': 'dummy_username', 'password': 'dummy_password', 'port': 22, 'verbose': False, 'secret': 'dummy_secret'}
router_023 = {'device_name': 'router_023', 'device_type': 'cisco_nxos', 'ip': '1.1.1.11', 'username': 'dummy_usern... |
# class Persona:
# #def __init__(self):
# def __init__(self,nombre,apellido,edad):
# self.nombre = nombre
# self.apellido = apellido
# self.edad = edad
# persona1 = Persona('Juan','Castellanos',21)
# print(f'Objeto Persona 1: {persona1.nombre} {persona1.apellido} {persona1.edad}')
# #M... | class Person:
def __init__(self, name: str, last_name: str, age: int):
self.name = name
self.last_name = last_name
self.age = age
def show_details(self):
print(f'Person: {self.name} {self.last_name} {self.age}')
persona1 = person('Juan', 'Castellanos', 21)
persona1.show_details... |
#
# PySNMP MIB module XEDIA-DRIVER-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/XEDIA-DRIVER-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:42:41 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar ... | (object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, constraints_intersection, value_range_constraint, single_value_constraint, value_size_constraint) ... |
DEFAULT_FILENAME = "output_test_file.txt"
DEFAULT_CONTENT = [
"Obi-Wan Kenobi: Hello there.",
"General Grievous: General Kenobi. You are a bold one."
]
def main():
filename = DEFAULT_FILENAME
content = DEFAULT_CONTENT;
with open(filename, "w") as text_file:
for line in content:
... | default_filename = 'output_test_file.txt'
default_content = ['Obi-Wan Kenobi: Hello there.', 'General Grievous: General Kenobi. You are a bold one.']
def main():
filename = DEFAULT_FILENAME
content = DEFAULT_CONTENT
with open(filename, 'w') as text_file:
for line in content:
text_file.w... |
#
# PySNMP MIB module XYLAN-ATM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/XYLAN-ATM-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:44:48 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... | (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, value_range_constraint, value_size_constraint, constraints_union, single_value_constraint) ... |
def count_down(num):
if num == 0:
return 0
else:
print(num)
num = num -1
return count_down(num)
print(count_down(10)) | def count_down(num):
if num == 0:
return 0
else:
print(num)
num = num - 1
return count_down(num)
print(count_down(10)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.