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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
33362cea7cc5710950a2c016c595d05cc445b791 | Python | 1m6h0st/exploitation-training | /pwn-template.py | UTF-8 | 1,966 | 2.609375 | 3 | [] | no_license |
# A custom template for binary exploitation that uses pwntools.
# Examples:
# python exploit.py DEBUG NOASLR GDB
# python exploit.py DEBUG REMOTE
from pwn import *
# Set up pwntools for the correct architecture. See `context.binary/arch/bits/endianness` for more
context.binary = elfexe = ELF('./path/to/binary') ... | true |
a43f0b5e51de861294432bf23aed4a3fea0379cf | Python | geekcomputers/Python | /Droplistmenu/GamesCalender.py | UTF-8 | 1,447 | 3.421875 | 3 | [
"LicenseRef-scancode-unknown",
"GPL-1.0-or-later",
"MIT"
] | permissive |
from tkinter import *
from tkcalendar import Calendar
import tkinter as tk
window = tk.Tk()
# Adjust size
window.geometry("600x500")
gameList =["Game List:"]
# Change the label text
def show():
game = selected1.get() + " vs " + selected2.get()+" on "+cal.get_date()
gameList.append(game)
... | true |
b39ab5cdd8be2dcc29a7c6bc4aee045dea1bd4b7 | Python | neuroelf/EASY-analyses | /python/download_ISIC_file.test.py | UTF-8 | 890 | 2.625 | 3 | [
"MIT"
] | permissive | import getpass
import urllib.request as urllib2
# ISIC base URL
ISICBaseURL = 'https://isic-archive.com'
# request username and password (without output to console)
username = input('Please enter your ISIC username: ')
password = getpass.getpass('Please enter your ISIC password: ')
# create the password manager
mana... | true |
66dc93033baa1775480cf9d276c3008ea38f3f5b | Python | hcheng761/CodeWars-Kata | /Python/3or5.py | UTF-8 | 533 | 3.421875 | 3 | [] | no_license | def solution(number):
identicals = []
ff = 0
while (ff < number):
identicals.append(ff)
ff += 15
t = 1
f = 1
threes = []
fives = []
while t*3 < number:
threes.append(t*3)
t+=1
while f*5 < number:
fives.append(f*5)
f+=1
... | true |
7c0b652b65d5ca5650ad9fb2ae8866f1d3abee04 | Python | francoislegac/algorithms | /uninformed_searched.py | UTF-8 | 2,765 | 3.84375 | 4 | [] | no_license | from collections import deque
import maze_puzzle as mp
#BFS
def run_bfs(maze_puzzle, current_point, visited_points):
queue = deque()
queue.append(current_point)
while queue:
current_point = queue.popleft()
if not current_point in visited_points:
visited_points.append(current_point)
if isFinalPoint(maze_p... | true |
159c915d751bf38b980c92114855b24f02335ea3 | Python | victtorhugo/teste-github | /helloworld.py | UTF-8 | 71 | 3.0625 | 3 | [] | no_license | nome = input()
print ("Hello,"+ nome +".Bom dia!")
print("Até mais!")
| true |
f3d54e94c00e08b517419bd226fcd231dda01e6b | Python | Richard-D/python_excrise | /pandastest/唯一值_值计数.py | UTF-8 | 596 | 3.328125 | 3 | [] | no_license | import pandas as pd
obj = pd.Series(["c","a","d","a","a","b","b","c","c"])
print(obj)
uniques = obj.unique()
print("取得唯一值的数组 ",uniques)
count = obj.value_counts()
print("取得Value的唯一值 ", count)
b = pd.value_counts(obj.values,sort=False)
print("pd.value_counts可用于任何数组或序列")
print(b)
mask = obj.isin(["a","c"])
print(obj[... | true |
4219dca10df01d9a37eef841aef4abc820f7f8ed | Python | ivvve/What-I-study | /python/basics/class/property.py | UTF-8 | 359 | 3.328125 | 3 | [] | no_license | class Car(object):
def __init__(self, model=None):
self.__model = model # __로 시작하면 외부 접근 불가
@property
def model(self):
return self.__model
@model.setter
def model(self, model):
self.__model = model
tesla = Car('Tesla Model S')
print(tesla.model)
tesla.model = 'Kia K7'
pr... | true |
c947998c5a61b1f95743262cce9e92f753c3466e | Python | hercules261188/flask-celery-rabbitmq | /celery-queue/file/tasks.py | UTF-8 | 1,268 | 2.625 | 3 | [] | no_license | import zipfile
import requests
from celery import chain, group
from tqdm import tqdm
from celery_worker import app
@app.task(ignore_result=True)
def get_multi_python_packages(versions):
job = group([get_python_package.s(v) for v in versions])
job.apply_async()
@app.task(ignore_result=True)
def get_python_... | true |
711eaf5148da45fcaf8f1e043f6042943f929a83 | Python | ZJRen333/RZJbedtools | /bedfunction.py | UTF-8 | 1,910 | 2.546875 | 3 | [] | no_license | '''
#coding:UTF-8
'''
import sys
readfilename=sys.argv[1]
class Xtobedlist():
def __init__(self,filename,indexlist):
self.file=open(filename,'r')
self.indexlist=indexlist
def sublistabstract(self,listinput,indexlist):
sublist=[]
for i in indexlist:
sublis... | true |
083fa7e7c5151ba0a58b3e37ec9cbbd8d218027f | Python | dopiwoo/basic-algorithm | /pattern6-in-place-reversal-of-a-linkedlist/5. Rotate a LinkedList (medium).py | UTF-8 | 1,492 | 4.28125 | 4 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 3 17:52:46 2021
@author: dopiwoo
Given the head of a Singly LinkedList and a number 'k', rotate the LinkedList to the right by 'k' nodes.
"""
class Node:
def __init__(self, value: int, next_node: 'Node' = None):
self.value = value
... | true |
87ad66df79e47c03328195358347289fb51d2d18 | Python | Shubu-alfa/nltk_work | /hackerearth/practice_3.py | UTF-8 | 1,035 | 3.125 | 3 | [] | no_license | #list = [int(x) for x in input().split()]
count = 0
house_cost = []
k = ""
diff =100
house_data = int(input())
if 2 <= house_data <= (2 * (10**5)):
house_cost = [int(x) for x in input().split()]
#print(house_cost)
for i in range(0, house_data):
#house_cost.append(int(input()))
count = count ... | true |
18ed0255c616965b32c4f186196cf0b059fea1ed | Python | ygorkayan/YK-Estacionamento | /Site/views.py | UTF-8 | 4,352 | 2.96875 | 3 | [] | no_license | import threading
from django.core.mail import send_mail
from django.shortcuts import render, redirect
from .forms import FormSuporte, FormCarrinho
from django.contrib.auth.forms import UserCreationForm
def index(request):
return render(request, "Site/index.html")
def sobre(request):
return rende... | true |
4e8eebee26ad947d44e4eeff0c2788a41d1de236 | Python | taivy/PassportScanner | /server.py | UTF-8 | 2,036 | 2.734375 | 3 | [] | no_license | from PIL import Image
import numpy as np
from flask import render_template, Flask, request
from pdf2image import convert_from_bytes
import passport
import json
import traceback
app = Flask(__name__)
DEBUG = True
# Для получения результатов распознавания отправить POST запрос на uploader
# с файлом картинк... | true |
34fb137b5c927dad0df024c673379e71875f3776 | Python | Esteban-NaGa/MyST-Lab3-Equipo4 | /f_be_DispositionEffect.py | UTF-8 | 3,630 | 3.109375 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 31 21:35:44 2019
@author: Esteban
"""
import numpy as np
import pandas as pd
from datetime import datetime
import plotly.graph_objects as go #Libreria necesaria para usar plotly
#Ciclo para medir tiempo entre close time y open time manuales de tp y... | true |
306a0b7fb5955afc88419e2a862e1c767f71d639 | Python | sakshee3/Question-Answering-System | /Part2/3.py | UTF-8 | 2,589 | 2.796875 | 3 | [] | no_license | import sys
import nltk
from nltk.corpus import wordnet as wn
import re
exceptions=['match','most','was','is','were','over','started','first','?','']
ans_list=[]
# lemmalist is to compute similiar words
def lemmalist(str):
syn_set = []
for synset in wn.synsets(str):
for item in synset.lemma_names:
syn_s... | true |
eab865d35075ced192939d706a73e0d5e183b8b6 | Python | taosun-18/Python000-class01 | /Week_04/G20190343010648/week04_0648_pandas.py | UTF-8 | 657 | 3.1875 | 3 | [] | no_license | import pandas as pd
import numpy as np
df1 = pd.DataFrame(['a', 'b', 'c', 'd'])
print(df1)
df2 = pd.read_excel(r'0321.xlsx')
df2.head(10)
df2['id']
df2.groupby('id').count()
df2[( df2['id'] < 1000) & (df2['age'] < 30)]
group = ['x','y','z']
table1 = pd.DataFrame({
"id":[group[x] for x in np.random.randint(0,l... | true |
54e23f98a0f81563f13e9d9b1bc35ed738e48817 | Python | owdqa/owd_test_cases | /tests/HOMESCREEN/test_26771.py | UTF-8 | 2,550 | 2.546875 | 3 | [] | no_license | #===============================================================================
# 26771: Launch a intallation doing a long-tap on any app shown
# by everything.me and press Yes button
#
# Procedure:
# 1- Open everything.me
# 2- open a category or search by text
# 3- do a long-tap on any app shown by everything.me
# ER... | true |
d15f9113a4afbca2acae29184c5a348736714290 | Python | lindo-zy/leetcode | /贪心算法/376.py | UTF-8 | 618 | 3.359375 | 3 | [] | no_license | #!/usr/bin/python3
# -*- coding:utf-8 -*-
from typing import List
class Solution:
def wiggleMaxLength(self, nums: List[int]) -> int:
if not nums:
return len(nums)
cur_diff = 0
pre_diff = 0
result = 1
for i in range(len(nums) - 1):
cur_diff = nums[i +... | true |
da2e5b1912f455d9281feb44e84f3c23c6d34a7c | Python | Aishu0708/Python-prg | /addtuple.py | UTF-8 | 80 | 2.9375 | 3 | [] | no_license | tuplex = (4, 6, 2, 8, 3, 1)
print(tuplex)
tuplex = tuplex + (9,)
print(tuplex)
| true |
dbb4d9bc8be5fa4c73c18308cfc0c3955d09895b | Python | ssehuun/langStudy | /programmers/12925.py | UTF-8 | 848 | 4.09375 | 4 | [] | no_license | """
https://programmers.co.kr/learn/courses/30/lessons/12925
연습문제 > 문자열을 정수로 바꾸기
- 제한조건
s의 길이는 1 이상 5이하입니다.
s의 맨앞에는 부호(+, -)가 올 수 있습니다.
s는 부호와 숫자로만 이루어져있습니다.
s는 "0"으로 시작하지 않습니다.
- 입출력예
예를들어 str이 "1234"이면 1234를 반환하고, "-1234"이면 -1234를 반환하면 됩니다.
str은 부호(+,-)와 숫자로만 구성되어 있고, 잘못된 값이 입력되는 경우는 없습니다.
"""
""" 맞은 내풀이"""
def so... | true |
a17a7571b3a0412111df61051cbda470a58703d2 | Python | reeds-git/CS-450-Machine-Learning | /DecisionTree/Main.py | UTF-8 | 4,826 | 3.25 | 3 | [] | no_license | import numpy as np
import ReadFile as rf
from sklearn.cross_validation import train_test_split as split
from sklearn import preprocessing as prep
import NodeClass as aNode
def get_test_size():
"""
prompt user for test size and random state
:return: return a test size from 0.0 to 0.5
"""
test_size =... | true |
32228422c08d358edea738f1a2ea14920af005f8 | Python | CrovaS/Material-processor | /text_module.py | UTF-8 | 4,232 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | import os
import PyPDF2
from pptx import Presentation
def pdf_ppt_extraction(directory):
try:
directory = directory + "/"
# find all pdfs to convert
for filename in os.listdir(directory + "pdf/"):
if filename.endswith(".pdf"):
directory_pdf = directo... | true |
891a87898c86924ecf28f2f7c3e933f2bd5b7cb5 | Python | edawson/BioSandbox | /filter_vcf.py | UTF-8 | 2,831 | 2.96875 | 3 | [] | no_license | import sys
## A script used to filter
## a SNP VCF file and correct
## for some oddities in Varscan output.
## Eric T Dawson
## Texas Advanced Computing Center
## November 2013
snp = {}
header = []
def load_file(infile):
global snp
global header
with open(infile, "r") as snp_file:
for line in sn... | true |
747119e5e7b9d85b4360a1f923dc3dce13aee7ad | Python | Sasi5526/apriori | /app.py | UTF-8 | 964 | 2.703125 | 3 | [] | no_license | from flask import Flask,render_template,url_for,request
import pandas as pd
import pickle
import apyori
# load the model from disk
filename = 'apriori_model.pkl'
model = pickle.load(open(filename, 'rb'))
app = Flask(__name__)
def get_recommendations(title):
data = (title)
return_df = model[~model['... | true |
552e21933d5ffb30d076c82a46c823e9e81740f0 | Python | MayankShrivastava17/lyrically | /app.py | UTF-8 | 1,838 | 3.15625 | 3 | [
"MIT"
] | permissive | # Created :: Mayank Shrivastava
# Using flask as backend
from flask import Flask, request, render_template
from azlyrics.azlyrics import lyrics
# Using Genius API
import lyricsgenius as lg
import config
app = Flask(__name__)
@app.route('/')
def index():
# Rendering Home-Page
return render_templa... | true |
b96a96e1cef13755443a250a4ebc46087b4cb074 | Python | atomandspace/firstpygui | /hello_gui.py | UTF-8 | 1,144 | 3.546875 | 4 | [] | no_license | # import everything from Tkinter
from Tkinter import *
# create a class "Application"
class Application(Frame):
# response when say_hi function is called upon
def say_hi(self):
print "Hello world!"
# create Widegets
def createWidgets(self):
# create QUIT Button
self.QUIT = Butt... | true |
f0ddffe494e92b9e090526cb61836a5149d8b88c | Python | dmourainatel/Pyrates-projects | /Diego Moura/API's REST com Python/PegaTemperatura.py | UTF-8 | 606 | 3.4375 | 3 | [] | no_license | import requests,json
op = 1
while(op == 1): #main
cidade = input('Entre com a cidade:')
siglaPais = input('Entre com o pais:')
uri = 'http://api.openweathermap.org/data/2.5/weather?q=%s,%s'%(cidade, siglaPais)
resposta = requests.get(uri)
informacoes = json.loads(resposta.text)
temperat... | true |
3bc99024d7211d648e09b38f369dd255522bd2a3 | Python | kolaSamuel/CodeChef | /Chef and Pick Digit.py | UTF-8 | 444 | 2.6875 | 3 | [] | no_license | from collections import Counter
from itertools import permutations
for _ in xrange(input()):
n = raw_input()
_A = Counter([int(x) for x in n])
A = []
for x in _A:
A.append(x)
if _A[x]-1:A.append(x)
A.sort()
result = []
for i,j in permutations(A,2):
val = int(str(i)+st... | true |
203266cc86c6e1223da287aae6636dc538ad5554 | Python | rafaelperazzo/programacao-web | /moodledata/vpl_data/448/usersdata/316/109744/submittedfiles/matriz1.py | UTF-8 | 340 | 3.625 | 4 | [] | no_license | # -*- coding: utf-8 -*-
nl=int(input('Digite o numero de linhas: '))
nc=int(input('Digite o numero de colunas: '))
h=[]
for i in range(0,nl,1):
c=[]
for j in range(0,nc,1):
c.append(int(float(input('digite o valor do elemento'))))
h.append(c[::-1])
inv=[]
o=len(h)-1
while o>=0:
inv.append(h[o])
... | true |
e62193893424af22378f8ce1c15e2ecc831b613c | Python | haoericliu/haoliu | /tigress/tigress/tigress/libs/utils.py | UTF-8 | 1,266 | 2.625 | 3 | [] | no_license | import re
import random
from string import letters
import hashlib
import functools
from tigress.libs.errors import UnauthorizedError
USER_RE = re.compile(r"^[a-zA-Z0-9_-]{3,20}$")
def valid_username(username):
return username and USER_RE.match(username)
PASS_RE = re.compile(r"^.{3,20}$")
def valid_password(password... | true |
6d5553117c56af0310e6b345f288fcc983bf838c | Python | barbarossia/busface | /busface/spider/db.py | UTF-8 | 10,769 | 2.671875 | 3 | [
"MIT"
] | permissive | '''
persist data to db
'''
from datetime import date
import datetime
import operator
from functools import reduce
import json
from peewee import *
from enum import IntEnum
from busface.util import logger, get_data_path, format_datetime, get_now_time, get_full_url
DB_FILE = 'bus.db'
db = SqliteDatabase(get_data_path(DB... | true |
ebc529ff2b902f261c6458dcb15aa0e523bd11c9 | Python | RuMaxwell/whitespace-interpreter | /entrance.py | UTF-8 | 2,700 | 2.8125 | 3 | [] | no_license | from sys import argv
from storage import *
from interpret import *
from io import *
from platform import system
if system() == 'Windows':
import win_unicode_console
win_unicode_console.enable()
# Stack used in the interpreter
main_stack = Stack()
# Heap storage used in the interpreter
main_heaps = Heaps()
t... | true |
4f68c01d5dbad489d70d82f8098bf239fa81d4be | Python | GitYangshanglin/spartan2 | /spartan/util/ioutil.py | UTF-8 | 15,170 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : ioutil.py
@Desc : Input and output data function.
'''
# here put the import lib
import gzip
import os
import sys
import pandas as pd
import numpy as np
from . import TensorData
import csv
from .basicutil import set_trace
class File():
def __... | true |
f229d5b05c06907b810b3935db0148f5dd58edbd | Python | lingxiao26/cloudwatch | /cloudwatch/metric/cw_space.py | UTF-8 | 1,935 | 2.546875 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import boto3
import ssl
from datetime import datetime, timedelta
class CWSpace(object):
def __init__(self, profile, namespace, region='us-east-1'):
self.namespace = namespace
self.profile = profile
self.session = boto3.Session(profile_name=... | true |
a4401d949460ff48c77f90cfe945746c0939d48a | Python | valentin-stamate/Photo-Date-Taken-Script | /main.py | UTF-8 | 1,424 | 3.046875 | 3 | [] | no_license | import os
from datetime import datetime
import piexif
from scripts.date_and_time import date_list_to_str, filename_to_datetime
def change_metadata(path, date_time):
file_name = os.path.basename(path)
exif_dict = piexif.load(path)
date_time_str = date_time.strftime("%Y:%m:%d %H:%M:%S")
exif_dict['0... | true |
50d0e647eb1adcdf53dc8fb444ae6eccd7874637 | Python | RichieSjt/ITC | /Fourth-semester/Analysis and design of algorithms/Class activities/Greedy/policemen_thieves.py | UTF-8 | 401 | 3.453125 | 3 | [] | no_license | def policemenAndThieves(pt, k):
n = len(pt)
police = 0
thief = 0
catches = 0
for i in range(n):
while pt[police] != 'P':
police += 1
while pt[thief] != 'T':
thief += 1
if abs(police-thief) <= k:
catches += 1
return catches
pt = ['P', ... | true |
d6664b1337ec46a6902e6a25df87cb9d199636b7 | Python | jlundholm/RaspPi | /ESP4T-2021/37_sensor_kit_code/AnalogSound_gpiozero.py | UTF-8 | 1,182 | 3.8125 | 4 | [] | no_license | '''
For finding the relationship between ADC and Decibels,
we used the following website as a reference:
https://circuitdigest.com/microcontroller-projects/arduino-sound-level-measurement
'''
#Import the MCP3008 module from the gpiozero library
from gpiozero import MCP3008
#Import the sleep function from ti... | true |
530acd797682d94af3e76322998b9522dbf48782 | Python | hernbrem/TYK2CodeAAA | /Udemy_code/code/s02/Challenge1_ColorSpiral10.py | UTF-8 | 327 | 3.859375 | 4 | [] | no_license | import turtle
t = turtle.Pen()
turtle.bgcolor("black")
t.speed(0)
sides = 10
colors = ["red", "yellow", "blue", "orange", "green",
"purple", "gray", "white", "pink", "light blue"]
for x in range(360):
t.pencolor(colors[x%sides])
t.forward(x * 3 / sides + x)
t.left(360/sides + 1)
t.width(x*side... | true |
b3bf5859f8207285552dbf5a5c64ea230ab5759f | Python | prbbing/StandAloneTools | /python/getParameters.py | UTF-8 | 1,277 | 2.671875 | 3 | [] | no_license | #!/usr/bin/env python
import os,sys
import PyPDF2
for version in range(0,100):
if os.path.isfile('v'+ str(version) + '/Output/all.pdf'):
pdf_file = open('v'+ str(version) + '/Output/all.pdf')
read_pdf = PyPDF2.PdfFileReader(pdf_file)
number_of_pages = read_pdf.getNumPages()
page = read_pdf.getPage(2)... | true |
9dad75fe30f16a9f34edb80837fe764d6f737baf | Python | alclass/bin | /renameTwoFirstNumbers.py | UTF-8 | 3,706 | 3.5625 | 4 | [] | no_license | #!/usr/bin/env python3
'''
This rename script is useful for renaming files
with 2 numbers at the beginning separated by
spaces and periods (and other characters)
and reorganizes them like [[n-m]]
ie the two numbers being separated by a '-' (dash).
Eg. ' 3 . 10 bla.mp4' renames to '3-10 bla.mp4'
-----------------------... | true |
08b7dc9768000a59a4f5fbc1be2ed6032839b7f1 | Python | hjiang00/CS263-Python-Comparison | /Week 7/Script/fibonacci.py | UTF-8 | 652 | 2.6875 | 3 | [] | no_license | import sys
# from memory_profiler import profile
# from guppy import hpy
# hxx = hpy()
# heap = hxx.heap()
# byrcs = hxx.heap().byrcs;
def powLF(n):
if n == 1:
return (1, 1)
L, F = powLF(n//2)
L, F = (L**2 + 5*F**2) >> 1, L*F
if n & 1:
return ((L + 5*F) >> 1, (L + F) >> 1)
else:
... | true |
c02dc5d030a037899197167960b5ead9400b6c59 | Python | ekapujiw2002/pytermgui | /pytermgui/input.py | UTF-8 | 6,893 | 2.6875 | 3 | [] | no_license | """
pytermgui.input
---------------
author: bczsalba
File providing the getch() function to easily read character inputs.
credits:
- original getch implementation: Danny Yoo (https://code.activestate.com/recipes/134892)
- modern additions & idea: kcsaff (https://github.com/kcsaff/getkey)
"""
# pylint doesn't ... | true |
55143e7fd22e798946f94dea20eb15adfa3ff621 | Python | dbwz8/aiidalab-registry | /src/app_registry/config.py | UTF-8 | 2,307 | 2.6875 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""Data classes and functions related to the app registry configuration.
An app registry can optionally be managed with a configuration file.
"""
from collections.abc import Mapping
from dataclasses import dataclass
from dataclasses import field
from pathlib import Path
from typing import Unio... | true |
f668e3eee387db8b31faa67b87e620f8e79778ba | Python | alwayschasing/sentence_similar | /create_data.py | UTF-8 | 4,437 | 2.71875 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import tensorflow as tf
import random
import jieba
import tokenization
flags=tf.flags
FLAGS=flags.FLAGS
flags.DEFINE_string("raw_data_file",None,
"raw train data file")
flags.DEFINE_string("train_data_file",None,
"train data file")
... | true |
b8c78ceb88ecf1823bbb40adaed2319ec06d40ab | Python | vitateje/impacta | /LP I/LP1-AC6.py | UTF-8 | 2,801 | 3.03125 | 3 | [] | no_license | '''
════════════════════════════════════════════════════════════════════════════════
Instituição : Faculdade Impacta Tecnologia
Curso : Análise e Desenvolvimento de Sistemas
Disciplina : Linguagem de Programação 1
Turma : 1B (noite)
Professor : Lucio Nunes de Lira
Aluno (1) :
Aluno (2... | true |
01a5a4741f3520592d6eb2a060de8697d161a8f9 | Python | vkpanchal/helloworld | /04-04-2020/self/while.py | UTF-8 | 912 | 4.125 | 4 | [] | no_license |
cnt=1
while cnt<100:
print(cnt, "This is inside while loop")
cnt+=1
else:
print(cnt, "this is outside while loop")
############################################################
# Display even Number
x=1
while x<=100:
if x%2==0:
print("Even Number is ", x)
x+=1
# Odd Number
y=1
while y<=100:
if y%2>0:
print... | true |
357524047db2bd93389522cbb20ccfa3ac69b6bb | Python | tierpod/pyosm | /pyosmkit/tile.py | UTF-8 | 2,119 | 3.375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python
"""Provides tile description based on OSM filename convention:
https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
"""
import os.path
import re
TILE_URL_RE = re.compile(r"(\w+)/(\d+)/(\d+)/(\d+)(\.\w+)")
class Tile(object):
"""Attributes:
z, x, y (int): zoom, x, y coordinates
... | true |
b5aa5f5d2d74429cc94be5215560eb2e43b4aa2f | Python | MehrdadJannesar/SQLite3_Mapsa | /Server.py | UTF-8 | 368 | 2.578125 | 3 | [] | no_license | import socket
import time
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock_ip = "localhost"
sock_port = 7000
# server_time = time.ctime()
sock.bind((sock_ip, sock_port))
sock.listen(10)
while True:
server_time = time.ctime()
c, addr = sock.accept()
print("one client connected!!")
c.sen... | true |
50e108ac0aaae5eb45ea99ac8fbf0d34c046939b | Python | vincent732/hw3 | /main.py | UTF-8 | 3,043 | 2.6875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from utils import read_input
import numpy as np
from sklearn.cross_validation import StratifiedShuffleSplit
from sklearn.cross_validation import cross_val_score
from sklearn.model_selection import RandomizedSearchCV
from Classifier import Classifier, build_model
from pandas import DataFrame
de... | true |
012ff1fbebc12d33af737705aba76e5a2a3353fe | Python | Donggeun-Lim3/ICS3U-Assignment-4B-Python | /weekday.py | UTF-8 | 845 | 4.0625 | 4 | [] | no_license | #!/usr/bin/env python3
# Created by Donggeun Lim
# Created on December 2020
# This is weekday program
def main():
weekday_string = input("Enter the number of weekday : ")
print("")
try:
weekday_number = int(weekday_string)
if weekday_number == 1:
print("Monday")
elif ... | true |
fdd6b9007467471217a023b7a793cc6a85976c28 | Python | anvesh2502/Leetcode | /Maximum_Sub_Array.py | UTF-8 | 708 | 2.734375 | 3 | [] | no_license | public class Solution {
public int maxSubArray(int[] nums)
{
int max_array_sum=0,max_ending=0;
boolean negFlag=false;
if(nums.length==1)
return nums[0];
for(int a : nums)
{
if(a>0)
{
negFlag=true;
break;
}
}
if(!negFlag)
{
int min=-999... | true |
5d9b9fe85f9d0fa9a2933b2a645c0d1415ae3f87 | Python | Subhasishbasak/saferGPMLE | /pkgcomp/pythongp/wrappers/openturns_wrapper.py | UTF-8 | 4,223 | 2.890625 | 3 | [
"BSD-3-Clause"
] | permissive | '''
Wrapper functions
Author: S.B
Description: The following code contains the necessary wrapper functions
which implements Gaussian Process regression the OpenTURNS library
'''
import openturns as ot
import numpy as np
import math
class openturns_wrapper():
def __init__(self):
# library... | true |
560b9d7f95349c2bbb87af32ac3edff6b5b3fba8 | Python | saschapojot/nwave | /solveF.py | UTF-8 | 1,877 | 2.734375 | 3 | [] | no_license | from consts import *
import pandas as pd
import matplotlib.pyplot as plt
inFileName = "./preciseHPrime/hp" + sng + "d" + str(d) + "p" + str(p) + ".csv"
inDat = pd.read_csv(inFileName)
rowN = 2
hp0Val = inDat.iloc[rowN, 1]
alpha = 1 / 2 * (p * (d - 1) - 2)
xExpon = 2 * alpha - 2
N = 10000
dx = 1 / N
def P(x, f, m):
... | true |
9d358b697e7a7183ec8e528cfd55f9799757bdd4 | Python | dream1986/lilac | /lilac/parser.py | UTF-8 | 3,687 | 3.015625 | 3 | [
"MIT"
] | permissive | # coding=utf8
"""this module provides a parser to parse post's source to post instance"""
from . import charset
from .models import Post
from .exceptions import *
from datetime import datetime
import toml
import misaka
import houdini
from misaka import HtmlRenderer, SmartyPants
from pygments import highlight
from ... | true |
1340b49c149eabbb88cbefa58244bd5393c72719 | Python | trygveaa/python-tunigo | /tunigo/cache.py | UTF-8 | 756 | 3.09375 | 3 | [
"Apache-2.0",
"Python-2.0"
] | permissive | from __future__ import unicode_literals
import time
class Cache(object):
def __init__(self, cache_time):
self._cache = {}
self._cache_time = cache_time
def __repr__(self):
return 'Cache(cache_time={})'.format(self._cache_time)
def _cache_valid(self, key):
return (key in... | true |
ab78ea22e6da359d5721449ccccfb1305897f75c | Python | Natalia-oli/praticas-turma-VamoAI | /ilha.py | UTF-8 | 487 | 4.0625 | 4 | [] | no_license | intem1 = input("Digite o primeiro item que levaria para uma ilha")
intem2 = input("Digite o segundo item que levaria para uma ilha:")
intem3 = input("Digite o terceiro item que levaria para uma ilha:")
print("voce levaria para uma ilha deserta:",intem1, intem2,intem3)
animal1 = input("Qual animal gostaria de ser?"... | true |
a4f9e1dfdcf7e3caa4215d3ec51e5cb27b719cfc | Python | benwatson528/advent-of-code-20 | /main/day15/rambunctious_recitation.py | UTF-8 | 509 | 3.203125 | 3 | [] | no_license | from collections import defaultdict
from typing import List
def solve(nums: List[int], end_turn: int) -> int:
tracker = defaultdict(list)
for turn in range(len(nums)):
tracker[nums[turn]].append(turn + 1)
last_num = nums[-1]
for turn in range(len(nums) + 1, end_turn + 1):
if len(trac... | true |
8f2ff2222895c36f73ea10b0e0f08ab373691f8d | Python | Camomilaa/Python-Curso-em-Video | /ex089.py | UTF-8 | 716 | 3.65625 | 4 | [] | no_license | al = []
sal = []
c = num = 0
while True:
al.append(str(input('Insira o nome do aluno: ')))
al.append(float(input('Insira nota 1: ')))
al.append(float(input('Insira nota 2: ')))
al.append(c)
c += 1
sal.append(al[:])
al.clear()
cont = str(input('Deseja adicionar mais? [S/N] ')).upper()
... | true |
68ccc6e18cdd2570945716b25e390bb74daefd29 | Python | bordaigorl/sublime-markdown-editing | /distraction_free_mode.py | UTF-8 | 1,128 | 2.703125 | 3 | [
"MIT"
] | permissive | """
This file contains some "distraction free" mode improvements. However they can be
used in normal mode, too. These features can be enabled/disabled via settings files.
In order to target "distraction free" mode, FullScreenStatus plugin must be installed:
https://github.com/maliayas/SublimeText_FullSc... | true |
62722faad9514df261b97321e0831ae532f860ed | Python | tonzowonzo/GISproject | /create_image_stacks.py | UTF-8 | 6,552 | 3.234375 | 3 | [] | no_license | # Create image stacks with April, June and August imagery.
# Randomly match all months values to create a large dataset (in order).
# Import libraries.
import os
import numpy as np
import cv2
import pandas as pd
import matplotlib.pyplot as plt
from get_label import get_label
# Landsats.
landsats = [5, 7, 8]... | true |
daa8841ef5c5f5c977381c08495b4c083372f804 | Python | gtu001/gtu-test-code | /PythonGtu/gtu/openpyxl_test/ex1/janna/excel_test_rpt_36.py | UTF-8 | 4,641 | 2.6875 | 3 | [] | no_license |
import csv
from inspect import getmembers
import openpyxl
from openpyxl.workbook.workbook import Workbook
from gtu.io import fileUtil
from gtu.openpyxl_test.ex1.janna.excel_test_rpt_37 import RegionDefEnum, TaoRecac
from gtu.reflect import checkSelf
HAS_G8_TAO = False # 是否是103年以前(不含)的資料
rowIdMappin... | true |
42807af66ffb9b59ee409424794d683ca930b883 | Python | ryland-mortlock/biof309 | /in_class/class_notes_20200406.py | UTF-8 | 3,054 | 4.40625 | 4 | [] | no_license | # Implementing fizz buzz
# Replaces numbers divisible by 3 with fizz
# Replaces numbers divisible by 5 with buzz
# Replaces numbers divisible by 3 and 5 as fizzbuzz
# New function to do fizzbuzz
def our_fizz_buzz(my_range) :
"""Takes a range of number and prints the numbers replaced by fizz if the number is divisi... | true |
293b93c91518f1711c31aa33968cfd399358c455 | Python | whojayantkumar/learn-complete-python-in-simple-way | /Modules/mymath.py | UTF-8 | 215 | 3.09375 | 3 | [] | no_license | x=888
y=999
def add(a,b):
print('Module mymath')
print('The Sum: ',a+b)
def product(a,b):
print('The product: ',a*b)
def sub(a,b):
print('The subtraction: ',a-b)
print('Module Name: ',__name__)
| true |
120f01f35e790ba8fd4c6ed9d807ea6493c42b19 | Python | numpy/numpy | /numpy/typing/tests/data/fail/array_like.pyi | UTF-8 | 455 | 3.015625 | 3 | [
"Zlib",
"BSD-3-Clause",
"MIT",
"Apache-2.0"
] | permissive | import numpy as np
from numpy._typing import ArrayLike
class A:
pass
x1: ArrayLike = (i for i in range(10)) # E: Incompatible types in assignment
x2: ArrayLike = A() # E: Incompatible types in assignment
x3: ArrayLike = {1: "foo", 2: "bar"} # E: Incompatible types in assignment
scalar = np.int64(1)
scalar._... | true |
ddab8f7b9df9af8e446f5b3e833342cd55aebdd6 | Python | ameeno/Submission-notifier | /notify_script.py | UTF-8 | 4,426 | 2.890625 | 3 | [] | no_license | import time
import praw
# Enter your main account's username here (the one that will recieve the notifications).
main_acc = 'USERNAME'
# Enter your second Reddit account username and password here. Make sure this second account has at least 3 link karma or it will not work.
second_acc = 'USERNAME'
second_acc_... | true |
f9c1fddaef68245478abf41cf097a70d80deb829 | Python | dogcomplex/projecteuler | /src/lvitourneynums.py | UTF-8 | 274 | 3.25 | 3 | [] | no_license | '''
Created on Jul 18, 2011
@author: W
'''
lowercut = 20
uppercut = 50
for k in range(2,8):
print k, 'rounds:'
for i in range(k+1):
s = 2**i * 3**(k-i)
if lowercut < s < uppercut:
print s, i, 'rounds of 2,', k-i, 'rounds of 3'
print | true |
fcd1115056121987ec00b8d569f14924ff81a3ac | Python | elisamussumeci/TCC | /cluster_analysis.py | UTF-8 | 2,101 | 2.71875 | 3 | [] | no_license | from sklearn.cluster import AffinityPropagation, DBSCAN, AgglomerativeClustering, MiniBatchKMeans
def cluster_vectors(docvs, method='DBS'):
print("Calculating Clusters.")
X = docvs
if method == 'AP':
af = AffinityPropagation(copy=False).fit(X)
cluster_centers_indices = af.cluster_centers_i... | true |
1210926381abd3b1c7b70f01a640c7c2de339cdd | Python | pythonCore24062021/TA | /HW/HW06_akaia/tests/test_login_page.py | UTF-8 | 1,455 | 2.953125 | 3 | [] | no_license | """
Tests related to Login functionality
"""
import unittest
from selenium import webdriver
from HW.HW06_akaia.pages.home_page import HomePage
from utils.data_manager import Credentials
"""Getting test data from google sheet"""
credentials = Credentials("1rr1dzPSwa6qx6jarzbtXdWBSg5DsNsknmn2dWckmnvk")
email = credenti... | true |
01ee3d535861e4d1a6d8c9964f57a0874b68252c | Python | rlatmd0829/algorithm | /알고리즘풀이/21.06.28/단지번호.py | UTF-8 | 93 | 2.5625 | 3 | [] | no_license | n = int(input())
graph = [list(map(int,input())) for _ in range(n)]
print(graph)
#def dfs():
| true |
ee218528fd75b87729b3985d72e75a8bd4a5b19f | Python | AbtinDjavadifar/Hackerearth | /Trailing_Zeros_in_Factorial.py | UTF-8 | 671 | 3.234375 | 3 | [] | no_license | T = int(input())
for _ in range(T):
M = int(input())
i = 0
up = 0
while M >= up:
i += 1
up += 5**i - 1
if M == up:
ans = 5**i - 5
print(ans, ans + 1, ans + 2, ans + 3 , ans + 4)
break
fives = up - (5**i - 1) + i
diff = M - fives
compensate = 0
... | true |
e5702994a7d9b664f375aae9ad9ae433eaec35ed | Python | GongFuXiong/leetcode | /old/t20190906_huiwen/huiwen.py | UTF-8 | 1,766 | 3.390625 | 3 | [] | no_license | #!/usr/bin/env python
# encoding: utf-8
'''
@author: KM
@license: (C) Copyright 2013-2017, Node Supply Chain Manager Corporation Limited.
@contact: yangkm601@gmail.com
@software: garner
@time: 2019/9/06
@url:https://leetcode-cn.com/problems/add-binary/
@desc:
请判断一个链表是否为回文链表
输入: 1->2->2->1 输出: True
输入
数... | true |
ea214b2d58dfa00410c35476a40624a73ae54bb0 | Python | urumican/AutoEncoder | /autoEncoderPretraining.py | UTF-8 | 2,280 | 2.515625 | 3 | [] | no_license | # Train the autoencoder
# Source: https://github.com/fchollet/keras/issues/358
from keras.layers import containers
import keras
from keras.models import Sequential
from keras.layers.core import Dense, Flatten, AutoEncoder, Dropout
from keras.optimizers import SGD
from keras.utils import np_utils
random.seed(3)
np.rand... | true |
ac5919e963af469139e7626960839c59b22d5655 | Python | abbindustrigymnasium/python-kompendium-abbnilbor | /Kapitel 5/5.1.py | UTF-8 | 826 | 3.078125 | 3 | [] | no_license | a=input("Ange kön: ")
b=input("Ange hårfärg: ")
c=input("Ange ögonfärg: ")
Daniel_Radcliffe=["Daniel Radcliffe", "man","brun","brun"]
Rupert_Grint=["Rupert Grint", "man","brun","brun"]
Emma_Watson=["Emma Watson", "kvinna", "brun", "brun"]
Selena_Gomez=["Selena Gomez", "kvinna", "brun","brun"]
Khetdan_Phopat=["... | true |
05748b89ef6e4523b686f7b94e3b1ede2c313d65 | Python | Danielle-Huber/CPSC322FinalProject | /mysklearn/plot_utils.py | UTF-8 | 5,204 | 3.609375 | 4 | [] | no_license | import matplotlib.pyplot as plt
import numpy as np
def compute_slope_intercept(x, y):
""" computes the slope and y intersept of the passed in x and y variables
Args:
x: (list) x variables
y: (list) y variables
Returns:
m: (float) slope
b: (float) y intersept
... | true |
898b5ea2c9e7d77c286faf41dc7f2fa3a32bfcef | Python | tejasgondaliya5/advance-python-for-me | /Nested_class.py | UTF-8 | 1,173 | 4 | 4 | [] | no_license | class School:
# outer class constructor
def __init__(self):
self.sname = "Dharti vidhaya vihar"
# create inner class object create
self.obj1 = self.Teacher()
# outer class method
def show(self):
print("school name is :", self.sname)
# create inner class
... | true |
b9a4e26121c9f8dd30ec76b0163b2eb7109e06bd | Python | LeenaKH123/Python2 | /03_file-input-output/file-counter/analyze.py | UTF-8 | 334 | 3.5 | 4 | [] | no_license | # Use the `csv` module to read in and count the different file types.
# import CSV
# With open(‘some.csv’, ‘rb’) as f:
# reader = csv.reader(f)
# for row in reader:
# print row
import csv
with open("03_file-input-output/file-counter/filecounts.csv") as f:
reader = csv.reader(f)
for row in reader:
print... | true |
6235226ac25a0ec8eea89ede76329a8afa90a790 | Python | Huqicheng/Symbolic-Auto-Differentiation-Executer | /qnet/autodiff/ops/op.py | UTF-8 | 1,177 | 3 | 3 | [] | no_license | from qnet.autodiff.core import *
class Op(object):
"""Op represents operations performed on nodes."""
def __call__(self):
"""Create a new node and associate the op object with the node.
Returns
-------
The new node object.
"""
new_node = Node()
n... | true |
3304a22ec03b30ec604691fe73d46ecb40a35ecd | Python | vin003/Web-Application-Development-usning-Flask-and-Python | /main.py | UTF-8 | 3,250 | 2.515625 | 3 | [] | no_license | from flask import request
import datetime , json
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
from flask_mail import Mail
# from flask_mysqldb import MySQL
# using flaskmail to send email to our email id as well
app=Flask(__name__)
with open("config.json" ,'r') as c :
params... | true |
4a501fca65c0ee5b7f7a215f098aa489ea12670c | Python | PBarmby-teaching/GH-review-demo | /gal_radii_pb.py | UTF-8 | 2,556 | 2.640625 | 3 | [] | no_license | from astropy.coordinates import SkyCoord, Distance, Angle
from astropy import units as u
import numpy as np
def correct_rgc(coord, glx_ctr=SkyCoord('00h42m44.33s +41d16m07.5s', frame='icrs'),
glx_PA=Angle('37d42m54s'),
glx_incl=Angle('77.5d'),
glx_dist=Distance(783, unit=u.kpc),
deproj... | true |
46ab775b268b441631ac3430a506d710c68499be | Python | CoryOwens/FibonacciPy | /fibserver.py | UTF-8 | 2,274 | 2.921875 | 3 | [] | no_license | #!/usr/bin/python
from functools import lru_cache
import socket
import sys
import threading
import time
import fib
import socketutils
verbose = False;
if len(sys.argv) > 1 and (sys.argv[1] == '-v' or sys.argv[1] == '-V'):
verbose = True;
@lru_cache(maxsize=256)
def cachedFib(n):
return fib.fib(n);
class ... | true |
055358dd1611cff9e838105bd6d32235639cd04d | Python | yian2271368/exc | /exc/CW1/7/reducer.py | UTF-8 | 612 | 2.875 | 3 | [] | no_license | #!/usr/bin/python
import sys
prev=''
lst1=[]
def prt(studentid,lst1):
print studentid, '-->',
for (k,v) in lst1:
print ("(%s,%s)"%(k,v)),
print
for line in sys.stdin:
line=line.strip().split()
if line[0]==prev:
if len(line) == 2:
studentid = line[1]
if len(line)... | true |
aa4c21cbc75e5870738906f6c1d36f76df0e3633 | Python | mikiyaK/feedforwardnet | /ffnn.py | UTF-8 | 12,693 | 2.828125 | 3 | [] | no_license | #ffnn.py
from __future__ import print_function #for using python3's print_function in python2
import time
import random
import numpy as np
import scipy.stats as stats
import sys
from sklearn.datasets import fetch_mldata
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
def cross_entr... | true |
a2823d1d89fb1c350d4e2e960ecc86e76792d52e | Python | davidesartori/Tasklog_agent | /tasklog_agent.py | UTF-8 | 2,197 | 2.921875 | 3 | [] | no_license | #!/usr/bin/python
# -*- coding: utf-8 -*-
import mysql.connector
import datetime
import time
__author__ = "Sartori Davide"
__version__ = "1.0"
def get_conf():
""" returns the configuration from the given file """
filename = "tasklog_agent.conf"
parameters = ["db_username", "db_password", "db_host", "da... | true |
913b1f610b1aaf137f29e2383aa0b62ebcc729f3 | Python | gianscarpe/unimib | /VIPM/labs/lab3/main.py | UTF-8 | 3,252 | 2.921875 | 3 | [
"MIT"
] | permissive | import cv2
from matplotlib import pyplot as plt
import math
import numpy as np
eps = np.finfo(float).eps
coudble = 1 / math.log10(1 + 1)
def get_scaling_factors(im):
R = im[:, :, 0] + eps
G = im[:, :, 1] + eps
B = im[:, :, 2] + eps
den = R + G + B
return (R / den), (G / den), (B / den)
def get... | true |
b5ef437a33acadc56c111bb1de3bc00dc19b49cc | Python | SistemesInformacioTerritorial/CatalegIndicadors | /Vistes/QeLabel.py | UTF-8 | 958 | 2.859375 | 3 | [] | no_license | from QeView import QeView
from Fonts.QeFont import QeFont
from PyQt5.QtWidgets import QLabel
class QeLabel(QeView):
def __init__(self, font: QeFont, titol: str = None, tempsAct: int = None):
super().__init__(font, tempsAct)
if titol is not None:
self._lay.addWidget(QLabel(titol))
... | true |
e99897a6cdfa0c24806ab879ad290bd3a98147fc | Python | Gfz-arka/MFE-5250 | /test.py | UTF-8 | 3,013 | 2.765625 | 3 | [] | no_license | import datetime
import math
import os
import matplotlib.pyplot as plt
import time
import pandas as pd
from event import OrderEvent
from backtest import Backtest
from data import HistoricCSVDataHandler
from execution import SimulatedExecutionHandler
from portfolio import Portfolio
from Moving_average_cross_... | true |
17e07f0e25b514aaa80c4bb86b01d58964ba635d | Python | andrew-qu2000/Schoolwork | /cs1134/aq447_hw7/aq447_hw7_q3.py | UTF-8 | 697 | 2.984375 | 3 | [] | no_license | from LinkedBinaryTree import LinkedBinaryTree
def is_height_balanced(bin_tree):
def is_subtree_height_balanced(subtree_root):
if subtree_root is None:
return (True,0)
else:
left_side = is_subtree_height_balanced(subtree_root.left)
right_side = is_subtree_height_b... | true |
e850f00c790e8cfbf584cf24eb38afa1f68da8f7 | Python | AdamZhouSE/pythonHomework | /Code/CodeRecords/2965/60719/276574.py | UTF-8 | 389 | 2.875 | 3 | [] | no_license | def all_to_int(x):
for i in range(len(x)):
x[i] = int(x[i])
return x
limit = input().split(" ")
limit = all_to_int(limit)
s = input()
n = int(input())
for i in range(n):
ops = input().split(" ")
ops = all_to_int(ops)
s0 = s[ops[0]:ops[1]]
s = s[:ops[2]]+s0+s[ops[2]:]
if len(s) > li... | true |
760efe6f42018420883f96a0aed3a4d8a2bfb660 | Python | LAIjun554520/myedu-- | /day01/list.py | UTF-8 | 655 | 3.875 | 4 | [] | no_license |
intqq=50
def list_demo():
alist = [4, 'ysl', '8', 7]
print(alist)
# 通过索引访问 元素
print(alist[0])
print(alist[1])
# 倒序访问
print(alist[-1])
print(alist[-2])
# 更新列表中的元素
def list_update(alist):
alist[0] = 1
print(alist[0])
print(alist)
# 切片操作
def list_update1(alist):
# 从索引2 的... | true |
f957554d129822ecf34c8f45d71cc69f7190e808 | Python | zerynth/core-zerynth-stdlib | /examples/CAN_Auto-baudrate/main.py | UTF-8 | 1,528 | 2.578125 | 3 | [] | no_license | # CAN Auto-baudrate
# Created at 2020-02-10 16:39:24.048614
from fortebit.polaris import polaris
import can
polaris.init()
print("CAN Bus Auto-Baudrate Example")
# Initialize CAN transceiver
pinMode(polaris.internal.PIN_CAN_STANDBY, OUTPUT)
digitalWrite(polaris.internal.PIN_CAN_STANDBY, LOW)
sleep(100)... | true |
6919b3c77dd72af3e8429f04f2a2074676aa4b87 | Python | abdouglass/GWU_MSBA_Prog_for_Analytics_Fall14 | /hangman_1person.py | UTF-8 | 4,393 | 4.0625 | 4 | [] | no_license | player = raw_input("Welcome player. What is your name? ") #Initiate game, by asking who is playing
print "Hello {0}! Welcome to hangman.".format(player)
with open('G:/Programming for Analytics/HW #1/words.txt','r') as words: #import word file that will be pulled from
words = words.read().split("\n")
import rand... | true |
2d233c75ce94d2de037a211be977b9f088b66758 | Python | jabobon1/cryptography | /ciphers/substitution_cypher.py | UTF-8 | 2,123 | 3.953125 | 4 | [
"MIT"
] | permissive | import secrets
from typing import Optional
from common.base_class import BaseCipher
class SubstitutionCipher(BaseCipher):
"""
a substitution cipher is a method of encrypting in which units
of plaintext are replaced with the ciphertext, in a defined manner
"""
def __init__(self, alphabet_id: Opti... | true |
f9ed3e819e7e20174cf32e5efd4e601e9273d5be | Python | Cow-berry/telebot | /bot.py | UTF-8 | 15,078 | 2.78125 | 3 | [] | no_license | # -*- codimg: utf-8 -*-
import logging
import config # в нём лежит ваш токен
import telebot # для работы с телеграмом
import datetime # для работы со временем
import time
from pathlib import Path # для проверки существования файла
from telebot import types # для крутых клавиатур
bot = telebot.TeleBot(config.token... | true |
4d651035f70cdaf59537ca4abd08f045cb97aa9b | Python | GaneshSaiKumar/Movie_Prophecy | /data cleaning_files/ratings.py | UTF-8 | 2,658 | 2.78125 | 3 | [] | no_license | import pandas as pd
import sys
from collections import Counter
from pathlib import Path
import os
path = Path(os.getcwd()).parent;
movie_data = pd.read_csv(str(path)+'\csv_files\21century_data.csv')
# movie_data = pd.read_csv(sys.argv[1])
print(movie_data.isnull().sum())
# removing unnecessary rows from data1
num_nulls... | true |
9ebe2764abe2bb2d63e40892eaa280be111c58c6 | Python | PYROP3/pixelizer | /pixel.py | UTF-8 | 2,989 | 2.53125 | 3 | [
"MIT"
] | permissive | import numpy as np
import math
from PIL import Image, ImageDraw
import sys
import imageio
import argvParser as parser
valid_args = ['-w', '-h', '-s', '-B']
image_path = sys.argv[1]
# image_path = parser.getNextValue(sys.argv
print('Fetching image '+sys.argv[1])
current_image = imageio.imread(image_path)
# pixel_wid... | true |
64138c842df01980ca3bae3d0f0fd8a4352b84a2 | Python | fRomke/rummi | /rummi_output.py | UTF-8 | 1,884 | 2.65625 | 3 | [] | no_license | from rummi_util import placeValue
from time import time, localtime, strftime
print_to_console = False
print_to_file = False
def outputTable(table,output):
if print_to_console:
printTableToConsole(table)
if print_to_file:
printTableToFile(table, output)
def printTableToConsole(table):
if ta... | true |
812936f460104d50b69910f75039697068cf690f | Python | NikiVe/django_first_steps | /оthers/4.Functions/Ex/6. Password Validator.py | UTF-8 | 700 | 3.75 | 4 | [] | no_license | def pas_validator(password_valid):
digits = 0
is_valid = True
if not 6 <= len(password) <= 10:
is_valid = False
print("Password must be between 6 and 10 characters")
for el in password:
if not (48 <= ord(el) <= 57 or 65 <= ord(el) <= 90 or 97 <= ord(el) <= 122):
pri... | true |
14365b382ed0beb5fd3700c49064d43d960cd92d | Python | Hato0/INSAAutomaton | /FileClass.py | UTF-8 | 8,546 | 2.875 | 3 | [] | no_license | # Copyright (C) 2018 Thibaut Lompech - All Rights Reserved
# You may use, distribute and modify this code under the
# terms of the legal license, which unfortunately won't be
# written for another century.
#
# You should have received a copy of the legal license with
# this file. If not, please write to: thibaut.... | true |
d4900557da9090d9ee184108a6cac11d27834161 | Python | sawenzel/O2CodeChecker | /utility/ThinCompilationsDatabase.py | UTF-8 | 6,408 | 2.71875 | 3 | [] | no_license | #!/usr/bin/python
# A python script with the goal
# to transform a (large) compilations database
# to a smaller compilations database, given a list of source files
# that have changed (currently only supporting c++ source and header files)
# This should be useful to reduce the time spent in static code analysis by onl... | true |