seq_id
string
text
string
repo_name
string
sub_path
string
file_name
string
file_ext
string
file_size_in_byte
int64
program_lang
string
lang
string
doc_type
string
stars
int64
dataset
string
pt
string
api
list
8245327650
from pymongo import MongoClient from fastapi import HTTPException from datetime import datetime class ModekenSystemManager: def __init__(self, username, password): self.client = MongoClient(f'mongodb://{username}:{password}@db.modeken-system.com:27017') self.db = self.client['modeken-system'] ...
tochiman/modeken-ticket-system
backend/src/mongo.py
mongo.py
py
5,068
python
en
code
0
github-code
6
[ { "api_name": "pymongo.MongoClient", "line_number": 8, "usage_type": "call" }, { "api_name": "fastapi.HTTPException", "line_number": 27, "usage_type": "call" }, { "api_name": "fastapi.HTTPException", "line_number": 32, "usage_type": "call" }, { "api_name": "fastap...
8366348060
# /usr/bin/env python # -*- coding:utf-8 -*- import sys import math from dataclasses import dataclass from functools import reduce from functools import wraps """ 迭代器 迭代是Python最强大的功能之一,是访问集合元素的一种方式。 迭代器是一个可以记住遍历的位置的对象。 迭代器对象从集合的第一个元素开始访问,直到所有的元素被访问完结束。迭代器只能往前不会后退 迭代器有两个基本的方法: iter() 创建迭代器 ...
renxiaowei-1991/pythonLearn
a01PythonLearn/package/b01PythonLearn/c23ClassHighLearn.py
c23ClassHighLearn.py
py
24,298
python
zh
code
0
github-code
6
[ { "api_name": "math.sqrt", "line_number": 314, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 361, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 366, "usage_type": "call" }, { "api_name": "functools.reduce", ...
20972559660
import torch from tools.image import transforms, cv from tools.image.index_map import default_map from tools import tensor def to_rgb(hex): return ((hex >> 16) & 255, (hex >> 8) & 255, (hex >> 0) & 255) def draw_box(image, box, scale=1.0, name=None, confidence=None, thickness=2, color=(255, 0, 0), text_color=...
oliver-batchelor/detection
detection/display.py
display.py
py
3,548
python
en
code
0
github-code
6
[ { "api_name": "tools.image.cv.rectangle", "line_number": 15, "usage_type": "call" }, { "api_name": "tools.image.cv", "line_number": 15, "usage_type": "name" }, { "api_name": "tools.image.cv.putText", "line_number": 18, "usage_type": "call" }, { "api_name": "tools....
14242354466
#基类,将原生的方法都封装一遍,让继承的类去调用 import csv import logging import os from time import sleep, strftime from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.by import By from baseView.desired_caps import appium_desired class BaseView(object): def __init__(self,driver): #初始化方法...
XiaoChang97/maishou_testProject
baseView/baseView.py
baseView.py
py
5,558
python
zh
code
0
github-code
6
[ { "api_name": "selenium.webdriver.common.by.By.ID", "line_number": 32, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 32, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.ID", "line_number": 33, "usage_ty...
32381382238
import string import os import random import bs4 from urllib import request url = "http://reddit.com" urlPage = request.urlopen(url).read() soup = bs4.BeautifulSoup(urlPage, "html.parser") img_list = [] for img in soup.find_all('img'): img_item = str(img.get('src')).split('//') img_list.append(img_item[1]) #print...
techreign/Webscraping
ImageScraper.py
ImageScraper.py
py
739
python
en
code
0
github-code
6
[ { "api_name": "urllib.request.urlopen", "line_number": 8, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 8, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "string.ascii_le...
10502966682
from rest_framework.test import APITestCase from ...services.notification_service import NotificationService from django.urls import reverse class TestNotificationAPI(APITestCase): def setUp(self): self.payload = { "title": "Winter discount sale started", "description": "Enter cou...
anojkr/onboarding-project
push_notification/apps/notification/tests/unit/test_notification.py
test_notification.py
py
1,381
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.test.APITestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "services.notification_service.NotificationService", "line_number": 13, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 14, "usage_type": "...
43447073770
import sys, re from argparse import ArgumentParser parser = ArgumentParser(description = 'Calculate the percentage of each nucleotide in the sequence') parser.add_argument("-s", "--seq", type = str, required = True, help = "Input sequence") args = parser.parse_args() seq = seq.upper() if re.search('^[ACGTU]+$', args....
stepsnap/git_HandsOn
Percentage.py
Percentage.py
py
1,350
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" }, { "api_name": "re.search", "line_number": 9, "usage_type": "call" } ]
27520740533
import os import datetime import netCDF4 def handle_netcdf_scheme_wrf(var_names, file_name, run, model, st): # try: if os.path.exists(file_name): data_list = [] file = netCDF4.Dataset(file_name) var1 = file.variables[var_names[0]][:] var2 = file.variabl...
RevertonLuis/Ensemble
lib/handle_netcdfs.py
handle_netcdfs.py
py
2,022
python
en
code
1
github-code
6
[ { "api_name": "os.path.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "netCDF4.Dataset", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.strptim...
200126759
import torch import torchvision.transforms as transforms from PIL import Image from model import LeNet device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") def main(): transform = transforms.Compose( [transforms.Resize((32, 32)), transforms.ToTensor(), transforms.Nor...
ChengZhangX/Deeplearning-for-cv
LetNet model/predict.py
predict.py
py
893
python
en
code
0
github-code
6
[ { "api_name": "torch.device", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torchvision.transfo...
20164701509
import cv2 import mediapipe as mp from handLandmarksDefine import * from objectCoords import * import time import numpy as np import math import serial start_time = 0 end_time = 0 try: arduino = serial.Serial('COM3', 9600) except serial.serialutil.SerialException: print("Arduino not connected") # lm = landm...
vladpasat/HandFlow0
handTrackingModule.py
handTrackingModule.py
py
16,607
python
en
code
0
github-code
6
[ { "api_name": "serial.Serial", "line_number": 14, "usage_type": "call" }, { "api_name": "serial.serialutil", "line_number": 15, "usage_type": "attribute" }, { "api_name": "mediapipe.solutions", "line_number": 29, "usage_type": "attribute" }, { "api_name": "mediapi...
43243820127
from PyQt5.QtCore import QThread, pyqtSignal from simplekml import Kml, Snippet, Types from math import radians, cos, sin, asin, degrees, atan2 import os class PlotFiles(QThread): progressSignal = pyqtSignal(int) threadMessage = pyqtSignal(str) def __init__(self, results, issilist, google, gps): ...
stephenmhall/Coordinator_parser
plotfile.py
plotfile.py
py
5,066
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtCore.QThread", "line_number": 7, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 8, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 9, "usage_type": "call" }, { "api_name": "PyQ...
26247964346
import six import webob.exc from oslo_log import log from delfin.i18n import _ LOG = log.getLogger(__name__) class ConvertedException(webob.exc.WSGIHTTPException): def __init__(self, exception): self.code = exception.code self.title = '' self.explanation = exception.msg self.err...
sodafoundation/delfin
delfin/exception.py
exception.py
py
8,827
python
en
code
201
github-code
6
[ { "api_name": "oslo_log.log.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "oslo_log.log", "line_number": 8, "usage_type": "name" }, { "api_name": "webob.exc.exc", "line_number": 11, "usage_type": "attribute" }, { "api_name": "webob.exc", ...
6250184169
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 19 12:46:12 2018 @author: CTF Team """ from PyQt5 import uic,QtCore, QtGui, QtWidgets from PyQt5.QtCore import QSize, Qt import CompanyTaxUI import sys import pandas as pd import csv import numpy as np class ApplicationWindow(QtWidgets.QMainWindow)...
larry2967/academic-projects
taxcalculator/CompanyTaxSavingsApp.py
CompanyTaxSavingsApp.py
py
14,683
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 16, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 16, "usage_type": "name" }, { "api_name": "CompanyTaxUI.Ui_MainWindow", "line_number": 19, "usage_type": "call" }, { "api_n...
23722748410
from django.urls import path from gisapp.views import HomeView, county_datasets, point_datasets from gisapp.api.views import ProvincesListAPIView,ProvincesDetailAPIView urlpatterns = [ path('', HomeView.as_view(), name='home'), path('county_data/', county_datasets, name = 'county'), path('incidence_data/'...
shwky56/geo-django
gisapp/urls.py
urls.py
py
506
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "gisapp.views.HomeView.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "gisapp.views.HomeView", "line_number": 7, "usage_type": "name" }, { "api_name": "dja...
42543026750
"""Utility related functions. """ import sys import os import ctypes import pygame from .window import * def quit(): """Shuts down ag_py the correct way.""" destroy_window() pygame.quit() sys.exit() def is_admin() -> bool: """Determines if the user is running your game as admin.""" try: ...
trypolis464/ag_py
agpy/utils.py
utils.py
py
951
python
en
code
0
github-code
6
[ { "api_name": "pygame.quit", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 17, "usage_type": "call" }, { "api_name": "os.getuid", "line_number": 23, "usage_type": "call" }, { "api_name": "ctypes.windll.shell32.IsUserAnAdmin", ...
19528118390
__author__ = 'zhaicao' import sys from PyQt5.QtWidgets import (QWidget, QPushButton, QLineEdit, QInputDialog, QApplication, QColorDialog, QFrame, QVBoxLayout, QSizePolicy, QLabel, QFontDialog, QTextEdit, QAction, QFileDialog ,QMainWindow) from PyQt5.QtGui import QColor, QIcon #通过输入框改变文字 ...
zhaicao/pythonWorkspace
Pyqt5Practice/demo_8.py
demo_8.py
py
3,852
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 10, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QColor", "line_number": 16, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QPushButton", "line_number": 18, "usage_type": "call" }, { "api_name":...
9518060798
from ast import Lambda from functools import reduce l2=[1,2,3,4,5,6,7,8,9] l=[1,2,3,4,5,6,7,8,9,10] a=list(filter(lambda x : x>5,l)) print (a) b=list(map(pow,a,l2)) print(b) sum=(reduce(lambda x, y: x + y,b)) print(sum)
SouvikPaul2000/Souvik-paul-2
Basic code/MapFilterLamdaReduce.py
MapFilterLamdaReduce.py
py
222
python
en
code
0
github-code
6
[ { "api_name": "functools.reduce", "line_number": 11, "usage_type": "call" } ]
41234449235
# create by andy at 2022/4/21 # reference: import torchvision from torch.utils.tensorboard import SummaryWriter from torchvision import transforms from torch.utils.data import DataLoader dataset_transform = transforms.Compose([ transforms.ToTensor(), ]) train_set = torchvision.datasets.CIFAR10(root="./dataset",...
beishangongzi/study_torch
p10_dataset/dataset_download.py
dataset_download.py
py
1,327
python
en
code
0
github-code
6
[ { "api_name": "torchvision.transforms.Compose", "line_number": 9, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 9, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 10, "usage_type": "call" }, { ...
17459989896
from flask import current_app, render_template, make_response, session from ecom.datastore import db,redis_store from ecom.exceptions import ServiceUnavailableException from ecom.models import Item, Cart, Account import json import razorpay from ecom.utils import general_util class PaymentManager(): @staticmethod...
ubamax/esocial-app
ecom/managers/payment_manager.py
payment_manager.py
py
3,473
python
en
code
0
github-code
6
[ { "api_name": "ecom.utils.general_util.get_category_map", "line_number": 13, "usage_type": "call" }, { "api_name": "ecom.utils.general_util", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.session", "line_number": 15, "usage_type": "name" }, { "ap...
11038610201
# -*- coding: utf-8 -*- """ Created on Wed Sep 19 14:24:54 2018 @author: henyd """ from sklearn import tree from sklearn import svm import numpy as np from chatterbot import ChatBot from chatterbot.trainers import ListTrainer def get_response(usrText): bot = ChatBot('Couns', storage_adapter='chat...
henydave/career-counselling-chatbot
chatbot_final2.py
chatbot_final2.py
py
2,211
python
en
code
1
github-code
6
[ { "api_name": "chatterbot.ChatBot", "line_number": 13, "usage_type": "call" }, { "api_name": "chatterbot.trainers.ListTrainer", "line_number": 25, "usage_type": "argument" }, { "api_name": "sklearn.tree.DecisionTreeClassifier", "line_number": 44, "usage_type": "call" },...
10966117387
import os import clip import torch.nn as nn from datasets import Action_DATASETS from torch.utils.data import DataLoader from tqdm import tqdm import wandb import argparse import shutil from pathlib import Path import yaml from dotmap import DotMap import pprint import numpy from modules.Visual_Prompt imp...
Lycus99/SDA-CLIP
test.py
test.py
py
11,801
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 27, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 27, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 36, "usage_type": "attribute" }, { "api_name": "torch.nn", "li...
39480165735
import numpy as np import scipy.sparse as sp agg1_index = np.load("../trace/agg1_index.npy") agg1_adj = np.load("../trace/agg1_adj.npy") input_feature = np.load("../trace/feat1.npy") coo_row = agg1_index[0] coo_col = agg1_index[1] num_nodes = input_feature.shape[0] """ # Use adjacency matrix to generate norm num_nod...
zhang677/SparseAcc
train/dgl/check.py
check.py
py
4,271
python
en
code
0
github-code
6
[ { "api_name": "numpy.load", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 7, "usage_type": "call" }, { "api_name": "scipy.sparse.coo_matrix", "line_num...
23589518050
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import mne fname ="oddball_example_small-fif.gz" raw = mne.io.read_raw_fif(fname) raw = mne.io.read_raw_fif(fname,preload=True) raw.plot_psd(); raw.plot(); #%%data in 20 different ica components ica = mne.preprocessing.ICA(n_co...
Sarah436/EEG_Control_Drone
EEG_Drone.py
EEG_Drone.py
py
1,304
python
en
code
0
github-code
6
[ { "api_name": "mne.io.read_raw_fif", "line_number": 9, "usage_type": "call" }, { "api_name": "mne.io", "line_number": 9, "usage_type": "attribute" }, { "api_name": "mne.io.read_raw_fif", "line_number": 10, "usage_type": "call" }, { "api_name": "mne.io", "line_...
27591581690
import logging from pymongo import MongoClient from src.utils import Singleton logger = logging.getLogger(__name__) class DBConnection(metaclass=Singleton): def __init__(self, db_settings): self.db_settings = db_settings self.client = MongoClient( host=db_settings['host'], ...
andre1393/fashion-mnist
src/database/mongo_connection.py
mongo_connection.py
py
1,388
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "src.utils.Singleton", "line_number": 9, "usage_type": "name" }, { "api_name": "pymongo.MongoClient", "line_number": 13, "usage_type": "call" } ]
27278546383
from cProfile import label from genericpath import exists from math import ceil import os import random import numpy as np import argparse import time import torch import torch.nn as nn import torch.nn.functional as F from torch import optim, autograd from matplotlib import pyplot as plt import seaborn as sns from mpl_...
JiantingFeng/Deep-Ritz-PDE-Solver
new_train.py
new_train.py
py
6,408
python
en
code
3
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "seaborn.set_style", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 48, "usage_type": "call" }, { "api_name": "os.path", ...
22989091213
#!/usr/bin/python # -*- coding: utf-8 -*- # utf-8 中文编码 u""" >>> m=encrypt('123456789','1'*16) >>> m '34430c0e47da2207d0028e778c186d55ba4c1fb1528ee06b09a6856ddf8a9ced' >>> decrypt('123456789',m) '1111111111111111' m = encrypt_verify('123','0123456789') print m print decrypt_verify('123',m) """ from Crypto.Cipher im...
GameXG/shadowsocks_admin
mycrypto.py
mycrypto.py
py
2,044
python
zh
code
175
github-code
6
[ { "api_name": "hashlib.md5", "line_number": 29, "usage_type": "call" }, { "api_name": "Crypto.Cipher.AES.new", "line_number": 33, "usage_type": "call" }, { "api_name": "Crypto.Cipher.AES", "line_number": 33, "usage_type": "name" }, { "api_name": "Crypto.Cipher.AES...
74130707068
import datetime def get_next_friday(some_date: datetime.datetime, if_friday_same=True): if if_friday_same: # if a Friday, then same day return some_date + datetime.timedelta((4 - some_date.weekday()) % 7) else: # if a Friday, then next one return some_date + datetime.timedelta((...
alex-muci/small-projects
snippets/five_min_test.py
five_min_test.py
py
748
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime", "line_number": 4, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.da...
44091100190
import os import os.path import numpy as np from PIL import Image from PIL import ImageDraw from PIL import ImageFont _logo_fonts = { "Arial" : ImageFont.truetype(os.path.abspath(os.path.dirname(__file__))+"/arial.ttf", 200), "ArialBold" : ImageFont.truetype(os.path.abspath(os.path.dirname(__file__...
jisraeli/DeepBind
code/libs/deepity/deepity/tape2logo.py
tape2logo.py
py
13,154
python
en
code
85
github-code
6
[ { "api_name": "PIL.ImageFont.truetype", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.ImageFont", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line...
5897393360
from fastapi import FastAPI, HTTPException from model import Todo from fastapi.middleware.cors import CORSMiddleware from database import( fetch_all_todos, fetch_one_todo, create_todo, remove_todo, patch_todo ) app = FastAPI() origins = [ "https://localhost:3000", "http://...
MdAhosanHabib/Redis-Kafka-FastAPI-React
main.py
main.py
py
1,538
python
en
code
0
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 13, "usage_type": "call" }, { "api_name": "fastapi.middleware.cors.CORSMiddleware", "line_number": 21, "usage_type": "argument" }, { "api_name": "database.fetch_all_todos", "line_number": 34, "usage_type": "call" }, { ...
15169928273
from fastapi import Depends, Request from fastapi_utils.cbv import cbv from fastapi_utils.inferring_router import InferringRouter from sqlalchemy import select from sqlalchemy.ext.asyncio import AsyncSession from admins.models import TemplateField, Template from permissions import manage_helpdesk from admins.schemas i...
AlexeyShakov/helpdesk_fast_api
src/admins/endpoints/template_fields.py
template_fields.py
py
2,294
python
en
code
0
github-code
6
[ { "api_name": "fastapi_utils.inferring_router.InferringRouter", "line_number": 13, "usage_type": "call" }, { "api_name": "crud_handler.BaseHandler", "line_number": 18, "usage_type": "name" }, { "api_name": "sqlalchemy.ext.asyncio.AsyncSession", "line_number": 19, "usage_t...
24354887610
import csv import requests import xml.etree.ElementTree as ET def parseXML(xmlfile): tree = ET.parse(xmlfile) root = tree.getroot() orderitems = [] for item in root.findall('./AddOrder'): orders = {} for child in item: orders[child.tag] = child.text.encode('utf8') ...
actioncamen13/Orderbook-submission
csv_convert.py
csv_convert.py
py
1,032
python
en
code
0
github-code
6
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 6, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 6, "usage_type": "name" }, { "api_name": "csv.DictWriter", "line_number": 32, "usage_type": "call" } ]
74849030268
""" @author: Tobias Carryer """ import numpy as np import pandas as pd from pyts.image import GASF, GADF, MTF from splitting_data import get_subject_data from matplotlib import pyplot as plt def create_gasf_gadf_mtf_compound_images(observations, image_size=128): """ Designed to take observations of time seri...
TobCar/delirium
demo_compound_images.py
demo_compound_images.py
py
3,064
python
en
code
0
github-code
6
[ { "api_name": "pyts.image.GASF", "line_number": 27, "usage_type": "call" }, { "api_name": "pyts.image.GADF", "line_number": 28, "usage_type": "call" }, { "api_name": "pyts.image.MTF", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.stack", "lin...
23121624875
from flask import render_template, flash from app.giturl_class.url_form import UrlForm from app.giturl_class import bp import json @bp.route('/index', methods = ['GET', 'POST']) def urlPage(): form = UrlForm() citation = None installation = None invocation = None description = None if form.vali...
quiteaniceguy/SM2KG-WebApp
app/giturl_class/routes.py
routes.py
py
1,182
python
en
code
0
github-code
6
[ { "api_name": "app.giturl_class.url_form.UrlForm", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.flash", "line_number": 14, "usage_type": "call" }, { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.render_t...
19990844115
from django.conf.urls import url from . import views, verifycode urlpatterns = [ url(r'^$', views.index), # 生成验证码 url(r'^verifycode/$', verifycode.Verifycode), # 输入验证码试验 url(r'^verifycodeinput/$', views.verifycodeinput), url(r'^verifycodecheck/$', views.checkcode), # 反向解析(针对的是超链接,千万别弄错) ...
Evanavevan/Django_Project
Project3/myApp/urls.py
urls.py
py
700
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "django.c...
19065408732
from confluent_kafka import Consumer import redis import time from datetime import datetime ################ r = redis.Redis(host='localhost', port=6379) c=Consumer({'bootstrap.servers':'localhost:9092','group.id':'python-consumer','auto.offset.reset':'earliest'}) print('Available topics to consume: ', c.list_topics(...
Failedvixo/SD-Tarea2
kafka_consumer.py
kafka_consumer.py
py
857
python
en
code
0
github-code
6
[ { "api_name": "redis.Redis", "line_number": 6, "usage_type": "call" }, { "api_name": "confluent_kafka.Consumer", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.dat...
14205921043
import collections class Node: def __init__(self, value): self.value = value self.neighbours = [] def make_graph(n_of_nodes, edges): graph = [] for i in range(n_of_nodes): node = Node(i+1) graph.append(node) for first_node, second_node in edges: ...
jdalbosco/hackerrank
preparation-kits/one-week/d6-mock_test.py
d6-mock_test.py
py
1,287
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 25, "usage_type": "call" } ]
13922774332
import requests from authid_agent_client.listeners.request_listener import RequestListener DEFAULT_HOST = "localhost" DEFAULT_PORT = 8080 API_PATH = "/api/v0.0.1/" IDS_PATH = API_PATH + "ids/" PROCESSOR_KEYS_PATH = API_PATH + "processorKeys/" REQUESTS_PATH = API_PATH + "requests/" ADDRESSES_PATH = API_PATH + "addres...
OnePair/authid-agent-client-py
authid_agent_client/authid_agent_client.py
authid_agent_client.py
py
4,618
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 42, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 49, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 57, "usage_type": "call" }, { "api_name": "requests.post", "line_nu...
26624814566
# # SERMEPA / ServiRed payments module for Satchmo # # Author: Michal Salaban <michal (at) salaban.info> # with a great help of Fluendo S.A., Barcelona # # Based on "Guia de comercios TPV Virtual SIS" ver. 5.18, 15/11/2008, SERMEPA # For more information about integration look at http://www.sermepa.es/ # # ...
dokterbob/satchmo
satchmo/apps/payment/modules/sermepa/views.py
views.py
py
8,365
python
en
code
30
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 34, "usage_type": "call" }, { "api_name": "payment.views.payship.base_pay_ship_info", "line_number": 37, "usage_type": "call" }, { "api_name": "payment.views.payship", "line_number": 37, "usage_type": "name" }, { "...
39122527665
import yaml, tempfile, os, libUi import PinshCmd, ConfigField from bombardier_core.static_data import OK, FAIL from SystemStateSingleton import SystemState system_state = SystemState() class CreateType(PinshCmd.PinshCmd): '''A thing that can be created.''' def __init__(self, name, help_text): PinshCmd....
psbanka/bombardier
cli/lib/Create.py
Create.py
py
3,460
python
en
code
1
github-code
6
[ { "api_name": "SystemStateSingleton.SystemState", "line_number": 5, "usage_type": "call" }, { "api_name": "PinshCmd.PinshCmd", "line_number": 7, "usage_type": "attribute" }, { "api_name": "PinshCmd.PinshCmd.__init__", "line_number": 10, "usage_type": "call" }, { "...
37108029587
"""2 question 6 sprint""" import json import logging logging.basicConfig(filename='app.log', filemode='w', format='%(name)s - %(levelname)s - %(message)s') def parse_user(output_file, *input_files): def get_name(dct): if "name" in dct and dct["name"] not in list(map(lambda x: x["name"], users_list)): ...
Misha86/python-online-marathon
6_sprint/6_2question.py
6_2question.py
py
803
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 5, "usage_type": "call" }, { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dump", "line_numb...
910975330
import sys, argparse, os, numpy as np from horton import __version__, IOData # All, except underflows, is *not* fine. np.seterr(divide='raise', over='raise', invalid='raise') def parse_args(): parser = argparse.ArgumentParser(prog='horton-convert.py', description='Convert between file formats supported...
theochem/horton
scripts/horton-convert.py
horton-convert.py
py
1,810
python
en
code
83
github-code
6
[ { "api_name": "numpy.seterr", "line_number": 7, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "horton.__version__", "line_number": 16, "usage_type": "name" }, { "api_name": "horton.IOData....
4582056106
import numpy as np import pandas as pd from matplotlib import pyplot as plt import seaborn as sns from scipy import stats import collections import time from sklearn import cluster from sklearn.metrics import adjusted_rand_score import scipy as sp from tqdm import tqdm from sklearn.manifold import MDS from run_dist_mat...
pdavar/Analysis-of-3D-Mouse-Genome-Organization
chromosome_alignment.py
chromosome_alignment.py
py
16,670
python
en
code
0
github-code
6
[ { "api_name": "numpy.sum", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.cut", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.MultiIndex.from_product", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.MultiIndex...
19492440920
# -*- coding: utf-8 -*- from flask import Flask,request,abort # 引用flask库 import os import time import sys, getopt from dd.mylog import TNLog import dd logger = TNLog() print(__name__) app= Flask(__name__) app.config.update(DEBUG=True) # 定义路由 @app.route('/') def hello_world(): out = os.popen('docker info').re...
stosc/dockerDeployer
dd/run.py
run.py
py
3,114
python
en
code
0
github-code
6
[ { "api_name": "dd.mylog.TNLog", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "os.popen", "line_number": 20, "usage_type": "call" }, { "api_name": "os.popen", "line_number": 25,...
72995183868
import os import sys import time import struct import debug import eosapi from eosapi import N, push_transactions from common import prepare, Sync from tools import cpp2wast def init_debug(wasm=True): def init_decorator(func): def func_wrapper(*args, **kwargs): if wasm: _src_di...
learnforpractice/pyeos
programs/pyeos/tests/wasm/lab/t.py
t.py
py
3,368
python
en
code
131
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 16, "usage_type": "call" }, { "api_name": "tools.cpp2wast.set_src_p...
24998585781
import wizard import pooler import datetime import time from copy import deepcopy import netsvc from tools.translate import _ _schedule_form = '''<?xml version="1.0"?> <form string="Interview Scheduling Of Candidate"> <field name="start_interview"/> <field name="end_interview"/> <field name="interval_time"...
factorlibre/openerp-extra-6.1
hr_interview/wizard/wiz_schedule.py
wiz_schedule.py
py
4,374
python
en
code
9
github-code
6
[ { "api_name": "wizard.interface", "line_number": 37, "usage_type": "attribute" }, { "api_name": "pooler.get_pool", "line_number": 39, "usage_type": "call" }, { "api_name": "time.strptime", "line_number": 41, "usage_type": "call" }, { "api_name": "datetime.datetime...
10696495998
# -*- coding: utf-8 -*- import os import uuid import json import requests import re from datetime import datetime import urllib import hmac import base64 from threading import Timer REQUEST_URL = 'https://alidns.aliyuncs.com/' LOCAL_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ip.txt') ALIYUN_SET...
mikuh/aliyun_ddns
ddns.py
ddns.py
py
4,069
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.abspath", "line...
72683668667
import sys from PyQt5.QtWidgets import QApplication, QDialog, QVBoxLayout, QPushButton, QLabel, QHBoxLayout, QLineEdit button_y_position = 0.1 # Initial Y position for the buttons class Addsubject(QDialog): def __init__(self): super().__init__() self.setWindowTitle('Custom Pop-up Block') ...
Rush-154/DBMS
Login/flexcards.py
flexcards.py
py
2,119
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 5, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QVBoxLayout", "line_number": 13, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QHBoxLayout", "line_number": 14, "usage_type": "call" }, { "ap...
36411448777
#import logging; logging.basicConfig(level=logging.INFO) import asyncio, os, json, time, base64 from datetime import datetime from aiohttp import web from jinja2 import Environment, FileSystemLoader from log import Log,create_logger import config as conf import common.orm as orm from common.webmiddlewares import ...
jkilili/python_web
www/app.py
app.py
py
3,208
python
en
code
0
github-code
6
[ { "api_name": "log.Log.info", "line_number": 19, "usage_type": "call" }, { "api_name": "log.Log", "line_number": 19, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, ...
18527949488
import pytest from selene.support.shared import browser from selene import be, have @pytest.fixture(scope='session', autouse=True) def browser_size(): browser.config.window_width = 1280 browser.config.window_height = 720 def test_search(browser_size): browser.open('https://google.com') browser.eleme...
ekat-barkova/qa_guru_python_6_2_homework
tests/test_google_should_find_selene.py
test_google_should_find_selene.py
py
788
python
en
code
0
github-code
6
[ { "api_name": "selene.support.shared.browser.config", "line_number": 8, "usage_type": "attribute" }, { "api_name": "selene.support.shared.browser", "line_number": 8, "usage_type": "name" }, { "api_name": "selene.support.shared.browser.config", "line_number": 9, "usage_typ...
42483141861
import os import json import requests from flask import Flask, jsonify, request, Response from faker import Factory from twilio.access_token import AccessToken, IpMessagingGrant app = Flask(__name__) fake = Factory.create() @app.route('/') def index(): return app.send_static_file('index.html') @app.route('/ton...
AvonGenesis/jwms
app.py
app.py
py
2,338
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "faker.Factory.create", "line_number": 11, "usage_type": "call" }, { "api_name": "faker.Factory", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.post", "l...
11300309585
from django.contrib import admin from django.urls import path from firstapp import views as v1 urlpatterns = [ path('admin/', admin.site.urls), path('home/',v1.home), path('gm/',v1.gm_), path('ga/',v1.ga_), path('gn/',v1.gn_), ]
Ranjith8796/Demo
firstapp/urls.py
urls.py
py
262
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "dja...
5898520470
import os from datetime import datetime, timezone import tweepy def scrape_user_tweets(username: str, num_tweets: int = 10) -> list: """ Scrapes Twitter user's original tweets (i.e., no retweets or replies) and returns them as a list of dictionaries. Each dictionary has three fields: "time_posted" (relat...
mdalvi/langchain-with-milind
third_parties/twitter.py
twitter.py
py
1,318
python
en
code
2
github-code
6
[ { "api_name": "tweepy.OAuthHandler", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 19, "usage_type": "attribute" }, { "api_name": "tweepy.API", ...
16062801257
import pygame import init from gui_config import Config from widget import Widget class Label(Widget): def __init__(self, text, x,y,width,height, config=Config.default_drawing_conf): Widget.__init__(self,x,y,width,height,config) self.__set_text(text) ...
unusualcomputers/unusualgui
code/label.py
label.py
py
2,516
python
en
code
0
github-code
6
[ { "api_name": "widget.Widget", "line_number": 6, "usage_type": "name" }, { "api_name": "gui_config.Config.default_drawing_conf", "line_number": 10, "usage_type": "attribute" }, { "api_name": "gui_config.Config", "line_number": 10, "usage_type": "name" }, { "api_na...
71700390588
from django.shortcuts import render from django.shortcuts import render, redirect from .forms import NewUserForm from django.contrib.auth import login, authenticate from django.contrib import messages from django.contrib.auth.forms import AuthenticationForm from django.core.mail import send_mail, BadHeaderError ...
KeanDelly/GrowExplore
worldBuilder/Login/views.py
views.py
py
13,994
python
en
code
6
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 11, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path"...
6922603466
import os # python -m pip install --upgrade pip # python -m pip install --upgrade Pillow from PIL import Image # pip install numpy import numpy as np ####################################################################### black=[25,25,25] blue=[50,75,175] brown=[100,75,50] cyan=[75,125,151] gray=[75,75,75] green=[100...
kirbycope/map-markers-java
img.py
img.py
py
4,689
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 34,...
71483943548
# SPDX-License-Identifier: MIT # (c) 2023 knuxify and Ear Tag contributors from gi.repository import GObject, GLib import threading import time class EartagBackgroundTask(GObject.Object): """ Convenience class for creating tasks that run in the background without freezing the UI. Provides a "progress...
knuxify/eartag
src/utils/bgtask.py
bgtask.py
py
3,589
python
en
code
67
github-code
6
[ { "api_name": "gi.repository.GObject.Object", "line_number": 8, "usage_type": "attribute" }, { "api_name": "gi.repository.GObject", "line_number": 8, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 31, "usage_type": "call" }, { "api_name": "thre...
28108895632
import mat73 import matplotlib.pyplot as plt FORMAT = 'pdf' plt.rcParams.update({'font.size': 22}) datasets = ["Brain", "MAG-10", "Cooking", "DAWN", "Walmart-Trips", "Trivago"] budgets = [0, .01, .05, .1, .15, .2, .25] budget_strings = ['0.0', '0.01', '0.05', '0.1', '0.15', '0.2', '0.25'] n = [638, 80198, 6714, 2109...
TheoryInPractice/overlapping-ecc
Exp1-Algorithm-Evaluation/R_Plots.py
R_Plots.py
py
2,373
python
en
code
null
github-code
6
[ { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 5, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "...
72761928188
import nussl import torch from torch import nn from torch.nn.utils import weight_norm from nussl.ml.networks.modules import ( Embedding, DualPath, DualPathBlock, STFT, LearnedFilterBank, AmplitudeToDB, RecurrentStack, MelProjection, BatchNorm, InstanceNorm, ShiftAndScale ) import numpy as np from . import ...
bfredl/tutorial
common/models.py
models.py
py
6,359
python
en
code
1
github-code
6
[ { "api_name": "nussl.AudioSignal", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.device", ...
23060222816
import math import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches compdata=np.loadtxt('compdata.txt') agelabel=compdata[:,0] compdata=compdata[:,1] obsdata=np.loadtxt('obsdata.txt') error=obsdata[:,3] obsdata=obsdata[:,1] #plt.plot(agelabel, compdata, 'r',label='Computed data') plt...
AndreasMu/Bachelor
Graphs and Tex/obsdataplot.py
obsdataplot.py
py
554
python
en
code
0
github-code
6
[ { "api_name": "numpy.loadtxt", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.errorbar", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
8774738477
import gym import numpy as np from cartpole_deep_net import CartpoleDeepNet class CartPole: def __init__(self, render_mode='None'): self.env_title = 'CartPole-v1' self.env=gym.make(self.env_title, render_mode=render_mode) self.single_state_shape_len = 1 self....
asharali001/Deep-Q-Learning
cartpole.py
cartpole.py
py
1,231
python
en
code
0
github-code
6
[ { "api_name": "gym.make", "line_number": 8, "usage_type": "call" }, { "api_name": "cartpole_deep_net.CartpoleDeepNet", "line_number": 16, "usage_type": "call" } ]
70939657148
from selenium import webdriver import requests from bs4 import BeautifulSoup from pymongo import MongoClient import time import datetime def get_page(url): header = { "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11" ...
lzzandsx/lizhengzhao_python_homework
xinlang.py
xinlang.py
py
1,935
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 20, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 26, "usage_type": "call" }, { "api_name": "time.localtime", "li...
74197622589
from rest_framework import serializers from des.models import Exposure, SkybotJob, SkybotJobResult class SkybotJobResultSerializer(serializers.ModelSerializer): # job = serializers.PrimaryKeyRelatedField( # queryset=SkybotJob.objects.all(), many=False # ) # exposure = serializers.PrimaryKeyRela...
linea-it/tno
backend/des/serializers/skybot_job_result.py
skybot_job_result.py
py
1,678
python
en
code
1
github-code
6
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "rest_framework.serializers.PrimaryKeyRelatedField", "line_number": 1...
22134160802
from django.urls import path from . import views urlpatterns = [ path('', views.index, name = 'home'), path('about', views.about, name = 'about'), path('create', views.create, name = 'create'), path('review', views.review, name = 'review'), path('test1', views.test1, name = 'test1'), path('<int...
Voron4ikhin/Web_lab
taskmanager/main/urls.py
urls.py
py
553
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
22963907434
import urllib3 # 忽略警告:InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. urllib3.disable_warnings() import json import os # http://www.meituan.com/meishi/api/poi/getMerchantComment?id=42913246&offset=0&pageSize=50&sortType=1 COMMENT_URL = 'http://www...
puke3615/comment_spider
comment_spider/util.py
util.py
py
4,172
python
en
code
5
github-code
6
[ { "api_name": "urllib3.disable_warnings", "line_number": 4, "usage_type": "call" }, { "api_name": "urllib3.PoolManager", "line_number": 32, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path.join",...
31534048424
import telebot; import os import subprocess import re #получение токена при запуске и возможно его сохранение file = open("Token", "r") token = file.read() file.close() bot = telebot.TeleBot(token) os.system("echo запущено") @bot.message_handler(content_types=['text']) def get_text_messages(message): if message.text ...
romazanovma/probable-octo-potato-telegram-bot
bot.py
bot.py
py
1,759
python
ru
code
0
github-code
6
[ { "api_name": "telebot.TeleBot", "line_number": 9, "usage_type": "call" }, { "api_name": "os.system", "line_number": 10, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 27, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number...
71200356027
from moviepy.editor import * from moviepy.video.tools.subtitles import SubtitlesClip import moviepy.video.fx as vfx def create_srt(line): subs_obj = open(r"D:\Final Renders\your next line.srt", "r") orig_subs = subs_obj.read().split("\n") print(orig_subs) orig_subs[6] = f"\"{line}\"" orig_subs[10...
alwynwan/Messenger-Bot
srtgen.py
srtgen.py
py
1,002
python
en
code
0
github-code
6
[ { "api_name": "moviepy.video.fx.resize.resize", "line_number": 24, "usage_type": "call" }, { "api_name": "moviepy.video.fx.resize", "line_number": 24, "usage_type": "attribute" }, { "api_name": "moviepy.video.fx", "line_number": 24, "usage_type": "name" }, { "api_...
33645109204
from __future__ import print_function import os.path from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials from datetime import datetime, timedelta calendar_id = os.environ...
Santixs/NotionGSync
gcalendarsync.py
gcalendarsync.py
py
3,727
python
en
code
1
github-code
6
[ { "api_name": "os.path.environ.get", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.path.exists"...
71913849148
import requests API_ENDPOINT = 'https://api.openai.com/v1/chat/completions' API_KEY = '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' MODEL_ID = 'gpt-3.5-turbo' def test_chatgpt_api(): headers = { 'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json' } d...
Ali-Jabowr/TelegramWordBot
commands/chatgpt_testing.py
chatgpt_testing.py
py
777
python
en
code
0
github-code
6
[ { "api_name": "requests.post", "line_number": 16, "usage_type": "call" } ]
9837393322
import networkx as nx # import pulp G = nx.DiGraph() G.add_nodes_from(['A', 'B', 'C', 'D', 'E', 'F']) G.add_edges_from([('A', 'B'), ('A', 'D'), ('B', 'C'), ('B', 'E'), ('C', 'F'), ('D', 'C'), ('E', 'C'), ('E', 'D'), ('E', 'F')]) capacities = [4,5,5,4,4,3,2,2,1] costs = [1,7,7,2,3,2,1,1,4] for i, edge in enumerate(G...
havarpan/verkkomallit-k21-glitchtest
python/luentoesim.py
luentoesim.py
py
639
python
en
code
0
github-code
6
[ { "api_name": "networkx.DiGraph", "line_number": 4, "usage_type": "call" }, { "api_name": "networkx.min_cost_flow", "line_number": 21, "usage_type": "call" }, { "api_name": "networkx.cost_of_flow", "line_number": 22, "usage_type": "call" } ]
17335047402
import sesame import numpy as np ###################################################### ## define the system ###################################################### # dimensions of the system Lx = 3e-4 #[cm] Ly = 3e-4 #[cm] # extent of the junction from the left contact [cm] junction = .1e-4 # [cm] # Mes...
usnistgov/sesame
examples/tutorial5/2d_EBIC.py
2d_EBIC.py
py
4,876
python
en
code
16
github-code
6
[ { "api_name": "numpy.concatenate", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.linspace", ...
42649131070
""" some tools """ import logging import re import sys from rancon import settings tag_matcher = re.compile("%([A-Z0-9]+)%") def fail(message): """ logs message before calling sys.exit XXX: why is this using print not log? """ if isinstance(message, list) or isinstance(message, tuple): ...
flypenguin/python-rancon
rancon/tools.py
tools.py
py
1,596
python
en
code
0
github-code
6
[ { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 56, "usage_type": "call" }, { "api_name": "rancon.settings.loglevel", "...
40369189284
from multiprocessing.spawn import old_main_modules from os import listdir from os.path import isfile, join from wordcloud import WordCloud import codecs import jieba import matplotlib.pyplot as plt # read data mypath = 'lab/contexts/' font_filename = 'fonts/STFangSong.ttf' files = [f for f in listdir(mypath) if isfil...
NATaaLiAAK/PPE1
cloud_build.py
cloud_build.py
py
1,000
python
en
code
0
github-code
6
[ { "api_name": "os.listdir", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "jieba.cut", "line_number":...
24362182930
from datetime import date, timedelta from .downloaders import Downloader from .parsers import Parser class RequiredValue(): def __init__(self, child_of=None): self.child_of = child_of def __call__(self, value): return self.child_of is None or isinstance(value, self.child_of) class Default...
suningwz/netaddiction_addons
netaddiction_octopus/base/supplier.py
supplier.py
py
2,132
python
en
code
0
github-code
6
[ { "api_name": "datetime.date.today", "line_number": 33, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 33, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.date",...
30293188969
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path("new", views.create, name='new'), path('list', views.list, name='list'), path('edit/<int:task_id>', views.edit, name='edit'), ]
drazisil/task-zero
tasks/urls.py
urls.py
py
252
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
4473417766
import datetime import logging import re from estropadakparser.parsers.parser import Parser from estropadakparser.estropada.estropada import Estropada, TaldeEmaitza class ArcParserLegacy(Parser): '''Base class to parse an ARC legacy(2006-2008) race result''' def __init__(self, **kwargs): pass de...
ander2/estropadak-lxml
estropadakparser/parsers/arc_legacy_parser.py
arc_legacy_parser.py
py
4,486
python
eu
code
2
github-code
6
[ { "api_name": "estropadakparser.parsers.parser.Parser", "line_number": 8, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "attribute" }, ...
17615533766
import web import os urls = ('/upload', 'Upload') class Upload: def GET(self): web.header("Content-Type","text/html; charset=utf-8") return open(r'upload.html', 'r').read() def POST(self): try: x = web.input(myfile={}) filedir = 'submit' # change this to the...
Louis-He/simpleOj
webmain.py
webmain.py
py
2,766
python
en
code
0
github-code
6
[ { "api_name": "web.header", "line_number": 9, "usage_type": "call" }, { "api_name": "web.input", "line_number": 15, "usage_type": "call" }, { "api_name": "os.system", "line_number": 27, "usage_type": "call" }, { "api_name": "os.system", "line_number": 28, ...
31261537971
from collections import namedtuple from itertools import izip from operator import attrgetter from tilequeue.log import LogCategory from tilequeue.log import LogLevel from tilequeue.log import MsgType from tilequeue.metatile import common_parent from tilequeue.metatile import make_metatiles from tilequeue.process impor...
thanhnghiacntt/tilequeue
tilequeue/worker.py
worker.py
py
24,574
python
en
code
0
github-code
6
[ { "api_name": "Queue.Full", "line_number": 36, "usage_type": "attribute" }, { "api_name": "tilequeue.utils.format_stacktrace_one_line", "line_number": 80, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 86, "usage_type": "call" }, { "api_name": "t...
7125623220
###################################################### ### SQL Database Script for PokeDex and TrainerDex ### ###################################################### import numpy as np import pandas as pd from sqlalchemy import create_engine from config import password import pprint as pp # Set locations for CSV Files...
ASooklall/ETL_Project
pokemon_db/pokemon_db.py
pokemon_db.py
py
4,633
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "config.password", ...
35743736914
import sys import os import numpy as np import scipy.sparse from scipy.sparse import csr_matrix, find import read_write as rw import matlab.engine ''' finput_iu_rating_matrix_train = "Data/iu_sparse_matrix_train.npz" finput_title_sim_matrix = "Data/title_similarity_matrix" finput_description_sim_matrix = "D...
clamli/Dissertation
Step1-Preprocessing/buildtree_preparation.py
buildtree_preparation.py
py
4,436
python
en
code
28
github-code
6
[ { "api_name": "sys.argv", "line_number": 25, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 27, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
25033983488
from django.urls import path from . import views urlpatterns = [ # UI & API hybrid routes path("", views.index, name="index"), path("posts/<int:page>", views.posts, name="posts"), path("following/<int:page>", views.following, name="following"), path("profile/<str:username>/<int:page>", views.profi...
csloan29/HES-e-33a-web-django
network/network/urls.py
urls.py
py
773
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
8410504339
#! /usr/bin/python import logging import os from pathlib import Path import coloredlogs from dotenv import load_dotenv PROJECT_ROOT = Path(__file__).parent.resolve() ##################### # CONFIGURE LOGGING # ##################### LOG_PATH = str(PROJECT_ROOT / "worker.log") logging.basicConfig( filename=LOG_...
darwin403/translate-transcribe-videos
settings.py
settings.py
py
1,222
python
en
code
1
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 18, "usage_type": "call" }, { "api_name": "coloredlogs.install", "line_number": 24, "usage_type": "call" }, { "api_name": "dotenv.load_dote...
6148825082
from selenium import webdriver from time import sleep import selenium from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.select import Select import pandas as pd if __name__ == '__main__': # option=webdriver.ChromeOptions() # option.add_argument("--user-data-dir="+r"C:\\Users\\2014...
YN3359/runoob-git-test
PythonScripts/自动备案COC.py
自动备案COC.py
py
2,122
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Ie", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 13, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 16, "usage_type": "call" }, { "api_name": "time.sleep", ...
16543689747
import csv import sys from nuitka.__past__ import StringIO from nuitka.Tracing import my_print from nuitka.utils.Execution import check_output def main(): # many cases, pylint: disable=too-many-branches my_print("Querying openSUSE build service status of Nuitka packages.") # spell-checker: ignore kayha...
Nuitka/Nuitka
nuitka/tools/release/osc_check/__main__.py
__main__.py
py
3,651
python
en
code
10,019
github-code
6
[ { "api_name": "nuitka.Tracing.my_print", "line_number": 12, "usage_type": "call" }, { "api_name": "nuitka.utils.Execution.check_output", "line_number": 17, "usage_type": "call" }, { "api_name": "nuitka.__past__.StringIO", "line_number": 23, "usage_type": "call" }, { ...
40077076852
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import re import logging from .pushbullet import * class Messenger(object): """docstring for Message""" def __init__(self): #, arg): # super(Message, self).__init__() # self.arg = arg self.ready = False self.message = '' ...
lucy9215/jobNotification
pushbullet/messenger.py
messenger.py
py
5,743
python
en
code
0
github-code
6
[ { "api_name": "re.compile", "line_number": 17, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 18, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 19, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 20, ...
23307657200
from __future__ import print_function try: # For Python 3.0 and later from urllib.request import urlopen from urllib.request import urlretrieve from urllib import request except ImportError: # Fall back to Python 2's urllib2 from urllib2 import urlopen from urllib import urlretrieve import ...
nblago/utils
src/utils/finder_chart.py
finder_chart.py
py
24,759
python
en
code
2
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 31, "usage_type": "call" }, { "api_name": "astropy.coordinates.SkyCoord", "line_number": 41, "usage_type": "call" }, { "api_name": "astropy.units.hourangle", "line_number": 43, "usage_type": "attribute" }, { ...
14927451670
import tkinter as tk from tkinter import filedialog, simpledialog, messagebox, Scale, HORIZONTAL from tkinter.ttk import Notebook from PIL import Image, ImageTk import random import os import shutil import zipfile import json class TraitBubble: def __init__(self, canvas, trait_name, x, y, prob_scale): self...
net1ife/NFT-generation
v0.py
v0.py
py
7,914
python
en
code
0
github-code
6
[ { "api_name": "tkinter.Label", "line_number": 67, "usage_type": "call" }, { "api_name": "tkinter.Frame", "line_number": 70, "usage_type": "call" }, { "api_name": "tkinter.Button", "line_number": 73, "usage_type": "call" }, { "api_name": "tkinter.Label", "line_...
2690012282
import boto3 import os class WasabiUploader: def __init__(self, directory): self.directory = directory self.session = boto3.Session(profile_name="default") self.credentials = self.session.get_credentials() self.aws_access_key_id = self.credentials.access_key self.aws_secret...
evanwmeeks/PersonalProjects
wasabi_interface/wasabi.py
wasabi.py
py
3,414
python
en
code
0
github-code
6
[ { "api_name": "boto3.Session", "line_number": 8, "usage_type": "call" }, { "api_name": "boto3.resource", "line_number": 12, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path.join", "line_numbe...
73017766588
import json from typing import Dict, List, Tuple from flask import Flask, jsonify, request from rb.complexity.complexity_index import compute_indices from rb.complexity.index_category import IndexCategory from rb.core.document import Document from rb.core.lang import Lang from rb.core.text_element import TextElement f...
rwth-acis/readerbenchpyapi
rb_api/keywords/keywords.py
keywords.py
py
6,881
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 26, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 32, "usage_type": "name" }, { "api_name": "rb.core.word.Word", "line_nu...
40299141620
import numpy as np from typing import List, Optional, Tuple from collections import defaultdict from kaggle_environments.envs.halite.helpers import Ship from .board import MyBoard, ALL_SHIP_ACTIONS from .logger import logger def ship_converts(board: MyBoard): """ Convert our ships into shipyards """ if board....
w9PcJLyb/HaliteIV-bot
halite/ship_converts.py
ship_converts.py
py
5,297
python
en
code
0
github-code
6
[ { "api_name": "board.MyBoard", "line_number": 9, "usage_type": "name" }, { "api_name": "board.step", "line_number": 11, "usage_type": "attribute" }, { "api_name": "board.moves_left", "line_number": 11, "usage_type": "attribute" }, { "api_name": "board.num_my_shipy...
73790991549
from typing import List, Tuple from abstract_puzzles import AbstractPuzzles DATA_TYPE = List[Tuple[Tuple[int, int], Tuple[int, int]]] class Puzzles(AbstractPuzzles): def __init__(self, method_name): super().__init__( method_name, day=4, puzzle_1_example_answer=2, ...
Lynxens/AdventOfCode2022
advent_of_code/day4.py
day4.py
py
1,600
python
en
code
4
github-code
6
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 4, "usage_type": "name" }, { "api_name": "abstract_puzzles.AbstractPuzzles", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.Tuple",...
519381337
from openmdao.core.driver import Driver, RecordingDebugging from openmdao.api import SimpleGADriver, Problem, LatinHypercubeGenerator, DOEDriver from dataclasses import dataclass from copy import deepcopy import random import numpy as np from itertools import chain from deap import algorithms, base, tools from deap.be...
ovidner/openmdao-deap
openmdao_deap/__init__.py
__init__.py
py
5,155
python
en
code
0
github-code
6
[ { "api_name": "openmdao.core.driver.Driver", "line_number": 13, "usage_type": "name" }, { "api_name": "deap.base.Fitness", "line_number": 61, "usage_type": "attribute" }, { "api_name": "deap.base", "line_number": 61, "usage_type": "name" }, { "api_name": "numpy.sh...
33914485796
from django.conf.urls import patterns, url from ventas import viewsInforme,viewsPedido urlpatterns = patterns('', url(r'^$', viewsPedido.venta_desktop, name='venta_desktop'), url(r'^fac/', viewsPedido.venta_desktop, name='venta_desktop1'), url(r'^mobile/$', viewsPedido.venta_mobile, name='venta_mobile'), ...
wilmandx/ipos
ventas/urls.py
urls.py
py
1,020
python
es
code
0
github-code
6
[ { "api_name": "django.conf.urls.patterns", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "ventas.viewsPedido.venta_desktop", "line_number": 6, "usage_type": "attribute" }, { ...
13538653206
import pygame import numpy as np from util.helpers import * from physics.colliding_object import Colliding class EyeBeam(Colliding): def __init__(self, start, end): self.start = np.array(start) super(EyeBeam, self).__init__(self.start) self.end = np.array(end) self.collide_type = '...
SimonCarryer/video_game_ai
brains/eyes.py
eyes.py
py
3,313
python
en
code
2
github-code
6
[ { "api_name": "physics.colliding_object.Colliding", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array"...
74451964986
from core.visualization import PlotGraphics from core.relation_extraction import SpacyRelationExtraction from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.pipeline import Pipeline from sklearn.tree import DecisionTreeClassifier from skle...
eliseu31/MSDS-Analyser
core/text_pipeline.py
text_pipeline.py
py
6,284
python
en
code
8
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.dirname", ...
21932276295
from discord.ext import commands class ErrorHandeler(commands.Cog): """A cog for global error handling""" def __init__(self, bot: commands.Bot): self.bot = bot @commands.Cog.listener() async def on_command_error(self, ctx: commands.Context, error: commands.CommandError): if isinstance(error...
Jarkyc/Franklin-The-Undying
errorhandler.py
errorhandler.py
py
599
python
en
code
0
github-code
6
[ { "api_name": "discord.ext.commands.Cog", "line_number": 4, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 4, "usage_type": "name" }, { "api_name": "discord.ext.commands.Bot", "line_number": 7, "usage_type": "attribute" }, { "api...
36697027175
from jinja2 import Environment, PackageLoader import os from typing import Dict import re class SQLTemplate: _templatePath = os.path.join( os.path.dirname(os.path.dirname(os.path.relpath(__file__))), "templates" ) _templatePath = os.path.join("templates") # raise ValueError(f'temp...
ProjectiveGroupUK/tips-snowpark
tips/framework/utils/sql_template.py
sql_template.py
py
1,001
python
en
code
2
github-code
6
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9...
72784214587
# https://www.codewars.com/kata/5b76a34ff71e5de9db0000f2 from itertools import starmap def solve(arr): def conv(t1,t2): t1 = tuple(map(int,t1.split(":"))) t2 = tuple(map(int,t2.split(":"))) hd1, md = divmod((t2[1] - t1[1] - 1), 60) hd2 = (t2[0] - t1[0] + hd1) % 24 mm = (hd2...
blzzua/codewars
6-kyu/simple_time_difference.py
simple_time_difference.py
py
487
python
en
code
0
github-code
6
[ { "api_name": "itertools.starmap", "line_number": 13, "usage_type": "call" } ]
21347456845
class IP(): def __init__(self,ipaddress): url='http://m.ip138.com/ip.asp?ip=' self.IP=ipaddress self.site=url+self.IP self.header={'User-Agent' :'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063'} def get_phy(...
Alex-Beng/CubingQQBot
IP.py
IP.py
py
1,869
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 17, "usage_type": "call" }, { "api_name": "re.S", "line_number": 17, "usage_type": "attribute" } ]
5312412579
import pygame from flame import Flame class Firework: def __init__(self): self.rect = pygame.Rect(640, 720, 25, 50) self.image = pygame.Surface( (25, 50) ) self.image.fill( (255, 255, 255) ) self.exploded = False self.flames = [] def update(self): if not self.e...
jbedu1024/fajerwerki
firework.py
firework.py
py
822
python
en
code
0
github-code
6
[ { "api_name": "pygame.Rect", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.Surface", "line_number": 7, "usage_type": "call" }, { "api_name": "flame.update", "line_number": 19, "usage_type": "call" }, { "api_name": "flame.draw", "line_number":...
33105484438
#!/usr/bin/env python # -*- coding: UTF-8 -*- import logging; logger = logging.getLogger("main") FORMAT = '%(asctime)s - %(levelname)s: %(message)s' logging.basicConfig(format=FORMAT, level=logging.WARNING) import time from flask import Flask, escape, url_for,render_template, g, request, redirect, jsonify, session f...
severin-lemaignan/robomaze
backend/backend.py
backend.py
py
4,956
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 6, "usage_type": "attribute" }, { "api_name": "flask.Flask",...