blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 133 | path stringlengths 2 333 | src_encoding stringclasses 30
values | length_bytes int64 18 5.47M | score float64 2.52 5.81 | int_score int64 3 5 | detected_licenses listlengths 0 67 | license_type stringclasses 2
values | text stringlengths 12 5.47M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
3531e324c88e1571f8eea1443ae0420f6e7f1b46 | Python | arnab415/cmdcalc.exe | /calc.py | UTF-8 | 1,060 | 3.515625 | 4 | [] | no_license | import sys
import argparse as ap
def calc(args):
if args.o == "add":
return args.f + args.s
elif args.o == "sub":
return args.f - args.s
elif args.o == "mul":
return args.f * args.s
elif args.o == "div":
return args.f / args.s
elif args.o == "div":
... | true |
ffdb741624bfcfb31d69ce87dac93bff0f85f35b | Python | jwills15/garden | /Python Files/GardenPi/testingScripts/ConfigTest/configTest.py | UTF-8 | 412 | 2.765625 | 3 | [] | no_license | import configparser
config = configparser.ConfigParser()
config.read('configfile.ini')
current = int(config['DEFAULT']['whichValve'])
current += 1
config['DEFAULT']['whichValve'] = str(current)
print(config['DEFAULT']['whichValve'])
if current >= 4:
config['DEFAULT']['whichValve'] = '0'
print(config['DEFAULT']['... | true |
6b1df47677fe311d221c5b8aef62d6b206778749 | Python | EmotionalBeast/muse | /animation.py | UTF-8 | 7,273 | 2.53125 | 3 | [] | no_license | #!/usr/bin/python3
#coding: utf-8
#@author: Lazy Yao
#@email: none
#@date: 2020/07/10 14:08
import os, json
CH = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
NUM = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
class AnimationData(ob... | true |
f660cb27588393aea1544f587b1791c3865499c3 | Python | Nordenbox/Nordenbox_Python_Fundmental | /闰年.py | UTF-8 | 206 | 3.609375 | 4 | [] | no_license |
temp = input("输入年份:")
YEAR = int(temp)
if (YEAR % 4 == 0 and YEAR % 100 != 0) or (YEAR % 400 == 0 and YEAR % 3200 != 0) or YEAR % 172800 == 0:
print ("闰年")
else:
print ("非闰年") | true |
f59daa123a5de65e88cd2bef8717c678a0017fcb | Python | HunterCSci127/HunterCSci127.github.io | /files/cunyLocations.py | UTF-8 | 1,067 | 3.25 | 3 | [] | no_license | import folium
import pandas as pd
import webbrowser #display html file
import os #use to find directory
#Use pandas (alias pd) to read a csv file,
#save the return data frame object in variable cuny.
cuny = pd.read_csv('cunyLocations.csv')
#Create a map object centered at 40.75, -74.125,
#save in variable mapCUNY.
ma... | true |
910e516bbeafd1aa15ce11925d57fb648257014d | Python | S0c5/learningpython | /ex18-21.py | UTF-8 | 563 | 3.234375 | 3 | [] | no_license | # This is a file of execerices 18-19-20-21 of learning python.
from sys import argv
from os.path import exists
def print_file(f):
print f.read()
def line(f):
return f.readline()
def print_exist(file_name):
flag = exists(file_name)
print "Exist file name? ",flag
return flag
def rewind(f):
f.seek(0)
script_... | true |
46269e12ceecc692da7ea0de00b1a8f424b8f4d2 | Python | robin0371/servem | /server/validate.py | UTF-8 | 884 | 2.890625 | 3 | [] | no_license | from cerberus import Validator
# Схема валидации тела запроса
STATUS_SCHEMA = {
'device_id': {
'type': 'string', 'regex': '^[a-z]{1,10}[_]{1}\d+$', 'required': True},
'request_id': {'type': 'string', 'min': 16, 'max': 16, 'required': True},
'status': {'type': 'string', 'required': True},
'data... | true |
47b3f170ee269dcd95e24ce5c44c277ca28098b2 | Python | Aly-Elgharabawy/TestCNN | /CNN.py | UTF-8 | 2,717 | 3.0625 | 3 | [] | no_license | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import matplotlib.pyplot as plt
import torchvision
import torchvision.transforms as transforms
torch.set_printoptions(linewidth=120)
torch.set_grad_enabled(True)
train_set = torchvision.datasets.FashionMNIST(
root = '.... | true |
78d62f17ad76341ed05ecab509e512768e12a2ba | Python | chrysalisDVT/python-basics | /merge_sort.py | UTF-8 | 1,266 | 3.828125 | 4 | [] | no_license | def split(base_list):
""" Splits the list and returns the left and right sub list"""
list_mid_pointer=len(base_list)//2
return base_list[:list_mid_pointer],base_list[list_mid_pointer:]
def merge_sorted_list(left_sublist,right_sublist):
""" Merges the sorted list provided and returns the sorted list"""
... | true |
0e38835a2fad49506313eff19c21518ba49be086 | Python | thiagoabreu93/ed-not-2021-2 | /cursoemvideo/exercicios/ex007.py | UTF-8 | 158 | 4.09375 | 4 | [] | no_license | n1 = float(input('Digite a Nota 1: '))
n2 = float(input('Digite a Nota 2: '))
print('A média entre {:.1f} e {:.1f} é: {:.1f}'.format(n1, n2, (n1+n2)/2))
| true |
b1ef59f157f1eb864bd4e9a2e793d7de0c133de1 | Python | Solotzy/Scraping | /PythonScraping/ch5/04TableToCsv.py | UTF-8 | 684 | 2.828125 | 3 | [] | no_license | # coding: utf-8
import csv
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen("https://zh.wikipedia.org/wiki/%E6%96%87%E4%BB%B6%E7%BC%96%E8%BE%91%E5%99%A8%E6%AF%94%E8%BE%83")
bsObj = BeautifulSoup(html, "html.parser")
# 主对比表格是当前页面上的第一个表格
table = bsObj.findAll("table", {"class":"wikitable"}... | true |
6a3b27886c99f76914707391db58b61b8d7716e0 | Python | RounakChatterjee/SEM2_Assignment4 | /Codes/Chi_Sq_Test.py | UTF-8 | 2,148 | 3.875 | 4 | [] | no_license | '''
CHI SQUARED TEST FOR RANDOM NUMBERS
=============================================================
Author : Rounak Chatterjee
Date : 01/06/2020
=============================================================
The Chi squared test is one of the ways to check whether a random number generator's
performance. If we ... | true |
c5b6cbf00a0b6690696f80f18bee9ab6318b7832 | Python | ibrahim272941/python_projects | /combination.py | UTF-8 | 171 | 3.078125 | 3 | [] | no_license | new=[1,2,3]
new_1=[]
r,l=0,0
for i in new:
new_1.append(new[l:]+new[:r])
a=list(reversed(new))
new_1.append(a[l:]+a[:r])
l+=1
r+=1
print(sorted(new_1)) | true |
42281f6ce39543ce372b92e8e6d9de1215f79a11 | Python | yutianji888/CV-Python-Basic | /ch25-Hough直线变换/25.1-OpenCV中的霍夫变换-HoughLines.py | UTF-8 | 1,298 | 3.53125 | 4 | [] | no_license | # -*- coding: utf-8 -*-
# __author__ = 'corvin'
"""
cv2.HoughLines()。
返回值就是( ρ; θ)。 ρ 的单位是像素, θ 的单位是弧度。这个函数的第一个参
数是一个二值化图像,所以在进行霍夫变换之前要首先进行二值化,或者进行
Canny 边缘检测。第二和第三个值分别代表 ρ 和 θ 的精确度。第四个参数是
阈值,只有累加其中的值高于阈值时才被认为是一条直线,也可以把它看成能
检测到的直线的最短长度(以像素点为单位)
"""
import cv2
import numpy as np
img = cv2.imread('../data/sudoku.jpg')
... | true |
ca2425801ca87e2e193b607ea567e755cae07f8f | Python | HuZhenghang/Coursera-practices | /memory.py | UTF-8 | 1,951 | 3.078125 | 3 | [] | no_license | import simplegui
import random
list= [1,2,2,3,7,1,5,8,3,5,4,4,6,7,6,8]
list_turn=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
state=0
last_number=-1
def mouse_handler(position):
global state
global list_turn
global last_number
number=position[0]/50
if state==0:
state=1
li... | true |
6b507a11623f7a3da6673a8ba426fa7a05df176a | Python | jhubar/PI | /Python/SEIR_extended.py | UTF-8 | 21,718 | 2.875 | 3 | [] | no_license | import json
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.integrate import odeint
from scipy.optimize import minimize
import math
"""
=======================================================================================================
Meilleure version à l'heure actuel (... | true |
c0d661ba7c34b4cd1fe7a0d90f87043f8bd48b22 | Python | prostomusa/Solutionpython | /task_4/SRC/task4.py | UTF-8 | 804 | 3.671875 | 4 | [] | no_license | def compare_two_string(x, y):
if "*" in x:
return("Неверный формат данных")
if "*" not in y and len(x) != len(y):
return ("KO")
tern = y.split("*")
p = 0
if tern[0] != "":
if tern[0] != x[:len(tern[0]):]:
return("KO")
if tern[-1] != "":
if tern[-1] !=... | true |
4b6227deb3bbea45f6b015ffd559448c95b39e9d | Python | frix360/nlp-project | /Questions.py | UTF-8 | 970 | 3.421875 | 3 | [] | no_license | class Questions:
def __init__(self):
self.questions = {}
self.__init_questions()
def __init_questions(self):
self.questions = {
'color': [
'What is the color of the button?',
'What is the button\'s color?',
'Color of the button... | true |
022b75b0a2c69d5491ced09b58bdd4dfe03472df | Python | rhbelson/WhenInRome | /main.py | UTF-8 | 9,182 | 2.859375 | 3 | [] | no_license | import chord_quality_identifier
import chroma_to_notes
import convert_labels_to_roman_numerals
import csv
import notes_to_chroma
import os
import runMelisma
import sys
import transposition
if len(sys.argv) != 2:
print "usage: python main.py [midifile]"
quit()
args = sys.argv
midifile = args[1]
keys = ['C', 'C... | true |
f845d1ad54cc6c868ed411f0d47b21ea5f6c5ac9 | Python | kunjur-shreesha/HackerEarth | /Basic-Programming/Palindromic String.py | UTF-8 | 119 | 3.640625 | 4 | [] | no_license | def rev(x):
return x[::-1]
str1=input()
str2=rev(str1)
if str1==str2:
print("YES")
else:
print("NO") | true |
2eff5caf1dc664376f158305b42adb1cbe4f2937 | Python | heiye1024/Django_Blog | /blog_run订单系统基本完成,版本6/system/forms.py | UTF-8 | 2,096 | 2.5625 | 3 | [] | no_license | import re
from django import forms
class LinkForm(forms.Form):
txtTitle = forms.CharField(label='网站名称',max_length=24,error_messages={
'required':'请输入网站名称'
})
txtUserName = forms.CharField(label='联系人姓名',max_length=6,error_messages={
'required':'请输入联系人姓名'
})
txtUserTel = forms.CharFi... | true |
b78b46437ef59bf050ddee2df7d37c5c1530ca39 | Python | hjorthjort/advent2020 | /day11/11.py | UTF-8 | 1,961 | 2.96875 | 3 | [] | no_license | from copy import deepcopy
with open('input.txt') as f:
inp = f.read()
arounds1 = {}
def around1(pos_x, pos_y, max_x, max_y):
if (pos_x, pos_y) in arounds1:
return arounds1[(pos_x, pos_y)]
positions = [(x, y) for x in range(pos_x-1, pos_x+2) for y in range(pos_y-1, pos_y+2) if max_x > x >= 0 and ... | true |
340bf6eaf2ff862f412a10f5e065252b53caca4c | Python | canberkaslan/pythonexamples | /example_sets_002/05_for_loops.py | UTF-8 | 809 | 3.40625 | 3 | [] | no_license | #names = ['ali','veli','murtaza']
#for x in names:
# print(f'my name is {x}')
#
#name = 'Cabbar Can'
#
#for x in name:
# print(x)
#
#tuple = [(1,2),(3,4),(5,6),(7,8)]
#for x in tuple:
# for y in x:
# print(y)
#tuple = [(1,2),(3,4),(5,6),(7,8)]
#for x,y in tuple:
# print(x,y)
#
#x = {'x1':1,'x2'... | true |
5ec34640c3926a265e028b3253ac8891abf85785 | Python | charan3/NoteBook | /models/BlogModel.py | UTF-8 | 1,581 | 2.59375 | 3 | [] | no_license | from google.appengine.ext import db
from datetime import datetime
from .UserModel import UserModel
import logging
class BlogModel(db.Model):
title = db.StringProperty(required=True) # type: str
content = db.TextProperty(required=True) # type: str
# username of writer
author = db.ReferenceProperty(Use... | true |
8cfb02f119fd628fcb16ed4d41dda260c352b0b0 | Python | raymondbutcher/pretf | /pretf/pretf/collections.py | UTF-8 | 3,170 | 2.765625 | 3 | [
"MIT"
] | permissive | from functools import wraps
from typing import Any, Callable, Generator, Iterable, Sequence, Union
from .parser import get_outputs_from_block
from .render import call_pretf_function, unwrap_yielded
from .variables import VariableStore, VariableValue, get_variable_definitions_from_block
class Collection(Iterable):
... | true |
35a9971e9ac361001bdb83255d50bc4977392f2c | Python | MacIver-Lab/Ergodic-Information-Harvesting | /SimulationCode/ErgodicHarvestingLib/ergodic.py | UTF-8 | 14,918 | 2.625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
import numpy as np
from scipy.integrate import trapz, quad, solve_ivp
from scipy.interpolate import interp1d
from ErgodicHarvestingLib.utils import matmult
class ProjectionBasedOpt(object):
def __init__(self, nx, nu, R, time, Quinit):
"""
Class to represent an optimization... | true |
243ba7f7644d3f65c9644a2077f42b3321e07fa3 | Python | LucasSQPardo/coursera-Python_Data_Structure | /python_data_structure/open_read_write_file/processing_files.py | UTF-8 | 1,051 | 3.8125 | 4 | [] | no_license | def lengthOfFile(fileVectorVar):
length = len(fileVectorVar)
return length
def foundSomething(fileVariable):
searchTerm = input("Keyword: ")
for lines in fileVariable:
if searchTerm in lines:
print(lines.strip())
return
def readIt(fileVariable):
for line in fileVariable:
... | true |
4e34cdcd7e5670b6d28090f6f6a0b30367ed7004 | Python | mukutkhandelwal/Face-Detection-Using-Deep-learning | /video_detection.py | UTF-8 | 2,276 | 2.734375 | 3 | [] | no_license | # required libraries
import numpy as np
import argparse
import imutils
import time
import cv2
# creating the command line argument for passing the image,model,weights of model and optional Confidence
ap = argparse.ArgumentParser()
# ap.add_argument('-i','--image',required=True,help = 'path of img')
ap.add_... | true |
d9c743fa60434ce1b11e7488da5c26364866cd18 | Python | Irou1/Bridge-Application | /Logic/New_Game.py | UTF-8 | 9,482 | 2.546875 | 3 | [
"MIT"
] | permissive | from tkinter import *
import tkinter as tk
import random
root = tk.Tk()
root.geometry("800x800")
canvas = tk.Canvas(root,width=800,height=800)
canvas.pack()
#Heart
h1 = tk.PhotoImage(file='C:\\Users\\JORGEALEJANDRO\\OneDrive\\Python_Tkinter\\deck\\Heart1.gif')
h2 = tk.PhotoImage(file='C:\\Users\\JORGEALE... | true |
8b11962ac004d8a745989786a8297508660a6d1e | Python | SrtaCamelo/TextMining2018.2 | /Mineracao_L02/1qst_l02.py | UTF-8 | 3,413 | 3.1875 | 3 | [] | no_license | #Mineração de Texto 2018.2
#Raissa Camelo Salhab
#Lista 02, Questão 01
#--------------------------------------Word Clouds with NLTK-----------------------------------------------------
#-------------Imports-----------
import nltk
from nltk.stem import WordNetLemmatizer
#from nltk.corpus import stopwords
from nltk.tree... | true |
680b19634072384d70df43227e0a7585193c2ce0 | Python | Leozoka/ProjetosGH | /002.py | UTF-8 | 48 | 2.78125 | 3 | [] | no_license | msg = ('Python ')
msg = msg.rstrip()
print(msg)
| true |
968548f55263fe86b872dd7f7636e2de06d22ae1 | Python | benjiaming/leetcode | /test_group_anagrams.py | UTF-8 | 550 | 3.203125 | 3 | [] | no_license | import unittest
from group_anagrams import Solution
class TestSolution(unittest.TestCase):
def test_group_anagrams(self):
solution = Solution()
anagrams = [
["ate","eat","tea"],
["nat","tan"],
["bat"]
]
result = solution.groupAnagrams... | true |
c776d7c4104055f1b39004529e27f7c40173781a | Python | arpitsomani8/Python-Programming-Projects | /Image Processing-Enhance Your Image/Flipping the image/Flipping_the_image.py | UTF-8 | 294 | 3.21875 | 3 | [] | no_license | """
@author: Arpit Somani
"""
#flipping the image
from PIL import Image
#opening the image
img=Image.open("obtained.png")
#transposing
transposed_img=img.transpose(Image.FLIP_LEFT_RIGHT)
#SAVE IT TO A FILE IN A HUMAN UNDERSTANDABLE FORMET
transposed_img.save("corrected.png")
print("Done Flipping")
| true |
7de41f23fc40801f58c6a8b0921521ad9c630a4e | Python | KKP127/pythonexample | /ex.py | UTF-8 | 373 | 4.59375 | 5 | [] | no_license | # WARNING! We put a end=' ' at the end of each print line. This tells print to not end
# the line with a newline character and go to the next line
print("How old are you?:",end=' ')
age=input()
print("How tall are you?:",end=' ')
tall=input()
print("How much do you weight?:",end=' ')
weight=input()
print(f"So you ... | true |
78c48930f2523275956a8172ddfe29c3975c9b2d | Python | emmanuelgonzalezcota/PythonCourse | /3.1.2.8 Loops LAB continue Ugly Vowel Eater.py | UTF-8 | 142 | 3.28125 | 3 | [] | no_license | # Prompt the user to enter a word
# and assign it to the userWord variable.
for letter in userWord:
# Complete the body of the for loop.r | true |
753fc7c3490e097832ca657549d9c080ef47608c | Python | violasignorile01/sqlalchemy-challenge | /app.py | UTF-8 | 4,452 | 2.59375 | 3 | [] | no_license | import numpy as np
import pandas as pd
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from flask import Flask, jsonify
engine = create_engine("sqlite:///Resources/hawaii.sqlite")
Base = automap_base... | true |
57679ec31088d9e30a9381d3e51d9d4aebf9384e | Python | PHI-base/phi-nets | /Python-code/resolving_overlapping_domains.py | UTF-8 | 7,885 | 2.75 | 3 | [
"MIT"
] | permissive | #************ THE PROGRAM TO RESOLVE OVERLAPPING BETWEEN DOMAINS IN PROTEINS *************
# Author: Elzbieta Janowska-Sedja, 16/06/2019
# As input file hmmer file with domain signatures is used.
# The format of the file is described below
#********************************************... | true |
a4281863b19454d9a1d138063350f1e4c131b32f | Python | Keramas/RPG_Battle | /main.py | UTF-8 | 9,630 | 2.84375 | 3 | [] | no_license | from classes.game import Person, bcolors
from classes.magic import Spell
from classes.inventory import Item
import random
# Spells usable by the player
# Offensive spells:
staticBurst = Spell("Static Burst", 25, 600, "black")
gravitonCannon = Spell("Graviton Cannon", 250, 600, "black")
bash = Spell("Bash", 25, 600, "b... | true |
8670c6324b69c686a79487becaaacb1ec4ef4326 | Python | acmore/OpenEmbedding | /laboratory/benchmark/summary.py | UTF-8 | 746 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | import os
import sys
times = dict()
for name in os.listdir(sys.argv[1]):
time = 100000000
for line in open(sys.argv[1] + '/' + name):
r = line.find('s - loss')
l = line.find('-')
if l > r:
l = line.find(':')
if l != -1 and r != -1:
time = min(time, int(li... | true |
ed2d4f4816d1e6f5a3acb04644720dce6bbe0a2d | Python | skfo763/Problem_Solving | /backjoon/sorting/10989.py | UTF-8 | 377 | 3.484375 | 3 | [] | no_license | import sys
input = sys.stdin.readline
print = sys.stdout.write
list = [0 for i in range(10001)]
n = int(input().rstrip())
# 상자에 담는다.
for _ in range(n):
number = int(input().rstrip())
list[number] = list[number] + 1
# 상자에 담긴걸 확인하고 출력
for i, val in enumerate(list):
for j in range(val):
print(str(i)... | true |
a14e518b119bc26378ff78e0cbf3fdfe552a056a | Python | qs8607a/Algorithm-39 | /Euler/part2/p98.py | UTF-8 | 988 | 3.15625 | 3 | [] | no_license | from itertools import permutations
from collections import Counter,defaultdict
issquare=lambda x:int(x**0.5)**2==x
def g(s1,s2):
s=list(set(s1))
l=len(s)
m=0
X=1
for x in permutations('0123456789',l):
if X%100000==0:
print(X)
X+=1
t1,t2=s1,s2
... | true |
00be2045f248d1f5a874a224ecddaddc1ff7d1b7 | Python | YuliiaAntonova/codingbat | /warmup-1/parrot_trouble.py | UTF-8 | 543 | 4.09375 | 4 | [] | no_license |
# We have a loud talking parrot. The "hour" parameter is the
# current hour time in the range 0..23. We are in trouble if the parrot is
# talking and the hour is before 7 or after 20. Return True if we are in trouble.
# parrot_trouble(True, 6) → True
# parrot_trouble(True, 7) → False
# parrot_trouble(False, 6) → Fals... | true |
c965a6727c5551ceb6051e1e993cdcb90299966a | Python | NARMATHA-R/PYTHON-PRACTICE | /islower.py | UTF-8 | 46 | 3.21875 | 3 | [] | no_license | txt = "hello all!"
x = txt.islower()
print(x)
| true |
780e64202e6728eebf8e397f521634383c99ce36 | Python | s81320/dsw | /data-acquisition/get-content-tsp-02.py | UTF-8 | 1,497 | 2.625 | 3 | [] | no_license | from newspaper import Article
import time
import sys , os
import json
# first filename witt be i+1
# so i should be the latest number given to an article
i=529 # for 14th of July
with open("links-tsp-2020-07-14-new.txt" , "r") as link_file :
all_lines = link_file.readlines()
for link in all_lines:
link = link.re... | true |
733b0712e557cfeba0566d83f44e619fc2b1b89a | Python | vumeshkumarraju/class | /assesment1/code2.py | UTF-8 | 290 | 4.21875 | 4 | [] | no_license | #factorial of a number
print("\nwelcome to the program")
print("we are going to find the factorial of your inputed number.\n")
n = int(input("enter the number="))
i=n
fact=1
print("THE FACTORIAL OF ",n,":-")
while i>1:
fact=fact*i
print(i,end=" x ")
i-=1
print("1 = ",fact)
| true |
1c7193de57ec8c8b2e61e07e9ba67c892c87d480 | Python | Grievi/Pomodoro | /app/auth/v1/utilities/timer.py | UTF-8 | 711 | 3.3125 | 3 | [] | no_license | import time
class UserTimer():
def pomodoro(t):
print("Timer starts now!")
for i in range(4):
set_time = t*60
while set_time:
mins = t // 60
secs = t % 60
timer = '{:02d}:{:02d}'.format(mins,secs)
print("" + ti... | true |
6c65489667ae145255d4fe3fd55e1f0af6305dde | Python | kunaldesign/python-program | /program 11.py | UTF-8 | 445 | 4.3125 | 4 | [] | no_license | #program using if...else statment to find the largest number
n1=int(input("enter an 1st number: "))
n2=int(input("enter an 2nd number: "))
n3=int(input("enter an 3rd number: "))
if (n1>=n2):
if(n1>=n3):
print('{} is the largest.'.format(n1))
else:
print('{} is the largest.'.format(n3))
else:
... | true |
68333cb2522912e371fb2d34e3f9fd4c75272705 | Python | staticfloat/libsquiggly | /libsquiggly/resampling/upfirdn/__init__.py | UTF-8 | 11,983 | 2.8125 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | # Copyright (c) 2009, Motorola, Inc
#
# All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | true |
17cdb43142264b2a9a0793c25a5fef29f2947bca | Python | pvithayathil/titanic | /titantic_explore_pv.py | UTF-8 | 7,198 | 3.125 | 3 | [] | no_license | import numpy as np
import pandas as pd
import sklearn.linear_model as lm
from sklearn.model_selection import GridSearchCV
import matplotlib.pyplot as plt
# Import the RandomForestClassifier
from sklearn.ensemble import RandomForestClassifier
# Thanks for https://www.kaggle.com/arthurlu/titanic/exploratory-tu... | true |
6583352a01a38143d0575cc310ab132e4a91ef80 | Python | jacekstamm/Python_Exercise | /exercises/calculator/Calculator.py | UTF-8 | 2,467 | 4.5625 | 5 | [] | no_license | def add(a, b):
return a + b
def substract(a, b):
return a - b
def multiplication(a, b):
return a * b
def divine(a, b):
return a / b
def power(a, b):
return a ** b
def calculator():
database = []
print("Wybierz działanie które chcesz wykonać:")
print("1. Dodawanie")
print("2... | true |
60634ee271ca7bad1de37381cd511e70e26809f0 | Python | AmineCharko/UPGMA | /Projet_UPGMA.py | UTF-8 | 3,255 | 3.03125 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: aminecharko
"""
def trouverDistMin(mat):
case_min = 999999999 # on génére case_min à l'infini
x, y = -1, -1
for i in range(len(mat)):
for j in range(len(mat[i])):
if (mat[i][j] < case_min and mat[i][j] != 0):
ca... | true |
20e4047146af85c0344b41811ca5777025ac6555 | Python | WeeDom/exercism | /python/robot-name/robot_name.py | UTF-8 | 978 | 3 | 3 | [] | no_license | import random
import string
import os
class Robot:
def generate_random_name(self):
# generate a random name, and check against extant robot_names.txt
name = ''.join(random.choice(string.ascii_uppercase) for i in range(2)) + \
''.join(random.choice(string.digits) for i in range(3))
... | true |
43f981bd6111dcc005b3873bb9d28da88439494e | Python | Kratharth/1BM17CS035 | /Class Programs/class1.py | UTF-8 | 1,211 | 3.65625 | 4 | [] | no_license | class student:
def __init__(self):
self.i = None
self.m = None
self.a = None
def set(self,student_id,marks,age):
self.i = student_id
self.m = marks
self.a = age
def get(self):
print('Id is :' + str(self.i))
print('Marks is : ' + str(self.m))
print('Age is : '+ str(self.a))
def validate_marks(... | true |
46985d31dfa315fb38954be9118e719f75521bc5 | Python | feliciahsieh/holbertonschool-webstack_basics | /0x01-python_basics/106-weight_average.py | UTF-8 | 476 | 3.78125 | 4 | [] | no_license | #!/usr/bin/python3
"""106-weight_average.py - calc weighted average of all integer tuples
"""
def weight_average(my_list=[]):
""" weight_average() - calc weighted average of all integer tuples
Arguments:
my_list: list of tuples
Returns: weighted average
"""
if my_list == []:
return 0
... | true |
c19bfc2a050c0eef23069cb3c3e8b426cccc796e | Python | deepaknalore/IDS-for-Authentication-Services | /Simulation/AttackSimulation/LegitimateUser.py | UTF-8 | 3,177 | 2.859375 | 3 | [] | no_license | import requests
import csv
import json
import time
import threading
import queue
import random
from copy import deepcopy
from helper import passwordTypo
start_time = time.time()
LEGITIMATE_USER_DATA = '../Resources/user.csv'
# Threading related information
q = queue.Queue()
n_thread = 10
payload = {'user':'', 'pass... | true |
77e03b7634c4dc2a0b5397a2abe0261dbe40a150 | Python | CJ8664/leetcode | /45-jump-game-ii/45-jump-game-ii.py | UTF-8 | 541 | 3.1875 | 3 | [] | no_license | class Solution:
def jump(self, nums: List[int]) -> int:
# from the current element in the window find the
# farthest index that you can jump. That becomes
# the end point of the next window
# Number of windows is the result
l, r = 0, 0
res = 0
while r < (len... | true |
a78b71f5aafc41d5e59e3113d8af2553157c1089 | Python | shentonfreude/rfd | /rfd/views.py | UTF-8 | 2,421 | 2.515625 | 3 | [] | no_license | # Templates get 'context' automatically so we don't need to pass it.
from repoze.bfg.url import model_url
from webob.exc import HTTPFound
import logging
logging.basicConfig(level=logging.INFO)
def _make_name_url(context, request, thing):
"""Can I do this differently by having a url() meth on the obj?
And use _... | true |
f8b7743b2341cfa7149f4d7bfb87c4b9187655f5 | Python | Sahara241/opencv- | /opencv18.py | UTF-8 | 639 | 3.171875 | 3 | [] | no_license | #Canny Edge Detection in OpenCV
import cv2
import numpy as np
from matplotlib import pyplot as plt
img=cv2.imread('ronaldo.jpg',0)
img2=cv2.imread('lena.jpg',0)
canny=cv2.Canny(img,100,200)
lena=cv2.Canny(img2,100,200)
titles=['image','image2','canny','canny2']
images=[img,canny,img2,lena]
for i in range(4):
pl... | true |
07f02225103dc93909358528f2c960cb1d2579c3 | Python | jimfred/python | /PythonSwigWindows/HurryTutorial/RunMe.py | UTF-8 | 169 | 2.765625 | 3 | [] | no_license | import example
print(example.cvar.My_variable) # 3.21
print(example.fact(5)) # 120
print(example.my_mod(7,3)) # 1
print(example.get_time()) # '2021-08-30 15:37:08'
| true |
cff6e849ac4f861e31065c785177efa5d2626e2f | Python | ccrain78990s/Python-Exercise | /0413 客服機器人/1-複習/Mylib.py | UTF-8 | 55 | 2.6875 | 3 | [
"MIT"
] | permissive | def ILikeEat(x):
print("我愛吃"+""+x+""+"嗎?")
| true |
bbe3cb24c9b083f1599d6f44e7ae67f2f25ddcf1 | Python | alimahmoudi29/tsdate | /tests/test_cache.py | UTF-8 | 1,950 | 2.640625 | 3 | [
"MIT"
] | permissive | """
Tests for the cache management code.
"""
import os
import pathlib
import unittest
import appdirs
import numpy as np
import tsdate
from tsdate.prior import ConditionalCoalescentTimes
class TestSetCacheDir(unittest.TestCase):
"""
Tests the set_cache_dir function.
"""
def test_cache_dir_exists(sel... | true |
e4b78bd8e1c173cfc6c37b54acc4105142439c0f | Python | gslavine30/slx_projecet | /data_etl/clickhouse/weidu_industry.py | UTF-8 | 2,079 | 2.75 | 3 | [] | no_license | from clickhouse_driver import Client
clickhouse_config = {'host': "39.100.224.138",
'port': '9090',
'database': 'JIANG',
'user': "default",
'password': "slx2021"
}
client = Client(**clickhouse_config)
... | true |
2fefa8a116104344610e4dd78c17714f9c0f5aa5 | Python | niterain/digsby | /digsby/src/common/scriptengine.py | UTF-8 | 3,256 | 2.828125 | 3 | [
"Python-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | from __future__ import with_statement
from types import GeneratorType
import collections
import os.path
import sys
def runfile(filename):
filename = os.path.expanduser(filename)
with open(filename) as f:
contents = f.read()
runscript(contents, filename)
def runscript(script, filename):
s... | true |
e48562e4b5497bdb7c8ad6149fa8a5c929bdab51 | Python | gmeader/pybadge | /writefiles/writefile.py | UTF-8 | 360 | 2.640625 | 3 | [] | no_license | # check to see if PyBadge can write to its filesystem
# must have installed boot.py on the PyBadge
# and must hold a button while rebooting the PyBadge
import board
import digitalio
import storage
import time
try:
with open("/test.txt", "a") as fp:
fp.write("hello, world!")
print('Wrote file')
except Excepti... | true |
d5960c648f42d0aef274ea9cf78057d325e4d660 | Python | MiguelBim/Python_40_c | /Challenge_28.py | UTF-8 | 2,550 | 4.15625 | 4 | [] | no_license | # CHALLENGE NUMBER 28
# TOPIC: While Struct
# Prime Number App
# https://www.udemy.com/course/the-art-of-doing/learn/lecture/17060854#overview
import time
def check_primer_num(number):
if number > 1:
for prev_num in range(2, number + 1):
if prev_num == number:
continue
... | true |
25cadd8183ce0587f019f57b32974c214c859437 | Python | wudc5/Python_Teach | /Spider/getPicure.py | UTF-8 | 882 | 2.796875 | 3 | [] | no_license | #coding=utf-8
import urllib
import re
import urllib2
proxy_info = {'host': 'web-proxy.oa.com', 'port':8080}
proxy_support = urllib2.ProxyHandler({"http": "http://%(host)s:%(port)d" % proxy_info})
opener = urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
def getHtml(url):
page = ... | true |
75adb7844013a711a39da6132c449c787577aba7 | Python | RUPAK7406/leetCode-python-solutions | /leetCode-349.py | UTF-8 | 220 | 2.890625 | 3 | [] | no_license | class Solution:
def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
nums1 = set(nums1)
nums2 = set(nums2)
result = nums1.intersection(nums2)
return result
| true |
c8c1c01e4710c344fe5449f5789f9d7b28ad423f | Python | spiedeman/LeetCode-Note | /html2md.py | UTF-8 | 5,116 | 2.78125 | 3 | [] | no_license | import os
import sys
import re
from functools import partial
LOCAL_PATH=os.path.split(os.path.abspath(sys.argv[0]))[0]
class HTML2MARKDOWN(object):
def __init__(self, info=dict(), output='output.md', solution_path='.'):
self.info = info
self.problem = ''
self.output = solution_path+'/'+out... | true |
b8b5725590710126db4ab8b2fc12f194e55efbd3 | Python | erjillsison/Reddit-Wallpaper-Downloader | /Source Codes/scheduler.py | UTF-8 | 2,042 | 2.828125 | 3 | [] | no_license | import os, subprocess, sys, time
#Get and set the current working directory
if getattr(sys, 'frozen', False):
absWorkingDir = os.path.dirname(sys.executable)
elif __file__:
absWorkingDir = os.path.dirname(__file__)
os.chdir(absWorkingDir)
filePath = os.path.join(absWorkingDir,"rwd.pyw")
sc = ''
mo = ''
def... | true |
cf55afaaab82dc67f842f67c045e8c4e189da463 | Python | kanishkegb/CSCI-6527-projects | /Project-1/crop_funcs.py | UTF-8 | 4,864 | 3.515625 | 4 | [] | no_license | def crop_aligned_image(img, roll_g, roll_r):
'''
Crop the aligned image consideing the outside border and the amount of
pixels the G and R layers were rolled to align them.
Args:
img: array - aligned image
roll_g: tuple - amount of pixels the G layer was rolled to align it
... | true |
50ba3e1aab14a67273936154659cb136c0fe03d4 | Python | markbaas/markstimetracker | /markstimetracker/models.py | UTF-8 | 3,733 | 2.71875 | 3 | [] | no_license | import datetime
import random
from collections import defaultdict
from dateutil.relativedelta import relativedelta
from sqlalchemy import Column, ForeignKey, Integer, String, Boolean
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import re... | true |
afa7e5d214a0d413aafcbfb93abdb02edcf214d6 | Python | kurtd5105/AdventOfCode | /Day 14/part2.py | UTF-8 | 2,333 | 3.40625 | 3 | [] | no_license | import sys
def getNextDist(reindeer):
"""Iterator to Calculate the distance that each reindeer travels in 2503 seconds"""
limit = 2503
time = 0
prevTime = 0
timeCycle = 0
distance = 0
flying = True
while time < limit:
#If it's flying then it's moving
if flying:
#If the reindeer isn't tire... | true |
0548a067fd315bcb2b743ab306ff2e73541a83f4 | Python | hetaov/study | /data/read_rules.py | UTF-8 | 191 | 2.578125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
def read():
book = open_workbook('rules.xlsx')
sheets = book.sheets()
sheet = sheets[5]
if __name__ == '__main__':
rules = read()
print rules
| true |
1462a332647a738fd6bfc6252eb91d4677288587 | Python | Prashast07/Python-Projects | /findBob.py | UTF-8 | 191 | 3.15625 | 3 | [] | no_license | s = "bobhdhaboblklbobbob"
count = 0
subString = ""
for i in range(len(s)):
if s[i] == 'b':
subString = s[i:i+3]
if subString == "bob":
count += 1
print count
| true |
e1baea77798df41f9d34f05648d6c783e317a10a | Python | Jingyueshi/MyPython | /mztespro/baidu.py | UTF-8 | 672 | 3.1875 | 3 | [] | no_license | # -*- coding utf-8 -*-
# @author:"zhangJingHua"
import time
from selenium import webdriver
# driver=webdriver.Firefox()
driver=webdriver.Chrome()
driver.get("https://www.baidu.com")
#获得输入框的尺寸
size=driver.find_element_by_id('kw').size
print(size)
#返回百度页面底部备案信息
text=driver.find_element_by_id("cp").text
print(text)
#返... | true |
698ca3ec8867ab65094e95c210288e6d1cd78bbd | Python | abhi-laksh/Python | /Adv/Photoshop/a.py | UTF-8 | 52 | 2.59375 | 3 | [] | no_license | lst =[['A','B'],'\n' , ['C' , 'D']]
print(str(lst)) | true |
b1be8efd5df8945dd1861156cafc124e80ad6151 | Python | Valijon21/python-lessons | /numlist.py | UTF-8 | 506 | 2.875 | 3 | [] | no_license | sonlar = [17,7,21,1993,-2,56.2,22.3,2]
print(sonlar)
qush = sonlar[0]+sonlar[2]
ayir = sonlar[1]-sonlar[7]
kupaytir = sonlar[3]*sonlar[4]
bul = sonlar[4]/sonlar[5]
ildiz = sonlar[1]**(1/2)
butun = sonlar[0]%sonlar[7]
qoldiq = sonlar[1]//sonlar[7]
kvadrat = sonlar[1]**2
print(f" yig'indi: {qush} \n ayirma: {ayir} \n kup... | true |
54481ddc69663a918e744c120511fede8ccd0a5c | Python | EverlastingBugstopper/tiny-projects | /calc3_scripts/vectors/inputmenu.py | UTF-8 | 992 | 3.484375 | 3 | [] | no_license | class Menu:
def __init__(self, title="Menu", options=["Option 1", "Option 2"]):
self.options = options
self.result = -1
self.title = title
def __str__(self):
result = ""
self.options.append(self.title)
maxLength = int(len(max(self.options, key=len)) + len(str(len(self.options))))
dashes = int((maxLength... | true |
9718b912d2d30c8e68dc4ec939a8003892b60cd3 | Python | Eric-Hsieh97/2019ChallengeEntries | /DoctorWho/sepsis_challenge_s6/src/mgp/mgp.py | UTF-8 | 8,646 | 2.78125 | 3 | [
"BSD-2-Clause"
] | permissive | '''
MGP Module (code for the most part copied from Futoma et al. 2017 ICML)
'''
import tensorflow as tf
import numpy as np
from .mgp_utils import OU_kernel,CG,Lanczos,block_CG,block_Lanczos
#------------------------------------------------
##### Convinience classes for managing parameters
class DecompositionMethod()... | true |
fcbdcab5f7d72840aca3b3c719a93f1edb6148e6 | Python | nanduzz/python_backup | /DBBackup.py | UTF-8 | 1,120 | 2.703125 | 3 | [] | no_license | import os
import subprocess
from subprocess import Popen, PIPE, STDOUT
class DBBackup(object):
def __init__(self, endereco, database, login, senha, porta=3306):
self.endereco = endereco
self.database = database
self.login = login
self.senha = senha
self.porta = porta
... | true |
8bc406061a502f2a0a22d65bf9425b70de4b3ef9 | Python | Haestad/datatek | /oving3/ciphers_test.py | UTF-8 | 2,039 | 2.609375 | 3 | [] | no_license | from multiplication import Multiplication
from affine import Affine
from oving3.cipher import Cipher
from rsa import RSA
from unbreakable import Unbreakable
from sender import Sender
from receiver import Receiver
from caesar import Caesar
if __name__ == '__main__':
c1 = Caesar()
c2 = Multiplication()
c3 = ... | true |
e759de37b517d32716894db3720ec78a58981aa5 | Python | samgmorrone/IsochroneGenerator | /Script.py | UTF-8 | 1,584 | 2.578125 | 3 | [] | no_license | import arcpy #Here is our Python ArcGIS package
from arcpy import env #Env class contains all geoprocessing environments
from arcpy.sa import * #Importing spatial analysis package
import sys #sys module (information ab constants, functions, + methods
import os #os module (functions for editing directories)
... | true |
74c583552970781c19d93d660ceeb2da79926fdf | Python | Tskatom/company_market | /code/util/extractDailyInteraction.py | UTF-8 | 4,595 | 2.59375 | 3 | [] | no_license | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
extract the interaction between users in the daily tweet network,
we extract following actions:
tweets sent
mentions
replies
retweents
for each day, we will output a file in which each line is for a user
"""
__author__ = "Wei Wang"
__email__ = "tskatom@vt.ed... | true |
8bec4ab7ed8a2ae6f6c482c537a74d4e624839ed | Python | Martin-Ruggeri-Bio/Desarrollo_Personal | /python/manejo_de_archivos/manejo_de archivos.py | UTF-8 | 143 | 2.609375 | 3 | [] | no_license | from io import open
archivo_texto = open("archivo.txt", "w")
frase = "es un estupendodo dia"
archivo_texto.write(frase)
archivo_texto.close()
| true |
4703fe716c0cabfd9e3d4d61dd882b725a4fb8a8 | Python | uniqueness001/Machine_learning | /YOLO/distance_to_camera.py | UTF-8 | 1,762 | 3.015625 | 3 | [] | no_license | # -*- coding:utf-8 -*-
import numpy as np
import cv2
def find_marker(image):
# 将图像转化为灰度值,并检测图像边缘
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
gray = cv2.GaussianBlur(gray, (5, 5), 0)
edged = cv2.Canny(gray, 35, 125)
(_,cnts,_) = cv2.findContours(edged.copy(), cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
... | true |
dd435e65dda81b58286cc8b26d456383aa2e474f | Python | jesugq/algorithms-v1 | /leetcode/970.py | UTF-8 | 2,121 | 3.484375 | 3 | [] | no_license | from typing import List
class Solution:
def powerfulIntegers(self, x: int, y: int, bound: int) -> List[int]:
max_base = max(x, y)
min_base = min(x, y)
sets = set()
if max_base != 1 and min_base != 1:
max_exponent = 0
max_operation = 1
while max_o... | true |
185e02eac55ec9bc20367e1b7e9a720497ae1605 | Python | AdamZhouSE/pythonHomework | /Code/CodeRecords/2567/60810/254734.py | UTF-8 | 501 | 3.21875 | 3 | [] | no_license | inp = input()
nums = inp[1:len(inp)-1].split(",")
lower = int(input())
upper = int(input())
sum = 0
add = []
result = 0
for i in range(0, len(nums)):
sum = sum + int(nums[i])
add.append(sum)
add = list(map(int, add))
for i in range(0, len(add)):
if add[i] >= lower:
if add[i] <= upper:
r... | true |
f98eff32046ed4e4f1cd938bad666202aa2bb9af | Python | MrScrith/kidsGames | /main.py | UTF-8 | 3,029 | 2.8125 | 3 | [
"MIT"
] | permissive | import pygame
import time
from utils import *
import colordraw
import gamemenu
import colorfill
pygame.init()
# Current list of games, more to be added later.
gameList = ["Draw Colors", "Color Fill"]
def Main():
js1 = None
js2 = None
jscount = 0
screen = pygame.display.set_mode((900, 500), pygame.D... | true |
ebf5f17fb3fe694d76da12121149623fe599ffe1 | Python | isym444/Competitive-Programming-Solved-Problems | /CP1/Codewars/Practice/USACO_Bronze/MilkFactoryFAILEDLOGIC.py | UTF-8 | 668 | 3.21875 | 3 | [] | no_license | import sys
sys.stdin = open("/Users/isym444/Desktop/PythonCP/CP1/Codewars/Practice/input.txt", "r")
sys.stdout = open("/Users/isym444/Desktop/PythonCP/CP1/Codewars/Practice/output.txt", "w")
""" sys.stdin = open("factory.in", "r")
sys.stdout = open("factory.out", "w") """
""" there must be a RH number that appears n... | true |
c69534b6c0b081baedf634e37f3db3adcd5f3b9c | Python | AdamZhouSE/pythonHomework | /Code/CodeRecords/2877/60678/260811.py | UTF-8 | 185 | 3.484375 | 3 | [] | no_license | num = int(input())
nums = input().split()
for i in range(0, num):
nums[i] = int(nums[i])
sum = 0
for i in nums:
if i < 0:
sum += -i
else:
sum += i
print(sum) | true |
126be290b656e2a2e504ee8303354a9f3b0d43a8 | Python | gameguyr/personal_repo | /kitty/GridLayout.py | UTF-8 | 433 | 3.09375 | 3 | [] | no_license | #! /usr/bin/python2.7
#####################
# PURPOSE: to learn how to write grids using 2 for loops
#
# DATE: 7/3/2013
#
# AUTHOR: Russell Lego
####################
import numpy as np
list = np.arange(0, 64)
count=0
while count < len(list):
count2=0
while count2 < 3:
print str(list[... | true |
aead45ea7d204e9335f7007b9c06939d5a41e871 | Python | lebuingockhang123/L-p-tr-nh-python | /LeBuiNgocKhang_53157_CH01/Exercise/page_05_exercise_04.py | UTF-8 | 513 | 2.890625 | 3 | [] | no_license | """
Author: Le Bui Ngoc Khang
Date: 12/07/1997
Problem: Describe an instruction that is not well defined and thus could not be included as a
step in an algorithm. Give an example of such an instruction.
Solution:
The process that cannot be carried out by any computing agent should not be included as a step in an al... | true |
48cf233e4d7858af799610dec3505a0e9b6f1e50 | Python | psgandalf/advent_of_code_2019 | /day1/day1_1.py | UTF-8 | 162 | 3.53125 | 4 | [] | no_license | file = open('input.txt')
rows = file.readlines()
sum = 0
for row in rows:
value = int(row.strip())
value = value // 3 - 2
sum += value
print(sum)
| true |
4bcef54ce3e713d23b4526f6c65b2bb4c16189aa | Python | demonlife/DataBaseLea | /codesegment/python_use_redis_oplua.py | UTF-8 | 467 | 2.59375 | 3 | [] | no_license | #encoding: utf8
import redis, time
r = redis.Redis('localhost', db=0)
script1 = '''
local i=0
local b=0
local res
local limit = tonumber(KEYS[1])
while (i <= limit) do
res = redis.call('set', i, b)
i = i + 1
b = b + 1
end
return KEYS[1]
'''
#r.eval(script1, 1, 200)
script2 = '''
local list = redis.call(... | true |
d8820dba8084d09f3f84e8bd7705f8a5fb6781e8 | Python | jesusveca/chordDiagram_boroCD | /preprocessNYBorough/preprocess.py | UTF-8 | 3,546 | 2.96875 | 3 | [] | no_license | import json
from pprint import pprint
import csv
import sys
def point_in_poly(x,y,poly):
n = len(poly)
inside = False
p1x,p1y = poly[0]
for i in range(n+1):
p2x,p2y = poly[i % n]
if y > min(p1y,p2y):
if y <= max(p1y,p2y):
if x <= max(p1x,p2x):
... | true |
a08a3637a3d5b0af1eab659d82b0cd8a58195782 | Python | Akus0ni/bug-free-fiesta | /exe5.py | UTF-8 | 598 | 3.21875 | 3 | [] | no_license | my_name = 'Aku Soni'
my_age = 24 # no lying
my_height = 74 # inches
my_weight = 75 #kg
my_eyes = 'Brown'
my_teeth = 'Yellowish White'
my_hair = 'Brown'
print "Lets talk about %s." %my_name
print "He's %d inches tall." %my_height
print "He's %d Kg heavy." %my_weight
print "Actually thats not too heavy."
print "He's got... | true |
dce7d3cd1b7c65e100447778bb14d44edcea591b | Python | Ehsan-Nirjhar/Person_Re-Identification_Project_Fall18 | /custom/testset.py | UTF-8 | 2,557 | 3.03125 | 3 | [] | no_license | #################################################################################
######################## CSCE 625 : AI PROJECT : TEAM 17 ########################
## Prepares the validation dataset givan in the class
## Copy the 'testSet' folder to the '/data' folder
## Must contain:
## /data/testSet/gallery/*.pn... | true |
e2ced1bebdc2ef22c917f58ffc1a1b4dfff0aca7 | Python | akoshdev/Weather | /ob_havo/templates/views.py | UTF-8 | 1,220 | 2.515625 | 3 | [] | no_license | from django.shortcuts import render
from django.http import HttpResponse
import requests
import json
# city = "London"
# country_code = "UK"
# location = city+','+country_code
# APIKEY = '53dc894d6fe5612c69a7eaf3b13d2059' #get an api key from openweathermap.org
# url = "http://api.openweathermap.org/data/2.5/find?q=%s... | true |
28426e4330e796e482e8405510f6e0ddfbe84b16 | Python | R0fM1a/python-related-file-Decoder | /pyscript_decode.py | UTF-8 | 3,852 | 2.578125 | 3 | [] | no_license | #!/usr/bin/env python
'''
this script can help you when analysing python related PE or pythonscript format file
created by rofmia
and other features such as deconfusion will be supported later
'''
import os, os.path
import pefile
import marshal
import zipfile
import StringIO
import argparse
from unc... | true |
78a64e7b447d0ae3e48bd8ee7aa027e019ac7073 | Python | gitter-lab/prmf | /script/prepare_nodelist.py | UTF-8 | 2,241 | 2.59375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import sys, argparse
import os, os.path
import networkx as nx
import prmf
from prmf import string_db as sdb
def main():
parser = argparse.ArgumentParser(description="""
Construct a nodelist containing all nodes from STRING and all nodes from all networks in <graphml-dir>.
""")
parser.add_argu... | true |