content stringlengths 7 1.05M |
|---|
def SetUpGame():
global WreckContainer, ShipContainer, PlanetContainer, ArchiveContainer, playerShip, gameData, SystemContainer
GameData = gameData()
GameData.tutorial = False
PlanetContainer = [Planet(0, -1050, 1000)]
GameData.homePlanet = PlanetContainer[0]
GameData.tasks = []
PlanetContai... |
class SearchGoogleNewsError(Exception):
pass
class SearchGoogleNewsDataSourceNotFound(Exception):
pass
class SearchGoogleNewsParseError(Exception):
pass
|
class Pattern:
def __init__(self):
self.count = 0
self.pairs = []
def getPairs(self, my_list):
for i in range(len(my_list[1:9])): # i 0~8 / (0 0 3 0 0 12 0 0 0)
if my_list[i+1] > 0:
self.pairs.append(tuple([i, my_list[i]])) # (2,3) (5,12) / activation area라는 리... |
#!/usr/bin/env python3
# Character Picture Grid
grid = [
[".", ".", ".", ".", ".", "."],
[".", "O", "O", ".", ".", "."],
["O", "O", "O", "O", ".", "."],
["O", "O", "O", "O", "O", "."],
[".", "O", "O", "O", "O", "O"],
["O", "O", "O", "O", "O", "."],
["O", "O", "O", "O", ".", "."],
[".", ... |
#
# PySNMP MIB module HH3C-VM-MAN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-VM-MAN-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:30:16 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... |
# Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
#!/usr/bin/python3
'''
定义:
+ free block of length i, starting from 0 to (i-1)
+ its corresponding suffix is reprented by lx[i:] (with 1 subtracted)
分析:
+ bits string set can be seperated into several disjoint sets (DS)
+ the number of disjoint sets = number of 1 in bitstring (x+1)
+ one special DS is the one with no pr... |
class Solution:
def canVisitAllRooms(self, rooms):
"""
:type rooms: List[List[int]]
:rtype: bool
"""
if len(rooms) == 1:
return True
if len(rooms[0]) == 0:
return False
curent = set()
visited = [0]
for key in rooms... |
"""2. Fine-tuning SOTA video models on your own dataset
=======================================================
Fine-tuning is an important way to obtain good video models on your own data when you don't have large annotated dataset or don't have the
computing resources to train a model from scratch for your use case.... |
class Solution:
"""
@param height: A list of integer
@return: The area of largest rectangle in the histogram
"""
def largestRectangleArea(self, height):
len_histogram = len(height)
ans = 0
height_list = sorter(height, reverse=True)
for now_h... |
# 17. Take 10 integers from keyboard using loop and print their average value on the screen. (use array to store inputs).
numbers = list(map(int, input("Enter 10 numbers:").split()))
if len(numbers) >= 10:
numbers = numbers[0:10]
print("10 Numbers are", numbers)
print("Average=", sum(numbers)/len(numbers)... |
def parse_parts(line):
space_separated_parts = line.split()
bounds = space_separated_parts[0].split('-')
char = space_separated_parts[1].split(':')[0]
password = space_separated_parts[2]
return int(bounds[0]), int(bounds[1]), char, password
def is_valid_first(min_req, max_req, letter, password):
... |
"""
实例成员
实例变量:s个体的数据
实例方法:个体的行为(操作实例变量)
"""
# name = "双二" # 全局变量内存中只有一份
class Wife:
def __init__(self, name=""):
self.name = name # 每个对象都有一份
def play(self):
print(self.name + "在玩耍")
jian_ning = Wife("建宁") # 在内存中分配空间,存储name
shuagn_er = Wife("双儿") # 在内存中分配空间,存储name
print(j... |
""" Escreva um programa onde o usuário digita uma frase
e essa frase retorna sem vogal """
frase = input("Digite uma frase:\n > ").lower()
nova = ''
print(frase.replace('a','').replace('e','').replace('i','').replace('o','').replace('u',''))
for c in frase:
# if c != 'a' and c != 'e' and c != 'i' and c != 'o' a... |
# Given a collection of numbers, return all possible permutations.
# For example,
# [1,2,3] have the following permutations:
# [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].
# [1,2] have the following permutations:
# [1,2], [2,1]
class Solution:
# @param {integer[]} nums
# @return {integer[][]}
... |
a = int(input('Digite o primeiro termo: '))
r = int(input('Digite a razão: '))
c = 1
while c <= 10:
a +=r
c +=1
print(a-r)
|
# import pytest
class TestDatabase:
def test___call__(self): # synced
assert True
def test_default_schema(self): # synced
assert True
def test_schema_names(self): # synced
assert True
def test_table_names(self): # synced
assert True
def test_view_names(self)... |
class Vetor:
def __init__(self, x=0, y=0):
self.x = x
self.y = y
def __repr__(self):
return 'Vetor (%r,%r)' % (self.x, self.y)
def __mul__(self, escalar):
x = self.x * escalar
y = self.y * escalar
return Vetor(x, y)
def __add__(self, outro):
x ... |
# Databricks notebook source
# MAGIC %md # CCU002_03-D04-custom_tables
# MAGIC
# MAGIC **Description** This notebook creates custom tables, such as long format HES.
# MAGIC
# MAGIC **Author(s)** Venexia Walker
# COMMAND ----------
# MAGIC %md ## Define functions
# COMMAND ----------
# Define create table functio... |
SUBJ_REPORT = "Problem Report: ExCEED Labs"
ERROR_NO_EMAIL_TO_GET_AHOLD = "We need to know how to get ahold of you!"
ERROR_NO_REPORT = "Don't forget to add your problem report or request!"
ERROR_NOT_SUBMITTED = "There was a problem with your submission. Please try again!"
SUCCESS_REPORT_SUBMITTED = "Success! Your pro... |
"""
URL: https://codeforces.com/problemset/problem/144/A
Author: Safiul Kabir [safiulanik at gmail.com]
"""
n = int(input())
mil = list(map(int, input().split()))
count = 0
maxx_index = mil.index(max(mil))
while maxx_index - 1 >= 0:
mil[maxx_index - 1], mil[maxx_index] = mil[maxx_index], mil[maxx_index - 1]
... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# FreeType high-level python API - Copyright 2011-2015 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
#
# -----------------------------------------------------------------------------
""... |
# Sum square difference
# https://projecteuler.net/problem=6
def solve(n):
sn = (n*(n+1)//2) * (n*(n+1)//2)
sn2 = n*(n+1)*(2*n+1)//6 # sum of first n squared natural numbers
return abs(sn - sn2)
print(solve(100)) |
_base_ = [
'../_base_/models/paa_distil_fpn.py',
'../_base_/datasets/coco_detection.py',
'../_base_/schedules/schedule_1x.py',
'../_base_/default_runtime.py'
]
model = dict(
type='LAD',
# student
pretrained='torchvision://resnet50',
backbone=dict(depth=50),
bbox_head=dict(... |
class Solution(object):
def solveNQueens(self, n):
def dfs(queens, xy_sub, xy_plus):
row = len(queens)
if row == n:
result.append(queens)
return None
for col in range(n):
if col not in queens and col + row not in xy_plus and... |
def merge_sort_time(job_list):
'''
sorts the list by timestamp
:return:
array
'''
if len(job_list) > 1:
mid = len(job_list) // 2
lefthalf = job_list[:mid]
righthalf = job_list[mid:]
merge_sort_time(lefthalf)
merge_sort_time(righthalf)
i =... |
#
# PySNMP MIB module CHARACTER-MIB (http://pysnmp.sf.net)
# ASN.1 source http://mibs.snmplabs.com:80/asn1/CHARACTER-MIB
# Produced by pysmi-0.0.7 at Sun Feb 14 00:06:47 2016
# On host bldfarm platform Linux version 4.1.13-100.fc21.x86_64 by user goose
# Using Python version 3.5.0 (default, Jan 5 2016, 17:11:52)
#
( ... |
class Regularcombo():
"""docstring for ."""
def __init__(self, burger = ["big_mac"], snack = ["fries"], drink = ["coca"]):
try:
assert type(burger) == list
except AssertionError:
print('Please enter initial burger as list then custom')
else:
self.burge... |
def write_results(results, save_path):
output = []
for k, v in results.items():
output.append("{}: {}".format(k, v))
output.append("\n")
output.append("If you need to access these results for the future "
"they are stored in: {}".format(save_path))
with open(save_pat... |
houses = {"Harry": "Gryffindor", "Draco": "Slytherin"}
houses["Hermione"] = "Gryffindor"
print(houses["Harry"])
|
# 在二维平面上,有一个机器人从原点 (0, 0) 开始。给出它的移动顺序,判断这个机器人在完成移动后是否在 (0, 0) 处结束。
#
# 移动顺序由字符串表示。字符 move[i] 表示其第 i 次移动。机器人的有效动作有 R(右),L(左),U(上)和 D(下)。如果机器人在完成所有动作后返回原点,则返回 true。否则,返回 false。
#
# 注意:机器人“面朝”的方向无关紧要。 “R” 将始终使机器人向右移动一次,“L” 将始终向左移动等。此外,假设每次移动机器人的移动幅度相同。
#
#
#
# 示例 1:
#
# 输入: "UD"
# 输出: true
# 解释:机器人向上移动一次,然后向下移动一次。所有动作都具... |
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def oddEvenList(self, head):
if not head:
return None
i = 0
tmp = head
first = True
prev = None
tmp_even_head = None
tail = None
... |
def lineup_students(string):
return sorted(string.split(), key=lambda x: (len(x), x), reverse=True)
# lineup_students = lambda s: sorted(s.split(), key=lambda x: (len(x), x), reverse=True)
|
'''Escolha um programa que leia um número inteiro qualquer e peça para o usuário escolher qual será a base de conversão
-1 para binário
-2 para octal
-3 para hexadecimal'''
num = int(input('Digite um número inteiro: '))
print('''Escolha uma das bases de conversão
[1]Converter para binário
[2]Converter para octal
[3]Co... |
# Accept a positive integer and print the reverse of it.
n = int(input("Enter a positive integer: ")) # | n = 123
print()
rev = 0 # | rev = 0
while n > 0: # | 123 > 0 = True | 12 > 0 = True | 1 > 0 = True |
... |
def parse_plotter_args(parser):
parser.add_option(
"--name_of_3dmodel",
type="string",
default="airplane/airplane_0630.ply",
help="name of 3D model to plot using the 'plot_subclouds' script",
)
parser.add_option(
"--save_plot_frames",
action="store_true",
... |
PART_NAMES = [
"nose", "leftEye", "rightEye", "leftEar", "rightEar", "leftShoulder",
"rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist",
"leftHip", "rightHip", "leftKnee", "rightKnee", "leftAnkle", "rightAnkle"
]
NUM_KEYPOINTS = len(PART_NAMES)
PART_IDS = {pn: pid for pid, pn in enumer... |
to_remove = input()
word = input()
while to_remove in word:
word = word.replace(to_remove, '')
print(word)
|
BASE_URL = 'https://www.instagram.com/'
LOGIN_URL = BASE_URL + 'accounts/login/ajax/'
LOGOUT_URL = BASE_URL + 'accounts/logout/'
MEDIA_URL = BASE_URL + '{0}/media'
CHROME_WIN_UA = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'
STORIES_URL = 'https://i.i... |
if __name__ == '__main__':
name = ' aleX'
print(name.strip())
# name = name.strip()
if name.startswith('al'):
print('yes')
if name.endswith('X'):
print('yes')
print(name.replace('l', 'p'))
# name = name.replace('l', 'p')
print(name.split('l'))
print(type(name.split('e... |
'''
Created on 16.1.2017
@author: jm
'''
class GedcomLine(object):
'''
Gedcom line container, which can also carry the lower level gedcom lines.
Example
- level 2
- tag 'GIVN'
- value 'Johan' ...}
'''
# Current path elemements
# See https://docs.python.org/3/faq/... |
'''input
1
1 1 0 1 0 0 0 1 0 1
3 4 5 6 7 8 9 -2 -3 4 -2
8
3
1 1 1 1 1 1 0 0 1 1
0 1 0 1 1 1 1 0 1 0
1 0 1 1 0 1 0 1 0 1
-8 6 -2 -8 -8 4 8 7 -6 2 2
-9 2 0 1 7 -5 0 -2 -6 5 5
6 -6 7 -9 6 -5 8 0 -9 -7 -7
23
2
1 1 1 1 1 0 0 0 0 0
0 0 0 0 0 1 1 1 1 1
3 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1
0 -2 -2 -2 -2 -2 -1 -... |
filename = 'programming_poll.txt'
responses = []
while True:
response = input("\nWhy do you like programming? ")
responses.append(response)
continue_poll = input("Would you like to let someone else respond? (y/n) ")
if continue_poll != 'y':
break
with open(filename, 'a') as f:
for respons... |
'''
Created on Oct 13, 2017
@author: LSX1KOR
'''
"""
In the multiple inheritance scenario, any specified attribute is searched first in the current class.
If not found, the search continues into parent classes in depth-first,
left-right fashion without searching same class twice.
"""
class Base1(object):
def foo(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Louis Richard"
__email__ = "louisr@irfu.se"
__copyright__ = "Copyright 2020-2021"
__license__ = "MIT"
__version__ = "2.3.7"
__status__ = "Prototype"
def iso86012datetime64(time):
r"""Convert ISO8601 time format to datetime64 in ns units.
Parameters... |
class PropertyMapperException(Exception):
pass
class UnsupportedType(PropertyMapperException):
pass
class WrongType(PropertyMapperException):
pass
class OverrideForbidden(PropertyMapperException):
pass
class ValidationError(Exception):
"""
Ошибка при заполнении данных маппера.
Либо п... |
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
#
# @lc app=leetcode id=1806 lang=python3
#
# [1806] Minimum Number of Operations to Reinitialize a Permutation
#
# @lc code=start
class Solution:
def reinitializePermutation(self, n: int) -> int:
i, cnt = 1, 0
while not cnt or i > 1: # i != 1 doesn't work
i = i * 2 % (n - 1)
... |
class TestFunctionalTest(object):
counter = 0
@classmethod
def setup_class(cls):
cls.counter += 1
@classmethod
def teardown_class(cls):
cls.counter -= 1
def _run(self):
assert self.counter==1
def test1(self):
self._run()
def test2(self):
self._run(... |
class Parameter:
'''
Defines a sampled (or "free") parameter by spin, parity, channel,
rank, and whether it's an energy or width (kind).
kind : "energy" or "width"
"width" can be the partial width or ANC (depending on how it was
set up in AZURE2)
channel : channel pair... |
top_avg = """SELECT *
FROM rm_episodes
INNER JOIN ratings
ON rm_episodes.tconst = ratings.tconst
ORDER BY averageRating
DESC
LIMIT 5
"""
worst_avg = """SELECT *
FROM rm_episodes
INNER JOIN ratings
ON rm_episodes.tconst = ratings.tconst
ORDER BY averageRating
ASC
LIMIT 5
"""
top_vote = """SELECT *
FROM rm_episodes
INNE... |
"""
/*
*
* Crypto.BI Toolbox
* https://Crypto.BI/
*
* Author: José Fonseca (https://zefonseca.com/)
*
* Distributed under the MIT software license, see the accompanying
* file COPYING or http://www.opensource.org/licenses/mit-license.php.
*
*/
"""
class CBUtil:
@staticmethod
def safe_hash(phash, b... |
# numero_inicial = int(input('Qual o Numero que vocÊ deseja começar a somar?'))
# numero_final = int(input('Até qual numero devemos somar?'))
# total = 0
# for numero in range(numero_inicial,numero_final+1):
# total += numero
# print(total)
# total = 0
# for numero in [50,51,52,53,54,55,56,57,58,59,60,61,62,63,64... |
class MissingPatterns():
"""docstring for MissingPatterns"""
def __init__(self, data, selected_features):
self.missing_patterns = set() # -> set de frozenset
self.data = data # -> weka.core.dataset.Instances
self.missingPatterns(selected_features);
# Encontra os padrões ausentes
def missingPatterns(self, sel... |
# -*- coding: utf-8 -*-
'''
팝빌 팩스 API Python SDK Example
- Python SDK 연동환경 설정방법 안내 : https://docs.popbill.com/fax/tutorial/python
- 업데이트 일자 : 2021-12-27
- 연동 기술지원 연락처 : 1600-9854
- 연동 기술지원 이메일 : code@linkhubcorp.com
<테스트 연동개발 준비사항>
1) 17, 20번 라인에 선언된 링크아이디(LinkID)와 비밀키(SecretKey)를
연동신청 후 메일로 발급받은 인증정보를 참조... |
config = {
# these values are related to the user's environment
'env': {
'databases': {
'postgres_host': '127.0.0.1',
'postgres_name': 'jesse_db',
'postgres_port': 5432,
'postgres_username': 'jesse_user',
'postgres_password': 'password',
... |
class CopyAsValuesParam(object):
def __init__(self, **kargs):
self.nodeId = kargs["nodeId"] if "nodeId" in kargs else None
self.asNewNode = kargs["asNewNode"] if "asNewNode" in kargs else False
|
# a queue is a data structure in which the data element entered first is removed first
# basically you insert elements from one end and remove them from another end
# a very simple, and cliche example would be that of a plain old queue at McDonald's
# The person who joined the queue first will order first, and the one... |
#!/usr/bin/env python3
def coverage_test_helper():
one = 10 + 3 - 12
print('This function should be called {one} time to achieve 100% coverage')
return one
|
class Checksum:
@staticmethod
def calc(data: str):
chksum = Checksum.__str_list2bin(data)
chksum = Checksum.__sum_bytes(chksum)
map(lambda x: bytearray(x + 1)[0], chksum)
return chksum
@staticmethod
def __str_list2bin(data: str) -> list:
map(lambda x: bytearray(x... |
async def m001_initial(db):
await db.execute(
"""
CREATE TABLE subdomains.domain (
id TEXT PRIMARY KEY,
wallet TEXT NOT NULL,
domain TEXT NOT NULL,
webhook TEXT,
cf_token TEXT NOT NULL,
cf_zone_id TEXT NOT NULL,
des... |
# --------------
##File path for the file
file_path
#Code starts here
#Function to read file
def read_file(path):
#Opening of the file located in the path in 'read' mode
file = open(path, 'r')
#Reading of the first line of the file and storing it in a variable
sentence=file.rea... |
# Adapted from: https://stackoverflow.com/questions/37935920/quantile-normalization-on-pandas-dataframe
# Citing: https://en.wikipedia.org/wiki/Quantile_normalization
class QNorm:
def __init__(self):
return
def fit(self,df):
return _QNormFit(self,df.stack().groupby(df.rank(method='first').stack(... |
class PluginError(Exception):
pass
class OneLoginClientError(PluginError):
pass
class UserNotFound(PluginError):
pass
class FactorNotFound(PluginError):
pass
class TimeOutError(PluginError):
pass
class APIResponseError(PluginError):
pass |
YES = "LuckyChef"
NO = "UnluckyChef"
def solve():
for _ in range(int(input())):
x, y, k, n = map(int, input().split())
arr = []
for __ in range(n):
arr.append(list(map(int, input().split())))
remaining_pages = x - y
if remaining_pages <= 0:
print(YE... |
class Board:
def __init__(self, lines):
self.data = []
self.has_won = False
for i, l in enumerate(lines):
self.data.append([int(x) for x in l.split()])
def __str__(self):
return str(self.data)
def __repr__(self):
return str(self)
def final_score(sel... |
#Dias da semana
n1=int(input())
if(n1==1):
print("Domingo")
elif(n1==2):
print("Segunda")
elif(n1==3):
print("Terça")
elif(n1==4):
print("Quarta")
elif(n1==5):
print("Quinta")
elif(n1==6):
print("Sexta")
elif(n1==7):
print("Sabado")
else:
print("Valor invalido") ... |
precotij=float(input('Digite o preço da unidade do tijolo (Em reais): '))
alturatij=float(input('Digite a altura do tijolo (Em metros): '))
comprimentotij=float(input('Digite o comprimento do tijolo (Em metros): '))
alturaparede=float(input('Digite a altura das paredes (Em metros): '))
comprimentoparede=float(input('Di... |
#!/usr/bin/env python3
NUMBER_OF_DIVS = 25
INCL_SPACES = True
divString = """
<div class="item{}">
<img class="rounded-img carousel-img" id="carousel-img-{}" src="images/sample.png" alt="Pic{}">
</div>
"""
if(INCL_SPACES):
divString = """
<div class="item{}">
<img class="rounded-img carousel-i... |
nome = input('Digite seu nome completo: ')
nomem = nome.upper()
nomemin = nome.lower()
fat = nome.split()
juntin = '-'.join(fat)
nomefatiado = nome.replace(" ", "")
print(len(nomefatiado))
print(nomemin)
print(nomem)
print(len(fat[0]))
print(fat)
print(juntin) |
dados_aluno = {'Nome': str(input('Nome do aluno: ')), 'Media': float(input('Média: '))}
if dados_aluno['Media'] > 7:
dados_aluno['situação'] = 'Aprovado'
else:
dados_aluno['situação'] = 'Reprovado'
print(f'Situação é igual a {dados_aluno["situação"]} ') |
def write_tsv(headerfields, features, outfn):
"""Writes header and generator of lines to tab separated file.
headerfields - list of field names in header in correct order
features - generates 1 list per line that belong to header
outfn - filename to output to. Overwritten if exists
"""
with ope... |
if __name__ == '__main__':
n = int(input())
arr = map(int, input().split())
# Copy original array
new_arr = set(arr)
# Remove max values
new_arr.remove(max(new_arr))
# Print new max (2nd max)
print(max(new_arr))
|
# coding=utf-8
"""
复制带随机指针的链表
描述:给出一个链表,每个节点包含一个额外增加的随机指针可以指向链表中的任何节点或空的节点。
返回一个深拷贝的链表。
思路: 要用到 hash table 这样就完成深度拷贝了
mapping = {
head1: rhead1,
head2: rhead2,
head3: rhead3,
...
headn: rheadn
}
将copy后的 head1 里的换车 rhead1 就完成深拷贝了
"""
"""
Definition for singly-linked list with a random poin... |
a, b, c = map(int, input().split())
if b - a == c - b:
print("YES")
else:
print("NO") |
# https://leetcode.com/problems/longest-valid-parentheses/
# Given a string containing just the characters '(' and ')', find the length of
# the longest valid (well-formed) parentheses substring.
################################################################################
# dp[i] = longest valid of s[i:n] starti... |
def fizz_buzz(n):
for fizz_buzz in range(n+1):
if fizz_buzz % 3 == 0 and fizz_buzz % 5 == 0:
print("fizzbuzz")
continue
elif fizz_buzz % 3 == 0:
print("fizz")
continue
elif fizz_buzz % 5 == 0:
print("buzz")
print(fizz_buzz)
... |
"""Unix shell commands toolchain support.
Defines a toolchain capturing common Unix shell commands as defined by IEEE
1003.1-2008 (POSIX), see `sh_posix_toolchain`, and `sh_posix_configure` to scan
the local environment for shell commands. The list of known commands is
available in `posix.commands`.
"""
load("@bazel... |
#import GreenMindLib
msg_menu = '''
Use: sudo ./green -u http://businesscorp.com.br -o teste.txt \n\n
Green Recon
=============
Command Description
------- -----------
greenrecon Start recon OSINT
recon Suite recon OSINT
googl... |
# Faça um programa que leia um número inteiro
# e diga se ele é ou não um número primo.
num = int(input('Digite um valor: '))
flag = 0
for i in range(2, num):
if num % i == 0:
flag = 1
break
if flag == 0:
print(f'{num} é primo!')
else:
print(f'{num} é composto!') |
"""yolk.
Author: Rob Cakebread <cakebread at gmail>
License : BSD
"""
__version__ = '0.9.5'
|
_base_ = [
'../../_base_/default_runtime.py',
'../../_base_/schedules/schedule_sgd_1200e.py',
'../../_base_/det_models/dbnet_r18_fpnc.py',
'../../_base_/det_datasets/icdar2015.py',
'../../_base_/det_pipelines/dbnet_pipeline.py'
]
train_list = {{_base_.train_list}}
test_list = {{_base_.test_list}}
... |
class MoveNotFound(Exception):
pass
class CharacterNotFound(Exception):
pass
class OptionError(Exception):
pass
class LimitError(Exception):
pass
class CharacterMainError(Exception):
pass
class CharacterSubError(Exception):
pass
class CommandNotFound(Exception):
pass
class Comm... |
with open('pessoa.csv') as arquivo:
with open('pessoas.txt', 'w') as saida:
for registro in arquivo:
registro = registro.strip().split(',')
print(f'Nome:{registro[0]}, Idade: {registro[1]} anos', file=saida) |
class PrettyException(Exception):
"Semantic errors in prettyqr."
pass
class ImageNotSquareException(PrettyException):
pass
class BaseImageSmallerThanQRCodeException(PrettyException):
pass
|
#
# Author:
# Date:
# Description:
#
# Constants used to refer to the parts of the quiz question
CATEGORY = 0
VALUE = 1
QUESTION = 2
ANSWER = 3
#
# Read lines of text from a specified file and create a list of those lines
# with each line added as a separate String item in the list
#
# Parameter
# inputFile -... |
def C_to_F(temp):
temp = temp*9/5+32
return temp
def F_to_C(temp):
temp = (temp-32)*5.0/9.0
return temp
sel = input('\nCelsius and Fahrenheit Convert\n\n'+
'(A) Fatrenheit to Celsius\n'+
'(B) Celsius to Fatrenheit\n'+
'(C) Exit\n\n'+
'Please input...> ')
while sel != 'C':
temp = int(input('Please input tempe... |
# first line: 1
@memory.cache
def vsigmomEdw_NR(Erecoil_keV, aH):
return [sigmomEdw(x,band='NR',label='GGA3',F=0.000001,V=4.0,aH=aH,alpha=(1/18.0)) for x in Erecoil_keV]
|
# Copyright 2020 The XLS Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
for i in range(101):
if i % 15 == 0:
print("Fizzbuzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
print("Buzz")
else:
print(i)
|
RESOURCE = "https://graph.microsoft.com" # Add the resource you want the access token for
TENANT = "Your tenant" # Enter tenant name, e.g. contoso.onmicrosoft.com
AUTHORITY_HOST_URL = "https://login.microsoftonline.com"
CLIENT_ID = "Your client id " # copy the Application ID of your app from your Azure portal
CLIENT... |
# Hiztegi bat deklaratu ta aldagaiak jarri, erabiltzaileak sartu ditzan
hizt = {}
EI = input("Sartu zure erabiltzaile izena:\n")
hizt['Erabiltzaile_izena'] = EI
PH = input("Sartu zure pasahitza:\n")
hizt['Pasahitza'] = PH
# Aldagai hoiek gorde ta bukle batekin bere datuak sartzea, ondo sartu arte (input = hiztegian... |
#!/usr/bin/env python3
x, y = map(int, input().strip().split())
while x != 0 and y != 0:
att = list(map(int, input().strip().split()))
att.sort()
dff = list(map(int, input().strip().split()))
dff.sort()
if(att[0] < dff[1]):
print("Y")
else:
print("N")
x, y = map(int, input... |
FreeSansBold9pt7bBitmaps = [
0xFF, 0xFF, 0xFE, 0x48, 0x7E, 0xEF, 0xDF, 0xBF, 0x74, 0x40, 0x19, 0x86,
0x67, 0xFD, 0xFF, 0x33, 0x0C, 0xC3, 0x33, 0xFE, 0xFF, 0x99, 0x86, 0x61,
0x90, 0x10, 0x1F, 0x1F, 0xDE, 0xFF, 0x3F, 0x83, 0xC0, 0xFC, 0x1F, 0x09,
0xFC, 0xFE, 0xF7, 0xF1, 0xE0, 0x40, 0x38, 0x10, 0x7C, 0x30,... |
s = '''
[setattr(f, 'func_code', type(f.func_code)(0, 0, 2, 67,
'd\\x06\\x00j\\x00\\x00j\\x01\\x00d\\x01\\x00\\x19j\\x02\\x00\\x83\\x00\\x00d\\x02\\x00\\x19j\\x03\\x00j\\x04\\x00d\\x03\\x00\\x19j\\x05\\x00d\\x04\\x00\\x19j\\x06\\x00j\\x07\\x00d\\x05\\x00\\x83\\x01\\x00\\x01d\\x00\\x00'
+ 's'.upper(),
([].append(1), 0,... |
def split_labels(
label_reader,
training_label_writer,
testing_label_writer,
training_fraction,
max_labels=0,
):
"""Splits a full label set into a training and testing set.
Given a full set of labels and associated inputs, splits up the labels
into training and testing sets in the propor... |
print("What is your first name?")
firstName = input()
print("What is your last name?")
lastName = input()
fullName = firstName + " " + lastName
greeting = "Hello " + fullName
print(greeting)
|
# Faça um Programa que leia 2 números e em seguida pergunte ao usuário qual operação ele deseja realizar. O resultado da operação deve ser acompanhado de uma frase que diga se o número é:
#a. par ou ímpar;
#b. positivo ou negativo;
#c. inteiro ou decimal.
n1 = float(input('Digite um número: '))
n2 = float(input('Digit... |
# Write your movie_review function here:
def movie_review(rating):
if rating <= 5:
return "Avoid at all costs!"
elif rating > 5 and rating < 9:
return "This one was fun."
else:
return "Outstanding!"
# Uncomment these function calls to test your movie_review function:
print(movie_review(9))
# should ... |
'''
Author: hdert
Date: 25/5/2018
Desc: Input Validation
Version: Dev Build V.0.1.6.9.1
'''
#--Librarys--
#--Definitions--
#--Variables--
choice = ""
number = 0
#-Main-Code--
while(choice != "e"):
'''
while(True):
choice = input("Enter a, b, or c: ")
if(ch... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.