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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
e73ae82d3026f03fe0b18ec32ac02a8f54d425cc | Python | ValDagon/computer-switch | /server.py | UTF-8 | 602 | 2.71875 | 3 | [
"MIT"
] | permissive | import socket
SERVER_ADDRESS = ('192.168.56.1', 8686)
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.bind(SERVER_ADDRESS)
server_socket.listen(1)
print("Server is running")
while True:
connection, address = server_socket.accept()
message = connection.recv(1024)
if str(m... | true |
9c486ec84fc0a3cc914faf715b312de5c56c8890 | Python | phamvankien/pypowersystem | /methods/cSimulation.py | UTF-8 | 3,722 | 2.65625 | 3 | [] | no_license | #Libraries
from scipy.sparse.linalg import inv
from scipy.sparse.linalg import spsolve
from scipy.sparse import identity
from scipy.sparse import hstack
from scipy.sparse import vstack
from scipy.sparse import csc_matrix
from numpy import r_
from numpy import zeros
from numpy import empty
from numpy import Inf
from nu... | true |
2c61bff48777b4342bf44acc6a23f1a724d6f945 | Python | kmcclean/PressYourBuncoLuck | /src/Players.py | UTF-8 | 696 | 3.359375 | 3 | [] | no_license | # this class holds all of the information on the players.
class Players:
def __init__(self, name, rounds_won, points_this_round, is_computer):
self.player_name = name
self.rounds = rounds_won
self.points = points_this_round
self.is_comp = is_computer
# This increases the numbe... | true |
5a739bf4769943f35f477d6488b225c4248b4923 | Python | hakanmhmd/messenger_bot | /messengerbot/bot.py | UTF-8 | 4,686 | 2.515625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import os
import requests
import apiai
import json
from sys import argv
from wit import Wit
from bottle import Bottle, request, debug
from dotenv import load_dotenv
# Setup Bottle Server
debug(True)
app = Bottle()
# Facebook Messenger GET Webhook
@app.get('/webhook')
def messenger_webhook():
... | true |
8dc1aeb75e88323f7be38163f737458e5e7a21c6 | Python | CaesarZhang070497/audios | /wavenet/decoder.py | UTF-8 | 7,436 | 2.8125 | 3 | [] | no_license | from itertools import product
from typing import List, Optional
import torch
from torch import nn
from torch.nn import functional as F
from tqdm import trange
from .modules import BlockWiseConv1d, DilatedQueue
class WaveNetDecoder(nn.Module):
"""
WaveNet as described NSynth [http://arxiv.org/abs/1704.01279]... | true |
3e0da2e2699ec60bf41ebdf072838ac3b4163c8c | Python | DaHuO/Supergraph | /codes/CodeJamCrawler/16_0_1_neat/16_0_1_Kiiwi_a.py | UTF-8 | 639 | 3.015625 | 3 | [] | no_license | file = open('A-large.in')
out = open('output.in', 'w')
T = int(file.readline().strip())
case = 1
for cases in range(T):
input_line = file.readline().strip().split(" ")
N = int(input_line[0])
digit_list = []
i = 1
while len(digit_list) < 10:
n = N*i
if n == 0:
... | true |
ac8fc701cc95a5f76ed9de7987ed601e1990e8c7 | Python | Sahanave/Millionsongdataset_UCI | /Part-2.py | UTF-8 | 2,076 | 2.796875 | 3 | [] | no_license |
# coding: utf-8
# In[3]:
#import the libraries
import pandas
from pandas.tools.plotting import scatter_matrix
import matplotlib.pyplot as plt
from sklearn import cross_validation
from statistics import mode
from sklearn.linear_model import SGDRegressor
from sklearn.linear_model import Ridge
from sklearn.linear_model... | true |
9fdafc26664d41cfb5a8f1696626363704309cf8 | Python | Erick-rick/Python | /Exercicios II/Ex_01.py | UTF-8 | 144 | 3.484375 | 3 | [] | no_license | print ('**-- Conta de Luz --**')
cl = int(input ('Digite o valor da conta de luz :'))
if (cl > 50):
print ('Você esta gastando muito!')
| true |
1565c55ec5fb3e17adb280790dc6237751b082c2 | Python | monci07/AI | /Primer bloque/1249134_primerEje.py | UTF-8 | 578 | 3.875 | 4 | [] | no_license | #funcion que invierte la lista
def rev(lista):
reversa = []
#el ciclo empieza en el ultimo elemento de la lista, para ir decrementando mientras sea mayor a -1
for i in range(len(lista)-1, -1, -1):
reversa.append(lista[i])
return reversa
lista1=[]
listaR=[]
bandera = 's'
#se empiezan a tomar dat... | true |
a6b24b10fc3650e2e65e2c9cf5a500c97fb39fd0 | Python | rzwck/c1-form-reader | /read-C1-form.py | UTF-8 | 20,438 | 2.546875 | 3 | [] | no_license | import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
import warnings
warnings.filterwarnings("ignore")
import matplotlib.image as mpimg
import numpy as np
import cv2
from pyimagesearch import *
from keras.models import load_model
def read_box(window):
# input image is black over white background
... | true |
48bd6197674262811f0e2c7a3f639aa72293b41e | Python | 6564200/Channel4-TV-Prog | /doctoxml.py | UTF-8 | 3,307 | 3.015625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import os
import sys
import re
from datetime import datetime
import xml.etree.cElementTree as ET
month = (('января', '1'), ('февраля', '2'), ('марта', '3'), ('апреля', '4'), ('мая', '5'), ('июня', '6'), ('июля', '7'), ('августа', '8'), ('сентября', '9'), ('октября', '10'), ('ноября', '... | true |
7425bb4c2c7077b8037d080c073c559834c4e1be | Python | johntomyang/stockopr | /selector/plugin/dynamical_system.py | UTF-8 | 1,629 | 2.6875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import pandas as pd
from util.macd import macd
from util.macd import ema
def function(ema_, macd_):
if ema_ and macd_:
return 1
if not ema_ and not macd_:
return -1
return 0
def dynamical_system(quote, n=13):
ema13 = ema(quote['close'], n)['ema']
# ema... | true |
081995cb84d92813f5117283b373d3446242d212 | Python | ylee22/labeler_project | /media/post_file_upload.py | UTF-8 | 338 | 2.765625 | 3 | [
"MIT"
] | permissive | import requests
import os
def upload_file(filename):
url = 'http://localhost:8000/images/'
local_path = os.getcwd()
with open(filename, 'rb') as file:
file_data = {'file': (filename, file), 'file_name': filename}
resp = requests.post(url, files = file_data)
print(resp)
upload_fi... | true |
fbf698d362102c1e1c27c3128f7080c27c068b95 | Python | jfriedly/foreign-currency | /create_country.py | UTF-8 | 3,634 | 3.171875 | 3 | [] | no_license | #!/usr/bin/env python
import argparse
import os
import sys
import constants
import models
def parse_args():
description = ("Add a new country to the collection, creating all the "
"metadata.")
argparser = argparse.ArgumentParser(description=description)
argparser.add_argument("short_na... | true |
4768a3d3ce5ce6c08d7de73e4593fa311aef9c9f | Python | EmilyStohl/ProjectEuler | /21-40/P27.py | UTF-8 | 574 | 3.171875 | 3 | [] | no_license | # Project Euler - Problem 27
# 1/10/17
import math
def TestPrime(n):
Top = math.ceil(math.sqrt(n))
for i in range(2,int(Top)+1):
if n%i == 0:
return False
return True
MaxN = 0
MaxA = -2000
MaxB = -2000
for a in range(-999, 1000):
for b in range(-1000, 1001):
Stop = False
n = 0
while Stop == False:
... | true |
201aab77ddc33788e59c7c02938d5aadb555fbc4 | Python | clemigg/INF8808_Projet | /Source/helper.py | UTF-8 | 2,284 | 2.84375 | 3 | [] | no_license | '''
This file contains some helper functions to help display the map.
'''
import plotly.graph_objects as go
def adjust_map_style(fig):
'''
Sets the mapbox style of the map.
Args:
fig: The current figure
Returns:
fig: The updated figure
'''
fig.update_la... | true |
a6818c5b873f3fa9173b9ec52d50bf028ef3d225 | Python | azakimi123/Python | /flower.py | UTF-8 | 195 | 3.703125 | 4 | [] | no_license | import turtle
import math
bob = turtle.Turtle()
bob.color("red", "yellow")
bob.speed(10)
bob.begin_fill()
for i in range(50):
bob.forward(200)
bob.left(168.5)
bob.end_fill()
turtle.done() | true |
3acd8780955897049b51d620742901cff47b0785 | Python | dennisnderitu254/CodeCademy-Py | /chapter_08_Taking_a_Vacation/16_Paying_Up.py | UTF-8 | 333 | 3.546875 | 4 | [] | no_license | def hotel_cost(nights):
return nights * 140
bill = hotel_cost(5)
def add_monthly_interest(balance):
return balance * (1 + (0.15 / 12))
def make_payment(payment, balance):
balance = add_monthly_interest(balance - payment)
print "You still owe:", balance
return balance
print make_payment(bill / 2 ... | true |
7cd3f94c63144251bb32bcde0422a2b7534492db | Python | kojh0111/Data-Structure-and-Algorithms | /10_Binary_Search/1300.py | UTF-8 | 455 | 3.5625 | 4 | [] | no_license | """
- K번째 수
이분탐색 문제/ 각 열별로 mid보다 작은 수 갯수를 파악하여 k보다 많아지면 답 출력
"""
import sys
input = sys.stdin.readline
N = int(input())
k = int(input())
left = 1
right = k
while left <= right:
mid = (left + right) // 2
cnt = 0
for i in range(1, N + 1):
cnt += min(mid // i, N)
if cnt < k:
left = mid +... | true |
a567d445fd5560ec97bef9dffed71d95bedb404d | Python | ElChurco/Introprogramacion | /Grafica/Clase_2.py | UTF-8 | 500 | 3.640625 | 4 | [] | no_license | Ax = int(input("Ingrese un numero para Ax: "))
Ay = int(input("Ingrese un numero para Ay: "))
Bx = int(input("Ingrese un numero para Bx: "))
By = int(input("Ingrese un numero para By: "))
Cx = int(input("Ingrese un numero para Cx: "))
Cy = int(input("Ingrese un numero para Cy: "))
base = Cx - Ax
altura = By - Ay
impor... | true |
dcaf28137a2d41d14feab9257c00934766b683ae | Python | 5l1v3r1/mr_london | /app/model/textgen.py | UTF-8 | 5,514 | 2.953125 | 3 | [] | no_license | import pickle
import numpy as np
class LiteTextGen:
def __init__(self, fn=None):
self.maxlen = 20
self.generated = ''
self.primer = "I want to have a big"
self.LSTM = LiteLSTM()
if fn is None:
fn = "app/model/lstm_weights.pkl"
self.load_model(fn)
def load_model(self, fn):
[weights, meta] = pickle.... | true |
36d59ac3249af68b210cf0a0cea088b7a6ca6dff | Python | optimusMY/PYTHON | /TkinterExamples/loginpage.py | UTF-8 | 2,033 | 3.109375 | 3 | [] | no_license | from tkinter import * # note that module name has changed from Tkinter in Python 2 to tkinter in Python 3
from tkinter import messagebox
import tkinter
# creating a window
wnd = Tk()
wnd.geometry("300x100")
label_1 = Label(wnd, text="Name")
label_2 = Label(wnd, text="Password")
entry_1 = Entry(wnd)
entr... | true |
7f91122ca1353c7938198324b9b633232268541c | Python | LauraBritoMedina/EyeTracking_DimRed_SmartFlat | /Random_Forest.py | UTF-8 | 5,173 | 3.109375 | 3 | [] | no_license | """
===================================================
Random Forest
===================================================
Applies random forest to the data in path:
Inputs:
path: Folder containing features
a : Index of the data to preprocess. It can be:
0 = Initial Calibration
1 = Final Cal... | true |
3cfb6073d8bf213c167ba27752288f8b5ba10c4d | Python | hemanthgr19/practise | /sumof arr.py | UTF-8 | 116 | 3.078125 | 3 | [] | no_license | def _sum(arr,n):
return (sum(arr))
arr = []
arr = [12,3,56,23,78,42]
n = len(arr)
ans = _sum(arr,n)
print(ans) | true |
e17be6e38065793ee1c5769ddffcfa3961a57a5c | Python | lacriment/Jordamach | /jordamach/app.py | UTF-8 | 4,363 | 2.890625 | 3 | [
"MIT"
] | permissive | import sys
from PyQt5 import QtCore
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox, QTableWidgetItem
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns; sns.set(color_codes=True)
from ui.design import Ui_MainWindow
from linear_regression import Regrezio
class App(QMainWindow... | true |
05c8ec32ce255a6ef1b0de6585100eb8eb2e7657 | Python | Keimoshi/Learing | /9.类/9-3.py | UTF-8 | 1,117 | 3.828125 | 4 | [] | no_license | class User():
def __init__(self, first_name, last_name, age, skill):
self.first_name = first_name
self.last_name = last_name
self.age = age
self.skill = skill
self.login_attempts = 0
def describe_user(self):
print(
"--------" + self.first_name + self.... | true |
d8bbceb3ba28bfddeaf18e6bc7c885431c387cde | Python | EoJin-Kim/CodingTest | /BFS/02CompetitiveInfection.py | UTF-8 | 792 | 2.96875 | 3 | [] | no_license | from collections import deque
n,k = map(int,input().split())
graph=[]
data=[]
for i in range(n):
graph.append(list(map(int,input().split())))
for j in range(n):
if graph[i][j] != 0:
data.append((graph[i][j],0, i, j))
s,x,y = map(int,input().split())
'''
n,k=3,3
graph=[[1,0,2],[0,0,0],[3,... | true |
88ad9de71cc641777e1035b602ebf5c2e06dc73e | Python | ashmorecartier/pyjunk | /src/Zbrac.py | UTF-8 | 6,057 | 3.28125 | 3 | [
"MIT"
] | permissive | #! /bin/env python3
# -*- coding: utf-8 -*-
################################################################################
#
# This file is part of PYJUNK.
#
# Copyright © 2021 Marc JOURDAIN
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated doc... | true |
e5ac3ca3af1b173570d5c68178628409ec19d6e2 | Python | CNLiiserp/CA3bouton | /vdcc_dat/genStimVid.py | UTF-8 | 1,358 | 2.59375 | 3 | [] | no_license | from pylab import *
# Note: stimuli are 5 ms wide.
n = 20 # n = number of pules in tetanic pulse
nBurst = 2 # number of bursts
isi = 10e-3 # isi = Inter-Spike Interval in burst
ibi = 5 # inter-burst internal (sec)
infile=[0]*9
outfile=[0]*9
infile[0]="VDCC_PQ_C01.dat"
infile[1]="VDCC_PQ_C10.dat"
infile[2]="VDC... | true |
20dbacad7bd4d5d763a4d08e1a244fbf4bee5e1f | Python | Rafsun83/Python-Basic-practice-Code-With-OOP | /pytest.py | UTF-8 | 183 | 2.90625 | 3 | [] | no_license | import pytest
@pytest.mark.one
def test_method1():
x = 10
y = 20
assert x == y
@pytest.mark.two
def test_method2():
a = 20
b = 15
assert a == b+5
| true |
0d8f22a63a5f28a2ee356b8843efa9d135142511 | Python | wkentaro/effective-python | /chapter5/0039_thread_cooperation/sample2.py | UTF-8 | 563 | 2.515625 | 3 | [] | no_license | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from Queue import deque
from Queue import Queue
import time
from threading import Lock
from threading import Thread
def main():
queue = Queue()
def consumer():
print('Consumer waiting')
... | true |
4ccae33d43c0a8d04e71dc447288afb1ee70f3ef | Python | ptsiampas/Exercises_Learning_Python3 | /12_Modules/Exercise_12.11.7.py | UTF-8 | 465 | 3.5 | 4 | [] | no_license | from unit_tester import test
def myreplace(old, new, s):
""" Replace all occurrences of old with new in s. """
if old == " ":
return new.join(s.split())
return new.join(s.split(old))
test(myreplace(",", ";", "this, that, and some other thing"),
"this; that; and some other... | true |
464da1f0054ec13f521918dc212374add49631d3 | Python | physcode/capitainterview | /joinscript.py | UTF-8 | 2,140 | 3.46875 | 3 | [] | no_license | ##Script written in Python3 - Nikolaos Palamidas##
def LEFTJOIN(Lfilename,Rfilename,LEFT_ON,RIGHT_ON,destination,delimiter = ","):
"""Takes arguments of a file name for the left and right tables
(in working directory). Left joins according to the LEFT_ON and RIGHT_ON columns of each specified by zero inde... | true |
1e9a383d814c3724d7194c175eaa543959cadfcc | Python | monini13/NucleiSegmentationAI | /gui.py | UTF-8 | 3,721 | 2.53125 | 3 | [] | no_license | import tkinter as tk
from tkinter import *
from tkinter import filedialog
import os
from PIL import Image, ImageTk
from predict import predict, get_actual_mask
from scipy.io import loadmat
import matplotlib.pyplot as plt
import numpy as np
class Window(Frame):
def __init__(self, weights_path, master=None):
... | true |
2688632cebd70d447b46da4738d33a6c270d5b60 | Python | feliciahsieh/holbertonschool-higher_level_programming | /0x03-python-data_structures/5-no_c.py | UTF-8 | 147 | 3.0625 | 3 | [] | no_license | #!/usr/bin/python3
def no_c(my_string):
n = ""
for x in my_string:
if x != 'c' and x != 'C':
n = n + x
return(n)
| true |
3a927b053ea3ecb83d1b941be27a72431f10f78d | Python | gdfelt/competition | /euler/python3/euler007.py | UTF-8 | 392 | 3.921875 | 4 | [] | no_license | #!/usr/bin/env python3
"""
Project Euler Problem 7
=======================
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see
that the 6th prime is 13.
What is the 10001st prime number?
"""
import utils
def main():
p_count = 0
num = 1
while p_count < 10001:
num +=1
if utils.is_prime(... | true |
bf1fffad2fd1f28181a83fe31352c58ab53b9c31 | Python | Noverish/Face-Recognition | /src/extraction/__init__.py | UTF-8 | 822 | 2.828125 | 3 | [] | no_license | import os
def extract(input_path):
input_path = os.path.abspath(input_path)
image_paths = []
labels = []
person_names = sorted([x for x in os.listdir(input_path) if os.path.isdir(os.path.join(input_path, x))])
for i in range(len(person_names)):
person_name = person_names[i]
pers... | true |
52ed2e0c7f94bc60e699ea15838178a7eed0c65f | Python | Gitikameher/Emotion-classification | /data_loader.py | UTF-8 | 1,629 | 3.59375 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 10 17:31:49 2019
@author: meher
"""
from os import listdir
from PIL import Image
import numpy as np
# The relative path to your CAFE-Gamma dataset
data_dir = "./CAFE/"
# Dictionary of semantic "label" to emotions
emotion_dict = {"h": "happy", "ht": "ha... | true |
417f56cb5af06e3784bb33bddf1b1efb7647f204 | Python | incalia/schedy-client | /schedy/pbt.py | UTF-8 | 2,388 | 3.03125 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
#: Minimize the objective
MINIMIZE = 'min'
#: Maximize the objective
MAXIMIZE = 'max'
class Truncate(object):
_EXPLOIT_STRATEGY_NAME = 'truncate'
def __init__(self, proportion=0.2):
'''
... | true |
91253ec84fe1dcdbaaffb95f39338e8bde793233 | Python | PDXDevCampJuly/Nehemiah-Newell | /Python/Bank/Bank.py | UTF-8 | 2,334 | 3.484375 | 3 | [] | no_license | ###
# Defines the Bank
###
from Person import Person
class Bank(object):
"""Bank information stored here"""
def __init__(self):
self.customers = {}
self.vault = -10.00
self.savings_interest = .3
def new_customer(self, name, email):
self.customers[email] = Person(name, email)
def remove_customer(self, ema... | true |
32fb36b6bcd783a31dc7ebb20a2c48b7e1dfda58 | Python | davidvlaminck/OTLMOW | /src/OTLMOW/OTLModel/Datatypes/TimeField.py | UTF-8 | 3,937 | 2.875 | 3 | [
"MIT"
] | permissive | import logging
import random
from datetime import time, datetime, date
from OTLMOW.Facility.Exceptions.CouldNotConvertToCorrectTypeError import CouldNotConvertToCorrectTypeError
from OTLMOW.OTLModel.BaseClasses.OTLField import OTLField
class TimeField(OTLField):
"""Beschrijft een tekstregel volgens http://www.w3... | true |
88a87965df6f7089c0217116783c45aedffb054a | Python | jingong171/jingong-homework | /张庭康/2017310416张庭康金工17-1第四次作业/2017310416张庭康金工17-1第四次作业/作业1.py | UTF-8 | 611 | 4.4375 | 4 | [] | no_license | from random import randint
#导入模块random中生成随机数的函数
class Die():
"""打印位于1和骰子面数之间的随机数"""
def __init__(self,sides=6):
self.sides = sides
"""创建一个名为sides(面数)的属性"""
def roll_die(self):
print("面数为"+str(self.sides)+"的骰子投掷十次的结果为:",end=' ')
for i in range(10):
print(str(randint... | true |
9e7904301dc6474e8dc333a7ab4f5aa8914e9fbb | Python | holoviz/datashader | /datashader/layout.py | UTF-8 | 8,967 | 3.34375 | 3 | [] | permissive | """Assign coordinates to the nodes of a graph.
"""
from __future__ import annotations
import numpy as np
import param
import scipy.sparse
class LayoutAlgorithm(param.ParameterizedFunction):
"""
Baseclass for all graph layout algorithms.
"""
__abstract = True
seed = param.Integer(default=None, ... | true |
5985af30ebc10a5f053ac9966866553034bc285e | Python | alexaoh/algdat | /Exercise1/take_pieces.py | UTF-8 | 122 | 3.421875 | 3 | [] | no_license | def take_pieces(n_pieces):
for i in range(1,8):
if (n_pieces - i) % 8 == 1:
return i
return 2
| true |
0c72752f6c8f1044dee082c1bce65bbfb06ac9fc | Python | mmunar97/inPYinting | /inPYinting/algorithms/exemplar_based/exemplar_based_inpainting.py | UTF-8 | 11,317 | 2.640625 | 3 | [
"MIT"
] | permissive | import numpy
import sys
import time
from typing import List, Tuple
from inPYinting.algorithms.exemplar_based.exemplar_based_utils import *
from inPYinting.base.result import InpaintingResult
class ExemplarBasedInpainter:
def __init__(self, image, mask):
self.__image = image
self.__original_mask... | true |
8d300fa432ecb3899824c184669d8b9569d1bdb4 | Python | kproshakov/SudokuCV | /main.py | UTF-8 | 1,516 | 2.796875 | 3 | [
"MIT"
] | permissive | from SudokuCV import SudokuCV
import cv2
from tkinter import *
from tkinter import filedialog
from PIL import Image, ImageTk
class GUI(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
w,h = 400, 500
master.minsize(width=w, height=h)
master.maxsize(width=w, h... | true |
088a0fb4c0b57af11965ad91e87af83450bd29de | Python | terencesll/AdventOfCode | /2020/02a.py | UTF-8 | 567 | 3.109375 | 3 | [] | no_license | file = open("02.txt")
numValid = 0
for line in file:
tokens = line.split(":")
policy = tokens[0].split(" ")
policyMinMax = policy[0].split("-")
policyMin = int(policyMinMax[0])
policyMax = int(policyMinMax[1])
policyLetter = policy[1]
password = tokens[1].strip()
count = { policyLetter: ... | true |
e6ffb1fdba2715f233a2c98c251f8a468a42b994 | Python | cfvillalta/postdoc | /UID_in_HMM_out_domain.py | UTF-8 | 2,542 | 3.078125 | 3 | [] | no_license | #!/usr/bin/env python
#The purpose of this script was to put in a list of IDs from a phylogenetic tree branch and pull their sequecnes from a list of sequecnes I might have. The script then aligns those sequences with Clustal Omega and builds an HMM with the alignment.
import phylo_tools
import sys
import re
#list o... | true |
8ca6a7a0868efbd8da3e414e96191f107805b0a3 | Python | dcobas/adctest | /PAGE/Waveform.py | UTF-8 | 1,250 | 2.875 | 3 | [] | no_license | __author__ = "Federico Asara"
__copyright__ = "Copyright 2007, The Cogent Project"
__credits__ = ["Federico Asara", "Juan David Gonzalez Cobas"]
__license__ = "GPL2"
__version__ = "1.0.0"
__maintainer__ = "Federico Asara"
__email__ = "federico.asara@gmail.com"
__status__ = "Production"
from numpy import array
from Ite... | true |
47f8635b536fb7ad614874d5250f29811a2f619f | Python | PolinaAlexandr/python-numeric-types-exercise | /main_test.py | UTF-8 | 1,354 | 3.421875 | 3 | [] | no_license | import unittest
import main
class MainTest(unittest.TestCase):
def test_square_area(self):
self.assertEqual(main.square_area(5), 25)
def test_rectangle_area(self):
self.assertEqual(main.rectangle_area(3, 4), 12)
def test_triangle_area(self):
self.assertEqual(main.triangl... | true |
bd299caada8e0c8e526eb123af0a4eaf03f4e110 | Python | mlavarias/PFB2017 | /rnaseq/countingkmers.py | UTF-8 | 606 | 2.78125 | 3 | [] | no_license | import re
import sys
from Bio import SeqIO
kmer_length = 8
#sys.argv[1]
filename = sys.argv[1]
top_kmers = 10
# sys.argv[3]
kmerdict = {}
def count_kmers(kmerdict, sequence):
for i in range(0,len(sequence)-kmer_length+1):
kmer = sequence[i:i+kmer_length]
if kmer in kmerdict:
kmerdict[kmer] += 1
else:
k... | true |
a284b512112268f258fbe8c390a0e5286c0f9535 | Python | Natquuu/BirdClassification | /gmms/GMM5.py | UTF-8 | 3,771 | 2.796875 | 3 | [] | no_license | import numpy as np
from scipy.stats import norm
import scipy.stats as stats
import matplotlib.pyplot as plt
import matplotlib
def plot_distributions(data, data_sampled, mu, sigma, K, color="green", color_sampled="red", name='plot.png'):
matplotlib.rcParams['text.usetex'] = True
plt.rcParams.update({'font.size... | true |
78cb19d858d9bf3bfd2e14b1583873c04fdb1abb | Python | vlbos/bos.oracle-test | /oracle.testenv/test/airdropburn/unionset.py | UTF-8 | 2,941 | 2.78125 | 3 | [] | no_license | # coding:utf-8
import csv
import re
import json
airdrop_accounts_file = './dataset/accounts_info_bos_snapshot.airdrop.normal.csv'
airdrop_msig_accounts_file = './dataset/accounts_info_bos_snapshot.airdrop.msig.json'
nonactive_accounts_file = './dataset/nonactivated_bos_accounts.txt'
nonactive_msig_accounts_file = './da... | true |
3ba0eb687948eb4db2fe69d8b1aafc9d816ccfb5 | Python | goareum93/K-digital-training | /01_Python/07_string/string_trans.py | UTF-8 | 523 | 4.34375 | 4 | [] | no_license | # # replace()
#
# text = 'Java Programming'
# text = text.replace('Java', 'Python')
# print(text)
#
# # 대문자/소문자 변환
# # upper() lower() capitalize() title() swapcase()
# text = 'java programming is Fun'
# print(text.upper())
# print(text.lower())
# print(text.title())
# print(text.capitalize())
# print(text.swapcas... | true |
b55dbe1c09f1f37308ab23697e81fd9241f76adc | Python | robgoyal/BookSolutions | /PracticalProgramming/Chapter15/code_samples.py | UTF-8 | 450 | 3.4375 | 3 | [] | no_license | def double_preceding(values):
if values != []:
temp = values[0]
values[0] = 0
for i in range(1, len(values)):
double = 2 * temp
temp = values[i]
values[i] = double
def average(values):
count, total = 0, 0
for value in values:
if value ... | true |
493c343957b9e6ba6560ef8c8950083e77313792 | Python | kitakou0313/cracking-the-code-interview | /cracking-the-code-interview/chap3_3.py | UTF-8 | 1,534 | 3.65625 | 4 | [] | no_license | import unittest
# 固定版で実装
class MultiStack():
def __init__(self, capacity):
self.stacks = [[]]
self.capacity = capacity
def push(self, val):
if len(self.stacks[-1]) == self.capacity:
self.stacks.append([])
self.stacks[-1].append(val)
def pop(self):
hav... | true |
012955a73c2d0d14c1196f517ea076df37876a99 | Python | mdhvkothari/Python-Program | /leetCode/Single Number III.py | UTF-8 | 348 | 3.015625 | 3 | [] | no_license | class Solution:
def singleNumber(self, nums: List[int]) -> List[int]:
dict = {}
result= []
for num in nums:
if num in dict:
dict[num] +=1
else:
dict[num] = 1
for i in dict:
if dict[i] == 1:
result.app... | true |
554d6649ff94bd88b17fe2a56ab6b943e374f8fe | Python | biswasalex410/Python_1st_Part_Subeen_Book | /list add & multiplication operation.py | UTF-8 | 241 | 3.6875 | 4 | [] | no_license | li1 = [1, 2, 3]
li2 = [4, 5, 6]
li = li1 + li2
print(li)
li1 = [1, 2, 3]
li2 = li1 * 3
print(li2)
li = ["a", "b", "c"]
print(li)
str = "".join(li)
print(str)
str = ",".join(li)
print(str)
str = "-".join(li)
print(str) | true |
d3b72b72c5387ede0d708e9dc0d157a850209558 | Python | aelkikhia/portal | /portal/input/jsonstream.py | UTF-8 | 2,660 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive |
from portal.input.jsonep import JsonEventHandler, JsonEventParser
class JsonMessageHandler(object):
def header(self, key, value):
pass
def body(self, body):
pass
MESSAGE_ROOT = 1
class JsonMessageAssembler(JsonEventHandler):
def __init__(self, message_handler):
self.messag... | true |
4f9635d60dcda56f2e1bad747cf280facea897e2 | Python | christmo/zari | /functions/telegram/impl.py | UTF-8 | 8,223 | 2.515625 | 3 | [] | no_license | from services.sentimiento import Sentimiento
from telegram.productos import consultar_productos, menu_productos, promociones, validar_parametros_producto
from database.command import limpiar_carrito, pagar_carrito
from database.persitencia import save_shopping_car, save_tarjeta_usuario, save_usuario
from entities.df_co... | true |
014225a5be06a12304a51d388792de2dca7a911a | Python | big0ren/MalwareInvestigationTool | /Services/TimerCountDown.py | UTF-8 | 156 | 2.921875 | 3 | [] | no_license | import time
for t in range(120,-1,-1):
minutes = t / 60
seconds = t % 60
print "%d:%2d" % (minutes,seconds) # Python v2 only
time.sleep(1.0) | true |
a6cb4bd1c560abaad1a0deaffc2214891c6453fa | Python | aqlaboratory/openfold | /openfold/model/embedders.py | UTF-8 | 9,577 | 2.53125 | 3 | [
"Apache-2.0",
"CC-BY-4.0",
"LicenseRef-scancode-other-permissive",
"CC-BY-NC-4.0"
] | permissive | # Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | true |
476ac0415ea078851ddaf5e0a1af5e9d0c794735 | Python | AJaafer/1.Python-Tutorial-for-Beginners-Full-Course-2019 | /36.Return statement.py | UTF-8 | 64 | 2.859375 | 3 | [] | no_license | def square(number):
return number * number
print(square(9))
| true |
14cc623fd920cb20d689d5306a0f72ef6dc6d96b | Python | WPrendota/WordFrequencyFaster | /word_frequency_faster.py | UTF-8 | 1,771 | 3.359375 | 3 | [] | no_license | import time
from argparse import ArgumentParser
from OperationsOnLinesInDocument import OperationsOnLinesInDocument
from OperationsOnWordsInDocument import OperationsOnWordsInDocument
# Main function
def main(args):
if args.w:
if args.p:
oow = OperationsOnWordsInDocument(args.w, 'utf8')
... | true |
e67f358d4d81278dced18c52effc9650aad3c94c | Python | Pavlmir/python-basics-geekbr | /Lesson_2_types_and_operations/les_2_task2.py | UTF-8 | 946 | 4.4375 | 4 | [] | no_license | # 2. Для списка реализовать обмен значений соседних элементов, т.е.
# Значениями обмениваются элементы с индексами 0 и 1, 2 и 3 и т.д.
# При нечетном количестве элементов последний сохранить на своем месте.
# Для заполнения списка элементов необходимо использовать функцию input().
array = []
for i in range(1, 10):
... | true |
d9d381b1ecbc86e933c63274a9945fa8ba4e1914 | Python | shivasitharaman/python | /py3.py | UTF-8 | 116 | 3.625 | 4 | [] | no_license | num1 = 50
num2 = 3
div = int(num1) / int(num2)
print('The div of {0} and {1} is {2}'.format(num1, num2, div)) | true |
0e1fd7888fb2d3c6d5de7415812ab928d475006d | Python | apple/swift-lldb | /packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py | UTF-8 | 2,515 | 2.546875 | 3 | [
"NCSA",
"Apache-2.0",
"LLVM-exception"
] | permissive | """
Test SBBreakpoint APIs.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class BreakpointAPITestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
NO_DEBUG_INFO_TESTCASE = True
... | true |
4012b602f23e219e9757d4c121b7f60975930d95 | Python | KBIbiopharma/pybleau | /pybleau/reporting/dash_reporter.py | UTF-8 | 3,034 | 2.71875 | 3 | [
"MIT"
] | permissive | """ Class to drive the generation of a data report using Dash as the backend.
"""
import logging
from uuid import uuid4
from flask import Flask
import dash
import dash_html_components as html
from traits.api import Any, Bool, Int, List, Str
from .base_reporter import BaseReporter
from .section_report_element import S... | true |
0289b816d0951aa76680a287a0252c9f7c41f46a | Python | didwns7347/algotest | /알고리즘문제/16566 카드게임 DFS.py | UTF-8 | 280 | 2.625 | 3 | [] | no_license | n,m,k = map(int,input().split())
card=list(map(int,input().split()))
draw=list(map(int,input().split()))
check=[0 for _ in range(n+1)]
def find(node):
if check[node]==0:
check[node]=1
return node
return find(node+1)
for num in draw:
print(find(num+1))
| true |
bb9aadca4fb1595eb49bd805655e004cc013d9e9 | Python | Aprameyo/Competitive-Programming | /CodeChef/ZCO Contest/ZCO14003.py | UTF-8 | 378 | 2.75 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 8 22:48:10 2020
@author: Aprameyo
"""
import numpy as np
Solution = []
SolSpace = []
N = int(input())
for i in range(0,N):
temp = int(input())
Solution.append(temp)
Solution_2 = sorted(Solution)
for i in range(0,N):
Solution_2[i] = So... | true |
7da19d189ed2b9adf61011dc96d4c76adc82f347 | Python | toshiakiasakura/rakutto_collect_project | /prj_input/pyqt5_basic/dist_gui/developing/3_exp_dist.py | UTF-8 | 5,882 | 2.609375 | 3 | [] | no_license | # usr/bin/python3
# coding:utf-8
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
from PyQt5 import QtWidgets
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
import glob
from PIL import Image
from scipy.stats import norm
from scipy.stats import expon
def ... | true |
7703031c73034b5c0389d03e78073de020a52765 | Python | paiv/synasm | /synasm/asm.py | UTF-8 | 4,032 | 2.59375 | 3 | [
"MIT"
] | permissive | import ast
import array
import base64
import fileinput
import re
import sys
class SynasmError(Exception): pass
token_rx = re.compile(r'^\s*((?:\s*(?:\-?\'(?:\\.|[^\'])+\'|[^\s;]+))*?)\s*(?:;.*?)?\s*$', re.M)
label_rx = re.compile(r'^\s*(\w+\:)?\s*(.*?)\s*$', re.M)
def parse(text):
for tok in token_rx.findall(t... | true |
bdcba38282e5767bf6adf2da937f2fe6ec1eca3c | Python | 1047465356/Spider_Armies | /爬取高匿名代理IP/快代理+百度api检测.py | UTF-8 | 2,559 | 2.796875 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
# @Author : Aiden
# @Email : aidenlen@163.com
# @Time : 2020-3-11
from logging import exception
from os import write
import requests
from lxml import etree
import time
from fake_useragent import UserAgent
# 文件名
filename='proxy.txt'
# 代理容器
proxys_list = []
# 默认 True 开启代理检测(只生成可用... | true |
f2838a80ebc23f373df1263aa4d87ac12fee5c81 | Python | ripssr/Code-Combat | /7_Sarven_Desert/273-Operation_Killdeer/killdeer.py | UTF-8 | 223 | 3.140625 | 3 | [
"MIT"
] | permissive | def shouldRun():
return hero.health < hero.maxHealth / 2
while True:
if shouldRun():
hero.moveXY(75, 37)
else:
enemy = hero.findNearestEnemy()
if (enemy):
hero.attack(enemy)
| true |
841c1374df47c586be86f24746fa5eab50298a72 | Python | burck1/tnt-battlesnake | /battlesnake/agent.py | UTF-8 | 3,862 | 2.6875 | 3 | [] | no_license | import json
import logging
import os
import time
from collections import deque
import numpy as np
import tensorflow as tf
from tensorflow.python.saved_model import loader
from .constants import Direction
from .snake import Snake
from .data_to_state import data_to_state
LOGGER = logging.getLogger("Agent")
class Ag... | true |
b1c8e56382eaac478d32f3d0e1d765cf2decbf95 | Python | rockshaker/leetcodeme | /026_remove_duplicates_from_sorted_array.py | UTF-8 | 381 | 3.078125 | 3 | [] | no_license | class Solution(object):
def removeDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if not nums:
return 0
n = 0
for num in nums[1:]:
if num != nums[n]:
n += 1
nums[n] = num
retur... | true |
b31facace3152d307c1f708642304336be82f643 | Python | Lucas-JS/PLP | /Estruturado/olimpiadas.py | UTF-8 | 4,366 | 3.375 | 3 | [] | no_license | # Lucas de Jesus Silva - 20731356 - atividade 2 PLP - Estruturado
#=================================================================================================
# método para determinar vencedor do levantamento de pesos
def levantamentoPeso (x,y):
vencedor = ""
if x["peso"] > y["peso"]:
vencedor = x["no... | true |
7e3b857f7a07e28425edaa3f21cac527673635fb | Python | jackiboi307/cogpy | /examples/doublebuffer.py | UTF-8 | 369 | 2.78125 | 3 | [
"MIT"
] | permissive | from cogpy import *
from math import sin, cos # circle animation
from random import choice
screen = DoubleBufferCanvas((50, 25))
i = 0
while True:
# screen.fill(" ")
coords = (int(25 * (1 + sin(i))),
int(12 * (1 + cos(i))))
screen.draw.pixel(coords, choice(misc.ascii_shade_... | true |
f1849c76d329120bc502fde629914f3b230396f6 | Python | yunabe/codelab | /google/gflags_example_test.py | UTF-8 | 4,561 | 2.875 | 3 | [] | no_license | import commands
import os
import sys
import unittest
class TestGflagsCppProgram(unittest.TestCase):
def testDefault(self):
self.assertEqual('Hello world.',
commands.getoutput('./gflags_example'))
def testHelp(self):
helpOutput = commands.getoutput('./gflags_example --help')
self.... | true |
db0975d89962afc9b06513802c0418284677562d | Python | sainathurankar/Python-programs | /BubbleSort.py | UTF-8 | 399 | 3.953125 | 4 | [] | no_license | def BubbleSort(arr):
l=len(arr)
for i in range(l):
flag=0
for j in range(l-1-i):
if arr[j]>arr[j+1]:
temp=arr[j]
arr[j]=arr[j+1]
arr[j+1]=temp
flag=1
if flag==0:break
arr=list(map(int,i... | true |
51df9bf116971974955a47e292912ae67a9e8d8b | Python | lixiang007666/Algorithm_LanQiao | /DP/dayday_up.py | UTF-8 | 827 | 2.625 | 3 | [] | no_license | import math
import cmath
import string
import sys
import bisect
import heapq
from queue import Queue, LifoQueue, PriorityQueue
from itertools import permutations, combinations
from collections import deque, Counter
from functools import cmp_to_key
if __name__ == "__main__":
dp = [[0 for _ in range(2005)] for _ in ... | true |
7c5bb342a98be97fdb8a3949785abdd528ebc1fc | Python | biavidalf/beatriz-vidal-poo-python-ifce-p7 | /Presença/atvd03_presenca.py | UTF-8 | 787 | 3.875 | 4 | [] | no_license | """
ATIVIDADE 03 - PRESENÇA: POO - P7 DE INFO - BEATRIZ V.
ENUNCIADO: Para ganhar o prêmio máximo na Mega Sena, é necessário
acertar todos os 6 números em seu bilhete com os 6 números entre 1 e 60
sorteados. Escreva um programa que gere uma seleção aleatória de 6 números para
uma aposta. Certifique... | true |
e013da69e3f47ae73c0df92bfa7223e0d7a8a008 | Python | CCNITSilchar/Coding-Club-Contribution-Tracker-and-Leaderboard | /git_repo.py | UTF-8 | 1,001 | 2.59375 | 3 | [] | no_license | #!/usr/bin/env python
#Learn how this works here: http://youtu.be/pxofwuWTs7c
import urllib2
import json
import pymysql
from json_connection import database
from json_connection import json_l
conn=database()
conn.connect('coding_club')
conn.cursor.execute("SELECT name_of_repos FROM git_repos ")
list_of_repos=set()
re... | true |
df197b95860eb81f7d9f6460e3cee77a8a7b3830 | Python | AdamZhouSE/pythonHomework | /Code/CodeRecords/2344/60799/235346.py | UTF-8 | 185 | 2.734375 | 3 | [] | no_license | T = int(input())
for hhh in range(0, T):
input()
aList = [int(i) for i in input().split()]
d = int(input())
[print(i, end=' ') for i in aList[d:]+aList[0:d]]
print() | true |
260f4f1f67458871d22b457cc4fe0f3bdfce5dad | Python | RastogiAbhijeet/NewsReader | /Scrapping.py | UTF-8 | 4,087 | 2.90625 | 3 | [
"MIT"
] | permissive | from bs4 import BeautifulSoup
from urllib import request
# from pymongo import
from newspaper import Article
import newspaper
from textblob import TextBlob
from datetime import date
import json
from databaseHandling import InterfaceClass
class ScrapNews(object):
def __init__(self):
self... | true |
79073d8e675248cb7a0f870c6830f70466538803 | Python | mahendraphd/Python_LD | /AutoDictonary.py | UTF-8 | 1,783 | 2.515625 | 3 | [] | no_license |
import time
import sys
import os
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
from bs4 import BeautifulSoup
import pandas as pd
from time import strftime
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
driver = w... | true |
de1721c82366d88c0e358926352ecb8da54bcb2f | Python | guillox/Practica_python | /2013/tp3/tp3part1ej1.py | UTF-8 | 795 | 3.3125 | 3 | [] | no_license | """Manejo de archivos
Parte I
1.- Dado un conjunto de números (que se tomarán de la entrada estándar), generar dos archivos:
uno con los números pares y otro con los impares."""
L = [1,2,3,4,5,5]
conjuntoL = set(L)
def creacion():
archimp=open("archivo.txt","w")
archimp.close()
archpar=open("archivo txt","w")
ar... | true |
a7874461612ea64782c02c6195def6351edcbb6b | Python | skaidan/burger | /tests/integration/orders/test_order_data_access.py | UTF-8 | 1,924 | 2.609375 | 3 | [] | no_license | from django.test import testcases
from inventory.models import Inventory
from orders.data_access.order_data_access import OrderDataAccess
from orders.models import Order, OrderElement, OrderStatus
from organizations.models import Restaurant
class OrderDataAccessIntegrationTestCase(testcases.TestCase):
order = No... | true |
f831a0e794ab6bbbe7b5d4bb5c0693505d53ffb0 | Python | JenTus/pyalgorithm | /788_rotated_digits.py | UTF-8 | 705 | 3.375 | 3 | [] | no_license | range(1, -2, -1)
aa = "abdgw"
len(aa)
[aa[i] for i in range(len(aa)-1, -1, -1)]
range(1, 3+1, 1)
def reverse(s):
if s == "2":
return "5"
elif s == "5":
return "2"
elif s == "6":
return "9"
elif s == "9":
return "6"
elif (s == "0") or (s == "1") or (s == "8"):
... | true |
c42e1804d4a295eff0fe5006d9c7355d02a3353a | Python | rfelts/wsgi-calculator | /calculator.py | UTF-8 | 5,314 | 3.96875 | 4 | [] | no_license | #!/usr/bin/env python3
# Russell Felts
# Assignment 04 WSGI Calculator
import traceback
"""
For your homework this week, you'll be creating a wsgi application of
your own.
You'll create an online calculator that can perform several operations.
You'll need to support:
* Addition
* Subtractions
* Multiplicati... | true |
0bbadf9fcefc08b37ffe747886efd5da16288bda | Python | ThQuirino/api-em-flask-com-python | /server.py | UTF-8 | 2,144 | 2.546875 | 3 | [] | no_license | from flask import Flask, render_template,request
import index
import re
from src import procurarDados
from src import inserir
app=Flask("PDF")
@app.route('/',methods=["GET","POST"])
def index():
#if __name__=='__main__':
if(request.method =='POST'):
valor=request.form.get("name")
comparar=re.mat... | true |
aa087af80234b36325b573274c8bb5e0a76af51b | Python | Heminyildiz/Python-SansOyunlari.py | /SansOyunlari/SansOyunlari.py | UTF-8 | 1,479 | 3.8125 | 4 | [] | no_license | import random
print("Şanslı Sayı'ya Hoşgeldiniz")
input("*****Başlamak için ENTER'a basınız*****")
print("-"*30)
print("Şans Oyunu Kod")
print("-"*15)
print("Sayısal Loto: 1")
print("Super Loto: 2")
print("On Numara: 3")
print("Sans Topu: 4")
print("-"*30)
name = input("... | true |
721c3cb91d6f94a8f69b49a5e5a74150cd00388f | Python | likeaeike/tts | /tts.py | UTF-8 | 659 | 2.765625 | 3 | [] | no_license | #!/usr/bin/python
import pyttsx, sys, getopt
def main(argv):
inputstring = ""
try:
opts, arg = getopt.getopt(argv,"hi:o:",["ifile=","ofile="])
except getopt.GetoptError:
print 'test.py -i <inputstring> -o <outputfile>'
sys.exit(2)
for opt, arg in opts:
if opt == '-h':
... | true |
d4f37a0268aac0e28339ee980c5f68fc8e9a336f | Python | davidsongoap/yper | /word.py | UTF-8 | 2,117 | 3.046875 | 3 | [] | no_license | # __ __ ____ ______ ____
# \ \/ // __ \ / ____// __ \
# \ // /_/ // __/ / /_/ /
# / // ____// /___ / _, _/
# /_//_/ /_____//_/ |_|
#
# By Davidson Gonçalves
# github.com/davidsongoap/yper
import pygame
from screens.palette import Colors
class Word:
def __init__(self, text, x, y, font, win):
... | true |
ee49750e435e8befc0dc1de188039c8268849aed | Python | burakkose/HackerRank | /Challenges/AlternatingCharacters/solve.py | UTF-8 | 262 | 3.515625 | 4 | [
"Unlicense"
] | permissive | strings = []
for i in range(int(input(""))):
strings.append(input(""))
index = 0
deletion = 0
for j in range(1,len(strings[i])):
if strings[i][index] == strings[i][j]:
deletion += 1
else: index = j
print(deletion)
| true |
89756535f320c86257b886e95823f452f9d82da4 | Python | skriser/pythonlearn | /Day24/矩阵的行列式.py | UTF-8 | 255 | 3.0625 | 3 | [] | no_license | #!usr/bin/env python
# -*- coding:utf-8 -*-
"""
@time: 2018/05/29 16:39
@author: 柴顺进
@file: 矩阵的行列式.py
@software:rongda
@note:
"""
import numpy as np
vector = np.mat("3 4;5 6")
# 求行列式
det = np.linalg.det(vector)
print(det) | true |
396d534e8bf1b47d3c33edcade28686b58983b1d | Python | lforet/astroid | /wifi/wifi_graph.py | UTF-8 | 3,693 | 2.65625 | 3 | [] | no_license | import matplotlib.pyplot as plt
import numpy as np
import time
import thread
import math
import random
from wifi_consume import *
from matplotlib import mpl
import sys
import matplotlib.colors as mcolors
class wifi_graph():
def __init__(self, wifi_to_graph):
self.wifi_to_graph = wifi_to_graph
self.fig = None
... | true |
8e6fece1119c52ecfc8c412d51e067a61d023fac | Python | DenisRang/GradingSystem | /generator_random_works.py | UTF-8 | 1,157 | 2.890625 | 3 | [] | no_license | import os
import random
from mimesis import Person
STUDENTS_COUNT = 50
new_directory = os.getcwd() + r'\New works'
person = Person('en')
for i in range(STUDENTS_COUNT):
name_letter = person.name()[0]
surname = person.surname()
file_name = new_directory + '//' + name_letter + '.' + surname + '.'
file... | true |
f3f1d5dae7c58701848798634b105f201374dcd1 | Python | crunchiness/rss | /robot/vision/vision.py | UTF-8 | 2,582 | 2.578125 | 3 | [] | no_license | """Main vision class"""
from robot.vision.localisation import detect_pieces
import numpy as np
import cv2
from robot.vision.resource_finder import DetectionConfirmer, CubeDetector, get_mean
class Vision:
def __init__(self, io):
self.io = io
self.io.cameraSetResolution('high')
self.belief =... | true |
eb2ed11302e45fef97339559445b32dedd79e1c2 | Python | friendnj/pythonautotest | /unittest1/baidu_unittest.py | UTF-8 | 1,006 | 2.796875 | 3 | [] | no_license | from selenium import webdriver
import unittest
from HTMLTestRunner import HTMLTestRunner
import time
class Baidu(unittest.TestCase):
'''百度搜索测试'''
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.implicitly_wait(10)
self.base_url = "https://www.baidu.com/"
def tes... | true |