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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7dfe887896304036bcec817af9006035898431ad | Python | aamishagupta540/Tweet_Analysis | /main.py | UTF-8 | 1,191 | 2.65625 | 3 | [] | no_license | import json
from twitter_stream import DEIStreamer
class Twitter_Stream_Wrapper:
APP_KEY = ""
APP_SECRET = ""
OAUTH_TOKEN = ""
OAUTH_TOKEN_SECRET = ""
config_file_path = ""
search_file_path = ""
tweets_per_file = 0
key_words = []
def init_Stream(self,config_file_path,search_file_path,tweets_per_file):... | true |
21aa0f74faf4d1c330be967f97bbbfd24ba9175c | Python | cvillat/ST0245-033 | /proyecto/codigo/Entrega2.py | UTF-8 | 589 | 3.328125 | 3 | [] | no_license | # Entrega 2
# Miguel Angel Sarmiento Aguiar
# Marlon Perez Rios
def Crear_Estructura_Datos(Direccion_csv):
Archivo_csv = open(Direccion_csv, "rt") # C1
Texto = Archivo_csv.read() # C2
Texto = Texto[:len(Texto)-1] # C3
Datos = Texto.split("\n") ... | true |
08d0dd789a19440e055bb200fbb34a2b8dda8e52 | Python | tangx345/MachineLearning | /src/LinearRegression.py | UTF-8 | 13,934 | 3.171875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 8 19:48:35 2021
@author: Yang
"""
import numpy as np
import sys
sys.path.append('./MathUtils.py')
import MathUtils
class LS_Matrix:
# This is the very basic inverse matrix least square linear regression fit
# It requites the matrix to be non-sigular
def __i... | true |
9b714a994c8f281b433d1cb3977adcb6276b8d9a | Python | swq90/python | /exercise/bs/bs1.py | UTF-8 | 1,201 | 3.03125 | 3 | [] | no_license | # coding=UTF-8
import pydevd
from wsgiref.simple_server import make_server
def application(environ, start_response):
# environ:一个包含所有HTTP请求信息的dict对象;
# start_response:一个发送HTTP响应的函数。
# charset=UTF-8,几个encode有什么不同
start_response('200 OK', [('Content-Type', 'text/html;charset=UTF-8')])
# Header只能发送一... | true |
2a913090aae8e574fca825f64239475c42ed6868 | Python | bigaboom/learning | /venv/primes.py | UTF-8 | 430 | 3.734375 | 4 | [] | no_license | import itertools
def primes():
count = 1
while True:
count += 1
isSimple = True
for i in range(1, count, 1):
if (count % i == 0) and (i != 1) :
#print(count, i)
isSimple = False
break
if isSimple:
yield coun... | true |
f3626fe8dd335babb1bd9206b8360fe62b51bb86 | Python | ShannonMFarrell/BenfordCryptoAnalysis | /BitcoinAnalysis.py | UTF-8 | 1,150 | 3.25 | 3 | [] | no_license | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from math import log10, floor
def most_significant_digit(x):
e = floor(log10(x))
return int(x*10**-e)
def f(x):
return most_significant_digit(abs(x))
# read in the BTC data
BTCPrices = pd.read_csv(r'/home/shannonfarrell/Documents/B... | true |
4331cf8cf8ed0a6d9bd726d850942317f23bea70 | Python | deploy-soon/StockMarketData | /market/fnguide_extract_report.py | UTF-8 | 5,308 | 2.625 | 3 | [] | no_license | import os
import re
import sys
import csv
import pandas as pd
from os.path import join as pjoin
sys.path.append("../tools")
from misc import get_logger
class Report:
def __init__(self, data_path="data", res_path="res"):
self.logger = get_logger()
self.data_path = data_path
self.res_file =... | true |
2403306d85d49cec22988463dd3fda4e56172606 | Python | IsaacMagno/python3_curso_em_video | /PythonExercicios/ex065.py | UTF-8 | 489 | 4.15625 | 4 | [] | no_license | n = c = soma = maior = menor = 0
ask = 'S'
while ask != 'N':
n = int(input('Digite um número: '))
soma += n
c += 1
if c == 1:
maior = menor = n
else:
if n > maior:
maior = n
if n < menor:
menor = n
ask = str(input('Continuar? [S / N]: ... | true |
c8458fcb5aa2e7dc963acb2b5e920501a741b39e | Python | Yea-chanKim/kimyeachan | /python_1202_1/python_1202_1/python_1202_1.py | UTF-8 | 2,604 | 3.5625 | 4 | [] | no_license | import numpy as np
from matplotlib import pyplot as plt
##City 사이의 거리 구하기
#mileposts = np.array([0, 198, 303, 736, 871, 1175, 1475, 1544, 1913, 2448])
#distance_array = np.abs(mileposts - mileposts[:, np.newaxis])
#print(mileposts[:,np.newaxis]) # newaxis 하면 세로축으로 나타냄
#print(distance_array)
#그리드 또는 네트워크 기반 거리... | true |
8acaa6e0aad47b156a729ea8037ae548fb9566c1 | Python | thinkingrobo/CoachingSugoroku | /server/server_src/src/piece/piece_history_repository.py | UTF-8 | 2,151 | 2.65625 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .piece_history_model import PieceHistoryModel
from .repository_util import load_json, save_json
class PieceHistoryRepository:
def __new__(cls, *args, **kargs):
if not hasattr(cls, "_INSTANCE"):
cls._INSTANCE = super(PieceHistoryRepository, cls)... | true |
f216a64545c6e9fb5410a077b277ecce467ddf61 | Python | lewisfzhang/Scientist-Simulation | /src/functions.py | UTF-8 | 13,237 | 2.953125 | 3 | [] | no_license | # functions.py
import numpy as np
import config, timeit, glob, os, gc, ast, random, math
import subprocess as s
from scipy.stats import cauchy
# Input: Parameters for the logistic cumulative distribution function
# Output: Value at x of the logistic cdf defined by the location and scale parameter
def old_logistic_cd... | true |
d252e5ac1abab72a4533e176cc17ceb443601bd5 | Python | ptrwn/stats-and-reports | /stats.py | UTF-8 | 3,366 | 2.875 | 3 | [] | no_license | import pandas as pd
import numpy as np
from pathlib import Path
def get_df():
data_folder = Path("C:/Users/1/prg/py/jupy and tresh/DSATs/")
file_to_open = data_folder / "CSAT ALL.csv"
# reading the .csv
# the .csv is prepared manually, updated with DSAT analysis
df = pd.read_csv(file_to_open, k... | true |
e9196e135b95dd33fd92113a0e253dd80cda0df2 | Python | galoscar07/college2k16-2k19 | /1st Semester/Fundamentals of Programming /Lecture/Code/13-Exceptions.py | UTF-8 | 1,330 | 4.28125 | 4 | [] | no_license | '''
Created on Oct 25, 2016
@author: Arthur
Part of this code is taken from:
https://docs.python.org/3/tutorial/errors.html
'''
'''
Try to enter various (non-integer) values at the prompt given by the code snippet below
'''
# while True:
# try:
# x = int(input("Please enter a number: "))
# ... | true |
d73e88be32138c51e39b023ad51a194c93be2d6b | Python | Salvvador/algo | /6-3.f.py | UTF-8 | 549 | 4.0625 | 4 | [] | no_license | def does_tableau_contain(tableau, n):
j = 0
i = len(tableau) - 1
while j < len(tableau[0]) and i >= 0:
if tableau[i][j] == n:
return True
elif tableau[i][j] < n:
j += 1
else:
i -= 1
return False
tableau0 = [
[2, 3, 4, 9],
[5, 6, 8, 11... | true |
b63d86d8c317f3e7364d207f2a19afeebc002d29 | Python | PujaNaval/Python-Programs | /string1.py | UTF-8 | 429 | 4.25 | 4 | [] | no_license | str = 'hello'
str1 = "hi sushant"
str2 = """I am sushant, currently working as Assistant Professor"""
print (str) #prints complete string
print (str1)
print (str2)
print(str[0]) #prints first character of string
print (str [3:5]) #prints string in range
print (str [2:]) #prints string ... | true |
65a2a74d1f0c67fd759531f9e40aa48f34bd2f7d | Python | faheemali1997/SelfDrivingCar | /Remote_Control_Final.py | UTF-8 | 2,870 | 2.828125 | 3 | [
"MIT"
] | permissive | import tkinter as tk
import serial
import numpy as np
import scipy.io as sio
class Controller:
def __init__(self):
self.pressed = {}
self.prevPressed = {}
self._initPresses()
self._create_ui()
self.ser = serial.Serial(
port='/dev/cu.wchusbserial1420',
... | true |
469aa341f29ec68febadde94182fddacaa653768 | Python | ViktorHil/test | /PyQtTest/Test.py | UTF-8 | 257 | 2.609375 | 3 | [] | no_license | #!/usr/bin/python
import sys
from PyQt5.QtWidgets import QApplication, QWidget
if __name__ == '__main__':
app = QApplication( sys.argv)
w = QWidget()
w.resize( 250, 150)
w.move( 300, 300)
w.setWindowTitle('Simple')
w.show()
sys.exit( app.exec_())
| true |
a245a93510ad1510eada31789e10730fc03ee3fc | Python | alhariri-hashem/test_automation_project | /test.py | UTF-8 | 722 | 2.953125 | 3 | [
"MIT"
] | permissive | from test_automation.Utils.menu import Menu
from test_automation.Utils.menu_item import MenuItem
# navigation = OrderedDict({'h': 'home', 'e': 'exit'})
# m = ChainMap(navigation)
# main_menu = OrderedDict({'1': 'add a comment', '2': 'take a screenshot'})
# add_a_comment_sub = OrderedDict({'1': 'add a comment1', 'y': ... | true |
b1a0e53ecb383dd1d1b9ffc4db42bf2f2d6a1c8c | Python | aikrasnov/otus-examples | /mock/mock_patch/simple.py | UTF-8 | 159 | 2.515625 | 3 | [
"MIT"
] | permissive | from unittest.mock import patch
def foo():
return input()
@patch("builtins.input", lambda *args: "string")
def test_foo():
assert foo() == "string" | true |
4c91b425ef6f555a2f4d9576792abd60a1355546 | Python | falken20/workshop-ninja-python | /src/utils.py | UTF-8 | 2,096 | 2.546875 | 3 | [] | no_license | #!/usr/bin/env python
# coding=utf-8
# Copyright 2019
#
# Workshop Ninja Python
import logging
import json
import datetime
from google.appengine.ext import ndb
def serialize(model):
""" Returns dictionary from a ndb.Model object """
if isinstance(model, list):
return [serialize(i) for i in model]... | true |
b44df769b54225833917316594feb82ddfe6f64e | Python | vish-trip/EDS | /Assignment_1.py | UTF-8 | 1,663 | 3.015625 | 3 | [] | no_license | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
##Data Loading
eqData = pd.read_csv('EDSAssignment.csv', parse_dates=['date'])
eqData['price/epsNTM'] = eqData['price']/eqData['epsNtm']
eqData['entrVal/ebitdaNTM'] = eqData['entrVal']/eqData['ebitdaNtm']
eqData['entrVal/salesNTM'] = eqData['entrVal... | true |
40605688811774d7a2ec5f266c9826091f529c3c | Python | jpur/kanshii | /utils.py | UTF-8 | 819 | 2.921875 | 3 | [
"CC-BY-4.0",
"CC-BY-3.0"
] | permissive | import os
import xml.etree.ElementTree
import helper
from collections import namedtuple
from svg.path import Path, parse_path
Stroke = namedtuple('Stroke', 'start uvec')
# Populate dictionary with kanji stroke data from SVGs contained in the given directory
def calculate_paths(dirPath):
# Populate our kanji stroke d... | true |
25f8d3b6dc9c194a4d4e6704505419de78be4ef7 | Python | mrotmensch/assignment11 | /ll2850/assignment11.py | UTF-8 | 1,289 | 2.984375 | 3 | [] | no_license | __author__ = 'leilu'
import numpy as np
import matplotlib.pyplot as plt
from package.simulationandfunctions import *
def main():
"""
main function will call the investment function, taking argument from users that positions = [1,10,100,1000] and num_trails = 10000
The result daily_return is a list contai... | true |
868d9e46dda7634300162d7447f72f021167b293 | Python | JohnatanQuinteroV/CommunicationChannelSimulation | /PhysicalLayerSimulation.py | UTF-8 | 16,368 | 2.984375 | 3 | [] | no_license | # Made by: Johnatan Quintero and Edin Cascante
# How to run?: python3 PhysicalLayerSimulation.py
import matplotlib.pyplot as plt
import random
import hamming_codec
import numpy as np
from random import random, uniform
#recibe bc(l) y devuelve señal modulada s(t)
def modulador4ASK(bcT):
# salida sT y la señal c(t)... | true |
3c7d3266a13c52c1ac5f1d611b57bcc72c756324 | Python | fauziwei/async_tcp_server | /celery_test_threading_simple/app.py | UTF-8 | 901 | 2.59375 | 3 | [] | no_license | import os.path
import sys
import threading
basedir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(basedir)
import friend
def threadcode(my):
a = 5
b = 10
if my == 'one': # slowest
task = friend.spread_another_cpu.apply_async(args=(a, b), timeout=60)
count = task.get()
print('one: {}'.format(c... | true |
b93f461ec7e118403bda139baf9617809b4d90a2 | Python | SergeLage/Joined-Fishery-Analysis | /JFA/AS/DM/random_forest.py | UTF-8 | 804 | 3.109375 | 3 | [] | no_license |
from sklearn.ensemble import RandomForestClassifier
class RandomForest:
def makeModel(self,dataset):
print('RandomForestClassifier makeModel')
clf=RandomForestClassifier(n_estimators=200, max_depth=300,criterion ='entropy')
self.model = clf
def init(self):
print('RandomForest... | true |
e5d60d76db47bc456a3e77a8f58d1d0c1aa18236 | Python | supermario98218/BlockChain2920 | /script.py | UTF-8 | 7,509 | 2.75 | 3 | [] | no_license | import sched, time, hashlib, json, sys, time
import Adafruit_DHT as dht
import urllib
import urllib.request
from bs4 import BeautifulSoup
class Block:
hashVal = ""
prevHash = ""
data = 0.0
timeStamp = ""
def __init__(self, data, prevHash):
self.data = data
self.prevHash = prevHash
self.timeStamp = time.a... | true |
fd6f316d203481e044f5f56f987b2097dc1bdb4c | Python | priyansiChogale/dodgerGamePython | /main.py | UTF-8 | 11,433 | 2.8125 | 3 | [] | no_license | import pygame
import random
import sys
from tkinter import *
from os import path
from pygame import mixer
pygame.init()
WIDTH = 800
HEIGHT = 600
RED = (255, 0, 0)
BLUE = (0, 0, 255)
YELLOW = (255, 255, 0)
WHITE = (255,255,255)
NEW = (102,255,255)
HighScore = "HighScore.txt"
L2Score = "L2Score.txt"
L3Score = "L3Score.... | true |
a0cedfaad3d595e93689cbd4a6c82b83bac81f28 | Python | ArtemMonk/Homework2 | /Exercize3.py | UTF-8 | 803 | 4.40625 | 4 | [] | no_license | # 3. Пользователь вводит месяц в виде целого числа от 1 до 12.
# Сообщить к какому времени года относится месяц (зима, весна, лето, осень).
# Напишите решения через list и через dict.
seasons = ((1, 'Зима'), (2, 'Зима'), (3, 'Весна'), (4, 'Весна'), (5, 'Весна'), (6, 'Лето'), (7, 'Лето'), (8, 'Лето'), (9, 'Осень'), (10... | true |
6bb28c9c2ded56558c7bdfbd297afea1dc4ac492 | Python | Arturjssln/ML_project_1 | /src/evaluate.py | UTF-8 | 2,100 | 2.578125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import numpy as np
import datetime
from costs import compute_error, calculate_mse
from proj1_helpers import predict_labels
def compute_model_accuracy(x, y, w):
""" Compute the accuracy of the found model """
y_pred = predict_labels(w, x)
size = y.shape[0]
false_values = np.cou... | true |
afba02f39a464ee41f7085fce8c827972332b076 | Python | Aasthaengg/IBMdataset | /Python_codes/p02909/s732801478.py | UTF-8 | 117 | 3.125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
s = str(input())
dic = {'Sunny':'Cloudy', 'Cloudy':'Rainy', 'Rainy':'Sunny'}
print(dic[s]) | true |
ecf52af6bb4d30d7c3e9e3bc3c9d734225bbc1bd | Python | AdamZhouSE/pythonHomework | /Code/CodeRecords/2338/60707/313970.py | UTF-8 | 495 | 3.25 | 3 | [] | no_license | def func(A,X):
low=0
high=len(A)-1
while high>low:
if A[low]+A[high]==X:
return "Yes"
elif A[low]+A[high]>X:
low += 1
else:
high -= 1
return "No"
if __name__ == "__main__":
n = int(input())
for i in range(n):
inp1 = input(... | true |
bee8da42f6b3b79e3d7a1349971628b2bc103104 | Python | Anna-Vas/paseca-ctf-2019 | /tasks/expected_value_and_unexpected_winners/server/service/server.py | UTF-8 | 2,689 | 3.375 | 3 | [] | no_license | print('Welcome to the \"Great Casino\"')
print('In our casino you may choose to place bets on either a single number, various groupings of numbers whether the numbers are 1-36 or on zero.')
print('We know that in casual casion player can\'t have a winning strategy, however if you try to win in our casino 1000 times a r... | true |
ccc920dd9ae07c738f7cef74238d75fa67b0ae87 | Python | IsmailKent/updown-baseline | /updown/utils/GraphBuilder.py | UTF-8 | 2,014 | 2.90625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 25 11:13:58 2020
@author: Ismail
"""
import torch
import numpy as np
from scipy.linalg import block_diag
"""
Loops: Whenever you think you need a loop stop and think. Most of the time you do not and in fact do not even want one. It is much faster both to write and run co... | true |
b0711ca322d8d87324d18f79f6e4252e6b3d989d | Python | KlodaMikolaj/CDV | /Programowanie_strukturalne/6_listy_tuple_slowniki.py | UTF-8 | 658 | 3.75 | 4 | [] | no_license | #listy
programowanie=['PHP','Java','Python']
print(type(programowanie)) #class 'list'
programowanie.append('C#')
programowanie.append('PHP')
print(programowanie)
ile=programowanie.count("PHP")
print(f'PHP wystepuje {ile} razy')
###tuple
imiona={'julia','ania','tomek'}
print(type(imiona))
print(imiona)
firstname=imion... | true |
7610a3edd2ab2c8e8a3786b0cb09370727f19f80 | Python | MissTangerine/SunGouBot | /Answers.py | UTF-8 | 2,137 | 3.21875 | 3 | [] | no_license | import random
FORCE_UNIVERSAL_ANSWER_RATE = 0.13
UNIVERSAL_ANSWERS = [
"你说你马呢",
"那没事了",
"真别逗我笑啊",
"那可真是有趣呢",
"就这?就这?",
"你品,你细品",
"不会真有人觉得是这样的吧,不会吧不会吧不会吧"
"那可真是有够好笑的呢"
]
STRONG_EMOTION_ANSWERS = [
"你急了急了急了?",
"他急了,他急了!"
]
QUESTION_ANSWER... | true |
6188b66a3b410ef486292403aeda035921f45213 | Python | nathanwang000/deep_exploration_with_E_network | /env/main.py | UTF-8 | 6,162 | 2.515625 | 3 | [] | no_license | import numpy as np
import gym
import matplotlib.pyplot as plt
import matplotlib
from algorithms import *
def generate_plot_1():
env = gym.make("BridgeEnv-v0").unwrapped
marker_style=[':','-.','--','-',':','-.','--','-',':','-.']
num_episodes=10000
seed = [175,75,281,170,264,298,284, 144,38,20... | true |
44641a75d0a9639bc3969ffc6fca8a74feeb4a55 | Python | Chi-Chu319/SmartTurnstile | /smart_NFC_turnstile/Server/server_iot.py | UTF-8 | 2,924 | 2.53125 | 3 | [] | no_license | import Models.authen as authen
import Models.booking as booking
import Models.timeSlot as timeSlot
import Models.visitorEnter as visitorEnter
import datetime
import json
from flask import (
Blueprint,
request,
jsonify
)
with open('./config.json', 'r') as f:
config = json.load(f)
iotAPI = Blueprint("iotAPI",... | true |
a0e9c755329a1acdaca8c9fe75fefb372d82a547 | Python | KAJAL-1024/Python-exercises- | /Python/Lec_1.py | UTF-8 | 340 | 4.09375 | 4 | [] | no_license | print(2+3) # print function
a=15
b=45
print(a+b) # Addition
print(a-b) # subtraction
print(a*b) # multiplication
print(a/b) # Division
print(a//b) # Inter division
print(a%b) # Module
b=1.5
print(a) # print Integer (int)
print(b) # print Float (float)
print("Apple") # print Charac... | true |
5470158d24bc50f192260ef847f7e58ec7238fea | Python | mcburneyc/220 | /assignments/hw3/mean_test.py | UTF-8 | 3,823 | 2.671875 | 3 | [] | no_license | import json
from hw3 import mean
from tests import api_service
from tests.test_framework import *
class TestClass:
def test_hw(self, monkeypatch, capfd):
outline = TestBuilder('mean', 'mean.py', 12, 2)
outline.rc_file = '../../tests/hw3/.pylintrc'
outline.add_to_blacklist({
'... | true |
a4d5b92450f64794bc3391ceab2d0c7b58d2e06a | Python | AbuBakkar32/Python-Essential-Practice | /Practice/sumReexp.py | UTF-8 | 183 | 2.9375 | 3 | [] | no_license | import re
file = open('sumReexp.txt', 'r')
sum = 0
for line in file:
numbers = re.findall('[0-9]+', line)
for number in numbers:
sum = sum + int(number)
print(sum)
| true |
42d97c11e13602462799b27be035b020e911dfb0 | Python | GianMarcoZampa/Game | /Ammo.py | UTF-8 | 828 | 3.421875 | 3 | [] | no_license | import pygame
class Ammo:
_kunai = pygame.image.load('images/Player/Kunai.png')
scaling = 0.2
_kunai = pygame.transform.scale(_kunai, (int(32 * scaling), int(160 * scaling)))
_kunai = pygame.transform.rotate(_kunai, 270)
def __init__(self, x, y, left):
self.speed = 40
self.x, se... | true |
91de22de0749aa96be270a7307aa2fe50010badf | Python | rahulotwani/AlgoLab | /inversion.py | UTF-8 | 1,098 | 3.078125 | 3 | [] | no_license | def mergesort(arr, l, r):
if r-l ==0:
return arr, 0
if l < r :
mid = (l + r) // 2
a1, inv1 = mergesort(arr[l : mid + 1], 0, mid - l)
a2, inv2 = mergesort(arr[mid + 1 : r + 1], 0, r - mid - 1)
k = l
i = 0
j = 0
inv = 0
whi... | true |
1f18b524b6474eba611d0e4c83e4331b33824a90 | Python | Alexlandeau/advent-of-code-2020 | /day_9/day_9.py | UTF-8 | 1,393 | 3.140625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# Load necessary modules
import sys
from pathlib import Path
# Add parent folder to python path and import function from day 1 solution
sys.path.append(str(Path(".").absolute()))
from day_1.day_1 import get_sum_terms
TEST = False
DEFAULT_PREAMBLE_LENGTH = 25
# Read input data
with open("d... | true |
8f952d26f100a28d7cfac01e4979c4323a9941ef | Python | marciabalascio/marcia_estudo_URI | /#1009_salario_com_bonus.py | UTF-8 | 187 | 2.84375 | 3 | [] | no_license | vendedor = str(input())
salario_fixo = float(input())
total_vendas = float(input())
salario_total = (0.15 * total_vendas) + salario_fixo
print("TOTAL = R$","%.2f" % salario_total) | true |
004ce876ce9901b42b6a419aa75dc51fdb666501 | Python | hackrush01/os_lab | /Assignments/scripts/python/day9/6.py | UTF-8 | 948 | 3.59375 | 4 | [] | no_license | from math import sqrt
from time import sleep as ts
import multiprocessing
def fibo(n):
return ((1+sqrt(5))**n-(1-sqrt(5))**n)/(2**n*sqrt(5))
def print_fibo(num):
print("Fibonacce series is: ", end='')
for i in range(0, num):
print(int(fibo(i)), end=' ')
def print_sum(num):
print("\n\nSum... | true |
09c19891dd271f068d7d8321f37f6c82a08a74f1 | Python | Ulauncher/ulauncher-emoji | /EmojiSpider.py | UTF-8 | 7,813 | 2.578125 | 3 | [] | no_license | # encoding: utf-8
import os
import re
import scrapy
import requests
import lxml.html
import sqlite3
import shutil
import base64
EMOJI_STYLES = ['apple', 'twemoji', 'noto', 'blobmoji']
ICONS_PATH = lambda s: 'images/%s/emoji' % s
DB_PATH = 'emoji.sqlite'
def rm_r(path):
if os.path.isdir(path) and not os.path.isli... | true |
9d582fb472d030594e96a601a57ef9928231d2c9 | Python | DOSTI-99999/Reddit-Meme-APII | /memeGenerator.py | UTF-8 | 4,102 | 2.796875 | 3 | [
"MIT"
] | permissive | import praw
from random import choice
import os
reddit = praw.Reddit(client_id=os.getenv("9a8ByvHQz3sJoLsLqOb6VQ"),
client_secret=os.getenv("jshU-io739rUVLCKOojGncifRB3n6Q"),
user_agent=os.getenv("USER_AGENT")
)
TOPICS = [ # Default Topics When No Topic ... | true |
f776fab6c375df703346b505cd7f8c3cca5c903b | Python | hungntt/KattisSolutions | /Python/digitsum.py | UTF-8 | 708 | 3.40625 | 3 | [] | no_license | memo = {}
def digitSum(n):
dSum = 0
while n > 0:
dSum += n % 10
n //= 10
return dSum
def countUpTo(n):
if n <= 0:
return 0
if n % 10 == 0:
# 1+2+3+4+5+6+7+8+9 = 45
# 10 -> 19 = 45 + 10 number 1
# Ex: count(20) = 45 * 2 ( 2 times 1->9) + 10 * count(... | true |
afee7a50035a6c28d6cadf18e660a4403660164e | Python | chishige1217200/nabeatu | /nabeatu.py | UTF-8 | 240 | 3.3125 | 3 | [
"MIT"
] | permissive | def nabeatu(num: int):
if num <= 0:
return False
if num % 3 == 0:
return True
if '3' in str(num):
return True
return False
# main
for num in range(0, 401):
if nabeatu(num):
print(num)
| true |
ce9f5ed7d777ed9dbffe789184947919ad502007 | Python | willianjoga6/pythonfundamentals | /Aula/Funções.py | UTF-8 | 1,834 | 3.78125 | 4 | [] | no_license | #-*- coding: utf-8 -*-
# produtos = []
# #função sempre inicia com 'def'
# def cadastraProduto(produto:
# global produtos
# produtos.append(produto)
# cadastraProduto('Batata')
# print(produtos)
# def listarProdutos():
# global produtos
# print(produtos)
# def deletarProdutos(produto):
# glo... | true |
f00e68dd6a2e8e4bd141d84cd54b1b1ffbfa5830 | Python | imheyday/ghoulies | /image_generation/proof.py | UTF-8 | 2,093 | 2.75 | 3 | [
"MIT"
] | permissive | import hashlib
import os
import json
directory = "./output"
file_list = os.listdir(directory)
sorted_file_list = sorted(file_list, key=lambda x: int(os.path.splitext(x)[0]))
all_hashes_in_order_list = []
all_hashes = ""
for file in sorted_file_list:
filename = os.fsdecode(file)
json_filename = filename.split(... | true |
f6a4210b6e1112845bf6e4a0e9340b74180930f2 | Python | Jeffrey-A/Data_structures_and_algorithms_Programs | /HW12/part2/BST_unittest.py | UTF-8 | 713 | 3.40625 | 3 | [] | no_license | #Jeffrey Almanzar
from BST import *
import unittest
class BST_test(unittest.TestCase):
"""Test BST methods: insert_rec(item) and find(item)."""
def test_insert_rec(self):
self.assertEqual(TREE.asList(),[2,3,5,7,8,9])
def test_find(self):
values_in = [8,2,9,5]
for n in values_... | true |
eb303e2d7e0007e750f684a79fd07ac0a47277f5 | Python | fox895/handson_app | /scripts/analysis.py | UTF-8 | 10,166 | 2.75 | 3 | [] | no_license | import pandas as pd
import numpy as np
# read the airports data
airports = pd.read_csv('../data/airports.dat.csv', header=None, index_col=0)
cols = ['NAME', 'CITY', 'AIRPORT_COUNTRY', 'IATA', 'ICAO', 'LATITUDE', 'LONGITUDE', 'ALTITUDE', 'TIMEZONE',
'DST', 'TIMEZONE', 'TYPE', 'SOURCE']
airports.columns = cols... | true |
e1933f94cf42841e46b90ba5df56c21182279375 | Python | msaxena2/Project-Euler | /Largest_Prime_Factor_p3/Largest_Prime_Factor_sol.py | UTF-8 | 687 | 4 | 4 | [] | no_license | from math import sqrt
__author__ = 'manasvi'
"""
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
Approach is very naive. To be improved
"""
def check_prime(num):
print "checking prime"
for i in xrange(3, num/2):
if num % i == 0:
... | true |
df70ce2ea02f4c9b817246f01b0cf72b918f49bc | Python | tsCoelho/CarND-Advanced-Lane-Lines | /src/AdvancedLaneFinding_vFinal.py | UTF-8 | 41,883 | 2.84375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# coding: utf-8
# ## Advanced Lane Finding Project
#
# The goals / steps of this project are the following:
#
# * Compute the camera calibration matrix and distortion coefficients given a set of chessboard images.
# * Apply a distortion correction to raw images.
# * Use color transforms, gradie... | true |
c9bb0a760150ee5108778abeb7aacd59ed888a92 | Python | YellowruiAccount/Arctic_codes | /equation_test_sigma.py | UTF-8 | 2,399 | 3.28125 | 3 | [] | no_license | #!/usr/bin/env python
"""
"""
import sys
import matplotlib.pyplot as plt
import numpy as np
# Clear-sky summer values from net flux figure
dflux_dsigma = -1.3183
del_T = (86400.)*90 # number of seconds of solar heating per summer
l_f = 3.3e5 # latent heat of fusion (J/kg)
rho_i = 917 # density of ice (kg/m3)
def ... | true |
525ccae9ad5e2b15a4ee0a240ae9df596f5f8e6f | Python | Ferveloper/python-exercises | /KC_EJ26.py | UTF-8 | 216 | 3.625 | 4 | [] | no_license | #-*- coding: utf-8 -*
def pintarFila(n):
print('<table>');
for i in range(1, n + 1):
print('<tr><td></td></tr>')
print('</table>')
rows = input('Introduce el número de filas: ')
pintarFila(rows) | true |
139a7a506775a533e362a12d5a91275d08c379f2 | Python | Jesssullivan/USBoN | /pi-batman-adv/MusingParabolaGenerate.py | UTF-8 | 1,450 | 2.71875 | 3 | [] | no_license | # quickly generate parabolic dish for Tx / Rx hardware
# just a bunch of ideas mostly from https://forum.freecadweb.org/viewtopic.php?t=4430
import Part, math
# musings derived from:
# comments from forum are kept.
# ? may need to sc. mm --> cm?
tu = FreeCAD.Units.parseQuantity
def mm(value):
return tu('{} mm'.f... | true |
aedc4d833eb0fc2070338ef92ed82bf90ed7a622 | Python | yunieom/Study.2-Algorithm | /프로그래머스/lv1/42748. K번째수/K번째수.py | UTF-8 | 299 | 2.875 | 3 | [] | no_license | def solution(array, commands):
answer = []
arr = []
for i in range(len(commands)):
num1 = commands[i][0]
num2 = commands[i][1]
num3 = commands[i][2]-1
arr = array[num1-1:num2]
arr.sort()
answer.append(arr[num3])
return answer | true |
0c669cd620f6af2e254a66e8e49c654760949eda | Python | ashpool/ketchlip | /test/helpers/file_observer_test.py | UTF-8 | 2,278 | 3.09375 | 3 | [] | no_license | import time
from nose.tools import eq_
from ketchlip.helpers.file_observer import FileObserver
class Listener():
def __init__(self):
self.message = None
self.messages = []
def notify(self, message):
self.message = message
self.messages.append(message)
def test_notify():
f... | true |
d69a70070353dd8891facb52127c26f3c6deb657 | Python | skibaa/smart-sweeper | /test.py | UTF-8 | 740 | 2.796875 | 3 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | from google.appengine.ext import db
from time import time
print 'Content-Type: text/plain'
print ''
total_t=time()
class Root(db.Model):
pass
class C(db.Model):
i=db.TextProperty()
t1000="a"*10000
def add_in_transaction(root, text, amount):
for j in range(amount):
c=C(parent=root, i=text)
... | true |
b748db6b88f67fffc60443cc8508ec55d2849d69 | Python | jancyrusm/programming-logic-and-design | /M/3.py | UTF-8 | 606 | 4.34375 | 4 | [] | no_license | '''
Jan Cyrus M. Villar
BS CoE 1-6
Write a program that get your name and print and number of vowels.
What is your name? Danilo
You have 3 vowels
'''
patinig = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
name = []
pangalan = input('What is your name? ')
name.append(pangalan)
#separate wor... | true |
ae7bd84a53eef72df970a9aa8a0d95147b131e3f | Python | mitodl/odl-video-service | /ui/management/commands/add_hls_video_to_edx.py | UTF-8 | 3,909 | 2.59375 | 3 | [
"BSD-3-Clause"
] | permissive | """Management command to attempt to add an HLS video to edX via API call"""
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from ui.api import post_video_to_edx
from ui.encodings import EncodingNames
from ui.models import VideoFile
from ui.utils import g... | true |
440872951aa983ec1ec066f490e53d97502bc856 | Python | glofst/cicd | /calculator/sum.py | UTF-8 | 226 | 3.953125 | 4 | [] | no_license | def sum(a, b):
"""Simple sum function just for example
Args:
a (any): first element to sum
b (any): second element to sum
Returns:
any: result sum of two numbers
"""
return a + b
| true |
d54310c4d81d12db785b39ff5ee18e26f6698de2 | Python | felipedaf/UDS-Chat | /server/chat_handler.py | UTF-8 | 960 | 2.890625 | 3 | [] | no_license | from .chat import Chat
class ChatHandler:
def __init__(self):
self.chats = dict()
def __get_valid_chat(self, addr_user1, addr_user2):
hash1 = hash((addr_user1, addr_user2))
hash2 = hash((addr_user2, addr_user1))
if hash1 in self.chats:
return hash1
elif has... | true |
f8e60774054d99f71534c72faf98f26de4c25e09 | Python | karolinamaruszak13/jezyki_biblioteki_analizy_danych | /zad6/tests/test_line_equation.py | UTF-8 | 960 | 3.015625 | 3 | [] | no_license | import unittest
from jezyki_biblioteki_analizy_danych.zad6.line_equation import line_equation
class LineEquationTest(unittest.TestCase):
def test_point_value(self):
self.assertRaises(ValueError, line_equation, pointA=(1, 1), pointB=(1, 1))
self.assertRaises(ValueError, line_equation, pointA=(0, 0)... | true |
db4f6eb639df074fad6e1c15cd3caae501c1a0a7 | Python | simzeee/FindAFarm | /app/api/amenity_routes.py | UTF-8 | 1,274 | 2.671875 | 3 | [] | no_license | from flask import Blueprint, jsonify, request
from flask_login import login_required, current_user
from app.models import db, Amenity, Farm
amenity_routes = Blueprint("amenities", __name__)
@amenity_routes.route("/")
def getAmenities():
amenities = Amenity.query.all()
return {"amenities": [amenity.to_dict()... | true |
13c83cc46f78b4a181ec1c603657ca3300fdc52c | Python | nd7141/Yandex-contest2015 | /3/path.py | UTF-8 | 2,053 | 3 | 3 | [] | no_license | __author__ = 'Sergei.Ivanov'
def main():
with open("input.txt") as f, open("output.txt", "w") as g:
lines = f.readlines()
N, M = map(int, lines[0].split())
edges = {i: set() for i in range(1, N+1)}
e_lines = lines[1:M+1]
e_order = dict()
e_weight = dict()
for... | true |
46a22a96bda9a5f195e4a451bd7461a575413892 | Python | AkhilaSaiBejjarapu/Python | /between_number.py | UTF-8 | 96 | 3.328125 | 3 | [
"MIT"
] | permissive | number=int(input())
if ((number>25) and (number<75)):
print("True")
else:
print("False") | true |
49f8a0505274f2dce65faeb31beb0749f6e03aa6 | Python | Ma-r-co/cp-utils-python | /mod_combination.py | UTF-8 | 1,236 | 3.0625 | 3 | [] | no_license | MOD = 10 ** 9 + 7
def modFact(n):
global MOD
if n == 1:
return 1
else:
return (n * modFact(n - 1)) % MOD
def modInvFact(n):
global MOD
ans = 1
for i in range(1, n + 1):
ans *= pow(i, MOD - 2, MOD)
ans %= MOD
return ans
def modCombi(n, r):
global MOD
... | true |
c734a410a988d6958e6a1e22126d1b9cfa4e8439 | Python | tmoi29/Succotash | /pass_strength.py | UTF-8 | 876 | 2.96875 | 3 | [] | no_license | #Tiffany Moi
#SoftDev2 pd7
#K15 -- Do You Even List?
#2018-04-26
from math import log
def threshold(passw):
upper = [x for x in passw if x.isupper()]
lower = [x for x in passw if x.islower()]
num = [x for x in passw if x.isdigit()]
return (len(upper) != 0 and len(lower) != 0 and len(num) != 0)
pr... | true |
ff2a96dbe2570f18c7d9febed28f789fa7bfb97d | Python | talha927/Football-Match-Analysis-and-Prediction-System | /jsonC.py | UTF-8 | 1,360 | 2.640625 | 3 | [] | no_license |
import json
def convert_json_format(data):
imglst=[]
titlelst=[]
desclst=[]
authorlst=[]
contentlst=[]
urllst=[]
# print(json.dumps(data, indent=4, sort_keys=True))
# print(data['status'])
# print("Author: ",data['articles'][0]['author'])
# print("Content: ",data['... | true |
5b3665dd867b4d6bdcaa52f7ff9ae0bdefe4ea1f | Python | paullen/Spidermae | /Spidermae.py | UTF-8 | 2,508 | 2.703125 | 3 | [] | no_license | # This spider downloads memes from subreddits with all the
# settings being mentioned in the settings.py file.
# This script does not use PRAW since it only retrieves memes from the
# subreddits, there is no user interaction with the website so I didn't see
# it fit to use an API.
import os
import requests
import re
... | true |
d51971eb1e1128f1ca131ade1e020a196b566714 | Python | denizcetiner/rosalindpractice | /3SUM.py | UTF-8 | 1,426 | 3.203125 | 3 | [] | no_license | def get3sum(array: []) -> []:
ht1_sum_index = {}
for i in range(0, len(array)):
ht1_sum_index[array[i]] = [i]
ht2_sum_indexes = {}
for k in range(0, len(array)):
check = array[k]
for sums, indexes in ht1_sum_index.items():
if k in indexes:
continue
... | true |
b3438f9ce25c9327d0ea628e8dc33f434f5002b0 | Python | abhigupta4/Competitive-Coding | /SPOJ/feynman.py | UTF-8 | 106 | 3.390625 | 3 | [] | no_license | number = int(raw_input())
while (number):
print (n*(n+1)*((2*n)+1))/6
number = int(raw_input())
| true |
e7f417667b72ce77764c3cfe456662e6d2e2cc7e | Python | RubenMcCarty/Machine-Learning-codes | /multilayer-perceptron/test_iris.py | UTF-8 | 2,047 | 3.203125 | 3 | [] | no_license | #!/usr/bin/env python
import numpy as np
from multilayer_perceptron import *
"""
Iris setosa:
1-sepal length in cm
2-sepal width in cm
3-petal length in cm
4-petal width in cm
5-class ( Setosa, Vericolour, Iris Virginica)
download from: http://archive.ics.uci.edu/ml/machine-learning-databases/iris/... | true |
18d0b95179b7fa5e0bdc6fa30f12e69bc39c10df | Python | hrithikguy/ProjectEuler | /p31.py | UTF-8 | 699 | 3 | 3 | [] | no_license | import math
amount_we_want = 200
output = 0
for i1 in range(0, amount_we_want/200 + 1):
for i2 in range(0, (amount_we_want - 200*i1)/100 + 1):
for i3 in range(0, (amount_we_want - 200 * i1 - 100*i2)/50 + 1):
for i4 in range(0, (amount_we_want - 200*i1 - 100*i2 - 50 * i3)/20 + 1):
for i5 in range(0, (amount_... | true |
340db954ec9d77b0a4de403e56761f84c96206a6 | Python | chrisjim316/Amazon-Alexa-Hack | /tests/src/alexaTest.py | UTF-8 | 2,341 | 2.703125 | 3 | [
"MIT"
] | permissive | from __future__ import print_function
import json
import urllib2
from random import *
from pprint import pprint
from alexa import *
# Import logger for more detailed debugging tracebacks
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__) #<<<<<<<<<<<<<<<<<<<<
def main():
... | true |
9688bc03b2465a3d0c350161c595b360194068e6 | Python | abetts155/Projects | /tools/lib/system/analysis.py | UTF-8 | 11,879 | 2.578125 | 3 | [] | no_license | import collections
import random
from concurrent.futures import ThreadPoolExecutor
import numpy
from lib.utils.debug import verbose_message
from lib.system.directed_graphs import (DepthFirstSearch,
CallGraph,
InstrumentationPointGraph)
fr... | true |
f721778dba5cbfe672bd9a89f40633b7c2f18af7 | Python | fliptopbox/shredder | /shredder.py | UTF-8 | 3,711 | 2.859375 | 3 | [] | no_license | #!/usr/bin/python3
import numpy as np
import cv2
import random
import sys
import getopt
import re
banner = """
____ . . ____ ___ ___ ____ ____ . ; . : . ,
[__ |__| ---- |___ | \ | \ |___ |__/ | | | | | |
___] | | |__/ |___ |__/ |__/ |___ | \ | | | | | |
+---------|--\----------------|-------... | true |
160dd3503412b9055b88847312e867cdfa656781 | Python | HFMarco/quantum_py | /Tarea_01/mayor_menor.py | UTF-8 | 264 | 4.15625 | 4 | [] | no_license | a = int(input('Ingrese un numero, por favor: '))
b = int(input('Ingrese el segundo numero, por favor: '))
def diferencia(a,b):
c=f'El numero {a} es mayor'
d=f'El numero {b} es mayor'
return c if a>b else d
resultado = diferencia(a,b)
print(resultado) | true |
9e0148cd56d35996b89c7214e5f65a639fb1acab | Python | aikiyy/ods-python | /source/chainedhashtable.py | UTF-8 | 1,718 | 2.875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import random
from arraystack import ArrayStack
from base import BaseSet
w = 32
class ChainedHashTable(BaseSet):
def __init__(self, iterrable=[]):
self._initialize()
self.add_all(iterrable)
def _initialize(self):
self.d = 1
self.t = self._alloc_table(1... | true |
09545a93de223f96524fa7c7d66efc35aa030720 | Python | aleenadavy90/Python-unit-test-framewok | /NginxPerfTest.py | UTF-8 | 1,413 | 2.65625 | 3 | [] | no_license | import unittest
from datetime import datetime
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
class PerformanceTest(unittest.TestCase):
@classmethod
def setUpC... | true |
226e742423492b5dbddd0c405de17b5c7fc2e3c8 | Python | afhernani/pyAnarkia | /Tareas/subclasethread.py | UTF-8 | 640 | 3.75 | 4 | [] | no_license | '''
Creando una subclase Thread y redefinir sus metodos.
Cuando comienza la ejecución de un hilo se invoca, automáticamente, al método subyacente
run() que es el que llama a la función pasada al constructor. Para crear una subclase Thread es
necesario reescribir como mínimo el método run() con la nueva funcionalidad
'... | true |
3ae4e7318b8f1ac7217a5321bdd5b630d2c57529 | Python | Philippaolomoro/simple_python_projects | /Documents/startNG/python/python_first_task/circle_area.py | UTF-8 | 136 | 3.859375 | 4 | [] | no_license | import math
def circle_area(radius):
return math.pi * (radius ** 2)
rad = float(input("Enter a radius: "))
print(circle_area(rad)) | true |
b35b2eecc75176a88443fd65897aa72f5a50a0e6 | Python | dkisliuk/DCSDAQ | /Keithley2230G.py | UTF-8 | 7,267 | 3.09375 | 3 | [] | no_license | #!/usr/bin/python
'''
Defines a class to control Keithley2230G model low voltage power supply
Read out is via USB-USB (serial) connection using pyvisa-py library
Also has a 'main' program for testing purposes
**NOTES**
The Keithley2230G is very finnicky when it comes to reading out things through pyvisa-py.
For this ... | true |
7dea51bd714b8c1197052c3dcd02fc478ade57b5 | Python | sapcc/vrops-exporter | /tools/helper.py | UTF-8 | 654 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | def chunk_list(lst, n):
for i in range(0, len(lst), n):
yield lst[i:i + n]
def yaml_read(path):
import yaml
yml = dict()
with open(path, 'r') as stream:
try:
yml = yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
return yml
def remov... | true |
5137e0d2218724ca725ba8de8737678954519a0c | Python | sychoo/feature-interaction-prototype | /src/STL_Interpreter/AST/stmt.py | UTF-8 | 3,352 | 3.0625 | 3 | [] | no_license | # stmt.py
# 2020-11-06 07:48:34
# contains core statement of the language
from sys import stdout, path
path.append("..") # Adds higher directory to python modules path.
from tools import String_Builder
from core_AST import Stmt
class Variable_Decl_Stmt(Stmt):
def __init__(self, decl_type, var_id_val, var_type, ... | true |
ba3680ba2be68892c294c3987f59cd2c1dfc355e | Python | SravyasriAppajee/PythonProgramming | /compareusingfunctions.py | UTF-8 | 309 | 4.0625 | 4 | [] | no_license | a=int(input("enter value of a: "))
b=int(input("enter value of b: "))
c=int(input("enter value of c: "))
def largestnumber():
if(a>=b) and (a>=c):
largest=a
elif(b>=a) and (b>=c):
largest=b
else:
largest=c
print("largest number is: ",largest)
largestnumber() | true |
fe2c07c7e3f92a298481d00d90e5ecf21d3b5fe1 | Python | uoaid/crwal | /爬取_杰伦封面.py | UTF-8 | 1,027 | 2.609375 | 3 | [] | no_license | import requests
from bs4 import BeautifulSoup
import re
import os
# 伪造请求头: 基操
Hostreferer = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36'
}
response = requests.get("http://www.jianshu.com/p/23791264077f", headers=Hostre... | true |
ab7e9845b0ea5f270cf2f718a746d58eec0a38e0 | Python | GBH007/GLib | /src/GLib/reportgenerator/txtreport/txtreport.py | UTF-8 | 978 | 2.84375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# author: Григорий Никониров
# Gregoriy Nikonirov
# email: mrgbh007@gmail.com
#
from ..report import ReportGenerator
__all__=['TXTReportGenerator']
class TXTReportGenerator(ReportGenerator):
'''класс для отчетов в txt файле'''
def addText(self,text,end='\n'):
'''добавляет... | true |
45f5a9267378e624a0e358b72a8420c76d14b4f8 | Python | OASISJAY/COMP9021-18s1 | /Assignments/Assignment 2/frieze.py | UTF-8 | 19,966 | 2.828125 | 3 | [] | no_license | #Written by Ragavendran Lakshminarasimhan for COMP9021 SEMESTER 1,2018
import os
import numpy as pd
from collections import defaultdict
def validnumbers(array):
if (array >= 0).all() and (array <=15).all():
return True
def valid_lastcolumn(array):
if (array[:,-1] >=0).all() and (array[:,-1] <=1).al... | true |
64e1f884e8decaf674951449a6dd0f2986497b74 | Python | gsnlyd/TrafficViz | /inference/detect.py | UTF-8 | 5,176 | 2.6875 | 3 | [] | no_license | from argparse import ArgumentParser
from argparse import ArgumentParser
from typing import NamedTuple, Tuple, List
import torch
import torchvision
from PIL import Image, ImageDraw
from torch import Tensor
from torchvision.models.detection import FasterRCNN
from torchvision.transforms import ToTensor
from training imp... | true |
d6c4629cd66daf9bd1d468dabe4575c2fe8fc2b6 | Python | michaelescue/Code | /forward.py | UTF-8 | 2,936 | 3.15625 | 3 | [
"MIT"
] | permissive | #https://circuitdigest.com/microcontroller-projects/arduino-python-tutorial
#https://pynput.readthedocs.io/en/latest/mouse.html#reference
import numpy as np
from math import pi
from math import radians as rad
# Lengths
# 1st arm from shoulder, forecep, wrist with gripper length.
a = np.array([12.5, 12.5, 18.5])
# X... | true |
72d701241ec78208b56a05c135713924da7664bf | Python | Naserume/OpenSourceSWProject | /cardgame.py | UTF-8 | 1,332 | 3.46875 | 3 | [
"MIT"
] | permissive | # Card Game API
import random
def fresh_deck():
suits = {"Spade", "Heart", "Diamond", "Club"}
ranks = {"A", 2, 3, 4, 5, 6, 7, 8, 9, 10, "J", "Q", "K"}
deck = []
for s in suits:
for r in ranks:
card = (s, r)
deck.append(card)
random.shuffle(deck)
return deck
# d... | true |
ab117db0dce60cc33bb5afba5048adaa5f56c001 | Python | BBVA/economics-of-serverless | /awscosts/awscosts/ec2.py | UTF-8 | 4,386 | 3 | 3 | [
"Apache-2.0"
] | permissive | # Copyright 2018 BBVA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwar... | true |
1e54c7e492d36c10439b61272620b95520dc13e8 | Python | 6895mahfuzgit/Linear_Algebra_for_Machine_Learning | /matrix_by_matrixmultiplication_using_numpy.py | UTF-8 | 294 | 3.125 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 14 01:12:41 2021
@author: Mahfuz_Shazol
"""
import numpy as np
A=np.array([
[3,4],
[5,6],
[7,8],
])
B=np.array([
[1,9],
[2,0],
])
result=np.dot(A,B)
print(result)
| true |
2bbb8def18d2ac8480ed081b1a7410521d2964e4 | Python | Beirdo/HavokMud-redux | /docker/eosio/eosio/bin/extract_private_key.py | UTF-8 | 341 | 2.5625 | 3 | [
"MIT"
] | permissive | #! /usr/bin/env python3
import json
import sys
if len(sys.argv) < 3:
print("Usage: %s json-key-file privateKey" % sys.argv[0])
sys.exit(1)
with open(sys.argv[1]) as f:
data = json.load(f)
data = {row[0]: row[1] for row in data}
privkey = data.get(sys.argv[2], "")
if not privkey:
sys.exit(2)
print(... | true |
8393fd05802d55139d3a51034b9be5e17f872bd1 | Python | obrazowaniebiomedyczne/laboratorium-1-wt-tn-17-05-comm0 | /solution.py | UTF-8 | 1,671 | 3.671875 | 4 | [] | no_license | """
Rozwiązania do laboratorium 1 z Obrazowania Biomedycznego.
"""
import numpy as np
"""
3 - Kwadrat
"""
def square(size, side, start):
image = np.zeros((size, size)).astype(np.uint8)
for i in range(start[0],side):
for j in range(start[1],side):
image[i,j] = 255
return image
"""
3 - Koło
"""
... | true |