content
stringlengths
7
1.05M
BASE_FILES = "C:\\Users\\Dani\\repos-git\\shexerp3\\test\\t_files\\" BASE_FILES_GENERAL = BASE_FILES + "general\\" G1 = BASE_FILES + "t_graph_1.ttl" G1_NT = BASE_FILES + "t_graph_1.nt" G1_TSVO_SPO = BASE_FILES + "t_graph_1.tsv" G1_JSON_LD = BASE_FILES + "t_graph_1.json" G1_XML = BASE_FILES + "t_graph_1.xml" G1_N3 = B...
val = int(input("Valor:")) soma = val maior = val menor = val for i in range(0,9): val = int(input("Valor:")) if val>maior: maior = val if val<menor: menor=val soma+=val print("O maior valor é:",maior) print("O menor valor é:",menor) print("A média é:",(soma/10))
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") def deps(): excludes = native.existing_rules().keys() if "bazel_installer" not in excludes: http_file( name = "bazel_installer", downloaded_file_path = "bazel-installer.sh", sha256 = "bd7a3a583a18640f...
#!/usr/bin/python def test_vars(): """test variables in python""" int_var = 5 string_var = "hah" assert int_var == 5 assert string_var == 'hah' print("test vars is done") if __name__ == "__main__": test_vars()
class Programmer: def __init__(self, name, language, skills): self.name = name self.language = language self.skills = skills def watch_course(self, course_name, language, skills_earned): if not self.language == language: return f"{self.name} does not know {language}"...
#returns the value to the variable # x = 900 print(x) #print will take the argument x as the value in the variable #
def add(tree, x): if not tree: tree.extend([x, None, None]) print('DONE') return key = tree[0] if x == key: print('ALREADY') elif x < key: left = tree[1] if left == None: tree[1] = [x, None, None] print('DONE') else: ...
batch_size, num_samples, sample_rate = 32, 32000, 16000.0 # A Tensor of [batch_size, num_samples] mono PCM samples in the range [-1, 1]. pcm = tf.random.normal([batch_size, num_samples], dtype=tf.float32) # A 1024-point STFT with frames of 64 ms and 75% overlap. stfts = tf.signal.stft(pcm, frame_length=1024, frame_ste...
"""Top-level package for mynlp.""" __author__ = """Suneel Dondapati""" __email__ = 'dsuneel1@gmail.com' __version__ = '0.1.0'
""" User Get Key Value Input Dictionary Start """ dic = { "google": "google is provide job and internship.", "amezon": "amezon is e-commerce store and cloud computing provider.", "zoom": "zoom is provide video call system to connecting meeating.", "microsoft": "microsoft is owner of windows and office ...
# Copyright 2016 Dave Kludt # # 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 writing, s...
class Element: dependencies = [] def __init__(self, name): self.name = name def add_dependencies(self, *elements): for element in elements: if not self.dependencies.__contains__(element): self.dependencies.append(element) def remove_dependencies(self, *elem...
# known contracts from protocol CONTRACTS = [ # NFT - Meteor Dust "terra1p70x7jkqhf37qa7qm4v23g4u4g8ka4ktxudxa7", # NFT - Eggs "terra1k0y373yxqne22pc9g7jvnr4qclpsxtafevtrpg", # NFT - Dragons "terra1vhuyuwwr4rkdpez5f5lmuqavut28h5dt29rpn6", # NFT - Loot "terra14gfnxnwl0yz6njzet4n33erq5n70w...
def isPalindrome(string, i = 0): j = len(string) - 1 -i return True if i > j else string[i] == string[j] and isPalindrome(string, i+1) def isPalindrome(string): return string == string[::-1] def isPalindromeUsingIndexes(string): lIx = 0 rIdx = len(string) -1 while lIx < rIdx: if(string...
# coding=utf-8 # *** WARNING: this file was generated by crd2pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** SNAKE_TO_CAMEL_CASE_TABLE = { "access_modes": "accessModes", "api_group": "apiGroup", "api_version": "apiVersion", "app_protocol": "appProtocol", ...
# -*- coding: utf-8 -*- # Importing Libraries """ # Commented out IPython magic to ensure Python compatibility. import torch import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import torch.nn as nn from tqdm import tqdm_notebook from sklearn.preprocessing import MinMaxScaler...
ad1 = input(f"Adjective1: ") ad2 = input(f"Adjective2: ") part1 = input(f"body part: ") dish = input(f"Dish: ") madlib=f"One day, a {ad1} fox invited a stork for dinner. \ Stork was very {ad2} with the invitation – she reached the fox’s home on time and knocked at the door with her {part1}.\ The fox took her to t...
# List of addresses within the Battle Animation Scripts for the following commands which cause screen flashes: # B0 - Set background palette color addition (absolute) # B5 - Add color to background palette (relative) # AF - Set background palette color subtraction (absolute) # B6 - Subtract color from backgroun...
class Solution: def maxEnvelopes(self, envelopes: List[List[int]]) -> int: if not envelopes: return 0 pairs = sorted(envelopes, key=lambda x: (x[0], -x[1])) result = [] for pair in pairs: height = pair[1] if len(result) == 0 or height > result[-1]...
class Dog: def __init__(self, newColor): self.color = newColor def bark(self): print("---旺旺叫----") def printColor(self): print("颜色为:%s"%self.color) def test(AAA): AAA.printColor() wangcai = Dog("白") #wangcai.printColor() xiaoqiang = Dog("黑") #xiaoqiang.printColor() tes...
# -*- coding: utf-8 -*- # This file is made to configure every file number at one place # Choose the place you are training at # AWS : 0, Own PC : 1 PC = 1 path_list = ["/jet/prs/workspace/", "."] url = path_list[PC] clothes = ['shirt', 'jeans', 'blazer', 'chino-pants', 'jacket'...
def test_rm_long_opt_help(pycred): pycred('rm --help') def test_rm_short_opt_help(pycred): pycred('rm -h') def test_rm_none_existing_store_gives_exit_code_2(pycred, workspace): with workspace(): pycred('rm non-existing-store user', expected_exit_code=2)
# Calcula a quantidade de notas de cada valor a serem sacadas em uma caixa eletrônico print('=' * 30) print('{:^30}'.format('CAIXA ELETRÔNICO')) print('=' * 30) valor = int(input('Valor a ser sacado: R$ ')) # notas de real (R$) existentes tot200 = valor // 200 tot100 = (valor % 200) // 100 tot50 = ((valor % 200) % 100)...
# Application definition INSTALLED_APPS = [ 'django.contrib.staticfiles', 'django.contrib.sessions', 'authenticate', ] ROOT_URLCONF = 'auth_service.urls' WSGI_APPLICATION = 'auth_service.wsgi.application' # Use a non database session engine SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookie...
s=[] for i in range(int(input())): s.append(input()) cnt=0 while s: flag=True for i in range(len(s)//2): if s[i]<s[-(i+1)]: print(s[0],end='') s.pop(0) flag=False break elif s[-(i+1)]<s[i]: print(s[-1],end='') s.pop() flag=False break if flag: print(s[-1],end='') s.pop() cnt+=1 if ...
cars=100 cars_in_space=5 drivers=20 pasengers=70 car_not_driven=cars-drivers cars_driven=drivers carpool_capacity=cars_driven*space_in_a_car average_passengers_percar=passengers/cars_driven print("There are", cars,"cars availble") print("There are only",drivers,"drivers availble") print("There will be",car_not_driven,"...
# Definição de função def soma(a2, b2): # Os parâmetros aqui precisam ter outro nome print(f'A = {a2} e B = {b2}') s = a2 + b2 print(f'A soma vale A + B = {s}') # Programa principal a = int(input('Digite um valor para A: ')) b = int(input('Digite um valor para B: ')) soma(a, b)
# Your code goes here tab=[] for i in range(1000) : tab.append(i) tab2=[] for i in range(len(tab)): if sum([ int(c) for c in str(tab[i]) ]) <= 10: tab2.append(tab[i]) tab3=[] for i in range(len(tab2)): a=str(tab2[i]) if a[len(a)-2] == '4': tab3.append(tab2[i]) tab4=[] for i in range(l...
# 대학생 새내기들의 90%는 자신이 반에서 평균은 넘는다고 생각한다. 당신은 그들에게 슬픈 진실을 알려줘야 한다. # 첫째 줄에는 테스트 케이스의 개수 C가 주어진다. # 둘째 줄부터 각 테스트 케이스마다 학생의 수 N(1 ≤ N ≤ 1000, N은 정수)이 첫 수로 주어지고, 이어서 N명의 점수가 주어진다. 점수는 0보다 크거나 같고, 100보다 작거나 같은 정수이다. # 각 케이스마다 한 줄씩 평균을 넘는 학생들의 비율을 반올림하여 소수점 셋째 자리까지 출력한다. def avg(l): s=0 for i in l: s+=i ...
# AUTOGENERATED! DO NOT EDIT! File to edit: dataset.ipynb (unless otherwise specified). __all__ = ['load_mp3', 'get_sample_label', 'preprocess_file', 'pad_by_zeros', 'split_file_by_window_size', 'wrapper_split_file_by_window_size', 'create_dataset_fixed_size', 'get_spectrogram', 'add_channel_dim'] # Cell d...
# Exercício 066 soma = total = 0 while True: n = int(input('Digite um valor [999 para parar]: ')) if n == 999: break soma += n total += 1 print(f'O total de números digitados foi {total} e a soma deles vale {soma}')
# coding=utf-8 DEBUG = True TESTING = True SECRET_KEY = 'secret_key for test' # mongodb MONGODB_SETTINGS = { 'db': 'firefly_test', 'username': '', 'password': '', 'host': '127.0.0.1', 'port': 27017 } # redis cache CACHE_TYPE = 'redis' CACHE_REDIS_HOST = '127.0.0.1' CACHE_REDIS_PORT = 6379 CACHE_R...
# Copyright 2014-2015 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. class mockData: """dictionary of mocking data for the mocking tests""" # dictionary to hold the mock data _data={} # function to add mock data to the _mock_data dictionary def _add(se...
a = int(input()) b = int(input()) if a >=b*12: print("Buy it!") else: print("Try again")
# [weight, value] I = [[4, 8], [4, 7], [6, 14]] k = 8 def knapRecursive(I, k): return knapRecursiveAux(I, k, len(I) - 1) def knapRecursiveAux(I, k, hi): # final element if hi == 0: # too big for sack if I[hi][0] > k: return 0 # fits else: retur...
class Piece(object): def __init__(self, is_tall: bool = True, is_dark: bool = True, is_square: bool = True, is_solid: bool = True, string: str = None): if string: self.is_tall = (string[0] == "1") se...
""" # Utilities for interacting with NCBI EUtilities relating to PubMed """ __version__ = "0.0.1"
# Crie um programa que leia uma frase qualquer e diga se ele é um palíndromo, desconsiderando os espaços. frase = str(input('Digite uma frase: ')).strip() palavras = frase.split() junto = ''.join(palavras) inverso = '' for c in range( len(junto)-1, -1, -1): inverso += junto[c] if inverso == junto: print('A fra...
inp = input().split(" ") adult = int(inp[0]) child = int(inp[1]) if adult == 0 and child == 0: print("0 0") quit() if adult == 0: print("Impossible") quit() min = 0 # К каждому взрослому один бесплатный ребенок => # "Платные дети" это разница между взрослыми и всеми детьми not_free_child = child - ad...
''' 杨氏矩阵查找 在一个m行n列二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下 递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 ''' def get_value(l, r, c): return l[r][c] def find(l, x): m = len(l) - 1 n = len(l[0]) - 1 r = 0 c = n while c >= 0 and r <= m: value = get_value(l, r, c) if value == x: ...
x = int(input('Podaj pierwsza liczbe calkowita: ')) y = int(input('Podaj druga liczbe calkowita: ')) z = int(input('Podaj trzecia liczbe calkowita: ')) print() if x > 10: print(x) if y > 10: print(y) if z > 10: print(z)
while True: try: dados = [] matriz = [] n = int(input()) for linha in range(0, n): for coluna in range(0, n): dados.append(0) matriz.append(dados[:]) dados.clear() # Numeros na diagonal for diagonal_principal in rang...
''' http://pythontutor.ru/lessons/ifelse/problems/minimum/ Даны два целых числа. Выведите значение наименьшего из них. ''' val_01 = int(input()) val_02 = int(input()) if val_01 > val_02: print(val_02) else: print(val_01)
# query_strings.py ''' Since Sqlite queries are inserted as string in Python code, the queries can be stored here to save space in the modules where they are used. ''' delete_color_scheme = ''' DELETE FROM color_scheme WHERE color_scheme_id = ? ''' insert_color_scheme = ''' INSERT INT...
""" HackerRank :: Reverse a singly-linked list https://www.hackerrank.com/challenges/reverse-a-linked-list/problem Complete the reverse function below. For your reference: SinglyLinkedListNode: int data SinglyLinkedListNode next """ def reverse(head): # head node value can be null # Keep track of p...
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'chromium_code': 1, }, 'targets': [ { 'target_name': 'gfx', 'type': '<(component)', 'dependencies': [ ...
""" 113 / 113 test cases passed. Runtime: 92 ms Memory Usage: 16.4 MB """ class Solution: def pacificAtlantic(self, heights: List[List[int]]) -> List[List[int]]: m, n = len(heights), len(heights[0]) def dfs(used, x, y): used[x][y] = True for xx, yy in [(x + 1, y), (x - 1, y),...
__all__ = ( 'LIST', 'GET', 'CREATE', 'UPDATE', 'REPLACE', 'DELETE', 'ALL', 'get_http_methods' ) LIST = 'list' GET = 'get' CREATE = 'create' REPLACE = 'replace' UPDATE = 'update' DELETE = 'delete' ALL = (LIST, GET, CREATE, UPDATE, REPLACE, DELETE) _http_methods = { LIST: ('get',), GET: ('get',), CREATE: (...
# -*- coding: utf-8 -*- """ Created on 2017/11/18 @author: MG """
""" Rackspace Cloud Backup API Test Suite """
def test(): assert "spacy.load" in __solution__, "Rufst du spacy.load auf?" assert nlp.meta["lang"] == "de", "Lädst du das korrekte Modell?" assert nlp.meta["name"] == "core_news_sm", "Lädst du das korrekte Modell?" assert "nlp(text)" in __solution__, "Verarbeitest du den Text korrekt?" assert "prin...
NFSW_Texts = [ 'سکس' ,'گایید' ,' کص' ,'جنده' ,'کیر' ,'jnde' ,'jende' ,'kos' ,'pussy' ,'kir' ,'lashi' ,'لاشی' ,'jakesh' ,'جاکش' ,'مادر خراب' ,'madar kharab' ,'mde kharab' ,'khar kose' ,'fuck' ,'bitch' ,'haroomzade' ,'حرومی' ,'حرامزاده' ,'حرومزاده' ,'جندس' ,'کصه ' ] NFSW_Names=[ 'خاله' ,'ج...
#!/usr/bin/env python3 if __name__ == '__main__': # Python can represent integers. Here are a couple of ways to create an integer variable. Notice the truncation, # rather than rounding, in the assignment of d. a = 5 b = int() c = int(4) d = int(3.84) print(a, b, c, d) # Integers ha...
def test(): obj = { 'xxx1': 1, 'xxx2': 2, 'xxx3': 4, 'xxx4': 4, 'foo': 123 } i = 0 while i < 1e7: obj['foo'] = 234 obj['foo'] = 234 obj['foo'] = 234 obj['foo'] = 234 obj['foo'] = 234 obj['foo'] = 234 obj['foo'] = 234 obj['foo'] = 234 ob...
#!/usr/local/bin/python # -*- coding: utf-8 -*- """ """ __author__ = 'joscha' __date__ = '03.08.12'
counter_name = 'I0_PIN' Size = wx.Size(1007, 726) logfile = '/net/helix/data/anfinrud_1502/Logfiles/I0_PIN-2.log' average_count = 1 max_value = 11 min_value = 0 start_fraction = 0.401 reject_outliers = False outlier_cutoff = 2.5 show_statistics = True time_window = 172800
print("I will now count my chickens:") print ("Hens",25+30/6) print ("Roosters",100-25*3%4) print("How I will count the eggs:") print(3+2+1-5+4%2-1/4+6) print("Is it true that 3+2<5-7?") print(3+2<5-7) print("What is 3+2?", 3+2) print("What is 5-7?", 5-7) print("Oh,that's why it's false") print("How about some...
class Cpf: def __init__(self, documento): documento = str(documento) if self.cpf_eh_valido(documento): self.cpf = documento else: raise ValueError("CPF inválido!") def cpf_eh_valido(self, documento): if len(documento) == 11: return True ...
#! /usr/bin/env python """ Learning Series: Network Programmability Basics Module: Programming Fundamentals Lesson: Python Part 2 Author: Hank Preston <hapresto@cisco.com> common_vars.py Illustrate the following concepts: - Code reuse imported into other examples """ shapes = ["square", "triangle", "circle"] books =...
# -*- coding: utf-8 -*- """ Created on Wed May 27 18:48:24 2020 @author: Christopher Cheng """ class Stack(object): def __init__ (self): self.stack = [] def get_stack_elements(self): return self.stack.copy() def add_one(self, item): self.stack.append(item) def add_many(self,ite...
def wordPower(word): num = dict(zip(string.ascii_lowercase, range(1,27))) return sum([num[ch] for ch in word])
''' 剑指 Offer 10- II. 青蛙跳台阶问题 一只青蛙一次可以跳上1级台阶,也可以跳上2级台阶。求该青蛙跳上一个 n 级的台阶总共有多少种跳法。 答案需要取模 1e9+7(1000000007),如计算初始结果为:1000000008,请返回 1。 提示: 0 <= n <= 100 ''' ''' 思路:递归 ''' class Solution: def numWays(self, n: int) -> int: if n == 0: return 1 if n == 1: return 1 if n ...
""" Profile ../profile-datasets-py/div83/027.py file automaticaly created by prof_gen.py script """ self["ID"] = "../profile-datasets-py/div83/027.py" self["Q"] = numpy.array([ 1.51831800e+00, 2.02599600e+00, 2.94787100e+00, 3.99669400e+00, 4.71653800e+00, 4.89106600e+00, 5.1439...
s = input().strip() res = [c for c in set(s.lower()) if c.isalpha()] if len(res) == 26: print("pangram") else: print("not pangram")
class DataStream: async def create_private_listen_key(self) -> dict: """**Create a ListenKey (USER_STREAM)** Notes: ``POST /fapi/v1/listenKey`` See Also: https://binance-docs.github.io/apidocs/futures/en/#start-user-data-stream-user_stream """ retu...
x = input("Enter sentence: ") count={"Uppercase":0, "Lowercase":0} for i in x: if i.isupper(): count["Uppercase"]+=1 elif i.islower(): count["Lowercase"]+=1 else: pass print ("There is:", count["Uppercase"], "uppercases.") print ("There is:", count["Lowercase"], "lowercases.")
input = """ f(X,1) :- a(X,Y), g(A,X),g(B,X), not f(1,X). a(X,Y) :- g(X,0),g(Y,0). g(x1,0). g(x2,0). """ output = """ f(X,1) :- a(X,Y), g(A,X),g(B,X), not f(1,X). a(X,Y) :- g(X,0),g(Y,0). g(x1,0). g(x2,0). """
file = open("13") sum = 0 for numbers in file: #print(numbers.rstrip()) numbers = int(numbers) sum += numbers; print(sum) sum = str(sum) print(sum[:10])
variable1 = "variable original" def variable_global(): global variable1 variable1 = "variable global modificada" print(variable1) #variable original variable_global() print(variable1) #variable global modificada
TIMEOUT=100 def GenerateWriteCommand(i2cAddress, ID, writeLocation, data): i = 0 TIMEOUT = 100 command = bytearray(len(data)+15) while (i < 4): command[i] = 255 i += 1 command[4] = i2cAddress command[5] = TIMEOUT command[6] = ID command[7] = 2 command[...
class AveragingBucketUpkeep: def __init__(self): self.numer = 0.0 self.denom = 0 def add_cost(self, cost): self.numer += cost self.denom += 1 return self.numer / self.denom def rem_cost(self, cost): self.numer -= cost self.denom -= 1 if self....
#--- Exercício 2 - Variáveis #--- Crie um menu para um sistema de cadastro de funcionários #--- O menu deve ser impresso com a função format() #--- As opções devem ser variáveis do tipo inteiro #--- As descrições das opções serão: #--- Cadastrar funcionário #--- Listar funcionários #--- Editar funcionário #--...
__version__ = "2.18" def version(): """Returns the version number of the installed workflows package.""" return __version__ class Error(Exception): """Common class for exceptions deliberately raised by workflows package.""" class Disconnected(Error): """Indicates the connection could not be establ...
#!/usr/bin/env python3 class UnionFind(): def __init__(self, n): self.parent = [-1 for _ in range(n)] # 正==子: 根の頂点番号 / 負==根: 連結頂点数 def find(self, x): if self.parent[x] < 0: return x else: self.parent[x] = self.find(self.parent[x]) return self....
sqlqueries = { 'WeatherForecast':"select concat ('FY', to_char(f.forecasted_timestamp, 'YY')) Fiscal_yr, to_char(f.forecasted_timestamp, 'MON') Fiscal_mth, concat ('Day_', to_char(f.forecasted_timestamp, 'DD')) Fiscal_day, f.zipcode zip, min(f.temp_avg) low, max(f.temp_avg) high, max(f.wind_speed) wind, max(f.humid...
mock_dbcli_config = { 'exports_from': { 'lpass': { 'pull_lastpass_from': "{{ lastpass_entry }}", }, 'lpass_user_and_pass_only': { 'pull_lastpass_username_password_from': "{{ lastpass_entry }}", }, 'my-json-script': { 'json_script': [ ...
#!/usr/bin/env python # -*- coding:utf-8 -*- # author:dabai time:2019/2/24 class GameStats(): """跟踪游戏的统计信息""" def __init__(self,ai_settings): """初始化统计信息""" self.ai_settings=ai_settings self.reset_stats() # 让游戏一开始处于非活动状态 self.game_active=False # ...
# Practica de funciones #! /usr/bin/python # -*- coding: iso-8859-15 def f(x): y = 2 * x ** 2 + 1 return y # Programa que usa la funcion f n = int(input("Ingrese número: ")) for i in range(n): y = f(i) print (i,y)
class Samples: def __init__(self): #COMMANDS self.PP = ('Für [https://osu.ppy.sh/b/{} {} [{}]{}] (OD {}, AR {}, ' 'CS {}, {}★, {}:{}) wirst du {} {}') self.PP_FOR = ('| {}pp bekommen für {}% ') self.PP_PRED = ('Für [https://osu.ppy.sh/b/{} {} [{}]{}] (OD {},...
# Time: O(n) # Space: O(1) class Solution(object): def minDistance(self, height, width, tree, squirrel, nuts): """ :type height: int :type width: int :type tree: List[int] :type squirrel: List[int] :type nuts: List[List[int]] :rtype: int """ ...
# Copyright 2000-2004 Michael Hudson mwh@python.net # # All Rights Reserved # # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose is hereby granted without fee, # provided that the above copyright notice appear in all copies and # that both ...
with open('./8/input_a.txt', 'r') as f: input = [[a.strip().split(' | ')[0].split(' '), a.strip().split(' | ')[1].split(' ')] for a in f] num = sum([sum([1 if len(a) in {2,3,4,7} else 0 for a in o[1]]) for o in input ]) print(f'Part A: Number of 1,4,7 or 8s in output - {num}') def getoutput(i): nums = ['0','1...
class Node: def __init__(self, data): self.data = data self.next = None def sumLinkedListNodes(list1, list2): value1, value2 = "", "" head1, head2 = list1, list2 while head1: value1 += str(head1.data) head1 = head1.next while head2: value2 += str(head2.dat...
class Stack: def __init__(self): self.array = [] self.top = -1 self.max = 100 def isEmpty(self): if(self.top == -1): return True else: return False def isFull(self): if(self.top == self.max -1): return True else: ...
#---------------------------------------------------------------------- # Basis Set Exchange # Version v0.8.13 # https://www.basissetexchange.org #---------------------------------------------------------------------- # Basis set: STO-3G # Description: STO-3G Minimal Basis (3 functions/AO) # Role: orbital # ...
{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "001887f2", "metadata": {}, "outputs": [], "source": [ "# import os modules to create path across operating system to load csv file\n", "import os\n", "# module for reading csv files\n", "import csv" ] }, { ...
class Solution: """ @param A : an integer array @return : a integer """ def singleNumber(self, A): # write your code here return reduce(lambda x, y: x ^ y, A) if A != [] else 0
# Copyright 2018 Luddite Labs Inc. # # 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 writing...
# https://www.beecrowd.com.br/judge/en/problems/view/1017 car_efficiency = 12 # Km/L time = int(input()) average_speed = int(input()) liters = (time * average_speed) / car_efficiency print(f"{liters:.3f}")
""" Copyright (c) College of Mechatronics and Control Engineering, Shenzhen University. All rights reserved. Description : Author:Team Li """ """ 13. Roman to Integer Easy Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X ...
preference_list_of_user=[] def give(def_list): Def=def_list global preference_list_of_user preference_list_of_user=Def return Def def give_to_model(): return preference_list_of_user
UNIVERSAL_POS_TAGS = { 'VERB': 'verbo', 'NOUN': 'nombre', 'PRON': 'pronombre', 'ADJ' : 'adjetivo', 'ADV' : 'adverbio', 'ADP' : 'aposición', 'CONJ': 'conjunción', 'DET' : 'determinante', 'NUM' : 'numeral', 'PRT' : 'partícula gramatical', 'X' : 'desconocido', '.' : 'si...
def is_leap(year): leap = False # Write your logic here # The year can be evenly divided by 4, is a leap year, unless: # The year can be evenly divided by 100, it is NOT a leap year, unless: # The year is also evenly divisible by 400. Then it is a leap year. leap = (year % 4 == 0 and (year ...
# Set random number generator np.random.seed(2020) # Initialize step_end, n, t_range, v and i step_end = int(t_max / dt) n = 50 t_range = np.linspace(0, t_max, num=step_end) v_n = el * np.ones([n, step_end]) i = i_mean * (1 + 0.1 * (t_max / dt)**(0.5) * (2 * np.random.random([n, step_end]) - 1)) # Loop for step_end ...
# ------------------------------ # 78. Subsets # # Description: # Given a set of distinct integers, nums, return all possible subsets (the power set). # Note: The solution set must not contain duplicate subsets. # # For example, # If nums = [1,2,3], a solution is: # [ # [3], # [1], # [2], # [1,2,3], # [1,3]...
class CompressedFastq( CompressedArchive ): """ Class describing an compressed fastq file This class can be sublass'ed to implement archive filetypes that will not be unpacked by upload.py. """ file_ext = "fq.gz" def set_peek( self, dataset, is_multi_byte=False ): if not dataset...
# Copyright 2017 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
class PaginatorOptions: def __init__( self, page_number: int, page_size: int, sort_column: str = None, sort_descending: bool = None ): self.sort_column = sort_column self.sort_descending = sort_descending self.page_number = page_number self...
property_setter = { "dt": "Property Setter", "filters": [ ["name", "in", [ 'Purchase Order-read_only_onload', 'Purchase Order-default_print_format', 'Purchase Invoice-naming_series-options', 'Purchase Invoice-naming_series-default', 'Delivery Note-naming_series-options', 'Delivery Note-naming_seri...
# -*- encoding: utf-8 -*- """ @File : metadata.py @Time : 2020/1/1 @Author : flack @Email : opencoding@hotmail.com @ide : PyCharm @project : faketranslate @description : 描述 """