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
fe36465245d23e1ca5cb885c4f6970e752058622
kyle-gross/holbertonschool-higher_level_programming
/0x03-python-data_structures/5-no_c.py
UTF-8
180
3.09375
3
[]
no_license
#!/usr/bin/python3 def no_c(my_string): # Removes all characters c and C from a string # Return the new string return my_string.translate({ord(i): None for i in 'Cc'})
true
1d65b635cb584b8bc1f38c7dbb9269cc0c50a3ef
ism46999937/M03
/17-03-2017/ejercicio-mayor.py
UTF-8
299
3.875
4
[]
no_license
#!/usr/bin/python # coding: utf-8 read num1 read num2 if (num1 > num2) : print ("El primer valor introducido es más grande que el segundo") else if (num2 > num1) : print ("El segundo valor introducido es más grande que el primero") else print ("Los dos valores son iguales")
true
67cfd51efe8fd08b643edaba59ec48e5cbb47229
flight7788/3d-printing-with-moveo-1
/Cura/Cura/tests/TestCuraSceneNode.py
UTF-8
1,813
2.828125
3
[ "GPL-3.0-only", "LGPL-3.0-only" ]
permissive
from UM.Math.Polygon import Polygon from UM.Scene.SceneNodeDecorator import SceneNodeDecorator from cura.Scene.CuraSceneNode import CuraSceneNode import pytest from unittest.mock import patch class MockedConvexHullDecorator(SceneNodeDecorator): def __init__(self): super().__init__() def getConvexHul...
true
9f17b46dd3efaf52b260d343744f1941e2699a09
NateMeyvis/knockoutpool
/opp_analysis.py
UTF-8
1,801
3.171875
3
[]
no_license
#Tools for analyzing the field in a knockout pool #See README.md for assumptions about the .tsv file from collections import Counter def interpret(team): #Given a team abbreviation, attemps to find a #standard team abbreviation for it #Returns None if it thinks it's not a NFL team name TEAMS = ("ATL", "DEN", "SD",...
true
0ac090325f1686cd0d97cb2b8a376c2a1b793e37
Alruk-art/Mod_16
/16_9_1.py
UTF-8
503
3.9375
4
[]
no_license
print ('\t Задание 16_9_1') class Figure: def __init__(self, height, width): self.x = height self.y = width def get_tip_fig(self): if self.x == self.y: fig = 'square' else: fig = 'rectangle' return fig def par_fig(self): xx = self.x ...
true
71b2b596fd26cbdda5d57190b6b9ddcebc7337b9
alessiodiluzio/Deep-Learning-for-Powerline-Cable-Segmentation
/src/unet.py
UTF-8
7,650
2.5625
3
[]
no_license
import tensorflow as tf class Conv2DLayer(tf.keras.Model): def __init__(self, filters, kernel_size, strides, padding, activation, kernel_initializer): super(Conv2DLayer, self).__init__(name='conv_block') self.convolution = tf.keras.layers.Conv2D(filters=filters, kernel_size=kernel_size, strides=s...
true
12e132bd30f9043963a6cded5e881918bdf09f9f
mohilkhare1708/Competitive-Programming
/Misc/Coding/whileCovid/m.py
UTF-8
747
2.859375
3
[]
no_license
def find_answer(bin_l): while True: len_set = set(map(lambda x: len(x), bin_l)) if len(len_set) > 1: break if 0 in len_set or bin_l[0][0] == '0': return 0 bin_l = list(map(lambda x: bin(int(x[1:], 2)), bin_l)) max_len = max(map(lambda x: len(x), bin_l))...
true
1a8696db973042e0e9d5e2e77dac1558ebebfda3
Azrrael-exe/event-logger
/services/background_worker.py
UTF-8
1,080
2.875
3
[ "MIT" ]
permissive
import abc import queue import logging from time import sleep from entities.message import Message from multiprocessing import Process, Queue class BackgroundWorker(abc.ABC): def __init__(self, input_queue: Queue = None, output_queue: Queue = None, sleep_time: fl...
true
b8891af0e3aa88769f0e0e1cb9c2aedac41dfc57
rukisama/arcturus_2019
/game_messages.py
UTF-8
1,787
3.09375
3
[]
no_license
import tcod import textwrap from typing import Tuple, Dict, Union class Message: def __init__(self, text: str, color: Tuple[int, int, int] = (255, 255, 255)) -> None: self.text = text self.color = color def to_json(self) -> Dict: json_data = { "text": self.text, ...
true
3f2cbf3fc8788f0f0ba8cf7a69e3631ad9e5f24b
dinesh1987/python-samples
/OOPS/basic_oops.py
UTF-8
790
3.96875
4
[]
no_license
observe1="What's happening" observe2="creating Monkey class" class Monkey: def __init__(self): observe4="creating instance vars of that obj." self.breed=None self.color=None observe3="creating a Monkey object" dunston=Monkey() observe5="dunston refers to that object" observe6="accessing ins...
true
65964687969818ec29049ee46816b47f09364649
simonhoch/python_basics
/08_functions/greeter.py
UTF-8
506
4.5
4
[ "MIT" ]
permissive
def get_formatted_name(first_name, last_name): """Return a full name, neatlly formatted""" full_name = first_name + ' ' + last_name return full_name.title() while True: print("\nPlease tell me your name:") f_name = input("First name: ") l_name = input("Last name: ") formated_name = get_form...
true
c1fb45a4b012e4d3fa66c72d4249edf6ceebd4c7
SoulSkare/Pyr2t
/pyr2t/OLD/tumblr/post.py
UTF-8
910
2.65625
3
[]
no_license
from tumblpy import Tumblpy def post(): YOUR_CONSUMER_KEY = '' YOUR_CONSUMER_SECRET = '' OAUTH_TOKEN = '' OAUTH_TOKEN_SECRET = '' # Get the final tokens from the database or wherever you have them stored t = Tumblpy(YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_...
true
9328dc1260c4fe08b5a151891dbb053463f81bf2
manjupriyabalaji/pythonprog
/46pro.py
UTF-8
151
2.734375
3
[]
no_license
n=int(input()) l=list(map(int,input().split())) a=0 b=0 l.sort(reverse=True) for i in l: m=ah+i if b>m: a=m else: a=b b=m print(a,b)
true
b9911e1703cac590cee5a5f656a652392ffe6873
jbaniya/kattis
/kattis/pot.py
UTF-8
181
3.265625
3
[]
no_license
input = int(raw_input()) final = 0 for i in range(0, input): num1 = int(raw_input()) mod1 = num1 % 10 num1 = num1 / 10 final = final + (num1 ** mod1) print final
true
7ea816c1e817090643e10e4ceab00d9e7a51374f
dwiindraloka/Practise-Case-Model-Deployment
/flask_app.py
UTF-8
946
2.625
3
[]
no_license
import numpy as np from flask import Flask, request, jsonify from sklearn.externals import joblib app = Flask(__name__) model = joblib.load(open('/home/dwiindraloka/mysite/rf.pkl','rb')) @app.route('/api',methods=['POST']) def predict(): # Get the data from the POST request. datas = request.get_json(force=Tr...
true
14a08d25fa90c4d5ed707acb4a125f40592c71ee
Amiao-miao/all-codes
/month01/day17/common_homework/homework02.py
UTF-8
1,995
4.15625
4
[ "Apache-2.0" ]
permissive
""" 需求: 定义函数,在员工列表中查找员工编号最小的员工 定义函数,在员工列表中查找薪资最少的员工 步骤: 1. 根据需求,写出函数。 2. 因为主体逻辑相同,核心算法不同. 所以使用函数式编程思想(分、隔、做) 创建通用函数get_min(定义到单独模块中) 3. 在当前模块中调用(使用lambda) """ from iterable_tools import IterableHelper class Employee: def __init__(self, eid, did, na...
true
35396da260cca534b01b928c01123e4eda919386
shixish/CS-440-Program-4
/dataRun.py
UTF-8
1,523
2.515625
3
[]
no_license
#!/usr/bin/python import datetime import ivspSolver from ivspSolver import * grlog = galog = anlog = comblog = "" print "Running until keyboard interupt..." while(True): for cnn in [.05, .1, .15, .2]: g = Graph(100, cnn) g.fitfunc = g.connFitness # Greedy before = datetim...
true
2cc270490ada6463e160b6c9d782388d3bb1618f
stevengeeky/rock-cnn
/demos/include/loader.py
UTF-8
11,982
2.5625
3
[ "MIT" ]
permissive
from PIL import Image import numpy as np import random import io, os, sys limit_size = 2 * 3 * 5 * 7 # Rocks used for testing (numbered 1-360) vals = [6, 14, 34, 39, 59, 69, 73, 95, 102, 119, 127, 144, 151, 164, 172, 188, 201, 213, 218, 237, 250, 263, 267, 284, 300, 309, 314, 336, 348, 352] # Correction of the hithe...
true
90e41285eac222eace8e36636a4d8e7e9d16d9b7
Amir0715/2020-2-Atom-QA-Python-A-Kamolov
/hw1/fixtures/some_fixtures.py
UTF-8
297
3.046875
3
[]
no_license
import random import pytest import string @pytest.fixture(scope='class') def random_value(): yield random.randint(1, 1000) @pytest.fixture() def random_string(): def rand_str(n): return ''.join( [random.choice(string.ascii_lowercase) for i in range(n)]) yield rand_str(10)
true
e2e745b6dfd1076142f08cd06d6a7b906320f96b
LakshmiBoga7/Assignment
/Assignment/3sender.py
UTF-8
308
2.78125
3
[]
no_license
import socket import sys s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) print("server socket created") host='127.0.0.1' port=6000 s.bind((host,port)) while True: data,addr=s.recvfrom(1024) print("received data from {1} and {2}",data,addr) s.sendto(data,addr) s.close()
true
3be0046b27bb5b16e877cd92b1cd46d3b43337a9
matiasb/simplestats
/server/tests/test_datastore.py
UTF-8
544
3.140625
3
[]
no_license
import unittest from server.datastore import DataStore class DataStoreTestCase(unittest.TestCase): def setUp(self): self.datastore = DataStore() def test_add_value(self): """The values are added under the series name key.""" self.datastore.add_value('name', 123456789, 42) sel...
true
6ce98dde53c310ec6403c8e252ad6d89fd463b2c
hyun98/python
/알고리즘/수학/택시 기하학.py
UTF-8
230
3.625
4
[]
no_license
pi = 3.141592653589793238462643383279 def euclid(r): area = r*r*pi print(f"{area:.6f}") def taxi(r): area = 2*r*r print(f"{area:.6f}") if __name__=="__main__": r = int(input()) euclid(r) taxi(r)
true
26fb4df58abbef0ffdade820c097dae9b173b6e3
Draft2007/Scripts
/root/Desktop/Scripts/Python Forensic Scripts/Test/python/pHashAndCollectMeta/_pHashAndCollectMeta.py
UTF-8
9,022
2.84375
3
[]
no_license
# # pfish support functions, where all the real work gets done # # Display Message() ParseCommandLine() WalkPath() # HashFile() class_CVSWriter # ValidateDirectory() ValidateDirectoryWritable() # import os #Python Standard Library - Miscellaneous operating system interfaces import stat ...
true
231b00a425eb15c26bb165ceab76d031d3dc1fb4
fgksgf/NLP-Wheels
/measures/entropy.py
UTF-8
1,592
3.1875
3
[ "MIT" ]
permissive
import math from collections import Iterable def h(p, base=2): return - p * math.log(p, base=base) def entropy(p, base=2): """ :param p: :param base: :return: """ ret = 0.0 if isinstance(p, Iterable): for item in p: ret += h(item, base) else: ret = h(...
true
40686e75eaa7aead2adce4b3b4a95dc4e17673f3
anantraut/me_indicators_automation
/me_indicators_automation/case_form.py
UTF-8
5,450
2.875
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 23 10:52:54 2020 @author: anant """ import pandas as pd class CaseForm: def __init__(self, filepath=None, cols=None, filetype=None): self.filepath = filepath self.cols = cols if self.filepath is not None: if...
true
79bef8939c681af2e7c5bbd6bc9aa9494851658e
noodlezen/python_project_learn
/day1/task/day1_task_v2_180204.py
UTF-8
2,525
3.03125
3
[]
no_license
#!/usr/bin/env python #_*_ coding:utf-8 _*_ import os print ''' ||========================|| ||<<<<<<<<欢迎光临>>>>>>>>|| ||>>>>>>>>登入接口<<<<<<<<|| ||========================|| v2.0 ''' flag_1 = input("1.创建新用户\n2.用户登入\n请选择:") flag_1_2 = 1 while flag_1_2 != 'n': if flag_1 == 1 : user_nam...
true
63b95306b2657ff4c74f1911411e03c86fe1c794
Rathal/MachineLearning
/Assignment/Code/Task1.py
UTF-8
5,081
3.5
4
[]
no_license
import pandas as pd import numpy as np import matplotlib.pyplot as plt ##Get Polynomial Data Matrix given coordinates and degree def get_poly_data_matrix(x, degree): X = np.ones(x.shape) for i in range(1, degree+1): X = np.column_stack((X, x**i)) return X ##Get Weights/Parameters given coorinates...
true
06141a1e474f9d66669d21534f44a5d8a9163b68
who-knows-who/aoc-2019-python
/day10.py
UTF-8
1,631
3.296875
3
[]
no_license
from util import get_input, print_answer, gcd from math import degrees, atan2, sqrt, inf from collections import defaultdict def get_directions(asteroid): directions = defaultdict(lambda: {"location": None, "distance": inf}) for a in asteroids: if a != asteroid: # y = 0 at top so invert y ...
true
652ec61e55f867560ab36a82792c86b7ef6e3da5
jaymo2004/MNO_YKT
/randomPassword.py
UTF-8
702
3.53125
4
[]
no_license
# coding=utf-8 import random setAll = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+=-" setNumChar = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" passwordArray = [] print ("1.只包含大小写字母") print ("2.包含大小写字母与特殊符号") passType = input("请选择密码类型(选择1 或 2):") length=input("请输入所需密...
true
16b57fa477d79fcd2182c9fec82b321fe1503442
toyo97/AoC2018
/10_Point_Message/Points.py
UTF-8
1,720
3.0625
3
[]
no_license
import numpy as np # per vettori posizione e velocità import scipy.misc as smp # per disegnare immagine import matplotlib.pyplot as plt def next_step(P): P[:, 0, :] = P[:, 0, :] + P[:, 1, :] def scale(P, Pl): return P[:, 0, :] - Pl s = [] for line in open('input.txt', 'r'): s.append(line.strip()) ...
true
ec3f664a68bfe98983268508032132a6263c4a84
oskip/IB_Algorithms
/CtCI/7.7.py
UTF-8
742
3.59375
4
[]
no_license
def kthNumber(k): x = 3 y = 5 z = 7 for step in range(k - 1): moreX = 3 * x * y * z moreY = x * 5 * y * z moreZ = x * y * 7 * z if moreX <= moreY and moreX <= moreZ: x *= 3 elif moreY < moreX and moreY <= moreZ: y *= 5 elif moreZ < ...
true
b718a9a6eadad367354f6e9b12e99793b214530d
remmarp/change-point-detection-in-a-sequence-of-bags-of-data
/util.py
UTF-8
3,372
2.96875
3
[]
no_license
# -*- coding: utf-8 -*- # """ # util.py # Helper function for change detection. # """ ########## # IMPORT ########## # 1. Built-in modules import random # 2. Third-party modules import numpy as np from scipy.stats import wasserstein_distance # 3. Own modules ############## # DEFINITION ############## def his...
true
d29bc365f05eb77ed1c44c503cd14baabb22a114
cvva/RepasoPython
/ClasePythonPOO/ejem06.py
UTF-8
339
3.640625
4
[]
no_license
#Clases, Objetos y Encapsulamiento class Persona: def __init__(self, cod, name, age): self._codigo=cod self._nombre=name self.__edad=age def saludar(self): print("Hola "+ self.nombre) jose = Persona(1,"Juan",25) print(jose._codigo) print(jose._nombre) print(j...
true
c9b6dc7cd864541e41c5a08b49883d3d5d03af93
amitnyc83/perspective
/python/perspective/perspective/table/view_config.py
UTF-8
3,736
2.75
3
[ "Apache-2.0" ]
permissive
# ***************************************************************************** # # Copyright (c) 2019, the Perspective Authors. # # This file is part of the Perspective library, distributed under the terms of # the Apache License 2.0. The full license can be found in the LICENSE file. # class ViewConfig(object): ...
true
ed70ca6aee141e48e5dfba4ff7c3057fa52c4be0
syedshameersarwar/python
/min_heap.py
UTF-8
2,578
3.609375
4
[]
no_license
import sys class MinHeap: def __init__(self,capacity): self.capacity = capacity self.size = 0 self.list = [] def parent(self,index): return (index-1)//2 def left(self,index): return (2*index)+1 def right(self,index): return (2*index)+2 def ...
true
c10272979a13515e619c225371af6b00b72f442b
TheusZer0/ctf-archives
/Imaginary/2021/misc/Mazed/maze.py
UTF-8
4,638
3.015625
3
[ "MIT" ]
permissive
#!/usr/local/bin/python -u from random import choice from copy import deepcopy # https://pypi.org/project/timeout-decorator/ import timeout_decorator class Maze: def __init__(self, dim, size): self.dim = dim self.size = size self.maze = '#' self.loc = tuple([0]*dim) for i i...
true
b2c5fb10fb2ef9c3dccea2d286fd068babe8303d
Orbittman/FFEngine
/FFEngine/GameParser.py
UTF-8
455
2.796875
3
[]
no_license
import json from collections import namedtuple class Enum(set): def __getattr__(self, name): if name in self: return name raise AttributeError Formats = Enum(["dict", "tuple"]) def _json_object_hook(d): if "format" in d: if d["format"] == Formats.dict: return ...
true
4391df0559f5504e2e31a9b16c0c044caa2de46f
elkira01/Association-Rules-PHP
/utils.py
UTF-8
444
2.953125
3
[]
no_license
import math def split(str): l=[] for s in str: l.append(s) return l def arr(n,k): return math.comb(n,k)*math.factorial(k) def append(l,a): l.append(a) s=set(l) l=list() for e in s: l.append(e) return l def cass(s,l=list()): l.remove(s) return l def list_c...
true
d8e51ceadef5c116c247afd296ba81f60dfe7c79
DeDryverC/PythonProject
/Module_PacDuel/MenuGen.py
UTF-8
7,226
3.609375
4
[]
no_license
import curses class Menu: """ Class : Menu Author : C. De Dryver Cette classe permet d'afficher un menu ou l'on peut choisir le mode que l'on veut, c'est a dire on a le choix du gamemode (solo ou duo), le choix de voir la page des score (TODO), gerer les paramètre grace aux setti...
true
e16a0386ce9a38823c3f865464c044d770e08db3
AlexKrasnov/polynomial
/polynomial.py
UTF-8
10,453
3.265625
3
[]
no_license
import numpy as np import math class Polynomial: def __init__(self, p): self.__polynomial = [] self.polynomial = p def __call__(self, p): self.__polynomial.clear() self.polynomial = p @property def polynomial(self): return self.__polynomial @polynomial.se...
true
fd562e72a02182d1022050c79b7b56a88040860b
LeonDong02/contest-solutions
/DMOJ/CCC/Telemarketer or not.py
UTF-8
151
2.875
3
[]
no_license
digits = [int(input()) for i in range(4)] if digits[0] > 7 and digits[3] > 7 and digits[1] == digits[2]: print('ignore') else: print('answer')
true
216888bd0cd6479f8a17bd147bd6452e7e1205e4
plasmatic1/archived-projects
/Other Python/rationalform.py
UTF-8
1,546
3.25
3
[]
no_license
from supersub import * class Rational: def __init__(self, nml=1, root=1, pwr=2): self.nml=nml self.root=root self.pwr=pwr def simplify(self): trt=self.root for i in range(2,self.root): poff=0 while trt%i==0: poff+=1 ...
true
c9b12bb9202e93a295ef02e40f101aa4adf8c3f1
Ehotuwe/Py111-praktika1
/Tasks/c2_recursive_binary_search.py
UTF-8
892
4.34375
4
[]
no_license
from typing import Sequence, Optional def binary_search(elem: int, arr: Sequence) -> Optional[int]: """ Performs binary search of given element inside of array (using recursive way) :param elem: element to be found :param arr: array where element is to be found :return: Index of element if it's p...
true
4a47c71a7f2f6487f19cdf00af6da6ee5966f912
RickyVu/SardineROV
/controlbox/Test.py
UTF-8
2,446
2.625
3
[]
no_license
''' from pubsub import pub from ModuleBase import Module class Thruster(Module): def __init__(self, name, address, invert): self.name = name self.address = address self.invert = invert pub.subscribe(self.__listener, name) self.target_power = 0 self.curre...
true
bb6c5973055bf42a812553804f06e79c2be2d5b8
Pseudomanifold/Skeleton_Persistence
/dtw_distance.py
UTF-8
1,412
3.453125
3
[ "MIT" ]
permissive
#!/usr/bin/env python3 # # Simple implementation of dynamic time warping for two curves. This # follows the implementation given in # # https://en.wikipedia.org/wiki/Dynamic_time_warping # # with the addition of making the distance functor configurable. # # Usage : dtw_distance.py FILES # Output: matrix of distances ...
true
56586fabf43523a995c33ef4e0b9fc15d967834e
kaoboyandy/Self_driving_car
/ai.py
UTF-8
10,958
3.671875
4
[]
no_license
# AI for Self Driving Car ## for autocpmplete: pip uninstall enum34 # Importing the libraries import numpy as np import random import os import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.autograd as autograd from torch.autograd import Variable # Creating the a...
true
bf6433171987e726cc292ac946ccf13a6f4a2443
sjdeak/interview-practice
/contest/kickstart/practice/18A-even-digits/main.py
UTF-8
1,600
2.8125
3
[]
no_license
import os import sys class CustomException(Exception): pass if os.getenv('SJDEAK'): sys.stdin = open(os.path.expanduser('./in-large.txt')) # sys.stdout = open(os.path.expanduser('./out-large.txt'), 'w') from icpc_util import dump_args else: debug = lambda *args, **kwargs: None dump_args = lambda func: fun...
true
102f3cd865f7bc87af99d6442fe4986f4316ccc2
Ikuyadeu/comment_research
/GetReview.py
UTF-8
1,217
2.671875
3
[]
no_license
################## # Author:Ueda Yuki # CreatedOn: 2015/10/14 # Summary: This program is to count current judge and incurrent judge. ################## #comment is not correct ### Import lib import sys import MySQLdb from collections import defaultdict # set original ReviewNum argv = sys.argv argc = len(argv) if arg...
true
0cf8f3bf7662e08e7bb8e6544badc023988540f2
Aasthaengg/IBMdataset
/Python_codes/p02789/s554733835.py
UTF-8
83
3.375
3
[]
no_license
a = input().split() b = a[0] c = a[1] if b == c: print("Yes") else: print("No")
true
c1fd746f45abb4e75c4f785b6022f55516a618cd
yejianye/programming-problems
/euler/problem102.py
UTF-8
845
3.15625
3
[]
no_license
def isContainOrigin(x1, y1, x2, y2, x3, y3): vertex = [(x1, y1), (x2, y2), (x3, y3)] param = [ x1 == x2 and 'special' or (y1 - y2) * 1.0 / (x1 - x2), x1 == x3 and 'special' or (y1 - y3) * 1.0 / (x1 - x3), x2 == x3 and 'special' or (y2 - y3) * 1.0 / (x2 - x3)] for i in range(3): # y = ax all_signs = ...
true
b85059f25b51a239b963912766237f54a407fe2b
taeyoungchoon/t-shell
/python/stdin.py
UTF-8
90
2.609375
3
[]
no_license
#!/usr/bin/env python3 import sys for line in sys.stdin: print(f"{line.rstrip()}")
true
2244d03f78c5469f8964b690e72741c1e9f88402
idaholab/raven
/ravenframework/contrib/pyDOE/doe_factorial.py
UTF-8
7,190
3.21875
3
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer", "BSD-2-Clause", "BSD-3-Clause" ]
permissive
""" This code was originally published by the following individuals for use with Scilab: Copyright (C) 2012 - 2013 - Michael Baudin Copyright (C) 2012 - Maria Christopoulou Copyright (C) 2010 - 2011 - INRIA - Michael Baudin Copyright (C) 2009 - Yann Collette Copyright (C) 2009 - CEA - Jean-Ma...
true
c3b1b2570de9963b147bd465deaa010d91a48dff
Aksh07/Compiler-Construction
/Neutron/ErrorParserTable.py
UTF-8
11,771
2.671875
3
[]
no_license
import sys import pandas as pd import numpy as np from IPython.display import display first = [[";","void","char","short","int","long","float","double","string"], ["void","char","short","int","long","float","double","string"], ["Name"], ["void","char","short","int","long","float","double","string"], ["void","...
true
43288eb1ab359d77fde442412c6171f857e77a28
Charlie-kun/Python3-fundation
/DayStudy/FileSaveLoad.py
UTF-8
2,220
3.59375
4
[]
no_license
''' File write, read File save, load ''' ''' import os print(os.getcwd()) # Current Working Directory check. ''' ''' #file write s="""Its power : Python developers typically report they are able to develop applications in a half to a tenth the amount of time it takes them to do the same work in such languages as C....
true
f1967ff6092c6774123637a7403a060241990c11
kinokoberuji/Statistics-Python-Tutorials
/KMC_demo/constants.py
UTF-8
1,253
2.53125
3
[]
no_license
import os df_link = 'https://vincentarelbundock.github.io/Rdatasets/csv/Stat2Data/Fertility.csv' col_names = {'Age':'Tuổi', 'LowAFC': 'Số nang nhỏ nhất', 'MeanAFC': 'Số nang trung bình', 'FSH': 'Đỉnh FSH', 'E2':'Mức sinh sản', 'MaxE2':'Mứ...
true
cecc175c8754852047f3407466fb1ce18cb59046
MathBosco/exPython
/Ex007.py
UTF-8
277
4
4
[]
no_license
#Enunciado #Desenvolva um programa que leia as duas notas de um aluno, calcule e mostre a sua média. n1 = float(input('Insira a primeira nota: ')) n2 = float(input('Insira a segunda nota: ')) media = (n1 + n2)/2 print('A média aritmética das notas é: {}'.format(media))
true
d91c50b30d48f40bfc5f3c1f203bb7a4a223ad60
Syn-Tax/transformer-aem
/process_data.py
UTF-8
4,390
2.609375
3
[]
no_license
import docx2txt import random import re import os import codecs import pandas as pd import tika tika.initVM() from tika import parser def get_marks(csv, name): name = name.split(" ") try: index = list(csv["Surname"]).index(name[-1]) except: try: index = list(cs...
true
3c031e8969a46bd809697f358a2550de8bf5fabe
iamkvv/forstudents
/lecture_01_12.py
UTF-8
4,160
3.4375
3
[]
no_license
import string,random,re '''Поиск подстроки''' '''Задача в pythontutor.ru Найдите в строке второе вхождение буквы f, и выведите индекс этого вхождения. ''' def tutor_solution(): '''Решение разработчиков''' s = 'ofofofofofofofofo' if s.count('f') == 1: print(-1) elif s.count(...
true
827572051990191322a91ed7001f711b992cf075
yeonvly819/PythonAlgorithm
/Phase 3/210705_다트게임.py
UTF-8
1,570
3.15625
3
[]
no_license
#%% # 2nd try import re def solution(dartResult): answer = 0 score_split = re.compile('\d+[A-Z][*#]?').findall(dartResult) score = [] for i in score_split: num = int(re.compile('\d+').findall(i)[0]) section = re.compile('[A-Z]').findall(i)[0] reward = re.compile('[*#]+').finda...
true
5fab561fc780840f47b6aa978b1b5bb2a7357001
nhamlv-55/hde
/HDE.py
UTF-8
477
3.203125
3
[]
no_license
sum=0 def func1(n): global sum if n==0: return else: process_a_line() n-=1 func1(n) def process_a_line(): n=int(raw_input("")) input = raw_input("").split() print compute(n, 0, input) def compute(n, i, input): if i==n-1: if int(input[i])>0: return int(input[i])**2 else: return 0 else: if i...
true
775ae6937a731ff27b638eb0ed494cde9d690bcd
tankorsmash/opencept
/dataset.py
UTF-8
2,344
3.03125
3
[]
no_license
import xlrd from collections import OrderedDict from cards import CreatureCard, EmptyCardRow class RowMap(object): def __init__(self): self._row_map = OrderedDict() def at(self, idx): return self._row_map.get(idx) class Sheet(object): def __init__(self, sheet): self.sheet = sh...
true
622e11e7d88ddf8c6cf0f3c7033277db5b7c6272
pragyatwinkle06/Python_patterns_and_codes
/pattern1.py
UTF-8
763
3.40625
3
[]
no_license
#pattern 1 n=int(input("enter a no")) s=n for a in range(n,0,-1): for l in range(n,0,-1): if (a==s or l==s )and l<=s: print(s,end="") else: print(l,end="") for p in range(2,n+1): if (a==s or p==s )and p<=s: print(s,end="") else: ...
true
6ab2a83119b5925bd9bce9f17168c322faaf17ee
Abdulkadir78/Python-basics
/q28.py
UTF-8
356
4.15625
4
[]
no_license
''' Write a program to compute: f(n) = f(n-1)+100 when n > 0 and f(0) = 1 with a given n input by console(n > 0). Example: If the following n is given as input to the program: 5 Then, the output of the program should be: 501 ''' def f(n): if n == 0: return 1 else: return f(n - 1) + 100 n = ...
true
92296395975e7975bb23158dda7e2b663af3f2d2
furas/python-examples
/__scraping__/douglascollege.ca - selenium, BS/main-1-selenium-BS.py
UTF-8
590
2.8125
3
[ "MIT" ]
permissive
# author: https://blog.furas.pl # date: 2020.07.09 # https://stackoverflow.com/questions/62805708/how-can-i-get-a-data-from-specific-text-in-div-class-using-a-beautifulsoup/ import selenium.webdriver from bs4 import BeautifulSoup url = "https://www.douglascollege.ca/programs-courses/catalogue/programs" driver = sel...
true
b2d263d555c4fe79e79cc4f01e422c3a60261d21
buxeasywork/elegion-django-project-template
/core/templatetags/numeric.py
UTF-8
763
3.109375
3
[]
no_license
from django.template import Library from django.utils.safestring import mark_safe register = Library() @register.filter(name='sign') def add_sign_and_class(value, add_sign=False): """ Wraps a number with a <span class="positive|zero|negative">%d</span>. And optionaly prints a positive sign (+) in front o...
true
031fcb305f412bedc6cb229e9716f157e069278c
ajonjoli/python2.7
/Stepic/stepic_18GreedyMotif.py
UTF-8
2,526
2.859375
3
[]
no_license
# coding=utf8 # GreedyMotifSearch: Motif Finding Algorithm based on greedy search # for every k-mer in first string, select the best k-mer in 2nd string # then from those 2 k-mers select the best k-mer in 3rd string and go on till the last string # keep the set of k-mers with BestScore # Dna: list of strings, k: size ...
true
5585803bf756de95e4100f471552b4e7a93de756
avengerryan/daily_practice_codes
/four_sept/programiz/two.py
UTF-8
635
4.1875
4
[]
no_license
# adding 2 numbers # num1=1.5 # num2=6.3 # # sum=num1+num2 # # print('the sum of {0} and {1} is {2}'.format(num1, num2, sum)) # Adding 2 numbers with user input # num1=input('enter first number: ') # num2=input('enter second number: ') # num1=float(input('enter first number: ')) # num2=float(input('enter second ...
true
a83ef40afe5de5a9eced0507eb2c898aeff06b4f
Rootmen/Helper
/Helper/db_access/Main.py
UTF-8
3,144
2.5625
3
[]
no_license
import mimetypes import os import sqlite3 from django.http import HttpResponse from xlsxwriter import Workbook GenderMass = ["женский", "мужской"] # Функция создания базы данных, запускать только один раз при ее создании def First_Init(): conn = sqlite3.connect(os.path.abspath("Helper\db_access\db_s.d...
true
e909dc5d309adeb939e64a8b35ce6f8e56521d2c
JosephItopa/SimpsonsParadox
/main.py
UTF-8
3,258
2.734375
3
[ "MIT" ]
permissive
import argparse import pandas as pd from simpsons_paradox import SimpsonsParadox def main(): parser = argparse.ArgumentParser(description="Find Simpson's Pairs") parser.add_argument('-input_file', required=True, help='input CSV file with analysis ...
true
fe6f2b4b26e816e42d85b218dfd94cf83bb7f456
cgnorthcutt/veneer
/veneer.py
UTF-8
1,475
3.015625
3
[]
no_license
# coding: utf-8 # In[ ]: #!/usr/bin/python3 # In[ ]: from __future__ import print_function # In[ ]: import datetime import random import os # In[ ]: fn = 'veneer.txt' sunday_write_frac = 0.75 months = ["Jan", "Feb", "March", "April", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec"] months = di...
true
6f2fac9a19ba05e1206752c0c132d2db94660df2
WindDrifter/practising_algorithms
/sorting/python/quicksort.py
UTF-8
307
2.953125
3
[]
no_license
# def quick_sort(array): # pivot = array[len(array)/2] # # # if len(array) <= 1: # return array # smaller = [x for x in array[1:] if x < pivot] # larger = [x for x in array[1:] if x > pivot] # return quick_sort(smaller) + array[0] + quick_sort(larger) # # def partitaion(array):
true
72e0a1e7204edc95bd0af480405e185d70093e99
taivy/Python_learning_projects
/Tkinter/events.py
UTF-8
547
3.21875
3
[]
no_license
from tkinter import * root = Tk() def change(): t['width'] = int(e1.get()) t['height'] = int(e2.get()) def focus_out(event): t['bg'] = 'lightgrey' def focus_in(event): t['bg'] = 'white' frame = Frame(width=10) frame.pack(side=TOP) e1 = Entry(frame) e2 = Entry(frame) b = Button(frame, text='Измени...
true
34eca6c8773263ae7cc642bd11666b6f39e68e6c
939147533/ARIMA
/HFDM_Arima_Main.py
UTF-8
1,611
2.578125
3
[]
no_license
import pandas as pd from datetime import datetime from util import timeseries_plot, config_plot from myArima import * config_plot() parse_dates = [['Date', 'Time']] train_file = '../HFDM/广东省/广东-周-发病人数-分地区 - 矫正后 - 副本.xlsx' test_file = '../HFDM/广东省/gd2019.csv' train_GD = pd.read_excel(train_file) test_GD = pd.read_csv(...
true
73867cc8987af9278b88b448daa8657bb57cdedf
KenAdeniji/WordEngineering
/IIS/WordEngineering/Python/WesMcKinney.com/wesmckinney.com_-_2022-05-10T1635NumPyArraysPentateuch.py
UTF-8
1,220
3.625
4
[]
no_license
import numpy as np import pandas as pd #pip install pandas bibleBooksTitles = ['Genesis', 'Exodus', 'Leviticus', 'Numbers', 'Deuteronomy'] bibleBooksChapters = np.array([50, 40, 27, 36, 34]) #Bible books chapters bibleBooksVerses = np.array([1533, 1213, 859, 1288, 959]) #Bible books verses bibleBooksChaptersVerses = ...
true
a203ff327bfd99b8fbc2added6ac55c289be4302
Jacoab/pollutionstation
/read.py
UTF-8
490
2.78125
3
[]
no_license
import time import board from busio import I2C import adafruit_bme680 i2c = I2C(board.SCL, board.SDA) bme680 = adafruit_bme680.Adafruit_BME680_I2C(i2c,debug=False) bme680.sea_level_pressure = 1013.25 for i in range(10): print("\nTemperature: %0.1f C" % bme680.temperature) print("\nGas: %d ohm" % bme680.gas) p...
true
736e19e6e950b466c1624ff6e1b9717301f14835
yuanjunling/UnittestCaseDemo
/Study/string_01.py
UTF-8
63
2.6875
3
[]
no_license
print("hhh \\n world") c="b" print("{0} in {1}".format("a",c))
true
e79e5b3da33aa3a33b8f9ee99d32213a1076585f
joaogui1/Minicurso_python
/generators.py
UTF-8
356
4.03125
4
[]
no_license
#iterator function def squares(nums): for i in nums: yield (i*i) small_squares = squares([1, 2, 3, 4, 5]) small_squares = (x*x for x in [1, 2, 3, 4, 5]) # for sq in small_squares: # print(sq) # def fib(n): a, b = 0, 1 for _ in range(n): a, b = b, a + b yield a fib_seq = fib(...
true
1c34c1eb6a8463012f780faf58bc06fd4c6aa6d8
zhyw86/2018Summer
/ann_note.py
UTF-8
2,715
2.765625
3
[]
no_license
from collections import Counter import seaborn as sns import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.neural_network import MLPClassifier import matplotlib.pyplot as plt #from imblearn.under_sampling import TomekLinks features = pd.read_csv('neiss_20180620.csv'...
true
d82eda5da07f82a2ecfde5c8834550916dccaa99
bobdoah/gphotos-cl
/gphotos_cl/albums.py
UTF-8
3,332
2.65625
3
[]
no_license
import datetime from xml.etree import ElementTree import click import tabulate from .authorized_session import get_session_from_authorized_user_file, GOOGLE_AUTHORIZED_USER_FILE from .namespace import GPHOTO_XML_NS GOOGLE_PICASAWEB_ALBUMS_URL = 'https://picasaweb.google.com/data/feed/api/user/default?fields=entry(i...
true
80050bd4205c05728e8fba7d6378dd6c0a351727
SemihDurmus/Python_Helper
/2_Codes/Assignment_6_Profit.py
UTF-8
1,267
4.34375
4
[]
no_license
# Assignment_6_Profit """ Task - 1 : You work for a manufacturer as a programmer and have been asked to calculate the total profit made on the sales of a product. You are given a dictionary (sales) containing the cost price per unit (in dollars), sell price per unit (in dollars), and the beginning inventory. Write a...
true
c270384ff939302c9d6093cc554d5200f7f68f94
xiaocy91/workproject
/wxpyTest/template/boxmain.py
UTF-8
4,526
2.625
3
[]
no_license
#-*- coding:utf-8 -*- import wx from wx import MenuItem, NO_BORDER from view.boxevent import * from wx.lib.sized_controls import border import Image class BoxPanel(wx.Panel): topmap = [{"name":"online parse","func":onlineParseEvent}, {"name":"offline parse","func":printfunc}, {"name":...
true
6fb9caf45cd2768b2198f7f85266962b15b49239
nus-sps/workshops.tfi.data-visualisation
/my_functions.py
UTF-8
4,783
2.8125
3
[]
no_license
import copy import glob import os import re from pygments import highlight from pygments.formatters import HtmlFormatter from pygments.lexers import PythonLexer tag_output_file = '__my_python_output__' class My_Section: heading = None def __init__(self, filename, section_text): # section_text = sec...
true
fc6f4f0c722eb784b3d82aa2cbd777f9d673497b
RKGoel/src
/wave_reconstruct.py
UTF-8
1,678
2.6875
3
[]
no_license
from scipy.io import wavfile import matplotlib.pylab as plt import numpy as np def flip(nb_phase): wb_phase = np.empty(nb_phase.shape, dtype=np.float32) for i in range(nb_phase.shape[0]): wb_phase[i, :] = list(reversed(nb_phase[i, :])) return wb_phase """ Reconstruct audio signal based on magnitud...
true
8d6fbffe9bda6f1c4a56e4bc12495d9fc2b1166e
yuxng/Deep_ISM
/ISM/lib/utils/voxelizer.py
UTF-8
7,829
2.75
3
[ "MIT" ]
permissive
# -------------------------------------------------------- # FCN # Copyright (c) 2016 # Licensed under The MIT License [see LICENSE for details] # Written by Yu Xiang # -------------------------------------------------------- from ism.config import cfg import numpy as np class Voxelizer(object): def __init__(self...
true
0360379a10c429d20372765450347eeb3cb6a9ee
ssxgit/Semantic-Textual-Similarity-master
/model/FeatureExtract.py
UTF-8
13,668
2.75
3
[]
no_license
from sklearn.feature_extraction.text import CountVectorizer from sklearn.decomposition import LatentDirichletAllocation from sklearn.feature_extraction.text import TfidfTransformer from sklearn.metrics.pairwise import cosine_similarity from sklearn import preprocessing from nltk.stem import WordNetLemmatizer from nltk ...
true
017f38ce5694539ccdeb3137e5e3432cbac2a6fc
Arcanist13/LinearCode
/codex.py
UTF-8
357
2.75
3
[]
no_license
#Takes codex and converts to a transition factor def LinExt(codex): ListCode = list(codex) if len(ListCode) != 7: return False elif len(ListCode) == 7: pass op = 0 if ListCode[1] == 'a': op = '' elif ListCode[1] == 's': op = '-' else: return False tranTemp = op + str(ListCode[2]) + str(ListCode[5...
true
850263fe91179613162cde38f0083613d537cd1b
qiao-zhang/leetcode_problems
/algorithms/_189_rotate_array.py
UTF-8
503
3
3
[]
no_license
class Solution(object): def rotate(self, nums, k): """ :type nums: List[int] :type k: int :rtype: void Do not return anything, modify nums in-place instead. """ l = len(nums) if l <= 1: return r = k % l if r <= l // 2: r...
true
9c43f2fbda18a9faa6ca4706f8442ed374016f08
joshivivek67/Python_pratice
/capture7.py
UTF-8
80
2.984375
3
[]
no_license
def new_even(a_list): return [even for even in a_list if even % 2 == 0]
true
08a3a76732794aad2d7aed7ce08d75ddfe205dd3
TheEliasBe/AmsterdamUniversityDataScienceChallenge
/Main.py
UTF-8
1,957
3.78125
4
[]
no_license
import xml.etree.ElementTree as ET # for parsing the xml file import re # use regex to clean the document import inflection # library to convert import matplotlib.pyplot as plt # for create the histogram class Assignment: def part1(self, filename): # read xml file with open(filename, "r") as file...
true
32d31c728fdf4cc6f239c2939d2d86156ed4f37c
gbbbstrv/weibo_forecast
/src/main.py
UTF-8
1,927
2.609375
3
[]
no_license
import os from datetime import * import time from sort import * from split import * from features import * from predict import * from score import * delimiter = "\t" def dataset_input(weibo_train_file_path,weibo_predict_file_path): weibo_train_file = open(weibo_train_file_path) dataset_train = list(weibo_trai...
true
199314ba59a8b2b0bae16247ec8a37e17695a0df
BBlack-Hun/DataAnalyesis_study
/data14.py
UTF-8
3,922
3.71875
4
[]
no_license
#%% import matplotlib.pyplot as plt import numpy as np from numpy.core.defchararray import replace from numpy.lib.function_base import append t = np.arange(0. , 5, .2) plt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^') plt.show() # %% import matplotlib.pyplot as plt t = [] p2 = [] p3 = [] for i in range(0, 50, 2): ...
true
6e58299a373f4be6bc041b8ebbb8ec1f5502562f
JaydevVadachhak/Python-Basics
/3_Conditionals_Fun_Modules/Functions/Function_2.py
UTF-8
101
3.5
4
[]
no_license
def print_name(name): print("hi {}".format(name)) name = input("Enter name:") print_name(name)
true
6ea9324c5a21d388402f24dada5986910c7afd45
ypshiga/streamlit-framework
/milestone_app.py
UTF-8
2,989
2.953125
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # In[ ]: # test stock API # Your API key is: IRC9K9I0TMTQZPK7 import requests import pandas as pd import numpy as np import streamlit as st import time from datetime import datetime import os import plotly.express as px st.title('12 day Milestone Ticker app') st.write('Stock d...
true
18b0ccae380b788035dfdea9584d6dad7ee74d4a
Telefonica/avro-random-generator
/lib/merge-schemas.py
UTF-8
1,735
2.6875
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/python import sys import getopt import json from deepmerge import Merger field_merger = Merger( [ (list, ["override"]), (dict, ["merge"]) ], ["override"], ["override"] ) def merge_list(merger, path, base, nxt): extensions = dict((d['name'], dict(d, index=index)) for (i...
true
1f9604266d622e2927fadd3419baf06c016ddf7c
s-andromeda/Competitive-Coding-11
/RemoveKDigits.py
UTF-8
1,418
3.546875
4
[]
no_license
class Solution: """ Name : Shahreen Shahjahan Psyche Language Used : Python Time : O(N) Space: O(N) Passed All The Test Cases in LC : Yes Approach : # Data Structure : Stack # Its a greedy approach ...
true
00abbf94bdaf7222ece8d7ba14da168839890f6b
HelloMyFriend-o/Weathergetabot
/handlers/changecity/change_city.py
UTF-8
3,562
2.828125
3
[]
no_license
import requests from aiogram.dispatcher import filters from aiogram import types import keyboards as kb from loader import dp, APPID from database.db import connect_to_db # Triggered when user sends a message that starts with the word "город". @dp.message_handler(filters.Text(startswith='город', ignore_case=True)) ...
true
6e4c3e1d9eabdda390365a04f72083e1a3832391
hallyourbase/bokeh
/examples/plotting/file/image_alpha.py
UTF-8
755
3.15625
3
[]
permissive
import numpy as np from bokeh.plotting import figure, show, output_file N = 500 x = np.linspace(0, 10, N) y = np.linspace(0, 10, N) xx, yy = np.meshgrid(x, y) d = np.sin(xx)*np.cos(yy) d[:125, :125] = np.nan # Set bottom left quadrant to NaNs p = figure(x_range=(0, 10), y_range=(0, 10)) # Solid line to show effect...
true
2d3c336c68cebaf8d499ef18a4fd3604c929f98f
maggieaschneider/ACTUALHACK
/menu.py
UTF-8
3,107
3.203125
3
[]
no_license
from tkinter import * class menu(Frame): def __init__(self, master): super().__init__(master) self.grid() self.total = 0 self.create_widgets() self.drinks = ["water", "lemonade", "soda"] self.foods = ["chicken", "pasta", "salad"] self.desserts = ["Ice Cream", "Lava C...
true
a263108d81c79c54c66f8b647937bee78c8a4825
egalli64/pythonesque
/hr/algorithms/implementation/cats_mouse.py
UTF-8
612
3.75
4
[]
no_license
""" HackerRank Algorithms Implementation Cats and a Mouse author: Manny egalli64@gmail.com info: http://thisthread.blogspot.com/ https://www.hackerrank.com/challenges/cats-and-a-mouse/problem Given a list of integers, representing the positions on a line for - cat A, cat B, mouse C Return which cat reaches the...
true
4e7d6c1d9f57b8027155ccbe9db3cde829905c9d
Kailashcj/tpython
/hackerrank/geeks/is_abcd.py
UTF-8
234
3.296875
3
[]
no_license
#!/bin/python3 def is_abcd(w): previous = w[0] for c in w[1:]: if c < previous: return False previous = c return w if __name__=='__main__': w = input() print(is_abcd(w))
true