blob_id large_string | language 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
04a420c94d310d0db765ba11a66ee8d313b93fcc | Python | ericmjl/internet-monitor | /src/netspeedmonitor/ui.py | UTF-8 | 2,685 | 2.8125 | 3 | [
"MIT"
] | permissive | """Streamlit UI."""
import socket
from functools import partial
from threading import Thread
import pandas as pd
import streamlit as st
from tendo import singleton
from netspeedmonitor.lib import (
load_db,
log_data,
measure_speed,
record_func,
to_dataframe,
)
me = singleton.SingleInstance()
db... | true |
098bec8357b1c9031355d73eb7c76b1bf0216ccf | Python | edgargsm/CSLPProj3Python | /GolombTest.py | UTF-8 | 339 | 2.515625 | 3 | [] | no_license | from Golomb import Golomb
from Bitstream import BitStream
import sys
bt = BitStream("text1.txt", "wb",init_message = "Ola\n")
g = Golomb(5, bt)
encoded2 = g.encode2(int(sys.argv[1]))
bt.endWrite()
bt2 = BitStream("text1.txt", "rb",read_FirstLine = True)
g2 = Golomb(5,bt2)
decoded2 = g2.decode()
print(bt2.first_lin... | true |
d5d3c91e28408150f838eae64b3cbec8db5c39c7 | Python | tauanybueno/cursoemvideo-python-mundo1 | /desafios-python/python-mundo1/ex008.py | UTF-8 | 261 | 4.09375 | 4 | [
"MIT"
] | permissive | #escreva um programa que leia um valor em metros e o exiba
#convertido em centímetros e milímetros
m = float(input('Digite o valor em metros: '))
c = m * 100
mili = m * 1000
print('O valor em centimetros é {:.0f}cm e em milímetros {:.0f}mm'.format(c,mili)) | true |
150447a2983c46c5ebcecb61daf3080f0fea3b5e | Python | abiolarasheed/fabobjects | /apps/base.py | UTF-8 | 1,508 | 2.765625 | 3 | [
"MIT"
] | permissive | # coding: utf-8
from __future__ import unicode_literals
class BaseApp(object):
"""
A base application that implements minimal functions most apps should have.
"""
def __init__(self, *args, **kwargs):
pass
def delopy(self):
"""
A method to install the application on the ho... | true |
33653d2cfdf75ec87e6138ee96ed7fa40b494d68 | Python | ydtan123/EastCRNN | /detect.py | UTF-8 | 5,473 | 2.578125 | 3 | [] | no_license | #!/usr/bin/python
import argparse
import cv2
import logging
import os
import pathlib
from EAST.eval import EASTPredictor
from CRNN.predict import CRNNPredictor
from CRNN.tool.image_boxes import group_by_y
from CRNN.tool.image_boxes import get_gt_symbols
class Detector(object):
def __init__(self, east_weight, crn... | true |
37587603d6c559764cf55d3a667ef63fefdfe466 | Python | di-ex/Test | /Шифр Цезаря.py | UTF-8 | 717 | 3.34375 | 3 | [] | no_license | alpha = 'абвгдеёжзийклмнопрстуфхцчшщъыьэюя'
alphaUp = 'АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ'
number = int(input('Введите число Цезяря: '))
summary = ''
def changeChar(char):
if char in alpha:
return alpha[(alpha.index(char) + number) % len(alpha)]
elif char in alphaUp:
return alphaUp[(alp... | true |
fa6bbc91a95a3e652e6f590f8562c73eda317f9b | Python | samtaufa/countershape | /countershape/markup.py | UTF-8 | 840 | 2.53125 | 3 | [
"MIT"
] | permissive |
class Default:
def __call__(self, s):
return s
try:
import markdown2
class Markdown:
def __init__(self, html4tags=False, tab_width=4, safe_mode=None, extras=None, link_patterns=None, use_file_vars=False):
self.markdowner = markdown2.Markdown(
html4tags,
... | true |
e61ad6063df32e9b39b3359001469832ebc2e313 | Python | wufan0920/kaggle-digit-recognition | /cnn.py | UTF-8 | 5,865 | 2.609375 | 3 | [] | no_license | import scipy.io as sio
import numpy as np
import nnet
import softmax
import matplotlib.pyplot as plt
import matplotlib as mpl
import random
import math
def samplingImg(data):
patchsize = 9
numpatches = 24000
patches = np.zeros((patchsize*patchsize,numpatches))
for pic in range(800):
picture = ... | true |
552260db3609384a5cbb9c1629cffe94180ee301 | Python | AmrElsayedEG/stock-market-price-USA | /stockprice/stock/views.py | UTF-8 | 4,287 | 2.546875 | 3 | [] | no_license | from django.shortcuts import render, redirect, HttpResponse
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
import json
from . import stockapi
from .models import DailyPrice
from django.db import IntegrityError
api_key = 'SMRUPFC8PX39RTRT' #API Key
fr... | true |
7888ee673aaed59810697db39a07e682fa217152 | Python | sharma425/DSAprogram | /heap sort.py | UTF-8 | 1,845 | 3.78125 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 5 17:32:07 2021
@author: Keshav
"""
import timeit
import random
import matplotlib.pyplot as plt
# Python program for implementation of heap Sort
# To heapify subtree rooted at index i.
# n is size of heap
def heapify(A, n, i):
largest = i # Initialize largest as root
... | true |
d77b807f6cec1861aa6a2013cb0440fdc654177f | Python | lloo099/nn_benchmark | /nn_benchmark/networks/lenet5.py | UTF-8 | 1,496 | 2.640625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
# nn_benchmark
# author - Quentin Ducasse
# https://github.com/QDucasse
# quentin.ducasse@ensta-bretagne.org
# LeNet5 architecture in PyTorch
# Taken from http://yann.lecun.com/exdb/publis/pdf/lecun-01a.pdf
import torch
import torch.nn as nn
class LeNet5(nn.Module):
'''LeNet5 architectur... | true |
fa6b4b3325e25f2f20f19c0eeffdcc911c30a12d | Python | krnets/codewars-practice | /8kyu/Triple Trouble/index.py | UTF-8 | 1,271 | 4 | 4 | [] | no_license | # 8kyu - Triple Trouble
""" Create a function that will return a string that combines all of the letters of the three inputed strings in groups.
Taking the first letter of all of the inputs and grouping them next to each other. Do this for every letter, see example below!
Ex) Input: "aa", "bb" , "cc" => Output:... | true |
b446de8cdd6a6b980a191ad547efe3f3cfdc3130 | Python | arnabs542/BigO-Coding-material | /BigO_Algorithm/BigO exercise/throwing_cards.py | UTF-8 | 387 | 3.359375 | 3 | [] | no_license | #Throwing cards
import queue
while True:
n = int(input())
if n == 0:
break
q = queue.Queue()
for i in range(n):
q.put(i+1)
st = []
while q.qsize() > 1:
st.append(q.get())
tmp = q.get()
q.put(tmp)
print('Discarded cards:', str(st)[1:-1... | true |
443d31c3e682fcdb6f161599f04ebd01136c391b | Python | google/uv-metrics | /uv/reporter/base.py | UTF-8 | 14,122 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# 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 ag... | true |
cbfccb59d80d8826d589ce43e24ad2c599719a2b | Python | nezlobnaya/leetcode_solutions | /custom_sort_str.py | UTF-8 | 406 | 3.578125 | 4 | [] | no_license | from collections import defaultdict
class Solution:
def customSortString(self, order: str, str: str) -> str:
#make a lookup using order
#reorder order chars in str
lookup = defaultdict(int)
i = 0
for char in order:
lookup[char]=i
i+... | true |
abec861fbf1eed5acc6dd41c1adffa071bbb9b8e | Python | dawidpacia/python_august | /pages/main.py | UTF-8 | 709 | 2.578125 | 3 | [] | no_license | from selenium.webdriver.common.by import By
from pages.base import BasePage
class MainPage(BasePage):
search_field_selector = (By.ID, "search_query_top")
search_button_selector = (By.XPATH, "//*[@name='submit_search']")
login_button_selector = (By.CLASS_NAME, "login")
def go_to_page(self, url):
... | true |
d381e3166511cbea257d61dfe535cb117022670c | Python | UCSD-SEELab/ContextEngine27 | /python/Knn/parse.py | UTF-8 | 2,010 | 2.546875 | 3 | [] | no_license | from numpy import recfromcsv
from time import strptime
import matplotlib.pyplot as plt
from Knn import Knn
import numpy as np
csv = recfromcsv('refridge.csv', delimiter=',')
trainer = Knn(complexity=0, numInputs=1, discreteOutputs=0, discreteInputs=0);
x_train = [];
y_train = [];
x_predict = [];
x_real=[];
y_real=[]... | true |
1cd61304a86b53e88c21bf5a6074a8ecdbdbd557 | Python | ReGaBeh/PersonalRepo | /Projects/tts.py | UTF-8 | 1,552 | 3.65625 | 4 | [] | no_license | import pyttsx3 # Importing necessary modules
import argparse
# This function uses pyttsx3 to read out the input
def read(input, rate, volume):
if not rate: # if statements to assign rate/volume default values
rate = 100 # when none ar given by checking if rate/volume have
if not volume: ... | true |
6f1c18e53d425876d8a4739f434d0dfea7b4ad3f | Python | abhishekkarna/google_doc_id | /app.py | UTF-8 | 2,193 | 2.921875 | 3 | [] | no_license | from pydrive.drive import GoogleDrive
import pygsheets
import os
from dotenv import load_dotenv
load_dotenv('./.env')
# Constants
PATH_TO_SERVICE_ACCOUNT = os.environ.get('SERVICE_ACCOUNT')
ROOT_FOLDER_ID = ""
sheet = None
drive = GoogleDrive()
GOOGLE_SHEET_CLIENT = pygsheets.authorize(service_account_file=PATH_TO_SER... | true |
3c9ae37f9fb0859123f6be674f25452d759bbca6 | Python | felipehv/flask-workshop-ing2030 | /db.py | UTF-8 | 2,612 | 3 | 3 | [] | no_license | import sqlite3
class DB:
def __init__(self):
self.conn = sqlite3.connect("ing2030.db")
self.cursor = self.conn.cursor()
def init_db(self):
self.cursor.execute("DROP TABLE IF EXISTS Users;")
self.conn.commit()
self.cursor.execute("""
CREATE TABLE Users(id i... | true |
7534cbbf27a61f5c79b3bda0ddf0cb19eaa040fb | Python | andrewswan/lwotai | /lwotai/cards/us/card14.py | UTF-8 | 1,601 | 2.734375 | 3 | [] | no_license | from lwotai.cards.us.us_card import USCard
class Card14(USCard):
def __init__(self):
super(Card14, self).__init__(14, "Covert Action", 2, False, False, False)
def _really_playable(self, _side, app, _ignore_itjihad):
return app.contains_country(lambda c: c.is_adversary())
def play_as_us(... | true |
1cf281945ab11463597939bb9f5b3cbffda1a320 | Python | maniero/SOpt | /Python/Algorithm/RepeatWhile.py | UTF-8 | 245 | 3.3125 | 3 | [
"MIT"
] | permissive | while True:
sex = input('Digite seu sexo:')
if sex == 'M' or sex == 'F':
break
sex = input('Digite seu sexo:')
while sex != 'M' and sex != 'F':
sex = input('Digite seu sexo:')
#https://pt.stackoverflow.com/q/257156/101
| true |
6a0392ddcf8a0daeb561b2a03e3d88a55df3d1d9 | Python | JRBenson01/FootBall_Arcade | /engineDev3.py | UTF-8 | 34,843 | 3.421875 | 3 | [] | no_license | """
Designer: Justin Benson
Version: 3
Description: Version 3 adds abilities to set object variables via dictionary instead of using
individual functions to set each variable. In version 3 colors are now objects
instead of individual variables.
"""
print("+++Starting up+++")
... | true |
4b205c17c86dd480aebcb2a6b10a89cf0d12c258 | Python | Farizabm/pp2 | /week1/42e.py | UTF-8 | 628 | 3.4375 | 3 | [] | no_license | string = str(input())
cipher = str(input())
message_to_cipher = str(input())
cipher_to_message = str(input())
ciphered_message = ''
unciphered_message = ''
encryption = {}
for i in range(len(string)):
encryption[string[i]] = cipher[i]
for i in range(len(message_to_cipher)):
for key in encryption.keys()... | true |
417075e533d699765f53ec8473a652397f4bd312 | Python | charissachua/rp_cet_ipp | /format-string.py | UTF-8 | 109 | 2.96875 | 3 | [] | no_license | import math
print("pi is " + str(math.pi))
print(math.sqrt(4))
math.
print("pi is approx %.4f" % (math.pi))
| true |
abd4d6a832921469e4726ceefff58d1d92239f50 | Python | AnishDixit/Twitter-Sentiment-Analyzer | /Analyser/views.py | UTF-8 | 5,115 | 2.890625 | 3 | [] | no_license | import os
from django.shortcuts import render, redirect
from django.contrib.auth.forms import AuthenticationForm
from . import forms
from django.contrib.auth.decorators import login_required
import string
import re
from textblob import TextBlob
import tweepy
import nltk
from nltk.corpus import stopwords
from nltk imp... | true |
e25654b5a4c0223b93c36444ec3f327880bf4521 | Python | Newton-Musyimi/CSc-101-Practicals | /Prac 8/dice_roll.py | UTF-8 | 834 | 2.859375 | 3 | [] | no_license | import random
import turtle
wn = tr.Screen() #creates our game board
wn.bgcolor("black")
g = turtle.Turtle()
c = turtle.Turtle()
llx = 0
lly = 0
urx = 200
ury = 100
wn.setworldcoordinates(llx,lly,urx,ury)
number_of_dice =
rolls = 10000
min_val = number_of_dice
max_val = number_of_dice * 6
for i in r... | true |
70f0bc3d8c994e8725cad5a8e713af9af340f354 | Python | heureka/llconfig | /tests/test_converters.py | UTF-8 | 1,878 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | from decimal import Decimal
import pytest
from llconfig import Config
from llconfig.converters import bool_like, json
from tests import env
@pytest.mark.parametrize('_type', [int, float, complex, Decimal])
def test_python_numeric_types_converters(_type):
c = Config(env_prefix='')
c.init('VALUE', _type)
... | true |
b82b3a65e36fa2b13f8a8e13ed4140304e1e09a2 | Python | bharling/js-binary-trees | /py/variance.py | UTF-8 | 3,145 | 3 | 3 | [] | no_license | import argparse
from PIL import Image
import math
def rgToFloat(v):
r,g = v
fromFixed = 256.0/255
return r*fromFixed/1 + g*fromFixed/(255)
def getHeight(x,y,img):
pix = img.getpixel((x,y))
return rgToFloat((pix[0], pix[1])) * 100.0
#return img.getpixel((x,y))[3] / 255.0
def computeVariance(... | true |
9fd51f1bfe76af43a2a2f2d9cda1c27d9fc611c7 | Python | franx87/whatspy | /whatspy/start_remote.py | UTF-8 | 412 | 2.734375 | 3 | [
"MIT"
] | permissive | from time import sleep
from remote import ChromeRemote
remote1 = ChromeRemote()
print('remote1', remote1.current_url)
remote1.get('https://google.com')
# for i in range(5):
# input('Press any key to quit chrome...')
# print('remote', remote.current_url)
# remote.quit()
remote2 = ChromeRemote()
print('remot... | true |
f3fbaf48415e391b1b75a7d64b4e66698156f8f1 | Python | LeninGusqui/Programaci-n-en-Python-aplicada-a-la-Ingenier-a. | /Funcion hola nombres.py | UTF-8 | 200 | 3.375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 19 11:24:58 2021
@author: Lenin Gusqui
"""
def saludo(nombre):
print("Hola!", nombre, '\n'*2)
saludo("Juan Carlos")
saludo("Ana")
saludo("Dylan") | true |
f7a4037dfa965219d591fd1902a2015b72bbf67b | Python | rtk4616/Python3Learn | /wxl_dictionary.py | UTF-8 | 922 | 3.921875 | 4 | [] | no_license | dic = {'name': 'WuXiaolong', 'site': 'http://wuxiaolong.me/', 'code': 1024}
# 访问元素
print(dic)
print(dic['site']) # 输出键为 site 的值
# 修改元素
dic['code'] = 520 # 修改元素
print(dic['code']) # 打印:520
# 新增元素
dic['id'] = 1314 # 新增元素
print(dic) # 打印:{'name': 'WuXiaolong', 'site': 'http://wuxiaolong.me/', 'code': 520, 'id': 1... | true |
7ac5cce852867c1f62ab4e4101425ea2069bf536 | Python | 87drums/Myo-post-process | /analysis program/DTW.py | UTF-8 | 2,161 | 2.984375 | 3 | [] | no_license | # -*- coding:utf-8 -*-
import numpy as np
import math
#指定ファイルの内容をチャンネルごと(列ごと)に分割
def file_parse(filehead, filename):
#整形対象ファイル読み込み
rfn = open(filehead + filename, "r") #read file name
content = rfn.read()
rfn.close()
segcontent = content.split("\n")
for i, row in enumerate(segcontent):
if... | true |
686e122d06daa12535d91d1ad7b313a01a5f4472 | Python | halfcress/PyCharm_handbook | /not_ornek.py | UTF-8 | 361 | 3.53125 | 4 | [] | no_license | x = input("x gir:")
y = input("y gir:")
if not bool(x):
print("Doğru!")
#Bu örnekte y etkisiz elemandır ancak x değeri sorulduğunda hiç bir şey yazmaz isek
#normalde bool(x) false olacakken başında not operatörü yüzünden true olacaktır.
#bu sayede if bloğu true kabul edilecek ve print fonksiyo... | true |
f03363e847cd2728b4724543d2fd7583be580f13 | Python | SIFANWU/Deep_Learning_Keras | /多分类问题.py | UTF-8 | 3,120 | 2.8125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 26 11:57:44 2018
@author: Administrator
"""
import numpy as np
from keras.datasets import reuters
from keras.utils.np_utils import to_categorical
from keras import models,layers
import matplotlib.pyplot as plt
(train_data,train_labels),(test_data,test_labels)... | true |
6224991865c63b44565015779a0bac569a4a4052 | Python | Elias2389/basic-stadistics | /linear-regression.py | UTF-8 | 1,062 | 3.65625 | 4 | [] | no_license | import math
# Calculate linear regression
houses = [
{'month': 1, 'mts': 5, 'price': 375},
{'month': 2, 'mts': 15, 'price': 487},
{'month': 3, 'mts': 20, 'price': 450},
{'month': 4, 'mts': 25, 'price': 500},
]
# Calculate pending
total = 0
total_sum_prices = 0
total_sum_sqrt = 0
total_sum_sqrt_all = ... | true |
a2cbc7f57406ebd697c224c0b8ed3bf987c3eafd | Python | DataBiosphere/toil | /src/toil/lib/memoize.py | UTF-8 | 3,223 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | # Copyright (C) 2015-2021 Regents of the University of California
#
# 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 app... | true |
bb6c994a8f0bb8596e2c71c3f4eb0022fd2cc21a | Python | hemuke/python | /20_muke_python_advanced/01_summary/09_download_hash_save_server_singleThread/modules/storager.py | UTF-8 | 446 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | # -*- encoding=utf-8 -*-
from PIL import Image
from modules.base import BaseModule
class Storager(BaseModule):
"""
存储模块
"""
def _process(self, item):
content, path = item
content = Image.fromarray(content.astype('uint8')).convert('RGB')
content.save(path)
def _process_... | true |
95245e222dc14accd4f691cd74822d4d762ba261 | Python | toutizes/stereos | /compute/align.py | UTF-8 | 4,147 | 2.828125 | 3 | [] | no_license | #!/opt/local/bin/python2.7
import sys
import numpy as np
import collections
import Image
import ImageDraw
import ImageFont
Point = collections.namedtuple('Point', ['x', 'y'])
def load_points(path):
"""Read a file containing point pairs.
'path' contains 4 space-separated integers per line: x0 y0 x1 y1.
Args:
... | true |
4aea39fbeb9f08be78f8f9bce9fdac758cb1aa83 | Python | mkleinbort/text-summarisation | /app.py | UTF-8 | 269 | 2.875 | 3 | [] | no_license | import streamlit as st
from summarizer import Summarizer
st.title('Test')
doc = st.text_area("Document")
ratio = st.number_input('Output length', .01, 1.0, .01)
if st.button('Summarize'):
model = Summarizer()
ans = model(doc, ratio=ratio)
st.write(ans) | true |
4e6bc4e30d7d746086193d117791add9b980c23d | Python | githubProjectTermux/miningbot | /testing.py | UTF-8 | 10,701 | 2.5625 | 3 | [] | no_license | import sys
import time
import telepot
import requests
from telepot.loop import MessageLoop
from telepot.namedtuple import InlineKeyboardMarkup, InlineKeyboardButton
#define markup Dictionary for edit of messages
markupDict = {}
#define username dictionary
userNameDict = {}
#check if Rig is up
def checkRigUpStatus():... | true |
cee2e2bcf49e4dd90ecd9bdcd7c1eb73f159cf3d | Python | Steven17D/Lego3 | /lego_manager/lego_manager.py | UTF-8 | 5,859 | 3.078125 | 3 | [] | permissive | """
Lego manager controls and allocates setup for tests.
Each test requests relevant components from lego manager, and lego manager checks if
there is an available setup and allocates it.
Main features:
1. Controls the timing of the tests to utilize the setup for maximum usage.
2. Provides information on the s... | true |
fc650e7027b0f51520489167369b13a40e1a1bee | Python | Pkfication/cracking_coding_interview | /Chapter_2/2.1.remove_dups.py | UTF-8 | 729 | 3.546875 | 4 | [] | no_license | class Node:
def __init__(self, data):
self.data = data
self.next = None
def remove_duplicates(head):
if head is None:
return None
prev = head
n = head.next
dict = set([prev.data])
while n is not None:
if n.data in dict:
prev.next = n.next
... | true |
e4527981bab675ea58e1faeea6e01497569dc210 | Python | brony28/My-HaRa-Solutions | /PYTHON/BasicDataTypes/find_the_runner-up_score.py | UTF-8 | 193 | 2.875 | 3 | [] | no_license | #Find the Runner-Up Score
# b=[]
n = input()
# for i in range(int(n)):
# a=input()
# b.append(a)
b = map(int,input().split())
c=set(b)
b1=list(c)
b1.sort(reverse=True)
print(b1[1]) | true |
49d6442c6b9f8d9acbfd0678a5df66a822427ffe | Python | Poonam-Singh-Bagh/python-question | /Loop/strong_number.py | UTF-8 | 294 | 4.125 | 4 | [] | no_license | '''Q.2 Strong number'''
user = input("Enter a number: ")
number = list(user)
sum = 0
for i in number:
num=int(i)
f = 1
for i in range(num,0,-1):
f=f*i
sum=sum+f
if int(user) == sum:
print(user, "is a Strong number")
else:
print(user, "is not a Strong number")
| true |
081665b71232aae5e750008d9da25aad8fcba3f9 | Python | SilentAssassinMa/Group-Mailing-Script-For-Teaching-Assistants | /IndividualFileGenerate.py | UTF-8 | 1,180 | 3.125 | 3 | [] | no_license | import openpyxl
import os
def makeexcelfiles():
inputworkbook = openpyxl.load_workbook("HomeworkGrade.xlsx")
sheetnames = inputworkbook.sheetnames
print(sheetnames)
worksheet = inputworkbook[sheetnames[1]]
rows = worksheet.max_row
columns = worksheet.max_column
# The name of... | true |
e98e7776eebd18cf21acb5b7f9e63e73e51c495e | Python | LinuxLibrary/Python | /MyPyStore/programs/CC_Progs/CC-08/CC-08.0/CC-08.0.03_While_you_are_at_it.py | UTF-8 | 219 | 3.890625 | 4 | [] | no_license | #!/usr/bin/python
num = 1
while num <= 10: # Fill in the condition
print "Num is %s and its sqare is %s" % (num, num ** 2)# Print num squared
print num ** 2
num += 1# Increment num (make sure to do this!)
| true |
867ffc3b1888e4f744d8ec29a254140c083282a1 | Python | andrewwhitehead/indy-catalyst | /agent/indy_catalyst_agent/messaging/basicmessage/handlers/basicmessage_handler.py | UTF-8 | 958 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | """Basic message handler."""
from ...base_handler import BaseHandler, BaseResponder, RequestContext
from ..messages.basicmessage import BasicMessage
class BasicMessageHandler(BaseHandler):
"""Message handler class for basic messages."""
async def handle(self, context: RequestContext, responder: BaseResponde... | true |
5d281909cdebf17428ac1a0a24cf636850ef2e25 | Python | Papyrustaro/PositiveYellBot | /mecab.py | UTF-8 | 1,387 | 2.75 | 3 | [
"MIT"
] | permissive | import sys
import MeCab
# ipadic辞書を利用する
# install先は echo `mecab-config --dicdir`"/mecab-ipadic-neologd" コマンドで確認
mt = MeCab.Tagger("-d /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd")
# 名詞を返す(名詞が連続して並んでいる場合、全て結合して返す)(なければ空文字)
def returnNoun(input_text):
input = mt.parseToNode(input_text)
ou... | true |
fd7858952833ccedcb8e5bed55662687534c5d94 | Python | jianbow/EE250-Final | /baby_freq.py | UTF-8 | 3,236 | 2.890625 | 3 | [] | no_license | # GITHUB REPO: https://github.com/usc-ee250-fall2020/lab08-lab08
# GROUP MEMBERS: Leo Zhuang and Richard Huang
import numpy as np
from pydub import AudioSegment
import os
import sys
SLICE_SIZE = 0.1 #seconds
WINDOW_SIZE = 0.2 #seconds
NUMBER_DIC = {}
def get_max_frq(frq, fft):
max_frq = 0
max_fft = 0
fo... | true |
6c8515d8864885b96d7af81b15b2cab4d0baf86f | Python | Sonamsingh92/python1 | /sonam merge sort.py | UTF-8 | 4,886 | 2.953125 | 3 | [] | no_license | import pickle, random, os
class Record:
'''
A class to represent a Record.
'''
def __init__(self, key, nonKey):
'''
Objective : To initialize the object of class Record.
Input :
self : (Implicit Parameter) An object of class record.
Re... | true |
6e1f4e61ce1d71dc9fb3b7e4a65526b5976ab08c | Python | ltseng3/epaxos-single | /latency_analysis.py | UTF-8 | 1,210 | 3.515625 | 4 | [
"Apache-2.0"
] | permissive | # NOTE: There is a rare error where log.out may contain a non utf-encoded character.
# Simply rerun the experiment if this happens.
import numpy as np
latencies = []
with open('log.out') as log:
line = log.readline()
while line != '': # The EOF char is an empty string
# Extract the latency and its u... | true |
a3a11d7cb13a21a811f8a010f95c60accd25c9b3 | Python | santosg572/MiPagina | /crea_html_dir.py | UTF-8 | 2,224 | 2.609375 | 3 | [] | no_license | from os import remove
import shutil
import os.path as path
import os
import sys
import funciones
if len(sys.argv) > 2:
pat = sys.argv[1]
funciones.Saca_lista_direc(pat)
file_in = "tempo.txt"
file_out = sys.argv[2]
if (path.exists(file_out)):
remove(file_out)
f = open(file_in, "r")
dir =... | true |
419b6b4406f777f11365924ee8cbcf051c328523 | Python | koyo922/leetcode | /p123_stock_twice.py | UTF-8 | 4,096 | 3.734375 | 4 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 expandtab number
"""
给定一个数组,它的第 i 个元素是一支给定的股票在第 i 天的价格。
设计一个算法来计算你所能获取的最大利润。你最多可以完成 两笔 交易。
注意: 你不能同时参与多笔交易(你必须在再次购买前出售掉之前的股票)。
示例 1:
输入: [3,3,5,0,0,3,1,4]
输出: 6
解释: 在第 4 天(股票价格 = 0)的时候买入,在第 6 天(股票价格 = 3)的时候卖出,这笔交易所能获得利润 = 3-0 = 3 。
随后,... | true |
449fe649c0be228f4023dc11e8b51c5165890143 | Python | sarincr/Semester-Long-Program-on-App-Development | /25.Menu/01.Menu/main.py | UTF-8 | 304 | 2.6875 | 3 | [
"MIT"
] | permissive | from tkinter import *
root = Tk()
def base():
print("Menu is clicked")
Mn = Menu(root)
Mn.add_command(labe= "New_File", command = base)
Mn.add_command(labe= "Open", command = base)
Mn.add_command(label="Quit!", command=root.quit)
root.config(menu=Mn)
root.mainloop() | true |
d96dcf0703cbcdccd5c0b9348662a2d05e2d9a33 | Python | wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww/python | /_0921.py | UTF-8 | 744 | 3.75 | 4 | [] | no_license | class movie:
count =0
title ="암살 "
director ="최동훈"
def __init__(self,title,director):
self.title = title
self.director = director
self.count+=1
print(self.title+"생성자 호출")
def __del__(self):
print(self.title+"소멸자 호출")
def showinfo(self):
pr... | true |
0153ea461467696a299a08471bc998a9b92d2b28 | Python | romstay/BelajarPython-1 | /BelajarPython.py | UTF-8 | 708 | 3.125 | 3 | [] | no_license | nama = input ("Nama :")
namap = input ("Nama Panggilan :")
ttl = input ("Tempat dan Tanggal Lahir:")
umur = input ("Umur :")
tinggal = input ("Alamat :")
instansi = input ("Nama Kampus :")
nim = input ("NIM ... | true |
c6065e743e3a8923f809b54af0743fdd20479480 | Python | ToqYang/AirBnB_clone_v3 | /api/v1/views/places.py | UTF-8 | 2,493 | 2.5625 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | #!/usr/bin/python3
"""
Place crud
"""
from flask import jsonify, abort, request
from api.v1.views import app_views
from models import storage
from models.place import Place
@app_views.route("/cities/<city_id>/places", methods=['GET'],
strict_slashes=False)
def places_for_city_id(city_id):
"""Retu... | true |
09f4aa15608aab6f2cc31ab89ab1d0dc221a3ec0 | Python | melvinfuture/dhedge-python-sdk | /dhedge/utills.py | UTF-8 | 394 | 3.015625 | 3 | [
"MIT"
] | permissive | def strTo32HexString(string_key):
bytes_key = string_key.encode()
hex_key = bytes_key.hex()
hex_key32 = '0x' + hex_key + (64 - len(hex_key)) * '0'
return hex_key32
def parseBytes32String(key):
result = bytes.fromhex(str(key)[2:])
result = result.decode('utf-8').rstrip('\x00')
return result... | true |
8b33eb9d3e869158233555fdea2453b6f6716de7 | Python | liwb27/leetcode | /378. Kth Smallest Element in a Sorted Matrix.py | UTF-8 | 2,162 | 3.765625 | 4 | [] | no_license | # Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.
# Note that it is the kth smallest element in the sorted order, not the kth distinct element.
# Example:
# matrix = [
# [ 1, 5, 9],
# [10, 11, 13],
# [12, 13, 15]
# ],
# k ... | true |
21ed39494b8080312dcc168b600dc211cef4ed7c | Python | lostwire/pyced | /pyced/api.py | UTF-8 | 2,327 | 2.75 | 3 | [] | no_license | """ API """
import asyncio
import functools
import aiohttp
import requests
import aiohttp.web
def init(url, headers=None):
if not loop:
loop = asyncio.get_event_loop()
if not headers:
headers = {}
http = aiohttp.ClientSession()
return Api(url, http, headers, loop)
def init_sync(url, ... | true |
9e4caaae5073cd212e9232d3a65d656e588492b7 | Python | melodi-lab/SGM | /sourceCodes/python/visualize/absolute.py | UTF-8 | 8,150 | 2.59375 | 3 | [] | no_license | #!/usr/bin/env python
#
# Copyright 2011 <fill in later>
"""Support for absolute ranking plots"""
import itertools
import types
import numpy
import random
try:
import sys
import matplotlib
import pylab
if not sys.modules.has_key('matplotlib'):
matplotlib.use('Agg')
except ImportError:
prin... | true |
96afedd79a011b0e9ca1e975bfa51123da7d1470 | Python | RPHLuo/NeuralNetworksAssignments | /a1/q6.py | UTF-8 | 3,000 | 3.5 | 4 | [] | no_license | import numpy as np
import random
import matplotlib.pyplot as plt
from mnist import MNIST
mndata = MNIST('$$$') # Set this to the directory path where you're storing the test and training data
images, labels = mndata.load_training()
testImgs, testLbls = mndata.load_testing()
# Generates the image data for a... | true |
4f2a168c36ba1a52a6d1ddca2b347e1a9d13df08 | Python | twitter/caladrius | /common/heron/tracker.py | UTF-8 | 19,566 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | # Copyright 2018 Twitter, Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
""" This module contains methods for extracting and analysing information from
the Heron Tracker services REST API:
https://twitter.github.io/heron/docs/operators/heron-tracker-api/
"""
import l... | true |
b93115b5696ee2d68edd9231520908232f891133 | Python | marcusorefice/-studying-python3 | /Exe112/Exe112.py | UTF-8 | 415 | 2.875 | 3 | [] | no_license | """ Dentro do pacote utilidadesCeV que criamos no desafio 111, temos um módulo chamado dado.
Crie uma função chamada leiaDinheiro() que seja capaz de funcionar como a função imput(), mas
com uma validação de dados para aceitar apenas valores que seja monetários."""
from utilidadescev import moeda
from utilidadesc... | true |
9c4476d1855fe179bf2ab97d20b4090e4cf13b9a | Python | ZhuangLab/storm-control | /storm_control/sc_hardware/coherent/innova70C.py | UTF-8 | 5,187 | 2.984375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python
#
## @file
#
# Innova 70C laser control using RS-232.
#
# Hazen 4/09
#
import storm_control.sc_hardware.serial.RS232 as RS232
## Innova70C
#
# This controls a Innova70C laser using RS-232 communication.
#
class Innova70C(RS232.RS232):
## __init__
#
# Initiate RS-232 c... | true |
0855eb8eae16d6664ae467d78a7e275d15441f56 | Python | hyerin315/GDT_study | /basic/ifelse04_login.py | UTF-8 | 501 | 3.484375 | 3 | [] | no_license |
saved_id = "ilovepython"
id = input("아이디를 입력하세요 : ")
saved_pw = "1234"
if saved_id == id :
for i in range(5):
pw = input("패스워드를 입력하세요 : ")
if saved_pw == pw :
print("환영합니다.")
break
elif i < 5:
print("패스워드를 다시 입력하세요.")
else :
print("패... | true |
abc9c87726af9555ae13c08560114252903e6829 | Python | audepe/DeepFakeDetector | /1.Red-LSTM/lm_extractor_FAN.py | UTF-8 | 1,386 | 2.734375 | 3 | [] | no_license | import face_alignment
from pathlib import Path
import time
import json
def landmark_from_dir(frames_directory, output_dir, output_filename):
if not isinstance(output_dir, Path):
output_dir = Path(output_dir)
output_file = output_dir.joinpath(str(output_filename))
output_file = output_file.with... | true |
584f8c38a8552b926d399beac7505f76cd33f564 | Python | rjleveque/pattern-method-paper | /programs/tidepofzeta_dt.py | UTF-8 | 1,796 | 2.765625 | 3 | [] | no_license | import matplotlib
matplotlib.rc('text', usetex = True)
from pylab import *
import os
#Use the dt distributions from Crescent City
#tide gauge to make example plots
d = loadtxt('cumulative_probs.yearly.100.txt')
figure(1,(12,9))
clf()
axes((.1,.1,.8,.38))
#Add 1.13 to get s referenced to MSL
s = d[:,0] - 2. +1.13
p... | true |
89882d08cf25313874c7920c97ce046a6433ffc6 | Python | ChenjianHong2020/PRT582At1 | /Program_1_1.py | UTF-8 | 179 | 3.1875 | 3 | [] | no_license | print("Welcome to Hangman Game")
with open('1000WordsList.txt') as f:
words = [line.rstrip() for line in f]
#print(words)
import random
key = random.choice(words)
print(key)
| true |
7ca26211416f1d1c26221b1045f8dac3d739d916 | Python | kyle-rader/cs597_ctf | /2007-mafia/attack-perl-user/perlexploit.py | UTF-8 | 1,187 | 2.71875 | 3 | [] | no_license | #!/usr/bin/python3
"""this particular exploit takes advantage of a perl command injection vulnerability.
However, the target machine does not have nc installed; to get a remote shell we
create a reverse TCP connection using telnet (i.e. our local machine is passive
while the target machine is active using telnet)"""
... | true |
7cf69dbb5c9a1376d954423f7016d633f2da7864 | Python | zach-col/itemCatalog | /lotsOfCatalogs.py | UTF-8 | 1,311 | 2.59375 | 3 | [] | no_license | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Catalog, Base, CatalogItem, User
engine = create_engine('sqlite:///catalog.db')
# Bind the engine to the metadata of the Base class so that the
# declaratives can be accessed through a DBSession instance
Base.metad... | true |
3de6c4127e54a427f3917485a3c70a3c201f56b7 | Python | yadala1998/Delaunay-Triangulation---Voronoi-Generation | /Delaunay.py | UTF-8 | 15,461 | 3.09375 | 3 | [] | no_license | import numpy as np
import math
import copy
# Source Of Algorithm: http://www.s-hull.org/paper/s_hull.pdf
class Vertex(object):
def __init__(self, x, y):
self.xValue = x
self.yValue = y
self.faces = []
self.edges = []
def getVertexInfo(self):
return self.xValue, self.y... | true |
b0411176f434d072eb6b0b50c77473c7c274c954 | Python | c606hia/DART_HW_5 | /linear_regression.py | UTF-8 | 2,316 | 2.640625 | 3 | [] | no_license | import torch
import torch.nn as nn
import pyro
import numpy as np
import pandas as pd
import math
import torch.optim as optim
from pyro.nn import PyroModule
import matplotlib.pyplot as plt
def preprocess_data(data):
x_a = []
x_na = []
y_a = []
y_na = []
for i in range(len(data)):
... | true |
2da97589e858762042e58a82f20b44466ea99854 | Python | Capri2014/pytorch | /torch/lib/ATen/native_parse.py | UTF-8 | 1,105 | 2.828125 | 3 | [
"BSD-2-Clause"
] | permissive | def parse(filename):
with open(filename, 'r') as file:
declarations = []
in_declaration = False
for line in file.readlines():
if '[NativeFunction]' in line:
in_declaration = True
arguments = []
declaration = {'mode': 'native'}
... | true |
a01c9bf9bba7960bbd53af882408ef06d7d489ca | Python | Ape2017/python | /scripts/io/do_pickle.py | UTF-8 | 253 | 3.1875 | 3 | [] | no_license | #!/usr/bin/env python3
import pickle
d = dict(name='Bob', age=20, score=88)
# pickle any object into bytes
res = pickle.dumps(d)
print('After pickle:', res)
with open('dump.txt', 'wb') as f:
# Write into a file-like object
pickle.dump(d, f) | true |
f33706bb258085f3dcd09c236b776da84984846e | Python | andreea-munteanu/ACTN-2021 | /Tema2/multiprime_RSA.py | UTF-8 | 5,096 | 3.46875 | 3 | [] | no_license | import math
import time
import sympy
from sympy.ntheory.modular import crt
def check_prime(n) -> bool:
"""
Determines whether a number n is prime.
:param n: number n
:return: true if number is prime, false otherwise
"""
if n < 2:
return False
if n == 2 or n == 3:
... | true |
e036449d43d6418658a99668037b84d49afb87fd | Python | yu2guang/NCTU-CS | /Computer-Vision/HW5-Classifier/tiny_images_with_knn.py | UTF-8 | 4,298 | 2.765625 | 3 | [] | no_license | import os, glob
import cv2
import numpy as np
import time
import pandas as pd
import matplotlib.pyplot as plt
import csv
class data_preprocessing():
def __init__(self, src_path, target_path,
img_csv_name='img.csv', label_csv_name='label.csv'):
self.src_path = src_path
self.targe... | true |
6130578a319b2bf4887c9e8810ca93b2b21a9574 | Python | harry1080/scripts-2 | /sad.txt.py | UTF-8 | 341 | 3.265625 | 3 | [] | no_license | import time
alist = []
aset = set()
s1 = time.time()
for i in range(10000000):
alist.append(i)
s2 = time.time()
for j in range(10000000):
aset.add(j)
s3 = time.time()
print(s2-s1)
print(s3-s2)
for k in range(10000):
k in alist
s4 = time.time()
for l in range(10000):
l in aset
s5 = time.time()
prin... | true |
7521f116ecb7cc841921048c615c4f0484ed721d | Python | sdss/lvmmodel | /bin/desi_update_focalplane_log | UTF-8 | 3,799 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/env python
"""Commandline script to update the state log for a focalplane.
"""
import os
import shutil
import argparse
from datetime import datetime
from astropy.table import Table
from desimodel.io import load_focalplane, datadir
def main():
parser = argparse.ArgumentParser()
parser.add_argume... | true |
4fa16b44fc923e1d4b99214808b3eacf28984691 | Python | ironboxer/leetcode | /python/143.py | UTF-8 | 1,549 | 4.25 | 4 | [] | no_license | """
https://leetcode-cn.com/problems/reorder-list/
143. 重排链表
给定一个单链表 L:L0→L1→…→Ln-1→Ln ,
将其重新排列后变为: L0→Ln→L1→Ln-1→L2→Ln-2→…
你不能只是单纯的改变节点内部的值,而是需要实际的进行节点交换。
示例 1:
给定链表 1->2->3->4, 重新排列为 1->4->2->3.
示例 2:
给定链表 1->2->3->4->5, 重新排列为 1->5->2->4->3.
"""
# Definition for singly-linked list.
class ListNode:
def __in... | true |
5439c8460ae12dad636bbcddd86a3a463ed0d61d | Python | beckyxde/100_Days | /Workspaces/Beginner/Days_1-10/Day_2_Tip_Calculator.py | UTF-8 | 772 | 4.5625 | 5 | [] | no_license | import math
# Day 2
# Practice Exercise - Remaining Life Calculator
age = input("What is your current age?")
remaining = 90 - int(age)
days = 365 * remaining
weeks = 52 * remaining
months = 12 * remaining
message = f"You have {days} days, {weeks} weeks, and {months} months left"
print(message)
# Tip Calculator
print(... | true |
825b9a46277b3cb35dfb9cc80341e3337f6585ef | Python | d198965/machinelearninginaction | /Learn/kaggle/classify/BP.py | UTF-8 | 4,834 | 2.765625 | 3 | [] | no_license | # encoding:utf-8
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from Learn.kaggle.classify import DataProvider
def add_layer(input, in_size, out_size, activation_function=None):
weight = tf.Variable(tf.random_normal([in_size, out_size]) * 0.1)
biases = tf.Variable(tf.zeros([1, out... | true |
9a82531c4882881ed79b37c35e0b45bee743ac20 | Python | carlos2020Lp/progra-utfsm | /guias/2014-1/marzo-24/viaje/pauta.py | UTF-8 | 262 | 3.703125 | 4 | [] | no_license | tramo = -1
total = 0
while tramo != 0:
tramo = int(raw_input('Tramo: '))
total += tramo
horas = total / 60
minutos = total % 60
if horas == 1:
print 'Total: 1 hora y', minutos, 'minutos'
else:
print 'Total:', horas, 'horas y', minutos, 'minutos'
| true |
712d6b28848941d857e63ffafee08475d5db9be6 | Python | kmsmith137/rf_pipelines | /scripts/rfp-run | UTF-8 | 20,996 | 2.875 | 3 | [] | no_license | #!/usr/bin/env python
import sys
import argparse
####################################################################################################
#
# Argument parsing, checking
# Got a little carried away here, and wrote an argparse.ArgumentParser
# subclass, to customize error reporting...
class MyParser(ar... | true |
94c1d93609bcc0c7e0743bd07caae24ada3f7d29 | Python | KirilKR/FOR1T-BU_-fingaverkefni_foll- | /v2.py | UTF-8 | 749 | 3.703125 | 4 | [] | no_license | #Kiril Krushkov
#1.2.2017
#Æfingaverkefni 1-2 - Föll
#Whole chapter:
def reiknaRummalKulu():
radius = int(input("Sláðu inn radíus fyrir hringinn "))
rummalKulu = (4*3.14*radius)/3
print(rummalKulu)
reiknaRummalKulu()
def reiknaRummalKassa():
lengd = int(input("Sláðu inn lengd kassans "))
breidd = i... | true |
e794b4cff7f4aaf2afe9870e0f9c4ae190c49a8e | Python | ExtremeOptimist/Vedlegg_til_bachelor | /Kodesnutter/eks_affine_trans.py | UTF-8 | 824 | 2.828125 | 3 | [
"MIT"
] | permissive | import cv2, numpy as np
from matplotlib import pyplot as plt
bilde = cv2.imread('Github/vedlegg/bilder/teori/affine.png')
hoyde, bredde = bilde.shape[:2] #Dimensjoner på inngangbilde
src_points = np.array([[0, 0], [0, hoyde-1], [bredde-1, hoyde-1]], dtype=np.float32) # Startpunkt
fors = 50 # Forskyver sluttpu... | true |
296f983fac098e56be672c710d77650ca05ffd48 | Python | KirkVM/kdatapack | /itcpack/tests/test_reading.py | UTF-8 | 4,158 | 2.6875 | 3 | [] | no_license | from itcpack import readitc
def test_readitc_onvpitc_headerfields():
'''header fields in .itc file contain cell volume, starting cell concentration
and syringe concentration
'''
itcdata=readitc.readitc("datafiles/040419b.itc")
#syringe conc in M and vo (cell volume) in L pulled from data file
... | true |
4cf568d822502d0ff8155ad9741669326882f35d | Python | ghyeon1946/Imege-Processing | /skin_detector.py | UTF-8 | 1,499 | 2.59375 | 3 | [] | no_license | # 필요한 패키지를 import함
from __future__ import print_function
import argparse
import numpy as np
import cv2
def histogram_slicing(img, lowerb, upperb):
# 코드 작성
mask = cv2.inRange(img, lowerb, upperb)
mask = cv2.GaussianBlur(mask, (5,5),0)
dst = cv2.bitwise_and(img,img,mask=mask)
return dst
if __name__ == '__main_... | true |
f69cd566a9a058c6da1c2391765bad00164e6c51 | Python | ControlEverythingCommunity/KMX61 | /Onion Omega Python/KMX61.py | UTF-8 | 2,068 | 2.859375 | 3 | [] | no_license | # Distributed with a free-will license.
# Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
# KMX61
# This code is designed to work with the KMX61_I2CS I2C Mini Module available from ControlEverything.com.
# https://www.controleverything.com/products
from OmegaExp... | true |
ab7e9e1836da52f93ba7647aac7e29eeec2e448c | Python | seijihariki/brizas | /bot/chat_interface.py | UTF-8 | 1,933 | 2.984375 | 3 | [] | no_license | #!/usr/bin/python3
import subprocess as proc
from bot import Bot
import readline
import signal
import sys
user = "seiji"
prompt = ":user: > "
proc_timeout = 5
bot = Bot("yo.db", "yo.db")
running_state = True
# Parses and executes commands
def handle_command(command):
command = command.split()
if len(comma... | true |
b82dac4a437271c8941fae350ad222dc6a1077e2 | Python | demo112/1807 | /python/Myself_Note/Runoob/exercise/8_9.py | UTF-8 | 224 | 3.640625 | 4 | [] | no_license | # 题目:输出 9*9 乘法口诀表。
import time
for x in range(1, 10):
for y in range(1, x + 1):
s = y * x
print(s, '=', y, '*', x, sep='', end=' ')
print()
time.sleep(1)
# 暂停一秒输出 | true |
cb19632141927badc346ae2c20ef5fb8bebffd08 | Python | hell-abhi/Assignments | /assignment6.py | UTF-8 | 66 | 3.28125 | 3 | [] | no_license | input = 5
i = input
while i >= (-input):
print(i)
i = i-1
| true |
ac32f2fbcee99b1247012613ead9d370f90cc110 | Python | MrLokans/portfoliosite | /backend/apps/apartments_analyzer/services/subway_data.py | UTF-8 | 1,523 | 2.53125 | 3 | [] | no_license | # Those coordinates are collected manually
# key - name of the station
# value - latitude, longitude pair
SUBWAY_DATA = {
"Площадь Победы": (53.908273, 27.574682),
"Каменная Горка": (53.906645, 27.439102),
"Кунцевщина": (53.907354, 27.454018),
"Спортивная": (53.909800, 27.480059),
"Пушкинская": (53... | true |
744f8f8b7539dcddfd666174bff8f6e26890846e | Python | cole0227/Terrain-Project | /Python Tile Generation/tilesets4.py | UTF-8 | 9,670 | 2.53125 | 3 | [] | no_license | import time
import random
from numpy import *
import scipy
import sprite
from functions import *
wall = time.clock()
wall2 = time.clock()
tileSize = 20
reader = sprite.SpriteSheetReader("BasicTiles.png", tileSize)
regionMap = Gaussian_Blur(Matrix_Double(Matrix_Double(Matrix_Double(Matrix_Crop(load('.map_region.np... | true |
889d67897848f4b7ec25397bfb6825378fbc7cc5 | Python | Tarun-coder/Data-science- | /evenno.py | UTF-8 | 509 | 4.34375 | 4 | [] | no_license | # Write a Python function to print the even numbers from a given list.
a =int(input("Enter the size of the list : " ))
li=[]
for i in range(a):
number=int(input("Enter the Number to add into list: "))
li.append(number)
print("The value of the list",li)
print("The Final list is :",li)
print("--------------... | true |
2c9f9076db6d1dfb80ce4aea186f82191822bccc | Python | zhanglangEB/CPO_Lab_2 | /src/regex_fa_construction.py | UTF-8 | 15,536 | 2.890625 | 3 | [] | no_license | import logging
from typing import Optional, Iterable
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s')
from discrete_event import DiscreteEvent, Node, source_event
from common import empty_chars, Kind, element_type, arg_type... | true |
c8ba18b4d3b7f99d9ccb140428f9687ad3be670f | Python | hytsang/tensorflow-specialization-1 | /hello-world.py | UTF-8 | 642 | 3.4375 | 3 | [
"MIT"
] | permissive | #%% [markdown]
# ### Loading required libraries
import tensorflow as tf
import numpy as np
#%% [markdown]
# ### Defining and compiling the single layer and single neuron neural network (~ linear regression)
model = tf.keras.Sequential([tf.keras.layers.Dense(units=1, input_shape=[1])])
model.compile(optimizer="sgd", lo... | true |
762cdf9a780b0daa617cb9aec26dc951c49f107f | Python | anyl92/ALGORITHM | /codewars/191207_test4.py | UTF-8 | 435 | 2.78125 | 3 | [] | no_license | import copy
def solution(A):
copyA = copy.deepcopy(A)
mini = 99999
for i in range(len(A)):
cnt = 0
tmp = A.pop(i)
for num in A:
if num == tmp:
continue
elif num + tmp == 7:
cnt += 2
else:
cnt += 1
... | true |
fc5321c8d2782d4494f0902537187bd65d5d06fd | Python | wyaadarsh/koinex_notify | /koinex_notify.py | UTF-8 | 1,144 | 2.90625 | 3 | [] | no_license | import json
import requests
import os
import time
response = requests.get('https://koinex.in/api/ticker')
json_data = json.loads(response.text)
prices = json_data['prices']
stats = json_data['stats']
coins=['BTC','ETH','LTC','BCH','XRP']
def notify(title, subtitle, message):
t = '-title {!r}'.format(title)
s ... | true |