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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
42448338704 | from alpha_vantage.timeseries import TimeSeries
from bs4 import BeautifulSoup
import json
with open("config.json", "r") as config_file:
config = json.load(config_file)
api_key = config.get("api_key")
print("apik key: ", api_key)
ts1 = TimeSeries(key=api_key)
# Retrieve the monthly time series data for AAPL
# da... | tokyo-lab/alpha | data_using_alpha_vantage_package.py | data_using_alpha_vantage_package.py | py | 554 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "alpha_vantage.timeseries.TimeSeries",
"line_number": 11,
"usage_type": "call"
}
] |
8704975946 | import time
from stable_baselines3 import PPO, A2C
from batkill_gym import BatkillEnv
import os
models_dir = "ppo"
logdir = f"logs"
if not os.path.exists(models_dir):
os.makedirs(models_dir)
if not os.path.exists(logdir):
os.makedirs(logdir)
env = BatkillEnv()
env.reset()
TIMESTEPS = 100000
model = PPO('MlpPoli... | polako/batkill | batkill_ai_train.py | batkill_ai_train.py | py | 595 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_numb... |
42123413608 | import datetime
from collections import namedtuple
import isodate
from .. import build_data_path as build_data_path_global
from ..input_definitions.examples import LAGTRAJ_EXAMPLES_PATH_PREFIX
TrajectoryOrigin = namedtuple("TrajectoryOrigin", ["lat", "lon", "datetime"])
TrajectoryDuration = namedtuple("TrajectoryDu... | EUREC4A-UK/lagtraj | lagtraj/trajectory/__init__.py | __init__.py | py | 2,892 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "d... |
35754362412 | import pandas as pandas
import matplotlib.pyplot as pyplot
import numpy as numpy
import streamlit as st
import geopandas as gpd
import pydeck as pdk
from helpers.data import load_data, data_preprocessing, load_geo_data, geo_data_preprocessing
from helpers.viz import yearly_pollution, monthly_pollution, ranking_polluti... | natalie-cheng/pollution-project | main.py | main.py | py | 3,405 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.title",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "helpers.data.load_data",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "streamlit.header",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "streamlit.dat... |
20395581562 | """empty message
Revision ID: fbfbb357547c
Revises: 2152db7558b2
Create Date: 2021-05-07 17:56:36.699948
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'fbfbb357547c'
down_revision = '2152db7558b2'
branch_labels = None
depends_on = None
def upgrade():
# ... | metalsalmon/remote_monitoring | migrations/versions/fbfbb357547c_.py | fbfbb357547c_.py | py | 653 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.DateTim... |
22893421369 | # -*- coding: utf-8 -*-
from collective.transmogrifier.interfaces import ISection
from collective.transmogrifier.interfaces import ISectionBlueprint
from collective.transmogrifier.utils import resolvePackageReferenceOrFile
from zope.interface import classProvides
from zope.interface import implements
import os
try:
... | eikichi18/collective.jsonmigrator | collective/jsonmigrator/blueprints/source_json.py | source_json.py | py | 1,658 | python | en | code | null | github-code | 6 | [
{
"api_name": "zope.interface.classProvides",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "collective.transmogrifier.interfaces.ISectionBlueprint",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "zope.interface.implements",
"line_number": 23,
"u... |
70799503229 |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import requests
import random
from itertools import count
# Request fails unless we provide a user-agent
api_response = requests.get('https://api.thevirustracker.com/free-api?countryTimeline=US', headers={"User-Agent": "Chrome"})
... | it2515/Covid-19 | Covid19.py | Covid19.py | py | 1,590 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "numpy.ara... |
43462667811 | import pyshorteners
def shorten(url):
link = pyshorteners.Shortener()
return link.tinyurl.short(url)
if __name__ == "__main__":
url = input("Enter link for sorting:")
print(f"\n {shorten(url)}")
# https://github.com/urmil89
| urmil404/url-Sorter | main.py | main.py | py | 245 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyshorteners.Shortener",
"line_number": 5,
"usage_type": "call"
}
] |
13322067740 | import sys
import getopt
import time
import random
import os
import math
import Checksum
import BasicSender
'''
This is a skeleton sender class. Create a fantastic transport protocol here.
'''
class Sender(BasicSender.BasicSender):
def __init__(self, dest, port, filename, debug=False):
super(Sender, self)... | weichen-ua/MIS543O_Project2 | Sender.py | Sender.py | py | 2,910 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "BasicSender.BasicSender",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "Checksum.validate_checksum",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "getopt.getopt",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": ... |
71634339387 | from flask import Flask
import requests
URL="https://en.wikipedia.org/w/api.php"
app = Flask(__name__)
#configuring the server name as required
app.config['SERVER_NAME'] = "wiki-search.com:5000"
@app.route("/")
def home():
return 'Enter you query as the subdomain.'
@app.route('/', subdomain="<SEA... | jubinjacob93/Opensearch-Server | wiksearch.py | wiksearch.py | py | 1,513 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 36,
"usage_type": "call"
}
] |
40333923387 | import numpy as np
import wave
import pyaudio
from scipy.io import wavfile
from scipy import interpolate
import math
import matplotlib.pyplot as plt
#MaxVal = 2147483647
MaxVal = 2147483647
#found relavant blog post:
#http://yehar.com/blog/?p=197
def clippingFunction(inSample):
threshold = MaxVal #maximum 24 bit out... | theshieber/Spline-Filter | splinefilterPOC.py | splinefilterPOC.py | py | 3,288 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.sqrt",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.sign",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.io.wavfile.read",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "scipy.io.wavfile",
"li... |
22877254400 | import matplotlib.pyplot as plt
import math
for number in range(0,15,5):
formatString = "%0.1f" % (number/10.0)
filename = "data/stats_2000n_"+formatString+"00000th_"+str(int(number/10) + 1)+"00000times_0.600000kmin_0.200000kstep_2.000000kmax_10statsize.dat"
f = open(filename, 'r')
headers = f... | vitchyr/Research-in-Math | degree_model/data_analysis.py | data_analysis.py | py | 1,119 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": ... |
38750349973 | from imagenet_c import *
from torchvision.datasets import ImageNet
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
import os
import torch
import gorilla
DATA_ROOT = './data'
CORRUPTION_PATH = './corruption'
corruption_tuple = (gaussian_noise, shot_noise, impulse_noise, defocus_blu... | Gorilla-Lab-SCUT/TTAC | imagenet/utils/create_corruption_dataset.py | create_corruption_dataset.py | py | 1,892 | python | en | code | 37 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number"... |
30814400750 | __author__ = "https://github.com/kdha0727"
import os
import functools
import contextlib
import torch
import torch.distributed as dist
from torch.cuda import is_available as _cuda_available
RANK = 0
WORLD_SIZE = 1
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# ... | studio-YAIVERSE/studio-YAIVERSE | dist_util.py | dist_util.py | py | 3,621 | python | en | code | 20 | github-code | 6 | [
{
"api_name": "torch.distributed.is_available",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.distributed",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.p... |
18490735964 | import boto3
import json
import uuid
print('Loading function')
def lambda_handler(event, context):
bucketName = event['Records'][0]['s3']['bucket']['name']
fileName = event['Records'][0]['s3']['object']['key']
return detect_labels_and_put_dynamoDB(fileName, bucketName)
def detect_labels_and_put_dynam... | Samir42/RekognitionService | RekognitionLambda.py | RekognitionLambda.py | py | 1,249 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "boto3.client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 25,
"usage_type": "call"
}
] |
25144655510 | # pylint: disable=W0611, E0401
"""
Main goal of this module is to scrape and parse data from "visityerevan.am" website
"""
import logging
import sys
from dataclasses import dataclass
from urllib.parse import urljoin
from httpx import Client
from selectolax.parser import HTMLParser, Node
logger = loggi... | EPguitars/events-parsing-archive | standalone/scraper_visityerevan.py | scraper_visityerevan.py | py | 6,391 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.St... |
72279625789 | import firebase_admin
import googleapiclient
from firebase_admin import credentials
from firebase_admin import db
import os
from os.path import join, dirname
from dotenv import load_dotenv
from XmlParser import XmlParser
class FirebaseService:
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(dotenv_p... | CIDRA4023/Hologram-backend | FirebaseService.py | FirebaseService.py | py | 2,457 | python | ja | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
... |
71861349309 | import os
import sys
# 修改工作目录为程序所在目录,这样通过注册表实现开机自动启动时也能获取到正确的工作目录
# PS: 放到这个地方,是确保在所有其他初始化代码之前先修改掉工作目录
dirpath = os.path.dirname(os.path.realpath(sys.argv[0]))
old_path = os.getcwd()
os.chdir(dirpath)
import argparse
import datetime
import time
from multiprocessing import freeze_support
import psutil
import ga
from... | fzls/djc_helper | main.py | main.py | py | 10,763 | python | zh | code | 319 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_numbe... |
21897871134 | import got3
import pymongo
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
# connect to mongo deamon
connection = pymongo.MongoClient("mongodb://localhost")
# connect to the collection called uber_tweets in the kubrick db
db = connection.kubrick.uberban_tweets
count = 0
try:
while True:
... | JackJoeKul/cities-in-need | Old UberBan Tweets Scrape + Sentiment Analysis/old_tweets.py | old_tweets.py | py | 906 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "got3.manager.TweetCriteria",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "got3.manager",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "got3.... |
35988325228 | import joblib
model = None
def init_model(
db,
model_themes_path='./flaskr/model/log_reg_themes',
model_cats_path='./flaskr/model/log_reg_cats'
):
global model
cur = db.cursor()
query = """
select id from theme order by id;
"""
cur.execute(query)
theme_ids = [id[0] for id in ... | dimayasha7123/kursach3 | flaskr/model/model.py | model.py | py | 1,979 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "joblib.load",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "joblib.load",
"line_number": 39,
"usage_type": "call"
}
] |
3167027289 | #!/usr/bin/env python3
import random
from typing import Tuple
from functions.aes import AESCipher, pkcs7_pad, get_blocks, gen_random_bytes
def _encryption_oracle(bytes_: bytes) -> Tuple[bytes, str]:
key = gen_random_bytes(16)
iv = gen_random_bytes(16)
prefix = gen_random_bytes(random.randint(5, 10))
... | svkirillov/cryptopals-python3 | cryptopals/set2/challenge11.py | challenge11.py | py | 1,185 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "functions.aes.gen_random_bytes",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "functions.aes.gen_random_bytes",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "functions.aes.gen_random_bytes",
"line_number": 12,
"usage_type": "call"
... |
24506033331 | from nose.tools import eq_
from mock import patch, Mock, sentinel
from noderunner.process import open_process
@patch("subprocess.Popen", return_value=sentinel.proc)
def test_open_process(p):
ret = open_process(sentinel.fd,
sentinel.secret,
nodepath=sentinel.node_path... | williamhogman/noderunner | tests/test_process.py | test_process.py | py | 379 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "noderunner.process.open_process",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "mock.sentinel.fd",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "mock.sentinel",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "mock... |
14025841679 | """
@author: Yuhao Cheng
@contact: yuhao.cheng[at]outlook.com
"""
#!!!!! ignore the warning messages
import warnings
warnings.filterwarnings('ignore')
import os
import pickle
import math
import torch
import time
import numpy as np
from PIL import Image
from collections import OrderedDict
import torchvis... | YuhaoCheng/PyAnomaly | pyanomaly/core/engine/functions/memae.py | memae.py | py | 3,913 | python | en | code | 107 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "abstract.base_engine.BaseTrainer",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "pyanomaly.core.utils.AverageMeter",
"line_number": 33,
"usage_type": "call"
},
... |
30168009886 | import requests
import pandas as pd
import arrow
import warnings
import io
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import smtplib
import logging
warnings.filterwarnings('ignore', 'Unverified HTTPS request')
url = "https://protect.cylance.com/Reports/ThreatDataReport... | cmoxley1/Cylance | MemTDREmail.py | MemTDREmail.py | py | 2,128 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "arrow.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "email.mime.multipart.MIMEMultipart",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "... |
27867118318 |
import tensorflow as tf
from utils.nn import linear
from .tdnn import TDNN
def embed_characters(input, vocab_size, embed_dim=40, scope=None, reuse=None,
use_batch_norm=True, use_highway=True, highway_layers=2):
""" Character-level embedding """
with tf.variable_scope(scope or 'Embedder') as scop... | therne/logue | models/embedding.py | embedding.py | py | 2,203 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.variable_scope",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.unpack",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorflow.transpose",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tens... |
6827552389 | """ https://adventofcode.com/2020/day/10 """
from typing import Dict, List
from collections import defaultdict
Adapters = List[int]
def part1(adapters: Adapters) -> int:
""" O(nLogn) solution """
jolts = 0
diffs: Dict[int, int] = defaultdict(int)
for adapter in sorted(adapters):
diffs[adapt... | pozhega/AoC | 2020/d10.py | d10.py | py | 1,164 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 13,
"usage_type": "call"
}
] |
41236533985 | import rest_framework.authentication
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
from rest_framework import permissions
from user.auth.auth import JwtQueryParamsAuthentication
schema_view = get_schema_view(
openapi.Info(
title="接口文档",
default_version="1.0",
term... | beishangongzi/porcelain-backend | swagger_doc/views.py | views.py | py | 653 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "drf_yasg.views.get_schema_view",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi.Info",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "dr... |
20157578435 | import numpy as np
import pandas as pd
import time
from metric import SampleScore,EventScore, AdjustedMutualInfoScore
from joblib import Parallel, delayed
class Experiment:
def __init__(self,algorithms:list, configurations:list, thresholds = np.linspace(0,1,101),njobs=1,verbose = True) -> None:
"... | thibaut-germain/lt-normalized | src/experiment.py | experiment.py | py | 7,754 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.linspace",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.clip",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.clip",
"line_number": 3... |
21998584846 | from typing import List
class Solution:
def findPeakElement(self, nums: List[int]) -> int:
n = len(nums)
left = 0
right = n - 1
def get_num(i):
if i == -1 or i == n:
return float('-inf')
return nums[i]
ans = -1
while right >... | hangwudy/leetcode | 100-199/162. 寻找峰值.py | 162. 寻找峰值.py | py | 620 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
36153730574 | import boto3
import traceback
import datetime
import os
from botocore.exceptions import ClientError
from ..models.bucket import Bucket
from ..util.preprocessor import preprocess
"""
S3 functions
"""
def get_active_bucket_or_create_new(username):
"""
Returns the user's current active bucket. If there are no ... | jkausti/flask-textsapi | app/textsapi/service/s3buckets.py | s3buckets.py | py | 5,725 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "models.bucket.Bucket.sort.startswith",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "models.bucket.Bucket.sort",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "models.bucket.Bucket",
"line_number": 25,
"usage_type": "name"
},
... |
6854075721 | from flask import Flask,request,render_template,redirect, url_for
from flask import jsonify
import requests
from cassandra.cluster import Cluster
from collections import OrderedDict
app = Flask(__name__)
KEYSPACE = "twitterkeyspace"
@app.route('/', methods=['GET'])
def home():
if request.method == 'GET':
return r... | piyush-jain1/Databases | Cassandra/Assignment2/app.py | app.py | py | 3,427 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask.render_templ... |
70078444988 | import logging
import math
import threading
import time
import torch
#import support.kernels as kernel_factory
from ...support.kernels import factory
from ...core import default
from ...core.model_tools.deformations.exponential import Exponential
from ...core.models.abstract_statistical_model import AbstractStatistic... | lepennec/Deformetrica_coarse_to_fine | core/models/deterministic_atlas_withmodule.py | deterministic_atlas_withmodule.py | py | 45,901 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "core.models.abstract_statistical_model.AbstractStatisticalModel",
"line_number": 82,
"usage_type": "name"
},
{
"api_name": "core.default.dimension",
"line_number": 94,
"usage_type... |
1004762180 | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 11 20:06:31 2019
@author: saksake
"""
import numpy as np
from sklearn.datasets import load_iris
def datasets() :
# LOAD BOSTON HOUSING DATASET
boston = load_iris()
# MAKE FEATURE DICTIONARY
all_features = {}
for i in range(len(boston.feature_nam... | rofiqq/Machine-Learning | High_API/classifier/iris/iris.py | iris.py | py | 5,883 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.random.shuffle",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.ran... |
12704422220 | #!/usr/bin/env python3
import asyncio
import discord
import os
client= discord.Client()
TOKEN = os.getenv('USER_TOKEN')
CHANNEL_ID = int(os.getenv('CHANNEL_ID'))
MESSAGE = os.getenv('MESSAGE')
def lambda_handler(event, context):
print("lambda start")
client.run(TOKEN, bot=False)
@client.event
async def on_re... | mgla/lambda-discord-messager | lambda_function.py | lambda_function.py | py | 580 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.Client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
... |
30489464890 | from .master import Master
import numpy as np
import poselib
import time
import math
import test_module.linecloud as lineCloudTest
import test_module.recontest as recontest
import utils.pose.pose_estimation as pe
import utils.pose.vector as vector
from utils.pose import dataset
from utils.pose import line
from utils.... | Fusroda-h/ppl | domain/olc.py | olc.py | py | 5,682 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "static.variable.RANDOM_SEED",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "... |
74128409788 | from collections import deque
def find_correct(string):
stack = []
for c in string:
if c == "[" or c == "{" or c == "(":
stack.append(c)
else:
if "[" in stack and c == "]" and stack[-1] == "[":
stack.pop()
elif "{" in stack and c == "}" and st... | Dayeon1351/TIL | programmers/level2/괄호회전하기/solution.py | solution.py | py | 781 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 23,
"usage_type": "call"
}
] |
9007439548 | """
Week 2 - Data mining
By Christopher Diaz Montoya
"""
# Problem 1!!
store=[] # Empty array to store values
for a in range (1000, 2000): # Loop to check over all numbers in range
if (a % 11 == 0) and not (a % 3 == 0):
# Above line makes sure if multiple of 11 and not of 3 execute line below
sto... | diaz080800/Python-programming | Week 2/Week2.py | Week2.py | py | 6,360 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.product",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 74,
"usage_type": "name"
},
{
"api_name": "matplotl... |
15802748190 | from django.conf.urls import url, include
from django.contrib import admin
from rest_framework.documentation import include_docs_urls
api_patterns = [
url(r'^docs/', include_docs_urls(title='Documentation')),
url(r'^', include(('my_website.apps.youtube_download.urls', 'youtube_download'), namespace='yout... | zsoman/my-website | my_website/urls.py | urls.py | py | 902 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "rest_framework.documentation.include_docs_urls",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
... |
23915032189 | from django.contrib.auth.decorators import login_required
from django.contrib.auth import login
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from apps.data.models import Entry
from apps.data.forms import DataForm
from django.conf import settings
from django.core.u... | msakhnik/just-read | apps/data/views.py | views.py | py | 1,497 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render_to_response",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.template.RequestContext",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 11,
"us... |
33272837414 | import concurrent.futures
import timeit
import matplotlib.pyplot as plt
import numpy
from controller import Controller
def mainUtil():
result = []
for i in range(50):
c = Controller(300)
c.GradientDescendAlgorithm(0.000006, 1000)
result.append(c.testWhatYouHaveDone())
return result
if _... | CMihai998/Artificial-Intelligence | Lab7 - GDA/main.py | main.py | py | 1,133 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "controller.Controller",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "timeit.default_timer",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "concurrent.futures.futures.ThreadPoolExecutor",
"line_number": 21,
"usage_type": "call"
},
... |
27614632298 | # coding:utf-8
from appium import webdriver
class Werdriver:
def get_driver(self):
configure = {
"platformName": "Android",
"deviceName": "PBV0216922007470",
"app": "/Users/luyunpeng/Downloads/ci_v1.5.0_2019-07-18_16-35_qa.apk",
"noReset": "true"
... | lyp0129/study_appium | get_driver/test_driver.py | test_driver.py | py | 497 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "appium.webdriver.Remote",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "appium.webdriver",
"line_number": 17,
"usage_type": "name"
}
] |
45364250336 | import pygame
import solveModuleNotFoundError
from Game import *
from Game.Scenes import *
from Game.Shared import *
class Breakout:
def __init__(self):
self.__lives = 5
self.__score = 0
self.__level = Level(self)
self.__level.load(0)
self.__pad = Pad((GameC... | grapeJUICE1/Grape-Bricks | Game/Breakout.py | Breakout.py | py | 2,928 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "pygame.transform.scale",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.transform",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame... |
74227616828 | from flask import render_template,request,redirect,url_for
from . import main
from ..request import get_news_sources,get_allArticles,get_headlines
from ..models import Sources, Articles
#views
@main.route('/')
def index():
'''
View root page function that returns the index page and its data
'''
# getti... | chanaiagwata/News_API | app/main/views.py | views.py | py | 1,612 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "request.get_news_sources",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "request.get_news_sources",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "request.get_news_sources",
"line_number": 15,
"usage_type": "call"
},
{
"api_na... |
25508679765 | #!/usr/bin/env python3
import shutil
import psutil
import socket
import report_email
import time
import os
def check_disk_usage(disk):
disk_usage = shutil.disk_usage(disk)
free = (disk_usage.free / disk_usage.total) * 100
return free > 20
def check_cpu_usage():
usage = psutil.cpu_percent(1)
return usage < ... | paesgus/AutomationTI_finalproject | health_check.py | health_check.py | py | 1,330 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "shutil.disk_usage",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "psutil.cpu_percent",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "psutil.virtual_memory",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "socket.get... |
37379213866 | #影像命名:县(0表示西秀,1表示剑河县)_序号(在points列表中的序号,从0开始)_同一位置的序号(同一位置可能有多张,标个序号,从0开始)_年份(2021之类的)_img
#施工标签命名:县(0表示西秀,1表示剑河县)_序号(在points列表中的序号,从0开始)_年份(2021之类的)_conslabel
#分类标签命名:县(0表示西秀,1表示剑河县)_序号(在points列表中的序号,从0开始)_2021_classlabel
from osgeo import gdal,osr
import pickle
import os
import numpy
def getSRSPair(dataset)... | faye0078/RS-ImgShp2Dataset | lee/clip_label.py | clip_label.py | py | 5,260 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "osgeo.osr.SpatialReference",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "osgeo.osr",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "osgeo.osr.CoordinateTransformation",
"line_number": 18,
"usage_type": "call"
},
{
"api_name"... |
1530038484 | import requests
import json
from bs4 import BeautifulSoup
def songwhip_it(url):
html = requests.get('https://songwhip.com/'+url).content
soup = BeautifulSoup(html, 'html.parser')
links_text = list(soup.findAll('script'))[2].get_text()
links_json = json.loads(links_text[links_text.index('{'):-1])['links... | kartikye/q | linker.py | linker.py | py | 415 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
}
] |
28493662472 | ###### Librerias ######
import tkinter as tk
import Widgets as Wd
import Ecuaciones as Ec
import time as tm
import threading as hilos
import numpy as np
###### Modulos De Librerias ######
import tkinter.ttk as ttk
import tkinter.messagebox as MsB
import serial
import serial.tools.list_ports
import matplotlib.pyplot as ... | daridel99/UMNG-robotica | Interfaz.py | Interfaz.py | py | 39,199 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "serial.Serial",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "serial.Serial",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number"... |
5449785498 | from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import SGD
import matplotlib.pyplot as plt
from keras.datasets import cifar10
from keras.utils import np_utils
(xtrain,ytrain),(xtest,ytest) = cifar10.load_data()
print('xtrain.shape',xtrain.shape)
print('ytrain.shape',ytrain.shape... | daftengineer/kerasSagemaker | test.py | test.py | py | 1,101 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.datasets.cifar10.load_data",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "keras.datasets.cifar10",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "keras.utils.np_utils.to_categorical",
"line_number": 20,
"usage_type": "call"
},
... |
20908637143 | from python_app_configs import config
from python_generic_modules import se_os
from python_generic_modules import se_docker
import re
import os
import glob
import time
import jinja2
template1 = jinja2.Template("{% for i in range(0,last_num)%}zookeepernode{{ i }}.{{ domain }}:2181{% if not loop.last %},{% endif %}{% en... | karthikmahesh2611/docker_hadoop | python_hadoop_modules/kafka.py | kafka.py | py | 4,120 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "jinja2.Template",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "python_app_configs.config.zookeeper_nodes",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "python_app_configs.config",
"line_number": 11,
"usage_type": "name"
},
... |
74987096188 | from deep_rl_for_swarms.common import explained_variance, zipsame, dataset
from deep_rl_for_swarms.common import logger
import deep_rl_for_swarms.common.tf_util as U
import tensorflow as tf, numpy as np
import time
import os
from deep_rl_for_swarms.common import colorize
from mpi4py import MPI
from collections import d... | jparras/dla | deep_rl_for_swarms/rl_algo/trpo_mpi/trpo_mpi_attack.py | trpo_mpi_attack.py | py | 17,701 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": ... |
34142194304 | import numpy as np
import scipy.constants
from pathlib import Path
class ElectricAcceleration:
bodies = []
def __init__(self, bodies):
"""This will allow the list of particles from the Accelerator module to be inserted letting the ElectricAcceleration class calculate their acceleration"""
... | Lancaster-Physics-Phys389-2020/phys389-2020-project-twgrainger | LidlFieldV1.py | LidlFieldV1.py | py | 3,815 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_nu... |
16398002041 | import os
import pygame
from Engine import MainMenu
from Entities.Maps.SimpleCheck import SimpleCheck, ConditionsType
class BlockChecks(SimpleCheck):
def __init__(self, ident, name, positions, linked_map):
SimpleCheck.__init__(self, ident, name, positions, linked_map, True)
self.position_logic_i... | linsorak/LinSoTracker | Entities/Maps/BlockChecks.py | BlockChecks.py | py | 5,551 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "Entities.Maps.SimpleCheck.SimpleCheck",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "Entities.Maps.SimpleCheck.SimpleCheck.__init__",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "Entities.Maps.SimpleCheck.SimpleCheck",
"line_number": 11... |
23186461899 | """FECo3: Python bindings to a .fec file parser written in Rust."""
from __future__ import annotations
import os
from functools import cached_property
from pathlib import Path
from typing import TYPE_CHECKING, NamedTuple
from . import _feco3, _version
if TYPE_CHECKING:
import pyarrow as pa
__version__ = _versi... | NickCrews/feco3 | python/src/feco3/__init__.py | __init__.py | py | 5,512 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.NamedTuple",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.NamedTuple",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "os.PathLike"... |
73549678908 | __doc__ = """
Script for collection of training data for deep learning image recognition.
Saving standardised pictures of detected faces from webcam stream to given folder.
Ver 1.1 -- collect_faces.py
Author: Aslak Einbu February 2020.
"""
import os
import cv2
import datetime
import imutils
import time
import numpy... | aslake/family_deep_learning | collect_faces.py | collect_faces.py | py | 3,826 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "cv2.dnn.readNetFromCaffe",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
19092857489 | from collections import namedtuple
import csv
import gzip
import logging
import sys
import urllib.parse
csv.field_size_limit(sys.maxsize)
logging.basicConfig(level=logging.INFO)
Switch = namedtuple("Switch", ['srclang', 'targetlang', 'country', 'qid', 'title', 'datetime', 'usertype', 'title_country_src_count'])
Sessi... | geohci/language-switching | session_utils.py | session_utils.py | py | 8,958 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "csv.field_size_limit",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",... |
43346750218 | if __name__ == '__main__':
from ovh import *
import argparse
import logging
logger = logging.getLogger("ovh/download_db")
parser = argparse.ArgumentParser(description='Creates N workers on the OVH cloud.')
parser.add_argument('--db-name', default='Contrastive_DPG_v2', help='name for MySQL DB')... | charleswilmot/Contrastive_DPG | src/ovh_download_db.py | ovh_download_db.py | py | 899 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
}
] |
40128549954 | # included from libs/mincostflow.py
"""
Min Cost Flow
"""
# derived: https://atcoder.jp/contests/practice2/submissions/16726003
from heapq import heappush, heappop
class MinCostFlow():
def __init__(self, n):
self.n = n
self.graph = [[] for _ in range(n)]
self.pos = []
def add_edge(s... | nishio/atcoder | PAST3/o.py | o.py | py | 5,401 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "heapq.heappush",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_nu... |
74179568189 | '''
To run test: move into same directory as spotify_api.py file
'''
import unittest
import spotify_api
import spotipy
import pandas as pd
from spotipy.oauth2 import SpotifyClientCredentials
client_id = 'ea776b5b86c54bd188d71ec087b194d3'
client_secret = '1e0fcbac137c4d3eb2d4cc190693792a' # keep this ... | dylanmccoy/songtrackr | tests/spotify_unittest.py | spotify_unittest.py | py | 2,431 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "spotipy.oauth2.SpotifyClientCredentials",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "spotipy.Spotify",
"line_number": 23,
"usage_type": "call"
},
{
"ap... |
70327957627 | #!/usr/bin/env python3
import rospy
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
from math import sqrt, atan2, exp, atan, cos, sin, acos, pi, asin, atan2, floor
from tf.transformations import euler_from_quaternion, quaternion_from_euler
from time import sleep
import sys
import numpy as np
impor... | lucca-leao/path-planning | scripts/Astar.py | Astar.py | py | 9,706 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 158,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 167,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 167,
... |
36407185173 | import pytest
from logging import getLogger
from barbucket.domain_model.types import *
_logger = getLogger(__name__)
_logger.debug(f"--------- ---------- Testing Types")
def test_api_correct() -> None:
_logger.debug(f"---------- Test: test_api_correct")
try:
test_api = Api.IB
except AttributeEr... | mcreutz/barbucket | tests/domain_model/test_types.py | test_types.py | py | 3,398 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"lin... |
38200290752 | import speech_recognition as sr
import pyttsx3
import screen_brightness_control as sbc
import geocoder
from geopy.geocoders import Nominatim
r = sr.Recognizer()
def SpeakText(command):
engine = pyttsx3.init()
engine.say(command)
engine.runAndWait()
while(1):
try:
with sr.Microphon... | Priyanshu360-cpu/Machine-Learning | repeat_audio.py | repeat_audio.py | py | 746 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyttsx3.init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 15,
"usage_type": "call"
},
{
"api_name":... |
41682684008 | import torch
#Linear regression for f(x) = 4x+3
X= torch.tensor([1,2,3,4,5,6,7,8,9,10], dtype=torch.float32)
Y=torch.tensor([7,11,15,19,23,27,31,35,39,43], dtype= torch.float32)
w= torch.tensor(0.0,dtype=torch.float32,requires_grad=True)
def forward(x):
return (w*x)+3
def loss(y,y_exp):
return ((y_exp-y)**2... | kylej21/PyTorchProjects | linearRegression/linearReg.py | linearReg.py | py | 818 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.tensor",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.float32",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.tensor",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.float32",
"line_n... |
71053381947 | import logging
import os
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
logger.propagate = False # do not propagate logs to previously defined root logger (if any).
formatter = logging.Formatter('%(asctime)s - %(levelname)s(%(name)s): %(message)s')
# console
consH = logging.StreamHandler()
consH... | ChenShengsGitHub/structure-based-peptide-generator | cfg.py | cfg.py | py | 5,610 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.StreamHan... |
40238915211 |
from setuptools import setup, find_packages
requires = [
'buildbot',
'python-debian',
'xunitparser',
]
setup(
name='buildbot-junit',
version='0.1',
description='Junit for buildbot',
author='Andrey Stolbuhin',
author_email='an.stol99@gmail.com',
url='https://github.com/ZeeeL/buildb... | ZeeeL/buildbot-junit | setup.py | setup.py | py | 535 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 18,
"usage_type": "call"
}
] |
23378159417 | import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.nn.utils as utils
LRELU_SLOPE = 0.1
def get_padding(kernel_size, dilation=1):
return int((kernel_size*dilation - dilation)/2)
def init_weights(m, mean=0.0, std=0.01):
if isinstance(m, nn.Conv1d):
m.weight.data.normal_(me... | uuzall/hifi_gan | model.py | model.py | py | 10,620 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Conv1d",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"li... |
19124524287 | from google.appengine.ext import ndb
from components import utils
import gae_ts_mon
import config
import model
FIELD_BUCKET = 'bucket'
# Override default target fields for app-global metrics.
GLOBAL_TARGET_FIELDS = {
'job_name': '', # module name
'hostname': '', # version
'task_num': 0, # instance ... | mithro/chromium-infra | appengine/cr-buildbucket/metrics.py | metrics.py | py | 4,246 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gae_ts_mon.CounterMetric",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "gae_ts_mon.CounterMetric",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "gae_ts_mon.CounterMetric",
"line_number": 26,
"usage_type": "call"
},
{
"api_na... |
30078414055 | import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.models import Sequential
import pandas as pd
import matplotlib.pyplot as plt
from tensorflow.keras.utils import to_categorical
print(tf.__version__)
train = pd.read_csv(r"sign_m... | daxjain789/Sign-Language-MNIST-with-CNN | sign_language.py | sign_language.py | py | 2,118 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.__version__",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflo... |
45483801886 | import pickle
import numpy as np
import random
import os
import pandas as pd
import yaml
import copy
from tqdm import tqdm
from . import utils
from . import visual
import xarray as xr
from .proxy import ProxyDatabase
from .gridded import Dataset
from .utils import (
pp,
p_header,
p_hint,
p_success,
... | fzhu2e/LMRt | LMRt/reconjob.py | reconjob.py | py | 45,613 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "copy.deepcopy",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"lin... |
43347425408 | import numpy as np
import os
from collections import defaultdict, namedtuple
import re
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
class Collection(object):
def __init__(self, path):
self.path = path
self.name = path.strip("/").split("/")[-1]
self.data = defaultdict(list)
... | charleswilmot/lossy_compression | src/collection.py | collection.py | py | 5,139 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": ... |
15932161401 | import datetime
import time
import json
import six
from ..exceptions import HydraError, ResourceNotFoundError
from . import scenario, rules
from . import data
from . import units
from .objects import JSONObject
from ..util.permissions import required_perms
from hydra_base.lib import template, attributes
from ..db.mod... | hydraplatform/hydra-base | hydra_base/lib/network.py | network.py | py | 127,911 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "hydra_base.lib.attributes",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "db.model.DBSession.query",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "... |
70338202429 | #!/usr/bin/env python3
"""
The main program that will be run on the Raspberry Pi,
which is the controller for the pharmacy client.
DINs of drugs on this pharmacy should be specified in din.cfg
"""
# these libraries come with python
import logging
import datetime
import struct
import asyncio
import json
... | alimzhan2000/arka_project_on_python | drug_delivering_code.py | drug_delivering_code.py | py | 11,430 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "asyncio.sleep",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "logging... |
5892500320 | import tkinter
import requests
import ujson
import datetime
from PIL import ImageTk,Image
from tkinter import ttk
from concurrent import futures
# pip install: requests, pillow, ujson
#region Static Requests
key = 0000000000 #<-- Riot developer key needed.
# ----------- Request Session -----------
... | WandersonKnight/League-Quick-Data | MainFile.py | MainFile.py | py | 54,615 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.Session",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.Session",... |
12424083867 | __author__ = "Vanessa Sochat, Alec Scott"
__copyright__ = "Copyright 2021-2022, Vanessa Sochat and Alec Scott"
__license__ = "Apache-2.0"
from .command import Command
import json
# Every command must:
# 1. subclass Command
# 2. defined what container techs supported for (class attribute) defaults to all
# 3. define r... | syspack/paks | paks/commands/inspect.py | inspect.py | py | 2,263 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "command.Command",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "command.Command",
"line_number": 47,
"usage_type": "name"
}
] |
33022799224 | from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'yj.views.home'),
url(r'^api/', include('api.urls')),
# Include an application:
# url... | bob1b/yj | yj/urls.py | urls.py | py | 477 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 7,
"usage_type": "call"
},
{
"api... |
9836602574 | import matplotlib.pyplot as plt
import numpy as np
k=9.0e9
q=1.9e-19
d=1.0e1
t=np.linspace(0,2*np.pi,10000)
i=1
V=V=(3*k*q*(d**2)/(2*(i**3)))*np.cos(2*t)
plt.plot(t,V,color='black')
plt.xlabel('theta')
plt.ylabel('Potential')
plt.show() | Rohan-Chakravarthy/Basic-Mathematics-Programs | quad alt.py | quad alt.py | py | 247 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.linspace",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"lin... |
70789372028 | # Counting element
# Given an integer array, count element x such that x + 1 is also in array.If there're duplicates in array, count them separately.
# Example 1:
# Input: {1, 2, 3}
# Output: 2
# Explanation:
# First element is 1 + 1 = 2 (2 is present in an array)
# ... | deepk777/leetcode | 30-day-challenge-2020/April/week1/day7-counting-element.py | day7-counting-element.py | py | 1,238 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 38,
"usage_type": "call"
}
] |
39943332700 | from decouple import config
from logic import bet
My_Money = int(config('MY_MONEY'))
while True:
print('you have ' + str(My_Money))
print('do you wanna play? (yes or no)')
a = input('')
if a.strip() == 'no':
print('you are out of the game')
break
elif a.strip() == 'yes':
b =... | aliiiiaa/hw5 | 25-2_Aliia_Abyllkasymova_hw_5.py | 25-2_Aliia_Abyllkasymova_hw_5.py | py | 509 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "decouple.config",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logic.bet",
"line_number": 16,
"usage_type": "call"
}
] |
30906506351 | import mailchimp_marketing as MailchimpMarketing
from mailchimp_marketing.api_client import ApiClientError
def survey_monkey_distribute_daily(**kwargs):
api_key = kwargs['api_key']
server = kwargs['server']
try:
client = MailchimpMarketing.Client()
client.set_config({
"api_key": api_key,
"se... | GregorMonsonFD/holmly_sourcing_legacy | scripts/python/survey_monkey_distribute_daily.py | survey_monkey_distribute_daily.py | py | 525 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mailchimp_marketing.Client",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "mailchimp_marketing.api_client.ApiClientError",
"line_number": 16,
"usage_type": "name"
}
] |
33369908821 | """
A script to extract IuPS addresses from an RNC CMExport file
Works with Huawei RNC CMExport
By Tubagus Rizal
2017
"""
import xml.etree.ElementTree as ET
import glob
import pdb
def getRncInfo(xmlroot):
# get RNC info
rnc = {}
for rncInfo in xmlroot.findall(".//*[@className='BSC6900... | trizal/python-CMExportReader | getIuPS.py | getIuPS.py | py | 1,817 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 47,
"usage_type": "name"
}
] |
22049716249 | from os import name
import sys
import requests
import time
import threading
sys.path.append('../')
from DeskFoodModels.DeskFoodLib import Item, OrderStatus, Order
from PyQt5.uic import loadUi
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QCheckBox, QComboBox, QDialog, QApplication, QListWidget, QMenu, QPushBu... | YY0NII/DeskFood | Frontend/Main.py | Main.py | py | 33,421 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi"... |
37370950188 | import argparse
import openai
import json
import time
from tqdm.auto import tqdm
from settings import settings
from textwrap import dedent
def evaluate(dataset: str, gold_path, log_file: str):
"""
Returns the average score for the dataset.
Args:
dataset: Path to the json dataset
log_file: ... | ZanezZephyrs/AutoSurvey | AutoSurvey/evaluation/evaluate.py | evaluate.py | py | 5,555 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tqdm.auto.tqdm",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "tqdm.auto.tqdm",
"line_number"... |
12388726621 | import os, sys
import subprocess
import json
import uproot
import awkward as ak
from coffea import processor, util, hist
from coffea.nanoevents import NanoEventsFactory, NanoAODSchema
from boostedhiggs import HbbPlotProcessor
from distributed import Client
from lpcjobqueue import LPCCondorCluster
from dask.distribut... | jennetd/hbb-coffea | vbf-scripts/submit-plots-dask.py | submit-plots-dask.py | py | 2,206 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "lpcjobqueue.LPCCondorCluster",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "distributed.Client",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sys.argv",
... |
2705587377 | from __future__ import annotations
import abc
from collections import ChainMap
from typing import Any, ClassVar, Optional, Type, TypeVar
import attr
from basic_notion import exc
from basic_notion.utils import set_to_dict, del_from_dict
def _get_attr_keys_for_cls(
members: dict[str, Any],
only_edita... | altvod/basic-notion | src/basic_notion/base.py | base.py | py | 4,973 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "typing.Any",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "basic_notion.attr.ItemAttrDescriptor",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "abc.ABCMeta",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "... |
15419264437 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 9 14:52:17 2022
@author: elie
"""
#################### SCALING ####################
import os
os.chdir('/home/elie/Documents/Tecnico/2ND_PERIOD/DS/PROJECT/CODE/')
from pandas import read_csv, DataFrame, concat, unique
from pandas.plotting im... | elielevy3/DATA_SCIENCE_TECNICO | lab_3.py | lab_3.py | py | 5,182 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.chdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.plotting.register_matplotlib_converters",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 34,
"usage_type": "call"
},
{
"api_name"... |
41682544130 | """add unique index for modalities
Revision ID: 3cccf6a0af7d
Revises: ba3bae2b5e27
Create Date: 2018-01-05 14:28:03.194013
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3cccf6a0af7d'
down_revision = 'ba3bae2b5e27'
branch_labels = None
depends_on = None
def... | MondayHealth/provider-import | alembic/versions/3cccf6a0af7d_add_unique_index_for_modalities.py | 3cccf6a0af7d_add_unique_index_for_modalities.py | py | 749 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.create_index",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "alembic.op.f",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op.drop_index... |
30386260395 | #!/usr/bin/env python3
import os
import urllib
import requests
import config
def dump_stories():
new_stories = 0
num_stories = 0
r = requests.get(
"https://i.instagram.com/api/v1/feed/reels_tray/",
cookies=config.instagram_cookies, headers=config.instagram_headers).json()
for user in... | bl1nk/instadump | instadump.py | instadump.py | py | 2,019 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "config.instagram_cookies",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "config.instagram_headers",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name... |
3967140891 | import torch
def batch_horizontal_flip(tensor, device):
"""
:param tensor: N x C x H x W
:return:
"""
inv_idx = torch.arange(tensor.size(3) - 1, -1, -1).long().to(device)
img_flip = tensor.index_select(3, inv_idx)
return img_flip
def euclidean_dist(x: torch.Tensor, y: torch.Tensor):
... | clw5180/reid-baseline | utils/tensor_utils.py | tensor_utils.py | py | 1,068 | python | en | code | null | github-code | 6 | [
{
"api_name": "torch.arange",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.pow",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.pow",
"line_number"... |
23642650864 | # -*- coding:utf-8 -*-
#@Time : 2020/4/27 16:05
#@Author: Triomphe
#@File : vulscan.py
import importlib
import os
import sys
from PyQt5.QtCore import QObject, pyqtSignal
from vulscan.port_scan import portscan
from modules.mod_get_rootPath import get_root_path
sys.path.append(os.path.abspath(
os.path.dirname(__fi... | TriompheL/Ratel | vulscan/vulscan.py | vulscan.py | py | 2,337 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
29249896795 | import matplotlib.pyplot as plt
import seaborn as sns
from table import create_table
import pandas as pd
import streamlit as st
import plotly.tools as tls
import plotly.figure_factory as ff
import numpy as np
import plotly.express as px
from download import report_downlaoder
import os
st.image('Somaiya Header.png',wid... | rahulthaker/Result-analysis | Analysis.py | Analysis.py | py | 6,347 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.image",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "streamlit.subheader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar... |
71276866109 | import setuptools
with open("README.md", "r") as file:
long_description = file.read()
with open("requirements.txt", "r") as file:
required_packages = file.read().splitlines()
setuptools.setup(
name="labscribe",
version="0.4.7",
author="Jay Morgan",
author_email="jay.p.morgan@outlook.com",
... | jaypmorgan/labscribe | setup.py | setup.py | py | 729 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 18,
"usage_type": "call"
}
] |
38829812575 | from django.shortcuts import render , get_object_or_404 , get_list_or_404
from django.contrib.auth.decorators import login_required
from .models import Members
# Create your views here.
@login_required(login_url="/")
def onemember_record(request , name):
objlist = get_list_or_404(Members , name = name)
objlist = ... | hiteshkhatana/khatana-society-django | members/views.py | views.py | py | 1,267 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.get_list_or_404",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Members",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "django.shortcuts.render",
"line_number": 27,
"usage_type": "call"
},
{
"api_n... |
11169927859 | from rest_framework import serializers
from review_app.models import FarmersMarket, Vendor
class FarmersMarketSerializer(serializers.ModelSerializer):
rating = serializers.ReadOnlyField(source='get_rating')
class Meta:
model = FarmersMarket
fields = ['id', 'fm_name', 'fm_description', 'rating... | dhcrain/FatHen | fm_api/serializers.py | serializers.py | py | 1,092 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.ReadOnlyField",
"line_number": 6,
"us... |
19972078722 | from PIL import Image
from torchvision import transforms
import torch
import numpy as np
import pandas as pd
import sys
sys.path.append("d:\\Codes\\AI\\kaggle\\kaggle-CIFAR-10\\")
def loadImages():
# image list
images = np.zeros((300000, 3, 32, 32))
print("begining loading images")
i = 0
while True... | rowenci/kaggle-CIFAR-10 | submission/testProcessing.py | testProcessing.py | py | 947 | 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": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_nu... |
71968210427 | from django.conf.urls import url
from mainapp import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^category/(?P<category_name_slug>[\w\-]+)/$', views.view_category, name='category'),
url(r'^search_dictionary/$', views.search_dictionary, name="search_dictionary"),
url(r'^search/$',... | Gystark/Tech4Justice2016 | mainapp/urls.py | urls.py | py | 637 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "mainapp.views.index",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "mainapp.views",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.conf.... |
16172136194 | import numpy as np
from my_function import smooth_curve
from my_cnet import SimpleConvNet
from mnist import load_mnist
from my_optimizer import Adam
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
import seaborn as sns
(x_train,t_train),(x_test,t_test) = load_mnist(flatten=False)
network... | kang9kang/DL-learning | cnn/my_cnn_train.py | my_cnn_train.py | py | 3,081 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "mnist.load_mnist",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "my_cnet.SimpleConvNet",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "my_optimizer.Adam",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.random... |
26043642636 | from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import List, cast
from pants.backend.project_info import dependents
from pants.backend.project_info.dependents import Dependents, DependentsRequest
from pants.base.build_environment import get_buildroot
from pants.b... | pantsbuild/pants | src/python/pants/vcs/changed.py | changed.py | py | 6,103 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "pants.backend.project_info.dependents",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": ... |
11896448439 | from unittest import mock
from django.http import HttpRequest
from google_optimize.utils import _parse_experiments, get_experiments_variants
def test_parses_single_experiment_cookie():
request = HttpRequest()
request.COOKIES["_gaexp"] = "GAX1.2.utSuKi3PRbmxeG08en8VNw.18147.1"
experiments = _parse_experi... | danihodovic/django-google-optimize | tests/test_utils.py | test_utils.py | py | 4,156 | python | en | code | null | github-code | 6 | [
{
"api_name": "django.http.HttpRequest",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "google_optimize.utils._parse_experiments",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.http.HttpRequest",
"line_number": 16,
"usage_type": "call"
},
... |
41236219255 | """myProject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | beishangongzi/myProject | myProject/urls.py | urls.py | py | 1,926 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "... |
42862238176 | import pgzrun
import random
import time
import pygame.time
# import pygame
TITLE = "Brickbreaker"
# initial score is 0
# time is use to get the initial time and stores in the variable 'start time'
score = 0
# as ball hits the brick, score changes by 10
score_point = 10
start_time = time.time ()
elapsed_time = 0
# se... | Nirrdsh/py-game | Assignment.py | Assignment.py | py | 6,033 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "pygame.time.mouse.get_rel",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "pygame.time.mouse",
... |
32177625426 | from unittest import mock
from itertools import product
import pytest
@pytest.mark.parametrize(
'user_agent, session',
product(
[None, mock.Mock()],
[None, mock.Mock()]
)
)
def test_init(user_agent, session):
with mock.patch('Raitonoberu.raitonoberu.aiohttp') as m_aio:
from ... | byronvanstien/Raitonoberu | tests/test_raitonoberu.py | test_raitonoberu.py | py | 5,643 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "unittest.mock.patch",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "unittest.mock",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "Raitonoberu.raitonoberu.Raitonoberu",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.