blob_id large_string | language large_string | repo_name large_string | path large_string | src_encoding large_string | length_bytes int64 | score float64 | int_score int64 | detected_licenses large list | license_type large_string | text string | download_success bool |
|---|---|---|---|---|---|---|---|---|---|---|---|
9f5c5866cb78e578275b2e68bb0d33fc07f8ec63 | Python | amandeep1991/data_science | /learnings/notes/PythonGyanLessons/daily_classes/20181020_mine.py | UTF-8 | 1,346 | 3.609375 | 4 | [] | no_license |
# import sys
# ll = sys.argv # returns a list whose first element(0-indexed element) is actually a file name (which we ran) (with absolute path) and from 2nd element onwards it gives command-line arguments
#
# print(ll[0])
# print(ll[1])
# print(ll[2])
# print(ll[3])
# 4
# n = 5
# space = " "
# star = "*"
#
# for ... | true |
a86fe2066f5e24590ded5209b30ac8aec8e1a6aa | Python | suddencode/pythontutor_2018 | /9.3.py | UTF-8 | 360 | 2.921875 | 3 | [] | no_license | my_list = list(input().split())
n, m = int(my_list[0]), int(my_list[1])
a = [['.'] * m for i in range(n)]
for i in range(n):
for j in range(m):
if (i % 2) == 0 and (j % 2) == 1:
a[i][j] = '*'
elif (i % 2) == 1 and (j % 2) == 0:
a[i][j] = '*'
for row in a:
print(... | true |
aae40b63332d7b9f0a6a81cb821aed2918d454ae | Python | Nitro-Pan/ledCubeMatrixVisualizer | /tkinterLEDTest.py | UTF-8 | 1,466 | 3.25 | 3 | [] | no_license | from gpiozero import LED
import tkinter as tk
led = [None, None, LED(2), LED(3), LED(4), LED(5), LED(6), LED(7), LED(8), LED(9), LED(10), LED(11), LED(12), LED(13), LED(14), LED(15), LED(16), LED(17), LED(18), LED(19), LED(20), LED(21), LED(22), LED(23), LED(24), LED(25), LED(26)]
currLed = 21
def openWindow():
r... | true |
553927d38d375f7ddbfaf1452e36c4a21743e29e | Python | RaduGatej/crowd-driving-cph | /utils/time_utilities.py | UTF-8 | 260 | 2.734375 | 3 | [] | no_license | from datetime import datetime
import time
def get_time_difference(start_time):
dt = datetime.now()
sec_since_epoch = time.mktime(dt.timetuple()) + dt.microsecond/1000000.0
millis_since_epoch = sec_since_epoch * 1000
return millis_since_epoch - start_time
| true |
ef6c29f0d69e77399a9b09327aac0fb44dbbdd2d | Python | ErikMoxley/EricK | /FirstProject.py | UTF-8 | 279 | 3.6875 | 4 | [] | no_license | print("Hello World")
print(" /|")
print(" / |")
print(" / |")
print("/___|")
character_name = "John"
character_age = "27"
print("My Name is " + character_name + "")
print("He is " + character_age + " years old")
phrase = "Eric is cool"
print(phrase[0])
print(phrase[1])
| true |
7551865797aa1a87a0b170ec8629c883d3a57ceb | Python | migrate2iaas/cloudscraper-engine | /Migrate/SelfTest/AzureServiceBusResponder.py | UTF-8 | 2,358 | 2.578125 | 3 | [] | no_license | """
AzureServiceBusResponder
~~~~~~~~~~~~~~~~~
This module provides AzureServiceBusResponder class
"""
# --------------------------------------------------------
__author__ = "Vladimir Fedorov"
__copyright__ = "Copyright (C) 2013 Migrate2Iaas"
#---------------------------------------------------------
import logging... | true |
aa25618316da48c9610a3003925d40a16237799d | Python | cartermeyers/jlt-access-analyzer-test | /MacieStatusChecker.py | UTF-8 | 3,748 | 2.984375 | 3 | [] | no_license | '''
Project: Sensitive Data Analyzer (SDA)
Function name: sda-macie-check-status
Description: Check the status of a Macie classification job based on the given job id
Version:
1.0 - Initial version
2.0 - Added functionality to check is there is any finding.
- Process custom input event
- Returns string "In Prog... | true |
cafa6b1cf852fea956e156535f47d3cf5299de38 | Python | bizatheo/training-material | /Python/Ising/util.py | UTF-8 | 287 | 3.046875 | 3 | [
"CC0-1.0"
] | permissive | #!/usr/bin/env python
options_fmt = '{prefix:s}{key:s} = {value:s}\n'
def print_options(file, options, prefix='# '):
for key, value in options.__dict__.items():
file.write(options_fmt.format(prefix=prefix, key=key,
value=str(value)))
| true |
dcf0847a4992ac6d2182aa24064057ecb1a513f0 | Python | lianhuo-yiyu/python-study | /study9 str/str 左右居中对齐.py | UTF-8 | 517 | 4.09375 | 4 | [] | no_license | # Python 学习 1
# 2020/11/26 15:04
#center(x,y)居中对齐,第一个参数指定宽度,第二个参数指定填充字符(默认为空格)
s = 'hello, python,maybe I can USE YOU'
print(s)
#s = s.center(200)
print(s)
s = s.center(50,'*')
print(s)
#ljust()左对齐,第一个宽度,第二个填充字符 左对齐填充在右边,一直填够指定的宽度
s = s.ljust(100,'1')
print(s)
#rjust右对齐 一样 每一次对齐加入的填充字符变成了str的内容
s = s.rjust(200,'0')
... | true |
58ea22d4d66cb8de21b83707409373d17cc0bf57 | Python | Pisceszaiby/first_semester | /LAB 7 i.py | UTF-8 | 245 | 3.578125 | 4 | [] | no_license |
def print_message(x):
print(x,"is present")
def show_presence(x):
for x in list_of_students:
print_message(x)
list_of_students=['Ali','Aqsa','Umair','Abdullah','Urwah','Maymunah']
show_presence(list_of_students)
| true |
09cb86ac685b935ef1fff6dfeac476147522a119 | Python | MartinaMia/Homework_9.2_9.3 | /Homework_9.2_9.3/9.3_Make string lowercase.py | UTF-8 | 363 | 4.34375 | 4 | [] | no_license | # Where would this come handy?
# For example if you ask user "Would you like to continue (yes/no)?",
# the user might respond: "yes", "Yes", "YES" or even "YeS".
# In this case, changing your user's response into lowercase letters
# would be very helpful in your if-else statement.
answer = input("Would you like to con... | true |
4b84059eca52ca7b637be701adbad1e121756a20 | Python | jeonghanlee/Work | /siteApps/fastProtect-1-0/opi/fps_overview_gen.py | UTF-8 | 4,532 | 2.734375 | 3 | [] | no_license | #!/usr/bin/env python
# Date: 2016-12-12
# Author: Wayne Lewis
# Description:
# This file generates the RAON FPS overview display from a set of input files.
# No arguments are required.
import sys
# System definition constants
links = 8
outputs = 16
nodes_per_link = 5
# Geometry constants
x_start = 18
x_spacing_out... | true |
112dc34f26091bdcd2ec3fd53c7c66c2a015c25d | Python | Leejunhee17/CS443 | /CS443-BLENDSv2/blends/node/blockchain/dbmanager.py | UTF-8 | 3,580 | 2.78125 | 3 | [] | no_license | import collections
from typing import Dict, List, Optional
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from ... import GENESIS_HASH, REWARD
from ..model import Block, Transaction
class DBManager:
def __init__(self, connection_string: str):
self.engine = create_engine(con... | true |
75dd648f9899a6cce7cfb77a054abbd9b2962f0b | Python | dushyantkhosla/viz4ds | /99-Miscel/AnatomyOfMatplotlib-master/examples/scatter_example.py | UTF-8 | 800 | 3.25 | 3 | [
"CC-BY-3.0",
"MIT"
] | permissive | """
Illustrates the basics of using "scatter".
"""
import numpy as np
import matplotlib.pyplot as plt
import example_utils
# Generate some random data...
np.random.seed(1874)
x, y, z = np.random.normal(0, 1, (3, 100))
t = np.arctan2(y, x)
size = 50 * np.cos(2 * t)**2 + 10
fig, axes = example_utils.setup_axes()
axes... | true |
763451c2c21ec3b93852ab29fa40071b3fa82cff | Python | marianpg12/pcep-tests | /block2_datatypes_evals_basic_io/test4.py | UTF-8 | 354 | 4.125 | 4 | [] | no_license | # What would be the output of the following code snippet:
programming_language = "Python 3"
print (programming_language[-1])
# Answer: 3
# Explanation: The strings are represented as arrays and we can access
# the elements using their index position. The -1 is the first index from
# the other end of the array (or the l... | true |
0af88e568ca9c342082d6965a2af6b93dd96ea66 | Python | AndreyPankov89/python-glo | /lesson10/task2.py | UTF-8 | 205 | 3.59375 | 4 | [] | no_license | chr_0 = ord('0')
chr_9 = ord('9')
character = ord(input('Введите символ: '))
if (character >= chr_0 and character <= chr_9): #character.isdigit()
print('YES')
else:
print('NO')
| true |
fb52fb05d3eee137005c881661b2f32768a46d1e | Python | BakedRibs/CoverageAndConnection | /painterWidget.py | UTF-8 | 6,495 | 2.96875 | 3 | [] | no_license | import random
from PyQt5.QtWidgets import QWidget
from PyQt5.QtGui import QPalette, QColor, QPainter, QBrush
from PyQt5.QtCore import Qt
class painterWidget(QWidget):
def __init__(self):
super().__init__()
self.Init_UI()
def Init_UI(self):
self.setFixedSize(1600, 700) ... | true |
309adbe7b616bef22b0d5000791af673c4dc7d2f | Python | amitkumarbanga/Training2021 | /Session8B.py | UTF-8 | 515 | 3.828125 | 4 | [] | no_license | data = [1, 2, 3, 4, 5, 6]
squared_data = []
for i in range(len(data)):
squared_data.append(data[i]*data[i])
# List Comprehension's
print("data:", data)
print("squared_data:", squared_data)
squared_data1 = [x**2 for x in data]
cube_data = [x*x*x for x in data]
print("squared_data:", squared_data1)
print("cube_da... | true |
0659ded120ce775b8942aca1ac535c6c053715c8 | Python | TylersDurden/0xC0D3 | /0x219/utility.py | UTF-8 | 588 | 2.953125 | 3 | [] | no_license | import os
def swap(fname, destroy):
data = []
for line in open(fname, 'r').readlines():
data.append(line.replace('\n', ''))
if destroy:
os.remove(fname)
return data
def write(fname, data):
f = open(fname, 'w')
for buff in data:
f.write(buff)
def execute(command, des... | true |
cb032fdfa373ff270428e8d69f226aadb8ca8ce5 | Python | izaankml/cs2110 | /Lab15/test.py | UTF-8 | 53 | 3.15625 | 3 | [] | no_license | sum = 0
for i in range(70):
sum += i
print sum | true |
9601a5fd061a6bc0ccc43bba043d88d8ed102e4c | Python | RutgerMoons/Rosalind | /1-25/Problem_010.py | UTF-8 | 870 | 3.25 | 3 | [] | no_license | __author__ = 'rutger'
dict = {
"A": 0,
"C": 1,
"G": 2,
"T": 3
}
dict2 = {
0: "A",
1: "C",
2: "G",
3: "T"
}
f = open("file_010.txt").readlines()
sequence = ""
seq = []
for line in f:
if line[0] == ">":
seq.append(sequence)
sequence = ""
else:
sequence +... | true |
43877a98b1e682d177e789d3771d0645412951eb | Python | Marisa-Bezemer/ta_masterclass | /earnings_with_vacation_money.py | UTF-8 | 342 | 3.53125 | 4 | [] | no_license | def calculate_yearly_income_with_vacation_money(yearly_income):
"""This function takes a yearly income as input and returns
yearly income plus vacation interest"""
if yearly_income >= 0:
interest = yearly_income * 0.08
return interest + yearly_income
else:
return "Yearly income... | true |
759aad4a543f868a41e8168af15bac5c13160c50 | Python | Slangoij/PlayData_Algorithm_Study | /알고리즘 스터디 1차/07.가운데 글자 가져오기.py | UTF-8 | 151 | 2.859375 | 3 | [] | no_license | def solution(s):
leng=len(s)
if leng%2:
answer=s[int(leng/2)]
else:
answer=s[int(leng/2)-1:int(leng/2)+1]
return answer | true |
f736bd27fe3581f7403fbcd49c23fa30460a89c2 | Python | Ran-n/kneighbors | /cancer-accuracy.py | UTF-8 | 1,031 | 2.859375 | 3 | [] | no_license | #! /usr/bin/python
#+ Autor: Ran#
#+ Creado: 29/08/2020 14:23:33
#+ Editado: 29/08/2020 14:23:33
from sklearn.datasets import load_breast_cancer
from sklearn.neighbors import KNeighborsClassifier as knc
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
cancer = load_breast_cancer()
... | true |
f1001e68a003372c81ede5c8131e1657dadfd604 | Python | Deepanshus98/D_S_A | /dpcoinchange.py | UTF-8 | 559 | 2.96875 | 3 | [] | no_license | class Solution(object):
def coinChange(self, coins, amount):
new_coins = sorted(coins)
dp = [amount for _ in range(amount+1)]
dp[0] = 0
#dp[11]=5 means 5 coins will get 11
for each_amo in range(1,amount+1):
for coin in new_coins:
... | true |
d2f602ee38863170d60ea7f9210c4e34b3420dd0 | Python | chancebeyer1/CSC110 | /Assignment_7-5.py | UTF-8 | 142 | 3.5625 | 4 | [] | no_license | L = [1, 2, 3, 4, 5, 8, 7, 99]
max = L[0]
for pos in range(len(L)):
if L[pos] > max:
max = L[pos]
print("The max is", max) | true |
aac10ede53181bf4b24a18af3eb9e1642962029a | Python | yiiwood/thunder | /python/thunder/summary/ref.py | UTF-8 | 1,081 | 2.703125 | 3 | [] | no_license | # ref <master> <dataFile> <outputDir> <mode>
#
# compute summary statistics
#
# example:
# pyspark ref.py local data/fish.txt results mean
#
import sys
import os
from numpy import *
from thunder.util.dataio import *
from pyspark import SparkContext
argsIn = sys.argv[1:]
if len(argsIn) < 4:
print >> sys.stderr, \
... | true |
2b57db0864a91dfd4cddba44e4f39c2ac5f3dedc | Python | Moulick/HackerRank | /Python/Introduction/Say Hello, World With Python.py | UTF-8 | 60 | 2.515625 | 3 | [] | no_license | # Write your code on the next line.
print ('Hello, World!')
| true |
5ef7100ee5a89980fcf00f21417c77a58260b811 | Python | h3abionet/h3agwas | /qc/templates/showhwe.py | UTF-8 | 6,075 | 3.109375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
import pandas as pd
import numpy as np
import sys
from matplotlib import use
use('Agg')
import matplotlib.pyplot as plt
import matplotlib
EOL=chr(10)
if len(sys.argv)<=1:
sys.argv="showmaf.py $hwe $base".split()
template = """
*-paragraph*{Hardy Weinberg Statistics}:
Figure~*-ref{fig... | true |
3ed370564618a2abf3b477fe4eb5aadc33331670 | Python | Shibaken2017/Practice2 | /security_practice/sql_injection/sqlite_script.py | UTF-8 | 832 | 2.84375 | 3 | [] | no_license | import sqlite3
import os
conn=sqlite3.connect("practice.db")
curs=conn.cursor()
print(curs.execute("select name from sqlite_master where type='table'"))
print(curs.fetchall())
#curs.execute("Create TABLE zoo (name VARCHAR(20)PRIMARY KEY,pass VARCHAR(20))")
#curs.execute('''INSERT INTO zoo VALUES("shibata","datasecti... | true |
0f4265f5f952429d2337d536f40fa6911afda704 | Python | xirdneh/imagify | /license/models/website.py | UTF-8 | 1,091 | 3.171875 | 3 | [] | no_license | """
.. module: license.models.subscription
:synopsis: Subscription model..
"""
from __future__ import unicode_literals
from future.utils import python_2_unicode_compatible
import logging
LOG = logging.getLogger(__name__)
@python_2_unicode_compatible
class Website(object):
"""Website model."""
def __ini... | true |
87dea3903a62507f8cfa41b0c5797d86160d4877 | Python | ctwplyp/PythonFun | /alien_invasion.py | UTF-8 | 566 | 2.75 | 3 | [] | no_license | import sys
import pygame
from settings import Settings
from ship import Ship
import game_functions as gf
def run_game():
# Start game create screen
pygame.init()
ai_settings = Settings()
screen = pygame.display.set_mode((ai_settings.screen_width, ai_settings.screen_height))
pygame.display.set_caption("Sean's Ali... | true |
35617d1dfec1510e697e1311b47cde52560a401b | Python | christopher-henderson/Experiments | /brainTeasers/sequenceOfIntegers/unitTests.py | UTF-8 | 2,204 | 3.328125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
from __future__ import print_function
from functools import wraps
from random import shuffle
from sequence import *
assertion = 0
exception = 0
passed = 0
def Test(function):
@wraps(function)
def wrapper(*args, **kwargs):
global assertion
global exception
global p... | true |
43107e2c2a4b5ee8f6f2a7e2be59fe528cdc799a | Python | ubuntu9786/python | /Mini_Builds/nums.py | UTF-8 | 215 | 3.328125 | 3 | [] | no_license | from math import *
print(14)
print(" \n ")
print(4+6)
print(10 % 3)
num1 = 4
num2 = -5
print(10 + num1)
print(str(num1+1) + "yup")
print(abs(num2))
print (pow(2,4))
print (max(num1,num2))
print(floor(15.6))
| true |
20d56bb9db35037a6c24c9f0982a08fccb5e94c0 | Python | lostleaf/crypto_monitor | /scripts/utils.py | UTF-8 | 555 | 2.75 | 3 | [] | no_license | import time
import pandas as pd
def retry_getter(func, retry_seconds, retry_times=3):
for _ in range(retry_times):
try:
return func()
except Exception as e:
print(e)
time.sleep(retry_seconds)
return None
def df_table(df):
return {"columns": [{'text': ... | true |
f67b90c7de72c9c84253ad0aeaaabc2d23c1305d | Python | aatwum/flood-warning-system | /test_higheststations.py | UTF-8 | 1,284 | 2.71875 | 3 | [
"MIT"
] | permissive | from floodsystem.station import MonitoringStation
from floodsystem.flood import stations_highest_rel_level
s_id = "test-s-id"
m_id = "test-m-id"
label = "some station"
coord = (1, 5)
trange = (-2.3, 3.4445)
river = "River X"
town = "My Town"
s1 = MonitoringStation(s_id, m_id, label, coord, trange, river, town)
s1.late... | true |
a8fcc773e9c56894e29980a158b3c9488207a17c | Python | Myshj/tdoa_multisensor_model | /actors/world_related/signal_related/sound_related/sensors/SoundSensor.py | UTF-8 | 5,535 | 2.71875 | 3 | [] | no_license | import random
from datetime import datetime
import gevent
from actor_system import Broadcaster
from actor_system.broadcasters.messages import Broadcast
from actors.world_related.signal_related.sound_related.sensors import messages
from actors.world_related.signal_related.sound_related.sensors.Base import Base
from ac... | true |
0dadeaacb8eee165bd3a09126e24983290e0eef1 | Python | paynelsam/AIND-Recognizer | /my_model_selectors.py | UTF-8 | 9,633 | 2.65625 | 3 | [] | no_license | import math
import statistics
import warnings
import numpy as np
from hmmlearn.hmm import GaussianHMM
from sklearn.model_selection import KFold
from asl_utils import combine_sequences
ERROR_LOGGING = False
class ModelSelector(object):
'''
base class for model selection (strategy design pattern)
'''
... | true |
50959b1ca454d91ce0493365278bd7c2111277b2 | Python | Aasthaengg/IBMdataset | /Python_codes/p02603/s383355865.py | UTF-8 | 353 | 3.078125 | 3 | [] | no_license | N=int(input())
A = list(map(int, input().split()))
money=1000
stock=0
if A[0]<A[1]:
stock=int(money/A[0])
money=money-A[0]*stock
for i in range(1,N-1):
if A[i-1]<A[i]:
money=money+A[i]*stock
stock=0
if A[i]<A[i+1]:
stock=int(money/A[i])
money=money-A[i]*stock
money=money+... | true |
df0ea170af5fe54b74ae6fc6a01ea1195ffa2e45 | Python | kaurav/image-processing | /cv_api/blob.py | UTF-8 | 606 | 2.828125 | 3 | [] | no_license | import cv2
import numpy as np
import matplotlib.pyplot as plt
m = cv2.imread('images/foto.jpg',0)
ret,thresh1 = cv2.threshold(m,127,255,cv2.THRESH_BINARY)
ret,thresh3 = cv2.threshold(m,127,255,cv2.THRESH_TRUNC)
ret,thresh4 = cv2.threshold(m,127,255,cv2.THRESH_TOZERO)
ret,thresh5 = cv2.threshold(m,127,255,cv2.THRESH_TOZ... | true |
80a7fd24e33f140531658c17d3bc04d4a0ab8d27 | Python | ConyYang/Music_Audio_Processing | /TheSoundOfAI/DemystifyFourierTransform.py | UTF-8 | 1,329 | 3.0625 | 3 | [] | no_license | import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
# load audio file
audio_path = "audio/piano_c.wav"
signal, sr = librosa.load(audio_path)
# Derive spectrum using FT
ft = sp.fft.fft(signal)
magnitude = np.absolute(ft)
frequency = np.linspace(0, sr, len(magnitu... | true |
d4a1c9029d522fe761d4f98971cf5383b6f32f10 | Python | pramodh-bn/learn-data-edx | /Week 5/assignment5.2.py | UTF-8 | 1,432 | 2.828125 | 3 | [
"Unlicense"
] | permissive | import numpy as np
import matplotlib.pyplot as plt
from numpy.lib import scimath
if __name__ == "__main__":
'''k = np.arange(-5,5, 0.001)
xneg = np.arange(-5,-1, 0.01)
xpos = np.arange(1,5, 0.01)
x = xneg + xpos
print x
plt.plot(x, scimath.sqrt((x-1) * (x + 1)),'r')
plt.plot(x, -scimath.sqr... | true |
31e4efbba4c35f8f3b61c927e07e34b73339d89b | Python | QinganZhao/LXXtCode | /LeetCode/728. Self Dividing Numbers.py | UTF-8 | 407 | 3.078125 | 3 | [
"MIT"
] | permissive | class Solution:
def selfDividingNumbers(self, left: int, right: int) -> List[int]:
res = []
for num in range(left, right+1):
if self.check(num):
res.append(num)
return res
def check(self, num):
numList = map(int, list(str(num)))
for n ... | true |
ef686211a1d87af010dd72709f7d273acb1696d7 | Python | mille449/pygr-draw | /pygr_draw/draw.py | UTF-8 | 8,888 | 2.859375 | 3 | [] | no_license | """
Actual drawing API to produce images.
"""
from PythonList import PythonList
from nlmsa import create_annotation_map
from annotation import convert_to_image_coords
from xyplot import SpanMap
def get_picture_class(suffix='png'):
suffix = suffix.lower()
if suffix == 'pdf':
from PDFSeque... | true |
c6cad10913ec153bc221f569b907c4b4a2dbcab1 | Python | PreetiLo/loop | /Sum of n numbers.py | UTF-8 | 212 | 3.4375 | 3 | [] | no_license | # i=1
# n=10
# total=0
# while i<=n:
# inp=int(input("Enter any number : "))
# total+=inp
# i+=1
# print(total)
# reversed
# i=10
# while i>=1:
# print(i)
# i-=1
# print("reversed")
| true |
ce46cb612fa9a05ac49911aff4b48e23287eeb1b | Python | natemago/adventofcode-solutions | /day-21/day21p1.py | UTF-8 | 2,320 | 3.4375 | 3 | [] | no_license | #!/usr/bin/python3
import math
def combinations(choice, elements, base):
if choice == 1:
for e in elements:
yield base +[e]
else:
for i in range(0, len(elements) - choice + 1):
yield from combinations(choice - 1, elements[i+1:], base + [elements[i]])
def play(player1, player2):
p1_points, ... | true |
9dacf8cbbd936d5a5cee511f91817b204aa0a5ae | Python | mahmoudimus/Typthon | /typthonOptimizer.py | UTF-8 | 5,549 | 2.609375 | 3 | [] | no_license | import typthonAST as ast
class Optimizer(object):
def __init__(self, root: ast.Node):
"""
IR_lst: list of IR code
register_count: integer to keep track of which register to use
label_count: similar to register_count, but with labels
"""
self.root = root
sel... | true |
4cc372a648bffe78ac4ad8407c334d0fd587edf3 | Python | helloddkd/advance_algorithm | /0328/시험감독_13458/baikjiwon.py | UTF-8 | 370 | 2.828125 | 3 | [] | no_license | import sys
sys.stdin = open('B13458.txt', 'r')
N = int(input())
arr = list(map(int, input().split()))
B,C = map(int, input().split())
re = N
for j in range(len(arr)):
arr[j] -= B
if arr[j] > 0:
t = arr[j]//C
re += t
r = arr[j]%C
if r:
re += 1
print(re)
#꼭 기억하기!!! 음... | true |
3baaa3d1498aa8aef0a9a86b81451e5268df1f74 | Python | wikizero/MyScripts | /forDatabase/forMySQL.py | UTF-8 | 1,509 | 2.578125 | 3 | [] | no_license | # coding:utf-8
import pandas as pd
from sqlalchemy import create_engine
import sys
import getopt
def input_handle():
output, connection, out_type, db_engine, sql = '', '', 'json', 'mysql', ''
try:
opts, args = getopt.getopt(sys.argv[1:], 'hi:o:c:t:e:s:')
except getopt.GetoptError, e:
print 'forMySQL.py -c <use... | true |
8bdad342504abf93b8b2daea184e71567615d564 | Python | anurag2050doit/DSA | /Data Structures/Link List/Loop detection.py | UTF-8 | 2,153 | 4.59375 | 5 | [] | no_license | """
Given a linked list, check if the the linked list has loop or not
"""
# Method 1: Hashing
class Node:
# Constructor to initialize
# the node object
def __init__(self, data):
self.data = data
self.next = None
class LinkList:
# Function to initialize head
def __init__(sel... | true |
66d51e87c8a973a4103bb73a2a39fcf5a73ff8a5 | Python | alexvassel/sli | /helpers.py | UTF-8 | 769 | 2.53125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import sqlite3
import tornado.web
# Имя таблицы с адресами
SQLITE_URLS_TABLE = 'url'
class BaseHandler(tornado.web.RequestHandler):
"""
Проверка авторизации
"""
def get_current_user(self):
return self.get_secure_cookie('user')
# Для более сложной БД стоит использоват... | true |
c2e0449517e7131d6c880bff76bffdec38f957ce | Python | darenas/myPyTools | /myPyTools/img/buildJsonForVeDee.py | UTF-8 | 3,325 | 2.796875 | 3 | [
"MIT"
] | permissive | '''
Created on 2 May 2018
@author: darenas
'''
import sys
from os import listdir
from os.path import join, isdir
from lxml import html
import requests
import json
# Parsing params
if len(sys.argv) != 3:
print("Two arguments are required: origin path (local or remote http) and destination file path (local)")
e... | true |
c00f13639ae65c1921e45540e82dc084486257c1 | Python | CosmosHua/Mesh | /Blur-MX=/motion_blur.py | UTF-8 | 4,470 | 2.609375 | 3 | [] | no_license | # coding:utf-8
# !/usr/bin/python3
# Ref: https://github.com/KupynOrest/DeblurGAN/tree/master/motion_blur
import os, cv2
import numpy as np
import matplotlib as mpl; mpl.use('Agg')
import matplotlib.pyplot as plt
from scipy import signal
from motion_blur_PSF import PSF
from motion_blur_Trajectory import ... | true |
38a5159b02a7e43461ff0798709574531f8598f1 | Python | vsself/Test | /python_camp/lesson1/exec_2.py | UTF-8 | 320 | 3.1875 | 3 | [] | no_license | """
sort the number list from min to max
"""
def number_sort(numbers):
len1 = len(numbers)
for i in range(len1):
for j in range(len1-i):
if j+1 < len1:
if numbers[j] > numbers[j+1]:
(numbers[j], numbers[j+1])=(numbers[j+1], numbers[j])
return numbers | true |
fd4dac4e42b684ba01331409531a7ad023edb702 | Python | matyaskollert/AdventOfCode2020 | /2020/4/part2.py | UTF-8 | 2,051 | 2.859375 | 3 | [] | no_license | import re
with open("vstup.txt", "r") as f:
listA = [x for x in f.read().split("\n\n")]
valid = 0
listB = []
letters = ['a', 'b', 'c', 'd', 'e', 'f']
eyes = ["amb", "blu", "brn", "gry", "grn", "hzl", "oth"]
for person in listA:
tempValid = 0
if person.count(":") == 8 or (person.count(":") == 7 and person.fi... | true |
c6f8148e657c746443f0aecdf8a38c220ee4d294 | Python | stfnwong/lernomatic | /cnn_vis_test.py | UTF-8 | 2,614 | 2.859375 | 3 | [
"MIT"
] | permissive | # Try producing an image that minimizes the loss of a convolution
# operation for a given layer and filter of a CNN
import torch
from torch import nn
from torch.optim import Adam
import numpy as np
import matplotlib.pyplot as plt
from torchvision import models, utils
from PIL import Image
from lernomatic.util.image_... | true |
30c292768313f46a38d7521dc6d2835e71bcf216 | Python | atlassian-api/atlassian-python-api | /atlassian/bitbucket/server/projects/repos/__init__.py | UTF-8 | 10,783 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | # coding=utf-8
from requests import HTTPError
from ...base import BitbucketServerBase
from ...common.permissions import Groups, Users
class Repositories(BitbucketServerBase):
def __init__(self, url, *args, **kwargs):
super(Repositories, self).__init__(url, *args, **kwargs)
def __get_object(self, dat... | true |
1fd5aff61676a771171f3158c995e7d9c9b164cb | Python | naravitchan/spark-ws | /src/03-min-temp.py | UTF-8 | 648 | 2.796875 | 3 | [] | no_license | from pyspark import SparkConf, SparkContext
conf = SparkConf().setMaster("local").setAppName("MinTemperatures")
sc = SparkContext(conf=conf)
def parseLine(line):
## split & parse logic temp F -> C
#map value
##
return (stationID, entryType, temperature)
### station_id, , type, fahrenheit, ...
lin... | true |
4a95ab2ea253ad96a38b70506e484a384d03b22e | Python | Rocha117/Laboratorio-01 | /wiki.py | UTF-8 | 425 | 2.859375 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
import textoavoz
import wikipedia
wikipedia.set_lang("es")
def buscador(pregunta):
respuesta = wikipedia.summary(pregunta, sentences=5)
reslist = list(respuesta)
k = "["
while (k in reslist):
i = reslist.index(k)
reslist.remove(k)
reslist.remove(reslist... | true |
4d5d0ee11b8cc163566712626472287c63516211 | Python | Jianyang-Hu/numpypractice | /threading_event_0408.py | UTF-8 | 1,100 | 3.59375 | 4 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
# @version : Python3.6
# @Time : 2017/4/8 16:07
# @Author : Jianyang-Hu
# @contact : jianyang1993@163.com
# @File : threading_event_0408.py
# @Software: PyCharm
"""
Event是线程间通信最间的机制之一:一个线程发送一个event信号,
其他的线程则等待这个信号。
用于主线程控制其他线程的执行。
Events 管理一个flag,这个flag可以使用set()设置成True
或者使用clear()重置为Fal... | true |
083b0be0266b22a67445d44ee4f7a2c6dd30b096 | Python | sethGu/leetcode | /leetcode/118_杨辉三角.py | UTF-8 | 1,208 | 3.25 | 3 | [] | no_license | # 蠢逼想法,递归里面有循环,只为计算具体值,而每次求结果还要一个一个求
class Solution:
def generate(self, numRows: int) -> List[List[int]]:
res=[]
for i in range(numRows): res.append([])
def helper(lvl,k):
if lvl==1:
return 1
else:
tmp=0
i=0
... | true |
5b8ee150f19426c9d7b8341da195f6f91b84494f | Python | galinakaleeva/pithontutor | /11_gen_tree_ancestors_and_descendants.py | UTF-8 | 995 | 3.34375 | 3 | [] | no_license | n = int(input())
gen_tree = dict()
for i in range(n - 1):
line = input().split()
son, parent = line[0], line[1]
gen_tree[son] = parent
height = dict()
for person in set(gen_tree.keys()).union(set(gen_tree.values())):
height[person] = 0
son = person
while son in gen_tree.keys():
son = gen... | true |
56381043d0765bbd7ff0b6dcdd64c84c50893982 | Python | Tiagoksio/estudandoPython | /exercicios010/tabelaBrasileirao.py | UTF-8 | 1,541 | 4.0625 | 4 | [] | no_license | # Crie uma tupla preenchida com os 20 primeiros colocados da tabela do campeonato brasileiro de futebol, na ordem de colocação. Depois mostre:
# 1. Apenas os 5 primeiros colocados;
# 2. Os últimos 4 colocados da tabela;
# 3. Uma lista com os times em ordem alfabética;
# 4. Em que posição na tabela está... | true |
59e3fec6cdc155a37065736359546d22e9dc33a8 | Python | Renc17/Project_Automation | /create.py | UTF-8 | 1,331 | 2.578125 | 3 | [] | no_license | from pathlib import Path
import sys
import os
import requests
import json
from dotenv import load_dotenv
def init_project(params):
# CREATE DIR
if not os.path.exists(path):
os.makedirs(path, exist_ok=True)
else:
print("Project already exists")
exit()
# CREATE README
readme... | true |
009462645dcef041529bfe1fa5a7015abdc2a02a | Python | caywood/tph | /stem_leaf.py | UTF-8 | 3,838 | 2.765625 | 3 | [
"MIT"
] | permissive | from math import floor
from plot_spacing import pad
left_reversed = 0
day_start = 3 # 0 for midnight; 3 = 3 AM start
trim_schedule = 1 #
time_12_hours = 1 # or 24
def hour_to_12_or_24(h):
# convert hour number h to hour string e.g. ' 8 PM'
if time_12_hours:
hmod = h % 12
if hmod == 0: hmod = 12
hstr = pad(hm... | true |
f5710ccb436967c35afa254367792c384f44d1b8 | Python | darraes/coding_questions | /v2/_leet_code_/0001_easy_two_sum.py | UTF-8 | 606 | 3.390625 | 3 | [] | no_license | class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
complements = {}
for idx, num in enumerate(nums):
complement = target - num
if complement in complements:
... | true |
4350bc3b8f6b249df9b28801babc0114d223fbb2 | Python | Aasthaengg/IBMdataset | /Python_codes/p02536/s629659919.py | UTF-8 | 942 | 3.140625 | 3 | [] | no_license | class UnionFind:
def __init__(self, n):
self.n = [-1]*n
self.r = [0]*n
self.co = n
def find_root(self, x):
if self.n[x] < 0:
return x
else:
self.n[x] = self.find_root(self.n[x])
return self.n[x]
def unite(self, x, y):
x = self.find_root(x)
y = self.find_root(y)
... | true |
09457e08fee85acb351bd5ec168964b51844ac44 | Python | emersonivo/MyCodes | /Learning/for_statement.py | UTF-8 | 1,407 | 3.828125 | 4 | [] | no_license | ...
# lista=['Um','Dois', 'Tres', 'Quatro']
# for i in lista:
# print(i)
# print(len(i))
#
# print("-" * 10)
# a = ['Mary', 'had', 'a', 'little', 'lamb']
# for i in range(len(a)):
# print(i, a[i])
# print("-" * 10)
# for i in range(1,10):
# print(i)
# print("-" * 10)
# n = 8 % 4
# print("n " + str(n))
#... | true |
b3574773e30d9f55ce54f420fdcd6750fc5a60d2 | Python | BaBaPreorder/ctf-training-session-2021 | /services/nasarasa/checker/checklib/http.py | UTF-8 | 2,692 | 2.6875 | 3 | [] | no_license | import checklib
import checklib.utils
import checklib.random
import logging
import requests
def build_main_url(fn):
def wrapper(self, address, *args, **kwargs):
self.main_url = 'http://%s' % address
return fn(self, address, *args, **kwargs)
wrapper.__name__ = fn.__name__
wrapper.__doc__ = ... | true |
1765fb7fe83c232772dd1533e45e4c75a8757902 | Python | kevinshenyang07/Data-Structures-and-Algorithms | /algorithms/string/zigzag_conversion.py | UTF-8 | 798 | 3.28125 | 3 | [
"MIT"
] | permissive | # ZigZag Conversion
class Solution(object):
def convert(self, s, n):
"""
:type s: str
:type n: int
:rtype: str
"""
if n < 2:
return s
rows = [[] for _ in range(n)]
m = 2 * n - 2 # length of cycles = n + (n - 2)
for i, char in enu... | true |
1315454eca8930c08e049b8499074727280e0ec7 | Python | piccolo-orm/piccolo_docker | /dockerdb/commands/create.py | UTF-8 | 780 | 2.65625 | 3 | [
"MIT"
] | permissive | import asyncio
from typing import Tuple
from docker.models.containers import Container
from dockerdb.repository import PiccoloDockerRepository
def create(auto_remove: bool = False) -> Tuple[str, str]:
"""
Creates a database inside a docker container
:return: container name, database name
:rtype: Tup... | true |
1319100935746e8e186180db011d3d7ab2c30289 | Python | aosid/prog | /euler/project euler 50.py | UTF-8 | 1,017 | 3.796875 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 21 15:50:07 2018
@author: vcian
"""
"""The prime 41, can be written as the sum of six consecutive primes:
41 = 2 + 3 + 5 + 7 + 11 + 13
This is the longest sum of consecutive primes that adds to a prime below one-hundred.
The longest sum of consecutive primes below one-... | true |
254f6799bc9617dcb8f7483cd429e32e361aaa1e | Python | karenstritz/shaderSetup | /shaderSetupGui.py | UTF-8 | 4,049 | 2.5625 | 3 | [] | no_license | # ------------------------------------------------------------------------------
# Shader Setup by Karen Stritzinger
# June 2014
# A tool for MARI 2.0 and above to set up diffuse, bump, and specular channels
# and connect them to appropriate inputs in a specified type of shader. Bump
# and spec channels are created w... | true |
30a7048189c2aa76b8ab25b044d944cb82ce183d | Python | wnox1102/SambilProjectF2 | /sandbox/reference.py | UTF-8 | 135 | 3.140625 | 3 | [] | no_license |
def main():
lista1 = [1,2,3]
lista2 = [lista1]
lista2.append(4)
print(lista1)
if __name__ == "__main__":
main() | true |
41a3953b3afd7f708a8a7875c3b0ad8a3ad17c6a | Python | WolfgangHall/python_studies | /pycc4_organizing_lists.py | UTF-8 | 600 | 4.1875 | 4 | [] | no_license | cars = ['bmw', 'audi', 'toyota', 'subaru']
#permanently changes the order of the list
cars.sort()
print(cars)
#reverses order alphabetically
cars.sort(reverse=True)
print(cars)
#sorted function lets you display list in a certain order but doesn't permanently affect it
brands = ['jordan', 'nike', 'adidas', 'puma']
pr... | true |
d85e83633538225d1ed1bf48b9316afe7443b988 | Python | eliemichel/ReACORN | /acorn/bnb_solver.py | UTF-8 | 3,496 | 2.515625 | 3 | [
"MIT"
] | permissive | # This file is part of ReACORN, a reimplementation by Élie Michel of the ACORN
# paper by Martel et al. published at SIGGRAPH 2021.
#
# Copyright (c) 2021 -- Télécom Paris (Élie Michel <elie.michel@telecom-paris.fr>)
#
# The MIT license:
# Permission is hereby granted, free of charge, to any person obtaining a copy
# ... | true |
aa465caed1de41eefa80a1b9fdb53447c85ccc07 | Python | windymar/python | /mars_rover/rover_controller.py | UTF-8 | 1,416 | 3.046875 | 3 | [] | no_license | class RoverController:
def __init__(self, rover, map_size, callback=None):
self._rover = rover
self._map_size = map_size
self._callback = callback
def get_rover(self):
return self._rover
def get_map_size(self):
return self._map_size
def execute_command(self, co... | true |
bcd95153f629e726a4024a4020546f123dc024f7 | Python | ylwyl/OurRPG | /messageBox.py | UTF-8 | 697 | 3 | 3 | [] | no_license | import pygame
class MessageBox():
def __init__(self):
self.image = pygame.image.load('image/message_box.jpg').convert()
self.rect = self.image.get_rect()
self.rect.left, self.rect.top = 0, 0
self.chara = None
self.message = None
self.show_message = False
... | true |
c21fa1d9fed256b82c727833a9df5f80a72ef4c2 | Python | ReactionMechanismGenerator/RMG-database | /input/kinetics/families/HO2_Elimination_from_PeroxyRadical/training/reactions.py | UTF-8 | 12,690 | 2.5625 | 3 | [] | no_license | #!/usr/bin/env python
# encoding: utf-8
name = "HO2_Elimination_from_PeroxyRadical/training"
shortDesc = u"Reaction kinetics used to generate rate rules"
longDesc = u"""
Put kinetic parameters for specific reactions in this file to use as a
training set for generating rate rules to populate this kinetics family.
"""
e... | true |
d6f4535ed72050fc08119710ef8b2be186b0d171 | Python | howardchen/OS_test_tools | /fileMove.py | UTF-8 | 1,366 | 2.765625 | 3 | [] | no_license | import os
import shutil
from getHostname import getHostname
class FileMove:
__doc__ = """這是一個用來做檔案複製以及將結果上傳的類別"""
def __init__(self):
# share_ip 可由外部設定
self.share_ip = '192.168.10.5'
# \\192.168.10.5\高鳳國際物流
self.path = os.path.join('//', self.share_ip, '高鳳國際物流', '電腦室')
... | true |
73d729ca7a3bd7c56ea30e76d51bbcfbc10f036e | Python | robograder/robogen | /scripts/parseGenerated.py | UTF-8 | 3,983 | 2.75 | 3 | [] | no_license | from bs4 import BeautifulSoup as bsoup
import urllib2
import re
import random
import subprocess
sentenceEnd = re.compile(r'([\.!?]+ )')
# split line into sentences
def splitSentences(essay):
return [endSentence(s) for s in re.sub(sentenceEnd, '\g<1>|||', essay).split('|||')]
def endSentence(sentence):
senten... | true |
a4e705c0ef7adfad292a74e6cc730c36d0a82dcc | Python | EngiNearStrange/Python_Practice_Exercises_Projects | /Lambda function.py | UTF-8 | 244 | 3.484375 | 3 | [] | no_license | # def addition(a, b):
# return a + b
# print(addition(9, 12))
# addition = lambda a, b : a + b
# print(addition(4, 5))
# def giv(lt):
# return lt[2]
lt = [[5, 2, 7], [8, 54, 64], [5, 6, 1]]
lt.sort(key = lambda lt : lt[2])
print(lt) | true |
e48cccd59c6a330d9c6c620f525a16d07d75a561 | Python | jpc0016/Python-Examples | /Crash Course/ch6-Dictionaries/cities.py | UTF-8 | 903 | 4.625 | 5 | [] | no_license | # CH6 Exercise 6-11
#
# cities.py
#
# Make a dictionary called cities.
# Create a dictionary of information about three cities to include country, population,
# and a fact. Print the name of each city and their attributes
# Define the cities dictionary
cities = {
'huntsville': {
'country': 'us',
'... | true |
dddedcdba9e7156091f25da073a269913f1fe2b8 | Python | TEAM-DEFINITION/individual_repository | /20210410/kimjuwon/endecrypt_test.py | UTF-8 | 1,181 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive | import base64
from Crypto import Random
from Crypto.Cipher import AES
BS = 16
pad = lambda s: s + (BS - len(s.encode('utf-8')) % BS) * chr(BS - len(s.encode('utf-8')) % BS)
unpad = lambda s : s[:-ord(s[len(s)-1:])]
class AESCipher:
def __init__( self, key ):
self.key = key
def encrypt( self, raw ):
... | true |
0551b4efb46ef7039637a7d4513993324f986789 | Python | JarryShaw/PyPCAPKit | /pcapkit/corekit/fields/numbers.py | UTF-8 | 11,775 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | # -*- coding: utf-8 -*-
"""numerical field class"""
import enum
import math
from typing import TYPE_CHECKING, Generic, TypeVar, Union, cast
import aenum
from pcapkit.corekit.fields.field import Field, NoValue
from pcapkit.utilities.exceptions import IntError
__all__ = [
'NumberField',
'Int32Field', 'UInt32F... | true |
6fa94027b0d7a50ae6995a23a724f2fd0ae0fce1 | Python | wendyfly/django-twitter | /gatekeeper/models.py | UTF-8 | 1,128 | 2.765625 | 3 | [] | no_license | from utils.redis_client import RedisClient
# Store those info in redis because those infos are frequently visited
class GateKeeper(object):
@classmethod
def get(cls, gk_name):
conn = RedisClient.get_connection()
# use prefix to determine the usage of rdis
name = f'gatekeeper:{gk_name... | true |
9cf2a4af9a9fd4a5ef949d2c3222e338c2751d59 | Python | BhushanTayade88/Core-Python | /Feb/day 6/stud.py | UTF-8 | 173 | 2.921875 | 3 | [] | no_license | class student:
pass
s1=student()
s1.rollno=1
s1.name="bhushan"
s2=student()
s2.rollno=2
s2.name="tayade"
print(s1.rollno)
print(s1.name)
print(s2.rollno)
print(s2.name)
| true |
67fb6cbf28f5fd726f442ec48c29f3a8dfd3a9d7 | Python | Kabug/Chess-AIs | /engine.py | UTF-8 | 28,040 | 3.375 | 3 | [] | no_license | """
Starter Code for Assignment 1 - COMP 8085
Please do not redistribute this code our your solutions
The game engine to keep track of the game and provider of a generic AI implementation
You need to extend the GenericAI class to perform a better job in searching for the next move!
"""
# pip install Chessnut
from Che... | true |
837983e2f5172dc236dfa62e8311c2af5afa5c08 | Python | kedington/pi | /get_py.py | UTF-8 | 398 | 2.734375 | 3 | [] | no_license | import requests
chunk_len = 1000
domain = "https://api.pi.delivery"
endpoint = "/v1/pi"
with open("pi.txt", 'w') as outfile:
for i in range(1000):
resp = requests.get('{0}{1}?start={2}&numberOfDigits={3}'.format(domain, endpoint, chunk_len*i, chunk_len))
if resp.status_code == 200:
out... | true |
e392cd12b0b531cd584c4ebcfafc1492d3fa8d27 | Python | Bisonai/awesome-edge-machine-learning | /style.py | UTF-8 | 1,238 | 3.234375 | 3 | [
"CC0-1.0"
] | permissive | from typing import List
def concatenate(text: List):
return "".join(filter(lambda x: x is not None, text))
def li(fp, text):
if isinstance(text, list):
text = concatenate(text)
fp.write("- " + text + "\n")
def lili(fp, text):
"""Second level of list items"""
fp.write("\t")
li(fp, ... | true |
a32a9a62853fae63e422c6e3061bbdf849ad34d9 | Python | jeanyvesb9/Jupyter-Beeper | /jupyter_beeper/Beeper.py | UTF-8 | 1,682 | 3.296875 | 3 | [
"MIT"
] | permissive | from IPython.display import display, Audio, HTML
import numpy as _np
import time as _time
import random as _rand
class InvisibleAudio(Audio):
'''
IPython.display.Audio, but without it being displayed. It still takes space in the output
layout tough.
'''
def _repr_html_(self):
audio = super... | true |
112c6b3b8421e675f53ce6928c24749530b266f3 | Python | shashikumar2691/Python-Assigment | /inheritance_car.py | UTF-8 | 1,853 | 3.34375 | 3 | [] | no_license | class Car:
def __init__(self, typ, make, color, year, miles):
self.typ = typ
self.make = make
self.color = color.lower()
self.year = year
self.miles = miles
def print_details(self):
print('Vehicle Type: {}'.format(self.typ))
print('Make: {}'.format(self.m... | true |
7e28c8286a67318ac246e00023c817e5f52dc12f | Python | ashukid/pygames | /hangman_game/hangman.py | UTF-8 | 1,460 | 3.234375 | 3 | [] | no_license | class Hangman:
def __init__(self):
self.sc=20 #space count
self.line1=" "*self.sc + " +---+"
self.line2=" "*self.sc + " |"
self.line3=" "*self.sc + " |"
self.line4=" "*self.sc + " |"
self.line5=" "*self.sc + " |"
self.line6=" "*self.sc... | true |
a8dfe2baa459b972327925bd636d5df21871391b | Python | LArbys/thrumu | /event_array_loop_ccqe_all_pixels_clustering.py | UTF-8 | 30,709 | 2.609375 | 3 | [] | no_license | import sys
from larcv import larcv
import numpy as np
# Import the file that will contain the algorithm for matching the wire with other wires that //
# are at the same y and z coordinates
import y_wire_matches_single_threshold_improved
import z_wire_matches_single_threshold_improved
import barnes_pixel_clustering
imp... | true |
f59f44aed3860758a70a86683b6a09497744484b | Python | JosueHernandezR/Analisis-de-algoritmos-ESCOM | /Practica2/Fibonacci/Iterativo/grafica.py | UTF-8 | 1,040 | 3.75 | 4 | [
"MIT"
] | permissive | #Análisis de Algoritmos 3CV2
# Alan Romero Lucero
# Josué David Hernández Ramírez
# Práctica 2 Fibonacci Iterativo
# Este archivo sirve para gráficar los resultados obtenidos
import matplotlib.pyplot as plt
import numpy as np
def graph ( count, fibo, f, n ):
# Título de la ventana
plt.figure ( "Fibonacci Itera... | true |
459cc949c9e30df946dc7f7a2e06ff7ef66302ad | Python | shivneelmistry/sudoku | /SudokuBoard.py | UTF-8 | 9,931 | 3.40625 | 3 | [] | no_license | """
Sudoku
Shivneel Mistry
05/05/2021
"""
from random import shuffle, choice, randint
import sys
from typing import Union, List
import xlsxwriter
import pygame
WIDTH, HEIGHT = 900, 950
CHIN = 50
WHITE = (255, 255, 255)
GREY = (160, 160, 160)
BLACK = (0, 0, 0)
GRID = [["", "", "", "", "", "", "", "", ""... | true |
176379021b5d10bef11b6baffe10621b39d2db79 | Python | sameermuhd42/Luminar-python | /programs/set_squareofno.py | UTF-8 | 118 | 3.3125 | 3 | [] | no_license | set_no = {1, 2, 3, 4, 5, 6, 7, 8, 9}
set_square = set()
for i in set_no:
set_square.add(i ** 2)
print(set_square)
| true |
8e3cd690182790f233c3bbffec7ea22aad72195c | Python | estheragbaje/Sprint-Challenge--Data-Structures-Python | /ring_buffer/ring_buffer.py | UTF-8 | 2,104 | 3.5625 | 4 | [] | no_license | from doubly_linked_list import DoublyLinkedList
class RingBuffer:
def __init__(self, capacity):
self.capacity = capacity
self.current = None
self.storage = DoublyLinkedList()
def append(self, item):
#if there's still capacity for storage, append new item to head
if s... | true |
60c900660f7bde45cf5df6d4e27229f05f700f83 | Python | kingkarlito/Wallet-watcher | /wallet-watcher.py | UTF-8 | 6,111 | 2.625 | 3 | [] | no_license | import requests
import json
import datetime
import sys
import argparse
from termcolor import colored
parser = argparse.ArgumentParser(
description='Wallet watcher',
formatter_class=argparse.ArgumentDefaultsHelpFormatter #added to show default value
)
print colored("asciiart.eu ______________ \n\
__,.,--... | true |
a25e8285ef7f3904f9a476f9275bd6a5d094e341 | Python | Technologicat/unpythonic | /unpythonic/syntax/tests/test_ifexprs.py | UTF-8 | 1,828 | 3.015625 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | # -*- coding: utf-8 -*-
"""Extended if-expressions."""
from ...syntax import macros, test # noqa: F401
from ...test.fixtures import session, testset
from ...syntax import macros, aif, it, cond, local # noqa: F401, F811
def runtests():
with testset("aif (anaphoric if, you're `it`!)"):
# Anaphoric if: ai... | true |