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
4483b5d884084baa1adcb7081aef1b6e21cb9a61
Python
abhidurg/CSE_480_Database_Systems
/proj08/wait_die_shedule.py
UTF-8
7,563
2.90625
3
[]
no_license
class Action: """ This is the Action class. """ def __init__(self, object_, transaction, type_): self.object_ = object_ self.transaction = transaction assert type_ in ("WRITE", "COMMIT", "ROLLBACK", "LOCK", "UNLOCK", "WAIT") self.type_ = type_ def __str__(self): return f"Action('...
true
81dbd093cab21233ebebfa94e49f02f141dea0dd
Python
truboprovod4uk/My-Project
/sinX.py
UTF-8
2,659
3.4375
3
[]
no_license
# Це не мій проект, програма написана по прикладу з ютуба # Ця програма генерує координатну сітку та синусоїду, приймаючи дані від користувача from tkinter import * import math root = Tk() root.title("Графік фунції") root.geometry('1240x640') canvas = Canvas(root, width=900, height=640, bg='#002') canvas.pack(side='ri...
true
526ac0ca6af79b634f4ee51403f84c8d7a121745
Python
Shurui-Zhang/Biometrics
/biometrics.py
UTF-8
7,487
2.546875
3
[]
no_license
#!pip install removebg import cv2 as cv import torchvision.models.segmentation as segmentation import numpy import torch from torchvision import transforms from PIL import Image from torchvision.datasets import ImageFolder from torch.utils.data import DataLoader from sklearn.neighbors import KNeighborsClas...
true
560da9b167d3608df28bb4fcff90bfe8a3a44334
Python
kwendim/sentence_extractor
/new_textifier.py
UTF-8
4,026
3.046875
3
[]
no_license
"""Extracts the title, content and date from the blogs and saves it in a file that is organized into sentences. The name of the file will be the date followed by the article title. Argument passed should be the absolute path to the folder containing the website data. When giving path, start from the "/" folder""" __aut...
true
c3fe8b65722d5325f3abf1d2369553632e933c52
Python
ikikohei/atcoder
/EDPC/D_knapsack.py
UTF-8
584
3.015625
3
[]
no_license
def knapsack(N,W,items): dp = [[0 for i in range(W+1)] for j in range(N+1)] for n in range(N): for w in range(W): if items[n][0] <= w+1: dp[n+1][w+1] = max(dp[n][w+1],dp[n][w+1-items[n][0]]+items[n][1]) else: dp[n+1][w+1] = dp[n][w+1] return dp...
true
9a23231487f9c4b3c7ad52de71dda7005520116a
Python
MKDevil/Python
/学习/0标准库/lib_string.py
UTF-8
2,110
3.90625
4
[]
no_license
#!/usr/bin/env python # -*- coding:utf-8 -*- import string ################################### 字符串常量 ################################### # ascii_lowercase 生成小写字母 a~z print('小写字母:', string.ascii_lowercase) # ascii_uppercase 生成大写字母 A~Z print('大写字母:', string.ascii_uppercase) # ascii_letters 生成所有的字母,a~z + A~Z...
true
1ea5227e42395c4db8154e6cf2b33a243d58f7f6
Python
gumuxiansheng/BFSUCitation
/export.py
UTF-8
2,230
2.609375
3
[]
no_license
import xlwt wb = xlwt.Workbook(encoding='utf-8', style_compression=0) ws = wb.add_sheet('export', cell_overwrite_ok=True) ws2 = wb.add_sheet('citation', cell_overwrite_ok=True) colNames = ['AU', 'TI', 'SO', 'VL', 'IS', 'BP', 'EP', 'DI', 'PD', 'PY', 'AB', 'ZR', 'TC', 'ZB', 'Z8', 'ZS', 'Z9', 'SN', 'EI', 'UT...
true
3a5e978e04a542f4a3051b2c30545b960fddd00f
Python
suseongKim87/python-study
/응용1/mod2.py
UTF-8
264
3.5625
4
[]
no_license
PI = 3.141592 class Math: def solv(self, r): return PI*(r**2) #반지름을 계산하는 클래스, r**2는 r의 제곱. def sum(a,b): return a+b if __name__=="__main__": print(PI) a = Math() print(a.solv(2)) print(sum(PI,4.4))
true
75ef2bcedebb7524b11ceaecfbcaeb10bd81cffa
Python
AustinAkerley/crypto
/crypto/cryptanalysis/pollard.py
UTF-8
625
3.328125
3
[]
no_license
# Title: Pollard's p-1 Factorization Algorithm # Creator: Austin Akerley # Date Created: 05/17/2020 # Last Editor: Austin Akerley # Date Last Edited: 05/17/2020 # Associated Book Page Nuber: 139 # INPUT(s) - # N - type: int, desc: integer to be factored into p and q, note: p*q = N from crypto.src.fast_power import fa...
true
1f18c885822ba15d6542e386f42f1e1a7627905f
Python
cchan19/region_classification
/work/feature_extracting/Basic_feature/Code_Basic_feature_1/feature.py
UTF-8
68,772
2.75
3
[]
no_license
import time import numpy as np import sys import datetime import pandas as pd import os from Config import config # 用字典查询代替类型转换,可以减少一部分计算时间 date2position = {} datestr2dateint = {} str2int = {} date2int = {} for i in range(24): str2int[str(i).zfill(2)] = i # 访问记录内的时间从2018年10月1日起,共182天 # 将日期按日历排列 for i in range(182...
true
ec560887d6a722946ee492eb7991f55a190be42f
Python
AK-1121/code_extraction
/python/python_7777.py
UTF-8
92
3.015625
3
[]
no_license
# How do I print a Celsius symbol with matplotlib? ax.set_xlabel('Temperature ($^\circ$C)')
true
3fc5b97db4907104c33052bb141f5e13fc7692e8
Python
knighton/deepzen
/deepzen/api/base/core/cast.py
UTF-8
875
2.71875
3
[]
no_license
class BaseCastAPI(object): def cast(self, x, dtype=None, device=None, copy=False): raise NotImplementedError def cast_to_cpu(self, x, dtype, copy=False): return self.cast(x, dtype, self.cpu(), copy) def cast_to_gpu(self, x, dtype, gpu=None, copy=False): return self.cast(x, dtype, s...
true
04d60a62b037b423cf0ff90a2a6ef2a450c138cd
Python
Guilhermesav/Assessment2
/ok.py
UTF-8
1,520
3.078125
3
[]
no_license
import threading, time,multiprocessing lista_tamanhos = [1000, 2000, 3000, 4000, 5000] if __name__ == '__main__': for tam in lista_tamanhos: lista = [1.3, 10.4, 40.0, 59.87, 33.01, 101.4]*tam tamanho = len(lista) def calcPorcent(lista, inicio, fim): for i in range(...
true
f6b18ed443cbcd69ebd6c87fc002987aa5a7e8d9
Python
eboling/MBTS-Water-Tiers
/gen_tiers.py
UTF-8
1,589
2.53125
3
[]
no_license
import sys from numpy import loadtxt, arange, ones from scipy import stats from rate_tier import RateTier, TierSystem from RawQData import RawQData data_file_dir = sys.argv[1] tier_file_name = sys.argv[2] spreadsheet_file_name = sys.argv[3] raw = RawQData(data_file_dir) lines = loadtxt(tier_file_name) #print lines r...
true
bd9d9fb1da81c85732962429ae943f51c52e7307
Python
conceptslearningmachine-FEIN-85-1759293/affiliates
/affiliates/links/tests/test_models.py
UTF-8
929
2.53125
3
[ "MIT", "BSD-3-Clause" ]
permissive
from datetime import date from nose.tools import eq_ from affiliates.base.tests import TestCase from affiliates.links.models import Link from affiliates.links.tests import DataPointFactory, LinkFactory class LinkTests(TestCase): def test_manager_total_link_clicks(self): for clicks in (4, 6, 9, 10): # =...
true
8941efe0b69af32e43f78600ecb5ae41ca0d6266
Python
magdacisowska/AdventOfCode
/AOC/day5.py
UTF-8
1,411
3.78125
4
[]
no_license
def is_gonna_react(a, b): low_up = a.isupper() and b.islower() up_low = a.islower() and b.isupper() same_sign = a.lower() == b.lower() return (low_up or up_low) and same_sign def react(input): new_polymer = [] old_polymer = list(reversed(input)) while old_polymer: current_unit = ...
true
180d6d68c232abb4ba3e49474ce7005a49191109
Python
AnastasiaMazur/test_octopus_task
/encryption_decryption.py
UTF-8
1,119
2.875
3
[]
no_license
import base64 import os from Crypto import Random from Crypto.PublicKey import RSA from settings import PRIVATE_KEY_FILENAME def generate_keys(): if os.path.exists(PRIVATE_KEY_FILENAME): print("GET KEY FROM PATH") with open(PRIVATE_KEY_FILENAME, 'r') as f: PRIVATE_KEY = RSA.importKey(f...
true
80437243415280ea32f1dcecd97be3e9a4968ba2
Python
jumbokh/micropython_class
/ESP32/Lab/Dust/pms5003.py
UTF-8
3,562
3.09375
3
[]
no_license
""" Program to read data from PLANTOWER PMS5003 Modified from program to read data from NovaFitness SDS011 by Nils Jacob Berland njberland@gmail.com / njberland@sensar.io +47 40800410 Modified by Szymon Jakubiak Measured values of PM1, PM2.5 and PM10 are in ug/m^3 Number of pa...
true
d74b7c1683e2eb5230b34e175b894e236a2833fb
Python
herowhj/weixin_crawler_2.0
/utils/time.py
UTF-8
673
2.890625
3
[]
no_license
def get_internet_time(): """ :return: 获取百度服务器时间 """ import requests,time,datetime try: r = requests.get(url="http://www.baidu.com") date = r.headers['Date'] #将GMT时间转换成北京时间 net_time = time.mktime(datetime.datetime.strptime(date[5:25], "%d %b %Y %H:%M:%S").timetuple())+...
true
7e85a37f9b7cc6ab92fea8c3fe17a132b68a161a
Python
ninastijepovic/MasterThesis
/hera_sim/visibilities/simulators.py
UTF-8
13,973
2.53125
3
[ "MIT" ]
permissive
from __future__ import division from builtins import object import warnings import healpy import numpy as np from cached_property import cached_property from pyuvsim import analyticbeam as ab from pyuvsim.simsetup import ( initialize_uvdata_from_params, initialize_catalog_from_params, uvdata_to_telescope_c...
true
c111c58750c12fb8ab344a4176468cc873ed6468
Python
laxminagln/IOSD-UIETKUK-HacktoberFest-Meetup-2019
/Beginner/age.py
UTF-8
296
3.78125
4
[ "Apache-2.0" ]
permissive
while True: try: a = int(input("enter your age :")) if a > 18: print("Adult") elif 10 < a <= 18: print("Teen") elif a <= 10: print("Child") break except ValueError: print("enter valid age") break
true
c40e07411d8abc5540de0bc15810940894d58900
Python
samuelcharles007/TheSelfTaughtProgrammer
/Odd_or_evenusingloop.py
UTF-8
104
3.375
3
[]
no_license
l=input("Type a Int") r=input("Type another int") i=[] for i in range(int(l),int(r)): print(i)
true
1e75fedd8d82ee9b9159f872729f4eb4466f79a2
Python
Comradgrimo/Py_sql_qt
/lesson_1.py
UTF-8
5,402
3.78125
4
[]
no_license
# 1. Написать функцию host_ping(), в которой с помощью утилиты ping будет проверяться доступность сетевых узлов. # Аргументом функции является список, в котором каждый сетевой узел должен быть представлен именем хоста или ip-адресом. # В функции необходимо перебирать ip-адреса и проверять их доступность с выводом соотв...
true
7942d5e162a8d475762bf5af9657985322d8f283
Python
hackengineer/enet_tensorflow
/utils.py
UTF-8
5,852
2.890625
3
[]
no_license
import tensorflow as tf import numpy as np def process_path_enc(file_path): ''' Function to process the path containing the images and the labels for the input pipeline. In this case we work for the encoder output Arguments ---------- 'file_path' = path containing the images and ...
true
58b9dbafe87eb8e484a8e896b4cc259fda4be589
Python
EgehanGundogdu/drf-test-driven-development-exercies
/app/core/tests/test_models.py
UTF-8
1,167
2.890625
3
[ "MIT" ]
permissive
from django.test import TestCase from django.contrib.auth import get_user_model class UserModelTests(TestCase): def setUp(self): self.user = get_user_model().objects.create_user( email="test1@gmail.com", password="super secret" ) def test_create_user_with_email(self): """T...
true
e85b8529a6197568e727b40623000a9f82c7fed0
Python
xiguashuiguo/langren
/M_langren.py
UTF-8
2,072
2.71875
3
[]
no_license
class M_langren(object): """狼人游戏的流程控制""" playerNum = 0 langrenNum = 0 day = 1 mumber = [] langrenList = [] nvwuNum = 0 YuyanNum = 0 Zancun = [] Nvwu_D = True Nvwu_J = True JingzhangNum = 0 def __init__(self): return def setPlayer(self,P): ...
true
73866ad8e111316f51d570f0ec89eac841e2400b
Python
blackholemedia/writings
/algorithm/solutions/offer/hassubtree.py
UTF-8
2,585
2.984375
3
[]
no_license
#-*- coding=utf-8 -*- from functools import reduce import sys if sys.platform == 'linux': sys.path.append('/home/alta/ds') from mytree.binarytreefromlist import BinaryTreeFromList from mytree.tree import TreeNode else: sys.path.append('c:\\users\\alta') from datastructure.mytree.binarytreef...
true
780da105a891cc88976004347547179172257d78
Python
EasonPeng-TW/big5_10
/big5_10.py
UTF-8
863
3.078125
3
[]
no_license
import pandas as pd import requests big5_url = 'https://www.taifex.com.tw/cht/3/largeTraderFutQry' big5_table = pd.read_html(requests.get(big5_url, headers={'User-agent': 'Mozilla/5.0(Windows NT 6.1; Win64; x64)AppleWebKit/537.36(KHTML, like Gecko)Chrome/63.0.3239.132 Safari/537.36'}).text) big5_table[3] big10_call = b...
true
e7ce5ead997e40a4f4499cadf7037d87b7fe4925
Python
zhafen/cc
/cc/concept_n_body.py
UTF-8
2,100
2.59375
3
[]
no_license
import rebound import augment ######################################################################## class Simulation( object ): @augment.store_parameters def __init__( self, concept_map, r_c = 5., rep_power = 3., att_power = 1., inital_dims = ( 10., 10., 10...
true
4b0585286ff2df8e916efb8fb46717e499f73ea1
Python
aleph-im/pyaleph
/tests/toolkit/test_batch.py
UTF-8
747
2.890625
3
[ "MIT" ]
permissive
import pytest from aleph.toolkit.batch import async_batch async def async_range(*args): for i in range(*args): yield i @pytest.mark.asyncio async def test_async_batch(): # batch with a remainder batches = [b async for b in async_batch(async_range(0, 10), 3)] assert batches == [[0, 1, 2], [3,...
true
45e3b61514c33f3cdee0a33845caa990fb574e44
Python
sy2es94098/MLGame-Summer
/games/easy_game/ml/ml_play_template.py
UTF-8
496
2.953125
3
[]
no_license
import random class MLPlay: def __init__(self): print("Initial ml script") def update(self, scene_info: dict): """ Generate the command according to the received scene information """ # print("AI received data from game :", scene_info) actions = ["UP", "DOWN", ...
true
55c08f336f70a4531a1d2188170309835655bd70
Python
mgilgamesh/DRL-Continuous-Control
/model.py
UTF-8
2,231
2.6875
3
[]
no_license
import numpy as np import random from collections import namedtuple, deque import torch import torch.nn.functional as F import torch.optim as optim import torch.nn as nn class Actor(nn.Module): """ Policy Model """ def __init__(self, state_size, action_size, seed): super(Actor, self).__init...
true
dfddfc42c13760ab4ec35e05bf36242fdb22c204
Python
mcxu/code-sandbox
/PythonSandbox/src/misc/num_subsets_min_max_below_k.py
UTF-8
564
3.3125
3
[]
no_license
''' https://leetcode.com/discuss/interview-question/268604/Google-interview-Number-of-subsets Requirement: O(n^2) time or better. Example 1: nums = [2, 4, 5, 7] k = 8 Output: 5 Explanation: [2], [4], [2, 4], [2, 4, 5], [2, 5] Example 2: nums = [1, 4, 3, 2] k = 8 Output: 15 Explanation: 16 (2^4) - 1 (empty set) = 15 ...
true
647b3208a3698a3c774325e5c1cf33cd3e8d547f
Python
viticlick/adventofcode
/2020/day_02/day2_02.py
UTF-8
335
3.40625
3
[]
no_license
import re from operator import xor f = open('input.txt','r') counter = 0 for line in f.readlines(): (a,b,c,d) = re.findall('(\d+)-(\d+) (\w): (\w+)', line)[0] first_occurence = d[int(a) - 1] == c last_occurence = d[int(b) - 1] == c if xor(first_occurence, last_occurence): counter = counter + 1 ...
true
49a03219699c3ce1cef26cb80feea6b3dd96021d
Python
rahul9852-dot/Python-From-Scratch
/Basic Python/Practise_problem/facorial.py
UTF-8
383
4.25
4
[]
no_license
# Factorial of given number # single line of code # Recursive approach def fact(n): return 1 if (n==1 or n==0) else n*fact(n-1) print(fact(5)) # Iterative approach def factorial(n): if n<0: return 0 elif n==1 or n==0: return 1 else: fact=1 while n>1: fact*=...
true
d24188f846922dd017fc873a5e1b476b04548a06
Python
pinartopcam/project
/Assignment.py
UTF-8
14,996
2.78125
3
[]
no_license
import Preference import Instructor as i import Course as c import TeachingAssistant as t from random import shuffle import random class Assignment: def __init__(self, preference_list, ta_list, course_list, instructor_list): self.preference_list = preference_list self.ta_list = ta_list self...
true
e593ecbb7a23b3b4fa3654f25d5b87a47aea6374
Python
danielgil1/resbaz_2019_nlp
/hangman_resbaz/flaskask/game.py
UTF-8
2,191
4.125
4
[]
no_license
def hangman(secret_word, guesser, max_mistakes=8, verbose=True, **guesser_args): """ This game engine is part of material given by The University of Melbourne - Web Search and Text Analysis secret_word: a string of lower-case alphabetic characters, i.e., the answer to the game guesser: a fun...
true
4a78e566d624a5cb9945273714ed0f81b2c014aa
Python
ngthuyn/BTVN
/10_7.py
UTF-8
362
3.28125
3
[]
no_license
"""Bài 10: Cho list sau: ["www.hust.edu.vn", "www.wikipedia.org", "www.asp.net", "www.amazon.com"]. Viết chương trình để in ra hậu tố (vn, org, net, com) trong các tên miền website trong list trên.""" a=["www.hust.edu.vn", "www.wikipedia.org", "www.asp.net", "www.amazon.com"] for i in range(len(a)): b=a[i].spli...
true
8cff65427411babec7c2a49d84ee678f94a4f1d6
Python
JianYiheng/leetcode-dialog
/226.invert-binary-tree-m1.py
UTF-8
698
3.1875
3
[]
no_license
from typing import List class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def invertTree(self, root: TreeNode) -> TreeNode: if not root: return None TreeList = [root] while 1: ptr_node = TreeList...
true
4c422743f4496441d2dc98efa0416f91aabd91c5
Python
megansmcguire/saucerbot
/saucerbot/groupme/handlers/saucer.py
UTF-8
4,518
2.8125
3
[]
no_license
# -*- coding: utf-8 -*- import logging import random from typing import List, Union from lowerpines.endpoints.bot import Bot from lowerpines.endpoints.message import Message from lowerpines.message import ComplexMessage, RefAttach from saucerbot.groupme.handlers import registry from saucerbot.groupme.models import S...
true
9a76630f2e801e479bb26b06d262280d0adf1ef3
Python
jdurakie/raycaster
/meshbuilder.py
UTF-8
708
2.703125
3
[]
no_license
from Triangle import Triangle as T from colormanip import RED, GREEN, BLUE, YELLOW, CYAN, MAGENTA def makeBox(): A = (22, 26, 20) B = (42, 26, 20) C = (42, 6, 20) D = (22, 6, 20) E = (22, 26, 40) F = (42, 26, 40) G = (42, 6, 40) H = (22, 6, 40) tris = [ T(A, B, C, color=R...
true
046dd0bf748e8e4c084a1dda6d5f31995c058e10
Python
slichlyter12/Aristotle
/tests/selenium/TestStudentUseCases.py
UTF-8
10,860
2.546875
3
[]
no_license
import json import unittest import HTMLTestRunner import time from selenium import webdriver class Test_Student_Use_Cases(unittest.TestCase): @classmethod def setUpClass(self): self.driver = webdriver.Chrome() self.driver.implicitly_wait(5) def test_login_error(self): ...
true
63b218c32269fc23b20329308f27fd390ac6048f
Python
863752027z/lab_server
/micro_detect/get_file.py
UTF-8
1,173
2.625
3
[]
no_license
import os import torch.utils.data as Data from torchvision import transforms, datasets def get_path(base_path): path_list = [] for root, dirs, files in os.walk(base_path): for i in range(len(dirs)): temp_path = base_path + '/' + dirs[i] path_list.append(temp_path) break...
true
bd245d25908174a44c070e4c0f1e61f966ea00ac
Python
tastypotinc/Taiwan_Stock_info
/python_code_for_ref/old_version_get_stock/html_parser.py
UTF-8
6,074
2.96875
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- #這裡將日盛網頁資料,分成index, data兩個檔案切出需要的文字後,再合併 #最後再重新整理資料,因為網頁的資料表格,有橫、直之分,所以資料有些分散 #要注意網頁的編碼、<p>標籤會多一次的取值 #import htmldom from htmldom import htmldom def html_parser(path_time,path_stock,path_file): #print(path_time) #print(path_file) #print(path_file) print("w...
true
7c3cc3f23d778f253d196186767ddf79987c8f39
Python
eegnom1807/raspy_led_pwm
/test_files/led.py
UTF-8
249
2.953125
3
[]
no_license
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(7, GPIO.OUT) led = GPIO.PWM(7, 100) led.start(0) while True: led.start(0) for i in range(0, 100, 25): print(i) led.ChangeDutyCycle(i) time.sleep(0.5)
true
7d85888493b1250740d3078308ae266802048f4f
Python
esineokov/ml
/lesson/8/exercise/1.py
UTF-8
454
3.03125
3
[]
no_license
class Data: data = None def __init__(self, data): Data.data = data @classmethod def parse(cls): return list(map(int, cls.data.split("-"))) @staticmethod def validation(): day, month, year = tuple(Data.parse()) return 1 <= day <= 31 and 1 <= month <= 12 and yea...
true
8688242a391fe2f3a775ea64efc3980735e91c1a
Python
tranquansp/KerasTools
/Dev/rl/agents/pg.py
UTF-8
2,591
3
3
[ "MIT" ]
permissive
#!/usr/bin/env python3 # Policy algorithm by https://github.com/DeepReinforcementLearning/DeepReinforcementLearningInAction # Distributed there under the MIT license import catch import numpy as np import keras grid_size = 10 l1 = grid_size*grid_size*3 l2 = 150 l3 = 3 learning_rate = 0.001 def generate_model(): ...
true
e860a91a4766c1c0997010178744c262d5dd2b2a
Python
frank12a/Gemma-
/XXX.py
UTF-8
1,736
3.9375
4
[]
no_license
class Foo(object): pass class Bar(Foo): pass class WW(Foo): pass # obj = Bar() # obj1 = WW() # isinstance用于判断,对象是否是指定类的实例 (错误的) # isinstance用于判断,对象是否是指定类或其派生类的实例 # print(isinstance(obj, Foo)) # print(isinstance(obj, Bar)) # print(isinstance(obj1, Foo)) # print(type(obj) == Bar) # print(type(obj) == ...
true
05013dc748902d5b680fb6aece184c36d3627476
Python
ice-bear-git/PyQt5-learn
/GUI/Basic-train/PyQtGraph/graph.py
UTF-8
3,555
2.59375
3
[]
no_license
# import pyqtgraph.examples # pyqtgraph.examples.run() #!/bin/bash # -*- coding: UTF-8 -*- import pyqtgraph as pg import sys import numpy as np import PyQt5 # 基本控件都在这里面 from PyQt5.QtWidgets import QApplication, QMainWindow, QDesktopWidget, QStyleFactory, QWidget from PyQt5.QtGui import QPalette, QColor from PyQt5.Qt...
true
11195cf9bec61a758e7daf6be9d8b0ab2aa7d8b9
Python
PhilippeOlivier/wsp
/tools/generate.py
UTF-8
3,387
2.96875
3
[]
no_license
# -*- coding: utf-8 -*- ################################################################################ # # This script generates a batch of 'num_instances' instances of size # 'num_items'. Every instance shares the same item weights, but has a different # cost matrix. This script takes as its only argument batch n...
true
10ca4a6c709a74ed60bb1c1d17b19782ddd1d356
Python
byAbaddon/Advanced-Course-PYTHON-May-2020
/3.0 Multidimensional Lists - Lab/04. Symbol in Matrix.py
UTF-8
337
3.53125
4
[]
no_license
import sys size_matrix = int(input()) matrix = [] for _ in range(size_matrix): matrix.append(input()) symbol = input() for row in range(len(matrix)): for col in range(len(matrix[row])): if matrix[row][col] == symbol: print((row,col)) sys.exit() print(symbol, 'does not occur...
true
71961edab22183c51747f3f7ff6806efc044b51a
Python
ahmedeltaweel/searchly
/main.py
UTF-8
707
2.640625
3
[ "MIT" ]
permissive
import sys from utils import process_docs, valid_pathes, perform_scored_search def main(): """ Main application entrypoint, bootstrap the indexer and db. """ if len(sys.argv) < 2: sys.exit('Please, provide a valid system dir path') if not valid_pathes(sys.argv[1:]): sys.exit('{} ...
true
26470eee09ecce31079978cab58864fd2b98a0f5
Python
phuchduong/essencero_restoration
/scripts/legacy/test_codecs.py
UTF-8
1,437
2.828125
3
[ "Apache-2.0" ]
permissive
# Encodings # Codec | Aliases | Languages # cp850 | 850, IBM850 | Western Europe # cp1252 | windows-1252 | Western Europe # latin_1 | iso-8859-1, iso8859-1, 8859,...
true
c0e359bbf80796e23aa10057f2fb92d2caa6a567
Python
Paccy10/flask-ecommerce-api
/api/models/user.py
UTF-8
807
2.796875
3
[]
no_license
""" Module for User Model """ from .database import db from .base import BaseModel class User(BaseModel): """ User Model class """ __tablename__ = 'users' firstname = db.Column(db.String(100), nullable=False) lastname = db.Column(db.String(100), nullable=False) email = db.Column(db.String(100),...
true
46b788e74b608fcc997319150e07782dfc907ff6
Python
njk8/AI-labs
/lab1/myvacuumagent.py
UTF-8
11,814
2.59375
3
[]
no_license
from lab1.liuvacuum import * from random import randint DEBUG_OPT_DENSEWORLDMAP = False AGENT_STATE_UNKNOWN = 0 AGENT_STATE_WALL = 1 AGENT_STATE_CLEAR = 2 AGENT_STATE_DIRT = 3 AGENT_STATE_HOME = 4 AGENT_DIRECTION_NORTH = 0 AGENT_DIRECTION_EAST = 1 AGENT_DIRECTION_SOUTH = 2 AGENT_DIRECTION_WEST = 3 ...
true
c075f96228e6d93b781e93b3d164a94db8b1441d
Python
abechoi/My_Python
/ABSP/login.py
UTF-8
239
3.15625
3
[]
no_license
myFile = open('secretFile.txt') secret = myFile.read() print("enter password:") password = input() if password == secret: print("access granted!") if password == "12345": print("weak password!") else: print("access denied")
true
9f395f44e360e1ab39842759e355b75279fd6a09
Python
poudrenoire/dessin
/dessin.py
UTF-8
1,169
2.734375
3
[ "CC0-1.0" ]
permissive
# Génère des dessins aléatoirement import turtle import random import time import tkinter import uuid screen = turtle.Screen() screen.colormode(255) turtle.speed(9) # Générateur de dessins for _ in range(25): turtle.pencolor(random.randint(0,255), random.randint(0,255), random.randint(0,255)) turtle.left(random.r...
true
3308d861d4caf309be6e36b95c03f8eb757ebc06
Python
goushan33/PycharmProjects
/learn_notes/leetcode/circul_queue.py
UTF-8
687
3.984375
4
[]
no_license
#基于数组实现循环队列 class CirculQueue(object): def __init__(self,capacity): self.items=[None]*capacity self.n=capacity self.head=0 self.tail=0 #入队 def enqueue(self,val): #队列已满 if (self.tail+1)%self.n==self.head: return False self.items[self.tail]...
true
2820b4c353ef886f77af7648aacb9aac740a73c9
Python
tianhanl/wiki-scrapper
/get_polling.py
UTF-8
1,052
2.765625
3
[]
no_license
import sys # This filed is created to allow get polling data and save them using command line # Usage: python3 get_polling.py "query" path = './pollings/' if __name__ == '__main__': from sys import argv import wiki import re if len(argv) < 2: print('usage: python3 get_polling "query"') els...
true
3ed25158647eed962f409010c514bf7136f65e09
Python
ricardojoserf/triangle-position
/tripos.py
UTF-8
4,096
2.671875
3
[]
no_license
import re, time, os, math, argparse from geopy.distance import vincenty, great_circle from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np import sys from plot import drawMap def get_args(): parser = argparse.ArgumentParser() parser.add_argument('-c1', '--coordenadas1', requir...
true
abee29231b412daea132f3307fe118a632b1d979
Python
ihuei801/leetcode
/MyLeetCode/python/Count of Smaller Numbers After Self.py
UTF-8
2,008
3.109375
3
[]
no_license
### # Merge Sort # Time Complexity: O(nlogn) # Space Complexity: O(logn) + O(n) ### class Solution(object): def merge_sort(self, nums, start, end, small): if end - start <= 1: return mid = (start + end) / 2 self.merge_sort(nums, start, mid, small) self.merge_sort(nums, m...
true
b87a86f5efb9921952db4aedd83024721605ed3e
Python
ynikitenko/lena
/lena/flow/group_by.py
UTF-8
2,415
3.5625
4
[ "Apache-2.0" ]
permissive
"""Group data using :class:`.GroupBy` class.""" import lena.core import lena.flow class GroupBy(object): """Group values. Data is added during :meth:`update`. Groups dictionary is available as :attr:`groups` attribute. :attr:`groups` is a mapping of *keys* (defined by *group_by*) to lists of item...
true
c6eae374051020483d4800b01b6d0898a5d935c1
Python
Aasthaengg/IBMdataset
/Python_codes/p03545/s786987870.py
UTF-8
345
2.6875
3
[]
no_license
def main(): S = list(str(input())) LenP = 3 ans = 0 for i in range(2**LenP): P = ["-"]*LenP for j in range(LenP): if i >> j & 1: P[j] = "+" Res = [None] * (len(S)+len(P)) Res[1::2],Res[::2] = P,S ResEval = "".join(Res) if eval(ResEval) == 7: ans = ResEval+"=7" print(ans) break if __name...
true
3f1f758fe269fa14b1be6ef4e429322743450bef
Python
ahmad0790/stock-trading-machine-learning-algos
/DTLearner.py
UTF-8
7,547
2.953125
3
[]
no_license
""" Name: Ahmad Khan GT ID: akhan361 """ import numpy as np import pandas as pd import matplotlib.pyplot as plt import time from scipy import stats import datetime as dt class DTLearner(object): def __init__(self, leaf_size = 1, verbose = False): pass # move along, these aren't the drones you're looking...
true
b7747baf6a008469937415e9da53f2a9b2679a0f
Python
MichalKacprzak99/Vpython
/lab6/zad2.py
UTF-8
856
3.015625
3
[]
no_license
import random import numpy as np import matplotlib.pyplot as plt plt.style.use('classic') x0=0 y0=0 X=[] Y=[] X.append(x0) Y.append(y0) sum=0 tmp=0 i=1 while(sum<10**6): r = random.uniform(0, 100) if r < 1.0: x = 0 y = 0.16*y0 elif r < 86.0: x = 0.85*x0 + 0.04*y0 y = ...
true
4179ac05fd53902821f1a25fbafadb50a16e036b
Python
timber8/ComputerVision
/demo.py
UTF-8
7,580
3.109375
3
[]
no_license
import cv2 #to show the image import numpy as np from math import cos, sin import os def find_biggest_contour(image): # Copy image = image.copy() image, contours, hierarchy = cv2.findContours(image, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) # Isolate largest contour contour_sizes = [(cv2.conto...
true
0e2cc31f8b44d787a8ca62f3ac5d90ec735a78ae
Python
lzxysf/python
/cli/python_003_variable.py
UTF-8
2,991
4.34375
4
[]
no_license
# coding=utf-8 # python的数据类型:数字、字符串、复数,列表、元组、字典 import json a = b = c = 1 a, b, c = 1, 3.4, 'alice' s = "hello world!" x = '你好' print(s[1:7]) # 前包含后不包含 print(s[1:]) print(s[-1:-5]) # 倒着数时候是前不包含后包含 print(s[:-1]) print(s+x) print(x*2) # 列表可以包含数字、字符串、另一个列表 # 列表用[]表示,元素之间用,隔开 list = ['runoob', 786, 2.23, 'john', 70.2]...
true
563421cf4c5c78a911efae765ba929b96b17f24a
Python
alexlwn123/kattis
/Python/Karte.py
UTF-8
415
2.71875
3
[]
no_license
import sys deck = set() line = str(sys.stdin.readline()) for i in range(len(line) // 3): if (line[i*3: i*3+3]) in deck: print("GRESKA") break else: deck.add(line[i*3:i*3+3]) else: P = sum(1 for x in deck if x.startswith('P')) K = sum(1 for x in deck if x.startswith('K')) H = sum(1 for x in deck if x.st...
true
36dfb3d566efde9a99d80a40a6972fc9ab7ef30b
Python
zhushh/PythonCode
/basicStudy/func_local_var.py
UTF-8
171
3.234375
3
[]
no_license
#!/usr/bin/env python # Filename: func_local_var.py def func(x): print 'x is', x x = x + 1 print 'change local x to', x x = 32 func(x) print 'x is still', x
true
010e2385ac90107cf6e0ed7d0e7b666307ce3997
Python
notbdu/tf-mnist
/mnist_basic_nn.py
UTF-8
5,743
3.625
4
[ "MIT" ]
permissive
#!/usr/bin/env python """ An example of implementing multinomial logistic (softmax) regression with a single layer of perceptrons using Tensorflow Ouput: Confidence prediction (as an array) of which class an observation in the class belongs to """ import time import tensorflow as tf from tensorflow.examples.tutoria...
true
4cca3d99292b01445cf8ccbeae0529932759081b
Python
vidmo91/imgcode
/imGcode/env_imGcode/Lib/site-packages/matplotlib/tests/test_artist.py
UTF-8
9,061
2.640625
3
[ "Apache-2.0" ]
permissive
import io from itertools import chain import numpy as np import pytest import matplotlib.pyplot as plt import matplotlib.patches as mpatches import matplotlib.lines as mlines import matplotlib.path as mpath import matplotlib.transforms as mtransforms import matplotlib.collections as mcollections import matplotlib.ar...
true
707c841c33d2550c92c6665949ab433af6e7889b
Python
mgarkusha/GB-Python
/Урок1/hw01_normal.py
UTF-8
1,383
4.40625
4
[]
no_license
# Задача-1: Дано произвольное целое число, вывести самую большую цифру этого числа. import math num = int(input('Введите число: ')) razryad=int(math.log10(num)) i=0 while razryad >=0: k = int(num / (10**razryad)) print ('цифра',k) num -= 10**razryad*k razryad -= 1 if i==0 : bigNumber = k elif k > bigNumber : ...
true
283fc1b8f9f273bd39b00f4e510acb1c57949857
Python
mengjian0502/eee511_team03_finalproject
/eyeclosure/eyeclosure_extract.py
UTF-8
1,501
2.515625
3
[ "MIT" ]
permissive
""" """ import numpy as np import torch from six.moves import cPickle as pickle pickle_files = ['./open_eyes.pickle', './closed_eyes.pickle'] i = 0 for pickle_file in pickle_files: with open(pickle_file, 'rb') as f: save = pickle.load(f) if i == 0: train_dataset = save['train_dataset']...
true
3ef840bace16b1d0ed336cf18c5904407cdde3d0
Python
zingpython/kungFuShifu
/day_two/6.py
UTF-8
185
3.65625
4
[]
no_license
dictonary = {"A":6,"B":4,"C":1,"D":3,"E":4,"F":1} search_value = 5 result = [] for key in dictonary.keys(): if dictonary[key] == search_value: result.append(key) print(result)
true
93495f78f5265a1804dc1087adb55d4b8a7b8ccb
Python
nucleomis/Archivos_Python
/ejercicios 1er año/promedio de altura.py
UTF-8
719
4.28125
4
[]
no_license
#Cargar por teclado y almacenar en una lista las alturas de 5 personas # (valores float) #Obtener el promedio de las mismas. #Contar cuántas personas son más altas que el promedio y cuántas más bajas. altura=[] menor=[] mayor=[] for x in range(5): ingreso=float(input("ingrese una altura: ")) altura.append(ing...
true
59c6ad7766c5907acae83197faa927afe21e9203
Python
agronholm/anyio
/src/anyio/streams/buffered.py
UTF-8
4,500
2.9375
3
[ "MIT" ]
permissive
from __future__ import annotations from collections.abc import Callable, Mapping from dataclasses import dataclass, field from typing import Any from .. import ClosedResourceError, DelimiterNotFound, EndOfStream, IncompleteRead from ..abc import AnyByteReceiveStream, ByteReceiveStream @dataclass(eq=False) class Buf...
true
2f06182b39e06d28e9a336f3a9f3b631c483b843
Python
AreebaShakir/Initial-Tasks
/task3.py
UTF-8
893
3.015625
3
[]
no_license
from flask import Flask, request, jsonify import operator app = Flask(__name__) def reverse(func): def inner(): data = request.get_json() op = data['op'] inverse = {"+": "-", "-": "+", "*":"/", "/":"*"} data['op...
true
619e8b2343643c93e5eb255b24b575aaae8b8deb
Python
antrad1978/bigdata
/PySpark/json1.py
UTF-8
669
2.953125
3
[]
no_license
# Spark from pyspark import SparkContext # Spark Streaming from pyspark.streaming import StreamingContext # Kafka from pyspark.streaming.kafka import KafkaUtils # json parsing import json sc = SparkContext(appName="json") sc.setLogLevel("WARN") import json def jsonParse(dataLine): parsedDict = json.lo...
true
549e190b1aea9c2f5968a24739e2296afda06d1b
Python
PPodhorodecki/Prework
/02_Typy_danych_w_Pythonie/Zadanie_1-Typy_danych/task.py
UTF-8
373
3.625
4
[]
no_license
calkowita=5 rzeczywista=3.14 tekst="Python" tak=True result="Zmienna {} ma wartość {}".format("całkowita", calkowita) print(result) result="Zmienna {} ma wartość {}".format("rzeczywista", rzeczywista) print(result) result="Zmienna {} ma wartość {}".format("tekstowa", tekst) print(result) result="Zmienna {} ma warto...
true
42db02aefdf3f91c213a6ec556e61b25e9bb5b2e
Python
FreulonManon/fakenews
/arc.py
UTF-8
2,554
2.734375
3
[]
no_license
import arcpy import json import tweepy import time import csv from tweepy.streaming import StreamListener #Enter Twitter API Key information obtenu en créant une api twitter consumer_key = '' consumer_secret = '' access_token = '' access_secret = '' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set...
true
caa06eb951cd2e06db4c402db3a79fda9d27b8e7
Python
csc522nbagroup/playoffsandsalary
/all 2.py
UTF-8
2,492
2.546875
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Nov 9 12:39:30 2018 @author: shaohanwang """ import pandas as pd import numpy as np train_data=pd.read_csv('all.csv') train_data['Playoffs'] = train_data['Playoffs'].map({'Y': 1, 'N': 0}) train_data=train_data.dropna(axis='columns') x=train_data.iloc...
true
96be8996f29fb4f34eb3e423e662cad74d5c17d7
Python
AtharvaBhagat/email-using-python
/sendEmailUsingVoice.py
UTF-8
1,621
2.84375
3
[]
no_license
# pip install pyttsx3 # pip install SpeechRecognition import pyttsx3 import speech_recognition as rec import smtplib from email.message import EmailMessage from win10toast import ToastNotifier notify = ToastNotifier() listener = rec.Recognizer() engine = pyttsx3.init() voices = engine.getProperty('voice...
true
2ac918164fb69f90dd53256157aa2253c55960bc
Python
soareswallace/mit-deep-learning
/tutorial_mnist/plot_images.py
UTF-8
275
2.9375
3
[ "MIT" ]
permissive
import matplotlib.pyplot as plt def plot_images(features, labels): plt.figure(figsize=(10,2)) for i in range(5): plt.subplot(1, 5, i+1) plt.xticks([]) plt.yticks([]) plt.grid(False) plt.imshow(features[i], cmap=plt.cm.binary) plt.xlabel(labels[i]) plt.show()
true
542959fbd1899f6b9f0120d07e49f075a1aecc9b
Python
StrikeR2018/TDD
/question1/third_test/test_fizzbuzz.py
UTF-8
827
3.046875
3
[]
no_license
import unittest import fizzbuzz class testCase(unittest.TestCase): def test_case_1(self): self.assertEqual(fizzbuzz.fizzBuzz(3), "Fizz") def test_case_2(self): self.assertEqual(fizzbuzz.fizzBuzz(5), "Buzz") def test_case_3(self): self.assertEqual(fizzbuzz.fizzBuzz(15), "not multiple...
true
b98482805d6241de565adfe11fe620589ab15bea
Python
BorisMs55/django-handy
/django_handy/url.py
UTF-8
1,247
2.6875
3
[ "MIT" ]
permissive
from urllib.parse import parse_qs, urlencode, urlsplit, urlunsplit def simple_urljoin(*parts, append_slash=False): """Normalize url parts and join them with a slash.""" parts = list(map(str, parts)) schemes, netlocs, paths, queries, fragments = zip(*(urlsplit(part) for part in parts)) scheme = _last(s...
true
74c78bc28df423b759eb70b1ecad935248610bc1
Python
Uthreloss/hearts_pepper
/scripts/make_map.py
UTF-8
2,191
2.84375
3
[ "MIT" ]
permissive
#!/usr/bin/env python from pepper_controller import PepperController import numpy # pip install pillow try: from PIL import Image except ImportError: import Image robotIP = "westey.local" #Stevey PORT = 9559 class MakeMap(PepperController): def startingVariables(self): ## Verbal confirmation i...
true
d571080961ba901443d8276cf27c5e64000dab00
Python
LancerEnk/softwareTesting_Work3
/Code_ForModified/Task9/wrong_5_032.py
UTF-8
601
3.984375
4
[]
no_license
# Task 9: wrong_5_032 # 错误原因:使用replace()函数对首字母进行处理时,只是将替换后的首字母赋给了b,但没有给b增加非首字母的字符串,因此应该在后续为b补上a的后续字母。 # 修改方法:为b赋予a的后续字符串,使用python中string的截取方法。 def fun(input): a = input if a[0].isupper() == True: return(a) elif a[0].isupper() == False: b = a[0].replace(a[0],a[0].upper(),1) b+=a[1:] return(b) # 获取输入数值时的代...
true
5b6514e1053ccaeecb2adf26937b71e2a674f430
Python
maliciousgroup/BugBountyConsole
/src/core/command/ExitCommand.py
UTF-8
585
2.546875
3
[]
no_license
import asyncio from src.core.command.base.BaseCommand import BaseCommand class ExitCommand(BaseCommand): helper: dict = { 'name': 'exit', 'help': 'This command will gracefully exit the application', 'usage': 'exit' } def __init__(self, command: str, print_queue: asy...
true
dc43503080966efb3cc6ee909b8a2eb569c589ba
Python
zhongsangyang/PythonSimpleTest
/testPython/com/ht/pachogn/testnew.py
UTF-8
4,170
2.859375
3
[]
no_license
# coding=utf-8 import urllib import json from urllib import request import re import os class CrawlOptAnalysis(object): def __init__(self,search_word="美女"): self.search_word = search_word self.headers={ 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)...
true
b829943cbe955cb595d080f8811fb2cf2b289a7a
Python
sumsar01/Lattice-gauge-theory
/Spin_1_fields/Projector_advanced.py
UTF-8
2,480
2.578125
3
[]
no_license
from Gauss_law_advanced import * from Storage import * from qutip import * from itertools import product import itertools as itertools import numpy as np ############################################################################### # Making projection ################################################################...
true
e924030346aa50175885f0203c7ce0678c2f3dd5
Python
Scoowy/PythonLuisa
/tareanro1sb_a---expresiones-regulares-lfbermeo-main/src/problem2.py
UTF-8
372
3.15625
3
[ "MIT" ]
permissive
import re # Completar la función regex_ayuda para que tome una expresión regular (como una cadena) y # una cadena a la que desea aplicar la expresión regular. # La función debe devolver una lista con todas las apariciones del patrón en la cadena. def regex_ayuda(patron, cadena_entrada): pattern = re.compile(patr...
true
c762eb94b2994f9ca2566fb73bba5b0f176d1fe1
Python
Nivek-Stack/CPS3320
/Project2/WordFinder.py
UTF-8
881
4.15625
4
[]
no_license
from dictionary import * dictionary = Dictionary() # pip install dictionary # words.txt OR A.txt words = [] # Empty List that will store everything from the word file. new_words = [] # Empty List to make Strings later on. f = open('words.txt', 'r') # Opens the File in read mode only. words = f.read().splitl...
true
44d7f596e9fad288916c6c4b9ad87bb858eec3d3
Python
leandrogpv/chatbot-whats
/bot_whats.py
UTF-8
6,036
2.796875
3
[]
no_license
# -*- coding: utf-8 -*- from time import sleep from selenium.webdriver.common.keys import Keys ''' Bugs identificados a serem corrigios: *_Caso houver mensagens diferentes do mesmo remetente que chegaram no mesmo minuto ele nao considera como duas mensagens e acaba nao lendo a ultima *_Caso nao h...
true
664fac06d8c70d7fdc08bb21d3eb88db5bce74c3
Python
chandlersupple/Color-Pass-Filter
/ColorPassFilter.py
UTF-8
2,876
3.234375
3
[ "MIT" ]
permissive
# Chandler Supple, 6/2/2018 # The algorithm may be unresponsive for a few seconds after having initialized depending on the file size. # To add, some '.jpg' images may not work due to the PIL library. import io import pygame from PIL import Image from urllib2 import urlopen url = raw_input('Image Url (png, jpg): ') ...
true
c8fec20fce52112171d2941c2bc50bb41483bf07
Python
Charleezy/WinrateForFamiliarChamps
/api_wrapper/api_wrapper.py
UTF-8
6,318
2.84375
3
[]
no_license
from urllib.parse import urlencode import urllib.request from urllib.error import HTTPError from API_KEY import API_KEY import time import logging import json import threading import queue SHORT_TIME_LIMIT = 11 SHORT_MAX_REQUESTS = 10 LONG_TIME_LIMIT = 605 LONG_MAX_REQUESTS = 500 MAX_REQUEST_HTTP_CODE = 429 HIGHES...
true
387c054696079f389983c3bfdae887a398fe4b05
Python
brenda151295/scripts_AmazonBooks
/insertTableSalesRank.py
UTF-8
1,752
2.734375
3
[]
no_license
# Importing MongoClient. from pymongo import MongoClient # Importing MySQL Connector. import mysql.connector import pymysql # Connecting to MySQL. mysql_conn = mysql.connector.connect(user='root', password='1234', port="3306", host='127.0.0.1', database='books_dataset') # Geting the product details from 'asin'. def...
true
a99267e5f9797818aa37abe12a12462b266fea13
Python
spuddie1984/Python3-Basics-Book-My-Solutions
/Graphical User Interfaces/review_exercises_geometry_manager.py
UTF-8
694
3.65625
4
[]
no_license
import tkinter as tk ''' 1. Try to re-create all the screenshots in this section without looking at the source code ''' window = tk.Tk() frame1 = tk.Frame(master=window, width=500, height=100, bg="red") frame1.pack(fill=tk.BOTH, side=tk.LEFT, expand=True) frame2 = tk.Frame(master=window, width=100, bg="yellow") frame...
true
aa6e9b87ddcd785d96235d43b41c314d9967ab60
Python
LukeChai/PythonExercise
/python basic/dataStructure.py
UTF-8
1,399
4.375
4
[]
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- # Filename: dataStructure.py # 数据结构 # 列表的基本操作 a = [3, 2, 34, 12.3] print(a) # 添加一个元素到列表后面 a.append(15) print(a) # 查看元素的位置 print(a.index(34)) # 移除一个元素 a.remove(2) print(a) # 翻转列表 a.reverse() print(a) # 排序 a.sort() print(a) # 元组的基本操作,元组的值不会被改变 b = ("a", "b", "c") print(b) print...
true
92ef8c5b517957114740debdaab86be468889bf8
Python
jacenfox/psd-tools2
/src/psd_tools/utils.py
UTF-8
2,746
2.84375
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, unicode_literals, print_function import sys import struct import array try: unichr = unichr except NameError: unichr = chr def unpack(fmt, data): fmt = str(">" + fmt) return struct.unpack(fmt, data) def read_fmt(fmt, fp): ...
true
f6187ec82a6e8091edc5f45deface464fdd87115
Python
AbbyGeek/CodeWars
/8kyu/Calculate Average.py
UTF-8
112
3.078125
3
[]
no_license
def find_average(array): if len(array) == 0: return 0 else: return sum(array)/len(array)
true