blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
133
path
stringlengths
2
333
src_encoding
stringclasses
30 values
length_bytes
int64
18
5.47M
score
float64
2.52
5.81
int_score
int64
3
5
detected_licenses
listlengths
0
67
license_type
stringclasses
2 values
text
stringlengths
12
5.47M
download_success
bool
1 class
b6bfb28cfd4ceb8da66d3a170374ca817838b6a3
Python
hygnic/boomboost
/hyosmnx/main.py
UTF-8
1,768
2.859375
3
[]
no_license
#!/usr/bin/env python # -*- coding:utf-8 -*- # --------------------------------------------------------------------------- # Author: LiaoChenchen # Created on: 2021/3/19 13:53 # Reference: https://towardsdatascience.com/making-artistic-maps-with-python-9d37f5ea8af0 """ Description: Usage: """ # ------------------------...
true
6e07b6182a4444fa01cfc2a431b19c4f902fd836
Python
JeK2a/UchetTrat
/cursValut.py
UTF-8
803
2.75
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib.request from xml.etree import ElementTree as ET # Получение курса доллара def getCursUSD(): valuta = ET.parse(urllib.request.urlopen("http://www.cbr.ru/scripts/XML_daily.asp?date_req")) for line in valuta.findall('Valute'): id_v = line.get(...
true
018fdcc0beacdb0b6b76f27678cd0856116bf639
Python
Gavin666Github/yolo3-keras
/tool/brainwash_annotation.py
UTF-8
1,098
2.5625
3
[]
no_license
def convert_to_yolo(f_r, f_w): for line in f_r: line = line.replace('"', '') line = line.replace(':', '') line = line.replace('(', '') line = line.replace('),', '') line = line.replace(');', '') line = line.replace(').', '') line = line.replace('\n', '') ...
true
3951a4db1358907389df58c063e71364b02a1d95
Python
rcpsilva/InFTS2018-12
/animation_fts.py
UTF-8
2,823
2.546875
3
[]
no_license
from matplotlib import animation import pertinence_funcs as pf import numpy as np import matplotlib.pyplot as plt from fts_concrete import ConcreteFTS from fts_stream import StreamAdaptiveWindowFTS from fts_incremental_rule_deletion import IncMuSigmaRuleDeletionFTS #Fts order order = 3 nsets = 9 window_size = 100 # G...
true
aa6fdc80e820b53b87bb8022ce923c8a3f1b4ecd
Python
miraedbswo/DMS-Backend
/Server/tests/v1/views/admin/account/test_account_control.py
UTF-8
3,058
2.609375
3
[ "MIT" ]
permissive
from tests.v1.views import TCBase from app.models.account import SignupWaitingModel class TestDeleteAdminAccount(TCBase): """ TC about admin account deletion This TC tests * DELETE /admin/account-control """ def setUp(self): """ - Before Test Create new admin acc...
true
908a4cfd870fc703d75ab3f0c484cd305a402029
Python
skyyi1126/leetcode
/1192.critical-connections-in-a-network.py
UTF-8
1,219
3.1875
3
[]
no_license
# # @lc app=leetcode id=1192 lang=python3 # # [1192] Critical Connections in a Network # # @lc code=start import collections class Solution: def criticalConnections(self, n: int, connections): index = {} low = {} G = collections.defaultdict(list) for v1, v2 in connections: ...
true
f42280ea431710c79d2e45f15da7cb2ab5fe5a03
Python
e2fyi/py-utils
/e2fyi/utils/aws/s3_resource.py
UTF-8
12,402
3.015625
3
[ "Apache-2.0" ]
permissive
""" Provides `S3Resource` to represent resources in S3 buckets. """ import io import json import os.path from uuid import uuid4 from typing import Union, Generic, TypeVar, Callable, Optional import boto3 from e2fyi.utils.aws.s3_stream import S3Stream T = TypeVar("T") StringOrBytes = TypeVar("StringOrBytes", bytes, ...
true
eadcab4a53de592224b6390847a811b099bbce12
Python
Skyrich2000/Algorithm
/4_BruteForce/b_1182.py
UTF-8
500
2.78125
3
[]
no_license
n, s = map(int, input().split()) lst = list(map(int, input().split())) count = 0 def check(pick, newflag): newpick = [e for e in pick] newpick[newflag] = 1 global count summ = 0 for i in range(n): summ += lst[i] * newpick[i] if summ == s: count += 1 for i in range(newflag ...
true
0a5d0e8e8d54a46ce55d71d14295c0396a595f3b
Python
nabeen/AtCoder
/abc/abc028/a.py
UTF-8
334
3.046875
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- # https://atcoder.jp/contests/abc028/tasks/abc028_a def main() -> None: N = int(input()) if N <= 59: print('Bad') elif N <= 89: print('Good') elif N <= 99: print('Great') else: print('Perfect') if __name__ == '__main__...
true
92bbd5cb58f62f019bfadc8597cbf515f93d3ae8
Python
Fernweh-yang/TUM-Assigments
/Mobile Robotik in der Intralogitik/Python Vorlagen Neu/01_Kinematik/20200930_Kinematik_Aufgabe3_Studentenversion.py
UTF-8
14,563
3.171875
3
[]
no_license
from __future__ import print_function from __future__ import division import time as t import brickpi3 import math import numpy as np inf = math.inf #Unendlich definieren #Test for infinity: x = inf; math.isinf(x) ######################################## #BrickPi und dessen Anschlüsse definieren #-------...
true
8958ac4b6eb27410f6f4c2f9da144e53f7c17762
Python
arshharkial/Stock-Price-Prediction
/closing_price.py
UTF-8
2,481
3.140625
3
[]
no_license
#Importind necessary libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt from keras.models import Sequential from keras.layers import LSTM, Dense from sklearn.preprocessing import MinMaxScaler import h5py #Importing dataset dataset = pd.read_csv("NSE-Tata-Global-Beverages-Limited.csv") dat...
true
a9b84ae36ac10e4fd4747f8f96769fcadaa0414b
Python
Hnton/math318
/Project10.py
UTF-8
1,047
3.390625
3
[]
no_license
# Mikael Hinton # Project 10 def eucx(d0,d1): x0=1 y0=0 x1=0 y1=1 while d1 !=0: q=d0//d1 d2=d1 x2=x1 y2=y1 d1=d0%d1 x1=x0-q*x1 y1=y0-q*y1 d0=d2 x0=x2 y0=y2 # print("d0=",d0,"d1=",d1,"q=",q,"x0=",x0,"x1=",x1,"x2=",x2,"y0=",y0,"y1",y1,"y2=",y2) return (d0,x0,y0) def modexp(base, exponent, mo...
true
e6c3459e711c9a2c0a40c8cd12414eb4bc9f0ef5
Python
popexizhi/client2app
/httper.py
UTF-8
1,664
2.515625
3
[]
no_license
#-*- coding:utf8 -*- import urllib, urllib2 import cookielib import json class httper(): def __init__(self, http_ip = "192.168.1.43"): self.http_ip = http_ip def register_app_server(self, url_id, name, key, serial): "post id+key+serial /api/admin/register_app_server" sel...
true
a90e189a44d0a80ba51b80d4ce19d72031a91196
Python
Sasium/randomstuff
/processor.py
UTF-8
4,828
3.25
3
[]
no_license
def matrix_reader(a, b): print(b) matrix_parameters = a.split() return [input().split() for _ in range(int(matrix_parameters[0]))] def main_transpose(a): return [[x[i] for x in a] for i in range(len(a[0]))] def side_transpose(a): return [[x[i] for x in a[::-1]] for i in range(len(a[0]) - 1, -1,...
true
3fbbf063764ee7a14e3881d3f6b083e6b1f5cbf5
Python
agermain/Codewars
/6-kyu/are-they-the-"same"?/python/solution.py
UTF-8
323
3.140625
3
[]
no_license
import math def comp(array1, array2): print(array1, array2) if array1 is None or array2 is None: return False array1 = [abs(x) for x in array1] for num in array2: if math.sqrt(num) in array1: array1.remove(math.sqrt(num)) else: return False return Tru...
true
17de7975359b1d1107e660652cf15fa66a77cab3
Python
raechen1007/ga_synthesiser
/individual.py
UTF-8
3,713
3.109375
3
[]
no_license
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from math import sqrt import numpy as np from numpy.random import choice from operators.mutations import uniformMutation ''' Initial individuals generating functions ''' def unifor...
true
1e87ded83040317823fc56cf89ab99fb9a55d7ce
Python
peterdsharpe/AeroSandbox
/aerosandbox/dynamics/point_mass/point_1D/horizontal.py
UTF-8
1,894
2.859375
3
[ "MIT", "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-other-permissive" ]
permissive
from aerosandbox.dynamics.point_mass.point_3D.cartesian import DynamicsPointMass3DCartesian from aerosandbox.weights.mass_properties import MassProperties import aerosandbox.numpy as np from typing import Union, Dict, Tuple class DynamicsPointMass1DHorizontal(DynamicsPointMass3DCartesian): """ Dynamics instan...
true
739a784cf65f6169cc5d7abcef6ca5d02a734b04
Python
MRonald/exercicios-python
/Heranca/Amigo.py
UTF-8
624
3.03125
3
[]
no_license
from Heranca.Contato import Contato from Heranca.Pessoa import Pessoa class Amigo(Pessoa, Contato): todos_amigos = [] def __init__(self, nome, idade, sexo, email, linkedin, github): self.nome = nome self.idade = idade self.sexo = sexo self.email = email self.linkedin =...
true
15252a6666d41cc1ff9aa6099518214563b0e3b9
Python
ucsb-coast-lab/area_from_svo
/plot_results.py
UTF-8
4,120
3
3
[]
no_license
#!/usr/bin/python3 import numpy as np from numpy import genfromtxt import os, sys import matplotlib.pyplot as plt import matplotlib.mlab as mlab from scipy.stats import norm # We're going to open the results csv file, and write all the valid results to another # data file def import_data_from_csv(filename): # fil...
true
d665433fe48b046af508245da8031887e9d8a6c4
Python
b21quocbao/Competitive-Programming
/BGGCD.PY
UTF-8
516
2.609375
3
[]
no_license
from __future__ import print_function import sys def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) import os.path import math if os.path.isfile("test.inp"): sys.stdin = open("test.inp", "r") sys.stdout = open("test.out", "w") elif os.path.isfile("BGGCD.inp"): sys.stdin = open("BGGCD.i...
true
df660c52545797c62fd4cec61d5dc2f4d2d4d982
Python
Orlha/TLS
/TLS/kuznyechik/block_cipher_mode.py
UTF-8
3,017
2.640625
3
[]
no_license
import os import sys block_cipher_mode_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(block_cipher_mode_dir, '../../')) from TLS.kuznyechik.block_cipher import * class BlockCipherMode: def __init__(self, block_cipher: BlockCipher): self.cipher = block_cipher def encry...
true
5f3aa291e91fd4a91aa36d9b95ffde92bab9cb6f
Python
link-money-dev/robot
/tasks/issue_assets.py
UTF-8
7,556
2.65625
3
[ "MIT" ]
permissive
# -*- coding: UTF-8 -*- # 该模块给出了一个发行数字资产的例子 # 发行资产需要两个账户:一个是发行账户,一个是分发账户,产生的资产在分发账户里 # 对于本例,产生的资产咋子distributor这个账户里 # 发行账户即: # 分发账户即: import wrapper.client as CLIENT import CONSTANT constant=CONSTANT.Constant('public') issuer_private_key_for_LINK='SDCCOAL6ILCJXWQPDZLRNHTMAHLZHC2IIHGPSQMLSIPHRTLNCFNT4A66' issuer_ad...
true
9cc9256022dd5d8aea2e7d25f5b3c3c3d0b88dbb
Python
sagarnikam123/learnNPractice
/codingBat/python/string1/frontAgain.py
UTF-8
868
3.203125
3
[ "MIT" ]
permissive
####################################################################################################################### # # frontAgain # # Given a string, return true if the first 2 chars in the string also appear # at the end of the string, such as with "edited" # #############################################...
true
01e7958ca2aa13644fd628351c7df0d47a6f9837
Python
stellaluminary/Baekjoon
/2110.py
UTF-8
452
2.890625
3
[]
no_license
# n, c= 5,3 # l = sorted([1,2,8,4,9]) n,c = map(int, input().split()) l = sorted([int(input()) for _ in range(n)]) start = 1 end = l[n - 1] - l[0] while start <= end: cnt = 1 mid = (start + end) // 2 current = l[0] for x in l: if current + mid <= x: cnt += 1 current = x...
true
417e6e9ac20164065cd88aca183e161919c88db6
Python
hinriksnaer/Basic-Transformer
/trainer.py
UTF-8
5,212
2.640625
3
[]
no_license
import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import pytorch_lightning as pl from model import TransformerEncoder, PositionalEncoding from scheduler import CosineWarmupScheduler class TransformerPredictor(pl.LightningModule): def __init__(self, input_dim, model_di...
true
1007d77674650f04d823163fbf8ce056e07ac436
Python
adamcath/mailr
/mailr
UTF-8
3,060
2.78125
3
[]
no_license
#!/usr/bin/env python import argparse import csv import tempfile import os import sys def fail(msg, errno): sys.stderr.write(msg + "\n") sys.exit(errno) def cli(): parser = argparse.ArgumentParser(description="Send builk emails") subparsers = parser.add_subparsers() build_parser = subparser...
true
660e7f5dd2047d82cabe1705b80101c36ce395b9
Python
pedrozopayares/Data-Structure-and-Algorithms
/Python 3/BubbleSort.py
UTF-8
1,623
4.0625
4
[]
no_license
''' << Bubble Sort Algorithm >> Sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted. The algorithm, which is a comparison...
true
992b562a47c5b3195f1c7db721776c4aefef2bfa
Python
billwestfall/python
/miscellaneous/sudoku/002_three.py
UTF-8
301
3.34375
3
[]
no_license
import numpy as np a1 = [6, 6] arr = np.random.randint(1, 4, size = (3, 3)) arr_sum = np.sum(arr, axis=1) arr_sumb = np.sum(arr, axis=0) print('-----Generated Random Array----') print(arr) if np.array_equal(arr_sum, a1) and np.array_equal(arr_sumb, a1): print(arr_sum) else: print("Not sudoku")
true
8b3cd836c3d666cb5a4d8127704089667e761b9e
Python
jose-myvalue/investment
/app/value/fundamentals.py
UTF-8
21,592
2.59375
3
[]
no_license
from datetime import datetime from typing import Dict from app.value.forecast import ForecastLR from app.value.utils import Utils import pandas as pd import numpy as np pd.options.display.float_format = "{:.2f}".format pd.options.mode.chained_assignment = None np.set_printoptions(suppress=True, formatter={"float_ki...
true
412eba15b19d85b9e018fe0e8d11b01239bbe539
Python
aganpython/laopo3.5
/python/Socket&Twisted/T_TCPClient.py
UTF-8
402
2.65625
3
[]
no_license
# -*- coding: utf-8 -*- from socket import * HOST = 'localhost' PORT = 10001 BUFFER = 1024 ADDRESS = (HOST, PORT) clientSocet = socket(AF_INET, SOCK_STREAM) clientSocet.connect(ADDRESS) while True: data = input('> ') if not data: break clientSocet.send(data.encode()) data = clientSocet.recv(BU...
true
904a893b7495a25fc43bb14f22448d6a894f30aa
Python
yongkwangshin/tensorflow
/cnn.py
UTF-8
3,250
3.3125
3
[]
no_license
# cnn.py: MNIST image recognition with CNN # written by Sung Kyu Lim # limsk@ece.gatech.edu # 12/18/2017 # B1: import tensorflow import tensorflow as tf import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' # B2: MNIST data set up from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.re...
true
c295b6a3c141e4f8b97e044c2d86d663bb74abf5
Python
loggar/py
/py-core/io/io_file_position.py
UTF-8
366
3.5625
4
[]
no_license
#!/usr/bin/python3 # Open a file fo = open("./dist/foo.txt", "r+") s = fo.read(10) print("Read String is : ", s) # Check current position position = fo.tell() print("Current file position : ", position) # Reposition pointer at the beginning once again position = fo.seek(0, 0) s2 = fo.read(10) print("Again read Strin...
true
7c7b56f08a053ccde1ea3fe8398cb9e70634365a
Python
Aasthaengg/IBMdataset
/Python_codes/p02855/s871657124.py
UTF-8
1,317
2.796875
3
[]
no_license
H, W, K = map(int, input().split()) L = [] for _ in range(H): s = input() row = [] for j in range(len(s)): row.append(s[j]) L.append(row) # print(L) ans = [[0] * W for _ in range(H)] # ans[0][1] = 1 # print(ans[0][1]) color = 1 count = 0 for i in range(H): if '#' not in L[i]: for ...
true
660cc397886fb61f763d77f7e3fe135a22e321a0
Python
553672759/xxgit
/python/old/exercise/testDir/zidian.py
UTF-8
469
3.171875
3
[]
no_license
#coding:utf8 ''' Created on 2016-10-22 @author: xx ''' ''' 字典:一种映射关系 ''' #创建字典的方式 aInfo={'aaa':3000,"bbb":5000} info=[('aaa',3000),('bbb',5000)] bInfo=dict(info) cInfo=dict([('aaa',3000),('bbb',5000)]) dInfo=dict(aaa=3000,bbb=5000) fInfo=dict((('aaa',3000),('bbb',5000))) print fInfo aDict={}.fromkeys(('aaa','bbb','ccc...
true
6b7825de617ca9dbbbccd3f2cf4354856a002991
Python
rentfrow/DAQ_Logger
/DAQ_errors.py
UTF-8
23,147
2.71875
3
[]
no_license
#!/usr/bin/env python3 # SCPI Errors # -100 to -200 Command Errors # -200 to -299 Execution Errors # -300 to -399 SCPI Specified Device-Specific Errors # -400 to -800 Query and System Errors # 100 to 200 PNA-specific Errors # http://na.support.keysight.com/pna/help/latest/Support/SCPI_Errors.htm # -100 to -200 Comma...
true
ec266104bb8a2250332fc51644c80cff91742402
Python
captainsoma/midi_websocket_chesscam
/Server/hub_alt.py
UTF-8
2,619
2.59375
3
[]
no_license
#!/usr/bin/env python # WS server example import websockets import concurrent import json from Server.chesscam import ChessCam import asyncio import config class Hub: def __init__(self): # First we setup the chesscam self.cam = ChessCam() self.connected = False self.sequence_rea...
true
9bfb716a185cde5032832575bb8f0fd123ad98ca
Python
tws0002/helga
/helga/maya/arash/helga_rig_functionality/helga_rig_functionality.py
UTF-8
3,964
2.734375
3
[]
no_license
""" helga_rig_functionality ========================================== Rig helper functionality. This module separates the functionality of interacting with the Helga rigs from any UI. It encompasses functions used with Maya modules. There is no import of PySide in here. All UI tools that let you work with the rigs ...
true
161765f67126ccdd5db4262f078bb6b846e0af38
Python
benvizy/space-invaders
/enemy.py
UTF-8
1,885
3.84375
4
[]
no_license
from turtle import Turtle from bullet import Bullet import random MOVE_DISTANCE = 10 MOVE_INCREMENT = 10 ENEMY_NUMBER = 50 LEFT_B = -300 RIGHT_B = 300 def random_color(): r = random.randint(1, 255) g = random.randint(1, 255) b = random.randint(1, 255) ran_col = (r, g, b) return ran_col class Ene...
true
ff01bf2e01b1492411ec8b380590ad054df409d8
Python
sukku777/lists-in-python
/to find largest element in list.py
UTF-8
45
2.609375
3
[]
no_license
d=[23,45,6,78,98,34,67] k=max(d) print(k)
true
b29a6e9296e5bc850d972e623770cfb3446e7c29
Python
JamesDanni/PythonSpiderStudy
/study09-SeleniumSpider/doubanmovie.py
UTF-8
2,154
3.21875
3
[]
no_license
#coding=utf-8 from time import sleep as s from urllib import parse from selenium import webdriver import csv class DouBan(): def __init__(self,page_count): self.dv = webdriver.Chrome() self.page_count = page_count #点击加载更多的次数 self.data = [] #获取页面信息 def get_page_data(...
true
6593c8ae5a60f6e8219d2fa0e67a8d29bd39d71b
Python
IMIO/imio.pyutils
/imio/pyutils/utils.py
UTF-8
7,362
3.046875
3
[]
no_license
# -*- coding: utf-8 -*- # # python utils methods # IMIO <support@imio.be> # from collections import OrderedDict, defaultdict from itertools import chain from operator import methodcaller import copy import itertools import logging import time import timeit def all_of_dict_values(dic, keys, labels=[], sep=u'='): ...
true
60589bd98bc55e8a7366b9645d14f120128cf17b
Python
rafatio/cornetometro
/build_classifier.py
UTF-8
1,930
3.15625
3
[]
no_license
import os import nltk.classify.util from nltk.classify import NaiveBayesClassifier from nltk.corpus import stopwords from numpy.random import randint import collections import pickle # THIS FILE TAKES THE BEST APPROACH FROM sentiment_analysis.py AND PROVIDES A WAY TO SAVE THE CLASSIFIER IN A FILE def get_classified_t...
true
71acfb808427ca0b542b38a3ac758a1b1185ab36
Python
Prdeeepg/Epitranscriptome-Analysis
/kmeancluster_orignal.py
UTF-8
2,111
2.859375
3
[]
no_license
from scipy import stats import numpy as np from scipy.stats import fisher_exact import matplotlib.pyplot as pyplot from sklearn.cluster import KMeans def kmeans(file_string,f,outfile): normed = np.loadtxt(file_string, usecols=(1, 2), dtype = 'float', skiprows=1) normed = normed.astype(float) gene_name =...
true
202382d1c96ada71601b423988fcccb9ffd091c0
Python
Carlosriosch/FiltersForSelfies
/intento3 (Falta Pulir)/recolectar_gestos.py
UTF-8
3,042
2.578125
3
[ "MIT" ]
permissive
#python intento3/recolectar_gestos.py --nombre fondo --dir C:\Users\carlo\Desktop\GitHub\FiltersForSelfies\intento3\capturas #la primera linea es para llamar al programa darle el nombre fondo a la carpeta y los archivos que se guaradar y la ubicacion. import cv2 as cv import os import numpy as np import argparse scr...
true
bd4052ef6502f65c427d46e6f3fe1da3321bee36
Python
duybui2905/C4T-13
/session9/turtle_color.py
UTF-8
159
3.53125
4
[]
no_license
from turtle import * mau = ["blue", "green", "red", "orange"] speed(-1) shape("turtle") for i in range (len(mau)): color(mau[i]) forward(50) mainloop()
true
54b336176e7db059a3cb3d72e377c74c13f4c7a6
Python
DimitarKum/Python-Beginner-Project
/generateData/generateProject.py
UTF-8
951
3.53125
4
[]
no_license
import random as rnd # This is the code that was used to produce the matches.csv file. # The code can be rerun to generate different matches data since the games are randomized. def main(): scientists = [ "Grace Hopper", "Alan Turing", "Marie Curie", "Charles Darwin", "Nikola Tesla", "Gregor Mendel...
true
09278ba1e2dbb378f416b8e7f0119fb5ed9037e6
Python
MrDetectiv/fb-labs-2020
/cp_2/Ivanchenkov_Melnychenko_Cp2/viginer_test.py
UTF-8
1,520
2.96875
3
[]
no_license
import unittest from viginer_lib import exclude_letters, crypt, decrypt, crypt_file, decrypt_file, algorithm1, shift_text, build_key import numpy as np key = 'абвгд' class TestMethods(unittest.TestCase): """ тест кодирования/декодирования текста """ def test1(self): with open('text1.txt', 'r', encodi...
true
77fffb5903d27b3143bbf6a89e7d08388aa29ac3
Python
zckoh/cf_cw1
/Q5/g-min-c.py
UTF-8
2,299
2.828125
3
[]
no_license
# -*- coding: utf-8 -*- """ File : g-min-c.py Author : zckoh Date : Wed Feb 20 21:20:20 2019 Brief : shortsale-constrained portfolio """ import numpy as np import pandas as pd from datetime import timedelta import matplotlib.pyplot as plt import math import scipy.io from scipy.optimize import mi...
true
97b2ca54b99381ba46e0fbdbff41c9580179bfcc
Python
marcos-sb/hacker-rank
/algorithms/strings/two-strings/Solution.py
UTF-8
354
3.21875
3
[ "Apache-2.0" ]
permissive
import sys t = int(sys.stdin.readline()) for _ in range(t): chars = dict() a = sys.stdin.readline().strip() b = sys.stdin.readline().strip() for c in a: chars[c] = 1 found = False for c in b: if c in chars: print('YES') found = True break ...
true
f262343f70c0cef246cde4ecbb0f62e29cacc57a
Python
Retroflux/FallGuysStats
/classes/Episode.py
UTF-8
1,912
3.078125
3
[]
no_license
# Episode = full round of games from start to finish # Number of rounds # Episode Number # Number of Team Games # Number of Solo Games # Final Placement Score class Episode: """docstring for Episode""" totalNumberOfEpisodes = 0 def __init__(self, numberOfRounds, episodeNumber, finalPlayerScore, listOfRou...
true
b1a0b8bb2d8df073cf0645a34130e9c14d4b0254
Python
protist/utils
/vwtags.py
UTF-8
2,292
2.875
3
[ "MIT" ]
permissive
#! /usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function help_text = """ Extracts tags from Vimwiki files. Useful for the Tagbar plugin. Usage: Install Tagbar (https://github.com/preservim/tagbar/). Then, put this file anywhere and add the following to your .vimrc: let g:tagbar_type_vim...
true
97f3ea3324f4793f29e0c2960593140aa53e08ba
Python
capitao-red-beard/fluent_python
/part_2/listcomps.py
UTF-8
653
4.65625
5
[]
no_license
# Example for why list comprehension is more readable than for loops. # Build a list of Unicode codepoints from a string (1) symbols = "$&@*^%" codes = [] for symbol in symbols: codes.append(ord(symbol)) print(codes) # Build a list of Unicode codepoints from a string (2) symbols2 = "$&@*^%" codes2 = [ord(symbol2)...
true
e6435c5379a5c24bde3206e72f611f3eef3100d2
Python
sebasrodas/DeepLearning
/AplicacionEjercicio1AND.py
UTF-8
2,103
2.796875
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Thu Jan 2 17:10:54 2020 @author: SEBAS """ import numpy as np import pandas as pn import matplotlib.pyplot as plt dataSwiches = np.array(pn.read_csv('trainAND.csv')) X_train = dataSwiches[:,1:] Y_train = dataSwiches[:,0] Z_train = dataSwiches[:,0] Y_train = Y_train[:,np.newaxi...
true
14b09c77777408740466c4b9d9c161db79e2d935
Python
shivamaroraa/CodeSignal
/Intro/Python/checkPalindrome.py
UTF-8
194
3.21875
3
[]
no_license
def checkPalindrome(inputString): isP = True for i in range(len(inputString)): if inputString[i] != inputString[len(inputString) - 1 - i]: isP = False return isP
true
1108fbdf0373a52f3be1ef3879ac9195be591d4e
Python
dariogomes/udacity
/Project1/Exercises/script.py
UTF-8
774
3.828125
4
[]
no_license
# coding: utf-8 # Começando com os imports import csv import matplotlib.pyplot as plt # Vamos ler os dados como uma lista print("Lendo o documento...") with open("capacity.csv", "r", encoding="utf-8", errors="ignore") as file_read: reader = csv.reader(file_read) data_list = list(reader) print("Ok! File Read."...
true
215fe67d71e01d9bdb128e4a349e2aa58e116e02
Python
ShreJais/GMM
/inference/tensorflow/gmm_means_cavi.py
UTF-8
8,339
2.5625
3
[]
no_license
# -*- coding: UTF-8 -*- """ Coordinate Ascent Variational Inference process to approximate a mixture of gaussians with common variance for all classes """ from __future__ import absolute_import import argparse import math import os import pickle as pkl import sys from time import time import matplotlib.pyplot as pl...
true
86bfa78a3a4e7a6bc9428420e6bef56805edf80c
Python
my-xh/cs-course-project
/homework/10_4_1.py
UTF-8
4,279
4
4
[]
no_license
""" AVL树 这是一种平衡树 每次插入key时,都会调整树的结构使其保持为平衡二叉树 每个节点都有平衡因子bf=左子树高度-右子树高度 如果bf>0说明左重,小于说明右重 如果bf在-1到1之间,称为平衡树 调整方法: 左重:如果左子节点右重,先左旋左子节点,再右旋当前节点 右重:如果右子节点左重,先右旋右子节点,再左旋当前节点 """ from pythonds.trees.bst import BinarySearchTree, TreeNode class AVLTree(BinarySearchTree): # 重新定义_put方法 def _put(self, key, val, current_n...
true
e474df0c448b1630b678756b1e08b9eeefc083dd
Python
Aasthaengg/IBMdataset
/Python_codes/p02971/s105000392.py
UTF-8
193
2.96875
3
[]
no_license
N = int(input()) A = [] for _ in range(N): A.append(int(input())) newA = sorted(A) ma = newA[N-1] for i in range(N): if A[i] == ma: print(newA[N-2]) else: print(ma)
true
eb6cc8ae81d7bf0555bd5eadda638542a417d60f
Python
fletchermoore/AnkiNotebooks
/src/anki_notebooks/exporter.py
UTF-8
1,735
2.625
3
[]
no_license
from anki.exporting import Exporter from .write import writeDoc from .paths import escapedCardToPath, pathsToBullets import re class DocExporter(Exporter): key = _("Cards as Word Document") ext = ".docx" def __init__(self, col): Exporter.__init__(self, col) def exportInto(self, path): ...
true
9ff7c88767b8edf11d570eac55cbc783e3491fd0
Python
JavaRod/SP_Python220B_2019
/students/alexander_boone/lesson01/activity/calculator/adder.py
UTF-8
265
2.90625
3
[]
no_license
""" This module provides a addition operator. """ class Adder: """Perform addition operation on two input parameters.""" @staticmethod def calc(operand_1, operand_2): """Return operand 2 plus operand 1.""" return operand_1 + operand_2
true
0e66afc27aae6360984a744e79a18f889048f363
Python
eliorcc/ieeextreme-programming-competition
/game_of_stones.py
UTF-8
518
3.34375
3
[]
no_license
test_cases = int(input()) result_list = [] for i in range(test_cases): number_of_games = int(input()) pile_size_list = [] sum = 0 for j in range(number_of_games): piles = int(input()) pile_sizes = input().split(" ") for t in pile_sizes: pile_size_list.append(int(t)) ...
true
234be0092c11de430b257d101c47ba0c9bc4096f
Python
hchen13/tof-ai
/gesture_python/data_preprocess.py
UTF-8
1,717
2.640625
3
[]
no_license
import matplotlib matplotlib.use('TkAgg') import cv2 import pathlib import settings def display_image(*images, col=None, width=20): from matplotlib import pyplot as plt import numpy as np if col is None: col = len(images) row = np.math.ceil(len(images) / col) plt.figure(figsize=(width, (w...
true
b0fa7cc5083081a65f4d588e64b83735bc248a30
Python
rjr5838/EagleIslandAddons
/libTAS/EagleIsland2libTAS.py
UTF-8
5,994
2.65625
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/env python # This script converts .tas files from EagleIsland TAS tool # (https://github.com/rjr5838/EagleIslandTAS/) to libTAS input file. # Just run ./EagleIsland2libTAS path/to/tasfile.tas import glob import math import os import re import sys def main(): EagleIsland2libTAS().convert() def get_li...
true
006df71f5d16a383d5ffc1deaaf3103b1e24cbc7
Python
shashasi/BRKRST-2600
/off_the_box_demo.py
UTF-8
2,204
2.734375
3
[]
no_license
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRE...
true
6da16cf57c15aff82bffc7af23df3fb5ed944b8f
Python
Emoto13/Python101
/week4/01.Mixins/mixins.py
UTF-8
2,266
3.09375
3
[]
no_license
import json from dicttoxml import dicttoxml import jxmlease class JsonableMixin: def to_json(self, indent=4): name = self.__class__.__name__ attributes = self.__dict__ return json.dumps({'type': name, 'dict': attributes}, indent=indent) @classmethod def from_json(cls, json_string)...
true
6c1d9099e93402d739b2425403094894ec17b3c2
Python
EdenAraura/Games-Programming
/Classwork/Lesson_3/pythonClass3.1.py
UTF-8
176
3.09375
3
[]
no_license
list = ["mix", "xyz", "apple", "xanadu", "rovio"] a = [] b = [] for y in list: if y[0] == "x": a.append(y) else: b.append(y) print(sorted(a)+sorted(b))
true
01260961e9ef81352241d8abadb9cdf833794a77
Python
JoakimHaurum/DL_Projects
/dlrepo/models/utils/saving.py
UTF-8
1,338
2.828125
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- """ @author: Joakim Bruslund Haurum """ import pickle import matplotlib.pyplot as plt import numpy as np def save_img_grid(dir_path, file_name, imgs, nh, nw, title = ""): """ Saves the provided 2D images in a grid of size nw x nh in the designated directory """ assert imgs....
true
43609764e36d6680a16efb14f09aaa507224d2fb
Python
chrishanson06/Flask-API
/Flask/database/models.py
UTF-8
1,724
2.796875
3
[ "MIT" ]
permissive
''' Models to serialize between MongoDB and Python ''' from .db import db from flask_bcrypt import generate_password_hash, check_password_hash import onetimepass import base64, os, random, string class Card(db.Document): name = db.StringField() content = db.StringField() width = db.IntField() height = db.IntFie...
true
8c279f90d982a5220b161d13665bed7b193f3270
Python
gholamifarshad98/Stereo_Vision_Camera
/stereo_cam_calibration/generate_stereo_calibration_remap_parameters.py
UTF-8
7,790
2.546875
3
[]
no_license
import numpy as np # version: '1.14.0' import cv2 # version: '3.1.0' import glob import pickle import os # Set root directory. rootDir = os.getcwd() print('\nrootDir = {}\n'.format(rootDir)) # Set parameter directory. dir_calib_parameter = rootDir+'/output/computed_calibration_parameters/' # Set original frames direct...
true
1afc70e1e5c789b406fd5a29134af939fc7f21b6
Python
Aasthaengg/IBMdataset
/Python_codes/p03549/s093548401.py
UTF-8
101
2.953125
3
[]
no_license
[n,m] = [int(i) for i in input().split()] x = (n-m) * 100 * (2**m) x += m * (2 ** m) * 1900 print(x)
true
44d02288b1ceac3e8cd0a87c4ca47e379441e21c
Python
databar-team/redis-flask-docker
/app.py
UTF-8
694
2.90625
3
[]
no_license
import os from flask import Flask, request from redis import Redis app = Flask(__name__) redis = Redis(host='redis', port=6379) @app.route('/') def hello(): return "Go on /put route to put data, and on /get to read your data" @app.route('/put', methods=['GET', 'POST']) def put(): if request.method == 'POST':...
true
2ac956012e4c1aec24afd7404cf8cae5588feaa1
Python
ThorkellTheTall/Violeth
/Combat.py
UTF-8
4,959
2.625
3
[]
no_license
import pygame from pygame.locals import * from sorts import * from Personnage import * from mobs import * from Barre_de_vie import * from level import * from afficheur import * image = pygame.image.load("interface combat.png") pygame.init() pygame.mouse.set_visible(1) global scre...
true
1c85a0a576082e4154f1b63e40c1186be45d9de2
Python
Descent098/projects-experiments
/Languages/Python/snippits/string_similarity.py
UTF-8
2,076
3.5
4
[ "MIT" ]
permissive
# See https://gist.github.com/Descent098/dae85d0235acce5322bf1277d1372a7e from difflib import SequenceMatcher # Faster when used with python-Levenshtein, but causes some issues from fuzzywuzzy import fuzz from fuzzywuzzy import process ##################### Single word similarity ##################################...
true
f917f98f59de324fa7cc04a9e26e8ee9e7b02c4e
Python
dlatnrud/pyworks
/media_turtle/move_random.py
UTF-8
258
3.484375
3
[]
no_license
# 마음대로 걷는 거북이 import turtle as t import random t.shape('turtle') t.bgcolor('pink') t.color('blue') t.speed(5) for x in range(300): angle = random.randint(1, 360) # 1 ~ 360도 랜덤한 각도 t.setheading(angle) t.forward(10)
true
ace290279810c49d135c771135cb48e9d66de17e
Python
adelamegaa/Quiz-4
/Quiz43_Adela Mega Aglina_1201184258.py
UTF-8
233
3.609375
4
[]
no_license
ListGPA = [2.1, 2.5, 4, 3] def Hadiah (GPA): Bonus = 500000 Hadiah = GPA * Bonus return Hadiah for GPA in ListGPA: if GPA > 2.5: print('Hadiah : Rp ', Hadiah (GPA)) else: print('Maaf')
true
85d3d770290c89d6961b376b22ec80e0a133095b
Python
ChaofeiLiu/D.S
/DS_sort_set/binarysearch.py
UTF-8
1,015
4.03125
4
[]
no_license
#!/usr/bin/env/ python # -*— coding=utf-8 -*- # @FileName :binarysearch.py # @Time :2020/8/16 # @Author: chaofei_liu # 普通实现 def binarysearch(alist,item): first = 0 last = len(alist) - 1 found = False while first <= last and not found: midpoint = (first+last) // 2 if alist[midpoint] == ...
true
3d96ab92b306088145c0a74855e9ebd8aba1ff2c
Python
AndrewBatty/Iteration
/Iteration_Development_Exercise2.py
UTF-8
261
3.734375
4
[]
no_license
# Andrew Batty # 29/10/14 # Development exercise 2 stars = int(input("Please enter the number of stars per row you would like: ")) rows = int(input("Please enter the number of rows you would like: ")) for count in range(rows): print("*" * stars)
true
8f2a6902d6e0f1a1c6173c2789e6f1420a0e2763
Python
xtreezzz/msp_lesson2
/if_string.py
UTF-8
477
3.78125
4
[]
no_license
def string_checker(_s1, _s2): if isinstance(_s1, str) and isinstance(_s2, str): if _s1 == _s2: return 1 elif len(_s1) > len(_s2): return 2 elif _s2 == 'learn': return 3 else: # Недостоющиее условие return 4 else: ...
true
abe126c148b6bb23f3ba17a496b1dd87f8e351e4
Python
rstreppa/algorithms-Basics
/DataStructures/test_queue.py
UTF-8
665
3.21875
3
[]
no_license
# -*- coding: utf-8 -*- """ @date: Tue Jan 11 21:56:07 2022 @author: rstreppa ( roberto.strepparava@gmail.com ) @company: https://github.com/rstreppa @type: test @description: test file for script C:/Users/rober/OneDrive/Documents/Library/Programming/Data_Structures/Queue/queue.p...
true
cc13c924afea8d14bd511b57c36821114f371bab
Python
okiki-oliyide/aws_projects
/shows/streamer_rule_config_builder.py
UTF-8
1,460
2.609375
3
[]
no_license
import json channel_count = 40 udp_start_emx = 20001 cameras_list = [] streams_list = [] stream_source = [ "emx" , "eml" ] # for each channel : port_increment = 0 for channel_number in range(0,channel_count): for source_type in stream_source: if source_type == "emx": udp_start = udp_start_em...
true
7420b14764cc71f08b851c464156328af9753c2e
Python
FrancescoGobbo/Python
/libreriaPython.py
UTF-8
268
4
4
[]
no_license
#questo programma ci fornisce 10 numeri casuali tra 1 e 50 import random from math import sqrt for numero in range(10): valore=random.randint(1,50) print(valore) print("\nValore: " + str(valore)) k=sqrt(valore) print("\nValore SQRT: " + str(k))
true
886384daedb97de230e8ff33c72da1faafec912e
Python
nombreinvicto/OpenCV
/ocv_mallick/1.Course1-Intro/Project2_MouseEventHandling/submission_trackbar.py
UTF-8
2,634
3.140625
3
[]
no_license
import cv2 import numpy as np # resize function def resize(image: np.ndarray, target_size=(400, 400)): return cv2.resize(image, dsize=target_size) # putText function def put_text(image: np.ndarray): image_height = image.shape[0] cv2.putText(image, 'Hit ESC to close Window', (10, image_he...
true
cca40679b6e368b862143f055c6e344ccf3cae7c
Python
gunyarakun/nicotagmap
/png2tile.py
UTF-8
415
2.796875
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import math import Image, ImageDraw, ImageFont print sys.argv[1] img = Image.open(sys.argv[1]) width, height = img.size cols = int(math.ceil(width / 256.0)) rows = int(math.ceil(height / 256.0)) for y in range(rows): for x in range(cols): tile = img.cro...
true
00f22eac5f9a017afe03ea3d4d7e88d221b634aa
Python
tpt5cu/python-tutorial
/language/python_369/python_369/popular_modules/tempfile_/introduction.py
UTF-8
3,491
3.796875
4
[]
no_license
# https://docs.python.org/3.7/library/tempfile.html import tempfile, pathlib, os this_dir = pathlib.Path(__file__).parent ''' - TemporaryFile, NamedTemporaryFile, TemporaryDirectory, and SpooledTemporaryFile are high-level interfaces whose resources can be automatically removed when the script is finished - mks...
true
c2538eabaae13e128e64079a37259309bd5d2f16
Python
LaPetiteBiche/take-home_exam1_prog
/HT1_ArthurBonetti/Question_3/question_3c.py
UTF-8
106
3
3
[]
no_license
from Polar_Class import * p1 = Polar(1,1) print(p1) p2 = Polar(7,3) print(p2) p3 = Polar(12,23) print(p3)
true
6a87579a35cfb25f1ad6ae2af6fb2fafd9f8398d
Python
zhaoweikid/zbase3
/web/cache.py
UTF-8
6,201
2.90625
3
[]
no_license
# coding: utf-8 import os, sys import time import traceback import types import logging log = logging.getLogger() # 两种缓存模式 # 1. 所有缓存key共用同一个更新函数 # 2. 缓存为每个key都设置一个更新函数 class Cache (object): def __init__(self, func=None, timeout=10): self._cache = {} # 以下为缓存模式1所用,只有模式1才需要 self._func = func ...
true
13de5563be6926a7302e2e86c18dc93bbbcb968a
Python
janakparmar9491/The-Complete-Python-Masterclass-Learn-Python-From-Scratch
/2-Control-Structure-In-Python/2-Intro-List.py
UTF-8
165
3.515625
4
[]
no_license
people = ["Janak","Kuldip","Jakey","Ashok","Vijay"] print(people[2]) print(people[0:3]) num = [1,2,3,4,5] print(num) a = [] ###define list just like array print(a)
true
02a1f72b8ab33d359f6add2e9886815b844929ba
Python
sadiqulislam/Python-Practice-All-
/globalvariableKeyword.py
UTF-8
73
3.15625
3
[]
no_license
g = 10 def rise(m): l = 10 b = g + l print(b,m) rise("We")
true
e5457e2238d350ed473608e2ba0d8235b00ef883
Python
HubertSiewior/Python-AGH-Projects
/software engineering - project/tests/test_get_module_usage.py
UTF-8
2,618
2.828125
3
[]
no_license
import os import unittest from H1 import get_module_usage as gmu class TestStringMethods(unittest.TestCase): def test_get_node_data(self): path_dir = '../test_dir2' os.mkdir(path_dir) path1 = os.path.join(path_dir, 'test_file1.py') f1 = open(path1, "w+") f1.write("# !/us...
true
cf94fba585717e105b9bb2087c07596d895e0534
Python
MrPx/1521006homework
/1520873-实验三/testHello.py
UTF-8
596
2.671875
3
[]
no_license
import unittest from hello import User from hello import db class TestHello(unittest.TestCase): def setUp(self): db.create_all() def tearDown(self): db.drop_all() def test_creatUser(self): a=User('shenqianqian') self.assertEqual(a.username,'shenq...
true
21a884cafccf86053831561a183c2fbdd6ab45d8
Python
sid597/Nand-To-Games
/projects/08/directoryTranslator.vm.py
UTF-8
903
2.515625
3
[]
no_license
import os import inspect class Parser: def __init__(self, dir_name): self.dir_name = dir_name def parse_directory(self): for dirpath, dirnames, files in os.walk(self.dir_name): dir_name = dirpath.split('/')[-1] for file_name in files: if file_name.endswi...
true
0fdaa85ba85d159ee63797357480c004ae5d50f4
Python
bcogrel/webid-delegated-auth
/webid_delegated_auth/exceptions.py
UTF-8
3,704
2.59375
3
[ "LicenseRef-scancode-mit-old-style", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
""" Exceptions. Compatibility with those declared in https://auth.my-profile.eu/ """ NO_CLAIM_CODE = "noClaim" NO_CERT_CODE = "nocert" CERT_NO_OWNERSHIP_CODE = "certNoOwnership" REJECTED_CLAIM_CODE = "rejectedClaim" CERT_WITHOUT_URI_CODE = "noURI" EXPIRED_CERT_CODE = "certExpired" UNDECLARED_CERT_CODE = "noVe...
true
d958fef1388426fc3e4f7703dc8e066f49b8fba2
Python
alfredo-gimenez/sos_flow
/src/soapy/draw.py
UTF-8
2,534
2.78125
3
[ "LicenseRef-scancode-other-permissive" ]
permissive
import os import sys import sqlite3 import numpy as np import pylab as pl from data_utils import is_outlier # name of the sqlite database file sqlite_file = os.environ.get("SOS_LOCATION", ".") + "/" + sys.argv[1] table_name = 'tblvals' # name of the table to be queried print("Connecting to: ", sqlite_file) # Conn...
true
8dd5b717d5758d93183bc90d9e3a6c64dee6ceae
Python
MimiBambino/MachineLearning
/poi_id.py
UTF-8
8,911
2.671875
3
[]
no_license
#!/usr/bin/python import sys import pickle sys.path.append("../tools/") from feature_format import featureFormat, targetFeatureSplit from tester import test_classifier, dump_classifier_and_data from sklearn.preprocessing import MinMaxScaler #from sklearn.pipeline import Pipeline from sklearn.decomposition import Rand...
true
0d3dfc4315e122d445a741a9f63a18185ad394b4
Python
Jav1-Mart1nez/W4-apis-project
/src/main.py
UTF-8
1,739
2.921875
3
[]
no_license
import argparse import pandas as pd import genera_args as gen_a def main(): # Importamos el DataFrame que queremos filtrar. videogames = pd.read_csv("../outputs/clean_metacritic_games.csv") args = gen_a.filtro() release_date = args.year platform = args.platform genre = args.genre metascore...
true
d2d78c3ccb6719074eae1f8a56392bc72a90aec4
Python
lafionium/DMI
/PYTHON/hello.py
UTF-8
1,120
2.96875
3
[]
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- #print "Hello World!" ''' print "Here \bthe \bspaces \bare \bbackspaced." raksta bez atstarpem \b peremesaet kursor nazad ''' ''' print "Here \nthe \nspaces \nare \nnewlined." piwet kazdoje slovo s novoj strocki \n ''' ''' print "Here \tthe \tspaces \thave \thorizontal ...
true
d132790a36b255338fb6c7c2e4d8a93672844710
Python
LauraAndreaM/rpi-digitales3
/led.py
UTF-8
294
3.46875
3
[]
no_license
#Encender Leds por teclado import time import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(5, GPIO.OUT) while(True): teclado= input("'a' encendido, 'b' apagado:") if teclado == "a": GPIO.output(5,True) if teclado == "b": GPIO.output(5,False) GPIO.cleanup()
true
2b54df2fa836be9abc8153fee971373ae8101240
Python
RenukaNaik/Python
/positiveNum.py
UTF-8
756
3.8125
4
[]
no_license
#let's code loops! #Task 2: #Write a python program to print all positive numbers in a range list1=[] list2=[] n=int(input('enter number of elements: ')) i=0 while i<n: num=int(input()) list1.append(num) i=i+1 print('Input list: ',list1) for j in list1: if(j>0): list2.append(j)...
true
a250484426993a385e5628dd76d9aefa54ee947b
Python
alvinwang922/Data-Structures-and-Algorithms
/Queues/Sliding-Window-Max.py
UTF-8
986
4.125
4
[]
no_license
""" Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Return the max sliding window. Follow up: Could you solve it in linear time? """ cl...
true
c27bdd751c3061be4b4ccc0716469451078314c9
Python
SanjitRao/multiGameApp
/Unit4Project/httpdb_data server.py
UTF-8
1,598
2.703125
3
[]
no_license
import wsgiref.simple_server import urllib.parse from cs043_lesson2_2.database import Simpledb def application(environ, start_response): headers = [('Content-Type', 'text/plain; charset=utf-8')] path = environ['PATH_INFO'] params = urllib.parse.parse_qs(environ['QUERY_STRING']) db = Simpledb('datafi...
true