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
44960818882
import config import MySQLdb import hashlib import urllib import urllib2 import re from xml.dom import minidom def getText(nodelist): rc = [] for node in nodelist: if node.nodeType == node.TEXT_NODE: rc.append(node.data) return ''.join(rc) def search_ticker(ticker, mode): mysql = ...
kperson/TwitNode
pybatch/searchticker.py
searchticker.py
py
2,435
python
en
code
1
github-code
1
24677613630
import re from app.schemas.parse import RegexField, RegexFieldStatistical from app.core.config import Settings, GetFileJson from collections import OrderedDict, Counter class RegexRules: def __init__(self, content: str, setting: Settings = None): self.content = content if setting: self...
yc88/attachment_parse
app/api/content_regex.py
content_regex.py
py
6,941
python
en
code
0
github-code
1
38284308726
import discord from discord.ext import commands from src.summonerInfo import getSummonerIdentification from src.champion import get_champion_info_embed from src.ranked import init_tier, init_tier_embed, get_tiers_type, get_tier_info, get_max_tier, get_winratio from src.summoner import get_summoner_info from decouple ...
bakhoon/LoL-Summoner-Status
cogs/getSummonerInfo.py
getSummonerInfo.py
py
4,527
python
en
code
0
github-code
1
17726333528
import text.tokenizer from text.japanese_token import JapaneseToken class MockTokenizer(text.tokenizer.Tokenizer): """A mock tokenizer to be used in tests where a text needs to be split into tokens.""" def split(self, text): tokens = [] for i in range(10): token = JapaneseToken("戻...
EtienneDesticourt/MakuraReader
tests/text/mock_tokenizer.py
mock_tokenizer.py
py
650
python
ja
code
0
github-code
1
23241366223
# Register imports from flask import Flask, request, jsonify from models import db from models import Client from config import config from flask_marshmallow import Marshmallow from flask_cors import CORS, cross_origin import os #App startup configuration def create_app(enviroment): app = Flask(__name__) app.c...
josewiss777/apirestClients
app.py
app.py
py
3,480
python
en
code
0
github-code
1
71917708513
import sys from view.interfaces.IObserver import IObserver class CLIView(IObserver): def __init__(self, model, controller): self.model = model self.controller = controller self.model.subscribe(self) def update(self, msg): print('{} {} {}'.format(msg['header'], msg['status'], m...
arcanrun/MoodMovie
view/CLIView.py
CLIView.py
py
5,701
python
en
code
1
github-code
1
34000914126
import datetime class Shape: def __init__(self, colour, material): self.colour = colour self.material = material self.create_date = datetime.datetime.now().strftime("%x") # this date will be the same for all Shapes, we do not need to pass this create parameter
czamoral2021/CEBD-1100-CODE-WINTER-2021
Entities/Shape.py
Shape.py
py
301
python
en
code
0
github-code
1
31066958205
from __future__ import print_function import argparse import os import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import torchvision.datasets as dset import torchvision.transforms as transforms import torchv...
gyes00205/NYCU_DLP_2022
lab7/DCGAN.py
DCGAN.py
py
3,649
python
en
code
3
github-code
1
15416188509
import cv2 import numpy as np faceCascade = cv2.CascadeClassifier("Resources/haarcascade_frontalface_default.xml") #read video from webcam cap = cv2.VideoCapture(0) #0-> ID of the camera cap.set(10,100) #10-> Brighness # cap.set(3,640) #3-> width # cap.set(4,480) #4-> height #...
dwijmistry11/MyOpencvProject
9_b_Webcam_FaceDetection.py
9_b_Webcam_FaceDetection.py
py
779
python
en
code
1
github-code
1
9289479299
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import configparser import os from pymongo import MongoClient, DESCENDING, ASCENDING path = os.path.dirname(os.path.abspath(__file__)) config = configparser.ConfigParser() config.read(path + '''/../config/configuration.cfg''') def connect_to_mongodb(): client = Mo...
dantunescost/antunedo
api/lib/mongoConnector.py
mongoConnector.py
py
8,521
python
en
code
0
github-code
1
27191149539
# vd7.py # Cho 1 dãy số (phân biệt) # Tìm ra các bộ a, b, c trong dãy thỏa mãn a+b=c lst = [1, 3, 4, 5, 8, 11, 15] for a in lst: for b in lst: if a >= b: continue c = a+b if c in lst: print(f'{a}+{b}={c}')
pytutorial/py2011E
Day5/vd7.py
vd7.py
py
261
python
vi
code
1
github-code
1
3455412680
import tensorflow as tf from tensorflow import keras import numpy as np import cv2 from keras.models import load_model facedetect = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') cap=cv2.VideoCapture(0) cap.set(3,640) cap.set(4,480) font=cv2.FONT_HERSHEY_COMPLEX model = load_model('keras_model.h5') def ge...
ShadmanRana/Student_Attendance_System_Based_On_Face_Recogniton
project/facerecognition.py
facerecognition.py
py
1,445
python
en
code
0
github-code
1
166634994
import numpy as npy import ctypes as ct import os import platform src_path = os.path.dirname(__file__) if platform.system() == 'Windows': lib_name = 'connect.pyd' else: lib_name = 'connect.so' connect_lib = npy.ctypeslib.load_library(lib_name, src_path) def connect_s_fast(A,k,B,l): ''' connect two n...
jem0101/BigSwag-SQA2022-AUBURN
TestOrchestrator4ML-main/resources/Data/supervised/GITHUB_REPOS/scikit-rf@scikit-rf/skrf/src/__init__.py
__init__.py
py
1,954
python
en
code
2
github-code
1
74377598752
#!python3 # Multiclipboard program - Automate the Boring Stuff C8 # Follow along tutorial. # Implemented delete keyword # mcb.pyw - Saves and loads pieces of text to the clipboard # Command Line Arguments: py.exe mcb.pyw save <keyword> - Saves clipboard to keyword # py.exe mcb.pyw <keyword> - Lo...
lupp1/pyscripts
Multiclipboard/mcb.py
mcb.py
py
1,263
python
en
code
0
github-code
1
15686226766
import numpy as np import matplotlib.pyplot as plt import os import utils as u import result_gen_utils as ru import pandas as pd import seaborn as sns import multiprocessing from joblib import Parallel, delayed import natsort import time from sklearn.metrics.pairwise import cosine_similarity from sklearn import manifol...
agarwalShruti15/motion_signature
baseline/repo_tsne.py
repo_tsne.py
py
6,156
python
en
code
4
github-code
1
32486202031
############## 주의 ############## # 입력을 받기위한 input 함수는 절대 사용하지 않습니다. # 내장 함수 sum 함수를 사용하지 않습니다. # 사용시 감점처리 되니 반드시 확인 바랍니다. def sum_primes(number): start = 2 # 소수는 2부터 시작한다. ans = 0 # 답을 담을 그릇 except_num = 17 # 제외할 숫자는 17 prime = [1] * (number + 1) # 에라토스테네스의...
CrimsonTheLegoBuilder/MyBaekjoonSolve
hw/test230731/problem07.py
problem07.py
py
1,391
python
ko
code
0
github-code
1
26990281858
from flask_app.config.mysqlconnection import connectToMySQL import re from flask import flash EMAIL_REGEX = re.compile(r'^[a-zA-z0-9.+_-]+@[a-zA-Z0-9]+\.[a-zA-z]+$') class Email: db = 'email_validation' def __init__(self, data): self.id = data['id'] self.email = data['email'] self.creat...
raspuna/python_course
python/flask_mysql/validation/email_validation/flask_app/models/email.py
email.py
py
2,106
python
en
code
1
github-code
1
1656190042
def primeNumFinder(num): for i in range(2, num): if num % i == 0: return None return num def main(): lower = int(input("Start number: ")) while lower < 1: print("Start and end must be positive") lower = int(input("Start number: ")) upper = int(input("End number:...
otisscott/data_structures
others work/bernie/second/primeCustomRange.py
primeCustomRange.py
py
580
python
en
code
0
github-code
1
1710560499
import sys sys.path.insert(0, "/root/autodl-tmp/Code/RLHF") sys.path.insert(0, "/mnt/sfevol775196/sunzeye273/Code/chatgpt") # sys.path.insert(0, "/mnt/share-pa002-vol682688-prd/sunzeye273/Code/chatgpt") sys.path.insert(0, "/mnt/pa002-28359-vol543625-private/Code/chatgpt") import os import argparse import evaluate impo...
xuqy1981/RLHF
src/train_sft.py
train_sft.py
py
14,565
python
en
code
null
github-code
1
22876010422
import socket import select import errno from select import POLLIN, POLLOUT, POLLERR, POLLHUP, POLLNVAL from ccstruct import * from collections import deque # define channel types CH_TYPE_PIPE = 0 CH_TYPE_TCP = 1 CH_TYPE_UDP_S = 2 # send-only UDP CH_TYPE_UDP_R = 3 # recv-only UDP # define channel state CH_STATE_NO...
yeliqseu/ccfd-python
channel.py
channel.py
py
10,849
python
en
code
5
github-code
1
3482718873
import tkinter as tk from tkinter import filedialog from sym_crypto import Crypto class App(tk.Tk): def __init__(self): tk.Tk.__init__(self) self.c = Crypto() self.filename = '' self.title = tk.Label(text='Criptografia', font='Arial, 14') self.title.place(width=None, heig...
AdrielHigor/kryptos
Symmetric_crypto/main.py
main.py
py
3,963
python
pt
code
0
github-code
1
20267977331
""" Author: Rodion Calistru, rcalistr@purdue.edu Assignment: 07.4 - Magic Square Date: 10/24/2022 Description: The program determines whether a square fulfills several criteria, such as that all numbers are unique and are between 1 and 9. The sum of the squares must also equal 15, otherwise the square ...
R0DC/Purdue_EBEC_101_F22
07/magic_square_rcalistr.py
magic_square_rcalistr.py
py
3,472
python
en
code
0
github-code
1
10996050365
""" 给定一个字符串 s ,找出 至多 包含 k 个不同字符的最长子串 T。 示例 1: 输入: s = "eceba", k = 2 输出: 3 解释: 则 T 为 "ece",所以长度为 3。 示例 2: 输入: s = "aa", k = 1 输出: 2 解释: 则 T 为 "aa",所以长度为 2。 """ class Solution(object): def lengthOfLongestSubstringKDistinct(self, s, k): max_res = 0 left = 0 right = 0 s_dict = {} ...
bendanwwww/myleetcode
code/string/lc340.py
lc340.py
py
1,056
python
zh
code
1
github-code
1
7580240025
# BOJ_2407 # 조합 def solution(): n, m = map(int, input().split()) res_1 = 1 res_2 = 1 for i in range(n, n - m, -1): res_1 = res_1 * i res_2 = res_2 * (n - i + 1) print(res_1 // res_2) if __name__ == "__main__": solution()
wilderif/PS
BOJ/BOJ_2407.py
BOJ_2407.py
py
270
python
en
code
0
github-code
1
20824099866
import time import serial from pdb import set_trace as st import pandas as pd import matplotlib.pyplot as plt import numpy as np from scipy import fft def velo_calc(x,delta_t): v0 = 0 vel_list = [] for ind, each_x in enumerate(x): v = v0+each_x*delta_t vel_list.append(v) v0 = v return np.arr...
Paratra/sparkfun_adxl362
arduino_version/receive_data.py
receive_data.py
py
3,448
python
en
code
0
github-code
1
34104105219
import sys import requests from google.cloud import storage from os import listdir storage_client = storage.Client() def main(argv): folder = argv[1] bucket = storage_client.get_bucket('tfl-mp4-videos') files = listdir('..' + folder) print('Uploading videos from', folder) for file in files: ...
ministrudels/JamCam-Detector
docker_containers/upload_video/app.py
app.py
py
883
python
en
code
0
github-code
1
7455835422
import pytest import json from cdms_psql_server.server import app @pytest.fixture def test_client(): client = app.test_client() def search_companies(term, limit=50, offset=0): resp = client.post( '/company-search', data=json.dumps({ 'term': term, ...
uktrade/cdms-psql-server
test/conftest.py
conftest.py
py
562
python
en
code
0
github-code
1
22397222528
from django.shortcuts import render from django.shortcuts import redirect from django.http import JsonResponse from rest_framework import generics import json import matplotlib import matplotlib.pyplot as plt import networkx as nx import nltk import pandas as pd import os import json import pickle import re import spa...
rheyannmagcalas/santa_all_web
main/wishlist/views.py
views.py
py
9,877
python
en
code
0
github-code
1
22850519987
from odoo import api, models, fields class AccountInvoice(models.Model): _inherit = 'account.invoice' @api.model def line_get_convert(self, line, part): res = super().line_get_convert(line, part) for record in self.tax_line_ids: if line['type'] == 'tax' and record.sequence >= ...
ecosoft-odoo/rjc
account_invoice_reimbursable_tax/models/account_invoice.py
account_invoice.py
py
6,446
python
en
code
2
github-code
1
39027133493
from datetime import datetime from functools import wraps from random import randint import os from bcrypt import hashpw, gensalt, checkpw from flask import Flask, abort, jsonify, request, send_from_directory from flask_cors import CORS from sqlalchemy import or_ from marshmallow import ValidationError from jwt impor...
hammadfaisal/COP290_101_Switching_Protocols
backend/app/app.py
app.py
py
26,917
python
en
code
0
github-code
1
15115155806
"""Callout annotations. """ from .types import Color, FillStyle, HorizontalAlignment, StrokeStyle, VerticalAlignment def text(text, font_name, font_weight, font_size=96.0, font_color=Color(1.0, 1.0, 1.0), height=250.0, width=400.0, horizontal_alignment=H...
sixty-north/python-camtasia
src/camtasia/annotations/callouts.py
callouts.py
py
3,535
python
en
code
12
github-code
1
42632416752
import pennylane as qml from pennylane import numpy as np from arithmetic import compute_tensor from utils import uniform_superposition, tensor_to_qubits import matplotlib.pyplot as plt QUBITS_PER_NUM = 1 PROBLEM_SIZE = 2 SOLUTION_RANK = 3 sizes = (SOLUTION_RANK, PROBLEM_SIZE, QUBITS_PER_NUM) params_per_edge = SOLUTI...
yyargic/TRD_with_PennyLane
grover.py
grover.py
py
1,826
python
en
code
0
github-code
1
71507085474
from classes.user import User userLoginFileName = "login-details.txt" userDetailsFileName = "user-details.txt" def writeUserDetails(user): f = open(userDetailsFileName, "a") details = [user.id, user.firstName, user.lastName, user.address, user.phoneNumber] f.write(",".join(details)) f.write("\n") ...
kaveeshadinamidu/Hospital-User-System
data/user_data.py
user_data.py
py
1,672
python
en
code
0
github-code
1
9130710217
from groupy.gconv.tensorflow_gconv.splitgconv2d import gconv2d, gconv2d_util from tensorflow.keras import layers class GroupConv(layers.Layer): def __init__(self, input_gruop, output_group, input_channels, output_channels, ksize, strides=None, padding='SAME'): super(GroupConv, self).__ini...
guy120494/gcnn
models/layers/GroupConv.py
GroupConv.py
py
1,368
python
en
code
0
github-code
1
73614895713
from typing import Optional from sqlalchemy.orm import Session, selectinload from . import models, schemas class ResourceNotFound(Exception): ... def get_resources(db: Session) -> list[models.Resource]: return ( db.query(models.Resource).options(selectinload(models.Resource.snapshots)).all() )...
janheindejong/urlstalker
api/urlstalker/crud.py
crud.py
py
931
python
en
code
0
github-code
1
74774358113
import torch import argparse from kobert.pytorch_kobert import get_pytorch_kobert_model from sklearn.model_selection import train_test_split from dataset import * from model import * from loss import * from transformers import AdamW from adamp import AdamP from transformers import ElectraModel, ElectraTokenizer import...
ekzm8523/AI_Tech
Pstage_2/kobert/train.py
train.py
py
8,677
python
en
code
0
github-code
1
42184453828
"""This file tests internal details of AndroidPlatform. These are not part of the public API, and should not be accessed or relied upon by user code. """ import calendar from contextlib import contextmanager import imp from importlib import import_module, metadata, reload, resources import importlib.util from importli...
nguyentiem/android_python_chaquopy
chaquopy-demo-master/app/src/main/python/chaquopy/test/test_android.py
test_android.py
py
52,801
python
en
code
0
github-code
1
24927947803
# coding: utf-8 from django.shortcuts import render, get_object_or_404, redirect, render_to_response from .models import Category, Product, Rating, NewsBlock, ActionBlock, AboutUsBlock, DeliveryBlock, ContactsBlock from cart.forms import CartAddProductForm from django.db.models import Q, Avg, Sum, Max, Min, Count from ...
saltal77/docsimvol
site/shop/views.py
views.py
py
14,405
python
en
code
0
github-code
1
34469431520
n, m = map(int, input().split()) arr = list(map(int, input().split())) for _ in range(m): target = int(input()) find = False left = 0 right = n-1 while right >= left: mid = (left+right)//2 if arr[mid] == target: print(mid+1) find = True break ...
yeafla530/algorithms
코드트리/IM/Parmetric_Search/숫자빠르게찾기.py
숫자빠르게찾기.py
py
471
python
en
code
0
github-code
1
41951801108
from torch import nn, optim, cat import torch import numpy as np from torch.autograd import Variable class CNN(nn.Module): def __init__(self, weight): # 继承父类的初始化函数 super(CNN, self).__init__() # 定义卷积层,1 input image channel, 25 output channels, 3*3 square convolution kernel ...
cxyznj/DM2019_emojipredict
CNN.py
CNN.py
py
3,952
python
en
code
1
github-code
1
4371333468
from tqdm import tqdm import torch import torch.nn as nn from torch.optim import Adam from torch_geometric.data import DataLoader from torch_geometric.nn import DataParallel from core.trainer.trainer import Trainer from core.model.vectornet import VectorNet, OriginalVectorNet from core.optim_schedule import Scheduled...
41623134/idea
core/trainer/vectornet_trainer.py
vectornet_trainer.py
py
6,319
python
en
code
0
github-code
1
15813485193
# coding: utf-8 # author of this script Enrique Aldana # # Cleaning Energy Game database output (March, 21st, 2018) # # In order to use the output of the energy game for scientific purposes, it is needed to clean the database output. This script shows the process to clean the current database output. # # 0.Import ...
xdanielsb/DataGamesProcessor
assets/firstProcessor.py
firstProcessor.py
py
1,201
python
en
code
0
github-code
1
42909198832
import sys toolid = 0x0F39 #set digging tool graphic id defaulted as shovel maxweight = 400 #set max weight before it stops if ore is going to pack. target = Target.PromptGroundTarget('Select location to mine') #open a target for player to target tile to mine. Journal.Clear() #Make sure journal is not reading ahead of...
Dramoor/Razor-Enhanced-Scripts
Mining.py
Mining.py
py
2,877
python
en
code
6
github-code
1
28357143583
from rest_framework import mixins, viewsets from order.models import Order from order.serializers import OrderSerializer from order.utils import check_qualification, check_qty class OrderViewSet(mixins.CreateModelMixin, mixins.ListModelMixin, mixins.DestroyModelMixin, ...
menghuil/excercise_project_1
dashboard/order/views.py
views.py
py
666
python
en
code
0
github-code
1
28567418275
#!/usr/bin/env python3 # -*- coding: utf-8 -*- "Running jobs on all TaskCacheList" from multiprocessing import Process, Pipe from multiprocessing.connection import Connection from typing import ( Dict, Callable, List, Optional, Set, Union, Any, Iterator, Tuple, AsyncIterato...
depixusgenome/trackanalysis
src/peakcalling/model/_jobs.py
_jobs.py
py
12,033
python
en
code
0
github-code
1
19587087222
import pathlib from pydo import * this_dir = pathlib.Path(__file__).parent package = { 'requires': ['gstreamer'], 'sysroot_debs': ['libi2c-dev'], 'root_debs': [], 'target': this_dir / 'piroverd.tar.gz', 'install': ['{chroot} {stage} /bin/systemctl reenable piroverd.service'], } from ... imp...
ali1234/rpi-ramdisk
packages/piroverd/__init__.py
__init__.py
py
1,831
python
en
code
79
github-code
1
7585509733
from .forms import UsersProfile_CreationForm, UsersProfile_ChangeForm from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import UsersProfile_Model @admin.register(UsersProfile_Model) class UserProfile_Admin(UserAdmin): # forms and model to use model = UsersProfile_M...
withrvr/1Link
UsersProfile_App/admin.py
admin.py
py
1,248
python
en
code
5
github-code
1
5710224655
# @Time : 2020/2/29 9:38 # @Author : Xylia_Yang # @Description : from functools import cmp_to_key class Solution: def PrintMinNumber(self, numbers): """ sort的key指向一个item到key的映射,这个映射内容可以是自定义的一个排序方式,默认返回 升序排列 """ numbers.sort(key=cmp_to_key(self.compare)) res='' ...
XyliaYang/Leetcode_Record
python_version/Interview45.py
Interview45.py
py
979
python
zh
code
1
github-code
1
36948236931
# -*- utf-8 -*- # author : joelonglin import sys import tensorflow as tf tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) import os os.environ["CUDA_VISIBLE_DEVICES"] = "2" cl = tf.app.flags # reload_model = 'logs/btc_eth/Dec_25_17:27:07_2019' reload_model = '' cl.DEFINE_string('reload_model' ,reload_m...
WuYunjin/SIGIR-2020-FINIR-Competition
stage1/deepstate/run_deep_state.py
run_deep_state.py
py
3,546
python
en
code
2
github-code
1
8524034419
import pygame as pg def reveal_solution(screen, nbr_cases_x, nbr_cases_y, solution, images): # Fonction de révélation de toutes les cases for k in range(nbr_cases_y): for t in range(nbr_cases_x): screen.blit(images[solution[k][t]], (22*t, 22*k)) def reveal_case(screen, nbr_cases_x, nbr_case...
RaphaelRoumat/mini-jeux
manipulation_case.py
manipulation_case.py
py
3,874
python
fr
code
0
github-code
1
1829974800
import ROOT #ROOT.gStyle.SetOptStat(0) #ROOT.gStyle.SetOptFit(0) ROOT.gROOT.SetBatch(ROOT.kTRUE) ROOT.gStyle.SetLabelFont(42,"xyz") ROOT.gStyle.SetLabelSize(0.05,"xyz") #ROOT.gStyle.SetTitleFont(42) ROOT.gStyle.SetTitleFont(42,"xyz") ROOT.gStyle.SetTitleFont(42,"t") #ROOT.gStyle.SetTitleSize(0.05) ROOT.gStyle.SetTitleS...
kdipetri/BNL_AC_LGADs
util/pos_res.py
pos_res.py
py
3,388
python
en
code
0
github-code
1
870016117
#use 1 while loop and 3 for loops #4 spaces : 1 hash #3 spaces : 3 hashes #2 spaces : 5 hashes #1 space : 7 hashes #0 spaces : 9 hashes #Need to do #Get number of rows for the tree rows = eval(input('How tall is your tree: ')) #Decrement spaces by 1 each time through the loop spaces = rows - 1 #Increment t...
aarontinn13/Winter-Quarter-History
Tutorial/Treeproject(While,For,If,Elif,Else).py
Treeproject(While,For,If,Elif,Else).py
py
956
python
en
code
0
github-code
1
11070186844
# Librerias de python from tkinter import * from tkinter import messagebox as MessageBox from io import open from tkinter import filedialog from tkinter.filedialog import asksaveasfile import os import re # Analizadores lexicos from Analizadores.AnalizadorLexicocss import * from Analizadores.AnalizadorLexicoJS import ...
solaresjuan98/OLC1_Proyecto1_201800496
interfaz.py
interfaz.py
py
6,913
python
es
code
0
github-code
1
26714123866
import json from os import path import requests import datetime today = datetime.datetime.now() ymd = (str(today)).split(' ')[0] file_name = f'rates--{ymd}.json' print((str(today)).split(' ')[0]) key = '664db39a8f01d144d3bda05cbcde2278' endpoint = 'http://data.fixer.io/api/latest' + '?access_key=' + key def files()...
denb11/HW_fixer_io
curenci/fixer_io.py
fixer_io.py
py
3,437
python
en
code
0
github-code
1
16895217753
import boto3 import botocore # import jsonschema import json import traceback import zipfile import os import hashlib from botocore.exceptions import ClientError, ParamValidationError from extutil import remove_none_attributes, account_context, ExtensionHandler, ext, \ current_epoch_time_usec_num, component_safe_...
cloudkommand/ses
config_set/lambda_function.py
lambda_function.py
py
14,041
python
en
code
0
github-code
1
8718672060
import os.path from collections import defaultdict import operator from datetime import datetime import matplotlib.pyplot as plt import numpy as np import math import sys sys.path.append('../') from util import read_auxiliary_file, create_dir ORG_TYPES = { 'mass_media': ['media', 'radio', 'newspaper', 'jyrnal', '...
irinfox/minor_langs_internet_analysis
domain_registration_stats.py
domain_registration_stats.py
py
25,405
python
en
code
0
github-code
1
43407965358
from django.shortcuts import render from django.views.generic import View from .models import Notification import time from django.http import JsonResponse from security.response import set_response_header from authentication.auth import check_authentication from user.method import get_user from .serialize import noti...
tpvt99/new-social-network-backend
noti/views.py
views.py
py
1,420
python
en
code
1
github-code
1
33490174588
#!/usr/bin/env python import logging import sys import os import gzip from argparse import ArgumentParser from threading import Thread from math import isnan from glob import glob import traceback from time import time import torch.cuda from typing import Dict, Set, Optional import numpy import pandas import csv from...
DeepRank/DeepRank-Mut
scripts/preprocess_bioprodict.py
preprocess_bioprodict.py
py
14,090
python
en
code
1
github-code
1
14118223074
from time import time import inspect import io import contextlib func_list = {} class timer_func: def __init__(self,func): self.func = func timer_func.count = 0 def __call__(self,*args,**kwargs): timer_func.count += 1 self.arguments = args start = time() ...
Ghadeer-Issa92/Assignment1
Task3.py
Task3.py
py
1,144
python
en
code
0
github-code
1
21075647228
from selenium import webdriver from selenium.webdriver import ActionChains from selenium.webdriver.common.actions.action_builder import ActionBuilder from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from time import sleep import threading from tkinter import * from tkinter i...
IanDs0/Teste
Teste_Python/whatsapp/Envio_Mensagem_com_Arquivo/mensagemArquivo.py
mensagemArquivo.py
py
2,406
python
en
code
0
github-code
1
70880912995
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # 多页抓取和二级页面抓取解析 import requests from bs4 import BeautifulSoup import json def start_request(url): r = requests.get(url) return r.content # 解析一级页面 def get_page(text): soup = BeautifulSoup(text, 'html.parser') movies = soup.find_all('div', class_ = 'info...
CHOPPERJJ/Python
LearningProject/Crawl/DoubanSpider_03.py
DoubanSpider_03.py
py
1,832
python
en
code
0
github-code
1
29484977191
from bush import entity NORTH, EAST, SOUTH, WEST = NORTHWEST, NORTHEAST, SOUTHEAST, SOUTHWEST = 1, 2, 4, 8 TYPE_EDGE = 0 TYPE_CORNER = 1 class BinaryAutotileGroup(entity.Entity): def __init__(self, tiles, neighbor_type): self.tiles = tiles self.check_type = neighbor_type self.generate() ...
JiffyRob/bush
autotile.py
autotile.py
py
2,118
python
en
code
0
github-code
1
8530364167
from random import randint com = randint(0, 10) print('Sou seu computador...') print('Acabei de pensar de um número entre 0 e 10') print('Será que você vai conseguir adivinhar qual foi?') acertou = False palpites = 0 while not acertou: jog = int(input('Qual é o seu palpite? ')) palpites += 1 if jog == com: ...
jabes-christian/Curso-Python
Python-Exercícios&Aulas/Ex058 - Jogo da Adivinhação v2.0.py
Ex058 - Jogo da Adivinhação v2.0.py
py
565
python
pt
code
0
github-code
1
39109996251
import pygame class Tear(pygame.sprite.Sprite): def __init__(self,player,direction): super().__init__() self.velocity = 15 self.image = pygame.image.load('assets/tear.png') self.image = pygame.transform.scale(self.image, (30, 30)) self.player = player self.rect = se...
bastvdn/PyBoi
projectiles/tear.py
tear.py
py
1,644
python
en
code
0
github-code
1
15847164167
# Author - Shivam Kapoor # This code is written as minimal as possible. # Github - https://github.com/ConanKapoor/Elliptic_Curve_Implementation.git # importing libraries from random import randint # Finding Inverse Modulo def inverse(prime, num): if num<0: num = num + prime for i in range(1, prime): ...
little-endian-0x01/Elliptic_Curve_Implementation
Modules/Encryption.py
Encryption.py
py
2,601
python
en
code
1
github-code
1
74978840354
# coding:utf-8 #1画像からネジを検出し、画像の中心座標を求める #2画像の中心座標から一定の幅を持つ四角形で画像をsaveする #以下の3か所に調べたいネジを含むファイル名、出力ファイル名を記載する #image = cv2.imread("imageCopy_M8-16_15b.png",0) #image3 = cv2.imread("imageCopy_M8-16_15b.png",1) #cv2.imwrite('imageCopy_M8-16_15b.png', image3[a:b,c:d]) import cv2 import matplotlib.pyplot as plt import...
tmichiro/git_hub_code
getImageCenter_and_CaptureImage2.py
getImageCenter_and_CaptureImage2.py
py
2,280
python
ja
code
0
github-code
1
8473212340
# test logging functions import dectools.dectools as dectools from print_buffer import print_buffer p = print_buffer() prnt = p.rint printed = p.rinted printed_lines = p.rinted_lines prnt("Testing logging with simple calls") @dectools.logging(output=prnt) def greetings(name='Charles'): """ Print a greeting. ""...
merriam/dectools
dectools/test/test_log.py
test_log.py
py
1,266
python
en
code
4
github-code
1
41646837
from plasTeX.Packages.color import latex2htmlcolor def test_color(): colors = [("1", "#FFFFFF"), ("0", "#000000"), ("0.4", "#666666"), ("1,0,1", "#FF00FF"), ("0.2,0,0.8", "#3300CC")] for (i, o) in colors: assert latex2htmlcolor(i) == o
plastex/plastex
unittests/Packages/color.py
color.py
py
310
python
en
code
240
github-code
1
32741071460
edad = 16 tiene_licencia = False if edad >= 18 and tiene_licencia == True: print ("Puedes conducir") elif edad < 18 and tiene_licencia == False: print ("No puedes conducir aún. Debes tener 18 años y contar con una licencia") elif edad >= 18 and tiene_licencia == False: print ("No puedes conducir. Necesitas...
Alfredurst/Visual-Studio-Code-Projects
PYTHON PROJECTS/OPERADORES DE COMPARACION.PY
OPERADORES DE COMPARACION.PY
py
1,085
python
es
code
1
github-code
1
41027401256
import copy import itertools import logging import os from pathlib import Path import html import boto3 import time import json import gradio import requests import base64 from urllib.parse import urljoin import gradio as gr import utils from aws_extension.auth_service.simple_cloud_auth import cloud_auth_manager fr...
awslabs/stable-diffusion-aws-extension
aws_extension/sagemaker_ui.py
sagemaker_ui.py
py
67,283
python
en
code
111
github-code
1
13762478550
# 프로그래머스 LV1 - 완주하지 못한 선수(Counter 활용) # https://programmers.co.kr/learn/courses/30/lessons/42576?language=python3 import collections def solution(participant, completion): answer = '' # 리턴할 값 answer ''' participant와 completion 길이의 차는 1이다. 이를 활용하기 위해 Counter 클래스를 활용하면 된다. participant와 completion 배열...
irishNoah/Algorithm-Study
Programmers(프로그래머스)/LV1/Python/해시/프로그래머스_LV1 _완주하지못한선수(Counter 활용).py
프로그래머스_LV1 _완주하지못한선수(Counter 활용).py
py
829
python
ko
code
4
github-code
1
3196914614
import gdal import os import sys import cv2 import numpy as np from PIL import Image from matplotlib import pyplot as plt from functools import reduce from MoreOne import Ui_Dialog from PyQt5.QtWidgets import QDialog, QFileDialog,QApplication from base_functions import drawMatchesKnn_cv2, save_matchedpoints_in_file ...
scrssys/agriculture_analyze
main.py
main.py
py
4,073
python
en
code
0
github-code
1
5599038888
#!/usr/bin/env python3 N = int(input()) Timer = [0] + list(map(int, input().split())) all = sum(Timer) dp = [] for i in range(N+1): dp.append([False] * (all+1)) dp[0][0] = True for i in range(1, N+1): for j in range(all+1): if dp[i-1][j]: dp[i][j] = True if j-Timer[i] >= 0: ...
yuu246/Atcoder_ABC
ABC/ABC204/D/main.py
main.py
py
467
python
en
code
0
github-code
1
43694506844
import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier from sklearn import metrics from sklearn.linear_model import LinearRegression from sklearn.linear_model import Ridge from sklearn.svm import ...
Jalbiti/DNAffinity
model.py
model.py
py
5,002
python
en
code
0
github-code
1
6216213571
import glob import os import numpy as np import cv2 import argparse parser = argparse.ArgumentParser(description='Preprocessing/Visualizing EGTEA Gaze+ gaze annotations') parser.add_argument('--txtfile', default='./gaze_data', help='path to txt annotations') parser.add_argument('--datapath', default='dataset', help...
faderani/egtea_gaze_preproc
main.py
main.py
py
7,577
python
en
code
0
github-code
1
72307566755
import asyncio import discord from discord import client from discord import message from discord.abc import GuildChannel from discord.ext import commands from discord.utils import get from discord_slash import SlashCommand import logging import json from pathlib import Path from datetime import datetime from threading...
Finnmccarthy/pastebot-py
bot.py
bot.py
py
4,472
python
en
code
0
github-code
1
19123288264
import scrapy class BestsellersSpider(scrapy.Spider): name = 'bestsellers' allowed_domains = ['www.glassesshop.com'] start_urls = ['http://www.glassesshop.com/bestsellers/'] def parse(self, response): for glass in response.xpath("//div[@id='product-lists']/div"): if glass.xpath("....
paulitstep/web_scraping
6_glasses_shop/glasses_shop/spiders/bestsellers.py
bestsellers.py
py
959
python
en
code
0
github-code
1
13501866067
from django.shortcuts import redirect from django.urls import path, re_path from .models import * from . import views app_name = 'survey' urlpatterns = [ path('', lambda request: redirect('survey:site_overview', Checklist.objects.filter(is_active=True).last().id), name='index'), re_path(r'^(?P<checkli...
sabekov-study/study-app
sabekov/survey/urls.py
urls.py
py
1,445
python
en
code
0
github-code
1
70763205474
from flask import Flask, jsonify, request, abort import json import os app = Flask(__name__) directory = "data" with open(os.path.join(directory, 'productos.json'), 'r') as f: productos = json.load(f) with open(os.path.join(directory, 'carrito.json'), 'r') as f: carritos_compra = json.load(f) with ...
cano2030/Commerce-App
new.py
new.py
py
9,747
python
es
code
0
github-code
1
33141889702
import os if not os.path.exists("coded"): os.makedirs("coded") import aubio filename = input("Enter the path to the audio file: ") win_s = 4096 hop_s = win_s // 2 samplerate = 0 pitch_o = aubio.pitch("default", win_s, hop_s, samplerate) pitch_o.set_unit("Hz") pitch_o.set_tolerance(0.8) total_frames = 0 decim...
Khonzuu/Triton
triton_detect.py
triton_detect.py
py
1,306
python
en
code
0
github-code
1
70647127713
# calculate collatz sequence for a user supplied number # print the sequence nicely, print the sequence size. start_str = input("Working with what number : ") start_int = int(start_str) count = 1 seq_int = start_int print("Here is the Collatz sequence starting at : ", start_str) print('{0:7d}, '.format(seq_int), e...
GuenterHummel/HailStorm
hailstorm/hailstorm.py
hailstorm.py
py
868
python
en
code
0
github-code
1
7837869318
# 2023711994_전효림_데이터사이언스 컴퓨팅_중간고사 대체 과제 # 롤체지지 https://lolchess.gg/leaderboards?region=kr&mode=ranked # 대상: 국가별 챌린저~그랜드마스터 순위, 플레이어id, 티어, 승률, 게임수, 이긴횟수, 순위 방어 횟수 등 import requests from bs4 import BeautifulSoup import pandas as pd from selenium import webdriver from datetime import datetime import os import...
jeonhyolim/Project
main_userchoice_webcrawler.py
main_userchoice_webcrawler.py
py
7,231
python
ko
code
1
github-code
1
22193051528
from telebot.types import Message from loader import bot from config_data.config import DEFAULT_COMMANDS @bot.message_handler(commands=["start"]) def bot_start(message: Message) -> None: text = f"Привет, {message.from_user.full_name}! Я бот для поиска подходящих билетов. " \ f"Выберите команду:\n" ...
AgGashv/Telegram-bot
handlers/default_handlers/start.py
start.py
py
484
python
en
code
0
github-code
1
18038408493
from django.shortcuts import get_object_or_404 from rest_framework import viewsets from rest_framework.permissions import IsAuthenticated from .permissions import IsAuthorOrReadOnly from .serializer import CommentSerializer, PostSerializer, GroupSerializer from posts.models import Post, Group class PostViewSet(views...
bour89/api_yatube
yatube_api/api/views.py
views.py
py
1,124
python
en
code
0
github-code
1
32583421410
import sqlalchemy.exc from database import get_db, run_transaction from sqlalchemy.engine import Engine from fastapi import APIRouter from schemas import Ticket, Survey from fastapi import Depends ticket_router = APIRouter( prefix="/tickets", tags=['tickets'] ) @ticket_router.get("/get-tickets/{user_id}") d...
CSchelbNE/CS5200-fengwLavrishinASchelbC
backend/ticket_operations.py
ticket_operations.py
py
4,510
python
en
code
0
github-code
1
72873057634
from flask import jsonify, g from app import db from app.api import bp from app.api.auth import basic_auth, token_auth from app.models import WordSubject, Word, UserWord from flask import request from functools import cmp_to_key def words_subject_compare(x, y): # 已经完全背完了 if x['complete_ratio'] == 100: ...
HaoyueQiu/WordsInLife
back-end/app/api/words.py
words.py
py
3,822
python
en
code
1
github-code
1
38105063441
import numpy as np import matplotlib.pyplot as plt #(a) def multivariate_gaussian(X, mu, sigma2): d = 1 if isinstance(X, float) or isinstance(X, int) else X.shape[0] coef = 1 / np.power(np.linalg.det(sigma2), 0.5) / np.power(2*np.pi, d/2) e = np.exp(-0.5*np.dot(np.dot((X - mu).T, np.linalg.pinv(sigma2)), ...
hongxin-y/EECS545-Homeworks
HW4/prob4.py
prob4.py
py
2,363
python
en
code
2
github-code
1
20174214776
#!/usr/bin/env python3 import datetime import json import logging import pytz import requests import sys from errors import SolarLogCommunicationError from solarlog_reading import SolarLogReading class SolarLogReader: def __init__(self, ip, timezone, port=80): self.logger = logging.getLogger(self.__clas...
logreposit/solarlog-reader-service
src/solarlog_reader.py
solarlog_reader.py
py
3,553
python
en
code
0
github-code
1
839632565
T = int(10) for tc in range(1, T + 1): t = input() result = [] matrix = [] for _ in range(100): tmp = list(map(int, input().split())) result.append(sum(tmp)) matrix.append(tmp) for i in range(100): t_sum = 0 dae_1 = 0 dae_2 = 0 for j in range(1...
smileostrich/algorithm-practice
problemSolving/SWEA/D3/1209.py
1209.py
py
605
python
en
code
0
github-code
1
7125422899
from django.contrib import admin from django.urls import path from . import views from .views import * urlpatterns = [ path('',HomeView.as_view(),name='home'), path('detail/<int:pk>',NewsDetailView.as_view(),name="news_detail"), path('addnews/',AddNewsView.as_view(),name="add_news"), path('detail/edit/...
tienduonggia/News-Website
TinTuc/urls.py
urls.py
py
741
python
en
code
0
github-code
1
1835892975
import vk import json import re from django.conf import settings from vk_data_grub.models import VkGroups, Events token = settings.ACCESS_TOKEN session = vk.Session(access_token={token}) api = vk.API(session, v='5.3', lang='ru', timeout=10) api_5_103 = vk.API(session, v='5.53', lang='ru', timeout=10) def _get_tour...
mike62polonskiy/vivaldi
src/utils/vk_events.py
vk_events.py
py
4,106
python
en
code
0
github-code
1
19741485156
# -*- coding: utf-8 -*- """ Spyder Editor This is a cointegration script file. """ import numpy as np import pandas as pd import tushare as ta from statsmodels.tsa.stattools import adfuller start = '2020-01-01' end = '2022-01-01' SZ000725 = '000725' SH600026 = '600026' df_SZ000725 = ta.get_hist_data(SZ000725, start...
simple321vip/violin-trade
strategy/spreads_2.py
spreads_2.py
py
1,626
python
en
code
1
github-code
1
21143636979
""" The assistant for brain of Sara. Created on 19.01.2017 @author: Ruslan Dolovanyuk """ import logging import os import time import configs from extensions import birthday from extensions import calendar from extensions import events from extensions import notes from extensions import presser from extensions im...
DollaR84/SARA
assist.py
assist.py
py
4,193
python
en
code
2
github-code
1
10009309944
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 25 21:59:10 2021 @author: lin.yang """ import os current_path = os.getcwd()+'/' import sys sys.path.append(current_path) import numpy as np import math import matplotlib.pyplot as plt import myInput import datetime import multiprocessing as mp cla...
Linwitness/VECTOR
PACKAGE_MP_Vertex.py
PACKAGE_MP_Vertex.py
py
19,111
python
en
code
0
github-code
1
30523473116
# A group of functions to do common data organization tasks ### Functions ### # makeFilePath: Make a string for a file path indexed by today's date. If the path does not exist, create it # saveData: Given an array of data and a list of variable names corresponding to columns in the array, save the data # (an...
cphenicie/laserdaq_chris
dataShortcuts.py
dataShortcuts.py
py
2,549
python
en
code
0
github-code
1
27794721154
import os from scipy.stats import pearsonr import matplotlib.pyplot as plt import numpy as np import pandas as pd cwd='staining of induced aggregates\\' BIP=r'BIP/PFF/tif' Congo=r'Congo/PFF/tif' HSP=r'HSP60/PFF/tif' pasyn=r'pasyn/PFF/tif' #%% Loop through samples and find PCC scores data={} for sample in [BIP, Cong...
AlexanderSvan/PCC-colocalization-for-images
_analysisn_N_plotting.py
_analysisn_N_plotting.py
py
2,095
python
en
code
0
github-code
1
26666478666
from __future__ import print_function from mxnet import ndarray as nd from mxnet import autograd from mxnet import gluon from utils import accuracy, evaluate_accuracy, sgd import matplotlib.pyplot as plt def transform(data, label): return data.astype('float32') / 255, label.astype('float32') mnist_train = gluon.d...
xcszbdnl/Toy
Gluon_Code/simple_mlp_2.py
simple_mlp_2.py
py
2,491
python
en
code
1
github-code
1
22092028670
for i in range(int(input())): ent = int(input()) soma = 0 for x in range(1, ent): if ent % x == 0: soma += x if ent == soma: print(f'{ent} eh perfeito') else: print(f'{ent} nao eh perfeito')
JoaoAssalim/Beecrowd-Solution
Python/1164.py
1164.py
py
248
python
en
code
5
github-code
1
13044173228
import os import time import subprocess import sys import cmdln import components def run_test(component, args): comp = components.comp_names[component] currdir = os.getcwd() testcmd = ['pytest', '-vv'] + list(args) output_status = 0 if sys.version_info.major >= 3 and not comp.py3k_clean: ...
iotile/coretools
scripts/test.py
test.py
py
2,487
python
en
code
14
github-code
1
38246177984
forest = { "id": "forest", "name": "🌳 The Forest", "description": "A dense forest filled with wild animals and mythical creatures. Many adventurers come to test their mettle against the beasts that dwell within.", "min_level_requirement": 1, "mini_boss_level_requirement": 5, "boss_level_requi...
AceAltair13/AdventureRPG
data/regions/forest.py
forest.py
py
2,662
python
en
code
2
github-code
1