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
38327117535
from django.shortcuts import render, redirect from . import forms, models from django.views.decorators.http import require_POST import re from django.conf import settings import random from django.db.models import Max from django.core.mail import send_mail import smtplib from django.urls import reverse where_to_go = "...
othLah/Sell_Buy_Web_App
Vent_Achat_Proj/Vent_Achat_App/views.py
views.py
py
27,137
python
en
code
0
github-code
13
70696504979
import pyttsx3 from prettytable import PrettyTable import pyfiglet table = PrettyTable(["Item number", "Price"]) welcome = pyfiglet.figlet_format("WELCOME TO KIRANA STORE", font="digital") print(welcome) total = 0 tu = 1 while True: name = input("Enter the item\n") # 'q' to exit and print the table if (na...
anant-harryfan/Python_basic_to_advance
PythonTuts/Python_Practise/Practise10.py
Practise10.py
py
618
python
en
code
0
github-code
13
19262944876
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select from selenium.webdriver.common.action_chains import ActionChains import pandas as pd import time def devsleep(t): time.sleep(t) def navigate...
connorfryar/lab.python
Selenium_Example/selenium_example_anonymized.py
selenium_example_anonymized.py
py
3,116
python
en
code
0
github-code
13
15886750082
""" Routes and views for the flask application. """ from datetime import * from calendar import monthrange from flask import render_template, url_for, redirect, request, session, flash from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager, current_user, login_user, logout_user, login_required, U...
SpiderPorkPotter/Palestra
Palestra/views.py
views.py
py
49,842
python
it
code
0
github-code
13
72201778579
# Question Category : Arrays # Difficulty : Medium # Link to Leetcode Problem : https://leetcode.com/problems/product-of-array-except-self/ # NeedCode Video Solution : https://youtu.be/bNvIQI2wAjk # Obs.: make two passes, first in-order, second in-reverse, to compute products # Problem Desciption : """ Given an integer...
MSoltanovUSP/LeetCode
Blind-75-LeetCode-Questions/Question04-Product_of_Array_Except_Self.py
Question04-Product_of_Array_Except_Self.py
py
1,928
python
en
code
0
github-code
13
14739142286
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np import urllib.request import tensorflow as tf from matplotlib import pyplot as plt class DataManager: def __init__(self): self.X = np.zeros(0) self.Y = np.zer...
alexbooth/Beta-VAE-Tensorflow-2.0
dataset.py
dataset.py
py
3,884
python
en
code
14
github-code
13
29572469405
import numpy as np import pandas as pd import json import transformers import tensorflow as tf from sklearn.metrics.pairwise import cosine_similarity from transformers import logging logging.set_verbosity_error() import warnings warnings.filterwarnings('ignore') def init(): global model global tokenizer gl...
orion2107/Robohon_Training
azure_files/score_all.py
score_all.py
py
5,977
python
he
code
0
github-code
13
21105245173
# -*- coding: utf-8 -*- """ Created on Tue Jan 12 08:44:33 2021 @author: a8520 """ class Node: def __init__(self, val = None, next_ = None): self.val = val self.next_ = next_ # 如果linked list內包含環,如何找到環的入口節點。 class Solution: def findStart(self, node): # step1. 看快慢指針是否會重疊、會重...
uycuhnt2467/-offer
linkedlist中環的入口節點.py
linkedlist中環的入口節點.py
py
1,831
python
en
code
0
github-code
13
32932333099
import pandas as pd import requests import re import numpy as np from sklearn.mixture import GaussianMixture from bs4 import BeautifulSoup as bs import os import warnings warnings.filterwarnings("ignore") pd.options.display.float_format = "{:.2f}".format def apply_regex(regex, string): match = re.search(regex...
tbakely/thefantasybot
draft_boards.py
draft_boards.py
py
6,455
python
en
code
0
github-code
13
3229665330
import re import random import os from datetime import datetime def szereguj_instancje(nazwa_instancji, liczba_wezlow): czas = datetime.now() print("\n[%s] Szeregowanie instancji %s, liczba_wezlow=%d" % (czas, nazwa_instancji, liczba_wezlow)) random.seed(0) zadania = [] nazwa_pliku_wejsciowego = ...
tomdziwood/pbd-projekt
programy_szeregujace/szer_jsq_td.py
szer_jsq_td.py
py
6,458
python
pl
code
0
github-code
13
1644184521
from ftplib import FTP from ftplib import FTP_TLS x = "www.feg-hochdorf.ch" y = "fegch_4" z = "N1Us3kU97x" u = '/Users/silva/Desktop/Predigtuploader/LOGO_Petrol_weiss.mp4' class DataToTypo: def FTP(server_address, ftp_user, ftp_pw, filePath, ftpDirectory="Predigten"): # Create an FTP_TLS conn...
VonDoehner/DataToTypo
DataToTypo.py
DataToTypo.py
py
1,111
python
en
code
0
github-code
13
43231781084
import pyautogui from math import * import numpy as np import matplotlib import matplotlib.colors import matplotlib.pyplot as plt from matplotlib import patches import matplotlib.image as mpimg from matplotlib.animation import FuncAnimation, writers # =========================================================...
VY354/my_repository
Python/projects/visualizations/fourier_transform_visualization/FuncAddingGraph(Arrow).py
FuncAddingGraph(Arrow).py
py
5,060
python
en
code
0
github-code
13
27226412809
from Persona import Persona from Salario import Salario class Empleado(Persona, Salario): def datosEmpleado(self, salario, cargo): print(f'El salario es {salario} ') print(f'El cargo es {cargo}') objEmpleado = Empleado('Juan', 20, 'Masculino') objEmpleado.datosPersonales() objEmpleado.datosEmple...
andresdino/usco2023
Prog2/POO/Herencia/Empleado.py
Empleado.py
py
374
python
es
code
1
github-code
13
31150708632
# Temperature Calculator by L. Carthy import time def intro_options(): """ Takes the option and returns the fuction that correlates """ option = int(input("1 for Fahrenheit to Celsius \n" "2 for Celcius to Fahrenheit \n" "3 for Fahrenheit to Kelvin: ")) ...
thisislola/Tutorials
temp_calculator.py
temp_calculator.py
py
1,828
python
en
code
0
github-code
13
33919194571
import base64 import hashlib import hmac import json import requests import time import urllib.parse def task_reminder(webhook, secret=None, **kwargs): webhook_signed = None timestamp = str(round(time.time() * 1000)) if secret is not None: secret_enc = secret.encode('utf-8') string_to_sign...
ChiahsinChu/dpana
dpana/message.py
message.py
py
1,279
python
en
code
null
github-code
13
22031476823
# # SPDX-License-Identifier: Apache-2.0 # from rest_framework import serializers from api.common.enums import NetworkType, ConsensusPlugin, Operation from api.common.serializers import PageQuerySerializer NAME_MIN_LEN = 4 NAME_MAX_LEN = 36 NAME_HELP_TEXT = "Name of Cluster" SIZE_MAX_VALUE = 6 SIZE_MIN_VALUE = 2 cla...
hyperledger/cello
src/api-engine/api/routes/cluster/serializers.py
serializers.py
py
2,462
python
en
code
862
github-code
13
7346347093
# 🚨 Don't change the code below 👇 age = input("What is your current age?") # 🚨 Don't change the code above 👆 #Write your code below this line 👇 remYears = 90 - int(age) remDays = 365 * remYears remWeeks = 52 * remYears remMonths = 12 * remYears print(f"You have {remDays} days, {remWeeks} weeks, and {re...
Daven-anony/90yearsjuslikedat
main.py
main.py
py
351
python
en
code
0
github-code
13
23060627785
#!/usr/bin/python3 # #Funkcja wait_for_key() oczekująca na naciśniecie dowolnego przycisku. #Test 1: Jakiś program z funkcją print #Test 2: Program obracający tarczę o 12 kroków w prawo po każdym naciśnięciu dowolnego przycisku. from board_driver_simulator import open, close, but, pot, det, led # Simulator im...
wierzba100/Wprowadzenie-do-programowania-python
Czesc 3/cz3_02.py
cz3_02.py
py
896
python
pl
code
0
github-code
13
15202605162
from hashlib import md5 from pathlib import Path from invoke import task def as_user(ctx, user, cmd, *args, **kwargs): ctx.run('sudo --set-home --preserve-env --user {} --login ' '{}'.format(user, cmd), *args, **kwargs) def as_bench(ctx, cmd, *args, **kwargs): as_user(ctx, 'bench', cmd) def s...
pyrates/roll
benchmarks/fabfile.py
fabfile.py
py
2,375
python
en
code
27
github-code
13
7112677644
# -*- coding: utf-8 -*- import csv import random def run(outname): print("Input the number of classes: ") num_class = int(input()) class_prob = [] count = 0 while count < num_class: num = random.randrange(100) if num >= 50: class_prob.append(num) count += 1 ...
yamanalab/NB-Classify
training/createModel.py
createModel.py
py
2,139
python
en
code
3
github-code
13
17808744416
from tensorflow.keras.preprocessing.text import Tokenizer from tensorflow.keras.preprocessing.text import one_hot import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense from tensorflow.keras.layers import Dropout from tensorflow.keras.layers import LSTM from te...
e8dev/e8dev-quick-text-generation
quick_lstm.py
quick_lstm.py
py
3,792
python
en
code
0
github-code
13
39585857108
#!/usr/bin/env python # -*- coding: utf-8 -*- from http.server import CGIHTTPRequestHandler, HTTPServer import os HOST = '' PORT = 8080 class RequestHandler(CGIHTTPRequestHandler): # source in http://hg.python.org/cpython/file/3.3/Lib/http/server.py cgi_directories = ["/cmp/"] def do_POST(self): ...
ingemaradahl/bilder-demo
server.py
server.py
py
795
python
en
code
1
github-code
13
17597173134
# x = input("첫번째 숫자를 입력 : ") # y = input("두번째 숫자를 입력 : ") # print("두 수의 곱은 ...") # print(x * y) # 위와 같이 연산을 진행할경우 오류가 발생! # - 입력받은 수가 str 판정이기 때문. - # 형변환을 위해서는 `int(변수)`, `str(변수)` 와 같이 자료형 뒤에 소괄호! # x = int(input("첫번째 숫자를 입력 : ")) # y = int(input("두번째 숫자를 입력 : ")) # print("두 수의 곱은 ...") # print(int(x) * int(y)) ...
junkue20/Inflearn_Python_Study
5강_입력과자료형변환/quiz.py
quiz.py
py
1,289
python
ko
code
0
github-code
13
24423139490
import os import sgtk from sgtk.platform.qt import QtCore, QtGui from .ui import resources_rc # import the shotgun_fields module from the framework shotgun_fields = sgtk.platform.import_framework( "tk-framework-qtwidgets", "shotgun_fields") # import the shotgun_globals module from shotgunutils framework shotgun...
ColinKennedy/tk-config-default2-respawn
bundle_cache/app_store/tk-multi-demo/v1.0.2/python/tk_multi_demo/demos/field_widget_delegate/demo.py
demo.py
py
6,804
python
en
code
10
github-code
13
38910809873
class Ship2(pygame.sprite.Sprite): def __init__(self): pygame.sprite.Sprite.__init__(self) self.movey = 100 self.movex =100 pos = (400,400) self.image = pygame.image.load('ship.png') self.image = pygame.transform.smoothscale(self.image,(100, 100)) self.rect = ...
drakebayless90/astroids
Ship2.py
Ship2.py
py
676
python
en
code
0
github-code
13
40336501615
from base.base_train import BaseTrain from tqdm import tqdm import numpy as np from time import sleep from time import time from utils.evaluations import save_results class Mark1_Trainer(BaseTrain): def __init__(self, sess, model, data, config, summarizer): super(Mark1_Trainer, self).__init__(sess, model,...
yigitozgumus/Polimi_Thesis
trainers/mark1_trainer.py
mark1_trainer.py
py
9,888
python
en
code
5
github-code
13
73275285136
from xmlrpc.server import SimpleXMLRPCServer from xmlrpc.server import SimpleXMLRPCRequestHandler import random import hashlib # Restrict to a particular path. class RequestHandler(SimpleXMLRPCRequestHandler) : rpc_paths = ('/RPC2',) # Create server server = SimpleXMLRPCServer(("localhost", 8000), ...
gitfarah/CHAP_Paython-
server.py
server.py
py
3,263
python
en
code
0
github-code
13
34072180440
# solved in 5m n = int(input()) s = input() if len(s) % n != 0: print("ERROR") exit() for i in range(0, len(s), n): print(bin(sum(map(int,s[i:i+n])))[-1],end="")
Elod-T/codingame
clash of code/fastest/parityOfSumsInGroupsInBinary.py
parityOfSumsInGroupsInBinary.py
py
176
python
en
code
0
github-code
13
15391300596
# -*- coding:utf-8 -*- # update for BALDR HEART EXE 2017.09.14 import struct import os import sys import io def byte2int(byte): long_tuple=struct.unpack('L',byte) long = long_tuple[0] return long def int2byte(num): return struct.pack('L',num) def FormatString(string, count): res = "○%08d○\n%s\n●%08d●\n%s\n\n"%(...
Yggdrasill-Moe/Niflheim
NeXAS/mek_dump.py
mek_dump.py
py
3,753
python
en
code
105
github-code
13
33659007012
from jinja2 import Environment, FileSystemLoader import json, subprocess, time def runScript(): subprocess.call("npm run script --prefix handong-newsletter-script", shell=True) def todayDate(): days = "일월화수목금토" day = days[int(time.strftime("%w"))] + "요일" date = time.strftime("%Y.%m.%d") return [day, date] ...
junglesub/handong-newsletter
template/template.py
template.py
py
912
python
en
code
2
github-code
13
22220877029
import io from typing import Union import pytesseract import streamlit as st from PIL import Image from src.models import Receipt def preprocess_parsed_text(parsed_text: str): return parsed_text.strip() @st.cache def parse_cropped_image(cropped_image: Image, psm: int) -> str: if cropped_image.format != "J...
lscholtes/billSplit
src/scan.py
scan.py
py
2,349
python
en
code
0
github-code
13
23444189413
# -*- coding:utf-8 -*- from sklearn.datasets import load_breast_cancer from sklearn.neighbors import KNeighborsClassifier from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt #载入数据 cancer = load_breast_cancer() X_train,X_test,y_train,y_test = train_test_split(cancer.data,cancer.target, ...
liuaichao/python-work
机器学习/k近邻模型/乳腺癌/ruxian.py
ruxian.py
py
1,040
python
en
code
6
github-code
13
17669402330
#TC = O(N) and SC = O(N) class Solution(object): def connect(self, root): if root == None: return root queue = deque() queue.append(root) while queue: level_len = len(queue) prev_node = None for level_index in range(0, level_len): ...
SharmaManjul/DS-Algo
LeetCode/Medium/grok_connectLevelOrderSiblings.py
grok_connectLevelOrderSiblings.py
py
755
python
en
code
0
github-code
13
8576085872
""" Base rule optimiser class. Main rule optimisers classes inherit from this one. """ from iguanas.rules import Rules import iguanas.utils as utils from iguanas.utils.typing import PandasDataFrameType, PandasSeriesType from iguanas.utils.types import NumpyArray, PandasDataFrame, PandasSeries from iguanas.warnings impo...
paypal/Iguanas
iguanas/rule_optimisation/_base_optimiser.py
_base_optimiser.py
py
23,227
python
en
code
73
github-code
13
18726696152
import numpy as np import numpy.random as rand import matplotlib.pyplot as plt from numpy.linalg import norm def derivativetest(fun, x0): """ Test the gradient and Hessian of a function. A large proportion parallel in the middle of both plots means accuraccy. INPUTS: fun: a function handle tha...
syangliu/Naive-Newton-MR
derivativetest.py
derivativetest.py
py
2,159
python
en
code
4
github-code
13
43217610073
from threading import Thread from PySide6 import QtWidgets from sweep import Sweep from tello import Tello from video import Video class Button(QtWidgets.QPushButton): def __init__(self, text, action): QtWidgets.QPushButton.__init__(self) self.setText(text) self.clicked.connect(lambda: T...
rlgo/tello
control.py
control.py
py
1,627
python
en
code
0
github-code
13
20346791693
""" This module defines an ObservableProperty class. An ObservablePropery must be declared as class attribute, similar to standard python properties. You can bind callables to an ObservableProperty. The callable is called when the property value is set. Example: ------- >>> class MyBaseClass: >>> prop1 = Observabl...
Draegerwerk/sdc11073
src/sdc11073/observableproperties/observables.py
observables.py
py
8,034
python
en
code
27
github-code
13
20686388054
import pickle import numpy as np from data import data class Model (): def __init__(self) -> None: pickle_in = open("..\\files\\classifier.pkl","rb") self.clf=pickle.load(pickle_in) pk_sc = open("..\\files\\scaler.pkl","rb") self.sc= pickle.load(pk_sc) self.country = {'Franc...
OmarKhaledAbdlhafez/Churn-Classification
deployments/model.py
model.py
py
1,327
python
en
code
0
github-code
13
34908799846
''' 反转一个单链表。 示例: 输入: 1->2->3->4->5->NULL 输出: 5->4->3->2->1->NULL 进阶: 你可以迭代或递归地反转链表。你能否用两种方法解决这道题? ''' # Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def reverseList(self, head: ListNode) -> ListNode: # 迭代法 ...
Yujunw/leetcode_python
206_反转链表.py
206_反转链表.py
py
1,206
python
en
code
0
github-code
13
11364254729
from turtle import * import random import math class square (Turtle): def __init__(self,height,color,speed): Turtle.__init__(self) self.shape("square") self.shapesize(height) self.color(color) self.speed(speed) rec1=square(7,"red",1) rec2=square(7,"blue",1) x1=rec1.xcor() x2=rec2.xcor() y1=rec1.ycor() y2=re...
rahaf19-meet/yl1201718
lab6/rectangle.py
rectangle.py
py
1,026
python
en
code
0
github-code
13
71719325457
import pickle ########### LEER ARCHIVO ############## def linea_archivo(arch,default): linea=arch.readline() return linea if linea else default def leer_usuario(arch): linea=linea_archivo(arch,"end,0,0,0,0") id,nombre,fecha,peliculas,estado=linea.strip().split(',') ...
CarlosOrqueda/TP2
TP2 new.py
TP2 new.py
py
21,707
python
es
code
0
github-code
13
73685205459
from konlpy.tag import Kkma, Okt, Mecab from pyspark.sql import SparkSession from pyspark import SparkConf,SparkContext from konlpy.utils import pprint import Restaurant import TopWordCloud import re import os import threading import json import nltk import traceback import pymongo import datetime def strip_e(st): ...
kkw01234/AReaBigDataPython
instagramrate.py
instagramrate.py
py
2,718
python
en
code
0
github-code
13
14336696667
class Link(): def __init__(self, name, health, armor, power , weapon): self.name = name self.health = health self.armor = armor self.power = power self.weapon = weapon def print_info(self): print('', self.name) print('PV:', self.healt...
WalkX21/Aprentissage_des_classes
zelda2.py
zelda2.py
py
1,736
python
fr
code
0
github-code
13
3406102348
from Bio.Seq import Seq from Bio.Alphabet import IUPAC from project_dataclasses.Processed_dna_rna import Processed_dna_rna from project_dataclasses.Processed_protein import Processed_protein import json class Sequencer: def __init__(self): raise Exception( "Only a sorcerer can invo...
RodrigoCury/bioinformatic-project
biop/pyHelpers/Sequencer.py
Sequencer.py
py
7,046
python
en
code
0
github-code
13
36654779416
import sys import numpy import cv2 as cv import threading from application.camera import Camera from application.gui import GUI from sockets.client import ClientSocket class App: # Initializes the App class, setting up the client socket, camera, and GUI def __init__(self, client_data): # Initialize t...
RichiiCD/PyVideoChat
application/app.py
app.py
py
1,642
python
en
code
1
github-code
13
40424599112
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # # Libraries dependancies : # # # Haroun dependancies : # # Import core concept Intent. from core.concepts.Intent import Intent # Import core concept Intent. from core.concepts.Response import Response # # # Globals : # # # # class Interaction(object...
LounisBou/haroun
core/concepts/Interaction.py
Interaction.py
py
2,356
python
en
code
0
github-code
13
23851097539
# Django settings for frankencode project. # Initialize App Engine and import the default settings (DB backend, etc.). # If you want to use a different backend you have to remove all occurences # of "djangoappengine" from this file. from djangoappengine.settings_base import * DEBUG = False TEMPLATE_DEBUG = DEBUG ADM...
doffm/Frankencode
settings.py
settings.py
py
4,137
python
en
code
1
github-code
13
10007504813
import subprocess class CmdRunner(object): def __init__(self, cmd_prefix=''): self._cmd_prefix = cmd_prefix def run(self, cmd): cmd = self._cmd_prefix.split() + cmd proc = subprocess.Popen(cmd, # nosec stdout=subprocess.PIPE, ...
letterwuyu/cuvette
src/common/cmd_runner.py
cmd_runner.py
py
645
python
en
code
1
github-code
13
73996307858
from preprocess import get_dataset, DataLoader, collate_fn_transformer from network import * from device import * from tensorboardX import SummaryWriter import torchvision.utils as vutils import os from tqdm import tqdm def adjust_learning_rate(optimizer, step_num, warmup_step=4000): lr = hp.lr * warmup_step**0.5 ...
hry8310/ai
dl/pytorch-cpu-gpu-TTS/train_transformer.py
train_transformer.py
py
2,459
python
en
code
2
github-code
13
30642989962
## Programa escrito en python orientado a la deteccion y conteo de palabras, signos y espacios en textos ingresados por el usuario import string def count_words(text): """ Cuenta el número de palabras en un texto. Args: text: La cadena de caracteres a contar. Returns: El número de palabras en el tex...
ArochaDeveloper/libreria-en-python
libreria.py
libreria.py
py
1,272
python
es
code
0
github-code
13
37402475765
import pandas as pd from PIL import Image import streamlit as st from streamlit_drawable_canvas import st_canvas import glob import numpy as np import tensorflow as tf from object_detection.utils import label_map_util from object_detection.utils import visualization_utils as vis_util import argparse import sys from mat...
KiriKoppelgaard/StudyGroupIdaTheaKiri
Where_Is_Wally_exercise/Wally_interface.py
Wally_interface.py
py
7,220
python
en
code
1
github-code
13
2433766873
#!/usr/bin/env python3 """ .. automodule:: phile.launcher.cmd .. automodule:: phile.launcher.defaults ---------------------------------- For starting and stopping services ---------------------------------- """ # Standard libraries. import asyncio import collections import collections.abc import contextlib import dat...
BoniLindsley/phile
src/phile/launcher/__init__.py
__init__.py
py
21,024
python
en
code
0
github-code
13
74562970258
#!/usr/bin/env python """ _Express_t_ Express job splitting test """ import unittest import threading import logging import time from WMCore.WMBS.File import File from WMCore.WMBS.Fileset import Fileset from WMCore.WMBS.Subscription import Subscription from WMCore.WMBS.Workflow import Workflow from WMCore.DataStruc...
dmwm/T0
test/python/T0_t/WMBS_t/JobSplitting_t/Express_t.py
Express_t.py
py
10,553
python
en
code
6
github-code
13
40905840218
import numpy as np from flask import Flask from flask import jsonify from flask import request # request可以获取请求参数 from flask import render_template # 使用模板返回页面 import random import dataGet app = Flask(__name__) @app.route('/') def hello_world(): return 'hello world!' @app.route('/tem') def my_tem(): retur...
StuRuby/python-starter
main.py
main.py
py
5,613
python
en
code
1
github-code
13
30999406802
import pathlib from setuptools import setup CURRENT_PATH = pathlib.Path(__file__).parent README = (CURRENT_PATH/"README.md").read_text() setup( name="derive_event_pm4py", version="1.0.1", description="It derives new events based on rules provided as inputs.", long_description=README, long_descrip...
ajayp10/derive_event_pm4py
setup.py
setup.py
py
907
python
en
code
0
github-code
13
10041084189
import pygame import random class ParticlePrinciple: PARTICLE_EVENT = pygame.USEREVENT + 1 def __init__(self): self.particles = [] def emit(self, screen: pygame.display, color): if self.particles: self.delete_particles() for particle in self.particles...
DimYfantidis/Mimaras_Movement_Simulator
Classes.py
Classes.py
py
2,525
python
en
code
0
github-code
13
7592635426
from unittest import TestCase from summary.core import TokensSpace class TokenSpaceTest(TestCase): def test_shouldComputeDocumentSpaceAsToken2IdMapping(self): document_tokens = ["quick", "brown", "fox", "jump", "lazy", "dog", "quick", "brown", "fox", "jump", "lazy", "cat"] ...
rajasoun/nlp
nlp_framework/tests/summary/core/document_space_test.py
document_space_test.py
py
1,433
python
en
code
0
github-code
13
24508046650
# https://finance.naver.com/sise/ 에 요청을 보내서 응답을 받아온다. import requests import bs4 url = "https://finance.naver.com/sise/" response = requests.get(url) # print(response.text) # 받아온 response.text를 파이썬이 알아먹을 수 있도록 예쁘게 만들어준다. parser는 html.parser를 사용한다. html = bs4.BeautifulSoup(response.text, "html.parser") # print(html) ...
khs123456/TIL
day1/kospi.py
kospi.py
py
464
python
ko
code
0
github-code
13
1047687779
"""test_people Tests for people controller created 28-oct-2019 by richb@instantlinux.net """ import pytest from unittest import mock import test_base class TestPeople(test_base.TestBase): def setUp(self): self.authorize() @pytest.mark.slow def test_add_and_fetch_person(self): record ...
instantlinux/apicrud
tests/test_people.py
test_people.py
py
8,829
python
en
code
2
github-code
13
7512718219
# -*- coding:utf-8 -*- # author:peng # Date:2023/4/4 11:50 import time import cv2 import numpy as np from flask import request, Flask, render_template from flask_cors import CORS from Mtcnn_interface import mtcnn_detector, face_recognition, list_to_json app = Flask(__name__) # 允许跨越访问 CORS(app) @app.route("/recogni...
OpenHUTB/customs
mtcnn-facenet-pytorch/server_main.py
server_main.py
py
2,553
python
en
code
5
github-code
13
17041222854
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.JointAccountQuotaDTO import JointAccountQuotaDTO from alipay.aop.api.domain.AuthorizedRuleDTO import AuthorizedRuleDTO class AlipayFundJointaccountRuleModifyModel(object): de...
alipay/alipay-sdk-python-all
alipay/aop/api/domain/AlipayFundJointaccountRuleModifyModel.py
AlipayFundJointaccountRuleModifyModel.py
py
4,994
python
en
code
241
github-code
13
14273589266
#python #This Script Create a weight map based on the length of a curve import lx, lxu.select, lxu.object #Get selected Mesh Item meshItem = lxu.select.ItemSelection().current()[0] #Get the current scene and create a channel read object scene = meshItem.Context() chanRead = scene.Channels(None, 0) #Lookup the 'crv...
Tilapiatsu/modo-tila_customconfig
Scripts/CreateCurveLengthWMap.py
CreateCurveLengthWMap.py
py
1,006
python
en
code
2
github-code
13
44726269575
import kgit, sys, os # # list_w # # Used to list all current workspaces stored in the data store def list_w(): workspaces = kgit.get_file("workspaces") if workspaces == "" or workspaces == "\n": kgit.out("No workspaces available") return lines = workspaces.split("\n") kgit.out("=======...
krisnova/kgit
kgit/workspaces.py
workspaces.py
py
2,140
python
en
code
1
github-code
13
12727869635
from selenium.webdriver import Firefox from contextlib import closing from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.common.exceptions impor...
idfumg/series-finder-selenium
run.py
run.py
py
1,686
python
en
code
0
github-code
13
28880432025
from .constants import BLACK, ROWS, COLS, SQUARE_SIZE, WHITE, DARK_BEIGE, LIGHT_BEIGE from .piece import Piece import pygame import math import random class Board: def __init__(self): self.board = [] self.selected_piece = None self.black_left = self.white_left = 12 self.black_kings...
mh022396/Checkers-AI
src/checkers/board.py
board.py
py
13,828
python
en
code
0
github-code
13
74760763537
import streamlit as st from streamlit_image_coordinates import streamlit_image_coordinates from PIL import Image, ImageDraw st.set_page_config(layout="wide") def get_ellipse_coords(point: tuple[int, int]) -> tuple[int, int, int, int]: center = point radius = 10 return ( center[0] - radius, ...
francoisWeber/heating-planner
display_map_calibration.py
display_map_calibration.py
py
2,197
python
en
code
0
github-code
13
2856430328
from __future__ import absolute_import from __future__ import division from __future__ import print_function from valan.streetview_common import streetview_constants TD_BASELINE_AGENT_PARAMS = streetview_constants.BaselineAgentParams( # Actual vocab size is 4280, we add 1 as vocab_id=0 can not be used since we ...
google-research/valan
touchdown/constants.py
constants.py
py
1,481
python
en
code
69
github-code
13
70858437138
import atexit import pathlib import warnings from typing import Any, Callable, Dict, List, Tuple, Union # 3rd party from apeye.requests_url import RequestsURL from apeye.slumber_url import HttpNotFoundError, SlumberURL from apeye.url import URL from domdf_python_tools.paths import PathPlus from domdf_python_tools.typi...
domdfcoding/shippinglabel
shippinglabel/pypi.py
pypi.py
py
9,188
python
en
code
1
github-code
13
21043394096
import sys import platform import bluetooth import threading from argparse import ArgumentParser as AP """ Basic bluetooth scanner ~ v1 """ class SimpleBluetooth: def __init__(self): pass @staticmethod def basic_scan(): cfg = _Config() # How many devices were found?... p...
0pointNull/bluescan
basic.py
basic.py
py
3,285
python
en
code
0
github-code
13
14122389849
import unittest import numpy as np from pyfda.libs import pyfda_fix_lib as fx from pyfda.fixpoint_widgets.fir_df import FIR_DF_wdg class TestSequenceFunctions(unittest.TestCase): def setUp(self): q_dict = {'WI':0, 'WF':3, 'ovfl':'sat', 'quant':'round', 'fx_base': 'dec', 'scale': 1} self.myQ = fx....
chipmuenk/pyfda
pyfda/tests/test_fir_df.py
test_fir_df.py
py
5,413
python
en
code
601
github-code
13
38996510390
import firebase_admin from firebase_admin import firestore firebase_admin.initialize_app() db = firestore.client() newsRef = db.collection('news'); news= newsRef.get(); for key, value in news.items(): if(not (key == "info") ): desc = value["description"] ref.child(key).update({"description":desc.lower()})
artcodefun/test_news
migration/migration.py
migration.py
py
317
python
en
code
0
github-code
13
34466087904
import requests import json from common.commonData import CommonData class HttpUtil: def __init__(self): self.http=requests.session() self.headers={'Content-Type':'application/json;charset=UTF-8'} def post(self,path,data): host=CommonData.host #获取全局变量host路径 data_jso...
lihanhuan/pytest-api
util/httpUtil.py
httpUtil.py
py
668
python
en
code
0
github-code
13
6606379293
"""security URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-base...
nikhil631/Portable-Distress-Security-System
joe/Portable Distress System/security/security/urls.py
urls.py
py
1,365
python
en
code
1
github-code
13
31328859259
import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder from torch.utils.data import DataLoader from utils.datasets import * from transformers import BertTokenizer import nltk from tqdm.notebook import tqdm from models.bert import Ber...
mymiptshame/nlp_NMA
utils/utils.py
utils.py
py
6,714
python
en
code
0
github-code
13
26212296155
import os import math import sys import argparse import youtube_dl BEST_FORMAT = "bestvideo+bestaudio/best" PARSER = argparse.ArgumentParser(description="Youtube Video Downloader") PARSER.add_argument( '--Url', '-u', type=str, help='YouTube video or playlist url') PARSER.add_argument( "--Downloa...
n1xsoph1c/customTools
youtube_downloader.py
youtube_downloader.py
py
3,282
python
en
code
0
github-code
13
35013048210
import numpy as np import matplotlib.pyplot as plt import cv2 import scipy from matplotlib import pyplot as plt #Add imports if needed: from scipy import interpolate import time #end imports #Add extra functions here: def creatPanom(HpanoList, outsize, filepath='sintra/sintra'): """""stiching""""" """1to2""" ...
shalip91/Homography
my_homography.py
my_homography.py
py
17,427
python
en
code
0
github-code
13
7317626054
from langchain.llms import LlamaCpp from langchain.prompts import PromptTemplate from langchain.callbacks.manager import CallbackManager from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler import paho.mqtt.client as mqtt from dotenv import load_dotenv from langchain.output_parsers import Pyd...
MarcusTXK/esp32-llm-bridge
mvp_v3/test.py
test.py
py
5,150
python
en
code
0
github-code
13
70059062099
# vim: expandtab:tabstop=4:shiftwidth=4 """ This is the base class for our gcp utility classes. """ import os # pylint: disable=import-error from apiclient.discovery import build from oauth2client.client import GoogleCredentials # Specifically exclude certain regions DRY_RUN_MSG = "*** DRY RUN, NO ACTION TAKEN ***"...
openshift/openshift-tools
openshift_tools/cloud/gcp/base.py
base.py
py
8,744
python
en
code
161
github-code
13
27702316933
#Title: MPB_post_processing.py #Author: Tony Chang #Date: 02.10.2015 #Abstract: This script takes the output from MPB_Cold_T_area_analysis_v1_3.py that is stored as a NetCDF4 # and compiles the data together to single variables, so that they can be accessed in a single manner # import numpy as np import matplotl...
tonychangmsu/Python_Scripts
eco_models/mpb/MPB_post_processing_v1_2.py
MPB_post_processing_v1_2.py
py
9,412
python
en
code
0
github-code
13
21322024206
import math import os import hashlib from urllib.request import urlretrieve import zipfile import gzip import shutil import numpy as np from PIL import Image from tqdm import tqdm def _read32(bytestream): """ Read 32-bit integer from bytesteam :param bytestream: A bytestream :return: 32-bit integer ...
justputitdown/DLND
2_cnn_dog_project/data_dl.py
data_dl.py
py
6,016
python
en
code
0
github-code
13
21676003892
def solution(sizes): bigger, smaller = 0, 0 for s1, s2 in sizes: # 큰 순으로 정렬 if s1 < s2: s1, s2 = s2, s1 # 대소비교 bigger = max(bigger, s1) smaller = max(smaller, s2) return bigger*smaller
SangHyunGil/Algorithm
Programmers/Lv1/최소직사각형(Python).py
최소직사각형(Python).py
py
290
python
en
code
0
github-code
13
71398697617
from tilt_detector import TiltDetector, LineMerger from utils import ResultsHandler from concrete_polygon_extractor import LineExtender, PolygonRetriever import os import argparse import sys import cv2 def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('--image', type=str, help='Path to...
dashos18/resizing-for-pole-extracted
main.py
main.py
py
4,708
python
en
code
0
github-code
13
74909558096
num_de_n = int(input()) pesos = [] for i in range(0, num_de_n): if i % 2 == 0: pesos.append(2) else: pesos.append(4) pesos[0] = 1 pesos[num_de_n - 1] = 1 print(pesos)
Teuszin/Calculo-Numerico
Listas_do_Lop/Lista_06/Testes.py
Testes.py
py
194
python
es
code
0
github-code
13
41974526102
import requests import random import time user_agents = [ "Mozilla/5.0 (iPhone; CPU iPhone OS 17_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Mobile/15E148 Safari/604.1", "Mozilla/5.0 (PlayStation 5 8.20) AppleWebKit/601.2 (KHTML, like Gecko)", "Mozilla/5.0 (PlayStation 4 11.00)...
HoppersPS4/PredecessorGameQueSkipper
main.py
main.py
py
5,303
python
en
code
0
github-code
13
41115668185
import os import sys import lxml from lxml import etree def domainfromurl(url): x = url.replace('https://', '') y = x.split('/') return y[0] def nobindfromurl(url): x = url.split(';') return x[1].replace('nobind=', '') def ipfromurl(url): x = url.replace('https://', '') return True d...
whojarr/roxentools
roxentools/config.py
config.py
py
3,911
python
en
code
1
github-code
13
21268503858
import json,sys,re json_path="/home/fux/fux/miRNASNP3/predict_result/altutr/Targetscan/tga_altutr_compltet_chr_json/" bed_path="/home/fux/fux/miRNASNP3/predict_result/altutr/Targetscan/tga_altutr_compltet_chr_bed/" in_path="/home/fux/fux/miRNASNP3/predict_result/altutr/Targetscan/tga_altutr_compltet_chr/" f=sys.argv[...
chunjie-sam-liu/miRNASNP-v3
scr/predict_result/altutr/B-01-altutr-tgs-bed.py
B-01-altutr-tgs-bed.py
py
1,415
python
en
code
3
github-code
13
74136034898
def is_anagram(first_string, second_string): first_str = list(first_string.lower()) second_str = list(second_string.lower()) if (len(first_str) != len(second_str)): return False for value in first_str: try: second_str.remove(value) except ValueError: r...
magno-vicentini/project-algorithms
challenges/challenge_anagrams.py
challenge_anagrams.py
py
349
python
en
code
0
github-code
13
6922236318
''' Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] + nums[j] + nums[k] < target. Example: Input: ''' class Solution: def hash(self,nums): hashmap={} for num in nums: if num not in hashm...
Oushesh/CODING_INTERVIEW
LeetCode/Apple/OnSite/threeSumSmaller.py
threeSumSmaller.py
py
2,997
python
en
code
0
github-code
13
27705286602
import os import sentencepiece import collections import re class Patterns: SELF_BREAK_TOKEN = r'<selfbr>' SELF_BREAK_RGX = re.compile(SELF_BREAK_TOKEN) GET_SUBMISSION_SELF_TEXT_RGX = re.compile( r'(?<=%s).*$' % SELF_BREAK_TOKEN, re.DOTALL) BOT_BODY_RGX = re.compile( r"""^i a...
jessicazhu191/Reddit-Download
util.py
util.py
py
4,199
python
en
code
0
github-code
13
20474913617
import logging import json import os import boto3 logger = logging.getLogger("lookup-runner") logger.setLevel(logging.DEBUG) def handler(event, context): job_name = get_job_name(event) debug_print(f"Job name: {job_name}") runner = find_runner_for_job(job_name=job_name) return { "Arn": runner[...
JimmyDqv/gitlab-runners-on-aws
AutoScaler/lambdas/lookup/lookup-runner.py
lookup-runner.py
py
1,224
python
en
code
13
github-code
13
34914414063
import numpy as np from patteRNA import rnalib class Transcript: def __init__(self, name, seq, obs): self.name = name self.seq = seq self.obs = np.array(obs) self.T = len(obs) self.obs_dom = None self.ref = None self.alpha = None self.beta = None ...
AviranLab/patteRNA
src/patteRNA/Transcript.py
Transcript.py
py
2,058
python
en
code
12
github-code
13
37784894142
import cv2 import numpy as np import time #Load the camera time.sleep(3) cap = cv2.VideoCapture(0) print("Opening Camera ... ") for i in range (60): _,background = cap.read() background = np.flip(background, axis = 1) while cap.isOpened() : ret,frame = cap.read() if ret ==False : print(...
abdulahad01/ComputerVision-Projects
invisible cloth.py
invisible cloth.py
py
1,423
python
en
code
5
github-code
13
15302358436
#!/usr/bin/python3 from re import I import numpy as np import matplotlib.pyplot as plt import sys import math file_list = [] opr_name = ["Insert", "Delete", "Update", "Read"] rm_cnt = 0 mark_split_file = "" mark_merge_file = "" # Processing cmd arg if len(sys.argv) > 1: state = 0 for i in range(1, len(sys.arg...
josephly88/B-Tree_on_disk
proc_data/plot.py
plot.py
py
5,418
python
en
code
0
github-code
13
974288637
from django.conf import settings from django.contrib.gis import admin from django.contrib.gis.admin.widgets import OpenLayersWidget from django.contrib.gis.admin.widgets import geo_context from django.contrib.gis.gdal import OGRException from django.contrib.gis.gdal import OGRGeomType from django.contrib.gis.geos impor...
christaggart/openblock
ebpub/ebpub/db/admin.py
admin.py
py
10,191
python
en
code
null
github-code
13
12410379593
#Write a program that finds the summation of every number from 1 to num. The number will always be a positive integer greater than 0. #For example: #summation(2) -> 3 1 + 2 #summation(8) -> 36 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 def summation(num): number = 0 for i in range(1, num+1): # Learned: to create a range f...
KaiaWalters/code-wars
Python/grasshopperSummation.py
grasshopperSummation.py
py
397
python
en
code
1
github-code
13
74176776979
# -*- coding: utf-8 -*- """ Created on Mon Jul 10 10:39:04 2017 @author: gregz """ from args import parse_args import os.path as op from astropy.io import fits import matplotlib import matplotlib.pyplot as plt import numpy as np import datetime import warnings import sys import traceback from fiber import Fiber from f...
grzeimann/Panacea
virusw_special_reduction.py
virusw_special_reduction.py
py
14,173
python
en
code
8
github-code
13
71918189459
""" 025. 保龄球 小明到保龄球馆打保龄球,一次十局。若一到八局都零分,剩下最后两局。 保龄球打球规则为: (1) 每一局有十瓶保龄球瓶。 (2) 若某局第一球没有全部打倒十瓶保龄球瓶,可再打第二球。 (3) 若某局第一球打倒全部十瓶保龄球瓶,此局只打一球。 (4) 若第十局打倒全部十瓶保龄球瓶,此局可以打三球。 保龄球每一局计分规则为: (1) 两球打倒保龄球瓶少于十瓶,每一瓶得一分。 例如两球打倒 7 瓶、2瓶,计为 7 2。 此局分数计为 7+2 = 9。 (2) 第一球打倒保龄球瓶少于十瓶,第二球将剩余球瓶均打倒 (spare), 每一瓶得一分,并加计后面一球打倒瓶数。 例如两球打倒 7 瓶、3 瓶,下一球打倒 5...
guyleaf/python
homework/025. 保齡球/test25.py
test25.py
py
2,329
python
zh
code
1
github-code
13
25523992503
import tkinter as tk from initialize import initialize_database from ui.login_view import LoginView from ui.register_view import RegisterView from ui.game_view import TicTacToeGrid from game import TicTacToeGame from services.service import UserService class UI: """Luokka, joka vastaa käyttöliittymästä""" def...
xcvbnmas/ot-harjoitustyo
src/main.py
main.py
py
1,750
python
fi
code
0
github-code
13
17119948303
import pygame as pg from dataclasses import dataclass import random as rnd resolution = 400 grid = 20 size = resolution // grid mine_count = 20 pg.init() screen = pg.display.set_mode([resolution, resolution]) cell_normal = pg.transform.scale( pg.image.load("Teil_10_ms_cell_normal.gif"), (size, size) ) cell_marke...
ReturntoSender/python
minesweeper/minesweeper.py
minesweeper.py
py
3,264
python
en
code
0
github-code
13
31687855816
from django.db import models from django.core.files.storage import FileSystemStorage from django.contrib.auth.models import User fs = FileSystemStorage(location='/media/hushvids') class Show(models.Model): """ Represents a show """ title = models.CharField(max_length=255) class Episode(models.Model)...
zlandry13/hush
hushstream/video/models.py
models.py
py
1,068
python
en
code
0
github-code
13