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
22911048881
from flask import Flask,request from flask_restful import Resource, Api import pickle import pandas as pd from flask_cors import CORS import numpy as np app = Flask(__name__) CORS(app) api = Api(app) #GET @app.route('/') def index(): return 'Vist /predict Endpoint' #MODEL API @app.route('/predict', ...
shivamdpat94/GLM26.2
app.py
app.py
py
5,250
python
en
code
0
github-code
54
34536580586
grid = [list(map(int, line.strip())) for line in open("Day11.txt", "r")] ans = 0 i = 0 while True: i += 1 visited = set() fq = [] for r in range(10): for c in range(10): grid[r][c] += 1 if grid[r][c] > 9: fq.append((r, c)) visited.add((r, c)) while len(fq): r, c = fq.pop(0) for dr in range(-1,...
kevinmchung/AdventOfCode
2021/Day11/Day11.py
Day11.py
py
714
python
en
code
1
github-code
54
40407112780
nums = [] p = 0 maxRange = 100 for i in range(1,maxRange+1): nums.append(i) for x in range(0,nums.__len__()): n = nums[x]**2 p = p+n t = sum(nums) t = t **2 print(t - p)
Jampar/JP-Programming
Python/Project Euler/Euler Problems/Euler 6.py
Euler 6.py
py
187
python
en
code
0
github-code
54
70659860321
""" 类别:论语 """ import sqlite3 import os import json def make_db(db, path): sql = ''' CREATE TABLE IF NOT EXISTS "lunyu" ( "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "chapter" TEXT, "paragraphs" TEXT ); ''' print('\r\n论语 正在初始化...') try: conn = sqlite3.connect(db) cur = conn.curso...
hippieZhou/chinese-poetry-db
src/lunyu.py
lunyu.py
py
1,081
python
en
code
31
github-code
54
26634277747
from typing import Callable, List import torch from torch import nn import torch.nn.functional as F from einops import rearrange, repeat from .conv_blocks import ConvBlock, DownBlock, UpBlock from .temporal_encoder import TemporalAttentionEncoder2D class UTILISE(nn.Module): def __init__(self, i...
YvonLG/U-TILISE
model/utilise.py
utilise.py
py
3,645
python
en
code
0
github-code
54
17961521442
''' Transcribing DNA into RNA An RNA string is a string formed from the alphabet containing 'A', 'C', 'G', and 'U'. Given a DNA string t corresponding to a coding strand, its transcribed RNA string u is formed by replacing all occurrences of 'T' in t with 'U' in u. Given: A DNA string t having length at most 1000 nt....
Piergiorge/Python
scripts/Rosalind/rosalind_rna.py
rosalind_rna.py
py
534
python
en
code
0
github-code
54
4622604933
import Student as s import Batch as b class StudentScheduler: def __init__(self): self.listStudent = list() self.listBatch = list() def addStudent(self,name,roll): for i in range(0,self.listStudent.__len__()): if(self.listStudent[i].rollNumber == roll): retur...
iit2013159/PythonPractice
project1/StudentScheduler.py
StudentScheduler.py
py
1,418
python
en
code
0
github-code
54
9339861621
import pytest from utils import filter_gc import picologging @pytest.mark.limit_leaks("192B", filter_fn=filter_gc) def test_basic_handler(): handler = picologging.Handler() record = picologging.LogRecord( "test", picologging.INFO, "test", 1, "test", (), None, None, None ) with pytest.raises(N...
microsoft/picologging
tests/unit/test_handler.py
test_handler.py
py
4,181
python
en
code
571
github-code
54
19238319250
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018-12-04 16:15 # @Author : Albert liang # @Email : ld602199512@gmail.com # @File : model.py import tensorflow as tf class CNN(object): def __init__(self, image_height, image_width, kernels, drop_keep_prob): """ :param image_heigh...
albert-liangd/captcha_recognize
model.py
model.py
py
3,826
python
en
code
0
github-code
54
19140171847
import pytest import numpy as np import matplotlib.pyplot as plt from matplotlib.testing.decorators import check_figures_equal from matplottoy.artists import image, line import matplottoy.datasources.array as da from matplottoy.tests.utils import check_axes_property class TestArray: @pytest.fixture(autouse=T...
story645/proposal
code/scraps/tests/test_array.py
test_array.py
py
3,309
python
en
code
13
github-code
54
40701834503
import os import sys __dir__ = os.path.dirname(os.path.abspath(__file__)) sys.path.append(__dir__) sys.path.append(os.path.abspath(os.path.join(__dir__, '../..'))) import cv2 import copy import numpy as np import math import time import sys import paddle.fluid as fluid import ocr.tools.infer.utility as utility from ...
MrZilinXiao/Hyper-Table-OCR
ocr/tools/infer/predict_det.py
predict_det.py
py
8,299
python
en
code
151
github-code
54
21447632320
import re import sys dirs = { 'e': (1, -1, 0), 'w': (-1, 1, 0), 'se': (0, -1, 1), 'sw': (-1, 0, 1), 'nw': (0, 1, -1), 'ne': (1, 0, -1), } tiles = {} file = open(f'{sys.path[0]}/input.txt', 'r') pattern = re.compile(r'(e|s[ew]|w|n[ew])') for line in file: tileMovements = pattern.findall(lin...
Bruception/advent-of-code-2020
day24/part2.py
part2.py
py
1,465
python
en
code
0
github-code
54
40197518745
#!/bin/env -S pvpython --force-offscreen-rendering ## https://www.paraview.org/Wiki/ParaView_and_Python#Control_the_camera """ The successor script to vis.py NOTE: THIS SCRIPT IS DEPRECATED. USE PARAVISION INSTEAD. @ideal usage: $ paravis.py --pipeline project screenshot --project clip Plane 0.1 z -s Non...
modsim/ChromaHD-scripts
deprecated/paravis.py
paravis.py
py
22,409
python
en
code
0
github-code
54
28133221066
import ast import inspect import random import re import string import time import uuid from datetime import datetime from typing import Union from lztools import ansi from lztools.text.match_pairs import brace_matcher, parentheses_matcher, bracket_matcher, greater_and_less_than_matcher from .match_pairs import Match...
Zanzes/lztools
lztools/text/lztext.py
lztext.py
py
11,939
python
en
code
0
github-code
54
41014899450
from classes.LoteBanco import LotesBanco from variables import * from datetime import datetime from classes.Historico import Historico from utils.utilitis import Util from classes.LoteDetalle import LoteDetalle from utils.db import Database as db import traceback from typing import List import os codigoClie...
jesusrafaell/Paso2-pagoproveedor
utils/writeFile.py
writeFile.py
py
7,625
python
es
code
0
github-code
54
20003330907
import argparse def get_parser(): parser = argparse.ArgumentParser(description='LAVT training and testing') parser.add_argument('--amsgrad', action='store_true', help='if true, set amsgrad to True in an Adam or AdamW optimizer.') parser.add_argument('--att_norm_layer_type', default...
Yxxxb/LAVT-RS
LAVT-RVOS/args.py
args.py
py
19,534
python
en
code
1
github-code
54
35033173417
from numpy import loadtxt def main(): print('part 1') print(sonar_sweep('day1/test_input.txt')) print(sonar_sweep('day1/input.txt')) print('part 2') print(sonar_sweep3('day1/test_input.txt')) print(sonar_sweep3('day1/input.txt')) def sonar_sweep(path: str): depths = loadtxt(path) coun...
azhao9/advent-of-code-2021
day1/main.py
main.py
py
638
python
en
code
0
github-code
54
13368548194
import matplotlib.pyplot as plt import numpy as np rand_arr = np.random.randint(1,1000,2000).reshape(1000,2) # macierz o kształcie (1000,2) wypełnioną losowymi wartościami. plt.scatter(rand_arr[:,0],rand_arr[:,1]) # scatter - wizualizacja punktów # Prawa górna ćwiartka w kolorze czerwonym cmap = np.empty(rand_arr.s...
grzegorztata/Python
Modul_9/Modul_9_1/Modul_9_1_wykres_punktowy.py
Modul_9_1_wykres_punktowy.py
py
769
python
pl
code
0
github-code
54
72294394402
GENDER_CHOICES = ( ('Male', 'Male'), ('Female', 'Female'), ('others', 'others') ) MEMBER_TYPE =( ('Community', 'Community'), ('InnovationHub', 'InnovationHub') ) USER_ROLES =( ('Admin', 'Admin'), ('EmpactUser', 'EmpactUser') ) POST_STATUS_CHOICES = ( ('draft', 'Dra...
bethwelmusin/Empact-power-up
app/utilities/choices.py
choices.py
py
655
python
en
code
0
github-code
54
8729506066
import serial import sys import re import yaml import logging import time from time import sleep class DongleConnection: def __init__(self): self.port = "COM4" self.sensor_serial = "28:2C:02:40:28:3C" self.key = "3925" self.retries_timeout = 3 self.retries_...
efento/Using-the-dongle-with-Python
dongleconnector.py
dongleconnector.py
py
3,922
python
en
code
1
github-code
54
36712973377
import scrapy import uniout import codecs import sys from scrapy import Selector class pubmed_FULL_Spider(scrapy.Spider): name = "pubmed_full" website = "https://www.ncbi.nlm.nih.gov/" allowed_domains = ["ncbi.nlm.nih.gov"] #start = 1 #loop = 36534040 # def __init__(self, pag...
lkfo415579/program_collection
code_grave/pubmed_full.py
pubmed_full.py
py
2,657
python
en
code
0
github-code
54
37492266512
import base64 import pyfldigi import functools from pytun import TunTapDevice import random from scapy.all import * import sys import time def send_packet(packet): ip = IP(packet) origin_ip = ip.src send(ip) def get_byte_pair(integer): return divmod(integer, 0x100) def find_all_indexes(input_str, sea...
Rahi374/unlimited-dialup
client.py
client.py
py
4,497
python
en
code
0
github-code
54
31527237240
import socket import threading import os from des import des key = "keyyyyyy" d = des() def read_msg(clients, sock_cli, addr_cli, username_cli): while True: # terima pesan data = sock_cli.recv(65535) if len(data) == 0: break # parsing pesannya act = data.decod...
prolifel/des-chat
server.py
server.py
py
3,297
python
en
code
0
github-code
54
19334887432
# -*- coding: utf-8 -*- """ Job to setup, train and evaluate the network @author: Abdullah Thaibt """ import sys import os import argparse import pandas as pd import matplotlib.pyplot as plt from glassimaging.execution.jobs.job import Job from glassimaging.training.standardTrainer import StandardTrainer from torch.u...
abdullahthabit/MAIA-projects
Summer internship - Uncertainty Estimation in Deep Learning Glioma Segmentation as a Measure for Active Learning/Code/glassimaging/execution/jobs/joball.py
joball.py
py
9,648
python
en
code
1
github-code
54
31065493356
import pprint #for print prettily message = 'It was a bright cold day in April, and the clocks were striking thirteen.' count = {} for character in message: #argument of the achracter is passed to the dictionary, with default value at 0 count.setdefault(character,0) count[character] = count[character] +...
it-AVNG/Automate.Boring.Stuff
chapter5_dictionary/characterCount.py
characterCount.py
py
345
python
en
code
0
github-code
54
11934536031
# Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd from pandas import DataFrame as df import seaborn as sns from sklearn.neighbors import KNeighborsClassifier # Importing the dataset dataset = pd.read_csv('data.csv',encoding='iso-8859-1') #Dataset for Positions fi...
vigneshjayanth00/Football
Position Performance Metrics.py
Position Performance Metrics.py
py
9,336
python
en
code
0
github-code
54
1366066723
import datetime import json import sys import uuid import pika import redis import logging import requests import sqlite3 import configparser cfg = configparser.ConfigParser() cfg.read("./config_file.ini") CLASSIFIER_HOST = cfg.get("hosts", "classifier", fallback="172.17.0.2") RABBITMQ_HOST = cfg.g...
ecaterinacatargiu/SOA
CoreApp/core_app.py
core_app.py
py
6,278
python
en
code
0
github-code
54
2006561104
import random from Tkinter import Tk, Label, Button, Entry, StringVar, END, W, E import tkMessageBox class GuessingGame: def __init__(self, master): self.master = master master.title("Catalyst Engine") self.guess = None self.message = "Beta Engine" ...
Hndrx616/Python-src-redact
Py/guiExamples/betaSearch.py
betaSearch.py
py
1,632
python
en
code
0
github-code
54
26601163916
""" Author: Lâm Quang Thắng Date: 25/09/2021 Program: Viết một tập lệnh có tên là dif.py. Tập lệnh này sẽ nhắc người dùng về tên của hai tệp văn bản và so sánh nội dung của hai tệp để xem chúng có phải là tương tự. Nếu đúng như vậy, tập lệnh sẽ chỉ xuất ra "Có". Nếu không, kịch bản sẽ xuất ra "Không", theo sau ...
Thang998877/lamquangthang58451..
LamQuangThang_58451_CH04/Projects/page_133_projects_10.py
page_133_projects_10.py
py
1,931
python
vi
code
0
github-code
54
13568278008
"""Implementations of multi-layer perceptron (MLP) and other helper classes.""" from __future__ import annotations from typing import TYPE_CHECKING, Callable import torch from dgl import DGLGraph, broadcast_edges, softmax_edges, sum_edges from torch import nn from torch.nn import LSTM, Linear, Module, ModuleList if ...
materialsvirtuallab/matgl
src/matgl/layers/_core.py
_core.py
py
6,119
python
en
code
145
github-code
54
18832871690
from datetime import datetime import gspread from oauth2client.service_account import ServiceAccountCredentials import random import time import PySimpleGUI as sg import datetime import webbrowser key_name = r"python-api-project-331021-5d18bfc4ee9a.json" #jsonキー名 sheet_name = "testcsv" #スプレッドシート名 #APIにアクセス scope =...
TrellixVulnTeam/sqlite_MS5I
onogam/aaaaaaa.py
aaaaaaa.py
py
2,250
python
en
code
0
github-code
54
13100368583
from selenium import webdriver from selenium.webdriver import FirefoxOptions # To enable Chrome: # driver = webdriver.Chrome("/Users/sueroh/chromedriver") opts = FirefoxOptions() opts.add_argument("--headless") driver = webdriver.Firefox( executable_path="/Users/sueroh/geckodriver", firefox_options=opts)
wiseshrimp/landlord-search
db/seed/driver.py
driver.py
py
316
python
en
code
0
github-code
54
36712822802
import sys import numpy as np from matplotlib import pyplot as plt from network import Network from functions_network import data_loader, plot_figure, plot_scores #python main_network.py 0 data_type = sys.argv[1] # Se grafican los resultados para 2 tipos de datos: # 0: circulos # 1: lunas #Arquitectura de red #...
beregrande/machine-learning-galaxies
NeuralNetworks/ArtificialNeuralNetwork/main_network.py
main_network.py
py
1,169
python
es
code
2
github-code
54
27881778763
## @Copyright by DENG, Zhidong, Department of Computer Science, Tsinghua University ## Updated on April 6, 2019 ## Density-based Distance Tree (DDT) + LCCV import numpy as np # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Compute the Silhouette width criterion (S...
zhangruiwenCR7/som
ddt-lccv/LCCV.py
LCCV.py
py
5,165
python
en
code
1
github-code
54
34464913481
#!/usr/bin/python import concurrent.futures from builder import SIXAnalyzer_builder from finder import SIXAnalyzer_finder import files import stats class SIXAnalyzer_runner(): def __init__(self): with concurrent.futures.ProcessPoolExecutor(max_workers=2) as executor: future_files = executor.s...
Sixdsn/CppAnalyzer
modules/runner.py
runner.py
py
931
python
en
code
1
github-code
54
29601501210
import os os.chdir("/Users/olivia/oliviaphd/") import msprime import pyslim import tskit import numpy as np import pandas as pd import matplotlib.pyplot as plt import time import itertools genomeSize = int(1e6) popnSize = int(1e4) mutRate = 1e-6 recRate = 1e-8 l = 20 y = 2.0 d = 0.6 nWin = 20 rGen = 100 sum_gen = 8#...
olivia-johnson/oliviaphd
scripts/sim_seglift_old.py
sim_seglift_old.py
py
9,077
python
en
code
0
github-code
54
1202689702
import pandas as pd import numpy as np import regex as re # create list of data files data_to_read = ['HC/HC_14.csv', 'HC/HC_15.csv', 'HC/HC_16.csv', 'HC/HC_17.csv', 'HC/HC_18.csv', 'HC/HC_19.csv'] years_to_read = ['2014', '2015', '2016', '2017', '2018', '2019'] # list of survey waves to collapse combine = [['ACTDTY...
angelathe/classifying-opioid-use
data_cleaning/data_clean_hh.py
data_clean_hh.py
py
5,350
python
en
code
1
github-code
54
5444160583
from base_tokenizer import BaseTokenizer from utils import load_n_grams import ast import os __author__ = "Ha Cao Thanh" __copyright__ = "Copyright 2018, DeepAI-Solutions" class LongMatchingTokenizer(BaseTokenizer): def __init__(self, bi_grams_path='/home/tuannm/mine/vnexpress-texts-classification/tokenization/b...
tuannm2914/nlp
tokenization/dict_models.py
dict_models.py
py
3,530
python
en
code
0
github-code
54
7876485420
#!/usr/bin/env python # -*- coding:utf-8 -*- # @FileName :1706. Where Will the Ball Fall.py # @Time :2/23/22 # @Author :Eason Tang from typing import List class Solution: def findBall(self, grid: List[List[int]]) -> List[int]: def fall(ball_column): """ This function calcu...
tangyisheng2/leetcode-note
code/1706. Where Will the Ball Fall.py
1706. Where Will the Ball Fall.py
py
1,365
python
en
code
1
github-code
54
31706821513
#from _typeshed import OpenBinaryMode from flask import Flask, render_template, request, redirect, url_for, session, jsonify # for colors import numpy as np #needed for spec2col from funktionen import spectralTrafo from funktionen import spectralGuess app = Flask(__name__) app.config['SECRET_KEY'] = '4413' @app.rout...
AlphaMegaladon/SpectralColor
app.py
app.py
py
4,942
python
en
code
0
github-code
54
2564042145
import pandas as pd import numpy as np import random from lightgbm import LGBMClassifier #Initialise the random seeds def random_init(**kwargs): random.seed(kwargs['seed']) np.random.seed(kwargs['seed']) def load_data(df,cv=False,target=False,**kwargs): num_samples = len(df) sample_size = len(args...
sajedjalil/Data-Science-Pipeline-Detector
dataset/tabular-playground-series-mar-2021/Oscar/tabulardata-lightgbm.py
tabulardata-lightgbm.py
py
3,633
python
en
code
8
github-code
54
40666202825
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np import torch from torch import nn from torch import optim import torch.nn.functional as F from torchvision import datasets, transforms, models from PIL import Image from torch.autograd import Variable from torch.optim import lr_schedul...
nlisch/udacity_data_scientist_nanodegree_program
Term 2 - Deep learning ( Pytorch Classifier ) /predict.py
predict.py
py
3,550
python
en
code
0
github-code
54
19397403095
import sys from PyQt5 import QtWidgets from UI import pingxing if __name__ == "__main__": app = QtWidgets.QApplication(sys.argv) MainWindow = QtWidgets.QMainWindow() ui = pingxing.Ui_MainWindow() ui.setupUi(MainWindow) MainWindow.show() sys.exit(app.exec_())
unix2dos/pygui
main.py
main.py
py
286
python
en
code
1
github-code
54
41455838876
import maxcov import transportation import unittest class TestOpeartions(unittest.TestCase): def test_maxcov(self): for i in range(1,4): in_file=f"graph{i}.in" platoons_in_file = f"platoons{i}.in" out_file=f"answ{i}.in" with open(out_file) as f: ...
veruxy/MaxCov-Problem
test_main.py
test_main.py
py
803
python
en
code
0
github-code
54
73265346723
import base64 from io import BytesIO from PIL import Image from ..help import add_help_item from userbot.events import register from userbot.utils.thonkify_dict import thonkifydict @register(outgoing=True, pattern='.thonk(?: |$)(.*)') async def thonkify(thonk): """ Thonkifies the requested text """ textx = ...
darkparky/tg_userbot
userbot/modules/fun/thonk.py
thonk.py
py
2,328
python
en
code
0
github-code
54
71231847521
"""MiniscopeImagingExtractor class. Classes ------- MiniscopeImagingExtractor An ImagingExtractor for the Miniscope video (.avi) format. """ import json import re from pathlib import Path from typing import Optional, Tuple, List import numpy as np from ...imagingextractor import ImagingExtractor from ...multiima...
catalystneuro/roiextractors
src/roiextractors/extractors/miniscopeimagingextractor/miniscopeimagingextractor.py
miniscopeimagingextractor.py
py
5,718
python
en
code
10
github-code
54
4511833551
# -*- coding: utf-8 -*- """ Created on Fri Aug 12 13:57:23 2022 @author: LDE """ import cv2 as cv import sys import os from matplotlib import pyplot as plt from imutils.perspective import four_point_transform from imutils import contours import imutils import collections import numpy as np import graph_utils as Grap...
devantheryl/OCR_detection
OCR_detection.py
OCR_detection.py
py
10,800
python
en
code
0
github-code
54
30436818839
""" the next palindrome you have to take the number from the user you have to find the next palindrom corresponding to that number.your first input should be the number of test cases and then tke all the test cases from the user. """ def nextPalindrome(no_of_testcases): inputs = [] for i in range(0,no_of_te...
masterboy376/Python-tutorial
problem4.py
problem4.py
py
841
python
en
code
0
github-code
54
37193213832
from lamson.testing import * from lamson.mail import MailRequest from lamson.routing import Router from webapp import settings as websettings from config import settings, testing from webapp.postosaurus.models import * from nose import with_setup from app.model import mailinglist, files from tests.handlers.admin_tests ...
sfioritto/postosaurus-old
tests/handlers/files_tests.py
files_tests.py
py
4,102
python
en
code
1
github-code
54
14164669837
from datetime import datetime, timedelta from jose import JWTError, jwt from api import schemas from core.config import settings def create_access_token(data: dict, expires_delta: timedelta | None = None): to_encode = data.copy() if expires_delta: expire = datetime.utcnow() + expires_delta else:...
AkosKappel/MTAA-backend
api/JWT.py
JWT.py
py
969
python
en
code
0
github-code
54
33879596445
from django.urls import path from schemas import views app_name = "schemas" urlpatterns = [ path('', views.home, name='home'), path('schemas/', views.list_all_schemas, name='list_all_schemas'), path('schemas/create/', views.create_schema, name='create_schema'), path('schemas/view/<int:pk>', views.vie...
ShirinovAdil/FakeCSV
schemas/urls.py
urls.py
py
738
python
en
code
0
github-code
54
27743141476
from django import forms # class ContractForm(forms.Form): # subject = forms.CharField(max_length=100) # message = forms.CharField(widget=forms.Textarea) # sender = forms.EmailField() # cc_myself = forms.BooleanField(required=False) # # class ContactForm(forms.Form): name = forms.CharField(max_l...
pchab2458/dj_html_examples
my_app/forms.py
forms.py
py
3,381
python
en
code
0
github-code
54
24547674338
#Importing the Libraries import numpy as np import pandas as pd import seaborn as sns import plotly as py import matplotlib.pyplot as plt import plotly.graph_objs as go from sklearn.preprocessing import LabelEncoder # For Label Encoding from sklearn.cluster import KMeans # For K-means Algorithm from sklearn.cl...
pundriks3103/Customer-Segmentation-using-Clustering
complete_code.py
complete_code.py
py
2,029
python
en
code
0
github-code
54
12604020665
"""A collection of utility function.""" from copy import deepcopy def networkx2struct(graph): """Converts a networkX graph to a primitive dictionary with the necessary information for protocop-ui """ return {'nodes': [nodeStruct(node) for node in graph.nodes(data=True)], 'edges': [edgeS...
covartech/protocop-rank
python/queryManipulation.py
queryManipulation.py
py
2,240
python
en
code
0
github-code
54
37363288951
from django.shortcuts import render from django.http import HttpResponse from django.views.generic import View, TemplateView from .forms import * from .models import * # Create your views here. class MelodyIndexView(View): def get(self, request): return render(request, 'melody/index.html') class MelodyDashboardVie...
paradoxials/Melody-Web
Project/melody/views.py
views.py
py
2,120
python
en
code
0
github-code
54
22705699532
import pygame import os import sys import time pygame.init() wnWidth = 520 wnHeight = 480 wnColor = (30, 30, 30) wnTitle = "X-O mega" wn = pygame.display.set_mode((wnWidth, wnHeight)) pygame.display.set_caption(wnTitle) blueMouse = pygame.image.load("BlueMouse.png") redMouse = pygame.image.load("RedMouse.png") p...
BuT4n0s/Ultimate-Tic_Tac_Toe-
code/x_o-mega.py
x_o-mega.py
py
14,896
python
en
code
0
github-code
54
4832295873
# solved cherry pick up 2 first so i feel 2 was more 1 and 1 is more 2 # the logic is hard to come up with #the monopoly of this logic is if we keep moveing two robots from [0][0] #we will for sure reach the end in the same time #also the logic to start both the robots at the same time. def cherryPickup(self, arr: List...
Bidipto/DSApedia
Leetcode/DP/[IMP]CherryPickup.py
[IMP]CherryPickup.py
py
1,619
python
en
code
0
github-code
54
73863953442
# -*- coding:utf-8 -*- # Engine module: chaining gadgets and building ropchains from ropgenerator.semantic.ROPChains import ROPChain, validAddrStr from ropgenerator.Database import QueryType, DBSearch, DBPossibleInc, DBPossiblePopOffsets, REGList, DBPossibleMemWrites from ropgenerator.Constraints import Chainable, Re...
xubenji/csapp
attacklab03/target1/venv/lib/python2.7/site-packages/ropgenerator-1.2-py2.7.egg/ropgenerator/semantic/Engine.py
Engine.py
py
41,052
python
en
code
1
github-code
54
3596429112
import uuid from msrest.pipeline import ClientRawResponse from .. import models class WorkspacesOperations(object): """WorkspacesOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :para...
Azure/azure-sdk-for-python
sdk/powerbiembedded/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/operations/workspaces_operations.py
workspaces_operations.py
py
4,213
python
en
code
3,916
github-code
54
11806263443
#Altere o programa anterior para mostrar no final a soma dos números. n1 = int(input("Digite o primeiro número: ")) n2 = int(input("Digite o segundo número: ")) soma = 0 if ((n1+1) < n2): m = n1 M = n2 n1 = n1+1 while (n1 < n2): soma += n1 print(n1) n1 = n1+1 print("A s...
renitro/Python
Estruturas de Repetição/Exerc11.py
Exerc11.py
py
651
python
pt
code
0
github-code
54
71177436323
""" @author: Andres Fernando Guaca """ import datos as dt import seleccion_variables as sv import pandas as pd import h2o def prueba_modelos_ensamble(mod,train): modelos=[] semilla=[] T_PRO=[] for s in [431, 181,754,902,954,806, 400, 562, 552, 431]: splits = train.split_frame(ratios=[0.7], se...
andres0743183/Trading-algoritmico
ensamble_modelos.py
ensamble_modelos.py
py
6,074
python
en
code
1
github-code
54
74543400160
import random import cv2 import numpy as np import os from copy import deepcopy import matplotlib.pyplot as plt from collections import Counter def get_histogram(array): arr = np.array(array) vec = arr.flatten() count = Counter(vec) total_pixels = np.sum(list(count.values())) n_k = [] for i in...
chapnitsky/Image-Processing
cleaning_derivative.py
cleaning_derivative.py
py
7,269
python
en
code
0
github-code
54
12594678169
import os def create_file_if_not_exists(file): if not os.path.exists(file): open(file, 'w+') def get_temp_folder(): # define the name of the directory to be created return os.path.join(os.getcwd(), 'tmp') def check_temp_folder(): path = get_temp_folder() try: os.mkdir(path) ...
380sq/minim
lib/helpers.py
helpers.py
py
515
python
en
code
0
github-code
54
16389324110
# 4. Search # You will receive a number n and a word. # On the next n lines you will be given some strings. # You should add them in a list and print them. # After that you should filter out only the strings that include the given word and print that list too. n = int(input()) word = input() list_one = [] l...
BogomilaKatsarska/Programming-Fundamentals-with-Python-SoftUni
Lists Basics - L1Q4.py
Lists Basics - L1Q4.py
py
518
python
en
code
0
github-code
54
31950228980
import re import os import sys this = sys.modules[__name__] serialRegEx = re.compile(' serial=[0-9]+') active = False mySerial = '' returnSerial = '' waitForReturn = False myHandle = '' insideReturn = False lightsAreOn = False lightsMayBeOn = True def handle_line(line, joinCommand, leaveCommand): if line.start...
lfrenzel-os/zoom-client-events
meeting.py
meeting.py
py
1,883
python
en
code
0
github-code
54
73181791843
def credit_check(string): credit_numbers = to_list(string) # converts string to list of digits two_list = times_two(credit_numbers) # doubles each digit in list final_list = sum_gt_9(two_list) # numbers > 9 sum of its own digits sum = sum_all(final_list) # get sum of numbers in list if sum % 1...
ConnorDBurge/CP-Prep-Work
challenges/credit-check/python/credit_check.py
credit_check.py
py
1,274
python
en
code
0
github-code
54
21856342794
"""Support for incandescent wings in OPP.""" import logging from mpf.platforms.interfaces.light_platform_interface import LightPlatformSoftwareFade from mpf.platforms.opp.opp_rs232_intf import OppRs232Intf class OPPIncandCard: """An incandescent wing card.""" __slots__ = ["log", "addr", "chain_serial", "o...
OctaPinball/World-of-Warships-pinball
_dev_env/Python36/Lib/site-packages/mpf/platforms/opp/opp_incand.py
opp_incand.py
py
3,083
python
en
code
2
github-code
54
18113444637
from aocd.models import Puzzle import numpy as np import re puzzle = Puzzle(year=2021, day=13) puzldat = [val for val in puzzle.input_data.splitlines()] testdat = [ '6,10', '0,14', '9,10', '0,3', '10,4', '4,11', '6,0', '6,12', '4,1', '0,13', '10,12', '3,4', '3,0', '8,4', '1,10', '2,14', '8,10', '9,0', '', 'fold alon...
rky-w/aoc-2021
aoc-2021-13.py
aoc-2021-13.py
py
1,635
python
en
code
0
github-code
54
23221921419
import requests import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, GLib gi.require_version('AppIndicator3', '0.1') from gi.repository import AppIndicator3 as appindicator import datetime import webbrowser import os from pkg_resources import resource_filename APPINDICATOR_ID = 'Coronabar' file...
duarteocarmo/coronabar
Ubuntu/app.py
app.py
py
4,934
python
en
code
38
github-code
54
42936412249
import asyncpg import asyncio from util.db_create_statements import COLOR_INSERT, CREATE_BRAND_TABLE, CREATE_PRODUCT_COLOR_TABLE, CREATE_PRODUCT_SIZE_TABLE, CREATE_PRODUCT_TABLE, CREATE_SKU_TABLE, SIZE_INSERT async def main(): connection = await asyncpg.connect(host="127.0.0.1", ...
KolesnikIvan/async_repo
listing5_1.py
listing5_1.py
py
1,168
python
en
code
0
github-code
54
40532630871
#!/usr/bin/env python3 """ websitepuller.py - pull data for *each* item - Ebay, Lyft or Craiglist - This script is a library for lookup on Ebay, CraigList and Lyft - This script requires the requests BeautifulSoup module and geopy - This file is meant to be imported as a module. """ import re import sys import json...
ShouldIPickItUp/ShouldIPickItUp
lib/websitepuller.py
websitepuller.py
py
4,881
python
en
code
0
github-code
54
30236247060
# -*- coding: utf-8 -*- """ Created on Mon Jan 13 21:03:34 2020 @author: Sylwek Szewczyk """ import requests from bs4 import BeautifulSoup import pandas as pd import time, pickle class PrzepisyPl: def __init__(self, www): self.www = www def parse(self): database_input = {} ...
SylwekSzewczyk/Data-for-recipes-project
PrzepisyPl_crawler.py
PrzepisyPl_crawler.py
py
4,970
python
en
code
0
github-code
54
71699906082
from tkinter import* import time import datetime from playsound import playsound def reminder(): timebreak=0 while True: ## now_time=datetime.datetime.now().second now_time=datetime.datetime.strftime(datetime.datetime.now(),'%S') if timebreak !=now_time: playso...
anshu0157/python-projects
reminder and digital clock/digitalclock.py
digitalclock.py
py
820
python
en
code
0
github-code
54
22114873375
import gtk import os import platform import stat import subprocess import urllib from cmislib.model import * class ToolBar(): """ Toolbar class """ def __init__(self,app): menu = gtk.Menu() self.app=app self.toolbar = gtk.Toolbar() self.upButto...
joosth/cmisnavigator
src/toolbar.py
toolbar.py
py
2,007
python
en
code
4
github-code
54
19407275393
from re import search #Digital Marketing Tool using API import requests #requests is used to send HTTP request import pandas as pd #it is used to representdata data in tabular form import json #for data representation during transmission from datetime import date,timedelta #this is used to manage dat...
Hackveda/PythonInternsCodeSubmission
Niraj Somwani/GoogleAPI.py
GoogleAPI.py
py
2,024
python
en
code
0
github-code
54
3369950000
"""Simulated Annealing Algorithm for Minimization.""" from threading import Thread as _Thread, Event as _Event import numpy as _np class SimulAnneal: """.""" # NOTE: objects with threading.Event cannot be serialized with pickle def __init__(self, save=False, use_thread=True): """.""" se...
lnls-fac/apsuite
apsuite/optimization/simulated_annealing.py
simulated_annealing.py
py
9,599
python
en
code
0
github-code
54
3586328162
from typing import TYPE_CHECKING from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.r...
Azure/azure-sdk-for-python
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_generated/operations/_azure_monitor_client_operations.py
_azure_monitor_client_operations.py
py
4,621
python
en
code
3,916
github-code
54
26155005962
import speech_recognition as sr import pyttsx3 import pywhatkit import datetime import wikipedia import pyjokes import openpyxl import pyaudio import nltk import warnings from nltk.tokenize import word_tokenize import nltk # from newspaper import Article import string import random from sklearn.feature_extraction.text ...
hasibulkabiremon/virtual-family-member
main.py
main.py
py
9,183
python
en
code
0
github-code
54
25832934882
import torch from torch import nn import gym import numpy as np class DistributionDict(object): def __init__(self,distributions): self.distributions=distributions def sample(self): x={k:self.distributions[k].sample() for k in self.distributions} #x={k:x[k]*2-1 if isinstance(self.distributions[k],BetaD...
olemeyer/pyforce
pyforce/nn/action/action_mapper.py
action_mapper.py
py
2,692
python
en
code
3
github-code
54
31126884411
import mxnet as mx from mxnet import nd, autograd from test_utils.metrics import accuracy class MyTrainer(mx.gluon.Trainer): def __init__(self, net=None, train_data_iter=None, val_data_iter=None, loss=None, ckpt_name='ckpt', ctx=mx.gpu(0), decay_epochs=10, do_ckpt_epochs=1, **kwargs): ""...
wuwuwuxxx/MLxxx
train_utils/mytrainer.py
mytrainer.py
py
3,456
python
en
code
1
github-code
54
34009310867
# -*- coding: utf-8 -*- """ Created on Thu Oct 29 13:56:19 2020 This python file contains functions to plot the figures displayed in "Multiscale communication in cortico-cortical networks". @author: Vincent Bazinet """ import os import bct import tqdm import numpy as np import matplotlib import matplotlib.pyplot as ...
netneurolab/bazinet_multiscale
figures.py
figures.py
py
41,888
python
en
code
1
github-code
54
72228090402
from util import * # Add your import statements here import nltk from textblob import TextBlob from spellchecker import SpellChecker spell_checker = SpellChecker() class SpellCorrection(): def usingTextBlob(self, text): spellCheckedText = [] for each_sentence in text: spellCheckedSentence =...
wigglytuff-tu/NLP_Project
spellCorrection.py
spellCorrection.py
py
1,004
python
en
code
0
github-code
54
14061037646
# coding:utf-8 import os from flask import Flask, request, redirect, url_for, render_template, flash, send_from_directory from werkzeug.utils import secure_filename from keras.models import Sequential, load_model from keras.preprocessing import image import tensorflow as tf import numpy as np import cv2 from P...
ari0123-create/prisonbreakapp
main.py
main.py
py
5,485
python
ja
code
0
github-code
54
12762612177
from obsidian import Canvas, Group, EQ from obsidian.geometry import Circle, Rectangle, Point SQRT_2 = 2**0.5 WIDTH = HEIGHT = 300 CIRCLE_STYLE = {"stroke": "#0000ff", "fill_opacity": "0"} RECT_STYLE = {"stroke": "#ff0000", "fill_opacity": "0"} circle = Circle(style=CIRCLE_STYLE) square = Rectangle(style=RECT_STYLE...
wootfish/obsidian
examples/circle_and_square.py
circle_and_square.py
py
663
python
en
code
7
github-code
54
13428223158
######IMPORTS import os import glob from xmlrpc.client import boolean import tqdm import math import torch import numpy as np import dill as pkl from PIL import Image from tqdm import tqdm from PIL import ImageStat import matplotlib as plt from torchvision import transforms from torch.utils.data import DataLoader #####...
j-tobias/Pixel-Inpainting
utils.py
utils.py
py
15,364
python
en
code
1
github-code
54
40920020396
#!/usr/bin/python3 """a Python script""" import urllib.error import urllib.request import sys if __name__ == "__main__": url = sys.argv[1] try: with urllib.request.urlopen(url) as response: the_page = response.read().decode('utf-8') print(the_page) except urllib.error.HTT...
Aminat27/alx-higher_level_programming
0x11-python-network_1/3-error_code.py
3-error_code.py
py
372
python
en
code
0
github-code
54
8045603028
import cv2 import time cap = cv2.VideoCapture('C:/Users/Lukas/Desktop/commaai-speed-challenge/data/test.mp4') f = open("C:/Users/Lukas/Desktop/commaai-speed-challenge/data/test.txt", "r") while(cap.isOpened()): ret, frame = cap.read() font = cv2.FONT_HERSHEY_SIMPLEX caption = "Speed: "+ f.readl...
lukaspetersson/commaai-speed-challenge
caption.py
caption.py
py
691
python
en
code
0
github-code
54
24144623638
# Resevoir sampler, will keep only a fixed number of data and delete data if it sees more # Followed by the test function from util import O import random as rand import math class Sample: def __init__(self, max=512): # ---Why the default of 512 in Lean.sample.max # ---Where is Lean.sample.max com...
reCursedd/NC_FSS
w3/sample.py
sample.py
py
2,119
python
en
code
0
github-code
54
3586780082
import unittest from opentelemetry.instrumentation.fastapi import ( FastAPIInstrumentor, ) class TestFastApiInstrumentation(unittest.TestCase): def test_instrument(self): excluded_urls = "client/.*/info,healthcheck" try: FastAPIInstrumentor().instrument(excluded_urls=excluded_urls...
Azure/azure-sdk-for-python
sdk/monitor/azure-monitor-opentelemetry/tests/instrumentation/test_fastapi.py
test_fastapi.py
py
542
python
en
code
3,916
github-code
54
69995435362
# -*- coding: utf-8 -*- """Unit tests for `shist` module """ import os import tempfile import unittest import pyssub.shist class TestSHist(unittest.TestCase): """Test case for Slurm job history Generate an arbitrary mapping of job names to job IDs, save it to disk, load it again, and check for equalit...
kkrings/pyssub
tests/test_shist.py
test_shist.py
py
1,477
python
en
code
3
github-code
54
19417163902
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def middleNode(self, head: Optional[ListNode]) -> Optional[ListNode]: lenll = 0 headtemp = head while headtemp: l...
ujsolon/Leetcode
876-middle-of-the-linked-list/876-middle-of-the-linked-list.py
876-middle-of-the-linked-list.py
py
655
python
en
code
0
github-code
54
70561552161
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ @Time : 2019-05-19 15:53 @Author : Wang Xin @Email : wangxin_buaa@163.com @File : __init__.py.py """ def create_loader(args, mode='train'): # Data loading code print('=> creating ', mode, ' loader ...') import os from dataloaders.path import Path...
dontLoveBugs/CSPN_monodepth
dataloaders/nyu_dataloader/__init__.py
__init__.py
py
2,573
python
en
code
66
github-code
54
18545160048
import torch import torch.nn.parallel import util import numpy as np import matplotlib.image from dataset import DataGenerator from fast_depth import MobileNetSkipAdd import warnings from numba import cuda device = cuda.get_current_device() device.reset() warnings.filterwarnings('ignore') matplotlib.rcParam...
PouyaNF/Supervised-monocular-depth-estimation---kitti
test.py
test.py
py
3,866
python
en
code
0
github-code
54
16763911927
''' Chuong trinh nay chay khong dung. Can xem lai ''' import pyzbar.pyzbar as zbar import os,cv2,sys import numpy as np import matplotlib.pyplot as plt os.chdir("C:\\Projects\\python\\imgProcessing") img = cv2.imread(os.getcwd() +'\\imgs\\code3.jpg') gray_img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) gradX = cv2.Sobel(g...
truongtronghai/My-pyZbar
barcodeWithPyzbar_bad_version.pyw
barcodeWithPyzbar_bad_version.pyw
pyw
2,013
python
en
code
0
github-code
54
19653918802
import pandas as pd import numpy as np # Read input file def read(): input = pd.read_csv("./inputs/day2.txt", sep = "x", engine = "pyarrow", header=None) input.columns = ["l","w","h"] ## To check dataframe state # print(input.hea...
jtrangel/advent_of_code
src/2015/day2.py
day2.py
py
1,827
python
en
code
0
github-code
54
42785099746
from keras.models import Sequential from keras.layers import Dense,Conv2D,MaxPool2D,Flatten from create_label import x_train,x_test,y_train,y_test from keras import optimizers LR = 0.001 #creat model model = Sequential() #convolutional layer model.add(Conv2D(filters=64,kernel_size=(3,3),padding="valid",in...
fit1999123/Deep_learning
final_project/cnn.py
cnn.py
py
1,214
python
en
code
0
github-code
54
14697203752
import turtle ''' w=turtle.Screen() w.bgcolor("pink") w.title("HEllo") w.bgpic("m3.gif") t=turtle.Turtle() t.forward(100) t.backward(100) t.reset() #help(turtle.hideturtle()) t.hideturtle() t.circle(100) t.circle(100,180) t.circle(radius=100,steps=3) t.forward(100) t.circle(100,steps=7) help(turtle.hom...
shivam-2002/JAVA
a.py
a.py
py
953
python
en
code
0
github-code
54
30347306274
import sys sys.stdin = open('2303.txt', 'r') N = int(input()) max_of_all = 0 max_idx = -1 for stu_idx in range(N): nums = list(map(int, input().split())) # print(nums) stu_max = 0 for i in range(3): for j in range(i + 1, 4): for k in range(j + 1, 5): # stu_sum = sum(...
egyeasy/TIL_public
baekjoon/2303.py
2303.py
py
761
python
en
code
0
github-code
54
30722607063
""" def squeare_numbers(nums): result = [] for i in nums: result.append(i*i) return result """ import sys # Turning this function to a Generator # generators DO NOT hold the whole output in memory, but yield one restul at the time def squeare_numbers(nums): for i in nums: yield (i*i) ...
Spawnfile/PythonExercises
Plain Python/generators.py
generators.py
py
650
python
en
code
0
github-code
54
72146268000
from heapq import nlargest from linkedin.mobster.utils import memoize class CSSProfileParser(object): """ Parses CSS selector profile data and extracts important features """ def __init__(self, css_selector_data): """ Format of the css selector data: { "totalTime": [total processing ...
LinkedInAttic/mobster
src/linkedin/mobster/har/css.py
css.py
py
2,151
python
en
code
38
github-code
54