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 |
|---|---|---|---|---|---|---|---|---|---|---|
903034d7ef7cfcbadcd5c9b2e9ca890dc652d93f | SUNGNOX/python0 | /builded_in/Iter_Tools.py | UTF-8 | 599 | 3.9375 | 4 | [] | no_license | import itertools
print('从2开始计数')
co = itertools.count(2)
for i in co:
if i == 5:
break
print(i)
print('重复序列!')
cy = itertools.cycle('a,bc')
n = 1
for i in cy:
if n == 9:
break
print(i)
n = n+1
print("'a'重复3次")
re = itertools.repeat('a', 3)
for i in re:
print(i)
print("把两个迭代器组合... | true |
c2437276e0dd53cab2164c4889afca4f7cee9c9e | sine-fandel/HFM- | /RBMF.py | UTF-8 | 4,111 | 2.796875 | 3 | [] | no_license | import torch
import torch.nn as nn
import numpy as np
import torch.fft as fft
class RestrictedBoltzmannMachineModel():
"""
Implementation of RBM model
"""
def __init__ (self, nv, nh):
self.W = torch.randn(nv, nh)
self.a = torch.randn(nv)
self.b = torch.randn(nh)
self.W = self.W.double ()
self.a = self.a... | true |
7b0ac5e112c0c4601ea377e140e1858b2471af68 | kkrypt0nn/Python-Discord-Bot-Template | /cogs/general.py | UTF-8 | 9,031 | 2.625 | 3 | [
"Apache-2.0",
"Python-2.0"
] | permissive | """"
Copyright © Krypton 2019-2023 - https://github.com/kkrypt0nn (https://krypton.ninja)
Description:
🐍 A simple template to start to code your own and personalized discord bot in Python programming language.
Version: 5.5.0
"""
import platform
import random
import aiohttp
import discord
from discord import app_com... | true |
5ade26db304d4cb4e45cc11fb3dba3f54636d242 | Kslash2/python_scripts | /music.py | UTF-8 | 2,290 | 3.265625 | 3 | [] | no_license | import glob
import os
import sys
import json
def get_path():
#get path from parameters
if len(sys.argv) > 1:
if os.path.exists(sys.argv[1]):
path = str(sys.argv[1])
else:
path = 0
#get path of the script if path is not given as parameter
else:
path = os.... | true |
b493b8f0a74a10896566787ebd2c96b0365d2294 | imbd/CellsTypeDetermination-ML- | /main_for_new_data.py | UTF-8 | 5,770 | 2.515625 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
import os
from scipy import ndimage
from keras.models import Sequential
from keras.models import load_model
from keras.layers import Input, Dense, Flatten, Convolution2D, MaxPooling2D, AveragePooling2D
from keras.utils import np_utils
from keras.layers.core import Den... | true |
b37faba715e8d296a8340963026642f772d111e8 | dr-dos-ok/Code_Jam_Webscraper | /solutions_python/Problem_162/236.py | UTF-8 | 692 | 2.734375 | 3 | [] | no_license |
def rev(n):
s = str(n)[::-1]
s = s.lstrip('0')
return eval(s)
cache = [-1]*1000001
for i in range(11):
cache[i] = i
def solve_iter(n):
for i in xrange(11, n+1):
if i % 10 != 0 and rev(i) < i:
cache[i] = 1 + min(cache[rev(i)], cache[i-1])
else:
cache[i] = 1 + cache[i-1]
# print ... | true |
20d9c6bcfb1af6ebfac8dd4463123c418358e68d | szilard/GBM-intro | /5-more/3b-lightgbm-catenc.py | UTF-8 | 1,760 | 2.78125 | 3 | [
"MIT"
] | permissive |
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn import metrics
import lightgbm as lgb
## READ DATA
d_train = pd.read_csv("https://s3.amazonaws.com/benchm-ml--main/train-1m.csv")
d_test = pd.read_csv("https://s3.amazonaws.com/benchm-ml--main/test.csv")
d_train
## PRE-PROCESS
... | true |
6b6b0f018601852482cee69cf4e58e6bcd384eb6 | robin93/complexnetwork | /write_dict_to_csv.py | UTF-8 | 518 | 2.921875 | 3 | [] | no_license | def WriteDictToCSV(csv_file,csv_columns,dict_data):
try:
with open(csv_file, 'w') as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=csv_columns)
writer.writeheader()
for data in dict_data:
writer.writerow(data)
except IOError as (errno, strerror):
print("I/O error({0}): {1}".format(errno, strer... | true |
76fb1f9473ea9a684dc835244169e2803e13fc26 | mburns/mirwindcc | /printString.py | UTF-8 | 191 | 2.640625 | 3 | [] | no_license | def printString(phrase):
""" Prints the string sent in.
Created to test out modules functionality"""
print phrase
if __name__ == "__main__":
print "You are running this incorrectly."
| true |
1d1a79e8187c7595d7ee1dbbf4f2aa795cb918dd | xdongsheng/pachong | /数据解析/lxml和xpath_1.py | UTF-8 | 396 | 2.515625 | 3 | [] | no_license | from lxml import etree
#def parse_text():
#htmlelements = etree.HTML(text=)
#print(etree.tostring(htmlelements,encoding='utf-8').decode('utf-8'))
parser = etree.HTMLParser(encoding='utf-8')
def parse_file():
htmlelements = etree.parse("baidu.html",parser=parser)
print(etree.tostring(htmlelements, enc... | true |
2efc062c2709d26ab5621c963f6d0f37bed703f6 | Knicklichtjedi/TensorFlow | /traicy/cnn/LETTER_load_model_with_fully_custom_estimator.py | UTF-8 | 4,443 | 3.015625 | 3 | [] | no_license | import numpy as np
import tensorflow as tf
from skimage.io import imread
from skimage.util import img_as_float
from os.path import abspath
import LETTER_train_model_with_fully_custom_estimator
import glob
static_image_reference = None
model_dir = abspath("./python_resources/model_letter/") # model dir when GUI... | true |
69399838b8604e9d64d6198e72043cff22bbcc44 | CasusCura/ArduinoPendant | /scripts/auto_header.py | UTF-8 | 8,922 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/python3
"""Arduino Pendant - Auto Header.
Generates an header file containing explicity environmental variables.
Copyright (c) 2017 Alex Dale
See LICENSE for information.
"""
import argparse
from datetime import datetime
import logging
import os
import re
import sys
from typing import List, Dict
# Number... | true |
96e502768f7a14e59febd02c8ca7d2b4467aa1af | davidgreisler/webcrawler | /webcrawler/PageRankTest.py | UTF-8 | 520 | 3.40625 | 3 | [] | no_license | import PageRank
print "Testing the page rank computer."
print
webgraph = { 'A' : [ 'B', 'C' ],
'B' : [ 'C' ],
'C' : [ 'B', 'D' ],
'D' : [] }
print "Web graph: "
print webgraph
computer = PageRank.Computer(webgraph)
computer.compute()
result = computer.page_ranks
print ""
prin... | true |
6847b0d4195f8dec2fbc05b749c8dba459839ed2 | Mandrenkov/SVBRDF-Texture-Synthesis | /sandbox/image/pyramid.py | UTF-8 | 2,093 | 3.59375 | 4 | [
"MIT",
"CC-BY-4.0"
] | permissive | from . import Image
from scipy import ndimage # type: ignore
class Pyramid:
"""
A Pyramid object represents a Gaussian image pyramid.
"""
def __init__(self, image: Image, levels: int = 3) -> None:
"""
Constructs a Gaussian Pyramid with the given image and number of levels.
A... | true |
be887b2eb4755bc031cf27024b32c81b09d9e55d | Thesohan/Project-Euler-Solutions | /problem_094/solution_1.py | UTF-8 | 395 | 2.9375 | 3 | [] | no_license | hits=1 # amount found
sumn=16 # (5,5,6)
prev=2 # (1,1,0)
curr=8 # 4*prev-0
while True:
temp=curr
curr=4*curr-prev
prev=temp
if (hits&1)==1:
a=(-2+(4+12*(curr**2+1))**0.5)/6 # solves 3a^2+2a-1
per=3*a-1
else:
a=(2+(4+12*(curr**2+1))**0.5)/6 # solves 3a^2-2a-1
per=3... | true |
1357b7cc3c9f90abd48377c24a1a278fe7137614 | podkidyshev/pseudo-random_generators | /task_2/distributions/__init__.py | UTF-8 | 1,710 | 2.890625 | 3 | [] | no_license | import random
import operator as op
import numpy.random as rnd
from functools import reduce
SEPARATOR = '\n---------------------------------'
DEFAULT_INTERVAL_A = 0
DEFAULT_INTERVAL_B = 1000
DEFAULT_OFFSET_A = (-5, 5)
DEFAULT_SCALE_B = (0.1, 3)
DEFAULT_FORM_C = (0.5, 10)
def ncr(n, r):
r = min(r, n - r)
nu... | true |
ebdf21b23d633fefc92e6d327f87ea831ffda269 | BeniyamL/alx-higher_level_programming | /0x04-python-more_data_structures/10-best_score.py | UTF-8 | 421 | 3.40625 | 3 | [] | no_license | #!/usr/bin/python3
def best_score(a_dictionary):
"""function that finds the biggest integer value
Arguments:
a_dictionary: the given dictionary
Returns:
the key with bigest value
"""
if a_dictionary is None:
return None
max_val = max(a_dictionary.values(), default=None)... | true |
4a9ba8601040d6681bb4dcf034fa3e281b89695a | xcode1986/nineck.ca | /tools/project-creator/Python2.6.6/Lib/rexec.py | UTF-8 | 20,740 | 2.5625 | 3 | [
"MIT"
] | permissive | """Restricted execution facilities.
The class RExec exports methods r_exec(), r_eval(), r_execfile(), and
r_import(), which correspond roughly to the built-in operations
exec, eval(), execfile() and import, but executing the code in an
environment that only exposes those built-in operations that are
deemed safe.... | true |
be7b4be77e262ad93f27755d8d7899c703a8ed9c | cash2one/xai | /xai/brain/wordbase/nouns/_security.py | UTF-8 | 834 | 2.53125 | 3 | [
"MIT"
] | permissive |
#calss header
class _SECURITY():
def __init__(self,):
self.name = "SECURITY"
self.definitions = [u'protection of a person, building, organization, or country against threats such as crime or attacks by foreign countries: ', u'the group of people responsible for protecting a building: ', u'the fact that somethin... | true |
acc14f0fa865fbfd3daf278c5a043bd20abd8f27 | johnjdailey/pandas-ta | /pandas_ta/statistics/median.py | UTF-8 | 1,322 | 3.390625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
from ..utils import get_offset, verify_series
def median(close, length=None, offset=None, **kwargs):
"""Indicator: Median"""
# Validate Arguments
close = verify_series(close)
length = int(length) if length and length > 0 else 30
min_periods = int(kwargs['min_periods']) if 'm... | true |
a3cecdb4340f6be219b54cd78c569bac3f9c018e | jzqioipst/pre-education | /quiz/quiz4_1_selection_sort.py | UTF-8 | 551 | 3.75 | 4 | [] | no_license | def select_sort(lst):
# len(lst) - 1
# 선택정렬 특성상 마지막 남은 index 는 이미 정렬되어있다.
for i in range(len(lst) - 1):
min_index = i
# i + 1
# i는 이미 min_index 로써 선택되어 있으니 그 다음 인덱스부터 비교해나간다.
for j in range(i + 1, len(lst)):
if lst[j] < lst[min_index]:
min_index =... | true |
d5d410287b5e6f62123617f95c73fc3965e6170b | Marco2018/leetcode | /leetcode1012.py | UTF-8 | 266 | 3.0625 | 3 | [] | no_license | class Solution:
def bitwiseComplement(self, N: int) -> int:
if N<=1:return 1-N
temp=1
while temp<=N:
temp*=2
return temp-N-1
s1=Solution()
str=[[0,1,0],[0,0,1],[1,1,1],[0,0,0]]
s1.gameOfLife(str)
print(str)
| true |
517b69f7fea3a8a90f44e5717a7f3f2dc678bd07 | dgquintas/my-code-samples | /ProjectEuler/p209/bruteForce4.py | UTF-8 | 493 | 3.234375 | 3 | [] | no_license | def genInputs(n):
if n == 1:
yield [0]
yield [1]
else:
for i in genInputs(n-1):
yield [0] + i
yield [1] + i
tts = [tt for tt in genInputs(16) ]
def isOk(tt, a,b,c,d):
rowIdx1 = int("%d%d%d%d" % (a,b,c,d),2)
rowIdx2 = int("%d%d%d%d" % (b,c,d, a ^ (b & c)),2)
return (tt[rowIdx1] & tt[r... | true |
82c776daa50a2695a33171547abdb15c4e577737 | simpanID/python | /Part 01/class-character.py | UTF-8 | 534 | 3.828125 | 4 | [] | no_license | class Character():
def __init__(self,name,power,healt):
self.name = name
self.power = power
self.healt = healt
def info(self):
return 'Name : '+self.name+'\nPower : '+str(self.power)+'\nHealt : '+str(self.healt)
def spesial(self,count):
power_spesial = self.... | true |
27f38dce2761ddb0980c227c12714a4854029454 | HackneyChad/python-exercises | /converted_json_data_to_python.py | UTF-8 | 24,991 | 2.671875 | 3 | [] | no_license | converted_json_data_to_python.py
Converted json data into python - raw
[
{
"_id": "54e23c3e46ab53a440b580e8",
"index": 0,
"guid": "9962b468-ef3e-4993-b677-617469bc3008",
"isActive": "false",
"balance": "$2,097.02",
"picture": "http://placehold.it/32x32",
"age": 39,
"eyeColor": "blu... | true |
32d9bbdfee5764d7d8c0badb6f4384090bb5f38e | hTangle/DeepLearning | /DeepLearning.py | UTF-8 | 1,209 | 2.859375 | 3 | [] | no_license | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn import datasets, linear_model
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_predict
print("hello python")
data = pd.read_csv('D:\\program\\python\\DeepLearning\\CCPP\\Folds5x2_pp.csv... | true |
9c0b94a20f73c47bae8ff97ebb86b8ff140d0a0a | SmartHomeNLP/SmartHomeNLP | /SmartHome/decompress_files/comments/read_zst.py | UTF-8 | 2,728 | 2.609375 | 3 | [] | no_license | def read_zst(name):
import zstandard as zstd
import json
import pandas as pd
import re
# Initiate list
id = []
link_id = []
parent_id = []
created_utc = []
body = []
author = []
permalink = []
score = []
subreddit = []
with open(str(name), '... | true |
8183d23cf84e009b4e5ef47d5f3fe2b9ec3ea450 | N8Brooks/aoc_py | /tests/year2020/test_day08.py | UTF-8 | 724 | 2.84375 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
https://adventofcode.com/2020/day/8
"""
from unittest import main, TestCase
from aoc.year2020.day08 import part1, part2
from data.utils import get_input
EXAMPLE = """nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
jmp -4
acc +6
"""
class TestPart1(TestCase):
... | true |
cff905d6c3d110091760db26c89eb42ba5cfa106 | charles-bezerra/Interacao.TV | /Testes/test.py | UTF-8 | 554 | 2.828125 | 3 | [] | no_license | from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.graphics import BorderImage
"""class MyApp(App):
def build(self):
root = Widget()
b = Button(center=(200, 200))
root.add_widget(b)
with b.canvas.before:
... | true |
ce01e11415a2d82f66989e79d6e0d62c3afe1262 | scottwedge/buddism | /buddism/util.py | UTF-8 | 513 | 2.71875 | 3 | [] | no_license | import os
from subprocess import Popen, PIPE, STDOUT
def get_file_size(file_path):
return os.path.getsize(file_path)
def get_mp3_duration(file_path):
cmd = "ffmpeg -i %s 2>&1 | grep Duration | awk '{print $2}' | tr -d ,"%(file_path)
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_... | true |
f7f49fbe85cdcacd5b9a870ec8361aee35b29e81 | JosephLevinthal/Research-projects | /5 - Notebooks e Data/1 - Análises numéricas/Arquivos David/Atualizados/logDicas-master/data/2019-1/224/users/4357/codes/1875_196.py | UTF-8 | 273 | 3.109375 | 3 | [] | no_license | from numpy import*
from numpy.linalg import*
matriz=array(eval(input("digite o numero:")))
linha=int(input("digite o numero:"))
coluna=int(input("digite o numero:"))
a=matriz.shape[0]
b=matriz.shape[1]
if(matriz[linha,coluna]=='L'):
print("LIVRE")
else:
print("BOMBA")
| true |
17e407a62230a4a63229af8e4151eb6313972efc | sai-sukrutha/Wikipedia-Search-Engine | /src/textprocessing.py | UTF-8 | 16,479 | 2.65625 | 3 | [] | no_license | import re
import numpy as np
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
# from nltk.stem import WordNetLemmatizer
from nltk.stem import PorterStemmer
import sys
max_recursion = sys.getrecursionlimit()
stemmer = PorterStemmer()
nltk.download('stopwords')
SYMBOLS = re.compil... | true |
10a4b4cffef6bf13f8847e38c67c2466cb5a562f | shubhamdawande/Enron-Fraud-Detection | /final_project/poi_id.py | UTF-8 | 4,321 | 2.875 | 3 | [] | no_license | #!/usr/bin/python
import sys
import pickle
sys.path.append("../tools/")
import matplotlib.pyplot as plt
import pylab
from feature_format import featureFormat, targetFeatureSplit
from tester import dump_classifier_and_data
### Task 1: Select what features you'll use.
### features_list is a list of strings, each of wh... | true |
261fcad3239fd5d0129ba635982e3065b85b3d77 | RP5018540/seleniumgit | /SampleProject/Polymorphism.py | UTF-8 | 2,015 | 3.515625 | 4 | [] | no_license | # # Perform Operator Overloading Using +
#
# class Add:
# def __init__(self,a):
# self.a=a
# def __add__(self, other):
# self.other=other
# return self.a+other.a
# A1=Add(10)
# A2=Add(20)
# A3=Add("Greens")
# A4=Add("Tech")
# sum1=A1+A2
# sum2=A3+A4
# print(sum1)
# print(s... | true |
dfd6b933412bee915b2d5745c4570d5f54be4c53 | KhrystynaHranishak/DE-ML-project | /models_updates/training.py | UTF-8 | 4,762 | 2.625 | 3 | [] | no_license | import preprocessing as prp
from config import *
from sklearn import feature_extraction, model_selection, naive_bayes, pipeline, manifold, preprocessing
from sklearn import feature_selection, metrics
import pandas as pd
import numpy as np
import joblib
import sys
def upload_train_data(path):
return pd.read_csv(pa... | true |
ebd02a5d3e31f7fcae2b03caf3b13dc7091a5332 | techdustdojo/hktvPriceTrackerwithEmail | /hktvPriceTrackerwithEmail.py | UTF-8 | 1,829 | 2.703125 | 3 | [] | no_license | import requests
from bs4 import BeautifulSoup
import os
from datetime import date
import sdemail
def track(url,excepted_price):
headers = {
"User-Agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36",
"referer" : url
}
pag... | true |
0fed92cd943d467b5fde677d585795cbc5a85c52 | Dapid/toy_sudoku_solver | /solver_all.py | UTF-8 | 6,659 | 2.765625 | 3 | [
"BSD-3-Clause"
] | permissive | # import copy
# import collections
import numpy as np
def uncertainty(candidates, solution):
return np.sum(solution == 0) + sum(len(x) for x in candidates.values())
def recursive_single_elimination(candidates, solution):
changed = True
while changed:
changed = False
for i in range(9):
... | true |
ddb274850ae2925bcd478c94fa13d8ea20b0fdcb | AnaArce/introprogramacion | /Practico_1/Ejercicio_14.py | UTF-8 | 694 | 3.875 | 4 | [] | no_license | #Escriba un programa que reciba como entrada la estatura, el peso, y la edad de una persona, y le entregue su condicion de riesgo
peso = int(input("Ingrese su peso en Kg: "))
altura = float(input("Ingrese su altura en m: "))
edad = int(input("Ingrese su edad: "))
masa_muscular = peso / altura**2
print("Tu masa muscular... | true |
8cf2ceacfeb5dad90b1cb35c525a61e2d2ef91b3 | Aaronnw2/piCar | /server/display.py | UTF-8 | 942 | 2.640625 | 3 | [] | no_license | # pylint: disable=C0103, C0325, E0401, E0401
""" Displays the video feed """
import cv2
import utility
import numpy as np
def display_video(pipe):
print('Displaying video feed...')
cv2.namedWindow('Video feed')
cv2.moveWindow('Video feed', 850, 20)
while True:
image = utility.read_image(pipe)
... | true |
eb93df0d253191f87c18b7e42c1fca2c193087fa | dopiotrko/sudokus | /grid.py | UTF-8 | 16,388 | 3.40625 | 3 | [] | no_license | from itertools import repeat, product
import numpy as n
from exceptions import *
class Grid(list):
"""Solving/validating class"""
tmp = list(product(range(9), repeat=2))
coordinate_list = []
for j in (0, 27, 54):
for i in (0, 3, 6):
coordinate_list += tmp[j+i:j+i+3]+tmp[j+i+9:j+i+1... | true |
469914cf7f4c91d9cedf02d7b8a20cb6aabd036b | AtharvaParanjpe/Machine-Learning-CS536 | /Machine Learning/HW4/hw4.py | UTF-8 | 2,642 | 3.5625 | 4 | [] | no_license | import numpy as np
import math
## Generating x, x_prime, epsilon
def generate_data(m,sigma_squared):
x = np.random.uniform(100,102,m)
x_prime = x -101
epsilon = np.random.normal(0, math.sqrt(sigma_squared), m)
return x, x_prime, epsilon
## Generating y
def generate_y(x, x_prime, epsilon, w, b):
y ... | true |
9b73dfda63e83cfe36e529b361ad6a76fd033be1 | jyurtsever/pose_robot | /GetWristPose.py | UTF-8 | 3,181 | 2.765625 | 3 | [] | no_license | import cv2
import matplotlib.pyplot as plt
def main():
while True:
repeat()
def repeat():
# Read image
ret, frame = cap.read()
# print(frame.shape)
# Specify the input image dimensions
frame = rescale(frame, .6)
inWidth = frame.shape[1]
inHeight = frame.shape[0]
bo... | true |
05863c16af973610fc737adff221bf5f9320aa66 | foxr1/routetouni | /tests/test_socket_manage.py | UTF-8 | 1,872 | 2.953125 | 3 | [] | no_license | """
Name: Katie Fallon & Will Macpherson
This page tests the socket_manage.py for the
chat functionality which was created by Phillip
"""
from socket_manage import MessageManage
socket_man = MessageManage()
socket_man.flush_db()
# Test that a user can be added to a room
# Expected outcome = True
def test_add_room... | true |
15b1ac1576bfe9f2786fff9ae79b8df91e9b8c99 | Mksourav/Python-Basics | /Assign_3-1.py | UTF-8 | 355 | 3.453125 | 3 | [] | no_license | hrs = input("Enter Hours:")
rate = input("Enter rate per hour:")
try:
h = float(hrs)
r = float(rate)
except:
print("Error! Please enter the numeric value")
quit()
print(h, r)
if h>40:
eh = h-40 #eh= extra hour
nh = h-eh #nh= normal hour
xp = ((nh*r)+(eh*(r*1.5)))
print("Pay:",xp)
else:
... | true |
e6313ff93b5e63d54899b6ac916117ff6027a012 | MatteoMast/widowx | /windowx_controller/scripts/windowx_controller_sim_3links.py | UTF-8 | 10,947 | 2.703125 | 3 | [] | no_license | #!/usr/bin/env python
"""
Start ROS node to pubblish torques for manuvering windowx arm through the v-rep simulator.
"""
import cv2
import rospy, roslib
from math import sin, cos
from windowx_msgs.msg import TargetConfiguration
from std_msgs.msg import Float32MultiArray, MultiArrayDimension
import numpy as np
class ... | true |
cbabc6cd532717bab6b37b0b69505ee45f7081e4 | yugen96/brp | /data_red/old/old_code/masterflat.py | UTF-8 | 4,007 | 2.875 | 3 | [] | no_license | import numpy as np
import os
from astropy.io import fits
#################### FUNCTIONS ####################
# Returns a list will all subdirectories in a specific folder as well as the
# contained files
def mk_lsts(dir_name):
#dir_lst = [dirs[0] for dirs in os.walk(dir_name)]
dir_lst = next(os.walk(di... | true |
73cbe2e3f6fd1376106c6590d2ff3a31e3a133c2 | fandi-peng/Project_Euler | /code/euler67.py | UTF-8 | 738 | 3.015625 | 3 | [] | no_license | test_tri = '''
75
95 64
17 47 82
18 35 87 10
20 04 82 47 65
19 01 23 75 03 34
88 02 77 73 07 63 67
99 65 04 28 06 16 70 92
41 41 26 56 83 40 80 70 33
41 48 72 33 47 32 37 16 94 29
53 71 44 65 25 43 91 52 97 51 14
70 11 33 28 77 73 17 78 39 68 17 57
91 71 52 38 17 14 91 43 58 50 27 29 48
63 66 04 68 89 53 67 30 73 16 69... | true |
a228a612edcbfd7834860dee5d3e08106fbab595 | PI2-Smart-Vegetable-Germinator/Eletronica_SVG | /Comunicacao_Raspberry.py | UTF-8 | 279 | 2.796875 | 3 | [] | no_license | #!/usr/bin/env python 3
import serial
comunicacaoSerial = serial.Serial('/dev/ttyACMo', 9600) #substituindo ttyACM0 pelo USB da ESP32
while True:
print (comunicacao.Serial.readLine()) #imprime no terminal da raspberry
| true |
0a26ce9428f9860f83438f2bd510983ef6c97ac3 | 1218muskan/MarchCode | /Day 5/KeerthanaPravallika.py | UTF-8 | 165 | 3.5 | 4 | [
"MIT"
] | permissive | #Day 5
n , m = [int(x) for x in input().split()]
if n < m:
for i in range(n,m):
print(i,end=" ")
else:
for i in range(m,n):
print(i,end=" ")
| true |
05373b270813483e0b8cec3ff0045e9abb36d84a | utep-cs-systems-courses/python-intro-mherr305 | /wordCount.py | UTF-8 | 1,264 | 3.59375 | 4 | [] | no_license | #!/usr/bin/env python3
#Manuel Herrera
import re #Regular exp tool
import sys #Command line
import os #Check if file exists
#set the input and output files
if len(sys.argv) is not 3:
print("Correct usage: wordCount.py <input text file> <output file>")
exit()
inputFileName = sys.argv[1]
outputFileName = s... | true |
46d216d073bb570accf7a0048b4fd4c93aa6a987 | CristianCerutti/Compiti_Vacanze_Sistemi | /sum_of_multiples.py | UTF-8 | 292 | 3.1875 | 3 | [] | no_license | def multipli(n, fattori):
ris = []
for x in range(1, n):
for fattore in fattori:
if fattore != 0 and x % fattore == 0:
ris.append(x)
print(ris)
return
def main():
multipli(30, [2, 5])
if __name__ == "__main__":
main() | true |
7efb72c904f25d1ae00b0fba38b6e5945e28594e | zenkj/ossfs | /ossfs.py | UTF-8 | 5,924 | 2.53125 | 3 | [] | no_license | #!/usr/bin/env python
from __future__ import with_statement
import os
import sys
import errno
import oss2
import configparser
import time
from fuse import FUSE, FuseOSError, Operations
def log(*args):
print(*args)
class OSS(Operations):
def __init__(self, bucket):
self.bucket = bucket
self... | true |
f7bc5f913c426eabd3682b70645957cd5e300880 | nitzannehushtan/first_nn-project | /layer.py | UTF-8 | 806 | 3.109375 | 3 | [] | no_license | from random import random
from node import Node
import numpy as np
class Layer:
def __init__(self, nodes: np.ndarray = None, layer_ind: int = None, prev_layer=None, hidden=0):
if hidden > 0:
self.nodes = [Node(random(), ind, layer_ind) for ind in range(hidden)]
else:
self... | true |
7cedc8c7fdb19c085bd6f0bf2fb3ff2b52528535 | aludwig123/BlueMarket | /dbInteractions.py | UTF-8 | 7,528 | 2.640625 | 3 | [] | no_license | # BlueMarket functions.py
# Authors: Isabel Bryant, Analiese Ludwig, Hannah Yi
# Wellesley College CS304
# Fall 2019
import dbi
def getConn():
'''Return connection to bluemark_db'''
dsn = dbi.read_cnf('~/cs304/BlueMarket/static/bluemarket_db.cnf')
conn = dbi.connect(dsn)
conn.select_db('bluemark_db')
... | true |
b140dfc1bae9c21fe92c1c80a1c04705f4cd2259 | zumanah/Zum-Python | /forloop1.py | UTF-8 | 124 | 3.0625 | 3 | [] | no_license | def main():
for i in range(1,10):
for j in range(1, 10):
print(i*j)
print()
main()
| true |
a27ddec1fe0a041b7a2c4ce93910263baec3f6ef | DinkieShy/domain-adversarial | /util/SplitDataByDomain.py | UTF-8 | 977 | 2.640625 | 3 | [] | no_license | import pandas as pd
import csv
import numpy as np
import math
from shutil import copyfile
import json
train_df = pd.read_csv("./input/fullTrain.csv")
domainsToRemove = ["usask_1", "inrae_1", "rres_1"]
# # Print details of domains for choosing domains to remove
# domains = []
# domainCounts = []
# for i in range(len... | true |
f0ec03170517958fd7f165dcfb5299328a376897 | Gabaloo1/GrizzHacks5 | /Test.py | UTF-8 | 16,529 | 2.75 | 3 | [
"MIT"
] | permissive | import pygame, sys, time, ctypes, random
# Metodos y Parametros Inciales
pygame.init()
size = [1525, 800]
screen = pygame.display.set_mode(size, pygame.RESIZABLE)
pygame.display.set_caption("Nombre del Juego Pendiente")
# Funcion para cargar y actualizar (RESIZE) IMAGENES
def load_images(size):
# Global Va... | true |
1a80bfbd5dbd7062b985cdb48af3a811850fcab7 | skalaydzhiyski/midi-gan | /midi/multi_channel_parser.py | UTF-8 | 3,423 | 2.640625 | 3 | [] | no_license | import mido
import numpy as np
import matplotlib.pyplot as plt
import sys
import string
def msg2dict(msg):
result = dict()
if 'note_on' in msg:
on_ = True
elif 'note_off' in msg:
on_ = False
else:
on_ = None
result['time'] = int(msg[msg.rfind('time'):].split(' ')[0].split('=')[1].translate(
... | true |
233b8e43db588df70363cecd6a66b6c4528c6fba | Win-Htet-Aung/kattis-solutions | /hayPoints.py | UTF-8 | 398 | 2.65625 | 3 | [
"MIT"
] | permissive | st = input()
word = int(st.split(' ')[0])
desc = int(st.split(' ')[1])
salaDic = {}
for i in range(word):
st = input()
salaDic[st.split(' ')[0]] = int(st.split(' ')[1])
ans = []
for i in range(desc):
st = input()
total = 0
while st != '.':
for i in st.split(' '):
if i in salaDic.keys():
total = total + s... | true |
0111683550d911f8c2f79f002b9f3a3fd6a33c0d | melbeni1/FINAL | /P05 Time Measurement [FINISHED]/P5.3.1_count_to_erasing.py | UTF-8 | 153 | 3.609375 | 4 | [] | no_license | import time
def count_to_with_erasing(n):
for i in range(n):
print(f"{i + 1}...", end="\r")
time.sleep(1)
count_to_with_erasing(10) | true |
0a4e0a4309bf0c99af80b20b63ad42570319ef08 | RDIL/Perf | /perf/parser.py | UTF-8 | 2,602 | 2.5625 | 3 | [
"MIT"
] | permissive | import re
import functools
import os
import json
from .vendor.shaded_pyflakes import api
@functools.lru_cache(maxsize=None)
def load_regex():
"""Loads the regex strings from the file into a dict."""
return json.loads(
open(
os.path.abspath(os.path.dirname(__file__)) + "/regex.json", "r"
... | true |
f7aeeebff85723bf54edc16aea5e986b8d86685a | arruda/amao | /AMAO/apps/Avaliacao/Questao/models/multipla_escolha.py | UTF-8 | 1,804 | 2.828125 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
from django.db import models
from questao import Questao
class OpcaoMultiplaEscolha(models.Model):
"""
Representa uma opcao multipla escolha, caso esse seja o caso da questao.
É uma ligação de Muitas respostas para Uma questao.
Essa classe permite a questao, mais de uma op... | true |
cd4e4c534826470c7a3478cac605f02e851448fe | aselya/Machine_Learning_Baseball_Project | /split_the_population.py | UTF-8 | 659 | 2.53125 | 3 | [] | no_license | #/Users/aarondavidselya@gmail/PycharmProjects/lahmenCSVmanipulation/venv/stats_like_iris.csv
from sklearn.model_selection import _split
import pandas as pd
data = pd.read_csv("/Users/aarondavidselya@gmail/PycharmProjects/lahmenCSVmanipulation/venv/team_stats_ave_no_excess_stats.csv")
data_noNA = data.fillna(1)
pop1... | true |
f7a80f59e5e8851a12c36c8a1cc4c00787d77149 | HyeRyeongKang/snow_cam | /main.py | UTF-8 | 3,033 | 2.859375 | 3 | [] | no_license | import cv2, dlib, sys
import numpy as np
scaler=0.3
#얼굴 디텍터 모듈 초기화
detector=dlib.get_frontal_face_detector()
#얼굴 특징점 모듈 초기화
#머신러닝으로 학습된 모델 파일
predictor=dlib.shape_predictor('shape_predictor_68_face_landmarks.dat')
#load video
cap=cv2.VideoCapture('face.mp4')
#file이미지를 BGRA타입으로 읽기
overlay=cv2.imread('ryan_transparent... | true |
f23a7c76592c65ab1d3099e1bd51c9ef949720ed | jakamrak/uvod-v-programiranje | /datoteke-s-predavanj/2016-17/11-tkinter/tkinter-b.py | UTF-8 | 1,289 | 3.046875 | 3 | [] | no_license | import tkinter as tk
class MojSuperStevec:
def __init__(self, okno):
self.stevec = 0
self.pripravi_graficni_vmesnik(okno)
def pripravi_graficni_vmesnik(self, okno):
prikaz = tk.Frame(okno)
prikaz.grid(row=0, column=0)
self.prikaz_stevca = tk.Label(prikaz)
self.o... | true |
79450ad5d3eb08d4152c1c4740d6b922596f14a6 | RebelRebeler/The-Rebellion | /dude.py | UTF-8 | 3,802 | 3.046875 | 3 | [] | no_license | import time
from bullet import bullet
from space import space
class dude(space):
def __init__(self,game,y,x,health):
self.full = True
self.t = '*'
self.game = game
self.y = y
self.x = x
self.height = 3
self.width = 2
self.speed = 1
self.jump_h... | true |
ff48dcdb05812c05f4e231e62adc6d1d12dac051 | dingdl/pt-accessibility-analysis | /main.py | UTF-8 | 3,302 | 2.96875 | 3 | [] | no_license | ################################################################################
# Module: main.py
# Description: pipeline of the following paper
# Integrating Network Science and Public Transport Accessibiliy Analysis
# for Comparative Assessment
# Ding Luo @ TU Delft, The Netherlands
##########################... | true |
683125375bd7efbc9e844dcb28a9aaaf6b3e0e43 | SeokJunYeom/spoqa-hackathon | /spoqa/account/tests.py | UTF-8 | 1,872 | 2.53125 | 3 | [] | no_license | import json
from django.urls import reverse
from django.contrib.auth import get_user_model
from rest_framework import status
from rest_framework.test import APITestCase
User = get_user_model()
class Tests0000Account(APITestCase):
data = {
'username': '염석준',
'nickname': 'seokjun',
'pass... | true |
40c6ffc1b2a8af7e758911f958490241ae5a1633 | agnynureza/python-oop | /sakti.py | UTF-8 | 2,073 | 4.0625 | 4 | [] | no_license | #class
class Orang:
pass
org = Orang()
print(org)
#method
class Orang:
def katakanHalo (self):
print 'Halo, apa kabar ?'
org = Orang()
org.katakanHalo()
#method init
class Orang:
def __init__(self, name):
self.name = name
def katakanHalo(self):
print ('Hai, my name is {}'.f... | true |
5af50823b391d5ff34de9510778fa1a7504236ca | Siddharth-Shukla12/Competitive-coding | /hackerrank/interview prep kit/ArraysLeftrotation.py | UTF-8 | 537 | 3.09375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun May 9 11:32:31 2021
@author: siddh
"""
#https://www.hackerrank.com/challenges/ctci-array-left-rotation/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=arrays
def lefrot(li,b):
if b>=(len(li)):
b=b-len(li)
... | true |
45218be7b4c58d0fbedc716884585be817765882 | junhao69535/PSL | /Data_Types/datetime_section/available_types.py | UTF-8 | 276 | 2.765625 | 3 | [] | no_license | #!coding=utf-8
import datetime
"""
如题
"""
# class.datetime.date
"""
一个理想化的naive日期,假设当前的公历始终是,并且始终是有效的。属性:year,month,day
"""
print datetime.date.year
print datetime.date.month
print datetime.date.day
| true |
828be2856aac06be5b38b4df862b80d60d7ed728 | aasthaagrawal/Algorithms_and_Data_Structures | /leetcode/9_Palindrome_Number.py | UTF-8 | 391 | 3.421875 | 3 | [] | no_license | #https://leetcode.com/problems/palindrome-number/
#Complexity: O(n) where n is the number of digits in the integer
class Solution:
def isPalindrome(self, x: int) -> bool:
if x<0:
return False
old_x = x
new_x = 0
while x:
remainder = x%10
x //= 10
... | true |
984f9a100670d09e19a6fb76b460ebdcbd340fb8 | brohum10/python_code | /odd_even.py | UTF-8 | 216 | 3.765625 | 4 | [] | no_license | num = input("Enter any number.")
num = int(num)
print(type(num))
print( num%2)
if num == 0:
print("This is zero. It is even.")
exit()
if num%2 == 0:
print("This is even")
else:
print("This is odd")
| true |
79be6d6f6ef1b97d940c0549b420d31110925784 | b7w/behappy | /src/behappy/core/utils.py | UTF-8 | 3,736 | 2.578125 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
import functools
import inspect
import json
import re
import subprocess
import uuid
from datetime import datetime
from pathlib import Path
from time import time_ns
def timeit(f):
msg = '## {0} complete in {1:.0f} min {2:.1f} sec ({3}ns)'
@functools.wraps(f)
def wrapper(*args, **kw... | true |
d056232af410b4dc8cb5a109040b6367356061ef | samantaavijit/Python_Tutorial | /Faulty Calculator.py | UTF-8 | 1,087 | 4.375 | 4 | [] | no_license | """
------------- Faulty Calculator --------------------------
Design a calculator which will correctly
solve all the problem except the following ones :--
45 * 3= 555, 56 + 9 = 77, 56 / 6= 4
your program should take operator and the two numbers
as input from the user and then return the result
"""
nSet = {"45*3": 555... | true |
dd4cdd8674fab7efe2902f0cb4e97297a35a209e | deplax/PP_tensorflow | /study/denoising_audoencoder.py | UTF-8 | 1,698 | 2.75 | 3 | [] | no_license | # -*- coding: utf-8 -*-
__author__ = 'whale'
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
# 해당 위치에 mnist 샘플데이터셋을 받는다.
# one_hot 은 라벨을 0과 1로만 붙이는 설정이다.
# 해당 디렉토리는 생성되어 있지 않아도 ... | true |
5cbb4b69a921bfc9cfc579e2d86f9e35fdc5e0ff | matheus0000/Calculadora-En-Python | /Calculadora-de-viagem-en-km/Calculadora-de-Km-Para-Viajar.py | UTF-8 | 516 | 3.546875 | 4 | [] | no_license | a = int(input('Distansia en (km) Taxímetro: '))
print('Valor-Digitato',('KM'),('='),(a));
#Valor = ('R$',(0.50),'R$')
Valor = (0.50)
b = Valor
print(('R$ 0.50'),('Por'),('Km'),('R$'),'=',(b))
u1 = (b*a)
print('Valor-da-Viagen',('R$'),'=',(u1))
# Ler valor em km do taxímetro se cada 1km vale 50 centavos então soma as ... | true |
cb7101b6da92d782fe1f7f4ecd67cd546d667d33 | xintin/sdl_ai_workshop | /03_distributedHyperOpt/01_BasicHPS/model_run.py | UTF-8 | 3,710 | 2.828125 | 3 | [] | no_license | """"
model_run.py
"""
# pylint:disable=invalid-name, wrong-import-position
import os
import sys
import tensorflow as tf
here = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, here)
from load_data import load_data
keras = tf.keras
layers = tf.keras.layers
OPTIMIZERS = {
'Adam': tf.keras.optimizers.... | true |
4ef28ff6b4b55ca1753a90fd005623f7e3ccc43f | AHaSSaN07/ChatRoom-PythonSocket | /client.py | UTF-8 | 992 | 2.875 | 3 | [] | no_license | import socket
from threading import Thread, Lock
import sys
alias = input(">>What's your name? ")
def receiveMessage():
try:
while True:
message = client.recv(2018).decode()
if message != "/t":
print(message)
except:
exit()
client = socket.socket(socket... | true |
6d72693b973381be0929e76768ace58dfb379ce0 | minimedj/3dhero.ru | /apps/contact/admin/forms.py | UTF-8 | 1,737 | 2.71875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from flaskext import wtf
class ContactForm(wtf.Form):
order_id = wtf.IntegerField(
u'Порядок сортировки',
description=u'От большего к меньшему',
default=0
)
is_public = wtf.BooleanField(
u'Показывать на сайте?',
description=u'Показывать ли д... | true |
98ea73df8b09f28121804c1881bb030d23df7d76 | Nav1996/python | /mycode.py | UTF-8 | 2,903 | 3.65625 | 4 | [] | no_license | import pandas as pd
import random
from math import sqrt
emp_details={'employee':{'dave':{'ID':'001','salary':'3000','designation':'team lead'},'ava':{'ID':'003','salary':'9000','designation':'team member'}}}
print(emp_details['employee'])
my_dict={'ava':'001','adam':'003'}
for x,y in my_dict.items():
print(x,y)
my_... | true |
790ce8e55f749964153a0f4a3174ac2e14feee40 | sahasukanta/college-assignments-repo | /lab 1/lab1.py | UTF-8 | 3,497 | 3.59375 | 4 | [] | no_license | # lab 1
# Exercise 1
print("Exercise 1-----------------------------------------")
numbers = [11, 25, 32, 4, 67, 18, 50, 11, 4, 11]
oddNumbers = []
print("The contents of object {ID} are {content}".format(ID=id(oddNumbers), content=oddNumbers))
for i in numbers:
if i%2 == 1:
oddNumbers.append(i)
print("The... | true |
f51c12191b7d3a7080a2b7b89c66a4bf221276e4 | JASONEN/MarketSim | /src/marketsim/agents/simple_dqn.py | UTF-8 | 2,388 | 2.84375 | 3 | [] | no_license | #!/usr/bin/env python
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten
from keras.optimizers import Adam
# from rl.policy import BoltzmannQPolicy
from rl.agents.dqn import DQNAgent
from rl.callbacks import FileLogger
from rl.policy import LinearAnnealedPolicy, EpsGreedyQPolicy
f... | true |
2a804af7c957e2b0893e56481a229ddc8b1bc692 | mayk93/College | /License/OLD/Test/Servers/tcpClient.py | UTF-8 | 627 | 2.796875 | 3 | [] | no_license | import socket
LOCAL_HOST = '127.0.0.1'
GCE_SERVER = '104.155.2.110'
DEFAULT_PORT = 5000
MAX_SIZE = 1024
QUIT = 'q'
def main():
host = LOCAL_HOST
port = DEFAULT_PORT
clientSocket = socket.socket()
clientSocket.connect((host,port))
message = input("->")
toSendMessage = bytes(message, "utf-8")
... | true |
479ccdc9394342052aa6ba13a8f4dd406965bbfc | marionumza/saas | /addons/hr_expense/tests/test_expenses_mail_subjects.py | UTF-8 | 6,605 | 2.515625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# Part of Harpiya. See LICENSE file for full copyright and licensing details.
from harpiya.addons.hr_expense.tests.common import TestExpenseCommon
class TestExpenseSubject(TestExpenseCommon):
"""
Check subject parsing while registering expense via mail.
"""
def setUp(self):
... | true |
d77acfbfa9f380ec60df777f6e21282c2a9e9fbc | charlesjansen/Kaggle_Quora-Question-Pair | /2_features_creation_spacy/5_myMagics.py | UTF-8 | 11,733 | 3.078125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
laptop = 0
if laptop == 1:
drive = "C"
else:
drive = "F"
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from collections import defaultdict
TRAIN_DATA_FILE = drive + ':/DS-main/Kaggle-main/Quora Question Pairs - inputs/data/tr... | true |
b045c0aaa80ee8f9bb69f708333d5664e578fb01 | dream-lab/DiPETrans | /plots/serial_distributed_combined.py | UTF-8 | 3,331 | 2.53125 | 3 | [] | no_license | import os
import sys
import numpy as np
import matplotlib.pyplot as plt
fig1, ax1 = plt.subplots()
fig2, ax2 = plt.subplots()
ax1.grid(which='both', alpha=0.5)
ax2.grid(which='both', alpha=0.5)
markers = ['-o','-^','-s','-D','-X','-P']
markeredgecolors = ['g','m','c', 'y', 'k']
#ax2 = ax1.twinx() # instantiate a ... | true |
cadcf501eab65c521b4f7d9e47b95940fecd67bf | tianyudwang/adversarial_imitation_learning | /ail/network/value.py | UTF-8 | 5,101 | 2.921875 | 3 | [
"MIT"
] | permissive | from abc import ABC, abstractmethod
from typing import Sequence, Union, Optional, Tuple
import torch as th
from torch import nn
from ail.common.pytorch_util import build_mlp
class BaseValue(nn.Module, ABC):
"""
Basic class of a general Value or Q function
:param state_dim: State dimensions of the enviro... | true |
507fecd63f0588239b88fd7e17e494f0e7c7f398 | PSU-OIT-ARC/django-local-settings | /local_settings/__main__.py | UTF-8 | 4,513 | 2.546875 | 3 | [
"MIT"
] | permissive | import argparse
import importlib
import os
import sys
import textwrap
from setuptools import find_packages
from .color_printer import color_printer as printer
from .loader import Loader
from .strategy import get_file_type_map, guess_strategy_type
class ArgParser(argparse.ArgumentParser):
def error(self, messag... | true |
5e097c54401a21d454e46203268842c4f7d64bcd | kotteeshwaran/91social | /dates.py | UTF-8 | 149 | 3.09375 | 3 | [] | no_license | from datetime import date
date_1 = date(2020, 7, 2)
date_2 = date(2020, 7, 11)
delta = date_2 - date_1
print("Number of days:{}".format(delta.days)) | true |
1ad919320e5c8275bd65533ab00d613ad2929a3b | marinko-peso/haveibeenpwned | /haveibeenpwned/status.py | UTF-8 | 1,010 | 2.890625 | 3 | [
"LicenseRef-scancode-free-unknown",
"MIT"
] | permissive | # -*- coding: utf-8 -*-
import urllib3, json
# Supress warning about insecure request.
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
_pwned_url = 'https://haveibeenpwned.com/api/v2/breachedaccount/'
_headers = {'user-agent': 'Pwnage-Checker-PyPi-Package'}
def _get_response(email):
"""
... | true |
810463b2eabc0b065843e3ee2b9a02e8cee1210d | LanQui7/Curso-Python-2019 | /2019-08-09_promedio.py | UTF-8 | 318 | 3.65625 | 4 | [] | no_license | print("Primera nota: ")
pr = float(input())
print("Segunda nota: ")
se = float(input())
print("Tercera nota: ")
te = float(input())
print("Cuarta nota: ")
cu = float(input())
promedio = round(( float (pr + se + te + cu))/4, 2)
print(f"El promedio es: {promedio}") #otra forma de mostrar el resultado dentro de comillas | true |
ebed61ed275394d2e4320b3a09c624379935ccef | danawest/class-work | /stripping_names.py | UTF-8 | 127 | 3.375 | 3 | [] | no_license | name = " Jake Rodkin "
print(name)
name = name.rstrip()
print(name)
name = name.lstrip()
print(name)
name = name.strip()
print(name) | true |
255d7c269ce19036a1f4ee6caaedb119fa499e1c | microsoft/electionguard-python | /src/electionguard/key_ceremony.py | UTF-8 | 9,563 | 2.53125 | 3 | [
"MIT"
] | permissive | from dataclasses import dataclass
from typing import List, Type, TypeVar
from .serialize import padded_decode, padded_encode
from .election_polynomial import (
PublicCommitment,
compute_polynomial_coordinate,
ElectionPolynomial,
generate_polynomial,
verify_polynomial_coordinate,
)
from .elgamal imp... | true |
a741c5c50fc2b672806bdf505b56d563423095bd | arabindamahato/personal_python_program | /risagrud/decorater/test.py | UTF-8 | 369 | 3.234375 | 3 | [] | no_license | def decorater(args):
def after_mackup():
print('Bride looks beautyfull')
print('bride is well decorated ')
print('Bride is ready for marriage')
return after_mackup
@decorater
def before_mackup():
print('Bride looks like simple')
print('bride is not well decorated ')
print('B... | true |
0504b4372beba486aa77358f95b0106ec62905d7 | figlax/CuboctSTL | /numpy-stl-box_example.py | UTF-8 | 2,007 | 3.140625 | 3 | [] | no_license | from stl import mesh
import math
import numpy
#EXPLANATION OF THIS SCRIPT:
#This script is an example from the numpystl package
# Create 3 faces of a cube
data = numpy.zeros(6, dtype=mesh.Mesh.dtype)
# Top of the cube
data['vectors'][0] = numpy.array([[0, 1, 1],
[1, 0, 1],
... | true |
c88ab234e4a043dbcd1073e3ed814f0cf5674cce | czchen1/cs164-projects | /proj1/tests/other-tests/minz-tests/correct/for_while.py | UTF-8 | 81 | 3.796875 | 4 | [] | no_license | x = [1, 2, 3, 4, 5]
for item in x:
i = 0
while i < 5:
print item
i = i + 1
| true |
cf1de2ef6509935171d6356c09e9bf0b7d9813bb | ManjunathN90/Churn-Reduction | /Churn_Reduction_Project1.py | UTF-8 | 8,751 | 3.109375 | 3 | [] | no_license |
#Load libraries
import pandas as pd
import os
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from fancyimpute import KNN
from scipy.stats import chi2_contingency
sns.set()
# Load data
train = pd.read_csv("Train_data.csv")
test = pd.read_csv("Test_data.csv")
# Combine Train and test ... | true |
42e8ad479aaa9c1700585745bd67506fd999e3c9 | NemanjaDj93/Gis-Programiranje | /v2-Zadatak 4.py | UTF-8 | 311 | 3.390625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
a = raw_input('Unesi p ili d: ')
niz1 = [1, 2, 3]
niz2 = [5, 10, 15]
if a == 'p':
niz = [None]*(len(niz1)+len(niz2))
niz[::2] = niz1
niz[1::2] = niz2
print niz
elif a == 'd':
niz = [None]*(len(niz1)+len(niz2))
niz[::2] = niz2
niz[1::2] = niz1
print niz
| true |
72a07402cd45e59e04b56650f1713277d008ba01 | pandas-dev/pandas | /pandas/tests/io/formats/test_to_string.py | UTF-8 | 10,182 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | from datetime import datetime
from io import StringIO
from textwrap import dedent
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
option_context,
to_datetime,
)
import pandas._testing as tm
def test_repr_embedded_ndarray():
arr = np.empty(10, dtype=[("err", object)])
... | true |