blob_id
large_string
language
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
aafc02e8524419241b46dfd9b3f2ccacd0104bf5
Python
matcom/simspider
/Redist/pyfuzzy/doc/plot/gnuplot/doc.py
UTF-8
14,031
2.765625
3
[]
no_license
# -*- coding: iso-8859-1 -*- # # Copyright (C) 2009 Rene Liebscher # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 3 of the License, or (at your option) any # later ver...
true
f2bdfc0c28f24d343005c2eeee77deddfc91538c
Python
MaksimShumko/scraper
/OtomotoScraper.py
UTF-8
1,356
2.78125
3
[]
no_license
import requests from bs4 import BeautifulSoup import locale import numpy as np locale.setlocale(locale.LC_NUMERIC,"pl") link = ("https://www.otomoto.pl/osobowe/bmw" "?search%5Bfilter_enum_damaged%5D=0&search%5Bfilter_enum_registered%5D=" "1&search%5Bfilter_enum_no_accident%5D=1&search%5Border%5D=filter_...
true
9ff4d66f722a253084d1af11e611cbac23f9fb9f
Python
Aasthaengg/IBMdataset
/Python_codes/p02646/s632645984.py
UTF-8
134
2.75
3
[]
no_license
a,v=map(int,input().split()) b,w=map(int,input().split()) t=int(input()) k=abs(b-a) s=w-v print("YES" if s<=0 and k+t*s<=0 else "NO")
true
74af42fca4b53c73eb3f3dbf30bccd90dbd95928
Python
fengmingshan/python
/业务感知_提取eob_bob(顺序版).py
UTF-8
1,852
2.640625
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Sat Mar 3 15:34:29 2018 @author: Administrator """ import os import json import base64 import gzip from urllib import parse from io import BytesIO file_path = r'D:\Packet'+'\\' out_path = r'D:\eob_bob'+'\\' file_name = '20180110-1.txt' file = file_path + file_name eob_file_o...
true
7b5c8ee694908e583f73925bdca0ff67566ae3c8
Python
garysb/skirmish
/server/lib/logger.py
UTF-8
7,199
2.8125
3
[]
no_license
#!/usr/bin/env python3 # vim: set ts=8 sw=8 sts=8 list nu: import threading import socket import time from queue import Queue from queue import Empty as QueueEmpty class Logger(threading.Thread): """ The Logger class/thread creates a socket server to handle our connections from a client system. The sockets interact...
true
00126b97fadb7ff67275c280b2ed75ed5c407e25
Python
elomedah/iris-2020
/MapReduce-Python-master/Exemlpe 6/mapper.py
UTF-8
606
3.53125
4
[ "MIT" ]
permissive
#!/usr/bin/env python import sys wordList = dict() # input comes from STDIN (standard input) for line in sys.stdin: # remove leading and trailing whitespace line = line.strip() # split the line into words words = line.split() # increase counters for word in words: charList = list() ...
true
e91118db94961dbff8c691d2557eb4423f1ef43f
Python
guilhom34/images_recognition
/training_files.py
UTF-8
9,097
2.609375
3
[]
no_license
import collections import io import math import os import pathlib import random from six.moves import urllib from IPython.display import clear_output, Image, display, HTML import tensorflow as tf import tensorflow_hub as hub import numpy as np import matplotlib.pyplot as plt import seaborn as sns import sklearn.metr...
true
47815afd7e8f7eac99bc33e5f6efb437b437ec50
Python
ryubro/Hullpy
/hull.py
UTF-8
4,110
2.625
3
[]
no_license
import requests class Hull: def __init__(self, platform_id, org_url, platform_secret=None, sentry=None): self.baseurl = "%s/api/v1" % (org_url,) self.platform_id = platform_id self.platform_secret = platform_secret ...
true
e6695b93aa9e72e9534c7a66d0d6f6aa1f6bf888
Python
arthur-bryan/shopping-cart
/install.py
UTF-8
1,604
2.703125
3
[]
no_license
# -*- coding: utf-8 -*- import os import sys from time import sleep import platform APP_PATH = os.path.join(os.getcwd(), 'app.py') # ICON_FILE = os.path.join(os.getcwd(), 'imagens/carrinho.png') # EXECUTABLE_FILE = os.path.join(os.getcwd(), 'compras.sh') PYTHON_VERSION = float(platform.python_version()[:3]) if PYTH...
true
7eee2c6939708779f090c91659389b6adb83823b
Python
scipyargentina/sliceplots
/sliceplots/_util.py
UTF-8
435
3.5
4
[ "BSD-3-Clause" ]
permissive
# -*- coding: utf-8 -*- """Utility functions module.""" import numpy as np def idx_from_val(arr1d, val): """Given a 1D array, find index of closest element to given value. :param arr1d: 1D array of values :type arr1d: :py:class:`numpy.ndarray` :param val: element value :type val: float :ret...
true
1c2f27907db7626d48bb596dc79051eb2658fd9b
Python
kaustubhagarwal/Basic-Codes
/Upper and Lower Case.py
UTF-8
109
4.15625
4
[]
no_license
#To Print strings in upper and lower case l=input("Enter the string ") print(l.lower()) print(l.upper())
true
fbfc467b05978a9bf2f20c8a9a80bd20982327d3
Python
chaomenghsuan/leetcode
/1856_MaximumSubarrayMin-Product.py
UTF-8
814
2.609375
3
[]
no_license
from numpy import cumsum class Solution: def maxSumMinProduct(self, nums: List[int]) -> int: cumm = [0] + list(cumsum(nums)) n = len(nums) res = 0 l, st = [0], [[nums[0], 0]] for i in range(1, n): cur = 0 while st and nums[i] <= st[-1][0]: ...
true
62995fb78c790c7ff642c758093587d0c23a9816
Python
ganlanshu/leetcode
/subtree-of-another-tree.py
UTF-8
1,813
3.71875
4
[]
no_license
#coding=utf-8 # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def isSubtree(self, s, t): """ 判断t是否是s的子树 :type s: TreeNode :type t: TreeN...
true
7bc6a1aa6ba183f344fb3eac517c260e8d399f2e
Python
Ravi-Nikam/Machine_learning_programs-or-Algorithems
/Logistic_regression.py
UTF-8
3,428
3.453125
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Wed Jun 17 17:51:43 2020 @author: Ravi Nikam """ # Logistic Regression # Suv is purchsed or not 0 means not 1 means yes import pandas as pd import numpy as np import matplotlib.pyplot as plt data = pd.read_csv('Social_Network_Ads.csv') data.head() x=data.iloc[:,[...
true
b46733b26fe041b6d92d9bc1c43615f05cc861a3
Python
themagicbean/Machine-Learning-Course-1
/7 Natural Language Processing/my_natural_language_processing.py
UTF-8
2,912
3.421875
3
[]
no_license
# Natural Language Processing # L191 #making model to predict if review positive or negative # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('Restaurant_Reviews.tsv', delimiter = '\t', quoting = 3) # read csv can also read ...
true
65272fbf46c67f66a469a8ae8c6502737b6fc91a
Python
19133/rps
/main.py
UTF-8
1,913
3.609375
4
[]
no_license
import random # functions go here def check_rounds(): while True: response = input ("how many rounds: ") round_error = "Please type either <enter>" "or an interger that is more than 0\n" # If infinite mode is not chosen, check response # is an integer that is more than 0 if response != "": ...
true
6ada0c03b9697b0e63d6f32c26e235ce9d1991fe
Python
alatiera/Ellinofreneia-crawler
/src/launcher.py
UTF-8
1,817
2.734375
3
[ "MIT" ]
permissive
#!/usr/bin/env python3 import crawler import renamer import file_organizer import argparse def opts(): parser = argparse.ArgumentParser() subparsers = parser.add_subparsers() download = subparsers.add_parser('download', help='Downloads the shows', aliases=['dl', 'cra...
true
9ce70feae1eec76ec91cb37957e05f4201684e86
Python
Aasthaengg/IBMdataset
/Python_codes/p03029/s122921010.py
UTF-8
55
2.9375
3
[]
no_license
a,b= map(int, raw_input().split(' ')) print (3*a + b)/2
true
365740495d71b63d5522f0f7895ff981931d6a1e
Python
phodiep/BiomarkerLab_QuantileStatistics
/QuantileApp(v1.4).py
UTF-8
14,446
2.578125
3
[]
no_license
import time import pandas as pd import matplotlib.pyplot as plt import numpy as np from scipy.stats.stats import pearsonr, spearmanr, gmean, ttest_1samp def clear_terminal(): import os os.system('cls' if os.name=='nt' else 'clear') def start_screen(): print ''' =========================================== We...
true
d867b792d25d99a36150fe48791cc9ebb69d2d4b
Python
Aasthaengg/IBMdataset
/Python_codes/p02852/s908177307.py
UTF-8
615
2.640625
3
[]
no_license
N,M = map(int,input().split()) S = input()[::-1] if M >= N: print(N) exit() p = -1 for i in reversed(range(1,M+1)): if S[i] == "0": p = i break if p == -1: print(-1) exit() ps = [p] while 1: tmp = -1 for i in reversed(range(ps[-1]+1,ps[-1]+M+1)): try: ...
true
84469a9d92d1baea91affe1249b7fe035daecc3e
Python
metalnick/emu-container-desktop
/emu_container_desktop/emu_container.py
UTF-8
4,483
2.515625
3
[]
no_license
import configparser as cp import os import signal from socketserver import BaseRequestHandler, TCPServer, ThreadingMixIn from threading import Thread import json import subprocess import sys import glob # TODO: Server should handle requests to start, stop, etc. No need for a "local client". GUI/cmd line will make use ...
true
d4d81448549f77e337ad3313dbc10078a3cb37c8
Python
Deeksha-K/dm-assignments
/Assignment 1/DM_ASSN1_20160114_20160809_20160236/apriori.py
UTF-8
7,376
3.046875
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Sun Feb 10 22:58:59 2019 @author: Skanda """ import csv import copy import itertools def get_unique_items(data): """ This function reads the database and returns the list of unique items """ items = {} for transaction in data: for item i...
true
dd04647e1702687da86ba7e0e3c23d80983492a0
Python
nbiadrytski-zz/python-training
/p_advanced_boiko/oop_demos/decorators/property_via_decorator.py
UTF-8
630
3.84375
4
[]
no_license
class PropertyViaDecorator: def __init__(self): self._x = None @property def x(self): """I'm the 'x' property""" print('...getter called...') return self._x @x.setter def x(self, value): print('...setter called...') self._x = value @x.deleter ...
true
eeb166538e9100fc1bc849334737991f770854a3
Python
vbaryshev4/faster_python
/homework/2/merger.py
UTF-8
652
2.671875
3
[]
no_license
from os import listdir import heapq from datetime import * def get_datetime_object(string): return datetime.strptime(string, '%Y-%m-%d %H:%M') def key_func(i): date_time = i.split('\t')[2][:-1] return get_datetime_object(date_time) def join_results(lst): with open('chunks/sort_results.txt', 'a') as f...
true
1cbc3e635b23c7e1e01ce5d57f85d45437ba5af7
Python
kmorris0123/reverse_word_order
/reverse_word_order.py
UTF-8
569
4
4
[]
no_license
import os def usr_str(): print("Input a string that has multiple words.") print("Example: My name is Kyle") return input("--> ") def reverse_order(usr_str): usr_str = usr_str.split(" ") rev = usr_str[::-1] joined = " ".join(rev) return joined def main(): play = True while play == True: usr_str_s =...
true
a8d828d447ad8b929d17b3542f2f59eae783f71f
Python
SakibNoman/Python-Numerical-Analysis
/string.py
UTF-8
976
4.3125
4
[]
no_license
multilineString = '''Hello, This is Noman Sakib trying to ''' print(multilineString) print(multilineString[7]) for x in multilineString: print(x) #length of a string print(len(multilineString)) #Checking a specific word if exist in a string #in print("Sakib" in multilineString) myWord = "Sakib" if myWord in mu...
true
1b73fdacfc57a7bc7f2ce0ae4fc602c713d23a27
Python
1615961606/-test
/备份/1804爬虫/第二周/第八天/迭代器.py
UTF-8
587
3.953125
4
[]
no_license
from collections import Iterable class Booklist(object): def __init__(self): self.data = [] self.current = 0 def add_books(self,item): self.data.append(item) def __iter__(self): return self def __next__(self): if len(self.data) > self.current: result ...
true
616f002eab852e7104cc19e0fc427e2f6bdb4ca3
Python
bballjo/pythonfun
/commandGenerator.py
UTF-8
632
3.4375
3
[]
no_license
import commands import random import string def generateCommand(): return random.choice(test.wordsWithSemicolons) def WriteFile(name): file = open(name,'w') file.write(commands.Line('x = ' + str(random.choice([1,2,3,4,5,6,7,8,9])))) file.write(commands.If('x == ' + str(random.choice([1,2,3,4,5,6,7...
true
8a44b86aa4a3c767b221054a839fe32b59a222ee
Python
yucheno8/news_python
/LiaoSirWeb/recursive_factorial.py
UTF-8
216
3.890625
4
[]
no_license
# 利用递归函数计算阶乘 # N! = 1 * 2 * 3 * ... * N def fact(n): if n == 1: return 1 return n * fact(n-1) print('fact(1) =', fact(1)) print('fact(5) =', fact(5)) print('fact(10) =', fact(10))
true
5df4e0217c9cdaf4be35e35dd8c44ec92c1b3bd7
Python
ashishjsharda/numpyexamples
/argsort.py
UTF-8
64
2.703125
3
[]
no_license
import numpy as np a=np.array([5,2,8]) a=np.argsort(a) print(a)
true
66f6869f549434af31b50bcd46096e71338990e7
Python
JoelBondurant/RandomCodeSamples
/python/bytetool.py
UTF-8
1,257
3.359375
3
[ "Apache-2.0" ]
permissive
""" Module for byte operations. """ import hashlib import datetime def sizeof_fmt(num, dec = 3, kibibyte = False): """Byte size formatting utility function.""" prefixes = None factor = None if kibibyte: factor = 1024.0 prefix = ['bytes','KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB'] else: factor = 1000.0 ...
true
7017f224e020ac035dfaaa3d8dab635daacf6124
Python
Bavithakv/PythonLab
/CO1/replaced.py
UTF-8
142
3.15625
3
[]
no_license
a=input("enter a string") b=a[0] s=a[1:len(a)] for i in range(len(s)): if s[i]==a[0]: b=b+"$" else: b=b+s[i] print(b)
true
d4b6270429b462f79e25fe0260a0f4711573e5be
Python
HBinhCT/Q-project
/hackerearth/Algorithms/Decode/test.py
UTF-8
542
2.59375
3
[ "MIT" ]
permissive
import io import unittest from contextlib import redirect_stdout from unittest.mock import patch class TestQ(unittest.TestCase): @patch('builtins.input', side_effect=[ '2', 'wrien', 'reen', ]) def test_case_0(self, input_mock=None): text_trap = io.StringIO() with re...
true
fb3c0d8b4296404bba40639192711a50ccee3287
Python
StephanHeijl/SMH500
/compare_contribution_lists.py
UTF-8
1,099
2.546875
3
[]
no_license
import json import pprint import pandas import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt with open("volume_contribution.json") as f: volume_correspondence = json.load(f) with open("relative_market_caps.json") as f: relative_market_caps = sorted(json.load(f)) overview = {} for i, (coin,...
true
61ae6dbc6166d8fbfcdf146920018e2bb47cc44b
Python
standrewscollege2018/2020-year-11-classwork-EthanAllison
/Movie ticket.py
UTF-8
343
3.671875
4
[]
no_license
age = int(input("How old are you?\n")) if age > 13: student = input("Are you a student? (y/n)\n") if student == "y": print("It costs $8") elif age >= 18: print("It will cost $12") else: print("It will cost $9") elif age >=5: print("It will cost $7") else: print("It will b...
true
4d888fb082039bf3648970525e7dc3c592000e8c
Python
lukereding/nsf_awards_analysis
/parse_xml.py
UTF-8
2,483
2.8125
3
[]
no_license
import os import bs4 import csv def e_8(s): return s.encode('utf-8') os.chdir('./data') all_files = [file for file in os.listdir('.') if file.endswith(".xml")] print("total number of files: {}".format(len(all_files))) with open('../out.csv', 'w') as csvfile: writer = csv.writer(csvfile) writer.writerow...
true
1f8df0cc10d25c2f27a49385802265d1029d7c8d
Python
Nelson-Gon/urlfix
/urlfix/urlfix.py
UTF-8
7,334
2.75
3
[ "MIT" ]
permissive
from collections.abc import Sequence import os import re import urllib.request from urllib.request import Request import tempfile from urllib.error import URLError, HTTPError import logging log_format = "%(asctime)s %(levelname)s %(message)s" log_filename = "urlfix_log.log" log_level = logging.WARNING logging.basic...
true
e654d5dc25201845013c994ea9fdda9b650587d9
Python
sunarditay/tue_robocup
/challenge_eegpsr/test/navigate_in_front_of.py
UTF-8
1,922
2.609375
3
[]
no_license
#!/usr/bin/env python import rospy, sys, robot_smach_states, random if __name__ == "__main__": rospy.init_node('navigate_in_front_of') # Create Robot object based on argv[1] if len(sys.argv) < 2: print "Usage: ./navigate_in_front_of.py [amigo/sergio] [entityIds]..." sys.exit() robot_...
true
eefc3904060a6ed5358ec5399ee7e8572a8b512e
Python
OtchereDev/yt_omdb_api
/api/models.py
UTF-8
945
2.625
3
[ "MIT" ]
permissive
from django.db import models RATINGS=( ('5','5 Star'), ('4', '4 Star'), ('3', '3 Star'), ('2', '2 Star'), ('1', '1 Star'), ) TYPE=( ('movie','movie'), ('series','series'), ('episode','episode'), ) class Genre(models.Model): name=models.CharField(max_length=255) def __str__(se...
true
c1f40c62047e0185ecd73181b1aa793983887329
Python
mikss/pr3
/test/test_linear.py
UTF-8
2,226
2.515625
3
[ "MIT" ]
permissive
import numpy as np import pytest from sklearn.metrics import r2_score from pr3.linear import ( LeastAngleRegressionProjection, LowerUpperRegressionProjection, ProjectionOptimizerRegistry, ProjectionSampler, ProjectionVector, ) def test_normalize(random_seed, p_dim, q_dim): np.random.seed(rand...
true
9677b542de10580a2986dda6ecb588709b030430
Python
liyi0206/leetcode-python
/87 scramble string.py
UTF-8
665
3.453125
3
[]
no_license
class Solution(object): def isScramble(self, s1, s2): """ :type s1: str :type s2: str :rtype: bool """ if s1==s2: return True if len(s1)!=len(s2) or sorted(s1)!=sorted(s2): return False if len(s1)==1: return s1==s2 for i in range(1,len(s1)): ...
true
8b25701a3a88e458c8a9e9f38191f10663b306ab
Python
zhaoqun05/Coding-Interviews
/Python/数组中出现次数超过一半的数字.py
UTF-8
789
3.546875
4
[]
no_license
''' 数组中有一个数字出现的次数超过数组长度的一半,请找出这个数字。例如输入一个长度为9的数组{1,2,3,2,2,2,5,4,2}。由于数字2在数组中出现了5次,超过数组长度的一半,因此输出2。如果不存在则输出0。 ''' # -*- coding:utf-8 -*- class Solution: def MoreThanHalfNum_Solution(self, numbers): if not numbers: return None key, num = numbers[0], 1 for i in numbers[1:]: if ...
true
e8dbd5ddf8bf4dbbb893e1eb2875efee3c7295ff
Python
qlimaxx/projects-management-api
/manage.py
UTF-8
957
2.75
3
[]
no_license
import click from werkzeug.security import generate_password_hash from app import create_app from app.enums import Role from app.models import User, db app = create_app() @app.cli.command('create-db') def create_db(): db.drop_all() db.create_all() print('Database is created.') @app.cli.command('creat...
true
932af16a0d8c38f4375f5c4b699df1948d8faf1a
Python
Anirban2404/LeetCodePractice
/1135_minimumCost.py
UTF-8
1,930
3.703125
4
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Aug 15 10:40:04 2019 @author: anirban-mac """ """ 1135. Connecting Cities With Minimum Cost There are N cities numbered from 1 to N. You are given connections, where each connections[i] = [city1, city2, cost] represents the cost to connect city1 and c...
true
3de35b9bff11dee3b91dbb36f0672279a7444ade
Python
Jannatul-Ferdousi/PractisePython
/ND2.py
UTF-8
563
3.203125
3
[]
no_license
# Compute mean and standard deviation: mu, sigma mu = np.mean(belmont_no_outliers) sigma = np.std(belmont_no_outliers) # Sample out of a normal distribution with this mu and sigma: samples samples = np.random.normal(mu, sigma, size=10000) # Get the CDF of the samples and of the data x_theor, y_theor = ecdf(sa...
true
d15ca6a56956293e69dbfbcb45e69f252163defb
Python
fadeopolis/scripts
/bin/kathex
UTF-8
4,332
2.578125
3
[]
no_license
#!/usr/bin/python3 ##### PARSE OPTIONS ############################################################ import argparse import glob import os import subprocess DEFAULT_BUILD_COMMAND = 'pdflatex' RUBBER_COMMAND = 'rubber -q -s --pdf' PDFLATEX_COMMAND = 'pdflatex' DEFAULT_PDF_VIEWER = 'evin...
true
e90969b7f7d9e4198418ffbcc0664074655a16f4
Python
akdasa/gem
/gem/web/blueprints/session/connections.py
UTF-8
3,554
2.84375
3
[]
no_license
from collections import namedtuple from flask_socketio import join_room from gem.db import users from gem.event import Event SessionConnection = namedtuple("SessionConnection", ["user_id", "socket_id", "session_id", "session", "user"]) class Connections: """ Handles all the connections to the sessions. ...
true
91573de6ac79cac1668cf23ae0e01743f2552d9d
Python
LucasGiori/DowloadPdfAutomaticoSpringLink
/scraping_spring_link.py
UTF-8
1,799
3.3125
3
[]
no_license
import requests,sys,os from bs4 import BeautifulSoup from urls import getUrl #Pasta onde irá salvar o arquivo, pega a pasta raiz do Script Python,em seguida defino em qual pasta será downloadPath = str(sys.path[0])+'/arquivos/' urls=getUrl() #Função que faz as leituras dos link no arquivo de texto e retorna uma list...
true
a744960cfa0166bf507a81dd90a70700e7f22e45
Python
furas/python-examples
/tkinter/validate/main.py
UTF-8
1,145
3.109375
3
[ "MIT" ]
permissive
# # https://stackoverflow.com/a/47990190/1832058 # import tkinter as tk ''' It lets you input only numbers 8.2 digits. ''' def check(d, i, P, s, S, v, V, W): print("d='%s'" % d) print("i='%s'" % i) print("P='%s'" % P) print("s='%s'" % s) print("S='%s'" % S) print("v='%s'" % v) print("V='...
true
bb4b34ef70039150e6ed96a11994a4fe51a8c268
Python
magisterka-ppp/ppp2d
/player.py
UTF-8
3,653
2.859375
3
[]
no_license
import pygame from pygame.math import Vector2 from pygame.rect import Rect class Player(object): def __init__(self): self.grounded = False self.max_y_vel = 20 self.drag = 0.8 self.gravity = 6 self.bounds = Rect(20, 0, 80, 120) self.color = (155, 155, 0) self...
true
74c18fd7c38197a05c598231d1abe1494745ef7e
Python
google/gfw-deployments
/apps/python/groups/find_groups_where_user_is_owner.py
UTF-8
4,482
2.78125
3
[]
no_license
#!/usr/bin/python # # Copyright 2011 Google Inc. All Rights Reserved. """For a specific user, prints groups for which they are owner. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apa...
true
fa34c7188c7008af305831dbda443a4f41a38dc3
Python
brucesw/skills_progressions
/skills_progression.py
UTF-8
1,380
2.875
3
[]
no_license
from dictionaries import * from helpers import * # this does main portion of the work # just a modified search algorithm def expand_prerequisites(skill, prereq_list, depth, ret, abbreviations): if skill not in prereq_list: return for s in prereq_list[skill]: #print s, depth if depth not in ret: ret[depth] =...
true
949f10a2e6dfff24b211e2252d3369ae07438d42
Python
salkhan23/contour_integration
/learned_lateral_weights.py
UTF-8
7,801
2.6875
3
[]
no_license
# ------------------------------------------------------------------------------------------------ # Contour integration layer in an MNIST classifier # # In this version of contour integration, a learnable weight matrix is cast on top each pixel in # the input volume. The weight matrix is shared across a feature map bu...
true
550efc320225967509e49b681ab9b511ba1314bf
Python
frankieeder/fantasy_movie_league
/week_2018__12_14__12_16.py
UTF-8
2,250
2.640625
3
[]
no_license
import fml # 12/14/2018 - 12/16/2018 # PRICES_RAW = """SPIDER-MAN: INTO THE SPIDER-VERSE +$571 UNAVAILABLE SCREENS LOCKED THE MULE +$235 UNAVAILABLE SCREENS LOCKED MORTAL ENGINES +$171 UNAVAILABLE SCREENS LOCKED THE GRINCH +$155 UNAVAILABLE SCREENS LOCKED RALPH BREAKS THE INTERNET +$127 UNAVAILABLE SCREENS L...
true
79d6bb919f4b2f8b691e7d575309eca55a1a50ad
Python
infinitEnigma/github-upload
/PyTorch/torch_nn/torch_nn-walkthrough.py
UTF-8
14,990
3.078125
3
[]
no_license
from pathlib import Path import requests DATA_PATH = Path("data") PATH = DATA_PATH / "mnist" PATH.mkdir(parents=True, exist_ok=True) URL = "http://deeplearning.net/data/mnist/" FILENAME = "mnist.pkl.gz" if not (PATH / FILENAME).exists(): content = requests.get(URL + FILENAME).content (PATH / FILENAM...
true
38247e491e5d958d0cc0fd894b6de7af5619770f
Python
Kieran-Williams/Password_manager
/env/Database/create_db.py
UTF-8
579
2.53125
3
[ "MIT" ]
permissive
import sqlite3 from sqlite3 import Error from pathlib import Path from Database import create_tables def create_connection(db_file): conn = None try: conn = sqlite3.connect(db_file) print(sqlite3.version) except Error as e: print('DB Version' + e) finally: if conn: ...
true
ef3dd7b85fc326223f4c3cb2ade8c980f3048d40
Python
apalpant/ProjetFilRouge
/python/shared/admin/services/gitService copy.py
UTF-8
334
2.53125
3
[]
no_license
import subprocess # The service for git operations class GitService(): # Constructor def __init__(self): print('init GitService') # Clone repository from a given adress def clone(self, adresse): subprocess.Popen(['git', 'clone', str(adresse), '/home/vagrant/tmp/clone']) return...
true
bf8835766ab20429d4b4bfa1da420c157a95010a
Python
gluemoment/Exercises
/basic_projects/ZodiacSignApp/zodiacApp.py
UTF-8
1,777
3.609375
4
[]
no_license
zodiac_signs_assignment = { 0:'Monkey', 1:'Rooster', 2:'Dog', 3:'Pig', 4:'Rat', 5:'Ox', 6:'Tiger', 7:'Rabbit', 8:...
true
9763ba173e546b3e6905e88558056b87c0fe220a
Python
dbms-class/csc-2020-control-3.1
/model.py
UTF-8
1,956
2.578125
3
[]
no_license
# encoding: UTF-8 # В этом файле реализованы Data Access Objects в виде классов Peewee ORM from peewee import * from connect import getconn from connect import LoggingDatabase from args import * db = PostgresqlDatabase(args().pg_database, user=args().pg_user, host=args().pg_host, password=args().pg_password) #db = Lo...
true
c8a71707d4e9b6792c55f5dfa3a8cdcdefc1cbb4
Python
afunsten/oil
/opy/_regtest/src/osh/arith_parse.py
UTF-8
5,476
3.078125
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/env python """ arith_parse.py - Parse shell arithmetic, which is based on C. """ from core import tdop from core import util from osh.meta import Id from core import word from osh.meta import ast p_die = util.p_die def NullIncDec(p, w, bp): """ ++x or ++x[1] """ right = p.ParseUntil(bp) child = tdo...
true
626f6cabfe3c5a095d91f7be4425c0ec910115f7
Python
kou1127h/atcoder
/ABC/ver3/188/B.py
UTF-8
179
3.078125
3
[]
no_license
N = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) ans = 0 for i in range(N): ans += (a[i] * b[i]) print("Yes" if ans == 0 else "No")
true
7d211b2fffb7a2ed5a76ed4d197a6c6732ff3c59
Python
zannn3/LeetCode-Solutions-Python
/0306. Additive Number.py
UTF-8
882
3.375
3
[]
no_license
class Solution(object): def isAdditiveNumber(self, num): """ :type num: str :rtype: bool """ n = len(num) if n < 3: return False for i in range(n-2): for j in range(i+1, n-1): if self.checkNum(num, i, j): ...
true
12a88e232676dcc6650d8e8ef0e41461b7b23b6d
Python
alex35469/Flow-Scheduling-for-video-Streaming
/simulator/utils.py
UTF-8
989
2.8125
3
[]
no_license
import io import sys import os from time import time PATH = os.path.dirname(os.path.abspath(__file__)) def get_scaled_time(scale): "Get a scalable time" def get_time(): return scale * time() return get_time def read_network_trace(path): "Return a generator that outputs the trace" full_p...
true
177687297f8e4199eca539d03409ea93b2940d33
Python
Neniao/fmt-back
/hubspotconnect.py
UTF-8
1,045
2.75
3
[]
no_license
import requests import json import urllib max_results = 500 hapikey = "2b0cbf32-bc72-40b6-8953-c40aeebeec07" count = 20 contact_list = [] property_list = [] get_all_contacts_url = "https://api.hubapi.com/contacts/v1/lists/all/contacts/all?" parameter_dict = {'hapikey': hapikey, 'count': count} headers = ...
true
e94fbca7230071051fd52095af6c5cd6233e505b
Python
helios2k6/python3_interview_questions
/stronglyConnectedComponents.py
UTF-8
1,857
3.625
4
[]
no_license
def visit(adjList, visitedNodes, l, node): if node in visitedNodes: return visitedNodes[node] = True for neighbor in adjList[node]: visit(adjList, visitedNodes, l, neighbor) l.append(node) def transposeAdjList(adjList): transposedAdjList = {} for node, neighbors in adjList.items...
true
73cbeb02678baf50a5b13b5a10091f289bd70798
Python
dr-dos-ok/Code_Jam_Webscraper
/solutions_python/Problem_75/51.py
UTF-8
1,481
2.828125
3
[]
no_license
import sys outf = [] def pout(text): outf.append("Case #" + str(pout.case) + ": " + text + "\n") pout.case += 1 pout.case = 1 def get_input(infname): with open(infname, "r") as f: return map(lambda a: a.strip(), f.readlines()) def write_output(outfname): with open(outfname, "w") ...
true
5c283929af4c908985960fe46c3faf94a7589699
Python
Abe27342/project-euler
/src/104.py
UTF-8
1,144
3.515625
4
[]
no_license
from decimal import Decimal import math phi = (Decimal(5).sqrt() + Decimal(1))/Decimal(2) def frac(x): return(x-math.floor(x)) def is_pandigital(x): return({i for i in str(x)} == {'1','2','3','4','5','6','7','8','9'} and len(str(x)) == 9) fl = [0,1,1,2,3,5] def fibs(n): while n > len(fl): fl.app...
true
f23ceea33b3b36f3b784cf1a5fd4ca84658d2b1d
Python
jamtot/PyProjectEuler
/45 - Triangular, pentagonal, and hexagonal/tph.py
UTF-8
1,482
4.1875
4
[ "MIT" ]
permissive
# -*- coding: utf8 -*- #Triangle Tn=n(n+1)/2 1, 3, 6, 10, 15, ... #Pentagonal Pn=n(3n−1)/2 1, 5, 12, 22, 35, ... #Hexagonal Hn=n(2n−1) 1, 6, 15, 28, 45, ... def triangulate(n): return (n*(n+1))/2 def pentagulate(n): return (n*((3*n)-1))/2 def hexagulate(n): return n*((2*n)-1) def trigen(n=1)...
true
d53f1d9ed62cc5455aa7e2cb7a24894f591ffa83
Python
daniel-reich/ubiquitous-fiesta
/kKFuf9hfo2qnu7pBe_22.py
UTF-8
355
2.515625
3
[]
no_license
def is_prime(primes, num, left=0, right=None): mid = primes[int(len(primes)/2)] ​ if mid == num: return "yes" if (len(primes) == 1): return "no" if mid < num: return is_prime(primes[int(len(primes)/2): len(primes)], num, 0, None ) if mid > num: return is_prime(primes[0:int(...
true
9003070a9074c8327a860e21d266eee3894d698b
Python
lihao6666/graduation
/parser/爬虫/parse/build/lib/parse/spiders/hot.py
UTF-8
2,586
2.578125
3
[]
no_license
import scrapy from parse.items import WeiboTopItem,ZhiHuTopItem,WeiboHots,ZhihuHots class HotSpider(scrapy.Spider): name = 'hot' # allowed_domains = ['https://s.weibo.com/top/summary/'] start_url = 'https://s.weibo.com/top/summary/' next_url = 'https://www.zhihu.com/hot' def cookies_dict(self,coo...
true
b84a916974907120b37b03d4424a94d12ad5a08e
Python
novayo/LeetCode
/For Irene/BFS/0733_Flood_Fill.py
UTF-8
926
3.1875
3
[]
no_license
class Solution: def floodFill(self, image: List[List[int]], sr: int, sc: int, newColor: int) -> List[List[int]]: old_color = image[sr][sc] if old_color == newColor: return image width = len(image[0]) height = len(image) ...
true
fe719dad32d27bb81dc66228d711c463b0770d52
Python
Tusharshah2006/feature_selection_project
/q05_forward_selected/build.py
UTF-8
1,315
2.921875
3
[]
no_license
# %load q05_forward_selected/build.py # Default imports import pandas as pd import numpy as np from sklearn.linear_model import LinearRegression from sklearn.model_selection import train_test_split as tts from sklearn.metrics import mean_squared_error, r2_score data = pd.read_csv('data/house_prices_multivariate.csv') ...
true
70b6529c1901fbddf62d11a618d412422f4a9041
Python
cwlseu/Algorithm
/cpp/jianzhioffer/power.py
UTF-8
505
3.875
4
[]
no_license
# -*- coding:utf-8 -*- class Solution: def Power(self, base, exponent): # write code here if exponent < 0: return 1.0/(float)(self.Power(base, -exponent)) elif exponent == 0: return 1 elif exponent % 2 == 0: return self.Power(base, exponent/2)**2 el...
true
d1da752545cdc0f2a96af048ee835c000eddcaf2
Python
stacykutyepov/python-cp-cheatsheet
/leet/strings/wordBreak.py
UTF-8
1,004
3.46875
3
[ "Apache-2.0" ]
permissive
""" time: n^2 space: n """ class Solution: # go through word and check if slice matches subword, go until the end def wordBreak(self, s: str, wordDict: List[str]) -> bool: stk = [0] visited = set() while stk: i = stk.pop() visited.add(i) # che...
true
4a15f3f6d05637fab3b291bbca83696d19d9e102
Python
Shumpei-Kikuta/ants_book
/python/beginner/src/meiro.py
UTF-8
1,215
2.78125
3
[]
no_license
import sys sys.setrecursionlimit(10000000) from collections import deque import numpy as np INF = 10 ** 10 def main(): N, M = map(int, input().split()) meiros = np.ones((N + 2, M + 2)) * (-1) d = np.ones((N + 2, M + 2)) * INF for i in range(N): input_ = input() for j, v in enumerate(...
true
a35d1af9de65789a06984d400e1b0bac3200eb00
Python
Hashfyre/7dom
/prototypes/entity/alt_main.py
UTF-8
4,207
3.140625
3
[]
no_license
from pandac.PandaModules import * import direct.directbase.DirectStart from direct.showbase.DirectObject import DirectObject from panda3d.bullet import * class Entity(DirectObject): def __init__(self, world, parent, taskMgr=None, shape=BulletCapsuleShape(0.5, 1), pos=(0, 0, 2)): """Creates a generic Entit...
true
0a0a4d1940bde46b24604fef43d53d9c140a86a7
Python
RubenBasentsyan/DataScrapingAUA
/Homework 2/MovieScraping.py
UTF-8
2,040
3.703125
4
[]
no_license
import requests; import pandas as pd import time; from scrapy.http import TextResponse; URL = "https://www.imdb.com/chart/moviemeter/" base_url = "https://www.imdb.com" #td.titleColumn a - Movie titles #.secondaryInfo:nth-child(2) - Movie Year #.velocity - Rank -> doesn't return proper rankings therefore I will use a...
true
ddaee3330d16afc99d1b2cf00c652728d313661d
Python
IanRivas/python-ejercicios
/tp5-Excepciones/7.py
UTF-8
1,103
4.65625
5
[]
no_license
''' 7. Escribir un programa que juegue con el usuario a adivinar un número. El programa debe generar un número al azar entre 1 y 500 y el usuario debe adivinarlo. Para eso, cada vez que se introduce un valor se muestra un mensaje indicando si el nú-mero que tiene que adivinar es mayor o menor que el ingresado. Cuando c...
true
4e806189c021916e64a4ae331d80369db0dccd11
Python
mourkeita/scripts
/urllib_to_server.py
UTF-8
197
2.515625
3
[ "MIT" ]
permissive
#! /usr/bin/python # coding: utf8 import httplib2 import urllib print "Try to connect to site ..." h = httplib2.Http() headers, content = h.request("https://www.google.fr", "GET") print content
true
a76bc3c3632e0d2c06ec107e325e21fd3029300e
Python
borislavstoychev/Soft_Uni
/soft_uni_fundamentals/Basic Syntax, Conditional Statements and Loops/More Exercises/04_Sum_Of_A_Beach.py
UTF-8
192
3.34375
3
[]
no_license
word_snake = input() word_matches = ["water", "sand", "sun", "fish"] match = 0 for i in range(len(word_matches)): match += word_snake.lower().count(word_matches[i]) print(match)
true
a07108132bca4f86ef08d9c08e5bc1940c5fe5f7
Python
simonchapman1986/ripe
/src/apps/api/helpers/response.py
UTF-8
2,346
2.5625
3
[]
no_license
import json import logging trace = logging.getLogger('trace') class ResponseGenerator(): def __init__(self, api_name, path, attribute_keys, sub_struct=None, struct_count=0): self.resp = dict() self.struct = dict() self.struct[api_name] = {} self.struct[api_name]['current_report'] ...
true
cf3e375792f4df68bc7481a350f008c8f244eebc
Python
NAMHYEONJI/PPS
/NamHyeonJi_20210710/3-4_NamHyeonJi.py
UTF-8
291
3.625
4
[]
no_license
#이렇게 풀어도 되는 것인가... n = int(input()) first = int(input()) if first == 0: second = 1 else: second = 0 if n > 5: print("Love is open door") else: for i in range(n-1): if i % 2 == 0: print(second) else: print(first)
true
234d8b06ebab3bfb3357bf011e6182b0ded53b85
Python
Nu-Pan/konoumasuki
/parameter_solver/.ipynb_checkpoints/parameter_solver-checkpoint.py
UTF-8
6,468
3.03125
3
[]
no_license
from sympy import * from typing import Dict, List, Any from sympy.plotting import plot ''' # sympy ヘルパ ''' def makesym() -> Symbol: ''' シンボルを生成する。 シンボル名は後で更新するので適当でいい。 ''' return Symbol('undef') def Lerp( min_value: Symbol, max_value: Symbol, ratio: Symbol ) -> Symbol: ''' 区間 [min_value,...
true
6d425069335954ffedb365eb159e0b804331b766
Python
sjzyjc/leetcode
/200/200-BFS.py
UTF-8
1,096
3.484375
3
[]
no_license
from collections import deque class Solution: """ @param grid: a boolean 2D matrix @return: an integer """ def numIslands(self, grid): if not grid or not grid[0]: return 0 counter = 0 for i in range(len(grid)): for j in range(len(grid[i]))...
true
62dee71f74e7210daddaf06a4db7f690944c569c
Python
marcioinfo/reviews
/src/project/middlewares.py
UTF-8
566
2.625
3
[]
no_license
import json # DJANGO LIBRARY IMPORT from django.http import HttpResponse class ExceptionsMiddleware(object): """ A middleware for handling exceptions """ def __init__(self, get_response): self.get_response = get_response def __call__(self, request): return self.get_response(request) ...
true
202a51aeca3c36532ad1309e45ca6b72c692076f
Python
Speclized/cdn
/prj/paper/paperJiangchong.py
UTF-8
642
2.96875
3
[]
no_license
import pandas as pd import jieba import synonyms # 更改比例 小 中 大 s m l # 更改程度 小 中 大 s m l def change(text, rate=1, level=2): i = 0 while(i < level): i += 1 seg_list = list(jieba.cut(text, cut_all=False)) for i in range(len(seg_list)): s = seg_list[i] try: ...
true
94c66a8d94da5590c0b797c698ebe0f4364b3c66
Python
RAVURISREESAIHARIKRISHNA/Python-2.7.12-3.5.2-
/Tempp.py
UTF-8
309
3.4375
3
[ "MIT" ]
permissive
def replicate(times, data): value = [] if type(times) is str or data is " ": raise ValueError ("Invalid Input") elif times > 0 and data is not " ": for x in range(times): value.append(data) return value elif times <= 0: return value H = replicate(5,"x") print(str(H))
true
d90be73f0ff56e596b7abe33ac40f5f9269c8829
Python
cale-i/atcoder
/yukicoder/No.236 鴛鴦茶.py
UTF-8
168
3.21875
3
[]
no_license
# yukicoder No.236 鴛鴦茶 2020/02/03 a,b,x,y=map(int,input().split()) xa=x/a yb=y/b if a==b: ans=2*min(x,y) else: ans=(a+b)*min(xa,yb) print(ans)
true
7bf907a25f16a8a4e6e7a62a31bd7ce4a42a09b6
Python
magiccjae/robust_tracking
/src/quaternion_to_euler.py
UTF-8
748
2.609375
3
[]
no_license
#!/usr/bin/env python import rospy, tf from sensor_msgs.msg import Imu import numpy as np def quaternion_callback(msg): quaternion = ( msg.orientation.x, msg.orientation.y, msg.orientation.z, msg.orientation.w) # Use ROS tf to convert to Euler angles from quaternion euler ...
true
24377f76cc0a62ea2e71873e0e27aef36c4048e2
Python
MendelBak/cdPython
/python_fundamentals_cd/names.py
UTF-8
338
3.140625
3
[]
no_license
students = [ {'first_name': 'Michael', 'last_name' : 'Jordan'}, {'first_name' : 'John', 'last_name' : 'Rosales'}, {'first_name' : 'Mark', 'last_name' : 'Guillen'}, {'first_name' : 'KB', 'last_name' : 'Tonel'} ] def names(list): for obj in list: print obj["first_name"], obj["last_name"]...
true
e60a748dab0279bfcec845278e241166afc0d3d5
Python
Yuhjiang/LeetCode_Jyh
/problems/midium/13_roman_to_integer.py
UTF-8
642
3.65625
4
[]
no_license
class Solution: def romanToInt(self, s: str) -> int: digit = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000} ans = 0 length = len(s) for i in range(length-1, -1, -1): if i < length-1 and digit[s[i]] < digit[s[i+1]]: sign = -1 ...
true
233ef342cb61845f6eb5134ee7db22489e66a3fa
Python
bmviniciuss/ufpb-so
/project1/main.py
UTF-8
1,101
2.78125
3
[]
no_license
import sys import copy from Parser import Parser from FCFS import FCFS from SJF import SJF from RR import RR from OutputHandler import OutputHandler from Utils import get_stats_str, verbose_mode def main(): verbose = verbose_mode(sys.argv) parser = Parser() output = OutputHandler("results.txt") proce...
true
06bac0360a193fa558d07216ddc4744b65653f7b
Python
antonsold/mapreduce
/reducer.py
UTF-8
653
2.734375
3
[]
no_license
import sys def print_row(word, files_set): if word: print(word + '\t' + str(sum(files_set.values()))) current_word = None files = dict() files_banned = set() for line in sys.stdin: word, text_id, flag = line.strip().split('\t', 1) if current_word != word: print_row(current_word, files) ...
true
5b5340e8731544da3fbf5a4018883810383470f8
Python
swethakandakatla/python-project
/listcomprahensioncheck.py
UTF-8
77
3.140625
3
[]
no_license
n=100 num_list=[i for i in range(0,n) if(i%2==0 and i%5==0)] print(num_list)
true
33cbd164a435e9a4545c87bc7709057d5b847aa1
Python
konriz/KoNotek
/modules/morse/generator.py
UTF-8
1,829
3.078125
3
[]
no_license
import numpy as np import struct class Signal: def __init__(self, type, length): self.type = type self.length = length SIGNAL_RULES = { ".": Signal(type='signal', length=1), "-": Signal(type='signal', length=3), "/": Signal(type='pause', length=2), "*": Signal(type='pause', leng...
true
b0fba72b9a49e3ffd119b853e1dbf15cb9349dfc
Python
michaelgbw/leetcode_python
/14.最长公共前缀.py
UTF-8
1,543
3.484375
3
[]
no_license
# # @lc app=leetcode.cn id=14 lang=python3 # # [14] 最长公共前缀 # # https://leetcode-cn.com/problems/longest-common-prefix/description/ # # algorithms # Easy (36.59%) # Likes: 921 # Dislikes: 0 # Total Accepted: 211.5K # Total Submissions: 577.2K # Testcase Example: '["flower","flow","flight"]' # # 编写一个函数来查找字符串数组中的最长...
true
ae6dfe64f882c2aad7482b6f25bff5b66aa8bd5b
Python
childsm/Python-Projects
/helloWorld/scr/mainapp/profiles/models.py
UTF-8
839
2.625
3
[]
no_license
from django.db import models # Create your models here. PREFIX_OPTION = ( ('Mr','Mr'), ('Mrs', 'Mrs'), ('Ms', 'Ms'), ) class Profiles(models.Model): Prefix = models.CharField(max_length=60, default="", choices=PREFIX_OPTION) First_Name = models.CharField(max_length=30, default="", blank=False, n...
true
474a19ef045298b5de26751dd460777bcafaa80f
Python
zuzux3/Projekt-NP
/codes/main.py
UTF-8
386
3.671875
4
[]
no_license
from Expo_Euler import Euler_Exp from Impo_Euler import Euler_Imp from trapez import trapez string = "Podaj wybor operacji: " string1 = "1 - Jawny Euler, 2 - Niejawny Euler, 3 - Metoda Trapezowa" print(string) print(string1) w = input() if w == '1': Euler_Exp() elif w == '2': Euler_Imp() elif w == '3': tr...
true
41c51d1e477b1920837e1ea17f0267553eee3070
Python
pendragonxi/tec4tensorflow
/Test2.py
UTF-8
1,231
3.46875
3
[]
no_license
#-*-coding:UTF-8-*- import numpy as np import matplotlib.pyplot as plt # x = np.linspace(0, 10, 1000) # y = np.sin(x) # plt.figure(figsize=(8,4)) # plt.plot(x,y,label="$sin(x)$",color="red",linewidth=2) # plt.xlabel("Time(s)") # plt.ylabel("Volt") # plt.title("PyPlot First Example") # plt.ylim(-1.2,1.2) # plt.show() #...
true
54b0d95955d5164262faa27974f04ccbe081a074
Python
alintudose/football_match
/football_match.py
UTF-8
2,163
3.421875
3
[]
no_license
''' Se va simula un meci de fotbal intre doua echipe. Vom defini un teren de fotbal, o minge si pozitia mingii pe terenul de fotbal. Simularea meciului va consta in definirea numerelor de suturi si contabilizarea tuturor golurilor, outurilor si cornerelor. La marcarea golurilor mingea va reveni in centrul terenulu...
true