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
13848889282
import random import numpy as np from tqdm import tqdm import pandas as pd from preprocessing.indicators import IndicatorsPreprocessor, PriceSource from preprocessing.resampler import TimeResamplerPreprocessor from preprocessing.datetime_decomposition import DateTimePreprocessor from preprocessing import Preprocessor f...
cTatu/gym-algo-trading
main.py
main.py
py
3,809
python
en
code
11
github-code
97
[ { "api_name": "typing.List", "line_number": 24, "usage_type": "name" }, { "api_name": "preprocessing.Preprocessor", "line_number": 24, "usage_type": "name" }, { "api_name": "preprocessing.resampler.TimeResamplerPreprocessor", "line_number": 25, "usage_type": "call" }, ...
72233113919
from sklearn import datasets,linear_model from sklearn.model_selection import train_test_split data = datasets.load_breast_cancer() print(data.keys()) import pickle xtrain,xtest,ytarin,ytest = train_test_split(data.data,data.target,test_size=0.01) model =linear_model.LinearRegression() model.fit(xtrain,ytarin) l= m...
ashu-tosh-singh/stock-prediction
wineAndcancer/model/myModel.py
myModel.py
py
487
python
en
code
0
github-code
97
[ { "api_name": "sklearn.datasets.load_breast_cancer", "line_number": 4, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 4, "usage_type": "name" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 7, "usage_type": "call" },...
1712747158
import falcon from GlobalEnvironment.db import DB from GlobalEnvironment.GlobalFunctions import jwtDecode, sendmail from datetime import datetime import json conn = DB() class troubleTask(object): def on_post(self, req, resp): try: rawjson = req.stream.read() data = json.loads(rawjs...
girirahayu/api-timeshift
GlobalEnvironment/troubleTaskList.py
troubleTaskList.py
py
3,899
python
en
code
0
github-code
97
[ { "api_name": "GlobalEnvironment.db.DB", "line_number": 6, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 12, "usage_type": "call" }, { "api_name": "GlobalEnvironment.GlobalFunctions.sendmail", "line_number": 24, "usage_type": "call" }, { "api_...
7259704644
from __future__ import print_function import numpy as np np.random.seed(1234) # for reproducibility? # specifying the gpu to use # import theano.sandbox.cuda # theano.sandbox.cuda.use('gpu1') import theano import theano.tensor as T import binary_net import lasagne from pylearn2.datasets.cifar10 ...
matthijsvk/multimodalSR
code/lipreading/binary/binary_lipreading.py
binary_lipreading.py
py
19,199
python
en
code
56
github-code
97
[ { "api_name": "numpy.random.seed", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 5, "usage_type": "attribute" }, { "api_name": "binary_net.binary_tanh_unit", "line_number": 33, "usage_type": "attribute" }, { "api_name": "th...
34556143476
# First import the library import pyrealsense2 as rs import time from graceful_killer import GracefulKiller def rs_capture(): pipeline = rs.pipeline() config = rs.config() config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30) config.enable_stream(rs.stream.color, 640, 480, rs.format.rgb8, ...
luke-bouttell/bear-pack
rs_capture.py
rs_capture.py
py
1,152
python
en
code
0
github-code
97
[ { "api_name": "pyrealsense2.pipeline", "line_number": 7, "usage_type": "call" }, { "api_name": "pyrealsense2.config", "line_number": 8, "usage_type": "call" }, { "api_name": "pyrealsense2.stream", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pyrea...
3141408842
# -*- coding: utf-8 -*- import os import weasyprint as wp import csv import jinja2 as j2 try: os.mkdir('director_report') os.mkdir('teacher_report') os.mkdir('progress') except OSError: pass csv_file = open('new-data-total.csv','r') data = csv.DictReader(csv_file, delimiter=',') env = j2.Environment(load...
madker4/gen_pdf_report_surv
gen_pdf_report_surv.py
gen_pdf_report_surv.py
py
1,056
python
en
code
0
github-code
97
[ { "api_name": "os.mkdir", "line_number": 8, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 9, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 10, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 15, ...
19076820897
from selenium import webdriver import time PATH = "C:\Program Files (x86)\chromedriver_win32\chromedriver.exe" driver = webdriver.Chrome(PATH) driver.get("https://the-internet.herokuapp.com/") time.sleep(1) driver.find_element_by_link_text("Dynamic Content").click() time.sleep(1) driver.find_element_b...
ogorovoy/easy-selenium-test
dynamic contents.py
dynamic contents.py
py
585
python
en
code
0
github-code
97
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 9, "usage_type": "call" }, { "api_name": "time.sleep", ...
5825141182
import operator from functools import partial from athsymbol import ( isAthValue, AthExpr, AthSymbol, BuiltinSymbol, AthBuiltinFunction, AthCustomFunction, SymbolError, ) from athbuiltins_default import ath_builtins def bool_not(val): if isAthValue(val): val = AthSymbol(bool(val), left=val)...
virtuNat/discord.-ATH
athstmt.py
athstmt.py
py
13,647
python
en
code
3
github-code
97
[ { "api_name": "athsymbol.isAthValue", "line_number": 11, "usage_type": "call" }, { "api_name": "athsymbol.AthSymbol", "line_number": 12, "usage_type": "call" }, { "api_name": "athsymbol.AthSymbol", "line_number": 13, "usage_type": "call" }, { "api_name": "athsymbo...
2395291651
from graphene import graphene_model from plotly.subplots import make_subplots import plotly.graph_objects as go fig = make_subplots(rows=2, cols=2, specs=[[{'type': 'scatter'}, {'type': 'scatter'}], [{'type': 'surface'}, {'type': 'contour'}]]) graphene = graphene_model() R1, R2 = graphene.lattice(1) K ...
Luis2501/condensed-matter
tests/app.py
app.py
py
1,254
python
en
code
0
github-code
97
[ { "api_name": "plotly.subplots.make_subplots", "line_number": 5, "usage_type": "call" }, { "api_name": "graphene.graphene_model", "line_number": 9, "usage_type": "call" }, { "api_name": "graphene.lattice", "line_number": 10, "usage_type": "call" }, { "api_name": "...
70715556479
import sys sys.path.append('..') # CBOW 모델 최종 PTB 데이터 학습 코드 import numpy as np import pickle from common.trainer import Trainer from common.optimizer import Adam from cbow import CBOW from common.util import create_contexts_target from dataset import ptb # 하이퍼파라미터 window_size = 5 hidden_size = 100 batch_size = 100 max...
young-hun-jo/DeepLearningOnlyNumpy
season2/train/train_improved_cbow.py
train_improved_cbow.py
py
1,123
python
en
code
1
github-code
97
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "dataset.ptb.load_data", "line_number": 19, "usage_type": "call" }, { "api_name": "dataset.ptb", "...
26318435394
"""Server notifying of module connections.""" import asyncio import logging from typing import Dict, Set from opentrons.hardware_control.emulation.module_server.models import ( ModuleConnection, Message, ) from opentrons.hardware_control.emulation.proxy import ProxyListener from opentrons.hardware_control.emul...
Opentrons/opentrons
api/src/opentrons/hardware_control/emulation/module_server/server.py
server.py
py
3,478
python
en
code
363
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "typing_extensions.Final", "line_number": 16, "usage_type": "name" }, { "api_name": "opentrons.hardware_control.emulation.proxy.ProxyListener", "line_number": 19, "usage_type": "na...
3399699991
# Native Python imports import os import itertools # External package imports import pandas as pd def average_unemployment_data(): """Scripting function for averaging unemployment data using the directories below.""" # Get directories and files data_dir = "../../unemployment_data/" unemp_files =...
rmsander/ridesharing-econometrics
python/process_unemployment_data.py
process_unemployment_data.py
py
1,820
python
en
code
0
github-code
97
[ { "api_name": "os.listdir", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
9742693053
import pdftotext from urllib.request import urlopen,Request import io import re def helper(url): req = Request( url=url, headers={'User-Agent': 'Mozilla/5.0'} ) remote_file = urlopen(req).read() memory_file = io.BytesIO(remote_file) pdf = pdftotext.PDF(memory_file) content = '' for data in pdf: ...
ImAvinashSharma/plag-backendPy
pdfReader.py
pdfReader.py
py
394
python
en
code
0
github-code
97
[ { "api_name": "urllib.request.Request", "line_number": 7, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 11, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_number": 12, "usage_type": "call" }, { "api_name": "pdftotext.PDF...
42449835499
# This script scrapes statements and speeches from the g77. # You can run the script and write the contents out to a file # named g77_statements.csv using the command: # python scrape_g77_statements.py from selenium import webdriver from selenium.webdriver.common.keys import Keys import re, codecs # Create a headles...
kaneplusplus/akde-pubmed
united-nations/src/scrape_g77_statments.py
scrape_g77_statments.py
py
2,319
python
en
code
2
github-code
97
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "re.findall", "line_number": 28, "usage_type": "call" }, { "api_name": "codecs.open",...
72061438719
#!/usr/bin/env python # coding: utf-8 __author__ = "ChenyangGao <https://chenyanggao.github.io/>" __all__ = ["run"] from argparse import ArgumentParser, RawTextHelpFormatter def _init_command_line_options(): parser = ArgumentParser( description=""" 115 分享链接 webdav 挂载工具 源码地址:https://github.com/Chen...
ChenyangGao/web-mount-packs
python-115-share-link-webdav/cli.py
cli.py
py
6,898
python
en
code
31
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "argparse.RawTextHelpFormatter", "line_number": 18, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 98, "usage_type": "name" }, { "api_name": "util...
35637041884
""" check for memorization with min mse value between random sample and training data """ import os import random import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm from PIL import Image from skimage.metrics import mean_squared_error as mse if __name__ == "__main__": TRAIN_PATH = '/path/to/...
quental96/learnopencv-ddpm
tests/mse_min.py
mse_min.py
py
1,206
python
en
code
0
github-code
97
[ { "api_name": "random.randint", "line_number": 18, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 20, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_numbe...
73759782078
# -*- coding: utf-8 -*- import os import pytest from alchy.model import extend_declarative_base from intertwine import IntertwineModel, create_app, intertwine_db from intertwine.trackable import Trackable from config import ToxConfig @pytest.fixture(scope="module") def options(): """Capture configuration data a...
IntertwineIO/platform
tests/fixtures.py
fixtures.py
py
2,726
python
en
code
4
github-code
97
[ { "api_name": "config.ToxConfig", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_n...
26841374081
# ENGR2050_09_jasayles.py # Ethan Sayles # April 6, 2017 import numpy as np from matplotlib import pyplot as plt from scipy import stats as st #Class to plot the points and best fit lines of data class Plot(): def __init__(self, file): self.file = file def read_data(self): #Functi...
luna-sayles/engr-2050-project-9-spring-2017
ENGR2050_09_jasayles.py
ENGR2050_09_jasayles.py
py
1,708
python
en
code
0
github-code
97
[ { "api_name": "numpy.arange", "line_number": 29, "usage_type": "call" }, { "api_name": "scipy.stats.linregress", "line_number": 31, "usage_type": "call" }, { "api_name": "scipy.stats", "line_number": 31, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plo...
35170843417
import torch import unittest from tests.disc.testing_base import DiscTestCase class TestDiscBatchNorm(DiscTestCase): def _test_batchnorm(self, batchnorm_func, inp_test_data=None): if inp_test_data is not None: test_data = inp_test_data else: test_data = torch.randn([20, 16...
alibaba/BladeDISC
pytorch_blade/tests/disc/ops/test_batchnorm.py
test_batchnorm.py
py
2,182
python
en
code
707
github-code
97
[ { "api_name": "tests.disc.testing_base.DiscTestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.randn", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tor...
35277348535
import requests import json gqry = "gremlin=g.V().has('vertex_label','Version').has('pname',within('io.vertx:vertx-core')).in('has_dependency').values('sid')" payload = {'gremlin':gqry} url = 'http://bayesian-gremlin-http-saket-graph.dev.rdu2c.fabric8.io/' r = requests.post(url,data=json.dumps(payload)) sids = r.jso...
manjunath-s/temp-to-test
test-mathematical.py
test-mathematical.py
py
797
python
en
code
0
github-code
97
[ { "api_name": "requests.post", "line_number": 8, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 22, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": ...
74515634878
import pygame import math import random #set window pygame.init() WIDTH, HEIGHT = 700, 500 window = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption(("HangMan")) #loading images images = [] for i in range(7): image = pygame.image.load(str(i) + ".png") images.append(image) #Loading and proc...
IstiaqSiaam/Hangman
main.py
main.py
py
2,934
python
en
code
0
github-code
97
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.display.s...
39121832023
# Importing built-in modules from tkinter import * from PIL import ImageTk import pygame as p import sys # Importing self-defined modules from Chessopoly import * import Engine p.init() # BACKGROUND MUSICS def win_music(): '''Plays victpry.mp3 on victory of a team''' p.mixer.init()...
saifsafsf/Chessopoly
Modules.py
Modules.py
py
11,696
python
en
code
0
github-code
97
[ { "api_name": "pygame.init", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.mixer.init", "line_number": 18, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pygame.mixer.music.lo...
73145629439
from django.urls import path from . import views urlpatterns = [ path('', views.index, name = 'index'), path('panel/', views.panel, name = 'panel'), path('delete/<int:email_id>/', views.delete, name = 'delete'), path('sendemail/', views.send_mails, name = 'sendemail'), path('info/', views.info, name = 'info') ]
kdovlet777/generator
taslama/apps/questions/urls.py
urls.py
py
318
python
en
code
1
github-code
97
[ { "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", ...
32563555485
import pyodbc conn = pyodbc.connect('Driver={SQL Server};' 'Server=PC-TP3-02;' 'Database=BR_RK7_MAIN;' 'Trusted_Connection=yes;') print("Connected") cursor = conn.cursor() cursor.execute("select cast(cast(sqlquery as varbinary(max)) as nvarchar(max)) ...
romiy/pyreports
test1.py
test1.py
py
1,022
python
en
code
0
github-code
97
[ { "api_name": "pyodbc.connect", "line_number": 2, "usage_type": "call" } ]
23031298384
import tkinter as tk import yahoo_fin.stock_info as si from yahoo_fin import options import os import tkinter.font as tkFont # HEIGHT will be the height of the frame upon which elements # will be built HEIGHT = 350 # WIDTH will be the width of the frame upon which elements # will be built WIDTH = 500 # ...
rockywng/BlueChip
BlueChip.py
BlueChip.py
py
9,596
python
en
code
2
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
41732151536
from tools.engine import freeze_bn, custom_voc_evaluate from utils.backbone_utils import resnet_fpn_backbone from faster_rcnn import FasterRCNN, FastRCNNPredictor from faster_polar_rcnn import FasterPolarRCNN import _utils from datasets.data import get_dataset from run import get_transform from polar_net import PolarNe...
Chrisa142857/PolarNet-GCdet
Faster RCNN/test.py
test.py
py
2,717
python
en
code
9
github-code
97
[ { "api_name": "torch.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "thop.profile", "line_number": 18, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.cuda.set_device", "l...
74563146557
import requests from pyrogram import Filters, Message from rosebot import BOT from rosebot.helpers import ReplyCheck def define_word_ud(word): def get_data(word): r = requests.get( "http://api.urbandictionary.com/v0/define?term={}".format(word) ) if r.status_code == 200: ...
h4n1virus/RoseBot
rosebot/modules/ud.py
ud.py
py
1,906
python
en
code
4
github-code
97
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "rosebot.BOT", "line_number": 50, "usage_type": "name" }, { "api_name": "pyrogram.Message", "line_number": 50, "usage_type": "name" }, { "api_name": "rosebot.BOT.send_message", ...
7259502894
from __future__ import print_function import warnings from time import gmtime, strftime import traceback warnings.simplefilter("ignore", UserWarning) # cuDNN warning import logging import formatting logger_RNN = logging.getLogger('audioSR') logger_RNN.setLevel(logging.DEBUG) FORMAT = '[$BOLD%(filename)s$RESET:%(lin...
matthijsvk/multimodalSR
code/audioSR/RNN.py
RNN.py
py
12,116
python
en
code
56
github-code
97
[ { "api_name": "warnings.simplefilter", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.For...
651060642
from gi.repository import MyPaint def brushsetting_from_str(setting_str): return getattr(MyPaint.BrushSetting, "SETTING_" + setting_str.upper()) def set_base_value(brush, setting_str, value): setting = brushsetting_from_str(setting_str) return brush.set_base_value(setting, value) def get_base_value(brush...
manuq/xsheet
giutils.py
giutils.py
py
1,451
python
en
code
6
github-code
97
[ { "api_name": "gi.repository.MyPaint.BrushSetting", "line_number": 4, "usage_type": "attribute" }, { "api_name": "gi.repository.MyPaint", "line_number": 4, "usage_type": "name" }, { "api_name": "doctest.testmod", "line_number": 55, "usage_type": "call" } ]
27722580380
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Sep 30 08:37:41 2023 @author: admin """ import copy,random,pygame class Aliens(object): def __init__(self, k,openSpaces,row,column, pixel_w, pixel_h): self.k=k self.openSpaces = openSpaces self.alienSpaces = random.sample(se...
Harshith1234567/Invasion-of-the-Bot-Grabbers
aliens.py
aliens.py
py
1,846
python
en
code
0
github-code
97
[ { "api_name": "random.sample", "line_number": 14, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 36, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 37, "usage_type": "call" }, { "api_name": "random.shuffle", "line...
11226158153
import json class Asset(object): def __init__(self, name, age): self.name = name self.age = age def serialize(self): return json.dumps(self, default=lambda o: o.__dict__) if __name__ == '__main__': a = Asset('lee', 100.80) print(a.serialize())
rayest/python
property/serialize.py
serialize.py
py
290
python
en
code
0
github-code
97
[ { "api_name": "json.dumps", "line_number": 11, "usage_type": "call" } ]
29966529961
import numpy as np import torch import torch.nn.functional import torchvision.transforms import PSMNet.models # global preprocessing transform (from PSMNet Test_img.py) _normal_mean_var = {'mean': [0.485, 0.456, 0.406], 'std': [0.229, 0.224, 0.225]} _inference_transform = \ torchvision.transfo...
manoj-rajagopalan/stanford_cs231a_project
psm.py
psm.py
py
2,494
python
en
code
1
github-code
97
[ { "api_name": "torchvision.transforms.transforms.Compose", "line_number": 13, "usage_type": "call" }, { "api_name": "torchvision.transforms.transforms", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torchvision.transforms", "line_number": 13, "usage_type"...
27841572571
from tensorflow.keras.preprocessing.image import ImageDataGenerator import pandas as pd import numpy as np from data_loaders.utils import _getLabels from utils.paths import getDataDirectory import types def getData(dataset_name, test_dataset_name, label_set, get_batches_with_fake_waves_fn, dim=256): train_data ...
big-data-lab-umbc/big-data-reu
2022-projects/team-1/Other-Efforts/Synthetic-data-generation/data_loaders/minimal_load_localization_data.py
minimal_load_localization_data.py
py
1,743
python
en
code
2
github-code
97
[ { "api_name": "data_loaders.utils._getLabels", "line_number": 12, "usage_type": "call" }, { "api_name": "data_loaders.utils._getLabels", "line_number": 13, "usage_type": "call" }, { "api_name": "data_loaders.utils._getLabels", "line_number": 14, "usage_type": "call" }, ...
23945295912
import json import time import base64 import xml.etree.ElementTree as ET from pymisp import MISPEvent, MISPObject misperrors = {'error': 'Error'} moduleinfo = {'version': 1, 'author': 'Christian Studer', 'description': 'Import from GoAML', 'module-type': ['import']} moduleconfig = [] mispat...
MISP/misp-modules
misp_modules/modules/import_mod/goamlimport.py
goamlimport.py
py
10,034
python
en
code
310
github-code
97
[ { "api_name": "pymisp.MISPEvent", "line_number": 81, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 84, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 84, "usage_type": "name" }, { "api_name"...
30020717366
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Nov 6 15:00:41 2023 @author: maggie clarke Step #1 Append task data files, perform tSSS & movement compensation """ import mne import os import os.path as op from mne.preprocessing import maxwell_filter, compute_average_dev_head_t from mne.chpi import...
mdclarke/Im-Lab
VML_task_preprocessing_1.py
VML_task_preprocessing_1.py
py
3,556
python
en
code
0
github-code
97
[ { "api_name": "os.path.join", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, ...
30514380734
#!/usr/bin/env python # coding: utf-8 # In[1]: #jaiiii sri ram # In[2]: #steps ''' 1.input raw data 2.tokenizing 3.textcleaning - remove punctuations - remove stopwords - stemming/lemmatization 4.vectorization 5.modelling 6.accuracy and final model ''' # # BUSINESS PROBLEM UNDERSTANDING # In[3]: ...
srichar0n/feedback_sentimental_analysis
sentimental_analysis_feedback.py
sentimental_analysis_feedback.py
py
4,036
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 47, "usage_type": "call" }, { "api_name": "nltk.stem.PorterStemmer", "line_number": 85, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 93, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords....
11647213090
#Python 2.x program to transcribe an Audio file import speech_recognition as sr from gtts import gTTS import os AUDIO_FILE = ("Recording.wav") # use the audio file as the audio source r = sr.Recognizer() with sr.AudioFile(AUDIO_FILE) as source: #reads the audio file. Here we use record instead of #listen a...
Vipulgarg662/Project_data
speech_recog_from_file.py
speech_recog_from_file.py
py
800
python
en
code
0
github-code
97
[ { "api_name": "speech_recognition.Recognizer", "line_number": 9, "usage_type": "call" }, { "api_name": "speech_recognition.AudioFile", "line_number": 11, "usage_type": "call" }, { "api_name": "speech_recognition.UnknownValueError", "line_number": 20, "usage_type": "attrib...
2520215214
from pathlib import Path import pandas as pd import nltk from nltk.corpus import stopwords from nltk.stem.wordnet import WordNetLemmatizer import string # Importing Gensim import gensim from gensim import corpora # to suppress warnings from warnings import filterwarnings filterwarnings('ignore') pr...
utkarshbelkhede/NLP
datasets/topic_modeling_snippet.py
topic_modeling_snippet.py
py
1,714
python
en
code
0
github-code
97
[ { "api_name": "warnings.filterwarnings", "line_number": 15, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.read_excel",...
71831619838
## # CPCantalapiedra 2021 from io import StringIO import math import multiprocessing import sys import numpy as np import pandas as pd from pastml.acr import pastml_pipeline, acr, _validate_input from pastml.ml import MPPA from pastml.models.f81_like import F81 ## ## ACR functions ## ## # Compute ACR def compute_...
Cantalapiedra/delta-py
delta.py
delta.py
py
10,637
python
en
code
0
github-code
97
[ { "api_name": "pastml.ml.MPPA", "line_number": 26, "usage_type": "name" }, { "api_name": "pastml.models.f81_like.F81", "line_number": 27, "usage_type": "name" }, { "api_name": "sys.stderr", "line_number": 29, "usage_type": "attribute" }, { "api_name": "pastml.acr....
33029283255
#-*-coding:utf-8-*- # 游戏主程序 from gui.graph import * from pygame.locals import * import pygame from sys import exit from tools.game import Game from gui.graph import Graph from gui.lost import Lost from gui.win import Win from gui.welcome import Welcome row=4# 行数 gb=Game(row,True) gb.start_test() gr=Graph(row) gr.sta...
lavotap/2048
2048.py
2048.py
py
1,665
python
en
code
0
github-code
97
[ { "api_name": "tools.game.Game", "line_number": 16, "usage_type": "call" }, { "api_name": "gui.graph.Graph", "line_number": 18, "usage_type": "call" }, { "api_name": "gui.welcome.Welcome", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.event.get"...
72616499839
from typing import List from fastapi import Depends, Request, APIRouter from pydantic import BaseModel from sqlalchemy.orm import Session from auth.database import User from models.models import * from fastapi.templating import Jinja2Templates templates = Jinja2Templates(directory="templates") router = APIRouter() ...
lucorus/fastapi_project
html_templates.py
html_templates.py
py
2,494
python
en
code
0
github-code
97
[ { "api_name": "fastapi.templating.Jinja2Templates", "line_number": 10, "usage_type": "call" }, { "api_name": "fastapi.APIRouter", "line_number": 11, "usage_type": "call" }, { "api_name": "fastapi.Request", "line_number": 15, "usage_type": "name" }, { "api_name": "...
13537072504
from sklearn import datasets from sklearn.neighbors import KNeighborsClassifier da=datasets.load_iris() print(da.keys()) print(da.DESCR) s1=da.data s2=da.target model=KNeighborsClassifier() model.fit(s1,s2) y1=model.predict([[4,5,6,7]]) print(y1)
rishi4758/machine-learning-programmes-and-projects
programme/classifier using k nearest.py
classifier using k nearest.py
py
258
python
en
code
3
github-code
97
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 3, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 3, "usage_type": "name" }, { "api_name": "sklearn.neighbors.KNeighborsClassifier", "line_number": 8, "usage_type": "call" } ]
6003393998
from PIL import Image #import skimage as sk #from skimage import io as sk_io #import cv2 import os import numpy as np import matplotlib.pyplot as plt from matplotlib import image as mp_image import tkinter as tk from tkinter import filedialog root = tk.Tk() root.withdraw() #file_path = filedialog.askopenfilename() ...
shevious/webstudy
deep/image-handle/file-open.py
file-open.py
py
1,341
python
en
code
0
github-code
97
[ { "api_name": "tkinter.Tk", "line_number": 14, "usage_type": "call" }, { "api_name": "tkinter.filedialog.askopenfilenames", "line_number": 18, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 18, "usage_type": "name" }, { "api_name": "PIL...
36248083460
from numpy import genfromtxt import csv import numpy as np import math import matplotlib.pyplot as plt import copy import random import torch from torch import nn import datetime def read_csv(filename): with open(filename, newline='') as f_input: data = [] i=0 for row in csv.reader(f_input...
AhmedMasryKU/Machine-Learning
Assignment 6/hw6.py
hw6.py
py
15,523
python
en
code
0
github-code
97
[ { "api_name": "csv.reader", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 25, "usage_type": "attribute" }, { "api_name": "torch.nn.Sequential", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.nn", "line_num...
13207969886
import cv2 import imutils import matplotlib.pyplot as plt import numpy as np def midPoint(ptA, ptB): return ((ptA[0] + ptB[0]) * 0.5, (ptA[1] + ptB[1]) * 0.5) def preparedImgForCntr(img): # preparing image for contour detction gray = cv2.cvtColor(img.copy(), cv2.COLOR_BGR2GRAY) # converting im...
Mostafa-wael/The-blue-square-problem
theBlueSquare.py
theBlueSquare.py
py
8,882
python
en
code
2
github-code
97
[ { "api_name": "cv2.cvtColor", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cv2.GaussianBlur", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.Canny", ...
26318325104
from enum import Enum from typing_extensions import Final class GCODE(str, Enum): HOME = "G28.2" MOVE = "G0" DWELL = "G4" CURRENT_POSITION = "M114.2" LIMIT_SWITCH_STATUS = "M119" PROBE = "G38.2" ABSOLUTE_COORDS = "G90" RELATIVE_COORDS = "G91" RESET_FROM_ERROR = "M999" PUSH_SPE...
Opentrons/opentrons
api/src/opentrons/drivers/smoothie_drivers/constants.py
constants.py
py
2,387
python
en
code
363
github-code
97
[ { "api_name": "enum.Enum", "line_number": 6, "usage_type": "name" }, { "api_name": "typing_extensions.Final", "line_number": 41, "usage_type": "name" }, { "api_name": "typing_extensions.Final", "line_number": 50, "usage_type": "name" } ]
35449258371
from pydantic import BaseModel, Field from kubernetes.client.rest import ApiException class InputSchema(BaseModel): k8s_cli_string: str = Field( title='Kubectl Command', description='kubectl execute a command in pod', default='kubectl exec {pod_name} {command} -n {namespace}' ) pod...
unskript/Awesome-CloudOps-Automation
Kubernetes/legos/k8s_kubectl_exec_command/k8s_kubectl_exec_command.py
k8s_kubectl_exec_command.py
py
1,951
python
en
code
258
github-code
97
[ { "api_name": "pydantic.BaseModel", "line_number": 5, "usage_type": "name" }, { "api_name": "pydantic.Field", "line_number": 6, "usage_type": "call" }, { "api_name": "pydantic.Field", "line_number": 11, "usage_type": "call" }, { "api_name": "pydantic.Field", "...
23677479508
from authtools.views import LoginRequiredMixin from django.core.urlresolvers import reverse_lazy from django.views.generic import ListView, CreateView from . import models class HomeView(LoginRequiredMixin, ListView): model = models.Expense def get_queryset(self): return super().get_queryset().filte...
hackita02/ExMan
expenses/views.py
views.py
py
756
python
en
code
1
github-code
97
[ { "api_name": "authtools.views.LoginRequiredMixin", "line_number": 8, "usage_type": "name" }, { "api_name": "django.views.generic.ListView", "line_number": 8, "usage_type": "name" }, { "api_name": "authtools.views.LoginRequiredMixin", "line_number": 19, "usage_type": "nam...
31224753295
import sys import requests if __name__ == "__main__": order = sys.argv[1].lower() user = None users = None if order == "get_json": resp = requests.get("http://localhost:5000/api/users/1") user = resp.json() elif order == "list_json": resp = requests.get("http://localhost:5...
linuxacademy/content-working-with-restful-apis-with-python
json_requests.py
json_requests.py
py
1,232
python
en
code
1
github-code
97
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.post", "line_numb...
13079108122
from tkinter import * from tkinter import messagebox from tkinter.filedialog import askopenfilename from pdf2image import convert_from_path def pdf2img_converter(): try: # convert_from_path will get the PDF file from the entry widget we created in GUI. imgs = convert_from_path(str(entry.get())) ...
rohan-kiratsata/img2pdf-converter-tkinter
main.py
main.py
py
2,769
python
en
code
0
github-code
97
[ { "api_name": "pdf2image.convert_from_path", "line_number": 10, "usage_type": "call" }, { "api_name": "tkinter.messagebox.showinfo", "line_number": 20, "usage_type": "call" }, { "api_name": "tkinter.messagebox", "line_number": 20, "usage_type": "name" }, { "api_na...
31440381007
import numpy as np import time from sklearn import preprocessing import os.path import re import pandas as pd import random from dtw import dtw from sklearn.cluster import DBSCAN import matplotlib.pyplot as plt from autoencoder import AutoEncoder from lstm_ad import LSTMAD from lstm_enc_dec_axl import LSTMED from rnn_...
hren828/760-research-project-code-and-data
Code/DNN_cluster_noise_experiment.py
DNN_cluster_noise_experiment.py
py
6,250
python
en
code
0
github-code
97
[ { "api_name": "os.path.walk", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 33, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScal...
14801676521
import turtle import math import random import datetime def tleft(): # 左に回転 my_turtle.left(10) def tright(): # 右に回転 my_turtle.right(10) def tup(): # スピードアップ global step if step <= 10: step += 1 def tdown(): # スピードダウン global step if step > 0: step -= 1 def is_...
watorutart/python_prog
targetGame.py
targetGame.py
py
4,107
python
ja
code
0
github-code
97
[ { "api_name": "math.sqrt", "line_number": 28, "usage_type": "call" }, { "api_name": "math.pow", "line_number": 29, "usage_type": "call" }, { "api_name": "turtle.xcor", "line_number": 29, "usage_type": "call" }, { "api_name": "math.pow", "line_number": 30, ...
12611443590
# -*- coding: utf-8 -*- """Create instance of vrayscene.""" import os import json import appdirs import requests from maya import cmds import maya.app.renderSetup.model.renderSetup as renderSetup from openpype.hosts.maya.api import ( lib, plugin ) from openpype.settings import ( get_system_settings, g...
vino2307/OpenPype
openpype/hosts/maya/plugins/create/create_vrayscene.py
create_vrayscene.py
py
9,836
python
en
code
null
github-code
97
[ { "api_name": "openpype.hosts.maya.api.plugin.Creator", "line_number": 28, "usage_type": "attribute" }, { "api_name": "openpype.hosts.maya.api.plugin", "line_number": 28, "usage_type": "name" }, { "api_name": "maya.app.renderSetup.model.renderSetup.instance", "line_number": 4...
25480925369
from django import forms from .models import ColorPickerImageHolder # В этом разделе создаются формы для html-страниц # Создаем класс формы, который связан с моделью ColorPickerImageHolder из базы данных class ImageUploadForm(forms.ModelForm): class Meta: # Связываем данную форму с моделью ColorPicker...
IgorVeshkin/Django_colorpicker
ColorPicker_Django/ColorPicker/forms.py
forms.py
py
1,518
python
ru
code
0
github-code
97
[ { "api_name": "django.forms.ModelForm", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 10, "usage_type": "name" }, { "api_name": "models.ColorPickerImageHolder", "line_number": 16, "usage_type": "name" }, { "api_name":...
13723344292
#!/usr/bin/env python3 import cgi import cgitb import sys import sqlite3 cgitb.enable() def get_24hour(hour, period): """ Converts 12-hour time string to 24-hour :param hour: string :param period: either 'AM' or 'PM' string :return: 24-hour string """ if period == "PM": if hour != ...
colin-pm/indra_server
cgi-bin/schedule_watering.py
schedule_watering.py
py
3,994
python
en
code
0
github-code
97
[ { "api_name": "cgitb.enable", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.stdout.flush", "line_number": 48, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 48, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "l...
34149100717
import numpy as np from matplotlib import pyplot as plt from matplotlib import animation, rc from shapely.geometry import Point, LineString from HamSandwich.GeomUtils import * def prepare_axis(min_x=-10,max_x=10,min_y=-10,max_y=10): plt.grid(True,which='major') ax = plt.gca() min_x = int(min_x) max...
samsledje/HamSandwichViz
HamSandwich/PlotUtils.py
PlotUtils.py
py
3,228
python
en
code
1
github-code
97
[ { "api_name": "matplotlib.pyplot.grid", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.gca", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotli...
7140193371
from __future__ import ( annotations, ) import hashlib import hmac from io import ( BytesIO, ) from typing import ( Generic, ) from btctoy.codec import ( encode_base58_checksum, ) from btctoy.crypto.prime import ( is_prime, ) from btctoy.crypto.types import ( FieldElementT, ) # Secp256k1 ECDS...
Damag3dRoot/projectcrypto
src/btctoy/crypto/__init__.py
__init__.py
py
13,793
python
en
code
0
github-code
97
[ { "api_name": "btctoy.crypto.types.FieldElementT", "line_number": 36, "usage_type": "name" }, { "api_name": "hashlib.new", "line_number": 43, "usage_type": "call" }, { "api_name": "hashlib.sha256", "line_number": 43, "usage_type": "call" }, { "api_name": "hashlib....
38838343642
from django import forms from .models import * from .widget import * from django.utils.translation import gettext_lazy as _ class EngagementForm(forms.ModelForm): class Meta: model = Engagement fields = ['provider', 'parent', 'start_date', 'time_code', 'fye', 'type'] w...
rgienko/tande
app/forms.py
forms.py
py
3,648
python
en
code
0
github-code
97
[ { "api_name": "django.forms.ModelForm", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 8, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 21, "usage_type": "attribute" }, { "api_name": "dj...
9693643552
import numpy as np from joblib import Parallel, delayed from scipy.interpolate import interp1d from scipy.special import erf, erfinv from sklearn.base import BaseEstimator, TransformerMixin from sklearn.utils.validation import FLOAT_DTYPES, check_array, check_is_fitted class GaussRankScaler(BaseEstimator, Transformer...
aldente0630/gauss-rank-scaler
gauss_rank_scaler.py
gauss_rank_scaler.py
py
5,590
python
en
code
62
github-code
97
[ { "api_name": "sklearn.base.BaseEstimator", "line_number": 9, "usage_type": "name" }, { "api_name": "sklearn.base.TransformerMixin", "line_number": 9, "usage_type": "name" }, { "api_name": "sklearn.utils.validation.check_array", "line_number": 66, "usage_type": "call" }...
6218470287
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import pandas as pd from scipy.stats import binom from scipy.stats import poisson # In[2]: def combinations(n, k): return (np.math.factorial(n)/(np.math.factorial(k)*np.math.factorial(n-k))) # In[3]: p1 = binom.pmf(0,5000,0.0004) # In[...
NikitaX007/Math_sem_2
Task_2.py
Task_2.py
py
956
python
ru
code
0
github-code
97
[ { "api_name": "numpy.math.factorial", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.math", "line_number": 17, "usage_type": "attribute" }, { "api_name": "scipy.stats.binom.pmf", "line_number": 23, "usage_type": "call" }, { "api_name": "scipy.stat...
29883973899
def euclid_minus(x,y): while (y): if x>y: x,y=y,x-y else: x,y=y-x,x return x def euclid_div(x,y): while(y): x,y=y,x%y return x def chance(a,b): from fractions import Fraction cnt=0 for i in range(a+1,b+1): res=[] for j in range(1,i+1): ...
seungyeonhdata/TIL
PythonBasic/py/day26practice.py
day26practice.py
py
717
python
en
code
0
github-code
97
[ { "api_name": "fractions.Fraction", "line_number": 23, "usage_type": "call" } ]
41622590519
import base64 import logging import os import subprocess import sys import tempfile import unittest from PIL import Image from PIL import ImageChops import z3c.rml.tests from z3c.rml import rml2pdf LOG_FILE = os.path.join(os.path.dirname(__file__), 'render.log') def gs_command(path): return ('gs', '-q', '-sNO...
zopefoundation/z3c.rml
src/z3c/rml/tests/test_rml.py
test_rml.py
py
6,051
python
en
code
97
github-code
97
[ { "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": "unittest.TestCase", "li...
3933008552
''' Airmass related funcitons. Don't you think these must be implemented to astropy...? ''' from warnings import warn import numpy as np from astropy.io import fits from astropy import units as u from astropy.coordinates import AltAz, EarthLocation, SkyCoord from astropy.io.fits import Card from astropy.time import T...
ysBach/ysfitsutilpy
ysfitsutilpy/airmass.py
airmass.py
py
14,898
python
en
code
5
github-code
97
[ { "api_name": "numpy.cos", "line_number": 66, "usage_type": "call" }, { "api_name": "numpy.deg2rad", "line_number": 66, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 68, "usage_type": "call" }, { "api_name": "astropy.time.Time", "line_numb...
5147895986
''' Created on Jan 24, 2019 @author: GANESHRAM KANAKASABAI ''' from labs.common import ConfigUtil from labs.common import ConfigConst import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText ''' creating a class smtpClientConnector ''' class SmtpClientConnector(obje...
GANESHRAMKANAKASABAI1996/CONNECTED-DEVICES-_PYTHON
apps/labs/module02/SmtpClientConnector.py
SmtpClientConnector.py
py
2,137
python
en
code
0
github-code
97
[ { "api_name": "labs.common.ConfigUtil.ConfigUtil", "line_number": 18, "usage_type": "call" }, { "api_name": "labs.common.ConfigUtil", "line_number": 18, "usage_type": "name" }, { "api_name": "labs.common.ConfigConst.ConfigConst", "line_number": 27, "usage_type": "attribut...
72561932160
import os from collections import OrderedDict from configparser import RawConfigParser from importlib.metadata import PackageNotFoundError, version from django.core.checks import Error from df_config.checks import missing_package, settings_check_results from df_config.config.dynamic_settings import ExpandIterable fro...
d9pouces/df_config
df_config/guesses/apps.py
apps.py
py
7,123
python
en
code
5
github-code
97
[ { "api_name": "configparser.RawConfigParser", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "df_config.ch...
32362254762
from multiprocessing import Process, freeze_support import time import screen import glob def main(): freeze_support() scr = screen.Screen() scr_t = Process(target=scr.start, args=('test.yaml',)) scr_t.start() #Test glob.set_variable('venta', 0) while True: time.sleep(.1) ...
checor/Pygame-SSUI
main.py
main.py
py
469
python
en
code
2
github-code
97
[ { "api_name": "multiprocessing.freeze_support", "line_number": 10, "usage_type": "call" }, { "api_name": "screen.Screen", "line_number": 11, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 12, "usage_type": "call" }, { "api_name": "...
40295239570
import configargparse import torch import torchvision import torch.nn as nn from torch.utils.data import Dataset, DataLoader from sklearn.model_selection import train_test_split import numpy as np import json import os import matplotlib.pyplot as plt import tqdm device = torch.device( 'cuda') if torch...
Ljy2003/SleepStageClassify
transformer.py
transformer.py
py
4,941
python
en
code
0
github-code
97
[ { "api_name": "torch.cuda.is_available", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.device", ...
32150758893
# HTMLTestRunner是基于unittest框架的一个扩展,可以自己在网上自行下载 import os import smtplib import unittest import time from email.header import Header from email.mime.text import MIMEText from lib.HTMLTestRunner import HTMLTestRunner def send_mail(path): f = open(path,'rb') # 要读的内容 二进制格式 mail_body = f.read() # 读取html报告的内容,作为...
zhangbaosong/Weekend1118
html_run_all_test_cases.py
html_run_all_test_cases.py
py
4,914
python
zh
code
0
github-code
97
[ { "api_name": "email.mime.text.MIMEText", "line_number": 21, "usage_type": "call" }, { "api_name": "email.header.Header", "line_number": 26, "usage_type": "call" }, { "api_name": "smtplib.SMTP", "line_number": 44, "usage_type": "call" }, { "api_name": "time.strfti...
17206305185
import utility as utl import torchnet.meter as tnt import performance_tracker as pt import checkpoint as ckpt import summary import sensitivity_analysis as sa import collector import logging import config import math import time import random from collections import OrderedDict from torch.autograd import Variabl...
bwtseng/Object-Detection
train.py
train.py
py
20,013
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 26, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 37, "usage_type": "call" }, { "api_name": "uti...
74653653117
from datetime import datetime, timezone from random import randint, shuffle import config daily_water_consumption_avg = 330 daily_water_consumption_in_percentage = (1.5, 0.5, 0.5, 0.5, 1.0, 2.0, 2.5, 4.0, 6.0, 7.0, 6.0, 7.0, 6.0, 5.5, 4.0, 2.0, 6.0, 7.5, 8.0, 7.5, 5.5, 5.5, 2...
MjStryker/eco-device
src/dev.py
dev.py
py
3,924
python
en
code
1
github-code
97
[ { "api_name": "config.delay", "line_number": 13, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 19, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 25, "usage_type": "call" }, { "api_name": "random.randint", ...
3830336706
import hashlib import json import logging from decimal import Decimal from functools import wraps from typing import Callable, Optional from django.conf import settings from django.core.cache import caches from helpers.json import CustomJSONEncoder from rest_framework.request import Request from rest_framework.respons...
icha0s/django-template
{{cookiecutter.project_name}}/app/helpers/cache_decorator.py
cache_decorator.py
py
4,050
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "rest_framework.request.Request", "line_number": 32, "usage_type": "name" }, { "api_name": "functools.wraps", "line_number": 31, "usage_type": "call" }, { "api_name": "rest...
71057803838
import sys import os import argparse import time import torch import models.losses as ls #import models.train as tr from tqdm import tqdm from typing import Callable, List, Optional, Iterator, Tuple, NamedTuple, Union import random from ithemal_utils import * import training import pandas as pd #import utilities as ut...
junshim/ithemal2_js
ithemal_LSTM/run_ithemal.py
run_ithemal.py
py
5,480
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "training.load_trainer", "line_number": 92, "usage_type": "call" }, { "api_name": "training.load_continue", "line_number": 104, "usage_type": "call" } ]
31284829015
import webbrowser from PySide6 import QtCore, QtWidgets from mapclientplugins.sparccurationhelperstep.ui_sparccurationhelperwidget import Ui_SparcCurationHelperWidget from sparc.curation.tools.utilities import convert_to_bytes from sparc.curation.tools.ondisk import OnDiskFiles class SparcCurationHelperWidget(QtWid...
mapclient-plugins/mapclientplugins.sparccurationhelperstep
mapclientplugins/sparccurationhelperstep/sparccurationhelperwidget.py
sparccurationhelperwidget.py
py
1,627
python
en
code
0
github-code
97
[ { "api_name": "PySide6.QtWidgets.QWidget", "line_number": 10, "usage_type": "attribute" }, { "api_name": "PySide6.QtWidgets", "line_number": 10, "usage_type": "name" }, { "api_name": "mapclientplugins.sparccurationhelperstep.ui_sparccurationhelperwidget.Ui_SparcCurationHelperWidg...
40571047962
from dataclasses import field from rest_framework import serializers from .models import Chat, Message from django.contrib.auth.models import User from django.db import transaction class ChatViewSerializer(serializers.ModelSerializer): users = serializers.PrimaryKeyRelatedField(many=True, que...
burdyniuk/messenger
messenger_backend/chat/serializers.py
serializers.py
py
2,630
python
en
code
0
github-code
97
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 7, "usage_type": "name" }, { "api_name": "rest_framework.serializers.PrimaryKeyRelatedField", "line_number": 8...
31205530588
import numpy as np import matplotlib.pyplot as plt import glob import os import csv from scipy.signal import savgol_filter from numpy import mean txtfiles=[] def getFiles(): for file in glob.glob("*.txt"): txtfiles.append(file) def openFile(): for i in range (txtfiles.__len__()): print("Pres...
cm2617/ART-authentication-device
signal_processing.py
signal_processing.py
py
5,810
python
en
code
0
github-code
97
[ { "api_name": "glob.glob", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.Inf", "line_number": 60, "usage_type": "attribute" }, { "api_name": "numpy.Inf", "line_number": 72, "usage_type": "attribute" }, { "api_name": "numpy.Inf", "line_number"...
42388780536
from sqlalchemy_declarative import Person, Base, Address from sqlalchemy import create_engine engine = create_engine('sqlite:///sqlalchemy_example.db') Base.metadata.bind = engine from sqlalchemy.orm import sessionmaker DBSession = sessionmaker() DBSession.bind = engine session = DBSession() # Make a query to f...
SergiSM/Raspberry
SQLAlchemy/query.py
query.py
py
946
python
en
code
3
github-code
97
[ { "api_name": "sqlalchemy.create_engine", "line_number": 3, "usage_type": "call" }, { "api_name": "sqlalchemy_declarative.Base.metadata", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sqlalchemy_declarative.Base", "line_number": 4, "usage_type": "name" }...
32037092897
#!/usr/bin/env python import os import sys from troposphere import ( Parameter, Template, Output, GetAtt, Tags, Join, Ref, Sub, FindInMap, ) from troposphere import ( Equals, Not, Condition ) from troposphere.ssm import ( Parameter as SSMParam ) from troposphere.servicedisco...
lambda-my-aws/cfnmacro-vpc
vpc.py
vpc.py
py
12,110
python
en
code
0
github-code
97
[ { "api_name": "troposphere.Template", "line_number": 58, "usage_type": "call" }, { "api_name": "troposphere.ec2.VPC", "line_number": 63, "usage_type": "call" }, { "api_name": "troposphere.Tags", "line_number": 68, "usage_type": "call" }, { "api_name": "troposphere...
22339817744
from Estimator.geo_estimator import GeoEstimator import numpy as np from numpy.linalg import inv import matplotlib.pyplot as plt class Circle2D(GeoEstimator): def __init__(self, x_data, y_data, n): super().__init__(x_data, y_data, n) self.num_points_per_model = 3 def find_model(self, sample):...
brachahold/Briefcam_Core_Project
Estimator/circle2d.py
circle2d.py
py
1,309
python
en
code
0
github-code
97
[ { "api_name": "Estimator.geo_estimator.GeoEstimator", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.lin...
38760053876
import os import nmap print("hello world") a = [1, 3, 5, 8] #print(a) ''' for i in a: print(i) a = 2 b = 2 if a == b : print('equal') ''' #files = os.system('ls') #for file in files: #print(files) def sum(first, second, **kwargs): return first + second #print(dir(os)) #print(sum(2, 5)) ''' class...
susankoju/practice
py/basic.py
basic.py
py
882
python
en
code
0
github-code
97
[ { "api_name": "os.system", "line_number": 78, "usage_type": "call" }, { "api_name": "nmap.PortScannerAsync", "line_number": 81, "usage_type": "call" } ]
20209808581
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Dec 1 16:26:35 2018 @author: user1 """ import tensorflow as tf from PIL import Image import numpy as np INPUT_SHAPE = (299,299,3) trainf = tf.python_io.tf_record_iterator("../input_tf/Train-1.tfrecords") ite = next(trainf) def augment(image): im...
meitetsu3/HumanProtain
code/Test.py
Test.py
py
3,110
python
en
code
0
github-code
97
[ { "api_name": "tensorflow.python_io.tf_record_iterator", "line_number": 14, "usage_type": "call" }, { "api_name": "tensorflow.python_io", "line_number": 14, "usage_type": "attribute" }, { "api_name": "tensorflow.image.random_flip_left_right", "line_number": 18, "usage_typ...
12506555107
import qrcode from tempfile import NamedTemporaryFile from reportlab.lib.pagesizes import letter from reportlab.lib.units import inch from reportlab.pdfgen import canvas # Function to generate a QR code image def generate_qr_code_image(data, scale): qr = qrcode.QRCode( version=1, error_...
Epic-Fox-1234/PDF-QRCode-Gen
generator.py
generator.py
py
1,712
python
en
code
0
github-code
97
[ { "api_name": "qrcode.QRCode", "line_number": 10, "usage_type": "call" }, { "api_name": "qrcode.constants", "line_number": 12, "usage_type": "attribute" }, { "api_name": "reportlab.pdfgen.canvas.Canvas", "line_number": 28, "usage_type": "call" }, { "api_name": "re...
23447285368
"""Calculate statistics on simulated example. This program uses the functions in :file:`get_T.py` to calculate the t-statistics of 2 arrays. The results are saved in bin. the files used will be downloaded if they are not in the working directory of the IPython engines. """ from __future__ import print_function from I...
jesong1126/PermuStat
hpc/parallelsmall.py
parallelsmall.py
py
1,496
python
en
code
0
github-code
97
[ { "api_name": "numpy.arange", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 17, "usage_type": "call" }, { "api_name": "IPython.parallel.Client", "line_number": 22, "usage_type": "call" }, { "api_name": "permustat.perm_t.ge...
38555691892
# -*- coding: utf-8 -*- """ Created on Fri Feb 10 14:34:25 2023 @author: MICRO """ import cv2 from matplotlib import pyplot as plt import numpy as np x=np.arange(256) y=np.sin(2*np.pi*x/50) y+=max(y) y_img=np.array([[y[j]*127 for j in range(256)] for i in range(256)],dtype=np.uint8) plt.imshow(y_img) img=cv2.imr...
yewinhtet04/IMAGE-with-Python
tuto40fourier_transform.py
tuto40fourier_transform.py
py
748
python
en
code
0
github-code
97
[ { "api_name": "numpy.arange", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number":...
70653651520
import prompter from pdfminer.high_level import extract_text from connection import ask def run(): prompt = """ The following file is a class study plan. Please provide some recommendations considering the following information: """ #map subject to subject enum text = extract_text("api/...
Oscar6647/Stemist-Hack-2.0
api/fileparser.py
fileparser.py
py
384
python
en
code
1
github-code
97
[ { "api_name": "pdfminer.high_level.extract_text", "line_number": 13, "usage_type": "call" }, { "api_name": "connection.ask", "line_number": 17, "usage_type": "call" } ]
17084875846
from config import * from utilities import * import random import tweepy #driver.get(twitter_url) products = list( db.products.find( {'published_at': False, 'discount_percentage' : {'$gt': 20} } ).limit(25) ) # personal information consumer_key ="" consumer_secret ="" access_token ="" access_token_secret ="" # aut...
aashrafh/Electron
twitter.py
twitter.py
py
1,499
python
en
code
0
github-code
97
[ { "api_name": "tweepy.OAuthHandler", "line_number": 15, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 18, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 26, "usage_type": "call" }, { "api_name": "tweepy.TweepError", ...
14460011551
# coding: utf-8 # In[ ]: import telebot import requests as re import math as m from telebot import types from bs4 import BeautifulSoup # In[ ]: def ChistoEvents(): from bs4 import BeautifulSoup import requests html_doc = requests.get("https://www.2do2go.ru/smr/events/today") soup = BeautifulSou...
ruslan123332/HackathonSamaraInfo
bot.py
bot.py
py
7,327
python
en
code
1
github-code
97
[ { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 39, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
73030094399
from flask_restx.namespace import Namespace from flask import request from flask_jwt_extended import jwt_required, get_jwt_identity from services import compilation_service, check_page from .utils import OptionsResource from models import required_query_params from models.compilation_model import album_model, yt_compi...
kvirikroma/metal-in-blood
apis/compilation_api.py
compilation_api.py
py
3,912
python
en
code
0
github-code
97
[ { "api_name": "flask_restx.namespace.Namespace", "line_number": 11, "usage_type": "call" }, { "api_name": "models.compilation_model.album_model", "line_number": 15, "usage_type": "argument" }, { "api_name": "models.compilation_model.yt_compilation_model", "line_number": 20, ...
32296820467
#GAME OF LIFE import os import copy import pygame import module_button #Display #------ #Colors #------ BLACK = (0, 0, 0) GREY=(50,50,50) WHITE = (255, 255, 255) BLUE=(127,255,212) #-------------- #Box Dimensions #-------------- WIDTH = 9 HEIGHT = 9 MARGIN = 1 #----------------- #Button Dimensions #----------------- B_...
vaibhav20325/GameOfLife
GameOfLife.py
GameOfLife.py
py
10,402
python
en
code
0
github-code
97
[ { "api_name": "os.walk", "line_number": 31, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 39, "usage_type": "call" }, { "api_name": "pygame.image.load", "line_number": 44, "usage_type": "call" }, { "api_name": "pygame.image", "line_number...
6652453289
import torch import torch.nn.functional as F from torch.autograd import Variable as Var from tqdm import tqdm from . import utils from . import Constants class Trainer(object): def __init__(self, args, model, embeddings, vocabs, criterion, optimizer): super(Trainer, self).__init__() self.args = ar...
ram-g-athreya/RNN-Question-Answering-Similarity
treelstm/trainer.py
trainer.py
py
4,448
python
en
code
0
github-code
97
[ { "api_name": "torch.tensor", "line_number": 47, "usage_type": "call" }, { "api_name": "torch.nn.functional.torch.sum", "line_number": 48, "usage_type": "call" }, { "api_name": "torch.nn.functional.torch", "line_number": 48, "usage_type": "attribute" }, { "api_nam...
5239167685
import anndata import numpy as np import pandas as pd import patsy import random from scipy.stats import rankdata from scipy.linalg import svd def calc_res(X, H): return X - (H @ X.T).T def calc_dstat(res, idx): u, s, v = svd(res) return s[:idx]**2/np.sum(s[:idx]**2) def num_sv(adata, model_matrix, meth...
illumination-k/pysva
pysva/num_sv.py
num_sv.py
py
1,762
python
en
code
0
github-code
97
[ { "api_name": "scipy.linalg.svd", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", "line...
6574935638
import sys sys.path.append("..") from config import load_config from collections import Counter def count_objects(model, video_path, config='default.yaml', **kwargs): """ Count objects on video, using unique IDs :param model: model object :param video_path: path to the video :param config: confi...
Poseidondon/RailcarTracking
tracker/object_counter.py
object_counter.py
py
1,309
python
en
code
0
github-code
97
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "config.load_config", "line_number": 23, "usage_type": "call" }, { "api_name": "collections.Counter", ...
4989820856
#import iso_handling #import pal5_mock_ps import scipy import scipy.signal import csv labels=['CFHT','LSST 1-year','LSST 10-year','WFIRST'] colors=['seagreen','firebrick', 'slateblue', 'darkorange'] ################### # Start with CDM-like dire = '/Users/hendel/projects/streamgaps/streampepper/' xi_wfirst = scipy....
davidhendel/forecast
abc_comparison_figures.py
abc_comparison_figures.py
py
15,347
python
en
code
0
github-code
97
[ { "api_name": "scipy.genfromtxt", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.genfromtxt", "line_number": 15, "usage_type": "call" }, { "api_name": "scipy.genfromtxt", "line_number": 16, "usage_type": "call" }, { "api_name": "scipy.genfromtxt",...
6237916264
import kivy from kivy.app import App from kivy.uix.widget import Widget from kivy.properties import ObjectProperty from kivy.lang import Builder from kivy.core.window import Window # set size of calculator app Window.size = (400, 600) # file python will be reading from Builder.load_file('design.kv') cla...
dareckandarge/Calculator_App
calcu.py.py
calcu.py.py
py
6,818
python
en
code
0
github-code
97
[ { "api_name": "kivy.core.window.Window.size", "line_number": 9, "usage_type": "attribute" }, { "api_name": "kivy.core.window.Window", "line_number": 9, "usage_type": "name" }, { "api_name": "kivy.lang.Builder.load_file", "line_number": 12, "usage_type": "call" }, { ...
41161155994
from urllib.request import urlopen from bs4 import BeautifulSoup import re import pymysql import sys sys.setrecursionlimit(150000) conn = pymysql.connect(host='127.0.0.1', user='root', passwd='344126509', db='movie', charset='utf8') cur=conn.cursor() pages = set() start_url='http://www.loldytt.com/' def save_data(b...
yeehdavid/Thunder_movie_Spyder
spider.py
spider.py
py
1,349
python
en
code
0
github-code
97
[ { "api_name": "sys.setrecursionlimit", "line_number": 6, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib.request.urlopen...
74645456317
#!/usr/bin/python import boto3 import os import requests import random import string from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient from time import sleep import sys import getopt import json def startdevice(topicname, thingname): topicname = topicname thingname = thingname #retrieve region from m...
hongpham/Workshop-Protect-your-IoT-fleet
Module 4: Detect a compromised device using device-side metrics/startdevice.py
startdevice.py
py
4,030
python
en
code
2
github-code
97
[ { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 21, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 25, "usage_type": "call" }, { "api_name": "boto3.client", "line_number"...
7262521156
import json import unittest from json_formatter import flatten_json class TestFormatter(unittest.TestCase): # Should handle all JSON data types def test_nesting(self): formatted_json = flatten_json(json.loads(""" { "user": { "first": "dominik", "last...
drastawi/json-flattener
json_formatter_test.py
json_formatter_test.py
py
1,275
python
en
code
0
github-code
97
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "json_formatter.flatten_json", "line_number": 9, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 9, "usage_type": "call" }, { "api_name": "json_forma...
3452935006
from torch.utils.data import Dataset import numpy as np import utils.utils as utils import h5py import torch import torchvision import os class BaseDataset(Dataset): def name(self): return 'base_dataset' def __init__(self, config): self.config = config self.mode = config.mode ...
AIMLab-UBC/pathGAN
classification/data/base_dataset.py
base_dataset.py
py
2,876
python
en
code
4
github-code
97
[ { "api_name": "torch.utils.data.Dataset", "line_number": 10, "usage_type": "name" }, { "api_name": "h5py.File", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_n...
6088548638
import os import sys import json if __name__ == "__main__": img_dir, meta_file = sys.argv[1], sys.argv[2] # input.txt input_txt, img_names = "input.txt", None with open(input_txt, "w") as f: for root, dirs, files in os.walk(img_dir, topdown=False): img_names = files for...
Joker-co/useful_tools
generate_adela_dataset.py
generate_adela_dataset.py
py
2,360
python
en
code
0
github-code
97
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 20, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 28, ...
3532346500
from src.Team import Team from src.Fight import Fight from src.bots.Gauntlet import getGauntlet from copy import deepcopy import numpy as np import time import csv import pandas as pd import os import threading from functools import partial from multiprocessing import Pool, Process MAX_DEPTH = 2 DATA_PATH = "./data_co...
TylerLott/SAP-analog
src/bots/minmax.py
minmax.py
py
5,189
python
en
code
0
github-code
97
[ { "api_name": "copy.deepcopy", "line_number": 48, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 69, "usage_type": "call" }, { "api_name": "src.Fight.Fight", "line_number": 77, "usage_type": "call" }, { "api_name": "os.getpid", "line_num...
3803764808
from django.shortcuts import render from .forms import df, Pretraga from .models import Dogadjaji, Prijava, Ocenjivanje, Glasao, Poziv from korisnici.models import Clanovi from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.urls import reverse from django....
maxoo000/RAF2019
dogadjaji/views.py
views.py
py
27,058
python
hr
code
0
github-code
97
[ { "api_name": "korisnici.models.Clanovi.objects.get", "line_number": 18, "usage_type": "call" }, { "api_name": "korisnici.models.Clanovi.objects", "line_number": 18, "usage_type": "attribute" }, { "api_name": "korisnici.models.Clanovi", "line_number": 18, "usage_type": "n...