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 |
|---|---|---|---|---|---|---|---|---|---|---|
cd60a0f6b7833f01aa25a48e2fe03dbd7e1e48b5 | antoniosap/z3-trials | /alphametics-star/main.py | UTF-8 | 847 | 2.6875 | 3 | [] | no_license | #
#
# 6.12.2020
#
#
from time import perf_counter
import matplotlib
matplotlib.use('GTK3Cairo')
from graph_tool import Graph
from graph_tool.draw import graph_draw
from pkg.heuristics import uniform_cost
from pkg.colors import color
from pkg.search import ida_star_search
HEURISTIC = uniform_cost
TRANSITION_COST = 1
... | true |
16f7cc9d9174c96cfa7b9a8a4320e020c6231649 | Fleford/EO_Aberdeen | /EO_Aberdeen/Supply2PotSurfPlot.py | UTF-8 | 2,689 | 2.734375 | 3 | [] | no_license | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from GWM_Manipulator import extract_rivercells
# Streamflow Constraint
strmflw_cnstrnt = np.array([[14, 14],
[14, 21],
[13, 23],
[15, 26]])
# Load in potentiometric ... | true |
19250d8095addfe7cf708ed735535660e85bda77 | perronea/fMRI_autoencoder | /code/pytorch/classifier.py | UTF-8 | 6,837 | 2.5625 | 3 | [] | no_license | #!/usr/bin/env python
from __future__ import print_function
import os
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.utils.data import TensorDataset, DataLoader
from captum.attr import IntegratedGradi... | true |
1d42d251c20a2ec91028f519d3a0a007402ad34e | AryanP281/K-Means-Clustering-Model | /K_Means_Model.py | UTF-8 | 3,278 | 3.59375 | 4 | [] | no_license | #**************************Imports*********************
import numpy as np
from copy import deepcopy
#**************************Class*********************
class K_Means_Model(object) :
def __init__(self) :
pass
def get_clusters(self, X, k, epochs) :
"""Finds clusters in the giv... | true |
a811bbc95b5b622c3894cb28bf8ec119adc4d374 | chenchongsong/CZ3004-RPi | /img.py | UTF-8 | 2,440 | 2.546875 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
import socket, sys
import time
import threading
import io
import struct
import picamera
from PIL import Image
class im_conn(object):
def __init__(self):
self.ip = '192.168.18.18'
self.port = 8000
self.client = None
self.conn = None
s... | true |
9356d87311322dd7fe6fdc5789dabd879fa0b0ca | Debskij/AnomalyDetector | /taximodel.py | UTF-8 | 1,731 | 2.796875 | 3 | [] | no_license | import math
import random
import pandas as pd
import matplotlib.pyplot as plt
from tensorflow import keras
import numpy as np
if __name__ == '__main__':
x_train = []
y_train = []
values = pd.read_csv('nyc_taxi.csv')
rows = [x for x in values]
values = list(values[rows[1]])
TIME_STEPS = 30
... | true |
b258d261c04a76ccc20169a0e37b3230073cd046 | cmahadeo/DnDnC | /tutorial/chris/Daniel Notes_1.py | UTF-8 | 2,570 | 3.953125 | 4 | [] | no_license | #Module
if __name__ == '__main__':
# script
# this is a comment
# this is a continuation of a comment
# Mutable Class
#I nteger Stuff
x = 5
y = 2
z = x+y
u = x*y
v = x**y
e,f= 8, 9
print(x,y)
type(x)
print(type(x))
# Boolean
T = True
F = False
# Going b... | true |
cd11e56ba4846dd33c5f910c11eb5633fff9ad75 | n1ay/Causal-rules-discovery-from-data-streams | /plot_sequence.py | UTF-8 | 2,626 | 2.640625 | 3 | [] | no_license | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import argparse
parser = argparse.ArgumentParser(description='Plotting sequence')
parser.add_argument('-i', '--input', help='Sequence input file name', required=True)
parser.add_argument('-s', '--start', help='Start', default=100, required=False)
p... | true |
20c8b15a50976837fff23d0b02ddb5825c18292b | dvlahovski/compresspy | /tests/test_huffman.py | UTF-8 | 1,975 | 3.15625 | 3 | [
"MIT"
] | permissive | import unittest
from compresspy import huffman
from heapq import heapify, heappop, heappush
from collections import Counter
from random import randint
class TestHuffman(unittest.TestCase):
def setUp(self):
self.compressor = huffman.Huffman()
def compress(self, data):
data_bytes = bytes(data, ... | true |
fa3849c155a7058691f6a2c06e77b83a48e11c04 | nibircse/FeatureExtractor | /FeatureGenerator/Corpus_Readers/SemCor_v2.py | UTF-8 | 9,131 | 2.859375 | 3 | [] | no_license | #!/usr/bin/python
__author__ = 'Mohammad'
class SemCorTokenInfo:
"""this class contains SemCor3.0 information for each line (more specifically for each word)"""
def __init__(self, wf_cmd, wf_rdf, wf_pos, wf_lemma, wf_wnsn, wf_lexsn, wf_pn, wf_ot, wf_token):
self.cmd = wf_cmd # it contains 'ignore', ... | true |
5b19c1d93fd892c0d1dd6f663a29ac0be12d5b49 | Aditya8821/Python | /Python/Daily Challenges/Dictionary/Mirror_Chars.py | UTF-8 | 363 | 3.09375 | 3 | [
"MIT"
] | permissive | def mirror(input,k):
original = 'abcdefghijklmnopqrstuvwxyz'
reverse = 'zyxwvutsrqponmlkjihgfedcba'
dictchar=dict(zip(original,reverse))
prefix=input[0:k-1]
suffix=input[k-1:]
mirror=''
for i in range(len(suffix)):
mirror+=dictchar[suffix[i]]
print(prefix+mirror)
input=... | true |
b9ae6ee99b3e39ea4656c4d2b6480d2d19e2a1c2 | whiteQ777/codeWarsSolutions | /DuplicateEncoder.py | UTF-8 | 302 | 2.890625 | 3 | [] | no_license | def duplicate_encode(word):
#your code here
res = ''
arr = [0 for i in range(1000)]
word = word.lower()
for w in word:
arr[ord(w)] += 1
for w in word:
if arr[ord(w)] > 1:
res += ')'
elif arr[ord(w)] == 1:
res += '('
return res | true |
caeec025a310d0044c1fb10b284d09122cb896a5 | DylanDmitri/CodingameTrees | /game/Sun.py | UTF-8 | 140 | 3.421875 | 3 | [] | no_license |
class Sun:
def __init__(self):
self.orientation = 0
def move(self):
self.orientation += 1
self.orientation %= 6 | true |
eec0f30631d93c937d1fb746307037add3e384ed | gurgy11/DicePy-Refactored | /dicepy/modules/storage/warehouses/warehouses_model.py | UTF-8 | 335 | 3.0625 | 3 | [] | no_license | class Warehouse():
def __init__(self, manager_id, address_id, warehouse_name, label, notes):
self._id = None
self._manager_id = manager_id
self._address_id = address_id
self._warehouse_name = warehouse_name
self._label = label
self._notes = notes
self._cr... | true |
7a5fcc2e2345b331565a85dfa5a479fb2363f889 | sheim/edge | /edge/graphics/plotter/reward_failure_plotter.py | UTF-8 | 2,055 | 2.515625 | 3 | [
"MIT"
] | permissive | from matplotlib import pyplot as plt
from . import Plotter
from ..subplotter import EpisodicRewardSubplotter, \
SmoothedEpisodicFailureSubplotter
from ..colors import corl20_colors as colors
class RewardFailurePlotter(Plotter):
def __init__(self, agents_names, window_size, padding_value=1):
super(Rew... | true |
deb23198b9aace794821a0133a5cdb47f7900e45 | jinloke22/python | /pachong/nine_wynew/NEW/NEW/pipelines.py | UTF-8 | 548 | 2.578125 | 3 | [] | no_license | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
from itemadapter import ItemAdapter
class NewPipeline:
f = open("./new.txt",... | true |
384852d9709b66d0a4af1e43571f1975e64ce43d | 021631/data-logger | /api_plugin/sams_science.py | UTF-8 | 3,464 | 2.59375 | 3 | [
"MIT"
] | permissive | import requests
import configparser
from main.logging_activity import Log
from credentials import Credentials
class SamsApi:
def __init__(self):
self.config = configparser.ConfigParser()
self.token_config = configparser.ConfigParser()
self.log = Log()
self.config_file = Credentials... | true |
bf42699dfb7f6e2e90ffba5bb80f99a02926ff0a | gronkyzog/Puzzles | /old/Euler171.py | UTF-8 | 465 | 2.9375 | 3 | [] | no_license | def solve(n):
mapper = {}
mapper[0] = [0,1]
for i in range(n):
temp = {}
for k,v in mapper.items():
for s in range(10):
ds = k + s**2
if ds not in temp:
temp[ds] = [0,0]
Z = temp[ds]
Z[0] += 10*v[0] + s*v[1]
Z[1] += v[1]
mapper = temp
return mapper
sol = solve(20)
total = 0
xmax... | true |
5fad00004890b3b15ffca8d58badd5c0c799935e | EmelineGOT/Centrale | /INF/INF tc1/BE1/GOT - BE1 - Prise en main de Python/XXIV-6 Fichier.py | UTF-8 | 1,720 | 3.5625 | 4 | [] | no_license | with open("test.txt") as f:
s=f.readlines()
mots=[]
for i in range(len(s)):
mots=mots+(s[i].split()) #On sépare les mots les uns des autres suivant les espaces
nb_phrase=0
for i in range(len(mots)):
mots[i]=list(mots[i]) #On transforme les string en liste
if mots[i... | true |
313abe0f4f467ef3f9117600f92f3ae3212c02d5 | skills421/PythonMultiTrack | /FastTrack/BankingProject/24-bankinggui2/model/account.py | UTF-8 | 1,841 | 2.90625 | 3 | [] | no_license | import datetime
from model.transaction import Transaction
class Account:
_accounts = {}
@staticmethod
def add_account(account):
Account._accounts[account.account_code] = account
@staticmethod
def get_account(account_code:int):
_account = Account._accounts.get(account_code)
... | true |
1fa7d380d62990a59a88296d33f3d7bc15056e20 | alexandrasouly/Basalt_MineRL_misc | /streamlit.py | UTF-8 | 3,264 | 2.765625 | 3 | [] | no_license | import argparse
import cv2
import minerl
import numpy as np
import plotly.express as px
import random
import os
import streamlit as st
from pathlib import Path
import sqlite3
import skvideo.io
from database import return_all_data, get_number_of_unrated_pairs, get_one_unrated_pair, rate_traj_pair, NoUnratedPair
import ... | true |
a9da1a2bb3455b4e28806a1591b8c831fc6d15a5 | Aaryan6/perwebapp | /static/my pygame/car race/main.py | UTF-8 | 5,628 | 2.90625 | 3 | [] | no_license | import pygame, sys, random, os
pygame.init()
pygame.mixer.init()
SCREEN_WIDTH =318
SCREEN_HEIGHT = 500
SCREEN = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
clock = pygame.time.Clock()
def welcome():
exit_game = False
while not exit_game:
for event in pygame.event.get():
if ev... | true |
388cc56208bdf46eeee9534e9fa67e92c74ed8cc | cataltas/visibility_rec_system | /gender.py | UTF-8 | 1,674 | 2.734375 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, getopt, random
import os
import pandas as pd
from pyspark.sql import SparkSession
filepath = "hdfs:/user/ct2522"
def newSparkSession():
# return SparkSession.builder.getOrCreate()
mem = "7GB"
spark = (SparkSession.builder.appName("Music_Project")
... | true |
d2dcdd7e0c1f0ece41d1b71a050212e6eaee6407 | bancorprotocol/bancor-contracts-solidity-legacy | /python/PerformanceUniTestWeights.py | UTF-8 | 2,178 | 2.859375 | 3 | [] | no_license | import Web3Wrapper
import InputGenerator
MINIMUM_VALUE_STAKED = 10 ** 23
MAXIMUM_VALUE_STAKED = 10 ** 24
SAMPLES_COUNT_STAKED = 10
MINIMUM_VALUE_BALANCE = 10 ** 23
MAXIMUM_VALUE_BALANCE = 10 ** 24
SAMPLES_COUNT_BALANCE = 10
MINIMUM_VALUE_RATE = 100000
MAXIMUM_VALUE_RATE = 900000
SAMPLES_COUNT_RATE = 10
def Main()... | true |
c4339efca4ca433ddfb6ab46cc283b7d46497b3f | cburschka/modod | /src/modod/uf.py | UTF-8 | 1,002 | 3.34375 | 3 | [
"MIT"
] | permissive | '''A Union-Find data structure.'''
class UF:
def __init__(self, iterable=()):
self.list = list(iterable)
self.index = {x:i for i,x in enumerate(self.list)}
self.parent = list(range(len(self.list)))
def makeset(self, x):
self.index[x] = len(self.list)
self.parent.append(l... | true |
8b9e89e0c70fde9a6186d115484feb56d50cc72b | karankishinani/VISR | /fos/verify-merged.py | UTF-8 | 150 | 2.75 | 3 | [] | no_license | import json
f = open('xxx', 'r', encoding='utf-16')
r = f.readline()
while r:
j = json.loads(r)
if 'fos' in j:
print(j['fos'])
r = f.readline()
| true |
d7b2c5d35be2289bc5c6d3b500013174e3b2adae | NewerCN/MyStudy | /倒计时七段数码管绘制.py | UTF-8 | 1,281 | 3.640625 | 4 | [] | no_license | import turtle
import time
def drawGap(): # 绘制数码管之间的间隔
turtle.penup()
turtle.fd(5)
def drawLine(draw): # 绘制单端数码管
drawGap()
turtle.pendown() if draw else turtle.penup()
turtle.fd(40)
drawGap()
turtle.right(90)
def drawDigit(digit): # 根据数字绘制七段数码管
drawL... | true |
0a18f8aff0028ddc5790cb362a3c6ae8715a82c1 | LYZhelloworld/Leetcode | /roman-to-integer/solution.py | UTF-8 | 1,307 | 3.625 | 4 | [
"MIT"
] | permissive | class Solution:
def romanToInt(self, s):
"""
:type s: str
:rtype: int
"""
ones = (None, 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX')
tens = (None, 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC')
hundreds = (None, 'C', 'CC', 'CCC',... | true |
0f7d169f760a9eb25c1ca735a60b9f875df791a8 | MehulPrince/Python2020summer | /constructors.py | UTF-8 | 171 | 3.8125 | 4 | [] | no_license | class Person:
def __init__(self, name):
self.name = name
def talk(self):
print(f"Hi,my name is {self.name}")
john = Person("Bob Smith")
john.talk() | true |
7058760172fc808ce28cac36e8d8b2aee2378940 | caesarjuming/PythonLearn | /com/test1.py | UTF-8 | 4,806 | 3.640625 | 4 | [] | no_license | __author__ = 'Administrator'
# python处理的每一样东西都是对象,像模块,函数,类都是对象。
# Python是强类型的,也就是只能对相应类型做相应的操作,例如只能对字符串进行字符串操作,但他是动态类型
# python数字类型有整数,浮点类型,复数,十进制数,有理分数,集合等
print(1+1)
print(2.11+3)
print(2*4)
print(2**3)
import math
print(math.pi)
print(math.sqrt(4))
import random
print(random.random())
print(random.choice([1,2,3,4... | true |
6e739611f40cfb342f6c005e946b8792df0f3c99 | humanbeing-dev/dart-app | /Darts/users.py | UTF-8 | 3,418 | 2.8125 | 3 | [] | no_license | import mysql.connector
def db_connect(db_name=""):
"""Function to make connection to database"""
config = {
"host": "localhost",
"user": "root",
"password": "",
"auth_plugin": "mysql_native_password",
"database": f"{db_name}"
}
c = mysql.connector.connect(**conf... | true |
d2d0a20e357ca822825fcb9721a9310f1e8983f3 | OMGVee/scripts | /python/shop2.py | UTF-8 | 387 | 2.6875 | 3 | [] | no_license | #!/usr/bin/env python3
string='Practicemakesperfect'
dictionary=['makes','practice','perfect']
def match(s, dct):
s=s.lower()
for word in dct:
if word in s:
s=s.replace(word,"")
if len(s)>0:
return False
else:
return True
assert match("pr@acticeMakesperfect", diction... | true |
89978ca4c36f779dc1893b72d64b115ba3263261 | Drogheda/Deeplearning | /TensorFlowDemo/LogisticCat/lr_utils.py | UTF-8 | 1,578 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | import numpy as np
import h5py
def load_dataset():
#datasets/train_catvnoncat.h5文件下有三个数据集:/list_classes、/train_set_x、/train_set_y
train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r")
# print(train_dataset["list_classes"].value) #[b'non-cat' b'cat']
# print(train_dataset["train_set_x"].value) #输入... | true |
f9d239ec4f7defa9366551071bdb4877f2260e2f | kiml1/eSports | /scrapy/offlineTournaments/offlineTournaments/spiders/offlineTournaments_spider.py | UTF-8 | 2,263 | 2.6875 | 3 | [
"MIT"
] | permissive | from offlineTournaments.items import OfflinetournamentsItem
from scrapy import Spider, Request
import re
class OfflineTournamentsSpider(Spider):
name = 'offlineTournaments_spider'
allowed_urls = ['https://www.esportsearnings.com/']
start_urls = [
'https://www.esportsearnings.com/players/most-offli... | true |
81c54d49054aabe1457510af7e52ad013f591afa | haidark/PlateProj | /python/Printer.py | UTF-8 | 1,055 | 3.359375 | 3 | [] | no_license | ###################################################
#Filename: Printer.py
#Author: Haidar Khan, Azer Khan
#Date: 3/24/15
###################################################
# Notes: (Anything after a '#' is a comment)
# This file contains the function which prints a list of Plate objects \
# to a .csv file
############... | true |
7ac605ab7d5de06e88e4d4a690d1bb71b87f8080 | Kotzur/TwitterSentiment | /src/classifier.py | UTF-8 | 8,044 | 3.125 | 3 | [] | no_license | from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from sklearn.naive_bayes import MultinomialNB
from sklearn.pipeline import Pipeline
from sklearn.svm import SVC
from enum import Enum
import pickle
from utils import metrics, handle_datasets
class Type(Enum):
"""Type enum for classif... | true |
1cd8732efb0885f521f15880b64e7a4fb3146e06 | tecWang/knowledges-for-cv | /剑指offer/Codes/03_火柴拼图-贪心算法.py | UTF-8 | 1,936 | 3.609375 | 4 | [
"Apache-2.0"
] | permissive | #
#
# @param n int整型 n
# @param Stick int整型一维数组 Stick
# @return long长整型一维数组
#
#
#
# @param n int整型 n
# @param Stick int整型一维数组 Stick
# @return long长整型一维数组
#
class Solution:
def MaxArea(self , n , Stick ):
# write code here
# 从收益率的角度来讲
# 正方形每条边的收益率为 1/4
# 正三角形每条边的收益率... | true |
fafbfff25963555aada797df07db39d3fd79c7cb | BaylorBower/Sudoku | /main.py | UTF-8 | 2,330 | 3.296875 | 3 | [] | no_license | from random import sample
# On a scale of 1-100 difficulty
Difficulty = 100
# baseline valid solution
def pattern(r, c):
return (base*(r % base)+r//base+c) % side
# randomize rows, columns and numbers (of valid base pattern)
def shuffle(s):
return sample(s,len(s))
base = 3
side = base*base
... | true |
2e941fc0db69aa09ad6ebe485a4f48890ba34bb0 | AbdulrahmanIbraheem/chapter3-condition-problems | /Book Club Points.py | UTF-8 | 1,414 | 4.0625 | 4 | [] | no_license |
# 11. Book Club Points
# Serendipity Booksellers has a book club that awards points to its customers based on the
# number of books purchased each month. The points are awarded as follows:
# š ,I D FXVWRPHU SXUFKDVHV ERRNV KH RU VKH HDUQV SRLQWV
# š If a customer purchases 2 books, he or she earns 5 points.
# š ... | true |
2890e2b1c2cbc032b072388611ceb918be6fb046 | juano2310/aRobot | /src/python/10dof_MQTT.py | UTF-8 | 3,301 | 2.546875 | 3 | [] | no_license | import sys, getopt
sys.path.append('.')
import RTIMU
import os.path
import time
import math
import paho.mqtt.client as mqtt
server = "localhost"
port = 1883
vhost = "/"
username = "guest"
password = "guest"
SETTINGS_FILE = "RTIMULib"
# computeHeight() - the conversion uses the formula:
#
# h = (T0 / L0) * ((p / P... | true |
284af1bf2837d4f8626fa966037db660e576ff78 | Monarene/CV-Deep-learning-starter | /utilities/nn/cnn/shallownet.py | UTF-8 | 968 | 2.71875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 28 14:39:31 2018
@author: Michael
"""
#importing te relevant libraries
import numpy as np
from keras.models import Sequential
from keras.layers.core import Dense, Flatten, Activation
from keras.layers.convolutional import Conv2D
from keras import backend as ... | true |
649ab2e85a6ba5df1429628219ec655720f92fea | gadekarmd/Myntra-Web-Scraping | /myntra.py | UTF-8 | 1,700 | 2.828125 | 3 | [] | no_license | import requests as rs
from bs4 import BeautifulSoup
import json as js
import csv
headers = {"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"}
csv_file = open('web_scrape.csv', "w")
csv_writer = csv.writer(csv_file)
csv_writer.writerow(['Product Li... | true |
e03ae89414770b1f4520895cfcaf8b69cf5996d5 | huamuxiong/webdriver | /webdriver/webdriver14_other.py | UTF-8 | 751 | 3 | 3 | [] | no_license | from time import sleep
from selenium import webdriver
# 绑定浏览器
# driver = webdriver.Firefox()
driver = webdriver.Chrome()
# 输入 url
url = "file:///d:/python/PythonProject/test_other.html"
driver.get(url)
size = driver.find_element_by_css_selector("#uname").size
print(size)
text = driver.find_element_by_css_selector(... | true |
1bd5fc6b7e8bdb28011140ffb091469271974292 | erf-git/WashingMachineControlSystem | /testing/gpios/using/servo_testing.py | UTF-8 | 829 | 3.015625 | 3 | [] | no_license | from gpiozero import LED, LightSensor, Button, DistanceSensor, PWMOutputDevice, AngularServo
import Adafruit_DHT
import RPi.GPIO as GPIO
from time import sleep
import random
SERVO_SLEEP_SEC = 0.5
# Is the valve open?
serArray = ["valve closed", "valve open", "valve blocked"]
servo0 = AngularServo(22, initial_angle=0... | true |
1ea7557dbf3e10f1c337b805b9b2055168dbb33b | talhaibnaziz/projects | /pi3ddemos/LoadModelPickle.py | UTF-8 | 2,261 | 2.71875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python
from __future__ import absolute_import, division, print_function, unicode_literals
""" Loading or saving a model from or to a pickled form. The initial
model is loaded using Wavefront obj model loading as in LoadModelObj.py.
KEY 'd' will save the model as models/teapot.pkl and subsequent runs of... | true |
7ffa5087d1e2ae65738ca199b543e1f6d115f4a1 | roshande/codingWebsites | /Codechef/CLEANUP/cleanup.py | UTF-8 | 393 | 2.640625 | 3 | [] | no_license | for _ in range(int(input())):
n,m = list(map(int,input().split()))
completed = list(map(int,input().split()))
chef,assistant = [],[]
change = 0
for i in range(n):
if not i+1 in completed:
if change == 0:
chef.append(i+1)
change = 1
else:
assistant.append(i+1)
change = 0
for x in chef:
pr... | true |
3f2ea5ad5d29a84a810ddb2b021b1f28ea70e313 | guillaumeguirriec/capitrain | /sniffer.py | UTF-8 | 2,474 | 2.578125 | 3 | [
"ISC"
] | permissive | import environment
import pyshark
import os
import argparse
# Check if we have the necessaries environment variables
environment.check_sniffer_env()
# Arguments available
parser = argparse.ArgumentParser()
parser.add_argument(
'--outputFile', '-of', default="capture", help='The name of the pcap output ... | true |
a58e932799f016b0a4ae5de519ff08c5c100adb3 | q737645224/python3 | /ML/SCIENCE/day07/inter.py | UTF-8 | 1,632 | 3.28125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import numpy as np
import scipy.interpolate as si
import matplotlib.pyplot as mp
min_x, max_x = -2.5, 2.5
con_x = np.linspace(min_x, max_x, 1001)
con_y = np.sinc(con_x) # 减幅正弦
dis_x = np.linspace(min_x, max_x, 11)
dis_y = np.sinc(dis_x)
# ... | true |
d07b331f990dea2486ae9dbb7da556aab169216b | sbackon/Boring_Stuff | /Boring_Stuff_12/practice_projects/commandLineEmailer.py | UTF-8 | 1,139 | 2.625 | 3 | [] | no_license | #!/usr/bin/env python3
# commandLineEmailer.py takes email adress and string and sends them from your mail
import sys, time
from selenium import webdriver
from selenium.webdriver.support.ui import Select
# Save given email and string
target_email = sys.argv[1]
etext = sys.argv[2:]
# Open webbrowser and log in to you... | true |
bf3f1d275f8f2fa274d70fcbab49919570d925af | apcc-geoslegend/poold | /poold/__init__.py | UTF-8 | 1,383 | 3.03125 | 3 | [
"MIT"
] | permissive | from .learners import AdaHedgeD, DORM, DORMPlus
from .environment import Environment
def create(learner, model_list, groups=None, T=None, **kwargs):
"""
Returns an online_expert object, instantiated with the passed in parameters.
Args:
learner (str): online learning algorithm name [dorm | dormp |... | true |
44a339282900f66c50842748020d228cf18b0841 | SvetoslavKazandzhiev/Software-University | /Python-Advanced/exams/23February2020Expression_Evaluator.py | UTF-8 | 665 | 3.34375 | 3 | [] | no_license | from math import floor
user_input = list(input().split())
result = None
numbers = []
for i in user_input:
operand = None
if i not in ["+", "-", "*", "/"]:
numbers.append(int(i))
else:
operand = i
if result is None:
result = numbers[0]
del numbers[0]
... | true |
0a4fd67cee5360267b723e726d09d60680e87b12 | roiamiel1/SteganographyCTF2021 | /comperator.py | UTF-8 | 415 | 3.03125 | 3 | [] | no_license | from PIL import Image
imageA = Image.open("old.bmp")
imageB = Image.open("new.bmp")
for x in range(imageA.width):
for y in range(imageB.height):
rA, gA, bA = imageA.getpixel((x, y))
rB, gB, bB = imageB.getpixel((x, y))
s = abs(rA - rB) + abs(gA - gB) + abs(bA - bB)
color = int((0x... | true |
80b827e3ee150b2a3a98485a46f9021dac65fa88 | qxzsilver1/PteraSoftware | /pterasoftware/aerodynamics.py | UTF-8 | 38,171 | 3.578125 | 4 | [
"MIT"
] | permissive | """This module contains vortex class definitions, and useful aerodynamic functions.
This module contains the following classes:
LineVortex: This class is used to contain line vortices.
HorseshoeVortex: This class is used to contain horseshoe vortices.
RingVortex: This class is used to contain ring vortices... | true |
0fbbcaee6bc8b432d6164d8c62c06e229dd36fa3 | DingGuodong/LinuxBashShellScriptForOps | /functions/string/statisticsanalyse/pyTcpConnStatistics.py | UTF-8 | 3,593 | 2.75 | 3 | [] | no_license | #!/usr/bin/python
# encoding: utf-8
# -*- coding: utf8 -*-
"""
Created by PyCharm.
File: LinuxBashShellScriptForOps:pyTcpConnStatistics.py
User: Guodong
Create Date: 2017/7/31
Create Time: 9:48
Description: TCP Connection Statistic
References:
"""
import collec... | true |
61ad851a7083907ce4a417e6555c7bf13d05ce72 | Qinpeng96/leetcode | /316. 去除重复字母.py | UTF-8 | 1,277 | 4.40625 | 4 | [] | no_license | """
[316. 去除重复字母](https://leetcode-cn.com/problems/remove-duplicate-letters/)
给你一个仅包含小写字母的字符串,请你去除字符串中重复的字母,使得每个字母只出现一次。
需保证返回结果的字典序最小(要求不能打乱其他字符的相对位置)。
示例 1:
输入: "bcabc"
输出: "abc"
示例 2:
输入: "cbacdcbc"
输出: "acdb"
***
用栈来存储最终返回的字符串,并维持字符串的最小字典序。每遇到一个字符,如果这个字符不存在于栈中,
就需要将该字符压入栈中。但在压入之前,需要先将之后还会出现,并且字典序比当前字符小的栈顶字符移除,
然后... | true |
435741bc3eca85df96469f8a4b0fe6d713c88580 | yeqingyan/CCI_code | /Chapter1/q1_7.py | UTF-8 | 1,395 | 4.21875 | 4 | [] | no_license | """ Question 1.7 """
def rotate_matrix(matrix):
""" Rotate a NxN matrix by 90 degrees """
N = len(matrix[0])
row = 0
edge = N - 1
while row <= N/2-1:
for col in range(row, row+edge):
# row = 1, edge = 1 col = 1
temp = matrix[row][col]
# 0,1 = 2,0
... | true |
b8ad9c9511cda0ac2fdeac3e3afe4c3271a06dbf | Pianfensi/guessing | /apis/API.py | UTF-8 | 1,990 | 2.59375 | 3 | [] | no_license | # /usr/bin/python
from APIHelpers import *
class API:
def __init__(self):
self._success = False
self._data = None
self._weight = None
self._weight = self.get_weight()
def __call__(self):
if self._success:
return self._question, self._answer
... | true |
3e407ed862ade6bd64101cf32b28e8f51781f872 | lpantano/seqcluster | /seqcluster/function/peakdetect.py | UTF-8 | 621 | 3.078125 | 3 | [
"MIT"
] | permissive | import numpy as np
def _summarize_peaks(peaks):
"""
merge peaks position if closer than 10
"""
previous = peaks[0]
new_peaks = [previous]
for pos in peaks:
if pos > previous + 10:
new_peaks.add(pos)
previous = pos
return new_peaks
def find_mature(x, y, win=10)... | true |
09bdda68e7af21afae1eabaf2d4331dc2b78e580 | yukikoyanagi/cdp | /select_test.py | UTF-8 | 1,171 | 3.09375 | 3 | [] | no_license | #!/usr/bin/python
#
# File: select_test.py
# Description: Randomly selects a specified number of files from
# 'source' directory and copies to test directory under destination
# directory. The unselected files are copied to training dir under
# destination dir.
#
# Author: Yuki Koyanagi
# History:
# 2016/03/03: yk:... | true |
53b02ec6d9101185c0c19511a1eb42d95563a37f | mickzer/FYP | /app/master/master_logger/__init__.py | UTF-8 | 3,591 | 2.640625 | 3 | [] | no_license | import logging, threading, Queue, time, requests
from datetime import datetime
class MasterLoggingAdapter(logging.LoggerAdapter):
"""
Provides an interface to attach job ids and task ids to log messages.
"""
def __init__(self, log):
super(MasterLoggingAdapter, self).__init__(log, {})
def s... | true |
d3638d298ec7f12e4c14dc770046eb065622d23a | krish14011995/Artificial_Intelligence | /BranchNBound/ hw1cs561f2018.py | UTF-8 | 4,457 | 2.6875 | 3 | [] | no_license | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 14 09:48:18 2018
@author: krishmehta
"""
import numpy as np
import datetime
length_of_matrix=-1
no_of_officers=-1
no_of_vehicles=-1
dict_freq_count={}
frequency_sorted=[]
frequency_scooter = []
row_look_up=[]
column_look_up=[]
slash_look_up=[]
ba... | true |
23de4a888ba2216083567c3a3edf296718402882 | pol9111/ProxyPool | /proxypool/getter.py | UTF-8 | 1,010 | 2.703125 | 3 | [] | no_license | import asyncio
from proxypool.db import RedisClient
from proxypool.crawler import Crawler
from proxypool.setting import *
class Getter:
def __init__(self):
self.redis = RedisClient()
self.crawler = Crawler()
def is_over_threshold(self):
"""判断是否达到了代理池限制"""
if self.redis.cou... | true |
8477e9e1bb8d8d8e6a85b63dfccd066475299dfc | RyanDsilva/machine-learning-starters | /classifiers/random_forests.py | UTF-8 | 734 | 2.78125 | 3 | [] | no_license | from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn import metrics
import pandas as pd
iris = datasets.load_iris()
data = pd.DataFrame({
'sepalLength': iris.data[:, 0],
'sepalWidth': iris.data[:, 1],
'petalLength... | true |
e74ad04741776dcde540e9a4db413fdaa5c310ef | Varajey/rbm_based_autoencoders_with_tensorflow | /results_validation/visualize_distribution.py | UTF-8 | 1,453 | 2.6875 | 3 | [
"MIT"
] | permissive | """Visualize distribution of one or two models probability embeddings
Example usage:
python results_validation/visualize_distribution.py --emb_path /tmp/rbm_aec_reconstr/0_encodings_test_set.npy /tmp/rbm_aec_reconstr/1_encodings_test_set.npy
"""
import argparse
import os
import matplotlib.pyplot as plt
import numpy as... | true |
db2a194fcdf859ef9cd1a8ba20e8a2528787313d | zzz686970/leetcode-2018 | /874_robotSim.py | UTF-8 | 905 | 3.4375 | 3 | [] | no_license | def robotSim(commands, obstacles):
# -2: turn left 90 degrees
# -1: turn right 90 degrees
# 1 <= x <= 9: move forward x units
# [4,-1,3] --> 25
i = j = mx = d = 0
move, obstacles = [(0,1),(-1,0),(0,-1),(1,0)], set(map(tuple, obstacles))
for command in commands:
if command == -2: d = (d+1) % 4
elif command ... | true |
4c6bc0c1b2a4cdf2965b8b1f96513fe04cae925d | LaplaceKorea/Algorithms-for-Quantum-Internet-Routing | /src/agents/agent.py | UTF-8 | 2,645 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
#
# Written by Adel Sohbi, https://github.com/adelshb
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modificatio... | true |
65f1b793cbee08a8946e44f216ab129d8faa4459 | JhonataAugust0/Python | /Areas/Automacao/Selenium/Aulas/Aula04/Historico_da_pagina.py | UTF-8 | 483 | 2.875 | 3 | [
"MIT"
] | permissive | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
class Historico_da_pagina():
def __init__(self):
self.driver = webdriver.Chrome(executable_path="/run/media/jhonata/_home/Programação/Python/Selenium/chromedriver")
def entrar (self, url):
driver = sel... | true |
661e8c248d773cdccc3cea96374035988c8ac3f6 | auchappy/MA305 | /lab8/lab8c.py | UTF-8 | 1,341 | 3.765625 | 4 | [] | no_license | #!usr/bin/env python3
"""
=====================================
Chapman, Piers - 15NOV18
Purpose: Use a matrix to determine the 1-, infinite, and Frobenious norms.
=====================================
"""
import numpy as np
import time as clock
start = clock.time()
def froben(trix):
shape = trix.shape
row = shap... | true |
3870b215eb0df442053788d2f3ad8b3f91970463 | jfrfonseca/symbolic_regression | /symbolic_regression/genotype.py | UTF-8 | 3,833 | 2.828125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""__init__.py: Basic requirements for the module."""
__license__ = "MIT"
__author__ = "José Fonseca"
__copyright__ = "Copyright (c) 2020 José F. R. Fonseca"
# ===================================================================================================... | true |
914f639ed07a2599dba3af9fabe439318eca5f1e | blu-ies/blu-ies | /Board_2D.py | UTF-8 | 8,035 | 2.796875 | 3 | [] | no_license | from copy import deepcopy
from Square import *
import random
N = (-1, 0)
S = (1, 0)
E = (0, 1)
W = (0, -1)
NE = (-1, 1)
NW = (-1, -1)
SE = (1, 1)
SW = (1, -1)
COMPAS = (NW, N, NE, E, SE, S, SW, W)
class Board(object):
COMPASS = ((-1, -1), (-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -... | true |
f9e321ac499bf88c8bf64e605400a00869fd4c51 | Niuyuhang03/MachineLearning | /decision_tree/decision_tree.py | UTF-8 | 11,277 | 2.71875 | 3 | [] | no_license | # -*- coding: UTF-8 -*-
import numpy as np
import pandas as pd
import operator
from sklearn.preprocessing import Imputer, StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.metrics import f1_score
from sklearn.metrics import confusion_matrix
from matplotlib.font_manager import FontProperti... | true |
c06a643e9b78f93131dcab9e45174d678f7e8f90 | Ulkuozturk/SQL_Python_Integration | /movieMore.py | UTF-8 | 975 | 3.109375 | 3 | [] | no_license | import sqlite3
connection = sqlite3.connect("movie.db")
cursor= connection.cursor()
# cursor.execute('''CREATE TABLE IF NOT EXISTS Movies
# (Title TEXT, Director TEXT, Yera INT)''' )
# cursor.execute("INSERT INTO Movies VALUES ('Taxi Driver','Martin', 19)") sadece bir sira veri girisi yaptik
# cursor... | true |
528d8654e04469ee4621809324748c1c11cef06e | Godsdrink/Python_Labs | /ua/lviv/iot/lab1/Lab1.py | UTF-8 | 1,224 | 3.25 | 3 | [] | no_license | class Kitchen:
amount = 0
def __init__(self, dish_name="kuchka govnica", price=0, new_amount=0, quality="govno", caloric_content=0):
self.dish_name = dish_name
self.price = price
self.new_amount = new_amount
self.quality = quality
self.caloric_content = caloric_content
... | true |
7a883ab11f433e66e0a1e83a224cf02ef1cfc0f3 | zhengmaoch/OpenCVTutorial | /tutorial_13.py | UTF-8 | 1,441 | 2.859375 | 3 | [] | no_license | import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
def threshold_demo(image):
"""全局二制化"""
gray = cv.cvtColor(image, cv.COLOR_BGR2GRAY)
ret, binary = cv.threshold(gray, 0, 255, cv.THRESH_BINARY | cv.THRESH_OTSU)
print("threshold value %s" % ret)
cv.imshow("threshold", binary)
... | true |
9e13746b2836c94f3dbd07a02d8a9ceadb8d6620 | KeiKinn/audio_duration_on_asc | /dcase2020/model_functions.py | UTF-8 | 1,557 | 2.53125 | 3 | [] | no_license | import os
import torch
import config as c
import model as md
import logging_functions as lf
def generate_models_file_info(models_dir_path, tag):
while os.path.isfile(models_dir_path+'/saved_model_{}.pth'.format(tag)):
tag += 10000
models_name = 'saved_model_' + str(tag) + '.pth'
models_path = o... | true |
da14a0647a9d0c8cb06aca41701903d99e9600f1 | ferhsilvestre/algoritmos | /Lista 1/ex8.py | UTF-8 | 353 | 3.9375 | 4 | [] | no_license | deposito = float(input("Coloque aqui o valor que você deseja depositar: "))
taxa = float(input("Coloque aqui o valor da taxa de juros: "))
rendimento = deposito * taxa / 100
total = deposito + rendimento
print("O valor do rendimento é de R$ {:.2f}".format(rendimento))
print("O valor total do rendimento de um mês é ... | true |
947571db54af8f4747238465d59048f996c1e170 | veltzerdoron/GCJ | /src/go/go.py | UTF-8 | 8,580 | 3.140625 | 3 | [
"MIT"
] | permissive | import argparse
import importlib
import traceback
import sys
import os
__version__ = "1.1"
def execute(command, phase):
""" executes a command inside a phase """
try:
print(phase)
input("EXECUTE : " + command)
return os.system(command)
except Exception as e:
print("SOMETH... | true |
2c83070666d08229700de48af708fecb128e5756 | hwpwk/home | /import_Calculation_test.py | UTF-8 | 296 | 3.375 | 3 | [] | no_license | # 自作関数pyファイルを呼び出し
import Calculation
# Calculation.pyのtasu関数とhiku関数を実行
tasu = Calculation.tasu(3, 1)
hiku = Calculation.hiku(3, 1)
print('足し算の結果は{}です。'.format(tasu))
print('引き算の結果は{}です。'.format(hiku))
| true |
2191b29d7b8c57e373eeb62ebad6ae1ecea2b60c | xqhu2008/Larva | /src/game/sudoku.py | UTF-8 | 451 | 2.953125 | 3 | [] | no_license | # -*- encoding:utf-8 -*-
'''
sudoku.py:
sudoku game implementation by python. This implementation includes game solution and generation.
'''
class Sudoku:
def __init__(self, rows = 3, cols = 3):
self._rows = rows * rows
self._cols = cols * cols
self._fields = [0 for _ in range(... | true |
85840737c41cf38b81e33a6cf83aee39181b7507 | williamzxl/app_test_many_devices | /testcase/interface/writing/fangxie_zaoju/get_fangxie_zaoju_all_answer.py | UTF-8 | 1,927 | 2.6875 | 3 | [] | no_license | import requests
import json
# from utils.config import get_headers
class GetAllFangxieZaojuAnswers(object):
def __init__(self):
# self.headers = headers
# self.url = self.headers.get('Host')
self.pas = None
def get_all_fangxie_zaoju_answer(self, headers, groupID, taskID):
# ht... | true |
a4c900a62eaf4902c39f7ba0915be6f8e5ac81ea | Akashg1234/Large-file-processor | /assignment.py | UTF-8 | 13,400 | 2.890625 | 3 | [] | no_license | import csv
from os import access
import mysql.connector as mc
from mysql.connector import errorcode
class Access:
# db connection class
class db_operation:
# initialization
def __init__(self,dbuser=None,dbhost=None,dbpass=None,dbname=None):
self.db_user=dbuser
self.... | true |
ecbcb90fb524ea5d8eabc07b8f8e301e408c7def | samlnx03/alveolos | /calificar-python/licenciatura/Calificar_Licenciatura.py | UTF-8 | 10,636 | 2.765625 | 3 | [] | no_license | from string import *
from math import *
import sys
import xlwt
def califica(nombre, salida):
i=0
j=0
# nombre=raw_input("Ingresa el nombre del archivo de resultados de los alumnos: ")
diccionario={}
diccionario_fichas={}
diccionario_examenes={}
diccionario_respuestas={}
diccionario_respuestas... | true |
f8e94e01aa939faedd85ddc90a91dd55a2ef0dcb | bleedyao/dummy_vehicle_lottery | /ut/random_seed.py | UTF-8 | 690 | 3 | 3 | [] | no_license | import unittest
from vehical_lottery import RandomInformation
class TestSeed(unittest.TestCase):
def test_seed_equal(self):
ri1 = RandomInformation(seed=100)
ri2 = RandomInformation(seed=100)
for i in range(500):
result1 = ri1.randomApplicationCode()
result2 = ri2.r... | true |
10b732988c96631d2fd80dcbc74db0645d30c643 | mhoff12358/virtualpy | /resources/complex.py | UTF-8 | 504 | 3.21875 | 3 | [] | no_license | class C(object):
def __init__(self, x, y = 0):
self.u = x
self.v = y
def real(self):
return self.u
def imag(self):
return self.v
def __add__(self, other):
return C(self.u + other.u, self.v + other.v)
def __sub__(self, other)... | true |
dd1e0da71d0d0cada68db52d7d19b4c1256d7ee0 | rhiga2/BinaryNeuralNetwork | /datasets/stft.py | UTF-8 | 3,595 | 2.890625 | 3 | [] | no_license | import numpy as np
import torch
import torch.nn as nn
import scipy.signal as signal
import matplotlib.pyplot as plt
import soundfile as sf
def stft(x, window='hann', nperseg=1024, noverlap=768):
stft_x = signal.stft(x,
window=window,
nperseg=nperseg,
noverlap=noverlap)[2]
real, imag = n... | true |
a0d4ffed3334416942df7726a9d11e0a555317af | itsolutionscorp/AutoStyle-Clustering | /all_data/exercism_data/python/bob/6f8a779634884cd28436c33f2d98b23f.py | UTF-8 | 920 | 3.578125 | 4 | [] | no_license | def hey(msg):
if is_blank(msg):
return 'Fine. Be that way!'
if is_yelling(msg):
return 'Whoa, chill out!'
if is_question(msg):
return 'Sure.'
return 'Whatever.'
def is_question(msg):
# avoid reaching out of bounds in empty array with msg[-1]
return len(msg) > 0 and msg[-... | true |
5d823b73b7337b872ac8f6e627ed492080b88538 | gdemir/pro-lang | /python/ogrenci.py | UTF-8 | 969 | 3.015625 | 3 | [] | no_license | #!/usr/bin/python
#-*-coding:utf-8-*-
from config import *
class Ogrenci:
def __init__(self, csvname, KEY):
self.ogr = {}
self.csv = csvname
self.KEY = KEY
self.alan = self.yukle()
def goster(self):
for key, bilgi in self.ogr.items(): print key, bilgi
def bul(self):
for key in self.ogr.items():
prin... | true |
dd3ad8642a7d453cad52674d02648a9baeeab808 | Sipleman/SimpleHttpServer | /main.py | UTF-8 | 2,889 | 2.71875 | 3 | [] | no_license | import posixpath
import socket
import os
import xml.etree.ElementTree as ET
import sys
class HttpServer:
def __init__(self, PORT):
self.HOST, self.PORT = '', PORT
self.s = socket.socket(socket.AF_INET)
self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.s.bind((self.HO... | true |
dc5b17b3edd7296548891383ea2dada6672f3c27 | supremepoison/PythonNet | /Day02/code/udp_server.py | UTF-8 | 359 | 2.9375 | 3 | [] | no_license | from socket import *
#创建数据报套接字
sockfd =socket(AF_INET,SOCK_DGRAM)
#绑定地址
server_addr = ('0.0.0.0', 8888)
sockfd.bind(server_addr)
#消息接受/发送
while True:
data, addr = sockfd.recvfrom(1024)
print('Receive message from %s:%s'%(addr, data.decode()))
sockfd.sendto(b'Thanks for your msg',addr)
sockfd.close(... | true |
1a3f38f3e807c17dc69da9f27182bcc61be37514 | Evalle/Coursera | /datastructures/most_common_10.py | UTF-8 | 310 | 3.28125 | 3 | [] | no_license | #python3
fhand = open('text.txt')
count = dict()
for line in fhand:
words = line.split()
for word in words:
count[word] = count.get(word, 0) + 1
lst = list()
for key,value in count.items():
lst.append( (value,key) )
lst.sort(reverse=True)
for value,key in lst[:10]:
print(key,value)
| true |
a214c86dbf648e66200de19135357185a18b67e6 | indian91/Python3PM | /banking.py | UTF-8 | 3,739 | 3.03125 | 3 | [] | no_license | import json
import time
import os
import pickle
from getpass import getpass
def main_menu():
os.system('cls')
time.sleep(1)
s='''\n1.Signup\n2.Login\n3.Exit'''
print(s)
ch=int(input('Choose any option from above'))
if ch==1:
signup()
elif ch==2:
login()
els... | true |
bea4ea686d4aa71a5d1d29e87532b1cf3ff168bd | baucheng/Python_3D | /src/evaluateHmatrices.py | UTF-8 | 10,493 | 3.078125 | 3 | [] | no_license | #!/usr/bin/python
'''
Created on July 11, 2014
Testing the H matrices across the various depth planes.
Functional but not user-friendly yet!
@author: carlos torres <carlitos408@gmail.com>
'''
import cv2
import numpy as np
import matplotlib.pyplot as plt
import imtools
pathH = '/home/carlos/Documents/PYTHON/Compute... | true |
dd792dcfe89f7db0112c8b9f763e3403c6f3b13d | CarlHwang/Mobile | /FeatureExtraction/UICollectCartRate.py | UTF-8 | 1,894 | 2.609375 | 3 | [] | no_license | #! /usr/bin/env python
# -*- coding:utf-8 -*-
import csv
def UICollectCartRate():
outfile = open('../csv/ui_collect_cart_rate.csv', 'wb')
spamwriter = csv.writer(outfile, dialect = 'excel')
spamwriter.writerow(['user_id','item_id', 'collect_cart_rate'])
user_cc_num = {}
with open('../csv/user_beha... | true |
765afecd0e83d536561a84ea3022951bed79817b | alextaymx/data-mining-deployment | /app.py | UTF-8 | 5,006 | 2.765625 | 3 | [] | no_license | import streamlit as st
import matplotlib.pyplot as plt
# import missingno as msno
PAGE_CONFIG = {"page_title":"DM.project","page_icon":":smiley:","layout":"centered"}
st.beta_set_page_config(**PAGE_CONFIG)
from functions import *
def main():
# st.set_option('deprecation.showPyplotGlobalUse', False)
st.tit... | true |
d0eea7b993ad3530cf1f2879d9fda57592fbcbef | PauloVilarinho/algoritmos | /problemas uri/Problema1279 WA10%.py | UTF-8 | 653 | 3.328125 | 3 | [] | no_license | i = 0
while True :
try:
if i != 0 :
print()
ano = int(input())
bisexto = False
huluculu = False
bulukulu = False
if (ano%4 == 0) and (ano%100 != 0) :
bisexto = True
if ano%55 == 0:
bulukulu = True
elif ano%400 == 0 :
bisexto = True
if ano%55 == 0:
bulukulu = True
if (ano%15 ==... | true |
cbce7e256b9bfc21b69a4ea6fa4a3b3b9bbbe41d | glocomp-cisco-2021/secureki | /workflow/autoapprove.py | UTF-8 | 743 | 2.59375 | 3 | [] | no_license | from selenium.webdriver import Firefox
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.keys import Keys
import time
def auto_browse(url):
print('auto click on url: ' + url)
opts = Options()
opts.add_argument('--headless')
opts.add_argument('--disable-gpu')... | true |
e262eb4c9c40d60687faa4e072f9f5c085ccc6d9 | er-aditi/Learning-Python | /List Working Programs/List_Slicing.py | UTF-8 | 267 | 3.25 | 3 | [] | no_license | names = ['harry', 'john', 'Tom', 'smith']
print(names[0:3])
print(names[1:4])
print(names[:2])
print(names[2:])
print(names[:])
print(names[-3:-1])
""""
harry, john, Tom
'john', 'Tom', 'smith'
'harry', 'john'
'Tom', 'smith'
'harry', 'john', 'Tom', 'smith'
""" | true |
bad78747719506ad53d87167243967df32b37406 | collinol/MPCS-Blockchain-Assignments | /Mining/Mining.py | UTF-8 | 2,255 | 2.859375 | 3 | [] | no_license | from time import sleep
from Block import Block
from BlockChain import double_hash, encode_and_concenate, BlockChain
from Header import Header
from Transaction import CoinbaseTransaction
from txn_mem_pool import TxnMemoryPool
def miner(transaction_pool):
last_block_header = '0'*64 # genesis header
last_block_tar... | true |
f02f26be3839290061558b436eb2880831332fef | JeSappelleRoot/Py314 | /handlers/bind_agent.py | UTF-8 | 12,877 | 2.640625 | 3 | [] | no_license | import sys
import glob
import time
import socket
import socks
import modules
import logging
import hashlib
import threading
from cmd import Cmd
from core import channels
from os import system, path
from netaddr import ip
from termcolor import colored
from prettytable import PrettyTable
class Agent(Cmd):
# Agent promp... | true |
a796eb5669d78c5568f1ce7ac306178951ae1eca | weekmo/master_python | /src/pascal_triangle.py | UTF-8 | 876 | 3.640625 | 4 | [] | no_license | def triangle(rows):
for rownum in range (rows):
newValue=1
PrintingList = [newValue]
for iteration in range (rownum):
newValue = newValue * ( rownum-iteration ) * 1 / ( iteration + 1 )
PrintingList.append(int(newValue))
print(PrintingList)
print()
def pa... | true |