blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
133
path
stringlengths
2
333
src_encoding
stringclasses
30 values
length_bytes
int64
18
5.47M
score
float64
2.52
5.81
int_score
int64
3
5
detected_licenses
listlengths
0
67
license_type
stringclasses
2 values
text
stringlengths
12
5.47M
download_success
bool
1 class
69a33aea15566621a5ffc1ac28d4fa08db97cdd7
Python
gabriellaec/desoft-analise-exercicios
/backup/user_188/ch9_2019_04_04_22_16_24_603709.py
UTF-8
214
3.25
3
[]
no_license
def lista_sufixos(frase): lista = [] contador = len(frase) - 1 soma = "" while contador >= 0 : soma += frase[contador] lista.append(soma[::-1]) contador -= 1 return lista
true
b6f21a9664406de1e2e5d113393b51ee97f849f9
Python
bridge-ai-inc/pymc
/other_files/multiproc_test2.py
UTF-8
1,370
2.96875
3
[]
no_license
import os import pandas as pd from multiprocessing import Process, current_process # Change to dir containing matlab code, c code and data path_data = './src_data' os.chdir(path_data) MAX_NUM_CORES_TO_USE = 6 def mc_simulation(name): d = os.system('./mcxyz ' + name) print('simulating tissue ' + name) p...
true
345d2673e844c49c3b4a7d22a0aa8db557ca1ec0
Python
PritKalariya/Python-practice-problems-and-exercises
/The Basics - Loops/Loop over colors.py
UTF-8
142
4.15625
4
[]
no_license
# Loop over the color items and print out the item in every loop colors = [11, 34, 98, 43, 45, 54, 54] for color in colors: print(color)
true
85fb3bfa733d9ec10a1558a9de1f18360112e9dc
Python
tre3x/FloodScraper
/glidenumber/desc.py
UTF-8
3,582
2.640625
3
[ "MIT" ]
permissive
import os from sys import platform from selenium import webdriver from selenium.webdriver import ActionChains from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.firefox.options import Options def descriptionscrap(cont, startdate, endda...
true
c147896730babcd0a5b06475091d1506d5059995
Python
momennezhad/Web-Projects
/samples-server-master/startup.py
UTF-8
1,028
3.03125
3
[]
no_license
# # MDN Sample Server # Start up samples as needed. # import os import sys import subprocess # # startService # # Given a path, start up the service contained in that directory. # This is done by running the "startup.sh" script in each directory. # The bash shell is used. # def startService(path): print("Starting s...
true
7490d1ec897c07e7309628013f4a23d371472a2c
Python
benhoyle/benhoyle.github.io-src
/content/notebooks/title_generation/cb_model.py
UTF-8
5,380
3.21875
3
[]
no_license
"""This module contains a class to model a sequence to sequence model based on blogposts from Chollet and Brownlee """ from base_seq2seq import SharedGlove import numpy as np from keras.models import Model from keras.layers import Input, LSTM, Dense, Embedding def sample(preds, temperature=1.0): """ Helper funct...
true
f30304c408069fdfaa8ee045995f64b672937209
Python
HuangXiongjin/python_study
/python基础/2.变量和运算符/code/example.py
UTF-8
171
2.765625
3
[]
no_license
"""---author==hxj""" summation = 0 num = 1 while num <= 100: if (num % 3 == 0 or num % 7 == 0) and num % 21 != 0: summation += 1 num += 1 print(summation)
true
e16fad02d74b281a29d0856c174c03dfc3a28c35
Python
RHAF05/python-exercise
/files.py
UTF-8
456
3.09375
3
[]
no_license
def read(): numbers = [] with open('./files/numbers.txt','r',encoding='UTF-8') as f: for line in f: numbers.append(int(line)) print(numbers) def write(): names = ["Mi mujé", "Puto amo", "Kembarquiladiva"] with open("./files/names.txt","w", encoding="UTF-(") as f: for na...
true
a1ad2862d9dcf82d38da895baa296937e83fdb72
Python
YousefYA/Blue-teaming
/ARP_Detector.py
UTF-8
1,214
2.6875
3
[]
no_license
from termcolor import colored import os import winsound import pyfiglet def get_mac(ip): arp = scapy.ARP(pdst = ip) broadcast = scapy.Ether(dst = 'ff:ff:ff:ff:ff:ff') packet = broadcast/arp answered = scapy.srp(packet , timeout = 1 , verbose = False)[0] return answered[0][1].hwsrc def ...
true
266edb321dac83546555c55312f593c624aeb41e
Python
lbmendes/lucas-api
/sync.py
UTF-8
561
2.8125
3
[ "Unlicense" ]
permissive
import asyncio sleep = asyncio.sleep async def fazer_burguer(senha, n): print(f'Fazendo burguer {n} para cliente {senha}') await sleep(2) return b"[|O]" async def app(scope, receive, send): await send({'type': 'http.response.start', 'status': 200}) senha = scope.get('path') burguer1 ...
true
104033cb80fa702194ff28f468ea4f9ca0a52bbd
Python
gongjiqin/Data_Engine_SVW
/Action/Action2.py
UTF-8
592
3.359375
3
[]
no_license
import pandas as pd from pandas import DataFrame df = DataFrame(data={'语文': [68, 95, 98, 90, 80], '数学': [65, 76, 86, 88, 90], '英语': [30, 98, 88, 77, 90]}, index=['张飞', '关羽', '刘备', '典韦', '许诸'], columns=['语文', '数学', '英语']) # print(df.describe()) print(df) print('平均成绩:', '\n', df.mean()) print('最小成...
true
480b5868f82c55f4841e8cd3772b8f6af8b9f930
Python
aamanrebello/Burner-Controller-Software
/Remote/ML/multiple_regression.py
UTF-8
6,977
3.453125
3
[]
no_license
from sklearn import linear_model from sklearn.metrics import r2_score from sklearn.preprocessing import StandardScaler import pandas as pd import os from math import sqrt # MR_predictor: This class is used to predict the required gas aperture size using multiple regression with # the relevant variables i.e. supply p...
true
0964f0d5d46ac0777492ada895df66bdde5b8aeb
Python
d-millard/rec-rep
/FUNDEMENTALS/Module 7/encrypt_exercise.py
UTF-8
4,512
3.5
4
[]
no_license
from random import random as ran import os def run(): """ Main function for program. Brings together files, all symbols, the unicode hexadecimal, and the key. """ while True: try: user_data = user_file("Please enter a valid file name you would like to encrypt: ") ...
true
d138de0b5aceea3240a4034dbdd3124293dcd8a1
Python
H33525/Check-your-age
/Check your age.py
UTF-8
101
3.5
4
[]
no_license
birth_year=input("What year were you born? ") age=2019- int (birth_year) print(f'your age is:{age})
true
fb62fc532090e7e052ae2cb05d7a6c69367e47d3
Python
codycollier/netropy
/test/functional/test_beacon.py
UTF-8
3,055
3.0625
3
[ "MIT" ]
permissive
#!/usr/bin/env python import unittest import beacon class TestBeacon(unittest.TestCase): def setUp(self): unittest.TestCase.setUp(self) # this is the standard frequency in the nist beacon right now self.frequency = 60 def tearDown(self): unittest.TestCase.tearDown(self) ...
true
fa47353914dc0382149b5649a394e42c13add927
Python
i-cluster/Study
/1014_지뢰찾기.py
UTF-8
1,362
3.171875
3
[]
no_license
# SWEA 1868 import sys sys.stdin = open('sample.txt', 'r') d = [0, 1, -1, 1, 1, 0, -1, -1, 0] for tc in range(1, int(input())+1): n = int(input()) land = [list(input()) for _ in range(n)] for i in range(n): for j in range(n): if land[i][j] == '*': for k in range(8): ...
true
0d8c0466e8530db41a27ffb62ac9e0f89c769ded
Python
abbhowmik/PYTHON-Course
/chapter 9.py/09_pr.py
UTF-8
205
3.34375
3
[]
no_license
with open('this.rb') as f: content1 = f.read() with open('copy.rb') as f: content2 = f.read() if content1 == content2: print('Files are identical') else: print("Files are not identical")
true
db0c8c44a7228b5da1b2fb4add5c5e458f4e444f
Python
alexandremr01/MinesweeperAI
/single_evaluator.py
UTF-8
2,944
3.0625
3
[]
no_license
import numpy as np import random from minesweeper_environment import MinesweeperEnvironment from minesweeper import MinesweeperCore from agents.csp import MinesweeperAgent import matplotlib.pyplot as plt import os from agents.L4MSAgent import L4MSAgent # This script runs an actor and evaluates it. # Some PCs needed t...
true
86bc5e5de9e76ce3440fea6a44803be1e2544064
Python
ElementsProject/lightning
/tests/plugins/reject_odd_funding_amounts.py
UTF-8
1,005
2.828125
3
[ "MIT" ]
permissive
#!/usr/bin/env python3 """Simple plugin to test the openchannel_hook. We just refuse to let them open channels with an odd amount of millisatoshis. """ from pyln.client import Plugin, Millisatoshi plugin = Plugin() def run_check(funding_amt_str): if Millisatoshi(funding_amt_str).to_satoshi() % 2 == 1: ...
true
2fdc4e5cf56b2f8cfaa5721354e05e8e0f71a87b
Python
kait-takanolab/1785005_tsukiji_slackAPI
/get_slacklog.py
UTF-8
1,401
2.734375
3
[]
no_license
# -*- coding: utf-8 -*- #APIを使って対象のチャンネルのログをjson形式で取得するプログラム import sys,codecs,json from slacker import Slacker # API token tokenが入ったファイルの読み込みをして取得(セキュリティ回避) token = codecs.open("../slackapi_token.txt", "r","utf-8") # 対象のチャンネル名 # general:C0J8KM6KF # 2017-sotsuken:C18JT8ZNY # report:C0XMH9F0Q # master-chat:C4W2R...
true
fc1f69b9d76c198781c672c41da57090bd9b8d83
Python
IlkoMihov/411-Project
/app.py
UTF-8
13,527
2.53125
3
[]
no_license
# coding: utf-8 from flask import Flask from flask import g, session, request, url_for, flash from flask import redirect, render_template from flask_oauthlib.client import OAuth from get_tweets import getTweet import random app = Flask(__name__) app.debug = True app.secret_key = 'cs411' oauth = OAuth(app) # twitte...
true
c00136eaa870cca58a469264366dbdf4494be3ee
Python
zukerr/method-of-war
/MethodOfWar/method_of_war/ui/persistent_ui/units_view.py
UTF-8
2,082
3.046875
3
[]
no_license
from mini_engine.ui import border_rect from mini_engine.ui.a_view import * class UnitsView(View): __maxUnitTypes: int = 11 __currentY: int = 240 __elementHeight: int = 24 __currentElementCount: int = 0 __unitsDict: dict def updateUnits(self, unitsDict: dict): self.drawView() s...
true
223bf148b1b9c7aa005b0369f7f2c61a4a5dac9b
Python
st4rck19981/Topicos-Grafica
/INDIVIDUAL/Jeferson Poma/BitwiseMascara.py
UTF-8
615
2.734375
3
[]
no_license
import cv2 import numpy as np image=cv2.imread('image4.jpg') person=cv2.imread('perfil.jpg') person=cv2.resize(person,(400,400),interpolation=cv2.INTER_CUBIC) T=np.float32([[1,0,550],[0,1,50]]) person=cv2.warpAffine(person,T,(1000,500)) mask=np.zeros((500,1000),dtype=np.uint8) mask=cv2.circle(mask,(750,25...
true
bea48a2c75e711275dbf093af4b1fada11b34b0e
Python
tvarney/dotnet-nrbf-deserializer
/dotnet/io/base.py
UTF-8
1,139
2.765625
3
[ "MIT" ]
permissive
from abc import ABC, abstractmethod import dotnet.exceptions as exceptions import typing if typing.TYPE_CHECKING: from typing import IO from dotnet.object import Instance class Reader(ABC): @classmethod @abstractmethod def binary(cls) -> bool: raise exceptions.ClassMeth...
true
08aa4a88d5998247bc3e2a128debb1454acaf50a
Python
leoflorov/python1
/lesson_1_hw_easy.py
UTF-8
2,258
4.46875
4
[]
no_license
__author__ = 'Флоров Леонид Сергеевич' # Задача-1: Дано произвольное целое число (число заранее неизвестно). # Вывести поочередно цифры исходного числа (порядок вывода цифр неважен). # Подсказки: # * постарайтесь решить задачу с применением арифметики и цикла while; # * при желании решите задачу с применением цикла fo...
true
396f0ae26b8def1c9ee692a3728b46cbccc6d44a
Python
ashishkr619/dukaan_main
/products/models.py
UTF-8
1,331
2.609375
3
[ "MIT" ]
permissive
import uuid from django.db import models from stores.models import Store class TimestampedModel(models.Model): """ An abstract timestamp model when this object was created or updated""" created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) class...
true
40f5a8b7bd0fbfedf416ec9251bdafd87a680510
Python
souryou/py_excel
/excel.py
UTF-8
4,343
2.625
3
[]
no_license
#!/usr/bin/python3 import openpyxl as xl import tkinter as tk from tkinter import filedialog from tkinter.ttk import * from tkinter import messagebox title = "窗口标题" window=tk.Tk() window.title(title) window.geometry("600x300") fn = tk.StringVar() startRow = tk.StringVar() sheet_name = tk.StringVar() tabShow = tk.Stri...
true
1bf7d9c86dd3b7f35fa9deaa39fcbe593aeca01e
Python
dtbinh/15-112
/hw8b.py
UTF-8
5,833
3.703125
4
[]
no_license
# hw8.py # Hanzhou Lu / hanzhoul / II def isPrime(n, factor=2): if (n < 2): return False elif (factor*factor > n): return True elif (n % factor == 0): return False else: return isPrime(n, factor+1) def countDigit(n): if n == 0: return 0 #base case return 1 + countDigit(n//10) ...
true
5f8c9e445019dcb8edb4eee17bcb3d29a50a5de6
Python
count-chocolatin/Ejem-Programation
/example c/class-example.py
UTF-8
416
3.421875
3
[]
no_license
class Humano(): def __init__(self, edad, nombre, ocupacion): self.edad = edad self.nombre = nombre self.ocupacion = ocupacion def suma(self): presentacion = self.edad + self.nombre + self.ocupacion print(presentacion ) def resta(self): ...
true
b80966f612e4d633657b3094fa2076e766e32846
Python
aloverso/git-learning
/factorial.py
UTF-8
465
3.671875
4
[]
no_license
# -*- coding: utf-8 -*- """ Created on Wed Apr 15 15:35:02 2015 @author: aloverso & Luciano & sarahwalters """ # Calculates the factorial of a number def factorial(n): """ Testing the factorial >>> factorial(3) 6 >>> factorial(5) 120 """ if n == 1: # base case return 1 else...
true
e3265ab75b1c31cf28b68180426e021caa169259
Python
DanieleF98/Python_Exercises
/Esercizi Python/ex_08_05.py
UTF-8
1,029
3.953125
4
[]
no_license
#Open the file mbox-short.txt and read it line by line. When you find a line that starts with 'From ' like the following line: #From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008 #You will parse the From line using split() and print out the second word in the line #(i.e. the entire address of the person who sent...
true
176400286229b47f79c97b42310d7db5e93ee039
Python
JimTheToaster/pvs-bot
/current-pvs.py
UTF-8
29,411
2.859375
3
[ "MIT" ]
permissive
#!/usr/bin/python3 import asyncio import discord import requests import id client = discord.Client() URL = { 'base': 'https://{proxy}.api.pvp.net/api/lol/{region}/{url}', 'summoner_by_name': 'v{version}/summoner/by-name/{names}', 'get_league': 'v{version}/league/by-summoner/{id}/entry', 'g...
true
6b10bad5c4c7d57d377cd11192a70f0b6a712f9f
Python
ilijavucetic/AnomalyDetection
/SimulateTemperature/simulate_temperature.py
UTF-8
1,806
3.5
4
[]
no_license
import calendar from datetime import datetime, timedelta import random class SimulateTemperatures: months = range(1, 12) min_temperature = [1, 2, 6, 9, 13, 17, 20, 19, 16, 11, 6, 2] max_temperature = [9, 11, 15, 19, 23, 28, 32, 32, 27, 21, 15, 10] avg_temperature = [] offset = 2 humidity_mx...
true
eaa9c5ede19214fb1fef994b1135020c3c3e421c
Python
vladiulianbogdan/MasterThesisVUB-Prediction-Using-Importance-Sampling
/Transition.py
UTF-8
3,370
2.921875
3
[]
no_license
import re import math class Transition: def __init__(self, tokens): token = tokens.next_token() match = re.match(r'--n(\d+)x(\d+)', token) self.is_active = True self.source = int(match.group(1)) self.transition_index = int(match.group(2)) self.target = Transition.co...
true
c029e844a63865f4fde863fdf6431bcf339a67f4
Python
mylog00/hadoopExamples
/streaming/tf_idf/inverseDocumentFrequencyReducer.py
UTF-8
860
2.796875
3
[]
no_license
# Sample Input: # aut 1;4;1 # aut 2;2;1 # bene 2;1;1 # de 2;1;1 # mortuis 2;1;1 # nihil 1;1;1 # nihil 2;1;1 # Caesar 1;1;1 # Sample Output: # aut#1 4 2 # aut#2 2 2 # bene#2 1 1 # de#2 1 1 # mortuis#2 1 1 # nihil#1 1 2 # nihil#2 1 2 # Caesar#1 1 1 import sys docTfList = [] lastWord = None counter = 0 for line in sys....
true
cf9ffef0be6b1dcb50e101829c7fac0adc133293
Python
elms1990/random_terrain
/heightmaps/terrain/terrain_converter.py
UTF-8
320
3.328125
3
[]
no_license
class TerrainConverter: def __init__(self): self.intervals = [] def add(self, lower, upper, t, value): self.intervals.append((lower, upper, t, value)) def get(self, value): for x in self.intervals: if value >= x[0] and value <= x[1]: return (x[2], x[3])
true
462de88ace213e1b7c876d550ef8cb9b6d8ec694
Python
jooo000hn/cetech
/scripts/loggrep.py
UTF-8
3,134
2.59375
3
[ "CC0-1.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
#!/usr/bin/env python """ CETech log grep """ ########### # IMPORTS # ######################################################################################################################## import argparse import os import sqlite3 import tabulate from argparse import RawTextHelpFormatter ########### # GLOBALS # ###...
true
22ba33e53c4035a703db4701ced9715333b580a1
Python
IrishPhone/decorators
/time.py
UTF-8
515
3.625
4
[]
no_license
import time NUM_RUNS = 10 def time_this(func): def wrapp(): results = [] for i in range(NUM_RUNS): t0 = time.time() func() t1 = time.time() results.append(t1 - t0) print("Average time for {0} passes is {1} s.".format(NUM_RUNS, sum(results) / ...
true
40246a3fbe17bc1fbd970434a4993b5708d6397d
Python
seve-26/vincentvanbot
/vincentvanbot/fromtitle/train.py
UTF-8
1,559
2.6875
3
[]
no_license
### WORK IN PROGRESS! Currently not used by the api """This file trains a KNN model based on the output of vincentvanbot.fromtitle.data""" import os from sklearn.neighbors import NearestNeighbors import joblib from google.cloud import storage from vincentvanbot.params import BUCKET_NAME def train_model(joined_images...
true
99bec785306398c6ac577acc4f5094fda651bfba
Python
mergeMingJ/boj_basic_algo
/배열/1475. 방 번호.py
UTF-8
394
3.140625
3
[]
no_license
import sys sys.stdin = open('input/1475.txt', 'r') import math room = list(str(input())) check = {} for i in range(10): check[i] = 0 for n in room: check[int(n)] += 1 count = math.ceil((check[6]+check[9])/2) for i in range(10): if i == 6 or i == 9: pass else: if count >= check[i]: ...
true
d2e9ef380cf4fbbf64c60488bb91a241d8ea51ec
Python
mairaminaks/Share-Study-Material
/index.py
UTF-8
12,328
2.921875
3
[]
no_license
#import modules from tkinter import * import tkinter as tk from tkinter import ttk from tkinter import messagebox from tkinter import filedialog import sqlite3 as sq import os # Designing window for registration def register(): global register_screen register_screen = Toplevel(main_screen) ...
true
0f0738122d20607f26711a17a2bd68dfc48d2ecb
Python
mzalota/crabs-video-analysis
/lib/data/CrabsData.py
UTF-8
7,885
2.6875
3
[]
no_license
from __future__ import annotations from typing import List, Dict import pandas as pd from datetime import datetime from lib.FolderStructure import FolderStructure from lib.common import Box from lib.data.PandasWrapper import PandasWrapper from lib.data.SeeFloor import SeeFloor from lib.infra.DataframeWrapper import D...
true
6639b32df872810ea31492795177713134804ac5
Python
sz-o/Zadania-Ansta
/zadanie_2.py
UTF-8
542
3.21875
3
[]
no_license
def brakujace_elementy(istniejace, n): return [x for x in list(range(1, n + 1)) if x not in istniejace] # Poniżej testy def test_gdy_dodaje_pusta_liste_i_3_to_zwracana_jest_pelna_lista_od_1_do_3(): assert brakujace_elementy([], 3) == [1, 2, 3] def test_gdy_dodaje_pusta_liste_i_4_to_zwracana_jest_...
true
8d747c5f0c3da1ece46d578a567b73e68b26c014
Python
dmitricus/SpamFilter
/db/models.py
UTF-8
2,352
2.609375
3
[ "MIT" ]
permissive
import datetime import os from sqlalchemy import Column, Integer, String, BOOLEAN, BIGINT, INT, TEXT, FLOAT, DATE, ForeignKey, DateTime, VARCHAR, create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, sessionmaker Base = declarative_base() # заносим в БД спамме...
true
9b8b26fc63d9a5aa1b6fc9f7a4796b83babbe110
Python
kenilpatel/Analysis-of-search-algorithm
/RBTREE.py
UTF-8
10,250
2.90625
3
[]
no_license
rootval=0 tree=None class rbtree: def __init__(self): self.root=None class rbnode: def __init__(self,val,color="r",root=False): self.key=val self.left=None self.right=None self.parent=None self.root=root self.color=color def print(self): print(self.key,self.color,self.root) def add...
true
da2ce55c90d6890b1bdc8e7aae59a5fc0fc81bd5
Python
manisha-217/Assignment4
/set.py
UTF-8
71
2.765625
3
[]
no_license
s1=set([6,8,0,6]) s2=set([9,4,0,7]) print(s1-s2) print(s1&s2) print(s)
true
d2da38e21dd1e00174cd9db340d892bb42b681cc
Python
shreyasandal05/HelloWorld
/files_and_directories.py
UTF-8
122
2.515625
3
[]
no_license
from pathlib import Path path = Path("ecommerce") print(path.exists()) # o/p-True path2 = Path("emails") path2.rmdir()
true
5f24d7ccde81587dfc4e801d9a9f2c583f744a00
Python
whitebumblebee/face-tracker-pyjs
/text.py
UTF-8
2,992
3.03125
3
[ "MIT" ]
permissive
#!/usr/bin/python3.4 import pygame, sys from core_funcs import * from clip import clip def load_font_img(path, font_color): fg_color = (255, 0, 0) bg_color = (0, 0, 0) font_img = pygame.image.load(path).convert() font_img = swap_color(font_img, fg_color, font_color) last_x = 0 letter...
true
b43d6aac36316d8809c43b2a3731014b416705cc
Python
Internet-SmokeAlarm/core
/dependencies/python/fmlaas/model/experiment.py
UTF-8
3,816
2.546875
3
[]
no_license
from .db_object import DBObject from .model import Model class Experiment(DBObject): def __init__(self, id, jobs, hyperparameters, current_job, start_model, current_model, is_active): ""...
true
3356677e47259861ece755c17f54a28e1df0bd05
Python
super1337/Super1337-CTF
/questionnaire/management/commands/addquestions.py
UTF-8
679
2.609375
3
[ "MIT" ]
permissive
from django.core.management.base import BaseCommand from questionnaire.questions import questions class Command(BaseCommand): help = 'Adds the questions from input JSON file to Database.' def add_arguments(self, parser): parser.add_argument( '--inputfile', dest='inputfile', ...
true
7e404edf8d302e33958be666039026385973d8dc
Python
junwei-wang/project-euler
/001-100/47/47.py
UTF-8
1,342
3.640625
4
[ "MIT" ]
permissive
#!/usr/bin/env python # -*- coding: utf-8 -*- from math import sqrt, ceil def get_primes_under_n(num): length = int(ceil(num/2.0)) sevie = [True] * length # 1, 3, 5, 7, ..., n-1 sevie[0] = False # a number has at most one factor than its squre sqr = int(ceil(sqrt(num))) sqr_idx = (sqr+1)/2 ...
true
34debc2c97ad474a31cea95dd381be0cffe5bd97
Python
arby1108/IntelliTrader
/Attention.py
UTF-8
8,204
2.765625
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Fri Oct 2 19:09:10 2020 @author: RB """ import tensorflow as tf import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler from sklearn.metrics import mean_squared_error from datetime import datetime from datetime import timedelta impor...
true
2493f97065589c464504567e24cd711f0dbee8a7
Python
yordanovagabriela/Cinema-Reservation-System
/commands.py
UTF-8
3,010
2.796875
3
[]
no_license
import sqlite3 class Commands: OCCUPIED_SEAT = 'X' def __init__(self, database): self.connection = sqlite3.connect(database) self.connection.row_factory = sqlite3.Row self.cursor = self.connection.cursor() def show_movies(self): return self.cursor.execute("""SELECT movie...
true
775f0e125adf801c2b6ae3bf3bb488a075153d3f
Python
samdfonseca/presentations
/airflow-custom-macros-talk/code/bigquery_weekend_example2.py
UTF-8
542
2.625
3
[]
no_license
# Select from `proj.dataset.table1` when execution_date is a weekday, # from `proj.dataset.table2` when execution_date is a weekend. def determine_table(execution_date: pendulum.Pendulum) -> str: if execution_date.weekday() >= 5: return 'proj.dataset.table2' return 'proj.dataset.table1' with DAG(..., ...
true
ea44747694bc6baff207b63d29875d0dbc48771c
Python
daren996/HCI_AI_Med
/Analysis/AnlyzNoRst.py
UTF-8
4,554
2.703125
3
[]
no_license
import Utils import json import matplotlib.pylab as plt import numpy as np import math from collections import Counter import csv source_path = "../DataSet/" data_set = "dial_no_rst.txt" with open(source_path + data_set, "r") as in_file: lines = in_file.readlines() service_needed = Utils.findServices(lines)...
true
730b5f47c49a785f5fbb42a8c16b8f6c78d59e96
Python
jakovlev-fedor/tms_python_fedor_jakovlev
/02_lesson/08_conditional_operators.py
UTF-8
2,456
3.6875
4
[]
no_license
"""""" """ --------------------------------- 1. Используя функцию > придумать: 3 примера когда результат будет равен True 3 примера когда результат будет равен False """ print('#01---------------') print(100 > 1) print(1000 > 100) print(1 > 0.1) print(1 > 100) print(100 > 1000) print(0.1 > 1) print() """ ----...
true
7be137826000637cf30560c358f517bdac31d517
Python
BeardedPlatypus/thesis-data
/scripts/light_exporter.py
UTF-8
6,640
3.375
3
[]
no_license
import os import bpy from enum import Enum # ----------------------------------------------------------------------------- # Supporting classes class LightType(Enum): """ Enum representing the different possible options for light types. """ PointLight = 1 class Position(object): ...
true
85234483ae32d59ee23afd03484258e76fd67601
Python
sapnanil7/IOT_Projects
/firstdemo.py
UTF-8
159
2.875
3
[]
no_license
print("This is our First Demonstration on Security using CV and IOT") a=2+3 print(a) print("Our First Project") print("HEllo World") print("HI") print("Jio")
true
dc2c4c9f0c1fabb637cddb20b76b3ddfce360773
Python
dr-dos-ok/Code_Jam_Webscraper
/solutions_python/Problem_97/556.py
UTF-8
335
2.796875
3
[]
no_license
c, C = 0, int(input()) while c != C: c += 1 A, B = input().split() L = len(A) a = len(set( (n,n[i:]+n[:i]) for n in map(str,range(int(A),int(B)+1)) for i in range(1,L) if n<n[i:]+n[:i]<=B )) print("Case #%d:" % c, a) ...
true
f94219345fc4beaf95bc13209d31db914e4fade1
Python
shincap8/holbertonschool-machine_learning
/supervised_learning/0x08-deep_cnns/test.py
UTF-8
229
2.9375
3
[]
no_license
#!/usr/bin/env python3 con = 0 linesB = {hash(line) for line in open('intranet.txt')} for line in open('output.txt'): if hash(line) not in linesB: print('line: {}'.format(con)) print('diferente') con += 1
true
25ccd0ad8bd28b4f47715d0c94940b06cbd6bfc8
Python
tetrismegistus/minutia
/exercises/guided_tutorials/advent17/16_1.py
UTF-8
1,284
3.25
3
[]
no_license
def load_steps(filename): with open(filename) as f: file = f.read().strip('\n').split(',') steps = [] for instruction in file: step = [instruction[0]] + instruction[1:].split('/') steps.append(step) return steps def spin(string, number): index = -(number % ...
true
e84a4efc0de6f36494c6a9e9f2c9a47072f5cbcd
Python
Eric-Wonbin-Sang/CS110Manager
/2020F_hw5_submissions/liethan/ethanlip95.py
UTF-8
501
4.09375
4
[]
no_license
#1 def numberlist(): ui = input("Enter a list of numbers. Please put a space between each number ") List = list(int(num) for num in ui.strip().split()) for i in range(len(List)): List[i] = List[i] ** 2 print(List) numberlist() #2 def numberlist2(): print("\n") ui2 = input("Enter a list ...
true
28ca058acf45ea186c624619a162f4a683333f1f
Python
Conan1985/facial-landmarks
/facial_landmarks.py
UTF-8
1,125
2.59375
3
[]
no_license
from imutils import face_utils import argparse import imutils import dlib import cv2 argsParser = argparse.ArgumentParser() argsParser.add_argument("-p", "--shape-predictor", required=True) argsParser.add_argument("-i", "--image", required=True) args = vars(argsParser.parse_args()) detector = dlib.get_frontal_face_de...
true
a4aea4af7c467cc9258c8aa2694bd1e8e9c5caad
Python
pereverges/EXC-MapReduce-using-Hadoop-Streaming
/task3/combiner2.py
UTF-8
1,026
3.578125
4
[]
no_license
#!/usr/bin/env python2 # Combiner in: [decade:int|genre:str|averageRating:float|primaryTitle:str] out: [decade:int|genre:str|averageRating:float|primaryTitle:str] [decade:int|genre:str|title:str] import sys last_decade = None last_genre = None # Since the input comes ordered we ouput the best title of each genre and ...
true
144be9caf117e0b1464e6b2be369a789a18f836b
Python
bschweiz/codewars
/python/unique_in_order.py
UTF-8
216
3.171875
3
[]
no_license
# my solution def unique_in_order(iterable): unique = [] for i in iterable: if len(unique) < 1 or i != unique[len(unique) - 1]: unique.append(i) return unique
true
a62309cb3906eaa1c35ce6a653f9d47cc14c9643
Python
manno23/Discrete-Optimisations
/coloring/colouring.py
UTF-8
5,520
2.84375
3
[]
no_license
#!/usr/bin/python # -#- coding: utf-8 -*- from ortools.constraint_solver import pywrapcp def readData(input_data): # Read in the file lines = input_data.split('\n') first_line = lines[0].split() node_count = int(first_line[0]) edge_count = int(first_line[1]) edges = [] for i in range(1...
true
5528fc0a757fd6428aa8c9c076cbc1dadbaa2df7
Python
Kurolox/AdventOfCode17
/Python/12/part2.py
UTF-8
600
3.1875
3
[]
no_license
def check_childrens(node): """Check each clild of a node.""" for child in id_dict[node]: if child not in zero_list: zero_list.append(child) check_childrens(child) id_dict = {} group_list = [] with open("input") as the_input: for line in the_input: id_dict[int(line....
true
c3188ec12412f2e86807751330af87dd9c8266fd
Python
bhumadhi/MyPythonFolder
/Queue.py
UTF-8
1,849
4.1875
4
[]
no_license
# -*- coding: utf-8 -*- """ Created on Fri May 3 10:39:48 2019 @author: bhuwan.madhikarmi """ """Make a Queue class using a list! Hint: You can use any Python list method you'd like! Try to write each one in as few lines as possible. Make sure you pass the test cases too!""" class Element(object): ...
true
b6ce2652ee9fb01a7a06c25338b5c0adbe1081fa
Python
RemcoWalsteijn/PythonCursusBlok1
/PythonLes5/pe5_5.py
UTF-8
231
3.375
3
[]
no_license
def gemiddelde(): willekeurigezin = input('Vul alstublieft een willekeurige zin in: ') woorden = willekeurigezin.split() gemiddeld = sum(len(woord) for woord in woorden) / len(woorden) print(gemiddeld) gemiddelde()
true
9c6d9cf1dd0152c25ebbcd6ce6b4058bed76b2cb
Python
mlz000/Algorithms
/leetcode/72.py
UTF-8
508
2.59375
3
[]
no_license
class Solution(object): def minDistance(self, s, t): n, m = len(s), len(t) dp = [[10**6] * (m + 1) for i in xrange(n + 1)] for i in xrange(n + 1): dp[i][0] = i for j in xrange(m + 1): dp[0][j] = j for i in xrange(1, n + 1): for j in xrange(1, m + 1): ...
true
5d3ee1defe26787b2b5e4a067ce1d2e67b4ee7f0
Python
deltaori0/Python-Algorithm
/programmers/완전탐색/소수찾기.py
UTF-8
740
3.625
4
[]
no_license
import itertools def is_prime(n): if n < 2: return False for i in range(2, n): if n % i == 0: return False return True def solution(numbers): # numbers 문자열을 각각의 문자로 분리 # permutation # int로 바꾸기 (맨 앞에 0인 애들은 자동으로 똑같이 되겠지?) # set을 이용해서 고유 숫자 뽑아내기 # 소수 찾기 함...
true
e851f987bf8b35f178c3828e8ce86fbde89fa415
Python
AlanJYLi/leetcode_practice_python
/week_14/2020_08_17.py
UTF-8
4,102
3.1875
3
[]
no_license
# 361. Bomb Enemy class Solution: def maxKilledEnemies(self, grid: List[List[str]]) -> int: if grid == []: return 0 r = len(grid) c = len(grid[0]) dp_l = [[0] * c for _ in range(r)] # 'e' on the left dp_r = [[0] * c for _ in range(r)] # 'e' on th...
true
bcfe72fd485934bf105373fa7b6931b795f1a66e
Python
bhuveshgautam/codeforcomp
/.gitignore/code1.py
UTF-8
786
2.9375
3
[]
no_license
n = int(input()) for x in range(0, n): numPeople = int(input()) assert(numPeople >= 2) A = input() AiList = A.split() for i in range(0,len(AiList)) : AiList[i] = int(AiList[i]) day = 0 people = 1 peoplek=0 peoplej=0 while(people < numPeople): ...
true
863754f46bfa179b5c5283a81d106d86949d0c6b
Python
Kamata-kun/Nomads
/03_18_occurrence.py
UTF-8
448
4.71875
5
[]
no_license
''' Write a script that takes a string from the user and creates a dictionary of letter that exist in the string and the number of times they occur. For example: user_input = "hello" result = {"h": 1, "e": 1, "l": 2, "o": 1} ''' user_string = input("Please enter a string of characters!\n: ") new_dict = {} for i i...
true
5e5dbd7307d791833b9d5842c2cc85f8d3c2b9bb
Python
euriion/code_snippets
/datafeed/wikipedia_pagecount/wikipeida_pagecount.puller.py
UTF-8
5,606
2.59375
3
[]
no_license
__author__ = 'aiden.hong' import os import urllib import re import gzip from optparse import OptionParser class WikipediaPVImpoter: website_path_prefix = "http://dumps.wikimedia.org/other/pagecounts-raw" base_archiving_directory = "/data/aiden.hong/feeding/wikipedia_pagecount" origin_filelist = [] delimiter =...
true
059825c5efa74326d469095b5a882d1a35a2132a
Python
DT021/data_structures_and_algorithms
/sorting/merge_sort.py
UTF-8
795
3.4375
3
[]
no_license
def merge_sort(data): if len(data) > 1: mid_point = len(data)//2 left = data[:mid_point] right = data[mid_point:] merge_sort(left) merge_sort(right) i,j,k = 0,0,0 while (i < len(left)) and (j < len(right)): if (left[i] < right[j]): ...
true
9e778ee0972cda7ea671057f8a386bcbd3892d84
Python
simrankaushik/pythonCodes
/BMI_calculator.py
UTF-8
183
3.609375
4
[]
no_license
h=input("enter the height: ") w=input("enter the weight: ") print(type(h)) print(type(w)) a=float(h) b=int(w) print(type(a)) print(type(b)) g= b/(a**2) c=round(g,2) print(c)
true
4e58fe5c2fe5d1e37534b95c4b4b702d78bf4067
Python
lxchavez/Yeezy-Taught-Me
/src/MSongsDB/Tasks_Demos/Lyrics/split_mxm_dataset.py
UTF-8
5,069
2.625
3
[ "GPL-1.0-or-later", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain", "CC-BY-NC-SA-2.0", "LicenseRef-scancode-proprietary-license", "MIT" ]
permissive
#!/usr/bin/env python """ Thierry Bertin-Mahieux (2011) Columbia University tb2332@columbia.edu This code splits the full musiXmatch dataset into train and test using the same split as for automatic tagging. This is part of the Million Song Dataset project from LabROSA (Columbia University) and The Echo Nest. http://...
true
445b9c4de5f3776fee019af6ecaff1cf0bd5d36f
Python
gsherwin74/PiFire
/distance_vl53l0x.py
UTF-8
1,771
3.09375
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
#!/usr/bin/env python3 # ***************************************** # PiFire vl53l0x Interface Library # ***************************************** # # Description: This library supports getting the hopper level from the distance sensor # # Install Dependancies: # # sudo apt install python3-smbus # sudo pip3 inst...
true
666dc909e03fac1ef8abf35ae5e6fde6b1efb52d
Python
Brainsucker92/friday_finder
/friday_finder.py
UTF-8
870
3.921875
4
[]
no_license
#!/bin/python3 import datetime class FridayFinder: def __init__(self, date): self.__date = date def get_days_to_friday(self): weekday = self.__date.weekday() return (4 - weekday) % 7 def get_next_friday(self): days_to_friday = self.get_days_to_friday() ...
true
fdf1c365100b858b3e0466516f46059c0ad6a811
Python
flashlightli/math_question
/leetcode_question/mid_question/402_Remove_K_Digits.py
UTF-8
626
3.25
3
[]
no_license
class Solution: def removeKdigits(self, num: str, k: int) -> str: stack = [] # 栈的知识 remain = len(num) - k for i in num: # 数字从左到右 最左边的数字小 数字整体才会小 # 从左到右遍历 比栈最后一个数字小的话替换栈最后一个数字 可移除的个数减一 直到移除的数字达到限制 while k and stack and stack[-1] > i: stack....
true
fac8381df87c4837fa5fcc76518b624c0f44fda9
Python
q2git/JsApp
/01_OrderLog/server/singleinstance.py
UTF-8
1,800
3.21875
3
[]
no_license
# -*- coding: utf-8 -*- """ http://outofmemory.cn/code-snippet/1494/ python使用Mutex保证程序只有一个实例运行 在开始时,程序创建了一个命名的mutex,这个mutex可以被其他进程检测到。 这样如果程序已经启动,再次运行时的进程就可以检测到程序已运行, 从而不会继续运行。 """ from win32event import CreateMutex from win32api import CloseHandle, GetLastError from winerror import ERROR_ALREADY_EXISTS class s...
true
9b98c8ebdbda0be9bc48979404339fae1d16427d
Python
Wal1d/MovieReview
/api/api.py
UTF-8
588
2.6875
3
[ "Apache-2.0" ]
permissive
import flask from flask import jsonify, request from utils import predictReview app = flask.Flask(__name__) app.config["DEBUG"] = True @app.route('/', methods=['GET']) def home(): return "<h1>mMvie review sentiment classification</h1><p>This is a test, call /predict.</p>" @app.route('/predict', methods=['GET...
true
78241b18d5c0505a6e3b140dfe3c5a3733296df4
Python
zerorock1312/lt-maker-master
/app/engine/skill_system.py
UTF-8
16,733
2.90625
3
[ "MIT" ]
permissive
class Defaults(): @staticmethod def can_select(unit) -> bool: return unit.team == 'player' @staticmethod def check_ally(unit1, unit2) -> bool: if unit1 is unit2: return True elif unit1.team == 'player' or unit1.team == 'other': return unit2.team == 'playe...
true
d6190b88947363b9be1cb78c4bffe11abcc93f90
Python
Francisco-HI/mecatronica
/creditos.py
UTF-8
1,253
3
3
[]
no_license
""" Nombre: dashboard.py objetivo: Construye el menu principal de la aplicacion de base de datos Autor: Jose Francisco Garcia Fuentes Fecha: 10 de octubre de 2019 """ #cramos clase from tkinter import * from tkinter import ttk from tkinter import messagebox #Enlazar otro archivo y extrar una clase from ins...
true
666f490a11bb81dd3ea012874e1f4f465c713484
Python
AmaurX/duckietown-visualodo
/lib-visualodo/src/duckietown_visualodo/algo/data_plotter.py
UTF-8
9,349
2.578125
3
[]
no_license
from __future__ import division import matplotlib.pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure import cv2 import numpy as np from cv_bridge import CvBridge from sensor_msgs.msg import CompressedImage from match_filters import Histogr...
true
8ca0a31c800066a6d2cff5e3ccf0436ca8867887
Python
FrankYang3110/Simple_baidu_baike_spider
/Simple_baidu_baike/baike_spider/downloader.py
UTF-8
500
2.703125
3
[]
no_license
#!/usr/bin/env python # -*- coding:utf-8 -*- import requests from fake_useragent import UserAgent class Downloader(object): def __init__(self): self.headers = {'User-Agent': UserAgent().random} def down(self, url): if url is None: return None r = requests.get(url, headers...
true
65530345f183ee81b6eed0d0dd01bcfcfa78fa13
Python
PerilousApricot/WMCore
/src/python/WMCore/Services/TagCollector/XMLUtils.py
UTF-8
3,944
2.765625
3
[]
no_license
#!/usr/bin/env python #-*- coding: utf-8 -*- #pylint: disable= """ File : XMLUtils.py Author : Valentin Kuznetsov <vkuznet AT gmail dot com> Description: Set of utilities for RequestManager code """ from __future__ import (division, print_function) # system modules import re import cStringIO as StringIO impo...
true
3cdebe479f62bc52bd6956ddb935ab438ad96627
Python
fernandolobato/balarco
/clients/tests_models.py
UTF-8
1,707
2.875
3
[ "MIT" ]
permissive
from django.test import TestCase from .models import Client, Contact class ClientTestCase(TestCase): def setUp(self): Client.objects.create(name='Test Starbucks', address='Felipe Ángeles 225') Client.objects.create(name='Test OXXO', address='Reforma 190') def test_client_names(self): ...
true
46904e1d2fef802ce0d82a32bf8de2aa12413461
Python
LotusLine/filefetching
/pandas/main.py
UTF-8
2,440
4.15625
4
[]
no_license
import pandas as pd print('---------------------------------------------------------') #create a dictionary which contains information about fruits fruit_dict = {"Name":['Mango', 'Apple','Banana','Peach'], "Quantity": [1,4,8,12]} #create a dataframe df = pd.DataFrame(fruit_dict, index=['Series1','Series2','Series3',...
true
b3d9c098ba688e630a8f6dcb9a0ca80feb958c5d
Python
dysomni/Chladni-Laser
/src/timer.py
UTF-8
796
2.703125
3
[]
no_license
####################################################################################################################### # timer.py # # Simple timer class that is currently not being used. Meant to stop people from accidentally taking multiple pictures # # Created by James Brock for Scott Hawley's Physics for AET class ...
true
013484635dc05ebfac74753b52112bfee314d4d0
Python
redwingsdan/python-tests
/diceroll.py
UTF-8
368
3.625
4
[]
no_license
import random def start_dice_roll(): min = 1 max = 6 roll_again = 'yes' while roll_again == 'y' or roll_again == 'yes': diceroll = random.randint(min, max) print('Roll 1: ' + str(diceroll)) diceroll = random.randint(min, max) print('Roll 2: ' + str(diceroll)) rol...
true
2ad9373b1ec5ed88421c756e3333e6d8444fd5f1
Python
Slangoij/PlayData_Algorithm_Study
/알고리즘 스터디 1차/03.서울에서 김서방 찾기.py
UTF-8
170
3.03125
3
[]
no_license
def solution(seoul): for idx,i in enumerate(seoul): if(i=='Kim'): answer='김서방은 '+str(idx)+'에 있다' break return answer
true
6753c1f6656f9c9dd1d47162978de21e592100e0
Python
nurjanat/winx_club
/bbb.py
UTF-8
304
3.328125
3
[]
no_license
# list1 = [1,2,3,4,5] # i = 0 # result = 0 # while i < len(list1): # result = result + list1[i] # i = i + 1 # print(result) # x = 9 # list1 = [1,2,3,4,5,6,7,8,9,9,9] # i = 0 # count_9 = 0 # while i < len(list1): # if list1[i] == x: # count_9 +=1 # i = i + 1 # print(count_9)
true
52582f17e8a6d4005d0714ab631bc05164f544dc
Python
Harshahg20/color-recognition-in-an-image
/colorDetection.py
UTF-8
5,547
3.1875
3
[]
no_license
import cv2 import numpy as np import pandas as pd import os import shutil import sys # Stores every drive connected on PC in a list. drives = [chr(x) + ':' for x in range(65, 90) if os.path.exists(chr(x) + ':')] # Lists each folder and file present in the current working directory def listDirectories(): listdir =...
true
487e1b65563ee4502403216662ee64a4f119d78b
Python
DmytroLopushanskyy/lab11_part2
/polynomial/polynomial.py
UTF-8
5,656
3.671875
4
[]
no_license
""" Implementation of the Polynomial ADT using a sorted linked list. """ class Polynomial: """ Create a new polynomial object. """ def __init__(self, degree=None, coefficient=None): """ Polynomial initialisation. :param degree: float :param coefficient: float ""...
true
d487d12137f629169affef0f458ff840103c2039
Python
thydungeonsean/Shinar_Genesis
/src/data_structures/dijkstra_map.py
UTF-8
899
3.59375
4
[]
no_license
class DijkstraMap(object): def __init__(self, parent_map): self.parent_map = parent_map def spread(self, match_value): edge = set() for point in self.parent_map.get_all(match_value): self.add_neighbours(point, edge, match_value) return edge def add_neigh...
true
38f1b04d0ae3a6460ca90376a55656492cb4d75a
Python
ReubenGoodridge/Space-Invaders
/Space Invaders.py
UTF-8
4,211
3.359375
3
[]
no_license
import turtle from turtle import Turtle, Screen import math import random import winsound import time # Define Globals player = Turtle() wn = Screen() score = 0 scorestring = 'Score: %s' %score # Register Graphics turtle.register_shape('enemy.gif') turtle.register_shape('player.gif') wn.setup(700, 7...
true
9ced1f5b77e914cd183e9010fc22cf83a896027a
Python
LifeMoroz/ES1
/logic.py
UTF-8
1,265
2.78125
3
[]
no_license
from models import Question, Answer, Actor, Link def print_question(question: Question) -> Answer: print(question.text) result_dict = {} for i, a in enumerate(question.get_answers(), 1): print("{}) {}".format(i, a.text)) result_dict[i] = a while 1: try: s = int(inp...
true
0217f7f9b2e641302fdefdf9b70a94fb74e545c2
Python
UCSD-SEELab/ContextEngine27
/test/DStreamIITest.py
UTF-8
3,067
2.6875
3
[]
no_license
import csv import datetime import math import numpy as np import sys, os import pickle import time ## Append the paths to your algorithms here. sys.path.insert(1, os.path.join(sys.path[0], '../python/D-StreamII')); sys.path.insert(1, os.path.join(sys.path[0], '../python')); ## Import your algorithms here....
true