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 |
|---|---|---|---|---|---|---|---|---|---|---|
8ebbebe91db8b15ba37d933d7a508e07094d8be9 | ml4ai/MusECI | /MusECI/FromMidi2.py | UTF-8 | 4,649 | 3.0625 | 3 | [] | no_license | from MusECI.Chunk import *
from MusECI.MusEciDataStructures import *
from MusECI.GMInstruments import *
from copy import deepcopy
from MusECI.MidiReader import *
from MusECI.MEvent import MEvent, musicToMEvents
from MusECI.BasicOperations import removeZeros, removeZerosOnset, par
from MusECI.MidiConversion import split... | true |
888521237eaf4ac12aae92968f3748c2e79b4e45 | Nehal31/Python | /HeadFirst/Chapter3/save_dialog.py | UTF-8 | 811 | 3.0625 | 3 | [] | no_license | """ print dialoge is function which can be used to print proper convesation
between any two person """
def save_dialog(file):
men = []
other = []
try:
for item in file:
try :
(person,dialog)= item.split(':',1)
if person =='Man':
men.ap... | true |
577675e1118404be029e06f562016e0e5917576d | farsanajasmin/farsana_jasmin_rmca_s1A | /pyython/3-2-2021/co2_8.py | UTF-8 | 472 | 3.015625 | 3 | [] | no_license | Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> def find(word):
wl=[]
for n in word:
wl.append((len(n),n))
wl.sort()
result=wl[-1][0],wl[-1][1]
print("longest word: ",result[1])
p... | true |
71a95bd468d0a4276acd4a03fa5f999053d0cbbb | Larz60p/MakerProject | /venv/src/GetRemoteDir.py | UTF-8 | 2,782 | 2.75 | 3 | [
"MIT"
] | permissive | import GetUrl
from bs4 import BeautifulSoup
import time
import sys
import socket
class GetRemoteDir:
def __init__(self):
self.soup = None
self.gu = GetUrl.GetUrl()
self.internet_available = socket.gethostbyname(socket.gethostname()) != '127.0.0.1'
self.page = None
self.refr... | true |
dda45f30bd02998fef96d4f08d9611162cdf7a8a | SrishtiT/CS235Flix-A2 | /cs235flix/domainmodel/model.py | UTF-8 | 6,385 | 2.96875 | 3 | [] | no_license | from datetime import datetime
from typing import Iterable, List
class Movie:
def __init__(self, rank: int, title: str, release_year: int, genres, actors, director, description):
self._reviews: List[Review] = list()
if type(rank) is int and 0 < rank < 1001:
self._rank = rank
if... | true |
191fcc34b7cb188727850e9132807b90c170fa1d | Francosantander/um-programacion-i-2020 | /58105-Santander-Franco/tps/tp1/ejercicio_6.py | UTF-8 | 564 | 3.890625 | 4 | [] | no_license | class Numero():
def __init__(self):
self.num = 0
def set_num(self, num):
self.num = num
def get_num(self):
return self.num
def val_num(self, num):
if num > 2:
i = 2
while num % i != 0:
i += 1
if i == num:
... | true |
0d7685a4e358b17e9dd5126b5affd50526d454e4 | YoavBaavour/flask-date-converter | /date_convert.py | UTF-8 | 1,781 | 2.75 | 3 | [] | no_license | import requests as re
from flask import Flask, render_template, request, redirect, flash, url_for
from form import DateForm # import my form module
app = Flask(__name__)
app.config['SECRET_KEY'] = '295072870ea55e07d52889cbd8abb832'
# execute convert_date when entering this route
@app.route("/", method... | true |
62b84c56e4a68070601dd78324477e3fd58ac3fb | nguyentamanda/qbb2019-answers | /week5_Sequence_Alignment_and_Evolution/02-nucleotides.py | UTF-8 | 2,709 | 2.71875 | 3 | [] | no_license | #!/usr/bin/env python3
"""
./02-nucleotides.py 2-mafft.parsed.tsv 2-blastn-results.tsv
"""
import sys
mafft = open(sys.argv[1])
blastn = open(sys.argv[2])
protein_dict = {}
sequence_dict = {}
back_to_nucleo = {}
codon_table = {
"TTT" : "F", "CTT" : "L", "ATT" : "I", "GTT" : "V",
"TTC" : "F", "CTC" : "L", "ATC" : ... | true |
d2db3794c5ae811434d25449d37a542c79e8f7e9 | frasermyers/ShakespeareMonkeysV1 | /Population.py | UTF-8 | 5,038 | 3.328125 | 3 | [] | no_license | from ShakespeareMonkeys import Monkey
import random
from matplotlib import pyplot as plt
class Population:
pop_size = 1500
def __init__(self):
self.current_population = [None for i in range(Population.pop_size)]
self.new_population = []
def initial_population(self):
for i in rang... | true |
6c941efedd8506d91c065c6eb90d47584edc2216 | kamyu104/GoogleCodeJam-2014 | /Round 1C/part-elf.py | UTF-8 | 606 | 3.015625 | 3 | [
"MIT"
] | permissive | # Copyright (c) 2016 kamyu. All rights reserved.
#
# Google Code Jam 2014 Round 1C - Problem A. Part Elf
# https://code.google.com/codejam/contest/3004486/dashboard#s=p0
#
# Time: O(logQ)
# Space: O(1)
#
from fractions import gcd
def part_elf():
P, Q = map(int, raw_input().strip().split('/'))
GCD = gcd(P, Q)... | true |
bc90cef8ea7c988b23ab081f5c3a0326d0e48435 | tpogue/poetry-generation | /train.py | UTF-8 | 14,909 | 2.515625 | 3 | [] | no_license | from __future__ import print_function
import numpy as np
import tensorflow as tf
from tensorflow.python.training.learning_rate_decay import cosine_decay_restarts
import matplotlib.pyplot as plt
import argparse
import time
import os
from six.moves import cPickle
from utils import TextLoader
from model import Model
from... | true |
06f9de8886d3186d78bd4e4dd03dddda6ec17c99 | PhysicsFTW/POCS | /pocs/mount/serial.py | UTF-8 | 16,606 | 2.859375 | 3 | [
"MIT"
] | permissive | import os
import yaml
from ..utils import error
from ..utils import rs232
from .mount import AbstractMount
class AbstractSerialMount(AbstractMount):
def __init__(self, *args, **kwargs):
"""
"""
super(AbstractSerialMount, self).__init__(*args, **kwargs)
# Setup our serial connec... | true |
7bba8fa779b533a87e86a41578196128fecfc6ef | horzone/hwPython | /hw19_server.py | UTF-8 | 2,777 | 3 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import socket
# Написать dns сервер.
# Сервер должен принимать соединения по протоколу udp.
# Если приходит запрос "domain.name" должен отправлять в ответ ip адрес.
# * Доп задание: иметь возможность переопределять записи клиентами:
# * ADD my.google.com:228.228.228.228
# Создаем сокет и закр... | true |
1f3ba4c5f27cdb08a212536d51a3d657d87ffd8c | cssamal/practice | /robot_helper.py | UTF-8 | 1,462 | 3.890625 | 4 | [] | no_license | #!/usr/bin/env python3
from math import sqrt
class RobotHelper:
def __init__(self, x=0, y=0):
# initialize robot position with x,y co-ordinates with (0,0)
self.x = x
self.y = y
def forward(self, steps):
self.x = self.x + float(steps)
def backward(self, steps):
s... | true |
325ebb11e94048700093ce8fec59dc5e5a2f7d08 | Jisangl22/WebStudio2019 | /5_rdbms/practice/Kangyeongjin/articlehascommentlist.py | UTF-8 | 676 | 2.625 | 3 | [
"MIT"
] | permissive | from flask import Flask, request
from flask_restful import Api, Resource
import os
import json
class ArticleHasCommentList(Resource):
def get(self, article_number):
if not os.path.exists('comments.json'):
return 'There is no comment'
r = []
if os.path.exists('comments.json'):
with open('comments.json', ... | true |
650c01d5c499b88fb5dff5cc77af793a9b40cc4f | WalterBluman/Tecnologo-ADS | /Algoritmos/Lista 03 - Estrutura de Repetição/QUESTAO01.py | UTF-8 | 227 | 3.984375 | 4 | [] | no_license | """1. Leia N e escreva todos os números inteiros de 1 a N."""
print('Questão 01:')
def main():
n = int(input('Digite um número: '))
for n in range(1, n + 1):
print (n)
if __name__ == '__main__':
main()
| true |
ee5ae46ca4bb19f9849b8d343d8b428d03e05638 | cmura009/data | /scripts/CategoryCount.py | UTF-8 | 859 | 3.328125 | 3 | [] | no_license | """
Python script to find the number of sales transactions for each product category
using Map-Reduce framework (mapper, combiner, and reducer functions) with mrjob package
4/14/17
"""
from mrjob.job import MRJob
class CategoryCount(MRJob):
# each input lines consists of city, productCategory, price, and paymentMod... | true |
eb7cc8688a3c7f13f1585885270b233ab67fa6e1 | heyder-1995/RoseBot | /rosebot/modules/gender.py | UTF-8 | 1,232 | 2.59375 | 3 | [] | no_license | import requests
from pyrogram import Filters, Message
from rosebot import BOT
from rosebot.helpers import ReplyCheck
def genderize(first_name):
r = requests.get("https://api.genderize.io/?name={}".format(first_name))
if r.status_code == 200:
try:
a = r.json()
text = "**Name:*... | true |
6865ecf968c4212ddeff6f56399326ebadbd7469 | demidp/itmo-ml | /knn/CF-C.py | UTF-8 | 2,340 | 2.859375 | 3 | [] | no_license | import math
from math import sqrt
#Kernels
def gaussian(x):
return math.exp(-x**2/2)/sqrt(2*math.pi)
def uniform(x):
return 0 if abs(x) >= 1 else 1/2
def triangular(x):
return 0 if abs(x) > 1 else 1-abs(x)
def epanechnikov(x):
return 0 if abs(x) > 1 else 3/4*(1-x ** 2)
def quartic(x):
return 0 if a... | true |
5e8ecbe7eb7a86db499edb54df72ead4ccb600fa | lee102699/Weather-Search | /Scripts/GCPmain.py | UTF-8 | 706 | 2.734375 | 3 | [] | no_license | from flask import Flask , request
import requests, json
# app = Flask(__name__)
# @app.route('/', methods=['GET', 'POST'])
def weatherAPI(CITY):
# base URL
BASE_URL = "https://api.openweathermap.org/data/2.5/forecast?"
URL = BASE_URL + "q=" + CITY + "&appid=" + "5c23d8f44b6a520211b8539b8512bdaa" + "&units=met... | true |
857052bacc280d82004b413e12923e81a7da6d91 | zache-fi/Wikitrust2.0 | /wikitrustbackend/Runner.py | UTF-8 | 2,542 | 2.828125 | 3 | [] | no_license | # This file contains the code for the runner of the WikiTrust
# algorithm. This file connects all the individual parts
# in the project.
#
# Joseph Csoti, November 2019
# Cagan Bakirci, November 2019
from Firestore import Firestore
from WikiEngine import WikiEngine
import ReputationEngine as re
import authorEngine as... | true |
f55064eaca4ffe6c76fbfdf643fc21dff3a76f82 | Shu-HowTing/Code-exercises | /E26.py | UTF-8 | 698 | 3.75 | 4 | [] | no_license | # -*- coding: utf-8 -*-
# Author: 小狼狗
'''
快排(quicksort)
'''
def partition(numbers, low, high):
pivot = numbers[low] #轴点
while low<high:
while low<high and numbers[high]>pivot:
high -= 1
numbers[low] = numbers[high]
while low<high and numbers[low]<=pivot:
... | true |
9ddfb5ec123f046508f3331053dbae495d9c7a03 | RandyOfosu/Python-2 | /4-Programmastructuren/taak01/antwoorden.py | UTF-8 | 322 | 2.890625 | 3 | [] | no_license | cijfers ={1: 'Een', 2: 'Twee', 3: 'Drie', 4: 'Vier', 5: 'Vijf', 6: 'Zes', 7: 'Zeven', 8: 'Acht', 9: 'Negen', 10: 'Tien'}
vraag1 = int(input('Voer een getal in tussen 1 en 10: ')[:2])
while vraag1 > 10:
vraag1 = int(input('Nee, even serieus. Voer een getal in tussen 1 en 10: ')[:2])
else:
print(cijfers[vraag1]... | true |
318f6eab01dbac6576ad8234d39edf730cf35467 | chananyameth/Battleship | /battleship_player.py | UTF-8 | 1,909 | 3.203125 | 3 | [] | no_license | from hashlib import sha256
from random import randrange
from functools import reduce
from converters import coordinate_to_number, number_to_coordinate
from consts import *
class BattleshipPlayer:
def __init__(self, submarines: dict):
self.nonce = randrange(MIN_NONCE, MAX_NONCE)
self.submarines = ... | true |
fb082dec1dd23493b7a012209eddfea1b99975ff | swethaselvanambi/beginner | /StrRev.py | UTF-8 | 122 | 3.265625 | 3 | [] | no_license | a=input().split()
for j in a:
b=[ i for i in j]
for i in range(len(b)-1,-1,-1):
print(b[i],end="")
print(" ")
| true |
f051e90d074cf8120282123c87a3d7f93d47ef41 | dhadjia1/NeuroGAN | /utils/preprocessing_utils.py | UTF-8 | 7,581 | 2.546875 | 3 | [] | no_license |
import sys
import os
import numpy as np
from collections import namedtuple
from sklearn.decomposition import PCA
Point = namedtuple('Point', ['int_label', 'typ', 'xyz', 'radius', 'parent'])
PC_Transform = namedtuple('PC_Transform', ['PointCloud', 'PointCloud_reference', 'rot'])
class CellCloud(object):
def __ini... | true |
eeecf21da5c0e2c0f628b599ac5dcbd2b46ba0eb | Jessica-Thomas/PythonPractice | /return.py | UTF-8 | 339 | 3.75 | 4 | [] | no_license | # def add_two(num):
# print(num)
# val = 2 + 2
# return val
# add_two(5)
# multiple parameters
def add_mx_nums(num1, num2, num3):
val = num1 + num2 + num3
return val
print(add_mx_nums(4, 5, 6))
------------
def hello_student(name):
return "Hello " + name
hello = he... | true |
8505336e447c06b91eaacb9cd1fb59128e3303b3 | sunwenying218/ccnn | /lib/fast_rcnn/nms_wrapper.py | UTF-8 | 1,261 | 2.515625 | 3 | [
"MIT"
] | permissive | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import numpy as np
from fast_rcnn.config import cfg
from nms.gpu_nms im... | true |
e49ef64bb0c80839094ce47855c25032df351445 | dani272001/Prog-1 | /6. gyakorló.py | UTF-8 | 1,606 | 3.21875 | 3 | [] | no_license | import matplotlib.pyplot as plt
import numpy as np
import matplotlib.image as img
#1. feladat
g = open("arfolyam.txt", "r")
row = []
row2 = []
elso = g.readline()
elso = elso.split()
masodik = g.readline()
masodik = masodik.split()
for i in range(10):
row.append(float(elso[i]))
for i in range(10):
... | true |
06a219adfef07f5bce0c726e52924055cbc8221e | ebaek/Data-Structures-Algorithms | /Codility/rotate_array.py | UTF-8 | 223 | 2.765625 | 3 | [] | no_license | from collections import deque
def solution(A, K):
if not A: return A
numTimes = K % len(A)
A = deque(A)
for _ in range(numTimes):
lastEl = A.pop()
A.appendleft(lastEl)
return list(A)
| true |
d41480f965d402113a62c905323537193f2a7ddf | ChuhanGao57/KerasPlayground | /test2.py | UTF-8 | 374 | 2.984375 | 3 | [] | no_license | import numpy as np
import Tkinter
import matplotlib.pyplot as plt
#this is testBranch
#test 2
x = np.arange(10)
y1 = 2*x
y2 = x
plt.figure(0)
plt.plot(x, y1, 'bo', label = 'Training Acc')
plt.xlabel('Epochs')
plt.ylabel('Accuracy')
plt.legend()
plt.figure(1)
plt.plot(x, y2, 'bo', label = 'Training Loss')
plt.xlabel... | true |
f1953165b191662cd27312cf4c6a6026cebe2656 | cyrilvincent/DL | /data/climate/14_jena_lstm.py | UTF-8 | 1,034 | 2.546875 | 3 | [] | no_license | import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import tensorflow as tf
import data.climate.window_generator as wg
# https://www.tensorflow.org/tutorials/structured_data/time_series
mpl.rcParams['figure.figsize'] = (8, 6)
mpl.rcParams['axes.grid'] = False
train_df = pd.read_csv("jena_cli... | true |
0d85bb9efb7047aba95ebaad316df86ebc6e719a | deepgorthi/youtube-playlist-API | /youtube_playlist_duration.py | UTF-8 | 665 | 2.84375 | 3 | [] | no_license | from datetime import timedelta
class YoutubePlaylistDuration:
def __init__(self, hours, minutes, seconds):
# self.video_id = video_id
self.hours = hours
self.minutes = minutes
self.seconds = seconds
def getDuration(self):
return self.hours, self.minutes, self.seconds
... | true |
2b39652d45ca6cd08aded6494f91bcb783f16eb2 | rafaelperazzo/programacao-web | /moodledata/vpl_data/125/usersdata/147/28987/submittedfiles/ap1.py | UTF-8 | 652 | 3.390625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
a=float(input('digite a:'))
b=float(input('digite b:'))
c=float(input('digite c:'))
if a>b and b>c and a>c:
print('%f' %c)
print('%f' %b)
print('%f' %a)
if a>b and c>b and a>c:
print('%f' %b)
print('%f' %c)
print('%f' %a)
if a>b and c>a and c>b:
print('%f' %b)
pri... | true |
95a6c503629193f90c33e8e8be1c3a0c9399f6ab | jjudy60334/my-nlp-wrangler | /mynlpwrangler/cleaner.py | UTF-8 | 2,583 | 3.15625 | 3 | [
"MIT"
] | permissive | from urllib.parse import urlparse
import re
import string
import pandas as pd
import numpy as np
from typing import Callable
class ArticleCleaner():
"""
clean data for nlp
"""
def __init__(self, col: str, cleaned_col: str = "clean_text"):
self._col = col
self._cleaned_col = cleaned_c... | true |
ffbcab30910a2525b3d80dd79f0289c6832d57ac | daleobrien/Python-CPP-Extension | /runme.py | UTF-8 | 1,337 | 3.375 | 3 | [] | no_license |
import helloWorld
assert helloWorld.__doc__ == 'Module Documentation'
d = dir(helloWorld)
assert "printHelloWorld" in d
assert "dict_to_dict" in d
r = helloWorld.printHelloWorld()
assert r == set(['hello', 'world'])
s = helloWorld.dict_to_dict({'One': 1, "Two": 2})
assert s[1] == 'One'
assert s[2] == 'Two'
s =... | true |
4aa7579bb9c4056da59f8104f8e87b6665966a80 | ugurcemozturk/face-morphing | /morphing/__init__.py | UTF-8 | 1,343 | 2.515625 | 3 | [
"MIT"
] | permissive | from morphing.face_landmark_detection import makeCorrespondence
from morphing.delaunay import makeDelaunay
from morphing.faceMorph import makeMorphs
import subprocess
import argparse
import shutil
import os
def doMorphing(thePredictor,theImage1,theImage2,theDuration,theFrameRate,theResult):
[size,img1,img2,list1,list... | true |
381896ae2c49cc9602764369122ee943f41865a8 | yashu762001/Python-Tutorial | /OOPS/MethodInPython.py | UTF-8 | 2,267 | 4.375 | 4 | [] | no_license | """
TOPICS TO BE DISCUSSED:
1. INSTANCE METHODS.
2. GETTTERS AND SETTERS METHODS.
3. CLASS METHODS.
4. STATIC METHODS.
POINT TO BE REMEMBERED: CLASS VARIABLES AND STATIC VARIABLES WERE ONE AND THE SAME THING.
BUT CLASS METHODS ARE DIFFERENT ARE DIFFERENT AND STATIC METHODS ARE DIFFERENT.
"""
# INSTANCE METHODS ARE TH... | true |
537fd4c8c66deae434cda4969a129d7bbf66da27 | YounghoonKwon/leets-get-it | /201125-Leet452-MinimumNumberOfArrowsToBurstBalloons/jiyun.py | UTF-8 | 438 | 2.875 | 3 | [] | no_license | class Solution(object):
def findMinArrowShots(self, points):
if len(points) < 2:
return len(points)
points.sort(key = lambda x: x[0])
count = 1
end = points[0][1]
for i in range(1, len(points)):
if end >= points[i][0]:
end = min(po... | true |
a1f1462b643e9b13829ab30c01e6b82b8368a742 | loumatheu/ExerciciosdePython | /Mundo 1/Exercicio11.py | UTF-8 | 1,109 | 3.0625 | 3 | [] | no_license | cores = {'azul':'\033[1;34m','verde':'\033[1;32m','semestilo':'\033[m', 'vermelho':'\033[1;31m',
'lilas':'\033[1;35m', 'amarelo':'\033[1;33m', 'verdepiscina':'\033[1;36m'}
print(f"""{cores['azul']}====================================================================
CHALLENGE 11
===... | true |
dd561f12fdc02400c24b4bf59ba716268449c81c | rfernandezf/TouchCarPI | /touchcarpi/main/GUI/widgets/buttons/PlayAudioMenu/Button_Back_PAM.py | UTF-8 | 2,691 | 2.609375 | 3 | [] | no_license | #*************************************************************************************************************
# ________ ________ ___ ___ ________ ___ ___ ________ ________ ________ ________ ___
# |\___ ___\\ __ \|\ \|\ \|\ ____\|\ \|\ \|\ ____\|\ __ \|\ __ \|\ __ \|\ \
# \|___ \ \_... | true |
a25a12650c401d11860e58ea70bc5f94c087f622 | colinwxl/NetworkBasedInference | /NBI.py | UTF-8 | 1,138 | 2.71875 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 13 09:42:53 2018
@author: icruicks
"""
from sklearn.base import BaseEstimator, ClassifierMixin
import numpy as np
class NBI(BaseEstimator, ClassifierMixin):
def __init__(self):
pass
def fit(self, A):
'''
A is a biaprt... | true |
dc09e82de7808653c4182f6054f9db5610b963e6 | ucshadow/gist | /total and median karma by poster.py | UTF-8 | 1,746 | 2.796875 | 3 | [] | no_license | import matplotlib.pylab as plt
import json
import numpy as np
from pylab import rcParams
import matplotlib.ticker as plticker
import pandas
with open('op_karma.json') as f:
ops = json.loads(f.read())
top_karma = sorted(ops.keys(), key=lambda ee: ops[ee][0], reverse=True)[:10]
op_names = []
total_karma = []
medi... | true |
e1c21ff796d0e5fa96365f2281c59407b27d5e3b | piaomiaoxian66/pycharm | /day03/change_type.py | UTF-8 | 1,794 | 4.5625 | 5 | [] | no_license | # 字符串转化成整数 int()
# a = '10'
# b = 10
# c = int(a) + b
# print(c)
# 整数转换成字符串 str()
# a = '10'
# b = 10
# c = a + str(b)
# print(c)
# 把字符串编程小数前面加 float
# a = '10.8'
# b = 10.3
# c = float(a) + b
# print(c)
# 把小数 (强转)成int类型 ,失去小数部分
# c = 3.1415
# print(int(c))
# d = 9.99
# print(int(d))
# print(int(c + d))
"""... | true |
50c9f811e3ad6638c0efec2854511e846a2e3a58 | alexmlamb/GenerativeAdversarialNetworks | /lib/qqplot.py | UTF-8 | 873 | 3.6875 | 4 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
from scipy.special import erfinv
def cdflst(sortedSamples):
cumsum = sum(sortedSamples)
cdf = []
psum = 0.0
for i in range(0, len(sortedSamples)):
psum += sortedSamples[i]
cdf += [erfinv(2.0 * i / len(sortedSamples) - 1)]
... | true |
ed3efa256460c1f16f7f8a7b81cb623a2e6f5647 | georgebolshoi44/Tarea1GiacominHernandezMoraRosales | /Tarea1Funciones.py | UTF-8 | 854 | 3.53125 | 4 | [] | no_license | # errores
errorData = -666
error1 = -3
error2 = -5
error3 = -9
def func1(x):
if (x == str(x)):
indice = 0
contador = 0
while indice < len(x):
caracter = x[indice]
if (caracter.islower() is True):
indice += 1
else:
... | true |
029e853467a34d3d903d915eb65306309204a4ef | cheapkai/MSU_Net | /data_loader.py | UTF-8 | 1,476 | 2.84375 | 3 | [] | no_license | from random import shuffle
import torch
from torch.utils import data
from torchvision import transforms as T
from PIL import Image
class MyDataset(torch.utils.data.Dataset):
def __init__(self, imList, labelList, mode = 'train'):
self.imList = imList
self.labelList = labelList
self.mode = mo... | true |
c09f583badb3271f149121fcbedd01428264d1b5 | supergravity/PythonLearning- | /Data_Visualization/Plot/Matplotlib/FT748/Ch10/Ch10_1_2c.py | UTF-8 | 490 | 4.03125 | 4 | [] | no_license | str1 = 'welcome to python'
print("str1 = " + str1)
str2 = 'Welcome to Python'
print("str2 = " + str2)
str3 = 'This is a test.'
print("str3 = " + str3)
s = str1.capitalize()
print("str1.capitalize() = " + s)
s = str2.lower()
print("str2.lower() = " + s)
s = str1.upper()
print("str1.upper() = " + s)
s = st... | true |
0d505a4ca58129d3aceeaf05251e1abe6acd5c28 | MurrayCode/CodeAcademyMLCourseWork | /DecisionTreeClassifiers/DTC1.py | UTF-8 | 427 | 2.96875 | 3 | [] | no_license | from collections import Counter
labels = ["unacc", "unacc", "acc", "acc", "good", "good"]
#labels = ["unacc","unacc","unacc", "good", "vgood", "vgood"]
#labels = ["unacc", "unacc", "unacc", "unacc", "unacc", "unacc"]
impurity = 1
label_counts = Counter(labels)
print(label_counts)
for label in label_counts:
probabi... | true |
17fe1d684ea2a3adf0f2e25776eecc7a3df8f544 | JBarrada/habitable_zone | /hexagons/hexagon2.py | UTF-8 | 5,813 | 2.953125 | 3 | [] | no_license | from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
import math
import numpy
import random
import colorsys
from copy import copy
from scipy.linalg import norm
from PIL import Image, ImageDraw
class Vertex:
l_coords = numpy.zeros(3)
t_coords = numpy.zeros(2)
n_coords = numpy.zeros(3)... | true |
136b2384037043f94fdbd9f5455d2e97fee8f363 | Meowxw/toolkit4nlp | /pretraining/preprocess.py | UTF-8 | 10,670 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
# @Date : 2020/7/20
# @Author : mingming.xu
# @Email : xv44586@gmail.com
# @File : preprocess.py
import numpy as np
import tensorflow as tf
from toolkit4nlp.backend import K
class TrainingDataset(object):
def __init__(self, tokenizer, seq_length):
"""
:param token... | true |
9f0bcb49a663049994aacd1f12b074ec65e2095e | puzzismael/ProyectQuality | /Celda.py | UTF-8 | 2,966 | 3.390625 | 3 | [] | no_license | class celda:
def __init__(self, PosFila, PosColumna, filas, columnas):
if PosFila >= filas or PosFila < 0:
raise ValueError(f'Expected a fila index in range(0, {filas}) exclusive, got {PosFila}')
if PosColumna >= columnas or PosColumna < 0:
raise ValueError(f'Expected a colum... | true |
b863b49bc96dea1df9d0019e0d55e57736a14b8e | derektrom/CSCI384 | /HW2-TromD/HW2-TromD.py | UTF-8 | 13,061 | 4.03125 | 4 | [] | no_license | """
Derek Trom
CSCI 384
HW2
AB Prune Connect 4
"""
import numpy as np
import pygame
import sys
import math
import random
# colors for board and pieces
BLUE = (0, 0, 255)
BLACK = (255, 255, 255)
RED = (255, 0, 0)
YELLOW = (0, 0, 0)
# dimensions of board
numRows = 6
numColumns = 7
# random globals
player = 0
computer =... | true |
998b76b6dbb0fff9c0bf7b8dba74965314d9e5af | radams15/LanguageExtrapolator | /extrapolator.py | UTF-8 | 872 | 2.78125 | 3 | [] | no_license | from textgenrnn import textgenrnn
class Extrapolator:
def __init__(self):
self.gen = textgenrnn()
def finetune_file(self, file, cfg, steps=1, gen=0):
self.gen.train_from_file(
file,
num_epochs=cfg["learn_times"],
gen_epochs=cfg["test_amount"]
)
def finetune_list(self, list_of_text, cfg, step... | true |
e219e2537303590f520eb17223cd1381872b2329 | derricks/code-review-checklist-plugin | /export_checklist.py | UTF-8 | 1,962 | 3.0625 | 3 | [] | no_license | import json
import os.path
import sys
SUBHEADING = 'subheading'
CHECKLIST = 'checklist'
NAME = 'name'
def print_usage():
print 'Script for exporting checklist json into markdown'
print 'Usage: ' + sys.argv[0] + ' input_file'
def validate_args():
if len(sys.argv) == 1:
print_usage()
re... | true |
c0ccb82f4d840ccead7013a2a19677b774409b3d | ruidazeng/cela-tf-starter | /tfimage.py | UTF-8 | 5,611 | 2.734375 | 3 | [] | no_license | import tensorflow as tf
import numpy as np
import boto3
from tensorflow import keras
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D
from keras.layers import Activation, Dropout, Flatten, Dense
from keras.optimizers import SGD
train_path = '/data/Resize/Training/' # directory containi... | true |
c7c051ef6e8dccb04fa1749f00933b069055da87 | Aasthaengg/IBMdataset | /Python_codes/p03599/s421182165.py | UTF-8 | 663 | 2.640625 | 3 | [] | no_license | a,b,c,d,e,f=map(int,input().split())
rmax=0
for a100 in range(0,f+1,100*a):
for b100 in range(0,f-a100+1,100*b):
# for b100 in range(0,f+1,100*b):
if a100+b100>0:
fcd=f-a100-b100
for ci in range(0,fcd+1,c):
for di in range(0,fcd+1,d):
if a100+b10... | true |
f7e08b5ad73bdcfcd2647cc56a5bfdca4b91d4d3 | canyon289/flask_docker | /app.py | UTF-8 | 178 | 2.5625 | 3 | [] | no_license | from datetime import datetime
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return f'Hello Pasadena Python! {datetime.now().isoformat()}'
| true |
8d0b3452e387f1681d575016663ebf4375454a25 | Cijams/pyDataStructures | /pyDeque/PyDeque.py | UTF-8 | 2,778 | 3.890625 | 4 | [] | no_license | """
Christopher Ijams
Deque
A linear generalization of stack and queue functionality combined.
"""
class PyDeque:
def __init__(self, max_length=0):
self.deque = []
self.limited = False
if max_length > 0:
self.max_length = max_length
self.limited = True
# Return... | true |
0b44b8da10e1a4177c63cc953457f0a6443468d2 | DataScience-Proj-MH/NFL_Success | /Data/Cleaning_data/clean_college_stats.py | UTF-8 | 4,173 | 2.890625 | 3 | [] | no_license | import pandas as pd
college_stats = pd.read_csv('college_stats.txt') # load in both df
combine_stats = pd.read_csv('combine_stats.txt')
counter = -1; #used for creating custom index
# groups each players different college years
for row in range(len(college_stats)):
if (college_stats.iloc[[row] , 3].asty... | true |
b9cc1c6eb39f126cd37d6f7f87dc807ec930ac3a | iamdefinitelyahuman/curve-dao-contracts | /tests/fork/Burners/test_synth_burner.py | UTF-8 | 3,233 | 2.609375 | 3 | [
"MIT"
] | permissive | import pytest
from brownie import ETH_ADDRESS, ZERO_ADDRESS, Contract
@pytest.fixture(scope="module")
def receiver(UnderlyingBurner, alice, receiver):
yield UnderlyingBurner.deploy(receiver, receiver, alice, alice, {"from": alice})
@pytest.fixture(scope="module")
def burner(SynthBurner, alice, receiver):
co... | true |
790c53ca701b335058a9f8156c68d8c3e7f50b97 | cnhx/reviewer_experience_prediction | /util/get_review_data.py | UTF-8 | 4,805 | 2.828125 | 3 | [
"MIT"
] | permissive | """
:author: Matt Mulholland
:date: April 1, 2015
Script used to run the web scraping tool in order to build the video
game review corpus.
"""
import logging
from os import makedirs
from os.path import (join,
dirname,
realpath)
from argparse import (ArgumentParser,
... | true |
cf554979d511093d89df2c79b2a9aaf0eab94589 | Thoola/2018-2-level-labs | /lab_4/main.py | UTF-8 | 5,119 | 2.78125 | 3 | [] | no_license | import math
import re
import collections
import pandas as pd
REFERENCE_TEXTS = []
if __name__ == '__main__':
texts = ['5_7.txt', '15_2.txt', '10547_3.txt', '12230_7.txt']
for text in texts:
with open(text, 'r') as f:
REFERENCE_TEXTS.append(f.read())
def clean_tokenize_corpus(texts: list) -... | true |
0df12804230134297714584c6543e1c3773ada98 | jonbinney/informative_path_planning | /ppas/src/ppas/pplan.py | UTF-8 | 6,645 | 2.703125 | 3 | [] | no_license | import time
import numpy as np
from scipy import linalg
import gaussian, dbg
import ppas
def grg_equilateral(
G, # graph
s, # start node
t, # end node
start_t, # start time
end_t, # end time
i, # recursion level
objective, # objective function class
Xi_pilot,
max_recursions,
):... | true |
ea8eff4125e99c9df5b704ff0a814cd4c661d0f2 | RenneSA/Aprendendo-Python | /Aulas de Python Curso em vídeo/desafio 3 aula4.py | UTF-8 | 155 | 3.765625 | 4 | [
"MIT"
] | permissive | num1 = input('Digite o primeiro número: ')
num2 = input('Digite o segundo número: ')
soma = int(num1) + int(num2)
print('O resultado da soma é ', soma)
| true |
e7d4dd17211e203ac1e0bc519c0627a57db26bf7 | andela/ah-backend-valkyrie | /authors/apps/authentication/tests/test_user_sign_up_validation_errors.py | UTF-8 | 3,621 | 2.71875 | 3 | [
"BSD-3-Clause"
] | permissive | from authors.apps.authentication.tests.base import BaseTestMethods
from rest_framework import status
class UserRegistrationAPIViewTestCase(BaseTestMethods):
def test_user_sign_up_without_input(self):
"""
Test for user registration validation errors.
"""
data = {"user": {}}
... | true |
23bf35f2e03e78c429d6624e74eacb89084fe2b1 | raschild6/IS_CVOA-LSTM | /CVOA_LSTM/CVOA/CVOA.py | UTF-8 | 7,927 | 2.5625 | 3 | [] | no_license | from CVOA.Individual import Individual
from copy import deepcopy
import numpy as np
import sys as sys
import random as random
from DEEP_LEARNING.LSTM import fit_lstm_model, getMetrics_denormalized, resetTF
class CVOA:
bestSolution = None
bestModel = None
MIN_SPREAD = 0
MAX_SPREAD = 5
MIN_SUPERSPRE... | true |
c823ce2410630ca8b69d26a175c4aca1ceb10db8 | ankitparchani/project1 | /dictonary - Copy.py | UTF-8 | 462 | 2.78125 | 3 | [] | no_license | count = dict()
name = input("Enter file:")
handle = open(name)
if len(name) < 1: name = "mbox-short.txt"
for i in handle:
if not i.startswith('From '):
continue
afterslice = i.split()[5]
line=afterslice[0:2]
count[line] = count.get(line,0)+1
lst=list()
for (value,count) in so... | true |
047f5813cbc7208e8af2ae0a9221b801630e1730 | wzx1102k/documents | /ml/assignment/perception/pla.py | UTF-8 | 1,495 | 2.734375 | 3 | [] | no_license | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
LEN = 40
x = (np.random.rand(LEN,2) - 0.5) * 10
line = np.random.rand(2,1)
label = np.sign(np.dot(x, line))
label[label == 0] = 1
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
idx_0 = np.where(label[:, 0] == -1)
# error label point
#label[list(i... | true |
53c5a956b03161e4e743408e7552410a37ea51c6 | herbertchen1/rlntm-tensorflow | /rlntm.py | UTF-8 | 5,924 | 2.5625 | 3 | [] | no_license | import tensorflow as tf
from utils import *
class RLNTM:
def __init__(self, params, input_, initial, target,
in_move, out_move, mem_move, out_mask):
self.params = params
self.input = input_
self.target = target
self.in_move = in_move
self.out_move = out_mo... | true |
06b721b5999a5c36cd941d63e32b3cdddb5c4fbd | JeroendeBruijnHU/Progammeren | /Les 4/Opdrachten/4_3.py | UTF-8 | 170 | 3.234375 | 3 | [] | no_license | lengte = eval(input("Wat is je lengte in cm?"))
if lengte >= (120):
print ('Je bent lang genoeg voor deze attractie!')
else:
print ('Sorry, je bent te klein')
| true |
72d5fb3c66cb0c8dac18e5fe7873a158109c18db | kissann/lab3 | /Base_second.py | UTF-8 | 835 | 3.96875 | 4 | [] | no_license | #Написати простий калькулятор на чотири арифметичні дії.
print("Калькулятор. Для выхода из программы введите ^")
while True:
x = input("x=")
if x=='^':break
zn = input("Введите знак (+,-,*,/): ")
if zn == '^': break
y = input("y=")
if y=='^': break
else:
x=float(x)
y=float(y)... | true |
b78d1a152925943421f08f47a6d8b344484256c7 | vjx/planetaudium | /distance-plot-dia.py | UTF-8 | 478 | 3.03125 | 3 | [] | no_license | import ephem
import datetime
import time
localtime = datetime.datetime(2015,11,20)
lPos = [] # Lista para guardar a position.
lhora = [] # Lista para guardar o dia.
for x in range(0, 86400) :
hora = localtime + datetime.timedelta(0,x)
mercury = ephem.Mercury(hora)
lPos.append(mercury.earth_distance)
... | true |
db3f2e638d668ea7b8b526d1ea6677b5684a62a6 | Ch3shireDev/Robert-Python | /old/MiniLogia/14/2etap/etap2_zad3_motyw.py | UTF-8 | 1,880 | 3.25 | 3 | [] | no_license | from turtle import *
#funkcja testuj() do testowania rozwiązania
def testuj(n):
a=499
b=796
reset()
tracer(0)
if n==1:
kwiat()
if n==2:
tetki(2)
if n==3:
motyw(3)
pu(); home(); pd()
pu();fd(b/2);pd()
lt(90)
color("red")
for i in range(2):
... | true |
4dd9590721fd22b427b460f246a5f42aab698b10 | silvafj/BBK-MSCCS-2017-19 | /POP1/worksheets/one/ex14/code.py | UTF-8 | 102 | 3.34375 | 3 | [
"MIT"
] | permissive | # What is the volume of a sphere with radius 5?
import math
print(round(4 / 3 * math.pi * 5**3, 2))
| true |
0c4f9082f3fdad0947290e9effa8d65962c8baaf | redcpp/Competitive-Programming | /codeforces/997B.py | UTF-8 | 314 | 3.421875 | 3 | [] | no_license | def count(s, g):
res = 0
for i in range(len(s)-1):
if s[i:i+2] == g:
res += 1
return res
n = int(input())
s = input()
grams = [s[i:i+2] for i in range(n-1)]
best = 0
ans = grams[0]
for g in grams:
x = count(s, g)
if x > best:
best = x
ans = g
print(ans)
| true |
00aabf8584e67396344149de6f593f57e2271772 | superoverflow/python_android_bot | /ocr_trainer.py | UTF-8 | 2,094 | 2.625 | 3 | [] | no_license | import logging
import os
import sys
import cv2
import numpy as np
test_input_dir = 'test_input/char_cards/'
test_files = [f for f in os.listdir(test_input_dir) if f.endswith(".png")]
# test_files = [ '02282_000.png', '02282_001.png', '02282_002.png']
base = (82, 42)
size = (24, 30)
def cnt_height(cnt):
[x, y, ... | true |
c77bfe2481196fb454f2bac40b69be2a4c7c7d40 | almakhann/Codeforces | /705A.py | UTF-8 | 342 | 3.75 | 4 | [] | no_license | n = int(input())
result = ''
for i in range(1,n+1):
if i%2 == 1 :
if n != 1 and i != n:
result += 'I hate that '
else:
result += 'I hate it '
else:
if i != 1 and i != n:
result += 'I love that '
else:
result += 'I love... | true |
db4311eeab04083912f502f1f73af577d17368a4 | cccccccccccccc/Myleetcode | /53/maximumsubarray.py | UTF-8 | 689 | 3.359375 | 3 | [
"Apache-2.0"
] | permissive | # time complexity = O(n) space complexity = O(1)
# F(i) = max{F(i-1)+a[i],0} DP(dynamic programming
# if tmpmax < 0 tmpmax = 0 turn to next index
# maxsum = max(tmpmax)
from typing import List
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
if max(nums)<= 0:
return max(nums)
... | true |
dc1a8a8cf1b268dc1e9f3721a2abd337cc9d0f18 | OktayGardener/glip | /visufy/spotify.py | UTF-8 | 885 | 2.96875 | 3 | [] | no_license | from spotipy import Spotify
sp = Spotify()
def song(query):
"""If the query is an uri or url, get it instead"""
if query.startswith("spotify:track:") or query.startswith("https://open.spotify.com/track/"):
track = sp.track(query)
else:
"""Search Spotify and retrieve a relevant song."""
... | true |
5562a5b253b58ec8c54b867d2cc9aff1530af3c4 | Pneha1234/Data-Structure-in-python | /array.py | UTF-8 | 506 | 4.1875 | 4 | [] | no_license | # is a container which can hold fix number of items of same type
# Element - Each item stored in an array
# Index - identifier of the location of an array
from array import *
# typecode- defines the type of value(i representing integer)
exm_array = array('i', [10,20,30,40,50])
# accessing array element
print(exm_arra... | true |
c0a36e2c123bdd1d011bb541c383f1911a65b45f | shreyarm/DataMining | /Project-1/final_nested.py | UTF-8 | 1,513 | 2.71875 | 3 | [] | no_license | __author__ = 'shreyarajani'
import util
if __name__ == '__main__':
features = [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)] # 9 features
trainingData = [{(0, 0): 1, (0, 1): 1, (1, 2): 0, (2, 0): 0},
{(0, 0): 0, (0, 1): 1, (1, 2): 1, (1, 0): 0},
... | true |
5249dc2bb9bbcbf67d66e3c95bab5bf67424b829 | pnidhi26/Face-Expression-Detection | /modules/videocheck.py | UTF-8 | 557 | 2.546875 | 3 | [] | no_license | import subprocess
def video_check(file_path, output_file_path, frames_expected):
""" Rotating video (mobile front+back camera) using FFMPEG Library """
try:
command = "ffmpeg -i "+file_path+" -strict -2 -filter:v fps=fps="+frames_expected+" "+output_file_path
p = subprocess.Popen(command, shell=True, stdout=su... | true |
a2327cb60113306c048036f5c6f153f2eff77577 | Lizyll/PY4E_Code | /ch10_sortedExample.py | UTF-8 | 107 | 3.203125 | 3 | [] | no_license | d = {'b': 8, 'c': 9, 'a': 10}
t = sorted(d.items())
print(t)
for k,v in sorted(d.items()):
print(k, v)
| true |
9d896f4bf3d98c8b3fc687e09b5eb257199623b1 | grg909/LCtrip | /Binary_Tree/LintCode.597.Subtree_with_Maximum_Average.py | UTF-8 | 1,164 | 3.75 | 4 | [] | no_license | # -*- coding: UTF-8 -*-
# @Date : 2019/12/21
# @Author : WANG JINGE
# @Email : wang.j.au@m.titech.ac.jp
# @Language: python 3.7
"""
解题报告:Traverse的特点是不直接得到结果,
而是用每层得到的值去更新全局变量
"""
"""
Definition of TreeNode:
class TreeNode:
def __init__(self, val):
self.val = val
self.left, self.right... | true |
8153875c62a7ac882077200d96c3cffd4bd21119 | beblount/Steer-Clear-Backend | /tests/app_tests.py | UTF-8 | 13,778 | 2.546875 | 3 | [
"MIT"
] | permissive | from steerclear import app, db
from steerclear.models import *
from steerclear.views import *
import unittest, json, vcr
from datetime import datetime, timedelta
from testfixtures import replace, test_datetime
# vcr object used to record api request responses or return already recorded responses
myvcr = vcr.VCR(casset... | true |
aa0c1d2cf859b3534dedcab15919655d57ff8bdb | Jore93/adventcalendar | /day2_1.py | UTF-8 | 791 | 3.421875 | 3 | [] | no_license | # -*- coding:UTF-8 -*-
import sys
def read_file(file_name):
file = open(file_name)
text = file.readlines()
file.close()
return text
def calc_checksum(text):
checks = []
val = []
for i in range(len(text)-1):
values = text[i]
number = values.split("\t")
for j in num... | true |
7dcf96f8023a4224bd0ab45cb31173f16d221355 | ShrutheeshIR/Football-League-Data-Management | /predictions/predGoalTeam.py | UTF-8 | 3,251 | 2.671875 | 3 | [] | no_license | import plotly
import mysql.connector
import plotly.plotly as py
import plotly.graph_objs as go
from plotly.tools import FigureFactory as FF
import json
import numpy as np
import pandas as pd
import scipy
def goalteam(tid=None):
# print("booo")
mydb = mysql.connector.connect(
host="localhost",
user="roo... | true |
a37e64ed495d1fa80c45593db9e5f03c99657b31 | nerugattiraju/interview-questions | /pattrens.py | UTF-8 | 452 | 3.390625 | 3 | [] | no_license | n=int(input("enter the number"))
for i in range(n):
print(" "*(n-i)+"* "*(i+1))
n=int(input("enter the number"))
for i in range(n,0,-1):
print(" "*(n-i)+"* "*(i))
n=int(input("enter the number"))
x=0
for i in range(n):
for j in range(i):
print(x,end=" ")
x=x+1
print()
n=int(input("enter ... | true |
805fd38de4462a140d91112416fae3689c5d0de1 | WarwickAstro/snippets | /cutpoints/cutpoints.py | UTF-8 | 4,884 | 2.96875 | 3 | [] | no_license | """
A program to cut points from a spectrum. The features used in matplotlib
overwrite the rectangular selection used by this script so you can zoom
in on a specific region you wish to cut. The program will cut any points
that are within the boxed area, and then replot the data. If you make a
mistake, you can restart ... | true |
3c1bc73d528eb6c87dcfa9627891d0248f30cd7d | mannbiher/DeepLearningForHealthCareProject | /src/FLANNEL/utils/generate_bar.py | UTF-8 | 7,739 | 2.640625 | 3 | [
"MIT"
] | permissive | #
# This utility is to generate the bar chart of FLANNEL vs Patched FLANNEL Covid-19 scores
# Make sure results_home and measure_detail* file names are adjusted accordingly while running this util.
# results_home - line 12
# measure_detail* files in create_f1df function
#
import pandas as pd
import numpy... | true |
2b8a6ffa7c9c94ed413845ece49a17e5c06999e0 | michalgregor/class_utils | /class_utils/graphs.py | UTF-8 | 864 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | from IPython.display import Image, display
from sklearn.tree import export_graphviz
import graphviz
def show_tree(model, feature_names=None, class_names=None,
save2fpath=None, return_graph=False,
width=1000, height=None, impurity=False, filled=True,
proportion=True, rounded=Tr... | true |
ffa5d5d97a22c13a7d00a378418dfa795d291086 | kristofen/totofBeats | /audio-engine/configurationmanager.py | UTF-8 | 987 | 2.75 | 3 | [] | no_license | #-------------------------------------------------------------------------------
# Name: Configuration Manager
# Purpose: Loads and Saves Xml config files
#
# Author: Christophe
#
# Created: 22/02/2014
# Copyright: (c) Christophe 2014
# Licence: <your licence>
#--------------------------------... | true |
6bc2f6f9ebfc317ac07cf411cabb291fc15df44a | usop7/Python_OOP_Projects | /Lectures/1125/asyncio_request_ex.py | UTF-8 | 843 | 2.8125 | 3 | [] | no_license | import aiohttp
import asyncio
async def get_starwars_people_data(id: int, session: aiohttp.ClientSession, url: str) -> dict:
target_url = url.format(id)
response = await session.request(method="GET", url=target_url)
print(response)
print(type(response))
json_dict = await response.json()
print(... | true |
250ad47908d8fbeea0ccb1d457c2e95df8625031 | ayushkumarshah/Python_Optimizations | /Ch07/07_05/sqrt.py | UTF-8 | 214 | 3.90625 | 4 | [
"MIT"
] | permissive | """Small Math library"""
def sqrt(n, epsilon=0.0001):
"""Return square root of a number"""
guess = 1.0
while abs(guess*guess - n) > epsilon:
guess = (n/guess + guess) / 2.0
return guess
| true |
2c7c602e9364d9d591df82e6e574569390d85b8f | FSund/FY8904 | /Assignment 02/task3_animation.py | UTF-8 | 3,000 | 2.921875 | 3 | [] | no_license | import numpy as np
from math import sqrt, pi, sin, cos
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
mpl.rcParams['mathtext.fontset'] = 'cm' # use r"$x^3_i$" to produce math using cm font
mpl.rc('font', **{'family': 'serif', 'serif': ['CMU Serif Roman 2']})
L... | true |
8705b7eee5cfeb02157a3fab91243dcb9adf9b14 | dongrote/git-it | /lib/git.py | UTF-8 | 2,665 | 2.578125 | 3 | [] | no_license | #
# Python Git library
#
import os
import repo
def quote_string(s):
s = s.replace('\"', '\\\"')
return '\"%s\"' % s
def current_branch():
return filter(lambda x: x[1], all_branches())[0][0]
def all_branches():
branches = command_lines('branch', ['-a'])
arr = []
for b in branches:
current = b[0:2] == ... | true |
34621cfedc24ee53670e8daa52b82d44fb879158 | trishinairyna/trishina | /lesson_9/9_6_trishina_irina.py | UTF-8 | 589 | 4.40625 | 4 | [] | no_license | # Задание 6
# Напишите функцию, которая считает количество
# цифр в числе. Число передаётся в качестве параметра. Из
# функции нужно вернуть полученное количество цифр.
# Например, если передали 3456, количество цифр будет 4.
def number_of_digits (num:int):
count=0
while num>0:
num//=10
count=c... | true |
37b9b3bb0b12693c53909e71086e1a0c22a9d96a | michaelmdresser/neteng2017-ddos | /port_scan.py | UTF-8 | 1,791 | 2.6875 | 3 | [
"MIT"
] | permissive | #! /usr/bin/python
# http://resources.infosecinstitute.com/port-scanning-using-scapy/
# https://securitylair.wordpress.com/2014/02/21/simple-port-scanner-in-python-with-scapy-2/
import time
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Disable the annoying No Route found warning !
from s... | true |
640e739ffe4b81ea187c0736c8a62dc0523c96ea | tediris/robo_location | /path_gen_tester.py | UTF-8 | 1,679 | 2.765625 | 3 | [] | no_license | import sys
import path_generator as PG
import Tkinter as tk
import copy
COLORS = ["red","orange","yellow","green","blue","violet"]
def main(argv=None):
filename = str(raw_input("What image would you like to test? "))
if (len(filename) == 0):
filename = "hello.png"
smoothFactor = raw_input("What sm... | true |