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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7df8eeda8a39ff5c4c1f498c57f301263d61d3b3 | Python | lyutenkova/cost-visualization | /cost_visualization.py | UTF-8 | 3,859 | 3.109375 | 3 | [] | no_license | import pandas as pd
import numpy as np
import plotly.graph_objects as go
from plotly.subplots import make_subplots
def get_data_from_xslx(file_path):
''' Получаем данные из файла в виде DataFrame'''
df = pd.read_excel(file_path, names=['number', 'title', 'cost'])
return df
def create_ds_for_drawing():
... | true |
c9f49fe392e016d80a021181d10799f9e22d1a7b | Python | nguyenngochuy91/programming | /interview/SlidingWindow.py | UTF-8 | 3,520 | 3.796875 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun Jul 28 13:08:07 2019
@author: huyn
"""
"""
When to use:
Ordered and iterable data structure: array, string, linkedList
"""
#Given an array of unsorted intrgers and a integer target, return true if a contiguous subarrays sums up to the
#integer target. Otherwise, return... | true |
f0f79c87b53ebcc453c033c2e0057678598185d0 | Python | vietanhluu0109/hackerman0109 | /session9/part V/list2.py | UTF-8 | 235 | 2.796875 | 3 | [] | no_license | l1 = ['ST', 'BĐ', 'BTL', 'CG', 'ĐĐ', 'HBT']
l2 = [150300, 247100, 333300, 266800, 420900, 318000 ]
f = max(l2)
u = min(l2)
c = l2.index(f)
k = l2.index(u)
print("Quan co dong dan la:",l1[c], f)
print("Quan co thua dan la:",l1[k], u) | true |
318c7302813f68a018ec437901706604254c13ae | Python | gabrielavirna/python_data_structures_and_algorithms | /my_work/ch10_design_techniques_&_strategies/merge_sort_divide_and_conquer.py | UTF-8 | 2,650 | 4.4375 | 4 | [
"MIT"
] | permissive | """
Divide and conquer
-------------------
- emphasizes the need to break down a problem into smaller problems of the same type/form of the original problem.
- These subproblems are solved and combined to solve the original problem.
Implementation - 3 steps:
-> Divide: break down an entity/problem (the original proble... | true |
13a9bea8cf2eccbd55265c86d3ebe0ffbe01b23a | Python | Trash-Bud/FPRO | /Pys/Py10/Rearrange.py | UTF-8 | 161 | 2.65625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 13 21:01:08 2019
@author: Joana
"""
def rearrange(l):
return [x for x in l if x<= 0] + [x for x in l if x>0] | true |
a193b1f7410fcfdf935a90ac22e5d8ed2294f5d2 | Python | dykim822/Python | /ch09/file_read1.py | UTF-8 | 450 | 3.5625 | 4 | [] | no_license | file = open('test.txt', 'r', encoding='utf-8')
for i in file:
# print(i) 그냥 쓰면 한줄씩 띄어서 출력
print(i, end='')
file.close()
print('=====================')
file = open('test.txt', 'r', encoding='utf-8')
content = file.read()
print(content)
file.close()
print('=====================')
file = open('test.txt', 'r', enco... | true |
bfe0e210583e7517b662ce90e2478b7a45198bc2 | Python | learncn/python-learns | /180101.py | UTF-8 | 253 | 3.53125 | 4 | [] | no_license | #! python3
# mouseNow.py - Displays the mouse cursor's current position.
import pyautogui
print('Press Ctrl-C to quit.')
# Get and print the mouse coordinates.
x, y = pyautogui.position()
positionStr = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4)
| true |
713d7506faac4ec567e63706fae7cf9fe05be98d | Python | chdzq/crawldictwebapp-flask | /webapp/model/request_result.py | UTF-8 | 1,088 | 2.96875 | 3 | [] | no_license | # encoding: utf-8
class RequestResult:
def __init__(self, result=0, body = None, message = None):
self._result = result
self._body = body
self._message = message
@property
def result(self):
return self._result
@property
def body(self):
return self._body
... | true |
51fcba55741ab6000f9c27e5ce49bf5c84ac1aed | Python | 2020wangwei/1 | /scrapy_test/spiders/something.py | UTF-8 | 2,514 | 2.90625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import scrapy
class Some_spider(scrapy.Spider):
"""定义蜘蛛的类 继承scrapy Spider类"""
""" 可以直接调用
[s] scrapy scrapy module (contains scrapy.Request, scrapy.Selector, etc)
[s] crawler <scrapy.crawler.Crawler object at 0x0000025830967280>
[s] item {}
[s] requ... | true |
73ac7766f0f78a3c3c167f453dc17af5b9ab2ee2 | Python | ziggyzacks/drippy | /publisher/sensors/light.py | UTF-8 | 531 | 2.78125 | 3 | [] | no_license | import board
import busio
import adafruit_tsl2561
class Light:
def __init__(self, _i2c=None):
self.i2c = busio.I2C(board.SCL, board.SDA) or _i2c
# Create the ADC object using the I2C bus
self.light = adafruit_tsl2561.TSL2561(self.i2c)
self.light.enabled = True
# Set gain 0=... | true |
d1974bd00b1731f6e832360f0241a9d062ca8e08 | Python | ntruongan/Restaurant_reviews | /test_new_interface.py | UTF-8 | 6,063 | 2.75 | 3 | [] | no_license | from tkinter import *
from tkinter import simpledialog
import model as ANLP
class MyWindow:
def __init__(self, window, models):
self.model = models
self.window = window
self.lbl_input = Label(window, text="Customer Review")
self.txt_input = Text(window)
self.lbl_input.pla... | true |
d8480acc5fd1ff892f988e8e7fd2583adb4463d6 | Python | Arnav3-343/C2-Output | /main.py | UTF-8 | 213 | 3.25 | 3 | [] | no_license | print("Hello World,")
print("My name is Arnav Atluri")
print("I am in the Seventh Grade.")
print("My favorite color is blue.")
print(" My favorite sport is hockey.")
print("My Favorite ice cream flavour is chocolate.") | true |
f93705552b25ed1cb960a4e67a61a28470d62d8f | Python | unna97/cursor-games | /nyan.py | UTF-8 | 650 | 3.28125 | 3 | [] | no_license | """Draw a flying nyan cat."""
import curses
from pyrsistent import m, inc
# from curses import halfdelay, beep, wrapper, error as c_err
from engine import Game
class NyanGame(Game):
def __init__(self, initial_state=None):
super().__init__(m(
time=0,
color=curses.COLOR_MAGENTA,
... | true |
22445738153e5bd9ec6129a756b6c482af3b1ab4 | Python | LuanGermano/Mundo-3-Curso-em-Video-Python | /exercicios3/ex077.py | UTF-8 | 702 | 4.09375 | 4 | [
"MIT"
] | permissive | #Crie um programa que tenha uma tupla com VARIAS PALAVRAS.
# Depois disso vc deve mostrar, para cada palavra, quais sao suas vogais.
palavras = ('Olho', 'Cabeça', 'ombro', 'Joelho', 'pe', 'boca', 'nariz', 'mao', 'cotovelo', 'pescoço')
for p in palavras:
print('\n', '-=-' * 15)
print(f'A palavra {str(p).title()}... | true |
da978c3be7bade77b3e9b1e71be403896a02d450 | Python | Bhuvaneswaribai/guvi | /code kata/sumofk.py | UTF-8 | 69 | 2.65625 | 3 | [] | no_license | gety=int(input())
kp=0
for i in range(1,gety+1):
kp=kp+i
print(kp)
| true |
b3dbdc77ff1761836d32b7db52dcdc9d60e879c8 | Python | sophiefsadler/community_finding | /partition_gen.py | UTF-8 | 4,145 | 2.90625 | 3 | [] | no_license | """
Run a community finding algorithm for many runs to obtain data from which to
calculate the coassociation matrix and certain node features.
The graphs_folder input must be a folder of the structure generated by
graph_gen.py.
The parts_folder is where the partitions should be saved.
Usage:
partition_gen.py (louv... | true |
23a165fa445fc7af5f863d66141bf67a8a259ee1 | Python | pu1et/algorithm | /baekjoon/greedy/11399/11399.py | UTF-8 | 510 | 3.765625 | 4 | [] | no_license | '''
돈을 인출할 때 걸리는 시간이 이전 사람의 시간들의 누적값이 더해지므로
오름차순으로 정렬하여 각 인출시간을 더해주면 최소값이 된다.
1. 인출 시간을 오름차순 정렬한다.
2. 각 인출 시간을 더한다.
'''
n = int(input())
n_list = sorted(list(map(int, input().split(" ")))) # 인출 시간 오름차순 정렬
tmp = n_list[0]
sum = n_list[0]
# 각 인출 시간을 더함
for i in range(1,n):
tmp += n_list[i]
sum += tmp
print(sum)
| true |
95dee554e8694509ea22ade3b1660df7a01ab08f | Python | vapjunior/PDATA | /PDATA.py | UTF-8 | 10,305 | 2.59375 | 3 | [] | no_license | #!/usr/bin/env python
'''
__author__: Valdir Junior
'''
import re
from unicodedata import normalize
import csv
import requests
import pymysql
from xlsxwriter.workbook import Workbook
import datetime
import pandas as pd
import math
class SELENA:
con = None
def __init__(self):
self.con = pymysql.connect(user='ap... | true |
5748b59c69896cd9966dc4302fc65cdbcbc83b68 | Python | unsw-cse-capstone-project/capstone-project-comp3900-w17a-csyeet | /backend/src/helpers/bid.py | UTF-8 | 633 | 2.59375 | 3 | [] | no_license | from dataclasses import asdict
from typing import Optional
from sqlalchemy.orm import Session
from ..models import Bid, Listing
from ..schemas import BidResponse
def get_highest_bid(listing_id: int, session: Session) -> Optional[Bid]:
return session.query(Bid) \
.filter_by(listing_id=listing_id) \
... | true |
52489f4d427059b411696e11cb3b01fefa8a9c67 | Python | kppl/dirtycar-speechservice | /DBConnection.py | UTF-8 | 502 | 2.53125 | 3 | [] | no_license | import _mysql
def ConnectDB(host, user, password, dbName):
return _mysql.connect(host, user, password, dbName)
def InsertRating(cnx, questionID, questionText, rating, customerID):
cnx.query("INSERT INTO RATINGS (ID,col2) VALUES(col2*2,15);")
print("InsertRating in DB succeeded");
def InsertKeyPh... | true |
42d1d4b61b74e5f85207f4baa17cf1117ca92993 | Python | cnheider/warg | /warg/os_utilities/platform_selection.py | UTF-8 | 2,849 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Christian Heider Nielsen"
__doc__ = r"""
Created on 04-01-2021
"""
import enum
import sys
__all__ = [
"get_backend_module",
"is_py3",
"get_system",
# "set_system",
"SystemEnum",
]
from types import ModuleType
if... | true |
58b2c65534b8ccaca6a5806ea46b11d017d266dd | Python | Quotion/ProjectKate | /functions/helper.py | UTF-8 | 1,321 | 3 | 3 | [] | no_license | import random
async def random_win():
win = random.randint(0, 1)
if win == 0:
if random.randint(0, 2) == 0:
return random.randrange(20000, 120000, 10000), 0
else:
return random.randrange(1000, 2200, 200), 0
else:
if random.randint(0, 2) == 0:
... | true |
b02d174d43b5d726bcb1bda099d66f759c5b8115 | Python | nobodysshadow/HangmanGame | /Python/Lib/library_start.py | UTF-8 | 3,894 | 3.640625 | 4 | [] | no_license | """
[library_start.py] from the HangmanGame
Defines the function of GW for the game
HANGMAN_PICS Definition of the Definition of the hangman pictures
getRandomWord(length) Word selection function that return the to word to guess
displayBoard(missedLetter,wordStatus): Function that displays the game status... | true |
9078f13e0a799f38f69e932ffcbd61a6a7c74eb1 | Python | dr-dos-ok/Code_Jam_Webscraper | /solutions_python/Problem_116/2663.py | UTF-8 | 1,633 | 3.25 | 3 | [] | no_license | import sys
str_xo = ["Draw", "X won", "O won"]
str_not = "Game has not completed"
board_size = 4
def determine(l):
# 0: None
# 1: X wins
# 2: O wins
x = l.count('X')
o = l.count('O')
t = l.count('T')
if x + t == board_size:
return 1
if o + t == board_size:
... | true |
5e6387ab4fb563ec393cddfeb8060579052dab9f | Python | renatodev95/Python | /aprendizado/curso_em_video/desafios/desafio095.py | UTF-8 | 1,386 | 3.890625 | 4 | [
"MIT"
] | permissive | # Aprimore o DESAFIO093 para que ele funcione com vários jogadores, incluindo
# um sistema de visualização de detalhes do aproveitamento de cada jogador.
aprov = {}
laprov = []
while True:
print('—'*40)
aprov['nome'] = str(input("Nome: "))
partidas = int(input(f'Quantas partidas {aprov["nome"]} jog... | true |
8c0f067fb83cdb14b7b77b8eed54ebbdf273ecbb | Python | Lu314/solarsystem | /solarsystem.py | UTF-8 | 2,499 | 3.59375 | 4 | [] | no_license | import sys
sun_Distance = float(93000000)
moon_Distance = float(238900)
iss_Distance = float(250)
distanceSun2Moon = sun_Distance - moon_Distance
distanceIss2Moon = moon_Distance - iss_Distance
def Solarsystemfunction():
user_FirstAnswer = input(
"Would you like to know how far the Earth is to the... | true |
1bedf252ece8d4097e1ad7faec23a11fc04c3951 | Python | marinnaricke/CMSC201 | /Homeworks/hw8/hw8_part1.py | UTF-8 | 920 | 4.46875 | 4 | [] | no_license | #File: hw8_part1.py
#Author: Marinna Ricketts-Uy
#Date: 11/24/15
#Section: 17
#UMBC Email: pd12778@umbc.edu
#Description: This program takes in a list of integers and prints out
# the reverse of that list using recursion
#rev() Prints out the reverse of a list
#input: the list of in... | true |
e27a69143b752cdb6b8f218c6fb4c27bb075f9a1 | Python | LeohomZhang/Project | /notebook2-basketpair.py | UTF-8 | 3,392 | 2.859375 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 27 16:40:52 2021
@author: motionpay
"""
def on_vocareum():
import os
return os.path.exists('.voc')
def download(file, local_dir="", url_base=None, checksum=None):
import os, requests, hashlib, io
local_file = "{}{}".format(local_d... | true |
0df544e94fe31f047c27716d180417fbef5a35fc | Python | ericsyc/leetcode | /Python/53 Maximum Subarray.py | UTF-8 | 552 | 2.8125 | 3 | [] | no_license | class Solution:
def maxSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
cumsum = ans = nums[0]
for num in nums[1:]:
cumsum = max(cumsum, 0) + num
ans = max(cumsum, ans)
return ans
def maxSubArray(self, nums):
ans = n... | true |
454fe1b2ff5389be4386897f591107bb18d358fa | Python | TeamC-AAD/Library | /geneticalg/core/AbstractSolver.py | UTF-8 | 7,505 | 2.90625 | 3 | [
"MIT"
] | permissive | ''' Base solver class '''
import math
import random
from abc import abstractmethod
import json
import numpy as np
from geneticalg.helper import mutation
from geneticalg.helper import selection
from geneticalg.helper import crossover
# TODO: Check if ma == pa
class AbstractSolver:
def __init__(
self,
... | true |
0d6af49c304c0024b07c05a87dd71ca1412c70a8 | Python | joaogilberto23/REST-APIs-Python-Flask | /python-iniciante/metodos.py | UTF-8 | 845 | 4.25 | 4 | [] | no_license | """
Em Python, para se criar um método basta usar a seguinte estrutura:
def meu_metodo():
instrução
Para executar este método, basta chamá-lo.
meu_metodo()
OBS: lembrar de identar corretamente as instruções dentro do método
"""
def imprimir():
print('Olá')
imprimir()
# método com parâmetros
def som... | true |
bd0f3daa2374ddac80f178808132704a46277edd | Python | IHautaI/programming-language-classifier | /lang_class/vectorizer.py | UTF-8 | 2,494 | 3.046875 | 3 | [] | no_license | import re
import numpy as np
from scipy.sparse import csc_matrix, hstack, coo_matrix
class CodeVectorizer():
def __init__(self, vectorizer):
self.fit_X = None
self.fit_Y = None
self.punctuation = None
self.lengths = None
self.fitted = False
self.punc = '. , ; : ! #... | true |
3ab34f338621d1213a2d9cfb58d29f1eef5fc1b4 | Python | JasonKIM092/Python | /20191112 내 필기.py | UTF-8 | 2,140 | 3.59375 | 4 | [] | no_license |
# 정규식 패턴
import re
txt1 = 'asd asd@naver.com 123x d ! ced@yahoo.co.kr'
pattern1 = re.compile('.+@.+\..+', flags = re.IGNORECASE)
pattern2 = re.compile('[a-z0-9]+@[a-z]+\.[a-z]{2,4}', flags = re.IGNORECASE) # 띄어쓰기는 한개의 공백으로 파싱하므로 띄어쓰기는 신중히 할 것.
pattern3 = re.compile('[a-z0-9]+@[a-z]+\.[a-z.]{2,5}', flags = re.IG... | true |
beabc7a63103942bd3efa378c8912033c7aa7685 | Python | jeyakannan82/webcomponent | /experience_utils.py | UTF-8 | 3,692 | 2.734375 | 3 | [] | no_license | import random
from collections import Counter
from collections import defaultdict
import json
from datetime import datetime
from datetime import timedelta
from copy import deepcopy
from itertools import groupby
from operator import itemgetter
def successfailurecount(response_types):
server_failures = 0
user_f... | true |
94b7e1be0fd25f0aa12ff893420b0737529e1b69 | Python | shiraz-30/Intro-to-Python | /Python/Python_problems/simcross.py | UTF-8 | 1,508 | 2.859375 | 3 | [] | no_license | words = {}
crsswrd = []
rows, columns = {},{}
n,m = map(int, input().split())
for r in range(n):
line = list(input())
crsswrd.append(line)
cnt = []
for index in range(m):
char = line[index]
if char == "b" or char == "r":
cnt.append(index)
if len(cnt) != 0:
rows[... | true |
56a9cf90a1aee97d4305c83710e882a4c634fcfd | Python | GenryEden/kpolyakovName | /2878.py | UTF-8 | 436 | 3.21875 | 3 | [] | no_license | def check(x):
if x % 6 == 0:
return False
if x % 7 == 0:
return False
if x % 8 == 0:
return False
for i, s in enumerate(str(x)):
if (i == 2 or i == 4) and (int(s) % 2 == 1):
return False
if (4 != i != 2) and (int(s) % 2 == 0):
return False
return True
cnt = 0
maximal = 0
minimal = 0
for i in rang... | true |
e6b4751354faa7ffa68e70208064127be601b44a | Python | mrschyte/wascan | /util/queue.py | UTF-8 | 777 | 2.8125 | 3 | [
"BSD-2-Clause"
] | permissive | import unittest
import queue
from util.misc import identity
class SetQueue(queue.Queue):
def _init(self, maxsize):
self.maxsize = maxsize
self.queue = set()
def _put(self, item):
self.queue.add(item)
def _get(self):
return self.queue.pop()
class UniqueQueue(queue.Queue):... | true |
89f464a75a7aac7ab5115cd9d35347c822c01997 | Python | godontop/python-work | /loop_return.py | UTF-8 | 182 | 3.625 | 4 | [
"MIT"
] | permissive | def sum(x):
res = 0
for i in range(x):
res += i
# return res
return res
# Don't put the return in for loop, or the for loop will just run one time,
# then quit.
print(sum(10)) | true |
660cf8543fd50165af4cfe1e61842c9346901b95 | Python | Artimi/engeto_pa_praha_18_9_2019 | /07/47_anagram.py | UTF-8 | 583 | 3.515625 | 4 | [] | no_license |
def all_anagrams(candidates):
# if not candidates:
# return False
# if len(candidates) == 1:
# return True
# sorted_candidates = [sorted(candidate) for candidate in candidates]
# first = sorted_candidates[0]
# for candidate in sorted_candidates[1:]:
# if first != candidate:
... | true |
2ca773cad585501a5409c0fa88c8301a53132515 | Python | Aasthaengg/IBMdataset | /Python_codes/p03739/s036183358.py | UTF-8 | 655 | 2.734375 | 3 | [] | no_license | n=int(input())
a=list(map(int,input().split()))
dp=[0]*n
dp[0]=a[0]
for i in range(1,n):
dp[i]=dp[i-1]+a[i]
ans1,ans2,cnt1,cnt2,flag=0,0,0,0,True
for i in range(n):
if flag==True:
if dp[i]+cnt1<=0:
ans1+=abs(1-(dp[i]+cnt1))
cnt1+=1-(dp[i]+cnt1)
flag=False
else:
if dp[i]+cnt1>=0:
ans1... | true |
8a3ac4fea2faaa3cc7b31eb98598793b3acd51da | Python | suhyeun/pythonStudy | /textbook_exam2.py | UTF-8 | 765 | 3.78125 | 4 | [] | no_license | #1.
our_pots = {"강소리":1, "강수연":2, "강은별":3, "김나은":4, "김수현":5, "김아름":6, "김연희":7, "손지우":8}
#2.
for name in our_pots:
print(name)
#3.
for name in our_pots:
print("{0} 집에는 {1}개의 냄비가 있다".format(name, our_pots[name]))
#4.
for name in our_pots:
if our_pots[name] >= 3:
print(name)
#5.
fo... | true |
1992cfd60032b511b7f643e12857ab36065138ae | Python | YunkyJig/WordClouds | /wordCloud.py | UTF-8 | 1,299 | 3.171875 | 3 | [] | no_license | #!/usr/bin/env python
import requests
import re
import sys
from wordcloud import WordCloud
def getWords(com):
return com.split()
# Cleaning is a bit gross because comments from the api include html
def cleanComment(com):
# removing urls
com = re.sub(r'https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z... | true |
5782596cccfaf8a1280d927d972ac3425522e778 | Python | KDercksen/adventofcode18 | /7/part_two.py | UTF-8 | 1,446 | 2.828125 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import defaultdict
from itertools import chain
from operator import itemgetter
import re
if __name__ == "__main__":
graph = defaultdict(list)
with open("input.txt") as f:
for line in f:
first, after = re.match(r".*?\s(\w)\s.*... | true |
9da0a75a071fc9bbe84da622c612f3e859117725 | Python | taskforge/cli | /src/taskforge/commands/login.py | UTF-8 | 1,400 | 2.65625 | 3 | [
"AGPL-3.0-only",
"GPL-3.0-or-later",
"AGPL-3.0-or-later"
] | permissive | import sys
import click
from taskforge.client.http import ClientException
from taskforge.commands.cli import cli
from taskforge.commands.utils import inject_client, spinner
def do_login(client, email, password):
try:
with spinner("Generating a personal access token"):
pat = client.users.logi... | true |
dcdfcf8549f4f7a50c5efa745764a91b82b124f5 | Python | sung0471/yolov3 | /utils/detection_boxes_pytorch.py | UTF-8 | 3,078 | 2.609375 | 3 | [] | no_license | from torchvision import transforms
import cv2
from utils.utils import non_max_suppression, prep_image
from colors import *
from torch.autograd import Variable
import torch
def get_class_names(label_path):
with open(label_path, 'rt') as f:
classes = f.read().rstrip('\n').split('\n')
classes.insert(0, '... | true |
7f75ea62709ea8a887280bb9b60b4396dc9937af | Python | alves-Moises/python_course_curso_em_video | /aula10.py | UTF-8 | 383 | 4.03125 | 4 | [] | no_license | tempo = int(input("quantos anos tem seu carro?"))
if tempo>=3:
print('carro velho')
else:
print('carro novo')
nome = str(input("say your name: "))
if nome == 'abc':
print('true')
else:
print('false')
n1 = float(input('Note 1: '))
n2 = float(input('Note 2: '))
print(f'Media: {(n1+n2)/2:.2f}')
m = (n1+n... | true |
4b4b9f0cb6c971230bc147f8e972554b7404cad3 | Python | Tencent/ncnn | /python/ncnn/model_zoo/yolov7.py | UTF-8 | 10,685 | 2.53125 | 3 | [
"BSD-3-Clause",
"Zlib",
"BSD-2-Clause"
] | permissive | # Kenny Bradley 2023
# Ported yolov7-tiny to python based on:
# - https://github.com/Qengineering/YoloV7-ncnn-Raspberry-Pi-4/blob/main/yolo.cpp
#
# Format based on the ncnn yolov4 implementation by THL A29 Limited, a Tencent company
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this fil... | true |
28482d7192c8cba7e0ada2cbd0b7f7c4323503e3 | Python | Ashok531/pythonProject | /main.py | UTF-8 | 1,118 | 2.671875 | 3 | [] | no_license | import webbrowser
from flask import Flask, render_template, url_for, redirect
app = Flask(__name__, template_folder='template')
@app.route('/')
def home():
return 'Welcome to home page'
@app.route('/second/<name>')
def second(name):
return f"hello{name}"
@app.route('/Admin')
def admin():
return 'Welc... | true |
3b930ae707370e8fb51e640a266821ca3d120547 | Python | Dioclesiano/Estudos_sobre_Python | /Exercícios/ex062a - Criando PA com While.py | UTF-8 | 644 | 4.0625 | 4 | [
"MIT"
] | permissive | # Melhore o DESAFIO 061, perguntando para o usuário se ele quer mostrar mais alguns termos.
# O programa encerra quando ele disser que não quer mostrar o termo.
n = int(input('Digite o primeiro termo da Progressão Aritmética » '))
razao = int(input('Digite a razão da Progressão Aritmética » '))
primeiro = n
cont = 1
a... | true |
3ae49938a369ccdfb0b6b12bfb13b4ca8f856e80 | Python | cal65/Mass-Shootings | /Euler/Euler25.py | UTF-8 | 173 | 3.125 | 3 | [] | no_license | from numpy import *
fibonnaci = [1]
x= 1
i = 2
while (len(str(x)) < 1000):
fibonnaci.append(x)
x = fibonnaci[i-1] + fibonnaci[i-2]
i=i+1
x
#answer is
len(fibonnaci)+1 | true |
1ba4a1f81ec44e743c19632badcb051cd02be0a5 | Python | jiaojiner/Python_Basic | /内置类型_列表-列表引用/ifconfig_mac.py | UTF-8 | 886 | 2.875 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- encoding = utf-8 -*-
# 该代码由本人学习时编写,仅供自娱自乐!
# 本人QQ:1945962391
# 欢迎留言讨论,共同学习进步!
import os # 引入os模块,可支持执行系统命令
import re # 引入正则表达式模块
ifconfig_result = os.popen("ifconfig " + 'ens33').read() # 执行Linux命令并将结果赋值
# print(ifconfig_result)
list_ifconfig_result = ifconfig_result.split('\n') # 将命令... | true |
8550bb5f6a04a599a020ab9d7fe380e0de78927f | Python | RoboticBase/uoa-poc2-controller | /app/src/utils.py | UTF-8 | 274 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | import json
def flatten(x):
return [z for y in x for z in (flatten(y) if hasattr(y, '__iter__') and not isinstance(y, str) else (y,))]
def is_jsonable(x):
try:
json.dumps(x)
return True
except (TypeError, OverflowError):
return False
| true |
fedd5f5fd236d53156203a59c4b33d65fad629af | Python | zhineng/flask_api_demo | /resources/user_bk.py | UTF-8 | 6,290 | 3.0625 | 3 | [] | no_license | from flask_restful import Resource, reqparse #處理使用者傳來參數
#讓class Users 知道它是flask_restful 的一種資源
import pymysql # 連接MySQL
from flask import jsonify,make_response #讓Python 資料結構(ex: Dictionary) 轉成JSON 格式
import traceback #吐出錯誤訊息
from server import db
from models import UserModel
parser = reqparse.RequestParser() #設定白名單,使用者... | true |
8982b740864bdbba138d8ff223d0053bb4f3d1e8 | Python | mcdyl1/Projects | /447/main.py | UTF-8 | 8,345 | 3.03125 | 3 | [] | no_license | #Imports
import parse_excel
from ortools.sat.python import cp_model
from constraint import *
#Spreadsheet file names
schedule_file = "Spring 2020 Schedule.xlsx"
classroom_file = "ClassRoom.xlsx"
classes = []
rooms = []
list_of_times = []
class Class:
def __init__(self, subject, number, title, section, instructor,... | true |
b5038494cd242707f6b58d13a2ab7ab0ff543173 | Python | AminatDukhu/coursera | /week2/w2p01.py | UTF-8 | 1,764 | 3.296875 | 3 | [] | no_license | import re # библиотека регулярных выражений
from scipy.spatial.distance import cosine
sourceFile = open('sentences.txt', 'r')
allWords = [] #контейнер для слов
allSentences = [] #контейнер для предложений
for line in sourceFile:
sentence = re.split('[^a-z]', line.lower()) # разбиваем на слова
sentence = lis... | true |
261cb764321ba28e57d3caac0004df4bed48f55f | Python | pasumarthi/EVA | /ENDGAME/ai.py | UTF-8 | 11,819 | 2.90625 | 3 | [] | no_license | # AI for Self Driving Car
# Importing the libraries
import numpy as np
import random
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.autograd as autograd
from torch.autograd import Variable
import time
import matplotlib.pyplot as plt
from collectio... | true |
2bc662a548d7307ec9a088fcc0168f759e57e9e7 | Python | barleen-kaur/LeetCode-Challenges | /DS_Algo/Graphs/possibleBipartitionGraph.py | UTF-8 | 1,650 | 3.71875 | 4 | [] | no_license | '''
886. Possible Bipartition
Given a set of N people (numbered 1, 2, ..., N), we would like to split everyone into two groups of any size.
Each person may dislike some other people, and they should not go into the same group.
Formally, if dislikes[i] = [a, b], it means it is not allowed to put the people numbered ... | true |
6a778a40e55905b6a789f798265a8028aca33cf7 | Python | dbetm/cp-history | /HackerRank/Interview/Greedy/1_MinimumAbsoluteDifferenceInAnArray.py | UTF-8 | 431 | 3.859375 | 4 | [] | no_license | # https://www.hackerrank.com/challenges/minimum-absolute-difference-in-an-array/problem
# Tag(s): Greedy
def minimumAbsoluteDifference(arr):
arr.sort()
ans = abs(arr[0] - arr[1])
n = len(arr)
for i in range(2, n):
ans = min(ans, abs(arr[i-1] - arr[i]))
return ans
if __name__ == '__main... | true |
907c8959ce46377b278219544021165134ced3a5 | Python | espresso6615/myPy | /gggggg.py | UTF-8 | 489 | 3.765625 | 4 | [] | no_license | import turtle as t
def turn_right():
t.setheading(0)
t.forward(10)
def turn_up():
t.setheading(90)
t.forward(10)
def turn_left():
t.setheading(180)
t.forward(10)
def turn_down():
t.setheading(270)
t.forward(10)
def blank():
t.clear()
t.shape("turtle")
t.speed(0)
t.on... | true |
2f58dc3a9b0dbb2f2d8a5ad63fe3aef2ce421e12 | Python | Safe-Shammout/Python_Assesment | /main.py | UTF-8 | 15,445 | 3.59375 | 4 | [] | no_license | #Story line game
#Safe Shammout 2021
from tkinter import * # for GUI and widgets
from PIL import ImageTk, Image # for Images
from tkinter import messagebox # for error messages (diagnose and recover)
# variables
names_list = [] # list to store names for leader board
# Componenet 1 (Game Starter Window object) ... | true |
7908918756bd3c3d9b8503416f5f4f34075ba620 | Python | MakingMexico/CursoPythonYoutube | /clase1.py | UTF-8 | 1,451 | 4.40625 | 4 | [] | no_license | """Clase1: Numeros."""
# Enteros
print(1)
print('Tipo de dato: ', type(1))
# Enteros Binarios
print(0b10)
print('Tipo de dato: ', type(0b10))
# Enteros Octal
print(0o10)
print('Tipo de dato: ', type(0o10))
# Enteros Hexadecimal
print(0x10)
print('Tipo de dato: ', type(0x10))
# Flotante
print(-7.86)
print('Tipo de ... | true |
2b758295ee470c4aa063e1ad9de721b8e7969d2b | Python | JesseBonanno/IndeterminateBeam | /docs/examples/ex_4d.py | UTF-8 | 451 | 3.0625 | 3 | [
"MIT"
] | permissive | # defined by force (tuple with start and end force),
# span (tuple with start and end point) and angle of force
load_1 = TrapezoidalLoad(force=(1000,2000), span=(1,2), angle = 0)
load_2 = TrapezoidalLoad(force=(-1000,-2000), span=(3,4), angle = 45)
load_3 = TrapezoidalLoad(force=(-1000,2000), span=(5,6), angle = 90)
... | true |
acffb6ae0721216009615b774e105dac11d4b69a | Python | xiexiying/study-xxy | /note-month02/02data_manage3-8/day03/exercise1.py | UTF-8 | 749 | 3.78125 | 4 | [] | no_license | """
定义函数,参数传入一个单词,返回单词解释
"""
# def find_word(wor):
#
# list01=[]
# list02=[]
# file=open("dict.txt","r")
# for line in file:
# word=line[:18].strip('')
#
# list01.append(word)
# word_last=line[18:].strip('')
# list02.append(word_last)
# for i in range(len(list01)):
# ... | true |
3a3acb05217f33cf3d34aa030eb9b192a67895b4 | Python | maxxkim/python | /hw14/ez.py | UTF-8 | 524 | 3.203125 | 3 | [] | no_license | import re
def readfile ():
with open("ozhegov.txt", "r", encoding='utf-8') as f:
text = f.read()
return text
def killpunctuation (text):
text = re.sub(u"[^а-яА-Я0-9!?. \\n]", "", text)
text = re.sub(u"[!?.]", "Ə", text)
return text
def makedic(text):
text = text.split("Ə")
dic... | true |
b394d8dc7bb6d045104376848c892bd0dea5f43e | Python | brmlab/ledbar | /host_python/rainbow2d.py | UTF-8 | 1,585 | 2.984375 | 3 | [] | no_license | #!/usr/bin/python
from __future__ import print_function
from ledbar import Ledbar
import math, time
import sys
WIDTH = 4
HEIGHT = 5
PIXELS = 20
def lint(x, points, values):
assert(len(points) == len(values))
for i in range(len(points)-1):
if x > points[i+1]:
continue
width = points[i+1] - points[i... | true |
aeaacd73df3bb5cb3bf26ec863b3869392a71907 | Python | dlaststark/machine-learning-projects | /Programming Language Detection/Experiment-2/Dataset/Train/Python/write-float-arrays-to-a-text-file-3.py | UTF-8 | 333 | 3.484375 | 3 | [] | no_license | def writedat(filename, x, y, xprecision=3, yprecision=5):
with open(filename,'w') as f:
for a, b in zip(x, y):
print("%.*g\t%.*g" % (xprecision, a, yprecision, b), file=f)
#or, using the new-style formatting:
#print("{1:.{0}g}\t{3:.{2}g}".format(xprecision, a, yprecision,... | true |
0c541cfd9e0d39973e1f446c87e05def5789ebf9 | Python | Naviden/sample_size | /sample_size.py | UTF-8 | 980 | 3.453125 | 3 | [] | no_license | from scipy.stats import norm
#https://shodhganga.inflibnet.ac.in/bitstream/10603/23539/7/07_chapter%202.pdf
def cochran(confidence_level, margin_of_error, population_size=None, round=True, p=0.5):
"""Calculate sample size based on Cochran (1977) method """
Z = norm.ppf(1 - (1 - confidence_level) / 2) # two-t... | true |
fce9aea715b82e89f8af8ccebda700d58dda1065 | Python | mdamien/guide-de-pont | /rendu_html.py | UTF-8 | 289 | 3.265625 | 3 | [] | no_license | import json
categories = json.load(open('commerces.json'))
print('<pre>')
for categorie, commerces in categories.items():
print('<h1>', categorie, '</h1>', sep='')
for commerce in commerces:
for attribut, valeur in commerce.items():
print(attribut, ':', valeur)
print()
print() | true |
e5aa4ab783c18cbb111b0cf1737f8e2057139bde | Python | Genyu-Song/LeetCode | /Algorithm/Searching/DFS/FriendCircles.py | UTF-8 | 4,250 | 3.515625 | 4 | [] | no_license | # -*- coding: UTF-8 -*-
'''
There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature.
For example, if A is a direct friend of B, and B is a direct friend of C, then A is an indirect friend of C. And we
defined a friend circle is a group of students who are... | true |
ea653aa0f061e1c320ad706b229ed0edf71c71e8 | Python | cowboyhackr/captureprojects | /projects/MotionSnap/motionSoundAction.py | UTF-8 | 2,113 | 2.71875 | 3 | [] | no_license | #!/usr/bin/python
import sys
import pygame
import pygame.camera
import RPi.GPIO as GPIO
import time
import uuid
from datetime import datetime, timedelta
pygame.init()
pygame.camera.init()
#create fullscreen display 640x480
#screen = pygame.display.set_mode((640,480),0)
#find, open and start low-res camera
cam_list ... | true |
23d42fcc0250f4c7bfefec2bc0e8dc62d9835da4 | Python | rajlath/rkl_codes | /HackerEarth/sum_pair.py | UTF-8 | 300 | 2.921875 | 3 | [] | no_license | '''
5 9
1 2 3 4 5
SAMPLE OUTPUT
YES
'''
noe, needed = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
matches = []
ans = "NO"
for i in arr:
if i in matches:
ans = "YES"
break
else:
matches.append(needed - i)
print(ans)
| true |
81b322b7599c889d4eeb0f269ac974ed15051cfb | Python | maloferriol/cloud-computing-project | /script_aws.py | UTF-8 | 1,556 | 2.859375 | 3 | [
"MIT"
] | permissive | import boto3
import json
import pandas as pd
import time
dataset = pd.read_csv("./datasets/original/dataset.csv")
dataset.reset_index(drop=True, inplace=True)
print( dataset['text'].describe() )
def authenticate_client():
comprehend = boto3.client(service_name='comprehend', region_name='us-east-1')
return com... | true |
a2c85b24a4eee3ee6e73d12a2a0999a4f29721f2 | Python | azrehman/stock-tweet-sentiment | /predict.py | UTF-8 | 1,309 | 2.546875 | 3 | [] | no_license | import numpy as np
import tensorflow as tf
from preprocess import remove_URL, remove_punct, remove_punct, remove_stop_words, remove_empty, remove_case_white_space
from preprocess import max_seq_length, tokenizer, decode
from tensorflow.keras.preprocessing.sequence import pad_sequences
CATEGORIES = ['positive', 'negati... | true |
fdade1723e90b34230ddce7b75300f30f2acd6ab | Python | KonstantinKlepikov/data_tools | /data_tools/patches.py | UTF-8 | 6,605 | 2.71875 | 3 | [
"MIT"
] | permissive | import numpy as np
import h5py
from .io import (h5py_array_writer,
bcolz_array_writer)
class patch_generator(object):
"""
Extract 2D patches from a slice or volume. Patches extracted at an edge are
mirrored by default (else, zero-padded).
Patches are always returned as float32.
... | true |
7932eae03c097121fab88bef99d994f4ac07f83a | Python | concreted/mcrypto | /python/pset3/24.py | UTF-8 | 841 | 3 | 3 | [] | no_license | from mclib import *
text = ''.join([chr(randint(0, 255)) for i in range(randint(0, 10))])
text += "a" * 14
print ba.hexlify(text)
mtsc = MTStreamCipher(randint(0, 2**8))
c = mtsc.encrypt(text)
print ba.hexlify(c)
#d = mtsc.decrypt(c)
#print ba.hexlify(d)
# Crack cipher from known plaintext
import time
def timef... | true |
ce8050f65d6a71fefc4d9626473ac10161132d5a | Python | raghuvanshraj/PyTorch-CRNN-OCR | /src/utils/image_generator.py | UTF-8 | 1,730 | 2.578125 | 3 | [] | no_license | import os
from scipy.stats import bernoulli
from trdg.generators import GeneratorFromStrings
import consts
class ImageGenerator(object):
def __init__(self, train_test_split, random_skew, random_blur, img_height, img_width, img_count):
self.train_test_split = train_test_split
self.random_skew = ... | true |
8965346454afd832d31336d89236123a59526f7e | Python | bkapilg/Seleniumprograms | /seleniumBasics/drivers/Windowsframe.py | UTF-8 | 875 | 2.53125 | 3 | [] | no_license | import time
from selenium import webdriver
from selenium.webdriver import ActionChains
driver =webdriver.Chrome("D:\\chromedriver_win32 (5)\\chromedriver.exe")
driver.get("http://demo.automationtesting.in/windows.html")
driver.maximize_window()
ele1 = driver.find_element_by_xpath("//a[text()= 'SwitchTo']")
ele2 = ... | true |
b7b2a40a0ae63a80969a9c0ce5b2fa45f804f2b1 | Python | frazentropy/DSP | /NumPyTuts/numpy_arranging.py | UTF-8 | 528 | 3.609375 | 4 | [] | no_license | import numpy as np
x = np.arange(5)
print(x)
# dtype set
x = np.arange(5, dtype=float)
print(x)
# start and stop parameters set
x = np.arange(10,20,2)
print(x)
# linear spacing
x = np.linspace(10,20,5)
print(x)
# endpoint set to false
x = np.linspace(10,20,5, endpoint = False)
print(x)
# find retstep value
x = np.... | true |
a80d99e07d8b93f92b3006d6aa53953bcf560275 | Python | Mahmoud-Arafaa/NLP | /Sentimentclassification/sentimentClassificationProject.py | UTF-8 | 4,154 | 2.828125 | 3 | [] | no_license | import pandas as pd
import re
import nltk
import csv
import numpy as np
from nltk.corpus import stopwords
from sklearn.linear_model import LogisticRegression
from sklearn import svm
from sklearn.model_selection import train_test_split
def load_embeddings(path):
glove_file = path
with open(glove_file,encoding="ut... | true |
9288b4543aef01d050d3631b3688039168ba57f0 | Python | gervanna/100daysofcode | /w3resources/Basic_pt.1/7.py | UTF-8 | 317 | 4.09375 | 4 | [] | no_license | #Write a Python program to accept a filename from the user and print the extension of that.
#02_10_21
name_of_file = (input("Enter the full name of the file: "))
print(f"\nThe name of your file is {name_of_file}.")
name_of_extension = name_of_file.split(".")
print(f"The file extension is {name_of_extension[-1]}.") | true |
545690e7da88c58fad8d2149b4dcbef7f541461e | Python | holwech/Spacebanks | /backend/user.py | UTF-8 | 772 | 2.859375 | 3 | [
"MIT"
] | permissive | class User:
def __init__(self,userid,funding_permission):
self.userid = userid
self.funding_permission = funding_permission
self.fundings = []
def add_funding(self,funding):
self.fundings.append(funding)
class Funding:
def __init__(self,status,time_ack,time_expired,funding_type,funding_id):
self.status =... | true |
6c24f91551af8a925c392371561f093b8d52e146 | Python | khagkhangg/qr_code_reader | /detector.py | UTF-8 | 23,851 | 3.265625 | 3 | [] | no_license | import exifread
from PIL import Image
from spriteutils.spriteutil import SpriteSheet
from math import sqrt, degrees, acos, atan2
from numpy import array, zeros
class QRCode:
"""Represent a QR Code"""
def __init__(self, image, position_detection_patterns):
self._image = image
self._position_de... | true |
7bfe0f01bb2397b838a49ae81229797c00e4d070 | Python | ankitranjan9/Hackerrank | /Introduction_to_sets.py | UTF-8 | 103 | 3.015625 | 3 | [] | no_license | n = int(input())
S = set(map(int, input().split()))
tot = 0
for i in S:
tot += i
print(tot/len(S))
| true |
2396836078b09b418bd54d1d72c61b8348b5e854 | Python | DunkHimYo/apart_managment_system_v1 | /findIdPs.py | UTF-8 | 3,918 | 2.546875 | 3 | [] | no_license | from tkinter import *
from tkinter import ttk
from operator import itemgetter
class findIdPs(ttk.Frame):
def __init__(self, parent, controller):
ttk.Frame.__init__(self, parent)
self.controller = controller
self.list = {'번호': None, '이름': None, '휴대폰번호': None, '이용자': None, '주소(동... | true |
8d1c370644a58db6bf4274311af99bc0c7a8d7d3 | Python | saigon1983/SFDemiurge | /RTL/Libs/projectManager/project_tree_elements.py | UTF-8 | 11,452 | 2.96875 | 3 | [] | no_license | '''
В этом модуле описываются элементы дерева структуры проекта - объекты подклассы QStandardItem, необходимые для отражения
структуры проекта в виде дерева в виджете PROJECT_MANAGER
'''
import os
from RTL.Libs.sceneManager.scene_model import SceneModel
from RTL.Libs.projectManager.project_element_menu import *
from RT... | true |
971091fd54e6b5a77a2c5025c0cfad798da5dd88 | Python | niklasmichel/trapy | /trapy/tra.py | UTF-8 | 13,866 | 2.984375 | 3 | [
"MIT"
] | permissive | import os
import sys
import math
import warnings
import pandas as pd
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
from .trial import Trial
def instantiate(folder):
"""Crawls folder for text files and makes them instances of the Trial() Class.
... | true |
05335834ea7093367bc05bdfe6dd34a2c8059137 | Python | TohaRhymes/BI_2019_Python | /calculator.py | UTF-8 | 2,461 | 4.40625 | 4 | [] | no_license | # return true, if string is a rational number
def is_digit(string):
if string.isdigit():
return True
else:
try:
float(string)
return True
except ValueError:
return False
print("Hello in my calculator. Type in:\n"
"- integer operand,\n"
"-... | true |
897b26d8ad289b8917498e5446f4ac64ae643eb5 | Python | jomadmann/SESTREN | /cogs/vcaccess-t.py | UTF-8 | 6,733 | 2.734375 | 3 | [] | no_license | """
Module for listener for user's joining/leaving voice channels.
On join, adds role to grant access to voice channel.
On leave, removes access role.
"""
import discord
from discord.ext import commands
from cogs.utils import checks
from main import app_name
class VCAccess:
"""Module for listener for user's jo... | true |
add2607514b61dfc413f3d321ec5a7369de7f61e | Python | zheyaogao/zg2308 | /database/HW4/test/unit_test.py | UTF-8 | 918 | 2.5625 | 3 | [] | no_license | import sys
sys.path.append('../')
from redis_cache import data_cache
from utils import utils as ut
ut.set_debug_mode(True)
t = [{"playerID": "willite01", "nameLast": "Williams", "bats": "R"}]
r = [{'nameLast':'Williams',"birthCity":'San Diego'}]
def test1():
'''
test check cache
'''
r = data_cache... | true |
7f163357ea00394017968236ad14341dbca02a29 | Python | educastro100/flask_helloworld | /app.py | UTF-8 | 416 | 3.5 | 4 | [] | no_license | # importando a classe Flask
from flask import Flask
# Criando uma instância da classe Flask
app = Flask(__name__)
# Decorator serve pra applciar uma função em cima de outra
# Define uma rota para a página
@app.route("/")
def index(): # Uma página que está sendo criada (index)
return "Hello World!"
# Verifica se... | true |
f30fbbb4a148633a57976691cf658c43f65d368f | Python | Chaddai/RainCheckingExample | /surveille-pluie.py | UTF-8 | 1,347 | 3.375 | 3 | [] | no_license | # Programme principal : surveille les prévisions sur une ville et affiche un message
# d'alerte si de la pluie est prévue dans les 3h qui viennent
import sys
import time # pour gérer le temps (récupération régulière des données)
from tkinter import Tk, messagebox # afficher le pop-up d'alerte
from accesWeatherApi im... | true |
ac52a8d84880919ebe5b9156ba6d27b4b19fb7dd | Python | DSXiangLi/Leetcode_python | /script/[687]最长同值路径.py | UTF-8 | 1,594 | 3.5 | 4 | [] | no_license | # 给定一个二叉树的 root ,返回 最长的路径的长度 ,这个路径中的 每个节点具有相同值 。 这条路径可以经过也可以不经过根节点。
#
# 两个节点之间的路径长度 由它们之间的边数表示。
#
#
#
# 示例 1:
#
#
#
#
# 输入:root = [5,4,5,1,1,5]
# 输出:2
#
#
# 示例 2:
#
#
#
#
# 输入:root = [1,4,5,4,4,5]
# 输出:2
#
#
#
#
# 提示:
#
#
# 树的节点数的范围是 [0, 10⁴]
# -1000 <= Node.val <= 1000
# 树的深度... | true |
bd3bcc40637d55cb470292862ffac568c1a888e7 | Python | mr-ovro/sms | /sms2.py | UTF-8 | 1,336 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python3
import requests as rq
"""
SMS Bomber using Hoichoi SMS api
"""
def send(target):
header = {
"x-api-key": "dtGKRIAd7y3mwmuXGk63u3MI3Azl1iYX8w9kaeg3"
}
data = {
"requestType":"send",
"phoneNumber":"+88"+target,
"screenName":"signin"
}
url = "https://prod-api.viewlift.... | true |
66bf5deca7ea3c3554d8f9fbc332b8855265a43c | Python | glambertucci/TC | /TP1/Punto 1/graphStepResponse/Graphs.py | UTF-8 | 2,167 | 2.828125 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
def not_num(content):
if content == "0":
return 0
if content == "1":
return 0
if content == "2":
return 0
if content == "3":
return 0
if content == "4":
return 0
if content == "5":
return 0
i... | true |
af7aee888f535fc6134b4502a3145dfff9eb0f82 | Python | jeremyfirst22/GMX_Helix_oplsaa | /Process_scripts/Process_temperature.py | UTF-8 | 1,830 | 2.625 | 3 | [] | no_license | import glob
import numpy as np
import matplotlib.pyplot as plt
import os
from os import sys
from matplotlib.colors import LogNorm
from matplotlib import rc_file
import matplotlib.lines as mlines
cutoff = 10 ##Electrostatic cutoff distance (Angstroms)
figCols=1
figRows=1
rc_file('rc_files/paper.rc')
if not os.... | true |
928f3b0434ed829bac3d4d0ae84516de84340574 | Python | trezorg/aioredis | /aioredis/parser.py | UTF-8 | 4,907 | 2.640625 | 3 | [
"MIT"
] | permissive | from .errors import ProtocolError, ReplyError
__all__ = [
'Reader', 'PyReader',
]
class PyReader:
"""Pure-Python Redis protocol parser that follows hiredis.Reader
interface (except setmaxbuf/getmaxbuf).
"""
def __init__(self, protocolError=ProtocolError, replyError=ReplyError,
en... | true |
73f294928084d32802b1311f1be3755720d12730 | Python | Julesdhs/ProjetPOO | /EstimateurMoyenne.py | UTF-8 | 2,178 | 3.828125 | 4 | [] | no_license | from EstimateurAbstraite import EstimateurAbstraite
from Table import Table
class EstimateurMoyenne():
'''la classe permet de calculer la moyenne sur une variable que l'on sélectionne à l'aide de nom_col dans une tale
Attribus
----------
nom_col : str
nom de la variable dans notre... | true |
e627514db965570c3368a2d5d951c68bd259735f | Python | ufp1000/Python | /R12_E2C/WindowUI.py | UTF-8 | 2,305 | 2.6875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 18 23:01:19 2018
@author: Rahul.Mishra1
"""
from tkinter import *
"""
def view_command():
lstbx.delete(0,END)
for row in Backend.view():
lstbx.insert(END,row)
def search_command():
lstbx.delete(0,END)
for row in Backend.search(title_text.get(),a... | true |
837a34986a3232af1bef48b811f9ef14e9b47cde | Python | loosely-coupled/violent-python-exercises | /forensics/metadata/parse_firefox.py | UTF-8 | 3,020 | 2.921875 | 3 | [] | no_license | ##
#This module parses firefox sqlite database file to extract certain information from it.
#The specific information extracted are: downloads, Cookies, History, search terms
##
import sqlite3
import optparse
import os
import re
def printDownloads(downloadDB):
conn = sqlite3.connect(downloadDB)
c = conn.cursor()... | true |
2fa5b0d2e709ba30e8b5a0b102aef0b248746d1e | Python | AdrianAwad/uebung | /src/server/db/GradingMapper.py | UTF-8 | 3,529 | 3.1875 | 3 | [] | no_license | import mysql.connector
from server.bo.Grading import Grading
from server.db.Mapper import Mapper
class GradingMapper (Mapper):
"""This is a mapper-class, which represents grading objects into
a relational database. For this reason you can find some methods,
which help to find, insert, modify, and delete o... | true |