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
c7c2e5046f05bbb6f96b0e47739af6006d5e66d8
ifpb-cz-ads/pw1-2020-2-ac04-team-amandamichel
/questao_14.py
UTF-8
880
4.21875
4
[]
no_license
'''14) Escreva um programa para controlar uma pequena máquina registradora. Você deve solicitar ao usuário que digite o código do produto e a quantidade comprada. Utilize a tabela de códigos abaixo para obter o preço de cada produto. Seu programa deve exibir o total das compras depois que o usuário digitar 0. Q...
true
0c424783047cce6d2e4f1eb4b96a7954686201e0
dliedtka/dnssec_reproduction
/reproduction/final.py
UTF-8
4,906
2.5625
3
[]
no_license
import json import pprint # load filtered scenarios fin = open("filtered_scenarios.json", "r") scenarios = json.load(fin) fin.close() # count resolvers resolvers = set() for scenario in scenarios: for zone in scenario["zones-requested"].keys(): for rec_type in scenario["zones-requested"][zone].keys(): for e...
true
fc78b775b29ae7e50aa627b803023500f93f81c3
dlaststark/machine-learning-projects
/Programming Language Detection/Experiment-2/Dataset/Train/Python/sudoku.py
UTF-8
2,160
3.078125
3
[]
no_license
def initiate(): box.append([0, 1, 2, 9, 10, 11, 18, 19, 20]) box.append([3, 4, 5, 12, 13, 14, 21, 22, 23]) box.append([6, 7, 8, 15, 16, 17, 24, 25, 26]) box.append([27, 28, 29, 36, 37, 38, 45, 46, 47]) box.append([30, 31, 32, 39, 40, 41, 48, 49, 50]) box.append([33, 34, 35, 42, 43, 44, 51, 52, 5...
true
79880510bce952149151001129c3d8165d4a036b
dailyfatcat/IS211_Assignment1
/assignment1_part1.py
UTF-8
806
3.796875
4
[]
no_license
class ListDivideException(Exception): pass def listDivide(numbers, divide = 2): """ The function returns the number of elements in the numbers list that are divisibleby divide """ counter = 0 for number in numbers: #Check if modulo returns 0 #if number % divide == 0 if n...
true
eda3aa6de7c179d47e880835037db8c996d88711
DandDevy/data_analytics_project2
/r00168428.py
UTF-8
17,731
2.96875
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # In[2]: """ author Daniel """ from pandas import read_csv import numpy as np from pandas.plotting import scatter_matrix from matplotlib import pyplot from sklearn.model_selection import train_test_split from sklearn.model_selection import cross_val_score from sklearn.model_sele...
true
303b17417b3bda226a9020727e0200768b83b685
hsocasnavarro/CalcCorrect
/calccorrect.py
UTF-8
1,083
3.015625
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- def message(correct=True): import curses stdscr = curses.initscr() [maxy,maxx]=stdscr.getmaxyx() curses.endwin() line1=' CALCULATIONS ' if correct: line2=' CORRECT ' else: line2=' INCORRECT! ' len1=len(line1) len...
true
ad4d579db2ed7a2a3039216c26c175b8cf2465ce
SadiaSuma/Python-Code
/overloading operator.py
UTF-8
661
3.625
4
[]
no_license
class student: def __init__(self,m1,m2): self.m1 =m1 self.m2 = m2 def __add__(self,other): m1 = self.m1+ other.m1 m2 = self.m2 + other.m2 s3 = student(m1,m2) return s3 def __gt__(self,other): r1 = self.m1+self.m2 r2 = other.m1+oth...
true
3d2b38bcef402b25f966cf70abfb88c3a5d0586f
watty62/jazz_birthdays
/old versions/dead_or_not.py
UTF-8
342
2.859375
3
[ "CC0-1.0" ]
permissive
import re tests = ["Milt Jackson, vibraphone, piano, guitar, 1923 (d. October 9, 1999)", "Howard Johnson, alto sax, 1908 (d. December 28, 1991)","Sonny Greenwich, guitar, 1936", "Eiichi Hayashi, alto sax, 1960", "Yoshio Ikeda, bass, 1942", "Urs Leimgruber, saxophones, bass clarinet. 1952"] for test in tests: m = r...
true
05c604c1f429944f09233a435231348d9ad55d21
FryderykSzopen/ComputationalLinguistics
/morfoloskoRasclanjivanje.py
UTF-8
297
3.078125
3
[]
no_license
w1 = "pevač" w2 = "beogradski" w3 = "spavanje" a=w1[-6:-2] aa=w1[3:5] b=w2[0:7] bb=w2[7:11] c=w3[0:-5] cc=w3[-3:] c_c=w3[4] print("Osnova: ",a) print("Sufiks: ",aa) print("Osnova: ",b) print("Sufiks: ",bb) print("Osnova: ",c) print("Tematski vokal: ",c_c) print("Sufiks: ",cc)
true
6c6a8e9333bae816e0f70ed805422b327d696214
rdhox/cnn-gtsrb
/fn_images_enhancement.py
UTF-8
2,275
3.015625
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 15 15:50:59 2021 @author: renaud """ import numpy as np from skimage.morphology import disk from skimage.util import img_as_ubyte from skimage.filters import rank from skimage import color, exposure, transform def images_enhancement(images, width=2...
true
149ecca858c07dae154ed627de7e77eaf4ee02b3
excursus/nlpypes
/nlp/apostrophe.py
UTF-8
1,256
2.8125
3
[]
no_license
from basics import * from text.unicode import Unicode as U from nlp.contractions.Contractions import shared as contractions import re from enum import Enum class ApostropheInfo(Enum): none = 0 contraction = 1 multiple = 2 other = 3 noun_plus_will = 4 apostrophe_s = 5 ing_apostrophe = 6 ...
true
dd84cb7d486ebf063af24eab0f7061773b7f0ede
nakuyabridget/pythonwork
/non_mutable.py
UTF-8
104
3.125
3
[]
no_license
def f(a, L=None): if L is None: L = [] L.append(a) return L print (f(1)) print (f(2)) print (f(3))
true
b3381d02e6a49ccd17cb99b0afac53b0cbc58f79
andreapiero91/Phython
/Esempi/Gestione_cartelle.py
UTF-8
1,177
3.25
3
[]
no_license
####### GESTIONE CARTELLE ###### import os import shutil #IN QUALE CARTELLA SONO? print(os.getcwd()) #CONTENUTO CARTELLA AUTTUALE, TUTTO CONTENUTO print(os.listdir()) #CAMBIO CARTELLA os.chdir("C:\\") #dico voglio spostarmi in C:\\ print(os.getcwd()) #CREO CARTELLA CON QUESTO NOME os.makedirs("C:\\...
true
cc594e2685c28cf5b8aa0f2042f41b566fdc1529
thomas-corcoran/doc2vec
/train.py
UTF-8
1,546
2.671875
3
[]
no_license
import argparse import sys from collections import namedtuple from gensim.models.doc2vec import TaggedDocument from gensim.models import Doc2Vec import numpy as np from random import shuffle ProductDocument = namedtuple('ProductText', 'words tags') alldocs= [] def train(input_file,doc_limit,n_epochs=1): with open...
true
cfe25a57ef9e59f6fe59d20022cd900d3c563322
Minkov/python-advanced-2020-01
/multidimentional_lists/spiral_matrix.py
UTF-8
561
3.15625
3
[ "MIT" ]
permissive
def in_range(value, max_value): return 0 <= value < max_value n = 6 row_dirs = [0, +1, 0, -1] col_dirs = [+1, 0, -1, 0] matrix = [[None] * n for _ in range(n)] dir = 0 row = 0 col = 0 for count in range(n * n): matrix[row][col] = count + 1 next_row = row + row_dirs[dir] next_col = col + col_dirs[d...
true
d82ea04d1eb82ba31996b8fe470c9c3b99435212
sunwww168/bigclam
/agm.py
UTF-8
894
3.34375
3
[]
no_license
import networkx as nx import matplotlib.pyplot as plt from itertools import combinations import random class community(): """community class definition""" def __init__(self, nodes, prob): self.nodes = nodes self.prob = prob # AGM generates graph from communities, Matrix F is 0/1 def AGM(nodes,communities): # n...
true
de257ca6c1941c6afbfd117ec8e1be85179aab0a
nathanmwhite/hmong_albert
/scripts/demonstrate_bpe.py
UTF-8
1,709
2.71875
3
[]
no_license
#!/usr/bin/python # Byte-pair encoding demonstration script # Copyright (c) 2021 Hmong Medical Corpus Project # Author : Nathan M. White <nathan.white1@my.jcu.edu.au> """ This script runs a series of tests of the byte-pair encoding model files for purposes of demonstration. """ import os import sentencepiece as spm ...
true
37167bfe34c388773da6fa4d6f081d881f1e6663
jay0613/2020-0720-note
/month02/day10/udp_client.py
UTF-8
341
2.828125
3
[]
no_license
from socket import * ADDR = ("127.0.0.1",8888) while True: udp_socket = socket(AF_INET,SOCK_DGRAM) word = input("请输入查询的单词(#退出):") udp_socket.sendto(word.encode(),ADDR) if word == "#": break data,addr = udp_socket.recvfrom(1024) print("%s : %s"%(word,data.decode())) udp_socket.close()
true
1a899b075052146fb7b425a95ba108940f0c9f5a
111HanXinLong/LJY_Machine_Learning
/Pytorch/GAN/SandwichGAN_LSGAN/SandwichGAN_dataloader.py
UTF-8
1,403
2.625
3
[]
no_license
import os import glob import torch.utils.data import numpy as np class SandwichGAN_Dataloader(torch.utils.data.Dataset): #todo def __init__(self, path, transform, centered=False): super().__init__() self.transform = transform self.centered = centered self.add_string = lambda a, ...
true
6262ed37fa5d020a3d4f88e86e323f369b71ef46
raulduranperea/zRobot
/wheels.py
UTF-8
2,009
2.796875
3
[]
no_license
import RPi.GPIO as GPIO import runtime import wiringpi import math class Wheels: left_wheel = None right_wheel = None def __init__(self, left_wheel, right_wheel): self.left_wheel = left_wheel self.right_wheel = right_wheel pass def setup(self): self.left_wheel.setup()...
true
dd53b64244230faeea49a925c147fa9b0635ab8f
ggarcia01/wes_scripts
/ASTR232/232_hw4/hw4_code.py
UTF-8
6,525
2.984375
3
[]
no_license
''' Gil Garcia ASTR232 - Cosmology HW4 10 - 11 - 19 ''' #importing required packages import pandas as pd import matplotlib.pyplot as plt import numpy as np #importing csv with spectral line data for 6 galaxies spectra_lines = pd.read_csv('spectra_lines.csv',index_col=False) #importing line ratio data for HII galaxies...
true
8b4293e7bd7c490645188da8ccd676d0da4a97e4
GerardProsper/Intermediate-Python-Programming-Course
/Function Arguments.py
UTF-8
3,045
3.765625
4
[]
no_license
# difference between arguements and parameters def print_name(name): # name here is parameter print(name) print_name('Gerard') # Gerard here is arguments def fool(a,b,c): print(a,b,c) fool(1,2,3) fool(a=1,c=3,b=2) # this is keyword arguments. order doesnt matter fool(2, b=3, c=5) # this would ...
true
89f5d0169073c6a443880cba1567164ad3cbce62
LannibaleS/Python_fullstack
/day22/4.面向对象的交互.py
UTF-8
546
3.8125
4
[]
no_license
class Dog: def __init__(self, name, blood, aggr, kind): self.name = name self.hp = blood self.aggr = aggr self.kind = kind def bite(self, person): person.blood -= self.aggr class Person: def __init__(self, name, blood, aggr, sex): self.name = name ...
true
2934c90eb36df7424f71358042b742503468ccff
itestedthis1/API_TESTING_BASE
/app/gdb/services/customer.py
UTF-8
4,425
2.640625
3
[]
no_license
import time import uuid import logging from json import dumps, loads from typing import List from pydantic import BaseModel from app.gdb.helper.graph import get_gdb gdbservice = get_gdb() class Customer(BaseModel): id: str status: bool title: str CompanyReg: int RegisteredAddress: str password...
true
cf83fbff04b95723601e15ab48fc5df979fabfb2
shirtsgroup/finite-temperature-crystal-scripts
/useful_scripts/interpolate_itp.py
UTF-8
2,970
3.265625
3
[ "MIT" ]
permissive
#!/usr/bin/python # # Interpolate an itp file # All interpolation lines are headed with the keyword INTERPOLATE followed by the number of parameters that will be interpolated. # This line is then followed by the (0.0) and (1.0) values for each parameter. # # Copyright Michael R. Shirts, University of Virginia, 2014 # ...
true
bf31857df3dd5bfb1e75211ad5af1d46c565326a
thilux/tvdb_client
/tvdb_client/utils/utils.py
UTF-8
1,020
3.046875
3
[ "Apache-2.0" ]
permissive
# encoding=latin-1 __author__ = 'tsantana' import urllib def query_param_string_from_option_args(a2q_dict, args_dict): """ From a dictionary of arguments to query string parameters, loops through ad arguments list and makes a query string. :param a2q_dict: a dictionary containing argument_name > query str...
true
f15baa23f177c7299cb0838ca9f626d0b75101aa
cravo123/LeetCode
/Algorithms/1196 How Many Apples Can You Put into the Basket.py
UTF-8
336
3.015625
3
[]
no_license
# Solution 1, greedy class Solution: def maxNumberOfApples(self, arr: List[int]) -> int: arr.sort() curr = 0 i = 0 while i < len(arr): curr += arr[i] if curr > 5000: break i += 1 r...
true
25d295fa75b11644c2f04c3621e25ebbe9c6f11b
hhheegunnn/Algorithm_Study
/boj_implementation/S/S5/7568/boj_S5_7568_jungwha.py
UTF-8
322
2.9375
3
[]
no_license
N = int(input()) w =[] h =[] answer = [1 for j in range(N)] for _ in range(N): a,b = map(int, input().split()) w.append(a) h.append(b) for i in range(N): for k in range(N): if w[i] < w[k]: if h[i] < h[k]: answer[i] += 1 answer = map(str, answer) print(' '.join(answer)...
true
5fd319c76f460ea0c4c3b047c2e053781fe5919c
ThisseasX/PythonTest
/Experiments/DateTimeExperiment.py
UTF-8
456
2.890625
3
[ "Apache-2.0" ]
permissive
import locale import time from datetime import datetime locale.setlocale(locale.LC_TIME, "el") def crm(): return int(round(time.time()) / 24 / 60 / 60) # print(datetime.now().time()) # print(datetime.now()) # print(datetime.now().timestamp()) # print(round(time.time())) date1 = datetime.now() date2 = date1.replac...
true
c6e5d34a27f18166d9e8f479928d8eef915cf5e4
leadc/python101
/1.0-comenzando/src/ejercicio10.py
UTF-8
196
3.75
4
[ "Apache-2.0" ]
permissive
import random print("Piedra, papel o tijeras!") x = random.randint(0,30) if x <= 10: print("Piedra!") elif x > 10 and x <= 20: print("Papel!") elif x > 20 and x <= 30: print("Tijeras!")
true
99e8fa43a112ac882c8ccc0293808fd7ea3046ab
GreatXerxes/AI---Coursework
/cw2/Task 1 - converter/csvConverter.py
UTF-8
996
3.453125
3
[]
no_license
import csv import sys inputFile = sys.argv[1] #input file outputFile = sys.argv[2] # output file with open(inputFile, 'rb') as csvFile: writeToFile = [] #list myReader = csv.reader(csvFile, delimiter=',')#read from csv file for row in myReader: if row[len(row) - 1]== '1': # check character at end ...
true
ed3f37ab5e12848aa6e8b5a88d65002ee5968047
gabriellaec/desoft-analise-exercicios
/backup/user_016/ch37_2020_04_01_04_44_23_721197.py
UTF-8
150
3.28125
3
[]
no_license
senha = True while senha: tentativa = input('Qual a senha? ') if tentativa == 'desisto': print('Você acertou a senha!') break
true
6b793c07893057ab267eff754ef8352b7e327c49
dcallega/Drone-Explorer
/mission/Main.py
UTF-8
1,474
2.890625
3
[ "MIT" ]
permissive
# ====================================================================== # FILE: Main.py # # DESCRIPTION: This file contains main function for the board running # in the background # # CHANGES MADE 04/08: inorder, graph # # CHANGES TO BE MADE: take out threading example # ==========================...
true
182e30e76381b8697aea3c10cd8a8a55eb2d9f0f
GermanGarayAdriel/Tutorial
/clases/Controlador.py
UTF-8
4,328
2.703125
3
[]
no_license
import pygame from clases.Mario import Mario from clases.Moneda import Moneda from clases.Base import Base from clases.Bloque import Bloque class Controlador(object): @classmethod def iniciar(cls): pygame.init() #pygame.mouse.set_visible(False) @classmethod def terminar(cls): ...
true
d10b402460d0e909cf1194390a28bddaa3d41848
heiv82/test_one
/test_18.py
UTF-8
211
3.65625
4
[]
no_license
my_list = [int(s) for s in input().split()] for i in range(len(my_list)): for j in range(len(my_list)): if i != j and my_list[i] == my_list[j]: break else: print(my_list[i], end=' ')
true
942e59b9c330006e98e0302baad4a809a95ccdfe
hibajamal/PSO_Simulation
/Assignment 2/ProcessingFiles/Button.py
UTF-8
1,197
3.25
3
[]
no_license
class button(object): def __init__(self, x, y,label, fontSize): self.x = x; self.y = y; self.Width = (width*0.25)*0.55 self.Height = (height*0.08)*0.85 self.fontSize = fontSize; self.font = createFont("Arial", self.fontSize); self.label = label def D...
true
6c1b92d76ad39485f68dac036f32418841cb9ddc
haryadwi/idcamp-py
/function/passbyref.py
UTF-8
503
4.21875
4
[]
no_license
def changeme(mylist): mylist.append([1, 2, 3]) print("Nilai di dalam fungsi: {}".format(mylist)) # Memanggil fungsi change me mylist = [10, 20, 30] changeme(mylist) print("Nilai di luar fungsi: {}".format(mylist)) print('\n') def changeme2(mylist2): mylist2 = [1, 2, 3, 4] # fungsi untuk mereplace isi ...
true
cc649bba5b340cef520e66f8ce526a65b59f7320
Themistoflix/NPL
/GA/NichedPopulation.py
UTF-8
2,787
3.203125
3
[]
no_license
import numpy as np # TODO these features are experimental right now class Population: def __init__(self): pass def add_offspring(self, particle): raise NotImplementedError def compute_fitness(self, particle): raise NotImplementedError def random_selection(self, n_individuals...
true
283e39c9548783b0960f23db351c97a4fa8a7d22
amidying/shop-calculator
/sample.py
UTF-8
963
3.765625
4
[]
no_license
'''github origin:https://github.com/alineaz42/shop-calculator/commits/main pushed ''' print("welcome to future:") def calc(name, address): bazarList = {} total = 0 while True: productName = input("Enter product name or q to quite: ") if productName != "q": try: ...
true
b2c1fb9a7a3cbcdd405eb55c571aba7396cf1675
BriefyHQ/briefy.common
/tests/utils/test_transformers.py
UTF-8
923
2.859375
3
[]
no_license
"""Tests for `briefy.common.utils.transformers` module.""" from briefy.common.utils.transformers import json_dumps from briefy.common.vocabularies.person import GenderCategories from datetime import date from datetime import datetime from datetime import time from decimal import Decimal import colander import pytest i...
true
57cb39261926f2848a48d714c9ad3f0d53155c65
estraviz/codewars
/6_kyu/Twisted Sum/python/solution.py
UTF-8
119
2.984375
3
[]
no_license
"""Twisted Sum""" def compute_sum(n): return sum(int(y) for y in list("".join(str(x) for x in range(1, n + 1))))
true
2e2e4e996b496d99ba8ffb805749030b1072379f
AlexxFuentes/VerificadorDeSintaxis
/clases/stack.py
UTF-8
899
4.09375
4
[]
no_license
""" @autor: Alex Fuentes fecha: 24/04/2021 """ class Stack: """Implementación de pila como una lista""" def __init__(self): """Crear nueva pila """ self._items = [] def is_empty(self): """Comprueba si la pila está vacía """ return not bool(self._items) def push(self, i...
true
9a5033e3d730599683f393188f64726ba06c7a0a
fluder1/bhops
/gradeParser.py
UTF-8
1,374
3.625
4
[]
no_license
#Script to parse json file 'students.json' and sort by grade #@author Alan Fluder import json class Student: def __init__(self, first_name, last_name, grade): self.first_name = first_name self.last_name = last_name self.grade = grade if (grade.lower() == "senior"): self....
true
3d1ad2eaec41c162191017a19ec523f5c7ca9d9a
cprieto/kron
/kron/kronbute/base_server.py
UTF-8
2,799
2.515625
3
[]
no_license
import re import urllib.parse from typing import Optional, Dict, List, Union, Any, Any import requests from .errors import ServerError, ArgumentValidationError, NotFoundError, AliasAlreadyExistsError version_regex = re.compile(r"hello!, version: (?P<version>.*)") class BaseServer: def __init__(self, url: str):...
true
bbea0c40d263b54fc13c94a8449fafb7d9cbae6a
greydevv/pytyper
/pytyper/core/calculation.py
UTF-8
899
3
3
[ "MIT" ]
permissive
from pytyper.core.comparison import conflicting, matching def gross_wpm(user_input, seconds): """ Calculates gross words-per-minte Parameters ---------- user_input: str seconds: float or int Returns ------- float """ gross = (len(user_input)/5)/(seconds/60) return gross def net_wpm(prompt, user_input, s...
true
d8bb6d0b6702d0ac757112b679db64f607a08318
QiusHosens/zhuxian_dati
/src/main/upload_geci.py
UTF-8
1,925
2.625
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -* from elasticsearch import Elasticsearch from datetime import datetime es = Elasticsearch(['114.115.155.228:29200']) def upload_geci(id, geci): es.create(index="geci", doc_type="geci", id=id, body={"data": geci}) def update_file_all(): geci_file_path = '../geci/source/igeci_geci.txt' ...
true
5ce207be8ec57ec7324258e9ec7eaac3be574ea5
juvenn/katas
/src/leetcode/largest_rectangle.py
UTF-8
2,596
3.703125
4
[]
no_license
#! /usr/bin/python # class Solution: # @param height, a list of integers # @return an integer def largestRectangle(self, height): return self.largestByStack(height) # Push array indices into stack, and pop them when value is less # than the previous one, compute the area by indice width. ...
true
328014843be8ae324dc6061ab73c8da97cb30674
WadeBarnes/aries-cloudagent-python
/aries_cloudagent/transport/outbound/base.py
UTF-8
2,635
2.65625
3
[ "LicenseRef-scancode-dco-1.1", "Apache-2.0" ]
permissive
"""Base outbound transport.""" import asyncio from abc import ABC, abstractmethod from typing import Union from ...core.profile import Profile from ...utils.stats import Collector from ..error import TransportError from ..wire_format import BaseWireFormat class BaseOutboundTransport(ABC): """Base outbound tran...
true
617c77c83ba35b136ebae5d5c6aea4943f028bfe
adykumar/Leeter
/python/242_valid-anagram.py
UTF-8
1,194
4.0625
4
[]
no_license
""" Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Input: s = "anagram", t = "nagaram" Output: true Example 2: Input: s = "rat", t = "car" Output: false """ class Solution(object): def validAnagram(self, string1, string2): return sorted(string1)==sorted(st...
true
8fa231d3199766e74c04002bda3f7dfd02b8b159
raochuan/LintCodeInPython
/reverse_integer.py
UTF-8
594
3.375
3
[]
no_license
# -*- coding: utf-8 -*- class Solution: # @param {int} n the integer to be reversed # @return {int} the reversed integer def reverseInteger(self, n): # Write your code here plus = (n >= 0) # 判断正负号 abs_n = abs(n) numbers = [] while abs_n > 0: numbers.appen...
true
6162f21bd5b0db2f6a24abf05e9fb07267e10f13
syurskyi/Python_Topics
/333_nuke/example/useful_small_function/Pr_Suite/ShuffleEXRPasses.py
UTF-8
645
2.53125
3
[]
no_license
import nuke def ShuffleEXRPasses(): if nuke.selectedNodes() != []: selected = nuke.selectedNodes("Read") if selected: for read in selected: channelCollect = read.channels() store = [] for channel in channelCollect: cut = channel.split(".") ind = cut[0] store.append(ind) channelSe...
true
daa1eeefbf6caadf75108af4e3ad6f78a3d1029a
ters81/codeforces.com
/B. Заурядные числа.py
UTF-8
1,840
3.890625
4
[]
no_license
# B. Заурядные числа # https://codeforces.com/problemset/problem/1520/B # ограничение по времени на тест2 секунды # ограничение по памяти на тест256 мегабайт # вводстандартный ввод # выводстандартный вывод # Назовем целое положительное число n заурядным, если в десятичной системе счисления все его цифры одинак...
true
2fea77c71dd735001019c524a6674cc0ee736e83
BIDMAL/codewarsish
/LeetCode/Python/1732-FindTheHighestAltitude.py
UTF-8
883
3.6875
4
[]
no_license
from typing import List """ There is a biker going on a road trip. The road trip consists of n + 1 points at different altitudes. The biker starts his trip on point 0 with altitude equal 0. You are given an integer array gain of length n where gain[i] is the net gain in altitude between points i and i + 1 for all (0 <...
true
7bb25be193bf1276307ce03a47e8025002cc8e2d
koalaboy808/HW05
/HW05_ex00_TextAdventure.py
UTF-8
4,067
3.75
4
[]
no_license
#!/usr/bin/env python # HW05_ex00_TextAdventure.py ############################################################################## # Imports import sys # Body def infinite_stairway_room(username, count=0): print "%s walk through the door to see a dimly lit hallway." % username print "At the end of the hallway...
true
0f37bc5e73d0d2fd7974d2f8f7b3e0ee343be414
joestalker1/leetcode
/src/main/scala/FavoriteDrinks.py
UTF-8
581
3.46875
3
[]
no_license
from itertools import combinations def satisfies(option, preferences): return all(set(c).intersection(option) for c in preferences.values()) def make_drinks(preferences): customers = preferences.keys() drinks = set([x for y in preferences.values() for x in y]) for i in range(1, len(customers) + 1):...
true
de4bc4a70f1669fa4fb7bee4697498c1604536de
icedancemelody/DQN
/my_run.py
UTF-8
2,190
2.765625
3
[]
no_license
from DQN.my_env import Env from DQN.RL_brain import SumDQN import tensorflow as tf def run_maze(): step = 0 reward_sum=0#每十回合统计的奖励 step_sum=0#每十回合统计的步数 for episode in range(1001): # initial observation observation = env.reset() #人流量随机改变 #env.resetPeople() # if ...
true
4a26c4eb742bb71b2378057c46888a12ecab4c67
rj-aj/my-coding-assignments
/Python/Python_I/PythonFundamentals/FooAndBar.py
UTF-8
919
4.71875
5
[]
no_license
Optional Assignment: Foo and Bar Write a program that prints all the prime numbers and all the perfect squares for all numbers between 100 and 100000. For all numbers between 100 and 100000 test that number for whether it is prime or a perfect square. If it is a prime number print "Foo". If it is a perfect square ...
true
ed193327004994cedaccfb4bd9e24e21882374fe
par1321633/ds-coding-problems
/leetcode/must-do-75/merge-intervals.py
UTF-8
1,986
3.78125
4
[]
no_license
""" Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. Medium Example 1: Input: intervals = [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since int...
true
84a64fa1d3966453b9d9d77faf31f5b805c52bfb
vladignatyev/markovfsm
/examples/rigged_dice.py
UTF-8
863
3.15625
3
[ "MIT" ]
permissive
#!coding:utf-8 from random import betavariate from graphviz import Digraph from markov import Chain from markov.plot import transitions_to_graph def rigged_dice(): return int((betavariate(0.5, 0.7) * 6)) chain = Chain(6, rigged_dice()) # roll dice many times and build Markov chain for this process for i in ra...
true
b5dd231f8152417d9d3466671ec0d584f42c3ada
DayGitH/Python-Challenges
/DailyProgrammer/DP20170123A.py
UTF-8
1,135
3.484375
3
[ "MIT" ]
permissive
""" [2017-01-23] Challenge #300 [Easy] Let's make some noise https://www.reddit.com/r/dailyprogrammer/comments/5prdgb/20170123_challenge_300_easy_lets_make_some_noise/ #Description Let's try something different this week. Our output is going to be sound instead of text/graphics #Formal Inputs &amp; Outputs No real in...
true
1a0899da41a99e91d56b1dc9eaf4e8c0cbeb9880
leo-du/leetcode
/417_pacific_atlantic_water_flow/solution.py
UTF-8
1,856
3.46875
3
[]
no_license
from typing import List, Tuple, Set from queue import Queue class Solution: def pacificAtlantic(self, matrix: List[List[int]]) -> List[List[int]]: """ :type matrix: List[List[int]] :rtype: List[List[int]] """ m = len(matrix) if m == 0: return [] n...
true
a005dcfa4d845346c3b847ceca298599c27c38e8
TerrenceHo/ML_Algorithms
/DecisionTree/main.py
UTF-8
4,572
3.21875
3
[]
no_license
from RandomForest import RandomForest from DecisionTree import DecisionTree # import class and all helper functions from utils import * import os def test(): # Functions to test Decision Tree as I build it os.system("clear") Tree = DecisionTree() # Build Tree Object # testing gini cost function ...
true
ad698f0e28a3c25f84c4dcec852e8aeb7ef02dce
bloedlink/python
/2.Scripts/smspython/sms.py
UTF-8
557
2.53125
3
[]
no_license
# Download the helper library from https://www.twilio.com/docs/python/install from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/console # DANGER! This is insecure. See http://twil.io/secure account_sid = 'enter account sid here' auth_token = 'enter auth token here' client = Client(accou...
true
62c529bf8d47353dee0656151efaadab1eee0d21
sharath28/leetcode
/prob77/combinations.py
UTF-8
850
3.171875
3
[]
no_license
class Solution(object): def combine(self, n, k): """ :type n: int :type k: int :rtype: List[List[int]] """ #################3 #Backtracking # def backtrack(first=1,curr=[]): # if len(curr)==k: # output.append(curr[:]) # for i in...
true
f68f4d63aa68d514ba2b024bf57332839ad34e50
kcoyle/dctap-python
/tests/test_CSVREADER__normalize_element_name.py
UTF-8
1,468
3
3
[ "MIT" ]
permissive
"""In getting rows: normalize element names (CSV header) as per config_config.""" from dctap.config import get_config from dctap.csvreader import _normalize_element_name def test_normalize_element_name(): """Element names not recognized as aliases are left unchanged.""" config_dict = get_config() element_...
true
2fdd31b2fa88e1976afa3784177ffdb4c7648d78
mkduer/reinforcement-learning-snake-game
/venv/mouse.py
UTF-8
1,528
3.703125
4
[ "Apache-2.0" ]
permissive
from random import randint import constant class Mouse: def __init__(self, width, height, snake_body: ([int], [int])): self.grid_width = width self.grid_height = height self.x = -1 self.y = -1 self.generate_mouse(snake_body) def draw(self, surface, image): """...
true
8c08b881805a9a7c465f6bd2cddd60f6f5507e60
ryoiwata/think_python
/ch_10_lists/ch_10_exercises.py
UTF-8
4,445
3.828125
4
[]
no_license
import timeit import time def nested_sum(input_list_of_list): #exercise 10-1 local_list = input_list_of_list for index, value in enumerate(local_list): local_list[index] = sum(value) return sum(local_list) def cum_sum(input_list): #exercise 10-2 local_list = input_list current_sum...
true
342e996ad3d9433c06c007f5c1bb478b5e7f4ec8
maomao905/algo
/monotonic-array.py
UTF-8
424
3.265625
3
[]
no_license
from typing import List class Solution: def isMonotonic(self, A: List[int]) -> bool: if A[0] == A[-1]: check = lambda a, b: a == b elif A[0] < A[-1]: check = lambda a, b: a <= b else: check = lambda a, b: a >= b N=len(A) return al...
true
5947edccea1581c76435009d8d28fe8236ed995c
andres-erbsen/rrtcp
/results/scripts/plotting.py
UTF-8
1,242
3.546875
4
[ "Apache-2.0" ]
permissive
""" Demo of the histogram (hist) function used to plot a cumulative distribution. """ import numpy as np import matplotlib.pyplot as plt from matplotlib import mlab def plot_loss_over_time(file_name): with open(file_name, 'r') as f: lines = f.readlines() events = order_events(lines) packets_sent ...
true
4b57f98631751389d97ab010cfe80f636d8ed99d
RuthKassahun/PythonLectures
/Intro/Variables.py
UTF-8
904
4.34375
4
[]
no_license
# variables are identifies that holds values of diffrent data types age = 10 # Age holds the int value 10 name = "Abebe" # name holds the string value abebe mark = 88.5 # mark holds the float value 88.5 ''' Naming Conventions don't use keywords as a name of a variable like print,float,int,new ...
true
fec4825fbe3dcaf10587792925641062fc57936e
oahaneku/plannning_tool
/simulator_components.py
UTF-8
28,247
2.78125
3
[ "MIT" ]
permissive
import random import datetime import organisation def bernoulli(verbose,probability): random_number = random.random() # random floating point number in the range [0.0, 1.0) outcome = int(random_number <= probability) if verbose == 1: print "(Bernoulli function) probability = %f, random seed = %f"...
true
305e60ec106894902dbc9c33257c590a1925da5d
OSiddiqi/Python---other-exercises
/person.py
UTF-8
1,379
4
4
[]
no_license
class Person(): def __init__(self): self.firstName = "" self.lastName = "" self.dateOfBirth = "" self.personList = [] self.isMember = True def addDetails(self): """creating a new person""" self.firstName = input("Enter first name: ") ...
true
93559e4677bac3c24dd3555ebdc70646301d027f
bansalmanu/ADMBS_MovieRec
/mongoOperations/ReadingCSV.py
UTF-8
1,726
2.59375
3
[]
no_license
import pandas as pd import DataDocuments import Connection as con file_path_links = "../data/links.csv" file_path_movies = "../data/movies.csv" file_path_ratings = "../data/ratings.csv" file_path_tags = "../data/tags.csv" movies_data = pd.read_csv(file_path_movies) links_data = pd.read_csv(file_path_links) ratings_dat...
true
3cfedb9ea4b0126ab2a516d2e356ec57aa925c2e
draghan/dataSetCollector
/dataSetCollector.py
UTF-8
4,411
3.140625
3
[ "MIT" ]
permissive
# # This file is distributed under MIT License. # Copyright (c) 2020 draghan # 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 t...
true
9d8b825c4c875298f1a0c3a86b736a7bdafdfec2
10529473/B9IS109-CA2
/src/app.py
UTF-8
2,667
2.671875
3
[]
no_license
import os from flask import (Flask, render_template, request, redirect, url_for, flash) from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.secret_key = "Secret Key" # PostegreSQL connection for Docker db_url = 'localhost:5432' db_name = 'crud' db_user = 'postgres' db_password = '!QWEqwe123' app.config[...
true
044b8faa887c7c347718b81c7528b6827f695feb
gm088/gscripts
/gscripts/general/downsample_bam.py
UTF-8
4,356
2.734375
3
[ "MIT" ]
permissive
__author__ = 'gpratt' __author__ = 'gpratt' import argparse import subprocess import os def wrap_wait_error(wait_result): if wait_result != 0: raise NameError("Failed to execute command correctly {}".format(wait_result)) def pre_process_bam(bam, bam01, bam02, bam03, bam04, bam05, bam06, bam07, bam08, ba...
true
2537d1a9427ed7f6b44a5fa1e83da3dbcda2f502
AlfiraDs/ads
/ads/ml/preprocessing/parallel_text_processing.py
UTF-8
1,603
2.796875
3
[]
no_license
import multiprocessing from itertools import chain from multiprocessing.pool import Pool from nltk import WordNetLemmatizer from tqdm import tqdm import re from nltk.corpus import stopwords import time from sklearn.datasets import fetch_20newsgroups global_stop_words = stopwords.words('english') train = fetch_20new...
true
0c3c9e96f1c7eb775a9ea7cb76d1c392e4144062
SpeechieX/algorithms-and-data-structures
/algorithmic-toolbox/week4_divide_and_conquer/2_majority_element/majority_element.py
UTF-8
1,005
3.828125
4
[]
no_license
# Uses python3 import sys def get_majority_element(a, left, right): if left == right: return -1 if left + 1 == right: return a[left] # Mid-point of list middle = (right-left)//2 + left left_maj = majority(get_majority_element(a, left, middle), a, left, middle) right...
true
f620efb3d4ea4bd4990db9b51c99653231d3f78c
maciej3031/arbitrary_style_transfer
/main.py
UTF-8
1,076
2.609375
3
[ "MIT" ]
permissive
# Demo - train the style transfer network & use it to generate an image from __future__ import print_function from itertools import product from infer import stylize from utils import list_images # for training ENCODER_WEIGHTS_PATH = 'vgg19_normalised.npz' STYLE_WEIGHTS = [0.70] MODEL_SAVE_PATHS = [ 'models/st...
true
bec9646d437f9f6e9e9b80d3311594f23b9bb3cc
Larissa-Rodrigues/Python3-CursoEmVideo
/Mundo1/ex033.py
UTF-8
514
4.875
5
[ "MIT" ]
permissive
#DESAFIO 033: Faça um programa que leia três números e mostre qual é o maior e qual é o menor. a = int(input('Primeiro valor: ')) b = int(input('Segundo valor: ')) c = int(input('Terceiro valor: ')) #Verificando quem é menor: menor = a if b < a and b < c: menor = b if c < a and c < b: menor = c #Verificando...
true
3de306e88141b89efecd23730c813e9d6567c276
jelluh333/untitled
/Les 1.py
UTF-8
1,046
3.671875
4
[]
no_license
#Exercise 1_2 #a print(len('Supercalifragilisticexpialidocious')) #b print('ice' in 'Supercalifragilisticexpialidocious') #c print(len('Antidisestablishmentarianism') > len('Honorificabilitudinitatibus')) #d lst = ['Berlioz', 'Borodin', 'Brian','Bartok', 'Bellini', 'Buxtehude', 'Bernstein'] lst.sort() print(lst) #Exer...
true
d1a6f13e104ec31d2dae34bc687dfa6465bbf293
UstunYildirim/Tweet-Collector-and-Generator
/getRealTimeTweets.py
UTF-8
2,340
2.859375
3
[]
no_license
#!/usr/bin/python3 from __future__ import absolute_import, print_function from tweepy import OAuthHandler, Stream, StreamListener import json, os def readConfig(): with open('tweets.config') as f: lines = f.read().split(os.linesep) i = 0 while i < len(lines): l = lines[i] ...
true
cd310de6da79836b26f3da1d6b8f87a5547bbca2
damg/cpl
/cpl.py
UTF-8
30,427
3.3125
3
[]
no_license
import re import sys def swap(tupl): return (tupl[1], tupl[0]) class Token: def __init__(self, typ, lexeme, line, col): assert(isinstance(typ, str)) assert(isinstance(lexeme, str)) assert(isinstance(line, int)) assert(isinstance(col, int)) self.typ = typ ...
true
669be79e28b92681e1b11ed9d60567129cf409d2
tszandy/leetcode
/python_program/q701_Insert_into_a_Binary_Search_Tree.py
UTF-8
1,162
3.25
3
[]
no_license
from typing import List from collections import Counter,defaultdict from math import * from functools import reduce,lru_cache,total_ordering import numpy as np from heapq import * from bisect import bisect_left,bisect_right from itertools import count # Definition for a binary tree node. # class TreeNode: # def __...
true
8209582a3e7f8bf95be82441c97cf3c13808d09c
agrzybkowska/Data8Project
/json_reader.py
UTF-8
2,092
3.140625
3
[]
no_license
import boto3 from pprint import pprint import json import pandas as pd from FileDictionary import files # For the interview notes bucket it take 5 min to write into the df class ReadTransformJson: """ A class that will import json files from s3 and load them into a pandas dataframe """ def __init__(se...
true
6b3256af974f9ba7935b7d58c217da0e941bb3cb
MattBussing/DistancePi
/distancepi/server_connector.py
UTF-8
1,706
2.796875
3
[ "MIT" ]
permissive
# author Matt Bussing from datetime import datetime import pytz import requests class ServerConnector(): """ This is the class we will use to connect the device to the server """ def __init__(self, url: str, client: str): self.url = url self.client = client def get_messages(self...
true
218d3a42a1e1f2738cf41b0f18d0f52db4ec3561
RobertChienShiba/Yt_Concate
/yt_concate/pipeline/steps/downloads_captions_by_multithreading.py
UTF-8
1,557
2.53125
3
[ "MIT" ]
permissive
import logging from concurrent import futures import time from youtube_transcript_api import YouTubeTranscriptApi from yt_concate.pipeline.steps.step import Step class DownloadCaptions(Step): def process(self, data, inputs, utils): start = time.time() with futures.ThreadPoolExecutor(max_workers=...
true
19a6f2f2bfee22491447d10bd0b3233583e9643d
LOVE-Yourself/weixin
/sougou_weixin.py
UTF-8
5,487
2.671875
3
[]
no_license
from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.keys import Keys from selenium.webdriver.support import expected_conditions as EC import time from lxml import etree import urllib.request class weixin_spider(object): def get_search_content(self,...
true
88c6796554819cb0bdb5355aaf0b4f90f78948de
toshihikoyanase/optuna
/optuna/visualization/_intermediate_values.py
UTF-8
3,369
2.640625
3
[ "SunPro", "BSD-2-Clause", "MIT" ]
permissive
from __future__ import annotations from typing import NamedTuple from optuna.logging import get_logger from optuna.study import Study from optuna.trial import TrialState from optuna.visualization._plotly_imports import _imports if _imports.is_successful(): from optuna.visualization._plotly_imports import go _l...
true
d41958c060ff427f7c7502b701b8aab6c4d13974
digpulls/docker-testrunner
/resources/load_testng_parameters.py
UTF-8
849
2.796875
3
[]
no_license
import json import sys import xml.etree.ElementTree as elementTree xml_data_tree = elementTree.parse('template.xml') # Read TestNG input parameters from Json file with open(sys.argv[1]) as test_ng_json_data: # Pass json file path as script argument input_params = json.load(test_ng_json_data) def update_test_ng...
true
cb43de4cf8123e3a6b4d769df097ec01c5a1e11c
valdirsjr/learning.data
/python/vogais.py
UTF-8
136
2.578125
3
[ "MIT" ]
permissive
def vogal(letra): vogais = "aeiouAEIOU" if vogais.count(letra) == 1: return True else: return False
true
9d97f736cd19b6a2404115bb7fb67dca24ace82d
j-grana6/pyProScout
/build/lib.linux-x86_64-2.7/proscout/python_api/analyze_tools.py
UTF-8
9,293
3.109375
3
[]
no_license
""" This script will hold objects that have to do directly with analyzing and presenting data. No scraping functions are defined in this script. """ from proscout.tools.player import Player from proscout.tools.team import Team, team_codes from matplotlib import pyplot as plt import numpy as np class TwoPlayerComparis...
true
8fcc68a7d9954fd9745f8f6091fb289943eac97c
ask-ramsankar/DataStructures-and-Algorithms
/linked_list/Singly/singly.py
UTF-8
3,801
3.578125
4
[]
no_license
class node: def __init__(self,data): self.data=data self.next=None class linkedlist: def __init__(self): self.head=None def append(self,data): current=self.head while current.next!=None: current=current.next current.next=node(data) def disp...
true
de84907ed75e7ad8d5d69f7a40d642ee1b1a28d0
Insperias/online_crocodile
/client/main_menu.py
UTF-8
2,859
3.265625
3
[]
no_license
import pygame from network import Network from game import Game from player import Player #-200 window #-20 font class MainMenu: BG = (255, 255, 255) def __init__(self): self.WIDTH = 1100 self.HEIGHT = 800 self.win = pygame.display.set_mode((self.WIDTH, self.HEIGHT)) self.name...
true
bb8dfda6cb5f6644f83b5d0f3429db304855c9f3
LoisBN/python
/env/code/pendu.py
UTF-8
4,501
3.203125
3
[]
no_license
#encoding:utf8 import math,random def pendu(): continuer = "1" while continuer == "1" or continuer == "yes" or continuer == "y" or continuer == "oui": print("\n") print("bonjour bienvenue dans le pendu un mot aléatoire va être choisi et vous allez devoir le trouver lettre par lettre \n") ...
true
e19ba6445d9685e04b459ce38d4e08c0e43e0bca
jjeeey/practicum_1
/58.py
UTF-8
998
3.203125
3
[]
no_license
""" Имя проекта: practicum_1 Номер версии: 1.0 Имя файла: 58.py Автор: 2020 © Ю.А. Мазкова, Челябинск Лицензия использования: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/deed.ru) Дата создания: 10/12/2020 Дата последней модификации: 10/12/2020 Связанные файлы/пакеты: numpy, random Описание: Решение за...
true
a47723a4317e020459ec98368fba513c7f7ee7e1
JornSchampheleer/2021-pop
/DinoAI/DinoAI/neatmain.py
UTF-8
4,323
2.828125
3
[]
no_license
# Copyright (c) 2020. # By Jorn Schampheleer # Textures copyrighted by google, extracted from the game by chirag64 (https://github.com/chirag64/t-rex-runner-bot) import pygame from DinoAI.DinoAI.GameObjects.ground import Ground from DinoAI.DinoAI.GameObjects.obstacle_spawner import ObstacleSpawner from DinoAI.DinoA...
true
0728a6478affbd90a0ac812c26c980b1364affce
b1ueb1ues/brm
/brmfullsystem/aura.py
UTF-8
2,913
2.625
3
[]
no_license
from event import * class aura(object): _enable = 0 duration = 10 src = 0 el = 0 _auraev = 0 withhaste = 0 casttime = 0 value = 0 class AuraEv(Event): def process(this): this.src._enable=0 tmpev = aura.callbackev() tmpev.src = this.src...
true
2629d32e6fcc2cc296deb782ddee1152d5d88632
Anzanrai/music_genre_classification
/projectFolder/test_m.py
UTF-8
1,466
2.734375
3
[]
no_license
import Tkinter import tkFileDialog import generateMFCC as g import numpy as np import os import glob import pickle import operator as op modelpath = "C:/Users/anju/Documents/eclipse_workspace/MusicGenreClassification/" modelnames = [] def test(): ftypes = [('Wav files', '*.wav')] d...
true
b3583450ee57f293193b9903643ad44cc65513a3
BosenkoTM/python_learning
/lesson_06_list/task05.py
UTF-8
760
3.8125
4
[ "Apache-2.0" ]
permissive
#!/usr/bin/python # -*- coding: utf-8 -*- # Заполнить список из десяти элементов произвольными целочисленными значениями. Получить список из элементов певрого списка, # стоящих на четных местах. import random listCount = 10 # Размер списка randoms = [random.randrange(1, 101, 1) for _ in range(listCount)] print('Ис...
true