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
71431975358
#Flask from flask import Flask, render_template, request, session, url_for, redirect from flask.helpers import send_file from flask_dropzone import Dropzone #Utils import os #Drive Utils from md5 import md5 import db app = Flask(__name__, template_folder="./templates") app.secret_key = 'fat' @app.route("/") @app...
Canis-Ignem/key_drive
flask_wrapper.py
flask_wrapper.py
py
4,441
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 23, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 30, "usage_type": "call" }, { "api_name": "flask.session", "lin...
70801064638
import matplotlib.pyplot as plt import operator #from mpmath import * from sympy import * from __future__ import division x, y, z, t, pole, pole2, residue, residue2 = symbols('x y z t pole pole2 residue residue2') k, m, n = symbols('k m n', integer=True) f, g, h = symbols('f g h', cls=Function) asym_f, asym_g, asym_h ...
kerzol/Patterns-in-Treeshelfs
src/asymtotics.py
asymtotics.py
py
4,618
python
en
code
0
github-code
97
[ { "api_name": "operator.mul", "line_number": 38, "usage_type": "attribute" }, { "api_name": "operator.truediv", "line_number": 57, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 58, "usage_type": "call" }, { "api_name": "matplo...
23173376202
from django.db import models from users.models import User from imagekit.models import ImageSpecField from imagekit.processors import ResizeToFill, ResizeToFit, Transpose #Keep transpose in? I don't know.... # Create your models here. class Photo(models.Model): owner = models.ForeignKey(User, on_delete=models.CAS...
momentum-team-2/django-photo-gallery-joeyviolacode
core/models.py
models.py
py
2,325
python
en
code
0
github-code
97
[ { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 9, "usage_type": "call" }, { "api_name": ...
30655199628
import asyncio import pytest @pytest.mark.asyncio async def test_kv_newdevice(kivy_app, KvEventWaiter, mocked_vidhub_telnet_device): from vidhubcontrol.backends import DummyBackend kv_waiter = KvEventWaiter() config = kivy_app.vidhub_config def get_newdevice_btn(w): for _w in w.walk(): ...
nocarryr/vidhub-control
tests/kv/test_kv_newdevice.py
test_kv_newdevice.py
py
2,229
python
en
code
7
github-code
97
[ { "api_name": "asyncio.sleep", "line_number": 63, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 4, "usage_type": "attribute" } ]
23955308089
import requests import subprocess import time class InternetVerify(): def check_internet(self): ''' checar conexão de internet ''' url = 'http://10.17.20.116/public' timeout = 5 try: requests.get(url, timeout=timeout) return True except: ...
VBSX/PythonScriptInternetVerify
internet_test.py
internet_test.py
py
902
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 25, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 30, "usage_type": "call" } ]
5781608871
from keras.preprocessing.text import Tokenizer samples = ['我 在 哈尔滨 读书', '我 去 深圳 就职'] tokenizer = Tokenizer() tokenizer.fit_on_texts(samples) word_index = tokenizer.word_index print(word_index) print(len(word_index)) sequences = tokenizer.texts_to_sequences(samples) print(sequences) one_hot_results = ...
VIMQQZS/Aid
WordVec/02-one-hot编码在keras中的实现.py
02-one-hot编码在keras中的实现.py
py
404
python
en
code
0
github-code
97
[ { "api_name": "keras.preprocessing.text.Tokenizer", "line_number": 5, "usage_type": "call" } ]
19179395925
from django.urls import path from . import views urlpatterns = [ path('', views.home, name=""), path('login/',views.userLogin, name="login"), path('logout/',views.userLogout, name="logout"), path('register/',views.register, name="register"), path('create-task', views.createTask, name="create-task"...
Ru960413/toDoList
task/urls.py
urls.py
py
543
python
en
code
0
github-code
97
[ { "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", ...
70971868800
import os import sqlite3 from sqlite3 import Error from random import randint def create_connection(path): connection = None try: connection = sqlite3.connect(path) except Error as e: print(f"The error '{e}' occurred") return connection def execute_read_select(connection, select): ...
DoroninDobro/Egorushka
always_alive.py
always_alive.py
py
1,480
python
en
code
1
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlite3.Error", "line_number": 11, "usage_type": "name" }, { "api_name": "sqlite3.Error", "line_number": 23, "usage_type": "name" }, { "api_name": "random.randint", "lin...
42438518634
# !/usr/bin/env python3 # -*- coding: utf-8 -*- # Created: Nov. 9, 2019 by Sean von Bayern # Updated: # Import all required packages import argparse import json import torch from torch import nn from utils import create_classifier, create_loaders, create_model def get_args(): # Create parser object parser ...
SeanvonB/image-classifier
train.py
train.py
py
8,085
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.save", "line_number": 61, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 75, "usage_type": "call" }, { "api_name": "torch.exp", "lin...
38704529638
# -*- coding: utf-8 -*- from PIL import Image import numpy as np import re import random import time class Loader: dataPath = './lfw image data/' train_labels = {} validation_labels = {} test_labels = {} # 所需正则表达式 r"([A-Za-z_]*)_[0-9]*.jpg"gm def LoadData(self): # 从.txt导入标签 ...
birdx-007/Gender_Recognition
dataloader.py
dataloader.py
py
3,324
python
en
code
0
github-code
97
[ { "api_name": "re.compile", "line_number": 31, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 35, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 36, "usage_type": "call" }, { "api_name": "random.randint", "line_numbe...
28909150185
from django.http import HttpResponse, HttpResponseBadRequest, Http404 from django.shortcuts import get_object_or_404 from django.core.mail import EmailMessage from django.contrib.auth.hashers import check_password from django.template.loader import render_to_string from rest_framework import status from rest_framework....
milknsoda/yeoubyeol
back/accounts/views.py
views.py
py
14,694
python
en
code
0
github-code
97
[ { "api_name": "models.User", "line_number": 24, "usage_type": "name" }, { "api_name": "django.contrib.auth.get_user_model", "line_number": 24, "usage_type": "call" }, { "api_name": "rest_framework.views.APIView", "line_number": 30, "usage_type": "name" }, { "api_n...
25493815844
import pandas_datareader.data as web import pandas as pd import datetime as dt import numpy as np # import matplotlib.pyplot as plt # from matplotlib import style import talib # %matplotlib inline # import plotly # import plotly.io as pio # import plotly.graph_objects as go # from plotly.offline import init_notebook_m...
antony0315/benchmarkpred
bull-bear-plot.py
bull-bear-plot.py
py
1,633
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.date",...
42213666863
import pickle import os import sys from progress.bar import Bar import utils from midi_neural_processor.processor import encode_midi from tqdm.contrib.concurrent import process_map MAX_WORKERS = 12 MAX_SEQ = 2048 # Should set same as max_seq in config file. (ex) base.yml) def preprocess_midi(vars): path, save_dir...
juhannam/gct634-2022
hw4/preprocess.py
preprocess.py
py
1,114
python
en
code
6
github-code
97
[ { "api_name": "midi_neural_processor.processor.encode_midi", "line_number": 14, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 17, "usage_type": "call" }, { "api_name": "utils.find_files_by_extensions", "line_number": 23, "usage_type": "call" }, {...
72970161918
import numpy as np from scipy.sparse import dok_matrix, csr_matrix from multiprocessing import Pool, current_process class Tools: def __init__(self): pass def get_co_oc_matrix(self, vocabulary_size, word2ind, corpus_list, context_size = 3): corpus_size = len(corpus_list) comat = np.ze...
zyli93/Adversarial-Gender-debiased-WE
glove-python/tools.py
tools.py
py
3,209
python
en
code
0
github-code
97
[ { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line_number": 29, "usage_type": "call" }, { "api_name": "scipy.sparse.csr_matrix", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.random...
20982163992
import operator,functools,copy,random,math,cmath class Matrix: #%%Initialization and Representation def __init__(self,M,N): """initializes instance of class; attributes include entries as rows, # of rows, and # of columns""" self.rows=[[0]*N for n in range(M)] self.m=M ...
lplacette/Num-Methods
Matrices.py
Matrices.py
py
16,504
python
en
code
0
github-code
97
[ { "api_name": "operator.add", "line_number": 49, "usage_type": "attribute" }, { "api_name": "operator.sub", "line_number": 62, "usage_type": "attribute" }, { "api_name": "functools.reduce", "line_number": 78, "usage_type": "call" }, { "api_name": "operator.mul", ...
20085764610
import uvicorn from fastapi import FastAPI from chatbot import ChatBot app = FastAPI() @app.get('/{message}') async def chat(message: str): answer = chatbot.get_msg(message) return {'Bot:': answer} if __name__ == '__main__': chatbot = ChatBot() uvicorn.run(app, host="0.0.0.0", port=8000)
gitMiodek/AI_ChatBot
app.py
app.py
py
310
python
en
code
0
github-code
97
[ { "api_name": "fastapi.FastAPI", "line_number": 5, "usage_type": "call" }, { "api_name": "chatbot.get_msg", "line_number": 9, "usage_type": "call" }, { "api_name": "chatbot.ChatBot", "line_number": 14, "usage_type": "call" }, { "api_name": "uvicorn.run", "line...
15837692396
from __future__ import print_function # system imports from datetime import datetime, timedelta import urllib try: # noinspection PyUnresolvedReferences from typing import Callable, Optional, List, Tuple # pylint: disable=unused-import except ImportError: pass # enigma2 imports from Components.Sources.List import...
technic/iptvdream4x
src/main.py
main.py
py
44,048
python
en
code
0
github-code
97
[ { "api_name": "Tools.Directories.resolveFilename", "line_number": 53, "usage_type": "call" }, { "api_name": "Tools.Directories.SCOPE_SKIN", "line_number": 53, "usage_type": "argument" }, { "api_name": "Tools.Directories.resolveFilename", "line_number": 54, "usage_type": "...
70112471038
from pip.req import parse_requirements from pip.download import PipSession from setuptools import setup, find_packages install_reqs = parse_requirements("requirements.txt", session=PipSession()) requires = [str(ir.req) for ir in install_reqs] if __name__ == "__main__": setup( name="aioprometheus-binar...
claws/aioprometheus-binary-format
setup.py
setup.py
py
769
python
en
code
1
github-code
97
[ { "api_name": "pip.req.parse_requirements", "line_number": 7, "usage_type": "call" }, { "api_name": "pip.download.PipSession", "line_number": 7, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 13, "usage_type": "call" }, { "api_name": "set...
74608611520
import logging import os import requests import sys from typing import Any from typing import Tuple from typing import Dict import thoth.prescriptions_refresh from thoth.prescriptions_refresh.prescriptions import Prescriptions from .gh_link import iter_gh_info _LOGGER = logging.getLogger(__name__) _PRESCRIPTIONS_DEF...
thoth-station/prescriptions-refresh-job
thoth/prescriptions_refresh/handlers/gh_popularity.py
gh_popularity.py
py
4,330
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "thoth.prescriptions_refresh.prescriptions.Prescriptions.DEFAULT_PRESCRIPTIONS_REPO", "line_number": 15, "usage_type": "attribute" }, { "api_name": "thoth.prescriptions_refresh.prescriptio...
2322933307
# Data Visualization for Non-cyberbullying content import matplotlib.pyplot as plot # labels are defined dataLabels = ['Non-Cyberbullying ', 'Cyberbullying '] # Each label's area covered partition = [9.59,0.41] # Colours for labels col = ['yellow', 'red'] # Create Pie chart plot.pie(partition, label...
anketsah/Detection-and-Analysis-of-Cyberbullying-Data-on-Twitter-based-on-Machine-Learning-and-Data-Mining
Data Visualization/Non-CyberbullyingDV.py
Non-CyberbullyingDV.py
py
635
python
en
code
1
github-code
97
[ { "api_name": "matplotlib.pyplot.pie", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 15, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 20, "usage_type": "call" }, { "api_name": "matpl...
40831033771
import pandas as pd import matplotlib import matplotlib.pyplot as plt from pandas.plotting import scatter_matrix # plt.interactive(False) df = pd.read_csv('./data/sigite2014-difficulty-data.csv', sep=';') print('Shape:', df.shape) print('Columns:', df.columns) # df.boxplot() # scatter_matrix(df, alpha=0.2, figsize=(6...
pihvi/edutime
scrap/visualisation.py
visualisation.py
py
644
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.gcf", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.rc"...
36367672869
# coding: utf-8 from flask import Blueprint, render_template, jsonify, abort from flask_restful import Resource, Api from ..models import User, Product bp = Blueprint('api', __name__, url_prefix='/api') api = Api(bp) class USER(Resource): def get(self, id): try: user = User.query.get_or_404(id) ...
vladimirmyshkovski/tetrafoil
application/controllers/api.py
api.py
py
767
python
en
code
4
github-code
97
[ { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 10, "usage_type": "name" }, { "api_name": "models.User.qu...
5592967196
import arcade from CONSTANTS import * from Frog import FrogBody from Popcorn import Popcorn from random import randint from Candy import CandyFall from Hand import HandBoss from Table import Table from platform_tile import PlatformTile from filling_popcorn import RisingPopcorn import arcade.key class MovieTheaterFrog...
krishols/PopcornFrog
main.py
main.py
py
21,601
python
en
code
0
github-code
97
[ { "api_name": "arcade.Window", "line_number": 14, "usage_type": "attribute" }, { "api_name": "arcade.set_background_color", "line_number": 63, "usage_type": "call" }, { "api_name": "arcade.SpriteList", "line_number": 64, "usage_type": "call" }, { "api_name": "arca...
30156053908
""" Code originally by vinothpandian Modified by Lucian Reiter, Dec 3, 2022 """ import random import pygame, sys import math from pygame.locals import * pygame.init() fps = pygame.time.Clock() # colors WHITE = (255, 255, 255) RED = (255, 0, 0) YELLOW = (255, 255, 0) GREEN = (0, 255, 0) BLACK = (0, ...
Kontonkitsune/CSCI1620-Final-Project-Pong-Pong
pongpong.py
pongpong.py
py
15,628
python
en
code
0
github-code
97
[ { "api_name": "pygame.init", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mod...
37266340001
import numpy as np import feature_extraction from sklearn.ensemble import RandomForestClassifier as rfc #from sklearn.svm import SVC from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression as lr from flask import jsonify def getResult(url): # url="http://...
Gopika-15/Cyber-Attack-Prediction
phishing.py
phishing.py
py
1,846
python
en
code
0
github-code
97
[ { "api_name": "numpy.loadtxt", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 24, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 25, "usage_type": "call" ...
42336112982
# coding: utf-8 # # Project:Health Care-Diabetes # # - ***Accurately predict whether or not the patients in the dataset have diabetes *** # # **Attribute Information:** # # - Pregnancies (Number of times pregnant) # - Glucose (Plasma glucose concentration a 2 hour in an oral glucose tolerance test) # - BloodPres...
kysgattu/Health-Care-Diabetes
Code-Health Care-Diabetes.py
Code-Health Care-Diabetes.py
py
6,032
python
en
code
1
github-code
97
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 33, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 33, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 33, "usage_type": "name" }, { "api_na...
42244257551
# -*- coding: utf-8 -*- import pickle from sklearn.metrics import classification_report,confusion_matrix def test_results(df): print('***********TEST RESULTS***********') models=[] mod_name = ['Decision Trees','Random Forest','Neural Network'] #prin...
rastabot/JB_ML_Project
test_and_scores.py
test_and_scores.py
py
1,653
python
en
code
1
github-code
97
[ { "api_name": "pickle.load", "line_number": 27, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 37, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 43, "usage_type": "call" }, { "api_name": "sklearn.metrics.classification_re...
69825386879
# Script used to recognize faces and to trigger a specific spotify playlist upon recognizing a specific person from peoples_anthem import PeoplesAnthem if __name__ == "__main__": import argparse parser = argparse.ArgumentParser() parser.add_argument( "--model-filepath", type=str, ...
fortin-alex/peoples-anthem
code/recognize_and_play_music.py
recognize_and_play_music.py
py
556
python
en
code
1
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "peoples_anthem.PeoplesAnthem", "line_number": 19, "usage_type": "call" }, { "api_name": "peoples_anthem.recognize_and_play_spotify", "line_number": 20, "usage_type": "call" ...
74367250557
# recording = AudioSegment.from_file(BytesIO(song_byte), format="mp3") # recording.export('new.mp3', format='mp3') # for export # play(recording) # for play import socket import selectors from pydub import AudioSegment from io import BytesIO sel = selectors.DefaultSelector() mp3_segments = []...
jancquian/Redes-2-ESCOM
Envio mp3/Servidor/main.py
main.py
py
2,588
python
en
code
0
github-code
97
[ { "api_name": "selectors.DefaultSelector", "line_number": 12, "usage_type": "call" }, { "api_name": "selectors.EVENT_READ", "line_number": 32, "usage_type": "attribute" }, { "api_name": "selectors.EVENT_WRITE", "line_number": 32, "usage_type": "attribute" }, { "ap...
2488545844
from collections import defaultdict def operation(color_dict): sorted_dict = dict(sorted(color_dict.items())) return min(sorted_dict, key=sorted_dict.get) def main(): count = int(input()) color_dict = defaultdict(lambda: 0) for i in range(count): color_dict[input()] += 1 print(operati...
blueBye/daily-challenges
maktabkhoneh/task09.py
task09.py
py
561
python
en
code
0
github-code
97
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" } ]
2841495364
import sys from collections import deque input = sys.stdin.readline n = int(input()) q = deque(enumerate(map(int, input().split()))) sol = [] while q: idx, paper = q.popleft() sol.append(idx + 1) if paper > 0: q.rotate(-(paper - 1)) elif paper < 0: q.rotate(-paper) print(' '.join(ma...
kcy0521/algorithm
백준/28278(스택 2).py
28278(스택 2).py
py
702
python
ko
code
0
github-code
97
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" } ]
38614013777
import signal import time import logging class GracefulKiller: kill_now = False def __init__(self): signal.signal(signal.SIGINT, self.exit_gracefully) signal.signal(signal.SIGTERM, self.exit_gracefully) def exit_gracefully(self, *args): logging.info("Exit signal received. Setting the k...
Sciocatti/python_scheduler_and_clean_forced_exit
src/graceful_killer/graceful_killer.py
graceful_killer.py
py
602
python
en
code
0
github-code
97
[ { "api_name": "signal.signal", "line_number": 8, "usage_type": "call" }, { "api_name": "signal.SIGINT", "line_number": 8, "usage_type": "attribute" }, { "api_name": "signal.signal", "line_number": 9, "usage_type": "call" }, { "api_name": "signal.SIGTERM", "lin...
7636541414
# -*- coding: utf-8 -*- # file with periodical tasks from __future__ import absolute_import from django.db.models import Q from celery.utils.log import get_task_logger from celery import shared_task from decimal import Decimal from joebot_at.taskapp.celery import app as celery_app from datetime import datetime from d...
totoropy/joebot_at
ticker/tasks.py
tasks.py
py
2,863
python
en
code
0
github-code
97
[ { "api_name": "celery.utils.log.get_task_logger", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime.utcnow", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 27, "usage_type": "name" }, { "api_n...
38230349834
import time from enum import Enum from smbus2 import SMBus, i2c_msg from MainControlLoop.lib.devices import Device class AntennaDeployerCommand(Enum): SYSTEM_RESET = 0xAA WATCHDOG_RESET = 0xCC ARM_ANTS = 0xAD DISARM_ANTS = 0xAC DEPLOY_1 = 0xA1 DEPLOY_2 = 0xA2 DEPLOY_3 = 0xA3 DEPLOY_4...
TJREVERB/pfs
MainControlLoop/lib/drivers/AntennaDeployer.py
AntennaDeployer.py
py
4,664
python
en
code
6
github-code
97
[ { "api_name": "enum.Enum", "line_number": 7, "usage_type": "name" }, { "api_name": "MainControlLoop.lib.devices.Device", "line_number": 41, "usage_type": "name" }, { "api_name": "smbus2.SMBus", "line_number": 81, "usage_type": "call" }, { "api_name": "time.sleep",...
17697485735
from time import sleep from flask import render_template, request from flask_admin import BaseView, expose from .models import CommercialProposal, MainMetrics, Region from app import db, app from .form import CreateCommercialProposal from .async_views import count_words, generate_tasks_by_id class AnalyticsView(Bas...
ffortunado/price_counter
app/views.py
views.py
py
1,990
python
en
code
0
github-code
97
[ { "api_name": "flask_admin.BaseView", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.request.method", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "name" }, { "api_name": "form.Cre...
71621751999
from django.urls import path from . import views app_name = 'sattle' urlpatterns = [ # Define the URL pattern for the app's home view path('', views.home, name='home'), # Define the URL pattern for the app's submit_guess view path('submit_guess/', views.submit_guess, name='submit_guess'), path('...
saleha1wer/sattle
sattle_game/sattle/urls.py
urls.py
py
786
python
en
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "django.urls.path", ...
70621968320
""" Created by Gotham on 03-08-2018. """ from telegram import InlineKeyboardButton, InlineKeyboardMarkup from telegram.ext import ConversationHandler, CommandHandler, CallbackQueryHandler import flood_protection import random timeouts = flood_protection.Spam_settings() QSELCC = 2000 class CcHandler: def __init__(...
gotham13/superCodingBot
handlers/codechef.py
codechef.py
py
2,583
python
en
code
33
github-code
97
[ { "api_name": "flood_protection.Spam_settings", "line_number": 8, "usage_type": "call" }, { "api_name": "telegram.ext.ConversationHandler", "line_number": 15, "usage_type": "call" }, { "api_name": "telegram.ext.CommandHandler", "line_number": 16, "usage_type": "call" },...
38990164546
import cv2 import argparse import os from inference import Inference def get_parser(): parse = argparse.ArgumentParser() parse.add_argument('--device', type=str, default='cpu', choices=['cpu', 'cuda', 'cuda:0', 'cuda:1']) parse.add_argument('--path', type=str, default='./images/madoka.jpg') parse.add...
LuckyMouseLai/ToyRepo
Anime2Sketch/convert_image.py
convert_image.py
py
947
python
en
code
1
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "inference.Inference", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.splitex...
9751131585
from konlpy.tag import Kkma import pymysql import sys conn = pymysql.connect(host='localhost', user='root', password='0000', db='cheongwadae', charset='utf8') curs = conn.cursor() SQL = "SELECT * FROM petition" curs.execute(SQL) result = curs.fetchall() kkma = Kkma() body_pos = {} for i in range(len(r...
min942773/petition
body_position.py
body_position.py
py
1,661
python
en
code
0
github-code
97
[ { "api_name": "pymysql.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "konlpy.tag.Kkma", "line_number": 12, "usage_type": "call" } ]
7677001706
from collections import deque class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right def levelOrder(root: TreeNode) -> list[list[int]]: levelorder = list() if root: stack = deque() stack.append(root) ...
niranjank2022/LeetCode
Medium/102. Binary Tree Level Order Traversal.py
102. Binary Tree Level Order Traversal.py
py
1,006
python
en
code
0
github-code
97
[ { "api_name": "collections.deque", "line_number": 14, "usage_type": "call" } ]
44596218744
from .entity import Entity from .vector import Vector from .game_config import GameConfig as gc from enum import Enum class Pickup(Entity): def __init__(self, pos, pickup_type): super().__init__() self.pickup_type = pickup_type self.pos = pos self.size = gc.POW_SIZE self.val...
SuddenDevs/SuddenDev
suddendev/game/pickup.py
pickup.py
py
1,016
python
en
code
2
github-code
97
[ { "api_name": "entity.Entity", "line_number": 6, "usage_type": "name" }, { "api_name": "game_config.GameConfig.POW_SIZE", "line_number": 11, "usage_type": "attribute" }, { "api_name": "game_config.GameConfig", "line_number": 11, "usage_type": "name" }, { "api_name...
3288056835
# %%shell # pip install transformers # pip install sentencepiece # wget -q --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1bY-iaCn_CTaZE2-wp7_...
byuawsfhtl/JERE
train.py
train.py
py
9,281
python
en
code
0
github-code
97
[ { "api_name": "BMDRecordGenerator.BMDGenerator", "line_number": 14, "usage_type": "call" }, { "api_name": "joint.model.dataset.load_datasets", "line_number": 42, "usage_type": "call" }, { "api_name": "joint.model.dataset", "line_number": 42, "usage_type": "attribute" },...
30260764891
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging plainLogger = logging.getLogger(__name__) import os import subprocess from abc import ABCMeta, abstractproperty, abstractmethod from ruamel.yaml.comments import CommentedMap, CommentedSeq from six import add_metaclass, iteritems from cont...
ansible/ansible-container
container/k8s/base_engine.py
base_engine.py
py
10,144
python
en
code
2,204
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "container.utils.visibility.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "container.docker.engine.Engine", "line_number": 23, "usage_type": "name" }, { ...
69885451840
import datetime import time import os import mail_handler from requests import exceptions, Session from patreon_parser import ParseSession, CaptchaError from download_handler import DownloadHandler from post_manager import PostManager from cloudscraper import CloudScraper, create_scraper from dotenv import load_dotenv ...
Grygon/patreon-downloader
main.py
main.py
py
6,971
python
en
code
1
github-code
97
[ { "api_name": "dotenv.load_dotenv", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_nu...
40495806014
import matplotlib.pyplot as plt from matplotlib import animation import seaborn as sns sns.set_style('ticks', {"axes.linewidth": "1", 'axes.yaxis.grid': False}) import numpy as np from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler from sklearn.feature_selection import VarianceThresh...
RishiRajalingham/MPongBehavior_public
PongRnn/rnn_analysis/utils.py
utils.py
py
16,650
python
en
code
3
github-code
97
[ { "api_name": "seaborn.set_style", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.nonzero", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.isfinite", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.mean", "line_...
19522500129
import random as rnd import time as t import wolframalpha as wra import speech_recognition as sr import pyttsx3 as tts import subprocess as sp #from gpiozero import LED as led import RPi.GPIO as GPIO engine = tts.init() r = sr.Recognizer() wra = wra.Client("Y9G92A-94TV756H3T") acronym = 'Intelligent but Retarded Info...
w3bhook/IRIS
main.py
main.py
py
5,063
python
en
code
2
github-code
97
[ { "api_name": "pyttsx3.init", "line_number": 11, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 12, "usage_type": "call" }, { "api_name": "wolframalpha.Client", "line_number": 13, "usage_type": "call" }, { "api_name": "random...
9136488102
# -*- coding: utf-8 -*- ''' @author : majian''' import logging from ServiceConfig.config import readFromConfigFile from twisted.application import internet, service, app from twisted.python import logfile class LoggerRecord: def __init__(self): self.Level = "" self.Filename = "" ...
qbaoma/web
WebserviceInterface/BaseClass/logger.py
logger.py
py
988
python
en
code
0
github-code
97
[ { "api_name": "ServiceConfig.config.readFromConfigFile", "line_number": 16, "usage_type": "call" }, { "api_name": "twisted.python.logfile", "line_number": 25, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "...
72473619200
from __future__ import print_function, division import torch import torchnet as tnt class TRSNetEpochMeters(object): def __init__(self, num_classes): self.num_classes = num_classes self.loss_meters = {} self.loss_meters['trsn'] = tnt.meter.AverageValueMeter() self.loss_meters['rfn...
ykhuang0817/Inflated_3DConvNets
meters/EpochMeters.py
EpochMeters.py
py
3,714
python
en
code
1
github-code
97
[ { "api_name": "torchnet.meter.AverageValueMeter", "line_number": 11, "usage_type": "call" }, { "api_name": "torchnet.meter", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torchnet.meter.AverageValueMeter", "line_number": 12, "usage_type": "call" }, { ...
9406886901
from django.shortcuts import render, get_object_or_404, redirect from .models import Item # Create your views here. def home(request): shop = Item.objects.all() return render(request, 'home.html', {'shop':shop}) def create(request): if request.method == 'POST': item=Item() item.name=reque...
mseo39/7.22likelion_crud-class
myproject/myapp/views.py
views.py
py
872
python
en
code
0
github-code
97
[ { "api_name": "models.Item.objects.all", "line_number": 7, "usage_type": "call" }, { "api_name": "models.Item.objects", "line_number": 7, "usage_type": "attribute" }, { "api_name": "models.Item", "line_number": 7, "usage_type": "name" }, { "api_name": "django.shor...
75110088318
"""Module for reading / converting pollyxt data.""" import logging import glob from typing import Optional, Union import netCDF4 import numpy as np from numpy import ma from numpy.testing import assert_array_equal import csv from datetime import datetime from scipy.interpolate import interp1d from cloudnetpy import o...
griesche/cloudnetpy_zenodo
cloudnetpy/instruments/pollyxt.py
pollyxt.py
py
18,284
python
en
code
0
github-code
97
[ { "api_name": "typing.Optional", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 27, "usage_type": "name" }, { "api_name": "cloudnetpy.output.add_time_attribute", "line_number": 67, "usage_type": "call" }, { "api_name": "...
22638386224
import requests, json from discord_webhook import DiscordWebhook, DiscordEmbed from time import sleep from datetime import datetime TOKEN = "" # HEADERS = { 'Accept':'application/json', 'Content-Type':'application/json', 'Authorization':f'Bearer {TOKEN}' } def refresh_token(): # get new token ...
S1NJED/api-spotify-currently-playing-python
spotify_API.py
spotify_API.py
py
4,118
python
en
code
3
github-code
97
[ { "api_name": "requests.Session", "line_number": 15, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 39, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 68, "usage_type": "call" }, { "api_name": "discord_webhook.DiscordWebho...
11644243250
# Faça um progrma que leia o ano de nascimento de um jovem # e informe, de acordo com sua idade: # -Se ele ainda vai se alistar ao serviço militar. # -Se é a hora de se alistar. # -Se já passou do tempo do alistamento. # Seu programa também deverá mostrar o tempo que falta ou # que passou do prazo. from datetime import...
Jonata-Dias/pythonEX
ex14-alistamento/main.py
main.py
py
2,598
python
pt
code
0
github-code
97
[ { "api_name": "datetime.date.today", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 53, "usage_type": "call" }, { "api_name": "datetime.date",...
20040879272
# This code is based on https://github.com/DeepVoltaire/AutoAugment/blob/master/autoaugment.py from PIL import Image, ImageEnhance, ImageOps import numpy as np import random from mmseg.datasets.builder import PIPELINES @PIPELINES.register_module() class ImageNetPolicy(object): """ AutoAugment ImageNet Policy...
aiearth-damo/deeplearning
aiearth/deeplearning/datasets/mmseg/target_extraction/pipelines/autoaugment.py
autoaugment.py
py
10,404
python
en
code
33
github-code
97
[ { "api_name": "numpy.random.random", "line_number": 83, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 83, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 85, "usage_type": "call" }, { "api_name": "mmseg.datasets.b...
24530771640
"""added min_max_response to poll_questions Revision ID: 57c279d25d1a Revises: 8a5d0ba68452 Create Date: 2023-10-09 18:00:24.318069 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '57c279d25d1a' down_revision = '8a5d0ba68452' branch_labels = None depends_on = N...
lutijdxgod/API
alembic/versions/57c279d25d1a_added_min_max_response_to_poll_questions.py
57c279d25d1a_added_min_max_response_to_poll_questions.py
py
1,491
python
en
code
0
github-code
97
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
40526498952
import scipy.stats as st import matplotlib.pyplot as plt from constants import * from scipy.interpolate import interp1d import naima import astropy.units as u import subroutines as sub import os import pickle import synchrotron from scipy.signal import savgol_filter from DELCgen import * from scipy.optimize import fso...
jhmatthews/CR-Variable-Jet
simulation.py
simulation.py
py
21,730
python
en
code
0
github-code
97
[ { "api_name": "scipy.stats.lognorm", "line_number": 26, "usage_type": "attribute" }, { "api_name": "scipy.stats", "line_number": 26, "usage_type": "name" }, { "api_name": "subroutines.init_lc_plot", "line_number": 151, "usage_type": "call" }, { "api_name": "synchr...
10648235782
from nltk.corpus import conll2002 from sklearn.feature_extraction import DictVectorizer import sklearn_crfsuite import numpy as np # Assignment 4: NER # This is just to help you get going. Feel free to # add to or modify any part of it. def word2featuresP2(sent, i): word = sent[i][0] postag = sent[i][1] features ...
Daweihao/nlp_assign4
part2.py
part2.py
py
4,620
python
en
code
0
github-code
97
[ { "api_name": "nltk.corpus.conll2002.iob_sents", "line_number": 162, "usage_type": "call" }, { "api_name": "nltk.corpus.conll2002", "line_number": 162, "usage_type": "name" }, { "api_name": "nltk.corpus.conll2002.iob_sents", "line_number": 163, "usage_type": "call" }, ...
38658616670
import datetime import enum import logging import typing from flask_babel import gettext from flask_babel import lazy_gettext from flask_sqlalchemy import BaseQuery from sqlalchemy import and_ from sqlalchemy import func from sqlalchemy.orm import joinedload from twilio.base.exceptions import TwilioRestException from...
airq-dev/hazebot
app/airq/models/clients.py
clients.py
py
19,470
python
en
code
9
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 32, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 35, "usage_type": "attribute" }, { "api_name": "flask_sqlalchemy.BaseQuery", "line_number": 40, "usage_type": "name" }, { "api_name": "airq.lib....
10090001677
#!usr/bin/python #conding=utf-8 def buttonDaochuClick(): try: import openpyxl from openpyxl import Workbook except: tkinter.messagebox.showerror('抱歉','您需要安装openpyxl拓展库') wb=Workbook() wb.remove_sheet(wb.worksheets[0]) ws=wb.create_sheet(title='在线点名情况') ws.append(['学号','姓名...
18660882015/py
python.launcher/daochu.py
daochu.py
py
876
python
en
code
0
github-code
97
[ { "api_name": "openpyxl.Workbook", "line_number": 9, "usage_type": "call" } ]
70078876160
import pickle import json import os import ipdb import torchtext import numpy as np def loadDataset(dataTorchFp): value = torchtext.data.Field(sequential=True, use_vocab=True) key = torchtext.data.Field(sequential=False, use_vocab=True) torchData = torchtext.data.TabularDataset(path=dataTorchFp, format='js...
akshittyagi/memqa2
memory.py
memory.py
py
3,643
python
en
code
0
github-code
97
[ { "api_name": "torchtext.data.Field", "line_number": 9, "usage_type": "call" }, { "api_name": "torchtext.data", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torchtext.data.Field", "line_number": 10, "usage_type": "call" }, { "api_name": "torchtext...
24965553728
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import time import functools import inject import DIConfig from classes.Connection.instaConnector import InstaConnect from classes.Connection.request import RequestFacade from classes.Instagram import Endpoints, InstaQuery from classes.Instagram.instaUser ...
dmitriypereverza/InstaBot
classes/Instagram/InstaBot.py
InstaBot.py
py
5,449
python
en
code
1
github-code
97
[ { "api_name": "functools.wraps", "line_number": 16, "usage_type": "call" }, { "api_name": "time.time", "line_number": 34, "usage_type": "call" }, { "api_name": "time.time", "line_number": 37, "usage_type": "call" }, { "api_name": "time.time", "line_number": 41...
9669708007
import os os.environ["CUDA_VISIBLE_DEVICES"] = "0" # "0, 1" import pickle import re import json import pandas as pd import numpy as np import codecs import random import tensorflow as tf from bert4keras.backend import keras, K, search_layer, set_gelu from bert4keras.layers import Loss from bert4keras.models import ...
ningshixian/Contextual-NLU
train.py
train.py
py
16,649
python
en
code
0
github-code
97
[ { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 36, "usage_type": "attribute" }, { "api_name": "tensorflow.ConfigP...
73201620480
from itertools import pairwise import numpy as np def decompose_rectangle_into_polygons(num, theta=0, pad=0): x_coords = [0, 1] y_coords = np.linspace(start=0, stop=1, num=num + 1) coords = [] for pair in pairwise(y_coords): polygon_coords = [] pair = (pair[0] + pad / 2, pair[1] - pad ...
phylyc/comut_plot
comutplotlib/math.py
math.py
py
554
python
en
code
1
github-code
97
[ { "api_name": "numpy.linspace", "line_number": 7, "usage_type": "call" }, { "api_name": "itertools.pairwise", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" } ]
74621662080
from preprocessdata import preprocessdata from sklearn.pipeline import make_pipeline from sklearn.svm import SVC from sklearn.preprocessing import StandardScaler import PIL.Image import torchvision.transforms as transforms from trt_pose.parse_objects import ParseObjects from trt_pose.draw_objects import DrawObje...
bigalex95/HandTracking
mainHand.py
mainHand.py
py
15,895
python
en
code
2
github-code
97
[ { "api_name": "json.load", "line_number": 33, "usage_type": "call" }, { "api_name": "json.load", "line_number": 36, "usage_type": "call" }, { "api_name": "trt_pose.parse_objects.coco.coco_category_to_topology", "line_number": 39, "usage_type": "call" }, { "api_nam...
71046458879
from setuptools import setup, find_packages with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setup( name="dimsense", version="0.1.2", author="Nathaniel Handan", author_email="handanfoun@gmail.com", description="A feature selection and extraction library", l...
Tinny-Robot/DimSense
setup.py
setup.py
py
856
python
en
code
13
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 15, "usage_type": "call" } ]
32862363428
# -*- coding: utf-8 -*- import random import pytest from model.contact import Contact from utils.data_transformations import produce_instance_for_home_page_view from datagen.contact import testdata_for_adding @pytest.mark.parametrize("contact_with_new_params", testdata_for_adding, ids=[repr(x) for x in testdata_for_...
petroffcomm/python-for-testers
test/test_edit_contact.py
test_edit_contact.py
py
1,567
python
en
code
0
github-code
97
[ { "api_name": "model.contact.Contact", "line_number": 13, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 17, "usage_type": "call" }, { "api_name": "model.contact.Contact.id_or_maxval", "line_number": 30, "usage_type": "attribute" }, { "api_n...
14452089460
import requests from ensembl_prodinf.email_celery_app import app from ensembl_prodinf.utils import send_email smtp_server = app.conf['smtp_server'] from_email_address = app.conf['from_email_address'] retry_wait = app.conf['retry_wait'] @app.task(bind=True) def email_when_complete(self, url, address): """ Task t...
vinay-ebi/ensembl-docker_compose
productionservices/ensembl-prodinf-core/ensembl_prodinf/email_tasks.py
email_tasks.py
py
1,597
python
en
code
0
github-code
97
[ { "api_name": "ensembl_prodinf.email_celery_app.app.conf", "line_number": 6, "usage_type": "attribute" }, { "api_name": "ensembl_prodinf.email_celery_app.app", "line_number": 6, "usage_type": "name" }, { "api_name": "ensembl_prodinf.email_celery_app.app.conf", "line_number": ...
31953670664
"""add_tags_table Revision ID: 3e3981bb512d Revises: 8899525de86a Create Date: 2023-04-26 18:01:25.632291 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = "3e3981bb512d" down_revision = "8899525de86a" branch_labels = Non...
mgurg/fastapi_docker
migrations/versions/2023_04_26_1801-3e3981bb512d_add_tags_table.py
2023_04_26_1801-3e3981bb512d_add_tags_table.py
py
2,310
python
en
code
16
github-code
97
[ { "api_name": "alembic.op.create_table", "line_number": 20, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 20, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.INTEG...
34001685980
import types from typing import Iterable from genpipes import compose, declare import pandas as pd import pytest @declare.generator() def fake_dataframe(): df = pd.DataFrame({"col1": [1, 2, 3, 4, 5, 6], "col2": [1, 2, 3, 4, 5, 6]}) return df @declare.processor() def multiply_by(stream: Iterable[pd.DataFrame...
Mg30/genpipes
tests/test_compose.py
test_compose.py
py
2,477
python
en
code
21
github-code
97
[ { "api_name": "pandas.DataFrame", "line_number": 10, "usage_type": "call" }, { "api_name": "genpipes.declare.generator", "line_number": 8, "usage_type": "call" }, { "api_name": "genpipes.declare", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Ite...
2644678828
'''Example script, flask server must be up and running first, then run this script in a separate shell (if developing locally). ''' import json import requests login_url = 'http://localhost:5000/login' url = 'http://localhost:5000/api/v1/markovchain' creds = requests.post( login_url, json={'username': 'wally...
spitfiredd/flask-numerical-api
flasky_numpy/example.py
example.py
py
819
python
en
code
1
github-code
97
[ { "api_name": "requests.post", "line_number": 12, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 27, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.get", "line_number":...
33349775282
import torch from torch.autograd.function import InplaceFunction, Function from torch.autograd import Variable from itertools import repeat import torch.nn as nn class StaticDropoutFunction(Function): @staticmethod def forward(ctx, input, module, train=False): ctx.train = train ...
quanpn90/NMTGMinor
onmt/modules/static_dropout.py
static_dropout.py
py
2,235
python
en
code
81
github-code
97
[ { "api_name": "torch.autograd.function.Function", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.numel", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 40, "usage_type": "attribute" }, { "api_name": "torc...
25264851116
# [DFS/BFS] 꼭 필요한 자료구조 기초 ## 1. Stack (List로 구현) stack = [] stack.append(5) # 삽입 stack.append(2) # 삽입 stack.append(3) # 삽입 stack.append(7) # 삽입 stack.pop() # 삭제 stack.append(1) # 삽입 stack.append(4) # 삽입 stack.pop() # 삭제 print(stack) ## 2. Queue (deque로 구현) from collections import deque queue = deque() queu...
minssoj/Learning_pfct
basic/5e1.py
5e1.py
py
1,057
python
ko
code
0
github-code
97
[ { "api_name": "collections.deque", "line_number": 18, "usage_type": "call" } ]
16303358299
from typing import Any, Dict, List, Type, TypeVar import attr T = TypeVar("T", bound="WingInfoStation") @attr.s(auto_attribs=True) class WingInfoStation: """ Attributes: title (str): id (str): """ title: str id: str additional_properties: Dict[str, Any] = attr.ib(init=False,...
glanch/bahnhofs-abfahrten-client
bahnhofs_abfahrten_client/models/wing_info_station.py
wing_info_station.py
py
1,509
python
en
code
0
github-code
97
[ { "api_name": "typing.TypeVar", "line_number": 5, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 18, "usage_type": "name" }, { "api_name": "attr.ib", "line_number": 18,...
2112483880
# trades.py placeholder import asyncio import websockets import json import os import re import ticker import elasticsearch import orderbook import os, time, datetime, sys, json, hashlib, zlib, base64, json, re, elasticsearch, argparse, uuid, pytz TIMEZONE = pytz.timezone('UTC') class Trade: def __init__(self): ...
currentsea/async-bitcoinsearch
trades.py
trades.py
py
1,915
python
en
code
0
github-code
97
[ { "api_name": "pytz.timezone", "line_number": 12, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 44, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 45, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
71298288640
# 220826 7562 나이트의 이동 from collections import deque import sys input = sys.stdin.readline # 나이트 이동 범위 설정 dr = [2, 1, -1, -2, -2, -1, 1, 2] dc = [1, 2, 2, 1, -1, -2, -2, -1] # bfs 함수 선언 def bfs(r, c): q = deque() q.append((r, c)) # 방문 표시 chess[r][c] = 1 while q: r, c = q.popleft() ...
Bluuubery/Problem_Solving
백준/Silver/7562. 나이트의 이동/나이트의 이동.py
나이트의 이동.py
py
1,320
python
ko
code
2
github-code
97
[ { "api_name": "sys.stdin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
5935643688
import argparse import pathlib import time import gym from tqdm import tqdm import numpy as np import torch as th import matplotlib.pyplot as plt from algo import vpg_with_baseline import pytorch_utils as ptu try: from icecream import install # noqa install() except ImportError: # Graceful fallback if ...
yifanwu2828/ECE276c
HW3/reacher.py
reacher.py
py
3,336
python
en
code
0
github-code
97
[ { "api_name": "icecream.install", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 26, "usage_type": "name" }, { "api_name": "matplot...
40160206991
import json import subprocess from abc import ABC, abstractmethod from statistics import mean from imutils import paths import argparse import cv2 import numpy as np import os, shutil class FeatureExtractor(ABC): @abstractmethod def analyze(self, video_path, video_name): pass @abstractmethod d...
Mike-Wazovsky/Video_compression_improvement
feature_extractor.py
feature_extractor.py
py
4,218
python
en
code
0
github-code
97
[ { "api_name": "abc.ABC", "line_number": 11, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 12, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 16, "usage_type": "name" }, { "api_name": "json.load", "line_n...
3182587321
import os import collections from collections import defaultdict import matplotlib.pyplot as plt if __name__ == '__main__': input_file = os.path.join('/Users/emielzyde/Downloads/Wrong analysis/wrong_test1.tsv') input_file_correct = os.path.join('/Users/emielzyde/Downloads/Correct analysis/correct_test1.tsv') ...
emielzyde/grammar_correction_thesis
own_files/consec_error_analysis.py
consec_error_analysis.py
py
6,136
python
en
code
1
github-code
97
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, ...
11869194501
""" Wrapper around the dynamo3 RateLimit class """ from typing import Dict from dynamo3 import RateLimit class TableLimits(object): """Wrapper around :class:`dynamo3.RateLimit`""" def __init__(self): self.total = {} self.default = {} self.indexes = {} self.tables = {} de...
stevearc/dql
dql/throttle.py
throttle.py
py
5,703
python
en
code
150
github-code
97
[ { "api_name": "typing.Dict", "line_number": 51, "usage_type": "name" }, { "api_name": "dynamo3.RateLimit", "line_number": 55, "usage_type": "call" } ]
28016670090
""" setup.py file for testing birefringence pycbc waveform plugin package """ from setuptools import Extension, setup, Command, find_packages VERSION = '0.0' setup ( name = 'pycbc-seobnr', version = VERSION, description = 'A waveform plugin for PyCBC for pySEOBNR', author = 'Yifan Wang', author_e...
yi-fan-wang/pycbc-plugin-seobnr
setup.py
setup.py
py
1,516
python
en
code
0
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 9, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 18, "usage_type": "call" } ]
264090691
import numpy as np from sklearn.multiclass import OneVsRestClassifier from sklearn.preprocessing import LabelBinarizer from joblib import Parallel from joblib import delayed from sklearn.utils import resample from sklearn.utils.validation import check_is_fitted from sklearn.base import BaseEstimator, clone import warni...
gprana/READMEClassifier
script/helper/balancer.py
balancer.py
py
3,498
python
en
code
22
github-code
97
[ { "api_name": "sklearn.base.BaseEstimator", "line_number": 12, "usage_type": "name" }, { "api_name": "sklearn.utils.validation.check_is_fitted", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.repeat", "line_number": 21, "usage_type": "call" }, { "...
16334852816
import torch from d2l import torch as d2l def multibox_prior(data, sizes, ratios): in_height, in_width = data.shape[-2:] device, num_sizes, num_ratios = data.device, len(sizes), len(ratios) boxes_per_pixel = (num_sizes + num_ratios - 1) size_tensor = torch.tensor(sizes, device=device) ratio_tensor ...
xuhuasheng/Dive2DeepLearning-pytorch
computer-vision/anchor.py
anchor.py
py
2,397
python
en
code
0
github-code
97
[ { "api_name": "torch.tensor", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.arange", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.arange", "line_number"...
6668558365
# coding:utf-8 import codecs import os import re from setuptools import setup, find_packages def find_version(*file_paths): """ Don't pull version by importing package as it will be broken due to as-yet uninstalled dependencies, following recommendations at https://packaging.python.org/single_source_ver...
nooperpudd/quantbube
setup.py
setup.py
py
2,582
python
en
code
6
github-code
97
[ { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "codecs.open", "line_...
24752309280
import csv import json import yaml import random import sys import os import glob import argparse import uuid import datetime from pymongo import MongoClient from pymongo.errors import ConnectionFailure from pymongo.errors import ConfigurationError parser = argparse.ArgumentParser(description="Overlay loader.") parse...
SBU-BMI/QuIPutils
python/quip_overlays.py
quip_overlays.py
py
4,503
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 28, "usage_type": "call" }, { "api_name": "pymongo.errors.ConnectionFailure", "line_number": 31, "usage_type": "name" }, { "api_...
28559525461
from django.core.paginator import Paginator from django.contrib.auth.decorators import login_required from django.contrib.auth import get_user_model from django.shortcuts import render, get_object_or_404, redirect from posts.models import Post, Group, Follow from django.views.decorators.cache import cache_page from po...
Vlados684/hw05_final
yatube/posts/views.py
views.py
py
4,062
python
en
code
0
github-code
97
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 12, "usage_type": "call" }, { "api_name": "django.core.paginator.Paginator", "line_number": 16, "usage_type": "call" }, { "api_name": "posts.models", "line_number": 16, "usage_type": "argument" }, { ...
31438202107
from django.conf import settings from celery import shared_task from .tasks.generic.eth_balance_checker import EthBalanceChecker from .tasks.generic.address_turnover_checker import AddressTurnoverChecker from .tasks.generic.related_turnover_checker import RelatedTurnoverChecker from .tasks.generic.token_balance_checke...
hossamelneily/nexchange
ico/task_summary.py
task_summary.py
py
2,239
python
en
code
1
github-code
97
[ { "api_name": "tasks.generic.eth_balance_checker.EthBalanceChecker", "line_number": 15, "usage_type": "call" }, { "api_name": "celery.shared_task", "line_number": 13, "usage_type": "call" }, { "api_name": "django.conf.settings.FAST_TASKS_TIME_LIMIT", "line_number": 13, "u...
22173177675
# -*- coding: utf-8 -*- """ Created on Tue Dec 3 10:17:37 2019 @author: guill """ import argparse def parameter_parser(): """ A method to parse up command line parameters. By default it gives an embedding of the Facebook tvshow network. The default hyperparameters give a good quality representation and...
jestjest/cs224w-project
RefeX/main.py
main.py
py
2,258
python
en
code
1
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "refeX.RecursiveExtractor", "line_number": 70, "usage_type": "call" } ]
20514593615
import unittest import nltk from utils.nlp import NlpPreprocess, SentimentAnalysis class TestPreprocess(unittest.TestCase): def setUp(self): nltk.download("punkt") nltk.download("stopwords") self.nlp_preprocess = NlpPreprocess(config={"use_nlp_preprocess": True}) self.text_en = "...
optittm/survey-back-api
tests/test_nlp.py
test_nlp.py
py
1,517
python
en
code
0
github-code
97
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "nltk.download", "line_number": 9, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 10, "usage_type": "call" }, { "api_name": "utils.nlp.NlpPreproc...
16841498143
from matplotlib import pyplot as plt import numpy as np from collections import defaultdict from numpy import poly1d, polyfit from scipy.stats import poisson import time from mpl_toolkits.axes_grid1 import make_axes_locatable, ImageGrid from mpl_toolkits.axes_grid1.inset_locator import (inset_axes, InsetPosition, ...
NDLOHGRP/SIR
genSIRUniverse.py
genSIRUniverse.py
py
18,093
python
en
code
0
github-code
97
[ { "api_name": "seaborn.set", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_n...
17389031462
import numpy as np import matplotlib.pyplot as plt Sil = np.load('Sil.npy') dim_range = range(1, 32) score = np.load('Score.npy') plt.axes([0.15, 0.15, 0.70, 0.70]) plt.plot(dim_range, score, '.-', markersize = 20) plt.grid('on') plt.xlabel('Dimensions (D)', size = 20) plt.ylabel('Mutual information score', size = ...
spinto88/Analisis_notas
analisis_score_dim.py
analisis_score_dim.py
py
446
python
en
code
0
github-code
97
[ { "api_name": "numpy.load", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.axes", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "l...
70933105920
from dashboard.models import Dashboard from datetime import datetime import os, platform import psutil from datetime import timedelta #class MyCronJob(CronJobBase): def MyCronJob1(): os.system("/bin/echo blablabla >> /tmp/teste") swapp=psutil.swap_memory() #>>> swap[3] = porcentagem da SWAP usada #(to...
enailecr/CAMBOXURA
dashboard/cron.py
cron.py
py
1,565
python
en
code
0
github-code
97
[ { "api_name": "os.system", "line_number": 9, "usage_type": "call" }, { "api_name": "psutil.swap_memory", "line_number": 10, "usage_type": "call" }, { "api_name": "psutil.disk_usage", "line_number": 17, "usage_type": "call" }, { "api_name": "psutil.cpu_percent", ...
26318903454
"""Load pipette command request, result, and implementation models.""" from __future__ import annotations from pydantic import BaseModel, Field from typing import TYPE_CHECKING, Optional, Type, Tuple from typing_extensions import Literal from opentrons_shared_data.pipette.dev_types import PipetteNameType from opentron...
Opentrons/opentrons
api/src/opentrons/protocol_engine/commands/load_pipette.py
load_pipette.py
py
3,075
python
en
code
363
github-code
97
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 17, "usage_type": "name" }, { "api_name": "typing_extensions.Literal", "line_number": 21, "usage_type": "name" }, { "api_name": "configuring_common.PipetteConfigUpdateResultMixin", "line_number": 24, "usage_type": "name...
6269717478
#!/usr/bin/env python # coding: utf-8 # In[102]: import requests import pandas as pd import pymongo from splinter import Browser from bs4 import BeautifulSoup from webdriver_manager.chrome import ChromeDriverManager from flask import Flask, render_template, redirect # In[11]: # Create flask app app = Flask(__name...
saiyidmkazmi/web-scraping-challenge
Mission_to_Mars/scrape_mars.py.py
scrape_mars.py.py
py
4,259
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 18, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 22, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 29, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", ...
23196044829
import pandas as pd import time import concurrent.futures import requests import matplotlib.pyplot as plot # Incorporate 1 or more modules to assess and measure program performance. # Apply approaches and libraries to deliver asynchronous programming. # Implement parallel process or multithreading to deliver con...
joseph8medina/CIS30E-Final-Project-Joseph-Medina
main.py
main.py
py
5,602
python
en
code
0
github-code
97
[ { "api_name": "time.perf_counter", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "concurrent.futures.futures.ThreadPoolExecutor", "line_number": 31, "usage_type": "call" }, { "api_...
29245262947
import os import json def json2txt(jsonFile,txtFile): with open(jsonFile, 'r') as load_f: load_dict = json.load(load_f) with open(txtFile, 'a') as f_txt: f_txt.truncate(0) for item in load_dict["shapes"]: txt_role = "" for point in item["points"]: ...
LittleSheepy/MyMLStudy
data/json文件转换.py
json文件转换.py
py
785
python
en
code
3
github-code
97
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 24, "usage_type": "call" } ]
29367222247
# -*- coding: utf-8 -*- import io import json import logging import os import sys from typing import Annotated import yaml from fastapi import FastAPI, Query, Depends from fastapi.encoders import jsonable_encoder from starlette.responses import JSONResponse, FileResponse, Response from datas.metadata import speakers_...
pierreaubert/spinorama
src/api/main.py
main.py
py
4,340
python
en
code
72
github-code
97
[ { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "logging.error", "line_number": 26, "usage_type": "call" }, { "api_name": "sys.exit", "line_number...
16242343634
from django.template.response import TemplateResponse from rest_framework.response import Response from movies_api.models import Movies from movies_api.serializers import MovieSerializer from rest_framework import viewsets import pandas as pd class MovieViewSet(viewsets.ViewSet): def list(self, re...
Rudra-writ/IMDb_movies
movies_api/views.py
views.py
py
2,679
python
en
code
0
github-code
97
[ { "api_name": "rest_framework.viewsets.ViewSet", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 9, "usage_type": "name" }, { "api_name": "movies_api.models.Movies.objects.values_list", "line_number": 16, "usage_type"...
5582804428
import time import re from hashlib import md5 from typing import Any, Dict, Optional, Union, Tuple from urllib.parse import urlencode from httpx import AsyncClient from httpx._models import Response from httpx._types import HeaderTypes, ProxiesTypes, URLTypes from .._typing import T_Auth from ..auth import Auth from ...
SK-415/bilireq
bilireq/utils/__init__.py
__init__.py
py
5,850
python
en
code
53
github-code
97
[ { "api_name": "typing.Dict", "line_number": 25, "usage_type": "name" }, { "api_name": "httpx.AsyncClient", "line_number": 31, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 43, "usage_type": "name" }, { "api_name": "typing.Any", "line_numb...
22202138169
import pandas as pd from datetime import datetime, timedelta import pytz from dateutil import rrule ## Code reference from Zipline's code: # https://github.com/quantopian/zipline/blob/43b85cffb06bfb90db48bbc9ac9f3ea242a01ef1/zipline/utils/tradingcalendar.py def canonicalize_datetime(dt): # Strip out any HHMMSS or...
jaycode/p4f
04_pandas/trading_calendar.py
trading_calendar.py
py
6,145
python
en
code
1
github-code
97
[ { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "call" }, { "api_name": "pytz.utc", "line_number": 12, "usage_type": "attribute" }, { "api_name": "dateutil.rrule.rrule", "line_number": 20, "usage_type": "call" }, { "api_name": "dateutil.rrule",...
21184847420
import discord from discord.ext import commands from JuiceboxReader import JuiceboxReader from database import Database _collection = 'test_data' JBReader = JuiceboxReader() class Settings(commands.Cog): def __init__(self, client): self.client = client @commands.command(name='alerts_here', h...
Canu-DAO/canu_bot
cogs/server_settings.py
server_settings.py
py
1,320
python
en
code
0
github-code
97
[ { "api_name": "JuiceboxReader.JuiceboxReader", "line_number": 7, "usage_type": "call" }, { "api_name": "discord.ext.commands.Cog", "line_number": 9, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 9, "usage_type": "name" }, { "api...
20070671017
from __future__ import annotations import json import logging import math import os import shutil import urllib.parse from typing import List, Any, Dict from zipfile import BadZipFile, ZipFile import pendulum from airflow.exceptions import AirflowException from airflow.models.taskinstance import TaskInstance from goo...
The-Academic-Observatory/academic-observatory-workflows
academic_observatory_workflows/workflows/ror_telescope.py
ror_telescope.py
py
15,867
python
en
code
12
github-code
97
[ { "api_name": "observatory.platform.workflows.workflow.SnapshotRelease", "line_number": 35, "usage_type": "name" }, { "api_name": "pendulum.DateTime", "line_number": 36, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 52, "usage_type": "call" }...