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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
32444061860 | from django.contrib import admin
from django.db import models
from models import Targets, Missions, Details, Planets, PayloadBusTypes, PayloadBusComps, SciData
#from django.db.models import Q
from django import forms
from django.forms import SelectMultiple
class TargetsAdmin(admin.ModelAdmin):
def formfield_for_... | chronos-pramantha/cloudService | wsgi/openshift/chronos/admin.py | admin.py | py | 3,647 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.forms.Textarea",
"line_number": 14,
"usage_type": "call"
},
{
"a... |
19271952309 |
from msmbuilder.featurizer import DihedralFeaturizer
from msmbuilder.dataset import dataset
from msmbuilder.decomposition import tICA
from msmbuilder.preprocessing import RobustScaler
from msmbuilder.cluster import MiniBatchKMeans
from msmbuilder.lumping import PCCAPlus
from msmbuilder.msm import MarkovStateMod... | satoshi-python/Desktop | MSM_MED.py | MSM_MED.py | py | 3,144 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "msmbuilder.dataset.dataset",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "mdtraj.join",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "msmbuilder.featurize... |
39381165733 | from bs4 import BeautifulSoup # 헤드라인 뉴스제목만 가지고 왔다.
import requests
import re
import pandas as pd
import datetime
import matplotlib.pyplot as plt
import numpy as np
category = ['Politics', 'Economic', 'Social', 'Culture', 'World', 'IT']
#url = 'https://news.naver.com/main/main.naver?mode=LSD&mid=shm&sid1=100' # 정치
#ur... | woocastle/news_classfication_lws | job01_crawling_headline.py | job01_crawling_headline.py | py | 2,426 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "pandas.DataFrame",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.compile",
"lin... |
32397352697 | import torch
import torch.nn as nn
from .my_modules import UNetEncoder, ASPP, SpatialAttention, ResidualUBlock
class UNet(nn.Module):
def __init__(self, layers, heights, atrous_rates):
super(UNet, self).__init__()
self.encoder = UNetEncoder(layers, replace_stride_with_dilation=(True, Tru... | alienzyj/PPos | models/my_unet.py | my_unet.py | py | 3,062 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "my_modules.UNetEncoder",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "my_modules.ASPP",
... |
29420141471 | from __future__ import division
import sys
import os
import warnings
from fpn_resnet1 import CSRNet
from utils import save_checkpoint
from rate_model import RATEnet
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import datasets, transforms
impor... | Bryce1010/DeepLearning-Project | Crowd_Counting_EM-master/Crowd-Counting/train_pool_demo.py | train_pool_demo.py | py | 23,477 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "numpy.load"... |
39471581954 |
from django.urls import path,include
from . import views as traffickviews
urlpatterns = [
path('', traffickviews.home, name = 'home'),
path('start/', traffickviews.start, name = 'start'),
path('about/', traffickviews.about, name = 'about'),
path('parameters/', traffickviews.parameters, name = 'paramet... | gidex19/my-traffick-app | traffickapp/urls.py | urls.py | py | 403 | 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": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
72328116987 | import requests
import json
repos = {"main": "https://api.github.com/repos/PortsMaster/PortMaster-Releases/releases/latest",
"multiverse":"https://api.github.com/repos/PortsMaster-MV/PortMaster-Multiverse/releases/latest"
}
ports = {"ports":{}}
for repo in repos:
latest_release = requests.get(... | PortsMaster/PortMaster-Info | tools/get_ports_file.py | get_ports_file.py | py | 813 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 24,
"usage_type": "call"
}
] |
17767620923 | #!/usr/bin/env python
"""Simple messaging server to receieve queueing requests from distributed
clients, and save them in a pre-defined textual format in order to be picked
up by spiders (which will push responses back via. HTTP).
"""
from __future__ import absolute_import, print_function, unicode_literals
from .daemon... | purifier1990/PythonLearn | venv/lib/python3.8/site-packages/dispatch/server.py | server.py | py | 7,880 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "daemon.AbstractDaemon",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "handler.Handler",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "logging.INFO",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "logging.ERROR... |
7577997830 | import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from datasets import *
from models import *
from prepocessing import *
import numpy as np
from keras.preprocessing import sequence
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Loading saved ... | hoangIT1/Vietnamese-Punctuation-Restoration | infere.py | infere.py | py | 1,873 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.device",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.load",
... |
15798317721 | import numpy as np
import time
import pprint
import csv
from collections import OrderedDict
import tensorflow as tf
import os
if not os.path.exists('weights/'):
os.makedirs('weights/')
if not os.path.exists('logs/'):
os.makedirs('logs/')
class StateSpace:
'''
State Space manager
Provides util... | titu1994/progressive-neural-architecture-search | encoder.py | encoder.py | py | 24,134 | python | en | code | 117 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_nu... |
26306611726 | from typing import Callable
from algorithms import Dimension, Direction, Point
from core import Component, Entity, Game, System
from systems import (
AnimationControllerComponent,
CollisionComponent,
ControlSystem,
WorldRenderComponent,
)
class MotionComponent(Component["MotionSystem"]):
def __in... | antonino-feitosa/Picnic_in_the_Dungeon | _old/systems/motion_system.py | motion_system.py | py | 2,692 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "core.Component",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "core.Entity",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "algorithms.Direction",
... |
73730930746 | import numpy as np
from gurobipy import GRB, LinExpr
from evanqp.sets import Box, Polytope
from evanqp.zonotope import Zonotope
from evanqp.layers import BoundArithmetic, BaseLayer
class InputLayer(BaseLayer):
def __init__(self, input_set):
self.input_set = input_set
if isinstance(self.input_set... | PREDICT-EPFL/evanqp | evanqp/layers/input.py | input.py | py | 2,295 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "evanqp.layers.BaseLayer",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "evanqp.sets.Polytope",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "evanqp.sets.Box",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "e... |
40080552331 | from flask import Flask, abort, jsonify
from Models.UserModel import User
from Models.BlacklistTokensModel import BlacklistToken
from flask_restful import Resource
class UserCurrentUser(Resource):
#get user connected
def get(self):
resp = User.verifyToken()
if isinstance(resp, int):
... | tuvetula/ApiRestFlask_videos | Resources/currentUser.py | currentUser.py | py | 1,021 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask_restful.Resource",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "Models.UserModel.User.verifyToken",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "Models.UserModel.User",
"line_number": 9,
"usage_type": "name"
},
{
"api_n... |
30326894738 | #!/home/shaival/anaconda3/bin/python3.5
###########################################
# Name: Shaival Dalal #
# #
# Project: Checkers Game #
###########################################
### IMPORTING LIBRARIES ###
import numpy as np
from copy ... | shaivaldalal/Checkers | checkers_Shaival.py | checkers_Shaival.py | py | 22,996 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number"... |
11667951771 | from selenium import webdriver
import time
url = 'https://www.taobao.com/'
driver = webdriver.Chrome()
driver.get(url)
# 最多等10秒(如果1秒就加载出页面,则执行后面的代码,相当于等1秒)
driver.implicitly_wait(10)
# 找到搜索框并输入数据(mac)
driver.find_element_by_xpath('//input[@id="q"]').send_keys('mac')
# 找到搜索按钮,并点击
driver.find_element_by_xpath('//butt... | Timid-yuluo/selenium | 02-selenium-输入并搜索.py | 02-selenium-输入并搜索.py | py | 493 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
}
] |
40481023281 | from django.core.mail import send_mass_mail
from django.core import mail
from yema.apps.users.models import User
from django.utils.translation import gettext_lazy as _
class MailAppointmentService():
def send(self, appointments):
mails = self.__build_mails(appointments)
send_mass_mail(mails, fail_... | vanegg/app_pediatricians | yema/apps/appointment/services.py | services.py | py | 1,267 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.core.mail.send_mass_mail",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.gettext_lazy",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.gettext_lazy",
"line_number": 16,
"usage_t... |
5033454247 | from django.shortcuts import render
from django.contrib.auth.models import User
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.db import transaction
from help.models import Group, UserProfile
from help.forms import GroupForm
def list(request):
groups = Gr... | davidbarat/P13 | needhelp/group/views.py | views.py | py | 1,510 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "help.models.Group.objects.exclude",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "help.models.Group.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "help.models.Group",
"line_number": 11,
"usage_type": "name"
},
{
... |
7650606239 | import requests
import re
import uuid
import os
headers = {"User-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.69", # 随机生成一个代理请求
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-CN,zh;q=0.9,en;... | hl123-123/yiyan-ppt | mdtree/img_search.py | img_search.py | py | 2,448 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,... |
15391213051 | import requests
import json
content_type = 'application/json'
accept = content_type
key = '0187dc68f47e49e9b97fc765bfd56716'
headers = {'Ocp-Apim-Subscription-Key': key, 'accept': accept, 'content-type': content_type}
####### Store products
store_id_example = 'K171'
limit = 1
ean = None
offset = None
######
def g... | Shakurova/Sustage | pricing.py | pricing.py | py | 837 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 27,
"usage_type": "call"
}
] |
23125605962 | from collections import OrderedDict
import utils.utils
import hotKeyWord.keyWordUtils
def read_xls_file():
dict = {
'url': "http://index.1688.com/alizs/DownLoadExcel.do?cat=56&rankType=rise",
'requestType': 'GET',
'isProxy': False,
'isHttps': False,
'reLoad': True,
}
... | tudousiji/pachong | hotKeyWord/main.py | main.py | py | 428 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "utils.utils.utils.utils.parseXls",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.utils.utils",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "utils.utils",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "h... |
23867193346 | from __future__ import absolute_import
import pytest
from psyclone.core import Signature
from psyclone.domain.lfric.transformations import LFRicExtractTrans
from psyclone.errors import InternalError
from psyclone.psyir.nodes import ExtractNode, Node
from psyclone.psyir.transformations import ExtractTrans
# ---------... | Otter-Taskification/PSyclone | src/psyclone/tests/psyir/transformations/extract_test.py | extract_test.py | py | 3,967 | python | en | code | null | github-code | 6 | [
{
"api_name": "psyclone.psyir.transformations.ExtractTrans",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "psyclone.domain.lfric.transformations.LFRicExtractTrans",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "psyclone.psyir.transformations.ExtractTrans.d... |
71272792509 | import fileinput
from functools import reduce
with fileinput.input() as f:
fields = {
field: [
range(int(lb), int(ub) + 1)
for r in rng.split(" or ")
for lb, ub in [r.split("-")]
]
for rule in iter(lambda: next(f).strip(), "")
for field, rng in [r... | cthlo/advent_of_code | 2020/day16_2.py | day16_2.py | py | 1,240 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fileinput.input",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 42,
"usage_type": "call"
}
] |
1293762401 | import numpy as np
import onnx
from tests.tools import expect
class Sign:
@staticmethod
def export(): # type: () -> None
node = onnx.helper.make_node(
'Sign',
inputs=['x'],
outputs=['y'],
)
x = np.array(range(-5, 6)).astype(np.float32)
y =... | gglin001/onnx-jax | tests/node/test_sign.py | test_sign.py | py | 443 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "onnx.helper.make_node",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "onnx.helper",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
... |
1126584280 | from flask_restful import Resource, reqparse, abort
from flask_jwt import jwt_required, current_identity
from flask import jsonify, request, current_app
from database.job_request import JobRequestDAO
from database.user_request import UserDAO
from database.mechanic_request import MechanicDAO
from extensions import mongo... | neenamaldikar/MobileMechanic | MobileMechanicCloud/api/api_models/jobs.py | jobs.py | py | 6,263 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.config.config.dictConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "configuration.LOGGING_JSON",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "logging.config.config",
"line_number": 11,
"usage_type": "attribute"
},... |
25875827100 | #!/usr/bin/env python
# file to test out the relative theta - p codes!
# In this case, you align the traces on the predicted backazimuth and slowness
# then conduct the beamforming
# imports
import obspy
import numpy as np
import time
import matplotlib.pyplot as plt
from obspy.taup import TauPyModel
model = TauPyModel... | eejwa/Array_Seis_Circle | examples/Theta-P_Relative_test.py | Theta-P_Relative_test.py | py | 6,077 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "obspy.taup.TauPyModel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "obspy.read",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "circ_array.get_eventtime",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "circ_array.... |
29297294545 | import numpy as np
from ast import literal_eval
import json
import pandas as pd
from pathlib import Path
import os
from tqdm import tqdm
from scipy.stats import kendalltau
import matplotlib.pyplot as plt
from scipy.stats import rankdata
def score_tile_max(predictions, runtime):
score = 0
for i in range(len(ru... | thanhhau097/google_fast_or_slow | merge_preds_tile.py | merge_preds_tile.py | py | 1,542 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.argsort",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 2... |
6416891652 | #! /usr/bin/env python3
from kafka import KafkaProducer
class Producer:
def __init__(self, server_ip = "127.0.0.1", port = 9092):
self.server_ip = server_ip
self.port = port
self.topic = None
self.producer = KafkaProducer(bootstrap_servers = "%s:%s" %(self.server_ip, self.... | chenzhongjun/kafka_zk | scripts/producer.py | producer.py | py | 643 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "kafka.KafkaProducer",
"line_number": 10,
"usage_type": "call"
}
] |
14755447755 | import os
import cv2
import csv
import torch
from PIL import Image
from utils.metric import seg_metric
from dataset import change_image_channels
from dataset import change_image_channels_noclahe
# from res_unet import Unet
# from InceptionRes import Unet
# from InceptionRes1 import Unet
# from InceptionRes... | ikkbic/My-Repositories | segmention_models-2/model_test.py | model_test.py | py | 2,693 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ResAttentionU.Unet",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "torch.load",
"line... |
24416311115 | import os
import time
import json
import retrying
from fabric import Connection
from subprocess import check_output
from tempfile import NamedTemporaryFile
def get_json_result(command: str):
command = command + ' --json'
text = check_output(command.split())
return json.loads(text)
def get_node(node_id:... | cloudify-cosmo/cloudify-managed-nagios-plugin | examples/test_scripts/update_example.py | update_example.py | py | 6,405 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "subprocess.check_output",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "subprocess... |
43967416676 | #!/usr/bin/env python
import logging
import argparse
from cpt_gffParser import gffParse, gffWrite
from gff3 import feature_lambda, feature_test_type
from guanine import GuanineClient
logging.basicConfig(level=logging.INFO)
logging.getLogger("requests").setLevel(logging.CRITICAL)
log = logging.getLogger(__name__)
g = G... | TAMU-CPT/galaxy-tools | tools/464/assessment2-admin.py | assessment2-admin.py | py | 4,351 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.CRITICAL... |
73944784508 | import atexit
import functools
import sys
import traceback
import gym
import numpy as np
class DrawerOpen:
def __init__(self, config, size=(128, 128)):
import metaworld
import mujoco_py
self._env = metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_drawer_open_v2.SawyerDrawerOpenEnvV2()
s... | conglu1997/v-d4rl | baselines/lompo/wrappers.py | wrappers.py | py | 17,277 | python | en | code | 64 | github-code | 6 | [
{
"api_name": "metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_drawer_open_v2.SawyerDrawerOpenEnvV2",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "metaworld.envs",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usa... |
26040495336 | from __future__ import annotations
import stat
from asyncio import Future
from pathlib import Path
from textwrap import dedent
from typing import NoReturn
from unittest.mock import MagicMock, Mock
import pytest
from pants.backend.javascript.subsystems import nodejs
from pants.backend.javascript.subsystems.nodejs imp... | pantsbuild/pants | src/python/pants/backend/javascript/subsystems/nodejs_test.py | nodejs_test.py | py | 9,931 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "pants.testutil.rule_runner.RuleRunner",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pants.backend.javascript.subsystems.nodejs.rules",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "pants.backend.javascript.subsystems.nodejs",
"line_num... |
17366157319 | from __future__ import annotations
from abc import ABC, abstractmethod
from enum import StrEnum
from loguru import logger
import battle_state
import dice
import uprising_units
class ResultModificationTarget(StrEnum):
PLAYER = "Player"
ENEMY = "Enemy"
class ResultModification(ABC):
def __init__(self) -> No... | KristianOzol/uprising-battle-simulator | result_modifier.py | result_modifier.py | py | 9,731 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.StrEnum",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "battle_state.BattleState",
... |
29557815668 | import sqlite3
#creates a table with the given information
def create_table():
try:
db = sqlite3.connect('ebookstore_db')
cursor = db.cursor()
cursor.execute('''CREATE TABLE books(book_id INTEGER PRIMARY KEY,
title varchar(255) NOT NULL,
... | Levz86/Level_2 | Task 13/ebookstore.py | ebookstore.py | py | 4,769 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
... |
44960521566 | from flask import Flask
from sqlalchemy import create_engine
from dotenv import load_dotenv
from model import AuthDao
from service import AuthService
from view import create_endpoints
class Services:
pass
def create_app(test_config=None):
load_dotenv()
app = Flask(__name__)
if test_config is None... | sangmin7648/flask-layered-template | app.py | app.py | py | 763 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "model.AuthDao... |
38255502890 | from django.shortcuts import render, redirect
from django.contrib.auth.decorators import permission_required
from django.http import JsonResponse
from hknweb.coursesemester.models import Course
from .models import (
CoursePreference,
Slot,
Tutor,
TutorCourse,
TimeSlot,
TimeSlotPreference,
Ro... | Gabe-Mitnick/hknweb | hknweb/tutoring/views.py | views.py | py | 8,614 | python | en | code | null | github-code | 6 | [
{
"api_name": "models.Room.objects.all",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "models.Room.objects",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "models.Room",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "models.S... |
12993398272 | import sys
import os
# path = os.path.join(os.path.dirname(__file__), os.pardir)
fwd = os.path.dirname(__file__)
sys.path.append(os.getcwd())
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from ast import literal_eval
from source.utils import load_route_naw, plot_route, an... | efkag/ant_world_alg_bench | Results/newant/failed-trials-analysis.py | failed-trials-analysis.py | py | 3,370 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number... |
4149743471 |
import os
import datetime
dt = datetime.datetime.now()
today = dt.strftime("%A_%d_%B_%Y")
if not os.path.isdir("C:\\StardewValley_Backup"):
os.makedirs("C:\\StardewValley_Backup")
User_name = input("윈도우 사용자 이름을 입력해주세요: ")
dir1 = 'C:\\Users\\'
dir2 = "\\AppData\\Roaming\\StardewValley\\Saves"
re... | Minsuh1204/StardewValley_backup_program | stardewvalley_backup(V1.1).py | stardewvalley_backup(V1.1).py | py | 1,016 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
26501886827 | from django import forms
from .models import Contact, Prospect , User, Invoice, Activities, Shipment_order, Lead, Shipment,Employee_Records, Campaign, Customer, Branch, Assortment,Case
from django.urls import reverse_lazy
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Subm... | MovingBox101/TOLADOL-TIS | tdolcrm/forms.py | forms.py | py | 3,930 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "crispy_forms.helper.FormHelper",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
12963730222 | from math import ceil
import torch
import torch.nn.functional as F
from torch.nn import Linear
from torch_geometric.nn import DenseSAGEConv, dense_diff_pool, JumpingKnowledge
class Block_1hop(torch.nn.Module):
# If we only connect up to 1-hop neighbors, jumping knowledge is always False.
def __init__(self, i... | yinanzhangepfl/multigraph-classification | diff_pool6_max.py | diff_pool6_max.py | py | 6,721 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch_geometric.nn.DenseSAGEConv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional.relu",
"line_number": 20,
"usage_type": "call"
},
{
"api_name":... |
24194369973 | import numpy as np
import modeldata
import os
import itertools
from matplotlib import pyplot
from fractions import Fraction
filename = os.path.basename(__file__)
g_scalefact = 5
g_widthfact = 1
g_heightfact = 1.75
g_fontsize = 6.5*g_scalefact
g_tickfontsize = 5.5*g_scalefact
# The width of a two-column revtex column. ... | shencebebetterme/pyTN | scaldim_plot.py | scaldim_plot.py | py | 21,235 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.basename",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
3677148061 | from mrjob.job import MRJob
class MRWordCount(MRJob):
def mapper(self, _, line):
yield (line.split(',')[2], int(line.split('$')[1].split(',')[0].split('.')[0]))
def reducer(self, key, values):
s = 0 #sum of primes
c = 0 #number of primes
for p in values:
s += p
... | TheMioa/WPBD | avg_salaries.py | avg_salaries.py | py | 411 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mrjob.job.MRJob",
"line_number": 2,
"usage_type": "name"
}
] |
32475265863 | import pyaudio
import wave
def record_and_save_wav(filename, duration=5, sample_rate=16000, channels=1, chunk_size=1024):
audio_format = pyaudio.paInt16
audio = pyaudio.PyAudio()
stream = audio.open(format=audio_format, channels=channels,
rate=sample_rate, input=True,
... | Jananzzzz/medical_robot | main/record_audio.py | record_audio.py | py | 1,167 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyaudio.paInt16",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pyaudio.PyAudio",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "wave.open",
"line_number": 27,
"usage_type": "call"
}
] |
2000420066 | from __future__ import annotations
from django.views.generic import TemplateView
from django_vue import VueComponentMixin
class VueSingleFileComponent(VueComponentMixin, TemplateView):
def __init__(self, template_name: str = None):
super().__init__()
if template_name:
self.template_n... | maximdeclercq/django-vue | django_vue/views.py | views.py | py | 1,196 | python | en | code | 55 | github-code | 6 | [
{
"api_name": "django_vue.VueComponentMixin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.views.generic.TemplateView",
"line_number": 8,
"usage_type": "name"
}
] |
29987050832 | from django import forms
from report_view.models import Report
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Button
from crispy_forms.bootstrap import FormActions
class ReportForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ReportForm, self).__init__(... | ShmulikArmon/qa_report | report_view/forms.py | forms.py | py | 680 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "crispy_forms.helper.FormHelper",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": ... |
36040314856 | import typing
from PyQt5.Qt import QColor
from PyQt5.QtChart import QChart, QValueAxis
from PyQt5.QtWidgets import QGroupBox, QLineEdit, QFormLayout
from ParadoxTrading.Utils import DataStruct
class SeriesAbstract:
BAR = 'bar'
LINE = 'line'
SCATTER = 'scatter'
CANDLE = 'candle'
def __init__(
... | ppaanngggg/ParadoxTrading | ParadoxTrading/Chart/SeriesAbstract.py | SeriesAbstract.py | py | 2,029 | python | en | code | 51 | github-code | 6 | [
{
"api_name": "typing.Sequence",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "typing.Sequence",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "typing.Any",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWid... |
2724538427 | import sqlite3
from graph import Graph
query = (' SELECT g.game_id as "game_id", g.game_name as "game_name", \n'
' u.user_id as "user_id", u.user_name as "user_name", \n'
' p.played_hrs as "played_hrs", r.rate as "rate"\n'
... | altuz/COMP4920-Project | generate_test.py | generate_test.py | py | 3,017 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "graph.Graph",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 42,
"usage_type": "call"
}
] |
7055048311 | import time, sys
import cv2, os
import numpy as np
from av import VideoFrame
from aiortc import MediaStreamTrack
from util import PreTxUtility
ROOT = os.path.dirname(__file__)
class CustomVideoTrackRTClient(MediaStreamTrack):
"""
A video stream track that transforms frames from an another track.
"""
... | ahmad-hl/NebulaWebrtcMCG | WebRTC_wcapture/custom_video_track_client.py | custom_video_track_client.py | py | 2,331 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "aiortc.MediaStreamTrack",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "util.PreTxUtility.... |
44068216354 | # mongodb likes database functions
from datetime import datetime
from uuid import uuid4, UUID
from pymongo import MongoClient
from fastapi import HTTPException
from pintrigue_backend.schemas import schemas
from pintrigue_backend.context.logger import logger
"""
Mongodb database set up
"""
settings = schemas.Setting... | sicness9/pintrigue-v2 | pintrigue_backend/database/mongodb/db_like.py | db_like.py | py | 2,817 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pintrigue_backend.schemas.schemas.Settings",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pintrigue_backend.schemas.schemas",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 19,
"usage_type": "call... |
33543986720 | import json
import os
opcao_menu = None
CAMINHO_ARQUIVO = r"C:" #Caminho do arquivo de texto onde será armazenado os produtos.
lista_produtos = []
while opcao_menu != 5:
print ('''
1) Cadastrar produto.
2) Consultar produtos por faixa de preço.
3) Gravar produtos em arquivo.
4) Carregar produtos do... | maisemaya/Sistema_basico_GerenciamentoDeProdutos | Sistema basico de gerenciamento de produtos.py | Sistema basico de gerenciamento de produtos.py | py | 3,817 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": "json.dump",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_numb... |
4696469759 | from typing import List, Dict
from flask import Flask, request, jsonify, render_template, redirect, flash, jsonify, abort
import mysql.connector
import json
import requests
from datetime import date, datetime, timedelta
from classes.cls_db import cls_dbAktionen
app = Flask(__name__)
app.config["DEBUG"] = True
app.co... | franny2006/da_backend_rules | app/da-rules-app.py | da-rules-app.py | py | 5,341 | python | de | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "flask.abort",
"... |
24256786046 | from typing import Final, List, Dict, Iterable, Sized
from math import sqrt, exp, pi
DATA_PATH_TEST: Final[str] = './data/test'
DATA_PATH_TRAIN: Final[str] = './data/train'
DATA_PATH_LIST: Final[List[str]] = [DATA_PATH_TRAIN, DATA_PATH_TEST]
# IMPORT DATA
def get_data(data_path: str) -> List:
output_list: List ... | erlichdominik/python-programming | ml/NBayes/NBayes.py | NBayes.py | py | 4,507 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Final",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.Final",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Final",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": ... |
81067291 | import time
import numpy as np
import torch
from pytorch_lightning import seed_everything, Trainer
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.callbacks.early_stopping import EarlyStopping
from tqdm import tqdm
import corai
from config import ROOT_DIR
from corai.src.classes.pl.histo... | Code-Cornelius/CorAI | corai/tests/pytorch_light/example_hyper_param.py | example_hyper_param.py | py | 10,066 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "corai_util.tools.src.function_writer.factory_fct_linked_path",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "config.ROOT_DIR",
"line_number": 27,
"usage_type": "argument"
},
{
"api_name": "corai_util.tools.src.function_writer.factory_fct_linked_path",
... |
36320346479 | from __future__ import annotations
from datetime import datetime
from typing import Optional, Union, Literal, TYPE_CHECKING
from .utils import _convert_timestamp
from .mixins import CacheClient, CacheObject
if TYPE_CHECKING:
from . import responses
from .champion import Champion
from .cache import DataCa... | DevilXD/aRez | arez/bounty.py | bounty.py | py | 2,256 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "mixins.CacheClient",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "cache.DataCache",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "typing.Optiona... |
72683690747 | import os
import json
from jinja2 import Environment, FileSystemLoader
class HTMLPublisher:
def __init__(self, directory, template_path=None):
self.directory = directory
self.username = directory.split("-")[0] if "-" in directory else None
if not template_path:
# If no ... | rshin7/archive-reddit-user | archive_reddit_user/html_publisher.py | html_publisher.py | py | 1,829 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line... |
20564623851 | import os
import json
import numpy as np
import cmdstanpy
import logging
from .utils import package_paths
from .stan_models.transient.decay_exponential import DecayExponential
# configure logger to prevent output
_logger = logging.getLogger("cmdstanpy")
_logger.addHandler(logging.NullHandler())
_logger.propagate = ... | cfrontin/dartboard | src/dartboard/transient.py | transient.py | py | 6,160 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.NullHandler",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "utils.pack... |
9897800071 | import argparse
import os
import glob
import json
import subprocess
def readJson(filePath):
""" JSONファイルを読み込んで返します
filePath: jsonファイルパス
"""
with open(filePath, 'r') as f:
ret = json.load(f)
# あとから作られたパラメータの初期値を。。
if not 'useOpenvino' in ret:
ret['useOpenvino'] = True
retu... | nuuuuume/sd-ov-tools | batch_img2img_ov.py | batch_img2img_ov.py | py | 5,395 | python | ja | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_number"... |
45309207506 | from django.test import TestCase
from api.serializers import CulturaSerializer, ComunicadoFullSerializer, ComunicadoSerializer
from proagro import util_proagro
from proagro.models import Cultura
class SerializerTest(TestCase):
""" Test employee serializer """
def setUp(self):
self.cultura, _ = Cultu... | julioriffel/Desafio-Softfocus-Proagro-Facil | api/tests/test_serializer.py | test_serializer.py | py | 1,636 | python | it | code | 1 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "proagro.models.Cultura.objects.get_or_create",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "proagro.models.Cultura.objects",
"line_number": 12,
"usage_type": "attri... |
73829660986 | import json
import hashlib
import os.path
import shutil
import zipfile
import pathlib
# test_extract_archive
def create_zip_file(path: str, zipfile_name: str) -> str:
hash_string = ""
with zipfile.ZipFile(f"data_for_tests/{zipfile_name}", "w") as zip_file:
for foldername, _, filenames in os.walk(f"dat... | FeltsAzn/TestTaskRadium | tests/utils/tools.py | tools.py | py | 2,540 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.walk",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.path.path.join",
"line_nu... |
35414868339 | import sqlite3
import click
from flask import current_app, g
from flask.cli import with_appcontext
# 创建一个数据库的连接,所有查询和操作都通过这个连接来执行,并在结束后关闭。
# 在 web 应用中连接往往与请求绑定,在处理请求时创建连接,返回响应之前关闭连接。
def get_db():
if 'db' not in g:
g.db = sqlite3.connect(
current_app.config['DATABASE'],
detect_type... | Mcontrite/python-projects | flask-flaskr/flaskr/db.py | db.py | py | 2,605 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "flask.g",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.g.db",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": ... |
18936931753 | import torch
import torch.nn as nn
import numpy as np
from torch.utils.data import DataLoader
from torch.nn.parallel import DistributedDataParallel
from torch.utils.data.distributed import DistributedSampler
import torch.optim as optim
from data.domain_dataset import DistributedBalancedSampler,BalancedSampler
from torc... | arfeen93/MAMC-Net | methods.py | methods.py | py | 19,765 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "numpy.random.default_rng",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.ran... |
6032832238 | """
Monkey patching of distutils.
"""
import sys
import distutils.filelist
import platform
import types
import functools
from importlib import import_module
import inspect
from setuptools.extern import six
import setuptools
__all__ = []
"""
Everything is private. Contact the project team
if you think you need this ... | freakboy3742/chaquopy | product/gradle-plugin/src/main/python/setuptools/monkey.py | monkey.py | py | 9,793 | python | en | code | null | github-code | 6 | [
{
"api_name": "platform.python_implementation",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "inspect.getmro",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "setuptools.extern.six.class_types",
"line_number": 40,
"usage_type": "attribute"
},
{
... |
74182983869 | import sqlalchemy.exc as e
from app.models.events_invitations_model import EventInvitationSchema, EventsInvitationsModel
from http import HTTPStatus
from flask_jwt_extended import get_jwt_identity
from flask import current_app, request
from flask_restful import abort
from app.models.users_model import UsersModel
from a... | hadouken726/Dominus | app/services/events_service.py | events_service.py | py | 4,558 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.services.base_service.BaseService",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "flask.current_app",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "app.models.events_model.EventSchema",
"line_number": 25,
"usage_type": "call"... |
40880856924 | ## Topic Classification: Based on the roots of each sentence, including noun (NN), verb (VB), and adjective (JJ)
## Training set: 300 sentences
## Testing set: 300 sentences
## Use Logistic Regression to classify sentence into relevant topics
## 6 topics: fiscal_stance, fiscal_analysis, economic_condition, monetary_pol... | utipe/imf_fiscal | code/topic.py | topic.py | py | 3,589 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
32509272953 | import torch
import time
from torch import cuda
from sklearn.datasets import load_boston
from PIL import Image
import numpy as np
from glob import glob
'''
# Boston 집값을 2D-Tensor 로 표현
# Feature: 13? 14rodml (Column으로 이루어져 있음)
boston = load_boston() # load_boston 함수: numpy의 array type으로 반환
# Matrix (Row, C... | JEONJinah/Shin | manipulate_tensor.py | manipulate_tensor.py | py | 13,913 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "torch.FloatTensor",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "torch.FloatTensor",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "torch.add",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "torch.FloatTensor",
... |
34521839445 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''dane.py
Taxes of the Czech Republic
'''
import numpy as np
import math
import matplotlib.pyplot as plt
import operator
import scipy.integrate as integrate
def dan(schema, m):
'''Vrací daň při definovaném daňovém schématu a mzdových nákladech m'''
delka = len(... | pirati-byro/analytika | dane/dane.py | dane.py | py | 6,260 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "matplotlib.rc",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 127,
"usage_type": "name"
},
{
"api_name": "matplot... |
1688525276 | import pip
import pygame
from pygame.locals import *
import random
pygame.init()
clock = pygame.time.Clock()
fps = 60
screen_width = 864 #define the width
screen_height = 936 #define the height
screen = pygame.display.set_mode((screen_width, screen_height)) #create the screen with W&H
pygame.display.set_caption('... | VeXs13/Flappy-bird-pygame | main.py | main.py | py | 7,096 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.time.Clock",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",... |
22736064482 | import gym_examples
from gym_examples.wrappers import RelativePosition
import os
import gym
from stable_baselines3 import DQN
from stable_baselines3.dqn.policies import MlpPolicy
import numpy as np
import matplotlib.pyplot as plt
from stable_baselines3.common.evaluation import evaluate_policy
from stable_baselines3.com... | pericles01/Pathfinder-Reinforcement-learning | RL/train.py | train.py | py | 4,953 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "stable_baselines3.common.callbacks.BaseCallback",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_nam... |
34324745766 | import sys, re
import matplotlib.pyplot as plt
import numpy as np
theta_list = []
x_list = []
y_list = []
def main():
if len(sys.argv) != 2:
print("modo de usar: <este_programa> <arquivo_csv>")
sys.exit()
csv_file = sys.argv[1]
with open(csv_file, "r") as arquivo:
classes = arquiv... | elmadjian/pcs5735 | linear_regression.py | linear_regression.py | py | 3,359 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.dot",
"line_number": 4... |
72532372349 | # pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=no-member
import asyncio
import json
from collections.abc import AsyncIterable, Callable
from pathlib import Path
from typing import Any, Final
from unittest.mock import AsyncMock
import aiodocker
import pytest
from aiodocker.... | ITISFoundation/osparc-simcore | services/dynamic-sidecar/tests/unit/test_api_workflow_service_metrics.py | test_api_workflow_service_metrics.py | py | 16,389 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "typing.Final",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "typing.Final",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "typing.Final",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "pytest.FixtureRequest",
"l... |
21795199273 | # (c) 2015-2018 Acellera Ltd http://www.acellera.com
# All Rights Reserved
# Distributed under HTMD Software License Agreement
# No redistribution in whole or part
#
import numpy as np
from htmd.kinetics import Rates
import logging
logger = logging.getLogger(__name__)
class KineticsHMM(object):
_kB = 0.0019872041... | abdulsalam-bande/KDeep | training_with_htmd/htmd/kineticshmm.py | kineticshmm.py | py | 5,729 | python | en | code | 19 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_numb... |
30252841659 | # Virial and Polynomial fitting CPA solutions
# Author: Joseph E.S. Abrams
#The following is code for converting between molarity, molality, and osmolality of solutions for cryopreservation, the virial equations and coefficients come from
# Prickett, R. C., Elliott, J. A. W. & McGann, L. E. Application of the osmotic ... | josephabrams/follicle_updated | custom_modules/virial_eq/virial.py | virial.py | py | 20,055 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.linspace",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 131,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
... |
13977693442 | import scrapy
import json
import math
from scrapy.loader import ItemLoader
from ..items import ShopItem
class FalabellaSpider(scrapy.Spider):
name = 'falabella'
allowed_domains = ['falabella.com.co']
next_page = 1
current_page = 0
start_urls = [
f'https://www.falabella.com.co/s/browse/v1/l... | Juanesdn/product-scraper | comparalo_scraper/spiders/falabella.py | falabella.py | py | 1,971 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "scrapy.loader.ItemLoader",
... |
8563013954 | #!/usr/bin/python3
# SPDX-License-Identifier: GPL-2.0-only
# vim: set ts=4:
import json
import os
import subprocess
from .object import *
from .local_repository import *
class RemoteRepository:
def __init__(self, path: str, local: LocalRepository):
self.path = path
self.local = local
def walk(self, want: str... | vlastavesely/git-remote-example | git_example/remote_repository.py | remote_repository.py | py | 1,520 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "json.dump",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 73,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": ... |
4821783412 |
import sys
from parse_arguments import parse_arguments
from crawler_utils import crawl_urls, crawl_urls_main
from crawler_context import Context
from threading import Thread
import logging
import json
import time
if __name__ =="__main__":
context = Context()
parse_arguments(context)
if context.log_... | sinha-vaibhav/web-crawler | crawler_main.py | crawler_main.py | py | 1,923 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "crawler_context.Context",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "parse_arguments.parse_arguments",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 17,
"usage_type": "call"
},
{
"api_n... |
22142946334 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | niuzhenguo/api-discovery | discovery/conf/opts.py | opts.py | py | 1,488 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discovery.conf.api.conf",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "discovery.conf.api",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "discovery.conf.api.conf",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_... |
37791405374 | CONFIG = {
"source" : "telnet", # Possible are "telnet" | "serial"
'telnet_host' : '192.168.1.178',
'telnet_port' : 23,
'serial_port' : '/dev/ttyACM0',
'serial_baudrate' : 115200,
"separator" : " ", # Separator between variables in source data
"skip_first" : 5, # How many first lines to skip... | michalpiekos/serial-chart | serialchart2d.py | serialchart2d.py | py | 4,268 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyqtgraph.mkQApp",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pyqtgraph.GraphicsLayoutWidget",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pyqtgraph.setConfigOptions",
"line_number": 35,
"usage_type": "call"
},
{
"api_na... |
35977285466 | import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE','modelProject.settings')
import django
django.setup()
from testapp.models import Madam
from faker import Faker
from random import *
fakegen=Faker()
def genNumber():
num=randint(7,9)
num=''+str(num)
for i in range(9):
num=num+str(randint(0,9))
... | abhinav375/DjangoProjects | modelProject/populate1.py | populate1.py | py | 823 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ.setdefault",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "faker.Faker",
"li... |
11299074871 | from deepsensor import backend
import lab as B
from deepsensor.data.task import Task
def convert_task_to_nps_args(task: Task):
"""Infer & build model call signature from `task` dict
TODO move to ConvNP class?
"""
context_data = list(zip(task["X_c"], task["Y_c"]))
if len(task["X_t"]) == 1 and l... | magnusross/deepsensor | deepsensor/model/nps.py | nps.py | py | 8,421 | python | en | code | null | github-code | 6 | [
{
"api_name": "deepsensor.data.task.Task",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "deepsensor.backend.nps.AggregateInput",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "deepsensor.backend.nps",
"line_number": 21,
"usage_type": "attribute"
},... |
13073223979 | from wrapper import Wrapper
import datetime
from waiter import Waiter
class Manager(Waiter):
"""in data we put all fields we need to see in ticket!"""
def __init__(self):
self.wrap = Wrapper()
def get_full_order(self, order_id):
"""in data put all what we need to see in ticket"""
... | Michaluch/rv006devqc | app/models/manager.py | manager.py | py | 3,016 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "waiter.Waiter",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "wrapper.Wrapper",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime"... |
35227536784 | # -*- coding: utf-8 -*-
"""
Created on Sun May 14 08:13:34 2017
@author: Leon
"""
import numpy as np
import cv2
import pandas as pd
from osgeo import gdal
from math import *
def dsm_angle(dsm_name,affine_par,EX_par):
# load Dsm
ds = gdal.Open(dsm_name)
band = ds.GetRasterBand(1)
dsm_arr = band.ReadAs... | LeonChen66/UAV-and-TrueOrtho | T_ortho_py/True_Ortho.py | True_Ortho.py | py | 7,266 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "osgeo.gdal.Open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "osgeo.gdal",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_numbe... |
34252199274 | import numpy as np
import matplotlib.pyplot as plt
import sys
# Activation function
def step_function(x):
return 1 if x >= 0 else -1
# Error function
def error_function(calculated, targets):
squared_diff = (calculated - targets) ** 2
return squared_diff.mean() # Average squared error
# Perceptron traini... | gelewaut/sia | tp3/ejercicio1/main.py | main.py | py | 3,495 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.insert",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sys.maxsize",
"l... |
71782399868 | # -*- coding:utf-8 -*-
import pygame
from pygame.locals import *
import sys
import time
import csv
import tkinter,os
import tkinter.filedialog
MAP_WIDTH = 500
MAP_HEIGHT = 500
map_chip = 10
start_point = [0,0]
goal_point = [0,0]
GOAL_FLAG = False
GOAL_INIT = True
END_FLAG=False
COST_CNT=0
init_flag=True
def pygame_i... | Hira-65536/sim_kadai | main.py | main.py | py | 19,112 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "pygame.fon... |
41951753992 | """Convert natural language captions to logical captions. The function atom_predict()
converts a single sentence and returns the logical caption. Running this script
will read a json file of captions for MSVD and MSRVTT at <dset_name>_captions.json
and write the parsed dataset, which also contains logical captions, to ... | Lou1sM/video_annotation | src/semantic_parser.py | semantic_parser.py | py | 12,510 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "nltk.stem.WordNetLemmatizer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 122,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 148,
"usage_type": "call"
},
{
"api_name": "langdetect.detect_l... |
43748778786 | import numpy as np
import cv2
import time
import sqlite3
import pytesseract
from pycoral.utils import edgetpu
from pycoral.adapters import common
from pycoral.adapters import detect
start = time.time()
print("Loading Interpreter...")
interpreter = edgetpu.make_interpreter("licensemodel/detect.tflite") # load interpre... | PureBacn/ALPRTest | main.py | main.py | py | 4,538 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pycoral.utils.edgetpu.make_interpreter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pycoral.utils.edgetpu",
"line_number": 12,
"usage_type": "name"
},
{
"api_name":... |
70730332669 | import os
import cv2
faceProto = "opencv_face_detector.pbtxt"
faceModel = "opencv_face_detector_uint8.pb"
ageProto = "age_deploy.prototxt"
ageModel = "age_net.caffemodel"
genderProto = "gender_deploy.prototxt"
genderModel = "gender_net.caffemodel"
MODEL_MEAN_VALUES = (78.4263377603, 87.7689143744, 114.895847746)
age... | kapilkumarpass/dl8 | DL/mini/detect.py | detect.py | py | 3,763 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.dnn.readNet",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "cv2.dnn.readNet",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_numb... |
24994195701 | import netsvc
from osv import fields, osv
import tools
from tools.translate import _
class eagle_config_event_base( osv.osv ):
_name = 'eagle.config.event'
_description = 'Eagle Events management'
_columns = {
'name': fields.selection( [
('draft', 'Draft'),
('inst', 'Installation'),
('prod', 'Production... | factorlibre/openerp-extra-6.1 | eagle_config/config.py | config.py | py | 2,719 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "osv.osv.osv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "osv.osv",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "osv.fields.selection",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "osv.fields",
"line_nu... |
69936266108 | from fastapi import APIRouter, Depends
from sqlalchemy import orm
import db.managers.items as items_manager
import db.managers.users as users_manager
import schemas.items
from db.services import get_db
router = APIRouter(prefix="/api/items")
@router.get("/")
async def items(
db: orm.Session = Depends(get_db... | Danielto1404/bachelor-courses | python-backend/projects/digital-art/server/api/items.py | items.py | py | 1,679 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.orm",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "schemas.i... |
18680633890 | import os
from collections import defaultdict
import json
from .dataset import ClassificationTaskDataset
class iNat2018Dataset(ClassificationTaskDataset):
"""iNaturalist 2018 Dataset
Parameters
----------
path : str (default None)
path to dataset
if None, search using DATA environmen... | awslabs/aws-cv-task2vec | dataset/inat.py | inat.py | py | 5,339 | python | en | code | 96 | github-code | 6 | [
{
"api_name": "dataset.ClassificationTaskDataset",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "os.path.ex... |
1445717851 | import abc
from copy import copy
from datetime import datetime
import pandas as pd
import quandl
from .base import BaseBacktestObject
from .contract import QuandlFutures
from ..utils import keys
from ..utils.const import FuturesInfo, DEFAULT_ROLL_RULE, FutureContractMonth
from ..utils.date import date_shift
from ..ut... | thoriuchi0531/adagio | adagio/layers/longonly.py | longonly.py | py | 13,072 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utils.logging.get_logger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "base.BaseBacktestObject",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "utils.keys.lo_ticker",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_na... |
39627685407 | import torch.nn as nn
from modules.deltarnn import DeltaGRU
import torch.nn.functional as F
# Definition of a neural network model
class Model(nn.Module):
def __init__(self,
inp_size,
cla_type,
cla_size,
cla_layers,
num... | SensorsINI/DeltaGRU-cartpole | modules/models.py | models.py | py | 4,627 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.GRU",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number"... |
6083928790 | """Contains a check for proper capitalization of the summary line."""
import string
from typing import Optional
from lintel import CHECKED_NODE_TYPES, Configuration, Docstring, DocstringError
class D403(DocstringError):
description = "First word of the first line should be properly capitalized ({!r}, not {!r}).... | Mr-Pepe/lintel | src/lintel/checks/capitalized.py | capitalized.py | py | 936 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "lintel.DocstringError",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "lintel.CHECKED_NODE_TYPES",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "lintel.Docstring",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "linte... |
19279411748 | import requests
import json
url = 'http://127.0.0.1:5000/'
def post_data(data, endpoint=''):
response = requests.post(url + endpoint, json=data)
data = json.loads(response.content)
return data
req = {'no_of_requests': 50, 'no_of_contents':20, 'cache_sizes': [5,7], 'zipf':1.2}
print(post_data(data=req, ... | emylincon/cachetrace | api_example.py | api_example.py | py | 337 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
}
] |
42955099779 | import random
import sys
import pathlib
import typing
from locust import events
sys.path.append(str(pathlib.Path(__file__).resolve().parents[4] / 'lib'))
import key
from common.base import Account, Deploy, NearNodeProxy, NearUser, FunctionCall, INIT_DONE
class FTContract:
# NEAR balance given to contracts, does... | Dev-JiwonShin/bustercore | pytest/tests/loadtest/locust/common/ft.py | ft.py | py | 5,305 | 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": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "common.base.NearUser.INIT_BAL... |
24886216339 | import os
from djaio import Djaio
from aiohttp.test_utils import AioHTTPTestCase
from djaio.ext.db import DB
try:
from djaio.tests.settings.base import TEST_DB as _DB_CONF
except ImportError:
_DB_CONF = {}
class DjaioAppTestCase(AioHTTPTestCase):
async def init_db(self):
db = DB(getattr(self, 'D... | domclick/djaio | djaio/tests/__init__.py | __init__.py | py | 918 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "djaio.tests.settings.base.TEST_DB",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "aiohttp.test_utils.AioHTTPTestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "djaio.ext.db.DB",
"line_number": 15,
"usage_type": "call"
},
{
... |
37130830028 | import requests
import pathlib
import os
from dotenv import load_dotenv
from os.path import splitext
from urllib.parse import unquote, urlsplit
def get_extension(nasa_picture_url):
link_split = urlsplit(nasa_picture_url)
file_name = unquote(link_split[2])
file_extension = splitext(file_name)
return f... | FulllMental/TG-bot-NASA-SpaceX-API | fetch_nasa_apod_images.py | fetch_nasa_apod_images.py | py | 1,345 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "urllib.parse.urlsplit",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib.parse.unquote",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.... |
42979632579 | import copy
import re
import sys
import time
from pathlib import Path
from WeaponDataImageGeneratorBeta import WeaponInfoGenerator
from Errors import *
import requests
import warnings
import threading
import BungieNetAPI
warnings.filterwarnings("ignore")
with open("./weaponHashListByIndex_season19.txt",... | CaliFall/Destiny2WeaponDataImageGenerator | generateControl.py | generateControl.py | py | 4,634 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "WeaponDataImageGeneratorBe... |
30331631825 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import weakref
import threading
from functools import wraps
# ###### copy from werkzeug.local #######
# since each thread has its own greenlet we can just use those as identifiers
# for the context. If greenlets are not available we fall back to the
# current thread ident... | 631068264/learn_crawler | python-scraping/base/smartpool.py | smartpool.py | py | 7,385 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "threading.Lock",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "threading.current_thread",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "_thread.get_ident",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "functools.w... |
20860101409 | import json
import csv
import os
from datetime import datetime
#Global data
global name_counter
global x
#Menu for the user
def start():
print("1.Make a reservation")
print("2.Cancel a reservation")
print("3.Print Scheduale")
print("4.Save scheduale to a file")
print("5.Exit\n")
#Menu for the choice of hour... | Wykoo/-Recruitment-task | main.py | main.py | py | 12,702 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": ... |
36084073018 | import discord
from discord.ext import commands
import youtube_dl
import os
TOKEN = "NzkxNjU4NDUwNjU5ODM1OTE0.X-SXYg.RlvRg9RcIgTGBjOHHwQruiZ62b8"
#pmst see osa on bot
client = commands.Bot(command_prefix="!")
#kommandid
@client.event
async def on_ready():
gens_uma_sumus = client.get_channel(108263953250951... | Naploon/Moe_bot | kolmapaev copy.py | kolmapaev copy.py | py | 2,671 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.path.isfile",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.