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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7436904572 | """Module containing class `Archive`."""
from collections import namedtuple
from zoneinfo import ZoneInfo
import datetime
import os.path
import sqlite3 as sqlite
from vesper.archive.clip_class import ClipClass
from vesper.archive.detector import Detector
from vesper.archive.recording import Recording
from vesper.ar... | HaroldMills/Vesper | vesper/archive/archive.py | archive.py | py | 35,925 | python | en | code | 47 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "... |
2987496688 | from user_profile.models import KarmaUser
from user_profile.models import UserStatistics
from item.models import Item
from bookmark.models import Bookmark
import nose.tools as nt
class TestBookmark(object):
def setup(self):
self.user = KarmaUser.objects.create(username='a')
self.item = Item.objects... | sameenjalal/mavenize-beta | mavenize/apps/bookmark/tests.py | tests.py | py | 1,351 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "user_profile.models.KarmaUser.objects.create",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "user_profile.models.KarmaUser.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "user_profile.models.KarmaUser",
"line_number": 9,
"... |
4156175262 | from app.Dashserver import DashServer
from dash.dependencies import Input, State, Output
import dash_html_components as html
import dash
import dash_core_components as dcc
import pandas as pd
from bisect import bisect_left
from datetime import datetime
from copy import deepcopy
import plotly.graph_objs as go
from flask... | pranoti-d/vizabi | app/MyDashApps/dashapp0.py | dashapp0.py | py | 2,829 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.Dashserver.DashServer.css.append_css",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "app.Dashserver.DashServer.css",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "app.Dashserver.DashServer",
"line_number": 20,
"usage_type": ... |
10629956155 | from collections import Counter
import pytest
import nengo
from nengo.utils.testing import ThreadedAssertion
def test_basic_context():
# We must give the two Networks different labels because object comparison
# is done using identifiers that stem from the top-level Network label.
model1 = nengo.Network... | Kanaderu/Neural-Networks | nengo-master/nengo/tests/test_network.py | test_network.py | py | 4,888 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nengo.Network",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nengo.Network",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nengo.Ensemble",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "nengo.Node",
"line_num... |
4132914870 | import pandas as pd
import collections
import json
import math
import random
import numpy as np
import networkx as nx
from sklearn.neighbors import NearestNeighbors
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
import argparse
import os
import sys
from stimuli import *
sn... | papachristoumarios/financial-contagion | safegraph_dataloader.py | safegraph_dataloader.py | py | 17,170 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "seaborn.set_theme",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array"... |
6453037180 | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 9 12:30:00 2018
Group 4
@authors: Noemie DELOEUVRE, Morgan SEGUELA, Aurelien PELAT
V 1.5
"""
import datetime as date
from bs4 import BeautifulSoup
import requests
import re
import g4_utils_v40 as utils
import time
def collect_url_themes(url_rss_figaro):
"""Create a ... | ProjetSID2018/Groupe4_Robot | Figaro/g4_lefigaro_v15.py | g4_lefigaro_v15.py | py | 5,338 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "g4_utils_v40.recovery_flux_url_rss",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "g4_... |
38800948921 | import os
from enum import Enum
ROOT_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__), '..'))
class OpenAIModel(str, Enum):
GPT4 = "gpt-4"
GPT35 = "gpt-3.5-turbo"
GPT35OLD = "gpt-3.5-turbo-0301"
HISTORY_CLEARED = 'HISTORY_CLEARED'
CLEAR_HISTORY = 'CLEAR_HISTORY'
| xchen-wizard/dialog-agent-service-test | dialog_agent_service/constants.py | constants.py | py | 294 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.realpath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_n... |
43586238297 | from bs4 import BeautifulSoup
import re
import urllib.request, urllib.error
import xlwt
import sqlite3
def main():
baseurl = "https://movie.douban.com/top250?start="
# 爬取网页
datalist = getData(baseurl)
savepath = "doubanmovie250.xls"
# 保存数据
saveData(datalist, savepath)
# askURL("https://m... | Lenezy/DataSpider | Spider.py | Spider.py | py | 5,026 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "re.S",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 25,
... |
32467844149 | # Created by Marios Paraskevas on November 2020
# Import Modules
import os
import datetime
import pandas as pd
from pathlib import Path
from twilio.rest import Client
from dotenv import load_dotenv
# Loading Environment Variables i.e. Twilio_account_sid and Twilio_auth_token
load_dotenv()
# Opening the excel warehous... | mariospar/inspector | main.py | main.py | py | 2,485 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
18781915076 | from django.urls import path
from .views import LaboratorioCreateView, LaboratorioUpdateView, LaboratorioDeleteView
from . import views
from django.contrib.auth.decorators import login_required
urlpatterns = [
path('', login_required(views.laboratorio_List), name='laboratorio.index'),
path('laboratorio/', logi... | tilitpeg/comunidade_litpeg | laboratorio/urls.py | urls.py | py | 1,641 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.laboratorio_List",
"line_number": 7,
"usage_type": "attribute"
},
... |
38691960769 | import numpy as np
import matplotlib.pyplot as plt
RESOLUTION = 300
LINSPACE_MAX = 1.5
NUM_CONTOURS = 40
LINE_COLOR = "black"
VECTOR_COLOR = "#B85450"
LINE_WIDTH = 0.7
VECTOR_DOT_SIZE = 0.015
THETA_TRUE_DEGREES = 30
LAMBDA_1 = 0.5
LAMBDA_2 = 1.5
theta_true_radians = THETA_TRUE_DEGREES * 2 * 3.14159 / 360
y_true = ... | matill/Ship-detection | plot_and_analysis_scripts/adv_loss_surface.py | adv_loss_surface.py | py | 3,105 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 2... |
10651928082 | from django.contrib import admin
from django.conf.urls import include, static, handler404
from .views import signup, toggle_fav_movies, faved_movies
from django.urls import path
from . import views
from django.contrib.auth import views as auth_views
from django.views.generic import TemplateView
from app.views import ha... | taibon38/marble | app/urls.py | urls.py | py | 4,397 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.urls.handler404",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "app.views.handle_page_not_found",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
"line_number": 14,
"usage_type": "call"
},
{
"api_... |
9764682690 | from django.urls import path, re_path
from . import views
urlpatterns = [
path(r'', views.index, name='index'),
path(r'about/', views.about, name='about'),
path(r'training/', views.training, name='training'),
path(r'faq/', views.faq, name='faq'),
path(r'registration/', views.register, name='re... | avankit27/Intraview | website/intra/url.py | url.py | py | 385 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"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",
... |
3901631318 | '''
Created on May 5, 2016
@author: odraudek99
'''
import logging
import tweepy
import ConfigParser
import smtplib
import sys
from datetime import datetime, timedelta
topic = sys.argv[1]
query = sys.argv[2]
logging.basicConfig(filename=str('log_bot_topic_'+topic+'.log'),level=logging.INFO)
logging.info('Init: bot_... | odraudek99/bots-twitter-python | bot_twitter_topics.py | bot_twitter_topics.py | py | 2,094 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"l... |
18814894525 | """
Inventory represents a collection of cars that a shop might keep.
"""
from CarShop.car import Car
from typing import Any, Callable
import operator
class Inventory:
def __init__(self) -> None:
"""
Creates a new inventory object.
"""
self.inventory: list[Car] = []
sel... | TyDk25/Car-Inventory-Manager | CarShop/inventory.py | inventory.py | py | 2,860 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "CarShop.car.Car",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "CarShop.car.Car",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "CarShop.car.Car",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"lin... |
18846111861 | from typing import Any
import pytorch_lightning as pl
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from data.cifar10 import SplitSimCIFAR10, simclr_transform, CIFAR10, general_transform
from model.custom_resnet import model_d... | parksang21/openset-study | pl_module/sup_simclr.py | sup_simclr.py | py | 7,690 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pytorch_lightning.LightningModule",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "model.resnet_big.SupConResNet",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "losses.contrastive.SupConLoss",
"line_number": 39,
"usage_type": "ca... |
9403765432 | from sklearn import *
import comparison_generation
import io_manager
import pandas as pd
import traceback
import scipy
def perform_ica(data):
new_training_features = None
new_test_features = None
try:
model = decomposition.FastICA()
best_name = comparison_generation.create_attribute_stora... | Spy7Dragon/Unsupervised-Learning-and-Dimensionality-Reduction | ica.py | ica.py | py | 2,705 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "comparison_generation.create_attribute_storage_name",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "io_manager.load_best",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "comparison_generation.update_model",
"line_number": 17,
"usage_t... |
70373501628 | import math
import torch
from torch import Tensor
from torch.optim.optimizer import Optimizer
from typing import List, Optional
class HydroOptimizer(Optimizer):
"""
Optimizer that implements the μP scaling.
"""
def __init__(self, params, lr=1e-3, weight_decay=0.0, **kwargs):
if not lr > 0:
... | S-Lab-System-Group/Hydro | hydro/optim/optimizer.py | optimizer.py | py | 1,224 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "torch.optim.optimizer.Optimizer",
"line_number": 8,
"usage_type": "name"
}
] |
32434528503 | # -*- coding: utf-8 -*-
import json
import unittest
import mock
from django import test
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.forms import ValidationError
from django.test import Client
from uuslug import slugify
from fields import MultipleEmailField
f... | senpl/Nitrate | tcms/testcases/tests.py | tests.py | py | 26,154 | python | en | code | null | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "fields.MultipleEmailField",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "django.forms.ValidationError",
"line_number": 74,
"usage_type": "argument"
},
{
... |
4755687537 | #!python3
#coding=utf-8
#This program take useful data in database to update pmi data
#==================================================================
#
#Usage:
# pmi_learn.py [option] [parameter]
#
# -l
# list current pmi data
#
# -h, --help
# display this help
#
#==============================================... | lksj51790q/emotion-classifier | pmi_learn.py | pmi_learn.py | py | 6,288 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "logging.Form... |
29587706946 | import linecache
from torchvision.transforms import transforms
import random
# 导入自定义的数据加载包
import linecache
import random
from scipy.special import expit
import numpy as np
from PIL import Image
import operator
class DataLoader:
images = []
labels = []
labels_onehot = []
# 现路径为本机上的路径,若加载不了图片,可考虑路径问题
... | xiaoshecode/lfw_cnn | lfw_loader.py | lfw_loader.py | py | 4,629 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.transforms.PILToTensor",
"line_number": 40,
"usage_type": "call"
},
{
"api_name":... |
22451825632 | from django.urls import path, include
from .views import (
PostListView,
PostDetailView,
)
from . import views
urlpatterns=[
path('', PostListView.as_view(), name='Hotels'),
path('<int:pk>/', PostDetailView.as_view(), name='Hotel1'),
path('<int:hotel_id>', views.add_review, name='add_review')
]
| fbbenod/Touristy-Information-System | myapp/hotels/urls.py | urls.py | py | 318 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.PostListView.as_view",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.PostListView",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django... |
19372706263 | '''
Calculates Region of Interest(ROI) by receiving points from mouse event and transform prespective so that
we can have top view of scene or ROI. This top view or bird eye view has the property that points are
distributed uniformally horizontally and vertically(scale for horizontal and vertical direction will be
dif... | theCR7/Covid-Reconnoiter | Social_Distancing_with_Bird_eye/start.py | start.py | py | 19,101 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 71,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FPS",
"line_number": 72,
"usage_type": "attribute"
},
{
... |
441984656 | import os
import tensorflow as tf
config=tf.ConfigProto()
config.gpu_options.allow_growth=True
config.allow_soft_placement=True
import matplotlib
matplotlib.use('Agg')
import numpy as np
# to make directories
import pathlib
import sys
sys.path.append('../')
from utils import *
import argparse
parser = argparse.A... | krishnabits001/domain_specific_cl | train_model/pretr_encoder_global_contrastive_loss.py | pretr_encoder_global_contrastive_loss.py | py | 16,633 | python | en | code | 166 | github-code | 6 | [
{
"api_name": "tensorflow.ConfigProto",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"l... |
73338786427 | from __future__ import annotations
import sys
import typing
from typing import Any, Callable, cast, Optional, TypeVar, Union
from typing_extensions import get_args, get_origin, ParamSpec, Protocol, TypeGuard
__all__ = [
"enforce_subclass_if_possible",
"extract_optional_value",
"is_optional",
"optiona... | Finistere/antidote | src/antidote/_internal/typing.py | typing.py | py | 2,832 | python | en | code | 88 | github-code | 6 | [
{
"api_name": "typing.TypeVar",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "typing_extensions.ParamSpec",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "typing.Type... |
32502720115 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#import os
#os.environ['CUDA_VISIBLE_DEVICES'] = '6,7,8,9' ####
import logging
import time
from os.path import exists, join, split
from torch import nn
import torch.backends.cudnn as cudnn
import torch.optim as optim
from torchvision import datasets, transforms
from torch.... | Mirlongue/Deep-Unsupervised-Part-Whole-Relational-Visual-Saliency | DUPnet/Code/DataClass.py | DataClass.py | py | 8,344 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.sum",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 91,
... |
11335865893 | import argparse
import os
from pathlib import Path
import logging
description = """description: assement.py combine checkm barnnap prodgial to assess metagenomics assembly"""
usage = """ python assement.py -i input -o output -b bins
eg:python assesment.py -i test_data/test.fa -o test -b test_data/bins/
=====... | zzsunday/asmetagenome-assesment | assesment.py | assesment.py | py | 4,529 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path.cwd",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",... |
34181922912 |
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from scipy.fftpack import rfft, rfftfreq
def T1_model(x, tau, amp, offset):
'''
Returns the amplitude value of a T1 qubit measurement at a given time
##################
INPUTS:
x (float or array of floats): t... | MRitter95/Kollar-Lab | utility/FitT.py | FitT.py | py | 6,695 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.exp",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
... |
70103615549 | from handle_api import account_info, tickers_list
from modelling import delta_price
import time
from handle_websocket_async import best_price_async
import asyncio
market = 'BTC'
gain = 1.1
Ke = 0.5
k = 300
# Vp =
best_price = {}
def trading(Vp, Ke=0.5, gain=1.1, market='BTC', k=300):
# get tickers list (t) for ... | cthadeufaria/passport | investing/trading.py | trading.py | py | 1,375 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "handle_api.tickers_list",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "handle_api.account_info",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "modelling.delta_price",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": ... |
19024270632 | from functools import partial
import scipy.optimize
from .base_labeling import BaseLabeling
from pyannote.database import get_annotated
from pyannote.audio.features import Pretrained
from pyannote.audio.pipeline import (
SpeechActivityDetection as SpeechActivityDetectionPipeline,
)
def validate_helper_func(curren... | DanRuta/xva-trainer | lib/_dev/pyannote/audio/applications/speech_detection.py | speech_detection.py | py | 2,796 | python | en | code | 78 | github-code | 6 | [
{
"api_name": "pyannote.database.get_annotated",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "base_labeling.BaseLabeling",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pyannote.audio.pipeline.SpeechActivityDetection",
"line_number": 20,
"usage_ty... |
34993132829 | import pygame, sys, time, random, os, pyautogui, threading
from pygame.locals import *
from tkinter import *
from tkinter import messagebox
pygame.init()
pygame.font.init()
pygame.display.set_caption('SnakeGame')
white = (255, 255, 255)
position = [ [ 80, 80 ] ]
past_position = [ [ 80, 80 ] ]
randx = ran... | hoseong0204/SnakeGame | SnakeGame.py | SnakeGame.py | py | 18,222 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.font.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_caption... |
34300083963 | import csv
import json
import pandas as pd
def cvs2json(path):
with open(path+".csv",'r',encoding="UTF-8-sig") as f:
reader = csv.reader(f)
fieldnames = next(reader)#获取数据的第一列,作为后续要转为字典的键名 生成器,next方法获取
# print(fieldnames)
csv_reader = csv.DictReader(f,fieldnames=fieldnames) ... | lilili-icon/VCbyEVT | util/cvs2json.py | cvs2json.py | py | 1,104 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_numb... |
7240921926 | from flask import jsonify, g, url_for, current_app, request
from .. import db
from .errors import forbidden
from . import api
from .decorators import permission_required
from ..models import Post, Permission
# This function uses the to_json method from the models.py for Post, and will
# return a jsonified ... | jerrodheiser/Foreverreference | app/api/posts.py | posts.py | py | 2,886 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.request.args.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "models.P... |
23805635384 | from django.shortcuts import render, redirect, get_list_or_404
from django.http import HttpResponse
from . import forms, models
from django.conf import settings
import os
import shutil
from . import process
# Create your views here.
def index(request):
# if not request.session['result']:
# request.session[... | JaiminSagar/Dog_Breed_Prediction_Website | dog_breed_detect_project/dog_breed_app/views.py | views.py | py | 2,530 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.MEDIA_ROOT",
"line_number": 31,
"usage_type": "attribute"
},
{... |
71363608828 | import os
import pickle
from PyQt5 import QtCore, uic
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout
from info_frame import Frame_Info
from models.assignment import Info, Test
from path import OPENED_INFO_DATA, OPENED_TEST_DATA
from test_frame import Frame_Test
TEST_PA... | hoangm960/Astraea | test_info.py | test_info.py | py | 6,246 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "PyQt... |
71969651069 | import string
import random
import time
import logging
import json
import os
import re
import tarfile
import tempfile
import warnings
import yaml
import zipfile
from datetime import datetime
from typing import Mapping, Callable
import kfp
import kfp_server_api
from kfp.compiler import compiler
from kfp.compiler._k8s_... | kubeflow/kfp-tekton-backend | sdk/python/kfp/_client.py | _client.py | py | 31,076 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "re.sub",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 72,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_num... |
6117892730 | import os
import sys
import argparse
import pandas as pd
def parse_args():
""" Load command line args """
parser = argparse.ArgumentParser()
parser.add_argument('--All_signals', metavar="<str>", help=("All input signals"), type=str, required=True)
#parser.add_argument('--Celltype', metavar="<str>", he... | xyg123/SNP_enrich_preprocess | scripts/CHEERS_preprocessing/Average_signal_by_celltype.py | Average_signal_by_celltype.py | py | 3,701 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pandas.concat"... |
72965735549 | import time
import logging
import tqdm
import os
import itertools
import numpy as np
import weakref
from collections import OrderedDict
from typing import Dict, List, Optional
from omegaconf import OmegaConf
import torch
from torch.nn.parallel import DistributedDataParallel
from pytorchpoints.config import kfg
from p... | ZhaofanQiu/SPE-Net | pytorchpoints/engine/defaults.py | defaults.py | py | 12,086 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "pytorchpoints.utils.comm.is_main_process",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pytorchpoints.utils.comm",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "pytorchpoints.utils.file_io.PathManager.mkdirs",
"line_number": 48,
"us... |
30477007495 | from django.contrib import admin
from .models import Venue,Event,MyClubUser
admin.site.register (MyClubUser)
@admin.register (Venue)
class VenueAdmin(admin.ModelAdmin):
list_display=('name','address','phone')
ordering=('name',)
search_fields=('name','address')
@admin.register(Event)
class ... | Mukhtorjon/django5 | home/admin.py | admin.py | py | 544 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.admin.site.register",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "models.MyClubUser",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 6,
"usage_type": "attribute"
},
{
... |
33574502195 | import re
from copy import deepcopy
from tqdm import tqdm
import networkx as nx
import utils
def preprocess(data):
regex = r'Valve ([A-Z]+) has flow rate=(\d+)'
G = nx.DiGraph()
for line in data:
head, tail = line.split('; ')
(valve, flow) = re.match(regex, head).groups()
neighbor... | 742617000027/advent-of-code-2022 | 16/16.py | 16.py | py | 1,503 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "networkx.DiGraph",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "networkx.shortest_path_length",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy... |
75163504186 | """add notice
Revision ID: 8fcc4d5b96b
Revises: 4b914d2ce17a
Create Date: 2014-12-18 10:23:09.337000
"""
# revision identifiers, used by Alembic.
revision = '8fcc4d5b96b'
down_revision = '4b914d2ce17a'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
... | cash2one/Luyasi-Flask | dxc/alembic/versions/8fcc4d5b96b_add_notice.py | 8fcc4d5b96b_add_notice.py | py | 1,840 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.create_table",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
7094093774 | from part1 import create_dict
import json
import nltk
import string
punctuation = string.punctuation # Retrieve all punctuation symbols from string library
stopwords = nltk.corpus.stopwords.words('english') # Retrieve stopwords from nltk library
stemmer = nltk.stem.lancaster.LancasterStemmer() # Initialize the ste... | MSU-AI/Mackenzie | part2.py | part2.py | py | 2,122 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "string.punctuation",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "nltk.corpus",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "nlt... |
20143063149 | import math
import struct
from pathlib import Path
import moderngl as mg
import moderngl_window as mglw
import numpy as np
from matplotlib import pylab
from moderngl_window import resources
from moderngl_window.scene import KeyboardCamera
import matplotlib.pyplot as plt
from pyrr import Matrix44, matrix44, Vector3
... | adriangaro/opengl-perlin-noise-test | main.py | main.py | py | 4,752 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "moderngl_window.resources.register_dir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "moderngl_window.resources",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api... |
32722412369 | from __future__ import unicode_literals
from yt_dlp import YoutubeDL
from youtube_search import YoutubeSearch
def dwnld(song_name : str,tracknum:int):
results = YoutubeSearch(song_name,max_results=1).to_dict()[0]
ydl_opts = {
'format': 'bestaudio/best',
'noplaylist':'true',
... | warui-slime/Music_Discord_Bot | youtube.py | youtube.py | py | 725 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "youtube_search.YoutubeSearch",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "yt_dlp.YoutubeDL",
"line_number": 23,
"usage_type": "call"
}
] |
6323441006 |
import random
from fractions import Fraction
import os
import traceback
import typing
from typing import *
import logging
import hikari
import lightbulb
from lightbulb.context import Context
from lightbulb import Bucket, commands
from lightbulb import errors
from lightbulb import events
from lightbulb.commands import... | zp33dy/inu | inu/ext/commands/random.py | random.py | py | 9,736 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "core.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "lightbulb.Plugin",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "core.Inu",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "lightbulb.context.Context",
... |
41161983442 | import pygame
class Missile():
def __init__(self, display, image, x, y, v):
self.x = x
self.y = y
self.v = v
self.image = image
self.display = display
width = self.image.get_width()
height = self.image.get_height()
self.rect = pygame.Re... | BlitW0/Space-Invaders | src/Missile.py | Missile.py | py | 1,010 | python | fa | code | 0 | github-code | 6 | [
{
"api_name": "pygame.Rect",
"line_number": 14,
"usage_type": "call"
}
] |
27958777452 | import collections
import math
import typing
from absl import logging
import numpy as np
from google.protobuf import duration_pb2
from google.protobuf import timestamp_pb2
from handler import utils
import metrics_pb2
class BaseCollector:
"""
Base class for Collector implementations.
"""
def __init__(self, e... | GoogleCloudPlatform/ml-testing-accelerators | metrics/handler/collectors/base.py | base.py | py | 6,842 | python | en | code | 54 | github-code | 6 | [
{
"api_name": "metrics_pb2.MetricSource",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "typing.Iterable",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "typing.Tuple",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "... |
18847021152 | from tkinter import *
from tkinter import filedialog
import pygame
DEFAULT_VOLUME = 30
class MyMusicPlayer():
def __init__(self, root, btn_colors='light blue', voice_color='dark cyan', volume_color = 'cyan', active_color='orange'):
self.player = pygame.mixer
self.player.init()
self.root = r... | mohammadpmf/python | pygame projs/mymusicplayer.py | mymusicplayer.py | py | 2,289 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.mixer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 26,
"usage_type": "name"
}
] |
71208823227 | # coding: utf-8
__author__ = 'zz'
import re
from collections import Counter
fin = open('train_msgs.txt', 'r')
fout = open('svm_features.csv', 'w')
stopWordList = ["a", "n", "able", "about", "across", "after", "all", "almost",
"also", "am", "among", "an", "and", "any", "are", "as", "at", "be",
... | hyzhangsf/stat154_final_proj | problem2.py | problem2.py | py | 3,744 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 74,
"usage_type": "call"
}
] |
10423057431 | #-*- coding: utf-8 -*-
"""
@author: Martí Congost
@contact: marti.congost@whads.com
@organization: Whads/Accent SL
@since: November 2008
"""
import sys
from collections import Counter
from cocktail.modeling import refine, OrderedSet, InstrumentedDict, DictWrapper
from cocktail.events import Event
from cocktail.pkg... | marticongost/cocktail | cocktail/schema/schemaobject.py | schemaobject.py | py | 43,747 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cocktail.schema.member.Member.shadows_attribute",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "cocktail.schema.member.Member",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "cocktail.schema.schema.Schema",
"line_number": 54,
"us... |
24789839092 | from django.urls import path
from . import views
from rest_framework import permissions
from django.contrib.auth import views as auth_views
urlpatterns = [
path('accounts/login/', auth_views.LoginView.as_view(), name='login'),
path('', views.lista_proyectos, name='lista_proyectos'),
path('proyecto/<int:pro... | cmonsivaisb/proyectosweb1 | project1/urls.py | urls.py | py | 924 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.views.LoginView.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.views.LoginView",
"line_number": 7,
"usage_type": "attribu... |
24178453193 | from django.conf.urls import url, include
from rest_framework.urlpatterns import format_suffix_patterns
from server.api.v1.views import api_index, get_budget_tree, get_munis,get_node_subtree,get_muni_roots
urlpatterns = [
url(r'^$', api_index, name='api_v1'),
url(r'^get_muni_roots', get_muni_roots, name="get... | idoivri/localbudgets-v2 | server/api/v1/urls.py | urls.py | py | 612 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "server.api.v1.views.api_index",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name... |
21043032280 | """Company test suite"""
import pytest
from company_server.domain.entities.CNPJ import CNPJ
from company_server.domain.entities.Company import Company
from company_server.domain.entities.UUIDGenerator import UUIDGenerate
def test_create_company():
"""Test creating a company with a valid CNPJ"""
_id = UUIDGene... | kelwinv/company-crud-with-tdd-backend | src/tests/unit/test_company.py | test_company.py | py | 1,917 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "company_server.domain.entities.UUIDGenerator.UUIDGenerate.generate",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "company_server.domain.entities.UUIDGenerator.UUIDGenerate",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "company_server.domai... |
33656189376 | import paddle
import paddle.nn as nn
paddle.set_device('cpu')
class Attention(nn.Layer):
def __init__(self, embed_dim, num_heads, qkv_bias=False, qk_scale=None, dropout=0.0, attention_dropout=0.0):
super().__init__()
self.embed_dim = embed_dim
self.num_heads = num_heads
self.head_d... | KHB1698/vit_study | ViT/attention.py | attention.py | py | 2,722 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "paddle.set_device",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "paddle.nn.Layer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "paddle.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "paddle.nn.Linear",
... |
17953419287 | # -*- coding: utf-8 -*-
import io
import numpy as np
from PIL import Image
import torch
from torchvision import transforms
from lichee import plugin
from .field_parser_base import BaseFieldParser
@plugin.register_plugin(plugin.PluginType.FIELD_PARSER, "video_tsn")
class VideoTemporalSegmentSampleParser(BaseFieldPars... | Tencent/Lichee | lichee/dataset/field_parser/video_tsn.py | video_tsn.py | py | 2,703 | python | en | code | 295 | github-code | 6 | [
{
"api_name": "field_parser_base.BaseFieldParser",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 33,
"usage_type": "name"
},
... |
24992708131 | from osv import osv
from osv import fields
from tools.translate import _
from tools import ustr
import time
class crm_analytic_timesheet(osv.osv):
_name = 'crm.analytic.timesheet'
_description = 'CRM summary work'
_columns = {
'name': fields.char('Work summary', size=128),
'model': fields... | factorlibre/openerp-extra-6.1 | crm_timesheet/crm_timesheet.py | crm_timesheet.py | py | 9,297 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "osv.osv.osv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "osv.osv",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "osv.fields.char",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "osv.fields",
"line_number"... |
13442851429 | import pygame
from pygame.locals import SRCALPHA
#
# Floor Class:
#
# Floor class is merely a class type that holds a list of tiles that will be used in that floor, and a floor surface.
#
# The purpose of this is that you can write tile.images to the Floor.image at certain locations. And the Floor.image ... | Occuliner/ThisHackishMess | modules/stockclasses/floor.py | floor.py | py | 8,462 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pygame.sprite",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.DirtySprite.__init__",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name... |
71744465147 | from bs4 import BeautifulSoup
import requests
URL = "https://en.wikipedia.org/wiki/Machine_learning"
r = requests.get(URL)
soup = BeautifulSoup(r.content, 'html5lib')
sdiv = soup.find("div", {"id": "mw-content-text"})
stext = sdiv.text
words=str(stext).replace("\n"," ")
words=words.split(" ")
wordcnt={}
for ... | Anirudhsh/MLassignments | wikiweb.py | wikiweb.py | py | 585 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 5,
"usage_type": "call"
}
] |
7790292670 | import nltk
import string
import re
from collections import Counter
from nltk.corpus import stopwords
from nltk.corpus import wordnet as wn
WORD_CLASS = {
"n": "Noun",
"v": "Verb",
"a": "Adjective",
"s": "Adjective Satellite",
"r": "Adverb"
}
Trump_Tweet = ('THE SECOND AMENDMENT WILL NEVER BE ... | sharmaraghav260/Analyzing-POTUS | analyze.py | analyze.py | py | 2,318 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "string.punctuation",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_nam... |
74066327868 | import pymongo
# pip install pymongo
# pip install "pymongo[srv]"
client = pymongo.MongoClient("mongodb+srv://test:test@cluster0.a1alg.mongodb.net/?retryWrites=true&w=majority")
db = client.test
# database--> collection-- document
# create database
# -----------------------------------
database = client['ineuron']
... | Dipanwita-biswas-lab/ineuron_python_liveclass | Database/Mongo.py | Mongo.py | py | 1,922 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
}
] |
72532659069 | """ Helper functions to determin access-rights on stored data
# DRAFT Rationale:
osparc-simcore defines TWO authorization methods: i.e. a set of rules on what,
how and when any resource can be accessed or operated by a user
## ROLE-BASED METHOD:
In this method, a user is assigned a role (user/tes... | ITISFoundation/osparc-simcore | services/storage/src/simcore_service_storage/db_access_layer.py | db_access_layer.py | py | 10,002 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "aiopg.sa.connection.SAConnection",
"line_number": 89,
"usage_type": "name"
},
{
"api_name... |
71718729468 | import wx
from .GUIclasses2 import MyButton,MyDscDialog,MyMessageDialog,FileLikeTextCtrl,ButtonPanel
from .DataClass2 import PointData
from . import GPS
import numpy as np
from . import MapBase
#Last update/bugfix 05.08.09, simlk
#GUI interface wrapping MapBase.py for ML-programs. Simple interface designed for i... | SDFIdk/nivprogs | MyModules/MLpanel.py | MLpanel.py | py | 5,878 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "wx.Panel",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "wx.Panel.__init__",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "wx.Panel",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "wx.EVT_CHAR",
"line_... |
30316029756 |
from grizzled.file import eglob, touch
import os
from os import path
from tempfile import TemporaryDirectory
from contextlib import contextmanager
import pytest
from typing import Sequence, Set, Generator
class Files(object):
def __init__(self,
tempdir: str,
files: [str],
... | bmc/grizzled-python | test/file/test_eglob.py | test_eglob.py | py | 2,993 | python | en | code | 22 | github-code | 6 | [
{
"api_name": "typing.Sequence",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Set",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Set",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Set",
"line_number":... |
36040556956 | import math
import typing
import numpy as np
from arch import arch_model
from ParadoxTrading.Indicator.IndicatorAbstract import IndicatorAbstract
from ParadoxTrading.Utils import DataStruct
class GARCH(IndicatorAbstract):
def __init__(
self,
_fit_period: int = 60,
_fit_begin... | ppaanngggg/ParadoxTrading | ParadoxTrading/Indicator/General/GARCH.py | GARCH.py | py | 2,758 | python | en | code | 51 | github-code | 6 | [
{
"api_name": "ParadoxTrading.Indicator.IndicatorAbstract.IndicatorAbstract",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "math.sqrt",
"line_number": 28,
"usage_type": "call"
},
... |
15532144904 | import numpy as np
import tensorflow as tf
from tensorflow.python.keras import Input
from vgg_model import vgg_face
from tensorflow.keras.applications.imagenet_utils import preprocess_input
from tensorflow.keras.preprocessing.image import load_img, img_to_array
from datetime import datetime
import cv2
face_cascade = c... | abdulkerimtoker/come491-experiment | main.py | main.py | py | 2,942 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
... |
17248822204 | #!/usr/bin/env python
# coding: utf-8
import pandas as pd
from copy import deepcopy
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.utils.validation import check_is_fitted
from rpy2.robjects.packages import importr
from rpy2.robjects import pandas2ri, numpy2ri
from rpy2.robjects.vectors import Int... | christophmark/fforma | fforma/r_models.py | r_models.py | py | 7,484 | python | en | code | 24 | github-code | 6 | [
{
"api_name": "rpy2.robjects.packages.importr",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "rpy2.robjects.pandas2ri.activate",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "rpy2.robjects.pandas2ri",
"line_number": 57,
"usage_type": "name"
},
... |
10503068902 | from rest_framework.test import APITestCase
from apps.notification.api_services.notification import NotificationAPIService
class TestWebPushAPI(APITestCase):
def setUp(self):
data = {
"title": "Winter clearance sale discount",
"description": "Enter coupon-code to avail 25% discount... | anojkr/onboarding-project | push_notification/apps/webpush/tests/unit/test_webpush.py | test_webpush.py | py | 925 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "apps.notification.api_services.notification.NotificationAPIService.create_notification",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "apps.notification.api_servi... |
20625544172 | from django.test import TestCase
from sane_api.helpers import \
( get_cyclic_dependency
, get_unmet_dependency
, get_value_at
, fill_template
)
from sane_api.exceptions import UnmetDependency
class TestHasCyclicDependency(TestCase):
def test1(self):
data = \
{ "article": {"query": {"comment": "{comm... | khalti/sane-api | tests/test_helpers.py | test_helpers.py | py | 3,047 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sane_api.helpers.get_cyclic_dependency",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sane_api.helpers.get_cyclic_dependency",
"line_number": 28,
"usage_type": "ca... |
34002707106 | from app import Deploy, ClientApp
import utils
from staking_function import ContractsFunction
token_1_id, rewards_token_id, app_id, escrow_logicsig, escrow_address = Deploy.deploy()
print("token_1_id, rewards_token_id, app_id, escrow_logicsig, escrow_address: ", token_1_id, rewards_token_id, app_id, escrow_logicsig, ... | narutomanchester/Test-Algorand | staking/test_app.py | test_app.py | py | 1,463 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.Deploy.deploy",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "app.Deploy",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "utils.get_client",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "staking_function.Contract... |
10339707782 | # TODO: Switch to PyTorch
import tensorflow as tf
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense
import numpy as np
from sklearn.cluster import KMeans
import heapq
# from data_helper import *
# from baselines import *
from scipy.optimize import linprog
from collections import default... | skyscraper-vetl/skyscraper | code/src/online/knob_plan.py | knob_plan.py | py | 22,012 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.keras.Sequential",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers.Dense",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers.Dense",
"line_number": 88,
"usage_type": "call"
},
... |
42451222386 | import json
from data.request_body import return_body
import requests
url = 'https://api.tinkoff.ru/geo/withdraw/clusters'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
def get_currency_places():
response = requests.post(url=url, json=return_body(), headers=headers).json(... | 1kpp/CurrencyBot | get_actual_atm_data.py | get_actual_atm_data.py | py | 1,612 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "data.request_body.return_body",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 39,
"usage_type": "call"
}
] |
34989689623 |
import torch
from torch.utils.data import TensorDataset
from torch.autograd import Variable
from torchvision import transforms, models
from PIL import Image
from rsearch_backend.CMH import CMH
import os
import random
class Encoder():
def __init__(self, modelpath = './rsearch_backend/model/hashmodel.pt... | ZhengZhuorui/rsearch | backend/rsearch_backend/rsearch_backend/Encoder.py | Encoder.py | py | 4,601 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rsearch_backend.CMH.CMH",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.optim.SGD",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfi... |
2122446488 | from django.shortcuts import render
from .services import set_key
def add_key(request, identifier):
if request.method == 'POST':
key = request.POST.get('key')
value = request.POST.get('value')
set_key(identifier=identifier, key=key, value=value)
return render(request, 'add_key.html... | HackBulgaria/Web-Development-with-Django | week2/2-KVStore-Templates-and-Forms/djedis/storage/views.py | views.py | py | 323 | python | en | code | 25 | github-code | 6 | [
{
"api_name": "services.set_key",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 14,
"usage_type": "call"
}
] |
123254561 | import datetime
import pickle
from sklearn.model_selection import train_test_split
from torch import nn
from torch.nn import functional as F
from torch.utils.data import DataLoader
import torch
import argparse
from torchvision import transforms, datasets, models
import os
import numpy as np
import matplotl... | 7hestral/CSC413FinalProject | Train.py | Train.py | py | 18,326 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.arange",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.equal",
... |
11613694583 | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 18 04:24:42 2019
@author: admin
"""
import os
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
from matplotlib.ticker import FormatStrFormatter
path1="E:\\wz\\tf_all\\simulate_data\\"
fault =... | Coder-WangZe/transfer-learning-on-fault-detection | plot_py/untitled0.py | untitled0.py | py | 1,178 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "numpy.max",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "numpy.loadtxt",
"lin... |
28172748113 | import pytest
import functools
from devtools_testutils import PowerShellPreparer
AttestationPreparer = functools.partial(
PowerShellPreparer, "attestation",
# attestation_azure_authority_host='xxx',
# attestation_resource_group='yyyy',
# attestation_subscription_id='xxx',
... | teaglebuilt/azure-sdk-for-python | sdk/attestation/azure-security-attestation/tests/preparers.py | preparers.py | py | 1,680 | python | en | code | null | github-code | 6 | [
{
"api_name": "functools.partial",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "devtools_testutils.PowerShellPreparer",
"line_number": 7,
"usage_type": "argument"
}
] |
653173867 | #! /usr/bin/python
import os
import time
import argparse
import subprocess
def wait_for_jobs(user, max_wait_time=None):
t_start = time.time()
while True:
time.sleep(5)
n_running = subprocess.check_output(['bjobs | grep %s | wc -l' % user], shell=True).decode()
n_running = int(n_runnin... | constantinpape/block_experiments | production/segmentation/run_cluster.py | run_cluster.py | py | 3,432 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_nu... |
39357450700 | import sys
import os
import datetime
# Define the output file path
log_file = "/dnif/log/que_del.log"
log_directory = os.path.dirname(log_file)
os.makedirs(log_directory, exist_ok=True) # Create the log directory if it doesn't exist
import os
timestamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
os.envi... | SME-DNIF/DNIF | queue_del.py | queue_del.py | py | 1,897 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"li... |
19474520068 | import os
import sys
import click
import pathlib
from subprocess import check_call, PIPE, STDOUT
from utils.cert import openssl_installed
from utils.misc import get_realpath
gen_tls_script = pathlib.Path(__file__).parent.parent.joinpath('scripts/gencert.sh').absolute()
@click.command()
@click.option('-p', '--path', ... | leadlxx/harbor | make/photon/prepare/commands/gencerts.py | gencerts.py | py | 962 | python | en | code | null | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "utils.misc.get_realpath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "click.echo",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "utils.cert.openssl_in... |
20843372415 | import torch
import json
def evaluate(model, criterion, loader, device):
model.eval()
total_loss = 0.0
num_hits = 0
num_samples = 0
for images, targets in loader:
batch_size = images.size(0)
images = images.to(device)
targets = targets.to(device)
with torch.set_g... | TropComplique/associative-domain-adaptation | utils.py | utils.py | py | 1,720 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "torch.set_grad_enabled",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.DoubleTensor",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 70,
"usage_type": "call"
}
] |
25555058009 | from __future__ import annotations
from typing import Optional
from .base import BuilderBase, GraphQLEnumMap, GraphQLInterfaceMap, GraphQLScalarMap
from .mutation import GraphQLInputObjectTypeMap, MutationBuilder
from .query import GraphQLObjectTypeMap, QueryBuilder
class Builder(QueryBuilder, MutationBuilder):
... | cipriantarta/typegql | typegql/builder/__init__.py | __init__.py | py | 864 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "query.QueryBuilder",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "mutation.MutationBuilder",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "base.Grap... |
26513878913 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sn
import pandas as pd
import librosa
import os
import joblib
import warnings
from sklearn.cluster import KMeans
from sklearn.ensemble import RandomForestClassifier, VotingClassifier
import sklearn.exceptions
from sklearn.linear_model import LogisticR... | sam4llis/Predicting-Keystrokes | create_model.py | create_model.py | py | 24,212 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.exceptions",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "sklearn.cluster",
"line_number": 38,
"usage_type": "name"
},
{
"api_name"... |
18100898584 | """
https://leetcode.com/problems/maximum-width-of-binary-tree/
662. Maximum Width of Binary Tree
Given the root of a binary tree, return the maximum width of the given tree.
The maximum width of a tree is the maximum width among all levels.
The width of one level is defined as the length between the end-nodes (the ... | hirotake111/leetcode_diary | leetcode/662/solution.py | solution.py | py | 1,799 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.Deque",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"li... |
26113781815 | __authors__ = ["P. Knobel"]
__license__ = "MIT"
__date__ = "15/05/2017"
import logging
import numpy
import os
import sys
import tempfile
import unittest
logger1 = logging.getLogger(__name__)
from ..specfilewrapper import Specfile
sftext = """#F /tmp/sf.dat
#E 1455180875
#D Thu Feb 11 09:54:35 2016
#C imaging User ... | silx-kit/silx | src/silx/io/test/test_specfilewrapper.py | test_specfilewrapper.py | py | 4,625 | python | en | code | 106 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 86,
"usage_type": "attribute"
},
{
"api_name": "tempfile.mkstemp",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "os.write",
... |
35372024756 | import discord
import praw
import pandas as pd
import random
import time
import sys
sys.path.append("H:/Misc")
import redditStuff as rs
client = discord.Client()
help = """**-help** - shows this \n**-ping** - pings the bot
**-invite** - gives an invite link so you can add the bot to more servers.
**-poll [message]** -... | JONKKKK/Everything | Discord Bots/Toaster (Python)/main.py | main.py | py | 10,640 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "discord.Client",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "discord.Game",
"line_n... |
74338091068 |
from xml.dom.minidom import Document
import cairosvg
import os
import numpy as np
def printtensor(X):
XL = X.tolist()
for i in range(len(XL)):
print("line : %d "%(i))
print(XL[i])
def EuclideanDistances(A, B):
BT = B.T
vecProd = np.dot(A,BT)
SqA = A**2
sumSqA = np.sum(SqA,1)
... | jiayouwyhit/deepdrawing | utils.py | utils.py | py | 5,687 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "numpy.dot",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.expand_dims",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.repeat",
"line_number... |
5539588392 | import numpy as np
import cv2
import time
def zero_padding_for_DCT(src,n=8):
(h,w) = src.shape
# padding shape의 초기화
(p_h,p_w) = (h,w)
# n의 배수로 h,w를 늘려준다.
if h % n != 0:
p_h = h + n - (h % n)
if w % n != 0:
p_w = w + n - (w % n)
# n의 배수로 늘려준 h,w를 size로 ... | daebakk/Image-Processing | Assignment/[IP]실습09 - Image comprssion2(JPEG)/JPEG.py | JPEG.py | py | 12,121 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_nu... |
16008654129 | import logging; log = logging.getLogger(__name__)
import struct
from ..base import TextureFormat
def unpackRGB565(pixel):
r = (pixel & 0x1F) << 3
g = ((pixel >> 5) & 0x3F) << 2
b = ((pixel >> 11) & 0x1F) << 3
return r, g, b, 0xFF
def clamp(val):
if val > 1: return 0xFF
if val < 0: r... | RenaKunisaki/botwtools | codec/bntx/pixelfmt/bc/base.py | base.py | py | 1,799 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 1,
"usage_type": "call"
},
{
"api_name": "struct.unpack_from",
"line_number": 22,
"usage_type": "call"
}
] |
34632202123 | import cv2
import numpy as np
#保存图片
img = cv2.imread('img\\test.jpg')
cv2.imwrite('img\\cpy_test.jpg', img, [int(cv2.IMWRITE_JPEG_QUALITY), 100])
cv2.imshow('copyImg', cv2.imread('img\\cpy_test.jpg'))
cv2.waitKey(0)
cv2.destroyAllWindows()
| liuyuhua-ha/opencvStudy | opencvStudy/saveImg.py | saveImg.py | py | 251 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.IMWRITE_JPEG_QUALITY",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.imshow",
"l... |
72531986429 | # pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
# pylint:disable=protected-access
import asyncio
import datetime
from typing import AsyncIterator, Final
import pytest
from faker import Faker
from pytest_mock import MockerFixture
from redis.exceptions import Loc... | ITISFoundation/osparc-simcore | packages/service-library/tests/test_redis.py | test_redis.py | py | 9,056 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "servicelib.redis.RedisClientSDK",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "settings_library.redis.RedisSettings",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "settings_library.redis.RedisDatabase.RESOURCES",
"line_number": 41,
... |
24285485654 | import docx
# restyling
doc = docx.Document('files/multipleParagraphs.docx')
doc.paragraphs[0].style = 'Normal'
doc.paragraphs[1].runs[0].style = 'QuoteChar'
doc.paragraphs[1].runs[1].underline = True
doc.paragraphs[1].runs[0].underline = True
doc.save('files/newStyle.docx')
# create a new one
doc = docx.Document()
#... | chhatrachhorm/ABS | PythonStuff/Word/creating.py | creating.py | py | 588 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "docx.Document",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "docx.Document",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "docx.shared.Inches",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "docx.shared",
"line... |
34859119648 | from pyspark.sql import SparkSession
from pyspark.sql.functions import lit, concat, col
def create_spark_session():
spark = SparkSession.builder \
.master("yarn") \
.appName("zaka retail data") \
.config("spark.executor.memory", '4g') \
.config('spark.executor.cores', '1') \
... | zaka-ai/data-engineer-track | Big_data_hadoop_and_spark/spark_submit_hands_on/pyspark_script.py | pyspark_script.py | py | 1,122 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyspark.sql.SparkSession.builder.master",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 6,
"usage_type": "n... |
35485367789 | #!/usr/bin/env python
# coding: utf-8
# # Tesla Deaths Exploratory Data Analysis
# In[1]:
import numpy as np
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
# # Contando a Introdução do Paper
# Baixei, primeiramente, a biblioteca que contabilizava o número de acidentes envolvendo óbito... | gabriel16011998/Tesla | Tesla Notebook (1).py | Tesla Notebook (1).py | py | 6,645 | python | pt | code | 1 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "seaborn.set_theme",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "seaborn.lineplot",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime... |
34779608696 | from Maze import *
from Actor import *
import math
import copy
import numpy as np
import matplotlib.pyplot as plt
class Simulator:
maze = None
chre = None
target = None
def __init__(self, maze_conncet, chre_connect, target_conncet):
self.maze = copy.deepcopy(maze_conncet)
self.chre = ... | NAKNAO-nnct/ChaseTheTarget | Learning.py | Learning.py | py | 4,819 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "copy.deepcopy",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_numbe... |
32660507446 | import pytest
from lumen.pipeline import Pipeline
from lumen.validation import ValidationError
@pytest.mark.parametrize(
"source,filters,transforms,msg",
(
(
{"type": "file", "tables": {"penguins": "url.csv"}},
[{"type": "widget", "field": "species"}],
[{"type": "a... | holoviz/lumen | lumen/tests/validation/test_pipeline.py | test_pipeline.py | py | 3,831 | python | en | code | 149 | github-code | 6 | [
{
"api_name": "lumen.pipeline.Pipeline.validate",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "lumen.pipeline.Pipeline",
"line_number": 98,
"usage_type": "name"
},
{
"api_name": "pytest.raises",
"line_number": 101,
"usage_type": "call"
},
{
"api_name"... |
35933575656 | from cement import Controller, ex
from time import strftime
class Commands(Controller):
class Meta:
label = 'commands'
stacked_type = 'embedded'
stacked_on = 'base'
@ex(help='list command')
def list(self):
data = {}
data['commands'] = self.app.db.all()
... | keremdemirtrk/krmd | krmd/controllers/commands.py | commands.py | py | 1,903 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "cement.Controller",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "cement.ex",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cement.ex",
"line_number... |
13163812463 | import argparse
import requests
parser = argparse.ArgumentParser(description='Update deltaml contract address on model buyer and fed agg')
parser.add_argument('address', metavar='N', type=str, help='an integer for the accumulator')
def update_contract_address(address):
print("Init contract address update")
... | DeltaML/testing | contract_scripts/contract.py | contract.py | py | 829 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "requests.patch",
"line_number": 15,
"usage_type": "call"
}
] |
70789320507 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 12 10:26:51 2020
@author: dana
"""
import pygame
import time
import functions_v2 as functions
# Inititaized pygame window
def main():
""" Runs Program
Returns
-------
None.
"""
running = True
clock = ... | dasteinb/COGS-18-FINAL | cogs18_Final/Files_that_didnt_work/main_code_run.py | main_code_run.py | py | 759 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.time.Clock",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "pygame.event.get",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pygame.event",
... |
28638271377 | import os.path
from aiogram import types
from aiogram.dispatcher import FSMContext
from config.bot_config import dp
from keyboards.admin_panel import log
from utils.state import StateAdmin
@dp.callback_query_handler(text='log_list')
async def logs(callback_query: types.CallbackQuery, state: FSMContext):
"""Хандлер, ... | akorsunov23/balance_replenishment_bot | handlers/admin_panel/log_list.py | log_list.py | py | 1,346 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "aiogram.types.CallbackQuery",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "aiogram.types",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "aiogram.dispatcher.FSMContext",
"line_number": 10,
"usage_type": "name"
},
{
"api_... |
22232638935 | import os
from collections import defaultdict
import settings
class Handler:
def __init__(self, csv_handler):
self.csv_handler = csv_handler
self.metadata_file_name = "metadata.csv"
self.file_pointers = settings.FILE_POINTERS
def raw_activity_to_dict(self, activity_folder) -> dict:
... | Wayhowen/VEP-api | api_internal/handlers/activity_handler.py | activity_handler.py | py | 1,215 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "settings.FILE_POINTERS",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.