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 |
|---|---|---|---|---|---|---|---|---|---|---|
101702b55447d6cad14136c61bc5d820e6a1d8d3 | lobsterkatie/ErgLog | /database_functions.py | UTF-8 | 11,178 | 2.8125 | 3 | [] | no_license | ################################################################################
# TO REMAKE DATABASE #
\c Katie
DROP DATABASE workoutlog;
CREATE DATABASE workoutlog;
\c workoutlog
\dt
#do the above, then run python -i model.py
#>>>db.create_all()
#then paste the functions below into the database
#################... | true |
dd844a663563586ac649ede13dfe67b7472bbdba | pravsp/problem_solving | /Python/BinaryTree/solution/__init__.py | UTF-8 | 654 | 3.359375 | 3 | [] | no_license | import os
import sys
def AddSysPath(new_path):
""" AddSysPath(new_path): adds a directory to python's sys.path
Does not add the directory if it doesnt exists or if its already on
sys.path. Return 1 if OK, -1 if new_path doesnt exists, 0 if it was already
on sys.path
"""
# Avoid adding non exi... | true |
309ebeffb892e13a1e6d07716c9e95a220366d15 | geochri/Human-Activity-Recognition-final-semester-project | /sensor/main.py | UTF-8 | 320 | 2.59375 | 3 | [] | no_license | import numpy as np
from pprint import pprint
def main(ls):
sensordata = [ls[i] for i in range(270)] #90(x,y,z)data i.e 270 data
inputnode = []
for a in range(90):
b = [[sensordata[a*3], sensordata[3*a+1], sensordata[3*a+2]]]
inputnode.insert(a,b)
inputnode =[[inputnode]]
pprint(np.array(inputnode))
| true |
f286f4dc68d31e039385731ef6fb424076d7fc88 | arentij/ft2db | /string_work/checksums.py | UTF-8 | 193 | 2.796875 | 3 | [] | no_license | def modify(x, y):
return (x+y)*113 % 10000007
n = int(input())
l = [int(i) for i in input().split()]
checksum = 0
for i in range(n):
checksum = modify(checksum, l[i])
print(checksum)
| true |
2d258e6b563e3111a6622a483bc215680e7ed317 | AmandaAnumba/Buzz | /app/scraper.py | UTF-8 | 647 | 2.640625 | 3 | [] | no_license | from bs4 import BeautifulSoup
import requests
web = ["http://www.ranker.com/list/best-punk-rock-bands-and-artists/reference",
"http://www.ranker.com/list/best-punk-rock-bands-and-artists/reference?page=2"]
artists = []
for i in web:
r = requests.get(i)
data = r.text
soup = BeautifulSoup(data)
# result = soup.fin... | true |
44f5393a4a4f407cc90f327ef6c8cb314701455a | Wellington-Silva/Python | /Python-Exercicios-Basicos/IFS/Lista de IF_ELSE do Classroom/positivo_negativo_nulo.py | UTF-8 | 151 | 3.96875 | 4 | [] | no_license | number = int(input("Digite um nรบmero: "))
if (number > 0):
print("positivo")
elif(number < 0):
print("Negativo")
else:
print("Nulo")
| true |
85ed9e063eed5a5b40206ce923a41a7fc47b8a22 | pkaran57/ML | /ml/algo/neural_net/SingleLaterNeuralNet.py | UTF-8 | 8,643 | 2.9375 | 3 | [] | no_license | import logging
import math
import random
import numpy as np
from ml.utils import ReportUtils, PlotUtils
from ml.utils.ArrayUtils import convert_to_np_array
class SingleLaterNeuralNet:
"""
Neural net with a single hidden layer
"""
def __init__(self, num_hidden_units, training_samples, validation_sam... | true |
58ee594dfa8952b05829778806f9b73ab9168dcc | malkoG/polyglot-cp | /BOJ/Sorting/Python/16496.py | UTF-8 | 60 | 2.59375 | 3 | [] | no_license | n=input()
print("".join(reversed(sorted(input().split()))))
| true |
e360d26daf3dadacbdfef295c4769e719716d972 | harshbhardwaj5/Coding-3 | /LCSubsquence.py | UTF-8 | 537 | 3.03125 | 3 | [] | no_license | def LCSsubs(s1, s2):
m=len(s1)
n=len(s2)
# for i in range(m+1):
# for j in range(n+1):
# L[i][j]=None
L = [[None]*(n+1) for i in range(m+1)]
print(L)
for i in range(m+1):
for j in range(n+1):
if i==0 or j==0:
L[i][j]=0
... | true |
8dab1f1cc736a72f3db7777b04d97e7d0259555f | xzhu0706/LetterCountPieChart | /probability.py | UTF-8 | 836 | 3.5 | 4 | [] | no_license | import string
def process_file(filename):
temp = dict()
file = open(filename)
for line in file:
process_line(line, temp)
return temp
def process_line(line, temp):
for word in line:
word = word.lower()
if word in string.digits:
temp['Numbers'] = temp.get('Numbers... | true |
87e26b89d70757e310632d26a169f8f756bb5991 | ecosy/TIL | /Algorithm/Greedy/leetcode/122_Best-Time-to-Buy-and-Sell-Stock-II.py | UTF-8 | 3,900 | 3.96875 | 4 | [] | no_license | # https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/
# ๋ฆฌํธ์ฝ๋
# ๊ทธ๋ฆฌ๋
# ์ฃผ์์ ์ฌ๊ณ ํ๊ธฐ ๊ฐ์ฅ ์ข์ ์์ 2
'''
[๊ตฌ๋งค]
1. ๊ฐ์ฅ ์ ๋ ์ฃผ์์ ์ฌ์ผ ํจ
[ํ๋งค]
1. ๊ฐ์ฅ ๋น์ ๋ ์ฃผ์์ ํ์์ผ ํจ
2. ์ฃผ์์ ์ฐ ๊ฐ๊ฒฉ๋ณด๋ค ๋น์ธ์ผ ํจ
'''
#%%
# ํ์ด ๊ณผ์
# prices = [7,1,5,3,6,4]
# prices = [1,2,3,4,5]
# prices = [7,6,4,3,1]
prices = [6,1,3,2,4,7]
#%%
... | true |
eb9a436912b82dc3107f64255e231e842d9fa152 | as3379/Python_programming | /Data_Structures/Lists/reverse_linkedlist.py | UTF-8 | 742 | 4.1875 | 4 | [] | no_license | def reverse(head):
current = head
nextnode = None
previous = None
while current:
nextnode = current.nextnode
current.nextnode = previous #pointing next node to previous node to reverse elements
previous = current
current = nextnode
return previous
class Node(objec... | true |
4ac98fed14a2b2c4108379e4a2d08272594dd9e6 | MiniMinnoww/moviepy-video-editor | /info/info.py | UTF-8 | 239 | 2.5625 | 3 | [] | no_license | color_data = {}
with open("info/colors.csv", "r") as file:
for line in file:
color_data[line.split(",")[0]] = line.split(",")[1].strip()
frame_background = color_data["frame_background"]
background = color_data["background"]
| true |
d18d53070266c2172d52570f3d415211335a021e | FeMMaschmann/listas-duplamente-encadeadas-py | /main.py | UTF-8 | 226 | 3.078125 | 3 | [] | no_license | from Lista import Lista
line = "-----------------------"
lista = Lista()
lista.append(6)
lista.append(2)
lista.append(2)
lista.append(9)
lista.append(7)
print(line)
lista.print()
print(line)
lista.printinverse()
print(line) | true |
634decf0ed097f9bf9ae8d70b4d97b395e5fc130 | alexandr-gnrk/reversi_ai | /reversi_match/game/controller/matchcontroller.py | UTF-8 | 1,328 | 2.96875 | 3 | [] | no_license | from ..model.game import Game
from ..model.antigame import AntiGame
from .player.matchplayer import AIPlayer, OpponentPlayer, SimplePlayer
from .gamemode import GameMode
import random
import time
class MatchController():
def __init__(self, black_hole=None):
self.gamemodel = AntiGame(black_hole)
def... | true |
0279b8ad4489c438f9140383b406defd6dc3e2f8 | yli110-stat697/AdventOfCode2020 | /Day 4/star1.py | UTF-8 | 788 | 3.375 | 3 | [] | no_license | with open("input.txt") as f:
passports = f.read()
passportsList = passports.split('\n\n')
def replaceSub(ls, substr):
new_ls = []
for item in ls:
item = item.replace(substr, ' ')
new_ls.append(item)
return new_ls
passportsList = replaceSub(passportsList, '\n')
def ConvertListToDict(ls):... | true |
d9eccb1fcdfccd9dce9d15ebc1a7a7796b32ce47 | fmscorreia/hax | /padding-oracle/padding-oracle.py | UTF-8 | 7,121 | 2.9375 | 3 | [] | no_license | #!/usr/bin/env python3
import constants
import argparse
import base64
import re
import requests
import time
import sys
from random import seed
from random import randint
################################################################################
## Global vars
debug = False
url = ... | true |
63a996549679ff4edc8f3eb01e488786b1e22e67 | xpqz/aoc-19 | /day16.py | UTF-8 | 1,357 | 3.59375 | 4 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
#
# Day 16: Flawed Frequency Transmission
#
# https://adventofcode.com/2019/day/16
#
# By Stefan Kruger
from itertools import chain, cycle, repeat
def read_data(filename="data/input16.data"):
with open(filename) as f:
return list(map(int, list(f.read())))
def patte... | true |
c927b78c734f5c1014daa8c749953936cfce8240 | rodmur/hackerrank | /algorithms/implementation/pickingnumbers_old.py | UTF-8 | 523 | 3.15625 | 3 | [] | no_license | #!/usr/bin/python3
n = int(input())
a = list(map(int, input().split()))
seta = set(a)
amax = 2
for k in seta:
newt = list(filter(lambda x: abs(x - k) <= 1, a))
d = len(newt)
if d > amax:
amax = d
new = newt
low = min(new)
high = max(new)
lower = []
upper = []
for i in range(len(new)):
... | true |
ec6a96f3818cad403a4d76a63558c7c3adc3ed6b | jk983294/CommonScript | /python3/module/pandas/df/transform.py | UTF-8 | 937 | 3.234375 | 3 | [] | no_license | import pandas as pd
import numpy as np
dates = pd.date_range('20130101', periods=6)
df = pd.DataFrame(np.random.randn(6, 4), index=dates, columns=list('ABCD'))
print(df)
# transpose
print(df.T)
# add new column, auto align with index column
df['E'] = ['one', 'one', 'two', 'three', 'four', 'three']
s1 = pd.Series([1,... | true |
b610b9d78570994615a32177f25de6c00f0d2320 | Neb2/Text-RPG | /data/display_map.py | UTF-8 | 12,388 | 2.796875 | 3 | [
"MIT"
] | permissive | from data.art import Colours
def print_map_town(character):
print(Colours.BOLD + "Minimap\n" + Colours.END)
location = Colours.GREEN + "@" + Colours.END
home = Colours.GREEN + "โ" + Colours.END
store = Colours.WHITE + "โ" + Colours.END
hall = Colours.BROWN + "โ" + Colours.END
street =... | true |
f2e8fe58b3a0960af493ca4230813f323c6b8422 | pidEins/AgileBot | /src/main/data/environment.py | UTF-8 | 434 | 2.875 | 3 | [] | no_license | # Interacts with the environment variables.
import os
def set_env():
filepath = (os.path.dirname(os.path.abspath(__file__ + "../../../../"))
+ '/env.conf')
variables = dict(line.strip().split('=') for line in open(filepath))
for k, v in variables.items():
set_var(k, v)
def set_va... | true |
6f32a5bd40f2a4ecced179f88616cfd8d9608c34 | prannb/CS671_assign2 | /doc2vec/glove.py | UTF-8 | 1,456 | 2.8125 | 3 | [] | no_license | import spacy
import os
import glob
import numpy as np
import re
from spacy.vectors import Vectors
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from tqdm import tqdm
nlp = spacy.load('en')
stop_words = set(stopwords.words('english'))
def getGloveVec(txt, filename):
vec = 0
num = 0
wor... | true |
c15358d5fc0f6b8beaa81ea7179dc327c3aedf24 | kovacsav/python-training-2021-10-13 | /get_only_text.py | UTF-8 | 890 | 2.921875 | 3 | [] | no_license | from bs4 import BeautifulSoup
from requests import get
content = get("https://www.index.hu").text
soup = BeautifulSoup(content, features="html.parser")
only_text = soup.get_text()
lines = only_text.splitlines()
counters = {}
for line in lines:
if len(line.strip()) != 0:
# print(line)
words = line.s... | true |
453a04264d01eceef890a42dd07ce4c19df6cd2c | j-bernardi/ising-model | /experiment_2/exp2.py | UTF-8 | 3,035 | 2.65625 | 3 | [] | no_license | import sys, random, time, copy
import numpy as np
from matplotlib import pyplot as plt
sys.path.insert(0, '..')
import main
#Correlation time stuff
#t counts number of states
#<Q> = lim(T->large) 1/T sum 1-T of Q(t)
#Find timescale at which u(t) and u(t+dt) decreases
#Equillibrium time is a good estimate (a few?)... | true |
fd1f9b46e1abc1ed8a84b7d737d5731910c05f39 | ChrisSun99/cs170_final_project | /output_checker.py | UTF-8 | 6,531 | 2.71875 | 3 | [] | no_license | # Released to students
import sys
sys.path.append('..')
sys.path.append('../..')
import argparse
import utils
from student_utils import *
import input_validator
from sys import maxsize
def validate_output(input_file, output_file, params=[]):
input_data = utils.read_file(input_file)
output_data = utils.read_... | true |
8b5381dd16420e77ede7a45bda9de40c11a89570 | Ankit-SIT/PPS-Assignment3 | /primeModule/main.py | UTF-8 | 155 | 2.65625 | 3 | [] | no_license | #!/usr/bin/python3
import primeModule
print("Enter a Number: ")
number = int(input())
primeModule.Check(number)
#Written by Ankit Das
#CS A1 - 19070122023
| true |
021d87e6b21b5da5e4a9f81c742918ba71ded799 | TheKillerAboy/programming-olympiad | /Python_Solutions/SAPO/School_Round_2010/Problem_1_Palin_Solution_1.py | UTF-8 | 163 | 3.03125 | 3 | [] | no_license | if __name__ == '__main__':
word = input('')
print('Is a Palindrome') if word == word[::-1] else print('Is not a Palindrome')
'''
amanaplanacanalpanama
''' | true |
b06fe3eb1ce4c9bbeba3044b29d531a21c584e7d | mcceTest/leetcode_py | /test/X153_TestFindMinimuminRotatedSortedArray.py | UTF-8 | 405 | 3.15625 | 3 | [] | no_license | import unittest
from X153_FindMinimuminRotatedSortedArray import Solution
class TestSum(unittest.TestCase):
def test1(self):
sol = Solution()
nums = [3,4,5,1,2]
self.assertEqual(sol.findMin(nums), 1)
def test2(self):
sol = Solution()
nums = [4,5,6,7,0,1,2]
s... | true |
213810f7f054b9f9a26fd527bc716f0bea61cd5d | javacode123/oj | /leetcode/primary/sortandsearch/rob.py | UTF-8 | 567 | 3.03125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# @Time : 2019-08-15 16:19
# @Author : Shark
# @mail : zhang_jia_luo@foxmail.com
# @File : rob.py
# @Software: PyCharm
class Solution(object):
def rob(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if nums is None or nums == []:
... | true |
674cd8b0d5c3cfb59f1b6a6f5b7de4af0ee5f6a0 | Shouqalmajed/Ad-click-Prediction | /preprocess.py | UTF-8 | 10,054 | 3.03125 | 3 | [] | no_license | #preprocessing original dataset (train_set.csv)
#Coming up with rules to replace missing values based on support confidence etc.
import pandas as pd
import numpy as np
import random
train_df = pd.read_csv("train_set.csv")
print(train_df.head())
k = list(train_df['devid'])
devices = [i for i in list(set(k)) if typ... | true |
82039dd771dcc0a671a0e948aa258881e9039b1f | PedroLeonii/progetto_maturita | /bot_manager/bot_manager.py | UTF-8 | 1,364 | 2.53125 | 3 | [] | no_license | import telepot
from telepot.loop import MessageLoop
import json
from gen_risposte import genera_risposte
class BotManager:
def __init__(self, token):
self.token = token
self.bot = telepot.Bot(token)
self.handlers = {'chat': self.handler_message, 'callback_query': self.handler_callback}
... | true |
54f950f5006f7ba9239136de29ba90bd31642f55 | Adi0704/Team-Titan | /Introduction(Aditya1).py | UTF-8 | 1,913 | 3.59375 | 4 | [] | no_license | def chat(name):
print("HELLO ", end="")
print(name, end="")
print(" I am glad to be at your service")
hello = input("Type 'hello' to chat with Dr.Titan")
if hello == 'Hello' or hello == 'hello':
intromenu()
else:
print("Please type 'hello' to chat with Dr.Titan:")
... | true |
be38e0fd105321256dbff900eba2ddef9f0fce8d | quake0day/oj | /Spiral Matrix.py | UTF-8 | 1,060 | 3.171875 | 3 | [
"MIT"
] | permissive | class Solution(object):
def spiralOrder(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: List[int]
"""
if matrix == []: return []
up = 0; left = 0
down = len(matrix) - 1
right = len(matrix[0]) - 1
direct = 0 # 0 go right 1 go down 2 go ... | true |
f4012a658469340a4799a44ab0bc61ce97449384 | Aasthaengg/IBMdataset | /Python_codes/p03038/s437096912.py | UTF-8 | 418 | 2.65625 | 3 | [] | no_license | from collections import defaultdict
n,m=map(int,input().split())
a=[int(i) for i in input().split()]
a.sort()
bc=defaultdict(int)
for i in range(m):
b,c=map(int,input().split())
bc[c]+=b
i=0
newc=[0]*n
for c,b in sorted(bc.items(),key=lambda x:x[0],reverse=True):
for _ in range(b):
if i==n:
break
ne... | true |
222c55f67a276d759b6876180ad6279c6b9503a5 | tharindupr/hackerrank_warmups | /Sherlock Quries/Sherlock.py | UTF-8 | 929 | 2.609375 | 3 | [] | no_license | def cal(arr):
dic={}
j=0
for i in arr:
try:
dic[i].append(j)
except:
dic[i]=[]
dic[i].append(j)
j+=1
return(dic)
#f=open("Input.txt","r")
NM=input().split(" ")#f.readline().split(" ")
N=int(NM[0])
M=int(N... | true |
f98b168a1e9d5721a19fece153e769a9e9d19bf8 | coleary9/RockBrawl | /cs255-assignment-10-bitcity/physics/body.py | UTF-8 | 5,186 | 2.875 | 3 | [] | no_license | # BitCity Studios:
# Cameron O'Leary <coleary9@jhu.edu>
# Steve Griffin <sgriff27@jhu.edu>
# Jeremey Dolinko <j.dolinko@gmail.com>
# Jonathan Rivera <jriver21@jhu.edu>
# Michael Shavit <shavitmichael@gmail.com>
import pygame
from pygame import time, Rect
import math
import glob
collDirections = ['left', 'right', '... | true |
a559130cc404b66c2adba9434c90a03f60ccfa15 | leoriviera/Project-Euler | /python/problem_58.py | UTF-8 | 738 | 3.84375 | 4 | [
"MIT"
] | permissive | from snippets import is_prime
def problem_58():
"Starting with 1 and spiralling anticlockwise, what is the side length of the square spiral for which the ratio of primes along both diagonals first falls below 10%?"
corner_n = 1
prime_proportion = 1
prime_count = 0
total = 1
loop_count = 1
... | true |
c22b0df157bd89af63509f05e9f3ba81ed71a767 | LorranSutter/URI-Online-Judge | /Beginner/1145.py | UTF-8 | 198 | 2.78125 | 3 | [
"MIT"
] | permissive | X, Y = tuple(map(int,input().split()))
res = ""
for k in range(1,Y+1):
res = res + str(k) + " "
if k%X == 0:
print(res[:-1])
res = ""
if len(res) != 0:
print(res[:-1])
| true |
904a7d4ba0a5a818d416c5c55bd7cbea1e6044f3 | areshta/python-edu | /basic-training-examples/tuple/tuple-1.py | UTF-8 | 900 | 4.5 | 4 | [] | no_license | #Python-3 tuple examples
print("\n*** Simple tuple ***\n")
seasons = ("winter", "spring", "summer", "autumn")
print("There are enough tuples in real life.\nSeasons, for example: ", seasons)
print("\n*** Create tuple from list ***\n")
a, b = 3, 4
c = tuple([a,b])
print(c)
print("\n*** Function can return tuple ***\n"... | true |
d3007825c851edc33305d051a3f89f63031ec0f0 | widelec9/codewars | /kata/python/4kyu/recover_a_secret_string_from_random_triplets.py | UTF-8 | 538 | 2.90625 | 3 | [] | no_license | def dfs(adj_list, v, visited, stack):
visited[v] = True
for k in adj_list[v]:
if not visited[k]:
dfs(adj_list, k, visited, stack)
stack.insert(0, v)
def recoverSecret(triplets):
adj_list = {k: set() for k in set(sum(triplets, []))}
for t in triplets:
adj_list[t[0]] |= {... | true |
db0c4eff898a62ab962ec34bc923db998bb470d7 | Muffinous/DAA | /zEXAMENES/alumnosexamen.py | UTF-8 | 1,189 | 3.296875 | 3 | [] | no_license | # COMO EL COLOREADO, BT- HAMILTON
def isFeasible(g, sol, alumn, exam):
i = 0
feasible = True
compis = g['ady'][alumn]
while feasible and i < len(compis):
if compis[i] < alumn:
feasible = sol[compis[i]] != exam
i += 1
return feasible
def colocar(graph, exams, sol, alum... | true |
aadcc62252c2e1cf17828aaed41f9e4ee09dd75b | philoinovsky/USACO-Traning-Python3-Solution | /chapter2/section2.4/cowtour.py | UTF-8 | 1,814 | 2.84375 | 3 | [] | no_license | '''
ID: philoin1
LANG: PYTHON3
TASK: cowtour
'''
from functools import lru_cache
from math import sqrt
f = open('cowtour.in', 'r')
w = open('cowtour.out', 'w')
data = f.read().split('\n')
def split(string):
return list(map(int,string.split()[:2]))
def warshall():
for k in range(N):
for i in range(N):
... | true |
0b0f47e91a707504e39c5dbba230904e531aca14 | robgaunt/flashlight | /python/searchlight.py | UTF-8 | 11,386 | 2.78125 | 3 | [] | no_license | __author__ = 'Rob Gaunt (robgaunt@gmail.com)'
import logging
import math
SEARCHLIGHT_NAME_ALL = "all"
RADIANS_TO_DEGREES = 57.2957795
DEGREES_TO_RADIANS = 1 / RADIANS_TO_DEGREES
MAX_ELEVATION = 2000
RADIUS_OF_EARTH_METERS = 6373000 # At 40 degrees latitude.
# The motor controller channel which controls azimuth or e... | true |
3d9e97af92289b9205a75e83d6e0a035bbad7fc5 | chenweichang/gaft | /tests/population_test.py | UTF-8 | 1,430 | 2.890625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
''' Test case for GAPopulation
'''
import unittest
from gaft.components.population import GAPopulation
from gaft.components.individual import GAIndividual
class PopulationTest(unittest.TestCase):
def setUp(self):
self.maxDiff = True
self.indv_templa... | true |
e4a737faa89b92e27e7c749be296ba7718e07f13 | pgl77/ProjectEuler | /PrimeGeneratorN.py | UTF-8 | 299 | 3.65625 | 4 | [
"MIT"
] | permissive | print("How many primes do you want?")
N = input()
a = 2
while a < N:
a =a+1
j=2
x=a
while x > j:
if x%j==0 and j!=x:
#print x, " is not prime, divisible by ", j
break
j=j+1
else:
print j,# " is prime, divisible by 1 and itself", x
| true |
ba431cb903c206e64dc323ef858856962dbc4f4b | richardneililagan/euler | /python/algorithms/0033.py | UTF-8 | 1,229 | 3.234375 | 3 | [] | no_license | #!/usr/bin/env python3
from functools import reduce
from math import sqrt
# :: ---
def shares_digit (m, n):
sm = list(str(m))
sn = list(str(n))
sd = set(sm) & set(sn)
if len(sd) == 1 and "0" not in sd:
d = list(sd)[0]
nm = "".join([ x for x in sm if int(x) != int(d) ])
nn = "... | true |
2c2cf98903817bd341f6ab93833edcf709ff97c3 | thakur-nishant/LeetCode | /66.PlusOne.py | UTF-8 | 705 | 4.09375 | 4 | [] | no_license | """
Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.
You may assume the integer do not contain any leading zero, except the number 0 itself.
The digits are stored such that the most significant digit is at the head of the list.
Eg.
digits = [1,1]
result = [1,2]
"""
... | true |
02116497b79b9a1b156d02275da5d227ef3535f9 | sumoward/Tool | /src/database_manage.py | UTF-8 | 22,600 | 2.765625 | 3 | [] | no_license | """
class to interact with mongo
This calls the template created by master template generator class
TODO write testing suite
"""
import pymongo
import csv
class Database_manage_recap:
def dbconnection(self, username, template = 'questionaire_master_template'):
self.connection = pymongo.MongoClient("loc... | true |
9353043a452a8d69f4d2d4ff91bf7a875e9a7b1c | ema47/api-rest-python-sqlite3 | /main.py | UTF-8 | 2,847 | 2.578125 | 3 | [
"MIT"
] | permissive |
from flask import Flask, jsonify, request
import product_controller
from db import create_tables
app = Flask(__name__)
@app.route('/product', methods=["GET"])
def get_products():
products = product_controller.get_products()
return jsonify(products)
@app.route("/product", methods=["POST"])
def insert_produ... | true |
7887c84d9031b37491437f665a061df88b846392 | JudeLee19/amazon_image_classification | /classifier_demo.py | UTF-8 | 1,537 | 2.53125 | 3 | [] | no_license | from flask import Flask, render_template, request,redirect
from collections import deque
from inference import Inference
import os
app = Flask(__name__)
UPLOAD_FOLDER = 'data/upload_file'
ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg'])
DEMO_RESULT_FOLDER = 'data/upload_file/demo_result'
app.config['UPLOAD_FOLDER'] =... | true |
237e374586a431c8a996399b93c485edc37a56b9 | cornell-zhang/heterocl | /tutorials/tutorial_09_stencil.py | UTF-8 | 2,695 | 3.125 | 3 | [
"Apache-2.0"
] | permissive | # Copyright HeteroCL authors. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Use the Stencil Backend
=======================
**Author**: Yuze Chi (Blaok)
In this tutorial, we show how to use the stencil backend in HeteroCL and
generate HLS C++ code as the result.
"""
import numpy as np
import heteroc... | true |
3531dcf4dcaf86fcac5f6560d18e683c1ca6c6e9 | Rapish/Moje_testy | /Strona_selenium_testy/tests/Test2.py | UTF-8 | 770 | 2.765625 | 3 | [] | no_license | from selenium import webdriver
from Strona_selenium_testy.Page_objects.open_website import Web
from Strona_selenium_testy.Page_objects.contact_fields import Contact_fields
import time
from Strona_selenium_testy.Objects.Xpaths import Path
class Test2():
def contact_us_submit(self):
driver = webdriver.Firef... | true |
2db7169ba674de2b35bacb5b2fdb3f7f1a7bd157 | RahulNegi123/SEM-III-CYBERSECURITY-RAHUL_NEGI_C_39 | /Assignment 2/5.py | UTF-8 | 290 | 3.703125 | 4 | [] | no_license | def multLIST(listELEM):
prod = 1
for i in listELEM:
prod *= i
return prod
lst=[]
n=int(input("Enter number of elements : "))
for i in range(0,n):
element = int(input())
lst.append(element)
print("product of elements in list is : ",multLIST(lst))
| true |
95585d21d47aad6aaf7e4126df71065f55210aef | S0166251-FinalProject/RUM | /RUM Vehicle Program/World/AbstractWorld.py | UTF-8 | 982 | 2.96875 | 3 | [] | no_license | import abc
from abc import ABCMeta
from World.Weather.Weather import Weather
class AbstractWorld(object):
__metaclass__ = ABCMeta
def __init__(self):
self.roadNetwork = []
self.roads = []
self.locations = []
self.weather = Weather()
@abc.abstractme... | true |
2da7646fc7bbd78cc1a43b19ff6a57b1904434bc | ayau/hackalytics | /flask/morphology_rect.py | UTF-8 | 1,771 | 2.84375 | 3 | [] | no_license | import cv2
import numpy as np
# read image
img = cv2.imread("../sample_videos/screen_1_2160x3840px.jpg")
# convert img to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
gray = 255-gray
# blur image
blur = cv2.GaussianBlur(gray, (3,3), 0)
# do adaptive threshold on gray image
thresh = cv2.adaptiveThreshold(b... | true |
78202ae33b41c9123abd1341c0e2e4abc203dc87 | ml758392/python_tedu | /python2/Day1_dict_set_time_os/pycharm/process.py | UTF-8 | 222 | 3.125 | 3 | [] | no_license | # -*-coding:utf-8-*-
import time
print('#' * 20, end='')
n = 0
while True:
print('\r%s@%s' % ('#' * n, '#' * (19 - n)), end='') #\r ่ฆ็ๅๆฅ็ๅญ็ฌฆ
n += 1
if n== 20:
n = 0
time.sleep(0.4) | true |
296ab3c2e4658fa9c035a5629ff98f69c9775787 | aelise17264/quizzler-app | /ui.py | UTF-8 | 2,321 | 3.46875 | 3 | [] | no_license | from tkinter import *
from quiz_brain import QuizBrain
THEME_COLOR = "#375362"
class QuizInterface:
def __init__(self, quiz_brain: QuizBrain):
self.quiz = quiz_brain
self.window = Tk()
self.window.title("Quizzler")
self.window.config(bg=THEME_COLOR, padx=20, pady=20)
self.... | true |
3d656d2ead5ce0323c3535d3f635f5c12c8bf351 | carltonbrown/scalr-api-tools | /ScalrAccessor.py | UTF-8 | 3,744 | 2.59375 | 3 | [] | no_license | #coding:utf-8
import datetime
import urllib
import base64
import hmac
import hashlib
from elementtree.ElementTree import parse, fromstring
class Instance:
def __init__(self, rolename, servername):
self.rolename = rolename
self.servername = servername
class Farm:
def __init__(self, xml):
... | true |
8bc477db72517f14b6f1a3e3e9805c18de7a8b2d | Jcgo3003/CS50-Studies | /pset6/1/vigenere1.py | UTF-8 | 840 | 3.203125 | 3 | [] | no_license | import sys
import cs50
if len(sys.argv) == 2:
k = sys.argv[1]
y = len(k)
for a in range (y):
if k[a].isalpha() and k[a].isupper():
k[a] = chr(ord(k[a]) - 65 )
elif k[a].isalpha() and k[a].islower():
k[a] = (chr(ord(k[a]) - 97))
else:
print("err... | true |
a9c7e146ffd60b73ca6f5428d199eb7cf2e7b38c | YiddishKop/python_simple_study | /__name__area.py | UTF-8 | 651 | 3.625 | 4 | [] | no_license | # if __name__ == '__main__':
# ่ฟๆก่ฏญๅฅ็ธๅฝไบpython็จๅบ็ entry point
# entry point is where execution begins
# entry point of C is ''void main()'
# entry point of Java is 'public static void main(String[] args)'
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
def calcul... | true |
8633ac865de0574e75bb8ef1c14d0f9dfc48d418 | Muzijiajian/kesci_part_1 | /set2/set2text.py | UTF-8 | 1,126 | 2.578125 | 3 | [] | no_license | #encoding=utf-8
import numpy as np
import os
set_path = '/home/lord/PycharmProjects/Kesci/set2/BOT_Image_Testset 2.txt'
# ็จไบๅญๅจๅพ็่ทฏๅพๅ็ธๅ
ณ
image_lists = []
full_image_path_lists = []
label_lists = []
fhandle = open(set_path)
count = 0
while True:
line = fhandle.readline()
# print line
line_parts = line.split('... | true |
28517afbdb2f39726bd2924eea59b78485b40060 | kotaproj/supportWebhooksBd | /esp_spiram/led.py | UTF-8 | 4,260 | 2.5625 | 3 | [] | no_license | import _thread
import time
from machine import Pin
from util import *
LED_DEFs = {
"red": (27, ),
"green": (26, ),
"blue": (25, ),
}
ledctl_inited = False
class LedCtl:
_instance = None
def __init__(self):
print("LedCtl - init")
global ledctl_inited
if False == ledctl_i... | true |
0ef7cf1225e4604849435eefc207640a3fbd7925 | copsicle/votingsys | /authsite/createdata.py | UTF-8 | 1,100 | 2.546875 | 3 | [] | no_license | from basic.models import Voter
from random import randrange
import datetime
start_date = datetime.date(1940, 1, 1)
end_date = datetime.date(2003, 2, 1)
time_between_dates = end_date - start_date
days_between_dates = time_between_dates.days
eligible = 605
voted = 448
image = "6d0fbd5b-1770-4969-8191-c5b3a1489742"
whil... | true |
4009ac056f6f4bfaa78299f5677975abc571c944 | ANJI1196/assignment2 | /4power bill.py | UTF-8 | 673 | 3.578125 | 4 | [] | no_license | #POWER CONSUMPTION CALC APP:
units=int(input("Please Enter Number of Units:"))
if units>=1 and units<=50:
print("Rate Per Unit($) is 3")
print("Bill Amount:",bill_amt)
rate=3.00
elif units>=51 and units<100:
print("Rate Per Unit($) is 6")
print("Bill Amount:",bill_amt)
rate=6.00
elif u... | true |
8d2a9032b036e650dfc6b97bf0d01ffa776fcfd8 | iosRookie/XlsAndLocalizable | /Common.py | UTF-8 | 5,599 | 2.59375 | 3 | [] | no_license | # coding=utf-8
import xlrd
import xlsxwriter
from XlsOperationUtil import XlsOperationUtil
def generateiOSandAndroidCommonKey(iosFile, androidFile):
(ikeys, ivalues) = XlsOperationUtil.getIOSKeysAndValues(iosFile)
(akeys, avalues) = XlsOperationUtil.getAndroidKeysAndValues(androidFile)
temp = []
for ... | true |
d03cbb27a7008d3160a59f011fd69d1b5be06ab2 | YthanZhang/fourier_series_computation_and_draw | /fourier.py | UTF-8 | 1,899 | 3.140625 | 3 | [] | no_license | import scipy.integrate as integrate
import scipy
def complex_quad(func: callable, a: float, b: float):
real_integrate = integrate.quad(lambda x: scipy.real(func(x)), a, b, limit=500)
imag_integrate = integrate.quad(lambda x: scipy.imag(func(x)), a, b, limit=500)
return complex(real_integrate[0], imag_inte... | true |
0f07bcdef0e298a45c2e986134b4a6ed89b70f69 | aj-michael/Hailstorm | /server/pasthourhailsresource.py | UTF-8 | 981 | 2.640625 | 3 | [
"MIT"
] | permissive | import json
import time
from twisted.web.resource import Resource
class PastHourHailsResource(Resource):
"""I provide the number of hails in the past hour, broken down by
category."""
def __init__(self, population):
Resource.__init__(self)
self.population = population
def render_GET(... | true |
f44447f4f417d3c240a366fee423f268335afab3 | xiongmengmeng/xmind-technology | /5.mysql/mysql23-ๅ
ถๅฎ.py | UTF-8 | 4,511 | 2.5625 | 3 | [] | no_license | import os,sys
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0,parentdir)
import xmind
from xmind.core.markerref import MarkerId
xmind_name="mysql"
w = xmind.load(os.path.dirname(os.path.abspath(__file__))+"\\"+xmind_name+".xmind")
s2=w.createSheet()
s2.setTitle("ๅ
ถๅฎ")
r2=s2... | true |
33e52548a90e3e4079d48449cdb9dd89dfbe900c | JasperDiShu/QYT_Homework_Practice | /Homework/2020_Mar_25/UDP_Server.py | UTF-8 | 2,120 | 2.984375 | 3 | [] | no_license | #!/usr/bin/env python3
# _*_ coding=utf-8 _*_
# 2020.03.25-Homework--UDP Server
import hashlib
import pickle
import struct
import sys
import socket
address = ('192.168.200.130', 6666)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(address)
print('UDPๆๅกๅจๅฐฑ็ปช๏ผ็ญๅพ
ๅฎขๆทๆฐๆฎ๏ผ')
while True:
try:
# ๆฅๆถUDPๅฅๆฅ... | true |
6506369110f821d28a8d3a7785d7950ea737e9b1 | JhoycekellyBonfort/prova-thassio | /application/model/entity/comentario.py | UTF-8 | 367 | 2.796875 | 3 | [] | no_license |
class Comentario():
def __init__(self,id,texto, video_id):
self._texto = texto
self._video_id = video_id
self._id = id
def getTexto(self):
return self._texto
def getId(self):
return self._id
def setTexto(self, text):
self._texto = texto
def ... | true |
570616b1cd8221b974dee596f8bf4ce94c398359 | y2k6302/ITskillMaster | /Apriori/Project Apriori Python/Apriori_Data_R.py | UTF-8 | 1,128 | 2.71875 | 3 | [] | no_license | # coding=utf-8
import json
import MySQLdb
import sys
reload(sys)
sys.setdefaultencoding("utf-8") # ้ฟๅ
ๅญๅ่ฝ็ขผ้ฏ่ชค
filename = 'C:/Users/BigData/Desktop/skill.txt'
# filename = 'C:/Users/BigData/Desktop/skill.csv'
f = open(filename, 'w')
db = MySQLdb.connect(host="localhost", user="root", passwd="iiizb104", db="project")... | true |
efa2f9f128fba51235a31eb33706f33cf19575aa | cinlo/Leetcode | /459_RepeatedSubstringPattern_python/Solution_459_best.py | UTF-8 | 590 | 3.265625 | 3 | [] | no_license | class Solution:
def repeatedSubstringPattern(self, s):
length = len(s)
result = {}
for i in range(len(s)):
if s[i] in result:
result[s[i]] = result[s[i]] + 1
else:
result[s[i]] = 1
for i in range(len(result)):
print (r... | true |
e3911a2ffbccc3177310b33da0880c7dc1b1f167 | krenfermo/melate | /melate.py | UTF-8 | 1,382 | 2.734375 | 3 | [] | no_license | import pandas as pd
import requests
from gmail import send_mail
def baja_csv():
req = requests.get("https://www.pronosticos.gob.mx/Documentos/Historicos/Melate.csv")
url_content = req.content
csv_file = open('melate.csv', 'wb')
csv_file.write(url_content)
csv_file.close()
data =... | true |
c9647cb322fb70fda460fa6bc407f5317ae8c3ad | huazhige/EART119_Lab | /mid-term/alarconvanessa/alarconvanessa_35946_1312515_Num2.py | UTF-8 | 634 | 2.96875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed May 8 09:04:24 2019
@author: Nessa
"""
import numpy as np
import matplotlib.pyplot as plt
import opt_utils as opt
#================= Equations ==================================================
x0 = -10
x1 = 10
x = np.arange(-10, 10, 1)
# a
def a(x):
r... | true |
c7f96a2bdfac224491732659df1f65b464b8dae8 | MarcosRS/python_practice | /6_list_methods.py | UTF-8 | 399 | 4.03125 | 4 | [] | no_license | spam = ['hello', 'hi', 'howdy', 'heyas'];
print(spam.index('howdy'));
spam.append('hellors');
spam.insert(1, 'what up');
print(spam)
## It will remove anywhere in the list
spam.remove('heyas')
print(spam)
#Sorting - It uses ASCII-betical Order - A < a
#For True Alphabetical you can pass (key = str.lower)
num = [2... | true |
2368f20afb3722e8ba9f31b31f64de64947f1481 | denze11/BasicsPython_video | /theme_8/17_why_func_param.py | UTF-8 | 434 | 4.09375 | 4 | [] | no_license | def my_filter(numbers, function):
result = []
for number in numbers:
if function(number):
result.append(number)
return result
numbers = [1, 2, 3, 4, 5, 6, 7, 8]
print(my_filter(numbers, lambda number: number % 2 == 0))
# ะตัะปะธ ะฝัะถะฝั ะฝะตัะตัะฝัะต ัะธัะปะฐ
print(my_filter(numbers, lambda number: number % 2 != 0))
... | true |
ebc573ede8c4a74409b3cc4240adcbfe5de02186 | cloudbuy/celery-singleton | /celery_singleton/backends/redis.py | UTF-8 | 792 | 2.671875 | 3 | [
"MIT"
] | permissive | from redis import Redis
from .base import BaseBackend
class RedisBackend(BaseBackend):
def __init__(self, *args, **kwargs):
"""
args and kwargs are forwarded to redis.from_url
"""
self.redis = Redis.from_url(*args, decode_responses=True, **kwargs)
def lock(self, lock, task_id... | true |
aaed8c4c94b0e35ce74c307a27a4237f6d88c26b | noppakorn-11417/psit-2019 | /problem/Day2011.py | UTF-8 | 711 | 2.859375 | 3 | [] | no_license | """fc inw bas"""
def main(day, month):
ย ย ย ย """fc inw bas"""
ย ย ย ย week = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday ", "Friday", "Saturday"]
ย ย ย ย calendar = [(31, week[6:7]+week[0:6]), (28, week[2:7]+week[0:2]), (31, week[2:7]+week[0:2]),\
ย ย ย ย ย (30, week[5:7]+week[0:5]), (31, week), (30, week[3:7]+week[0:3]), ... | true |
d1e6d668d11e64ea4cdb996eea9c353b0d250499 | edithturn/code-in-place | /01-week/02-lesson-control-flow/more_problems/maximum-5.py | UTF-8 | 566 | 3.421875 | 3 | [] | no_license | from karel.stanfordkarel import *
"""
File: Max5Karel.py
------------------------------
Karel should place 5 beepers in the bottommost row of the world if the world is more than 5 columns wide.
If the world is less than 5 columns wide, Karel should fill the bottommmost row with beepers and not walk through any walls.
... | true |
cc72c07ec438dd973d44392c95b5a78575ab9352 | inlightus/py | /machine_learning/linear_regression/linearRegression.py | UTF-8 | 353 | 3.34375 | 3 | [] | no_license | import matplotlib.pyplot as plt
from gradient_descent_funcs import gradient_descent
months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
revenue = [52, 74, 79, 95, 115, 110, 129, 126, 147, 146, 156, 184]
b, m = gradient_descent(months, revenue, 0.01, 1000)
y = [m*x + b for x in months]
plt.plot(months, revenue, "o")
p... | true |
7e837e3a9fb680fa16914c7bb7af8ae8bbb6210e | shubham20101994/statistics | /pvalue.py | UTF-8 | 579 | 3.203125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu May 7 21:03:23 2020
@author: SHUBHAM KAMBOJ
"""
import scipy.stats as st
def Z_prob(z0):
return(print('p-value of z normal distribution = ',st.norm.cdf(z0)))
def chi_prob(z0, dof):
return(print('\np-value of chisquare = ',st.chi.cdf(z0, dof)))
... | true |
fd2199948fc685c57983c82cd4b5fabf55ef0bef | Andoree/Python-Study | /refactoring/Edward/pygame-master/game_project/src/game.py | UTF-8 | 5,534 | 3.015625 | 3 | [] | no_license |
import random as rnd
import pygame as pg
from sprite_classes import Player, Ball, JUMP_COUNT, entities
from sprites_init import spr_ball_blue, spr_ball_green, spr_ball_red, spr_ball_purple, spr_player_idle, \
spr_player_run, spr_player_fall, spr_player_jump, spr_player_attack, spr_background
pg.init()
'''
Andre... | true |
cde3c8ab101f04d37191140c1e9b5884345b8d4b | kapilmunjewar/startwithgit | /src/read_file.py | UTF-8 | 1,531 | 2.625 | 3 | [] | no_license | import openpyxl
source_path = "../model_file/work_template.xlsx"
own_company_details = []
client_company_details = []
name_of_work = []
purchase_items_data = {}
conditions = []
greeting = ""
sign = []
wb_obj = openpyxl.load_workbook(source_path)
sheet_obj = wb_obj["data_sheet"]
# read own_company_details
for i in ra... | true |
012054349f63e431939a9850742d3c25c14181f2 | teetow/botwrunspy | /src/lib/rect.py | UTF-8 | 750 | 3 | 3 | [
"Unlicense"
] | permissive | from __future__ import annotations
from dataclasses import dataclass, field
@dataclass
class Rect():
y_start: float
y_end: float
x_start: float
x_end: float
def as_tuple(self):
return (self.y_start, self.y_end, self.x_start, self.x_end)
def scaled(self, w, h):
return Rect(
... | true |
5ebd3d1ab43ba1ab37a4503d6d9ac42a0a8d245e | LokIIE/AdventOfCode2020 | /Day5/firstStar.py | UTF-8 | 1,295 | 3.109375 | 3 | [] | no_license | minRow = 0
maxRow = 127
minCol = 0
maxCol = 7
maxBpId = 0
def getMiddleNumber(a: int, b: int):
return float.__trunc__((a + b) / 2)
def getBoardingPassRow(bp: str, minRow: int, maxRow: int):
rowStr = bp[0:6]
lastChar = bp[6:7]
for rowDir in rowStr:
if rowDir == "B":
minRow = getMid... | true |
f13b48e147958ef62d917e0e3d3356fca7fad79f | pooja1506/AutomateTheBoringStuff_2e | /chapter14/addressing.py | UTF-8 | 264 | 2.765625 | 3 | [] | no_license | import ezsheets
ezsheets.convertAddress('A2') # Converts addresses...
ezsheets.convertAddress(1, 2) # ...and converts them back, too.
ezsheets.getColumnLetterOf(2)
ezsheets.getColumnNumberOf('B')
ezsheets.getColumnLetterOf(999)
ezsheets.getColumnNumberOf('ZZZ') | true |
33142aa3ba1764cb7d05e3e7a7cdefff9bd7c7c8 | m-f-1998/university | /python_graph_generator/views_by_browser.py | UTF-8 | 2,724 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | import json
import re
class ViewsByBrowser:
def get_browser(self, verbose_flag, complex_browser=False) -> dict:
"""
Returns Most Popular Browsers Used To View Documents
:param verbose_flag -> bool
:param complex_browser -> bool
:return: browser_count
:rtype: dict
... | true |
28b01c2da3835bb209b5612a250732c2a6736767 | Lookich39/GitProjects | /Calculator/main.py | UTF-8 | 4,312 | 2.515625 | 3 | [] | no_license | from PyQt5 import QtWidgets, QtCore
from untitled import Ui_MainWindow
from math import sqrt
import sys
class mywindow(QtWidgets.QMainWindow):
def __init__(self):
super(mywindow, self).__init__()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.setWindowTitle("Calculator")
... | true |
24de1f3d091b5795878c6d6d6000403ad56c3df2 | ncbi/magicblast | /magicblast-tools/gtf.py | UTF-8 | 4,832 | 2.640625 | 3 | [] | no_license | #============================================================================
#
# PUBLIC DOMAIN NOTICE
# National Center for Biotechnology Information
#
# This software/database is a "United States Government Work" under the
# terms of the United States Copyright Act. It was w... | true |
d61ed6f8cb39e6e1398bdae091f00db00e23db30 | IBCNServices/pyRDF2Vec | /pyrdf2vec/samplers/pagerank.py | UTF-8 | 2,918 | 2.921875 | 3 | [
"MIT"
] | permissive | from typing import Dict
import attr
import networkx as nx
from pyrdf2vec.graphs import KG
from pyrdf2vec.samplers import Sampler
from pyrdf2vec.typings import Hop
@attr.s
class PageRankSampler(Sampler):
"""PageRank node-centric sampling strategy which prioritizes walks
containing the most frequent objects. ... | true |
693b1abff3065aa7ae40279807036ba21db2207f | shgmn/nlp100 | /001/solve.py | UTF-8 | 124 | 2.515625 | 3 | [] | no_license | #!/usr/bin/env python
def test(str):
print(str[::2])
if __name__ == '__main__':
test('ใใฟใใฏใซใทใผใผ')
| true |
985378a2c23ac64af1d5ee855ac91f141af0e0d7 | admiralcoder/Notes | /Class Notes/Actions in Java.py | UTF-8 | 3,491 | 3.53125 | 4 | [] | no_license | ACTIONS in JAVA
-------------- HOVER OVER MOUSE ----------------
Actions is a class that provides metods for advanced user interactions
such as hovering the mouse, double click, right click, scroll, drag and drop
- hovering = perform() actually will perform the actions
movesToElement method that takes an element a... | true |
7a680729b5e84cd04d822f64e98e165c61cf66e8 | dmlc/dgl | /python/dgl/nn/pytorch/conv/grouprevres.py | UTF-8 | 8,622 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | """Torch module for grouped reversible residual connections for GNNs"""
# pylint: disable= no-member, arguments-differ, invalid-name, C0116, R1728
from copy import deepcopy
import numpy as np
import torch
import torch.nn as nn
class InvertibleCheckpoint(torch.autograd.Function):
r"""Extension of torch.autograd""... | true |
9be4cf7bb5c501756d5ce02ccade6d7e8d6cd532 | junfenglx/skip-thoughts | /test_training.py | UTF-8 | 1,701 | 2.609375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
# Created by junfeng on 3/29/16.
# logging config
import codecs
import logging
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',
datefmt='%m/%d/%Y %I:%M:%S %p',
level=logging.DEBUG)
logger = logging.getLogger(__name__)
from training i... | true |
4788276a32842d9f7f7655ac450325371943da54 | bootiful-podcast/processor-v2 | /common.py | UTF-8 | 166 | 2.84375 | 3 | [] | no_license | NAME = "Podcast Processor"
def normalize_string(s: str):
import string
return "".join([c for c in s if (c in string.digits or c in string.ascii_letters)])
| true |
c2db089f7c39b93cb9c30333d2c44d29f2a1d7cb | chenIshi/catchment-basin-seeker | /cluster/result/plot-bw.py | UTF-8 | 1,208 | 2.609375 | 3 | [] | no_license | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
data = pd.read_csv('./data.csv')
markers = ['X', 'D', 'o', 'x']
'''
lpc = data[data["type"]=="LP"]
rndc = data[data["type"]=="Random"]
print(np.percentile(lpc["hamming distance"], 90))
print(np.percentile(rndc["hamming dista... | true |
bfa6be4c67b02a725462149a05e9ab0ccc1e24a2 | MahmoudHeshamBackup/videofiles | /rendering/pytracer/core/PtPixel.py | UTF-8 | 116 | 2.875 | 3 | [] | no_license | class PtPixel():
def __init__(self,r=0.0,g=0.0,b=0.0):
self.r = r
self.g = g
self.b = b
| true |
3c1022b6231b4c3274c06cad3c296b6a0e94bda3 | pranshuVerma98/python | /ds.py | UTF-8 | 353 | 3.453125 | 3 | [] | no_license | print("list started here")
c=["Captain America","Iron man","Hulk","Thor","Klint","Black Widoe"]
print(c)
print(c[3])
c.reverse()
print(c)
d=("this","is","touple")
print(d)
print(d[2])
dic={"name":"pranshu","class":['HEIGHER','upper'],"SO":"Whatsup!"}
print(dic)
print(dic["name"])
print(dic["class"][1])
dic... | true |
e4209a707203637f3c9c135de1b3343710ea2681 | mehradoo/ml-playground | /src/ML2-SVM/svm_author_main.py | UTF-8 | 2,108 | 3.109375 | 3 | [] | no_license | #!/usr/bin/python
"""
This is the code to accompany the Lesson 2 (SVM) mini-project.
Use a SVM to identify emails from the Enron corpus by their authors:
Sara has label 0
Chris has label 1
"""
import sys
from time import time
from email_preprocess import preprocess
### features_train and ... | true |