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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30230034371 | from flask import render_template, flash, redirect, url_for, request
from flask_login import current_user, login_required
from app import db
from datetime import datetime
from .models import *
from .forms import *
from app.stock.models import Company
from app.account_manage.models import User,Admin
from app.balance imp... | wuqiping09/StockDatabaseSystem | app/balance/views.py | views.py | py | 2,552 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.request.args.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "flask.re... |
44243801881 | import argparse
import logging
import sys
from pathlib import Path
from maple_test.utils import ALL, BASE_DIR, OS_SEP
from maple_test.utils import complete_path, read_config, get_config_value, is_relative
TEST_CONFIG = {}
LOGGER = None
LOG_CONFIG = {}
def parse_args():
parser = argparse.ArgumentParser()
tes... | himself65/OpenArkCompiler | test/maple_test/configs.py | configs.py | py | 11,362 | python | en | code | 687 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "maple_test.utils.BASE_DIR",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "maple_... |
41024269920 | import json
import time
def grapfdata():
# define a function to process the original json data to make it simplified in order to improve reaction speed.
# load the json file
try:
bd_json = open('static/BikesData.json')
except IOError:
print("file dublin.json not found")
else:
... | shkml/SE-Repo | processbikedata.py | processbikedata.py | py | 3,320 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 72,
"usage_type": "call"
}
] |
39655912646 | import nltk
from nltk.translate.bleu_score import sentence_bleu
from nltk.translate.bleu_score import SmoothingFunction
nltk.download('punkt')
nltk.download('stopwords')
def compute_code_bleu(reference_code, candidate_code):
"""
Compute the CodeBLEU score.
:param candidate_code: The generated code a... | algosmith/CodeBleuSysMD | bleu_nltk.py | bleu_nltk.py | py | 1,226 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "nltk.download",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "nltk.translate.bleu_score.SmoothingFunction",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": ... |
38428831492 | """ChessWarrior runner"""
import argparse
import os
import logging
from chesswarrior.config import Config
from chesswarrior.data import DataReader
from chesswarrior.train import Trainer
from chesswarrior.play import Player
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
fmt = logging.Formatter('%(asctime... | ChessWarrior/ChessWarrior | run.py | run.py | py | 2,045 | python | en | code | 11 | 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": "logging.Formatter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.Stream... |
19161020619 | import pandas as pd
# from dashboard.backend import dataset_interactions
import dash_html_components as html
from dash.dependencies import Input, Output, State
from sherlock.sherlockinterface import Sherlock
# from dashboard.utils import components_layout_helper
# from dashboard.pages import report_layout
import io
im... | rezabonyadi/sherlock_auto_data_inspector | dashboard/dashboardcallbacks.py | dashboardcallbacks.py | py | 8,773 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dashboard.utils.callbackshelpers.parse_spreadsheet_contents",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "dashboard.utils.callbackshelpers",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "sherlock.sherlockinterface.Sherlock",
"line_numb... |
11201891657 | import logging
logging.basicConfig(format="%(asctime)s - %(name)s - %(message)s", level=logging.INFO)
logger = logging.getLogger(__name__)
from telegram import Update
from telegram.ext import (
Application,
CommandHandler,
ContextTypes,
)
TOKEN = "TOKEN"
async def quadratic(update: Update, context: Con... | Barnacle322/bilimkana-lectures | tgbot/app2.py | app2.py | py | 1,548 | python | ru | code | 0 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "telegram.Update"... |
21822931560 | from __future__ import absolute_import
from __future__ import print_function
import re
import sys
from itertools import islice
import requests
from rtmbot.core import Plugin
class CveParser(Plugin):
def process_message(self, data):
message = data['text']
if re.search(r'\bignore\b', message):
... | LineageOS/slackbot | plugins/cve.py | cve.py | py | 1,106 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rtmbot.core.Plugin",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "re.search",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.finditer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "itertools.islice",
"line... |
35449322931 | from pydantic import BaseModel, Field
from beartype import beartype
from kubernetes.client.rest import ApiException
class InputSchema(BaseModel):
k8s_cli_string: str = Field(
title='Kubectl Command',
description='kubectl command '
'eg "kubectl get pods --all-namespaces"'
)
... | unskript/Awesome-CloudOps-Automation | Kubernetes/legos/k8s_kubectl_rollout_deployment/k8s_kubectl_rollout_deployment.py | k8s_kubectl_rollout_deployment.py | py | 1,285 | python | en | code | 258 | github-code | 97 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pydantic.Field",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pydantic.Field",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pydantic.Field",
"... |
18921390041 | # Program potrzebuje następujących bibliotek:
# pygame, numpy, matplotlib, keras
# import gry Pong
from PongGame import PongGame # import The Pong Game
from PongGenome import PongGenome
#
import random
import matplotlib.pyplot as plt
import operator
MAX_EVALUATE_FRAMES = 500
MAXEPOCHS = 31
def GetFuzzyValues(Ball... | s21164-pj/NAI_Chopsticks | Pong_Fuzzy_Logic/TrainPongGA.py | TrainPongGA.py | py | 7,123 | python | pl | code | 0 | github-code | 97 | [
{
"api_name": "PongGenome.PongGenome",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "PongGame.PongGame",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "PongGenome.PongGenome",
"line_number": 140,
"usage_type": "call"
},
{
"api_name": "PongGe... |
38583334371 | from torchvision import transforms
import random
import os
import numpy as np
import torch
import Utils.config_stomach as CONFIG
import itertools
from matplotlib import pyplot as plt
import scipy
from sklearn.metrics import roc_curve, roc_auc_score
import math
def seed_torch(seed=0):
random.seed(seed)
os.envi... | Kepler1647b/EBVnet | Utils/utils.py | utils.py | py | 6,804 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "random.seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
71333460800 | # -*- coding: utf-8 -*-
"""stochastic_evolutionary.py: Module containing functionalities to optimize
a given Latin Hypercube Design using an implementation of the Enhanced
Stochastic Evolutionary Algorithm proposed by Jin, Chen, and Sudjianto (1).
Details can be found in (1) for the enhanced version and (2) for the ori... | damar-wicaksono/gsa-module | gsa_module/samples/opt_alg/stochastic_evolutionary.py | stochastic_evolutionary.py | py | 12,914 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "types.FunctionType",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "types.FunctionType",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "ma... |
19537690525 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from .models import TUser,Waste,TransportVehicle,ProcesssingPlant,Landfill
class UserRegisterForm(UserCreationForm):
class Meta:
fields = ["username", "email", "password1", "password2",'area','landmark','city','state','zipcode'... | aarush7/Solid-Waste-Mangement | swm/invt/forms.py | forms.py | py | 3,822 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.TUser",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelForm",
"line_number": 15,
"usage_type": "attribute"
},
{
... |
38580601290 | import numpy as np
import matplotlib.pyplot as plt
vanilla_model = "200d_1x128LSTM_2x128out_50drop.txt"
pos_model = "200d_50pos_1x128LSTM_2x128out_50drop_2.txt"
def main():
data_vanilla = load_data(vanilla_model)
data_pos = load_data(pos_model)
print(data_vanilla.shape)
print(data_pos.shape)
... | MichielBaptist/using-part-of-speech-in-tweet-classification | plot/plot_making_script.py | plot_making_script.py | py | 1,314 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "matplotlib.py... |
24005242563 | from django.db import models
ZONA_MAX_LENGTH = 50
# Create your models here.
class Map(models.Model):
Zona = models.CharField(max_length = ZONA_MAX_LENGTH)
Latitud = models.FloatField()
Longitud = models.FloatField()
class Meta:
verbose_name_plural = 'Mapa'
def __str__(self):
ret... | Quitiweb/Quitiweb | Quitiweb/apps/qaweb/models.py | models.py | py | 334 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "... |
70867778558 | import torch
import torch.nn as nn
import os
from itertools import zip_longest
import numpy as np
class Learner():
def __init__(self, net, results_dir='./tmp/results/'):
self.net = net # Neural network model
self.loss = [] # List to store different loss functions
# Initialize the... | sebasrdez/LifelongCompositionalLearning | learners/base_learning_classes.py | base_learning_classes.py | py | 18,137 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.nn.MSELoss",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.nn.BCEWithLogitsLoss",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"... |
32351204281 | import logging
from group import ZabbixGroups
from object import ZabbixObject
# Connect to logger object
log = logging.getLogger(__name__)
class ZabbixAutoreg(ZabbixObject):
"""
Implements working with zabbix autoregister action objects.
Arguments:
zapi (ZabbixAPI) ZabbixAPI connector to send re... | adubkov/zabbixcli | zabbixlib/autoreg.py | autoreg.py | py | 3,444 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "object.ZabbixObject",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "object.ZabbixObject",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "group.ZabbixG... |
12395509220 | import os
import gym
import numpy as np
import torch
import matplotlib.pyplot as plt
import argparse
from copy import deepcopy
import torch.multiprocessing as mp
from torch.utils.tensorboard import SummaryWriter
from OppModeling.atari_wrappers import make_ftg_ram, make_ftg_ram_nonstation
from OppModeling.SAC import ML... | Byron-Edwards/FTG4.50 | evaluation_offline.py | evaluation_offline.py | py | 6,867 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.no_grad",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "torch.manual_seed",
"line_num... |
74880831357 | import sdl2
import sdlboy_console_component
import sdlboy_time
import hw_video as vid
import ctypes
import math
class Color:
def __init__(self, r, g, b, a=255):
self.r = r
self.g = g
self.b = b
self.a = a
self.c_argb = (ctypes.c_uint)((a<<24)|(r<<16)|(g<<8)|b)
class Tilevie... | thejoggeli/dmg-python | sdlboy_console_tileview.py | sdlboy_console_tileview.py | py | 5,221 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "ctypes.c_uint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sdlboy_console_component.ConsoleComponent",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sdl2.SDL_Rect",
"line_number": 34,
"usage_type": "call"
},
{
"api_na... |
34148742947 | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 18 10:28:32 2018
@author: User
"""
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import random
from deap import creator, tools, base, gp
import operator
def preprocessData():
#Importing the dataset
dataset = pd.r... | SamSnowKitten/VIP | OneMaxProblem.py | OneMaxProblem.py | py | 6,326 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.Imputer",
"line_number": 28,
"usage_type": "call"
},
{
"... |
74074088000 |
import logging
import sqlite3
from uuid import uuid4
log = logging.getLogger(__name__)
def create_connection():
conn = sqlite3.connect("db/tournament_tool.db", check_same_thread=False)
return conn
conn = create_connection()
class Tournament:
def __init__(self):
pass
def check_active_tou... | spoilaro/tournament_tool | app/tournament.py | tournament.py | py | 3,609 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_nu... |
38449633262 | from magicbus.compat import ntob
import os
thismodule = os.path.abspath(__file__)
import sys
import pytest
from magicbus import bus
from magicbus.plugins import opsys
from magicbus.test import Process, WebAdapter, WebService
from magicbus.test import WebHandler
from magicbus.plugins import loggers
loggers.StdoutLogg... | cherrypy/magicbus | magicbus/test/test_opsys.py | test_opsys.py | py | 2,452 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "os.path.abspath",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "magicbus.plugins.loggers.StdoutLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "magi... |
35347996058 | # coding=utf-8
import re, sys
reload(sys)
sys.setdefaultencoding("utf-8")
import scrapy
class StackOverflowSpider(scrapy.Spider):
name = 'priceza'
start_urls = ['http://www.priceza.com.my/search', 'http://www.priceza.com.sg/search', 'http://www.priceza.com.ph/search', 'http://www.priceza.com.vn/search', 'http... | moohebat/tools | scrapers/top-products/priceza.py | priceza.py | py | 1,194 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "scrapy.Spider",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"... |
7425524320 | import os
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from common.utils import compute_std_of_mean
SAVE_ROOT = '../../figs_sigcomm22'
plt.style.use('seaborn-deep')
plt.rcParams['font.family'] = 'Arial'
# plt.rcParams['font.size'] = 42
# plt.rcParams['axes.labelsize'] = ... | zxxia/RL-CC | src/plot_scripts/plot_sigcomm_bars_ethernet.py | plot_sigcomm_bars_ethernet.py | py | 8,664 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.use",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name":... |
13431944661 | from collections import deque
def DFS(n,graph,q):
visited_DFS[q]=1
print(q+1, end=' ')
for i in range(0,n):
if(visited_DFS[i]==0) and (graph[q][i]==1):
DFS(n,graph,i)
def BFS(n,graph,q):
queue=deque()
queue.append(q)
visited_BFS[q]=1
while queue:
tmp=queue.poplef... | persShins/DataStructure | DFS & BFS/DFS & BFS 출력 함수.py | DFS & BFS 출력 함수.py | py | 750 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
}
] |
74667661759 |
# coding: utf-8
# In[ ]:
from scipy import sparse
train_tfidf=sparse.load_npz("./npy/data1_tfidf_train_x.npz")
train_count_fea=sparse.load_npz("./npy/data1_count_fea_train_x.npz")
train_x=sparse.hstack((train_tfidf,train_count_fea))
# In[ ]:
test_tfidf=sparse.load_npz("./npy/data1_tfidf_test_x.npz")
test_count... | bestpredicts/Ali_Security_Competition | tfidf+count_feature+lr.py | tfidf+count_feature+lr.py | py | 3,254 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "scipy.sparse.load_npz",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scipy.sparse",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "scipy.sparse.load_npz",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scipy.sparse",... |
29736152982 | import datetime
from django.shortcuts import redirect
from core.tasks import send_email
from core.models import User, Product, ProductPackage, \
ClientPackages, Transaction, Notification
def generate_buyer_token(buyer):
"""
GET BUYER ID
GET THE DATEANDTIME
GENERATE TOKEN BY ADDING THE BUYER ID + ... | Farzan-ul-haq/AAAS | buyer/utils.py | utils.py | py | 2,806 | 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": "attribute"
},
{
"api_name": "core.models.ProductPackage.objects.get",
"line_number": 30,
"usage_type": "call"
},
{
... |
12115297301 | import pygame
from City import City
from pygame.locals import KEYDOWN, QUIT, MOUSEBUTTONDOWN, K_RETURN, K_ESCAPE
import sys
# # globals
screen_x = 500
screen_y = 500
city_color = [10, 10, 200] # blue
city_radius = 3
font_color = [255, 255, 255] # white
def getCitiesPoints():
cities = []
draw(cities)
... | krypty/IA_TP2 | GUI_example.py | GUI_example.py | py | 1,606 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.event.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pygame.event",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "pygame.locals.QUIT",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "sys.exit",
... |
70824162879 | import unittest
import os
import logging
from datetime import date
from decimal import Decimal
from ibrokersflex import parse_flex_accounts, parse_flex_positions, parse_flex_flows
class LoadFlexResultsTestCase(unittest.TestCase):
def setUp(self):
self.tree = None
example_file_path = os.path.abs... | chris-ch/lemvi-risk | tests/test_load_flex.py | test_load_flex.py | py | 2,329 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.sep.join",
... |
34601044927 | from theBrain import *
from datetime import datetime
import shutil
SENSE_BUFFER = [np.zeros([TRUNC_BACKPROP_LENGTH, SENSOR_DATA_DIM]),
np.zeros([TRUNC_BACKPROP_LENGTH, OUTPUT_DIM])]
def truth_values(batch_size):
# this is supposed to be high when I am here
hour = datetime.now().hour/NUM_HO... | ranjeethmahankali/sensorsWithABrain | consciousness.py | consciousness.py | py | 2,594 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "shutil.rmtree",
"line_number": 38,
"usage_type": "call"
}
] |
44891309054 |
from __future__ import with_statement
from fabric.api import *
from fabric.contrib.console import confirm
env.hosts = ['my_server']
def test():
with settings(warn_only=True):
result = local('./manage.py test my_app', capture=True)
if result.failed and not confirm("Tests failed. Continue anyway?"):
... | okipriyadi/NewSamplePython | SamplePython/Developer Tool/fab_fabric/11_put_it_all_together.py | 11_put_it_all_together.py | py | 1,345 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "fabric.contrib.console.confirm",
"line_number": 11,
"usage_type": "call"
}
] |
43332300755 | import time
import pytest
from aeon.measurement import Measurement
from aeon.errors import InvalidMeasurementState
def test_cant_start_measurement_twice():
m = Measurement("name", "group")
m.start()
with pytest.raises(InvalidMeasurementState):
m.start()
def test_cant_stop_measurement_before_star... | logicabrity/aeon-legacy | test/test_measurement.py | test_measurement.py | py | 1,229 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "aeon.measurement.Measurement",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "aeon.errors.InvalidMeasurementState",
"line_number": 10,
"usage_type": "argument"
},
{
... |
16686306664 | from django.urls import path
from . import views
from django.conf.urls import url
urlpatterns = [
path('', views.index, name='index'),
path('series', views.series, name='series'),
path('free_episodes', views.free_episodes, name='free_episodes'),
path('gethbo', views.gethbo, name='gethbo'),
path('blog', views.post_list... | skuanyshuly/My-First-Blog | blog/urls.py | urls.py | py | 389 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
72956796799 | from clients.python import TaskService_v1
from clients.python.protos.sylklabs.Todos.v1.Todos_pb2 import TaskId
import grpc
client = TaskService_v1(
client_opt={
'host': 'localhost',
'port': 51010
}
)
try:
task = client.GetTask(TaskId(id='1'))
print(task)
# Custom handling of exceptions... | sylk-build/todoapp-py | client.py | client.py | py | 611 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "clients.python.TaskService_v1",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "clients.python.protos.sylklabs.Todos.v1.Todos_pb2.TaskId",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "grpc.RpcError",
"line_number": 16,
"usage_type": "a... |
38338366868 | """new_eac_schema_payment
"""
from alembic import op
import sqlalchemy as sa
# pre/post deployment: pre
# revision identifiers, used by Alembic.
revision = "a7accb2d29db"
down_revision = "801ba453e407"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.add_column("payment", sa.Column("collectiveBo... | bruno-ebstein-pass-culture/pass-culture-main | api/src/pcapi/alembic/versions/20220721T124051_a7accb2d29db_new_eac_schema_payment.py | 20220721T124051_a7accb2d29db_new_eac_schema_payment.py | py | 1,032 | python | en | code | null | github-code | 97 | [
{
"api_name": "alembic.op.add_column",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.BigInte... |
28274794384 | import cv2
import numpy as np
import time
t0 = time.time()
cap = cv2.VideoCapture(0)
while True:
ret, frame = cap.read()
if ret:
t1 = time.time() - t0
t1_str = str(round(t1, 2))
frame = cv2.flip(frame, 1)
text = f"Amir Madankan {t1_str}"
cv2.putText(frame, text, (100, ... | AmirMadankan/Ch02_HW01 | Ch02_HW01.py | Ch02_HW01.py | py | 1,075 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "time.time",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.flip",
"line_number": 14,
... |
21495112014 | import pygame
from cell import *
class Button:
def __init__(self, WIN):
self.FONT = pygame.font.Font('font/8-BIT WONDER.ttf', 20)
self.WIN = WIN
def draw_buttons(self):
start_text = self.FONT.render("Start", 1, LIGHT_GRAY)
reset_text = self.FONT.render("Reset",1, LIGHT_GRAY)
... | luckyluke66/game-of-life | Button.py | Button.py | py | 1,347 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.font.Font",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.rect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"l... |
35313273533 | import requests
import json
import os
import time,datetime
def updateJsonFile( path, data ):
with open(path, 'w', encoding='utf-8') as f:
json.dump(data, f, ensure_ascii=False, indent=4)
# Actual temperature
waterData = {}
url = 'https://data.bs.ch/api/v2/catalog/datasets/100046/records?order_by=startzeit... | chrisrickenbacher/rhygfuehl | data/aggregation.py | aggregation.py | py | 12,315 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "json.dump",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"li... |
16584675807 | import tensorflow as tf
from tensorflow.keras.models import load_model
import pickle
import numpy as np
import argparse
import datetime
import glob
import time
import sys
import os
import re
import seaborn as sns
from matplotlib import pyplot as plt
from sklearn.metrics import (roc_auc_score, roc_curve,
classific... | nathanin/milk | scripts/experiment/test_npy.py | test_npy.py | py | 6,775 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pickle.load",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"lin... |
26926208647 | import sys
from collections import deque
read = sys.stdin.readline
n, m = map(int, read().split())
graph = [read().split() for _ in range(n)]
dist = [[0] * m for _ in range(n)]
res = 0
q = deque()
for i in range(n):
for j in range(m):
if graph[i][j] == '1':
q.append((i, j))
while q:
x, y... | kth321/BOJ | 17000/17086.py | 17086.py | py | 707 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 11,
"usage_type": "call"
}
] |
23328317432 | #!/usr/bin/python3.2
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.post()
def post(self):
raise tornado.web.HTTPError(403)
application = tornado.web.Application([
(r"/", MainHandler),
])
if __name__ == "__main__":
... | wendal/tornado-learn | day_1/return_error.py | return_error.py | py | 390 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "tornado.ioloop.web",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "tornado.ioloop",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "tornado.ioloop.web.HTTPError",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tor... |
4247318912 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scanpy.api as sc
import scanpy.external as sce
import os
import louvain
# import phate
import seaborn as sns
import anndata as ad
import time
import random
import tensorflow as tf
import statsmodels.api as sm
from sklearn.model_selection impo... | biskra/ajp.saucie.scanpy | dox.panel.fig.5.py | dox.panel.fig.5.py | py | 9,686 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "random.seed",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.set_random... |
19093092657 | from PyQt5.QtCore import QThread, pyqtSignal
import threading
import time
from program import MainProgram
# Model: pengkoneksi UI dengan program aslinya
class Model:
def __init__(self):
self.size = 4
self.bombs = 0
self.bombLoc = []
self.program = None
self.updater = None
... | darkGrimoire/tubes-ai-2 | appModel.py | appModel.py | py | 1,258 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "program.MainProgram",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.QThread",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCor... |
22637937078 | import json
import logging
from decimal import Decimal
from typing import Dict, List, Optional, Type, Union
from enforce_typing import enforce_types
from web3.datastructures import AttributeDict
from ocean_lib.config import Config
from ocean_lib.data_provider.data_service_provider import DataServiceProvider
from ocea... | cleancoindev/ocean.py | ocean_lib/ocean/ocean.py | ocean.py | py | 12,103 | python | en | code | null | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "ocean_lib.config.Config",
... |
21181729709 | from typing import Type, TypeVar, List, Optional
from sqlalchemy import and_, select
from sqlalchemy.ext.asyncio import AsyncSession
from core.database import Base
ModelType = TypeVar('ModelType', bound=Base)
class BaseRepository:
'''Base Data Repository'''
def __init__(self, model: Type[ModelType], sessio... | mohamad-liyaghi/fastapi-todo-list | src/core/repository/base.py | base.py | py | 3,367 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "typing.TypeVar",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "core.database.Base",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Type",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.ext.asyncio.As... |
7731721638 | import json
import pytest
from botocore.errorfactory import ClientError
from datetime import datetime
from datetime import timedelta
from .conftest import ObjectUsers
from .util import random_bucket_name
def test_governance_lock(users: ObjectUsers):
# Prepare two users and a shared bucket
owner = users.cre... | href/s3-features | tests/test_governance.py | test_governance.py | py | 3,969 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "conftest.ObjectUsers",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "util.random_bucket_name",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "datetime.date... |
18195146529 | from flask import Flask, render_template,request,redirect
from models.transaction import Transaction
from models.user import User
from models.tag import Tag
from models.item import Item
from models.merchant import Merchant
from flask import Blueprint
import repositories.transaction_repository as transaciton_repository... | zlatterson/Python-Spending-Tracker | controllers/transaction_controller.py | transaction_controller.py | py | 2,326 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Blueprint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "repositories.user_repository.select",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "repositories.user_repository",
"line_number": 20,
"usage_type": "name"
},
{
"... |
35664014568 | import json
import networkx as nx
import matplotlib.pyplot as plt
# Load dataset
with open('USAir97v2.json') as file:
dataset = json.load(file)
# Create empty graph
G = nx.Graph()
# Add nodes (airports) to the graph with importance factor attribute
for airport in dataset['nodes']:
airport_code =... | zim18/tugas_3_visdat | task 3/p3_force_layout.py | p3_force_layout.py | py | 1,884 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "networkx.spring_layout",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figu... |
40848142209 | from collections import defaultdict
from typing import Union
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
from bokeh.palettes import Blues
import numpy as np
import pandas as pd
from dara_data_interactivity.definitions import CATEGORICAL_FEATURES, GREEN, RED
def _categorical_bar_plot(... | causalens/dara_app_gallery | dara_data_interactivity/dara_data_interactivity/plotting_utils.py | plotting_utils.py | py | 4,430 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pandas.DataFrame",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "typing.Union",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "collections.defau... |
31459181416 | import sys
import math
from fractions import Fraction
from typing import Dict, List
class Vector:
def __init__(self, x: Fraction, y: Fraction):
self.x = x
self.y = y
@staticmethod
def from_str(s: str):
x, y = s.split(',')
return Vector(Fraction(x), Fraction(y))
def __... | hasipon/icfpc2016 | hasi/conv.py | conv.py | py | 6,801 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "fractions.Fraction",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "fractions.Fraction",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "fractions.Fraction",... |
73048991359 | import os
import json
from typing import Union, List, Dict
import transformers
import torch
from tqdm.auto import tqdm
from . import utils
from .utils import _infer_model_family, _infer_model_or_path
def _select_device(device_selection):
selected = device_selection.lower()
if selected == "auto":
dev... | xhluca/dl-translate | dl_translate/_translation_model.py | _translation_model.py | py | 9,774 | python | en | code | 367 | github-code | 97 | [
{
"api_name": "torch.device",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
... |
73172642880 | import os
import re
import time
import requests
from abc import ABC
from contextlib import closing
from download.AutoDownLoader import AutoDownLoader
from download import Translator
class DouyinDownloader(AutoDownLoader, ABC):
def __init__(self):
self.headers = {
'accept': 'text/html,applica... | FlamingJay/homework | download/douyin.py | douyin.py | py | 4,854 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "download.AutoDownLoader.AutoDownLoader",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 33,
"usage_type": "call"
},
... |
30680343060 | import healpy as hp
import numpy as np
import numpy.lib.recfunctions as rf
from shapely import geometry
from shapely import affinity
import shapely.vectorized
from astropy_healpix import HEALPix
from astropy import units as u
from descartes.patch import PolygonPatch
#from astropy.coordinates import SkyCoord
#from dustm... | LSSTDESC/sn_tools | sn_tools/sn_obs.py | sn_obs.py | py | 83,963 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "sn_tools.sn_clusters.ClusterObs",
"line_number": 129,
"usage_type": "call"
},
{
"api_name": "pan... |
18348159113 | from rest_framework import serializers
from rest_framework.authtoken.models import Token
from .models import Position, Emp, Work_Catalogue, Computers, RepairRequests, CustomUser, Tasks
from django.contrib.auth.models import Group
class PositionSerializer(serializers.ModelSerializer):
class Meta:
model= P... | Bipyf/inc_api | inc_api/api/serializers.py | serializers.py | py | 2,546 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.Position",
"line_number": 10,
"usage_type": "name"
},
... |
15781987797 | import itertools
import numpy as np
DOT = "."
PLUS = '+'
MINUS = '-'
HADAMARD = '∘'
EQUALS = '='
_PAD = ' '
_TOP_LEFT_CORNER = '┌'
_TOP_RIGHT_CORNER = '┐'
_BOTTOM_LEFT_CORNER = '└'
_BOTTOM_RIGHT_CORNER = '┘'
_BORDER = '│'
_ELLIPSIS = '…'
_MAX_HEIGHT = _MAX_WIDTH = 10
_SHRUNK_NUM_ROWS = _SHRUNK_NUM_COLS = 3
def... | samueljamesbell/prettymatrix | prettymatrix.py | prettymatrix.py | py | 10,878 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "itertools.zip_longest",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.full"... |
70881203838 | from __future__ import unicode_literals
from operator import neg
import frappe
from frappe.model.document import Document
from frappe.utils import now, flt
from functools import partial
from toolz import compose, excepts, first, get, unique, pluck, merge
from optic_store.api.customer import get_user_branch
from optic_... | f-9t9it/optic_store | optic_store/optic_store/doctype/xz_report/xz_report.py | xz_report.py | py | 9,554 | python | en | code | 23 | github-code | 97 | [
{
"api_name": "frappe.model.document.Document",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "frappe.db.sql",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "frappe.db",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "frappe.ut... |
2235398011 | from django.db.models import DecimalField, Q, Sum
from django.db.models.functions import Coalesce
from rest_framework.response import Response
from rest_framework.views import APIView
from usaspending_api.accounts.models import AppropriationAccountBalances
from usaspending_api.common.cache_decorator import cache_respo... | fedspendingtransparency/usaspending-api | usaspending_api/references/v2/views/agency.py | agency.py | py | 5,431 | python | en | code | 265 | github-code | 97 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "usaspending_api.references.models.Agency.objects.filter",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "usaspending_api.references.models.Agency.objects",
"line... |
27320724016 | from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, logout
from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from .forms import SignUpForm
from students.models import StudentTeacherReport
from personals.models import Staff, Teacher
... | sergeev/kvant42_crm | portal/views.py | views.py | py | 6,106 | python | ru | code | 0 | github-code | 97 | [
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.success",
"line_number": 24,
"usage_type": "call"
},... |
74912358078 | from urlparse import urlparse
from hamcrest import assert_that, is_, contains_string, is_not
from lxml import html
from pylons import url
from joj.services.model_run_service import ModelRunService
from joj.tests import TestController
from joj.utils.constants import *
from joj.model import session_scope, Session, Parame... | NERC-CEH/jules-jasmin | majic/joj/tests/functional/test_model_run_output.py | test_model_run_output.py | py | 14,590 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "joj.tests.TestController",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "joj.services.model_run_service.ModelRunService",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "joj.model.session_scope",
"line_number": 30,
"usage_type": "call"... |
69878776639 | from rest_framework import serializers
from collections.abc import Mapping, Iterable
from .models import Genre, Book
class GenreOverviewSerializer(serializers.ModelSerializer):
book_count = serializers.SerializerMethodField()
class Meta:
model = Genre
fields = ['id', 'name', 'book_c... | leeuwenjim/boeken_app | biblio_app/api/serializers_genre.py | serializers_genre.py | py | 1,956 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.SerializerMethodField",
"line_number": 7,... |
33886094067 | from tkinter import *
from tkinter import ttk
from random import randint
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
root = Tk()
root.title("Operating System GUI")
#root.iconbitmap('python.ico')
root.geometry('500x550')
def hide(widget):
# This will remove the w... | MohamedAhmed412000/Scheduling-Algorithm | OSGUI_v1.py | OSGUI_v1.py | py | 22,204 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tkinter.ttk.Labelframe",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "random.randint",
... |
2642973361 | import calendar
import logging
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import Sum
from tech.helpers.helpers import getDateTimeFormat, roundFifteen
from tech.models.choices import JobStatus, JobLevel, PartLocation
from tech.models.technician import Technici... | penguinpower80/isqa8210_assignment3 | tech/models/job.py | job.py | py | 2,871 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.db.models.Model",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 15,
"usage_type": "call"
},
{
"api_name... |
1825027759 | import torch
from torch import nn
from torch.nn.utils.rnn import pack_padded_sequence
import torch.nn.functional as F
from downstream.models.tdnnf import get_tdnnf_model
class TDNNFClassifier(nn.Module):
"""
This class defines TDNNF architecture
Args:
input_dim: Dimension for the inpu... | idiap/apam | src/e2e/downstream/model.py | model.py | py | 1,068 | python | en | code | 14 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "downstream.models.tdnnf.get_tdnnf_model",
"line_number": 26,
"usage_type": "call"
}
] |
30639008483 | import discord
from discord import ApplicationContext
from discord.commands import slash_command
from discord.ext import commands
from ..archive import cfg
from ..archive import embed_builder
class Portal(commands.Cog):
def __init__(self, bot):
self.bot = bot
@slash_command(name="gtool")
async ... | sushi-chaaaan/sakamata-bot | archive/portal.py | portal.py | py | 1,514 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "discord.ApplicationContext",
"line_number": 16,
"usage_type": "name"
},
{
"api... |
20260993866 | import numpy as np
import esutil
import time
import warnings
import matplotlib.pyplot as plt
from .fgcmUtilities import objFlagDict
from .fgcmUtilities import obsFlagDict
from .fgcmUtilities import getMemoryString
from .sharedNumpyMemManager import SharedNumpyMemManager as snmm
class FgcmStars(object):
"""
... | erykoff/fgcm | fgcm/fgcmStars.py | fgcmStars.py | py | 95,512 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "numpy.log",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "numpy.radians",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number":... |
13416980145 | from django.urls import path
from . import views
app_name = 'polls'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('<int:pk>/', views.DetailView.as_view(), name='detail'),
# detailViewの場合pkの数字でレコードの特定がされる。だからこれがデフォルト。intは正規表現でintじゃないと受け付けない。https://qiita.com/dai-takahashi/items/7d... | arara-ichihara/git_test | polls/urls.py | urls.py | py | 657 | python | ja | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
13872281525 | import os
from random import randint
import requests
from dotenv import load_dotenv
load_dotenv()
API_KEY = os.getenv("API_KEY")
BASE_URL = "https://api.pathfinder2.fr/v1/pf2/"
CURR_USER_KEY = "curr_user"
from flask import Flask, render_template, request, flash, redirect, session, g, jsonify
from sqlalch... | Bbullinger/pf2e_npc_generator | app.py | app.py | py | 5,080 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "flask.g.user",
"line_num... |
42882277209 | from argparse import Namespace
import random
from aiohttp.web import Application
from prometheus_client import Metric
from . import (
MetricConfig,
PrometheusExporterScript,
)
class SampleScript(PrometheusExporterScript):
"""A sample exporter."""
name = "prometheus-aioexporter-sample"
default_p... | albertodonato/prometheus-aioexporter | prometheus_aioexporter/sample.py | sample.py | py | 1,285 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "argparse.Namespace",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "aiohttp.web.Application",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "prometheus_client.Metric",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "r... |
21381432617 | import scrapy
class MyspiderSpider(scrapy.Spider):
name = 'MySpider'
start_urls = ['https://www.net-a-porter.com/en-in/shop/clothing/tops']
def parse(self, response):
self.logger.info('A response from %s just arrived!', response.url)
for container in response.css("div.ProductListW... | ShailendraKushwaha/BasicScrapy | netaproper/netaproper/spiders/MySpider.py | MySpider.py | py | 1,182 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "scrapy.Spider",
"line_number": 4,
"usage_type": "attribute"
}
] |
37583813767 | """Write experimental results data to output files."""
# System
import logging
import os
from collections import namedtuple
from functools import reduce
# Third party
from pyrsistent import v, pmap
from cytoolz.itertoolz import interleave
from more_itertools import chunked
import numpy as np
ResultsDescriptor = nam... | xanderdunn/options | imrl/utils/results_writer.py | results_writer.py | py | 2,834 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "collections.namedtuple",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.INFO",... |
74140895680 | import pygame
from pygame import Vector2
class Interactable:
def __init__(self, pos: tuple, size: tuple):
self.rect: pygame.Rect = pygame.Rect(pos, size)
self.is_hovering_over: bool = False
self.is_clicked: bool = False
self._was_clicked: bool = False
self.is_held: bool ... | XFajk/spongija | utils/interactable.py | interactable.py | py | 1,329 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pygame.Rect",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.Surface",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.rect",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
... |
21123052783 | from tictactoe.Game import *
import random
import torch as t
import pandas as pd
x_size = 9
a1_size = 81
a2_size = 45
a3_size = 9
model = t.nn.Sequential(
t.nn.Linear(x_size, a1_size),
t.nn.ReLU(),
t.nn.Linear(a1_size, a2_size),
t.nn.ReLU(),
t.nn.Linear(a2_size, a3_size))
criterion = t.nn.MSELoss... | pyoungkangkim/AI-games | tictactoe/q_reinforcement_learning.py | q_reinforcement_learning.py | py | 3,156 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.nn.Sequential",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
9009439402 | from tabulate import tabulate
from rrg.models import Contract
from rrg.models import Invoice
from rrg.models import Iitem
def remaining_payroll(session, employee):
"""
gather sherees remaining payroll with invoice and invoice items lists to
use to exclude from deletion
"""
scontract = \
... | fogcitymarathoner/sherees-commissions | rrg/payroll.py | payroll.py | py | 1,883 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rrg.models.Contract",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "rrg.models.Contract.employee",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "rrg.models.Contract",
"line_number": 16,
"usage_type": "name"
},
{
"api... |
74537516158 | #!/usr/bin/env python3
# coding: utf-8
import argparse
from collections import defaultdict, Counter
# initial parameters
parser = argparse.ArgumentParser()
parser.add_argument('--semantic_concept', choices=('diminutives', 'social-gender'))
args = parser.parse_args()
# load data
google_data = defaultd... | iml-r/macro-competition | 2022-10-macro-competition/03-annotation/03-1-merged/merge_and_select.py | merge_and_select.py | py | 5,956 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name":... |
22954991237 | # NOTE: Use your the virtual machine to execute this code and
# keep the memory allocated for the machine to 2GB!
import time
import numpy
from sklearn.neighbors import KNeighborsRegressor
# load data
print("Loading training data ...")
data_train = numpy.genfromtxt("data/train.csv", comments="#", delimiter=",")... | MartinMetaksov/diku.LSDA | teacher/HW1_Solution/nn_h5.py | nn_h5.py | py | 1,990 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KNeighborsRegressor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 22,
"usage_type": "call"
},
{
"api_name"... |
3993073601 | import datetime
import platform
import socket
import re
import uuid
import psutil
import logging
import matplotlib.pyplot as plt
from datetime import date
def base36encode(number):
base36, sign, alphabet = str(), str(), '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
if number < 0:
sign = '-'
number =... | D3NKYT0/conecta | resources/utils.py | utils.py | py | 2,977 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "platform.system",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "platform... |
29399141710 | import numpy as np
from scipy import optimize
from scipy.spatial.distance import pdist, squareform
try:
from sklearn.preprocessing import OrdinalEncoder
UseOrdinalEncoder = True
except ImportError:
UseOrdinalEncoder = False
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert... | scikit-optimize/scikit-optimize | skopt/learning/gaussian_process/tests/test_kernels.py | test_kernels.py | py | 7,406 | python | en | code | 2,684 | github-code | 97 | [
{
"api_name": "numpy.arange",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "skopt.learning.gaussian_process.kernels.RBF",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "skopt.learning.gaussian_process.kernels.Matern",
"line_number": 29,
"usage_type"... |
16528430596 | # -*- coding: utf-8 -*-
import http
from http.server import BaseHTTPRequestHandler
from werkzeug import urls
import os
import json
import traceback
from BLD_Parser import parse_solve
from DB_LOGS import add_log_of_request
def init_env_var(dict_params):
os.environ["SMART_CUBE"] = "True" if dict_params["SMART_CUBE... | RotoHands/3BLD_analyzer_HTTP_Server | http_server.py | http_server.py | py | 3,427 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"lin... |
28571921022 | #! /usr/bin/env python3
"""Cluster amplicon sequences using distribution patterns across samples to
inform OTU generation.
"""
from __future__ import print_function, division
__author__ = 'Christopher Thornton'
__license__ = 'GPLv3'
__date__ = '2019-10-08' #project initiation: 2014-07-23
__status__ = "Beta"
__versi... | cnthornton/envclust | envclust/envcluster.py | envcluster.py | py | 12,378 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.getcwd",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.access",
"line_number": ... |
13459748503 | import os
import queue
import cv2
import numpy as np
from PIL import Image, ImageDraw
import csv
import sys
import statistics
def draw_text(img, text,
font=cv2.FONT_HERSHEY_PLAIN,
pos=(0, 0),
font_scale=2,
font_thickness=2,
text_color=(0, 255, 0),
text_color_... | graySquirrel/courtPlusByteTrack | show_trajectory_bounce.py | show_trajectory_bounce.py | py | 9,164 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.FONT_HERSHEY_PLAIN",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cv2.getTextSize",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.putText... |
30929802819 | import json
import random
from fluiddb.common import error, util
from fluiddb.common.defaults import contentTypeForPrimitiveJSON
def _sendBody(request, body, contentType):
request.setHeader('content-type', contentType)
request.setHeader('content-length', str(len(body)))
request.write(body)
request.fi... | fluidinfo/fluiddb | fluiddb/web/util.py | util.py | py | 1,575 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "fluiddb.common.error.InternalError",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "fluiddb.common.error",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "fluiddb.common.util.strToBool",
"line_number": 32,
"usage_type": "call"
},
{
... |
34800121020 | from abc import ABC
from base import BaseDataLoader
from torch.utils.data import Dataset, IterableDataset
import pandas as pd
import os
import torch
from pathlib import Path
import glob
import random
class ScoreDataSet(Dataset):
def __init__(self, file_path, callback_func=None):
self.data = pd.read_csv(fi... | wudangqibujie/jay_template | dataset/data_loaders.py | data_loaders.py | py | 4,233 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "base.BaseDataLoader",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "torch.ut... |
25978575367 | #!/usr/bin/env python
# encoding: utf-8
# Date: 2023/02/11
# file: _datetime.py
# Email:
# Author: rakiwine
# epoch 时间开始的点,取决于平台
# UTC 协调世界时(Coordinated Universal Time),格林威治标准时间(GMT)
# DST 夏令时(Daylight Saving Time)
from pytz import utc, timezone
import datetime
from datetime import timezone as _timezone
# 猜测第三方插件原理 ... | rakiwine/Markdown | Study/python/python2/F 常用标准库/_datetime.py | _datetime.py | py | 10,762 | python | zh | code | 0 | github-code | 97 | [
{
"api_name": "pytz.timezone",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytz.timezone",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.timezone",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
... |
74891686078 | import setuptools
from PhotoCuration import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="PhotoCuration",
version=__version__,
author="Avi Alkalay",
author_email="avibrazil@gmail.com",
description="Extracts images and videos from iOS Photo ... | avibrazil/PhotoCuration | setup.py | setup.py | py | 1,754 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "setuptools.setup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PhotoCuration.__version__",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "setuptools.find_packages",
"line_number": 17,
"usage_type": "call"
}
] |
4296903682 | import vaex
import os
import pprint
# Define file paths
requests_csv = "requests.csv"
requests_hdf5 = requests_csv + '.hdf5'
domains_csv = "domains.csv"
domains_hdf5 = domains_csv + '.hdf5'
export_csv_folder = "domains2022_2023.csv"
# Load the requests HDF5 if it exists, if not, convert CSV to HDF5 for requests to ... | DuarteBarbosaPT/googleTransparencyReportDataReader | Vaex_Domains_Requests.py | Vaex_Domains_Requests.py | py | 1,767 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.isfile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "vaex.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "vaex.from_csv",
"line_numbe... |
75030864639 | import unittest
import twodlearn as tdl
import tensorflow as tf
import tensorflow.keras.layers as tf_layers
import functools
import operator
@tdl.core.create_init_docstring
class TransposeLayer(tdl.core.Layer):
@tdl.core.SubmodelInit
def conv(self, units, kernels, strides, padding='same'):
return tf_l... | danmar3/twodlearn | twodlearn/tests/stacked_test.py | stacked_test.py | py | 1,403 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "twodlearn.core",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.layers.Conv2DTranspose",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers",
"line_number": 13,
"usage_type": "name"
},
{
... |
23524757371 | import numpy as np
from itertools import product
import numbers
from numpy.lib.stride_tricks import as_strided
import matplotlib.pyplot as plt
__authors__ = "Xiaogang Yang"
__copyright__ = "Copyright (c) 2018, Argonne National Laboratory"
__version__ = "0.3.0"
__docformat__ = "restructuredtext en"
def nor_data(img):... | tomography/xlearn | xlearn/utils.py | utils.py | py | 13,520 | python | en | code | 37 | github-code | 97 | [
{
"api_name": "numpy.mean",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 35,
... |
3940511002 | from webthing import (SingleThing, Property, Thing, Value, WebThingServer)
import logging
import tornado.ioloop
from datetime import datetime, timedelta
from smartmeter_webthing.meter import Meter
class SmartMeterThing(Thing):
# regarding capabilities refer https://iot.mozilla.org/schemas
# there is also an... | grro/smartmeter_webthing | smartmeter_webthing/meter_webthing.py | meter_webthing.py | py | 5,903 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "webthing.Thing",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "smartmeter_webthing.meter.Meter",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "webthing.Thing.__init__",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": ... |
13291206554 | #! /usr/bin/python
#coding:utf-8
from pages.basePage import Page
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import sys
sys.path.append('.')
from common import param
import datetime
im... | zhouxin19911219/autoSjxt | pages/labelPage.py | labelPage.py | py | 54,121 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pages.basePage.Page",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.... |
7525600437 | #インポート処理
import matplotlib.pyplot as plt
import pandas
import datetime
#変数の初期化
l_warm = []
l_hot = []
l_too_hot = []
year = []
l_warm_high=[]
l_hot_high =[]
l_too_hot_high =[]
l_h_t_h = []
#csvデータを変数に格納
data = pandas.read_csv('C:\\Users\owner\Desktop\python_lesson\data_port_f\\weather\\1990-2018.csv',index_col='date', ... | masahiro54/python_TEST_masahiro | Discomfort_index.py | Discomfort_index.py | py | 3,212 | python | ja | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
14738332406 | import sys
from pymongo import MongoClient
#connect to MongoDB cluster
client = MongoClient("mongodb+srv://m001-Brian-Quinn:m001-mongodb-basics@m001-pbvpm.mongodb.net/test?retryWrites=true&w=majority")
import time
import json
import urllib.request, urllib.parse, urllib.error
from datetime import datetime
def ... | bquinn1838/Earthquake-Analysis | downloader.py | downloader.py | py | 2,675 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcfromtimestamp",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "name"
},
{
"api_name"... |
70774956480 | # -*- coding: utf-8 -*-
"""
Service parameter based filtering widget
"""
# .. note:: This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any lat... | INGV/qquake | qquake/gui/filter_parameter_widget.py | filter_parameter_widget.py | py | 44,175 | python | en | code | 8 | github-code | 97 | [
{
"api_name": "qgis.PyQt.uic.loadUiType",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "qgis.PyQt.uic",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "qquake.gui.gui_utils.GuiUtils.get_ui_file_path",
"line_number": 48,
"usage_type": "call"
},
{
... |
71218954239 | from selene.api import *
from selene.driver import SeleneDriver
from selenium.webdriver import Chrome
from selenium.webdriver.support.select import Select
def test_blaze():
config.browser_name = 'chrome'
browser.open_url('http://www.blazedemo.com/')
Select(s(by.name('fromPort'))).select_by_visible_text('B... | Brombult/Test_Automation | selene_practice/test_blaze_selene.py | test_blaze_selene.py | py | 1,400 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "selenium.webdriver.support.select.Select",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.support.select.Select",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selene.driver.SeleneDriver.wrap",
"line_number": 22,
"u... |
30990379009 | #!/usr/bin/env python3
import sys
import time
from typing import List
import requests
import datetime
from PyQt5 import QtWidgets
from PyQt5 import QtCore
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap
from gui.py.setting_window import Ui_Dialog
from gui.py.window import Ui_MainWindow
from gui.py.task_bo... | Llyfrs/torn-check-list | torn-task-list.py | torn-task-list.py | py | 18,238 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "PyQt5.QtCore.QSettings",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "PyQt... |
1486668833 | from datetime import datetime
# UI Libraries
import tkinter as tk
from tkinter import ttk
# Project Modules
from parsing.scoreboards import ScoreboardDatabase
class Scoreboard(ttk.Frame):
"""Frame containing a Treeview showing Scoreboard data"""
HEADINGS = {
"#0": "Name",
"kills": "Kills",
... | RedFantom/gsf-parser | widgets/results/scoreboard.py | scoreboard.py | py | 4,853 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tkinter.ttk.Frame",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tkinter.ttk",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "tkinter.Widget",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "tkinter.ttk.Fram... |
16838870046 | import pytest
import tasks
from tasks import Task
@pytest.fixture(autouse = True)
def init_tasks_db(tmpdir):
"""Connect to db before testing, disconnect after"""
tasks.start_tasks_db(str(tmpdir), 'tiny')
# Yield and allow testing to happend
yield
# Teardown and stop db instance
tasks.stop_... | esyywar/pytest-okken | ch2/tasks_proj/tests/func/test_unique_id_1.py | test_unique_id_1.py | py | 878 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tasks.start_tasks_db",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tasks.stop_tasks_db",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tasks.unique_id... |
74748500799 | # SPDX-License-Identifier: MIT
from __future__ import annotations
import json
import logging
import sys
import urllib.parse
from ...util import requests
from . import cli
logger = logging.getLogger(__name__)
class ClientCve:
server: str
@staticmethod
@cli.register(
'cve',
arguments=[... | gardenlinux/glvd | src/glvd/cli/client/cve.py | cve.py | py | 1,287 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO... |
35345935466 | #!/usr/bin/python
import json
import re
from imgurpython import ImgurClient
from imgurpython.helpers.error import ImgurClientRateLimitError
from shared import load_secrets
def get_imgur_client():
# visit https://api.imgur.com/oauth2/authorize?client_id=77fbcca7c596528&response_type=token
# to regenerate access to... | thinkingalaud/fooddays | scripts/upload_imgur.py | upload_imgur.py | py | 1,755 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "shared.load_secrets",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "imgurpython.ImgurClient",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "imgurpython.he... |
16133315332 | # Lint as: python3
"""Tests for epi_forecast_stat_mech.statistical_models.network_models.py."""
from absl.testing import absltest
from absl.testing import parameterized
from epi_forecast_stat_mech.statistical_models import network_models
from epi_forecast_stat_mech.statistical_models import tree_util
import jax
import... | HopkinsIDD/EpiForecastStatMech | epi_forecast_stat_mech/statistical_models/network_models_test.py | network_models_test.py | py | 3,030 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "jax.config.config.parse_flags_with_absl",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "jax.config.config",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "absl.testing.parameterized.TestCase",
"line_number": 15,
"usage_type": "attribu... |
72110752318 | import os
os.environ['SIDEKIT'] = 'theano=false,libsvm=false,mpi=false'
from torch.autograd import Variable
from torch import optim
import pyro.optim as pyro_optim
import logging
import torch
from torch import nn
import numpy
from torch.utils.data import DataLoader
from torchvision import transforms
# from torch.optim.... | bsxfan/meta-embeddings | code/Andreas-Themos/utils_train.py | utils_train.py | py | 20,242 | python | en | code | 23 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "torch.autograd.Variable",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "Config.ConfigNetwork.train_with_softmax",
"line_number": 35,
"usage_type": "attribute"
},
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.