blob_id 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 |
|---|---|---|---|---|---|---|---|---|---|---|
2044996685f58b9b7c346624fe3a048594339789 | yuraskubak/basic_python_selenium-test | /pages/create_account_page.py | UTF-8 | 1,273 | 3.171875 | 3 | [] | no_license | import time
class CreateAccountPage():
def __init__(self, driver):
self.driver = driver
def enter_firstname(self, firstname):
self.driver.find_element_by_id("firstName").clear()
self.driver.find_element_by_id("firstName").send_keys(firstname)
def enter_lastname(self, lastname):
... | true |
032c2d2482750e643402be183df2663ff2505faf | DmytroKaminskiy/students | /src/students_app/models.py | UTF-8 | 1,284 | 2.625 | 3 | [] | no_license | from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
from students_app.tasks import django_sleep
# pk - primary key
class Student(models.Model):
first_name = models.CharField(max_length=128)
last_name = models.CharField(max_length=128)
age = models.IntegerFie... | true |
effde54c1905bd46bcbb4a564d87b37e3d6ec8ce | nowindxdw/PlayWithDataStructure | /LeetCode_easy/find_disappear_nums_448.py | UTF-8 | 505 | 3.71875 | 4 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
'''
寻找丢失的数
先对已知长度数组去重,然后构建1~n完全数组求差集
'''
class Solution():
def find_dispeared_nums(self,input):
distinct = set(input)
comlete_list = set([i+1 for i in range(len(input))])
output = comlete_list.difference(distinct)
return list(output)
if __name__ == "__main... | true |
6b2b7dda7bc64853a3e9b99aab895cc9327431df | mlux86/pi_log_sensors | /log_sensors.py | UTF-8 | 354 | 2.53125 | 3 | [] | no_license | #!/usr/bin/python3
import Adafruit_DHT
import time
from bmp180.Adafruit_BMP085 import BMP085
ts = int(round(time.time()))
sensor = Adafruit_DHT.DHT22
pin = 4
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
bmp = BMP085(0x77)
pressure = bmp.readPressure() / 100.0
print('%d\t%.01f\t%.01f\t%.01f' % (ts, ... | true |
69ac000b3faa763974a0855427ac6edb472cd843 | mthuurne/retroasm | /src/retroasm/tokens.py | UTF-8 | 5,886 | 3.125 | 3 | [
"MIT"
] | permissive | from __future__ import annotations
from collections.abc import Iterable, Iterator
from enum import Enum, EnumMeta
from re import Pattern
from typing import Any, Callable, TypeAlias, TypeVar, cast
import re
from .linereader import InputLocation
class TokenMeta(EnumMeta):
"""Metaclass for `TokenEnum`."""
pat... | true |
763f027e21a003be319afbbba31fef73abbc2637 | wolflion/Code2019 | /Python编程:从入门到实践/chap04操作列表/e401_magicians.py | UTF-8 | 321 | 3.453125 | 3 | [] | no_license | magicians = ['alice', 'david', 'carolina']
for magician in magicians:
print(magician)
print(magician.title() + ", that was a great trick!") #这个怎么写语句块? 【对这种缩进的执行for里】
print("Thank you, everyone. That was a great magic show!")
#4.2是缩进错误和缺少冒号的语法错误 | true |
c63cfa990c6adc445393bb11abf9d9d9640074b3 | rockas69/python-electricity | /electricity/tariffs.py | UTF-8 | 12,872 | 2.875 | 3 | [
"MIT"
] | permissive | """
Map a given datetime to a tariff
"""
__version__ = "0.0.7"
__author__ = "Diogo Gomes"
__email__ = "diogogomes@gmail.com"
from datetime import date, time, datetime, timedelta
MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY = range(7)
WEEKEND = (SATURDAY, SUNDAY)
DAILY, WEEKLY, MONTHLY, YEARLY = ran... | true |
3a21ee947b13a90e797634dcec198d4a405cd39c | tom2411/projet-python | /labyrinthe/VersionPOO/cartePOO.py | UTF-8 | 9,644 | 3.5625 | 4 | [] | no_license | import random
"""
la liste des caractères semi-graphiques correspondant aux différentes cartes
l'indice du caractère dans la liste correspond au codage des murs sur la carte
le caractère 'Ø' indique que l'indice ne correspond pas à une carte
"""
listeCartes=['╬','╦','╣','╗','╩','═','╝','Ø','╠','╔','║','Ø','╚','Ø','Ø'... | true |
d3837ce1963f50469ca6ed0e0d58ca1135135c18 | prios-blake-aber/research-api | /insights/believable_view_disagrees.py | UTF-8 | 3,864 | 3.09375 | 3 | [] | no_license |
"""
Believable View Disagrees With.
"""
import itertools
from prios_api.domain_objects import meta, objects
from prios_api.concepts import sentiment, disagreement
def believable_and_overall_meeting_section_sentiment_disagree_119(question: objects.Question) -> meta.Assertion:
"""
Believable and Overall Meeti... | true |
e6567507f6064dcaabf375cd6c2a195b4f70c2ae | Aasthaengg/IBMdataset | /Python_codes/p03303/s053787236.py | UTF-8 | 56 | 2.984375 | 3 | [] | no_license | S = input().strip()
w = int(input())
x = S[::w]
print(x) | true |
6394a2a1e15b04084e5bce536b0d1dec2e8b5b95 | pliba/kaminpy | /plain/Calculator/evaluator_test.py | UTF-8 | 356 | 3.09375 | 3 | [] | no_license | from pytest import mark
from evaluator import evaluate
def test_evaluate_number():
got = evaluate(7)
assert 7 == got
@mark.parametrize("ast, value", [
(['+', 1, 2], 3),
(['*', 6, ['+', 3, 4]], 42),
(['/', ['*', ['-', 100, 32], 5], 9], 37)
])
def test_expression(ast, value):
got = evalua... | true |
b28536f3cb949c592116b82b59c8bf88bf5d3df7 | autoself/python_start | /Second_Module/Practice/generator.py | UTF-8 | 430 | 3.09375 | 3 | [] | no_license | #!/usr/bin/env python
#-*- coding:utf-8 -*-
__author__ = 'andylin'
__date__ = '17-8-5 下午4:53'
from itertools import islice
class checkFunc(object):
def __init__(self,a,b):
self.a = a
self.b = b
def __iter__(self):
return self
def __next__(self):
value = self.a
se... | true |
ea931a34842de51b886299bc9780ec427ef40614 | Jin-Woong/hackerthon-python | /manufacture-files/practice/bithumb.py | UTF-8 | 621 | 3.296875 | 3 | [] | no_license | import requests
from bs4 import BeautifulSoup
url = 'https://www.bithumb.com/'
request = requests.get(url).text
soup = BeautifulSoup(request, 'html.parser')
coins = soup.select('.coin_list tr') # class 가 coin_list 인 것에서 tr 태그들
with open('bithumb.csv', 'w', encoding='utf-8') as f:
for coin in coins:
# td:... | true |
f3a39512a42ca65cef0a1eb0798d2b30a3a10372 | mateuszGorczany/Bunioniser | /cv2_angles.py | UTF-8 | 3,960 | 2.828125 | 3 | [] | no_license | import cv2
import numpy as np
import collections
import matplotlib.pyplot as plt
file_numbers = ["06", "07", "09", "10", "12", "15", "16", "20", "21", "27"]
PATH_1st_part = "./input/img_00"
PATH_2nd_part = "_mask_Unet_toe.png"
def filename(number):
return PATH_1st_part + number + PATH_2nd_part
... | true |
4b0fbe8ede74582694515dc966900ec0577baeb0 | Ragabharathi/Python | /Minimum distance words count.py | UTF-8 | 490 | 3.453125 | 3 | [] | no_license | Minimum Distance Between Words:
Input:
the count of the birds in the world
the
count
Output:
1
Code:
x=list(input().strip().split(" "))
y=input().strip()
z=input().strip()
r=0
minc=200
for i in range(len(x)):
if x[i]==y or x[i]==z:
c=1
for j in range(i+1,len(x)):
if j==len(... | true |
228b9db39b11c22bd26c72a86c113d33a14b219d | VolkerH/imzml-tools | /extract_images.py | UTF-8 | 12,602 | 2.515625 | 3 | [
"MIT"
] | permissive | import cpyMSpec
import numpy as np
import pandas as pd
from pyMSpec.pyisocalc.pyisocalc import parseSumFormula
from pyimzml.ImzMLParser import ImzMLParser
assert cpyMSpec.utils.VERSION <= '0.4.2', 'Using an old version of cpyMSpec.'
ANALYZERS = ('tof', 'orbitrap', 'ft-icr')
TOL_MODES = ('constant_fwhm', 'tof', 'orbit... | true |
6e4269b9f79513cc567893f21453a25109765d1e | jakeelwes/mjpeg-wishes | /watermark.py | UTF-8 | 3,165 | 2.71875 | 3 | [] | no_license | from PIL import Image, ImageDraw, ImageFont
import os
import sys
import os.path, time
import datetime
import getopt
from pytz import timezone
from dateutil.tz import tzlocal
from dateutil import parser
def process(filename, path, original_path, name, localtime):
# Open the original image
main = Image.open(path + '/... | true |
b5c84d8424aad352de91981aa890a8195a68df09 | JaeSooLEE/kaggle | /preprocessing/transformers/log_target_transformer.py | UTF-8 | 273 | 2.84375 | 3 | [] | no_license | import pandas as pd
import numpy as np
def transform_log(df, column_name):
df[column_name] = df[column_name].apply(lambda x: np.log(x))
return df
def transform_exp(df, column_name):
df[column_name] = df[column_name].apply(lambda x: np.exp(x))
return df
| true |
21fe82357bc57c193c8a85e008772ee970b64c4d | lilyxiaoyy/python-28 | /day03/课下练习/编码问题.py | UTF-8 | 4,030 | 3.90625 | 4 | [] | no_license | '''
编码的问题
python2解释器在加载.py文件中的代码时,会对内容进行编码(默认ascii),而python3对内容进行编码的默认为utf-8。
计算机:
早期,计算机是美国发明的,普及率不高,一般只是在美国使用,所以,最早的编码结构就是按照美国人的习惯来编码的。
对应数字+字母+特殊字符一共也没多少,所以就形成了最早的编码ASCII码,直到今天ASCII依然深深的影响着我们。
ASCII(American Standard Code for Information Interchange,美国标准信息交换代码)是基于拉丁字母的一套电脑编码系统。
主要用于显示现代英语和其他西欧语言,其最多只能用8位来表示(一个字节),即... | true |
40c97c8fff65490c60cd365989eb80c1a3d6f7c9 | atheenaantonyt9689/covid19_data_project | /dashboard/management/commands/fetch_covid_data.py | UTF-8 | 1,200 | 2.546875 | 3 | [] | no_license |
from django.core.management.base import BaseCommand
from django.db.models.fields import DateField
from dashboard.models import CovidDistrict
import requests
import json
class Command(BaseCommand):
help = 'fetch_covid_data'
def handle(self, *args, **kwargs):
url="https://api.covid19india.org... | true |
e5220598226fb2f93f86460b16e805b9ad939cbc | natanmario-zz/Numerical-Methods | /Bissecao.py | UTF-8 | 943 | 3.90625 | 4 | [] | no_license | # -*- coding: utf-8 -*-
# Função para calcular f(z)
def funcao(z):
return z**3 + (-9*z) + 3
# Definir intervalo inicial
a = input("Digite o intervalo a: ")
b = input("Digite o intervalo b: ")
# Definir precisao e numero maximo de interações
precisao = 0.001
maxInter = 10
Fa = funcao(a)
Fb = funcao(b)
if(Fa * Fb ... | true |
8ae5180b6055352e43d82b61b10e2289e12abb53 | yongj123/jump_game | /wechat_jump_game/wechat_jump_py3.py | UTF-8 | 1,635 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
import os
import time
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from PIL import Image
def pull_screenshot():
os.system('adb shell screencap -p /sdcard/autojump.png')
os.system('adb pull /sdcard/autojump.png .')
def jump(... | true |
e7c86dae50e55923e6eb0b7ac64d78df8046eadf | ChenRunjin/GNEM | /utils.py | UTF-8 | 671 | 2.546875 | 3 | [] | no_license | import torch
import pandas as pd
from sklearn.metrics import precision_score, recall_score
def _read_csv(path):
columns = pd.read_csv(path).columns
type = {}
for name in columns:
if name == 'id':
continue
type[name] = str
data = pd.read_csv(path, dtype=type)
data = dat... | true |
f5b5a787612d8b866ed1269385fe7952cdcd28f5 | lboom/futel-ceres-opt-asterisk-var-lib-asterisk-agi-bin | /record.agi | UTF-8 | 1,556 | 2.703125 | 3 | [] | no_license | #!/usr/bin/env python
"""
Prompt for and collect recordings.
"""
import os, errno
import uuid
from asterisk import *
import util
import statements
agi = agi.AGI()
RECORDING_DIR = '/opt/asterisk/var/lib/asterisk/sounds/futel/recordings'
def get_username():
return str(uuid.uuid4())
def mkdir(path):
try:
... | true |
6ed2dcce8c77e3a720a0b34833e13798e4bf1c91 | tenpa1105/m5camera_mpy_samples | /2_line_notify/src/main.py | UTF-8 | 1,445 | 2.53125 | 3 | [
"MIT"
] | permissive | import gc
import camera
import urequests
import utime
import config
LINE_TOKEN = config.LINE_TOKEN
LINE_URL = "https://notify-api.line.me/api/notify"
def make_line_request(data, image=None):
boundary = '----boudary'
body = b''
body += b'--%s\r\n' % boundary
body += b'Content-Disposition: form-data; ... | true |
ecf0824c5558fe766cf0a5c92ad7e8adfa1a1cd4 | parm530/learning_python | /chapter3/chal1.py | UTF-8 | 586 | 3.890625 | 4 | [] | no_license | # write a orgram that simulates a fortune cookie
# should display 1 of 5 random fortunes each time it is run
import random
fortune = random.randint(1, 5)
if fortune == 1:
print("You will recieve lots of wealth soon!")
elif fortune == 2:
print("Today will be a bad day for you, keep up a positive attitude!")
e... | true |
c29d24fcfad8e1c40c52a848570a8e045d57b3af | dahea-moon/Bixby-Medi-Project | /bixby-medi/bound.py | UTF-8 | 437 | 2.828125 | 3 | [] | no_license | from math import cos, pi, asin, sin
def Bound(langt, longt):
x = langt - asin(sin(20/(2*6317)))*(180/pi)
lat_change = abs(langt - x)
y = longt +(180/pi)*2*asin(sin(20/(2*6371)))/cos(langt)
lng_change = abs(longt - y)
result = {
"langt_min": langt - lat_change,
"longt_min": longt - ... | true |
a40b2f94c1852d53ea51af4dc3fce5afd638afa1 | yangdd1205/python3-100-examples | /example42.py | UTF-8 | 211 | 2.515625 | 3 | [
"Unlicense"
] | permissive | #!/usr/bin/python3
'''
example 042
'''
num = 2
def autofunc():
num = 1
print 'internal block num = %d' % num
num += 1
for i in range(3):
print 'The num = %d' % num
num += 1
autofunc() | true |
647410b1dddcfedec229f41d769fb4a45b9878c4 | Kamilgolda/TripRecommendations | /travels/management/commands/add_trips.py | UTF-8 | 1,759 | 2.671875 | 3 | [
"MIT"
] | permissive | import pandas as pd
import os.path
from django.core.management.base import BaseCommand, CommandError
import logging
from travels.models import Trip
# full_path = os.path.join("../files/Wycieczki.xlsx")
# trips = pd.read_excel(full_path, sheet_name='Góry')
# print(trips["Nazwa wycieczki"])
class Command(BaseCommand):... | true |
d0ec583a682a61061950d224a22165c38a52fd5f | zhuyurain888/python_test | /home_work/User_01/format_01.py | UTF-8 | 504 | 3.828125 | 4 | [] | no_license |
# value = {"greet": "Hello world", "language": "Python"}
# # print("%(greet)s from %(language)s." % value)
#
# print("{} from {}".format(greet, language)
hash = {'name':'Bingo','age':18}
# print('my name is {name},age is {age}'.format(name='Bing1o',age=19))
print('my name is {},age is {}'.format('Bingo',19))
print('... | true |
b1221b51b39e4be054af891caaca998e8489aba5 | aytoku/tf-idf | /test/xaml.py | UTF-8 | 1,583 | 3.203125 | 3 | [] | no_license | import math
arr = """
Статическое свойство TextProperty является свойством зависимостей, представляя объект System.Windows.DependencyProperty.
По соглашениям по именованию все свойства зависимостей представляют статические публичные поля (public static) с суффиксом Property.
""".split("\n")[1:-1]
A = arr[0].lower().s... | true |
ee22b439e4f38ffd1ba48d6674bbeebe17eb772b | Samira-Kaline/Exercicio-Fila | /Questão6.py | UTF-8 | 320 | 2.765625 | 3 | [] | no_license | class ControleAvioes:
def __init__(self):
self.fila = []
def adcionaraviao(self,item):
self.fila.append(item)
def Autorizar_decolagem(self):
if not (len(self.fila)==0):
self.fila.pop(0)
def PrimeiroAviao(self):
return self.fila[0]
def ListarAvioes(self):
return len(self.fila)
| true |
05c028e33d21eace024244d2b79a8c5edca27763 | ElanVB/cvz_deep_q_agent | /python/tournament_host.py | UTF-8 | 2,499 | 3.09375 | 3 | [] | no_license | from interface import Interface
from environment import Environment
from renderer import Renderer
import random, time
class Match():
def __init__(self, max_humans=2, max_zombies=3, randomness=True, render_delay=0.05):
self._max_humans = max_humans
self._max_zombies = max_zombies
self._randomness = randomness
... | true |
ef4a24ddfdc76493c481156b745e7214f665b473 | famaxth/Way-to-Coding | /MCA Exam Preparations/Python/8.1 python program to print the prime numbers in a given file.py | UTF-8 | 375 | 3.90625 | 4 | [] | no_license | #python program to print prime numbers in a given file
def prime(number):
if number == 1 :
return True
else :
for i in range(2, number) :
if (number % i) == 0 :
return False
return True
f=open("prime.txt","r")
for i in map(int,f.readline().spl... | true |
b6f390b16d51a001b2bde201fc95fb56f17fb7e3 | byIlusion/GB_GeekShop | /basketapp/models.py | UTF-8 | 3,841 | 2.765625 | 3 | [] | no_license | from django.db import models
from django.shortcuts import get_object_or_404
from django.utils.functional import cached_property
from userapp.models import User
from mainapp.models import Product
class Basket(models.Model):
user = models.ForeignKey(User, verbose_name='ID пользователя', on_delete=models.C... | true |
8077d9fc8cbde977d699b77a08c8e78078ab09a5 | jdvpl/Python | /Universidad Nacional/monitorias/Ejercicios/3-problemas/gallinas-conejos-np.py | UTF-8 | 212 | 3.09375 | 3 | [] | no_license | # 1*conejo + 1*gallina = 50 (total_animales)
# 4*conejo + 2*gallina = 140 (total_patas)
import numpy as np
a = np.array([[1,1],[4,2]])
r = np.array([500,1400])
solucion = np.linalg.solve(a,r)
print(solucion)
| true |
a7ac7694a4e870356bd150b0d64b8750c8296aab | Tarasso/ENGR102 | /Lab4b_Prog2.py | UTF-8 | 561 | 4.0625 | 4 | [] | no_license | # Name: Kyle Mrosko
# Section: 212
# Assignment: Lab 4b_Prog2
# An Aggie does not lie, cheat or steal, or tolerate those who do.
print("This program calculates and evaluates Reynold's Number")
V = float(input("Enter the characteristic velocity of the flow (m/s): "))
d = float(input("Enter the pipe diam... | true |
8ef83358d758ada12d7e733462307616e499b0bf | JaeHyeokLee/artificial-intelligence-2017 | /Week9-Assignment/week9.py | UTF-8 | 5,604 | 2.953125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import os
import os.path as op
import struct as st
import numpy as np
import matplotlib.pyplot as plt
import random
import pickle
#Train Data Set 생성 - 0번째 원소 1 : Bias Term, 1,2번째 원소 : Input X값
#3번째 원소 : Tran data Set 의 Label
train_list = np.array([[1,0,0,0], [1,0,1,1], [1,1,0,1], [1,1,1,0]])
... | true |
9b493c1a69da189768fad2a8a111ad525038d01c | hacklinshell/learn-python | /进程和线程/fork.py | UTF-8 | 720 | 3.203125 | 3 | [] | no_license | from multiprocessing import Process #multiprocessing模块就是跨平台版本的多进程模块
import os
def run_proc(name):
print('Run child process %s (%s)' % (name,os.getpid()))
if __name__ == '__main__':
print('Parent process %s.' % os.getpid())
p = Process(target=run_proc,args=('test',)) #传入一个执行函数和函数的参数,创建一个Process实例,
... | true |
d8ccd00cca46d504e17104c62c30f7a4a67f4f87 | chanchailee/SecureDropboxUploadDownload | /ServerDeduplicationChecking.py | UTF-8 | 2,478 | 3.25 | 3 | [] | no_license | #!/usr/bin/env python3
#Author: Chanchai Lee
#The purpose of this file is to act as a server and check whether the input file is aleady existed in the dropbox or not.
# To run program:
# $ python ServerDeduplicationChecking.py input.txt
from ClientConvergentEncryptDecrypt import createHash,readInputFile,connectToDrop... | true |
dbdc9c8427fdb8bdc652513a1175cb94c796a07f | dbur/project-euler | /q_26.py | UTF-8 | 830 | 2.765625 | 3 | [] | no_license | from decimal import *
import math
getcontext().prec=100
longest_answer=[0,0]
for i in range(1,1000):
answer = 0
answer_repeat = []
remainder = [(10 % i )*(10**len(str(i)))]
repeat=0
while 1:
latest = remainder[len(remainder)-1]
if latest == 0:
break
to_add = (la... | true |
0588f5a7b616d3322345d0b58a9f6a179fbc4b11 | pagsamo/google-tech-dev-guide | /70_question/searching/quick_select.py | UTF-8 | 1,677 | 4.3125 | 4 | [
"Apache-2.0"
] | permissive | # Best O(N) | Avg O(N) | Worse O(N^2) time
# O(1) space since sort in place.
def quickselect(array, k):
"""
Select the kth smallest element in the array
Using quick select algorithm
"""
n = len(array)
if n == 1:
print_result(array, k)
return array[k-1]
start, end = 0, n - 1... | true |
c3a903fe3b3b374265054b29a974ef0eb53e510b | hakansam12/RandomNumbers | /app.py | UTF-8 | 6,817 | 2.765625 | 3 | [] | no_license | import random as rand
import requests
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/")
def home():
return render_template("index.html")
# Results for selected number and fact categories if requested for
@app.route("/results", methods=['GET', 'POST'])
def results():
if... | true |
d11ed6072e13bc8b7b3c89b9fb84bb9b5add924d | harryDr/leetcode-python- | /leetcode/575. 分糖果.py | UTF-8 | 639 | 3.375 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/5/22 14:40
# @Author : DR
# @File : 575. 分糖果.py
class Solution(object):
def distributeCandies(self, candies):
"""
:type candies: List[int]
:rtype: int
"""
#种类最多为candies的一半 然后遍历candies看有多少个种类 求两者的... | true |
3ae28d28e2f8437b3eb11cd676db1a5ddeb0ad62 | pqwang1026/convertible | /solver/optimal_stopping_solver.py | UTF-8 | 6,179 | 2.984375 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
import logging
logger = logging.getLogger(__name__)
class ConvertibleModel(object):
def __init__(self, v0, tau0, r, nu, c, k, sigma, delta, mu, mat):
self.v0 = v0 # initial capital
self.mat = mat # bond's maturity
self.tau0 = tau0 # fi... | true |
9277cc8f7ef14765c5e47ad9d0c6af331a1ee2a6 | MYMSSENDOG/leetcodes | /445. Add Two Numbers II.py | UTF-8 | 959 | 3.28125 | 3 | [] | no_license | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
from node_lib import *
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
if l1.val == 0 and l2.val == 0:
return ListNode(0)
... | true |
bab7a2b32aee7c5a4ca5f5d73057adc94a85b3ae | BetiaZ/more-lists | /final-project/game1.py | UTF-8 | 5,178 | 4.1875 | 4 | [] | no_license | # - have checkpoints where you can rest
# - can die of starvation, disease, or drowning
# - can hunt (random pounds of food), set how many miles you want to go per day
# - goal: get to the end in the shortest number of days possible
# - random factors: lose clothes in river, bad weather delays, food spoils, find food o... | true |
0d9442fefceb3f1e66fdc7847727ef6597523312 | AIditor/AIditor | /tagPreprocessing/manual_tagger.py | UTF-8 | 4,203 | 2.625 | 3 | [
"MIT"
] | permissive | import tkinter
import json
import urllib.request
import os
from PIL import Image, ImageTk
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-t', '--tag', type=str, default='데일리룩.json', help="json path here")
parser.add_argument('-n', '--start_image_number', type=int, default=210000, help="image n... | true |
5c75b8d05e6fb1eba3ac280609700852e54fb7f2 | ChangJungWu/COMPGI15-IRDM | /IRDM%2Bproject%2Bmodel.py | UTF-8 | 19,572 | 2.703125 | 3 | [] | no_license |
# coding: utf-8
# ## Attribute Extraction
# In[ ]:
# Import modules
import pandas as pd
import numpy as np
import time
import datetime
import xgboost as xgb
import matplotlib.pyplot as plt
import re, math
import numpy as np
import matplotlib.pyplot as plt
from nltk.tokenize import word_tokenize
from sklearn.linear_... | true |
603a886ba06c22911f02d4732f5fbb6833d7c430 | Alex-146/fastapi-sample | /src/ItemController.py | UTF-8 | 829 | 2.796875 | 3 | [
"MIT"
] | permissive | from datetime import datetime
import db
def allItems():
return { "ok": True, "data": db.items }
def singleItem(id: str):
item = db.getItemById(id)
if item:
return { "ok": True, "data": item }
else:
return { "ok": False }
def addItem(value: str):
item = { "id": str(int(datetime.now().timestamp())), ... | true |
edcc626628bdd8342ebce6aa387737665b933c0a | bkuk69/HelloPython | /Ch05/PCH05EX05.py | UTF-8 | 259 | 3.359375 | 3 | [] | no_license | import random
first = random.randint(1, 100)
second = random.randint(1, 100)
quest = str(first) + "-" + str(second) +":"
user_input = int(input(quest))
answer = first - second
if user_input == answer :
print("정답")
else :
print("오답")
| true |
499bc9e63907799ea8e7f6c24f261347a2e69d0f | yw-fang/epwtools | /Scripts/tc/calculate-Tc.py | UTF-8 | 553 | 2.625 | 3 | [
"MIT"
] | permissive | # Author: Yuewen FANG
# Date: 2021 March 2nd
# The used muc in EPW code of estiamtion of Tc is up to 0.2,
# Here, I used larger muc to estimate Tc
#logavg and l_a2F are obtained from epw.out
import math
logavg = 0.0022479 # modify
l_a2F=0.9736146 # modify
####constants####
ryd2ev = 13.6056981
kelvin2eV = 8.61734... | true |
066630323f52ffd333fc8904cb28b0141cc35241 | Conrad-Crowley/pulse2percept | /pulse2percept/implants/electrodes.py | UTF-8 | 9,817 | 3.1875 | 3 | [
"BSD-3-Clause"
] | permissive | """`Electrode`, `PointSource`, `DiskElectrode`, `SquareElectrode`, `HexElectrode`"""
import matplotlib.pyplot as plt
from matplotlib.patches import Circle, Rectangle, RegularPolygon
import numpy as np
from abc import ABCMeta, abstractmethod
# Using or importing the ABCs from 'collections' instead of from
# 'collectio... | true |
9e224fba69e2046655d95602460097b9c460f82c | LauserK/python-university-exercises | /Programacion II/III Corte - Matrices/matriz2.py | UTF-8 | 894 | 3.734375 | 4 | [] | no_license | """
Suma de matrices
"""
import random
n = int(input("Ingrese el numero de fila: "))
m = int(input("Ingrese el numero de columna: "))
matriz = [[0] * m for i in range(n)]
matriz1 = [[0] * m for i in range(n)]
matriz2 = [[0] * m for i in range(n)]
sfila = [0]*n
for i in range(n):
for j in range(m):
matriz... | true |
e6c576d338511151b31f6f2d18327dc0afac6a2c | sbahaddi/ft_linear_regression | /predict.py | UTF-8 | 759 | 3.421875 | 3 | [] | no_license | import argparse
import pandas as pd
from thetas import getThetas, saveThetas
from readCsv import openCsv
def predictPrice(theta0, theta1, mileage):
price = (theta1 * mileage) + theta0
return price
if __name__ == "__main__":
# read csv
X, Y = openCsv("data.csv")
# read thetas
theta0, theta1 ... | true |
89a34bd386b121dbd866e2580b4c56180761460a | heraldmatias/acajef | /src/apps/alumno/models.py | UTF-8 | 1,596 | 2.71875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from django.db import models
"""
App for Alumno
"""
SEXO = (
('F','Femenino'),
('M','Masculino'),
)
class Alumno(models.Model):
codigo = models.CharField('Código', max_length=10, blank=True, null=True)
numero_matricula = models.CharField('Código', max_... | true |
32113adeb442112542181d2638b36342d9a1eb0b | akriti05/tathastu_week_of_code | /day5/prog5.py | UTF-8 | 308 | 3.640625 | 4 | [] | no_license | def twoWaySort(arr, n):
for i in range(0, n):
if (arr[i] & 1):
arr[i] *= -1
arr.sort()
for i in range(0, n):
if (arr[i] & 1):
arr[i] *= -1
arr = [1, 3, 2, 7, 5, 4]
n = len(arr)
twoWaySort(arr, n);
for i in range(0, n):
print(arr[i], end=" ")
| true |
b6cf6d81d3fcce3ada9205d5b6f29e58e3f92fe9 | Dan70402/eddy | /eddy/tagger/SequentialTagger.py | UTF-8 | 1,267 | 2.671875 | 3 | [] | no_license | import nltk
import os
import pickle
from eddy.util import Wrapper
class SequentialTagger(Wrapper.Wrapper):
def __init__(self, corpus=nltk.corpus.nps_chat):
tagger = self._loadTagger(corpus)
super(SequentialTagger,self).__init__(obj=tagger)
def _loadTagger(self, corpus):
"""
H... | true |
2742775a8875d03e12c8e83870c5a547763878fc | messi10goat/Computer-Vision-Coursera | /opencv.py | UTF-8 | 733 | 2.78125 | 3 | [] | no_license | #Harsh Mittal harshmittal2209@gmail.com
import numpy as np
import cv2
import matplotlib.pyplot as plt
#%matplotlib inline
drawing = False
ex=-1
ey=-1
def DrawRectangle(event, x, y, flags, params):
global ex, ey, drawing
if event == cv2.EVENT_LBUTTONDOWN:
drawing = True
ex,ey = x,y
elif e... | true |
f8193e070a92de636d93ef7c1ef3005aec45513b | arvokoskikallio/Top100-PPsubmission | /submission script.py | UTF-8 | 1,372 | 2.953125 | 3 | [] | no_license | from io import StringIO
from html.parser import HTMLParser
import bs4 as bs
import urllib.request
import lxml
class MLStripper(HTMLParser):
def __init__(self):
super().__init__()
self.reset()
self.strict = False
self.convert_charrefs= True
self.text = StringIO()
... | true |
3c26c0e23869ea2bf87d5b9229daa50a775c15a6 | Nakxxgit/PyQt5_Tutorial | /menu_and_toolbar/simplemenu.py | UTF-8 | 1,466 | 3.0625 | 3 | [] | no_license | import sys
from PyQt5.QtWidgets import QMainWindow, QAction, qApp, QApplication
from PyQt5.QtGui import QIcon
class Example(QMainWindow):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
exitAct = QAction(QIcon('../Icon/exit.png'), '&Exit', self)
# 메뉴바, ... | true |
d572fb2cf6acfbd90cccfa4f762de152cf250d22 | Venkatraman9214/python-coding-challenges | /challenges/4.6.Exponents/main.py | UTF-8 | 110 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | a = 3
b = 4
### Write your code below this line ###
### Write your code above this line ###
print(power)
| true |
ba2a064f21920c02e8683029ddc5ccf2d727cc42 | dr-dos-ok/Code_Jam_Webscraper | /solutions_python/Problem_116/2730.py | UTF-8 | 2,289 | 3.421875 | 3 | [] | no_license |
def input_handler():
number_of_inputs = int(input())
games = {}
for i in range(number_of_inputs):
games[i] = []
for j in range(4):
raw = input()
raw = [ i for i in raw]
games[i].append(raw)
input() # this is to remove empty line
r... | true |
3bf20dc857aed5bfe1d5233e6f4fede777109284 | lephuoccat/Supervised-Encoding-Quantizer | /fmnist-encoder.py | UTF-8 | 8,667 | 2.703125 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 9 18:03:13 2019
@author: catle
"""
'''Train MNIST with PyTorch.'''
'''Pretrain encoder of autoencoder with MNIST'''
import os
import argparse
import numpy as np
from numpy import linalg as LA
from kmeans_pytorch.kmeans import lloyd
import torch
... | true |
e2c5722fd7313b373b128783b067f83a9ff541b9 | DrDub/Pablo | /sentence/getWords.py | UTF-8 | 1,877 | 2.890625 | 3 | [] | no_license | # -*- coding:utf-8 -*-
"""
Created on Nov 1, 2010
This package fetches words for Django based environments containing
word lists in a sqlite database.
@author: Aman
"""
from numpy.random import rand
from numpy import floor
from pablo.sentence.models import *
def getArticle():
nwords = Article.objects.count()
... | true |
8e53a774f0c32e2b36965199aae98e6f110878a6 | pauvrepetit/leetcode | /2023/main.py | UTF-8 | 510 | 2.859375 | 3 | [
"MIT"
] | permissive | from typing import List
#
# @lc app=leetcode.cn id=2023 lang=python3
#
# [2023] 连接后等于目标字符串的字符串对
#
# @lc code=start
class Solution:
def numOfPairs(self, nums: List[str], target: str) -> int:
count = 0
length = len(nums)
for i in range(length):
for j in range(length):
... | true |
3b51f0f99d8e9e6f5ec42855ddbc7bdcca65602b | fujihiraryo/aizu-online-judge | /DPL/05J_BallsAndBoxes10.py | UTF-8 | 296 | 2.8125 | 3 | [] | no_license | MOD = 10 ** 9 + 7
n, k = map(int, input().split())
dp = [[0] * (k + 1) for _ in range(n + 1)]
for i in range(n + 1):
dp[i][1] = 1
for j in range(2, k + 1):
dp[i][j] = dp[i][j - 1]
if i >= j:
dp[i][j] += dp[i - j][j]
dp[i][j] %= MOD
print(dp[n][k])
| true |
2f60b3e41f336a14855e6171742841b99b29e5f4 | IanHawke/HighamSDEs | /cle_mm.py | UTF-8 | 802 | 2.765625 | 3 | [
"Unlicense"
] | permissive | import numpy as np
# Stoichiometric matrix
V = np.array([[-1.0, 1.0, 0.0],[-1.0, 1.0, 1.0],[1.0, -1.0, -1.0],[0.0, 0.0, 1.0]])
# Parameters and Initial Conditions
nA = 6.023e23 # Avagadro's number
vol = 1e-15 # volume of system
Y = np.zeros((4,))
c = np.zeros((3,))
d = np.zeros_like(c)
a = n... | true |
637831cef60aa2badf63cad9ded173876640643f | bce-toolkit/historical-bcepy | /bce/parser/molecule/ast/base.py | UTF-8 | 8,772 | 2.546875 | 3 | [] | no_license | #!/usr/bin/env python
#
# Copyright 2014 - 2016 The BCE Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the license.txt file.
#
import bce.parser.common.ast as _ast
import bce.parser.molecule.status as _ml_status
import bce.math.constant as _math_cst... | true |
bccc603cea554215bddd55611f0fad6a8b1ab249 | bssrdf/pyleet | /B/BasicCalculatorIII.py | UTF-8 | 2,223 | 3.84375 | 4 | [] | no_license | '''
-Hard-
*Stack*
Implement a basic calculator to evaluate a simple expression string.
The expression string may contain open ( and closing parentheses ), the
plus + or minus sign -, non-negative integers and empty spaces .
The expression string contains only non-negative integers, +, -, *, /
operators , open ( a... | true |
3f887da67ee5f86f7935c2f857bc8ca164e399a6 | albertsalomo/TextRPG | /bet_Text_Rpg_V.1.0.6.py | UTF-8 | 43,358 | 2.9375 | 3 | [] | no_license | import textwrap
import sys
import os
import time
import random
screen_width = 300
##### Title Screen #####
def game_logo():
print("####################################################################")
print("# /\ /\ /\ /\ __ /\ #")
print("# / \ ~... | true |
ba5898b2a6e5b863736cbf23f35eb3de4cedb260 | hannonq/bcc264-email | /push_email/utils.py | UTF-8 | 4,860 | 2.703125 | 3 | [] | no_license | __author__ = 'hannon'
import threading
import re
from email.utils import parsedate_to_datetime
from imbox import Imbox
from .models import MyEmail, EmailId
# Global Variables
pattern = re.compile('\[BCC423\]\[\d{2}\.\d\.\d{4}] Agenda \d{2}/\d{2}/\d{4} \d{2}:\d{2}')
timeout = 60
imap = {1: 'imap.gmail.com',
... | true |
6402d8c109bdaa761af01ea763b901a432a8cb5e | sourabh1000/PARIKSHA-The-Online-Exam-Portal | /online exam.py | UTF-8 | 1,948 | 3.15625 | 3 | [] | no_license | 2#Project on Online Exam Management
#--------------------------------------------------------------------------------
#MODULE : Online Exam Management
import Database
import Menulib
import Student
import Subject
import Exam
import joinclass
import tests
import menulibstudent
import Attendance
Database.DatabaseCreate()
... | true |
e29d0551def1791180c1d19c4ab8a2760a1cddcb | lolostheman/PythonSort | /algo.py | UTF-8 | 1,339 | 3.375 | 3 | [] | no_license | import random
#jhl;kjhlkjhlkjhkjhjhjhuj
def bubble_sort(arr):
n = len(arr)
temp = 0
for x in range(n):
for i in range(len(arr)-1):
if arr[i] > arr[i+1]:
temp = arr[i]
arr[i] = arr[i+1]
arr[i+1] = temp
return arr
def merg... | true |
9d719824e287f0b2f9f3eed8fab55eea5eed55e7 | zengkaipeng/Machine_Learning | /visualize_ridge.py | UTF-8 | 2,224 | 2.671875 | 3 | [] | no_license | import json
import math
import numpy as np
import pickle
from matplotlib import pyplot as plt
import os
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def Gauss(x, Mu, Gx):
return 1 / (np.sqrt(2 * math.pi) * np.sqrt(Gx)) * \
np.exp(-(x - Mu) * (x - Mu) / (2 * Gx))
def CalMu_Sigma(Array):
Mu = np.... | true |
80cdbe95ff0efb6ba29ce0c1068f11740eb80d88 | Elwyslan/leukemia-classification-system | /rawDataHandler.py | UTF-8 | 4,616 | 2.515625 | 3 | [] | no_license | import sys
import os
from pathlib import Path
from itertools import chain
import pandas as pd
trainPath = Path('C-NMC_Leukemia/C-NMC_training_data/')
prelimPhaseLabels = Path('C-NMC_Leukemia/C-NMC_test_prelim_phase_data/C-NMC_test_prelim_phase_data_labels.csv')
prelimPhaseData = Path('C-NMC_Leukemia/C-NMC_test_prelim... | true |
29b1963e791a6c55bfed789f90a0fb382e5ed9d0 | Kai-Bailey/WebSock | /websock/ServerException.py | UTF-8 | 446 | 2.609375 | 3 | [
"MIT"
] | permissive | class WebSocketInvalidHandshake(Exception):
""" The client and server were unable to complete the handshake protocol
"""
def __init__(self, message, client):
super().__init__(message)
self.client = client
class WebSocketInvalidDataFrame(Exception):
""" The server was unable to parse t... | true |
e92033a7691b22ede1f7396d478360806ff9f4db | avidale/anekbot-example | /train_index.py | UTF-8 | 837 | 2.78125 | 3 | [] | no_license | from collections import defaultdict
from tqdm.auto import tqdm
from jokes import tokenize, load_jokes, lemmatize
if __name__ == '__main__':
print('creating inverse index for jokes...')
texts = load_jokes()
inverse_index = defaultdict(list)
for i, text in enumerate(tqdm(texts)):
for token in t... | true |
01784e29bc1ecf85104ee4854070eea4ec4a3867 | muhammadbassiony/Piccolo-Cipher | /piccoloroundpermutation.py | UTF-8 | 559 | 2.875 | 3 | [] | no_license |
from utils import split_bits, concat_split_num
# Pass 64 bit and returns 64 bit
def round_permutation(X):
x = split_bits(X, 8)
# in case the leading zeros were not counted
while len(x) < 8:
x.insert(0, 0)
x8 = []
x8.append(x[2])
x8.append(x[7])
x8.append(x[4])
x8.append(x[1]... | true |
6d238360c2c8ffb4c4073e57c52c7d3df83807c4 | yeyi-i/MYzhihu | /client_test.py | UTF-8 | 402 | 2.71875 | 3 | [] | no_license | #!/usr/bin/python3
import socket
# 创建 socket 对象
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# 获取本地主机名
host = socket.gethostname()
# 设置端口号
port = 8888
# 连接服务,指定主机和端口
s.connect((host, port))
s.send("https://www.zhihu.com/question/380089207/answer/1084080389".encode('utf-8'))
msg = s.recv(1024)
print(msg.d... | true |
f465aefb465812b199e056e7152cff020d9207fe | juancargm/Information-retrieval-based-on-readability | /src/Index.py | UTF-8 | 2,352 | 3.234375 | 3 | [] | no_license | from math import log10, sqrt
class Index:
def __init__(self):
self.words = dict()
self.documents = dict()
self.frequencies = dict()
def add(self, word, document):
if word not in self.words:
occurrences = dict()
occurrences[document] = 1
pa... | true |
dffece271586de26eaef41b0b5490e31ab661705 | zhangweiIOT/MicroPython_Examples | /哥伦布(STM32F407)/4.拓展实验/2.RGB彩灯/2.8X8矩阵(64 LEDS)/main.py | UTF-8 | 737 | 3.21875 | 3 | [
"MIT"
] | permissive | '''
实验名称:8X8矩阵
版本:v1.0
日期:2021-4
作者:01Studio
说明:Neopixel WS2812 RGB灯控制。
'''
import neopixel,time
from machine import Pin
#定义红、绿、蓝三种颜色
RED=(255,0,0)
GREEN=(0,255,0)
BLUE=(0,0,255)
#灯带初始化,PB1引脚,灯珠数量64。
np = neopixel.NeoPixel(Pin('B1', machine.Pin.OUT), n=64)
while True:
np.fill(RED) #红色
np.write() # 写入... | true |
2e36f3140459f7bdaaf35d9363b90015a0ec1156 | Toshiki-Sasaki-0417/Learning | /techgym_python/05-09.py | UTF-8 | 541 | 2.65625 | 3 | [] | no_license | #**************************************************************************
#05-09
#**************************************************************************
from google.colab import files
uploaded_file = files.upload()
uploaded_file_name = next(iter(uploaded_file))
import cv2
import matplotlib.pyplot as plt
img = ... | true |
401181448f779c80643bb8f802e917c6c4ab9f33 | OctavioOp/python_intermediate | /python_map_sort_filter.py | UTF-8 | 1,507 | 3.671875 | 4 | [] | no_license | objetos = [
{
"name": "Luke Skywalker",
"height": "172",
"mass": "77",
"hair_color": "blond",
"skin_color": "fair",
"eye_color": "blue",
"birth_year": "19BBY",
"gender": "male"
},
{
"name": "Wilhuff Tarkin",
"height": "180",
... | true |
64f35199201722bdc36a00324903069f3abf9da6 | zhenliang153/leetcode_weekly_spider | /user_loader.py | UTF-8 | 469 | 2.515625 | 3 | [] | no_license | '''
file : user_loader.py
author : zhenliang153(zhenliang153@163.com)
date : 2020-11-29 19:03:21
brief : 获取用户信息
'''
#import os
#import sys
class UserLoader(object):
def getUser(self, file):
users = []
with open(file, 'r') as user_ids:
for user_id in user_ids:
user_id = u... | true |
13b218a1790edccfa88ae8d7d61e813c00850758 | catxuxiang/sky-simplemud | /src/SimpleMUD/Logon.py | UTF-8 | 6,063 | 2.734375 | 3 | [] | no_license | '''
Created on 2012-4-25
@author: sky
'''
from SocketLib.ConnectionHandler import ConnectionHandler
from SocketLib.Telnet import *
from BasicLib.BasicLibLogger import USERLOG, ERRORLOG
from SimpleMUD.PlayerDatabase import playerDatabase
from SimpleMUD.RoomDatabase import roomDatabase
from SimpleMUD.Player im... | true |
cfa6b79f17e804ab1b77fade59c7265530aab938 | jingruzhang/j4462-assignments-jingru | /api_assgn.py | UTF-8 | 3,024 | 3.1875 | 3 | [] | no_license | import json
import requests
import sys
url = "http://openstates.org/api/v1/legislators/?state=mo&active='true'"
url_1 = "http://openstates.org/api/v1/bills/?state=mo&search_window=session:2016&chamber=upper"
url_2 = "http://openstates.org/api/v1/bills/?state=mo&search_window=session:2016&chamber=upper&q=abortion"
u... | true |
709779669418a19b281a860830d9d87e7db15e8d | syves/algorithms | /recursive_choc.py | UTF-8 | 722 | 3.28125 | 3 | [] | no_license | # ::num_choc //[int], int=>int
def num_choc(dollars, cost, wrappers_required, wrappers):
if dollars >= cost:
return (1 + num_choc(dollars - cost, cost, wrappers_required, wrappers + 1))
elif wrappers >= wrappers_required:
return 1 + (wrappers - wrappers_required) + num_choc(dollars, cost, wrappe... | true |
8e8dc936eb477e8b1673de8db19385a4acf1c53e | T567U1/heroku_website | /cov_19/views.py | UTF-8 | 1,821 | 2.515625 | 3 | [] | no_license | from django.shortcuts import render
from bs4 import BeautifulSoup
from selenium import webdriver
import requests, time, lxml, os, locale
# Create your views here.
def cov_19(request):
base_url = "https://corona.lmao.ninja/v2/all"
response = requests.get(base_url)
jsonFile = response.json()
countries = ... | true |
f2f9335968b1fc47bd3dedb0c56e3581110dd1df | calofmijuck/BOJ | /Codes/17200/17213.py | UTF-8 | 210 | 2.96875 | 3 | [] | no_license | def H(n, m):
n = n + m - 1;
k = min(n - m, m)
ret = 1
for i in range(n, n - k, -1):
ret = ret * i // (n - i + 1)
return ret
n = int(input())
m = int(input())
m -= n
print(H(n, m))
| true |
5cbb0d211bd9a0a40547f0252cd6e32adb1a6fee | paau12/dogofinder-backend | /api/tests/test_views.py | UTF-8 | 6,581 | 2.5625 | 3 | [] | no_license | import json
from rest_framework import status
from django.test import TestCase, Client
from django.urls import reverse
from ..models import Mascota
from ..serializers import Mascota_serializer
# Initialize APIClient app
client = Client()
# Test - Verify fetched records
class GetAllMascotasTest(TestCase):
"""
... | true |
b2915889ca02e0409e956804b1ddeaef99127a1d | nityxlabs/NeoStream | /Algorithms/SVSv7/GenomicVariant.py | UTF-8 | 12,079 | 2.703125 | 3 | [] | no_license | #/usr/bin/python
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
from Isoform import Isoform
from IsoformSJ import IsoformSJ
from MultiIsoform import MultiIsoform
from TranscribeTranslate_V5 import TranscribeTranscript, TranslateTranscript
"""
Needs for TTV5/GenomicVariant
-need a way to see which isoforms co... | true |
ef50d912f2cbf3c0467ea06ccfcea0dad2998b2a | hbhatia3/Hbhatia3 | /SummerPractice/TCP/IPserver.py | UTF-8 | 441 | 2.953125 | 3 | [] | no_license | import socket
class IPserver:
host = "localhost"
port = 4000
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((host, port))
s.listen(1)
print("Server listening on port: ", port)
c, addr = s.accept()
print("connection from: ", str(addr))
c.send(b"Connection successfully... | true |
5a3cab5e2b4e4a3061a162231e4a346e29d27f56 | CryptoSalamander/BasicML_Swmaestro | /머신러닝교육/perceptron_nand_nor.py | UHC | 1,157 | 3.359375 | 3 | [] | no_license | import numpy as np
from elice_utils import EliceUtils
elice_utils = EliceUtils()
# 1. NAND_gate Լ ϼ.
def NAND_gate(x1, x2):
x = np.array([x1,x2])
weight = np.array([-0.5,-0.5])
bias = 0.75
y = np.sum(x*weight)+bias
return Step_Function(y)
# 2. NOR gate Լ ϼ.
def NOR_gate(x1, x2):
x = ... | true |
835443ee011c0855167a15738c50f919dca5c1b0 | arthurDz/algorithm-studies | /leetcode/bulb_switcher_3.py | UTF-8 | 1,501 | 3.59375 | 4 | [] | no_license | # There is a room with n bulbs, numbered from 1 to n, arranged in a row from left to right. Initially, all the bulbs are turned off.
# At moment k (for k from 0 to n - 1), we turn on the light[k] bulb. A bulb change color to blue only if it is on and all the previous bulbs (to the left) are turned on too.
# Return th... | true |
410eeb40aa6dafc86118570abc757fe871a155dd | darkknight1989/Python-Scripts | /funtions.py | UTF-8 | 115 | 2.609375 | 3 | [] | no_license | #!/usr/bin/env python
def hello():
print('Hey')
print('Gday')
print('How you doing')
hello()
hello()
hello()
| true |
7fc43e0331c5836bb083b5d4974c42807f5a96f9 | snsd0805/ChiSteward | /wins/NcnuMainWin.py | UTF-8 | 976 | 2.578125 | 3 | [] | no_license | from tkinter import *
from tkhtmlview import HTMLLabel
from api.ncnuMain import NcnuMainAPI
def createNcnuMainWin():
win=Tk()
win.title("暨大官網最新資訊!")
win.geometry("600x600")
textLb=Label(win,text="暨大校園最新資訊",font="Helvetica 20",bg="#ffcccc")
sb=Scrollbar(win)
htmlLable=HTMLLabel(win)
htm... | true |
7493e9f6b8baab83e4066372cbc08ce62771bc45 | BoomBat/OpenSezMe | /OpenSezMe.py | UTF-8 | 8,523 | 2.703125 | 3 | [] | no_license | from tkinter import *
import pickle
from passdat import *
import random
db = {}
try:
with open('passdb', 'rb') as file_obj:
db = pickle.load(file_obj)
except:
pass
class App(Frame):
#Master Section
def __init__(self, master, db):
Frame.__init__(self)
self.master.title("OpenSez... | true |
0f6e21f6fc55f6a71149850bbe7032d6b2db0728 | qcl/hundred-day-s-reform | /leetcode/929-uniqure-email-address.py | UTF-8 | 526 | 2.953125 | 3 | [] | no_license | class Solution(object):
def numUniqueEmails(self, emails):
"""
:type emails: List[str]
:rtype: int
"""
address = {}
for email in emails:
name, domain = email.split('@')
name = name.split('+')[0].replace('.','')
mailAddress = '%s@%s'... | true |
0509ed87ff7b197d9e62b4653c2494dc68bc510a | mr6infinityGem/rebirth | /permutate.py | UTF-8 | 2,526 | 4.1875 | 4 | [] | no_license | #construct all permutations on a sequence. for example, there are 24 possibilities for an array of length 4 in which each element is unique.
#first done recursively. after that, attempts were made to permutate without recursion, with limited success.
#am able to permutate without recursion for any given size, but not... | true |