content stringlengths 7 1.05M |
|---|
operacao = str(input())
soma = media = contador = 0
matriz = [[], [], [], [], [], [], [], [], [], [], [], []]
for linha in range(0, 12):
for coluna in range(0, 12):
n = float(input())
matriz[linha].append(n)
for linha in range(0, 12):
for coluna in range(0, 12):
if coluna > 11 - linha:
... |
class InvalidNibbles(Exception):
pass
class InvalidNode(Exception):
pass
class ValidationError(Exception):
pass
class BadTrieProof(Exception):
pass
class NodeOverrideError(Exception):
pass
class InvalidKeyError(Exception):
pass
class SyncRequestAlreadyProcessed(Exception):
pass
|
"""
1923. Longest Common Subpath
Hard
There is a country of n cities numbered from 0 to n - 1. In this country, there is a road connecting every pair of cities.
There are m friends numbered from 0 to m - 1 who are traveling through the country. Each one of them will take a path consisting of some cities. Each path i... |
class fifth():
def showclass(self):
self.name="hira"
print(self.name)
class ninth(fifth):
def showclass(self):
self.name="khira"
print(self.name)
print("after reset")
super().showclass()
st1=fifth()
st2=ninth()
st2.showclass()
|
#
# @lc app=leetcode.cn id=290 lang=python3
#
# [290] 单词模式
#
# https://leetcode-cn.com/problems/word-pattern/description/
#
# algorithms
# Easy (36.58%)
# Total Accepted: 5.2K
# Total Submissions: 13.8K
# Testcase Example: '"abba"\n"dog cat cat dog"'
#
# 给定一种 pattern(模式) 和一个字符串 str ,判断 str 是否遵循相同的模式。
#
# 这里的遵循指完全匹配... |
#=========================filter===========================
# def isodd(x):
# return x%2==0
# for x in filter(isodd, range(10)):
# print(x)
#===============practice================
#1. find the even number from 1 - 20 by using filter
even=[x for x in filter(lambda x: x%2==0, range(1,21))]
print (even)
#2. fin... |
def truncate_fields(obj):
for key, val in obj.iteritems():
if isinstance(val, dict):
obj[key] = truncate_fields(val)
elif isinstance(val, (list, tuple, )):
idx = -1
for subval in val:
idx += 1
obj[key][idx] = truncate_fields(subval)
elif isinstance(val, (str, unicode)) and key not in ['... |
class Node:
def __init__(self, initdata):
self.data = initdata
self.next = None
def getData(self):
return self.data
def getNext(self):
return self.next
def setData(self, newdata):
self.data = newdata
def setNext(self, newnext):
self.next = newnext
... |
class Maze:
class Node:
def __init__(self, position):
self.Position = position
self.Neighbours = [None, None, None, None]
#self.Weights = [0, 0, 0, 0]
def __init__(self, im):
width = im.width
height = im.height
data = list(im.getdata(0))
... |
'''
There is an integer array nums sorted in ascending order (with distinct values).
Prior to being passed to your function, nums is rotated at an unknown pivot index k (0 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed). For exam... |
def test_h1_css(self):
self.browser.get('http://localhost:8000')
h1 = self.browser.find_element_by_tag_name("h1")
print (h1.value_of_css_property("color"))
self.assertEqual(h1.value_of_css_property("color"), "rgb(255, 192, 203)") |
"""
437
medium
path sum 3
"""
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def pathSum(self, root, targetSum: int) -> int:
# trying presum
# f... |
def fibonacci(sequence_length):
"Return the Fibonacci sequence of length *sequence_length*"
sequence = [0,1]
if sequence_length < 1:
print("Fibonacci sequence only defined for length 1 or greater")
return
elif sequence_length >=3:
for i in range(2,sequence_length):
s... |
# This file is generated by sync-deps, do not edit!
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def default_github_callback(name, repository, commit, sha256):
repo_name = repository.split("/")[-1]
_maybe(
http_archive,
name = name,
sha256 = sha256,
strip... |
a=input("Enter the string:")
a=list(a)
count=0
for i in a:
count+=1
print("The length is:",count)
|
cards = ['K','Q', 'J' , 'A' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '10']
suits = ['Clubs' , 'Spades' , 'Diamond' , 'Hearts']
def poker_star(no_of_card:'int', no_of_player:'int', sequence_cardsA:'list', sequence_cardsB:'list') -> 'Match Winner':
"""returns winning player name
Input:
... |
def _bind_result(function):
"""
Composes successful container with a function that returns a container.
In other words, it modifies the function's
signature from: ``a -> Result[b, c]``
to: ``Container[a, c] -> Container[b, c]``
.. code:: python
>>> from returns.io import IOSuccess
... |
# -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
class ActiveDirectoryPrincipal(object):
"""Implementation of the 'ActiveDirectoryPrincipal' model.
Specifies information about a single principal in an Active Directory.
Attributes:
domain (string): Specifies the domain name of the where th... |
'''
Deleting specific records
By using a where() clause, you can target the delete statement to remove only certain records. For example, Jason deleted all columns from the employees table that had id 3 with the following delete statement:
delete(employees).where(employees.columns.id == 3)
Here you'll delete ALL row... |
#
# PySNMP MIB module TPLINK-pppoeConfig-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TPLINK-pppoeConfig-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:18:44 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (d... |
#!/usr/bin/python
def log(self,string):
print(str(self.__class__.__name__)+": "+str(string))
|
_base_ = "./FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_Blender_01_ape.py"
OUTPUT_DIR = "output/deepim/lmCropBlenderSO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_lmCropBlender_SO/duck"
DATASETS = dict(TRAIN=("lm_blender_duck_train",), TEST=("lm_crop_duck_test",))
# bbnc9
# iter0
# objects duck Avg(1)
# ad_2 ... |
infile='VisDrone2019-DET-val/val.txt'
outfile='visdrone_val.txt'
with open(outfile,'w') as w:
with open(infile,'r') as r:
filelist=r.readlines()
for line in filelist:
new_line=line.split('.')[0]
w.write(new_line+'\n')
|
class Intervalo:
def __init__(self, centro, radio):
self.centro = centro
self.radio = radio
def extremo_izquierdo(self):
return self.centro - self.radio
def extremo_derecho(self):
return self.centro + self.radio
def __eq__(self, intervalo):
return self.centro ... |
"""
(А.Н. Носкин) Исполнитель Калькулятор преобразует число на экране.
У исполнителя есть три команды, которым присвоены номера:
1. Прибавить 2
2. Прибавить 4
3. Прибавить 5
Определите число, для получения которого из числа 31 существует 1001 программа.
"""
def solve(src: int, limit: int):
commands = ... |
"""Standard gate set for Orquestra.
Convention for Gate objects currently supported:
Gate.name: string
Name of the quantum gate.
Gate.qubits: [Qubit]
List of Qubit objects, whose length depends on the number of qubits that the
gate acts on.
Gate.params: [float]
List of gate parameters.
For discr... |
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("yield Example1")
def createGenerator():
yield 2
yield 3
yield 1
for i in createGenerator():
print(i)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("yield Example2")
def createGenerator2():
print("createGenerator2 2")
yield 2
print("createGenerat... |
class AssemblySimulatorVMConfigException(Exception):
def __str__(self):
return "[ERROR] Error: AssemblySimulatorConfigError, Response: {0}".format(super().__str__())
|
def write_name_delbertina(input_turtle):
# d
input_turtle.right(90)
input_turtle.forward(50)
input_turtle.left(90)
input_turtle.pendown()
input_turtle.forward(30)
input_turtle.left(90)
input_turtle.forward(50)
input_turtle.left(180)
input_turtle.forward(30)
input_turtle.right... |
"""
Definition of TrieNode:
class TrieNode:
def __init__(self):
# <key, value>: <Character, TrieNode>
self.children = collections.OrderedDict()
self.top10 = []
"""
class TrieService:
def __init__(self):
self.root = TrieNode()
def get_root(self):
# Return root of tri... |
class Solution:
def threeEqualParts(self, A):
"""
:type A: List[int]
:rtype: List[int]
"""
ones = A.count(1)
one, rem = divmod(ones, 3)
if rem:
return [-1, -1]
l, r = 0, len(A) - 1
n = len(A)
cnt = 0
while l < len(A)... |
class TestUser:
def test_list_no_user(self, client):
"""Test if db contains no user."""
headers = {"X-Api-Key": "123"}
res = client.get("/api/user/list", headers=headers)
json_data = res.get_json()
assert json_data["code"] == 404
def test_crate_user(self, client):
... |
my_list=[22,333,412]
sum =0
for number in my_list:
sum += number
print(sum) |
#To accept 2 integers and display the largest among them
a=int(input("Enter Number:"))
b=int(input("Enter Number:"))
if a>b:
print (a,"is greater")
elif a<b:
print (b,"is greater")
else:
print ("Both Are Same Number")
|
class DataGridViewBindingCompleteEventArgs(EventArgs):
"""
Provides data for the System.Windows.Forms.DataGridView.DataBindingComplete event.
DataGridViewBindingCompleteEventArgs(listChangedType: ListChangedType)
"""
def Instance(self):
""" This function has been arbitrarily put into the stubs"""
r... |
# == , != (Int, float, str, bool)
x,y=6,7
p=6
print(x == y) #False
print(p == x) #True
print(p == 6.0) #True
print('Hello' == 'Hello') #True
#Chaining
print(10 == 20 == 6 == 3) #False
print(1 == 1 == 1 < 2) #True
print(1 !=2 < 3 > 1) #True |
#!python
class BinaryTreeNode(object):
def __init__(self, data):
"""Initialize this binary tree node with the given data."""
self.data = data
self.left = None
self.right = None
def __repr__(self):
"""Return a string representation of this binary tree node."""
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Solution:
"""
给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。
你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素
"""
def __init__(self):
pass
def twoSum1(self, nums, target):
for i in range(0, len(nums)):
for ... |
#!/usr/bin/env python3
#coding: utf-8
"""
Решение без проверок на ошибки ввода
"""
print('Перемножить два целых числа.')
a = int(input('Введите первое число:'))
b = int(input('Введите второе число:'))
print(a * b) |
bool1 = [[i*j for i in range(5)] for j in range(5)]
print(bool1)
for g in range(0,len(bool1[0])):
i = 0
for j in range(g,len(bool1[0])):
print(bool1[i][j])
i += 1 |
def check(expected, obtained):
try:
a = float(expected)
b = float(obtained)
except ValueError:
return False
return abs(a - b) <= 1e-3
|
_base_ = '../yolox/yolox_l_8x8_300e_coco.py'
model = dict(
bbox_head=dict(num_classes=1)
)
dataset_type = 'BasketballDetection'
# data_root = '/mnt/nfs-storage/yujiannan/data/bas_data/train_data/'
data_root = '/home/senseport0/data/train_data/'
data = dict(
samples_per_gpu=4,
workers_per_gp... |
# Python Program to print Unique Prime Factors of a Number
Number = int(input(" Please Enter any Number: "))
i = 1
my=[]
while(i <= Number):
count = 0
if(Number % i == 0):
j = 1
while(j <= i):
if(i % j == 0):
count = count + 1
j = j + 1
... |
#!/usr/bin/env python
# -*- coding=utf-8 -*-
names = ['huang', 'hu', 'zhang', 'zhao', 'li']
print(names[::-1]) # 可视为翻转操作。
print(names[::2]) # 隔一个取一个
"""输出结果
['li', 'zhao', 'zhang', 'hu', 'huang']
['huang', 'zhang', 'li']
""" |
# class describes one row in the Types sheet
class Marker:
def __init__(self, id: str, name: str, icon_name: str, prefix: str, marker_color: str, icon_color: str, spin: int, zoom_min: int, zoom_max: int, extra_classes: str, icon_url: str, shadow_url: str, icon_size: str, shadow_size: str, icon_anchor: str, shadow_... |
LOC_TEXTS_TH = {
"Intro/Instructions": "กดปุ่ม [F11] เพื่อเปิด/ปิดโหมดเต็มจอ",
"Game/Title": "นอนไม่หลับ 8 ชั่วโมง",
"Tools/Select/TooltipName": "เลือก",
"Tools/Place/TooltipName": "วาง (Ctrl + P)",
"Tools/Exit/TooltipName": "ออกไปยังเมนูหลัก",
"LocalizedText/None": "เปล่... |
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"Ability": "00_characters.ipynb",
"Character": "00_characters.ipynb",
"Mage": "00_characters.ipynb",
"Demon": "00_characters.ipynb",
"init_player": "01_game.ipynb",
... |
"""
Ex 11 - Make a algorithm that reads the wall's height and width in meters, calculate its area and how many liters ink is necessary to paint it, knowing that each liter of ink can paint 2m² of area
"""
print('calculate the paint needed to paint the wall: ')
print('-=' * 30)
h = input('Enter height: ').replace(',',... |
# Make strings collectable with gettext tools, but don't trnslate them here:
_ = lambda x: x
# Transaction types (TRXTYPE)...
SALE, CREDIT, AUTHORIZATION, DELAYED_CAPTURE, VOID, DUPLICATE_TRANSACTION = (
'S', 'C', 'A', 'D', 'V', 'N')
# ...for humans
trxtype_map = {
SALE: _('Sale'),
AUTHORIZATION: _('Autho... |
#Einfügen zweier Zahlen in eine Zeichenkette
text = "Leistung ({} kW) und Höchstgeschwindigkeit ({} km/h) sind hoch" # "{}" sind Platzhalter
print(text.format(80+10, 187.2)) # die Zahlen-Objekte 90 und 187.2 wurden in den String "text" eingefügt
print()
text1 = "Es war {} auf der Treppe und {} im Keller als... |
DATABASE_NAME = "devops"
TABLE_NAME = "host_metrics"
HT_TTL_HOURS = 24
CT_TTL_DAYS = 7
|
class _InitVarMeta(type):
def __getitem__(self, params):
return self
class InitVar(metaclass=_InitVarMeta):
pass
def dataclass(_cls=None, *, init=True, repr=True, eq=True, order=False,
unsafe_hash=False, frozen=False):
pass
def field(*, default=MISSING, default_factory=MISSING, in... |
token_symbols = {
"DAI": {"address": 0x6B175474E89094C44DA98B954EEDEAC495271D0F, "decimals": 18},
"USDC": {"address": 0xA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48, "decimals": 6},
"MKR": {"address": 0x9F8F72AA9304C8B593D555F12EF6589CC3A579A2, "decimals": 18},
"LINK": {"address": 0x514910771AF9CA656AF840DF... |
GRAM_FUNC_FEATURE = 'GramFunc'
PRODUCTION_ID_FEATURE = 'ProdId'
BRANCH_FEATURE = 'branch'
POS_FEATURE = 'POS'
INHERITED_FEATURE = 'inheritedFeature'
BRANCH_FEATURE = 'branch'
SLOT_FEATURE = 'slot'
PERSONAL_FEATURE = "personal"
INFLECTED_FEATURE = "inflected"
STATUS_FEATURE = 'status'
VCAT_FEATURE = 'vcat'
NUMBER_FEATUR... |
# 1. Vorlesung mit Python (3. zu Skriptsprachen insges. -- 26.09.2020 - 1. PDF dazu)
x = input ("Ihr Name? ")
X = "Hallo " + x
print (x)
x = input ("Ihr Alter? ")
x = int(x) - 5
print (x)
# Seite 12
liste = "Hello World"
print (liste)
print (liste[2])
# Seite 17
strvar = "ABC"
print (strvar)
strvar = "ABC" * 5
... |
# Static config for the wms metadata.
response_cfg = {
"Access-Control-Allow-Origin": "*", # CORS header
}
service_cfg = {
# Which web service(s) should be supported by this instance
"wcs": True,
"wms": True,
"wmts": True,
# Required config for WMS and/or WCS
# Service title - appears e.g... |
host = "localhost"
mongoPort = 27017
SOCKS5_PROXY_PORT = 1080
auth = ""
passcode = ""
# if proxy is not working please update the auth and passcode
|
floor=0
with open("input.txt") as dataFile:
line = dataFile.readline().rstrip()
for index,direction in enumerate(line):
if direction == "(":
floor +=1
else:
floor -=1
if floor == -1:
print("Basement index is : {}".format(index+1))
break
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
*****************************************
Author: zhlinh
Email: zhlinhng@gmail.com
Version: 0.0.1
Created Time: 2016-03-02
Last_modify: 2016-03-02
******************************************
'''
'''
Given a collection of integers that might ... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 26 03:19:29 2020
@author: Legedith
"""
def euler_problem():
problems = {1: 'Problem 1: Multiples of 3 and 5:\nIf we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.\n\nFind the sum of ... |
"""
@file : bst.py
@brief : Binary Search Tree (bst)
@details : BinarySearchTree TreeNode
@author : Ernest Yeung ernestyalumni@gmail.com
@date : 20170918
@ref : cf. http://interactivepython.org/runestone/static/pythonds/Trees/SearchTreeImplementation.html
https://github.com/bnmnet... |
"""Constants unsed in the tests."""
HANDLE_READ_VERSION_BATTERY = 0x38
HANDLE_READ_NAME = 0x03
HANDLE_READ_SENSOR_DATA = 0x35
HANDLE_WRITE_MODE_CHANGE = 0x33
DATA_MODE_CHANGE = bytes([0xA0, 0x1F])
TEST_MAC = '11:22:33:44:55:66'
INVALID_DATA = b'\xaa\xbb\xcc\xdd\xee\xff\x99\x88\x77\x66\x00\x00\x00\x00\x00\x00'
|
def parse(data):
for line in data.split("\n"):
add, val = line.split(" = ")
if add == "mask":
yield -1, int(val.replace("X", "1"), 2)
yield -2, int(val.replace("X", "0"), 2)
else:
yield int(add.split("[")[-1][:-1]), int(val)
def aoc(data):
mem = {-1:... |
#
# PySNMP MIB module ANS-COMMON-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ANS-COMMON-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:06:50 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... |
class Animal(object):
#Initialization function
def __init__(self, arm_length, leg_length, eyes, tail, furry):
self.arm_length = arm_length
self.leg_length = leg_length
self.eyes = eyes
self.tail = tail
self.furry = furry
#Function to print out and describe the data members
def describe(self):... |
"""
This file contains the base wrapper class for Mujoco environments.
Wrappers are useful for data collection and logging. Highly recommended.
"""
class Wrapper:
"""
Base class for all wrappers in robosuite.
Args:
env (MujocoEnv): The environment to wrap.
"""
def __init__(self, env):
... |
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Androguard is distributed in the hope that it will be useful,
#... |
"""
This class represents articles on an educational website.
Add a class variable for the license attribute,
which is always equal to "CC-BY-NC-SA".
"""
class Article:
"""
>>> article1 = Article("Logic", "Samuel Tarín")
>>> article1.get_byline()
'By Samuel Tarín, License: CC-BY-NC-SA'
>>> article2 = Article... |
dayOfWeek = input("What day of the week is it? ").lower()
print(dayOfWeek == "Monday")
### BAD CODE Use ELSE
if (dayOfWeek == "monday"):
print ("It is Monday!")
if (dayOfWeek != "monday"):
print("Keep on going!")
if (dayOfWeek == "monday"):
print ("It is Monday!")
elif (dayOfWeek == "tuesday"):
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ThomasHuke'
class Person(object):
def __len__(arg):
return 200
a = Person()
a1 = len(a)
print(a1)
|
class Node:
def __init__(self,data):
self.data=data
self.nref=None
self.pref=None
class doubly:
def __init__(self):
self.head=None
def forward(self):
n=self.head
if(n is None):
print("List is empty, you cant do any forward traversal")
else... |
"""
Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.
Example 1:
Input: "Hello"
Output: "hello"
Example 2:
Input: "here"
Output: "here"
Example 3:
Input: "LOVELY"
Output: "lovely"
"""
class Solution:
def toLowerCase(self, string):
"""
... |
# --------------------------------------------------------------------------------------
# Copyright (C) 2020—2021 by Timothy H. Click <tclick@okstate.edu>
#
# Permission to use, copy, modify, and/or distribute this software for any purpose
# with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS I... |
class Solution:
def toGoatLatin(self, S: str) -> str:
S = S.split()
vowels = set("aeiouAEIOU")
def f(i, word):
if word[0] in vowels:
word += "ma"
else:
word = word[1:] + word[0] + "ma"
word += "a" ... |
"""
Parameters of the agent.
The meaning of the different parameters are described below.
Setting debug_run = True allows a shorter run, only for debugging purposes.
"""
debug_run = False
env_seed = 13
random_seed = env_seed+1
nb_training_steps = int(5e6) if not debug_run else int(2e5) # Number of training steps
s... |
class StringBuffer(str):
def __init__(self, str=''): self.str = str
def __len__(self): return len(self.str)
def __contains__(self, obj): return str(obj) in self.str
def __iter__(self):
self.curr = 0
return iter(self.str)
def __next__(self):
self.curr += 1
if self.curr == len(self.str):
raise StopIterati... |
class SemaphoreAuditRule(AuditRule):
"""
Represents a set of access rights to be audited for a user or group. This class cannot be inherited.
SemaphoreAuditRule(identity: IdentityReference,eventRights: SemaphoreRights,flags: AuditFlags)
"""
@staticmethod
def __new__(self,identity,eventRights,flags):
... |
# from .project_files import ProjectFiles
# from .google_cloud_storage import GoogleCloudStorage
__all__ = [
# 'ProjectFiles',
# 'GoogleCloudStorage',
]
|
# Data sources
database(
thermoLibraries=['surfaceThermoNi111', 'surfaceThermoPt111', 'primaryThermoLibrary', 'thermo_DFT_CCSDTF12_BAC'],
reactionLibraries = [('Surface/Deutschmann_Ni', True)], # when Pt is used change the library to Surface/CPOX_Pt/Deutschmann2006
seedMechanisms = [],
kineticsDeposito... |
"""
mod1
"""
def decorator(f):
return f
@decorator
def func1(a, b):
"""
this is func1
"""
return a, b
@decorator
class Class1(object):
"""
this is Class1
"""
class Class3(object):
"""
this is Class3
"""
class_attr = 42
"""this is the class attribute class_attr... |
class Credentials:
'''
Class for generating account credentials,passwords and save this information
'''
credentials_list=[]
def __init__(self,site_name,account_name,account_password):
'''
method to define the properties each user object will hold
'''
self.site_... |
separators = {}
separators['af'] = separators['be'] = separators['bg'] = separators['cs'] = separators['de-AT'] = separators['en-FI'] = separators['en-SE'] = separators['en-ZA'] = separators['es-CR'] = separators['et'] = separators['fi'] = separators['fr'] = separators['hu'] = separators['ka'] = separators['kk'] = sep... |
def foo(bar):
class Foo:
call(bar)
|
"""
Python 3.6
meta_obj.py
Class to hold key model output file metadata.
Matt Nicholson
19 May 2020
"""
class MetaObj:
"""
Simple class to hold key metadata for a model output file.
Instance Attributes
-------------------
* dataset: str
Dataset (or model) that produced t... |
# -*- coding: utf-8 -*-
BOT_NAME = 'wsj'
SPIDER_MODULES = ['wsj.spiders']
NEWSPIDER_MODULE = 'wsj.spiders'
# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'wsj (+http://www.yourdomain.com)'
# Obey robots.txt rules
ROBOTSTXT_OBEY = True
# Configure maximum concurrent r... |
# -*- coding: utf-8 -*-
# Scrapy settings for politikdokumente project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
#
BOT_NAME = 'politikdokumente'
SPIDER_MODULES = ['poli... |
vowels = set('aeiou')
word = input("Provide a word to search for vowels:")
found = vowels.intersection(set(word))
for vowel in found:
print(vowel)
|
EXPERIMENT_XML = """<?xml version="1.0" encoding="UTF-8"?>
<ROOT request="DRX001563&display=xml">
<EXPERIMENT accession="DRX001563" center_name="RIKEN_CDB" alias="DRX001563" broker_name="DDBJ">
<IDENTIFIERS>
<PRIMARY_ID>DRX001563</PRIMARY_ID>
<SUBMITTER_ID namespace="RIKEN_CDB">DRX001563</S... |
description = 'XYZ-Omega sample table'
group = 'lowlevel'
excludes = ['samplechanger']
devices = dict(
x_m = device('nicos.devices.generic.VirtualMotor',
description = 'X axis sample table motor',
abslimits = (0, 200),
speed = 5,
lowlevel = True,
unit = 'mm',
),
x ... |
"""
this directory contains objects which directly access the various databases we use.
Normally, these objects should be loaded into a service object rather than called directly.
"""
__author__ = 'ars62917'
|
# 039 - Write a Python program to compute the future value of a specified principal amount, rate of interest, and a number of years.
def futureValue(pValue, pRate, pYears):
return round(pValue * ((1 + (0.01 * pRate)) ** pYears), 2)
print(futureValue(10000, 3.5, 7)) |
VERSION = '0.2.0'
## ModBus/TCP
MODBUS_PORT = 502
## Modbus mode
MODBUS_TCP = 1
MODBUS_RTU = 2
## Modbus function code
# standard
READ_COILS = 0x01
READ_DISCRETE_INPUTS = 0x02
READ_HOLDING_REGISTERS = 0x03
READ_INPUT_REGISTERS = 0x04
WRITE_SINGLE_COIL = 0x05
WRITE_SINGLE_REGISTER = 0x06
WRITE_MULTIPLE_COILS = 0x0F
WRIT... |
draw = []
boards = []
drawn_boards = []
def parse_input(file):
"""
Parses this day's input data.
The first line will contain a random sequence of numbers.
After that, matrices of random numbers will follow, separated by a blank line.
"""
with open(file, "r") as fp:
... |
REQUEST_BODY_JSON = """
{
"id_token": "string",
"limit": 1,
"offset": 1
}
"""
RESPONSE_200_JSON = """
{
"balance": 1.1,
"past_transactions": [
{
"transaction_description": "string",
"amount": 1.1,
"transaction_datetime": "2099-12-31 00:00:00",
... |
nstrips = 100
width = 1/nstrips
integral = 0
for point in range(nstrips):
height = (1 - (point/nstrips)**2)**(1/2)
integral = integral + width * height
print("The value is", integral)
|
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you m... |
grandpy_intro = [
"Bonjour ",
"Coucou ",
"Hello ",
"Bienvenue ",
"Très heureux de te voir ",
"Quelle bonne surprise ",
"Je suis content de ta visite ",
"Quelle joie de te voir ",
]
grandpy_nickname = [
"mon enfant. ",
"mon petit lapin. ",
"mon poussin. ",
"visiteur. ",
... |
class Postions:
def __init__(self):
self.postions = [
"GK",
"CB",
"RCB",
"LCB",
"CDM",
"CM",
"CAM",
"CF",
"RB",
"LB",
"RWB",
"LWB",
"RM",
"L... |
class Path(object):
@staticmethod
def getPath(dataset):
if dataset == 'QUBIQ':
return r'/home/qingqiao/bAttenUnet_test/qubiq'
if dataset == 'uncertain-brats':
return r'/home/qingqiao/bAttenUnet_test/qubiq'
if dataset == 'brats':
return '/home/cvip/data... |
class Chunks:
HEADER = 0x0
MESHES = 0x1
SLOTS = 0x2
class LevelDetails:
pass
class DetailsTransform:
def __init__(self):
self.x = None
self.y = None
class DetailsHeader:
def __init__(self):
self.format_version = None
self.slot_size = 2.0
self.slot_ha... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.