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 |
|---|---|---|---|---|---|---|---|---|---|---|
2aabb3f9918437d743406b8767a0e3e68b818201 | aakaashkapoor/ASLRecognition | /train.py | UTF-8 | 2,444 | 3.6875 | 4 | [] | no_license | # function that takes in trained data of an american
import xlrd
from sklearn import svm
# get the workbook in a variable to get all the sheets one by one
workbook = xlrd.open_workbook('/Users/aakaashkapoor/Downloads/Research/02-26-18 SLR.xlsx')
#
# get the data of a workbook into
#
def getData():
# storing th... | true |
4ee3b34758d3105a24a87af68118c33366e5350d | xyLotus/HTMLPy | /HTMLPy.py | UTF-8 | 8,763 | 3.28125 | 3 | [
"Apache-2.0"
] | permissive | """
HtmlWriter is a libary made for efficiently creating HTML documents in Python.
"""
__auhtor__ = 'Lotus'
__version__ = 0.5 # 18-03-2021 | semi-stable
# stdlibs
import os
import datetime
# Non-stdlibs
try:
from bs4 import BeautifulSoup
except ImportError as e:
print('Error while trying to im... | true |
0e84be73dd5413c6d5727391facfd74ba9b44107 | mcneel/rhino-developer-samples | /rhinopython/SampleArrayCrv.py | UTF-8 | 1,314 | 2.5625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | ################################################################################
# SampleArrayCrv.py
# Copyright (c) 2018 Robert McNeel & Associates.
# See License.md in the root of this repository for details.
################################################################################
import Rhino
import rhinoscr... | true |
e0f796eb11ffd7acf2236075b324e9279bcfc38b | obinnaonyema/FaceRecognitionWithOpenCV | /face_recog_videoV2.py | UTF-8 | 2,589 | 2.828125 | 3 | [] | no_license | '''
This file implements face recognition using the face-recognition library which runs on the dlib
face recognition module.
From my experience it is an improvement on the performance of haarcascades.
'''
import cv2 as cv
import numpy as np
import os
import face_recognition
faceLocations = np.load('faceLocations.npy... | true |
e5575214f3dfbfc75741fff9fe9b9c53b856055f | BrainiacRawkib/Learning-Python | /managed_attributes/person.py | UTF-8 | 776 | 3.578125 | 4 | [] | no_license | class Person:
def __init__(self, name):
self._name = name
def get_name(self):
try:
print('fetching...')
return self._name
except AttributeError:
print('No attribute found!')
def set_name(self, value):
print('changing...')
self._na... | true |
047c82aa78ab6323cd818b8449b798d8a3ec2c23 | SaitoTsutomu/leetcode | /codes_/1122_Relative_Sort_Array.py | UTF-8 | 548 | 3.65625 | 4 | [
"MIT"
] | permissive | # %% [1122. Relative Sort Array](https://leetcode.com/problems/relative-sort-array/)
# 問題:arr1を前半と後半に分けて返せ。前半はarr2の順、後半は残りをソートせよ
# 解法:collections.Counterを用いる
class Solution:
def relativeSortArray(self, arr1: List[int], arr2: List[int]) -> List[int]:
p = [(i, i in arr2) for i in arr1]
c1 = collection... | true |
d0c4eac0e98c2acc756561becef1a8b811a917a6 | jeremiedecock/snippets | /python/matplotlib/hist.py | UTF-8 | 2,813 | 3.34375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plot a histogram
See:
- http://bespokeblog.wordpress.com/2011/07/11/basic-data-plotting-with-matplotlib-part-3-histograms/ (nice introduction)
- http://matplotlib.org/examples/pylab_examples/histogram_demo_extended.html
- http://matplotlib.org/api/pyplot_api.html#m... | true |
a809ebb47e903fae5a50cab1364bb8a20cac5152 | donkeyteethUX/evaluatethis | /django_code/courses.py | UTF-8 | 8,121 | 2.890625 | 3 | [] | no_license | #-------------------------------------------------------------------------------
# Name: Courses
# Purpose: Queries the sql database and build Pandas DataFrames to provide
# all information needed on webpage.
#
# Author: Alex Maiorella, Lily Li, Maya Shaked, Sam Hoffman
#
# Created: 03/... | true |
08b99cde2762b5efd2c0913ecb6df85faf491535 | IanMulvany/partiallyattended | /tag_generator.py | UTF-8 | 1,088 | 2.734375 | 3 | [
"MIT"
] | permissive | import glob
import ruamel.yaml as yaml
import io
blog_posts = glob.glob("_posts/*")
tags = set([])
for blog_post in blog_posts:
with open(blog_post) as stream:
try:
docs = yaml.load_all(stream)
for doc in docs:
try:
for item in doc.items():
... | true |
95e14542cf93d5cea7d2f4f6152d72551e1a1c6c | majf2015/flask | /flasg/app/test.py | UTF-8 | 409 | 2.609375 | 3 | [
"MIT"
] | permissive | from datetime import datetime,timedelta
import time
now = datetime.now()
ti = time.time()
print now
print now + timedelta(hours= 1), now + timedelta(days=1), now + timedelta(days=1, hours=2, minutes=3, seconds=4)
print ti
print datetime.fromtimestamp(ti)
dt = datetime(2014, 10, 10, 12, 30, 40)
print dt
dts = 1... | true |
8af59a369a0c6de7f3734c0f1d593763bfdfcee5 | youssef-abbih/python_projects | /mail_merging/main.py | UTF-8 | 438 | 2.8125 | 3 | [] | no_license | names_list = []
txt = "[name]"
with open("Input/Names/invited_names.txt") as names:
names_list = [name.strip('\n') for name in names.readlines()]
with open('Input/Letters/starting_letter.txt',mode = "r") as letter:
letter_content = letter.read()
for name in names_list:
new_letter = letter_content.replace(txt,name)... | true |
db790b23c8b63156263effbf6b067716a27f4d26 | yaeshimo/hello-python | /sort/shell.py | UTF-8 | 774 | 3.328125 | 3 | [] | no_license | # vim: fileencoding=utf-8
import numpy as np
def insertion(arr, interval=1):
for i in range(0, len(arr), interval):
v = arr[i]
j = i-interval
while j > -1 and v < arr[j]:
arr[j+interval] = arr[j]
j -= interval
# fill in the blank
arr[j+interval] = v
... | true |
1cce89eedd6c9f7275328edaa2fb6ffe448952d8 | Christymary/pythonprograms | /pattern_programs/squarepattern.py | UTF-8 | 117 | 3.671875 | 4 | [] | no_license | row=int(input("enter row"))
for i in range(row):
for j in range(row):
print("*",end=" ")
print()
| true |
b9b3837a5b84fdad70f707d10d55acf96dfbe336 | shriyans16/SOEN-6441 | /calc_l.py | UTF-8 | 1,572 | 3.71875 | 4 | [] | no_license | from decimal import *
class MathClass(object):
@staticmethod
def factorial(n): # global variable to be used throughtout the program
if n < 1:
return 1
else:
return n * MathClass.factorial(n - 1)
@staticmethod
def calc_pi():
p = Decimal(0)
for a... | true |
f0c761f37fd6946900cc951ff34dd918ff463bbb | ensarbaltas/7.hafta-odevler | /TelRehberi.py | UTF-8 | 3,756 | 3.296875 | 3 | [] | no_license | ##telefon rehberi uygulamasi
##Bu odevde bir telefon rehberi simulasyonu yapmanizi istiyoruz.
##Program acildiginda kullaniciya, rehbere kisi ekleme, kisi silme, kisi isim ya da tel bilgisi guncelleme,
##rehberi listeleme seceneklerini sunun. Kullanicinin secimine gore gerekli inputlarla programinizi sekillendirin.
##... | true |
004ef66f572cf9fa6d0c32b264b8cc9ecea01ceb | blossom/gae-utils | /util.py | UTF-8 | 769 | 2.96875 | 3 | [] | no_license | import uuid
import base64
import urllib
import hashlib
def generate_key():
"""
generates a uuid, encodes it with base32 and strips it's padding.
this reduces the string size from 32 to 26 chars.
"""
return base64.b32encode(uuid.uuid4().bytes).strip('=').lower()
def gravatar(email):
gravatar_ur... | true |
4b18ad0976bb706f5f08f323d5decce122791f44 | codeking-hub/Coding-Problems | /AlgoExpert/invertBinaryTree/itarative.py | UTF-8 | 491 | 3.625 | 4 | [] | no_license | def invertBinaryTree(tree):
# Write your code here.
queue = [tree]
while len(queue):
current = queue.pop(0)
if current is None:
continue
current.left, current.right = current.right, current.left
queue.append(current.left)
queue.append(current.right)
# ... | true |
196099e413520491104e8b20a5f8d9c1707bdd67 | Madhu-Kumar-S/Python_Basics | /Basic Programs/fact_recursion.py | UTF-8 | 280 | 4.46875 | 4 | [] | no_license | # Python Program for factorial of a number using recursion
def factorial(n):
if n == 0:
return 1
else:
result = n * factorial(n-1)
return result
n = int(input("enter a no:"))
fact = factorial(n)
print("factorial of {} is {}".format(n, fact))
| true |
8664e42df344a2cfdb4c4a5ba5a34f7ca41c4749 | osser/knowhow | /python/opencv/HoughLinesP.py | UTF-8 | 1,259 | 3.0625 | 3 | [] | no_license | import numpy as np
import cv2
img = cv2.imread("mylogo.png")
# img = cv2.imread("gta5.jpg")
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
bw = cv2.bitwise_not(gray)
# ハフ変換でラインの検出
lines = cv2.HoughLinesP(bw, rho=1, theta=np.pi/360, threshold=80, minLineLength=80, maxLineGap=5)
# lines = cv2.HoughLinesP(bw, rho=1, thet... | true |
0d279128d90a37e985a729c84a07e0a402bfdd44 | oo363636/test | /ForOffer09.py | UTF-8 | 1,062 | 4.375 | 4 | [] | no_license | """用两个栈实现一个队列。队列的声明如下,请实现它的两个函数 appendTail 和 deleteHead ,
分别完成在队列尾部插入整数和在队列头部删除整数的功能。(若队列中没有元素,deleteHead 操作返回 -1 )"""
class ForOffer09:
"""stack1来添加,stack2来删除
当stack2空时,看看stack1有什么元素,给append进stack2
如果stack1没元素,则stack2还是空,return -1
如果stack1有元素,则正常pop stack2的元素,即为head元素"""
def __init__(self):
... | true |
c59b1ab42eb379a31b86b125e1512c3bd528cfa9 | yxforever/StupidCode | /code/Pytrain/分支语句/intocm.py | UTF-8 | 371 | 4.0625 | 4 | [] | no_license | """
公英制单位转换
"""
value = float(input('请输入长度:'))
unit = input('请输入单位(in/英寸,cm/厘米):')
if unit == 'in' or unit == '英寸':
print('%f英寸 = %f厘米'% (value,value*2.54))
elif unit == 'cm' or unit == '厘米':
print('%f厘米 = %f英寸'% (value,value /2.54))
else:
print('请输入正确的单位。')
| true |
10b8b2e3be8897f90ae5aa82906fcec4c50e7caa | SvenGronauer/tensorbox | /tensorbox/common/probability_distributions.py | UTF-8 | 4,590 | 3.140625 | 3 | [
"MIT"
] | permissive | from abc import ABC, abstractmethod
import gym
import numpy as np
import tensorflow as tf
def get_probability_distribution(space):
assert isinstance(space, gym.spaces.Space)
if isinstance(space, gym.spaces.Discrete):
return CategoricalDistribution(num_classes=space.n)
elif isinstance(space, gym.s... | true |
554a22f6030e603a02dcd1aa2423698a3539a40c | prasannakumar0696/PythonLogicalPrograms | /Expression.py | UTF-8 | 634 | 3.90625 | 4 | [] | no_license | input_value = input("enter valid Special Chars: ")
def check_expr(val):
if len(input_value)%2 == 0:
for i in range(int(len(input_value)/2)):
if input_value[i] == '(' and input_value[-(i+1)] == ')':
continue
elif input_value[i] == '{' and input_value[-(i+1)] ... | true |
a5d965078579d413f0c97bba7d3ebd5e79fc78c1 | umbynos/TLN | /progetto_radicioni/esercitazione_3/auto_summ.py | UTF-8 | 5,229 | 3.3125 | 3 | [] | no_license | # Automatic Summarization with NASARI
from nltk.corpus import stopwords
from nltk.tokenize import sent_tokenize
from nltk.stem import WordNetLemmatizer
import string
# reads file starting from line 5 (title, then paragraphs)
def main():
# read NASARI file
nasari_file = open("dd-small-nasari-15.txt", "r", enc... | true |
003b279c5114b4b021d89c4b9c88961026b655c1 | gitter-badger/python_me | /hackrankoj/strings/string_formatting.py | UTF-8 | 1,548 | 3.71875 | 4 | [] | no_license | #!/usr/bin/python
#-*- coding: utf-8 -*-
"""
Read the integer, and print the decimal, octal, hexadecimal, and binary values from to with space padding so that all fields take the same width as the binary value.
17
1 1 1 1
2 2 2 10
3 3 3 11
4 4 4 100
... | true |
5763f9ac8eb453b4cf996d5f4eaeffc696153066 | Spagecko/RosterFiller_prototype- | /RosterReaderProtoType.py | UTF-8 | 2,117 | 2.875 | 3 | [] | no_license | #Bennett Lawrenz 7/5/17
import openpyxl
import os
import sys
from selenium import webdriver
varRow = 5
varCol = 3 # row and colum variables
driver = webdriver.Firefox()
driver.get('file:///C:/Users/+++/Documents/HTML5/BasicForm.html')
os.chdir('c:\\Users\\++++ \\Documents\\Excel') #changes the current... | true |
1b10b972e9e96eaedcfa434d32e4b39aec8c081d | fruchtereric32/PantryProject | /MainFood.py | UTF-8 | 744 | 3.21875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 3 16:23:08 2019
@author: ericp
"""
import CookingItem
##The class mainfood is used for the creation and keeping tracking of any foods considered a main\
##It is a subclass of CookingItem
class MainFood(CookingItem.CookingItem):
##The constructor here has the abilit... | true |
3f19096f706afbfec1fd4826fcfffcf9e61c8a30 | liujie40/gad-v2 | /src/data_partition.py | UTF-8 | 3,926 | 2.53125 | 3 | [] | no_license | # convert streaming test data into a list of pickled data by users, ordered by days.
import cPickle
from config import config
from batch import DayBatcher
import numpy as np
import operator
import os
def partition_by_user(infile_by_days, outfile_by_users):
day_batcher = DayBatcher(infile_by_days, skiprow=1)
... | true |
1289143be9379c19e2822b0985d47da37a1ba474 | srihariintain/facematch | /test_automate.py | UTF-8 | 1,010 | 2.546875 | 3 | [] | no_license | import os,sys
from test_automate_fun import facematch
import json
from itertools import permutations
folder = "test samples"
results={}
for folder_sub in os.listdir(folder):
subpath = "C:/drive/internships/intainai/face_match/test samples/"+folder_sub
input_path=[]
for filename in os.listdir(subpath):
... | true |
25bbb5e1707acc17a267186af5e202e2a8117324 | AdamZhouSE/pythonHomework | /Code/CodeRecords/2339/60829/276284.py | UTF-8 | 286 | 3.015625 | 3 | [] | no_license | def change(b,x):
count=0
for i in range(0,x-1):
for j in range(i+1,x):
if b[i]>b[j]:
count=count+1
return count
n=int(input())
for i in range(n):
a=int(input())
b=[int(x) for x in input().split(" ")]
x=change(b,a)
print(x) | true |
5ac60b3bd7a6bc23234929a195945440c72fc3c2 | RushabQA/Python-Requests-With-Docker-Task | /application_2/app.py | UTF-8 | 740 | 2.78125 | 3 | [] | no_license | from flask import Flask, Response, request
import random
import requests
app = Flask(__name__)
@app.route('/animal', methods=['GET'])
def animal():
animals= ["dog", "cat", "cow", "pig"]
choice = random.choice(animals)
return Response(choice, mimetype='text/plain')
@app.route('/noise', methods=['GET', '... | true |
cccaa07bf9990378e8f4098a6902db49d0457564 | peacelocker125/ScraperBC | /scraper/views.py | UTF-8 | 1,900 | 2.53125 | 3 | [] | no_license | from django.shortcuts import render
import datetime
import selenium
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
... | true |
bc1c5a68d8f8952dd6dd9c2328a18118d9959421 | umme-ammara/Internet-Measurements-Midterm | /process.py | UTF-8 | 978 | 3.359375 | 3 | [] | no_license | import pandas as pd
import regex
#Read the scraped data and store it in a dataframe
d = pd.read_csv('scrape_results.csv')
info = d['list1_selection2'] #The info contains Ip, web host provider name, and the country location
#print(info)
ipaddr = []
country = []
webhosts = []
#Process the scarped data ... | true |
ca52de27b9b74b99f555f63d076227b7ed07172f | thomasgolding/housemonitor | /analysis/house.py | UTF-8 | 1,899 | 2.609375 | 3 | [] | no_license | from datetime import datetime
from typing import Optional
import pandas as pd
from google.cloud.firestore import Client
def get_client():
client = Client()
return client
class House:
collection_name = "measurements"
def __init__(self, client: Optional[Client] = None):
if client:
... | true |
70f8336211f3bb3c4b104eaed6b656734f6347d6 | gabriellaec/desoft-analise-exercicios | /backup/user_343/ch4_2019_03_03_13_52_44_349494.py | UTF-8 | 202 | 3.015625 | 3 | [] | no_license | def classifica_idade(x):
if x<11;
return y
elif x<=17;
return z
else;
return w
y = 'crinca'
z = 'adolescente'
w = 'adulto'
x = 10
print (classifica_idade(x))
| true |
807c6c77fd1a9e12da1945d8c3ee70299ca852c9 | endreujhelyi/endreujhelyi | /week-04/day-3/11a.py | UTF-8 | 357 | 3.421875 | 3 | [] | no_license | from tkinter import *
top = Tk()
size = 300
canvas = Canvas(top, bg="coral", height=size, width=size)
def square_drawer(side, number):
extra = 10
for i in range(0, number):
canvas.create_rectangle(extra+(i*side), extra+(i*side), extra+((i+1)*side), extra+((i+1)*side), fill='purple')
square_drawer(10... | true |
ed7f7ef61c69dfb9a460650b5e0a18d34769291f | kjm1559/kaggle | /M5_forecasting/M5_predict_5.py | UTF-8 | 33,620 | 2.53125 | 3 | [] | no_license | from datetime import datetime, timedelta
import gc
import numpy as np, pandas as pd
import tensorflow.keras as keras
CAL_DTYPES={"event_name_1": "category", "event_name_2": "category", "event_type_1": "category",
"event_type_2": "category", "weekday": "category", 'wm_yr_wk': 'int16', "wday": "int16",
... | true |
16e35ef6595dd1f9a92dd9d63db12458bc7ac41d | bobchen1701/nglpy | /nglpy/Graph.py | UTF-8 | 6,963 | 2.84375 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | ########################################################################
# Software License Agreement (BSD License) #
# #
# Copyright 2018 University of Utah #
# Scientific Computing and I... | true |
46cc2971b7ec747d22c41deb0d30ae7c639fd82a | KFurudate/Atcoder_SHOJIN | /Atcoder/猪突猛進_貪欲法/辞書式順序/ABC_007_B_辞書式順序.py | UTF-8 | 660 | 3.96875 | 4 | [] | no_license | #https://atcoder.jp/contests/abc007/tasks/abc007_2
"""
それぞれの文字列の同じ位置同士を先頭から比較していって、初めて不一致になったら、
その文字同士の(アルファベットでの)比較結果が文字列の全体の比較結果である。
例えば、 " a b c d " と " a x " を比較すると、 2 文字目で、 ′ b ′ < ′ x ′ となるので、
" a b c d "<" a x " である。
もし、比較している途中で片方の文字列が尽きてしまったら、文字列の長さが短い方が小さい。
例えば " a b "<" a b c " である。
"""
A = input()
if len... | true |
369586a9ae4c4b9aa6ad368692c70a0b46ba7b3f | Chris1221/deepStab | /deepstab/utr.py | UTF-8 | 6,546 | 2.84375 | 3 | [] | no_license | #import velocyto as vcy
import math as ma
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import loompy
import pdb
class entrySimple:
"""More simple structure for the barebones fasta from the bedtools runs"""
def __init__(self, _lines: str):
if _lines != "":
self.geneName = _lines[1:].r... | true |
4fd6368278c557a350fd594d217931ed1b941fe6 | gijswijnholds/tensorskipgram-torch | /tensorskipgram/evaluation/composers.py | UTF-8 | 9,722 | 2.9375 | 3 | [] | no_license | """Define ways of composing vectors/matrices together into a sentence embedding."""
import numpy as np
from typing import List, Union, Tuple, Callable
from tensorskipgram.evaluation.spaces import Vector, Matrix
"""Intransitive Models."""
def cat_intrans(vects: List[Union[Vector, Matrix]]) -> Vector:
subj_vec, v... | true |
f95cc4f6291fc400e11d536866efb4a737b2d704 | AdamZhouSE/pythonHomework | /Code/CodeRecords/2774/60825/298963.py | UTF-8 | 410 | 2.890625 | 3 | [] | no_license | t=""
while True:
try:
ts=input()
t+=ts
except:
break
if t=='3sss' or t=='1s':
print('''a''')
elif t=='17 501 12 5 111 2 100 10':
print('''5''')
elif t.startswith('17 501 12 85 111 2 10 10'):
print('''5''')
elif t.startswith('17 501 12 5 111 200 100 10'):
print(''... | true |
3f63d8ddacb7ecfd6509bbe1b750968b8c627067 | keinafarm/EcoAnimal | /Market.py | UTF-8 | 842 | 3.359375 | 3 | [] | no_license | ##################################################
#
# 取引処理
#
##################################################
class Market:
def __init__(self, animal_list, log):
"""
取引処理クラス
:param animal_list: ModelのAnimalリスト
:param log: Viewのlog表示
"""
self.animal_list = animal... | true |
455e95fff842bd126f1572fe464003c5edd45904 | rpi-techfundamentals/introml_website_fall_2020 | /site/_build/jupyter_execute/assignments/assignment5/hm.py | UTF-8 | 6,327 | 3.59375 | 4 | [
"MIT"
] | permissive | ## Homework 05 - Instructions

**WARNING!!! If you see this icon on the top of your COLAB sesssion, your work is not saved automatically.**
**When you are working on homeworks, make sure that you save often. You may find it ea... | true |
96ea09b90b8ee11c9d5ef4fd72fc00d86f4b5341 | seohyeonhwang/Python_basic | /python_basic_10.py | UTF-8 | 1,459 | 4.5 | 4 | [] | no_license | ##2019.11.15
'''
#quiz 4
def swap(a,b):
return b,a
a=1
b=2
a,b=swap(a,b)
print(a,b)
#quiz 5
##list는 return을 안해도 되는 함수 중 예외!!
def listReverse(x):
# for i in range(len(x)):
# temp=x[len(x)-1-i]
# x[len(x)-1-i]=x[i]
# x[i]=temp
#이거 다시 원래대로 나온 이유는? 바뀌고 다시 바뀌어서
for i in range(... | true |
676994a60e159cbe56852ede1e18d10c320eb5a3 | RaresM123/CSS_PROJECT | /operations.py | UTF-8 | 6,701 | 3.109375 | 3 | [] | no_license | def add_positive_numbers(first_number, second_number):
result = []
while len(first_number) and len(second_number):
last_digit_a = int(first_number[len(first_number)-1])
last_digit_b = int(second_number[len(second_number)-1])
result.insert(0, last_digit_a + last_digit_b)
first_nu... | true |
e64b70496939ae4ad53d0ea6750ff3c6d8d53a5f | YQ-7/code-interview-guide | /c2_linked_list/remove_by_ratio.py | UTF-8 | 1,968 | 4.0625 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
题目:
给定链表的头节点head、整数a和b,实现删除位于a/b处节点的函数。
例如:
链表:1->2->3->4->5,假设a/b的值为r。
如果r等于0,不删除任何节点;
如果r在区间(0,1/5]上,删除节点1;
如果r在区间(1/5,2/5]上,删除节点2;
如果r在区间(2/5,3/5]上,删除节点3;
如果r在区间(3/5,4/5]上,删除节点4;
如果r在区间(4/5,1]上,删除节点5;
如果r大于1,不删除任何节点。... | true |
aebdce75ce6c2acc50653bd702c15d7d18e26b91 | ksonpost/Engeto-1-Destination | /Engeto-1-Destination.py | UTF-8 | 953 | 3.609375 | 4 | [] | no_license | # proměnná - města
mesta = ['Prague', 'Wien', 'Brno', 'Svitavy', 'Zlin', 'Ostrava']
# kolekce ceny-destinaci
cena = [1000, 1100, 2000, 1500, 2300, 3400]
# oddělovací mezera
oddelovac = ('=' *80)
# vzhled
print(oddelovac)
# pozdrav
print('Welcome to the DESTINATION, place where people plan their trips')
# vzhled
pr... | true |
a78add4798fa15621e177fbb717b1df06737a124 | carnellj/presentations | /pylady-june-2018/simple-contact-api/simple-contact.py | UTF-8 | 1,139 | 2.703125 | 3 | [] | no_license | #/usr/local/bin/python3
from flask import Flask, jsonify, request
import uuid
app = Flask(__name__)
contacts = {}
@app.route('/health/check')
def healthCheck():
return jsonify({'status': 'OK'}),200
@app.route('/api/v1.0/contacts', methods=['POST'])
def create_contact():
contactId = str(uuid.uuid4())
con... | true |
b6cf2197fb4dd617444fb6cec0f584700feb5892 | winniewjeng/StockDatabase | /lab2_exceptions.py | UTF-8 | 3,799 | 3.84375 | 4 | [] | no_license | #! /usr/bin/env python3
"""
File: Jeng_Winnie_Lab1.py
Author: Winnie Wei Jeng
Assignment: Lab 2
Professor: Phil Tracton
Date: 10/07/2018
This driver file tests the different methods inside the Example class
It uses the custom exception class, ExampleException, to handle errors
And it imports sys and traceback to outp... | true |
8764dc0047908c1c7b09961d731dd530b54687c7 | GregorGillan/PA4900-Research-Project-Code | /The Log Map Multiple.py | UTF-8 | 2,068 | 3.25 | 3 | [] | no_license | import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
from pylab import *
import pandas as pd
#Initializing values
p0 = 0.5 #Initial population.
b0 = 2.8 #Fecundity rate initial value.
bMax = 4.0 #Fecundity rate final value.
bStep = 0.01 #Change the value of dPoints to match the d.p of ... | true |
9a30d888b9f0d6f5787f002a524c602d31856d27 | felixir200/MachineLearning | /Lenguaje natural ML.py | UTF-8 | 2,542 | 3.28125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 24 15:11:56 2020
@author: Jumper
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
#importar el dataset
dataset = pd.read_csv("Restaurant_Reviews.tsv", delimiter = "\t", quoting = 3)
#Limpieza de texto
import re
import nltk
n... | true |
561615682fa9740e9f9caa42d346aa1146618bd3 | pingu342/python-getbtcprice | /bitfinex.py | UTF-8 | 346 | 2.53125 | 3 | [] | no_license | import urllib
import json
import ssl
import os
from pprint import pprint
ssl._create_default_https_context = ssl._create_unverified_context
def getPrice(market):
url = "https://api.bitfinex.com/v1/pubticker/" + market
res = urllib.urlopen(url)
result = json.loads(res.read().decode('utf-8'))
return flo... | true |
1645628356b5de97329057b7c1ee07b05967d244 | fenglihanxiao/Python | /Module01_CZ/day11_exception_package/04-代码/day11/day11/service/service_login.py | UTF-8 | 451 | 3.046875 | 3 | [
"MIT"
] | permissive | from excp.question import *
def check_login(name,pwd):
if len(name) <3 or len(name) > 8:
raise NameQuestion("用户名长度必须在3到8个字符之间")
if not name.isalnum():
raise NameQuestion("用户名中必须使用英文字母和数字组成")
if len(pwd) != 6:
raise PasswordQuestion("密码长度必须是6位")
if not pwd.isnumeric():
rai... | true |
696b453dcae560e69f7da7e31a2c9ef4e0fbca6d | saurabhg22/Snake-Game | /thegame.py | UTF-8 | 7,900 | 2.828125 | 3 | [] | no_license | import pygame
import time
import pickle
import random
pygame.init()
light_green = (191,248,22)
yellow=(255,245,62)
white=(255,255,255)
black=(0,0,0)
red=(255,0,0)
green = (0,155,0)
grey=(57,89,73)
start_length =5
display_width=800
display_height=600
fps=10
block_size=20
apllethickness=30
high_score = 0
scorefile = op... | true |
ffc0228537121d368ed4971731488f29f1fafd75 | katiecheng/Android | /app2.py | UTF-8 | 249 | 2.765625 | 3 | [] | no_license | import android
droid = android.Android()
title = "Hashtag me"
msg = "Type a short phrase:"
tag = droid.dialogGetInput(title, msg).result
tag_list = tag.split(" ")
hashtag = '#'
for word in tag_list:
hashtag += word
droid.makeToast(hashtag)
| true |
17d8405e0cfec45f40d38a17482eef9333b6e4c8 | BolajiOlajide/python-build-cli-planner-app | /tests/test_module1.py | UTF-8 | 16,936 | 2.6875 | 3 | [] | no_license | import pytest
import inspect
import re
import random
import shutil
import csv
from abc import ABCMeta, ABC
from collections.abc import Iterable
from dateutil.parser import parse
from datetime import datetime, timedelta
from pathlib import Path
import app
from src import database
from src import reminder
try:
from... | true |
4e17e661766e129ce7efe68b11deb1e8a5c5651f | RupeshPanta/Zyco-Text-Editor | /Zyco/Zyco-editor.py | UTF-8 | 18,984 | 2.703125 | 3 | [] | no_license | import tkinter as tk
from tkinter import ttk
import socket
from tkinter import messagebox
from tkinter import filedialog
from tkinter import Frame
import os
import sys
from tkinter.scrolledtext import ScrolledText
from tkinter import simpledialog
class ZycoEditor:
def __init__(self):
self.root = tk.Tk()
... | true |
48c6b042dd7b0254759e6663938889290bca16c6 | osomat123/LN379_Sampravah | /Database.py | UTF-8 | 1,396 | 2.75 | 3 | [] | no_license | import mysql.connector
from datetime import datetime
def InsertIntoTable(data,table,timestamp=0):
mydb=mysql.connector.connect(host='localhost',
user='root',
password='steelchair111',
database='dam'
... | true |
1455b1d3b9c0af8c236a7c70653c34e636e891a7 | stonedMoose/gamejam | /sandbox_zamplin.py | UTF-8 | 3,625 | 2.921875 | 3 | [] | no_license | import pygame
from pygame.locals import *
import os
# elmt de la bibliothèque
# -display
# -mixer
# -draw
# -event
# -image
# -mouse
# -time
import pygame
from pygame.locals import *
import time
import os
from classes import *
import pygame
from collections import deque
pygame.init()
screen = pygame.display.set_m... | true |
0487a5a6cf121b6860746e6ada1926a42e37650a | nvnavaneeth/RemoteDesktopManager | /accessor/remote_desktop_client.py | UTF-8 | 1,394 | 2.65625 | 3 | [] | no_license | import socket
import pickle
import threading
import select
class RemoteDesktopClient:
def __inti__(self):
self.screen_received_cb = None
def connect(self, address):
self.soc = socket.socket()
self.remote_ip, self.remote_port = address
try:
self.soc.connect((self.remote_ip, self.remote_port)... | true |
ca5c26d2f9ac0d26dd1ca806b4120337ff4aca42 | TM11153431/VAST2017 | /tsne/tsne.py | UTF-8 | 3,904 | 2.8125 | 3 | [
"Unlicense"
] | permissive | import json
from sklearn.manifold import TSNE
import numpy as np
import pandas as pd
import time
import ggplot
def tsne(files, total_data):
print(files)
data_dict = {}
# fill y with labels and x with matrix of vars
y = []
ids = []
# empty matrix with specified number of variables
x = np.em... | true |
7720e8f29a7300b6fdcce423a96ae1a0f6d8f8e2 | neohope/MLStudy | /NeuralNetwork/CNN/cnn_tensorflow.py | UTF-8 | 4,618 | 2.796875 | 3 | [] | no_license | #!/usr/bin/python
# -*- coding:utf-8 -*-
"""
CNN/Convnets/Convolutional neural networks
tensorflow
"""
from keras.utils import np_utils
from keras.datasets import cifar10
import tensorflow as tf
import numpy as np
def train(X_train,Y_train,X_test,Y_test):
"""
训练
"""
X = tf.placeholder("float", [None... | true |
db37a4e4b3a95e7e59d0090e6d08c513f0a58003 | nikhilnayak98/MBHack | /payload.py | UTF-8 | 683 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive | import threading, requests
END_NUM = 79800
URL = ""
def attack(x, y):
filename = str(x) + "to" + str(y) + ".txt"
for i in range(x, y):
PARAMS = {'UserID': i}
r = requests.get(url=URL, params=PARAMS)
if(len(r.text) == 90):
while(len(r.text)== 90):
r = request... | true |
c9e63452472ae9604050c42fa90359fc443a7598 | cassie01/APItesting | /before/009.py | UTF-8 | 1,265 | 2.546875 | 3 | [] | no_license | from selenium import webdriver
import unittest
import time
"""
user: testuser01
password: 123456
"""
class Cnode(unittest.TestCase):
def setUp(self):
self.Url = 'http://39.107.96.138:3000'
self.driver = webdriver.Chrome()
self.driver.get(self.Url)
def test_a_register(self):
... | true |
aa400547efa05cfdc96eae035115e5d811dbd2e9 | doORdeath/DeathOfFlask | /Chulpyo/Deco/__init__.py | UTF-8 | 228 | 2.59375 | 3 | [] | no_license | __author__ = 'Chulpyo'
class app:
class deco:
def __init__(self, f):
app.func = f
def __call__(self):
app.func()
@app.deco
def myfunc():
print("test2")
app.func()
#myfunc()
| true |
53dfe1958567cbba81273209451e7f645dcc9ba3 | ABHISHEKVALSAN/PLACEMENT-PREP | /PROGRAMMING/InterviewBit/Arrays/pascal-triangle.py | UTF-8 | 438 | 2.875 | 3 | [] | no_license | class Solution:
# @param A : integer
# @return a list of list of integers
def solve(self, A):
ans=[[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]]
if A<5:
return ans[:A]
for i in range(A-5):
ans.append([])
ans[-1].append(1)
for j in range(len(... | true |
e70e7fb1200bfdde6f6d1a75425a79772262aafd | isaacteoh25/Hyperskill-1 | /Multilingual Online Translator/translator_stage_4.py | UTF-8 | 3,067 | 3.34375 | 3 | [
"MIT"
] | permissive | import requests
from bs4 import BeautifulSoup
idx_lang_dict = { 1: "Arabic", \
2: "German", \
3: "English", \
4: "Spanish", \
5: "French", \
6: "Hebrew", \
7: "Japanese", \
... | true |
23b595e2fd697a0ece361302b4ec0b5b7f7156af | rodelrod/collective-intelligence | /chapter3/clusters.py | UTF-8 | 397 | 2.890625 | 3 | [] | no_license | def readfile(filename):
pass
def pearson(v1, v2):
pass
class bicluster:
pass
def hcluster(rows, distance=pearson):
pass
"""
>>> import clusters
>>> blognames, words, data = clusters.readfile('blogdata.txt')
>>> clust = clusters.hcluster(data)
"""
def printclust(clust, labels=None, n=0):
pass
"... | true |
371c12b3555ed1bb9420bf15ee926a4341ebfe8d | selimamrouni/gas-app | /gasapp/utilz.py | UTF-8 | 10,016 | 3.5 | 4 | [] | no_license | import pandas as pd
import numpy as np
from zipfile import ZipFile
import urllib.request
import xml.etree.cElementTree as et
from zipfile import ZipFile
from tqdm import tqdm
#haversine distance
from haversine import haversine
import requests
import googlemaps
def get_current_coordinate(current_address, key, count... | true |
18857555713f0b0d78b0a786895dff46fccdc4ef | FeixLiu/graduation_project | /classification/BiDAF.py | UTF-8 | 2,611 | 2.78125 | 3 | [] | no_license | import tensorflow as tf
class BiDAF():
"""
:param refc: the first reference c
:param refq: the second reference q
:param cLength: the length of c
:param qLength: the length of q
:param hidden_units: the nums of hidden units of the last lstm
:arg _sim_Mat: the similarity matrix between c a... | true |
699c7291190a5771d5a030645f6b1c45a6793cf8 | marconatalini/pyRPlink | /pyRPlink/src/Converti.py | UTF-8 | 1,071 | 2.859375 | 3 | [] | no_license | '''
Created on 11 giu 2019
@author: Marco
Utility per convertire btransaction.loc nel file transaction.txt
source:
:00002031201906100550130 0014736000000000000001+00000000 00000174 07 0000
result:
01 0000171 27/05/17 0648 0
'''
import os
def converti(l):
r = {}
r['ann... | true |
5787ec5297c60aac77e7e764869f4a7149eb2801 | perfectyang/share-tech | /w3cplus.py | UTF-8 | 1,426 | 2.6875 | 3 | [] | no_license | import os, json
from webScrawer import webScrawer
from threading import Thread as multiprocessline
allInfo = []
def parseHtml(html):
allArticles = html.find_all(id='page')[0].select('.node-blog')
for article in allArticles:
title = article.select('h1')[0].get_text().replace('\n', '')
link = 'htt... | true |
cc19159a83102dbc338b08abb244bc5c05b4560f | almighty-bungholio/fpga-fft | /python/read_vcd.py | UTF-8 | 3,219 | 2.671875 | 3 | [] | no_license | from __future__ import print_function
from pprint import pprint;
from Verilog_VCD import parse_vcd
import struct
import sys
from parse_verilog_header import ParseParams
if len(sys.argv) != 3:
exit("give vcd as first arg, params as 2nd")
params = ParseParams(sys.argv[2]).parse()
N = params['freq_bins']
data_width... | true |
6fb943572a03812da09f6f415262190e333dc0d6 | chikkuthomas/python | /function/amstrong number.py | UTF-8 | 799 | 4.09375 | 4 | [] | no_license | # num=int(input("enter the number")) #num=153=1*1*1+ 5*5*5 + 3*3*3
# ams=0
# temp=num
# while(temp>0):
# digit=temp%10
# ams=(digit*digit*digit)+ams #digit**3=raise to 3
# temp=temp//10 #here number is given as temp bcs we are comparing the orginal number with result
# if(ams==num):
# pr... | true |
006f1dba76eda46640a791c14faf48af0fe2c36f | Mohinem/Voronoi-Diagram-Generator | /voronoi.py | UTF-8 | 1,759 | 3.21875 | 3 | [] | no_license | import pygame
import random
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
COLOR_MIN_VALUE = 0
COLOR_MAX_VALUE = 255
MASSIVE_VALUE = 9999999999999999999999999999999999999999999999999
LEFT = 1
RIGHT = 3
gameDisplay = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
list_of_positions = []
random.seed()
def recolor():
... | true |
ef312b4c4ff0bd54b15bbe5f27839db852cb314d | Tr4shL0rd/VirusChooser | /viruschooser.py | UTF-8 | 524 | 2.65625 | 3 | [] | no_license | import time
import os
import datetime
import pyfiglet
name = pyfiglet.figlet_format("Virus Chooser", font = "slant")
clear = "\n" * 100
smallspace = "\n" * 5
print(clear)
print(name)
print("choose a virus!")
print()
#print("Sp4ceDestr0yer")
print("SpaceDestroyer")
print("50/50")
print()
chooser = input("what virus d... | true |
2f3ef5d8091c4bd7f9011550ccfe3c9e2e51d950 | osmomysl/Cocky_stroller | /clash.py | UTF-8 | 4,030 | 3.65625 | 4 | [] | no_license | from warrior_factory import WarriorFactory
import random
from datetime import datetime
random.seed(datetime.now())
class Clash:
def __init__(self, player1, player2):
self.player1 = player1
self.player2 = player2
self.wins = 0
self.escapes = 0
def select_opponent(self):
... | true |
db221c19d3beeb0da976b012846e8ddb6cee08b3 | lucidfrontier45/FalconRethinkProject | /webapp/rethinkdb.py | UTF-8 | 1,745 | 2.59375 | 3 | [] | no_license | import rethinkdb as r
class RethinkDBFactory(object):
def __init__(self, host="127.0.0.1", port=28015, db="data", tables: dict = None, **kwargs):
if tables is None:
tables = {}
self.host = host
self.port = port
self._db = db
self._tables = tables
self._c... | true |
def5189a183f744ac3176d3f43449ec09e4dff60 | 2533245542/shiny-mi | /zwpweka/techniqueEarlyStopRegression.py | UTF-8 | 11,163 | 2.84375 | 3 | [] | no_license | """ follow up of techniqueEarlyStop.py """
import sys
import pandas as pd
import numpy as np
from scipy.optimize import curve_fit
def earlyStopWithPatience(algorithm, history, optRd, algorithmToKeep, patience, delta):
### weipeng start
currentScores = history[lambda df: df.algName == algorithm].score
m... | true |
945885ab2282c4634b276e89ed67f88df48e3dfd | alvaroart/faculdade | /twp/twp120-exercicios-else.py | UTF-8 | 200 | 3.5625 | 4 | [] | no_license |
minutos= int(input("Minutos utilizados: "))
if minutos < 200:
conta = 0.20
else:
if minutos <= 400:
conta=0.18
else:
conta = 0.15
print("conta: R$ %6.2f" %(minutos*conta)) | true |
cbd694815b007fd136764a7a70a9d1c9afc1f458 | limkeunhyeok/daily-coding | /백준/4673/solution.py | UTF-8 | 256 | 3.265625 | 3 | [] | no_license | def d(n):
selfNumber = n
for i in str(n):
selfNumber += int(i)
return selfNumber
arr = []
for i in range(1, 10000):
k = d(i)
arr.append(k)
for i in range(1, 1000):
if i in arr:
continue
else:
print(i) | true |
04971b4f3f370bbcce02893e693979457e480b3d | fuzi2mo8/chibi | /icalc.py | UTF-8 | 2,776 | 3.484375 | 3 | [
"MIT"
] | permissive | import pegpy
peg = pegpy.grammar('''
Expression = Product (^{ '+' Product #Add })*
Product = Value (^{ '*' Value #Mul })*
Value = { [0-9]+ #Int }
''')
parser = pegpy.generate(peg)
class Expr(object):
@classmethod
def new(cls, v):
if isinstance(v, Expr):
return v
retur... | true |
5cf5a456c206278ed78fd56ffabe2ebc4f7564b0 | conradho/python_dojo_20150305 | /test_cut_blank_lines.py | UTF-8 | 847 | 3.046875 | 3 | [] | no_license | #/usr/bin/env python3.4
from collections import namedtuple
import unittest
import tempfile
import os
from cut_blank_lines import cut_blank_lines
TempFileTuple = namedtuple('TemporaryFile', ['file_descriptor', 'path'])
class TestCutBlankLines(unittest.TestCase):
def setUp(self):
self.sample_script = "pr... | true |
a2f74f063584dc5e63f0c0d01ac6e65290fadfdb | lomips/cpymad | /cpymad/util.py | UTF-8 | 6,959 | 2.90625 | 3 | [
"Python-2.0",
"CC0-1.0",
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | """
Utility functions used in other parts of the pymad package.
"""
import collections
import re
from .types import Range, Constraint
__all__ = [
'mad_quote',
'is_identifier',
'name_from_internal',
'name_to_internal',
'mad_parameter',
'mad_command',
]
try:
unicode
except NameError: # ... | true |
dec125141cc9404f6f779543ff9760e0744e0a80 | Alexml8456/RobotFramework | /Resources/BackOffice/Utils.py | UTF-8 | 1,467 | 2.828125 | 3 | [] | no_license | from Resources.BackOffice.ExLibraries import ExLibraries
import time
import calendar
from datetime import datetime
class Utils(object):
def __init__(self):
self.exLib = ExLibraries()
def get_text_list(self, locator):
texts = []
elements = self.exLib.ex_selenium2library()._element_find... | true |
4afd66f2364c5a1eb9d2995da96b3cdc178b7df5 | ss-8y0/SchoolSystem | /utils/checkinfo.py | UTF-8 | 1,606 | 2.828125 | 3 | [] | no_license | from Django_apps.students.models import *
import re
import datetime
def check_id_exist(id_card):
'''
校验输入的身份证在数据库是否存在
:param id_card:
:return:
'''
student = StudentInfo.objects.filter(id_card=id_card)
if student:
return True
def check_id_card(id_number):
info... | true |
3c20dc7228a30d728e0bac0e5bbc223094568919 | mreishus/leetcode | /2020-02/first_uni_num.py | UTF-8 | 3,533 | 3.875 | 4 | [] | no_license | #!/usr/bin/env python
"""
You have a queue of integers, you need to retrieve the first unique integer in
the queue.
Implement the FirstUnique class:
FirstUnique(int[] nums) Initializes the object with the numbers in the queue.
int showFirstUnique() returns the value of the first unique integer of the queue, and retu... | true |
8c37cfa415d400a02b5c1a565695767d26037726 | gabeochoa/AdventOfCode2016 | /day02/solution.py | UTF-8 | 2,080 | 3.015625 | 3 | [] | no_license | import sys
import math
stuff = []
for line in sys.stdin:
stuff.append(line.strip())
def kp(keypad, start):
return keypad[start[1]][start[0]]
def mv(matrix, x, y, dx, dy):
try:
if x+dx < 0 or y+dy < 0:
return [x,y]
aa = matrix.__getitem__(x+dx)[y+dy]
if a... | true |
1746fa05cac6f6921582d382a04d4e42be4fbd25 | andythigpen/chromeconsole | /chromeconsole/ui/__init__.py | UTF-8 | 3,460 | 2.6875 | 3 | [] | no_license | '''
chromeconsole.ui
===============
UI Implementation
'''
import asyncio
import requests
from prompt_toolkit.application import Application, AbortAction
from prompt_toolkit.buffer import Buffer, AcceptAction
from prompt_toolkit.interface import CommandLineInterface
from prompt_toolkit.shortcuts import create_asyncio_... | true |
2a18e76a742d794ada1f557423c0e0e9e449cdc6 | Z-Tong/Pivot-Libre | /Generator.py | UTF-8 | 1,134 | 3.6875 | 4 | [] | no_license | import random
candid_List = []
candidates = input("Please enter the candidates:") ###enter candidates with no space
for candidate in candidates:
candid_List.append(candidate)
### Case 1: All candidates are been voted.
all_votes_List = []
n = input("Please enter the number of random candidates sequences that you... | true |
617319711806fff0fb9138f342807ae19323c86a | jpisano99/ta_adoption_r1 | /old_revs/build_renewals_dict_r0.py | UTF-8 | 1,556 | 3.078125 | 3 | [] | no_license | import time
import datetime
import xlrd
from open_wb import open_wb
from settings import app
def build_renewals_dict(wb, sheet):
# Return a dict (my_dict) with bookings file info
my_list = ['End Customer', 'Renewal Date', 'Monthly Charge', 'Product Bookings']
my_dict = {}
# Loop across all column hea... | true |
1178ab31007cdf5f4c2f7c6e436996af2237aca8 | zero731/Mental_Health_Apps | /explore_funcs.py | UTF-8 | 2,511 | 3.609375 | 4 | [] | no_license |
def check_unique(col, df, dropna=False):
"""Takes in a Pandas DataFrame and specific column name and returns a Pandas DataFrame
displaying the unique values in that column as well as the count of each unique value.
Default is to also provide a count of NaN values.
Args:
col (str): N... | true |
d94e71a63404969454862798e6699d5021d2eb00 | break-through/EmotionGraph | /csvReadOut.py | UTF-8 | 1,046 | 3.234375 | 3 | [] | no_license | import csv
def readMyFile(filename):
d={}
header = []
values = []
time = []
emotion = []
with open(filename) as csvDataFile:
csvReader = csv.DictReader(csvDataFile)
for row in csvReader:
for column, value in row.iteritems():
d.setdefault(column, [... | true |
b4c25649ac5d07711e6f5e1ab57cc266c1034843 | moshekagan/Computational_Thinking_Programming | /homeworks/exersice_solutions_10/Ex10_2_multiplication_table.py | UTF-8 | 844 | 4.09375 | 4 | [] | no_license | rows = int(input("Insert a rows size:"))
columns = int(input("Insert a columns size:"))
if rows < 2 or columns < 2:
print("Invalid input!")
exit()
table = [[0] * rows for i in range(columns)]
# Fill first column
for i in range(1, len(table)):
table[i][0] = int(input("Insert a number in [" + str(i) + "," ... | true |
0a69617a8155c2aef2f46e9714aac826397f41ba | elrion018/CS_study | /beakjoon_PS/no5904.py | UTF-8 | 421 | 3.03125 | 3 | [] | no_license | import sys
def solve(N):
if N == 1:
return 'm'
if N == 2 or N == 3:
return 'o'
i = 0
while dp[i] < N:
i += 1
if N - dp[i-1] == 1:
return 'm'
if N - dp[i-1] <= i + 3:
return 'o'
return solve(N-dp[i-1]-(i+3))
N = int(sys.stdin.readli... | true |
ee12f265a707d9d5032d8286be830c8f098c8f40 | simoncos/mitx-6.00.2x | /uniform-distribute-scores-simulation/uniform_distribute_scores_simulation.py | UTF-8 | 2,917 | 3.921875 | 4 | [] | no_license | # -*- coding: utf-8 -*-
import random
import pylab
def sampleQuizzes():
'''
You are taking a class that plans to assign final grades based on two midterm quizzes and a final exam.
The final grade will be based on 25% for each midterm, and 50% for the final.
You are told that the grades on the exams ... | true |
fc866afb2dd1849db137bac22ec0f36831ab1c5b | asmelo/python_course | /47_repeticao.py | UTF-8 | 61 | 3.265625 | 3 | [] | no_license | for nr in range(2, 51):
if nr % 2 == 0:
print(nr) | true |
b04c5ad4b3992ac9d905325b9a2801be29660518 | acb100cias/HPV | /graf.py | UTF-8 | 6,365 | 2.640625 | 3 | [] | no_license | #!/usr/bin/python
from numpy import *
from pandas import *
import matplotlib.pyplot as plt
########################
a=104*array(range(24))
b=2*(array(range(24)))
c=array(arange(0,1,0.1))
d=10*array(range(10))
e=array(arange(0,0.4,0.1))
f=10*array(range(4))
##Leer bases de datos######
e1=read_csv("e1.csv")
e2=read_c... | true |
7447dc0ea3c500c05cae24c6a2614a616b4f1be1 | pranavlathigara/Raspberry-Pi-DIY-Projects | /pienviro/enviro-dashboard/logger/monitor.py | UTF-8 | 2,056 | 2.53125 | 3 | [
"MIT"
] | permissive | import time
import os
from envirophat import weather, leds, light
from influxdb import InfluxDBClient
influx_host = os.getenv("INFLUX_HOST")
port = 8086
dbname = "environment"
user = "root"
password = "root"
host = os.getenv("PI_HOST")
sleep_time = os.getenv("SAMPLE_PAUSE")
client = InfluxDBClient(influx_host, port, ... | true |