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
4251505090
import asyncio class AsyncRTSPClient: def __init__(self, server, port): self.server = server self.port = port self.reader = None self.writer = None async def read_headers(self): bytes = await self.reader.readline() line = bytes.decode('UTF-8') # print("...
miurahr/asyncio-sample
client.py
client.py
py
1,835
python
en
code
0
github-code
18
[ { "api_name": "asyncio.open_connection", "line_number": 25, "usage_type": "call" }, { "api_name": "asyncio.run", "line_number": 62, "usage_type": "call" } ]
71075536680
from __future__ import division from __future__ import print_function from __future__ import absolute_import import os, re, copy, itertools import pandas as pd import numpy as np import torch from torch.utils.data import Dataset # from nltk.corpus import stopwords class MultiseqDataset(Dataset): """Multimodal dat...
desmond-ong/TAC-EA-model
models/async/datasets.py
datasets.py
py
14,215
python
en
code
10
github-code
18
[ { "api_name": "torch.utils.data.Dataset", "line_number": 12, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 55, "usage_type": "call" }, { "api_name": "re.match", "line_number": 56, "usage_type": "call" }, { "api_name": "os.path.join", "line...
25663627926
from aiogram import types from aiogram.dispatcher import FSMContext from loader import dp, bot, logger from states.user import UserStates from swtichers import UserSwitchers from view import buttons @dp.message_handler(text=buttons.back, state=UserStates.SELECT_SUBJECT) async def back_from_select_subject(message: ty...
freddy-prom/ITMOQueue
bot/handlers/user/select_subject.py
select_subject.py
py
990
python
en
code
1
github-code
18
[ { "api_name": "aiogram.types.Message", "line_number": 11, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 11, "usage_type": "name" }, { "api_name": "aiogram.dispatcher.FSMContext", "line_number": 11, "usage_type": "name" }, { "api_name":...
72095327079
from django.forms import model_to_dict from django.shortcuts import render from django.shortcuts import render from django.http import HttpResponse, JsonResponse from django.shortcuts import render, redirect from django.contrib.auth import login, logout, authenticate from django.contrib.auth.mixins import LoginRequired...
xxy20020221/Backend
ScholarShare/Analysis/views.py
views.py
py
5,982
python
en
code
0
github-code
18
[ { "api_name": "UserManage.models.User.objects.get", "line_number": 53, "usage_type": "call" }, { "api_name": "UserManage.models.User.objects", "line_number": 53, "usage_type": "attribute" }, { "api_name": "UserManage.models.User", "line_number": 53, "usage_type": "name" ...
23890675755
from Scripts.DB import db_session from Scripts.DB.users import User import sqlalchemy.exc async def start(update, context): tguser = update.effective_user user_id = update.message.from_user.id user_name = update.message.from_user.name try: user = User() user.id = int(user_...
APELSIN123/YandexBot
Scripts/Commands/start.py
start.py
py
815
python
en
code
1
github-code
18
[ { "api_name": "Scripts.DB.users.User", "line_number": 12, "usage_type": "call" }, { "api_name": "Scripts.DB.db_session.create_session", "line_number": 19, "usage_type": "call" }, { "api_name": "Scripts.DB.db_session", "line_number": 19, "usage_type": "name" }, { "...
27442944567
from pydantic import BaseModel from telethon.tl.types import User from typing import Optional from cloudygram_api_server.models.asyncronous.base_response import BaseResponse class UserData(BaseModel): userId : Optional[str] username : Optional[str] firstName : Optional[str] lastName : Optional[str] ...
rhighs/cgas
cloudygram_api_server/models/asyncronous/user_model.py
user_model.py
py
973
python
en
code
3
github-code
18
[ { "api_name": "pydantic.BaseModel", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Optional", ...
38401603681
import collections def find_anagram_upgraded(S): with open('anagram/words.txt') as f: dictionary = [s.strip().lower() for s in f.readlines()] S_count = collections.Counter(S.lower()) anagram_list = [] for word in dictionary: word_count = collections.Counter(word) if all(word_c...
yomek33/google_step2023
week1/anagram1.py
anagram1.py
py
702
python
en
code
0
github-code
18
[ { "api_name": "collections.Counter", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 11, "usage_type": "call" } ]
6901561187
from classes.baseworker import BaseWorker from classes.FlickrAPI import flickr_get import discord help_message = """ ``` Sigma Flickr Images v1.0.0 commands: !fse [キーワード] ([画像枚数]) キーワードで検索した画像を表示します。 ``` """ class Worker(BaseWorker): async def join(self, message: discord.Message): # ここにかく await ...
sizumita/Sigma
apps/flickr/worker.py
worker.py
py
1,664
python
en
code
2
github-code
18
[ { "api_name": "classes.baseworker.BaseWorker", "line_number": 15, "usage_type": "name" }, { "api_name": "discord.Message", "line_number": 16, "usage_type": "attribute" }, { "api_name": "discord.Message", "line_number": 21, "usage_type": "attribute" }, { "api_name"...
38977559586
import environ from django.shortcuts import render from rest_framework.decorators import api_view from rest_framework.response import Response from .models import FoodOrder from . import Checksum env = environ.Env() environ.Env.read_env() @api_view(['POST']) def start_payment(request): OrderID = request.data['...
sumit-singh1196/Food-Delivery-App
swiggy-x-backend/Paytm/PaymentViews.py
PaymentViews.py
py
2,598
python
en
code
12
github-code
18
[ { "api_name": "environ.Env", "line_number": 9, "usage_type": "call" }, { "api_name": "environ.Env.read_env", "line_number": 11, "usage_type": "call" }, { "api_name": "environ.Env", "line_number": 11, "usage_type": "attribute" }, { "api_name": "models.FoodOrder.obj...
35548955694
from io import BytesIO import zipfile import tarfile from urllib.request import urlopen from collections import namedtuple import os tg = os.path.join(os.path.realpath(__file__)) Dataset = namedtuple('Dataset', ['name', 'instances', 'solutions']) datasets = \ [ Dataset(name="qaplib", ins...
8uurg/GeneticPermutationBenchmark
src/problems/QAP/instances/fetch.py
fetch.py
py
1,311
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.namedtuple", ...
11116167108
# From https://towardsdatascience.com/logistic-regression-python-7c451928efee, modifications made to learn how it works from scipy.special import expit import pandas as pd from sklearn.metrics import confusion_matrix from sklearn.model_selection import train_test_split from sklearn.datasets import make_classification ...
WheatleyTheCore/Learning-ML
code/LogisticRegression/LogisticRegression.py
LogisticRegression.py
py
1,104
python
en
code
0
github-code
18
[ { "api_name": "seaborn.set", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.datasets.make_classification", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 25, "usage_type": "call" }, { "api_na...
21036257742
#!/bin/python3 # =========================== # Ar-Ray-code 2022 # =========================== from PySide2.QtWidgets import QApplication, QWidget, QLineEdit, QInputDialog import sys import argparse class QuestionWidget(QWidget): def __init__(self): super().__init__() parser = argparse.ArgumentPar...
Ar-Ray-code/ReadableWidgets
PySide2/pyamlside2/commandline_widgets/question_lineedit.py
question_lineedit.py
py
1,078
python
en
code
3
github-code
18
[ { "api_name": "PySide2.QtWidgets.QWidget", "line_number": 10, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "PySide2.QtWidgets.QInputDialog", "line_number": 26, "usage_type": "call" }, { "...
23281753905
import sched from abc import ABC from program.abstract.algorithm import Algorithm from program.exec.track.track_only.hog_track import * schedule = sched.scheduler(time.time, time.sleep) delayId = "" class Track(Algorithm, ABC): def __init__(self): pass def execute(task): return Track.trac...
yejinlei/Dubhe
dubhe_data_process/program/exec/track/track.py
track.py
py
1,687
python
en
code
4
github-code
18
[ { "api_name": "sched.scheduler", "line_number": 7, "usage_type": "call" }, { "api_name": "program.abstract.algorithm.Algorithm", "line_number": 12, "usage_type": "name" }, { "api_name": "abc.ABC", "line_number": 12, "usage_type": "name" } ]
34345280224
import tweepy #pip install tweepy import csv import time import random #account's credentials : available on twitter dashboard, when you select the app and go to keys and tokens consumer_key = "" consumer_secret = "" access_token = "" access_token_secret = "" acc_screen_name = "@GUNdotIO" #the user screen name for...
Bharathi-G98/TwitterBotWithPython
genericGetFollowers.py
genericGetFollowers.py
py
1,682
python
en
code
0
github-code
18
[ { "api_name": "csv.writer", "line_number": 17, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 23, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 32, "usage_type": "call" }, { "api_name": "tweepy.Cursor", "li...
38651808728
import json import base64 from io import BytesIO from typing import Any from salesforce_functions import Context, InvocationEvent, get_logger import requests from PIL import Image # The type of the data payload sent with the invocation event. # We're specifying a specific type for improved IDE auto-completion # and ...
pozil/python-functions
functions/python_watermark/main.py
main.py
py
3,261
python
en
code
0
github-code
18
[ { "api_name": "salesforce_functions.get_logger", "line_number": 16, "usage_type": "call" }, { "api_name": "salesforce_functions.InvocationEvent", "line_number": 19, "usage_type": "name" }, { "api_name": "salesforce_functions.Context", "line_number": 19, "usage_type": "nam...
74708311401
from sklearn.neural_network import MLPRegressor from sklearn.metrics import r2_score, mean_absolute_error, mean_squared_error import numpy as np from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt import mlflow mlflow.sklearn.autolog() mlflow.set_experiment("mlpRegressor sklearn FINAL")...
Chilibonitsu/ML-mlflow-AND-OR-XOR-plus-Sine-Wave-prediction
timeSeries mlflow Final/mlpRegressor.py
mlpRegressor.py
py
2,142
python
en
code
0
github-code
18
[ { "api_name": "mlflow.sklearn.autolog", "line_number": 7, "usage_type": "call" }, { "api_name": "mlflow.sklearn", "line_number": 7, "usage_type": "attribute" }, { "api_name": "mlflow.set_experiment", "line_number": 8, "usage_type": "call" }, { "api_name": "mlflow....
39727243831
#1) Reverse the string using for loop by using the slicing options # (i.e. [start: stop: stepsize]. Here is the example using while loop. str1 = "Vimala's laptop" print(str1[0:len(str1)]) print(str1[::-1]) ##Reverse string #2) rstrip(), lstrip() and strip() used to remove the spaces on left, right and both # side...
Vimala390/Vimala_py
sam_strings_exerc.py
sam_strings_exerc.py
py
1,602
python
en
code
0
github-code
18
[ { "api_name": "re.split", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 35, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 35, "usage_type": "name" }, { "api_name": "re.compile", ...
11120707924
import xlrd class ZEDatas(): ''' Gestionnaire des données issues des packs B1 et B2 pour les zones d'emploi ''' def __init__(self): ''' Constructeur zones -- dictionnaire clef : code de la zone d'emploi valeur : ZEData de la zone d'em...
otelo-besoinlogement/otelo
outil/initialisation/charger_data.py
charger_data.py
py
8,057
python
fr
code
0
github-code
18
[ { "api_name": "xlrd.open_workbook", "line_number": 129, "usage_type": "call" } ]
12271715711
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import re import matplotlib.pyplot as plt import numpy as np def read_paragraph_file(filename): paragraphs = [] with open(filename, "r") as filepointer: for line in filepointer.readlines(): if line.strip()=="": continue # ignore ...
gentyp/TAL
pre_process_correction.py
pre_process_correction.py
py
7,737
python
en
code
0
github-code
18
[ { "api_name": "re.sub", "line_number": 56, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 64, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 65, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 66, "usage_type"...
45280660058
import torch from torch import nn class LabelSmoothingLoss_aftersoftmax(nn.Module): def __init__(self, classes, smoothing=0.0, dim=-1, ignore_index=1): super(LabelSmoothingLoss_aftersoftmax, self).__init__() self.confidence = 1.0 - smoothing self.smoothing = smoothing self.cls = cl...
sigirace/elmo_clone
paper/04_transformer/source/model/labelsmoothing.py
labelsmoothing.py
py
953
python
en
code
null
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.no_grad", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.zeros_like", "lin...
6950279875
import os import numpy as np import torch from torch.utils.data import DataLoader from tqdm import tqdm import pandas as pd import speechbrain as sb from hyperpyyaml import load_hyperpyyaml import sys import pdb if __name__ == "__main__": # Load hyperparameters file with command-line overrides hparams_file, r...
zhepeiw/clap_curation
retrieve_from_emb_thresh.py
retrieve_from_emb_thresh.py
py
1,697
python
en
code
4
github-code
18
[ { "api_name": "speechbrain.parse_arguments", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "hyperpyyaml.load_hyperpyyaml", "line_number": 17, "usage_type": "call" }, { "api_name":...
73689482599
import dash from dash import dcc from dash import html,Input, Output import dash_bootstrap_components as dbc from ..app import app from .sidebar_function_tab1 import TAB1_DROPDOWN,time_scale,date_picker_tab1,tab1_selector from data.data import temperature_df_full from .style import title_style,description_style,sub_tit...
DishaDH123/Home-Energy-Dashboard
src/components/sidebar1.py
sidebar1.py
py
1,611
python
en
code
0
github-code
18
[ { "api_name": "dash_bootstrap_components.Row", "line_number": 11, "usage_type": "call" }, { "api_name": "style.title_style", "line_number": 11, "usage_type": "name" }, { "api_name": "dash_bootstrap_components.Row", "line_number": 12, "usage_type": "call" }, { "api...
9912935582
"""Examples of computing Jacobian bounds. We show examples of: - Computing Jacobian bounds - Computing Linf local Lipschitz constants - Computing JVP bounds """ import numpy as np import torch import torch.nn as nn from auto_LiRPA import BoundedModule, BoundedTensor from auto_LiRPA.perturbations import PerturbationLp...
Verified-Intelligence/auto_LiRPA
examples/vision/jacobian_new.py
jacobian_new.py
py
5,407
python
en
code
235
github-code
18
[ { "api_name": "torch.nn.Sequential", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 19, "usage_type": "name" }, { "api_name": "auto_LiRPA.utils.Flatten", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn.Linear...
37494156467
'''Project Part 2: Import time and theta values from datafile.txt. Perform a 2-dimensional maximum likelihood fit to determine the best fit values of the parameters (F, tau1, tau2) and their errors. Find errors by varying one parameter whilst keeping all others fixed. Present the results in a table. ''' import math a...
bonniemcc/NumRep
project2.py
project2.py
py
2,562
python
en
code
0
github-code
18
[ { "api_name": "numpy.cos", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.inf", "line_number": 23, ...
15158970893
#coding utf-8 import serial import subprocess import time def main(): ser = serial.Serial('COM3',9600,timeout=1) ################################### cmd1 = "C:\\00_okamoto\\uwsc523\\uwsc.exe C:\\00_okamoto\\uwsc523\\3DPrint\\00_AutoMake.UWS" dist1min=1 dist1max= 5 dist1wait=10 dist1chk=...
coolbiz/Distance_Sensor
led.py
led.py
py
1,908
python
en
code
0
github-code
18
[ { "api_name": "serial.Serial", "line_number": 9, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 48, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 49, "usage_type": "call" }, { "api_name": "subprocess.call", "line_n...
24133615108
import datetime class sasFile: def readCurrentTask(self): try: file = open('currentTask.txt','r') currentTask = file.read(1) file.close() except Exception as e: self.updateCurrentTask('1') self.updateExceptionMessage("sasFile{readCurrentTa...
rizban114406/Attendance_Without_Display_Keypad
Python Scripts/sasFile.py
sasFile.py
py
6,644
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 53, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 53, "usage_type": "attribute" } ]
38389826864
from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QMainWindow, QPushButton, QLineEdit from PyQt5 import QtWidgets import numpy as np class MainWindow(QMainWindow): def __init__(self, parent=None): #Конструктор класса super().__init__() self.setMinimumSize(300, 300) # Устанавливаем размеры...
INePro/pythonProject8
main.py
main.py
py
4,321
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QPushButton", "line_number": 22, "usage_type": "call" }, { "api_name": "Py...
71032748521
global pg_user pg_user = os.getenv('DSTAT_PG_USER') or os.getenv('USER') global pg_pwd pg_pwd = os.getenv('DSTAT_PG_PWD') global pg_host pg_host = os.getenv('DSTAT_PG_HOST') global pg_port pg_port = os.getenv('DSTAT_PG_PORT') class dstat_plugin(dstat): """ Plugin for PostgreSQL connections. """ de...
zte-db/dool
plugins/dool_postgresql_backup.py
dool_postgresql_backup.py
py
1,631
python
en
code
0
github-code
18
[ { "api_name": "psycopg2.connect", "line_number": 41, "usage_type": "call" } ]
23519528379
# -*-coding:utf-8 -*- # !/usr/bin/env python3 import sys import time import requests import config sys.path.append("../") from logs import logs class Conduit: def __init__(self, api_token=config.PHA_CONFIG["BOT_API_TOKEN"], pha_url=config.PHA_CONFIG["PHA_URL"]): self.api_token = api_token self.pha_...
PengboBai/script
build_before/conduit.py
conduit.py
py
2,813
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "config.PHA_CONFIG", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logs.logs.error", ...
73811677160
import collections import copy import importlib import inspect import itertools import logging import math import os import pickle import sys import time import types import uuid from abc import ABCMeta, abstractmethod from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, Namespace from contextlib import ...
DataBiosphere/toil
src/toil/job.py
job.py
py
147,606
python
en
code
856
github-code
18
[ { "api_name": "sys.version_info", "line_number": 38, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 47, "usage_type": "attribute" }, { "api_name": "typing.TYPE_CHECKING", "line_number": 62, "usage_type": "name" }, { "api_name": "logg...
8230055270
from django.shortcuts import render,redirect #Importa as funções render,redirect que são utilizadas para renderizar templates HTML e redirecionar o usuário para outras páginas. from .models import Trofeus,Jogadores #Importar os modelos necessários def home(request): #Função que apresenta a página principal so site p...
RafaelCastro1000/ATIVIDADE-6-ENG-4021
appRafael/views.py
views.py
py
6,254
python
pt
code
0
github-code
18
[ { "api_name": "models.Trofeus.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Trofeus.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Trofeus", "line_number": 8, "usage_type": "name" }, { "api_name": "mo...
4028256612
from datetime import datetime, date users = [ { 'name' : 'Bill', 'birthday': '1983-6-1' #2022-05-17 }, { 'name' : 'Kim', 'birthday': '1980-5-25', #2022-05-17 }, { 'name' : 'Jan', 'birthday': '1997-5-18', #2022-05-17 }, { '...
AndrewAndrunin/goit_python-HW8
next_week_birthdayHW8_v1.py
next_week_birthdayHW8_v1.py
py
2,916
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 47, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 47, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 49, "usage_type": "call" }, { "api_name": "datetime.dateti...
4819030362
""" 31. Next Permutation Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such an arrangement is not possible, it must rearrange it as the loweest possible order (i.e., sorted in ascending order). The replacement must be in place and use only cons...
tkwang0530/LeetCode
0031.py
0031.py
py
2,867
python
en
code
4
github-code
18
[ { "api_name": "typing.List", "line_number": 43, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 71, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 83, "usage_type": "attribute" }, { "api_name": "unittest.main", "l...
5396958203
# coding: utf-8 """ WEX REST APIs Authentication methods - Basic Auth - JSON Web Token - [POST /api/v1/usermgmt/login](#!/User/signinUser) - [POST /api/v1/usermgmt/logout](#!/User/doLogout) - Python client sample [Download](/docs/wex-python-api.zip) OpenAPI spec version: 12.0.2.417 Generate...
adam725417/Walsin
wex-python-api/ibmwex/models/group_pattern.py
group_pattern.py
py
5,082
python
en
code
0
github-code
18
[ { "api_name": "six.iteritems", "line_number": 143, "usage_type": "call" }, { "api_name": "pprint.pformat", "line_number": 167, "usage_type": "call" } ]
18936489379
# VIDUR SUBAIAH, CONCEPTS OF PROGRAMMING, AUTUMN 2021 from task import Task from tasks import Tasks import argparse import global_variables task_list = Tasks() # initialize the Tasks object parser = argparse.ArgumentParser() # set up the parser # setting up the terms that the parser can recognize, the type of input...
vidur-subaiah/Command-Line-Task-Manager
todo.py
todo.py
py
2,351
python
en
code
0
github-code
18
[ { "api_name": "tasks.Tasks", "line_number": 9, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "task.Task", "line_number": 27, "usage_type": "call" } ]
17511230459
import itertools import random import operator import copy import math ids = ["316217835", "206824690"] class DroneAgent: def __init__(self, initial): self.map= initial['map'] self.drones= initial['drones'] self.dronesName= set(self.drones.keys()) self.packages= initial['packages']...
Lishay2/AI_HW2
ex2.py
ex2.py
py
16,794
python
en
code
0
github-code
18
[ { "api_name": "copy.deepcopy", "line_number": 36, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 42, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 48, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": ...
73894552360
import logging import pathlib import yaml import asyncio from aiopg.sa import create_engine BASE_DIR = pathlib.Path(__file__).parent.parent STATIC_DIR = pathlib.Path(__file__).parent / 'static' config_path = BASE_DIR / 'config' / 'app.yaml' # logging.basicConfig(filename=BASE_DIR/"log/base.log", level=logging.INFO)...
Hilinetria/Test
base/app/settings.py
settings.py
py
2,350
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.getLogger", "li...
22506124855
import os import argparse import tensorflow as tf from dataset import Dataset from hp import set_dataset import hp class ProgramArguments(argparse.ArgumentParser): def __init__(self, rank: int): super().__init__(description='Cnns through asynchronoUs Training and Evolution (cute) for TensorFlow', add_h...
jkarns275/cute
src/program_arguments.py
program_arguments.py
py
3,875
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "attribute" }, { "api_name": "hp.set_weight_initialization", "line_number": 56, "usage_type": "call" }, { "api_name": "hp.set_number_epochs", "line_number": 60, "usage_type": "call" }, { "ap...
37837177195
import unittest import sys from PySide2.QtWidgets import QApplication import matplotlib.pyplot as plt from pytestqt import qtbot from Master_GUI_App import MainWindow class Test_test_1(unittest.TestCase): def test_input_validation(self): app = QApplication(sys.argv) window = Main...
Abdallah-Ashraf202/Function_Plotter
Master_Micro_Function_Plotter/Master_GUI_App/Master_GUI_App/test_1.py
test_1.py
py
1,799
python
en
code
0
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "PySide2.QtWidgets.QApplication", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "Ma...
165830869
import os import imageio images = [] path = './GS_Result' filenames = os.listdir(path) filenames.sort() print(filenames) for filename in filenames: if filename.endswith('.png'): images.append(imageio.imread(path+'/'+filename)) print(filename) imageio.mimsave('./result_MSE.gif', images)
hello5949/PhoneLock
GIF_maker.py
GIF_maker.py
py
307
python
en
code
0
github-code
18
[ { "api_name": "os.listdir", "line_number": 6, "usage_type": "call" }, { "api_name": "imageio.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "imageio.mimsave", "line_number": 13, "usage_type": "call" } ]
45280617018
import time import os import os.path as osp import re import pickle import argparse import random from tqdm import tqdm import numpy as np import functools import logging import torch import torch.nn as nn import torch.optim as optim from .model import * from .dataloader import * from .utils import * # writer = Summa...
sigirace/elmo_clone
paper/03_attention/source/trainer.py
trainer.py
py
7,472
python
en
code
null
github-code
18
[ { "api_name": "random.seed", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", ...
14382160594
import logging from pages.elements.alerts import AlertsMessages from pages.main_page import MainPage from pages.wish_list_page import WishListPage logger = logging.getLogger("test") class TestWishListPage: def test_add_goods_wish_list_not_register(self, browser): main_page = MainPage(browser) a...
Nyusha52/opencart_tests
tests/test_wish_list.py
test_wish_list.py
py
990
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "pages.main_page.MainPage", "line_number": 13, "usage_type": "call" }, { "api_name": "pages.elements.alerts.AlertsMessages", "line_number": 14, "usage_type": "call" }, { "ap...
70222130920
import cv2 as cv import numpy as np from matplotlib import pyplot as plt img = cv.imread('/others/opencv.png',0) f = np.fft.fft2(img) fshift = np.fft.fftshift(f) magnitude_spectrum = 20*np.log(np.abs(fshift)) plt.subplot(121),plt.imshow(img, cmap = 'gray') plt.title('Input Image'), plt.xticks([]), plt.yticks([]) plt.su...
CSsaan/Deep-learning-of-machine-vision
ch2.图像预处理/fft.py
fft.py
py
451
python
en
code
46
github-code
18
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.fft.fft2", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.fft", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.fft.fftshift", "line_...
32358010351
from uuid import UUID from django.http import Http404 from django.shortcuts import render from django.views import View from apps.core.models import Task, TaskRecord class TaskDetailDiff(View): def get(self, request, task_record_id: UUID): try: task_record = TaskRecord.objects.get(pk=task_re...
FIIT-Databases/tester
apps/web/views/task_records.py
task_records.py
py
564
python
en
code
2
github-code
18
[ { "api_name": "django.views.View", "line_number": 10, "usage_type": "name" }, { "api_name": "uuid.UUID", "line_number": 11, "usage_type": "name" }, { "api_name": "apps.core.models.TaskRecord.objects.get", "line_number": 13, "usage_type": "call" }, { "api_name": "a...
44564533734
import deepspeech import wave import numpy as np from pydub import AudioSegment as am import time def predicts_audio(audio): w = wave.open(audio, 'r') sound = am.from_file(audio, format='wav', frame_rate=w.getframerate()) sound = sound.set_frame_rate(16000) sound.export('1', format='wav') w = wave.open('1', 'r') ...
Akash2021/Vai
SpeechToText/predict.py
predict.py
py
723
python
en
code
5
github-code
18
[ { "api_name": "wave.open", "line_number": 8, "usage_type": "call" }, { "api_name": "pydub.AudioSegment.from_file", "line_number": 9, "usage_type": "call" }, { "api_name": "pydub.AudioSegment", "line_number": 9, "usage_type": "name" }, { "api_name": "wave.open", ...
36520570143
import abc import logging import sqlite3 import sys from datetime import datetime, timedelta import pandas as pd from cryptofetcher import CryptoFetcher, CLOSE_COLUMN_NAME_CLEAN class CryptoCalculator(object, metaclass=abc.ABCMeta): def __init__(self, df): """ Queries the AV API for data which is s...
jaivalis/AlphaVantageCalculator
cryptocalculator.py
cryptocalculator.py
py
5,693
python
en
code
0
github-code
18
[ { "api_name": "abc.ABCMeta", "line_number": 12, "usage_type": "attribute" }, { "api_name": "abc.abstractmethod", "line_number": 18, "usage_type": "attribute" }, { "api_name": "abc.abstractmethod", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sqli...
13064039076
"""Add transaction_id to quark_mac_addresses Revision ID: 356d6c0623c8 Revises: 5632aa202d89 Create Date: 2015-04-14 01:53:48.233241 """ # revision identifiers, used by Alembic. revision = '356d6c0623c8' down_revision = '5632aa202d89' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column...
MichaelPorras/quark
quark/db/migration/alembic/versions/356d6c0623c8_add_transaction_id_to_quark_mac_.py
356d6c0623c8_add_transaction_id_to_quark_mac_.py
py
770
python
en
code
null
github-code
18
[ { "api_name": "alembic.op.add_column", "line_number": 18, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 18, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 19, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer...
10213591328
# -*- coding: utf-8 -*- """ Created on Fri Mar 10 09:11:39 2023 @author: Thomas Sartre et François Patinec-Haxel """ #importation de PIL pour la lecture des images from PIL import Image import numpy as np #récupération des deux textures sous forme d'arrays de couelurs perlinTex = list(Image.open("./Assets/precomputed...
Mortimer-Kerman/SpaceFactory
sources/NoiseTools.py
NoiseTools.py
py
2,549
python
fr
code
0
github-code
18
[ { "api_name": "PIL.Image.open", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 12, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number"...
2980558007
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse from django.views import View # for using Class based views from .forms import SuggessionForm from .models import SiteContent import smtplib from email.message import EmailMessage import imghdr from validate_email import validat...
nishikaverma/site-unravels
Website_UNRAVEL/homepage/views.py
views.py
py
3,199
python
en
code
0
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 24, "usage_type": "call" }, { "api_name"...
39289271400
#codding=utf-8 import pandas as pd from matplotlib import pyplot as plt sourcefile = u"C:/Users/Administrator/Desktop/CZURScanner文档/CZCVTestData/data.xlsx" data = pd.read_excel(sourcefile) plt.figure(figsize=(10,5)) plt.rcParams['font.sans-serif']=['SimHei'] plt.rcParams['axes.unicode_minus']=False plt.title('迭代版本...
oubingkun/hotch-potch
matplotlib/chart-line.py
chart-line.py
py
675
python
zh
code
1
github-code
18
[ { "api_name": "pandas.read_excel", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotli...
28338292335
from collections import deque def bfs(graph, start, end): visited = set() queue = deque([(start, [start])]) visited.add(start) while queue: (vertex, path) = queue.popleft() if vertex == end: return path for neighbor in graph[vertex]: if neighbor not i...
RoberthCCh/IA-busqueda
bfs.py
bfs.py
py
1,022
python
en
code
0
github-code
18
[ { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" } ]
32251846806
"""Main Script for m4b-util.""" import argparse import sys from rich import print from .__version__ import version from .subcommands import bind, cover, labels, slide, split def _print_version(): """Print the current version, then exit.""" print(f"[green]m4b-util[/], Version '{version}'") return 0 # S...
Tsubashi/m4b-util
src/m4b_util/__main__.py
__main__.py
py
2,216
python
en
code
3
github-code
18
[ { "api_name": "rich.print", "line_number": 13, "usage_type": "call" }, { "api_name": "__version__.version", "line_number": 13, "usage_type": "name" }, { "api_name": "subcommands.cover.run", "line_number": 19, "usage_type": "attribute" }, { "api_name": "subcommands...
19714865086
import simulation.simulation as simul import simulation.components as cmp import xmldiff.main import xmldiff.formatting import pickle import utils.general def base_test(): sim = simul.Simulation('D:/dartpy/config_templates/base575.toml', no_gen='not_implemented', ...
ARRRRGH/dartpy
test/base_test.py
base_test.py
py
2,574
python
en
code
0
github-code
18
[ { "api_name": "simulation.simulation.Simulation", "line_number": 10, "usage_type": "call" }, { "api_name": "simulation.simulation", "line_number": 10, "usage_type": "name" }, { "api_name": "simulation.simulation.Simulation.from_simulation", "line_number": 19, "usage_type"...
15031451352
from interactions import * from Utilities.fancysend import fancy_message import database as db import Utilities.badge_manager as badge_manager import Utilities.bot_icons as icons from datetime import datetime, timedelta import random class Command(Extension): current_limit = 0 wool_finds = [ 'You...
Axiinyaa/The-World-Machine
Commands/wool.py
wool.py
py
4,378
python
en
code
1
github-code
18
[ { "api_name": "database.fetch", "line_number": 44, "usage_type": "call" }, { "api_name": "Utilities.fancysend.fancy_message", "line_number": 47, "usage_type": "call" }, { "api_name": "Utilities.fancysend.fancy_message", "line_number": 50, "usage_type": "call" }, { ...
18306927161
from django.db import models # Create your models here. class Piece(models.Model): PAINTING = 'PA' ABSTRACT = 'AB' DRAWINGS = 'DR' INSTALLATIONS = 'IN' SCULPTURES = 'SC' PHOTOGRAPHY = 'PH' KIND = [ (PAINTING, 'Painting'), (SCULPTURES, 'Sculptures'), (DRAWINGS, 'Drawi...
LwangaConrad/galari
core/models.py
models.py
py
760
python
en
code
0
github-code
18
[ { "api_name": "django.db.models.Model", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.ImageField", "line_number": 19, "usage_type": "call" }, { "api_name":...
43325552010
import asyncio from bs4 import BeautifulSoup import aiohttp import csv url = 'https://climatescape.org/organizations' headers = { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36' } data_list = [] async def get_page_data(session, link): asyn...
Dim80188/fl_climat
climat_as.py
climat_as.py
py
4,139
python
en
code
0
github-code
18
[ { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "aiohttp.ClientSession", "line_number": 77, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 79, "usage_type": "call" }, { "api_name": "asyncio.cre...
41328603513
from Code.Customers import * import pickle import matplotlib.pyplot as plt import os ## ********************************************************************************************************************* ## Part I: Define Inputs ****************************************************************************************...
ludepo/TSE-Python-Project
Code/Simulation.py
Simulation.py
py
9,278
python
en
code
0
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
29072597606
# BOJ No.1302 # 베스트셀러 from collections import Counter n=int(input()) lst=[] for i in range(n): lst.append(input()) cnt=Counter(lst) result=cnt.most_common() result.sort(key=lambda x : (-x[1],x[0])) print(result[0][0])
Segye-kr/DataStructure-and-Algorithm
String/BOJ_1302.py
BOJ_1302.py
py
234
python
en
code
0
github-code
18
[ { "api_name": "collections.Counter", "line_number": 10, "usage_type": "call" } ]
29981379203
import argparse import logging import json import sys import requests import uuid import time import boto3 import botocore from utils.config_loader import Config from pprint import pprint as pretty import json import random from datetime import datetime from payloadHandler import payloadHandler from cmsHandler imp...
givenand/aws-cms-telemetry-demo
generateTelemetry.py
generateTelemetry.py
py
5,049
python
en
code
2
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "awscrt.mqtt.ConnectReturnCode", "line_number": 34, "usage_type": "attribute" }, { "api_name": "awscrt.mqtt", "line_number": 34, "usage_type": "name" }, { "api_name": "payl...
27930154675
import collections def solution(orders, course): answer = [] cnt = collections.defaultdict(int) def DFS(s, c, x): if len(c) in course: cnt[''.join(c)] += 1 if x >= len(s): return for i in range(x, len(s)): c.append(s[...
Yuha0123/Algorithm
Programmers/메뉴 리뉴얼.py
메뉴 리뉴얼.py
py
967
python
en
code
0
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 4, "usage_type": "call" } ]
21180113466
import tensorflow as tf import numpy as np from datetime import datetime class DQN: def __init__(self, game, name='DQN'): self.state_size = game.state_size self.action_size = game.action_size self.possible_actions = game.possible_actions self.gamma = 0.95 self.dir_saved_checkpoints = "/Users/Vincent/Pychar...
vincent-cr/DINO_CHROME
dqn.py
dqn.py
py
5,665
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" }, { "api_name": "tensorflow.variable_scope", "line_number": 15, "usage_type": "call" }, { "api_name": "ten...
14607781650
#!/usr/bin/python import argparse from getpass import getpass import os import time import shutil import sys from selenium import webdriver from selenium.webdriver.firefox.options import Options from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys parser = argparse.ArgumentParse...
nepcore/PufferScreens
screens.py
screens.py
py
6,468
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "getpass.getpass", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path", ...
43690902430
import concurrent.futures from typing import List from wordy.utils import ALL_POSSIBLE_CASES import wordy.match_cases as mc def __update_words_prob(words_prob: dict, case: List[str], hash_case: str, able_to_play_word: str, possible_words_answer: List[str]): ''' Update words_prob(dict)...
jamemamjame/wordy
wordy/words_probs_calculator.py
words_probs_calculator.py
py
1,690
python
en
code
2
github-code
18
[ { "api_name": "typing.List", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 9, "usage_type": "name" }, { "api_name": "wordy.match_cases.is_match_case", "line_number": 15, "usage_type": "call" }, { "api_name": "wordy.match_cas...
18648672920
from http import client from flask import Flask, render_template, request from manter.entities import Cliente from . import app @app.route("/index") def home(): return render_template("index.html") @app.route("/new") def new(): # recebe os campos do formulario # cria o objeto cliente # chamar a cla...
romildodcm/dev-web-2
20220215-crud-cliente/webapp/routes.py
routes.py
py
1,246
python
pt
code
0
github-code
18
[ { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.form.get", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 19, "usage_type": "attribute" }, { "api_name": "...
21177975008
import argparse from PIL import Image def convert(filepath, combine_8): """ Converts greyscale image pixels to binary numbers and saves the result to a text file. :param filepath: The path to the image file. :param combine_8: Combine every 8 bits into a single number from range 0-255. """ # Op...
PWrWhiteHats/BtS-2023-Writeups
misc/Nebula/solution/picture-script.py
picture-script.py
py
4,566
python
en
code
2
github-code
18
[ { "api_name": "PIL.Image.open", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 12, "usage_type": "name" }, { "api_name": "PIL.Image.new", "line_number": 98, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number":...
12293198052
import typing as t from pygls.features import (COMPLETION, TEXT_DOCUMENT_DID_CHANGE, TEXT_DOCUMENT_DID_CLOSE, TEXT_DOCUMENT_DID_OPEN) from pygls.server import LanguageServer from pygls.types import (CompletionItem, CompletionList, CompletionParams, DidChangeTextDocum...
lark-parser/lark-language-server
lark_language_server/server.py
server.py
py
1,929
python
en
code
13
github-code
18
[ { "api_name": "pygls.server.LanguageServer", "line_number": 12, "usage_type": "name" }, { "api_name": "pygls.types.DidChangeTextDocumentParams", "line_number": 22, "usage_type": "name" }, { "api_name": "error_reporting.get_diagnostics", "line_number": 25, "usage_type": "c...
19347709682
from selenium import webdriver from selenium.webdriver.chrome.service import Service chrome_driver_path = Service("/snap/bin/chromium.chromedriver") driver = webdriver.Chrome(service=chrome_driver_path) # driver = webdriver.Firefox() driver.get(url="https://www.amazon.in/Intel-Performance-NUC11PAHI5-Thunderbolt-Pre-I...
anbuchelva/learn-python
075-selenium-web-driver/amazon-price.py
amazon-price.py
py
578
python
en
code
0
github-code
18
[ { "api_name": "selenium.webdriver.chrome.service.Service", "line_number": 4, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 5, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 5, "usage_type": "name" } ]
36656237533
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="tinycircuits-sx1505", version="0.0.1", author="TinyCircuits", author_email="info@tinycircuits.com", description="SX1505 Joystick & Rotary Python library", long_description=long_descri...
TinyCircuits/TinyCircuits-SX1505-Python
setup.py
setup.py
py
726
python
en
code
0
github-code
18
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 15, "usage_type": "call" } ]
40640921078
from flask import Flask, url_for, redirect, render_template import random from db_scripts import get_question n_quiz = 0 n_quest = 0 def index(): global n_quiz, n_quest n_quest = 0 n_quiz = 0 return render_template('start.html') def test(): global n_quiz, n_quest result = get_question(n_qui...
Comandorr/test_site
quiz.py
quiz.py
py
1,074
python
en
code
0
github-code
18
[ { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "db_scripts.get_question", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.redirect", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.ur...
5679211738
import os import sys import pygame import random pygame.init() pygame.mixer.init() executing_wd = os.path.dirname(os.path.realpath(sys.argv[0])) current_wd = os.path.join(executing_wd, "assets") music_wd = os.path.join(current_wd, "music") sounds = [] ALL_SOUNDS = [] # music_wd = variables.music_wd list(map(lambda ...
a-abir/Retrove
music.py
music.py
py
1,768
python
en
code
0
github-code
18
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.mixer.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "l...
3273407641
import torch from bench.core.executer import Executer def yolo_encode(bboxes, gt_bboxes, stride, eps): """Get box regression transformation deltas that can be used to transform the ``bboxes`` into the ``gt_bboxes``. Args: bboxes (torch.Tensor): Source boxes, e.g., anchors. gt_bboxes (torc...
DeepLink-org/DLOP-Bench
bench/samples/long_tail/yolo_encode/torch_impl.py
torch_impl.py
py
1,776
python
en
code
38
github-code
18
[ { "api_name": "torch.log", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.log", "line_number": 30, "usage_type": "call" }, { "api_name": "torch.stack", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.from_numpy", "line_number":...
26860282495
from flask_cors import CORS from flask import Flask, jsonify, request from flask_restful import Api from modelos import db, UsuarioSchema, Usuario usuario_schema = UsuarioSchema() app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///micro-usuario.db.sqlite' app.config['SQLALCHEMY_TRACK_MODIFICATI...
duvanjamidvc/seguridad-exp
usuario/app.py
app.py
py
1,093
python
es
code
0
github-code
18
[ { "api_name": "modelos.UsuarioSchema", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "modelos.db.init_app", "line_number": 17, "usage_type": "call" }, { "api_name": "modelos.db", ...
71427350440
import re import gc import os import cv2 import glob import keras import shutil import pathlib import PIL import numpy as np import pandas as pd import seaborn as sb import networkx as nx import tensorflow as tf import matplotlib.pyplot as plt from shutil import copyfile import tensorboard from datetim...
aorursy/new-nb-3
immune_beginner-plant-pathology-eda-w-mplot3d.py
immune_beginner-plant-pathology-eda-w-mplot3d.py
py
9,682
python
en
code
0
github-code
18
[ { "api_name": "tensorflow.__version__", "line_number": 70, "usage_type": "attribute" }, { "api_name": "tensorflow.executing_eagerly", "line_number": 72, "usage_type": "call" }, { "api_name": "cv2.__version__", "line_number": 74, "usage_type": "attribute" }, { "api...
28059282668
'''Spectroscopic source object''' import sys import numpy as np from astropy.io import fits from astropy.wcs import WCS from astropy import units as u from scipy.interpolate import interp1d class SpectralSource(): '''Source object for the spectroscopy mode Create a source object consisting of a number of po...
oczoske/SpecCADO
speccado/source.py
source.py
py
4,771
python
en
code
0
github-code
18
[ { "api_name": "numpy.min", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 46, "usage_type": "call" }, { "api_name": "astropy.units.m", "line_number"...
70230944362
import numpy as np import bsopt import workdays import datetime import misc def delta_to_logratio(delta, vol, time2mat): return vol * (0.5 * vol - np.sqrt(time2mat) * bsopt.cnorminv(delta)) def ExpIntegral(b, tau): if (b == 0) or (tau ==0): return 1.0 else: return (1 - np.exp(-b*tau))/(b*...
harvey1673/pyktrader2
cmq_volgrid.py
cmq_volgrid.py
py
6,064
python
en
code
36
github-code
18
[ { "api_name": "numpy.sqrt", "line_number": 9, "usage_type": "call" }, { "api_name": "bsopt.cnorminv", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 18,...
74568360681
from django.db import models from django.utils.translation import ugettext_lazy as _ # Create your models here. class Employer(models.Model): name = models.CharField(_("Employer Name"), max_length=250) # ein = models.CharField(_("EIN"), max_length=150, blank=True, null=True) street = models.CharField(_("St...
anandharshini/cms-benefits
employer/models.py
models.py
py
829
python
en
code
0
github-code
18
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 6, "usage_type": "call" }, { "api_name": "...
44481296968
from django import forms from api.models import Match, Object, Action class MatchForm(forms.ModelForm): class Meta: model = Match fields = ('matchid', 'player', 'status', 'played_as', 'score', 'playtime', 'turn_count', 'spawned', 'killed', 'damage', 'heal', 'created_at', 'termin...
startergate/Basterds-Stat-Server
api/forms.py
forms.py
py
774
python
en
code
0
github-code
18
[ { "api_name": "django.forms.ModelForm", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "api.models.Match", "line_number": 8, "usage_type": "name" }, { "api_name": "django.forms.M...
18618353934
import tkinter as tk from tkinter import filedialog from moviepy.editor import VideoFileClip class VideoPlayerApp: def __init__(self, master): self.master = master self.master.title("Video Player") self.master.geometry("400x200") self.label = tk.Label(self.master, text="S...
RayVinc/ExtractLastFrameMP4
mp4runtime.py
mp4runtime.py
py
2,000
python
en
code
0
github-code
18
[ { "api_name": "tkinter.Label", "line_number": 11, "usage_type": "call" }, { "api_name": "tkinter.StringVar", "line_number": 14, "usage_type": "call" }, { "api_name": "tkinter.Entry", "line_number": 15, "usage_type": "call" }, { "api_name": "tkinter.Button", "l...
4447156767
# coding=utf-8 import datetime from urlparse import urlparse from google.appengine.ext import ndb __author__ = 'Jan Skalicky <hskalicky@gmail.com>' class WebScreenShot(ndb.Model): site_uri = ndb.StringProperty() site_host_uri = ndb.StringProperty() created = ndb.DateTimeProperty(auto_now_add=True) im...
vexis211/WebScreenShotter
webscreenshots.py
webscreenshots.py
py
1,517
python
en
code
0
github-code
18
[ { "api_name": "google.appengine.ext.ndb.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "google.appengine.ext.ndb", "line_number": 9, "usage_type": "name" }, { "api_name": "google.appengine.ext.ndb.StringProperty", "line_number": 10, "usage_type": "ca...
10606683801
#!/usr/bin/env python3 import os import re import sys import csv import gzip import lzma import glob import logging import datetime import argparse import collections from datetime import datetime from os import path sys.path.insert(0, "../btccrawlgo-processing") from processing.dataset import Dataset import util ...
ralphholz/bc-comparisons
load_scan.py
load_scan.py
py
13,009
python
en
code
0
github-code
18
[ { "api_name": "sys.path.insert", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "logging.warning", "line_number": 31, "usage_type": "call" }, { "api_name": "logging.info", "lin...
38540135993
import numpy as np import torch as T import torch.nn as nn import torch.nn.functional as F from utils import build_base_model from torch.distributions.categorical import Categorical class Actor(nn.Module): def __init__( self, state_dim: int, action_dim: int, hidden_layers: tuple[int] ) -> None: ...
mhyrzt/Simple-MADRL-Chess
learnings/ppo/actor.py
actor.py
py
845
python
en
code
8
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "utils.build_base_model", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn.Softmax...
28060931639
## referenced Harvard CS205 Course Material Lecture C3 ## https://harvard-iacs.github.io/2021-CS205/lectures/C3/ import sys, os, requests, time, math, time import datetime as dt import yfinance as yf import numpy as np import pandas as pd import socket import sys import requests import json # this method sends t...
vrsivananda/CS205_FinalProject
stock_predict/predict/stock_client.py
stock_client.py
py
2,992
python
en
code
1
github-code
18
[ { "api_name": "sys.exc_info", "line_number": 30, "usage_type": "call" }, { "api_name": "yfinance.download", "line_number": 37, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 66, "usage_type": "call" }, { "api_name": "requests.get", "line_nu...
30861757120
import os import time from collections import OrderedDict from flask import Flask from pyairtable import Table app = Flask(__name__) env_config = os.getenv("PROD_APP_SETTINGS") app.config.from_object(env_config) AIRTABLE_SECRET_TOKEN = os.getenv("AIRTABLE_SECRET_TOKEN") AIRTABLE_BASE_ID = os.getenv("AIRTABLE_BASE_ID"...
alexanderbcook/guidebook
utilities.py
utilities.py
py
2,475
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 12, ...
36646438032
import pygame, sys, time from snake import Snake from score import Score from food import Food pygame.mixer.pre_init(44100, -16, 2, 512) pygame.init() clock = pygame.time.Clock() # Screen parameters width = 400 height = 400 screen = pygame.display.set_mode((width, height)) pygame.display.set_caption("Snake") # Play...
uglkjgj/snake-game
game.py
game.py
py
3,640
python
en
code
0
github-code
18
[ { "api_name": "pygame.mixer.pre_init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.time.Clock", ...
13256304300
from __future__ import annotations from dataclasses import dataclass, field, replace from multiprocessing import Queue from coin.multiprocessing import mp_ctx from coin.process import Process, send_queue_message from coin.node_context import NodeContext from coin.block import OpenBlock, SealedBlockHeader from coin.find...
wgoldie/coin
coin/mining.py
mining.py
py
1,768
python
en
code
1
github-code
18
[ { "api_name": "coin.node_context.NodeContext", "line_number": 13, "usage_type": "name" }, { "api_name": "coin.block.OpenBlock", "line_number": 15, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 11, "usage_type": "call" }, { "api_name...
31052973081
import os import time from celery import Celery from .api_routers.routers_config import connecting_to_db from backend.parser_app.parser import (get_product_html, find_name, get_price, check_availability,...
theorgfortwoofus/sephora-parser
backend/parser_app/celery_tasks.py
celery_tasks.py
py
2,219
python
en
code
0
github-code
18
[ { "api_name": "celery.Celery", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.environ.get", "li...
7430372150
from scipy.sparse import issparse import numpy as np import pandas as pd def gower_matrix(data_x, data_y=None, weight=None, cat_features=None): # function checks X = data_x if data_y is None: Y = data_x else: Y = data_y if not isinstance(X, np.ndarray): if not np.array_equal(X.col...
w4k2/problexity
problexity/classification/gower.py
gower.py
py
4,399
python
en
code
18
github-code
18
[ { "api_name": "numpy.ndarray", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.array_equal", "line_number": 12, "usage_type": "call" }, { "api_name": "scipy.sparse.issparse", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.Dat...
2611662165
import os, time, pickle, gzip import pandas as pd import numpy as np import multiprocessing as mp pool_size = mp.cpu_count() import pickle from datetime import datetime from collections import OrderedDict, defaultdict from lib import conventions as conv from lib import submiter # global variable for multi-thread glob...
Marsan-Ma-zz/checkins
lib/merge_cv.py
merge_cv.py
py
5,563
python
en
code
1
github-code
18
[ { "api_name": "multiprocessing.cpu_count", "line_number": 5, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 32, "usage_type": "call" }, { "api_name": "collections.OrderedDi...
40587024409
import pymysql import random import math def gen_Secure_Random(min, max): systemRandom = random.SystemRandom() return systemRandom.randint(min, max) def compute_Identification_Verification(alpha, response, public_Key, challenge, p): return pow(alpha, response, p) * pow(public_Key, challenge, p) % p # # #...
D3vRandom/Zero-Knowledge-Proof-Identity-Verification
Lambda/BankPaymentProcessor.py
BankPaymentProcessor.py
py
5,596
python
en
code
8
github-code
18
[ { "api_name": "random.SystemRandom", "line_number": 6, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 25, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 31, "usage_type": "call" }, { "api_name": "pymysql.connect", ...
4820316182
""" 1382. Balance a Binary Search Tree Given a binary search tree, return a balanced binary search tree with the same node values. A binary search tree is balanced if and only if the depth of the two subtrees of every node never differ by more than 1. If there is more than one answer, return any of them. Example1: 1...
tkwang0530/LeetCode
1382.py
1382.py
py
3,735
python
en
code
4
github-code
18
[ { "api_name": "typing.List", "line_number": 47, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 54, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 86, "usage_type": "attribute" }, { "api_name": "unittest.main", "l...
71180680041
import torch import torch.nn as nn import torchvision import torchvision.transforms as transforms from torchvision import datasets, transforms import torch.optim as optim import numpy as np from torch.autograd import Variable import torch.nn.functional as F class img2num(nn.Module): def __init__(self): su...
exponentialbit1024/PurdueCS
BME495/hw5/img2num.py
img2num.py
py
3,006
python
en
code
1
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.ReLU", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
73920250919
from host import FileNode from host.models.Cloud import Cloud from common.BaseCommand import BaseCommand from common_util import ResultAndData, Error, Success from argparse import Namespace __author__ = 'zadjii' class DebugMirrorsCommand(BaseCommand): def add_parser(self, subparsers): dbg_mirrors = subpar...
zadjii/nebula
host/function/dbg_mirrors.py
dbg_mirrors.py
py
1,109
python
en
code
2
github-code
18
[ { "api_name": "common.BaseCommand.BaseCommand", "line_number": 9, "usage_type": "name" }, { "api_name": "host.models.Cloud.Cloud", "line_number": 17, "usage_type": "argument" }, { "api_name": "common_util.Success", "line_number": 31, "usage_type": "call" } ]
33994961518
"""Yet To Do -Need to worry about the inside like how the token behaves somewhere it is incrementing -Tabel->Almost done need to update the table with some function and it is printing many time You know there are some edge cases like the whne the token is inside the strip. Need to itroduce new bool for inside st...
174414-Rodda/Ludo
Ludo.py
Ludo.py
py
33,727
python
en
code
2
github-code
18
[ { "api_name": "pygame.draw.circle", "line_number": 42, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 42, "usage_type": "attribute" }, { "api_name": "pygame.draw.circle", "line_number": 43, "usage_type": "call" }, { "api_name": "pygame.draw", ...
30806418348
import tkinter as tk import PIL import torch import urllib.request import json from tkinter import filedialog from PIL import Image, ImageTk from torchvision import models, transforms from torchvision.models.resnet import ResNet50_Weights model = models.resnet50(weights=ResNet50_Weights.IMAGENET1K_V1) model...
SiymX/ImageRecognizer
ImageRecognizer.py
ImageRecognizer.py
py
3,641
python
en
code
1
github-code
18
[ { "api_name": "torchvision.models.resnet50", "line_number": 11, "usage_type": "call" }, { "api_name": "torchvision.models", "line_number": 11, "usage_type": "name" }, { "api_name": "torchvision.models.resnet.ResNet50_Weights.IMAGENET1K_V1", "line_number": 11, "usage_type"...
31960552180
from typing import List import collections, math, string class Solution: def ladderLength(self, beginWord: str, endWord: str, wordList: List[str]) -> int: def isAdjacent(word1, word2): count = 0 for char1, char2 in zip(word1, word2): if char1 != char2: ...
subhadeepdev/LeetCode
127. Word Ladder.py
127. Word Ladder.py
py
1,452
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "string.ascii_lowercase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 32, "usage_type": "call" } ]
4005410344
from absl.testing import parameterized import numpy as np from tensorflow.python.framework import dtypes from tensorflow.python.framework import errors from tensorflow.python.framework import tensor_shape from tensorflow.python.framework import test_util from tensorflow.python.ops import array_ops from tensorflow.pyt...
tensorflow/tensorflow
tensorflow/python/ops/ragged/ragged_one_hot_op_test.py
ragged_one_hot_op_test.py
py
7,005
python
en
code
178,918
github-code
18
[ { "api_name": "tensorflow.python.framework.test_util.TensorFlowTestCase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "tensorflow.python.framework.test_util", "line_number": 18, "usage_type": "name" }, { "api_name": "absl.testing.parameterized.TestCase", "li...
40890391759
#!/usr/bin/env python # coding: utf-8 # In[1]: import nltk; # In[2]: from textblob import TextBlob import pandas as pd # In[10]: df=pd.read_csv('train_file.csv', encoding = "ISO-8859-1") # In[11]: train = df # In[12]: # Removing punctuations data=train.iloc[:,1:4] data.replace("[^a-zA-Z]"," ",regex=T...
Sherlock149/ATOMiser
News Sentiment Prediction/src_code.py
src_code.py
py
2,025
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 65, "usage_type": "call" }, { "api_name": "textblob.TextBlob", "line_number": 113, "usage_type": "call" }, { "api_name": "textblob.TextBlob"...
71335657640
import nltk from nltk.tokenize import word_tokenize stopword = nltk.corpus.stopwords.words( 'english') # All English Stopwords Dont forget to type in terminal python -m nltk.downloader stopwords PorterStemmer = nltk.PorterStemmer() WordNetLemmatizer = nltk.WordNetLemmatizer() import string import pandas pandas....
junyang95/DetectFakeReviews
processingtosql.py
processingtosql.py
py
26,267
python
en
code
0
github-code
18
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 4, "usage_type": "call" }, { "api_name": "nltk.corpus", "line_number": 4, "usage_type": "attribute" }, { "api_name": "nltk.PorterStemmer", "line_number": 6, "usage_type": "call" }, { "api_name": "nltk.Wor...
72146096360
import requests, json import os, sys # define paths currentFile = __file__ realPath = os.path.realpath(currentFile) dirPath = os.path.dirname(realPath) dirName = os.path.basename(dirPath) ytdl_path = dirPath + "\yt-dlp.exe" # define def load_config(): global ssotoken, uniqueID with open ("creds....
astravaganza/JC-dl
main.py
main.py
py
4,198
python
en
code
22
github-code
18
[ { "api_name": "os.path.realpath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number...
38234011297
import time import busio import digitalio import RPi.GPIO as GPIO import board from PIL import Image, ImageDraw, ImageFont, ImageChops from adafruit_rgb_display import st7735 from datetime import datetime import requests import json from SpeechFunctions import record_audio, audio_to_text, text_to_function, translate, s...
sheriff4000/SCARGlass
Screen/Main.py
Main.py
py
13,845
python
en
code
0
github-code
18
[ { "api_name": "RPi.GPIO.setmode", "line_number": 19, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 19, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "line_number": 19, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setup", "lin...