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
07f34649f56aac31da2abf920f95c90ad023d4eb
jbreizh/actimaths_web
/src/actimaths_web/www/cgi-bin/exercices_actimaths/sixieme_nombreCalcul_rang.py
UTF-8
5,478
3.3125
3
[]
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- # # Pyromaths # Un programme en Python qui permet de créer des fiches d'exercices types de # mathématiques niveau collège ainsi que leur corrigé en LaTeX. # Copyright (C) 2006 -- Jérôme Ortais (jerome.ortais@pyromaths.org) # # This program is free software; you can redistribute...
true
7f2c23f8d7c7ad38fc151b9bdec7db27b22c13d0
biobakery/humann_legacy
/src/enzymes2pathways.py
UTF-8
1,269
2.53125
3
[]
no_license
#!/usr/bin/env python import random import sys if len( sys.argv ) != 2: raise Exception( "Usage: enzymes2pathways.py <keggc> < <enzymes.txt>" ) strKEGGC = sys.argv[1] hashKOs = {} for strLine in open( strKEGGC ): astrLine = strLine.strip( ).split( "\t" ) for strKO in astrLine[1:]: hashKOs.setdefault( strKO, [] ...
true
a711c53e89f3d105148addf4dc77368eb3b165de
adagio/advent-of-code
/source/day03/tests/test_overlaps.py
UTF-8
585
2.921875
3
[]
no_license
from unittest import TestCase from modules.overlaps import how_many_overlaps from modules.overlaps import get_non_overlapped_coords class OverlapsTestCase(TestCase): def test_overlaps(self): lines = [ '#1 @ 1,3: 4x4', '#2 @ 3,1: 4x4', '#3 @ 5,5: 2x2' ] ...
true
3e517d35fc65e8c07dab52b669580cd9e1c0105f
ghank/Dataguru-python
/lesson3/src/cankao1.py
GB18030
3,124
3.75
4
[]
no_license
1. дʵֹ #!/usr/bin/python # encoding: utf-8 | #-*-coding:utf8-*- | coding:utf8 """ @author: kenny @file: task3_1.py @time: 2016/10/23 19:11 """ def is_leap_year(year): return (year % 4 == 0) and (year % 100 !=0) or (year % 400 == 0) def days_of_month(year,month): if month in [1,3,5,7,8,10,12]: return...
true
5800e5cf8f8e62af34db34d80a924b943fadba15
Constructor-io/constructorio-python
/tests/test_constructorio.py
UTF-8
2,532
2.671875
3
[ "MIT" ]
permissive
'''ConstructorIO Python Client Tests''' from os import environ import pytest from constructor_io.constructor_io import ConstructorIO from constructor_io.helpers.exception import ConstructorException TEST_API_KEY = environ['TEST_REQUEST_API_KEY'] VALID_OPTIONS = { 'api_key': TEST_API_KEY } def test_with_valid_api_k...
true
56a1e3c335dcff6d50b167187252613a4acbf1ef
DanielFL0/Learning-Python
/exercise2-1.py
UTF-8
207
4.5
4
[]
no_license
#2-1 Simple Message: Store a message in a variable, and then print that message... #The variable message stores the String "Hello World!" and then prints the String. message = "Hello world!" print(message)
true
c19b0975592167539a997db4a6b1d319446f372f
swap1010/Static-Code-Analyzer
/code_analyzer.py
UTF-8
4,078
2.703125
3
[]
no_license
import re import sys import os import ast from collections import defaultdict from typing import Dict class PepAnalyzer(ast.NodeVisitor): def __init__(self): self.stats: Dict[str, Dict[int, list]] = { "variables": defaultdict(list), "parameters": defaultdict(list), "is...
true
cd51052ac2c2d0d2062d6b5fee8d9c0eb8e7f306
bbrucee/ECE573_HW2
/Q5/Q5.py
UTF-8
2,673
3.796875
4
[]
no_license
import sys import os # https://www.geeksforgeeks.org/quick-sort/ # https://stackoverflow.com/questions/50912873/python-quicksort-with-median-of-three def median_of_three(input_array, left, right): middle = (left + right - 1) // 2 a = input_array[left] b = input_array[middle] c = input_array[right - ...
true
1a1eb34804d049f8dfeb689915d4d796874e5310
mikhailchetin/distrsys4
/test_productivity.py
UTF-8
3,515
2.828125
3
[]
no_license
import xmlrpclib import os import datetime from threading import Thread N = 1000 def test_master(coordinator, server1, storage): server1.clear_storage() #to make sure storage is clean before testing start = datetime.datetime.now() for i in xrange(N): coordinator.tick() server1.tick() ...
true
8a4864f32f940d973b2ea8e5a73272321f5a5d1c
sakinala1006/Camera-Calibration
/main.py
UTF-8
3,311
2.890625
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Mar 15 16:01:03 2020 @author: saisrinijasakinala """ import numpy as np import calibrator def find_p(P_img1,K_img1,x_img1,P_img2,K_img2,x_img2): #method to estimate 3D world coordinates I = np.identity(3) #Projection matrix is p...
true
02bdd429d1b64d104557654a2dede0cfc5a78729
derickdeiro/Python_Basic_to_Advanced
/04-MODULOS/aula_54-datetime/aula_54-datetime.py
UTF-8
1,129
3.515625
4
[]
no_license
from datetime import datetime, timedelta from locale import setlocale, LC_ALL from calendar import mdays data = datetime(2021, 2, 3, 10, 53, 20) # Ano, mes, dia, hora, minuto, segundo # PADRAO PARA SAVE print(data) print(data.strftime('%d/%m/%Y %H:%M:%S')) # dia/mês/ANO(XXXX)!=ano(XX) print(data.strptime('03/02/2021...
true
a9fd76f9368eda644353fe51e7cdaf6940ee5f9a
WestfalNamur/CS50x
/python/cash.py
UTF-8
1,195
3.96875
4
[]
no_license
# ============================================================================= # Ask user how much change is owed. # Return Minumum number of coins nedded to return the cash. # ============================================================================= COINS = [0.25, 0.1, 0.05, 0.01] change_input_is_float = False ...
true
0c042b107ecff2cda102dcfa6383aa1ea7d51ad9
hieunguyen1053/question_answering
/question_answering/IR_system/search_engine.py
UTF-8
2,726
2.828125
3
[]
no_license
import urllib.parse import urllib.request from multiprocessing import cpu_count from multiprocessing.dummy import Pool from typing import List from bs4 import BeautifulSoup from nltk import sent_tokenize from readability import Document as Content from ..dataset.document import Document from ..dataset.sentence import...
true
a7bd68c26fcaaf4fd4190a361d0e8dec39539b13
RemySun/DeepVoice
/score/score.py
UTF-8
9,567
2.71875
3
[]
no_license
#!/usr/bin/python import sys import getopt import re import math # import trstk # ----------------------- # # ----- def usage() ----- # # ----------------------- # def usage(): print "Usage: " + sys.argv[0] + " [options] file.score" print " -o, --output=fn set ROC data output filename" print " -h, -...
true
92f3cef0f1eccc8a8114dffd157c71f7a94d8e7d
SoftServeSAG/aws_ros_tests
/mp_behaviour_tests/test/test_monitor_distance_to_goal.py
UTF-8
2,235
2.6875
3
[ "GPL-3.0-only" ]
permissive
#!/usr/bin/env python PKG = 'mp_behaviour_unittests' NAME = 'monitor_distance' import sys import time import unittest import rospy import rostest import roslib.scriptutil as scriptutil from std_msgs.msg import String from nav_msgs.msg import Path from std_msgs.msg import Float64 from geometry_msgs.msg import PoseSt...
true
858281cda6e1cea7d6f9df480b424861b020c792
DeclanOGorman/AdventofCode2020
/8/code_a.py
UTF-8
800
3.09375
3
[]
no_license
def runProgram(code, ): line = 0 acc = 0 lines = [0] while line < len(input): if input[line][0] == 'acc': acc += int(input[line][1]) elif input[line][0] == 'jmp': line += int(input[line][1]) - 1 line += 1 if line in lines: break else: lines.append(line) retur...
true
d18d6726485de649e3c02526e49811dd64f39e69
ynikhily/Stock-News-Alert
/main.py
UTF-8
3,380
2.953125
3
[]
no_license
import requests import datetime from twilio.rest import Client # GENERATE YOUR AUTH TOKEN AND ACCOUNT SID AFTER SETTING UP YOUR TWILIO ACCOUNT ON https://www.twilio.com/ account_sid = "" auth_token = "" STOCK = "TSLA" COMPANY_NAME = "Tesla Inc" # CREATE A FREE ACCOUNT ON https://www.alphavantage.co/ AND GET YOUR OW...
true
97894b29c915ce78da37896664eddc4cf580779b
namitanair0201/leetcode
/atoi.py
UTF-8
630
3.1875
3
[]
no_license
from math import floor class Solution: def myAtoi(self, s: str) -> int: if not s: return 0 s = s.replace(" ", '') digits = "+-0123456789" num = "" if s[0] not in digits: return 0 else: num += s[0] for char in s[1:]: ...
true
42709e5468bb7f26e8af5c1e0463def421c96e5c
Valiev/contests
/leetcode/27_Remove_Element.py
UTF-8
308
3.15625
3
[ "MIT" ]
permissive
class Solution: def removeElement(self, nums: List[int], val: int) -> int: next_pos = 0 for pos, n in enumerate(nums): if n == val: continue if next_pos != pos: nums[next_pos] = n next_pos += 1 return next_pos
true
b7279c5c11e6005803d3787d7faad48c5d63d75b
wdanielc/Audio_Modem
/OLD/channel_estimation_test_send.py
UTF-8
347
2.59375
3
[]
no_license
import audio_functions import numpy as np volume = 1.0 fs = 44100 duration = 5.0 sigma = 0.2 # standard deviation of Gaussian (square root of variance) Nsamples = int(duration*fs) gaussian = (np.clip(np.random.normal(0.0,sigma,Nsamples),-1.0, 1.0)).astype(np.float32) #generate gaussian white noise audio_functions.p...
true
e66910be3e19d1133a791467c1332c6bafeee9c3
TecProg-20181/02--gabrielademoraes
/Classes/hangman.py
UTF-8
2,792
4
4
[]
no_license
import string from os import system class Hangman: def __init__(self, secretWord): self.secretWord = secretWord self.lettersGuessed = [] def isWordGuessed(self): for letter in self.secretWord: if letter in self.lettersGuessed: pass else: ...
true
10c1009840e93489cb6faf01dcf0ad62765c41e9
king-zar/Zadania---Python
/Structures.py
UTF-8
595
3.4375
3
[]
no_license
ue = ["Ireland", "Estonia", "Denmark", "Italy", "Slovenia"] print(ue[3:3]) # writes empty tab - only "[]" print(ue[-2]) # writes content of penultimate element (ue[3]) - Italy print(ue[-6]) # error print(ue[0:5]) # writes whole tab - ['Ireland', 'Estonia', 'Denmark', 'Italy', 'Slovenia'] print(ue[0:3], ue[3:5]) # writ...
true
200b203f01330fe966f49b148c9a41bd9a212728
DamienMatias/HMM
/hmm.py
UTF-8
2,246
3.203125
3
[]
no_license
import numpy as np # Forward algorithm def forward(A, B, N, T, x): alpha = np.zeros((N, T)) alpha[1][0] = 1 for t in range(1, T): for j in range(N): sumalpha = 0 for i in range(N): sumalpha = sumalpha + alpha[i][t - 1] * A[i][j] alpha[j][t] = B[...
true
cf7429d3ae7efa84968e30ec794eb11b8d77c93a
FSTW-THL/MyKlaus2
/MyKlaus2/MyKlaus2/MyKlaus2/models.py
UTF-8
7,253
2.625
3
[]
no_license
from sqlalchemy import Table, Column, Integer, String, Boolean, Enum, ForeignKey from sqlalchemy.orm import relationship from MyKlaus2.database import Base import enum import json #Enums class SemesterEnum(enum.Enum): SS = 'SS' WS = 'WS' #Tabellen class Department(Base): __tablename__ = 'Department' ...
true
f7d7910fbe6829e78b8e8ea76b6d7cc4bc84e6cb
tuinfor/Data-Structure-And-Algorithmns
/Codepath/Linked list/Asignments - Hackerrank/Plus One Linked List.py
UTF-8
1,725
3.640625
4
[]
no_license
''' Given a non-negative integer representatted as a non-empty singly linked liswt of digits, add 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 as that the most significant dif is at the head of the list Input: 1->2->3 Output: 1-> ...
true
fcd57b13bcd1ea325bef4467388a9dd01a9900d7
zzm501278412/demo_2
/ECshop/page/address_page.py
UTF-8
4,456
2.703125
3
[]
no_license
from common.base import Base,open_browser import time class UserCenterPage(Base): '''封装表现层:制作定位器''' user_center_loc = ("link text","用户中心") # 用户中心 eceiving_addr_loc = ("link text","收货地址") # 收货地址 province_loc = ("xpath", "//form[last()]/table/tbody/tr[1]/td[2]/select[2]") # 选择省份下拉框 city_loc =...
true
3495737c568d483901646d72dcc2bf4f6202603b
nbroeking/Basic-Python-Compiler
/backslashx90/tests/break_while.py
UTF-8
181
3
3
[]
no_license
def pure(): i = 0 while i != 1000000: i = i + 1 return i def pure2(): r = pure() return 5 x = 5 x = pure() while x != 5: print 0 x = pure2()
true
19478cb4c3844691ec0680708b6c0880b69e75c6
oswavare14/proyectoTeoria
/grafos_proyecto.py
UTF-8
8,377
3.015625
3
[]
no_license
import tkinter as tk import matplotlib.pyplot as plt import networkx as nx class Application(tk.Frame): def __init__(self, master=None): super().__init__(master) self.master = master self.pack() self.entradaVertices() self.entradaAristas() self.dibujarGrafo() ...
true
4dc9ee34f80cf9beb71c2df3e822fcc31bb19624
Kanres-GH/Pokolenie-Python-Stepik
/Типы данных/Числовые типы данных int, float/451 градус по Фаренгейту.py
UTF-8
37
3
3
[]
no_license
a = float(input()) print(5*(a-32)/9)
true
bbe6d4072ebb41f9b2197a6dcb6b9f408b001a0d
invalidexplorer/xtcCoin
/backend/util/crypto_hash.py
UTF-8
513
3.234375
3
[]
no_license
import hashlib import json def crypto_hash(*args): """ Return a sha-256 hash of the given arguements """ stringfield_args = sorted(map(lambda data: json.dumps(data),args)) #print(f'stringfield_args:{stringfield_args}') joined_data = ''.join(stringfield_args) #print(f'joined_data: {joined_da...
true
736cad9ab2cb32f3bf4ef9f351639141a566da48
tnem/kenken
/jazz/KenKen_4.py
UTF-8
9,757
3.96875
4
[]
no_license
# This is a program to solve a 4 by 4 KenKen puzzle. # The goal of the puzzle is to fill a square with numbers 1-4, with each row # and column having all numbers occuring once. There are also regions which # have a defined operation (addition subtraction multiplication or division), # and a defined answer. The numb...
true
b671ac54a671379e2d5af30feecaa861fd9ff51f
mpresident14/RandomCode
/python/EulerMethod-Pendulum.py
UTF-8
1,040
3.25
3
[]
no_license
import math import matplotlib.pyplot as plt def angAccelIntegrate(numSteps, start, finish, initial): """Numerically integrate angular velocity function using numSteps from start to finish with initial condition initial""" time = 0 theta = initial velocity = 0 acceleration = -(9.8/0.4)*m...
true
ecb6a3cda9bfa2321f131037bf3599f35109a350
gnhngo/AI
/recursive_dfs.py
UTF-8
1,963
4.375
4
[]
no_license
# CS 44201 # Giang Ngo # 09/19/20 # Implement a “Recursive” DFS to search # Output result starting with node A class Vertex: def __init__(self, n): self.name = n # letter name of the vertex self.neighbors = list() # list of adjacent vertices of a specific vertex self.color = 'black' # not discovered ...
true
95f0386186b315eec3169ba9be32d2c134cc2d1f
yin-man/egateway_analysis
/lib/file_log_manager.py
UTF-8
3,491
2.796875
3
[]
no_license
# log_manager module wrapper modules of logging # to support data_collect personalized log write. from os.path import dirname, abspath, sep PWD = dirname(abspath(__file__)) log_dir = dirname(dirname(PWD)) + sep + 'log' import logging import traceback from logging.handlers import RotatingFileHandler import jsonpickle...
true
7234993989980ec43a99e22e41c5468de6f453ad
son1128/Evolution-Trading
/Network.py
UTF-8
4,066
2.859375
3
[ "MIT" ]
permissive
# MIT License # Copyright (c) 2021 Luke LaBonte # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, m...
true
a7c6fb017efd78c327a94c650bef3b7c60f6639a
royteutsch/md5
/md5_user.py
UTF-8
1,840
2.84375
3
[]
no_license
from tkinter import * import socket my_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) my_socket.connect(('127.0.0.1', 1729)) class Graphical_client: def __init__(self, lst, root): self.lst = lst self.total_rows = len(lst) self.frame = Frame(root) if not lst: ...
true
035d707d712b94d356145329949aaa706c8d602d
vstolchnev/test
/HairDryerModule.py
UTF-8
365
2.765625
3
[]
no_license
from ProductItemModule import ProductItem class Hairdryer(ProductItem): def __init__(self, dbId, art, nm, p, s): self.dbId = dbId self.artikul = art self.name = nm self.price = p self.power = s def get_info(self): return ProductItem.get_info(self) + ' Мощность ...
true
ef52921ee54f1d40bc4186945f97df3a25b24031
willacya/Python-Euler-Project
/eulerq7.py
UTF-8
240
3.40625
3
[]
no_license
def find_prime(): prime_list = [] i = 10001 while len(prime_list) < 10002: isPrime = True for j in range(2, i): if i % j == 0: isPrime = False if isPrime: prime_list.append(i) i += 1 print prime_list[-1] find_prime()
true
e21496c903b6d00c272918b73140459adfa446c4
SamRozen/dm2
/compare.py
UTF-8
563
3.078125
3
[]
no_license
#! /usr/bin/env python import sys import tempfile def load_file(filename): with open(filename) as f: res = set(map(lambda x: x.strip('" \'\n').lower(), f.readlines())) return res def write_set(s): f = tempfile.NamedTemporaryFile(mode='w+b', delete=False) f.writelines('\n'.join(sorted(s))) ...
true
65da8fb710e04b6acf264169e8d5742f6d74a78f
GAO8A/js-py-experiments
/experiments.py
UTF-8
3,036
4.125
4
[]
no_license
import math # Absolute value print("Absolute Value", abs(-100)) # python3 Ceiling, floor, round print("math ceiling", math.ceil(1.5)) print("math.floor: ", math.floor(1.5)) print("round:", round(1.5)) # Max/min print('Max 100,50', max(100,50)) print('Min 100,50', min(100,50)) # If else some_number = 3 if some_...
true
c7a70a0f2c3099ec68f492094392f4eb3850bc0c
gabryvieira/Network-Performance---DDR
/Trabalho1/Trabalho1/basePCap.py
UTF-8
3,976
2.515625
3
[]
no_license
import sys import argparse import pyshark from netaddr import IPNetwork, IPAddress, IPSet npkts=0 lastTime=0 pktUp =0 pktDown=0 byteUp = 0 byteDown = 0 strPktD = "" strPktU = "" interArrivalDown = 0 interArrivalUp = 0 def pkt_callback(pkt): global scnets global ssnets global interval global npkts global lastTime...
true
fb06b0a0b3684eca6db4b51af75d705ff0bb364e
javicercasi/lab
/ejercicios/21-04-20/ej2.py
UTF-8
1,358
3.15625
3
[]
no_license
#!/usr/bin/python #este codigo SOLO hace la comunicacion entre proceso usando mensajes #hijo1 -> hijo2 SIGUSR1 #hijo2 -> padre -> hijo1 SIGUSR2 import os import signal import time def creo_archivo(nro,frame): print "hijo2 pasa a mayusculas y le aviso al padre" os.kill(os.getppid(), signal.SIGUSR2) def aviso_...
true
6bdae80b17559086ef3212f22c75937991dc47ef
Maxcutex/pm_api
/app/utils/date_diff_functions.py
UTF-8
492
3.109375
3
[ "MIT" ]
permissive
import datetime from dateutil import relativedelta def date_diff_string(start_date, end_date): diff = relativedelta.relativedelta(end_date, start_date) date_diff = "" if diff.years > 0: date_diff += "{} yrs ".format(diff.years) if diff.months > 0: date_diff += "{} mon ".format(diff.mon...
true
37798bbddd7109727f9601b06b2ad95100da0afc
streethacker/MACQuery
/main.py
UTF-8
3,678
2.75
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/env python #-*- coding:utf-8 -*- from MACQuery import MACQueryHandler, BadFormatError, BadRequestError import sys import os import getopt class GetMACInfo: _resultInfo = """ HWaddr : %s Manufacturer : %s M's addr : %s """ _warning_not_found = """ HWaddr : %s Stop : %s Note : Unknown MAC add...
true
05e1ea2fafed4ddbfcfc49f0af9d05e9a017437e
JesseEmond/pickaxe
/miner/address_test.py
UTF-8
519
2.71875
3
[ "MIT" ]
permissive
import unittest from address import p2pkh_address_to_pubkey_hash class AddressTest(unittest.TestCase): def test_address_p2pkh_to_pubkey_hash_mainnet(self): # taken from: # https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses addr = "16UwLL9Risc3QfPqBUvKofHmBQ7wMt...
true
83bd3f712dfeef43c90e6ebe249bc9591e010914
daniszam/machine_learning
/task_06/knn.py
UTF-8
2,481
3.203125
3
[]
no_license
import random import math import pylab as pl import numpy as np from matplotlib.colors import ListedColormap def generate_dot(num_class, numberOfClasses): data = [] for classNum in range(numberOfClasses): X, Y = random.random() * 5.0, random.random() * 5.0 for row_num in range(num_class): ...
true
f5a8764a0c7cc83dcf3bbbc9d41bd767508f8b6f
joanamucogllava/PythonPrograms
/SalesTax.py
UTF-8
238
3.9375
4
[]
no_license
# This program will show the amount of the tax # you will be charged based on the purchase amount. purchaseAmount = eval(input("Enter purchase amount: ")) tax = purchaseAmount * 0.0825 print("Sales tax is", int(tax * 100) / 100.0)
true
fe9d7ee1b4b8763e44fc7dd2a02ac8eb3020f41d
Kevinrobot34/atcoder
/abc/abc_126_211/abc194/e.py
UTF-8
1,937
3.15625
3
[]
no_license
class SegmentTree1(): def __init__(self, n_, ele_id, op_func): self.n = 1 << (n_ - 1).bit_length() # size self.data = [ele_id] * (2 * self.n) # binary tree (1-indexed) self.ele_id = ele_id # identity element self.op_func = op_func # binary operation of monoid def __getitem__...
true
20bcb56a476be98e38864ef74d51131144f92752
Pablinki/QA-System
/booleano2.py
UTF-8
1,580
2.859375
3
[]
no_license
from random import sample def search(word): s = sample(range(10), len(word)) print '-- SEARCH %-12s %68s %-60s' % (word, '', str(sorted(s))) return set(s) def set_op(operator, set1, set2): if operator == 'AND': return set1 & set2 if operator == 'OR': return set1 | set2 return...
true
c98988d0e89b98c9c6577cde2ece944f6c75d22a
KunYi/onnxruntime-test-python
/onnx_ssdmobilenetv2.py
UTF-8
1,383
2.515625
3
[ "MIT" ]
permissive
''' download pretrained model from http://download.tensorflow.org/models/object_detection/ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz use tf2onnx/opset v10 to convert onnx model ref. https://github.com/onnx/tensorflow-onnx ''' import numpy as np import onnxruntime as rt import cv2 from PIL import Image,ImageDraw ...
true
cf6661461cc9f85a1a1ce2e0e7b3646cf43263cb
k-harada/AtCoder
/other_contests/HITACHI2020/C.py
UTF-8
1,902
3.03125
3
[]
no_license
from collections import deque def solve(n, ab_list): g = [[] for _ in range(n + 1)] for a, b in ab_list: g[a].append(b) g[b].append(a) # start from 1 d_list = [-1] * (n + 1) d_list[1] = 0 queue = deque([1]) while len(queue) > 0: p = queue.popleft() for q in ...
true
2aba55bae486ded349f84ad07fdf3588b5731849
teramita45/python-master
/siclos/if-else.py
UTF-8
513
3.984375
4
[]
no_license
condicion = True if condicion: print("la condicion es verdadera") else: print("la condicion es falsa") #operador ternario print("condicion es verdadera") if condicion else print("condicion es falsa") numero = int(input("proporciona un numero entre 1 y 3: ")) #if elseif else if numero == 1: numeroTe...
true
b53c5025c44098ad22c65eb3e20ce5f27663889c
bogdansimion31/University
/Semester4/Artificial Intelligence/KNN_gender_class/test.py
UTF-8
68
2.9375
3
[]
no_license
matrix = [[1, 2, 3], [4, 5, 6]] print([x[-1] for x in matrix[:-1]])
true
8396cac7cdd740ca834e9c44958b31995c5e4cc7
mauricioklein/algorithm-exercises
/challenge-66/test_solver.py
UTF-8
607
3.0625
3
[ "MIT" ]
permissive
import unittest from solver import Node, level_order class TestSolver(unittest.TestCase): def test_level_order(self): root = Node(1, Node(2), Node(3, Node(4), Node(5))) self.assertEqual(level_order(root), [1, 2, 3, 4, 5]) root = Node(1, right=Node(3, right=Node(5))) self.assertEqual(level_order(root...
true
823d0f6b7fe0ed25b59529ab1bcb34e10e641e36
tamerlan-b/ros_tcp
/server.py
UTF-8
4,160
2.578125
3
[]
no_license
#!/usr/bin/env python import rospy from std_msgs.msg import String import threading import socket import json import random import json from messages import MsgType, MsgDataType, MsgPacker # Return ip address of current machine def get_ip_address(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.conne...
true
8529861523f4bed63315018c436722f198467d8d
dhwen/Kaggle-Stock
/dataloader.py
UTF-8
611
3.125
3
[]
no_license
import numpy as np import csv class DataLoader: def load(self, file_name, row_start, row_end): file_data = open(file_name,'r') data_reader = csv.reader(file_data) cur_row = 0; input = [] labels = [] stock_prev_val = 0; for row in data_reader: cur_row = cur_row + 1 if (cur_row < row_start): ...
true
038bad74227cc127e276bdbcf749ee1a5a246c64
statsmodels/statsmodels
/statsmodels/stats/tests/test_robust_compare.py
UTF-8
11,037
2.59375
3
[ "BSD-3-Clause" ]
permissive
# -*- coding: utf-8 -*- """ Created on Fri Aug 16 13:41:12 2013 Author: Josef Perktold """ import numpy as np from numpy.testing import assert_equal, assert_allclose, assert_raises import pytest from statsmodels.stats.robust_compare import ( TrimmedMean, trim_mean, trimboth) import statsmodels.stats.oneway as...
true
05163408ff5896010ac137625ce14ac01a2f8f79
sangeetha19399/pythonguvipgm
/b96.py
UTF-8
89
2.71875
3
[]
no_license
aa1,dd1,nn1=map(int,input().split()) sum=((nn1/2)*(2*aa1+(nn1-1)*dd1)) print(round(sum))
true
70521a7a22f5d5536ea82dfe7b5932872bab40b8
khaeru/sdmx
/sdmx/model/internationalstring.py
UTF-8
4,702
3.234375
3
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
from copy import copy from typing import Dict, Iterable, Mapping, Optional, Sequence, Tuple, Union # TODO read this from the environment, or use any value set in the SDMX-ML spec. # Currently set to 'en' because test_dsd.py expects it. #: Default locale for :class:`InternationalString`. DEFAULT_LOCALE = "en" # §...
true
e82b353385550830463e71f903ae2cc1219b3730
gustavobbosa/CalculoNumerico
/Sistemas/.ipynb_checkpoints/metodossl-checkpoint.py
UTF-8
3,425
3.1875
3
[]
no_license
from . import utilitarios as ut from . import auxiliar as aux ############################################################################### def eliminacao_gauss(A,b,metodo=aux.pivoteamento_parcial,imprimir = False): '''Retorna uma lista com os xn.''' if imprimir: print("\n## Começando eliminação d...
true
af52de64bc4ac3e0d93b9f76c20cd7719ad4295e
PresiyanaBB/Python-11class
/NOK/NOK.py
UTF-8
163
3.296875
3
[]
no_license
a,b=map(int, input().split()); if(a>b): x=a; else: x=b; while x<=a*b: if(x%a==0 and x%b==0): print(x); break else: x=x+1
true
67dfdc479b7a140cff301032ed1c3e51ee85b36f
indigames/pyxiepython
/pyxie/devtool/__init__.py
UTF-8
11,426
2.6875
3
[ "MIT" ]
permissive
""" pyxie game engine offline develop tools convert 3d assets convert images to platform dipend format make pyxie package upload package to devserver """ import py_compile import shutil import glob import os.path import pyxie from pyxie import apputil from pyxie.devtool._pyxietools import * from pyx...
true
196820f925d7593fcf83202787c5d0f82a30b5f7
abrahammurciano/homework
/4th-Year/Intro-to-AI/hw3/cell.py
UTF-8
1,157
3.46875
3
[]
no_license
from typing import Optional, TYPE_CHECKING from players.abc.player import Player if TYPE_CHECKING: from connect_four_board import ConnectFourBoard class Cell: def __init__( self, row: int, column: int, player: Optional[Player["ConnectFourBoard"]] = None ): """Construct a cell. Args: row (int): The row i...
true
e30e21ba28c0f5b59ac64293d6e95e831b988bcd
ChittojiMuraliSreeKrishna/TkinterPython
/ContactBook.py
UTF-8
3,015
2.734375
3
[]
no_license
from tkinter import * import tkinter as tk from tkinter import messagebox import sqlite3 root = tk.Tk() root.title('contact book') root.configure(bg='black') conn = sqlite3.connect('contactbook.db') c = conn.cursor() c.execute("""CREATE TABLE IF NOT EXISTS contact( Name text, Mobile int, Email text, ...
true
289a9111334afec8eb4196c8588c87a9dfe277bf
heroca/heroca
/ejercicio332.py
UTF-8
255
3.484375
3
[]
no_license
opciones_salir=frozenset(["no","NO"]) suma=0 while True: valor=int(input("Ingrese un valor:")) suma=suma+valor op=input("Desea ingresar otro valor: [si/no]") if op in opciones_salir: break print(f"La suma de los valores es {suma}")
true
1dddc5a657be001cc746d6e6e52d1e3229e5ec19
Barsha96/CB-Recommendation
/Visualization/plot4.py
UTF-8
691
2.90625
3
[]
no_license
import seaborn as sns import pandas as pd import numpy as np from matplotlib import pyplot as plt df=pd.read_csv('English11_PostProcessing.csv') ax=df.iloc[0] vocab=(ax[50]/115)*100 grammar=(ax[51]/115)*100 reading=(ax[52]/60)*100 comp=(ax[53]/10)*100 writing=(ax[54]/50)*100 bar_width = 0.2 n_groups = 5 opacity = 0.8...
true
f40bdc48455f2550e0f9e80b8162766324d40c3c
jry2112/adventofcode
/day9_1.py
UTF-8
6,035
3.8125
4
[]
no_license
# --- Day 9: Encoding Error --- # # With your neighbor happily enjoying their video game, you turn your attention to an open data port on the little # screen in the seat in front of you. # # Though the port is non-standard, you manage to connect it to your computer through the clever use of several # paperclips. Upon c...
true
f1503c610ba20650b6c7c20ce8fab09470c177ae
JoranLau/mini_project_2
/model_vgg.py
UTF-8
2,285
2.625
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Sat Oct 20 16:03:30 2018 @author: Joran """ from keras.models import Sequential from keras.layers import Convolution2D,MaxPooling2D from keras.layers import Dense,Dropout,Flatten,Dropout import tensorflow as tf from sklearn.cross_validation import train_test_split ...
true
44e31b1dae0b3d57b4160fb7d205aca1b42e9de8
mpub/van_api
/examples/export_locations_as_csv.py
UTF-8
3,365
3.0625
3
[]
no_license
#!/usr/bin/python """Export Locations to a CSV file. This example downloads all location data for all locations to a CSV file on stdout """ import sys import csv import json import urllib import logging import van_api # Configuration INSTANCE_ID = 1 GEONAME_USER = 'demo' # A registered username at http://www.geonam...
true
71e5dd3d7c6c11f378f328ff675cb95ba8b9875e
anuragithub/Mood-Inspector
/src/predictor.py
UTF-8
2,218
2.59375
3
[ "MIT" ]
permissive
#!/usr/bin/env python # coding: utf-8 # In[32]: import numpy as np import torch from torch import nn from torch import optim import torch.nn.functional as F from torchvision import datasets, transforms, models from torch.autograd import Variable # In[3]: import pandas as pd from pathlib import Path from shutil i...
true
33f5c6d6d1ec05743b283898a5f58b20839ced1e
DenisVritov/algorithms
/easy_collection/sorting_searching/merge_sorted_array.py
UTF-8
1,741
4.3125
4
[]
no_license
""" Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Modify nums1 in place. Note: - The number of elements initialized in nums1 and nums2 are m and n respectively. - You may assume that nums1 has enough space (size that is equal to m + n) to hold additional elements ...
true
c4aafcd9e4b033e6ef17bfb19b21fbd90c47f16b
Esser50K/TwitterFortune
/fortunebot.py
UTF-8
1,366
2.625
3
[]
no_license
import os import time import tweepy import random COMMAND = "fortune" if os.getenv("OFFENSIVE", None): COMMAND += " -o" HASHTAGS = os.getenv("HASHTAGS", "").split(",") MAX_TAGS = int(os.getenv("MAX_TAGS", 3)) MIN_TIME_BETWEEN_TWEETS = 60 * 60 * 6 # 6 Hours MAX_TIME_BETWEEN_TWEETS = 60 * 60 * 12 # 12 Hours try...
true
f3e39d0e7e37a3cc7a1897f6a4783b6f1dde3821
CodeLagos/Batch-Five
/TechQuest/Python/Chukwuebuka Okongwu/simpleCalculatorGUI.py
UTF-8
2,026
3.53125
4
[]
no_license
#This GUI is simple calculator that computes basic arithmetic operations import tkinter as tk #Other ways of importing tkinter #import tkinter #from tkinter import import math #Code for the real code starts here def Multiply(): print("Code in action") r = float(formR.get()) h = float(formH.get()) product = r*h...
true
105a83cc49b5de7dbcb26c531933e1ef5a5fd340
SleepyBag/MachineLearningStudy
/experiments/timeSVDpp/main.py
UTF-8
4,351
2.921875
3
[]
no_license
from load_movie_data import loadMovieData import mxnet import timeSVDpp_batch import v1 import v3_batch import v2_batch import trainer import math data_loader = loadMovieData() userItems, nUsers, nItems, nDays, minTimestamp = \ data_loader.main('ml-100k/u1.base') test_userItems, test_nUsers, test_nItems, test_nDa...
true
41ca70109d92b1cb7ca9b9a42a96fe17f4991d85
MikeAlbo/USDA_python
/lib/helpers/helpers.py
UTF-8
1,052
2.859375
3
[]
no_license
import csv from lib.sql.usda_db import usda_db def product_parser_check(): if usda_db.completed_parsers()["p_p"] is False: print("product parser needs to run first") quit() def all_parsers_complete(): for v in usda_db.completed_parsers().values(): if v is False: print("A...
true
2fb9821372a2a670d9e62916662dd19d2c795bcb
AndreLesa/simplesmsforms
/simplesmsforms/smsform_exceptions.py
UTF-8
465
3.078125
3
[ "MIT" ]
permissive
class SMSFieldException(Exception): def __init__(self, field): self.field = field def __str__(self): return repr(self.field) class MissingRequiredFieldException(SMSFieldException): def __str__(self): return "The {required_field} is missing but is required.".format( r...
true
0e6c015b68faa30f7aa31ef373773602041df6ec
Viniciusmgm/aula_processamento_info
/Sequencial/media_3notas.py
UTF-8
120
3.265625
3
[ "MIT" ]
permissive
nota1 = float(input()) nota2 = float(input()) nota3 = float(input()) med = (nota1 + nota2 + nota3)/3 print(round(med,2))
true
67942265ee39297b5f8acfacf2bd4f84dad5ca23
Daniel-Gherard/TP1-PAA
/arvore.py
UTF-8
1,518
2.671875
3
[]
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- def busca_em_profundidade(grafo, inicio, fim, todos_os_caminhos, caminho=None): if caminho is None: caminho = [] caminho = caminho + [inicio] if inicio == fim: todos_os_caminhos.append(caminho) for vertice in grafo.dicionario[inicio]: ...
true
fe3a79174279d03e6ac32280485693caa6253832
feliperoveran/exercism
/python/isbn-verifier/isbn_verifier.py
UTF-8
491
3.296875
3
[]
no_license
import re def verify(isbn): if validate_format(isbn): result = 0 for i, num in enumerate(remove_dashes(isbn)): if num == 'X': num = 10 result += int(num) * (10 - i) return mod_11(result) else: return False def validate_format(isbn): ...
true
6356d6399fafca02ddffa5e7c37a29b133770133
polyactis/repos
/variation/trunk/src/DrawSNPMatrix.py
UTF-8
10,835
2.609375
3
[]
no_license
#!/usr/bin/env python """ Examples: DrawSNPMatrix.py -i ./2010_with_149snps_ecotype2accession.csv -o /tmp/2010_with_149snps_ecotype2accession_y4 -y4 #use a custom font and a smaller font size to reduce memory usage DrawSNPMatrix.py -i /tmp/alignment_1843.matrix -o /tmp/alignment_1843_fig_y4 -f FreeSerif.ttf -n ...
true
7fe122500f42ab3387089f2fac8b52ebbb25ccab
enlighter/board-question-paper-metadata
/utils/dataterms.py
UTF-8
2,720
2.59375
3
[ "MIT" ]
permissive
# This module contains the datastructures for metadata extraction from pprintpp import pprint class dc_elems: def __init__(self): print("Creating new dc instance") self.metadata_elements = {} def _init_metadata_(self): pass class qp_metadata(dc_elems): def __init__(self, publishe...
true
a39b5e4be14974744608725ba2235256e5e95eb7
vflopez/Election_Analysis
/Python_practice.py
UTF-8
1,228
3.890625
4
[]
no_license
# my_votes = int(input("How many votes did you get in the election? ")) # total_votes = int(input("What is the total votes in the election? ")) # # percentage_votes = (my_votes / total_votes) * 100 # print(f"I received {my_votes / total_votes * 100}% of the total votes.") # counties_dict = {"Arapahoe": 369237, "Denver...
true
3f4789998c1b879fa11cc4ef83b3decb2d354d54
zrsj/auto-update-script
/retrieve.py
UTF-8
3,358
3.171875
3
[]
no_license
#!/usr/bin/python3 #Author: zrsj #Date of creation: 09/01/2019 #Description: retrieval script that executes sql at 7am every day import psycopg2 #postgres driver for executing sql import sys #currently used for command line arguments import pytoml as toml #used to read in database config file import os #used to crawl t...
true
c120559c8e936c81890f021fd5a35d861c5231d2
maximebriol/process_data
/question3.py
UTF-8
1,808
2.671875
3
[]
no_license
import datetime import processing_data import processing_data.cartoplot def plot(table: processing_data.Table, filename: str): data = {} for k, v in zip(table.get_column("dep"), table.get_column("incid_hosp")): data[k] = v cp = processing_data.cartoplot.CartoPlot() fig = cp.plot_dep_map(data=d...
true
3d2c34d4c98b25434fd496e282151d903395e824
netproglogic/pyneng-examples-exercises-en
/exercises/25_db/task_25_4/task_25_4.py
UTF-8
2,501
2.890625
3
[]
no_license
# -*- coding: utf-8 -*- """ Task 25.4 There are no tests for the tasks of the 25th chapter! Copy file get_data.py from task 25.2. Add to the script support for the active column, which we added in task 25.3. Now, when requesting information, active records should be displayed first, and then, inactive ones. If there...
true
63fd7c535c5ce9ade37c3219f43d9f29136e27ed
ch1huizong/study
/lang/py/pyadmin/05/client/check/port_checker_twisted.py
UTF-8
822
2.609375
3
[ "MIT" ]
permissive
#! /usr/bin/env python3 # -*-coding:utf-8 -*- # @Time : 2019/06/14 23:04:31 # @Author : che # @Email : ch1huizong@gmail.com import sys from twisted.internet import reactor, protocol class PortCheckerProtocol(protocol.Protocol): def __init__(self): print("Created a new protocol") def connectio...
true
fdb8a7f227acccd3be3d747b2cbf5a730123a899
jhrcook/advent-of-code_2020
/challenges/23_challenge.py
UTF-8
2,515
3.140625
3
[]
no_license
import pickle from pathlib import Path from time import time import colorama import numpy as np # Prepare colorama to highlight printed solutions. colorama.init(autoreset=True) answer_highlight = colorama.Fore.BLUE + colorama.Style.BRIGHT # Input data. DEBUG = False if DEBUG: input_data = "389125467" else: ...
true
37e24382e90256e920afba5418a40a8eb475f068
Mohan-Zhang-u/From_UofT
/csc148/assignment2/modified assignment2.1/testfile.py
UTF-8
436
2.671875
3
[]
no_license
from controller import Tree from sudoku_puzzle import SudokuPuzzle t = Tree(('care',1)) t.insert(Tree(('dare', 2)),('care',1)) t.insert(Tree(('date', 3)),('dare', 2)) t.insert(Tree(('bare', 2)),('care',1)) t.insert(Tree(('cate', 4)),('date', 3)) t.insert(Tree(('cake', 5)),('cate', 4)) t.print_tree_indent() print(t.undo...
true
2a05fab993d43295a9b7d7f2a48b0165624c3960
yut-inoue/AtCoder_ABC
/other_practices/square869120#6_B.py
UTF-8
449
3
3
[]
no_license
n=int(input()) al=[0]*n bl=[0]*n for i in range(n): al[i], bl[i] = map(int,input().split()) al.sort();bl.sort() def f(start,end): res=0 for ai,bi in zip(al,bl): res+=abs(ai-start)+abs(bi-end)+(bi-ai) return res if n % 2 ==0: ans=min( f(al[n//2],bl[n//2]), f(al[n//2],bl[n//2-...
true
098b59dfa881cc88483732dad23ee30729813c8b
vvvis/Hillel_task03_Kitchen
/machinery_lib/Small_Machinery.py
UTF-8
2,405
3.671875
4
[]
no_license
class CoffeeMachine: def __init__(self): self.water_tank_cups=0 self.coffee_tank_cups = 0 self.milk_tank_cups = 0 self.power = 'off' def power_switch(self): if self.power == "on": self.power = "off" else: self.power = "on" def add_wa...
true
2df02d499b30cb472e7486709d09a1eb3601d9a0
christianvonkoch/TDDE31_Labs
/lab1-spark/exercise1.py
UTF-8
1,347
3.359375
3
[]
no_license
from pyspark import SparkContext # Definition for calculating the maximum value def max_temperature(a,b): if a>=b: return a else: return b # Definition for calculating the minimum value def min_temperature(a,b): if a<=b: return a else: return b sc = SparkContext(appName =...
true
7b8511bf69c11c2b92ae0e0e240bd6f412716691
gersongroth/maratonadatascience
/Semana 01/04 - Listas/05.py
UTF-8
442
4.375
4
[]
no_license
""" Faça um Programa que leia 20 números inteiros e armazene-os num vetor. Armazene os números pares no vetor PAR e os números IMPARES no vetor impar. Imprima os três vetores. """ MAX = 20 par = [] impar = [] vetor = [] for i in range(MAX): valor = int(input("Informe um número: ")) vetor.append(valor) if v...
true
5c80e13c55467a0f1f9a3e69a7b40b4133d86fac
EmperorCodeman/Example-MVC-BlackJack
/blackjack/controller.py
UTF-8
2,002
2.71875
3
[]
no_license
import flask, jsonpickle, shelve from game import Game shelves = shelve.open("shelves") app = flask.Flask(__name__) @app.route("/", methods=['GET','POST']) def landerPage(): if flask.request.method == "POST": userInput = flask.request.form npcCount = int(userInput["npcCount"]) game = Game(...
true
8348e07e51f39c84319b426d9a76d7dd6e41c4f0
Wolfant/EspePython
/Parte1/clases/class3.py
UTF-8
576
4.28125
4
[]
no_license
class MyClass: """Una clase simple para ejemplo""" def __init__(self, number): self._number = number def number(self): """ Funcion que retorna el valor de atributo de clase MyClass Return: object: el valor de "number" """ return self._number ...
true
c04e3a34290b2893bec75ef9dbb6679540aeb3ea
palmerkuo/PoseMono
/util/paths.py
UTF-8
80
2.53125
3
[ "WTFPL" ]
permissive
import os def makedir(path): if not os.path.exists(path): os.makedirs(path)
true
3309327097ebdc3968bee0b5c71e0c3b7313e027
chiragdholakia/python-net-auto-class
/class10/ex2_class10.py
UTF-8
609
2.8125
3
[]
no_license
#!/usr/bin/env python import threading from datetime import datetime from my_devices import network_devices from my_functions import ssh_command if __name__ == "__main__": start_time = datetime.now() for device in network_devices: my_thread = threading.Thread(target=ssh_command, args=(device, "show...
true
2979389f01116f6eec2e9ddc076afaf2d6c369c0
jdfinch/structpy
/structpy/collection/enumerable/finite_markov_enumerable.py
UTF-8
2,438
3.65625
4
[]
no_license
from structpy.language import specification, implementation @specification class FiniteMarkovEnumerableSpec: """ Define a sequence iterator that generates each value based on the previous value. A boolean end function is specified to define the end of the sequence. """ __kwargs__ = { ...
true
918b3512ee46e7b731c407acda3a564121b7ef5a
HundleyChris/Hundley_story
/ClassWork/Evenorodd.py
UTF-8
320
4.3125
4
[]
no_license
""" Write a program that will take a number (Integers only) and return a statement that will let the user know if it si even or odd """ number = int(input("Tell me a number and i will determine if it is even or odd.")) if (number x % 2 == 0): print("That is even.") if (number x % 2 == 1): print("That is odd.")
true
1fa6eed7e9202272f726e4044016ac5d7466ee70
ValiantLucatero/Python
/uno.py
UTF-8
752
3.515625
4
[]
no_license
######### # modulos en python ######### class Perro(): """Linea de documentacion para Perro""" def __init__(self, patas,dientes,cola): self.patas=patas self.dientes=dientes self.cola=cola def ladrar(): print("Woof!!!!") def correr(self): print("Soy un perro que corre con: ",self.patas,"pat...
true
dfdc3e2bc97d7dd2e317877bf1a9ff41878efb25
Coni63/CG_repo
/training/medium/cards-castle.py
UTF-8
1,395
3.078125
3
[]
no_license
import sys import math arr = [] def check_stability_per_line(line): for x in range(w-1): if arr[line][x] == '/' and arr[line][x+1] != "\\": return "unstable" for x in reversed(range(1, w)): if arr[line][x] == "\\" and arr[line][x-1] != "/": return "unstable" for x i...
true