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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
39232159682 | from django.shortcuts import render
from django.http import JsonResponse
from django.views.decorators.http import require_http_methods
import json
from common.json import ModelEncoder
from .models import AutomobileVO, Appointment, Technician
class AutomobileVOEncoder(ModelEncoder):
model = AutomobileVO
prope... | ClarisseNicole8/DriveWorks | service/api/service_rest/views.py | views.py | py | 5,229 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "common.json.ModelEncoder",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "models.AutomobileVO",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "common.json.ModelEncoder",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": ... |
23674517736 | import os, datetime, time
from flask import Flask, request, jsonify
from solve_captcha_with_model import CaptchaSolver
run_date = datetime.datetime.strptime("2021-01-05", "%Y-%m-%d")
today = datetime.datetime.strptime(time.strftime("%Y-%m-%d"), "%Y-%m-%d")
if today != run_date:
print("Date mismatch!")
exit()
... | HRN-Projects/amazon-captcha-solver | solve_api.py | solve_api.py | py | 1,005 | python | en | code | 25 | github-code | 97 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 6,
"usage_type": "call"
},
{
"api_nam... |
6390444645 | """
Entradas
Fecha de nacimiento-->int-->fecha
Salidas
Edad-->int-->edad
Signo zodiacal-->str-->signo
"""
from datetime import date
#Entrada
fecha=input("Digite su fecha de nacimiento en el formato dia/mes/año ")
(dia,mes,año)=fecha.split(" ")
dia=int(dia)
mes=int(mes)
año=int(año)
año_ac=date.today().year
mes_ac=date... | willingtonino/Algoritmos_programacion_C4G2 | Taller_secuencias_control_secuencial/ejercicio_13.py | ejercicio_13.py | py | 1,371 | python | es | code | 0 | github-code | 97 | [
{
"api_name": "datetime.date.today",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "datetime.date.today",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.date",... |
71008671040 | import json
import numba
from scipy.io.wavfile import read, write
import matplotlib.pyplot as plt
import argparse
def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return Fals... | invider/jump-n-loop.mod | fix/beat_detector/src/main.py | main.py | py | 2,156 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scipy.io.wavfile.read",
"line_number": 24,
"usage_type": "call"
},
{
"api_name... |
43297588963 | from django.db import models
from django.utils.translation import ugettext as _
from django.contrib.auth.models import User
from treebeard.al_tree import AL_Node
from embed_video.fields import EmbedVideoField
from django.contrib.postgres.fields import ArrayField
# Create your models here.
class NewsRecord(models.Model)... | jfeldman777/sky2018 | sky/models.py | models.py | py | 3,300 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.db.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
11788002307 | import logging
def create_log(level: str):
log_level = logging.INFO
if level == "INFO":
log_level = logging.INFO
elif level == "DEBUG":
log_level = logging.DEBUG
log_formatter = logging.Formatter(
fmt="%(asctime)s | %(levelname)7s | %(filename)-10s:%(lineno)-4s: %(message)s"... | luissaya/Hydraulic_electrovalves | src/tools/logs.py | logs.py | py | 776 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "logging.INFO",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.DEBUG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatte... |
10170284732 | from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import random
from typing import List, Optional
from pydantic import BaseModel
from uuid import uuid4
app = FastAPI()
origins =['http://127.0.0.1:5501']
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentia... | viniciusleitef/fastapi2 | server.py | server.py | py | 1,404 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 19,
"usage_type": "name"
},
{
"api_... |
4393256790 | from app.db.models import (
UploadInputfile,
CreateInputfile,
LoadFileList,
LoadFile,
FileTypeAndName,
)
import os, string, random
from app.db.config import REPO_DIR, JOBS_DIR
from typing import Union
def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
return "".join(random... | inojeon/slurm-api | src/app/libs/files.py | files.py | py | 2,775 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "string.ascii_uppercase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "string.digits",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "random.choice",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.... |
8994717035 | from django.db.models import Q
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework.decorators import action
from rest_framework.permissions import IsAuthenticated, BasePermission
from rest_framework.viewsets import ModelViewSet
from core.models import VotingSession, Position... | louieee/FamilyApp | FamilyBackend/core/views/ballot.py | ballot.py | py | 9,082 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "rest_framework.permissions.BasePermission",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "core.models.Family.objects.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "core.models.Family.objects",
"line_number": 20,
"usage_type": "a... |
10553367547 | import calendar
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.http import JsonResponse
from django.shortcuts import render
from finance.models import BankStatements, TypeExpenses
from grafic_matplotlib.core.forms import Calendar, UserChoice,... | garry8888/siteproject | grafic_matplotlib/views.py | views.py | py | 10,938 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "grafic_matplotlib.analytics.query_data.amount_expenses",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "grafic_matplotlib.analytics.query_data.amount_expenses",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "grafic_matplotlib.analytics.query_d... |
26151569352 | from typing import List, Mapping
from bot import bot
from data_types import GameId
from data_wrappers import GameData, GameStatus, UserStatus
from .game_loading import GameLoading
from .user_ui import GameConfirm, create_confirm_embed
class GameAdmin:
@staticmethod
async def initialize_game(
game_na... | ky-42/jubilant-computing-machine | src/games/game_handling/game_admin.py | game_admin.py | py | 5,514 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Mapping",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "data_wrappers.GameStatus.Game",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "data_wrapper... |
3237517196 | from flask import Flask
from flask import request, make_response, jsonify
from flask_cors import CORS
import datetime, base64, requests, json
from Crypto.Hash import CMAC
from Crypto.Cipher import AES
app = Flask(__name__)
def toggleLock():
# 各種パラメータ
uuid = 'A50706D7-4B52-160F-932F-E2FC938249A5'
secret_key = '3e92... | takuto-sat/hackthon-teamlink | unlock.py | unlock.py | py | 1,378 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "Crypto.Hash.CMAC.new",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "Crypto.Hash.CMAC",
... |
17198945382 | import secrets
Words = ["tehran" , "rasht" , "new york" , "texas" , "paris" , "berlin" , "rome" , "london" , "tokyo" ]
hangman_word = secrets.choice(Words)
letter_count = len(hangman_word)
guess = 0
score = letter_count
is_not_win = True
while is_not_win:
user_guess = input("Emter a Character : ")
if user... | Soroushbolbolabady/hangman | hangman.py | hangman.py | py | 676 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "secrets.choice",
"line_number": 5,
"usage_type": "call"
}
] |
30208406766 | from sklearn import datasets
from sklearn.multiclass import OneVsRestClassifier
from sklearn.svm import LinearSVC,SVC
from sklearn.preprocessing import LabelBinarizer,MultiLabelBinarizer
from sklearn.externals import joblib
# import cPickle as pickle
import numpy as np
import cv2 as cv
def saveModel(model, path):
j... | biugorgor/densenet-for-dog-breeds-identification | svm.py | svm.py | py | 945 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sklearn.externals.joblib.dump",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.externals.joblib",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sklearn.externals.joblib.load",
"line_number": 17,
"usage_type": "call"
},
{
... |
35010331152 | from __future__ import print_function
import numpy as np
import tensorflow as tf
import tensorflow.contrib.layers as tcl
from tensorflow.examples.tutorials.mnist import input_data
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from k... | tohinz/Image-Generation-And-Translation | code/mnist_classifier.py | mnist_classifier.py | py | 8,429 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "tensorflow.maximum",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.minimum",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.contrib.layers.batch_norm",
"line_number": 24,
"usage_type": "call"
},
{
"api_na... |
74388474558 | import numpy as np
from scipy.signal import find_peaks
import scipy
def countOutliers(x,mean,sigma):
outliers = 0
for i in x:
if (i > (mean + 2*sigma)) or (i<(mean-2*sigma)):
outliers = outliers+1
else:
continue
return outliers
def getFeatures(x):
if len(x) == 0... | Junwon6/data_analyzer | zFeature.py | zFeature.py | py | 5,227 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.nan",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.median",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number":... |
31670066687 | import logging
import logstash
# from logstash import AMQPLogstashHandler
import sys
if __name__ == '__main__':
# host为logstash的IP地址
# host = '47.102.113.60'
host = '39.100.224.138'
test_logger = logging.getLogger('python-logstash-logger')
test_logger.setLevel(logging.INFO)
# 创建一个ogHandler
... | zhangshuo1996/EAS_new | web/log/test_logstash.py | test_logstash.py | py | 818 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "logstash.LogstashHandler",
"line_number": 14,
"usage_type": "call"
}
] |
17379307105 | from django.conf import settings
from django.shortcuts import render, redirect
from django.http import HttpResponseForbidden
from django.views import View
# from django.contrib.auth import get_user_model
from .models import Vacancy
from django import forms
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Lo... | Solairw/Hyperjob | vacancy/views.py | views.py | py | 1,154 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.views.View",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "models.Vacancy.objects.all",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.Vacancy.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name... |
5415758064 | import random
from celery import shared_task
import requests
from celery.utils.log import get_task_logger
from celery.signals import task_postrun
logger = get_task_logger(__name__)
@shared_task
def divide(x,y):
import time
time.sleep(15)
return x/y
@shared_task()
def sample_task(email):
from project.... | simon7426/flask-celery | project/users/tasks.py | tasks.py | py | 1,852 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "celery.utils.log.get_task_logger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "celery.shared_task",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "project.... |
24530370876 | from mido import Message, MidiFile, MidiTrack
from lib import mid2aud, interpret
from pydub.playback import play
from pydub import AudioSegment
import numpy as np
import numpy.random as rd
def velocity_r(trk, t_vel, r, on=True):
"""Randomly change the velocity of a note in a track"""
time = 0
j = 0
c_t... | rcaze/Quantic | gamme.py | gamme.py | py | 2,315 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.random.randint",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "mido.MidiFile",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "mido.MidiTrack",
... |
28508724849 | #!/usr/bin/env python
### Specifically for UHDAS
### Must edit procsetup_onship.py for each particular installation
#
## run autovect (shallow layer, with temperature)
## run autocont (3 days, for contours against time, lon, lat)
##
## reads data from web_datadir
## puts ".eps" web_figdir; converts "*.eps" to *.png
#... | pedrolpena/uhdas_ladcp_terminal | scripts/run_3dayplots_mpl.py | run_3dayplots_mpl.py | py | 11,966 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "future.standard_library.install_hooks",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "future.standard_library",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "matplotlib.use",
"line_number": 29,
"usage_type": "call"
},
{
"api_... |
35034417371 | from flaskapp import db, scheduler
from flaskapp.models import stockTicker, stockQuaterlyResults,stockYearlyResults
from sqlalchemy.exc import IntegrityError,InvalidRequestError,DataError
def getResult(ticker, period='Quarterly'):
import requests
from bs4 import BeautifulSoup
import re
import pandas as... | HiIAmTzeKean/Stock_api | flaskapp/financials/helper.py | helper.py | py | 4,212 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_numb... |
40750428000 | """Config flow for UTE integration."""
from __future__ import annotations
import logging
from typing import Any
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResult
from homeassistant.exceptions import Home... | bcantera/haute | config_flow.py | config_flow.py | py | 3,058 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "voluptuous.Schema",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "voluptuous.Required",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "voluptuous.Re... |
21897180985 | # %%
import numpy as np
import pandas as pd
import numpy as np
import os
from scipy import signal
from scipy import sparse
from scipy.integrate import simps
from mne.connectivity import spectral_connectivity
# %%
a = np.loadtxt("data/raw/2.txt")
b = a[:, 0:15000]
# %%
def get_node_features(data_seg):
# set the... | derekjchan/senior-design-group-23 | sd_gnn/label.py | label.py | py | 1,651 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.loadtxt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "scipy.signal.welch",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "scipy.signal",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "numpy.logical_and",
... |
11676915990 | #!/usr/bin/env python
# -*-coding:utf-8-*-
# author:sware
"""
配置文件
"""
import os
import logging
import time
from datetime import timedelta
from logging.config import dictConfig
log_cofig = {
'version': 1,
'formatters': {'default': {
'format': '[%(asctime)s] [%(filename)s-%(lineno)s line] [%(levelnam... | sumlxt123/icoll | icoll/config.py | config.py | py | 4,828 | python | zh | code | 0 | github-code | 97 | [
{
"api_name": "os.path.dirname",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.urandom",
"line_n... |
44601289431 | import glob
import os
from absl import app
from absl import flags
from absl import logging
import numpy as np
import torch
from torch.utils import tensorboard
import tqdm
from tqdm.contrib.logging import logging_redirect_tqdm
# pylint: disable=g-bad-import-order
from metrics.models import InternVideo
from metrics i... | google/storybench | metrics/vtm_internvideo.py | vtm_internvideo.py | py | 6,696 | python | en | code | 33 | github-code | 97 | [
{
"api_name": "absl.flags.DEFINE_string",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "absl.flags",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "absl.flags.DEFINE_string",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "absl.fla... |
7660584637 | # -*- coding: utf-8 -*-
"""
Created on Mon May 23 12:22:52 2022
@author: longj
"""
import numpy as np
import matplotlib.pyplot as plt
import csv
from interp_function import interp_linear_dist_ph,save_df
from compare_height_function import compare_2_layers_7col_
import matplotlib
matplotlib.rcParams['font.s... | VoyagerLong/2022- | output/1/20_initial_ground_estimate_potential_ground_points.py | 20_initial_ground_estimate_potential_ground_points.py | py | 3,024 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "in... |
74062888958 | import gradio as gr
from transformers import GPT2Tokenizer, GPT2LMHeadModel, AutoTokenizer
model_name_or_path = "checkpoint-36000"
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
model = GPT2LMHeadModel.from_pretrained(model_name_or_path, pad_token_id=tokenizer.eos_token_id)
def infer_model(txt: str) ... | yuanzhoulvpi2017/zero_nlp | chinese_gpt2/chatbot.py | chatbot.py | py | 1,385 | python | en | code | 2,110 | github-code | 97 | [
{
"api_name": "transformers.AutoTokenizer.from_pretrained",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "transformers.AutoTokenizer",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "transformers.GPT2LMHeadModel.from_pretrained",
"line_number": 7,
"usa... |
70581190718 | # read the number of rounds by a judge
import csv, os, datetime #argparse
'''parser = argparse.ArgumentParser(description="Identify source folder and folder with full names")
parser.add_argument("-s", "--source", type=str,
help="Folder with raw, downloaded csv files to analyze")
sourceFolderName... | Robgea/AffNegProject | HSCXsidereader.py | HSCXsidereader.py | py | 4,456 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "csv.writer",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
71165635518 | import sys
import json
import time
import subprocess
import traceback
import asyncio
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMainWindow, QDialog, QTextEdit
from PyQt5.QtCore import pyqtSlot, QDate, Qt
from PyQt5.QtGui import QPixmap, QColor
from backend import Backend
class Ui_MainWindo... | avrland/DayCounter-pyqt | gui.py | gui.py | py | 11,640 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "backend.Backend",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.QSize",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PyQt5.... |
22874135221 | from pymongo import MongoClient
# Criação do banco de dados com mongoimport
# docker cp books.json mongodb:/tmp/books.json
# cd tmp
# mongoimport --db library --collection books (continua)
# --drop --file books.json --jsonArray
category = input("Escolha uma categoria: ")
with MongoClient() as client:
db = clien... | guilherme-ac-fernandes/trybe-exercicios | 04-ciencia-da-computacao/bloco-35-redes-e-raspagem-de-dados/dia-02-raspagem-de-dados/src/script-06.py | script-06.py | py | 436 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 11,
"usage_type": "call"
}
] |
26311855654 | from opentrons import protocol_api
from opentrons import types
from opentrons.protocol_api.labware import Well
import math
from types import MethodType
import subprocess
from opentrons.protocols.api_support.types import APIVersion
metadata = {
'protocolName': 'Omega Bio-Tek Mag-Bind Plant DNA DS Kit',
'author'... | Opentrons/Protocols | protocols/3e0bef/3e0b3f.ot2.apiv2.py | 3e0b3f.ot2.apiv2.py | py | 21,164 | python | en | code | 53 | github-code | 97 | [
{
"api_name": "subprocess.check_output",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "opentrons.protocol_api.ProtocolContext",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "opentrons.protocol_api",
"line_number": 33,
"usage_type": "name"
},... |
40056187419 | import sublime # To obtain plugin settings
import logging
# Define the plugin logger, to be initialized on `plugin_loaded()`
logger = logging.getLogger(__name__)
def InitializeMainLogger():
""" Apply required settings to the main RTags logger.
"""
# Remove all previously added handlers, if any (relevan... | papadokolos/RTags | rtags_modules/main_logger.py | main_logger.py | py | 1,496 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.For... |
7409701820 | """
爬取大学的课程数据
需在get_schools.py之后执行
"""
import multiprocessing
import requests
import logging
import json
from os import makedirs
from os.path import exists
# 日志输出格式
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s: %(message)s')
# url
BASE_URL = 'https://www.icourse163.org' # mooc主页
COURSE... | ChaiCunhao/mooc_spider | get_courses.py | get_courses.py | py | 4,785 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
... |
75030831999 | '''Definition of tf.keras compatible Layers
The tdl Layer is compatible with tf.keras layers and supports
autoinitialization with tdl descriptors.
'''
import types
import functools
import collections
import tensorflow as tf
from . import common
from .common import (InputArgument, InputParameter, InputModel, InferenceI... | danmar3/twodlearn | twodlearn/core/layers.py | layers.py | py | 8,030 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "common._find_tdl_attrs",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "common.TDL_INIT_DESCRIPTORS",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras",
"line_number": 34,
"usage_type": "attribute"
},
{
"api... |
44498189768 | import os
import numpy as np
import pickle
import matplotlib.pyplot as plt
import hdbscan
from tqdm import tqdm
from sklearn.cluster import DBSCAN
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
import itertools
from random import sample
class ... | Leko25/Video-Summarization-and-Tapestry | OfflineProcessing/HelperScripts/SynopsisSummarization/cluster_embeddings.py | cluster_embeddings.py | py | 3,882 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sklearn.cluster.DBSCAN",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "hdbscan.HDBSCAN",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path... |
32179555343 | import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
from matplotlib import animation
from parameters import *
import math
row = 800
column = 600
x_bias = -100
y_bias = -100
def social_cost(people_position, waypoint, personal_space_deviation):
dist = np.linalg.norm(people_position - waypo... | AnganMitra/robotNavigation | chlothoid_simulator/heatmap.py | heatmap.py | py | 2,512 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.linalg.norm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.exp",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "math.atan2",
"line_... |
35163211835 | import numpy as np
import matplotlib.pyplot as plt
import open3d as o3d
## unit 1px=1mm
## the total height is 90mm
## so Z range from 0 to 90
##
pcl = o3d.geometry.PointCloud()
def parametric_circle(t,xc,yc,R):
x = xc + R*np.cos(t)
y = yc + R*np.sin(t)
return x,y
def inv_parametric_circle(x,xc,R):
t... | hujunhan/cq_modeling | Build/hearcut_numpy/3_point_cloud.py | 3_point_cloud.py | py | 2,533 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "open3d.geometry.PointCloud",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "open3d.geometry",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
... |
73486463679 |
''' Spectrum_fitter.py : an obect-oriented framework for fitting dielectric spectra. '''
from numpy import *
import matplotlib.pyplot as plt
from scipy import optimize
from scipy import special as sp
class Lineshape:
"""Class that holds some things common to all Lineshapes"""
def __init__(self,params,bound... | delton137/spectrumfitter | spectrumfitter/spectrumfitter.py | spectrumfitter.py | py | 20,619 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "scipy.special.erfcx",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "scipy.special",
"line_number": 84,
"usage_type": "name"
},
{
"api_name": "scipy.optimize.minimize",
"line_number": 345,
"usage_type": "call"
},
{
"api_name": "scipy.opti... |
10767284414 | import pygtk
pygtk.require('2.0')
import gtk
import os
import stat
import shutil
import gobject
import gettext
import gnomevfs
from gnome import ui
from common.consts import *
from common.utils import get_icon_with_type
from common.widgets import TweakPage, DirView, FlatView
from common.widgets.dialogs import WarningDi... | tualatrix/ubuntu-tweak-old | src/scripts.py | scripts.py | py | 6,211 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "pygtk.require",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.expanduser",
"line... |
5124912577 | import torch
import torch.nn as nn
class Net(nn.Module):
def __init__(self, in_dim=100, hidden_dim=50, out_dim=10):
super(Net, self).__init__()
self.layer = nn.Sequential(
nn.Linear(in_dim, hidden_dim),
nn.BatchNorm1d(hidden_dim),
nn.ReLU(),
nn.Linear... | fourierer/Knowledge_Base | code/learn_pytorch/difference_Modulelist_Sequential/Modulelist_Sequential.py | Modulelist_Sequential.py | py | 700 | python | en | code | 16 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
34881211116 | # coding=UTF-8
import random
import json
from libs.file.class_Excel import Excel
from applications.collegeAdmission.class_ceespidersina import CEESpiderSina
# 0. Initial configuration
valid_proxy = ['61.174.10.22:8080', '101.66.253.22:8080','61.174.13.12:80', '101.200.178.46:3128','101.226.249.237:80']
regions = ['北... | plutoese/Robot | applications/collegeAdmission/main_college_entrance_data_sina.py | main_college_entrance_data_sina.py | py | 1,602 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "applications.collegeAdmission.class_ceespidersina.CEESpiderSina",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 42,
"usage_type": "call"
}
] |
26168868704 | import torch
import numpy as np
import pygame
import sys
from PIL import Image
import cv2
import time
from lib.utils.testing import decode_pred
pygame.init()
def make_a_char(font, c, color, back):
try:
ftext = font.render(c, True, color, back)
except:
ftext = font.render('卍', True, color, back)... | XMB962/G-R-Joint-Optimization | lib/operators/visual.py | visual.py | py | 8,853 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "pygame.init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.image.save",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"... |
33763091091 | import threading
from pywb.webapp.pywb_init import create_wb_router
from pywb.framework.wsgi_wrappers import init_app
# disable is_hop_by_hop restrictions
import wsgiref.handlers
wsgiref.handlers.is_hop_by_hop = lambda x: False
class ServerThreadRunner(object):
def __init__(self, make_httpd, config_file=None):
... | webrecorder/pywb | tests_disabled/server_thread.py | server_thread.py | py | 1,057 | python | en | code | 1,241 | github-code | 97 | [
{
"api_name": "wsgiref.handlers.handlers",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "wsgiref.handlers",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pywb.framework.wsgi_wrappers.init_app",
"line_number": 15,
"usage_type": "call"
},
{
... |
17668363752 | #!/usr/bin/python3
########################
# SCSU email scraper geolocation via google maps
# James Otten 2014
########################
import requests
from scraperdb import ScraperDatabase
import logging
import configparser
import sys
class Point:
def __init__(self, lat, lon, formatted):
self.lat = lat
s... | james-otten/SCSU-Student-Search | geo.py | geo.py | py | 2,478 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.warn",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "logging.warn",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_numb... |
13278135847 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
'''
此项目为堆石混凝土图像识别数据预处理软件
此代码主要完成GUI界面的搭建工作
最后编辑日期:2020-5-14
'''
import sys
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from skimage import io
import numpy as np
import correct
import count
fro... | Gxs16/Watershed-on-rock-image-and-GUI | frame.py | frame.py | py | 14,328 | python | zh | code | 0 | github-code | 97 | [
{
"api_name": "numpy.zeros",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sub_window.SegWindow",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "sub_window.CorrectWindow",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "sub_window.... |
35619963121 | import sys
def getch():
import termios
import sys, tty
def _getch():
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
try:
tty.setraw(fd)
ch = sys.stdin.read(1)
if ch == '\u0003':
sys.exit(0)
finally:
... | fancyplants/pheatures | data/test.py | test.py | py | 924 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.stdin.fileno",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "termios.tcgetattr",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tty.setraw",
"line... |
30304116931 | import os
import shutil
from pathlib import Path
import pandas as pd
import streamlit as st
from dataset_splitting_by_language import main as split_dataset_by_language
@st.cache_data
def convert_to_csv(df):
# IMPORTANT: Cache the conversion to prevent computation on every rerun
return df.to_csv().encode('ut... | alibaba/data-juicer | demos/tool_dataset_splitting_by_language/app.py | app.py | py | 4,110 | python | en | code | 633 | github-code | 97 | [
{
"api_name": "streamlit.cache_data",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "streamlit.cache_data",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "streamlit.session_state.get",
"line_number": 35,
"usage_type": "call"
},
{
"a... |
27778005216 | #!/usr/bin/python
import urllib
from bs4 import BeautifulSoup
import pandas as pd
from datetime import datetime
import os.path
import time
urls = ["http://www.bbc.co.uk/sport/football/scottish-championship/table?print=true",
"http://www.bbc.co.uk/sport/football/scottish-league-one/table?print=true",
"... | theritvars/graded-unit | updateTables.py | updateTables.py | py | 3,496 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "urllib.urlopen",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulS... |
19105229942 | from pyspark.sql import SparkSession
# Suppose you used the upload script to upload your file
# named "data.csv" to hdfs in a directory called "input"
# placed at the root of the shared file system
hdfs_path = "hdfs://namenode:9000/input/data.csv"
# initialize a spark session
spark = SparkSession.builder\
.appN... | LemuelPuglisi/spark-hdfs-app-template | app/example.app.py | example.app.py | py | 499 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 9,
"usage_type": "... |
40386215370 | import pandas as pd
import os
from config import *
import matplotlib.pyplot as plt
import numpy as np
from pydts.data_generation import EventTimesSampler
final_dfs = []
n_patients_list = [250, 500]
for n_patients in n_patients_list:
case = f'n{n_patients}_beta_results_comparison.csv'
df = pd.read_csv(os.path... | tomer1812/DiscreteTimeSurvivalPenalization | src/small_sample_results_reader.py | small_sample_results_reader.py | py | 4,544 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pandas.MultiIndex.from_tupl... |
74276245437 | #!/usr/bin/env python
import sys
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot
from pandas.plotting import scatter_matrix
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_s... | Fato07/ThesisProject | ThesisProject/main.py | main.py | py | 9,128 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_excel",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line... |
13127988113 | import logging
import socket
import threading
import argparse
import pickle
from rich.console import Console
from rich.logging import RichHandler
from hmg.word_utils import get_word_from_internet
FORMAT_LOGGING = "%(message)s"
logging.basicConfig(level=logging.INFO, format=FORMAT_LOGGING, handlers=[RichHandler()])
... | ekimdev/hangman-multiplayer-game | src/hmg/server.py | server.py | py | 3,746 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "rich.logging.RichHandler",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "loggin... |
18998681773 | import sqlite3
import json
from tqdm import tqdm
class DatabaseConnection:
def __init__(self, db_file, topic_json, heading_json, alltree_json):
self.db_file = db_file
self.connection = None
self.topic_json = json.loads(open(topic_json, "r").read())
self.heading_json = json.loads(op... | ngothetai/Phap_dien_VN | BE/static/JSON/database.py | database.py | py | 5,451 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number":... |
71037917440 | import wx, wx.aui, wx.lib.hyperlink
import os
import utils
RELEASE_ARTIST_WIDTH=150
RELEASE_RELEASE_WIDTH=100
RELEASE_DATE_WIDTH=100
RELEASE_FONT_SIZE=8
RELATED_ARTIST_WIDTH=150
ALLOW_AUI_FLOATING = False
LEFT_WIDTH = 160
class ReleasePage( wx.Panel ):
def __init__( self, parent, id, width, main ):
wx.... | baptr/pylbum | src/releasePage.py | releasePage.py | py | 7,990 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "wx.Panel",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "wx.Panel.__init__",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "wx.Panel",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "wx.BoxSizer",
"line... |
19429531005 | # coding: utf-8
import xair
import gym
import xsim
import numpy as np
import xtools as xt
import pandas as pd
import argparse
import matplotlib.pyplot as plt
from tqdm import tqdm
from dataclasses import dataclass
from feles.controller import sfb
from feles.controller.se import SystemEstimator3
from feles.utils.buffer... | xikasan/feles | tests/dev2/se.py | se.py | py | 6,593 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.ndarray",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "numpy.vstack... |
42450343832 | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 14 01:14:25 2020
@author: SHOBHIT SAINI
"""
import numpy as np
import cv2
# Import the image
img = cv2.imread('D:\IIT_BBS_CLG_WORK\CV_Practice\island.jpeg')
cv2.imshow('BGR_img_default', img)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
cv2.imshow('RGB_IMG', img)
cv2.waitK... | shobhit-saini/Computer_Vision_Practice | Operations/Convert_BGR_RGB/code.py | code.py | py | 350 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.imread",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_numb... |
39867830926 | import os
from shutil import copyfile
import lxml.etree as etree
class config:
def __init__(self, os=None, device=None, h=None, w=None, output=None, num_update_steps=None,
num_level_per_agent=None, num_worker=None, multiagent=None, training_attempts_per_level=None,
memory_size=... | Cheng-Xue/Hi-Phy | Agents/Utils/Config.py | Config.py | py | 9,100 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "os.listdir",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 78,
... |
2505014056 | from django.shortcuts import render
from django.urls import reverse_lazy,reverse
# from django.core.urlresolvers import reverse
# Create your views here.
from django.http import HttpResponse
from django.views.generic.edit import FormView
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from djan... | mohammed0115/django-erp | Products/views.py | views.py | py | 1,587 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "django.views.generic.edit.CreateView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "Products.forms.ProductForm",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 25,
"usage_type": "call"
},
... |
361533206 | from qwerqerqwerqweqwerqwerqwerqwerqwerwewqrwrerewre import get_date
from random import randint
from aiogram import Router, Dispatcher
from aiogram.types import Message,InlineKeyboardMarkup,InlineKeyboardButton,CallbackQuery
from aiogram import Bot
from aiogram.types.dice import DiceEmoji
from aiogram import F
from aio... | elyor-bek/boooot | axaxaxsa.py | axaxaxsa.py | py | 2,202 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "aiogram.types.InlineKeyboardMarkup",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "aiogram.types.InlineKeyboardButton",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "aiogram.types.InlineKeyboardButton",
"line_number": 20,
"usage_type... |
2440836040 | import os
import json
import time
import flask
import openai
from flask import (
request, jsonify
)
from datetime import datetime
from dotenv import load_dotenv
load_dotenv()
openai.api_key = os.getenv('OPENAI_API_KEY')
app = flask.Flask(__name__)
app.config["DEBUG"] = True
SP = """You are an AI assitant that ... | ethanlchristensen/GradioDockerKubeCtlApp | server/server.py | server.py | py | 3,278 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "openai.api_key",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"l... |
35175370687 | import unittest
import torch
from torch_quant.observer import HistogramObserver
class TestHistogramObserver(unittest.TestCase):
def test_basic(self):
obs = HistogramObserver()
obs.fake_quant = False
inp = torch.tensor([1, 2, 3, 4, 5], dtype=torch.float)
oup = obs(inp)
obs.... | alibaba/BladeDISC | tools/torch_quant/tests/test_histogram_observer.py | test_histogram_observer.py | py | 1,109 | python | en | code | 707 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch_quant.observer.HistogramObserver",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 11,
"usage_type": "call"
},
{
"api_name... |
29152495649 | from pyspark.sql import SparkSession
from pyspark.sql import Row
from pyspark.sql.functions import avg, min, max
spark = SparkSession.builder.appName('filter-example').getOrCreate()
sc = spark.sparkContext
sc.setLogLevel("ERROR")
def run():
print()
student = spark.createDataFrame([
Row(name='Song', s... | BigMountainTiger/aws-terraform-examples | glue-example/local-example/pyspark/dataframe/d-groupby-example.py | d-groupby-example.py | py | 1,186 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 5,
"usage_type": "... |
4563151853 | from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url(r'^register/$',
view=views.RegisterView.as_view(),
name="register",
),
url(r'^(?P<profile_id>[0-9]+)/$',
view=views.ProfileDetailView.as_view(),
name="detail",
),
url(r'... | slok/favorshare | favorshare/profiles/urls.py | urls.py | py | 429 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dja... |
32308532772 | from transliterate import translit
import re
def slugify(string: str) -> str:
return re.sub(
r'^-+|-+$', '', re.sub(
r'[\s_-]+', '-', re.sub(
r'[^\w\s-]', '', translit(
u"" + string, "ru", reversed=True
)
.lower()
... | allelleo/FireWork | src/utils/slug.py | slug.py | py | 335 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "re.sub",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "transliterate.translit",
"line_number": 9,
... |
2703240163 | from django.contrib import admin
from import_export import resources
from import_export.admin import ImportExportModelAdmin
from django.conf import settings
from django.conf.urls import url
from django.contrib import messages
from django.shortcuts import redirect
from pleethai.models import Word, SysWordJapanese, SysWo... | jocv-thai/pleethai | pleethai/admin.py | admin.py | py | 6,890 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "import_export.resources.ModelResource",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "import_export.resources",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pleethai.models.Word",
"line_number": 16,
"usage_type": "name"
},
... |
17661466638 | from itertools import combinations
def factor(n):
ans = []
d = 2
while d * d <= n:
if n % d == 0:
ans.append(d)
n //= d
else:
d += 1
if n > 1:
ans.append(n)
return ans
def print_out(nums):
for i in nums:
print(i, end=' ')
... | remgus/olymp | src/ВСОШ/2021-2022/муниципальный/e.py | e.py | py | 675 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "itertools.combinations",
"line_number": 31,
"usage_type": "call"
}
] |
14204332466 | #!/usr/bin/env python
# enccoding: utf-8
'''
@author: Yankai
@project:
'''
import xlrd,xlwt
from xlutils.copy import copy
#打开excel
readbook = xlrd.open_workbook(r'C:\Users\kmf\接口复习\test.xlsx')
#获取读入文件的sheet
sheet1 = readbook.sheet_by_index(0)
sheet2 = readbook.sheet_by_name('sheet2')
allsheetnames = readbook.sheet_nam... | imyk001/python- | readExcel.py | readExcel.py | py | 800 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 11,
"usage_type": "call"
}
] |
16870918677 | from __future__ import annotations
from asyncio import (CancelledError, Task, Queue, # pylint: disable=unused-import; typing
create_task, ensure_future, get_event_loop, shield, sleep)
import builtins
from datetime import datetime, timedelta, timezone
from email.message import EmailMessage
from fun... | noyainrain/micro | micro/micro.py | micro.py | py | 51,555 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "typing.TypeVar",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "typing_extensions.Protocol",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "core.RewriteFunc",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "typing.Dic... |
23945137202 | import json
import logging
import sys
from passivetotal.common.utilities import is_ip
log = logging.getLogger('passivetotal')
log.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setForma... | MISP/misp-modules | misp_modules/modules/expansion/passivetotal.py | passivetotal.py | py | 12,471 | python | en | code | 310 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdout",... |
71705805439 | import flet as ft
import random
def main(page: ft.Page):
page.add(
t = ft.Text(value="ELIGE PIEDRA PAPEL O TIJERA", color="pink")
)
opciones = ["piedra", "papel", "tijera"]
opcion_compu = random.choice(opciones)
usuario = input("piedra, papel o tijera: ").lower()
if usuario not in opciones:... | keniaescamilla/calculadora-y-to-do-app | .venv/assets/ppot2.py | ppot2.py | py | 762 | python | es | code | 0 | github-code | 97 | [
{
"api_name": "flet.Page",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "flet.Text",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flet.app",
"line_number": 23,... |
42717853564 | import os
this_dir = os.path.dirname(os.path.abspath(__file__))
import numpy as np
import torch as T
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from gymnasium.utils.save_video import save_video
from utils.plotting import plot_learning_curve
class DQN(nn.Module):
def __init_... | reedjacobp/LunarLanderProject | src/algorithms/dqn.py | dqn.py | py | 9,409 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.dirname",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line... |
70132371838 | from functools import lru_cache
from yaml import safe_load
from ansible_collections.arista.avd.plugins.plugin_utils.schema.default_schemas import DEFAULT_SCHEMAS
@lru_cache
def create_store():
store = {}
for id, schema_file in DEFAULT_SCHEMAS.items():
with open(schema_file, "r", encoding="UTF-8") as... | aristanetworks/ansible-avd | ansible_collections/arista/avd/plugins/plugin_utils/schema/store.py | store.py | py | 440 | python | en | code | 206 | github-code | 97 | [
{
"api_name": "ansible_collections.arista.avd.plugins.plugin_utils.schema.default_schemas.DEFAULT_SCHEMAS.items",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ansible_collections.arista.avd.plugins.plugin_utils.schema.default_schemas.DEFAULT_SCHEMAS",
"line_number": 11,
"usa... |
26412402511 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import argparse
import pickle
import hjson as json
import torch
import loader
from calc_F_score import calc_F_score # ~/work/misc
from model.AutoNER_with_RL import AutoNER_with_RL
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='... | tomoris/AutoNER_with_RL | test_with_RL.py | test_with_RL.py | py | 3,663 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "model.AutoNER_with_RL.AutoNER_with_RL",
"line_number": 37,
"usage_type": "call"
},
{
"api_nam... |
33793264828 | from django.contrib import admin
from .models import *
# Register your models here.
our_models = [
Biography,
Project,
ContactMe,
SocialsProfile,
Profile,
ProjectNotes,
ResumeProjects,
ResumeProjectDetails,
Resume,
ResumeAwardsAndAchievements,
CurrProj,
Feedback,
Bi... | JustinDo720/JDWebPortBE | jdwebport_app/admin.py | admin.py | py | 417 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.contrib.admin.site.register",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 23,
"usage_type": "name"
}
] |
18600147518 | import praw
import requests
import json
from datetime import datetime
import time
import argparse
from os.path import join
from os import getcwd
from tqdm import tqdm
class Downloader:
def __init__(self, client_id = None, client_secret = None, user_agent = None):
if client_id is not None:
self.... | epdansereau/textgen_prompts_demo | subreddit_text_downloader.py | subreddit_text_downloader.py | py | 3,485 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "praw.Reddit",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "os.path.join",
... |
26336157114 | """This module keeps track of current authorization."""
from system_server.jwt import create_jwt, registrant_from_jwt
from datetime import timedelta
import uuid
import logging
from system_server.constants import AUTHORIZATION_AUDIENCE
_log = logging.getLogger(__name__)
AUTHORIZATION_DURATION = timedelta(hours=2)
de... | Opentrons/opentrons | system-server/system_server/system/authorize/authorization.py | authorization.py | py | 978 | python | en | code | 363 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "system_server.jwt.registrant_from_jwt",
"line_number": 22,
"usage_type": "call"
},
{
"api_nam... |
21060553362 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/12/11 14:57
import logging
import os
import datetime
class Log():
def __init__(self):
self.logger = logging.getLogger()
self.logger.setLevel(logging.DEBUG)
self.base_dir = os.path.join(os.path.abspath(os.path.dirname(os.path.di... | 531461379/untitled | web_h5_test/Common/log.py | log.py | py | 1,051 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line... |
10607708235 | import pymysql as sql_tr
sql_con = sql_tr.connect(
user = 'root',
password = '',
host= 'localhost',
database= 'hr_db'
)
cur = sql_con.cursor()
insert_query = '''
INSERT INTO emp_tbl(emp_name,emp_age ,emp_dob, emp_salary)
VALUES(%s,%s,%s,%s)
'''
data_value = [
('John Bosco',23,'1999... | monterovincent/pythonSql | usersql.py | usersql.py | py | 537 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pymysql.connect",
"line_number": 3,
"usage_type": "call"
}
] |
73725255359 | import math
import xml.etree.ElementTree as ET
from button_tool.py.vtdTools import Weather
def get_score(xml_path, weather_result):
ego_car_type = None
veh_car_type = None
ttc_pivot = None
ego_speed = 500
ego_direction = 500
veh_speed = 500
veh_acc_target = 500
veh_lane = 1000
ttc... | jltyf/score | script/aeblka_5.py | aeblka_5.py | py | 5,059 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "button_tool.py.vtdTools.Weather.RAIN",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "button_tool.py.vtdTools.Weather",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 34,
"usage_type": ... |
70718446399 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
def manageStudent_test(driver, url):
while(True):
try:#click on Manage Student from the menu
driver... | rj96/resoluteAITesting | manageStudent.py | manageStudent.py | py | 5,107 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.by.By",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.CLASS_NAME",
"line_number": 1... |
73696358398 | import io
import re
import os
import six
import base64
import logging
from azure.cognitiveservices.vision.face import FaceClient
from msrest.authentication import CognitiveServicesCredentials
from azure.cognitiveservices.vision.computervision import ComputerVisionClient
from azure.cognitiveservices.vision.customvision.... | ayakurtam/GP | application.py | application.py | py | 8,877 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "azure.cognitiveservices.vision.computervision.ComputerVisionClient",
"line_number": 21,
"usage_type": "cal... |
17900354777 | import sqlite3, os
try:
# создаем свою базу country.db
connection = sqlite3.connect('music.db')
cursor = connection.cursor()
print("База данных создана и успешно подключена к SQLite")
# считывание файла скрипта для создания таблиц
with open('sqlite_create_tables.sql', 'r') as sqlite_file:
... | estle/itmo-uni | sem2/PRG/u3/3.py | 3.py | py | 2,737 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sqlite3.Error",
"line_number": 71,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 79,
"usage_type": "call"
}
] |
38245548420 | from flask import Flask
from datetime import datetime
from flask import jsonify
from index import *
# flask app
app = Flask(__name__)
# initialisation de la variable data
data = getDT('access2.log')
#
@app.route('/', methods=['GET'])
def hello_world():
response = jsonify({'some': 'data'})
response.headers.a... | Madjid-Djennane/dataD | api/server.py | server.py | py | 950 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_numb... |
72133912638 | from bs4 import BeautifulSoup
from urllib import request
from bs4.element import Tag
import pymysql
url = "http://gzjd.sipac.gov.cn/Web/BBS/MainList.aspx"
content = request.urlopen(url).read()
soup = BeautifulSoup(content, 'html5lib', from_encoding='GB2312')
# 根据id拿到table
table = soup.find(id="DataGrid1")
# 遍历tbody里面的... | chovy-3012/python-spider-examples | BeautifulSoup-examples.py | BeautifulSoup-examples.py | py | 1,598 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.element.Tag"... |
43457557880 | #!/usr/bin/env python
import extensions
from models import RoomType
from flask import request, Blueprint
from routes.route_utilities import table_get, table_ins, table_update, table_delete
auth = extensions.auth
db = extensions.db
dataResultSuccess = extensions.dataResultSuccess
roomtype_blueprint = Blueprint("roomt... | Hoptel/forest | routes/roomtype.py | roomtype.py | py | 750 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "extensions.auth",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "extensions.db",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "extensions.dataResultSuccess",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name"... |
32498465556 | """Toy implementation of a motion correction algorithm similar to the
one in Warp (https://doi.org/10.1038/s41592-019-0580-y)
"""
from datetime import datetime
import torch
import numpy as np
import mrcfile
import einops
import torch.nn.functional as F
from torch_cubic_spline_grids import CubicBSplineGrid3d
from lib... | teamtomo/libtilt | examples/motion_correction_a_la_warp.py | motion_correction_a_la_warp.py | py | 6,519 | python | en | code | 10 | github-code | 97 | [
{
"api_name": "torch.tensor",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "mrcfile.read",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional.avg_pool2d",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.nn.fun... |
38307184350 | import streamlit as st
import pandas as pd
import numpy as np
def gauss_jordan(matrix):
num_rows, num_cols = matrix.shape
pivot_row = 0
for col in range(num_cols - 1):
# Mencari pivot
pivot_value = matrix[pivot_row, col]
for row in range(pivot_row + 1, num_rows):
... | Terpaksa56/MatrixCalculator | p.py | p.py | py | 9,470 | python | id | code | 0 | github-code | 97 | [
{
"api_name": "numpy.linalg.det",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "numpy.linalg.det",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
... |
35658838959 | from flask import Flask, render_template, request, redirect, session
app = Flask(__name__)
# secret key removed
@app.route('/')
def index():
if not 'x' in session:
session['x'] = 0
return render_template("index.html")
@app.route('/process_money', methods=['POST'])
def get_gold():
print("GOLD!!!")
... | jeremydabbs/coding-assignments-python | 2 - Flask/flask_fundamentals/ninja_gold/server.py | server.py | py | 996 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"lin... |
883223782 | #!/usr/bin/env python
from __future__ import print_function, division, absolute_import
import math
import threading
from timeit import repeat
import numpy as np
from numba import jit
nthreads = 4
size = 10**6
def func_np(a, b):
"""
Control function using Numpy.
"""
return np.exp(2.1 * a + 3.2 * b)
... | numba/numba-examples | legacy/nogil.py | nogil.py | py | 2,516 | python | en | code | 160 | github-code | 97 | [
{
"api_name": "numpy.exp",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.exp",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numba.jit",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.allclose",
"line_number": 36,
... |
21091391440 | import requests
import json
import pandas as pd
import time
class HubSpotDeal(object):
"""docstring for HubSpot"""
def __init__(self, token):
self.params = {"hapikey":token}
self.headers = {
'accept': "application/json",
'content-type': "application/json"
}
... | imasdekar/awesome-notebooks | CRM/Hubpsot/Import Contact & Deals from Excel/Import Contact & Deals from Excel.py | Import Contact & Deals from Excel.py | py | 6,974 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.request",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "requests.request",... |
33311456188 | #encoding=utf-8
from django.db import models
from DjangoUeditor.models import UEditorField
from common.models import BaseModel, Category
from ceye_auth.models import User
ACTIVITY_STATUS = [(x, x) for x in ['UnStart', 'Starting', 'Finished']]
YES_OR_NO = [(x, x) for x in ['Yes', 'No']]
# 活动地区
class Area(BaseModel)... | guoshijiang/chaineye | activity/models.py | models.py | py | 6,913 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "common.models.BaseModel",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "d... |
71002592318 | import sys
import random
import math
import numpy as np
import matplotlib.pyplot as plt
class ApproxKarpLubyDNFCount:
def constructF(self, dnf:str):
clauses = []
clean = dnf.replace(" ", "").replace("(","").replace(")","")
for c in clean.split("or"):
clauses.append(... | dkfrankandersen/ITU_AdvancedAlgorithms | 3third/ApproxKarpLubyDNFCount.py | ApproxKarpLubyDNFCount.py | py | 4,073 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "random.randint",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"lin... |
15729613542 | import os
from os import path
import requests
import aiohttp
import youtube_dl
import callsmusic
import converter
from downloaders import youtube
from config import BOT_NAME as bn, DURATION_LIMIT, PLAY_PIC
from helpers.filters import command, other_filters
from helpers.decorators import errors
from helpers.errors imp... | TheVaders/vc_bot | handlers/play.py | play.py | py | 5,401 | python | en | code | 39 | github-code | 97 | [
{
"api_name": "pyrogram.types.Message",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "config.BOT_NAME",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "config.PLAY_PIC",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "pyrogram.types... |
36391821001 | import requests
import json
import pathlib
def getContracts(slug, apiKey):
url = "https://api.footprint.network/api/v1/protocol/{slug}/contract".format(
slug=slug)
print("url: ", url)
headers = {
"accept": "application/json",
"API-KEY": apiKey
}
# print(headers["API-KEY"])
... | Twerewolf/gamefi-contracts-collection | src/getContracts.py | getContracts.py | py | 1,287 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 2... |
74664924480 | import os
import discord
import csv
import requests
import re
import time
from datetime import date, datetime, timedelta
from bs4 import BeautifulSoup
from json import loads
from dotenv import load_dotenv
from discord.ext import tasks
import constants as id
import calendar_parser
class BotClient(discord.Client):
d... | bani/bot | discord/deprecated.py | deprecated.py | py | 11,809 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "discord.Client",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"l... |
334824195 | import os.path as osp
import numpy as np
import time
import torch
import os
os.environ['CUDA_VISIBLE_DEVICES'] = "1"
import torch.nn.functional as F
from torch_geometric.datasets import Planetoid
import torch_geometric.transforms as T
from gcn import GCN_PYG
import ctypes
_cudart = ctypes.CDLL('libcu... | jwwu666/Performance-Analysis-of-Graph-Neural-Network-Frameworks | node classification/gcn_pyg.py | gcn_pyg.py | py | 3,205 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "ctypes.CDLL",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
23679230615 | from rest_framework.viewsets import ModelViewSet
from rest_framework.views import Response
from rest_framework.status import (
HTTP_201_CREATED,
HTTP_204_NO_CONTENT,
HTTP_400_BAD_REQUEST,
HTTP_404_NOT_FOUND
)
from rest_framework.decorators import action
from apps.financeiro.models import Venda, ItemVend... | Juzeka/Mercearia | apps/financeiro/views/venda.py | venda.py | py | 3,508 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "apps.financeiro.serializers.VendaSerializer",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "apps.financeiro.models.Venda",
"line_number": 18,
"usage... |
23034623306 | from django.shortcuts import render,get_object_or_404
from curriculo.models import Curso, Disciplina, DisciplinaOfertada
from datetime import datetime
def curso(request, sigla):
curso = get_object_or_404(Curso, sigla=sigla)
curso.semestres = [
'Semestre 2',
]
ano = datetime.now().year
... | kthanasio/testeEntregaAC | curriculo/views.py | views.py | py | 902 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "curriculo.models.Curso",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
... |
16464561891 | import requests
import json
data = {'age': 50,
'workclass': 'Private',
'fnlgt': 367260,
'education': 'Bachelors',
'education-num': 13,
'marital-status': 'Never-married',
'occupation': 'Tech-support',
'relationship': 'Unmarried',
'race': 'White',
... | hseelawi/projcet3-udacity-mlops | tests/live_test.py | live_test.py | py | 653 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.post",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 23,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.