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
37407108595
from sklearn.datasets import make_classification from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error from sklearn.ensemble import RandomForestClassifier import xgboost as xgb from sklearn.linear_model import LinearRegression # dummy data X, y = make_classificatio...
HyperionDevBootcamps/C4_DS_lecture_examples
Lecture code/Machine Learning/Decision Trees/Ensemble.py
Ensemble.py
py
1,443
python
en
code
37
github-code
36
4419668118
#服务器 import socket import time SERVER_IP = "127.0.0.1" SERVER_PORT = 8000 server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) server.bind((SERVER_IP,SERVER_PORT)) print("Waiting...") players = [] while len(players) < 4: message, address = server.recvfrom(1024) message = message.decode()...
Julia1976/python-project
Network/3.13网络爬虫/3.27work/server play.py
server play.py
py
818
python
en
code
0
github-code
36
5762295604
import os import sys from datetime import datetime, timedelta from airflow.models import DAG from airflow.operators.python import PythonOperator from airflow.utils.dates import days_ago PARENT_DIR = os.path.dirname( os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ) sys.path.append(PARENT_DIR) from c...
bhuiyanmobasshir94/Apache-Airflow-Starter
airflow/dags/aflow_dag.py
aflow_dag.py
py
823
python
en
code
0
github-code
36
30722724901
#programmers_단어 변환 #=== import module ===# from collections import deque #=== variable declare ===# #=== Function define ===# def solution(begin, target, words): if target not in words: return 0; #불가능한 경우 queue = deque(); queue.append([begin,0]); #current, visited level = 0; succeed = False; while qu...
Hoony0321/Algorithm
2022_02/26/programmers_단어 변환.py
programmers_단어 변환.py
py
1,080
python
en
code
0
github-code
36
4035544255
#User function Template for python3 class Solution: def maxDiamonds(self, A, N, K): import heapq l = [] heapq.heapify(l) for i in A: heapq.heappush(l,-1*i) ans = 0 while(K!=0): x = -1*heapq.heappop(l) ans = ans +x ...
20A31A0563/LeetCode
Maximum Diamonds - GFG/maximum-diamonds.py
maximum-diamonds.py
py
739
python
en
code
0
github-code
36
71960799785
import gluonbook as gb from mxnet.gluon import data as gdata import sys import time import matplotlib.pyplot as plt mnist_train = gdata.vision.FashionMNIST(train=True) mnist_test = gdata.vision.FashionMNIST(train=False) # 训练集和测试集中每个类别的图像分别为6000, 1000, 因此len(mnist_train)=60000, len(mnist_test) = 10000 print(len(mnist...
fulinli/DeepLearning_MXNet
Fashion-MNIST.py
Fashion-MNIST.py
py
3,590
python
zh
code
0
github-code
36
13536005652
from lib import setter, getter, io_tools import argparse parser = argparse.ArgumentParser() parser.add_argument("--config", type = str, help = "path to campaigns config json file") parser.add_argument("--PU", type = str, help = "name of the pileup sample to set sitewhitelist for") parser.add_argument("--sites", type ...
tyjyang/CampaignManager
scripts/set-sitewhitelist-for-PU.py
set-sitewhitelist-for-PU.py
py
712
python
en
code
0
github-code
36
4013502332
# 문제 출처 : https://programmers.co.kr/learn/courses/30/lessons/12982 def solution(d, budget): answer = 0 d = sorted(d) for cost in d: if budget < cost: break else: budget -= cost answer += 1 print(answer) return answer
ThreeFive85/Algorithm
Programmers/level1/budget/budget.py
budget.py
py
298
python
en
code
1
github-code
36
951612582
pkgname = "less" pkgver = "643" pkgrel = 0 build_style = "gnu_configure" configure_args = ["--with-regex=posix"] make_cmd = "gmake" hostmakedepends = ["gmake"] makedepends = ["ncurses-devel"] checkdepends = ["perl"] pkgdesc = "Pager program similar to more(1)" maintainer = "q66 <q66@chimera-linux.org>" license = "custo...
chimera-linux/cports
main/less/template.py
template.py
py
1,187
python
en
code
119
github-code
36
70110044584
from django.contrib.auth import get_user_model from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from django.utils.translation import gettext_lazy as _ from library_test_project.users.models import ScoreAbs User = get_user_model() class Author(models.Model): na...
Bakdolot/library_test_project
library_test_project/library/models.py
models.py
py
1,968
python
en
code
0
github-code
36
8139333027
''' Æfingarverkefni 7 recursion Hrólfur Gylfason 31/10/2018 ''' def finnaHeildarsummu(tala, summa = 0): if tala > 0: summa += tala return finnaHeildarsummu(tala-1, summa) else: return summa def finnaHeildarsummuOdda(tala, summa = 0): if tala > 0 and tala % 2 == 1: summa += t...
hrolfurgylfa/Forritun
Python/FORR2HF05CU/Æfingarverkefni/14. Æfingarverkefni 7 recursion/Æfingarverkefni_7.py
Æfingarverkefni_7.py
py
1,693
python
is
code
0
github-code
36
21694318257
import os import numpy as np import matplotlib.pyplot as plt import re from io import StringIO from skimage.external.tifffile import imsave from scipy.interpolate import griddata from scipy.signal import medfilt def GetChunkFromTextFile(FileName, StartStr, StopStr, skip_header=0, skip_footer=0, LastHit=True, DataType...
ZGainsforth/QEScripts
Wannier/ReadXSFVolume.py
ReadXSFVolume.py
py
6,099
python
en
code
4
github-code
36
23591319702
from imdb import IMDb import pickle import os DIR = 'movies/' movie_files = os.listdir('movies') actors_list = list() # for file in movie_files: # with open(DIR + file, 'rb') as file: # movie = pickle.loads(file.read()) # with open(DIR + movie.movieID + "_actors.txt", "w", encoding='...
7tg/networkx
actors.py
actors.py
py
908
python
en
code
1
github-code
36
36950841559
import sys sys.path.append("/mnt/data0/ravi/work/wiredtiger/bench/workgen/runner") from runner import * from wiredtiger import * from workgen import * ''' The original wtperf input file follows: # This workload uses several tens of thousands of tables and the workload is evenly distributed # among them. The workload ...
mongodb/mongo
src/third_party/wiredtiger/bench/workgen/runner/many-dhandle-stress.py
many-dhandle-stress.py
py
3,579
python
en
code
24,670
github-code
36
34866939002
import math from src.getTickers import * from src.importData import * from backtrader.indicators import ema import datetime GOINGDOWN_DAYS = 60 def hasNotIncreaseTooMuch(datahigh,datalow): heighest=0 lowest=10000 for i in range(-5, 0): heighest = max(heighest, datahigh[i]) lowest = min(low...
lumeng3/luluquant
src/strategy/goingDown.py
goingDown.py
py
2,672
python
en
code
1
github-code
36
30820901838
#Extracts second-column values from .dat files and prints them out, comma-separated, so they can be used as a colormap in VARNA #It'll do this for all .dat files you have in your directory. If you don't want this feature just comment out everything with read_files in it #and unindent as needed. #I also plot out the va...
gwlilabmit/Ram_Y_complex
paired_prob/plot_dat.py
plot_dat.py
py
7,427
python
en
code
0
github-code
36
22782858968
# # @lc app=leetcode id=240 lang=python3 # # [240] Search a 2D Matrix II # # https://leetcode.com/problems/search-a-2d-matrix-ii/description/ # # algorithms # Medium (41.66%) # Likes: 1941 # Dislikes: 57 # Total Accepted: 218.3K # Total Submissions: 523.9K # Testcase Example: '[[1,4,7,11,15],[2,5,8,12,19],[3,6,9...
Zhenye-Na/leetcode
python/240.search-a-2-d-matrix-ii.py
240.search-a-2-d-matrix-ii.py
py
1,876
python
en
code
17
github-code
36
33167135913
from collections import Counter from contextlib import contextmanager, asynccontextmanager import logging import time logger = logging.getLogger(__name__) class TimingStats(Counter): def __init__(self, verbose: bool = False): super().__init__() self.verbose = verbose @contextmanager def ...
andrew-landers-by/luman-1584-blob-timeout
luman_1584/timing.py
timing.py
py
915
python
en
code
0
github-code
36
14722446132
from pycorenlp import StanfordCoreNLP import os, json, sys #os.chdir("C:/Program Files/stanford-corenlp-4.2.2") #os.system("java -mx5g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -timeout 10000") nlp = StanfordCoreNLP('http://localhost:9000') annotators = "ssplit,ner,depparse" ner_keys = ["PERSO...
gaelix98/progetto-fdsml
codici aggiunti/bio_nlp.py
bio_nlp.py
py
4,109
python
en
code
1
github-code
36
30998043719
import copy import utils from Handler import Handler MAX_LEN = 4000 THE_ANSWER_IS_LONG = "The answer is long, type /cont to continue" class DefaultValueHandler(Handler): def __init__(self, base_handler, default_query): self.base_handler = base_handler self.default_query = default_query ...
petr-kalinin/progrobot
DefaultValueHandler.py
DefaultValueHandler.py
py
516
python
en
code
14
github-code
36
22772365443
from tkinter import* from tkinter import ttk, messagebox import datetime as dt import openpyxl import pandas as pd import os import csv class dataEntry: def __init__(self,root): self.root = root self.root.title("Quality tracker") self.root.geometry("1000x800+0+0") self.ro...
muttas/my-projects
BusinessReviews_audit_form.py
BusinessReviews_audit_form.py
py
8,340
python
en
code
0
github-code
36
9744073954
import sys import os import logging import urllib from datetime import datetime, timedelta from google.appengine.ext import ndb from google.appengine.api import users from google.appengine.ext import blobstore sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from common.arguments import * from common....
AegisTools/aegis-appengine
modules/assets/assets_private.py
assets_private.py
py
5,339
python
en
code
0
github-code
36
4728646967
import time from io import BytesIO from typing import List import pandas as pd from matplotlib import pyplot as plt from pandas import DataFrame from svglib.svglib import svg2rlg from evaluate.EvaluateCore import PartAngle import seaborn as sns plt.rcParams['font.sans-serif'] = ['SimHei'] # 中文字体设置-黑体 plt.rcParams['...
spianmo/GaitStudio
evaluate/ReportModuleBuilder.py
ReportModuleBuilder.py
py
8,394
python
en
code
8
github-code
36
8754880255
# -*- coding: utf-8 -*- from odoo import models, fields, api from odoo.exceptions import UserError class OfDatastoreCrmAllocateWizard(models.TransientModel): _name = 'of.datastore.crm.sender.allocate.wizard' _description = u"Wizard d'affectation de partenaire" lead_id = fields.Many2one('crm.lead', u"Opp...
odof/openfire
of_datastore_crm_sender/wizards/of_datastore_crm_sender_allocate_wizard.py
of_datastore_crm_sender_allocate_wizard.py
py
5,884
python
fr
code
3
github-code
36
30380624251
import os from datetime import timedelta from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/ ...
Lord-sarcastic/quiz
backend/settings.py
settings.py
py
4,013
python
en
code
0
github-code
36
6241769210
"""A simple simulation of wave packet. Refer the details to the journal paper: PRA 45, 4734 (1992). """ from importlib.resources import path import numpy as np import pandas as pd import xarray as xr from . import rsc from .electricfield import ElectricField __all__ = ["predefined_target", "WavePacket"] def prede...
DaehyunPY/FERMI_20149100
Packages/simul2/wavepacket.py
wavepacket.py
py
1,648
python
en
code
0
github-code
36
44395034513
class Solution: def minimumSwap(self, s1: str, s2: str) -> int: # X_Y : x in s1, y in s2, with same index # Y_X : y in s1, x in s2, with same index X_Y, Y_X, res = 0, 0, 0 for i in range(len(s1)): if s1[i] == s2[i]: continue if s1[i] == "x" an...
Liuys614/LeetCode
1247_Minimum Swaps to Make Strings Equal_ref.py
1247_Minimum Swaps to Make Strings Equal_ref.py
py
721
python
en
code
0
github-code
36
3272420780
import json import re import requests from django.contrib.auth import login from django.contrib.auth.decorators import login_required from django.core import serializers from django.db import IntegrityError from django.http import HttpResponse from django.shortcuts import render, redirect from . import models OW_API_...
ysyesilyurt/WeatherApp
WeatherApp/views.py
views.py
py
9,163
python
en
code
1
github-code
36
24680745592
import base64 def e5(m): # base64 s = base64.b64decode(m) s = s.decode() return s def e4(m, k=13): # Caesar shift cipher m = m.lower() s = "" for i in range(len(m)): s += chr((ord(m[i]) - k - 97) % 26 + 97) return s def e2(m, k): # Vigenere cipher m = m...
SudeshGowda/Systems-recruitment-task
Decoder.py
Decoder.py
py
2,373
python
en
code
0
github-code
36
25049652193
import numpy as np import torch from skimage.metrics import peak_signal_noise_ratio,structural_similarity import natsort import cv2 import os from tqdm import tqdm def tensor2im(input_image, imtype=np.uint8): if isinstance(input_image, torch.Tensor): image_tensor = input_image.data else: return...
Jintopia/Hint-based-Colorization
utils.py
utils.py
py
1,302
python
en
code
1
github-code
36
28524161009
import socket import pickle SERVER_ADDR = "192.168.1.100" PORT = 6000 ADDR = (SERVER_ADDR, PORT) client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) replys = [] def send(reply): try: client.send(pickle.dumps(reply)) return pickle.loads(client.recv(4096)) except sock...
TSC-MSTF/QuizApp
client.py
client.py
py
2,308
python
en
code
0
github-code
36
7148043819
a = list(["test.email+alex@leetcode.com","test.e.mail+bob.cathy@leetcode.com","testemail+david@lee.tcode.com"]) res = [] for temp in a: temp1 = temp.split("@")[0] temp2 = temp.split("@")[1] temp1 = "".join(temp1.split(".")) temp1 = temp1[0:temp1.rfind('+',1)] if temp1+'@'+temp2 not in res: r...
ljdongysu/LeetCode
929/Unique_Email_Addresses.py
Unique_Email_Addresses.py
py
363
python
en
code
0
github-code
36
228322789
""" 练习2. 定义函数,在列表中找出所有数字 [43,"悟空",True,56,"八戒",87.5,98] """ # 适用性 # 函数有一个结果使用return # 函数有多个结果使用yield def get_number1(list_number): result = [] for item in list_number: if type(item) in (int, float): result.append(item) return result def get_number2(list_number): for item ...
testcg/python
code_all/day17/exercise02.py
exercise02.py
py
635
python
en
code
0
github-code
36
39056231859
from numpy import genfromtxt,where,zeros,nan,ones from glob import glob from obspy.core.util.geodetics import gps2DistAzimuth from matplotlib import pyplot as plt from obspy import read from obspy.core import UTCDateTime from datetime import timedelta lonepi=-122.3174 latepi=38.2118 time_epi=UTCDateTime('2014-08-24T10...
Ogweno/mylife
Napa_stuff/plot_PGD.py
plot_PGD.py
py
2,500
python
en
code
0
github-code
36
15013232508
### JORDAN VICENTE-LACHAPELLE /-/ 10-26-23 /-/CTI-110 - P3HW2 - Salary ### import os os.system('cls') # Get employee name from user Name = input("Enter employee's name: \n ") # Get number of hours from user Hours = int(input("Enter number of hours worked: \n ")) # Get pay rate per hour from user PayRa...
JordanVL1234/CTI-110
Python/P3HW2_JordanVicenteLachapelle.py
P3HW2_JordanVicenteLachapelle.py
py
1,239
python
en
code
0
github-code
36
3349395198
import paho.mqtt.client as mqtt import paho.mqtt.publish as publish import time,os import datetime while True: try: # The callback for when the client receives a CONNACK response from the server. def on_connect(client, userdata, flags, rc): # Subscribing ...
PraveerT/RPI_MDX
Shutdown/shutdown.py
shutdown.py
py
1,117
python
en
code
0
github-code
36
29656137310
import time import tweepy auth = tweepy.OAuthHandler('KINHgXqoSTS5ReyTnjXSYAA6w', 'ehCnMc37yfAf6PPdmzQMJM7pkUb5HYsnPfZw0vf5m9rxPNEbVm') auth.set_access_token('1488729367346040833-mQJ2oNZDK0Rj49uLojV9WAYL4oURe0', '8zzRNCJ9sGxcnxJxgVEQkfNC7kWL12Akgpd2gdUt6REo3') api = tweepy.API(auth) user = api.me() # public_tweets =...
giochoa/pythontest
twitterbot/tweety.py
tweety.py
py
978
python
en
code
0
github-code
36
6554339298
from __future__ import annotations # IMPORTS # =======> # noinspection PyUnresolvedReferences import typing import pegen.parser as pegen # EXPORTS # =======> __all__ = [ 'memoize', 'memoize_left_rec', ] # MAIN CONTENT # ============> if typing.TYPE_CHECKING: from pegen.parser import Parser F = typing....
ButterSus/KiwiPreview
frontend/parser/memoizetools.py
memoizetools.py
py
1,460
python
en
code
0
github-code
36
3738842637
import pandas as pd from bs4 import BeautifulSoup as bs from splinter import Browser def init_browser(): executable_path = {"executable_path": "chromedriver.exe"} return Browser("chrome", **executable_path) mars_dict = {} #NASA Mars News def scrape_mars_news(): try: browser = init_browser() ...
williamsit/Homework
Mission_To_Mars/scrape_mars.py
scrape_mars.py
py
4,587
python
en
code
0
github-code
36
37489105113
import struct import utils from random import randint from binascii import hexlify from abci import ABCIServer from abci import BaseApplication from abci import ResponseInfo from abci import ResponseQuery from abci import ResponseInitChain from abci import ResponseCheckTx from abci import ResponseDeliverTx from abci...
SoftblocksCo/Simple_coin
application.py
application.py
py
3,914
python
en
code
9
github-code
36
14059339607
from utils import WordEmbeddingUtil, TextUtil from config import Config import numpy as np import torch word2vec_util = None text_cnn_model = torch.load('../pretrained/text_cnn_static.h5') def static_text_cnn_word2vec_predict(sentence): global word2vec_util, text_cnn_model if word2vec_util is None: w...
miyazawatomoka/QIQC
script/predict.py
predict.py
py
1,148
python
en
code
0
github-code
36
7822082403
# 풀이 중도 포기 (2/1 이어서 시도) from collections import deque from sys import stdin input = stdin.readline def dfs(h, w): queue = deque([h, w]) visited[h, w] = True for i, j in li[h]: if not visited[j]: pass h, w = map(int, input().split()) li = [] res = 0 max = 0 # 육지 바다 정보 입력 for _ in r...
Drizzle03/baekjoon_coding
20230131/2589_Backtracking.py
2589_Backtracking.py
py
646
python
ko
code
0
github-code
36
22123090899
from conf import * # Это для моего пользованяи можете удалить import os TOKEN = TOKEN # Токен бота WEBHOOK_HOST = WEBHOOK_HOST #Хостинг для вебхуков WEBHOOK_PATH = f'/webhook/{TOKEN}' WEBHOOK_URL = f'{WEBHOOK_HOST}{WEBHOOK_PATH}' WEBAPP_HOST = '0.0.0.0' WEBAPP_PORT = 5000 pat_home = os.getcwd()
Colobok2002/Profkom-bot
CONFIG.py
CONFIG.py
py
366
python
ru
code
0
github-code
36
18694607794
# -*- coding: utf-8 -*- """ Functions to interact with the realsense recordings for HPPD project """ #%% imports import numpy as np import matplotlib.pyplot as plt import pandas as pd import cv2 import pyrealsense2 as rs import mediapipe import sys import keyboard import os import csv import datetime import time ...
mmtlab/wheelchair_contact_detection
hppdWC/bagRS.py
bagRS.py
py
43,231
python
en
code
0
github-code
36
32523088106
import os from flask import Flask, jsonify, request, send_from_directory, Blueprint from flask_restful import Api from werkzeug.utils import secure_filename from resources.invoice import InvoicesResource, InvoiceResource, MarkDigitizedInvoice # from config import UPLOAD_FOLDER UPLOAD_FOLDER = "./uploads/" ALLOWED_EXT...
KetanSingh11/Python_Assignment_-_Plate_IQ
plateiq_app/app.py
app.py
py
2,447
python
en
code
0
github-code
36
16103607796
import imp from multiprocessing.spawn import import_main_path from django.shortcuts import render from student.models.students import Student def index(request): if request.method == "POST": name = request.POST.get("name") adm = request.POST.get("adm") print(name) print(adm) ...
Python-Guruz/CRUD-DEMO
student/views/students.py
students.py
py
612
python
en
code
0
github-code
36
2722590323
class Solution: def groupThePeople(self, groupSizes: List[int]) -> List[List[int]]: d = collections.defaultdict(list) res = [] for i, g in enumerate(groupSizes): if g == 1: res.append([i]) elif (g not in d) or (g in d and len(d[g]) < g-1): ...
ZhengLiangliang1996/Leetcode_ML_Daily
contest/weekcontest166/groupPeople.py
groupPeople.py
py
521
python
en
code
1
github-code
36
42243134200
import sys, time, itertools import dill as pickle import numpy as np import matplotlib.pyplot as plt import scipy.interpolate as interp import scipy.stats as stats import scipy.optimize as opti import bead_util as bu import calib_util as cal import transfer_func_util as tf import configuration as config import war...
charlesblakemore/opt_lev_analysis
scripts/mod_grav/old/alpha_lambda_from_timedomain_fit.py
alpha_lambda_from_timedomain_fit.py
py
30,732
python
en
code
1
github-code
36
73495581544
def czy_wszystkie(napis): alfabet = "abcdefghijklmnopqrstuwvxyz" bledy = 0 for i in alfabet: if i not in napis: bledy = 1 if bledy == 0: return True else: return False napis = input("Podaj slowo do sprawdzenia:") if czy_wszystkie(napis): print(...
GracjanKoscinski/Programowanie
Petle for/funkcje/zadanie 6.py
zadanie 6.py
py
353
python
pl
code
0
github-code
36
4435033563
import requests from currency_codes import CURRENCIES API_KEY = '82e68121413a404dc85fd537' def get_rate(currency): url = f"https://v6.exchangerate-api.com/v6/{API_KEY}/pair/{currency}/UZS" try: response = requests.get(url) rate = response.json()['conversion_rate'] except: rate = False return rate de...
otabek-usmonov/uzs-exchangerate-bot
currency_rate_info.py
currency_rate_info.py
py
921
python
en
code
0
github-code
36
1478139833
import sys import os from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QLineEdit, QLabel, QPushButton, QListView from PyQt5.QtWidgets import QSizePolicy, QScrollArea, QCompleter, QHBoxLayout, QDialog from PyQt5.QtCore import Qt, pyqtSlot, QModelIndex from PyQt5.QtCore import QStandardPaths import ...
Vivx701/Nighandu
nighandu_gui.py
nighandu_gui.py
py
15,836
python
en
code
1
github-code
36
21271931699
from pulp import * def solve_sudoku(input_form): # A list for indexing indices_seq = ["1", "2", "3", "4", "5", "6", "7", "8", "9"] values = indices_seq rows = indices_seq columns = indices_seq squares_list = [] for i in range(3): for j in range(3): squares_list += [[(...
nrebel/sudoku-web-app
sudoku.py
sudoku.py
py
3,199
python
en
code
0
github-code
36
25161970451
import json import logging import requests from dacite import from_dict from typing import Any from adyen_gift_card.api.adyen_notifications.request import NotificationRequestItem from adyen_gift_card.infrastructure.newstore_client.client_response import NewStoreError from newstore_common.json.multi_encoder import Mu...
NewStore/int-cinori
integrations/adyen_gift_card/adyen_gift_card/infrastructure/newstore_client/client.py
client.py
py
1,368
python
en
code
0
github-code
36
27115300498
from django.shortcuts import render, redirect from application.models import * # Create your views here. def index(request): context= { 'Users': User.objects.all() } return render(request, 'index.html', context) def submit_user(request): User.objects.create( first_name=request.POST['fn...
beattietrey/Coding-Dojo
python_stack/django/django_fullstack/assignments/users_with_templates/application/views.py
views.py
py
468
python
en
code
0
github-code
36
74114165863
import frappe import os import json import sys # bench execute mfi_customization.mfi.patch.migrate_patch.get_custom_role_permission def get_custom_role_permission(site=None): if sys.argv[2]=='--site': os.system("bench --site {0} export-fixtures".format(sys.argv[3])) else: os.system("bench ex...
Bizmap-Technologies-Pvt-Ltd/mfi_customization-
mfi_customization/mfi/patch/migrate_patch.py
migrate_patch.py
py
848
python
en
code
0
github-code
36
36384166089
""" Author: Kevin Owens Date: 12 May 2014 Class: LongCalc Problem description summary (from TopCoder Tournament Inv 2001 Semi C+D 1000): Do big-int math with two integer operands and a an operator identifier for add, subtract, multiply, and integer divide. Operands are given as strings; operator is given as a numeri...
knaught/TopCoder
LongCalc.py
LongCalc.py
py
1,318
python
en
code
0
github-code
36
417596476
from socket import* import socket import sys try: sock=socket.socket(family=AF_INET,type=SOCK_STREAM) except socket.error as err: print("Failed to create a socket") print("Reason: %s" %str(err)) sys.exit() print("Socekt created") target_host=input("Enter the target_host name to connect: ") target_por...
Rakibuz/Robotics_HCI
Python Socket Programming/Pro_Knw_tcpsockets.py
Pro_Knw_tcpsockets.py
py
633
python
en
code
0
github-code
36
73857321062
import numpy as np from munch import DefaultMunch from sklearn.model_selection import train_test_split from tests import config_params, compas_dataset_class, compas_without_sensitive_attrs_dataset_class from virny.utils.common_helpers import validate_config, confusion_matrix_metrics def test_validate_config_true1(co...
DataResponsibly/Virny
tests/utils/test_common_helpers.py
test_common_helpers.py
py
2,369
python
en
code
7
github-code
36
27698172299
# -*- coding: utf-8 -*-# ''' # Name: NormalizePredicateData # Description: 将测试数据也进行归一化操作 # Author: super # Date: 2020/5/13 ''' import numpy as np from HelperClass.NeuralNet_1_1 import * file_name = "../data/ch05.npz" if __name__ == '__main__': # data reader = DataReader_1_1(file_name)...
Knowledge-Precipitation-Tribe/Neural-network
code/MultiVariableLinearRegression/NormalizePredicateData.py
NormalizePredicateData.py
py
727
python
en
code
3
github-code
36
100754923
from linkedin import (LinkedInAuthentication, LinkedInApplication, PERMISSIONS) if __name__ == '__main__': API_KEY = '77se22zag9iejz' API_SECRET = 'kBpqQgsjTrWXu4wB' RETURN_URL = 'http://68.183.125.29:5000' authentication = LinkedInAuthentication(API_KEY, API_SECRET, RETU...
fernando-carvalho/digital_info
teste2.py
teste2.py
py
495
python
en
code
0
github-code
36
35398028388
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) from contextlib import contextmanager import os import pytest from textwrap import dedent from pants.base.address import SyntheticAddress, BuildFileAddress from pants...
fakeNetflix/square-repo-pants
tests/python/pants_test/graph/test_build_graph.py
test_build_graph.py
py
13,188
python
en
code
0
github-code
36
19056751666
from model.Player import Player from model.PropertySquare import PropertySquare from model.Square import Square class SquareView: def __init__(self): return def render(self, square: Square): if(type(square) is PropertySquare): owner_obj: Player = square.get_owner() own...
louisZYC/monopoly
view/SquareView.py
SquareView.py
py
1,081
python
en
code
1
github-code
36
25719962431
import nmap import main import xlsxwriter nmScan = nmap.PortScanner() def scan_ip(host): nombre = main.checkoutput() if nombre == "print": print('Host : %s (%s)' % (host, nmScan[host].hostname())) print('State : %s' % nmScan[host].state()) for proto in nmScan[host].all_protocols(): print('-------...
mepiadmw/PIA-Ciberseguridad
scan_ip.py
scan_ip.py
py
1,175
python
en
code
0
github-code
36
30326229759
import pandas as pd import numpy as np from statsmodels.stats.outliers_influence import variance_inflation_factor def forward_delete_corr(data): # 计算相关系数矩阵 corr = data.corr().abs() # 选取相关系数矩阵的上三角部分 upper = corr.where(np.triu(np.ones(corr.shape), k=1).astype(bool)) # 找出相关系数大于0.7的变量并添加到待删除列表中 to...
Whale-lyi/simple-predict
filter.py
filter.py
py
1,753
python
en
code
0
github-code
36
5940263315
from functools import reduce import math import numpy as np import torch from torch import nn from tqdm import tqdm import torch.nn.functional as F from model.layers import * from model.losses import * class GraphRecommender(nn.Module): def __init__(self, opt, num_node, adj, len_session, n_train_sessions): ...
dbis-uibk/SPARE
model/recommender.py
recommender.py
py
4,257
python
en
code
3
github-code
36
29725189606
import pandas as pd import numpy as np def iat_get_dscore_each_stim(df,subject,rt,block,condition,stimulus,cond1,cond2,blocks,weighted): ''' Take all relevant columns and produce a D score for each stimulus (i.e. word). 08-2017 Alexander Millner <alexmillner@gmail.com ''' idx=pd.IndexSli...
amillner/pyiat
pyiat/pyiat.py
pyiat.py
py
32,040
python
en
code
1
github-code
36
33147673762
#!/usr/bin/env python3 from . base_instruction import BaseInstruction from error_handler import ErrorHandler class INS_Defvar(BaseInstruction): def __init__(self, instruction, programMemory): self.instruction = instruction self.programMemory = programMemory def eval(self): if len(self.instruction['args']) !=...
hondem/FIT
ipp_proj_1/instructions/ins_defvar.py
ins_defvar.py
py
724
python
en
code
0
github-code
36
44682923693
from flask import Flask, render_template, request, session, url_for, redirect from flask_sqlalchemy import SQLAlchemy import wikipedia as wk import random import re from retry import retry from nltk.tokenize import sent_tokenize import nltk nltk.download('all') #TODO - BETTER TEXT REPLACE HE/HER - WIKIPEDIA BETTER SEA...
Freskoko/WikipediaQuizFlask
app.py
app.py
py
3,771
python
en
code
0
github-code
36
36622911721
#"""Build and train for the AI Models.""" #imports from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import datetime import os from data_load import DataLoader import numpy as np import tensorflow as tf model_name = "" def reshape_function(d...
leahimJarun/SensoGripProjectAiModel
train.py
train.py
py
18,429
python
en
code
0
github-code
36
17754409752
import tornado.ioloop import tornado.web import tornado.httpserver import io import os from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine from sqlalchemy import inspect from sqla...
gbif/gbif-basemaps
polar-water-tiles/polar-water-preview/server_3575.py
server_3575.py
py
6,778
python
en
code
1
github-code
36
11577553681
# 10798 words = [] for _ in range(5): words.append(list(input())) word = '' for i in range(15): for j in range(5): try: word += words[j][i] except IndexError: continue print(word)
starcat37/Algorithm
BOJ/Bronze/10798.py
10798.py
py
212
python
en
code
0
github-code
36
73683828585
from typing import Optional, Tuple import numpy as np import torch from pytorch_lightning import LightningDataModule from torch.utils.data import DataLoader, Dataset from src.datamodules.components.diarization_dataset import ( DiarizationDataset, DiarizationDatasetforInfer, ) def collate_fn(batch): ys, ...
DaseiNaN/Speech-Diarization
src/datamodules/diarization_datamodule.py
diarization_datamodule.py
py
4,687
python
en
code
1
github-code
36
23495813882
import datetime import tkinter.messagebox as tm from tkinter import * import tkinter.ttk as ttk import sqlite3 from PIL import ImageTk,Image path="logo1.png" sum=0 def myfunction(event): canvas.configure(scrollregion=canvas.bbox("all"), width=1328, height=455) def Numberonly1(event): glob...
Adrish1999/Python-GUI
Reg_Form_Without_Login.py
Reg_Form_Without_Login.py
py
54,535
python
en
code
0
github-code
36
74307505383
# -*- coding: utf-8 -*- """ Created on Wed Jan 18 10:23:50 2017 @author: lcp5y3 """ #---------------------------------------------------------------------------- # file of function which allow to decode data from uart protocole # CRUBS_ll #-------------------------------------------------------------------------...
lcp5y3/tenchWichSpeak
pyqt/CRUBS_ll_decode.py
CRUBS_ll_decode.py
py
7,281
python
en
code
0
github-code
36
22778807898
import copy import numpy as np import random from collections import defaultdict from torch.utils.data.sampler import Sampler class RandomClassSampler(Sampler): """Randomly samples N classes each with K instances to form a minibatch of size N*K. Modified from https://github.com/KaiyangZhou/deep-person-rei...
MaXuSun/domainext
domainext/data/samplers/random_class.py
random_class.py
py
2,346
python
en
code
8
github-code
36
29326071622
# coding=utf-8 import matplotlib.pyplot as plt from gensim.models import Word2Vec from sklearn.linear_model import SGDClassifier from sklearn.metrics import roc_curve, auc import data_processing import globe import word2vec_gensim_train # 读入数据 # pos_file_path = '/home/zhangxin/work/workplace_python/DeepNaturalLanguag...
STHSF/DeepNaturalLanguageProcessing
TextClassification/sentiment_analysis/sentiment_analysis_zh/word2vec_classify_run.py
word2vec_classify_run.py
py
1,700
python
en
code
16
github-code
36
30466599177
class Solution: def read(self, buf, n): temp = [''] * 4 ##新开一个空间,让buf4往里面读数 index = 0 while True: count = read4(temp) size = min(count, n - index) # 看还够不够都放进buf里取的 for i in range(size): #对于读进来的数把buf里存入buf4里的数 buf[index] = temp[i] ...
dundunmao/LeetCode2019
157 Read N Characters Given Read4.py
157 Read N Characters Given Read4.py
py
609
python
zh
code
0
github-code
36
1406747066
#Your task is to complete this function #Your should return the required output class Solution: def maxLen(self, n, arr): #Code here curr_sum, max_sum = 0, 0 prefix_sum = {} for (i, curr) in enumerate(arr): curr_sum += curr if not curr_sum: ...
anishgupta675/Striver_SDE_Sheet
Arrays_Part_IV/Largest_Subarray_with_K_sum/Solution.py
Solution.py
py
863
python
en
code
0
github-code
36
34972782273
from .helpers import flattenToSet, console from .nodes import Nodes from .locality import Locality from .nodefeature import NodeFeatures from .edgefeature import EdgeFeatures from .computed import Computeds from .text import Text from ..search.search import Search API_REFS = dict( AllComputeds=("Computed", "compu...
aarek-eng/txtpy
txtpy/core/api.py
api.py
py
5,762
python
en
code
1
github-code
36
201309717
#name introduction """ Topic: Programming Logic and Design Author: Viernes, Michael Submitted to: Mr. Madrigalejos """ """ # Getter functions (NOT USED FOR THE MOMENT FOR HOMEWORK 04). def getName(): name = input("Your name: ") return name def getAge(): age = input("Your age: ") ret...
MichaelViernes271/PLD-Homework-04
name-intro.py
name-intro.py
py
1,869
python
en
code
1
github-code
36
19226676283
import dash from dash.dependencies import Input, Output, State import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go import dash_bootstrap_components as dbc from app import app from apps import general_functions as gf #from apps_igf import func_gral main_layo...
jGarciaGz/bocetos
gral2.py
gral2.py
py
3,189
python
en
code
0
github-code
36
35396901278
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) from twitter.common.collections import OrderedSet from twitter.common.dirutil.fileset import Fileset from twitter.common.lang import Compatibility def assert_list(obj...
fakeNetflix/square-repo-pants
src/python/pants/base/validation.py
validation.py
py
1,754
python
en
code
0
github-code
36
3511362879
import re def name_score(name): total = 0 for x in name: total += ord(x)-ord('A')+1 return total name_list = [] for name in open("p022_names.txt").read().split(","): name = re.findall("\"(.*)\"",name)[0] name_list.append(name) name_list = sorted(name_list) i=1 total = 0 for name i...
PetraVidnerova/euler
22.py
22.py
py
396
python
en
code
0
github-code
36
27698021659
# -*- coding: utf-8 -*-# ''' # Name: dnn_regression-keras # Description: # Author: super # Date: 2020/6/2 ''' from HelperClass2.MnistImageDataReader import * from keras.models import Sequential from keras.layers import Dense import matplotlib.pyplot as plt import os os.environ['KMP_DUPLICATE...
Knowledge-Precipitation-Tribe/Neural-network
code/DNN/dnn_regression-keras.py
dnn_regression-keras.py
py
1,937
python
en
code
3
github-code
36
74031939303
import json import sys import aes_functions import rsa_functions from exceptions.Exceptions import IncorrectData from socket_class import SOCKET_SIMPLE_TCP def receiveAESMessage(s): return s.receive(), s.receive(), s.receive() def checkMessageGCM(key, iv, cif, mac): res = aes_functions.decipherAES_GCM(key,...
makrron/simplified-kerberos-protocol
p-b.py
p-b.py
py
4,633
python
en
code
0
github-code
36
71903311144
import torch.nn as nn import torch import torch.optim as optim import numpy as np from torch.utils.data import DataLoader from prior_learning.toy_env.toyloader import toyenv_Dataset size = 8 seq_len = 32 categories = 16 batch_size = 128 feature_dim = 16 features = np.random.random((categories, feature_dim)) train_load...
buoyancy99/sap
prior_learning/toy_env/train_toy.py
train_toy.py
py
1,633
python
en
code
1
github-code
36
28924241951
#11238. Fibo """ 피보나치 수와 최대공약수와 유사한 문제. gcd(a,b)%M= gcd(a%M, b%M)이 성립하는진 사실 잘 모르겠지만.. 그러지 않고선 메모리 초과가 날 것 같다. gcd(Fib(m),Fib(n))=Fib(gcd(m,n))이라고 한다. 이에 대한 증명은 구글링을 통해 공부해보자. (재밌어보인다) """ big_num=1000000007 #행렬 a,b가 주어졌을때 그 행렬곱을 구하는 함수 def matmul(a,b): row=len(a); common=len(b); column=len(b[0]) c=[[...
GuSangmo/BOJ_practice
PS/DP/matrix_DP/11238.py
11238.py
py
1,587
python
ko
code
0
github-code
36
42850936844
from django.urls import path from . import views urlpatterns = [ path('register/', views.registerPage, name='register'), path('login/', views.loginPage, name='login'), path('logout/', views.logoutUser, name='logout'), path('event_create/', views.event_create, name='event_create'), path('event_manag...
Barnacle322/esoapp
eventsmanager/eventcreation/urls.py
urls.py
py
525
python
en
code
0
github-code
36
31061019305
from ..utils import Object class CancelUploadFile(Object): """ Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined Attributes: ID (:obj:`str`): ``CancelUploadFile`` Args: file_id (:obj:`int`): ...
iTeam-co/pytglib
pytglib/api/functions/cancel_upload_file.py
cancel_upload_file.py
py
735
python
en
code
20
github-code
36
27977418436
#!/usr/bin/env python import config import json import requests import sys """ Copyright (c) 2020, Cisco Systems, Inc. and/or its affiliates Creates webhooks in a repo upon release using GitHub API v3 POST /repos/:owner/:repo/hooks Requires a file with repo names, one per line, and a personal access token with access...
justwriteclick/gh-webhooks
create_webhook.py
create_webhook.py
py
3,009
python
en
code
2
github-code
36
32694277113
import forecast import send_sms from datetime import datetime # Since the api call is made at 6:00 AM, hourly_forecast[0] is 6 AM def main(): startTimes = [8, 8, 8, 8, 8] endTimes = [18, 16, 18, 18, 10] date = datetime.today() dayOfWeek = date.weekday() message = "" phone_number = "+19257877379...
kailashbaas/Weather-SMS
main.py
main.py
py
1,681
python
en
code
0
github-code
36
4579701597
from django.http import JsonResponse from django.views.generic import View from .models import Scraper from .validators import currency_serializer, get_valid_data class ScraperAPI(View): def get(self, *args, **kwargs): currencies = Scraper.objects.all() data = {"scrapers": list(map(currency_seri...
chvilches/rg-corp
api/views.py
views.py
py
2,052
python
en
code
0
github-code
36
4108394927
from sys import stdin input = stdin.readline moves = [[1, 0], [0, 1], [1, 1], [-1, 1]] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" for _ in range(5): r, c = [int(x) for x in input().split()] grid = [input()[:-1] for _ in range(r)] words = set() for _ in range(int(input())): before = input()[:-1] ...
AAZZAZRON/DMOJ-Solutions
ecoo14r1p3.py
ecoo14r1p3.py
py
1,243
python
en
code
1
github-code
36
32967623992
from django import forms from django.core.exceptions import ValidationError from arcana_app.models import Driver, Truck, Trailer, Insurance, Freight class DateInput(forms.DateInput): input_type = 'date' class TimeInput(forms.TimeInput): input_type = 'time' # class CheckboxInput(forms.CheckboxInput): # ...
KamilNurzynski/Arcana
arcana_app/forms.py
forms.py
py
2,848
python
en
code
1
github-code
36
29788143583
import os from extension.constants import ENV_OPTION_PREFIX from extension.interface import ExtensionModules class MockExtensionModules(ExtensionModules): def inputs(self): return [] def outputs(self): return [] def generate_inputs(self, data): pass def generate_outputs(sel...
ofek/extensionlib
tests/test_interface.py
test_interface.py
py
1,371
python
en
code
19
github-code
36
70212652263
import keras import keras_cv import keras_core as keras import tensorflow as tf images = tf.ones(shape=(1, 512, 512, 3)) labels = { "boxes": [ [ [0, 0, 100, 100], [100, 100, 200, 200], [300, 300, 100, 100], ] ], "classes": [[1, 1, 1]], } model = keras_cv....
kevinmccall/cs4
finalproject/kerastest.py
kerastest.py
py
804
python
en
code
0
github-code
36
9491434540
import tests.hakoblog # noqa: F401 from hakoblog.db import DB from hakoblog.loader.user import UserLoader from hakoblog.action.blog import BlogAction from hakoblog.loader.blog import BlogLoader from tests.util import random_string, create_user, global_user def test_create(): db = DB() user = create_user()...
hakobe/hakoblog-python
tests/action/test_blog.py
test_blog.py
py
1,116
python
en
code
10
github-code
36
36558187570
import heapq from typing import List def topKFrequent(nums: List[int], k: int) -> List[int]: # Verified on Leetcode frequencies = {} for num in nums: if num not in frequencies: frequencies[num] = 1 else: frequencies[num] += 1 temp = [] for num, f in frequencies...
InderdeepSync/grokking-coding-interview
top_k_elements/top_k_frequent_elements.py
top_k_frequent_elements.py
py
646
python
en
code
1
github-code
36
25651671407
from typing import Iterable, Tuple, TypeVar, Callable, Any, List, Dict, Union import math import numpy as np import os.path import torch import torchaudio import torch.nn as nn from torch.utils.data import Dataset, DataLoader import warnings import pandas as pd import plots from utils import validate_audio # Useful ...
rfalcon100/seld_dcase2022_ric
dataset/dcase_dataset.py
dcase_dataset.py
py
51,279
python
en
code
6
github-code
36
31429204981
#2021.06.22 #소수 구하기 import math def isprime(num) : if num == 1 : return False n = int(math.sqrt(num)) for i in range(2,n+1): if num % i == 0: return False return True s,e = map(int,input().split()) for k in range(s,e+1): if isprime(k) : print(k)
Minkeyyyy/OJ
BaekJoon/Step/기본수학2/_1929.py
_1929.py
py
286
python
en
code
0
github-code
36