blob_id stringlengths 40 40 | repo_name stringlengths 5 127 | path stringlengths 2 523 | length_bytes int64 22 3.06M | score float64 3.5 5.34 | int_score int64 4 5 | text stringlengths 22 3.06M |
|---|---|---|---|---|---|---|
d5b65c0ca0fc84a09f17f172404072d108c52afb | yuyaxiong/interveiw_algorithm | /剑指offer/和为S的连续正数序列.py | 849 | 3.546875 | 4 | """
输入一个正数s,打印出所有和为s的连续正数序列(至少含有两个数)。
例如:输入15,由于1+2+3+4+5=4+5+6=7+8=15,所以打印出3个连续
序列1-5,4-6和7-8。
"""
class Solution(object):
def find_continuous_sequence(self, sum):
small, bigger = 1, 2
while small < bigger:
if (small + bigger) * (bigger - small+1) / 2 == sum:
self.print_... |
e9745a6d2620ea9d036316d094c55b46be30bbeb | yuyaxiong/interveiw_algorithm | /LeetCode/链表双指针/234.py | 1,251 | 3.6875 | 4 | # Definition for singly-linked list.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
# 234.回文链表
class Solution:
def isPalindrome(self, head: ListNode) -> bool:
n_list = []
while head is not None:
n_list.append(head.val)
... |
7d2fd46534fca8d061e10b0ea73727c96631d14b | yuyaxiong/interveiw_algorithm | /剑指offer/第一个只出现一次的字符.py | 609 | 3.71875 | 4 | """
第一个只出现一次的字符。
在字符串中找出第一个只出现一次的字符。如输入:"abaccdeff",则输出"b"
"""
class Solution(object):
def first_not_repeating(self, pStrings):
if pStrings is None:
return None
s_count = {}
for s in pStrings:
if s_count.get(s) is None:
s_count[s] = 1
else:... |
79e0143f69a52b4379d644978551f76a90726e0c | yuyaxiong/interveiw_algorithm | /LeetCode/链表双指针/141.py | 607 | 3.84375 | 4 | # Definition for singly-linked list.
from typing import Optional
# 141.环形链表
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def hasCycle(self, head: Optional[ListNode]) -> bool:
slow, fast = head, head
while fast is not None and fast.next is... |
6a9bab008e394d48679ea4ed304c4dbe8c42ef55 | yuyaxiong/interveiw_algorithm | /LeetCode/链表双指针/21.py | 796 | 3.921875 | 4 | # Definition for singly-linked list.
# 21.合并两个有序链表
from typing import Optional
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def mergeTwoLists(self, list1: Optional[ListNode], list2: Optional[ListNode]) -> Optional[ListNode]:
head... |
9f74d1a7787bddd889b1abb1f786edca3b769d81 | yuyaxiong/interveiw_algorithm | /剑指offer/正则表达式匹配.py | 1,455 | 3.515625 | 4 | """
请实现一个函数用来匹配包含'.'和'*'的正则表达式。
模式中的字符'.'表示任意一个字符,而'*'表示它前面的
字符可以出现任意次(含0次)。在本题中,匹配是指字符串
的所有所有字符匹配整个模式。例如,字符串"aaa"与模式
"a.a"和"ab*ac*a"匹配,但与"aa.a"和"ab*a"均不匹配。
"""
class Solution(object):
def match(self, strings, pattern):
if strings is None or pattern is None:
return False
return self.mat... |
ef92a4e1ebdf637dc387c96ba210fcaa95b7ffde | yuyaxiong/interveiw_algorithm | /剑指offer/二叉树的深度.py | 1,525 | 4.15625 | 4 | """
输入一颗二叉树的根节点,求该树的深度。从根节点到叶节点一次经过的节点(含根,叶节点)形成树的一条路径,
最长路径的长度为树的深度。
5
3 7
2 8
1
"""
class BinaryTree(object):
def __init__(self):
self.value = None
self.left = None
self.right = None
class Solution(object):
def tree_depth(self, pRoot):
depth = 0
... |
effff8cdf0de849a58edd641191a5c94c2b24f45 | yuyaxiong/interveiw_algorithm | /LeetCode/二分搜索/35.py | 529 | 3.6875 | 4 |
# 35. 搜索插入位置
from typing import List
class Solution:
def searchInsert(self, nums: List[int], target: int) -> int:
return self.findN(nums, target, 0, len(nums)-1)
def findN(self, nums, target, s, e):
if s > e:
return s
mid = int((s + e)/2)
if nums[mid] == target:
... |
3a4131cff2a2fa57137ffcdecb2b51d0bb884098 | yuyaxiong/interveiw_algorithm | /剑指offer/数组中数值和下表相等的元素.py | 1,590 | 3.796875 | 4 | """
数组中数值和下标相等的元素
假设一个单调递增的数组里的每个元素都是整数并且是唯一的。
请编程实现一个函数,找出数组中任意一个数值等于其下标的元素。
例如:在数组[-3, -1, 1, 3, 5]
"""
class Solution(object):
def get_num_same_as_index(self, num, length):
if num is None or length <= 0:
return -1
left = 0
right = length -1
while left <= right:
... |
295269c2e2f17f0aa0dbd9e75ddbdd60e240128c | yuyaxiong/interveiw_algorithm | /剑指offer/合并两个排序的链表.py | 1,538 | 3.8125 | 4 | """
输入两个递增排序的链表,合并这两个链表并使新链表中的节点仍然是递增排序的。
例如, 输入图3.11中的链表1和链表2,则合并之后的升序链表如链表3所示。
1->3->5->7
2->4->6->8
1->2->3->4->5->6->7->8
"""
class ListNode(object):
def __init__(self):
self.value = None
self.next = None
class Solution(object):
def merge_list(self, pHead1, pHead2):
if pHead1 is No... |
6da2c66f141939606b9833e15c2a9628ee342864 | yuyaxiong/interveiw_algorithm | /LeetCode/二分搜索/1101.py | 1,177 | 3.546875 | 4 | from typing import List
# 1011. 在 D 天内送达包裹的能力
class Solution:
def shipWithinDays(self, weights: List[int], days: int) -> int:
max_val = sum(weights)
min_val = max(weights)
return self.carrayWeight(weights, min_val, max_val, days)
def carrayWeight(self, weights, s, e, days):
if ... |
a0c5d2ce5d084e464205eedc1e753fcb97dcc463 | yuyaxiong/interveiw_algorithm | /剑指offer/两个链表的第一个公共节点.py | 2,125 | 3.5625 | 4 | """
输入两个链表,找出它们的第一个公共节点。
1->2->3->6->7
4->5->6->7
"""
class ListNode(object):
def __init__(self):
self.value = None
self.next = None
class Solution(object):
def find_first_common_node(self, pHead1, pHead2):
pList1, pList2 = [], []
while pHead1.next is not None:
... |
1e9fd34c7a9f795ae1b750675d98f51a72c448c9 | yuyaxiong/interveiw_algorithm | /LeetCode/回溯算法/698.py | 1,886 | 3.609375 | 4 | #698. 划分为k个相等的子集
# leetcode 暴力搜索会超时
from typing import List
class Solution:
def canPartitionKSubsets(self, nums: List[int], k: int) -> bool:
if k > len(nums):
return False
sum_val = sum(nums)
if sum_val % k != 0:
return False
used_list = [False for _ in nums]... |
b9b1cb636e5e6168dbd58feb3f1266251d2abb7a | yuyaxiong/interveiw_algorithm | /剑指offer/二叉搜索树的后续遍历序列.py | 1,194 | 3.765625 | 4 | """
输入一个整数数组,判断该数组是否是某二叉搜索树的后续遍历结果。如果是则返回True,否则返回False。
假设输入的数组的任意两个数字都互不相同。例如,输入数组(5,7,6,9,11,10,8),则返回True,
因为这个整数序列是图4.9二叉搜索树的后续遍历结果。如果输入的数组是(7,4,6,5),则由于没有哪
颗二叉搜索树的后续遍历结果是这个序列,因此返回False。
8
6 10
5 7 9 11
"""
class Solution(object):
def verify_sequence_of_BST(self, nList):
if... |
accb77819a60ed86e64f5bf268f99662e8d40d48 | yuyaxiong/interveiw_algorithm | /剑指offer/之字形打印二叉树.py | 1,661 | 3.875 | 4 | """
请实现一个函数按照之字型顺序定二叉树,即第一行按照从左到右的顺序打印,
第二层按照从右到左的顺序打印,第三行按照从左到右的顺序打印,其他行依次类推。
例如,按之字形打印图4.8中二叉树的结构
8
| |
6 10
|| ||
5 7 9 11
"""
class BinaryTree(object):
def __init__(self):
self.value = None
self.left = None
self.right = None
class Solution(object):
# 需要NList是个栈
def... |
951af0dad234a397cadd2839c7695ee9397803ba | yuyaxiong/interveiw_algorithm | /LeetCode/数据结构设计/380.py | 1,412 | 3.828125 | 4 |
# 380. O(1) 时间插入、删除和获取随机元素
import random
class RandomizedSet:
def __init__(self):
self.nums = []
self.valToIdx = dict()
def insert(self, val: int) -> bool:
if self.valToIdx.get(val) is not None:
return False
self.valToIdx[val] = len(self.nums)
self.nums.app... |
0de9cbdec2ec0cb42e75376e9df8a989cfd4b405 | jougs/m4light | /espmpylight/animate.py | 850 | 3.9375 | 4 |
def map(val, in_min, in_max, out_min, out_max):
"""map a value val from one interval (in) to another (out)"""
return (val - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
def smoothstep(t, t_offs, duration, scale):
"""Function to fade smoothly from one value to another.
The canonical s... |
99f0223f2acdc0fba4a59939980b3f1e11781344 | MappingSystem/bonding | /Polygons.py | 4,144 | 4.3125 | 4 | import math
class Polygons:
""" This is the superclass."""
def number_of_sides(self):
return 0
def area(self):
return 0
def perimeter(self):
return 0
class Triangle(Polygons):
""" Models the properties of a triangle """
def number_of_sides(self):
return 3
... |
48554cbfb4796689c3fd8410f975c4c3177b156c | marloncard/Terminal-trader | /sql_generic.py | 597 | 3.65625 | 4 | #!/usr/bin/env python3
def create_insert(table_name, columns):
columnlist = ", ".join(columns)
qmarks = ", ".join("?" for val in columns)
SQL = """ INSERT INTO {table_name} ({columnlist})
VALUES ({qumarks})
"""
return SQL.format(table_name=table_name,
col... |
894c5bd3426c7d33e4c4876940b788c490ad43e9 | CrocodileCroco/LPassGen | /LPassGen.py | 985 | 3.515625 | 4 | from tkinter import *
from functools import partial
import random
root = Tk()
genrated = ''
def passgen():
genrated = ''
charlimitset = 0
charlimitset = int(entry_chlimit.get())
charlimitloop = charlimitset
print(charlimitset)
path = 'passletters.txt'
letterlist = open(path,'r')
ltrlist... |
23093aeec021225ca268b13ff12cd6cb6fdc0f7d | task-master98/ReinforcementLearning | /Environments/Trial.py | 1,096 | 3.65625 | 4 | import pygame
pygame.init()
screen = pygame.display.set_mode((200, 200))
run = True
pos = pygame.Vector2(100, 100)
clock = pygame.time.Clock()
# speed of your player
speed = 2
# key bindings
move_map = {pygame.K_LEFT: pygame.Vector2(-1, 0),
pygame.K_RIGHT: pygame.Vector2(1, 0),
pygame.K_UP: ... |
7d65a6e0fef25b6351e3b8add6fb79846520bf8c | task-master98/ReinforcementLearning | /DQN_models.py | 6,102 | 3.65625 | 4 | """
@Author: Ishaan Roy
#####################
Deep Q-Learning Algorithm
Framework: Pytorch
Task: Using Reinforcement Learning to play Space Invaders
File contains: Models required for Space Invaders game
#TODO
----------------------------------
=> Implement the Agent class: same file?
=> Write the main loop
=> Move he... |
2af2bc15f109cb2de4718386edc0f50162fd4f77 | TheReformedAlloy/py-class-examples | /clock.py | 2,077 | 3.984375 | 4 | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 4 11:50:38 2019
@author: Clint Mooney
"""
class Clock():
# Override Built-In Class Functions:
def __init__(self, hour=0, minutes=0, seconds=0):
self.hour = self.checkInput(hour, 0)
self.minutes = self.checkInput(minutes, 0)
self.seconds =... |
ce6eceac86ea4bb06541e5fc214aed8a1aad6fa7 | amitrajhello/PythonEmcTraining1 | /inheritenceAndOverridding.py | 453 | 3.75 | 4 | from inheritence import Person
class Employee(Person):
"""Employee class extends to class Person"""
def __init__(self, eid, fn, ln):
self.eid = eid
super().__init__(fn, ln) # invoke the overridden method
def get_info(self):
print('employee id:', self.eid)
sup... |
3991d59a1de29307e9b9333585e679c7bd3e679b | amitrajhello/PythonEmcTraining1 | /listdemo.py | 135 | 3.6875 | 4 | # Defining a list
items = [2.2, 'pam', 3.4, 'allen', .98, 'nick', 1, 2, 3, 4]
print(items)
print(len(items))
print(type(items))
|
77c9f7f18798917cbee5e7fc4044c3a70d73bb33 | amitrajhello/PythonEmcTraining1 | /psguessme.py | 611 | 4.1875 | 4 | """The player will be given 10 chances to guess a number, and when player gives a input, then he should get a feedback
that his number was lesser or greater than the random number """
import random
key = random.randint(1, 1000)
x = 1
while x <= 10:
user_input = int(input('Give a random number to play the ... |
fca48a33c99466a9c500454c2579590cd4390e5c | amitrajhello/PythonEmcTraining1 | /listRedundentEntries.py | 221 | 3.6875 | 4 | # eliminates duplicate entries
duplicates = [2.2, 3.3, 5.3, 2.2, 3.3, 5.3, 2.2, 3.3, 5.3]
print(set(duplicates)) # list type casted to set
uniq = list(set(duplicates)) # set type casted to list
print(uniq)
|
e1b50fc8a71d3bee42a9b8c02faf0128aa8e079e | amitrajhello/PythonEmcTraining1 | /iterator.py | 222 | 4 | 4 | s = 'root:x:0:0:root:/root>/root:/bin/bash'
for temp in s:
print(temp, '->', ord(temp)) # ord() is the function to print ASCII value of the character
for temp in reversed(s):
print(temp, '->', ord(temp))
|
9698a1b04749f46eb3735fe780e55880f48a2eab | amitrajhello/PythonEmcTraining1 | /inheritence.py | 419 | 3.953125 | 4 | class Person:
"""base class"""
def __init__(self, fn, ln): # self takes the reference of the current object
self.fn = fn # sets the first name of the current object
self.ln = ln
def get_info(self):
print('first name:', self.fn)
print('last name:', self.ln)
i... |
7095cca9d20fa2b15bb9afeb78cdc3af05164109 | Nosfer123/python_study | /HW_2_1.py | 494 | 4.09375 | 4 | def prepare_num(num):
while num <= 0:
print("Number should be more than zero")
num = prepare_num(int(input("Enter number: ")))
return num
def Fizz_Buzz(num):
if num % 3 == 0 and num % 5 == 0:
return "Fizz Buzz"
elif num % 3 == 0:
return "Fizz"
elif num % 5 == 0:
... |
84a2a5d8fd8de28f506ed71dc3634e5c815bdfbf | Nosfer123/python_study | /HW_4_1_2.py | 220 | 3.8125 | 4 | col = (input('Number of columns: '))
row = (input('Number of lines: '))
text = (input('What do you want to print? '))
def print_text():
for dummy_n in range (int(row)):
print (text*(int(col)))
print_text() |
9a9945bfd0b2e0998e4b25597fe15f6d93873245 | Nosfer123/python_study | /HW_8_1.py | 373 | 3.859375 | 4 | def is_concatenation(dictionary, key):
if not key:
return True
idx = 1
while idx <= len(key):
if key[0:idx] in dictionary and is_concatenation(dictionary, key[idx:]):
return True
idx += 1
return False
test_dict = ["world", "hello", "super"]
print(test_dict)
print("he... |
0cfdbc8f80c62aa9c12efbdad639aef979675fb0 | Nosfer123/python_study | /HW_2_2.py | 212 | 3.875 | 4 | def number():
num = int(input("Enter number: "))
for number_in_list in range (num+1):
if number_in_list % 2 == 0 and number_in_list > 0:
print (number_in_list*number_in_list)
number() |
1d3bcad1638a46ff2e58a96439ed9d3a1d029510 | Nosfer123/python_study | /lesson3_9.py | 256 | 3.875 | 4 | def print_square(n):
for i in range(n):
for k in range(n):
print('*', end='')
print()
while True:
num = int(input('N: '))
print_square(num)
print()
is_done = input('One more?')
if is_done:
break |
5d0fbd2af9084c9b6b54c1b42b39dc144b0081ad | Nosfer123/python_study | /HW_3_1.py | 327 | 3.859375 | 4 | from random import randint
def dice_throw():
return randint(1,6)
def dice_sum():
counter = 0
while True:
dice1 = dice_throw()
dice2 = dice_throw()
counter += 1
if dice1+dice2 == 8:
print(dice1, dice2, counter)
break
for dummy_i in range(10):
dic... |
2245707d7083ce60cbb00f9be02150a36806fba4 | SeptivianaSavitri/tugasakhir | /NER_Ika_Lib/WikiSplitType.py | 2,603 | 3.640625 | 4 | ####################################################################################
# WikiSplitType.py
# @Author: Septiviana Savitri
# @Last update: 8 Februari 2017
# Fasilkom Universitas Indonesia
#
# Objective: To filter the sentences so that meets certain criterias
# input:
# - a file contains all sentences -->... |
e62ac4c465dacd0c5694a65ce2c3185c64e05419 | smritisingh26/AndrewNGPy | /LinearRegression.py | 1,064 | 3.625 | 4 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
data = pd.read_csv('ex1data1.txt', header = None)
X = data.iloc[:,0]
y = data.iloc[:,1]
m = len(y)
print(data.head())
plt.scatter(X, y)
plt.xlabel('Population of City in 10,000s')
plt.ylabel('Profit in $10,000s')
#plt.show()
X = X[:,np.new... |
67e83fd9552337c410780198f08039044c925965 | Mickey248/ai-tensorflow-bootcamp | /pycharm/venv/list_cheat_sheet.py | 1,062 | 4.3125 | 4 | # Empty list
list1 = []
list1 = ['mouse', [2, 4, 6], ['a']]
print(list1)
# How to access elements in list
list2 = ['p','r','o','b','l','e','m']
print(list2[4])
print(list1[1][1])
# slicing in a list
list2 = ['p','r','o','b','l','e','m']
print(list2[:-5])
#List id mutable !!!!!
odd = [2, 4, 6, 8]
odd[0] = 1
print(o... |
09c67af03e8d3a2219d072ac4e78b3bab4d19481 | BryanISC/b1 | /numeros primos recursivos.py | 350 | 3.875 | 4 | def numeroPrimoRecursivo(numero, c):
if(numero % c == 0 and numero > 2):
return False;
elif(c > numero / 2):
return True;
else:
return numeroPrimoRecursivo( numero, c+1 );
numero = int(input("\ningrese un numero: "))
if(numeroPrimoRecursivo(numero, 2) ):
print ("el numero es primo")
else:
pri... |
4eba19ae037e7b6ba9334c7c1d4099102c17ab5c | mycks45/DS | /Selection_sort.py | 405 | 3.734375 | 4 | def selection_sort(arr):
length = len(arr)
i = 0
while i < (length-1):
j = i+1
while j<length:
if arr[i]>arr[j]:
temp = arr[i]
arr[i] = arr[j]
arr[j] = temp
j +=1
i +=1
return arr
arr = [5,3,78,212,43,12,34,... |
c4f6294bcdffb315f9bb02e63810024ac79e97cf | mycks45/DS | /string encode.py | 429 | 3.59375 | 4 |
def encode(message, key):
new_message = ''
for i in range(len(message)):
ascii_val = ord(message[i])
val = ascii_val + key
if val >122:
k = (122-val)
k = k % 26
new_message += chr(96 + k)
else:
new_message += chr(val... |
a744a47b4a4954fd8a718ca27e2bd3fcc799c084 | KMFleischer/PyEarthScience | /Transition_examples_NCL_to_PyNGL/xy/TRANS_bar_chart.py | 3,076 | 3.703125 | 4 | #
# File:
# TRANS_bar_chart.py
#
# Synopsis:
# Illustrates how to create a bar chart plot
#
# Categories:
# bar chart plots
# xy plot
#
# Author:
# Karin Meier-Fleischer, based on NCL example
#
# Date of initial publication:
# September 2018
#
# Description:
# This example shows how to crea... |
b5f7437fcb49452d5a9214af6a79e48cdb121b49 | minhnguyenphuonghoang/AlgorithmEveryday | /EverydayCoding/0019_validate_symbols.py | 2,114 | 3.78125 | 4 | from BenchmarkUtil import benchmark_util
"""Day 53: Validate Symbols
We're provided a string like the following that is inclusive of the following symbols:
parentheses '()'
brackets '[]', and
curly braces '{}'.
Can you write a function that will check if these symbol pairings in the string follow these below condition... |
e1fcd85babfd1971ba7bdb4a9a733ad22b250438 | minhnguyenphuonghoang/AlgorithmEveryday | /EverydayCoding/0022_find_prime_number.py | 1,265 | 3.609375 | 4 | from BenchmarkUtil import benchmark_util
"""Write a function to find a prime number of a given number
Prime number is the number that can only divide by 1 and itself.
For example: 1, 2, 3, 5, 7, 13, etc are prime numbers.
"""
from math import sqrt
NO_OF_SOLUTION = 2
def solution_01(s):
if s < 1:
return F... |
b7b283a77a4c9135f5cdd904dccb4594bc58eecb | minhnguyenphuonghoang/AlgorithmEveryday | /Algorithms/greatest_common_denominator.py | 160 | 3.5625 | 4 | def euclid_alg(num1, num2):
while num2 != 0:
temp = num1
num1 = num2
num2 = temp % num2
return num1
print(euclid_alg(20, 8))
|
c7bdf0cbdf287f5d15d4d229aa787e9f3e42523d | caramelmelmel/50.003-ESC_g_3_8 | /react-app/src/test/fuzzing/testFuzzInvalidPassword.py | 3,099 | 3.65625 | 4 | import random
import string
import re
# This test allows us to check if the passwords that we expect to fail will actually fail the regex
def fuzz(valid):
# Use various methods to fuzz randomly
for i in range(3):
trim_bool = random.randint(0, 1)
duplicate_bool = random.randint(0, 1)
sw... |
c9f325732c1a2732646deadb25c9132f3dcae649 | samir-0711/Area_of_a_circle | /Area.py | 734 | 4.5625 | 5 | import math
import turtle
# create screen
screen = turtle.Screen()
# take input from screen
r = float(screen.textinput("Area of Circle", "Enter the radius of the circle in meter: "))
# draw circle of radius r
t=turtle.Turtle()
t.fillcolor('orange')
t.begin_fill()
t.circle(r)
t.end_fill()
turtle.penup()
# calculate are... |
e1b281dbeb0452fa235c5bdfcd3827a44ebd4167 | Kristjan-O-Ragnarsson/FORR3RR05DU-verk2 | /sam.py | 155 | 3.625 | 4 | n = int(input())
m = int(input())
def funct(n, m):
if m == 0:
return n
else:
return funct(m, n % m)
print(funct(n, m))
|
933775bd8c8e1c702aa390bc16ba389db0287649 | Serpinex3/rx-anon | /anon/configuration/configuration_reader.py | 1,448 | 3.5625 | 4 | """Module containing corresponding code for reading a configuration file"""
import logging
from yaml import Loader, load
from .configuration import Configuration
logger = logging.getLogger(__name__)
class ConfigurationReader:
"""Class responsible for parsing a yaml config file and initializing a configuration"... |
c7ac2454578be3c3497759f156f7bb9f57415433 | dawid86/PythonLearning | /Ex7/ex7.py | 513 | 4.6875 | 5 | # Use words.txt as the file name
# Write a program that prompts for a file name,
# then opens that file and reads through the file,
# and print the contents of the file in upper case.
# Use the file words.txt to produce the output below.
fname = input("Enter file name: ")
fhand = open(fname)
# fread = fhand.read()
# p... |
acc900f9c4e91d452dccec4c9220142fd32dbd9b | AndersonCamargo20/Exercicios_python | /ex012.py | 423 | 3.765625 | 4 | print('========== DESAFIO 012 ==========')
print('LEIA O VALOR DE UM PRODUTO E INFORME O VALOR FINAL COM DESCONTO APÓS LER A PORCENTAGEM')
valor = float(input('Informe o valor do produto: R$ '))
porcent = float(input('Informe o valor da porcentagem: '))
desconto = (valor * porcent) / 100
print('O produto custava R${},... |
e514f618a3ffe08a2610ea780cf7efff8314c1fa | AndersonCamargo20/Exercicios_python | /ex032.py | 548 | 4 | 4 | print('========== DESAFIO 032 ==========')
print('LEIA UM ANO E DIGA SE ELE É BISEXTO OU NÃO')
from calendar import isleap
from datetime import datetime
now = datetime.now()
ano = int(input('Informe um ano para o calculo (Caso queira o ano atual informe ->> 0 <<-): '))
if ano == 0:
if isleap(now.year):
... |
d05af16be3b0e6715bdc528234604e6b515b641e | AndersonCamargo20/Exercicios_python | /ex007.py | 359 | 3.953125 | 4 | print('========== DESAFIO 007 ==========')
print('FAÇA UM PROGRAMA QUE FAÇA A MÉDIA ARITIMÉTICA ENTRE TRÊS NOTAS\n')
n1 = float(input("Informe a 1º nota: "))
n2 = float(input("Informe a 2º nota: "))
n3 = float(input("Informe a 3º nota: "))
soma = n1 + n2 + n3
media = soma / 3
print("A média das notas ({}, {} , {} ) é... |
5373667470e39443ab1191f2f523e0dc43742638 | AndersonCamargo20/Exercicios_python | /ex013.py | 489 | 3.796875 | 4 | print('========== DESAFIO 013 ==========')
print('LEIA UM SALÁRIO E A PORCENTAGEM DE AUMENTA E CALCULA O VALOR DO SALÁRIO COM AUMENTO')
salario_old = float(input('Informe o salário do funcionário: R$ '))
porcent = float(input('Informe a porcentagem de aumento: '))
aumento = (salario_old * porcent) / 100
salario_new = ... |
aa7452cbe83e2b4f61db6f28d244f4f4b19cb481 | AndersonCamargo20/Exercicios_python | /ex019.py | 451 | 3.84375 | 4 | print('========== DESAFIO 019 ==========')
print('LENDO O NOME DE 4 ALUNOS SORTEI UM DELES DA CHAMADA PARA APAGAR O QUADRO')
import random
list_alunos = []
num_alunos = int(input('Quantos alunos deseja salvar: '))
random = random.randint(0,num_alunos - 1)
print(random)
for i in range(0, num_alunos):
list_alunos... |
acd10df184f13bb7c54a6f4a5abac553127b27af | chittoorking/Top_questions_in_data_structures_in_python | /python_program_to_create_grade_calculator.py | 830 | 4.25 | 4 | #Python code for the Grade
#Calculate program in action
#Creating a dictionary which
#consists of the student name,
#assignment result test results
#And their respective lab results
def grade(student_grade):
name=student_grade['name']
assignment_marks=student_grade['assignment']
assignment_score=... |
968829ff7ec07aabb3dedfb89e390334b9b9ee57 | chittoorking/Top_questions_in_data_structures_in_python | /python_program_to_check_if_a_string_is_palindrome_or_not.py | 450 | 4.3125 | 4 | print("This is python program to check if a string is palindrome or not")
string=input("Enter a string to check if it is palindrome or not")
l=len(string)
def isPalindrome(string):
for i in range(0,int(len(string)/2)):
if string[i]==string[l-i-1]:
flag=0
continue
else :
... |
06132de9f0dd0dfbf3138ead23bd4a936ca4a70a | chittoorking/Top_questions_in_data_structures_in_python | /python_program_to_interchange_first_and_last_elements_in_a_list_using_pop.py | 277 | 4.125 | 4 | print("This is python program to swap first and last element using swap")
def swapList(newList):
first=newList.pop(0)
last=newList.pop(-1)
newList.insert(0,last)
newList.append(first)
return newList
newList=[12,35,9,56,24]
print(swapList(newList))
|
2f2fe636142d1859b49195d440d60e6641a45bc9 | inwk6312fall2018/programmingtask2-hanishreddy999 | /crime.py | 685 | 3.515625 | 4 |
from tabulate import tabulate #to print the output in table format
def crime_list(a): #function definition
file=open(a,"r") #open csv file in read mode
c1=dict()
c2=dict()
lst1=[]
lst2=[]
for line in file:
line.strip()
for lines in line.split(','):
lst1.append(lines[-1])
lst2.append(l... |
4c84102e21f49b710bd9bd292fc816700382f811 | basile-henry/projecteuler | /Python/problem60.py | 631 | 3.59375 | 4 | import primes2 as primes
def isPairPrime(a, b):
return primes.isPrime(int(str(a) + str(b))) and primes.isPrime(int(str(b) + str(a)))
def test(l, n):
return all([isPairPrime(a, n) for a in l])
def next(l, limit):
i = primes.getIndexOf(l[-1]) + 1
p = primes.getPrimeAt(i)
while not test(l, p):
i+=1
p = primes... |
509351177f6f9f41f47f5508a9da26c761202806 | jrihds/pdat | /code/generators.py | 265 | 4 | 4 | #!/usr/bin/env python3
"""Generator objects."""
colours = ['blue', 'red', 'green', 'yellow']
def e_count(_list):
"""Count how many e's in a string."""
for element in _list:
yield element.count('e')
for value in e_count(colours):
print(value)
|
10880d4e6f4462c7ae0af751dd4b68b5530680fe | Mitchell55/NumericalAnalysis | /Numerical_analysis/Forward_Euler.py | 673 | 3.59375 | 4 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 10 20:19:09 2019
@author: Mitchell Krouss
Method: Forward Euler
"""
import math
import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sc
a = 0
b = 1
h = 0.0001
n = int((b - a) / h)
def f(x,y):
return 998*x - 1998*y
def g(x,y):
return 1000*... |
3067c55a4f898411564a58baff539cd41f94a4db | amiune/projecteuler | /Problem054.py | 4,338 | 3.625 | 4 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
cardValue = {'2':2,'3':3,'4':4,'5':5,'6':6,'7':7,'8':8,'9':9,'T':10,'J':11,'Q':12,'K':13,'A':14}
# In[74]:
def getHighestCardValue(cards):
cards = sorted(cards, key=lambda card: cardValue[card[0]])
return cardValue[cards[-1][0]]
# In[86]:
def maxOfAKind(... |
70db04c2a239741286b2ca8e14ad4aae7d6ed462 | amiune/projecteuler | /Problem049.py | 816 | 3.953125 | 4 | #!/usr/bin/env python
# coding: utf-8
# In[6]:
def isPrime(n):
if n == 2 or n == 3: return True
if n < 2 or n%2 == 0: return False
if n < 9: return True
if n%3 == 0: return False
r = int(n**0.5)
f = 5
while f <= r:
if n % f == 0: return False
if n % (f+2) == 0: return Fals... |
998cb8e31e2065edefca18de17d6d4062d3aa564 | amiune/projecteuler | /Problem009.py | 263 | 3.578125 | 4 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import math
# In[8]:
n = 1000
for a in range(1,n-2):
for b in range(a+1, n-1):
c = math.sqrt(a*a + b*b)
if a + b + c == 1000:
print(int(a*b*c))
break
# In[ ]:
|
d57723a50878b71814f9ecdb6e7be14687e1aed9 | amiune/projecteuler | /Problem001.py | 168 | 3.796875 | 4 | #!/usr/bin/env python
# coding: utf-8
# In[4]:
answer = 0
for i in range(1, 1000):
if i % 3 == 0 or i % 5 == 0:
answer += i
print(answer)
# In[ ]:
|
0901c75662df3c0330deb4d25087868ba0693e94 | dipesh1011/NameAgeNumvalidation | /multiplicationtable.py | 360 | 4.1875 | 4 | num = input("Enter the number to calculate multiplication table:")
while(num.isdigit() == False):
print("Enter a integer number:")
num = input("Enter the number to calculate multiplication table:")
print("***************************")
print("Multiplication table of",num,"is:")
for i in range(1, 11):
res = i... |
1533e4ed87eb8d3650b5bd6998224361c83f376f | fANZYo/FrenchTestPy | /frenchPhrases.py | 2,212 | 4 | 4 | # Keep your imports at the top. It's good practice as it tells anyone reading your code what the program relies on
from sys import argv, exit
from random import randint
import json
def play(data):
"""Start the game with the list of sentences provided
data -- list of sentences
"""
while True:
sentencePick = ran... |
7b8fb7f4e7c0a339befa3619eefe77cfbb42a4f4 | Antn-Amlrc/Calendar_2020 | /day9.py | 1,707 | 3.921875 | 4 | file = open('input9.txt', "r")
lines = file.readlines()
file.close()
# PART 1
def is_the_sum_of_two_numbers(n, preambule):
for i in range(len(preambule)):
n1 = int(preambule[i])
for j in range(i+1,len(preambule)):
n2 = int(preambule[j])
if n1+n2==n:
... |
caaee5e916ac6fdee8d1cf40556b1168b1b266a5 | darsh10/HateXplain-Darsh | /Preprocess/attentionCal.py | 5,061 | 3.90625 | 4 | import numpy as np
from numpy import array, exp
###this file contain different attention mask calculation from the n masks from n annotators. In this code there are 3 annotators
#### Few helper functions to convert attention vectors in 0 to 1 scale. While softmax converts all the values such that their sum lies betw... |
c7a6b2bca50c23c93ab645a0be278b4a2d7830b2 | JoaolSoares/CursoEmVideo_python | /Exercicios/ex018.py | 500 | 4.03125 | 4 | from math import(pi , cos , sin , tan , radians)
an1 = float(input('Diga o angulo: '))
an2 = (an1 * pi) / 180
# Podemos usar tambem o math: an2 = radians(an1)
# sen = (sin(radians(an1)))
sen = sin(an2)
cos = cos(an2)
tg = tan(an2)
print('')
print('{:-^30}' .format(''))
print('O SENO do angulo {} é: {:.3f}... |
bcbb9151b1274e5b0b852c1cfa1db212d322f84d | JoaolSoares/CursoEmVideo_python | /Exercicios/ex004.py | 624 | 4.09375 | 4 | n1 = input('digite algo:')
print('o tipo primitivo desse valor é:', type(n1))
print('só tem espaços?', n1.isspace())
print('pode ser um numero?', n1.isnumeric())
print('é maiusulo?', n1.islower())
print('é minusculo?', n1.isupper())
print('é alfabetico?', n1.isalpha())
print('é alfanumerico?', n1.isalnum())
pri... |
9d6b6a18e003e0c7c3fca4dd0d2712f323f7cf5c | JoaolSoares/CursoEmVideo_python | /Exercicios/ex012.py | 220 | 3.65625 | 4 | d1 = float(input('Diga o desconto aplicado: '))
p1 = float(input('Diga o preço do produto: '))
desconto = (p1 * d1) / 100
print('O preço do produto com {}% de descondo ficará: {:.2f}' .format(d1 , p1 - desconto))
|
befa116c3ae0d337ea4ce41f8732d55e0c0b105a | JoaolSoares/CursoEmVideo_python | /Exercicios/ex031.py | 253 | 3.640625 | 4 | n1 = float(input('Diga quantos KM tem a sua viagem: '))
if n1 <= 200:
print('O preço da sua passagem ficara R${}' .format(n1 * 0.50))
else:
print('O preço da sua passagem ficara R${}' .format(n1 * 0.45))
print('Tenha uma boa viagem!! ;D') |
4a6e58653632be4182d5b9183938e56ea69f376c | JoaolSoares/CursoEmVideo_python | /Exercicios/ex069.py | 720 | 3.59375 | 4 | r = 's'
id18cont = mcont = f20cont = 0
# Esta sem a validação de dados...
while True:
print('--' * 15)
print('Cadastro de pessoas')
print('--' * 15)
idade = int(input('Qual a idade? '))
sex = str(input('Qual o sexo? [M/F] ')).strip().upper()[0]
print('--' * 15)
r = str(input(... |
93a6dccf6ecbe72702504cd62cfdc54f117ee363 | JoaolSoares/CursoEmVideo_python | /Exercicios/ex085.py | 310 | 3.625 | 4 | lista = [[], []]
for c in range(1, 8):
n1 = int(input(f'Digite o {c}º Numero: '))
if n1 % 2 == 0:
lista[0].append(n1)
else:
lista[1].append(n1)
print('\033[1;35m-+\033[m' * 18)
print(f'Numeros pares: {sorted(lista[0])}')
print(f'Numeros impares: {sorted(lista[1])}')
|
512085f8ba8507522624dd8f0ae41c5825387ce7 | JoaolSoares/CursoEmVideo_python | /Exercicios/ex062.py | 461 | 3.78125 | 4 | pt = int(input('Diga o primeiro termo da P.A: '))
rz = int(input('Diga a tazão dessa P.A: '))
cont = 1
termo = pt
mais = 1
while mais != 0:
while cont <= 9 + mais:
print(termo, end=' - ')
termo += + rz
cont += 1
print('Finish...')
print('--' * 25)
mais = int(i... |
8bf302e5b3c3b91e868479e2119f49f77a2b3422 | JoaolSoares/CursoEmVideo_python | /Exercicios/ex054.py | 364 | 3.8125 | 4 | from datetime import date
cont = 0
cont2 = 0
for c in range(1, 8):
nasc = int(input('Qual o ano de nascimento da {}º pessoa? ' .format(c)))
if date.today().year - nasc >= 18:
cont += 1
else:
cont2 += 1
print('--' * 20)
print('Existem {} pessoas MAIORES de idade.\nExistem {} pessoas... |
bdbd784a551a48151d15b76bdb80a49210bee853 | JoaolSoares/CursoEmVideo_python | /Exercicios/ex089.py | 1,138 | 3.984375 | 4 | aluno = []
lista = []
res = 'S'
print('\033[1;35m--' * 15)
print(f'{"Sistema Do Colegio":^30}')
print('--' * 15, '\033[m')
print('----')
# Coleta de dados
while res in 'Ss':
aluno.append(str((input('Nome do aluno: '))))
aluno.append(float(input('Nota 1: ')))
aluno.append(float(input('Nota 2: ... |
546907fe45b06b4c4813f9f1d193f073b7520672 | JoaolSoares/CursoEmVideo_python | /Exercicios/ex103.py | 411 | 3.671875 | 4 | def ficha(nome='<Desconhecido>', gols=0):
print(f'O jogador {nome} marcou {gols} gols no campeonato.')
n1 = input('Nome do jogador: ')
n2 = input('Gols no campeonato: ')
print('-=' * 20)
if n2.isnumeric():
n2 = int(n2)
if n1.strip() != '':
ficha(n1, n2)
else:
ficha(gols=n... |
67341965a301d547ba5422c3d1e256a2f513999b | JoaolSoares/CursoEmVideo_python | /Exercicios/ex020.py | 360 | 3.5625 | 4 | from random import shuffle
a1 = input('Diga o nome de um aluno: ')
a2 = input('Diga o nome de um aluno: ')
a3 = input('Diga o nome de um aluno: ')
a4 = input('Diga o nome de um aluno: ')
lista = [a1, a2, a3, a4]
shuffle(lista)
print('')
print('{:-^70}' .format(''))
print('A ordem escolhida foi: {}' .format... |
bc0e0a3075ea950cf67bc7bfe44201842624a81f | JoaolSoares/CursoEmVideo_python | /Exercicios/ex029.py | 223 | 3.71875 | 4 | n1 = int(input('Qual foi sua velocidade: '))
if n1 <= 80:
print('PARABENS! Por nao ter utrapassado o limite de 80km/h')
else:
print('ISSO NÃO FOI LEGAL! Você recebera uma multa de R${}' .format((n1 - 80) * 7)) |
fc95289439761478c89aaef10340dd1c0c149a36 | wangchengww/great-ape-Y-evolution | /palindrome_analysis/palindrome_read_depth/calculate_copy_number/Palindrome_scripts/line_up_columns.py | 4,441 | 3.609375 | 4 | #!/usr/bin/env python
import sys
def parse_columns(s):
if (".." in s):
(colLo,colHi) = s.split("..",1)
(colLo,colHi) = (int(colLo),int(colHi))
return [col-1 for col in xrange(colLo,colHi+1)]
else:
cols = s.split(",")
return [int(col)-1 for col in cols]
# commatize--
# Convert a numeric string into one ... |
ebbffeb694f13ec4d1d5282089eb228a9709a422 | jet76/CS-4050 | /Project 04/SumsToN.py | 346 | 3.875 | 4 | def recurse(num, sum, out):
if sum > n:
return
else:
sum += num
if sum == n:
print(out + str(num))
return
else:
out += str(num) + " + "
for i in range(num, n + 1):
recurse(i, sum, out)
n = int(input("Enter a positive integer: "))
for i in range(1, n +... |
d6e556e4afd34c6a8056dfa1df965ba5f6fd5c48 | Z477/concurrent-program | /2_multi_threading/demo_5_threadpoolexecutor.py | 1,533 | 3.640625 | 4 | #!/usr/bin/env python
# encoding: utf-8
'''
Use concurrent.futures to implement multi thread
Created on Jun 30, 2019
@author: siqi.zeng
@change: Jun 30, 2019 siqi.zeng: initialization
'''
import concurrent.futures
import logging
import time
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s [line:... |
ebd6f80484ef4a051fadde4199f8b27c366fa283 | JMSMonteiro/AED-Proj2 | /src/gui.py | 7,450 | 3.75 | 4 | from tkinter import *
from tkinter import messagebox
import main
########## FUNCTIONS JUST TO HAVE TEXT/CLEAR TEXT FROM THE ENTRIES ##########
#Still looking for a way to make all of these into 2 functions
def on_entry_click_0(event): #Cities Entry
"""function that gets called whenever entry is clicked"""
entry_c... |
8ed94e5a5bc207a34271e2bb52029d7b6b71870d | darlenew/california | /california.py | 2,088 | 4.34375 | 4 | #!/usr/bin/env python
"""Print out a text calendar for the given year"""
import os
import sys
import calendar
FIRSTWEEKDAY = 6
WEEKEND = (5, 6) # day-of-week indices for saturday and sunday
def calabazas(year):
"""Print out a calendar, with one day per row"""
BREAK_AFTER_WEEKDAY = 6 # add a newline after ... |
ab7b1bc5da6df5746bed215e196f2208301570df | jonathan-mcmillan/python_programs | /asdf;lkj.py | 1,126 | 3.5 | 4 | from cs1graphics import *
numLevels = 8
unitSize = 12
screenSize = unitSize * (numLevels + 1)
paper = Canvas(screenSize, screenSize)
for level in range(numLevels):
centerX = screenSize / 2
leftMostX = centerX - unitSize / 2 * level
centerY = (level +1) * unitSize
for blockCount in range(level +1):
... |
e96bfc80489c56a2fef2d71ca5ae417f6738a539 | jonathan-mcmillan/python_programs | /notes_2⁄1.py | 591 | 3.671875 | 4 | groceries=['eggs','ham','toast','juice']
for item in groceries:
print item
count = 1
for item in groceries:
print str(count)+')'+item
count += 1
a = [6,2,4,3,2,4]
n=0
print a
for e in a:
a[n]= e*2
n +=1
print a
for i in range(len(a)):
a[i] *= 2
print a
m = [[3,4],[2,1]]
for i in range... |
7a3e2fb304cbb15c640e17841da60543e46e95eb | emrache/Python_600x | /Problem Set 9/ps9.py | 2,824 | 3.65625 | 4 | # 6.00 Problem Set 9
import numpy
import random
import pylab
from ps8b_precompiled_27 import *
#
# PROBLEM 1
#
def simulationDelayedTreatment(numTrials):
"""
Runs simulations and make histograms for problem 1.
Runs numTrials simulations to show the relationship between delayed
treatment and pa... |
85c0cb7b1fb3da5a3e4f20d60d1a55ca1576aad3 | rorjackson/Jack | /tkintergui.py | 553 | 3.9375 | 4 | from tkinter import *
win = Tk()
win.geometry('200x100')
name = Label(win, text="Name") # To create text label in window
password = Label(win,text="password")
email = Label(win, text="Email ID")
entry_1 = Entry(win)
entry_2 = Entry(win)
entry_3 = Entry(win)
# check = CHECKBUTTON(win,text ="keep me logged in")
nam... |
d86ab402a950557261f140137b2771e84ceafbbe | priyankagarg112/LeetCode | /MayChallenge/MajorityElement.py | 875 | 4.15625 | 4 | '''
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.
You may assume that the array is non-empty and the majority element always exist in the array.
Example 1:
Input: [3,2,3]
Output: 3
Example 2:
Input: [2,2,1,1,1,2,2]
Output: 2
'''
from t... |
92bbf967afbb85b943c9af46bde946b2d0d9fdf9 | tusshar2000/DSA-Python | /graphs/dfs_cycle_directed_graph.py | 2,502 | 3.71875 | 4 | # https://leetcode.com/problems/course-schedule/
from collections import defaultdict
class Solution:
def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool:
# defaultdict(list) makes work easier
graph = defaultdict(list)
# we need to have eve... |
5b9cd3610bf26e71e74df0a4a869b3969382b5ac | tusshar2000/DSA-Python | /graphs/word-search-using-dfs.py | 1,993 | 3.71875 | 4 | # https://leetcode.com/problems/word-search/
class Solution:
def exist(self, board: List[List[str]], word: str) -> bool:
col = len(board[0])
row = len(board)
len_of_word = len(word)
is_possible = False #starting with it's not possible to form the string.
visited = ... |
78b22399df13bda1fa6519d86a1192cf358f6e87 | tusshar2000/DSA-Python | /binary tree/max_depth_of_n-ary_tree.py | 599 | 3.75 | 4 | https://leetcode.com/problems/maximum-depth-of-n-ary-tree/
#BFS
"""
# Definition for a Node.
class Node:
def __init__(self, val=None, children=None):
self.val = val
self.children = children
"""
class Solution:
def maxDepth(self, root: 'Node') -> int:
if not root:
... |
1e190699791483acd663a85db438602a6169e360 | kp646576/Simple-Compiler | /lexer.py | 4,596 | 3.625 | 4 | import sys
from scanner import Scanner
from token import Token
from symbolTable import symbolTable as st
def isAlpha(c):
if c:
c = ord(c)
return True if c >= 65 and c <= 90 or c >= 97 and c <= 122 else False
def isDigit(c):
if c:
c = ord(c)
return True if c <= 57 and c >= 48 else Fals... |
5fbf2ff1591bdc0a50b2ad9758cf806bf7e4f6e8 | ttsiodras/VideoNavigator | /menu.py | 5,600 | 3.71875 | 4 | #!/usr/bin/env python
"""
A simple Pygame-based menu system: it scans folders and collects the single
image/movie pair within each folder. It then shows the collected pictures,
allowing you to navigate with up/down cursors; and when you hit ENTER,
it plays the related movie.
The configuration of folders, resolutions, ... |
f03de31739574749ee56fabdeffdb43e0dc9229b | divannn/python | /math/sort_util.py | 71 | 3.546875 | 4 | def swap(list, i, j):
tmp = list[i]
list[i] = list[j]
list[j] = tmp
|
61329cb09135f5634b1c64baa1db566836929a26 | shivamach/OldMine | /HelloWorld/python/strings.py | 527 | 4.375 | 4 | print("trying basic stuff out")
m1 = "hello"
m2 = "World"
name = "shivam"
univ = "universe"
print(m1,", ",m2)
print(m1.upper())
print(m2.lower())
message = '{}, {}. welcome !'.format(m1,m2.upper())
print(message)
message = message.replace(m2.upper(),name.upper())
#replacing with methods should be precise
print(messag... |
433027b761e728e242c5b58c11866208fe39ca23 | caesarbonicillo/ITC110 | /quadraticEquation.py | 870 | 4.15625 | 4 | #quadratic quations must be a positive number
import math
def main():
print("this program finds real solutions to quadratic equations")
a = float(input("enter a coefficient a:"))
b = float(input("enter coefficient b:"))
c = float(input("enter coefficient c:"))
#run only if code is great... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.