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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10422769713 | from __future__ import annotations
from enum import Enum
from randovania.lib import enum_lib
class GameConnectionStatus(Enum):
pretty_text: str
Disconnected = "disconnected"
TitleScreen = "title-screen"
InGame = "in-game"
enum_lib.add_per_enum_field(
GameConnectionStatus,
"pretty_text",
... | randovania/randovania | randovania/network_common/game_connection_status.py | game_connection_status.py | py | 499 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "randovania.lib.enum_lib.add_per_enum_field",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "randovania.lib.enum_lib",
"line_number": 16,
"usage_type": "name"
}
] |
11699050926 | import requests
from bs4 import BeautifulSoup
URL = "http://rpu.edu.pe/miembros-rpu/"
page = requests.get(URL)
soup = BeautifulSoup(page.content, "html.parser")
results = soup.find(id="listado-miembros")
ListaMiembros = results.find_all("div", class_="listaMiembros-popupCoordinador")
for Miembro in ListaMiembros:
u... | siminchikkunarayku/ScrappingWeb | WebScrapingRPU2.py | WebScrapingRPU2.py | py | 710 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 5,
"usage_type": "call"
}
] |
1789123136 | """
Module for controlling deformable mirror Mirao 52e (Imaging Optics)
License GPL-3.0
by @nvladimus, 2020
"""
import ctypes
import widget as wd
import logging
import sys
import os
import numpy as np
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import pyqtSignal
from functools import partial
config = {'dll_... | nvladimus/daoSPIM | microscope_control/src/deformable_mirror_Mirao52e.py | deformable_mirror_Mirao52e.py | py | 13,276 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.QObject",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCo... |
34540346581 | import argparse
import datetime
import os
import sys
import shlex
import shutil
from subprocess import Popen, PIPE
from operator import add
from pyspark import SparkContext, SparkConf
import pyspark.serializers
import subprocess
import boto3
import re
import pysam
global parser_result
if sys.version > "3.4":
pysp... | VCCRI/Falco | source/spark_runner/run_pipeline_assembly.py | run_pipeline_assembly.py | py | 31,662 | python | en | code | 37 | github-code | 6 | [
{
"api_name": "sys.version",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pyspark.serializers",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "shlex.spl... |
16137871037 | # -*- coding: utf-8 -*-
import os
import pickle
import numpy as np
def load_word_vec(path, word2idx=None):
fin = open(path, 'r', encoding='utf-8', newline='\n', errors='ignore')
word_vec = {}
for line in fin:
tokens = line.rstrip().split()
if word2idx is None or tokens[0] in word2idx.keys(... | wenwen0319/spring2023_cs577_nlp_pj | data_utils_DE.py | data_utils_DE.py | py | 10,011 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.asarray",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_num... |
1773913879 | import pytest
import os
import sys
from time import sleep
from docker.models.containers import Container
from docker import DockerClient
from typing import cast
from src.app import create_app
def run_container(docker_base_url:str) -> Container:
if docker_base_url =='env':
# if env (default) is provided, i... | ghobadkhan/trash-heatmap-backend | tests/conftest.py | conftest.py | py | 2,415 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "docker.DockerClient.from_env",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "docker.DockerClient",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "dock... |
11325251151 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 21 18:47:09 2023
@author: 45157
"""
from transformers import GPT2Model, GPT2Tokenizer
import torch
gpt2_path = 'models/gpt2'
model = GPT2Model.from_pretrained(gpt2_path)
tokenizer = GPT2Tokenizer.from_pretrained(gpt2_path)
input_text = "Your input text ... | lc451574367/Embedding | test/code/gpt2demo.py | gpt2demo.py | py | 519 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "transformers.GPT2Model.from_pretrained",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "transformers.GPT2Model",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "transformers.GPT2Tokenizer.from_pretrained",
"line_number": 14,
"usage_type... |
19987747976 | from celery import shared_task
from django.core.mail import send_mail
import logging
import random
from django.core.cache import cache
logger=logging.getLogger(__name__)
@shared_task
def send_email_task(email):
subject='Welcome to cloudpay wallet'
message="Please read the content below carefully"
from_email... | Jothiprakash304/wallet | Practice/api/tasks.py | tasks.py | py | 1,230 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.core.mail.send_mail",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "celery.shared_task",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.... |
36089931904 | import pandas_datareader.data as web
import datetime
def give_date(ticker):
start = datetime.datetime(2018, 1, 1)
end = datetime.datetime(2018, 8, 30)
df = web.DataReader(ticker, 'yahoo', start, end)
open_values = df["Open"].values
close_values = df["Close"].values
substractions = []
... | OleksandrVovchuk/Project-Twitter | Project_twitter/get_stock_prices.py | get_stock_prices.py | py | 1,016 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas_datareader.data.DataReader",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pa... |
40061463979 | import subprocess
import sys
import re
import signal
import socket
from bs4 import BeautifulSoup
import requests
import argparse
import threading
parser = argparse.ArgumentParser()
parser.add_argument("-s",dest="single_input",help="E.g : www.amrita.edu",metavar="Single Input")
parser.add_argument("-f",dest="file_inpu... | Ganesh-Soma/Domain-Validator | Domain-Validator.py | Domain-Validator.py | py | 2,260 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_n... |
12683190161 | #
#
#
# nokia > https://careers.nokia.com/jobs/search/40601155
import requests
from sites.website_scraper_api import WebsiteScraperAPI
import subprocess
class nokiaScraper(WebsiteScraperAPI):
"""
A class for scraping job data from nokia website.
"""
url = 'https://careers.nokia.com/ajax/content/j... | peviitor-ro/JobsScrapers | sites/nokia.py | nokia.py | py | 4,818 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "sites.website_scraper_api.WebsiteScraperAPI",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 65,
"usage_type": "call"
},
{
"api_name"... |
12495804761 | #!/usr/bin/env python3.6
import argparse
parser = argparse.ArgumentParser(
description='Calculate the Manhattan distance for AoC 2017 day 3')
parser.add_argument('input', metavar='N', type=int, nargs=1)
args = parser.parse_args()
column = 0
row = 0
dx = 1
dy = 0
segment_length = 1
segment_index = 0
for i in ... | SamCastelain/aoc2017 | day3/spiral/spiral.py | spiral.py | py | 617 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 4,
"usage_type": "call"
}
] |
38864317142 | from collections import defaultdict
default_args = {
'use_checkpoint': True,
'embedding_size': 300,
'num_layers': 3,
'num_units': 728
}
all_args = {
'checkpoint_path': 'checkpoint',
'index2word_path': 'data/song_dataset/index2word.pkl',
'word2index_path': 'data/song_dataset/word2index.pkl... | lucasmoura/funk_generator | config.py | config.py | py | 1,405 | python | pt | code | 18 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 36,
"usage_type": "call"
},
{
"api_name"... |
20427423047 | import itertools
def anagramSolution1(s1,s2):
alist = list(s2)
pos1 = 0
stillOK = True
while pos1 < len(s1) and stillOK:
pos2 = 0
found = False
while pos2 < len(alist) and not found:
if s1[pos1] == alist[pos2]:
found = True
else:
... | tsaoalbert/test.tensor.flow | others/week2.algorithm.analysis.list.dict/anagram.py | anagram.py | py | 1,853 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.permutations",
"line_number": 57,
"usage_type": "call"
}
] |
19637386122 | #!/usr/bin/env python3
'''
Read pressure from BME280 sensor and calculate altitude, then log readouts to
database.
'''
import datetime as dt
from math import log
import bme280
import smbus2
import mysql.connector
def read_altitude_sensor(sensor_addr):
''' Read pressure and temperature form BME280 sensor. '''
... | maciejzj/pi-observer | scripts/press_alt_logger.py | press_alt_logger.py | py | 1,885 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "smbus2.SMBus",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "bme280.sample",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector.connect... |
40255211300 | import pandas as pd
import re
dataset=pd.read_csv(r'C:\Users\Z\Desktop\NI\Raw_1.csv', encoding='cp949')
dataset.drop('Score', axis=1, inplace=True)
news_df = pd.DataFrame(dataset.Narrative)
# 특수 문자 제거
news_df['clean_doc'] = news_df['Narrative'].str.replace("[^가-힣]", " ")
# 길이가 3이하인 단어는 제거 (길이가 짧은 단어 제거)
news_df['cl... | soominzoh/NI | ni_LDA_testrun.py | ni_LDA_testrun.py | py | 3,849 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "gensim.corpora.Dictionary",... |
74191010428 | """User interface for Spowtd
"""
import argparse
import logging
import os
import sqlite3
import sys
import spowtd.classify as classify_mod
import spowtd.load as load_mod
import spowtd.pestfiles as pestfiles_mod
import spowtd.recession as recession_mod
import spowtd.rise as rise_mod
import spowtd.plot_recession as re... | alex-cobb/spowtd | spowtd/user_interface.py | user_interface.py | py | 22,045 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "logging.ERROR",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "logging.WARNING",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "logging.DEB... |
37543024114 | #
# author: nvx
# created: 2021.06.05 13:27:35
#
import glob
import pygame
from ship import Ship
from invader import Invader, InvaderHive
class Game:
def __init__(self, surface):
# ship
self.surface = surface
self.ship_img = pygame.image.load('./res/razorinv.png')
w, h = self.ship_img.get_size()
... | nvxden/pygame | space-invaders/game.py | game.py | py | 1,760 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.image.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "ship.Ship",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pygame.Rect",
"line... |
73766875389 | import sys
from matplotlib import pyplot as plt
import random
import math
P = []
Px = []
Py = []
def distance(a, b):
xDiff = math.fabs(float(a[0]) - float(b[0]))
yDiff = math.fabs(float(a[1]) - float(b[1]))
return math.sqrt(xDiff ** 2 + yDiff ** 2)
def half_way_point(a ,b):
x = a[0] if a[0] < b[0] el... | Daanikus/Cordless | cordless.py | cordless.py | py | 1,054 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.fabs",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "math.fabs",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "math.fabs",
"line_number": 18,
... |
35417641770 | import time
from datetime import datetime
import datetime
import os
import winsound
m2="00"
u=input("Digita orario timer (hh.mm): ")
u=u.split(".")
if len(u)>1:
m2=u[1]
h1=u[0]
def clearConsole():
command = 'clear'
if os.name in ('nt', 'cls'):
command = 'cls'
os.system(command)
def countdow... | eduardonard/JustForFun | Timer.py | Timer.py | py | 1,613 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.name",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
42449551894 | import os
from fastapi import HTTPException
from starlette import status
admin_token = os.getenv("CHATMANIP_ADMIN_TOKEN")
async def check_authentication(token: str):
if not token == admin_token:
credentials_exception = HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
deta... | thx4nothing/ChatManip | api_server/admin_panel/auth.py | auth.py | py | 403 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "fastapi.HTTPException",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "starlette.status.HTTP_401_UNAUTHORIZED",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_na... |
29099259367 | from math import log10
import openpyxl
from numpy import array
from openpyxl import Workbook, load_workbook
from openpyxl.chart import (
ScatterChart,
Reference,
Series,
)
from statistics import mean
from bio_report_setup import _fetch_smiles_data
from excel_handler import insert_structure
def _write_do... | ZexiDilling/structure_search | bio_dose_excle_handler.py | bio_dose_excle_handler.py | py | 20,742 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.log10",
"line_number": 169,
"usage_type": "call"
},
{
"api_name": "statistics.mean",
"line_number": 210,
"usage_type": "call"
},
{
"api_name": "math.log10",
"line_number": 247,
"usage_type": "call"
},
{
"api_name": "openpyxl.chart.Reference",
... |
16609715799 | from torch import nn
import torchvision
class SaliencyModel(nn.Module):
def __init__(self):
super(SaliencyModel, self).__init__()
vgg = torchvision.models.vgg16(weights=torchvision.models.VGG16_Weights.DEFAULT).features
# Freeze the model
# for p in vgg.parameters(recurse=True):
... | sugol-a/saliency-detection | saliency/model.py | model.py | py | 3,015 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torchvision.models.vgg16",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torchvision.model... |
1676810256 | from itertools import combinations
import xml.etree.ElementTree as ET
import hashlib
import math
import pyspark
from pyspark import SparkContext
from pyspark.sql import Row, SparkSession, DataFrame
from pyspark.sql.types import *
from pyspark.sql.functions import coalesce, col, lit, sum, when
from graphframes import ... | ziyzhu/advanced-analytics-spark | chap7/main.py | main.py | py | 6,961 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "xml.etree.ElementTree.fromstring",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "hashlib.md5",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "ma... |
8665341490 | from selenium import webdriver
import os
import time
browser = webdriver.Chrome()
file_path = 'file:///'+os.path.abspath("E:/JavaWebCode/checkbox.html")
browser.get(file_path)
browser.maximize_window()
time.sleep(3)
inputs = browser.find_elements_by_tag_name('input')
for input in inputs:
if input.get_attribute('ty... | Zshuangshuang/Reload | 2021_03_12自动化学习/src2021_03_12/testDemo14.py | testDemo14.py | py | 388 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
7372086445 | from django.urls import re_path
from . import views
app_name = 'shop'
urlpatterns = [
re_path(r'^(?P<category_slug>[\w-]+)/$', views.allProds, name='products_by_category'),
re_path(r'^(?P<category_slug>[\w-]+)/(?P<product_slug>[\w-]+)/$', views.prodDetail, name='product_detail'),
re_path(r'^$', views.all... | waduhek/shopping | shop/urls.py | urls.py | py | 343 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.re_path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.re_path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.re_path",
"line_number": 10,
"usage_type": "call"
}
] |
74130227708 | #!/usr/bin/python3
import re
import os
import os.path
import csv
import time
import traceback
import datetime
import firebase_admin
from firebase_admin import credentials, firestore
from xml.dom import minidom
UNSENT_RIDES = "/home/pi/kadd-pi/data/rides/unsent/"
SENT_RIDES = "/home/pi/kadd-pi/data/rides/sent/"
CERT = ... | daygodavy/kadd-pi | src/db.py | db.py | py | 9,235 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.isfile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "xml.dom.minidom.parse",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "xml.dom.minidom",
... |
9305018177 | import logging
import os
from sys import platform
import re
from datetime import datetime
from configuration import Integration
def logging_config(integration_config: Integration, logging_mode: str= 'INFO', log_to_file: bool=False, executable_path:str = __file__) -> logging:
formatter = logging.Formatter('%(ascti... | daymer/Veeam-to-MS-Teams-notification-sender-app | logger_init.py | logger_init.py | py | 1,682 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "configuration.Integration",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "logging.Formatter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.searc... |
35573626800 | from pathlib import Path
import logging
import wandb
import torch
import torch.nn as nn
class Revisit:
def __init__(self) -> None:
pass
api = wandb.Api()
logger = logging.getLogger(__name__)
def load_model_artifact(project: str, filters: dict) -> nn.Module:
'''
load torch.nn.Module from wandb ... | puzhao8/sentinel2-burn-severity | visualizer/revisit.py | revisit.py | py | 3,668 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "wandb.Api",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_numbe... |
72531992829 | import re
import sys
from pathlib import Path
from setuptools import find_packages, setup
def read_reqs(reqs_path: Path) -> set[str]:
return {
r
for r in re.findall(
r"(^[^#\n-][\w\[,\]]+[-~>=<.\w]*)",
reqs_path.read_text(),
re.MULTILINE,
)
if i... | ITISFoundation/osparc-simcore | packages/settings-library/setup.py | setup.py | py | 1,672 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "re.findall",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.MULTILINE",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_num... |
20821467702 | from tornado.websocket import WebSocketHandler
from tornado.web import Application
from tornado.ioloop import IOLoop
import sys
import json
clients = list()
class EchoWebSocket(WebSocketHandler):
def check_origin(self, origin):
return True
def open(self):
print("WebSocket opened")
cl... | zianglei/myoGUI | server.py | server.py | py | 1,129 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tornado.websocket.WebSocketHandler",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dumps",
... |
39048498817 | """Digest all NationStates happenings, extracting their type and useful data.
A great undertaking to be sure.
"""
import re
import html
import asyncio
from contextlib import suppress
from aionationstates.utils import timestamp, unscramble_encoding, logger
import aionationstates
class _ParseError(Exception):
pa... | micha030201/aionationstates | aionationstates/happenings.py | happenings.py | py | 32,424 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.match",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "aionationstates.Nation",
"line_number": 120,
"usage_type": "call"
},
{
"api_name": "aionationstates.Region",
"line_number": 121,
"usage_type": "call"
},
{
"api_name": "aionationst... |
10548083246 | #!/usr/bin/env python
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
sns.set()
plt.rc('figure', figsize=(11.69, 8.27))
plots = [
{'zone': 'milton_pandr_south',
'max': 70,
'duration': 16,
'interval': 10,
'sun-interval': 15
},
... | SmartCambridge/milton_road_study | initial_investigation/plot_transits.py | plot_transits.py | py | 11,820 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "seaborn.set",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.ticker.Mul... |
44724993304 | # !/usr/bin/python3
import sys
import os
import time
from mkv import mkv
import argparse
import time
import subprocess
import numpy as np
def constructFFMPEGCall(measures, startTime):
systemCall = "ffmpeg -hide_banner -f f32le -ar " + str(args.samplingrate) + " -guess_layout_max 0 -ac "
systemCall += str(len(... | voelkerb/matroskaPlotter | scaleForAegisub.py | scaleForAegisub.py | py | 3,948 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.strftime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
5833565106 | from __future__ import print_function # Python 2/3 compatibility
from datetime import datetime
import webapp2
import os
import time
import json
import decimal
# Helper class to convert a DynamoDB item to JSON.
class DecimalEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, decimal.Decim... | ssongman/cloud | hybrid_cloud_study/GAE/python_log2ddb/main.py | main.py | py | 3,458 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.JSONEncoder",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "decimal.Decimal",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "webapp2.RequestHandler",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name":... |
648727231 | import logging
import os
import cv2
import numpy as np
import torch
import torch.nn as nn
from matplotlib import pyplot as plt
logfilepath = ""
if os.path.isfile(logfilepath):
os.remove(logfilepath)
logging.basicConfig(filename=logfilepath, level=logging.INFO)
# test시 nms 통과후 적용
def plot_bbox(img,... | DeepFocuser/PyTorch-Detector-alpha | classification/core/utils/util/utils.py | utils.py | py | 2,993 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "os.path.isfile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line... |
14203817576 | #!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
import argparse
import os
import sys
import _damon_result
import _damo_fmt_str
def set_argparser(parser):
parser.add_argument('--input', '-i', type=str, metavar='<file>',
default='damon.data', help='input file name')
parser.add_argument('-... | meghadri/damo | damo_report_raw.py | damo_report_raw.py | py | 2,900 | python | en | code | null | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "_damon_result.par... |
2348653904 |
import sublime_plugin
from functools import partial
from ..anaconda_lib.worker import Worker
from ..anaconda_lib.helpers import prepare_send_data, is_python, get_settings
class AnacondaSignaturesEventListener(sublime_plugin.EventListener):
"""Signatures on status bar event listener class
"""
documenta... | blizzrdof77/Sublime-Text-3-Packages | Anaconda/listeners/signatures.py | signatures.py | py | 1,687 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sublime_plugin.EventListener",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "anaconda_lib.helpers.is_python",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "anaconda_lib.helpers.get_settings",
"line_number": 22,
"usage_type": "ca... |
35161093783 | '''Random Agent Selector by Cael Shoop.'''
import tkinter as tk # GUI
from tkinter.messagebox import showerror, showinfo
import random # random number selector for choosing agents
import configparser as cp # Saving player info in .ini config file
# Global list of Valorant agents
agents = ['Astra', 'Breach', 'Brimston... | CCShoop/cse1100 | Final/base/agentselectoldest.py | agentselectoldest.py | py | 16,491 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.Toplevel",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tkinter.IntVar",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tkinter.Checkbutton",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
... |
29291879575 | import numpy as np
from genetic.combine_genes import one_point_crossover, two_point_crossover
from genetic.sort_genes import sort_genes
from genetic.mutate import mutate_genes
from genetic.roulette_util import select_n_from_population
from genetic.tournament_util import tournament_selection
import matplotlib.pyplot as ... | TheDeepDaemon/genetic-algorithm-assignment | genetic/genetic_algorithm.py | genetic_algorithm.py | py | 7,427 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.randint",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.reshape",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "genetic.combine_... |
11004646258 | from typing import List
class Solution:
def sumSubarrayMins(self, A: List[int]) -> int:
kMod = 10**9 + 7
n = len(A)
s, left, right = [], [1]*n, [1]*n
for i in range(n):
while s and s[-1][0] > A[i]:
left[i] += s.pop()[1]
s.append((A[i],left[i]... | xixihaha1995/CS61B_SP19_SP20 | temp/toy/python/907. Sum of Subarray Minimums.py | 907. Sum of Subarray Minimums.py | py | 679 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
18522609884 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^preview/$', views.home, name='home_preview'),
url(r'^json/$', views.homejson, name='... | mechanicalgirl/progressive_voting | voting/federal/urls.py | urls.py | py | 964 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.co... |
23907804224 | import nltk
from collections import Counter
from pycocotools.coco import COCO
import argparse
class Vocabulary(object):
"""Simple vocabulary wrapper."""
def __init__(self):
self.word2idx = {}
self.idx2word = {}
self.idx = 0
def add_word(self, word):
if not word in self.wo... | potato1996/IMGCaptioning | build_vocab.py | build_vocab.py | py | 2,813 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pycocotools.coco.COCO",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.word_tokenize",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": ... |
23180931301 | from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from cursos.models import Avaliacao, Curso
from cursos.serializers import AvaliacaoSerializer, CursoSerializer
class CursoAPIView(APIView):
"""_summary_
Args:
APIView (_type_): API... | Hurrendd/GeekUniversity_DjangoRestFramework | cursos/views/views_historico.py | views_historico.py | py | 1,296 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "cursos.models",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "cursos.models.Curso.objects.all",
"line_number": 17,
"usage_type": "call"
},
{
"api_nam... |
41415268416 | import pandas as pd
import numpy as np
from datetime import datetime, timedelta
def weekday_between(start: str, end: str):
"""A helper function that returns an array of all weekdays between start and end(exclusive)
Args:
start:
starting date of desired period, formatted as 'yyyy-mm-dd'
... | etccapital/MultiFactor | not useful temporarily/Dataloader.py | Dataloader.py | py | 4,716 | python | en | code | 30 | github-code | 6 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name"... |
36040656486 | import configparser
import logging
import pickle
import time
import arrow
import PyCTP
import schedule
from ParadoxTrading.Utils.CTP.CTPMarketSpi import CTPMarketSpi
from ParadoxTrading.Utils.CTP.CTPTraderSpi import CTPTraderSpi
class CTPDailyMarketTool:
RETRY_TIME = 5
SUB_SIZE = 100
WAIT_MIN = 60
... | ppaanngggg/ParadoxTrading | ParadoxTrading/Utils/CTP/CTPDailyMarketTool.py | CTPDailyMarketTool.py | py | 6,325 | python | en | code | 51 | github-code | 6 | [
{
"api_name": "ParadoxTrading.Utils.CTP.CTPTraderSpi.CTPTraderSpi",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "ParadoxTrading.Utils.CTP.CTPMarketSpi.CTPMarketSpi",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "configparser.ConfigParser",
"line_numbe... |
5504327934 | import torch
from torch.autograd import Variable
from .darknet import Darknet
from .util import load_classes, write_results
from .preprocess import prep_image
import pkg_resources
import numpy as np
resource_package = __name__
name_file = pkg_resources.resource_stream(resource_package, 'resources/coco.names').name
cf... | randreasen/HumanDetection | YoloTorch/__init__.py | __init__.py | py | 2,056 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pkg_resources.resource_stream",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pkg_resources.resource_stream",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pkg_resources.resource_stream",
"line_number": 12,
"usage_type": "call"
},
... |
23233286771 | """V tomto modulu jsou definovány nástroje pro správu stavů robotů ve světě.
"""
# Import standardních knihoven
# Import lokálních knihoven
from typing import Callable
import src.fw.world.robot_state as rs_module
import src.fw.robot.robot as robot_module
import src.fw.world.spawner as spawner_module
import src.fw.... | vojtechpavlu/DP_Robot | src/fw/world/robot_state_manager.py | robot_state_manager.py | py | 6,147 | python | cs | code | 0 | github-code | 6 | [
{
"api_name": "src.fw.target.event_handling.EventEmitter",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "src.fw.target.event_handling",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 27,
"usage_type": "name"
}... |
70487114427 | from typing import List
from test_framework import generic_test
def buy_and_sell_stock_twice(prices: List[float]) -> float:
max_profit = 0
min_price = float('inf')
profit_list = [0] * len(prices)
for i in range(len(prices)):
profit_of_the_day = max(max_profit, prices[i]-min_price)
max... | AsisBagga/ElementsOfProgramming | epi_judge_python/buy_and_sell_stock_twice.py | buy_and_sell_stock_twice.py | py | 1,150 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "test_framework.generic_test.generic_test_main",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "test_framework.generic_test",
"line_number": 29,
"usage_type": "name"
}
] |
30192346249 | #导入库
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#导入数据
import os
path = '/Users/wangchenchen/PycharmProjects/Test project/iris.data.csv'
data = pd.read_csv(path, names=['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'species'])
data.head()
#画散点图
positive = data[data['species'... | TJPU-ML/Homework-for-the-fall-semester-of-2018 | iris classification/王晨晨/test.py | test.py | py | 3,029 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.... |
14225878150 | from qiskit_qir.visitor import BasicQisVisitor
from qiskit.circuit.quantumcircuit import QuantumCircuit
from typing import List, Tuple, Union
from pyqir import Context, Module, qir_module
from qiskit_qir.elements import QiskitModule
def to_qir_module(
circuits: Union[QuantumCircuit, List[QuantumCircuit]],
pro... | microsoft/qiskit-qir | src/qiskit_qir/translate.py | translate.py | py | 2,182 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "qiskit.circuit.quantumcircuit.QuantumCircuit",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "qi... |
32003082153 | from django.shortcuts import render, get_object_or_404, redirect
from django.contrib import messages
from django.db import transaction, IntegrityError
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
#from django.contrib.auth.forms import UserCreationForm - switched to my app RegistrationForm
fr... | varvsn/course_work | shop/my_app/views.py | views.py | py | 10,043 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "my_app.forms.PerPageSelectForm",
"line_number": 25,
"usage_type": "call"
},
{
... |
4702699869 | # coding: utf-8
"""
This module provides ...
"""
from typing import Union
import os
from pymatgen.core import Structure
from pymatgen.ext.matproj import MPRester
from pymatgen.io.vasp.sets import MPRelaxSet
from automaterials.utils.constants import MATPROJ_API_KEY
def mp_relax_set(
structure: Uni... | r-mouta/automaterials | automaterials/simulation/vasp/inputs.py | inputs.py | py | 3,842 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pymatgen.core.Structure",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pymatgen.core.Structure.from_file",
"line_number": 34,
"usage_type": "call"
},
{
"api_name":... |
5085223246 | from flask import render_template
from hotspots.seqpeek.pathway_assoc_data import get_pathway_data
from hotspots.seqpeek.view import sanitize_normalize_tumor_type
from app_logging import get_logger
log = get_logger()
try:
from hotspots.seqpeek.gene_list import gene_list as GENE_LIST
except ImportError:
log.e... | cancerregulome/multiscale-mutation-hotspots | hotspots/pathway_assoc_view.py | pathway_assoc_view.py | py | 1,583 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "app_logging.get_logger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "hotspots.seqpeek.gene_list.gene_list",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "hotspots.seqpeek.gene_list.gene_list",
"line_number": 20,
"usage_type": "argum... |
28027679152 | import os
import matplotlib.pyplot as plt
################## extreme case, when last line of the file is empty is not handled #################
class obtainGraph:
def __init__(self,dir):
parent_list = os.listdir(dir)
count = 0
parent_list.sort()
self.x = [] # contains list x
... | mitulty/key_value_store | plot.py | plot.py | py | 1,450 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
19368690091 | import argparse
import getopt
import json
import logging
import traceback
import sys
import inject
from block_inspector import BlockInspector
from conf import base_config
from extractors.EtherTransferExtractor import EtherTransferExtractor
from extractors.TokenTransferExtractor import TokenTransferExtractor
from mapp... | MoonSHRD/parity_etl_producer | main.py | main.py | py | 2,810 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mappers.transaction_mapper.TransactionMapper.json_dict_to_transaction",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "mappers.transaction_mapper.TransactionMapper",
"line_... |
27943734900 | from selenium import webdriver
from selenium.webdriver.common.by import By
import time
from random import randint
import requests
def captchaSolver(driver):
print('Solving captcha...')
# time.sleep(randint(10, 15))
apiKey = '' # Add your API key here!
siteKey = ''
pageUrl = 'https://www.reddit... | bosca-fabian/RedditAccountCreator | captchaSolver.py | captchaSolver.py | py | 1,859 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": ... |
5811211144 | from flask import Flask, jsonify
import RPi.GPIO as GPIO
import werkzeug, time, sqlite3, datetime
from threading import Thread
app = Flask(__name__)
conn = sqlite3.connect('/home/pi/doorlock.db')
c = conn.cursor()
c.execute('CREATE TABLE IF NOT EXISTS doorlock (id INTEGER PRIMARY KEY AUTOINCREMENT, datetime TEXT NO... | nh-99/acg_door_lock | acgdoorlock.py | acgdoorlock.py | py | 1,435 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "threading.Thread.__init__... |
6779094664 | import numpy as np
import librosa
from pathlib import Path
from sklearn.neural_network import MLPClassifier
from sklearn.preprocessing import MinMaxScaler
from tkinter.messagebox import askyesnocancel, showwarning
from tkinter.filedialog import askopenfilename
from typing import List, Literal, Tuple
from unisul_machin... | Azganoth/unisul-machine-learning | test_2.py | test_2.py | py | 11,068 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "typing.Tuple",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Literal",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_numb... |
7412627385 | import torch
import torchvision #Has Datasets
import torchvision.transforms as transforms #Transforming Datasets
def Dataloading(batch):
#Applying data transformation (converting image to Tensor) and (Normalization)
transform = transforms.Compose(
[transforms.ToTensor(... | Armos05/Pytorch-Deep-Learning-projects | CIFAR-pytorch-main/src/data_processing.py | data_processing.py | py | 1,106 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 9,
"usage_type": "call"
},
{
... |
12208469611 | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import re
import scrapy
from datetime import datetime,timedelta
from scrapy.loader import ItemLoader
from scrapy.loader.processors import MapCompose,TakeFirst,Join
fro... | zero6996/ArticleSpider | ArticleSpider/ArticleSpider/items.py | items.py | py | 11,423 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "elasticsearch_dsl.connections.connections.create_connection",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "elasticsearch_dsl.connections.connections",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "models.es_types.ArticleType._doc_type",
... |
23397629519 | import random
import numpy as np
from numpy.core.shape_base import block
import torch
import torch.nn as nn
from torch.nn import functional as F
def seed_all(seed):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
def tok_k_logits(logits, k):
v, ix = ... | iVishalr/GPT | gpt/utils/utils.py | utils.py | py | 1,140 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "random.seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
... |
7973255669 | import logging
import os
import platform
import subprocess
import tempfile
from dataclasses import dataclass, field
from pathlib import Path
from typing import Iterable, List, Union
from compiler_server_service.services.cpp_compiler.process_results import (
CodeExecutionResult,
CompilationResult,
)
from compil... | zhuweiji/CPP-FYP-Proj | compiler-server-service/compiler_server_service/services/cpp_compiler/cpp_compiler_revised.py | cpp_compiler_revised.py | py | 8,283 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "platform.syst... |
6794403450 | from typing import Union
from phoenix.instructions import swap
from phoenix.instructions.place_limit_order import (
PlaceLimitOrderAccounts,
PlaceLimitOrderArgs,
place_limit_order,
)
from phoenix.instructions.swap import SwapAccounts, SwapArgs
from phoenix.program_id import PROGRAM_ID
from phoenix.types.mar... | Ellipsis-Labs/phoenixpy | phoenix/market_metadata.py | market_metadata.py | py | 7,889 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "solders.pubkey.Pubkey",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "types.market_header.MarketHeader",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 147,
"usage_type": "name"
},
{
"api_name": "... |
14625577246 | # Create your views here.
from django.shortcuts import render,HttpResponseRedirect
from django.http import HttpResponse
from django.contrib import messages
from django.utils.timezone import now
from my_app.models import User
from my_app.models import Application
from my_app.models import Classroom
import dateti... | liangzp/Lingnan-Website | my_app/views.py | views.py | py | 13,061 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "django.utils.timezone.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 35,
"usage_type": "call"
},
{
"api_na... |
30354706581 | """
Collection of utility functions common to different toolkits.
"""
def popup_save(parent=None):
"""Popup a dialog asking for an image name to save the scene to.
This is used mainly to save a scene in full screen mode. Returns a
filename, returns empty string if action was cancelled. `parent` is
the ... | enthought/mayavi | tvtk/pyface/utils.py | utils.py | py | 1,417 | python | en | code | 1,177 | github-code | 6 | [
{
"api_name": "pyface.api.FileDialog",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pyface.api.OK",
"line_number": 33,
"usage_type": "name"
}
] |
3855661840 | #!/usr/bin/python
# Author: https://vk.com/id181265169
# https://github.com/fgRuslan/vk-spammer
import subprocess
import argparse
from socket import timeout
import vk_api
import urllib.request
import urllib.error
import urllib.parse
import json
import random
import time
from requests.utils import requote_uri
from pytho... | wolf1407/vk | vk.py | vk.py | py | 26,000 | python | uk | code | 0 | github-code | 6 | [
{
"api_name": "os.path.expanduser",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
36155877253 | import pandas as pd
import numpy as np
import os
from env import host, user, password
import scipy as sp
from env import host, user, password
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import StandardScaler, QuantileTransformer, PowerTransfo... | CSolitaire/clustering-exercises | wrangle_zillow.py | wrangle_zillow.py | py | 14,983 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "env.user",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "env.host",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "env.password",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "env.user",
"line_number": 20,
... |
18705973737 | import multiprocessing as mp
import pymysql.cursors
import pyrebase
import json
from datetime import datetime, timedelta, date
import time
import os
import sys
import requests
import firebase_admin
from firebase_admin import credentials
from firebase_admin import storage
import base64
from firebase import firebase
cre... | wsx5031060310guy/python-project | camera/test_camera_remove.py | test_camera_remove.py | py | 5,155 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "firebase_admin.credentials.Certificate",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "firebase_admin.credentials",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.getcwd",
"line_number": 16,
"usage_type": "call"
},
{
"api_n... |
22449821470 | from itertools import combinations as c
pos = lambda m: ((m[1][0] - m[0][0])**2 + (m[1][1] - m[0][1])**2)**0.5
n = int(input())
a = [tuple(int(input()) for _ in range(2)) for _ in range(n)]
x = list(c(a, 2))
y = list(map(pos, x))
ID = (i for i, j in enumerate(zip(x, y)) if j[-1] == min(y))
for i in ID:
print(*x[i],... | IndraSigicharla/Python-Code | Code_For_Fun/min_distance_points.py | min_distance_points.py | py | 472 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.combinations",
"line_number": 5,
"usage_type": "call"
}
] |
42320754746 | import multiprocessing as mp
from multiprocessing import Process, Lock
import time
#https://docs.python.org/3/library/multiprocessing.html
def run(i, lock, backlog):
print('new run')
while True:
with lock:
if not backlog.empty():
task = backlog.get()
print(i... | elifehacker/playground | processes.py | processes.py | py | 1,263 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.sleep",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Queue",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Lock",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "multiprocessing... |
32410229844 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0003_auto_20150814_0837'),
]
operations = [
migrations.AddField(
model_name='object',
name='p... | jacyn/burst | webapp/app/migrations/0004_auto_20150814_0844.py | 0004_auto_20150814_0844.py | py | 625 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
3067908859 | from collections import OrderedDict
from .logic import Logic
from .rule_evaluator import RuleEvaluator
class RuleError(Exception):
pass
class Rule:
rule_evaluator_cls = RuleEvaluator
logic_cls = Logic
def __init__(self, predicate=None, consequence=None, alternative=None):
self._logic = se... | botswana-harvard/edc-metadata-rules | edc_metadata_rules/rule.py | rule.py | py | 1,729 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rule_evaluator.RuleEvaluator",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "logic.Logic",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "collections.OrderedDict",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "rule... |
26796277804 | import scrapy
from carfiveonefivefaScrapy.items import CarfiveonefivefascrapyItem
import json
import re
class ExampleSpider(scrapy.Spider):
name = '515fa'
allowed_domains = ['515fa.com']
start_urls = ['http://www.515fa.com/qcxl/']
def parse(self, response):
with open("carfa.html", "w") as f:
... | suoxiaoxiao/flutterStu | carfiveonefivefaScrapy/carfiveonefivefaScrapy/spiders/example.py | example.py | py | 2,246 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "carfiveonefivefaScrapy.items.CarfiveonefivefascrapyItem",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 33,
"usage_type": "call"
},
{
... |
1333482984 | import matplotlib
matplotlib.use('Qt5Agg')
import matplotlib.pyplot as plt
from matplotlib import colors
import numpy as np
from matplotlib.backend_bases import MouseButton
BUTTON_LEFTCLICK = MouseButton.LEFT
BUTTON_RIGHTCLICK = MouseButton.RIGHT
# 値は1間隔のiotaにすること。
CELL_EMPTY = 0
CELL_START = 1
CELL_GOAL = 2
CELL_SHO... | t4k48n/interactive_rrt | grid_map.py | grid_map.py | py | 3,577 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "matplotlib.backend_bases.MouseButton.LEFT",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.backend_bases.MouseButton",
"line_number": 8,
"usage_type": "name"... |
22395537272 | __author__ = "Zhongchuan Sun"
__email__ = "zhongchuansun@gmail.com"
__all__ = ["typeassert", "timer"]
import time
from inspect import signature
from functools import wraps
from collections import Iterable
def typeassert(*type_args, **type_kwargs):
def decorate(func):
sig = signature(func)
bound_... | wujcan/SGL-Torch | reckit/util/decorators.py | decorators.py | py | 1,626 | python | en | code | 76 | github-code | 6 | [
{
"api_name": "inspect.signature",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "collections.Iterable",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "functools.wraps",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.time"... |
32726167609 | import os
import sys
import pip
import subprocess
from pathlib import Path
from contextlib import contextmanager
from functools import lru_cache
from argparse import Namespace
import setuptools
import logging
LOG = logging.getLogger(__name__)
if sys.version_info.major != 3:
print('This Python is only compatible w... | wecacuee/floyd-warshal-rl | setup.py | setup.py | py | 5,963 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.version_info",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.version_info",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "argpars... |
859230491 |
import os
import sys
import frida
JS_CODE = """
// 进入Java 虚拟机
Java.perform(() => {
console.log('Hello World')
})
"""
with open('hook_script/jiami.js', encoding='utf-8') as file:
JS_CODE = file.read()
def message(msg, data):
"""
消息回调
:param msg:
:param data:
:return:
"""
if ... | xiaoweigege/FridaStudy | py_hook_demo.py | py_hook_demo.py | py | 1,520 | python | en | code | 16 | github-code | 6 | [
{
"api_name": "os.system",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "frida.get_remote_device",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "sys.stdin.read",
"li... |
3668949007 | import sqlite3
import os
import json
def main():
directory_path = os.getcwd()
dbpath = os.path.join(directory_path, 'mtl_parking.db')
connection = sqlite3.connect(dbpath)
cursor = connection.cursor()
load_signs(connection, cursor, directory_path)
load_voie(connection, cursor, directory_path)
... | yingzixu15/mtl_street_parking_finder | src/main/data_cleaning/load_db.py | load_db.py | py | 3,149 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number":... |
5785898306 | import requests
from time import sleep
import schedule
def resetar_senha():
url = "http://127.0.0.1:5000/queue"
payload = 'zerar_fila=true'
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(respon... | VBSX/SmartEdge-Painel-senha | test/test-reset-queue.py | test-reset-queue.py | py | 480 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.request",
"line_number": 10,
"usage_type": "call"
}
] |
7760721460 | import difflib
import spacy
nlp = spacy.load('ja_ginza')
# 送り主として採用しない住所
ignore_from_address = []
def extract(text, members):
doc = nlp(text)
# 人名タグと住所タグを抽出
persons = [ent.text for ent in doc.ents if ent.label_ == "Person"]
froms = [ent.text for ent in doc.ents if ent.label_ == "Postal_Address"]
... | JajaDoc/mail-notificator | extract.py | extract.py | py | 1,043 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "spacy.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "difflib.SequenceMatcher",
"line_number": 37,
"usage_type": "call"
}
] |
47676321 | from collections import deque
class Solution:
def alphabetBoardPath(self, target: str) -> str:
board = ["abcde", "fghij", "klmno", "pqrst", "uvwxy", "z"]
board[-1] = "z????"
map_alpa_to_pos = {}
m, n = len(board), len(board[0])
for i in range(m):
for j in range... | code-cp/leetcode | solutions/1138/main.py | main.py | py | 1,723 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 18,
"usage_type": "call"
}
] |
72000449149 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
try:
import Queue
except ImportError:
import queue as Queue
import threading
import time
from trident.misc.ipython_utils import is_in_ipython, is_in_colab
if is_in_ipython():
from IPython import d... | AllanYiin/trident | trident/data/image_reader.py | image_reader.py | py | 4,254 | python | en | code | 74 | github-code | 6 | [
{
"api_name": "trident.misc.ipython_utils.is_in_ipython",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "trident.misc.ipython_utils.is_in_colab",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "matplotlib.use",
"line_number": 19,
"usage_type": "call"
... |
75190174266 | import os
import time
from sys import exit
try:
from termcolor import colored
import pefile
import easygui
except ModuleNotFoundError:
os.system("py -3 -m pip install pefile")
os.system("py -3 -m pip install easygui")
os.system("py -3 -m pip install termcolor")
input("Restart me")
exit(... | guzfr1ng/sirius | sirius.py | sirius.py | py | 2,011 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.system",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 13,
"u... |
23083601613 | from bs4 import BeautifulSoup
import urllib.request
import requests
head = {'User-Agent':'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'}
head2 = { 'User-Agent' : ('Mozilla/5.0 (Windows NT 10.0;Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chro... | SangWooKang/gitgub-start | index.py | index.py | py | 1,054 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
}
] |
29795463652 | import time
import numpy as np
from PyQt5 import QtWidgets
from PyQt5 import QtCore as qtc
from PyQt5 import uic
from PyQt5 import QtWidgets as qtw
from scipy import signal
from controlers import Controlers
from audio_viewer import Viewer
from equalizer_worker import Equalizer_worker
from src.spectogram_viewer import... | saied-salem/Music-Equalizer | src/equalizer.py | equalizer.py | py | 5,934 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "qtawesome.IconWidget",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QSizePolicy",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": ... |
71133956027 | import argparse
from ppcls.modeling import architectures
import paddle.fluid as fluid
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--model", type=str, default='ResNet50_vd')
parser.add_argument("-p", "--pretrained_model", type=str, default='output/ResNet50_v... | GT-AcerZhang/PaddlePaddle-Classification | export_model.py | export_model.py | py | 2,201 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "paddle.fluid.data",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "paddle.fluid",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "paddle.fluid.la... |
37379466726 |
import torch
import torch.nn as nn
import sys
sys.path.append("..")
from nn.layer_factory import InvertedResidual, conv_bn_relu6, conv3x3
n_class = 5
class MobileNetV2(nn.Module):
"""MobileNetV2 definition"""
# expansion rate, output channels, number of repeats, stride
mobilenet_config = [
[1, ... | faye0078/RS-ImgShp2Dataset | train_example/model/Fast_NAS/model/mobileNet.py | mobileNet.py | py | 2,783 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
18804594467 | import logging
import sys
from pathlib import Path
from typing import Any, Optional
from minio import Minio
from minio.error import S3Error
from pymilvus.orm.schema import CollectionSchema
from .constants import (
DEFAULT_BUCKET_NAME,
MB,
BulkFileType,
)
from .local_bulk_writer import LocalBulkWriter
lo... | milvus-io/pymilvus | pymilvus/bulk_writer/remote_bulk_writer.py | remote_bulk_writer.py | py | 6,269 | python | en | code | 744 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "local_bulk_writer.LocalBulkWriter",
"line_number": 22,
"usage_type": "name"
},
{
"api_name":... |
2785402371 | # BFS code implementations
# Just like DFS, the code/implementations for BFS is very similar across different problems. Here is a general format
from collections import deque
def print_all_nodes(root):
queue = deque([root])
while queue:
nodes_in_current_level = len(queue)
# do some logic here... | Helenyixuanwang/algos | BFS_implementation.py | BFS_implementation.py | py | 703 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
}
] |
18231172548 | import pandas as pd
from astropy.coordinates import SkyCoord
from astropy import units as u
import glob
import os
from scipy.spatial import cKDTree
from tqdm import tqdm
from multiprocessing import Pool, Manager, freeze_support
import pickle
import json
import sys
# Define a function to create SkyCoord o... | WilliamOrringe/Indentifying-Candidate-Star-Clusters-in-M31 | convert_files_script_multi.py | convert_files_script_multi.py | py | 2,188 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_numbe... |
38364768001 | # 인쇄 요청이 들어온 순서대로 인쇄
# 중요도가 높은 문서를 먼저 인쇄하는 프린터
# 1) 인쇄 대기목록의 가장 앞에 있는 문서 꺼낸다.
# 2) 나머지 인쇄 대기목록에서 J보다 중요도가 높은 문서가 한 개라도 존재하면
# J를 대기목록의 가장 마지막에 넣는다.
# 3) 그렇지 않으면 J를 인쇄한다.
# 내가 인쇄를 요청한 문서가 몇 번째로 인쇄되는지 출력
from collections import deque
def solution(priorities, location):
answer = 0
q = deque()
# 원소의 인... | jy9922/AlgorithmStudy | Programmers/프린터.py | 프린터.py | py | 1,187 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
}
] |
2966552390 | from django.shortcuts import render
from django.views.decorators.http import require_http_methods, require_GET, require_POST
from django.http import HttpResponse, JsonResponse, Http404
from user.decorators import check_login
from douban_movie.models import DoubanMovie
from datetime import date
# Create your views her... | kacyouhuugetu/movie | douban_movie/views.py | views.py | py | 2,186 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.date.today",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "douban_movie.models.DoubanMovie.make_page",
"line_number": 25,
"usage_type": "call"
},
{
"api_n... |
13563067601 | from email import message
from http.server import BaseHTTPRequestHandler, HTTPServer
import time
# HTTPRequestHandler class
class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
# GET
def do_GET(self):
# Send response status code
self.send_response(200)
# Send message back to client
messag... | Padster01/ArmProject | Showcase Code/PC/crap_ai/server.py | server.py | py | 1,227 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "email.message",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "email.message",
"line_number": 31,
"usage_type": "argument"
},
{
"api_name": "ema... |
26598444491 | # GMM class is modified from CS 7641 Fall 2019 HW2
import numpy as np
from tqdm import tqdm_notebook as tqdm
from get_features import *
def softmax(logits):
"""
Args:
logits: N x D numpy array
"""
logits_exp = np.exp((logits.T - logits.max(axis=1)).T)
logits_exp_sum = np.sum(logits_exp, a... | b-zhao/error_detection | GMM.py | GMM.py | py | 6,030 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.exp",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 25,
... |
39673536504 | import os
import tarfile
import pytest
import requests
from craft_parts.sources import sources
@pytest.mark.usefixtures("new_dir")
@pytest.mark.http_request_handler("FakeFileHTTPRequestHandler")
class TestTar:
"""Tests for the tar source handler."""
def test_pull_tarball_must_download_to_sourcedir(self, mo... | cmatsuoka/craft-parts-orig | tests/unit/sources/test_tar.py | test_tar.py | py | 4,781 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "craft_parts.sources.sources.Tar... |
16166823512 | import random
from os import remove,rename
from datetime import datetime, timedelta
import mysql.connector
conn=mysql.connector.connect(host='localhost', user='root', passwd='toor', database='avantikaa')
curs=conn.cursor()
ones = ["", "one ","two ","three ","four ", "five ", "six ","seven ","eight ","nine ","... | aadityarengarajan/Hotel-Management | sql/hotel.py | hotel.py | py | 19,281 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 6,
"usage_type": "name"
},
{
"api... |
39507781396 | #!/usr/bin/env python3
"""
Validation for `*.xml.fdm_material` Material Profile files, based on an XML Schema
Definition.
This script is dedicated to the public domain under the terms of the CC0 license.
"""
import logging
import os
from pathlib import Path
import sys
from typing import Dict, Iterable, Optional, List... | Ultimaker/fdm_materials | scripts/check_material_profiles.py | check_material_profiles.py | py | 5,888 | python | en | code | 60 | github-code | 6 | [
{
"api_name": "lxml.etree.Element",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "lxml.etree",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
... |
29559962215 | import copy
import json
import threading
from imp import reload
from pprint import pprint
import requests
from TestPoolModel.model import models_, OperationtableTester
from TestPoolModel.model import db
from conf.Setting import *
from log import SetLog
from utils.GetSessionTester import GetSessionT... | shiqilouyang/ai_ats_project | app/TestPoolModel/runningTest.py | runningTest.py | py | 18,337 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "log.SetLog",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "TestPoolModel.model.db",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"lin... |
39580986942 | from typing import List
from fastapi import APIRouter, Response, status
from config.db import conn
from schemas.user import userEntity, usersEntity
from schemas.empleado import empleadoEntity, empleadosEntity
from schemas.proyectos import proyectoEntity, proyectosEntity
from schemas.tareas import tareaEntity, tareasEnt... | mimel94/fastapi | routes/user.py | user.py | py | 7,069 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "schemas.empleado.empleadosEntity",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "config.db.conn.local.empleado.find",
"line_number": 21,
"usage_type": "call"
},
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.