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
34801867065
import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import numpy as np # Load the dataset file_path = './data/Retail_Investors_Focus.xlsx' data = pd.read_excel(file_path) # Show basic information about the dataset and the first few rows data_info = data.info() first_rows = data.head() data_info...
monacosc1/makeover-monday
2023/W41/retail_investors.py
retail_investors.py
py
1,367
python
en
code
0
github-code
13
23603257269
import numpy as np import matplotlib.pyplot as plt try: import cupy as cp except ImportError or ModuleNotFoundError: print('CuPy is not found, using NumPy backend...') cp = np def draw_PSF_difference(inp_0, inp_1, diff, is_log=False, diff_clims=None, crop=None, colormap='viridis'): from mpl_toolkits.a...
EjjeSynho/LIFT
tools/misc.py
misc.py
py
3,990
python
en
code
0
github-code
13
11001981670
import subprocess import threading scan_complete_event = threading.Event() def run_pocsuite_scan(target, poc_file): pocsuite3_command = f"pocsuite -r {poc_file} -u {target}" print(f"Starting Pocsuite3 scan for {target} using POC file {poc_file}") try: result = subprocess.run(pocsuite3_command...
yuag/bgscan
pocsuite3/pocsuite3.py
pocsuite3.py
py
1,308
python
en
code
9
github-code
13
2260399068
import numpy as np import cv2 import pyzbar.pyzbar as pyzbar import csv import pandas as pd import time import tkinter as tk item = [0,0,0,0,0,0,0,0,0,0] def update_items_local(data): global item if data == 'Item:1': item[0] = item[0]+1 elif data == 'Item:2': item[1]=item[1]...
adil-ammar/Smart-Inventory-Management
Updation/Trial.py
Trial.py
py
1,972
python
en
code
0
github-code
13
13809080168
from typing import List,Tuple from simulacion import Simulacion,Metrica,crear_eventos_llegada,Evento,crear_eventos_salida from tareas import Tarea,tareas_random,string_a_fecha import bisect import configuracion from configuracion import Configuracion,print import json from math import ceil from administradores ...
alexiscaspell/task-simulator
app.py
app.py
py
3,815
python
es
code
0
github-code
13
74190171217
import sys import cv2 import re import os def cutSkinHead(skinPath, headPath, size=(64, 64)): img = cv2.imread(skinPath) img = img[8:16, 8:16] img = cv2.resize(img, size, interpolation=cv2.INTER_AREA) cv2.imwrite(headPath, img) if __name__ == '__main__': skinPath = sys.argv[1] if len(sys.argv) >...
Gura-Dev/skin-service
main.py
main.py
py
1,643
python
en
code
0
github-code
13
38711658221
print("You in cinema.Please enter your age ") while True: print("If you want to stop write end") answer=input("Write your age") if answer.lower()=="end": break else: answer=int(answer) if answer<=3: print("For you we haven't cost") elif answer<12>3: ...
VigularIgnat/python
mygr/Exam/pr2.py
pr2.py
py
416
python
en
code
0
github-code
13
30936382696
#coding=utf-8 import copy, numpy as np np.random.seed(0) # compute sigmoid nonlinearity #定义sigmoid函数 def sigmoid(x): output = 1/(1+np.exp(-x)) return output # convert output of sigmoid function to its derivative #计算sigmoid函数的倒数 def sigmoid_outpu...
kanuore/lstm-in-mnist
reference/exmple.py
exmple.py
py
6,234
python
en
code
0
github-code
13
45622166196
import scrapy from dianyingPro.items import DianyingproItem class DianyingSpider(scrapy.Spider): name = "dianying" # allowed_domains = ["dianyi.ng"] start_urls = ["https://dianyi.ng/v/action.html "] # start_urls = ["https://www.hacg.sbs/wp/anime.html"] url = 'https://dianyi.ng/v/action-%d.html' ...
Mryaochen/python_code
dianyingPro/dianyingPro/spiders/dianying.py
dianying.py
py
1,944
python
en
code
1
github-code
13
20429632741
import collections import os.path as osp from itertools import repeat import torch.utils.data from cogdl.data import Adjacency, Graph from cogdl.utils import makedirs from cogdl.utils import accuracy, cross_entropy_loss def to_list(x): if not isinstance(x, collections.Iterable) or isinstance(x, str): x ...
sultanalnahian/gg-principle-classifier
graphmethods/cogdl/cogdl/data/dataset.py
dataset.py
py
9,302
python
en
code
0
github-code
13
25888710772
from flask import Flask, request, jsonify from manipulateK6 import testJarServer app = Flask(__name__) @app.route('/actTest/<testType>/<testApi>/<userCount>') def testK6(testType,testApi,userCount): print(testType) print(testApi) print(userCount) #print(testType,testApi,userCount) # res = test...
offMomySon/Spring_performance_test
ForK6/clientForK6.py
clientForK6.py
py
641
python
en
code
0
github-code
13
31236858489
def homework_5(matrix, start, end, total): # 請同學記得把檔案名稱改成自己的學號(ex.1104813.py) # 一個矩陣存取節點到節點間的路徑,一個矩陣存取節點中插入的中轉點。 path = [[-1]*total for _ in range(total)] #設計一個n*n矩陣來填入path A = [[0]*total for _ in range(total) ] #設計一個n*n矩陣來填入初始數對應步數 for i in range(len(matrix)): #將題目給的數值及對應步數丟到矩陣A if i>...
daniel880423/Member_System
file/hw5/1100421/hw5_s1100421_4.py
hw5_s1100421_4.py
py
2,071
python
en
code
0
github-code
13
36150509226
# import pdb; pdb.set_trace() import argparse import itertools import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import numpy as np import seaborn as sns import pandas as pd from seaborn_fig_2_grid import SeabornFig2Grid from collections import defaultdict plt.style.use('seaborn') plt.rc('font'...
sayuj-choudhari/Causal-Inference-SURF-2023
acc_vs_err_jointplot.py
acc_vs_err_jointplot.py
py
8,846
python
en
code
0
github-code
13
42702913631
class crud(): def __init__(self): import os self.os = os print('Cadastro') #Função para ler os dados cadastrados def ler(self): if not self.os.path.exists('base_dados.txt'): escrita = open('base_dados.txt', 'w') escrita.write('') ...
luizsouza1993/Data_Science_Python
crud.py
crud.py
py
4,795
python
pt
code
0
github-code
13
7092502557
from typing import List class Solution: def isMonotonic(self, nums: List[int]) -> bool: ascendente = 'true' for i in range(len(nums)-1): if nums[i]>nums[i+1]: ascendente = 'false' break descendente = 'true' for i in range(len(num...
alexandreborgmann/leetcode
MonotonicArray.py
MonotonicArray.py
py
660
python
en
code
0
github-code
13
31708786603
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() #from haystack.views import SearchView urlpatterns = patterns('', # Examples: url(r'^$', 'kudosapp.views.home', name='home'), url(r'^directory/$', ...
exiao/TMKudos
kudos/kudos/urls.py
urls.py
py
833
python
en
code
0
github-code
13
36333372835
""" k 그룹으로 나눈다 -> k-1 개의 경계를 만들어야 한다. 가장 차이가 큰 숫자 사이에 경계를 만들면 최대이득이다. => 그 차이만큼 최종값에서 사라지고 0이 된다 """ import sys n, k = map(int, sys.stdin.readline().strip().split()) student = list(map(int, sys.stdin.readline().strip().split())) # print(student) answer = 0 if n == k: print(answer) sys.exit(0) # 초기값 설정 ans...
bywindow/Algorithm
src/Greedy/백준_행복유치원_G5.py
백준_행복유치원_G5.py
py
694
python
ko
code
0
github-code
13
31722774603
import pickle from collections import defaultdict import matplotlib import matplotlib.pyplot as plt import pandas as pd from matplotlib.font_manager import FontProperties matplotlib.rcParams['font.family'] = 'Microsoft JhengHei' font = FontProperties() font.set_size('xx-small') colormap = 'tab20' pdm = 'data/draw-d...
exiaohu/multi-mode-route-rec
scripts/draw_poi_demand_pic.py
draw_poi_demand_pic.py
py
1,362
python
en
code
6
github-code
13
22544026648
import sys input = sys.stdin.readline stack = [] n = int(input()) for _ in range(n): x = input().strip() if "push" in x: stack.append(x.split()[1]) elif x == "size": print(len(stack)) elif x == "empty": if len(stack) != 0: print("0") else: print...
WeeYoungSeok/python_coding_study
class_2/class_2_10.py
class_2_10.py
py
559
python
en
code
0
github-code
13
12617186898
class CreditCard: def __init__(self, card_no, balance): self.card_no = card_no self.balance = balance """ Vinay_card_details : { 1001 : 2500, 2002 : 3000 } """ class InvalidCase(Exception): def __init__(self, price, balance): msg = "The actual price is : ", pr...
Vinaykuresi/Python_Full_Stack_Aug_2022
Python/OOPS/Exception_handling/custom_exception.py
custom_exception.py
py
1,659
python
en
code
0
github-code
13
33935961447
# import faulthandler import logging import os import sys import time from pathlib import Path from typing import Union import networkx as nx import numpy as np from graph_tool import Graph from network_dismantling import dismantler_wrapper from network_dismantling.FINDER_ND.FINDER import FINDER from network_dismantl...
NetworkDismantling/review
network_dismantling/FINDER_ND/python_interface.py
python_interface.py
py
4,788
python
en
code
6
github-code
13
40016824701
from mpi4py import MPI if __name__ == '__main__': N = 10 L = [] comm = MPI.COMM_WORLD rank = comm.Get_rank() nb_proc = comm.Get_size() for i in range(int(N/nb_proc*rank), int(N/nb_proc*(rank+1))): L.append(i) data = comm.gather(L, root=0) if rank == 0: print(data)
lechevaa/Test_NR440
main.py
main.py
py
318
python
en
code
0
github-code
13
72758493777
CLASS_TO_COLOR = { 'f2f' : (0, 1, 0), # Green 'df' : (1, 0, 0), # Red 'fs' : (0, 1, 1), # Cyan 'icf' : (1, 0.6, 0), # Orange 'gann': (1, 0.7, 0.8), # Pink 'x2f' : (0, 0, 1) # Blue } CLASS_TO_LABEL = { 'real' : 'Real', 'df' : 'Deepfakes', 'f2f' : 'Face2F...
jcbrockschmidt/face-forgery-detection
scripts/visualize/common.py
common.py
py
426
python
fr
code
3
github-code
13
72865887057
import os import glob import cdms2 import numpy as np import numpy.ma as ma import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.colors as colors import cartopy.crs as ccrs from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter plotTitle = {'fontsize': 11.5} plotSideT...
zshaheen/e3sm_time_series
diff.py
diff.py
py
4,903
python
en
code
1
github-code
13
73261176018
from flask import Blueprint, render_template, request, redirect, abort from flask.helpers import url_for from flask_login import login_required, logout_user, login_user from models import User from urllib.parse import urlparse, urljoin from dotenv import load_dotenv import atexit from flask_login import login_required...
YashKandalkar/eco-mart
blogs.py
blogs.py
py
2,005
python
en
code
1
github-code
13
27044781406
import factory from unittest import mock from .models import Submission from .provider import get_or_create_submission_result class SubmissionFactory(factory.django.DjangoModelFactory): class Meta: model = Submission def test_get_result_if_reply_was_evaluated(): reply = "test reply" SubmissionF...
Akay7/solving-code-problems
backend/solution_verification_provider/tests.py
tests.py
py
2,183
python
en
code
0
github-code
13
35959218043
# Rhys Dunn - 2015 # Learning image vision/OpenCV # import libraries import numpy as np import cv2 # load image img = cv2.imread("money.jpg") # prep image - blur and convert to grey scale grey = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) blurred = cv2.GaussianBlur(grey, (17, 17), 0) # show blurred image and grey sca...
kineticR/Image-coin-counter
coin counter.py
coin counter.py
py
867
python
en
code
10
github-code
13
31494294262
# Faça um programa para imprimir: # 1 # 2 2 # 3 3 3 # ..... # n n n n n n ... n # para um n informado pelo usuário. Use uma função que receba um valor n inteiro e imprima até a n-ésima linha. # while True: try: a = int(input('Número de valores: ')) break exc...
GuilhermeMastelini/Exercicios_documentacao_Python
Funções/Lição 1.py
Lição 1.py
py
413
python
pt
code
0
github-code
13
16129665243
#!/usr/bin/python3 from PIL import Image, ImageOps def add_border(input_image, output_image, border): img = Image.open(input_image) if isinstance(border, int) or isinstance(border, tuple): bimg = ImageOps.expand(img, border=border) else: raise RuntimeError("Border is not an integer or tu...
udhayprakash/PythonMaterial
python3/11_File_Operations/03_multimedia/a_image_files/13_applying_borders.py
13_applying_borders.py
py
1,005
python
en
code
7
github-code
13
18606006524
from scenario_builder import Scenario from scenario_builder.openbach_functions import StartJobInstance from scenario_builder.helpers.service.dash import dash_client, dash_client_and_server from scenario_builder.helpers.postprocessing.time_series import time_series_on_same_graph from scenario_builder.helpers.postprocess...
CNES/openbach-extra
apis/scenario_builder/scenarios/service_video_dash.py
service_video_dash.py
py
2,730
python
en
code
0
github-code
13
18998687347
import numpy as np import pandas as pd import matplotlib.pyplot as plt from dwave.system import DWaveSampler, EmbeddingComposite import dwave.inspector as inspector from mapping_qubits import * def Merge(dict_1, dict_2): result = dict_1 | dict_2 return result # {(0, 0): 4, (1, 1): 3, (0, 1): 10} def auto_embedding...
fedeFuidio/quantum_embedding
quadratic_embedding.py
quadratic_embedding.py
py
2,071
python
en
code
0
github-code
13
32798979231
"""Install Dallinger as a command line utility.""" import pathlib from setuptools import setup # The directory containing this file HERE = pathlib.Path(__file__).parent README = (HERE / "README.md").read_text(encoding="utf-8") setup_args = dict( name="dallinger", packages=["dallinger", "dallinger_scripts"]...
Dallinger/Dallinger
setup.py
setup.py
py
3,751
python
en
code
113
github-code
13
38577954561
import logging from logging.handlers import TimedRotatingFileHandler def get_standard_logger(pgm_name): logger = logging.getLogger('eyesone') if logger.hasHandlers(): return logger # 로그 레벨 설정 logger.setLevel(logging.DEBUG) # 콘솔 출력 핸들러 stream_handler = logging.Str...
mrbluesky0123/eyesone-game
score_system/common/logger.py
logger.py
py
918
python
ko
code
1
github-code
13
6263396224
import cv2 windowName = "threshold image" trackbarValue = "threshold scale" scaleFactor = 0 maxScale = 255 imagePath = "CoinsB.png" src = cv2.imread(imagePath, cv2.IMREAD_GRAYSCALE) cv2.namedWindow(windowName,cv2.WINDOW_AUTOSIZE) def threshold_image(*args): global scaleFactor scaleFactor = 0 + args[0] ...
chrismarti343/coin-recognition
taskbar.py
taskbar.py
py
686
python
en
code
0
github-code
13
40322204265
import numpy as np from utils.OfflineDataLoader import OfflineDataLoader from base.BaseRecommender import RecommenderSystem from base.BaseRecommender_SM import RecommenderSystem_SM from base.RecommenderUtils import check_matrix, to_okapi, to_tfidf try: from base.Cython.Similarity import Similarity except ImportEr...
yigitozgumus/PolimiRecSys2018
models/KNN/Item_KNN_CFRecommender.py
Item_KNN_CFRecommender.py
py
4,404
python
en
code
0
github-code
13
41524497173
Data = [ "Moris", "Male", "Japan", "30-06-1998", "moriskha@gmail.com", "017896524", ] Data2 = [ "Rojina", "Female", "Japan", "30-06-1998", "moriskha@gmail.com", "017896524", ] Gender = Data[1] if Gender == "Male": name ...
raqib4you/Learn-Paython
class5/first.py
first.py
py
615
python
en
code
1
github-code
13
15303394086
from copy import deepcopy from typing import List from sortedcontainers import SortedList class Solution: def minAbsoluteDifference(self, nums: List[int], x: int) -> int: if x == 0: return 0 arr, best_dist = SortedList([]), float("inf") for i in range(x, len(nums)): ...
JosephLYH/leetcode
leetcode/2817.py
2817.py
py
1,124
python
en
code
0
github-code
13
17040776314
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayFincoreComplianceCaasMerchantlevelConsultModel(object): def __init__(self): self._amount = None self._app_name = None self._app_token = None self._biz_type =...
alipay/alipay-sdk-python-all
alipay/aop/api/domain/AlipayFincoreComplianceCaasMerchantlevelConsultModel.py
AlipayFincoreComplianceCaasMerchantlevelConsultModel.py
py
5,317
python
en
code
241
github-code
13
4845201132
from flask import Blueprint, jsonify, session, request from flask_login import login_required from app.models import Tag, db import json tag_routes = Blueprint('tags', __name__) @tag_routes.route('/', methods=['POST']) @login_required def createTag(userid): req_data = json.loads(request.data) tag_name = req_...
mjshuff23/evernote-clone
app/api/tag_routes.py
tag_routes.py
py
899
python
en
code
16
github-code
13
13573393212
import socket import random client = socket.socket(socket.AF_INET , socket.SOCK_STREAM) client.connect((socket.gethostname() , 8080)) l,h,n = [int(i) for i in client.recv(1024).decode('utf-8').split('\n')] print("You are worker number : " + str(n)) print(f"received limits : {l} {h}") while True: msg = client.re...
sirabas369/Socket-programming-and-Multi-threading
client.py
client.py
py
591
python
en
code
0
github-code
13
74518162256
import argparse import csv import simplejson class DataTransformer(object): def transform(self, input_file, output_file): year_header_map = {} output_dict = [] with open(input_file, 'rb') as in_csv_file: csv_reader = csv.reader(in_csv_file, delimiter=',') for row in ...
cbgaindia/parsers
municipal_budget/csv_to_json.py
csv_to_json.py
py
2,504
python
en
code
14
github-code
13
26020816672
from bs4 import BeautifulSoup as bsoup import requests as rq import csv url = "http://espn.go.com/mens-college-basketball/standings" r = rq.get(url) soup = bsoup(r.content) trs = soup.find_all("table", class_=True) with open("records.csv", "wb") as ofile: f = csv.writer(ofile) f.writerow(["Team","Record"]) fo...
adhan06/cbb-winless
Losers.py
Losers.py
py
801
python
en
code
0
github-code
13
22074723955
#!/usr/bin/env python3 """ """ from npoapi import Subtitles import os import json def subtitles(): client = Subtitles().command_line_client(description="Set subtitles") client.add_argument('mid|text', type=str, nargs=1, help='The mid for wich subtitles to get. Or form description') client.add_argument('-...
npo-poms/pyapi
src/npoapi/bin/npo_subtitles.py
npo_subtitles.py
py
1,217
python
en
code
0
github-code
13
73446225298
# -*- coding: utf-8 -*- __author__ = 'Ivan Cherednikov' __email__ = 'ivch@nmbu.no' class LCGRand: def __init__(self, seed): self.a = 16807 self.m = (2 ** 31) - 1 self.r = seed def rand(self): self.r = self.a*self.r % self.m return self.r class ListRand: def __in...
inoplanetka/INF200-2019-Exersices
src/ivan_cherednikov_ex/ex04/myrand.py
myrand.py
py
921
python
en
code
0
github-code
13
24769767509
from pygame.key import get_pressed from pug.component import * from pig import Scene from pig.keyboard import keys from pig.editor.agui import KeyDropdown class Joystick_Button_To_Key( Component): """Convert joystick button presses to simulate keyboard key presses. This component requires the Joystick_...
sunsp1der/pug
pig/components/scene/Joystick_Button_To_Key.py
Joystick_Button_To_Key.py
py
3,840
python
en
code
0
github-code
13
13238507045
""" Class for FileToList """ class FileToList(object): """ FileToList is a helper class used to import text files and turn them into lists, with each index in the list representing a single line from the text file. """ @staticmethod def to_list(file_path): """ Static method...
samjabrahams/anchorhub
anchorhub/lib/filetolist.py
filetolist.py
py
759
python
en
code
6
github-code
13
70696505939
# Harry Potter has got the “n” number of apples. Harry has some students among whom he wants to distribute the apples. These “n” number of apples is provided to harry by his friends, and he can request for few more or a few less apples. # # You need to print whether a number is in range mn to mx, is a divisor of “n” or...
anant-harryfan/Python_basic_to_advance
PythonTuts/Python_Practise/Practise2.py
Practise2.py
py
1,154
python
en
code
0
github-code
13
23240758168
import torch import math from collections import deque class Optim(torch.optim.Optimizer): def __init__(self, params, lr=1e-3, betas=(0.9, 0.992, 0.9), eps=1e-7, k=4, alpha=0.5): defaults = dict(lr=lr, betas=betas, eps=eps, buffer=[[None, None, None, None] for _ in range(10)], k=k, a...
reeshogue/Cozminimum
optim_v2.py
optim_v2.py
py
4,300
python
en
code
0
github-code
13
43165814129
import pytest import requests from connector import ConnectionService import threading import time PORT = 5000 def getNodeList(): return [_service._ip,"192.168.1.21","192.168.1.17","192.168.1.22"] _service = ConnectionService() print(_service._ip,flush=True) print(_service._name,flush=True) _nodes = getNodeL...
oludom/DPSproject3
unit_test.py
unit_test.py
py
3,565
python
en
code
0
github-code
13
29274420185
from skimage.io import imread from skimage.filters import threshold_otsu import matplotlib.pyplot as plt filename='video12.mp4' import cv2 cap = cv2.VideoCapture(filename) # cap = cv2.VideoCapture(0) count = 0 while cap.isOpened(): ret,frame = cap.read() if ret == True: cv2.imshow('window-name',frame)...
rockysw/attendence1
videocap.py
videocap.py
py
515
python
en
code
0
github-code
13
268182460
import pandas as pd import numpy as np import matplotlib.pyplot as plt plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签 plt.rcParams['axes.unicode_minus']=False #用来正常显示负号 data_train = pd.read_csv('../Datasets/titanic/train.csv') data_test = pd.read_csv('../Datasets/titanic/test.csv') # 利用pd返回数据的信息 # print(tra...
JoyGin/DeepLearning_inHand
Kaggle/Titanic.py
Titanic.py
py
4,279
python
en
code
1
github-code
13
21264361366
# # @lc app=leetcode id=74 lang=python3 # # [74] Search a 2D Matrix # # @lc code=start from typing import List class Solution: def searchMatrix(self, matrix: List[List[int]], target: int) -> bool: rows, cols = len(matrix), len(matrix[0]) # tansform the 2D coordinator to 1D lt, rt = 0, ...
sundaycat/Leetcode-Practice
solution/74. search-a-2-d-matrix.py
74. search-a-2-d-matrix.py
py
1,069
python
en
code
0
github-code
13
74045578258
''' Psycopg2 – Insert dictionary as JSON ''' # __________________________ PREP _____________________________ import psycopg2 from psycopg2.extras import Json import pandas as pd import json import ast import pprint ''' lcoal import ''' from Config import payload print(payload) def parse_config(): ...
Borgerod/Telegram_surveillance
postgres_controll_panel.py
postgres_controll_panel.py
py
10,813
python
en
code
0
github-code
13
24263221686
from waflib import Configure, Errors, Utils # TODO: make generic CHECK_SYMBOL_EXISTS_FRAGMENT = ''' #include "build.h" int main(int argc, char** argv) { (void)argv; #ifndef %s return ((int*)(&%s))[argc]; #else (void)argc; return 0; #endif } ''' # generated(see comments in public/build.h) # cat build.h | grep...
FWGS/hlsdk-portable
scripts/waifulib/library_naming.py
library_naming.py
py
4,144
python
en
code
222
github-code
13
39659982749
import random class BankAccount: """ A class to respresent a bank account. Attributes ---------- full_name : str the first and last name of the bank account owner account_number : int randomly generated 8 digit number, unique per account routing_number : int 9 digit...
matthewwei35/CS-1.1_MW_Bank_Account
bank_account.py
bank_account.py
py
4,585
python
en
code
1
github-code
13
6534991885
from tkinter import * from PIL import ImageTk, Image import mysql.connector import testthirdgame root = Tk() root.geometry("1366x768") root.configure(bg="#324AEE") root.resizable(0,0) frame=Frame(root,bg="#324AEE",height=768,width=1366) frame.place(x=0,y=0) img2 = Image.open("polygon1.png") img2 = img2.res...
anazr9/kbc
gamerules.py
gamerules.py
py
2,258
python
en
code
0
github-code
13
15185501956
from flask import Flask, render_template, jsonify from flask_socketio import SocketIO app = Flask(__name__) app.config['SECRET_KEY']='secret!' socketapp = SocketIO(app) @app.route("/") def index(): return render_template("index.html") @socketapp.on('message') def handle_message(message): print('received mess...
kirkdotcam/flasksocketexample
app.py
app.py
py
452
python
en
code
0
github-code
13
38243444996
# coding=utf-8 import re import requests __all__ = ('check_ver',) session = requests.Session() session.trust_env = False url = 'https://raw.githubusercontent.com/animalize/ting_py/master/launcher.py' def check_ver(current, full=True): try: r = session.get(url) except: return '无法获取GitHub上的页...
animalize/ting_py
pc/checkver.py
checkver.py
py
1,269
python
en
code
0
github-code
13
33517935338
from collections import OrderedDict from typing import List, Dict def classify_conversions(arrays: Dict[int, Dict[str, float]], conversion_classifications: List[dict], conversion_levels): """classify conversion by code and type using binned classes Args: arrays (dict): reach dictionaries with convers...
Riverscapes/riverscapes-tools
packages/rvd/rvd/lib/classify_conversions.py
classify_conversions.py
py
3,031
python
en
code
10
github-code
13
42076318398
import torch import torch.nn as nn import torch.nn.functional as F import matplotlib.pyplot as plt class CNN(nn.Module): def __init__(self, args, num_layers, input_shape, channel_size, output_size1=100, output_size2=1000, bn_momentum=1e-3, dropout=0.): super(CNN, self).__init__() self.layers = num_...
sangminwoo/Cost-Out-Multitask-Learning
lib/models/multi_task/cnn_multitask.py
cnn_multitask.py
py
5,499
python
en
code
1
github-code
13
7023662768
# -*- coding: utf-8 -*- import numpy as np import time from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error from sklearn.metrics import r2_score from scipy import stats from sklearn.datasets import fetch_california_housing from sklearn import neighbors s...
chaido-porlou/NeuralNetworks
RBF/knn_regression.py
knn_regression.py
py
1,253
python
en
code
0
github-code
13
34363539638
import logging from godzillops import Chat def main(config): gz_chat = Chat(config) try: _input = "" while True: _input = input("> ") responses = gz_chat.respond(_input) try: for response in responses: if isinstance(respo...
deybhayden/tokyo
platforms/text.py
text.py
py
671
python
en
code
0
github-code
13
19988300684
from django.conf.urls import url from StoriesApp import views urlpatterns = [ url(r'^stories/$', views.AllStoriesView.as_view()), url(r'^stories/(?P<storie_uuid>[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})/$', views.ConcreteStorieView.as_view()), url(r'^api/new_stor...
Linonse/RSOI-lab2-workers
Stories/StoriesApp/urls.py
urls.py
py
449
python
en
code
0
github-code
13
13142188905
import os import csv import cv2 import numpy as np import random import math from keras.models import Sequential from keras.layers import Flatten, Dense, Lambda, Conv2D, Dropout, Cropping2D import sklearn from sklearn.utils import shuffle from keras.callbacks import ModelCheckpoint from keras.optimizers import Adam fr...
ajdhole/Udacity-Behavioral-Cloning-P3
model.py
model.py
py
4,708
python
en
code
0
github-code
13
71340824658
import requests from bs4 import BeautifulSoup src_url = 'https://vjudge.net/' def fetch(url): headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36'} resp = requests.get(url, headers=headers) return resp def parse(resp): ...
civp/spider-zoo
sites.py
sites.py
py
1,129
python
en
code
1
github-code
13
34177523344
import cv2 import numpy as np from torch.nn import functional as F class VideoRecorder(object): def __init__(self, num_img, output_filename="output.avi"): self.frames = {} self.img_frames = {} self.num_steps = ( 100 # TODO: Don't finish on hardcode value, trigger end from outs...
LuisLechugaRuiz/general_manipulation
general_manipulation/utils/video_recorder.py
video_recorder.py
py
4,448
python
en
code
0
github-code
13
73644966416
import glob, os # https://gis.stackexchange.com/questions/227271/where-are-the-temporary-output-layers-from-qgis-processing-algorithms-stored # https://gis.stackexchange.com/questions/169090/how-to-open-and-save-qgis-datasource-with-to-lower-case-fields # Define path to directory of your csv files # path_to_csv = "T...
jerbou/Python_Qgis_stuff
multi_csv.py
multi_csv.py
py
1,233
python
en
code
0
github-code
13
12619882362
from .. import db from . import BaseModel from sqlalchemy import Column, Date, ForeignKey, Integer, JSON, String, Float, Boolean, BigInteger from sqlalchemy.orm import relationship, backref class BlockchainNetwork(BaseModel): __tablename__ = 'blockchain_network' name = Column(String(1000), nullable=False, un...
ljrahn/digi-markets
services/server/src/models/web3.py
web3.py
py
1,283
python
en
code
0
github-code
13
71913541779
# description : makes text file of random people (first name, last name, job position, favorite color) # author : Cédric-Antoine Ouellet # github : www.github.com/cedricouellet # website : cedricao.tk import random import os from time import sleep # putting OOP into practice class Person(): '''A temp...
cedricouellet/py-random-person-generator
main.py
main.py
py
3,017
python
en
code
0
github-code
13
40852798881
import glob import cv2 import shutil, os import numpy as np from matplotlib import pyplot as plt from random import randint def blending(pathRgb, pathSmoke): src = cv2.imread(pathRgb) smoke = cv2.imread(pathSmoke, cv2.IMREAD_UNCHANGED) height, width, depth = src.shape # print(smoke.shape) smoke ...
thangylvp/pytorch
genSmoke/loadSmoke.py
loadSmoke.py
py
2,449
python
en
code
1
github-code
13
73758952979
# Run this file in valgrind with: # PYTHONMALLOC=malloc valgrind --tool=memcheck --leak-check=yes --show-leak-kinds=definite --track-origins=yes --num-callers=12 --suppressions=valgrind-python.supp python3 test_memleak_granulator.py # There should not be any definitely lost bytes. from pyo import * import random s...
belangeo/pyo
tests/valgrind/test_memleak_granulator.py
test_memleak_granulator.py
py
1,387
python
en
code
1,221
github-code
13
7704566220
from swarmops.Optimize import SingleRun from swarmops import tools ######################################################################## class LUS(SingleRun): """ Perform a single optimization run using Local Unimodal Sampling (LUS). In practice, you would typically perform multiple optimizat...
Hvass-Labs/swarmops
swarmops/LUS.py
LUS.py
py
5,244
python
en
code
70
github-code
13
9087543830
#https://www.acmicpc.net/problem/20438 #백준 20438번 출석체크(그리디, 누적합) #import sys #input = sys.stdin.readline n, k, q, m = map(int, input().split()) students = [0]*(n+3) sleep = set(map(int, input().split())) attend = list(map(int, input().split())) attendPossible = set() for code in attend: if code in sleep: ...
MinsangKong/DailyProblem
06-29/2-2.py
2-2.py
py
796
python
en
code
0
github-code
13
6589445746
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ' Simple ORM using metaclass ' # 基类 class Field(object): def __init__(self, name, column_type): self.name = name self.column_type = column_type def __str__(self): return '<%s:%s>' % (self.__class__.__name__, self.name) # 字符串型字段 class S...
lazzman/PythonLearn
Python3_Learn/7. 面向对象编程高级/元类案例orm.py
元类案例orm.py
py
2,700
python
en
code
4
github-code
13
42344393037
import codecs from pydoc import describe import time, array import numpy as np import os, sys import imageio import cv2 from tqdm import tqdm_notebook as tqdm from PIL import Image import keras from keras.layers import Input, Conv2D, MaxPooling2D, Flatten, Dropout, Dense, LSTM, TimeDistributed, RepeatVector, BatchNorma...
nebulayoon/malware-classification
cnn.py
cnn.py
py
8,771
python
en
code
0
github-code
13
27702378803
#Title: hourly_model.py #Author: Tony Chang #Date: 9/2/2015 #Abstract: Test code to transform daily temperature values into hourly under various algorithms #Newton's Law of Cooling method #dP/dt = k(P-A) #where A is the ambient temperature, P is the phloem temperature, k is the rate of temperature transfer from tree t...
tonychangmsu/Python_Scripts
eco_models/mpb/hourly_model_09022015.py
hourly_model_09022015.py
py
7,125
python
en
code
0
github-code
13
28351395019
import torch import torch.nn as nn import transformers """ This script shows how to combine two transformer models to create a hybrid model. This is just an experimentation and not a part of the project. """ bart_model_name = 'facebook/bart-base' t5_model_name = 't5-base' bart_model = transformers.AutoModelF...
nazhimkalam/gensum
Code/datascience/core/hybrid-combination.py
hybrid-combination.py
py
2,127
python
en
code
2
github-code
13
42929142444
''' Write a program to sort a stack such that the smallest items are on the top. You can use an additional temporary stack, but you may not copy the elements into any other data structure (such as an array). The stack supports the following operations: push, pop, peek, and isEmpty. ''' class Stack: def __init__(self...
lmhbali16/algorithms
CTCI/chapter_3/sort_stack.py
sort_stack.py
py
1,549
python
en
code
0
github-code
13
72228452498
# -*- coding: utf-8 -*- """ Created on Tue Nov 17 07:14:09 2020 @author: lcam """ ''' formato do Arquivo de saída: Nome do grupo membros do grupo [INF1025, [Kaka,Ceci,Teco]], --> INF1025 Kaka Ceci Teco [FIS1020, [Keko]], [FIS1212, [Tata]] [CAL1010,[kiko]] ''' def salvaTabGruposNoArq(tabGrupos): arqS=ope...
luca16s/INF1025
Arquivo/agrupamentosa.py
agrupamentosa.py
py
1,150
python
pt
code
0
github-code
13
24654331541
__author__ = 'Michael Kaldawi' """ Programmer: Michael Kaldawi Class: CE 4348.501 Assignment: P01 (Program 1) Program Description: This program implements a prime number finder utilizing the sieve of Eratosthenes and multi-threading. """ # Note: we are using numpy for our array processing to speed up # runtime. nump...
michael-kaldawi/Prime-Number-Multiprocessing
Multithreading.py
Multithreading.py
py
3,895
python
en
code
1
github-code
13
43357939306
#!/usr/bin/python3 import sys if __name__ == "__main__": if len(sys.argv) != 2: print("#usage python", sys.argv[0],"<fastq>") sys.exit() InFASTQ = sys.argv[1] lLane = [] iCnt = 0 iCntA, iCntC, iCntG, iCntT = 0,0,0,0 with open(InFASTQ) as fr: for line in fr: iCnt += 1 if iCnt % 4 == 2: sSeq = lin...
KennethJHan/Bioinformatics_Programming_101
065.py
065.py
py
522
python
en
code
0
github-code
13
24322275250
"""Choise team repair Revision ID: 475448e80c95 Revises: cc0b9a8c6bec Create Date: 2022-02-20 14:49:35.862420 """ from alembic import op import sqlalchemy as sa from app.enums import ChoiceType from app.choises import equipment, team_composition # revision identifiers, used by Alembic. revision = '475448e80c95' do...
Pavel-Maksimov/shift_logs_flask
migrations/versions/475448e80c95_choise_team_repair.py
475448e80c95_choise_team_repair.py
py
1,046
python
en
code
0
github-code
13
40720066211
# -*- coding: utf-8 -*- """ Created on Thu Feb 14 09:41:56 2019 @author: bradw """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import statsmodels.api as sm from statsmodels.tsa import stattools from statsmodels.graphics.tsaplots import plot_acf, plot_pacf #Data Wrangling #Importing data i...
BradWebb101/PPP-USD-vs-AUD
PPP USD AUD.py
PPP USD AUD.py
py
5,738
python
en
code
0
github-code
13
36711030095
import os import argparse import hashlib import base64 import pathlib def main(args): for f in pathlib.Path(args.i).glob('**/*'): f = str(f) if os.path.isdir(f): continue filename = f.replace(args.i, '') with open(f, 'rb') as df: data = df.read() hash = base64.urlsafe_b64encode(hashlib.sha256(data)....
cyberj0g/OpenCV-Custom
record_generator.py
record_generator.py
py
657
python
en
code
0
github-code
13
32859345328
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from string import whitespace import re from .. import Unit from ...lib.argformats import multibin class trim(Unit): """ Removes byte sequences at beginning and end of input data. """ def interface(self, argp): argp.add_argument('junk', type=mul...
chubbymaggie/refinery
refinery/units/strings/trim.py
trim.py
py
1,867
python
en
code
null
github-code
13
14688656261
import os import numpy as np from features.gradient_features import choose_features #path_directory = '/content/drive/MyDrive/Dataset_Educazone_Test/' path_directory = 'E:/Job_Internships/Educazone/Dataset_Educazone_Test/'#input("Enter the directory of data: \n") filename = path_directory#input("Enter the path w...
SohamChattopadhyayEE/gradientfeatures-with-PCA_GMM
Codes/feature_extraction.py
feature_extraction.py
py
889
python
en
code
0
github-code
13
26422748410
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Aug 9 16:24:43 2018 @author: Olivia Hull Calculate the percent composition of a molecular orbital in Gaussian, specify pop=full keyword This package is written restrictively for Ag6-N2. Any deviation from my standard Ag6-N2 coordinate input will need...
oahull/NP-Code
MO_coefs.py
MO_coefs.py
py
9,325
python
en
code
0
github-code
13
214312525
# exercise 1:copy method list_ = [1,1.5,'python',0b101,True,[20+10j,"india",range(10)]] newlist_ = list_.copy() print(list_) print(newlist_) # if we make any changes the parent copy it also changing in child copy why? # what is deep copy and shallow copy? list_[5].append("john") print(list_) print(newlist_) #exercise ...
nareshchari/tasks
listexercises.py
listexercises.py
py
2,821
python
en
code
0
github-code
13
34692063956
import itertools import scipy import pandas as pd from statsmodels.stats.weightstats import * from math import sqrt from scipy import stats from sklearn import model_selection, metrics, linear_model, ensemble def my_proportions_confint_diff_rel(sample1, sample2, alpha = 0.05): z = stats.norm.ppf(1 - alpha/2.) ...
RBVV23/Coursera
Построение выводов по данным/Week_2/sandbox_2.py
sandbox_2.py
py
11,880
python
en
code
0
github-code
13
21091318947
# coding=utf-8 from dataviz import Dataviz from altair import Chart, load_dataset, X, Y df = load_dataset('seattle-weather') dataviz = Dataviz("Seattle Weather") overview_chart = Chart(df).mark_bar(stacked='normalize').encode( X('date:T', timeUnit='month'), Y('count(*):Q'), color='weather', ) dataviz.ad...
matteo-ronchetti/dataviz
test.py
test.py
py
1,128
python
en
code
0
github-code
13
26945689783
# -*- coding: utf-8 -*- # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from rq import Worker, Queue, Connection import os import redis REDIS_URL = os.getenv('REDIS_URL', 'redis://localhost:6379') listen = ['high', 'default', 'low'] conn = r...
bemau/BotyPy
worker.py
worker.py
py
466
python
en
code
0
github-code
13
17049166424
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class BeikeAccountResponse(object): def __init__(self): self._change_amount = None self._current_amount = None self._outer_biz_no = None @property def change_amount(sel...
alipay/alipay-sdk-python-all
alipay/aop/api/domain/BeikeAccountResponse.py
BeikeAccountResponse.py
py
2,030
python
en
code
241
github-code
13
15819949312
import sys from PyQt6.QtCore import Qt from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel, QPushButton, QFileDialog, QMessageBox, QListWidget, QListWidgetItem, QAbstractItemView from init import get_years, get_unique_values, filter_training_dataframe, create_test_dataframe, create_model, fit_model, ...
EarlyInterventions/earlyinterventions
src/ImportData.py
ImportData.py
py
5,633
python
en
code
0
github-code
13
34799712372
# coding: utf-8 # @author: hongxin # @date: 18-6-2 """ 参考文档: https://www.showdoc.cc/page/102098 """ from requests import post def check_article_suffix(article_path): """ 检查文件格式是否为md :param article_path: :return: """ if article_path.split('.')[1] == 'md': return True else: ...
xiehongxin/ShowdocUpload
upload_markdown_module.py
upload_markdown_module.py
py
3,132
python
en
code
1
github-code
13
41290424135
from random import randint def maior(* num): print(num) lista = [] ind = 0 for lis in range(0, randint(3, 10)): lis = randint(1, 50) print(lis) lista.append(lis) ind += 1 print(lista) lista.sort() quant = len(lista) print(f'sua lista de numeros contém {quant} valores') print(f'Os valores são: {l...
FernandoBoshy/Estudos-python
curso em video/ex099.py
ex099.py
py
361
python
pt
code
0
github-code
13
24964222420
import json from rest_framework.decorators import api_view from rest_framework import status from rest_framework.response import Response from .handleDB import * from .serializers import * @api_view(['POST']) def register(request): """ { "name": "Demo User8", "email": "demouser8@gmail.com", ...
Rohitbhojwani/o1analysis
apti_backend/apti_backend/views.py
views.py
py
26,887
python
en
code
null
github-code
13
70054678739
# pylint: skip-file def main(): ''' ansible oc module for registry ''' module = AnsibleModule( argument_spec=dict( state=dict(default='present', type='str', choices=['present', 'absent']), debug=dict(default=False, type='bool'), namesp...
openshift/openshift-tools
ansible/roles/lib_openshift_3.2/build/ansible/oadm_registry.py
oadm_registry.py
py
5,123
python
en
code
161
github-code
13
7471754900
import math import torch import torch.optim as optim from .utils.kfac_utils import (ComputeCovA, ComputeCovG) from utils.timing import Timer from .utils.factors import ComputeI, ComputeG from .utils.hylo_utils import EmptyBackend def randomized_svd(B, rank): if rank < 1: rank = int(rank * min(B.size()))...
Mohammad-Mozaffari/mkor
bert/optimizers/hkor.py
hkor.py
py
23,368
python
en
code
1
github-code
13
17041567174
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.AlipayInsDataDsbRequestImageInfo import AlipayInsDataDsbRequestImageInfo class AlipayInsDataDsbEstimateApplyModel(object): def __init__(self): self._accident_area_id ...
alipay/alipay-sdk-python-all
alipay/aop/api/domain/AlipayInsDataDsbEstimateApplyModel.py
AlipayInsDataDsbEstimateApplyModel.py
py
11,087
python
en
code
241
github-code
13
14541951925
import time import sklearn import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler from keras.utils import np_utils from keras.models import Sequential from keras.layers import Dense, Activation, Conv1D, MaxPooling1D, Flatten from keras.layers import Dro...
YT1202/DSP2020_Final-Project
Train.py
Train.py
py
9,809
python
en
code
0
github-code
13