seq_id
stringlengths
4
11
text
stringlengths
113
2.92M
repo_name
stringlengths
4
125
sub_path
stringlengths
3
214
file_name
stringlengths
3
160
file_ext
stringclasses
18 values
file_size_in_byte
int64
113
2.92M
program_lang
stringclasses
1 value
lang
stringclasses
93 values
doc_type
stringclasses
1 value
stars
int64
0
179k
dataset
stringclasses
3 values
pt
stringclasses
78 values
23931141323
from os import urandom SECRET_KEY = urandom(50) PROPAGATE_ECEPTIONS = True # Database Configuration SQLALCHEMY_DATABASE_URI = 'sqlite:///crews.sqlite' SQLALCHEMY_TRACK_MODIFICATIONS = False SHOW_SQLALCHEMY_LOG_MESSAGES = False ERROR_404_HELP = False
maucoderGit/One-Piece-Flask-API
config/default.py
default.py
py
254
python
en
code
0
github-code
1
6154548013
import os import random import shutil from django.views.decorators.csrf import csrf_exempt from django.http import ( HttpResponse, HttpResponseForbidden, HttpResponseServerError ) from django.conf import settings from license_protected_downloads.models import APIKeyStore, APILog from license_protected_dow...
NexellCorp/infrastructure_server_fileserver
license_protected_downloads/uploads.py
uploads.py
py
3,966
python
en
code
0
github-code
1
3834552212
import numpy as np from utils.text_analyzer import TextStats from utils.text_analyzer import compute_score from utils.dictionary import Dictionary from itertools import permutations as permutations def crack_transposition(stats: TextStats, dictionary: Dictionary, verbose: bool=False): """ Method to crack tabl...
draliii/Cracker
crackers/transposition.py
transposition.py
py
6,254
python
en
code
0
github-code
1
31966900393
import logging import subprocess as sp import numpy as np from t2v.config.root import RootConfig class VideoInput: def __init__(self, cfg: RootConfig, video_path: str): """ VideoInput reads frames from a given video file which can be used as init images for individual frame generation ""...
sbaier1/pyttv
t2v/input/video_input.py
video_input.py
py
2,724
python
en
code
35
github-code
1
26426724167
# 더 효율적인 로직으로 풀어보기 from collections import defaultdict,deque; import copy n, q = map(int, input().split()) n2 = 2**n g = [ list(map(int,input().split())) for _ in range(n2)] qrr = list( map(int, input().split()) ) visit = [ [False]*n2 for _ in range( n2)] # 2L × 2L --> 회전 90도 dir = [(-1,0),(1,0),(0,-1),(0,1)] summ = 0...
dohui-son/Python-Algorithms
simulation_samsung/b20058_마법상어와파이어스톰.py
b20058_마법상어와파이어스톰.py
py
2,729
python
en
code
0
github-code
1
8691021729
from typing import List from collections import defaultdict, deque # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def verticalOrder(self, root: TreeNode) -> List...
songkuixi/LeetCode
Python/Binary Tree Vertical Order Traversal.py
Binary Tree Vertical Order Traversal.py
py
694
python
en
code
1
github-code
1
14802591258
import numpy import numpy as np def load_matrix(filename: str): matrix = [] with open(filename, 'r') as matrix_file: for line in matrix_file: matrix.append([int(x) for x in line.split()]) return matrix def matrix_comparison(m1: np.ndarray, m2: np.ndarray): if (m1.shape[0] != m2....
lexxamcode/parallel_matrix_multiplication
multiplication_checker.py
multiplication_checker.py
py
1,437
python
en
code
1
github-code
1
39634062134
import turtle import random import math from tkinter.simpledialog import* inStr='' swidth,sheight=500,500 tX,tY,txtSize=[0]*3 val=0 r=1 turtle.title('거북이 나선형으로 글쓰기') turtle.shape('turtle') turtle.setup(width=swidth+50,height=sheight+50) turtle.screensize(swidth,sheight) turtle.penup() inStr=askstring('문자열 입력','거북이 쓸...
kyungkkk/python2
나선형 거북이2.py
나선형 거북이2.py
py
696
python
en
code
0
github-code
1
34690753869
# -*- coding: utf-8 -*- import asyncio import gi gi.require_version("GUPnP", "1.0") from gi.repository import GUPnP import urllib.request import urllib.parse from xml.etree.ElementTree import XML, XMLParser from xmlutils import StripNamespace from cameraremoteapi import CameraRemoteApi # from utils import debug_trace...
franckinux/sony-camera-remote-control
cameraremotecontrol.py
cameraremotecontrol.py
py
2,268
python
en
code
1
github-code
1
5806628875
# -*- coding: utf-8 -*- import config import telebot from room import Room from functools import partial from random import shuffle bot = telebot.TeleBot(config.token) imagi_room = Room @bot.message_handler(commands=['start']) def start(message): # kb = telebot.types.ReplyKeyboardMarkup(resize_keyboard=True, on...
pirr/imagination_bot
bot.py
bot.py
py
5,306
python
en
code
0
github-code
1
25675891462
# coding:utf-8 from Tkinter import * root = Tk() root.title("Entry") root.minsize(400, 300) e=Entry(root) e.pack(padx=20,pady=20) e.delete(0, END) e.insert(0, "默认文本....") mainloop()
52ai/load2python
PythonGUI学习/Tkinter/tk_entry.py
tk_entry.py
py
195
python
en
code
8
github-code
1
1020282111
import glob import pandas as pd import seaborn as sns import matplotlib.pyplot as plt def plot_figure(data, x, y, filename, figsize=(24, 9), log_scale=False): sns.set(font_scale=1.5) plt.style.use("seaborn-poster") fig, ax = plt.subplots(figsize=figsize, dpi=300) g = sns.barplot(x=x, y=y, hue="Meth...
dmitrisaberi/bndads
bandits/scripts/plot_results.py
plot_results.py
py
5,119
python
en
code
0
github-code
1
23716035381
from typing import Optional from fastapi import APIRouter, Form from Deployment.ConsumerServices.GeneralService import DownloadImageFromURLServiceTask, ParseImageFromBase64ServiceTask from Deployment.ConsumerServices.RecaptchaService import Captcha1RecognizeServiceTask from Deployment.server_config import IS_MOCK fro...
novioleo/Savior
Deployment/DispatchInterfaces/RecaptchaInterface.py
RecaptchaInterface.py
py
2,146
python
en
code
135
github-code
1
6714140725
# -*- coding: utf-8 -*- # @Author: solicucu import sys sys.path.append('..') import os import argparse import logging import time import openpyxl as xl import torch import torch.nn as nn from config import cfg from torch.backends import cudnn from utils import setup_logger, R1_mAP from data import make_data_l...
solicucu/ReID
FasterReID/main/train.py
train.py
py
8,054
python
en
code
8
github-code
1
23291776654
import sys import datetime configFile = open(sys.argv[1], 'r') symbolList = [] for line in configFile: symbol = line.split(';', 1) symbol[1] = symbol[1][:-1] #remove trailing \n symbol[0] = symbol[0].replace('\\n', '\n'); #remove escaping \\n symbol[1] = symbol[1].replace('\\n', '\n'); #remove escapin...
kozak127/textTools
textPreprocessor/textReplacer.py
textReplacer.py
py
808
python
en
code
0
github-code
1
34872633018
import time import RPi.GPIO as GPIO # import torch # import torchvision.transforms as transforms import math from src.rmd_x8 import RMD_X8 # from rmd_x8 import RMD_X8 import time from huskylib import HuskyLensLibrary import math GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.IN) GPIO.setup(26, GP...
strikerPro818/strikerBot
convertVoltageTest.py
convertVoltageTest.py
py
8,953
python
en
code
0
github-code
1
36862329178
import logging import numpy import matplotlib # Force matplotlib to not use any Xwindows backend. matplotlib.use('Agg') from matplotlib import pyplot as plt def plot_pixels(file_name, candidate_data_single_band, reference_data_single_band, limits=None, fit_line=None): logging.info('Display: Cre...
planetlabs/radiometric_normalization
radiometric_normalization/display.py
display.py
py
2,162
python
en
code
33
github-code
1
10242683668
# pedra = 0 # papel = 1 # tesoura = 2 # lagarto = 3 # spock = 4 stuff = {"pedra" : 0, "papel" : 1, "tesoura" : 2, "lagarto" : 3, "spock" : 4} results = [ [0, -1, 1, 1, -1], [1, 0, -1, -1, 1], [-1, 1, 0, 1, -1], [-1, 1, -1, 0, 1], [1, -1, 1, -1, 0] ] n = int(input()) for i...
lvirgili/programming_challenges
uri/uri1873.py
uri1873.py
py
555
python
en
code
5
github-code
1
25465189047
# -*- coding: utf-8 -*- """ Created on Thu Jul 9 08:39:51 2020 @author: AAYUSH pc """ import numpy as np l=[1,2,3,4] arr=np.array(l) print('elements') for i in arr: print(i) #only one type of data can be stored in numpy
ayush-mech-github/python-practice
spyder/numpy/intro3.py
intro3.py
py
233
python
en
code
0
github-code
1
42969228959
#!/usr/bin/env python3 import rospy from std_msgs.msg import Float64, Bool # Creating a publisher def talker(poly): # Defining the publisher, with the name of the topic, type of message, and number of queue pub_x2 = rospy.Publisher('x2', Float64, queue_size=10) pub_x1 = rospy.Publisher('x1', Float64, q...
AutoMecUA/VisionAndRosWorkshop
second_session/ros_pubandsub.py
ros_pubandsub.py
py
1,592
python
en
code
1
github-code
1
26972361076
satir =0 sutun =0 satir = int(input("Satir sayınısı giriniz")) sutun = int(input("Sutun sayısını giriniz")) matriks = [] matriks2 = [] matriksToplam = [] for i in range(satir): matriks += [[satir] * sutun] # 1. matriksi doldurma for i in range(satir): for j in range(sutun): sayi = int(input("Matriks...
onerdinc12/PythonOrnek
matrikstoplama.py
matrikstoplama.py
py
1,020
python
tr
code
0
github-code
1
42911353516
from contextlib import asynccontextmanager from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware def create_app() -> "FastAPI": from prisma import Prisma from app.api.v1 import api from app.core import settings @asynccontextmanager async def lifespan(_app: FastAPI): ...
neuronic-ai/autogpt-ui
backend/src/app/__init__.py
__init__.py
py
967
python
en
code
89
github-code
1
20260289310
def shopdirect(): global activity if activity==8: shoplist=[] sdol=18 for a in range(1,6): dol=int(sdol**a) shoplist.append(('Shop Entry #'+str(a),dol)) b=0 render('rect', arg=((20,40,w-300,h-80), (50,50,50), False),borderradius=10) for a i...
pxkidoescoding/Qlute
data/modules/shopscreen.py
shopscreen.py
py
885
python
en
code
0
github-code
1
42317484911
from domain.index_finder import find_index examples = [ ['A'], ['A', 'B', 'C', 'A', 'C'], ['A', 'A', 'B', 'B', 'C'], ['A', 'B', 'A', 'C', 'A'], ['A', 'B', 'B', 'B'], ['B', 'B', 'B', 'A'] ] for example in examples: print("-" * 100) print(example) print(find_index(example))
dbowers42/index_finder_python
program.py
program.py
py
310
python
en
code
0
github-code
1
15925042278
import curses import io import time from rich.console import Console from rich.table import Table from rich.text import Text from rich import box def main(): # initialize curses screen = curses.initscr() curses.noecho() # turn off key echoing curses.cbreak() # respond to keys immediately (don't wait ...
townsag/terminal_2048
curses_test.py
curses_test.py
py
2,994
python
en
code
0
github-code
1
28459530367
from typing import Iterable from autowsgr.constants.image_templates import IMG from autowsgr.constants.positions import FLEET_POSITION from autowsgr.controller.run_timer import Timer from autowsgr.game.game_operation import MoveTeam from autowsgr.ocr.ship_name import recognize_ship from autowsgr.utils.api_image import...
huan-yp/Auto-WSGR
autowsgr/port/ship.py
ship.py
py
6,025
python
en
code
40
github-code
1
15707900175
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import pytest #set up a browser @pytest.fixture def selenium(base_url): ...
zabojnikp/study
TestLadies/test_sample.py
test_sample.py
py
1,184
python
en
code
0
github-code
1
15564210957
import numpy as np import lime from lime.io import _LOG_EXPORT_DICT # Outputs file_address = 'manga_spaxel.txt' cube_plot_address = 'cube_manga_plot.png' spectrum_plot_address = 'spectrum_manga_spaxel.png' line_plot_address = 'Fe3_4658A_manga_spaxel.png' line_bands_file = f'manga_line_bands.txt' lines_log_file = f'man...
Vital-Fernandez/lime
tests/data_tests/check_saved_values.py
check_saved_values.py
py
3,070
python
en
code
9
github-code
1
23078099282
import requests import traceback import os import SimpleITK as sitk from SimpleITK.utilities.pyside import sitk2qpixmap from SimpleITK.utilities.resize import resize import pandas as pd import numpy as np import inspect from sklearn import metrics import matplotlib.pyplot as plt import tempfile from PySide6.QtWidgets ...
niaid/rap_tb_ntb_service_frontend
tb_ntb_gui.py
tb_ntb_gui.py
py
46,953
python
en
code
1
github-code
1
1160027609
import numpy as np import os import cv2 import trimesh import pickle import json import pycolmap import collections import matplotlib.pyplot as plt from models.pose_estimator import PoseModel from models.human_detector import DetectorModel from .aria_human import AriaHuman from .exo_camera import ExoCamera from utils...
rawalkhirodkar/egohumans
egohumans/lib/datasets/ego_exo_scene.py
ego_exo_scene.py
py
87,259
python
en
code
16
github-code
1
674848454
from typing import Optional, Union import cv2 import numpy as np from sklearn.cluster import KMeans def postprocess(image: np.ndarray, threshold: Optional[Union[str, int]] = None) -> np.ndarray: """Apply postprocessing on alpha prediction to make it appear better. Currently, the postprocessing steps are thre...
maibrahim2016/background_removal
src/postprocessing.py
postprocessing.py
py
1,783
python
en
code
0
github-code
1
3979992268
import getFile import modelResult from flask import Flask, jsonify, render_template, request from flask_cors import CORS from werkzeug.utils import secure_filename from getFile import MongoGridFS app = Flask(__name__) CORS(app) @app.route('/') def serverTest(): return "flask server" #get name from node server a...
uknowsj/flask
code/app.py
app.py
py
1,064
python
en
code
0
github-code
1
3307355256
import time # from pymavlink import mavutil import os import sys cur_path=os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, cur_path+"/../../../Documents/PX4-Autopilot/src/modules/mavlink") from mavlink.pymavlink import mavutil import struct import numpy as np import re from array import array mavutil.se...
AdityaMulgundkar/rrc_fault_tolerant_control
temp/mavlink-test-3.py
mavlink-test-3.py
py
1,238
python
en
code
0
github-code
1
70275561634
""" Scrape projections from Hashtag Basketball """ import datefinder import lxml.html import pandas import requests from datetime import datetime def main(): projections_page = download_projections_page() root = lxml.html.fromstring(projections_page) # parse HTML projections = extract_projections(r...
cdchan/fantasy-basketball
scrape_hashtagbasketball.py
scrape_hashtagbasketball.py
py
2,656
python
en
code
1
github-code
1
27006760976
class Solution(object): """docstring for Solution""" def climbStairs(self, n): result = [ 0 for i in range(n+1)] for i in range(0, n+1): if i == 0: result[0] = 0 if i == 1: result[1] = 1 if i == 2: result[2] = 2 if i > 2: result[i] = result[i-1] + result[i-2] return result[n] solu...
yiqin/HH-Coding-Interview-Prep
Use Python/ClimbingStairs.py
ClimbingStairs.py
py
384
python
en
code
3
github-code
1
186842274
import inspect from ..nonlinearities import linear from ..layers import batch_norm __all__ = [ 'batch_normed' ] def _batch_normed(layer, *bn_args, **bn_kwargs): signature = inspect.signature(layer) def new_layer(*args, **kwargs): parameters = signature.bind(*args, **kwargs) parameters.apply_defaults() ...
jem0101/BigSwag-SQA2022-AUBURN
TestOrchestrator4ML-main/resources/Data/supervised/GITLAB_REPOS/craynn@craynn/craynn/subnetworks/normalization.py
normalization.py
py
867
python
en
code
2
github-code
1
33489932488
import importlib import copy import os import re import sys import warnings from collections import OrderedDict import traceback import h5py import numpy as np import deeprank from deeprank.models.variant import PdbVariantSelection from deeprank import config from deeprank.config import logger from deeprank.generate ...
DeepRank/DeepRank-Mut
deeprank/generate/DataGenerator.py
DataGenerator.py
py
64,833
python
en
code
1
github-code
1
31674543046
from xarm.wrapper import XArmAPI ip = "192.168.1.240" speed = 50 arm = XArmAPI(ip) arm.clean_warn() arm.clean_error() arm.motion_enable(enable=True) arm.set_mode(0) arm.set_state(state=0) arm.set_servo_angle(angle=[-0.1, -20.1, 0.2, 21.9, 0.1, 42.5, 1.4], speed=speed, is_radian=False, wa...
Zscqy17/B2J-Project
toInitPosition.py
toInitPosition.py
py
347
python
en
code
1
github-code
1
3153573334
class TokenFutures: def __init__(self, symbol, binance_client): self.symbol = symbol self.binance_client = binance_client self.leverage = 0 self.isolated = False self.price_info = { "open": None, "close": None, "high": None, "lo...
sangwonmoonkr/Baynance
src/tokens.py
tokens.py
py
869
python
en
code
0
github-code
1
42904588345
from util import readfile DAY = 3 R = 3 D = 1 def solve_1(data): c = 3 x = 0 L = len(data[0]) for row in data[1:]: x += int(row[c] == "#") c += R c %= L return x def solve_2(data): L = len(data[0]) H = len(data) p = 1 for (right, down) in [(1, 1), (3, 1)...
rainmayecho/aoc2020
3.py
3.py
py
761
python
en
code
0
github-code
1
288021247
from django.db import models class CRUDManager(models.Manager): def update_product(self, data, pk): product = self.get(pk=pk) product.name = data['name'] product.brand = data['brand'] product.description = data['description'] product.price = data['price'] product....
izzat1998/indicator
product/managers.py
managers.py
py
382
python
en
code
0
github-code
1
34215818225
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse import markdown, pygments from comments.forms import CommentForm from .models import Post, Category def index(request): ''' 首页 ''' post_list = Post.objects.all() return render(request, 'blog/index.html', ...
huiiiuh/blogproject
blog/views.py
views.py
py
1,708
python
en
code
1
github-code
1
990633107
#Lucas Wenger #Project 4 - Make a game #Due November 30, 2018 #Pseudo-Pokemon game - player earns money by battling trainers and attempts to catch all of the pokemon #(Pokemon is owned by Nintendo) ''' IMPORTED PACKAGES/FILES ''' import sys from PType import * from Move import * from HealingItem import * ...
ljwenger99/Pokemon-P
Pokemon P/Pokemon_P (Launcher).py
Pokemon_P (Launcher).py
py
22,905
python
en
code
0
github-code
1
11163059093
from collections import deque def solution(land): land = deque(land) while len(land)>1: tmp=land.popleft() for i in range(4): tmp1=[] for j in range(4): if i==j: continue else: tmp1.append(land[0][i]+...
ahrtz/study
코로나 기간 알고/프로그래머스/땅따먹기.py
땅따먹기.py
py
469
python
en
code
0
github-code
1
22485833822
class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: l={} t=[] for i in range(len(nums)): if (target-nums[i]) in l: t.append(i) t.append(l[target-nums[i]]) return t else: l[nums[i]...
karthikravikumar3/Leetcode
0001-two-sum/0001-two-sum.py
0001-two-sum.py
py
357
python
en
code
0
github-code
1
42321676108
#!/usr/bin/env python import rospy from sensor_msgs.msg import Image #For aa kunne lese data fra realsense kamera from cv_bridge import CvBridge, CvBridgeError #Bro mellom ROS og openCV import cv2 import numpy as np from geometry_msgs.msg import Twist #For aa kunne skrive cmd_vel kommandoer class LineFollower_edgeDet...
B022EB-29/BerryBot
raspberry_bot/src/controller_opticalFlow.py
controller_opticalFlow.py
py
2,028
python
en
code
0
github-code
1
12174972454
# SWEA 10200 # 유튜브 구독자 최대값, 최소값 구하기 T = int(input()) # 여러개의 테스트 케이스가 주어지므로, 각각을 처리합니다. for test_case in range(1, T + 1): # 입력 값 받기 N, A, B = map(int, input().split()) # 결과 변수 준비 maximum = 0 minimum = 0 # 최대 값은 한 그룹이 다른 그룹의 부분 집합일때 작은 집합 if A >= B: maximum = B else: maxim...
BonHyuck/Python
SWEA/D3/10200.py
10200.py
py
665
python
ko
code
1
github-code
1
21035722163
# 从上往下打印出二叉树的每个节点,同层节点从左至右打印。 class Solution: # 返回从上到下每个节点值列表,例:[1,2,3] def PrintFromTopToBottom(self, root): result = [] # 如果根节点为空 if not root: return result # 将根节点放入列表中 q = [root] # 当q列表不为空 while len(q): #  将q列表的第一个元素赋值给新节点 ...
EarthChen/LeetCode_Record
newcoder_offer/print_from_top_to_bottom.py
print_from_top_to_bottom.py
py
897
python
zh
code
0
github-code
1
19072969128
from pyten.tools import create # Import the problem creation function problem = 'basic' # Define Problem As Basic Tensor Completion Problem siz = [20, 20, 20] # Size of the Created Synthetic Tensor r = [4, 4, 4] # Rank of the Created Synthetic Tensor miss = 0.8 # Missing Percentage tp = 'CP' # Define Solution Fo...
Techget/tcar
experimentPyten/tryoutbasic.py
tryoutbasic.py
py
1,745
python
en
code
0
github-code
1
40325957035
import database_util import mailling_util import cv2 import DetectChars import CheckPlates showSteps = False SCALAR_BLACK = (0.0, 0.0, 0.0) SCALAR_WHITE = (255.0, 255.0, 255.0) SCALAR_YELLOW = (0.0, 255.0, 255.0) SCALAR_GREEN = (0.0, 255.0, 0.0) SCALAR_RED = (0.0, 0.0, 255.0) def main(): DetectChars.loadKNNData...
karthikvg/final-year-project
main.py
main.py
py
1,528
python
en
code
0
github-code
1
16693613018
import urlparse import ujson as json import sys import time import itertools import getopt from shutil import copyfile import boto import warc from boto.s3.key import Key from gzip import GzipFile from mrjob.job import MRJob from mrjob.launch import _READ_ARGS_FROM_SYS_ARGV from mrjob.step import MRS...
hungtran1/PageRanking
linkgraph.py
linkgraph.py
py
3,019
python
en
code
0
github-code
1
19240445837
import time import numpy as np import numpy.matlib as matlib from scipy.optimize import dual_annealing class maxpro_design: def __init__(self): self.s = 2.0 self.n = 8 self.p = 2 self.random_seed = np.random.RandomState(100) self.no_local_search = True self.L_BFGS_B_...
yonghoonlee/pyMaxPro_lite
pymaxpro_lite/maxpro.py
maxpro.py
py
1,783
python
en
code
1
github-code
1
30413465665
import os import boto3 import subprocess import threading from flask import request class Videofunc: def __init__(self): self.local = os.path.dirname(__file__) self.dir = os.path.dirname(self.local) self.strlocal = self.dir + "/videostreaming/downloadedvideo.mp4" self.s3c = boto3.c...
JunHaSonh0409/accident_handling_Blackbox
jgb/videocode/video_func.py
video_func.py
py
3,731
python
en
code
0
github-code
1
22499711532
from array import array from random import random # creating a large array of floats floats = array('d', (random() for i in range(10**7))) print(floats[-1]) # saving fp = open('floats.bin', 'wb') floats.tofile(fp) fp.close() #loading floats2 = array('d') fp = open('floats.bin', 'rb') floats2.fromfile(fp, ...
sive2045/fluent_python
Ch_2/array_ex.py
array_ex.py
py
384
python
en
code
0
github-code
1
13853344061
from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * class DctDialog(QDialog): """Pop-Up window to set a discount for an order.""" def __init__(self, total, parent, percentage=None, amount=None, code=None): """Init.""" super().__init__(parent, Qt.FramelessWindowH...
edgary777/publicPos
Dialogs.py
Dialogs.py
py
14,317
python
en
code
0
github-code
1
40467641940
import os from teine import models, operations_common, s3_store def get_by_user(user, include_used=True, include_unused=True): media_list = models.Media.load_all(user.user_id) if not include_used: media_list = list(filter( lambda x: x.episode_id is None, media_list)) if not include_un...
hirogwa/teine
teine/audio_operations.py
audio_operations.py
py
1,143
python
en
code
0
github-code
1
19234890989
from scipy.stats import kstest from create_plots import * def plot_power(raw_df,dir,name): for d in [1]: df = raw_df.sort_values(['alp']) # for alp in [0.00, 0.02, 0.04, 0.06, 0.08, 0.10]: for n in [1000,5000,10000]: subset_3 = df[df['n']==n] a,b,e = calc_error_bars...
MrHuff/kgformula
power_comparison_baseline_categorical.py
power_comparison_baseline_categorical.py
py
1,983
python
en
code
0
github-code
1
33583948086
import os import sys import time TEXT_DELAY = 0.02 # seconds # This function will print text slowly, with a TEXT_DELAY (in seconds) delay between characters # it mimics a typewriter effect, and adds a nice narrative effect to the game def print_slowly(text): # for each character in the text for character in...
fbl100/wimporee-rpg
console.py
console.py
py
1,136
python
en
code
0
github-code
1
3727032914
from practice import Practice from teamPlayer import TeamPlayer class PracticePlayer(object): """docstring for PracticePlayer""" def __init__(self, arg): super(PracticePlayer, self).__init__() self.arg = arg self._PK self._AVAILABILITY self._PRACTICE = Practice() self._TEAMPLAYER = TeamPlayer...
baileyrd/SoccerObjects
practicePlayer.py
practicePlayer.py
py
323
python
en
code
0
github-code
1
36070263880
from aiogram import Router, F, Bot from aiogram.filters import Command from aiogram.types import Message, ReplyKeyboardRemove from aiogram.fsm.context import FSMContext from aiogram.fsm.state import StatesGroup, State from filters.user_admin import UserAdminFilter from filters.custom import bot_is_admin from keyboard...
bakanchev/bot_channel_helper
handlers/set_channels.py
set_channels.py
py
7,544
python
ru
code
0
github-code
1
2738920419
def solve(number, maxvalue, house): house.sort() costed = 0 res = 0 for i in range(number): costed += house[i] if costed<= maxvalue: res += 1 else: return res return res T = int(input()) for t in range(T): N, B = map(int, input().split(' ')) A...
huangketsudou/algorithms
kickstart/2020allocation.py
2020allocation.py
py
430
python
en
code
0
github-code
1
26374804652
import tensorflow as tf import tensorflow.examples.tutorials.mnist.input_data as inputdata # Load data using built in script. Makes it easy on us :)! mnist_data = inputdata.read_data_sets('MNIST_data/', one_hot=True) # Create placeholders for tensorflow so that it can build the computation graph # x is the input dat...
texasuml/tensorflow_intro_nn
NeuralNet.py
NeuralNet.py
py
3,869
python
en
code
2
github-code
1
79010759
#!/usr/bin/python3 ''' 5-island_perimeter.py''' def island_perimeter(grid): '''A function that returns perimeter of an island''' edges = 0 size = 0 width = len(grid[0]) height = len(grid) for cells in range(height): for cell in range(width): if grid[cells][cell] == 1: ...
LionMara/alx-low_level_programming
0x1C-makefiles/5-island_perimeter.py
5-island_perimeter.py
py
565
python
en
code
0
github-code
1
10022924118
import datetime import numpy as np from itertools import groupby from skimage import measure from PIL import Image class PycocoCreatorTools: @staticmethod def bbox(img): rows = np.any(img, axis=1) cols = np.any(img, axis=0) rmin, rmax = np.where(rows)[0][[0, -1]] cmin, cmax = n...
lifunudt/blender_based_render
src/utility/Coco/pycococreatortools.py
pycococreatortools.py
py
4,882
python
en
code
1
github-code
1
18432482635
import pandas as pd dfs=pd.read_html("https://en.wikipedia.org/wiki/College_admissions_in_the_United_States") print(len(dfs)) print(type(dfs)) print(dfs[10]) import numpy as np import timeit df = pd.read_csv('datasets/census.csv') print(df.head()) # The first of these is called method chaining. # The general idea be...
Muhinyuzi/data_science
Intro_Data_Science/Week2/exercise7.py
exercise7.py
py
9,436
python
en
code
0
github-code
1
31992355781
#! /usr/bin/python3 import tabulate from ctypes import * from pye3datapath.e3client import clib from pye3datapath.e3client import api_call_exception from pye3datapath.e3client import api_return_exception from pye3datapath.e3client import register_service_endpoint ''' enum node_type{ node_type_misc=0, node_type_...
chillancezen/DEPRECATED-e3datapath
e3api_export/pye3datapath/infra/node.py
node.py
py
3,572
python
en
code
1
github-code
1
44852115982
import sys sys.stdin = open('CF_641_D2/input.txt', 'r') sys.stdout = open('CF_641_D2/output.txt', 'w') linp = "list(map(int,input().split()))" import math as mt MAXN = 100001 spf = [0 for i in range(MAXN)] def sieve(): spf[1] = 1 for i in range(2, MAXN): spf[i] = i for i in range(4, MAXN, 2)...
proRamLOGO/Competitive_Programming
CF_641_D2/C.py
C.py
py
1,104
python
en
code
0
github-code
1
25209483126
import json import numpy as np import datetime import pandas as pd from flask import Flask, request from pymongo import MongoClient ''' run localhost:5000 ''' app = Flask(__name__) myclient = MongoClient("mongodb://localhost:27017/") # DOCKER-COMPOSE # = MongoClient( # os.environ['DB_PORT_27017_TCP_ADDR'], # 27017) ...
MPiorunn/Master-Thesis
Master/WebApp.py
WebApp.py
py
2,487
python
en
code
0
github-code
1
41862226624
import json from nextcord.ext import commands import discordlists with open('config.txt') as f: config = [g.strip('\r\n ') for g in f.readlines()] class DiscordListsPost(commands.Cog): def __init__(self, bot): self.bot = bot self.api = discordlists.Client(self.bot) # Create a Client instan...
HexCodeFFF/discordlists.py
tests/post.py
post.py
py
1,380
python
en
code
0
github-code
1
72839458913
""" msessionmanager.py Helper for database object for storing session data """ # mewlo imports from ..manager import modelmanager import msession class MewloSessionManager(modelmanager.MewloModelManager): """The MewloSessionManager class helps session management.""" def __init__(self, mewlosite, debu...
dcmouser/mewlo
mewlo/mpacks/core/session/msessionmanager.py
msessionmanager.py
py
4,417
python
en
code
5
github-code
1
32773044803
import tkinter as tk from tkinter import Tk, Button, filedialog, Label, ttk import os root = tk.Tk() root.title("First GUI") root.minsize(width=500, height=300) # def getFile(): # filename = filedialog.askopenfilename(initialdir=os.getcwd(), title="Select file", # filetypes=(("Excel...
sent1nu11/tkinter_button_dialog
main.py
main.py
py
937
python
en
code
0
github-code
1
71405998434
#!/usr/bin/env python """ MachineLog Docstring The Machine Log class logs the input/output data from the Turing Machine.. """ import math import copy import pandas as pd from typing import List from lib.controllers.IOPair import IOPair __author__ = "Dylan Pozorski" __project__ = "TuringMachine" __class__ = "Machi...
dpozorski/TuringMachine
lib/data/log/MachineLog.py
MachineLog.py
py
3,097
python
en
code
0
github-code
1
2851930186
import eel import random @eel.expose def start_game(): global game_word game_word = list(random.choice(["roman", "itsafe", "hacking", "cyber", "python"])) for data in range(len(game_word)): game_state.append("_") print (game_word) @eel.expose def guess_character(character): global tries ...
tomergilor/tomergilor
Python course - IT Safe/day6/guess_the_word/app.py
app.py
py
781
python
en
code
0
github-code
1
9857093608
#!/usr/bin/env python3 '''video dsp fice read''' #人脸识别器官 def fice_read(img): gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) #将图片你转化为灰色 # OpenCV人脸识别分类器 classifier = cv2.CascadeClassifier( r"/Users/yefeng/Desktop/python-test/ficedriver/haarcascade_frontalface_default.xml" #\u是转义字符 所以前面要加r 不然会识别不到文件位置 ) colo...
isyefeng/python-test
ficedriver/opencv/video_fice_read.py
video_fice_read.py
py
1,129
python
zh
code
1
github-code
1
7517821187
import sys from PyQt5.uic import loadUi from PyQt5 import QtWidgets from PyQt5.QtWidgets import QDialog, QApplication, QMainWindow, QFileDialog import json from PyQt5 import QtGui class MainWindow(QMainWindow): def __init__(self): super(MainWindow, self).__init__() path = r'C:\\Users\ASUS\labs\EO\e...
YelizavetaP/EOlabs2022
Project/main.py
main.py
py
5,258
python
en
code
0
github-code
1
6611982416
# # graphics/uq/omega.py - uncertainty quantification over force or moment tensor # angular distance # import numpy as np from mtuq import Force, MomentTensor from mtuq.graphics.uq._matplotlib import _plot_omega_matplotlib from mtuq.grid_search import DataArray, DataFrame from mtuq.util import warn from mtuq.util.m...
uafgeotools/mtuq
mtuq/graphics/uq/omega.py
omega.py
py
6,924
python
en
code
57
github-code
1
20485557893
from PIL import Image import torch from torch.utils import data from torchvision import transforms device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") class ImageTransform(): def __init__(self, resize, mean, std): self.data_transform = { 'train': transforms.Compose([ ...
Jeong-Labo/katsurayama_classificate
vgg16/create_dataset.py
create_dataset.py
py
2,578
python
ja
code
0
github-code
1
70801657313
#!/usr/bin/env python3 import logging import os from broadcaster import Broadcaster from common.heartbeat_sender import HeartbeatSender def parse_config_params(): config_params = {} try: config_params["row_queue"] = os.environ["ROW_QUEUE"] config_params["queues_to_send"] = os.environ["QUEUES_T...
chortas/7574-TP4
broadcaster/main.py
main.py
py
1,295
python
en
code
1
github-code
1
26716641606
import math import torch import torch.nn as nn from . import lovasz_losses from torch.nn.modules.loss import _WeightedLoss import torch.nn.functional as F class SmoothCrossEntropyLoss(_WeightedLoss): # https://stackoverflow.com/questions/55681502/label-smoothing-in-pytorch def __init__(self, weight=None, reduc...
tattaka/ukiyoe
src/utils/losses.py
losses.py
py
4,995
python
en
code
8
github-code
1
15781127175
# Given a string s, find the length of the longest substring without repeating characters. class Solution(object): def lengthOfLongestSubstring(self, s): """ :type s: str :rtype: int """ longest_string_l = 0 substr = "" length = 0 for value in s: ...
RaghvendraPal/DSA-Practice
DSA/Amazon/LCS.py
LCS.py
py
1,261
python
en
code
0
github-code
1
15534537748
import argparse import pickle import json from copy import deepcopy from src.config import conf # diayn with model-free RL from src.diayn import DIAYN # diayn with evolution stratigies from src.diayn_es import DIAYN_ES # diayn with evolution model-based RL # from src.diayn_mb import DIAYN_MB from src.utils import ...
FaisalAhmed0/SLUSD
src/finetune.py
finetune.py
py
22,907
python
en
code
3
github-code
1
31511284164
from pathlib import Path numbers = [int(l.strip()) for l in open(Path(__file__).resolve().parent / 'input.txt')] def move(l,i,d): j = (i+d)%(len(l)-1) tmp = l[:i] + l[i+1:] return tmp[:j] + [l[i]] + tmp[j:] def mixing(numbers,times=1): result = numbers for _ in range(times): for n,i in numbers: j...
andiwand/adventofcode
2022/day20/solution.py
solution.py
py
716
python
en
code
1
github-code
1
28144404836
# Draw class import Image img = Image.new('RGB', (255,255), "black") pixels = img.load() for i in range(img.size[0]): # for every pixel: for j in range(img.size[1]): pixels[i,j] = (i, j, 100) # set the colour accordingly def draw(): img.show() def set_pixel(self, x, y, colour): pixels[x, y] = (x...
ryanwong113/Voronoi
Draw.py
Draw.py
py
332
python
en
code
0
github-code
1
28570613993
"""Create a food log file for each client Create an exercise log file for each client. Ask the user whether they want to log or retrieve client data. Write a function that takes the user input of the client's name. After the client's name is entered, it will display a message as "What you want to log- Diet or Exerci...
mannu776/pyhtonproject
main_pro.py
main_pro.py
py
2,093
python
en
code
0
github-code
1
34499317330
import sys sys.setrecursionlimit(1000000) input = sys.stdin.readline N = int(input()) # DP =[[0] for i in range(N+1)] DP = [10*7]*(10**6+1) # DP[a] : a값을 연산하기에 가장 최소 방법 # print(DP) DP[1] = 0 # DP[2] = 1 # DP[3] = 1 # a,b,c = 10**7, 10**7, 10**7 for i in range(2, 10**6+1): if i%3 == 0 : DP[i] = min(DP[i-...
DongjuSon/Code_Test
1463_2.py
1463_2.py
py
513
python
en
code
0
github-code
1
15161754778
# Import relevant packages import base64 import requests import pandas as pd import numpy as np import json from pandas import json_normalize import schedule import time from datetime import date import os # store private authentication key from environment files key = str(os.environ.get('fantasyPoolApiKey')) # once ...
JordanFortney/fantasyHockeyPool
eodApiPullFantasyHockeyPool.py
eodApiPullFantasyHockeyPool.py
py
4,174
python
en
code
5
github-code
1
1052731755
#!/usr/bin/python3 """ f24.airport ~~~~~~~~~~~ This module contains the class handling airport data """ from data_suppliers.fr24_mobile_api import Fr24MobileApi class Aiport: FILENAME = "airport.json" def __init__(self, code): self.code = code query = "code=" + self.code mapi = Fr...
MatthieuMichon/f24
src/v1/airport.py
airport.py
py
1,254
python
en
code
2
github-code
1
7528142616
from flask import Flask, request, jsonify import requests import os from datetime import datetime, timedelta from pymongo import MongoClient from threading import Thread app = Flask(__name__) date_format = "%Y%m%d" # Format for the date in the URL destination_directory = "storage_1" # Destination directory to save ...
Raja1802/gitblock
download.py
download.py
py
5,497
python
en
code
0
github-code
1
4624349490
#!/usr/bin/python3 import turtle t = turtle.Turtle() def get_midpoint(a, b): ax, ay = a bx, by = b return (ax + bx) / 2, (ay + by) / 2 def draw_triangle(a, b, c): ax, ay = a bx, by = b cx, cy = c t.penup() t.goto(ax, ay) t.pendown() t.goto(bx, by) t.goto(cx, cy) t....
BigShuang/recursion-with-turtle
Sierpinski Triangle/sierpinski.py
sierpinski.py
py
839
python
en
code
11
github-code
1
16244186470
import matplotlib.pyplot as plt import scipy import numpy as np A = -0.004 B = 1 C = 0.048 kp = 0.607338773069937 ki = 0.00245637321622817 kd = 0 def model(t, x, yd): e = yd - x[0] #feedback e_int = x[1] u = kp * e + ki * e_int if u > 1: u = 1 if u < 0: u = 0...
xalpol12/pid-controller-with-resistor-heating
test.py
test.py
py
999
python
en
code
0
github-code
1
70989056674
def proteins(strand): di = {"Methionine": "AUG","Phenylalanine": ("UUU","UUC"), "Leucine": ("UUA","UUG"), "Serine": ("UCU", "UCC", "UCA", "UCG"), "Tyrosine": ("UAU", "UAC"), "Cysteine": ("UGU", "UGC"), "Tryptophan": "UGG", "STOP": ("UAA", "UAG", "UGA")} li = [] for i in range(0,len(strand),3): codon...
asiya00/Exercism
python/protein-translation/protein_translation.py
protein_translation.py
py
556
python
en
code
0
github-code
1
7824604928
import pandas as pd import os from training_utils.record_results import preds_file_index_cols def get_average_model_performance(df_final_results, mode='regression', ext_test_sets=[]): if mode == 'regression': # Get average, standard deviation and standard error: df_av_results = pd.DataFrame() ...
jc32173/ml_models
training_utils/model_scoring.py
model_scoring.py
py
3,841
python
en
code
0
github-code
1
29051120454
import pandas as pd from textrank4zh import TextRank4Keyword, TextRank4Sentence data = pd.read_csv('corpus.csv', encoding='gbk') for text in data['content']: tr4w = TextRank4Keyword() tr4w.analyze(text=text, lower=True, window=2) # py2中text必须是utf8编码的str或者unicode对象,py3中必须是utf8编码的bytes或者str对象 print('KeyWor...
nostalgicxm/TextRank4zh_my
main_2.py
main_2.py
py
699
python
en
code
0
github-code
1
4801747092
from socket import * # from sys import * SeverName = '67.209.179.53' SeverHost = 12000 clientSocket = socket(AF_INET,SOCK_DGRAM) #AF_INET 指示了底层网络使用的是IPv4. SOCK_DGRAM意味着它是一个UDP套接字 cnt = 0 while True: message = input("input message\n") clientSocket.sendto(message.encode(),(SeverName,SeverHost)) #需要将字符串对象转化为字节流(利用...
shanPic/webServerDemo
UDPClient.py
UDPClient.py
py
676
python
zh
code
0
github-code
1
40501751050
## Given two lists, print out the intersection of the lists. If an element is ## in both lists more than once, print it more than once. l1 = ["cat", "dog", "table", "horse", "house", "cat"] l2 = ["cat", "cat", "horse", "dog", "dog", "chair", "cabin"] def intersect(l1, l2): d1, d2 = {}, {} for l in l1: try: d1[l]...
xingzhong/interview-prepare
intersection.py
intersection.py
py
484
python
en
code
0
github-code
1
35431122664
import sys sys.stdin = open('input_3980.txt', 'r') def comb(k): global result if k == 11: result = max(sum(order), result) return else: for i in range(11): if not visited[i] and arr[k][i]: visited[i] = True order.append(arr[k][i]) ...
wally-wally/TIL
02_algorithm/baekjoon/problem/1000~9999/3980.선발명단/3980.py
3980.py
py
589
python
en
code
32
github-code
1
15437339898
from tensorflow.keras.models import Model from tensorflow.keras.layers import Input, Dense, Dropout, GlobalAveragePooling2D from tensorflow.keras.applications import MobileNetV3Small class MobileNet(): def __init__(self, n_classes): self.input_shape = (224,224,3) self.n_classes = n_classes ...
devRangers/wonderingPill-ai
pill_classification/models/mobilenet.py
mobilenet.py
py
875
python
en
code
1
github-code
1
20653306291
from qtpy.QtWidgets import ( QFormLayout, QHBoxLayout, QLineEdit, QPushButton, QVBoxLayout, QWidget, QCheckBox, QComboBox, ) from superqt import QCollapsible class ProjectControl(QWidget): def __init__(self, parent=None): super().__init__() main_layout = QVBoxLayout...
NHPatterson/napari-wsireg
src/napari_wsireg/gui/setup_sub/project.py
project.py
py
2,963
python
en
code
11
github-code
1
17914119640
import smtplib import email.message def enviar(): email_escopo = """ <p>email enviado por python</p> """ msg = email.message.Message() msg['Subject'] = "assunto do email" msg['From'] = "usuario@gmail.com" msg['To'] = "usuario@gmail.com" senha = 'senha_do_e...
RafaelBernardo18/python
11-Exemplo/envio_emails.py
envio_emails.py
py
636
python
pt
code
0
github-code
1
27915418590
import datetime import sys from time import time from typing import List from highlighter.utils.load import DataSetLoader, VideoChatsData from highlighter.utils.predict import enumerate_fvs_df if "-i" in sys.argv and len(sys.argv) > sys.argv.index("-i") + 1: target = sys.argv[sys.argv.index("-i") + 1] else: t...
MycroftKang/highlighter-core
tools/predict.py
predict.py
py
1,935
python
en
code
1
github-code
1