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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
43296095203 | from .trainer import Trainer
import latentsafesets.utils.spb_utils as spbu
import latentsafesets.utils.plot_utils as pu
import logging
from tqdm import trange
import os
log = logging.getLogger("dyn train")
class PETSDynamicsTrainer(Trainer):
def __init__(self, params, dynamics, loss_plotter):
self.param... | albertwilcox/latent-space-safe-sets | latentsafesets/rl_trainers/pets_dynamics_trainer.py | pets_dynamics_trainer.py | py | 2,721 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "trainer.Trainer",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
28147884752 | import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB
import numpy as np
import joblib
# Function to train and save both the model and TF-IDF vectorizer
def train_and_save_model(file_path, model_save_path, vectorizer_save_path):
# Create a Dat... | HactorPK/foodforthought | backend/image to text/recipe_model.py | recipe_model.py | py | 1,819 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_excel",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.naive_bayes.MultinomialNB",
"line_number": 18,
"usage_type": "c... |
32880081643 | #!/usr/bin/env python3
import pandas as pd
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import numpy as np
def explained_variance():
df = pd.read_csv("src/data.tsv", sep="\t")
pca = PCA()
pca.fit(df)
ev = pca.explained_variance_
v = df.var()
return v, ev
def stringi... | m1t0z/mooc-data-analysis-with-python-2021 | part06-e08_explained_variance/src/explained_variance.py | explained_variance.py | py | 687 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.cumsum",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
37195979517 | import numpy as np
import pandas as pd
from sklearn.metrics import mean_squared_error, mean_tweedie_deviance, mean_absolute_error
def evaluation(model, model_name, eval_path):
"""
Given a model and a dataset, perform an evaluation using 4 different metrics.
Parameters
----------
model: Model to ... | iAguila98/mlops | MLOps_Airflow/dags/scripts/evaluation_script.py | evaluation_script.py | py | 5,407 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 77,
"usage_type": "attribute"
},
{
"api_name": "sklearn.metrics.mea... |
29396152299 | from dataclasses import asdict
from app.database.models import User
from app.database.db import CustomDatabase
from app.database.schemas import UserDataclass
class UserRepository:
def __init__(self, db: CustomDatabase) -> None:
self.db = db
async def get(self, data: UserDataclass):
query = U... | Mansur-Ashrapov/bot_for_dudes_on_sport | app/repositories/user_rep.py | user_rep.py | py | 1,269 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "app.database.db.CustomDatabase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "app.database.schemas.UserDataclass",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "app.database.models.User.select",
"line_number": 13,
"usage_type": "call... |
70681087262 | import matplotlib
matplotlib.use('TkAgg')
matplotlib.rcParams['figure.figsize'] = (18.55, 9.86)
matplotlib.rcParams['axes.titlesize'] = 'medium'
from matplotlib.lines import Line2D
import numpy as np
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import os
from analytics.utils import get_experiment_files
... | DanIulian/minigrid_rl | analytics/analyze_results_multi.py | analyze_results_multi.py | py | 4,576 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "re.sub"... |
26837074652 | # coding=utf-8
"""Blog feature tests."""
from lib.MobileDriver import MobileDriver
from pageobjects import CountrySelectionPage
from pageobjects import LanguageSelectionPage
from pageobjects import LoginPage
from pageobjects import ShopSelectionPage , TutorialPage , CatalogPage , CartPage
from selenium.webdriver.supp... | lkeanfei/Assessment | test_scenario1.py | test_scenario1.py | py | 1,737 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "lib.MobileDriver.MobileDriver",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "pytest_bdd.scenario",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "lib.MobileDriver.MobileDriver",
"line_number": 30,
"usage_type": "name"
},
{
"a... |
5940995949 | import cv2
import copy
def img_threshold(img, threshold):
"""
img = image a traiter
threshold = valeur de seuillage (sur une echelle de gris allant de 0 a 255)
group = nombre de pixels voisins d'un groupe limite amenant a sa suppression ou non (nettoyage des parasites)
output = image opencv seuille... | MaloAnceaux/projet_cupules | threshold.py | threshold.py | py | 1,784 | python | fr | code | 0 | github-code | 7 | [
{
"api_name": "copy.deepcopy",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.threshold",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_TOZERO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.threshold",
... |
35204655902 | import aiohttp
from datetime import date
from bot_settings import config
async def daily_food(auth_token: str):
headers = {'Authorization': f'Token {auth_token}'}
today_date = str(date.today())
async with aiohttp.ClientSession() as session:
async with session.get(
f'{config.user_food_... | AlexeyDemidow/MyFitApp_telegramm_bor | handlers/daily_food_handler.py | daily_food_handler.py | py | 436 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.date.today",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bot_settings.co... |
6786982210 | import os, sys, stat
import socket
import platform
import requests
import tldextract
import pandas as pd
from datetime import datetime
from pandas import ExcelFile
from pandas import ExcelWriter
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
# Check OS and use relevant driver
if p... | nikolozsec/webr | webR.py | webR.py | py | 3,879 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "platform.system",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "platform.system",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strftime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
4783026356 | """
All experiments for extension to undersampling paper.
Notes:
Might need to adjust Batch size, learning rate, and stopping
criteria for neural net.
"""
import time
start_time = time.time()
def print_verbose(txt, verbose=False):
global start_time
if verbose:
print("Time for last phase: {} s".format(... | Trinli/uplift_modeling | models/undersampling_models.py | undersampling_models.py | py | 12,642 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LogisticRegression... |
11029816843 | import pytest
import time
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.web... | niluferdone/Selenium-23.12.2022 | test_workshop.py | test_workshop.py | py | 8,311 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.wait.WebDriverWait",
"line_number": 22,
"usage_type": "call"
},... |
44548045359 | from flask import g
import uuid
import hashlib
from expungeservice.database.db_util import rollback_errors
from expungeservice.models.expungement_result import EligibilityStatus
from flask_login import current_user
def save_result(request_data, record):
user_id = current_user.user_id
search_param_string = ... | grbarker/recordexpungPDX | src/backend/expungeservice/stats/stats.py | stats.py | py | 1,486 | python | en | code | null | github-code | 7 | [
{
"api_name": "flask_login.current_user.user_id",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask_login.current_user",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "hashlib.sha256",
"line_number": 22,
"usage_type": "call"
},
{
"api... |
15746823301 | import matplotlib.pyplot as plt
#######################################################################PLOTS
def create_plot_item_pie(cat_count,cat_labels):
fig, ax = plt.subplots()
ax.pie(cat_count,labels=cat_labels,autopct='%.1f%%',shadow = True)
plt.title('item distribution per category')
plt... | m0335066/IMC_PROG2_Project_1 | kassabon_project_create_plots.py | kassabon_project_create_plots.py | py | 567 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "mat... |
24963043111 | import tensorflow as tf
import numpy as np
from ops import dense, variable_summaries
import tensorflow.contrib.slim as slim
class CNNModel:
def __init__(self, sess, CONFIG, lr_decay, lr_step, seq_maxlen):
self.n_hidden = CONFIG.n_hidden
self.n_layers = CONFIG.n_layers
self.n_classes = CONFI... | tobiasfshr/online-handwritten-character-recognition-capacitive-sensors | cnn_model.py | cnn_model.py | py | 6,445 | python | en | code | 14 | github-code | 7 | [
{
"api_name": "tensorflow.placeholder",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "... |
907979043 | # -*- coding:utf-8 -*-
from os import path
import io
try:
from lxml import etree
except ImportError:
raise Exception("Falhou ao importar modulo lxml")
from pynfe.utils.flags import XSD_FOLDER_NFE
class Validacao(object):
"""Valida documentos xml a partir do xsd informado."""
def __init__(self):
... | TadaSoftware/PyNFe | pynfe/processamento/validacao.py | validacao.py | py | 2,329 | python | pt | code | 342 | github-code | 7 | [
{
"api_name": "pynfe.utils.flags.XSD_FOLDER_NFE",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "os.path.join... |
42204100410 | '''
File name: ctc_chroma/features.py
Author: Frank Zalkow
Date: 2020
License: MIT
This file is part of the following repository:
https://github.com/fzalkow/ctc_chroma
If you use code of this reposiory, please cite:
Frank Zalkow and Meinard Müller:
Using Weakly Aligned Score–Audio Pairs to Train Deep Chroma Mod... | fzalkow/ctc_chroma | ctc_chroma/features.py | features.py | py | 5,735 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "librosa.load",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "librosa.cqt",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "librosa.core.amplitude_to_db",
... |
38279175205 |
from typing import Optional
import re
import sys
import tuwien.tiss
import tuwien.colab
import tuwien.rdb
NAME_REPLACE = re.compile(r'[^A-Za-z0-9äüößÄÜÖẞ]')
class Room:
name: str
suffix: Optional[str]
name_short: Optional[str]
alt_name: Optional[str]
room_codes: [str]
tiss_code: Optional[st... | NerLOR/tucal | python/src/tucal/fetch_rooms.py | fetch_rooms.py | py | 4,914 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"lin... |
25452316400 | from django.contrib import admin
from django.conf import settings
from .forms import BaseArticleForm
from .models import Article, Brief, Sidebar
from .models import Destination, Category, Attachment, ArticleImage
from .models import supports_video, supports_polls, supports_galleries
if supports_video:
from video.... | tBaxter/tango-articles | articles/admin.py | admin.py | py | 3,298 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "models.supports_video",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.TabularInline",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 13,
"usage_type": "name"
},
{
... |
17623111894 | import datetime
from flask import Blueprint, jsonify, request
from model.example import Example
from repository.example import ExampleRepository
app_example = Blueprint('example', __name__, url_prefix='/examples')
example_repository = ExampleRepository()
@app_example.route('', methods=['GET'])
def examples():
... | Dreampie/pesto | pesto-example/pesto_example/router/example.py | example.py | py | 1,773 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "repository.example.ExampleRepository",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "fla... |
3368941685 | from django.shortcuts import render,redirect
from address.models import Address
# Create your views here.
def home(requsest):
return render(requsest, "address/index.html")
def list(request):
# ----------------------------------------------------
# select * from address_address
#select count(*) from add... | cheahee/myappss | address/views.py | views.py | py | 2,847 | python | ko | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "address.models.Address.objects.order_by",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "address.models.Address.objects",
"line_number": 16,
"usage_type": "attribu... |
2660718578 | import torch
from torch.distributions import Categorical
class Agent(object):
def __init__(self, env):
self.env = env
#self.reset()
"""
def reset(self):
self.state = self.env.reset()
self.total_reward = 0.0
def play_step(self, net):
done_reward = None
... | rohan1198/Reinforcement-Learning-Policy-Gradient-Methods | 01_REINFORCE/lib/agent.py | agent.py | py | 1,128 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.from_numpy",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "torch.distributions.Categorical",
"line_number": 44,
"usage_type": "call"
}
] |
18963054550 | import pandas as pd
import glob
import json
import os
from tqdm import tqdm
class PodcastClaims:
# transcript claims
def __init__(self, show_uri, episode_uri, transcript_claims):
self.show_uri = show_uri
self.episode_uri = episode_uri
self.transcript_claims = transcript_claims
def divide_claims(self, sur... | ojimenezn/spotify-misinformation | preprocessing/read_podcasts.py | read_podcasts.py | py | 3,016 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "glob.glob",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 53,
... |
35474621563 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 2 16:41:09 2023
@author: ugo.pelissier
"""
from matplotlib.image import imread
from tabulate import tabulate
from tabulate import tabulate
import matplotlib.pyplot as plt
import numpy as np
import os
import time
from scipy.linalg import interpolative, rq
#-------------... | UgoPelissier/RandomizedSVD | scripts/randomized_svd.py | randomized_svd.py | py | 16,912 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "numpy.linalg.qr",
... |
28303170384 | """
进程池使用演示
进程池:作用
大量函数需要频繁销毁,创建,
先写事件函数,后创建进程池
父进程结束,进程池销毁
"""
from multiprocessing import Pool
from time import sleep, ctime, time
start = time()
# 进程池事件函数
def worker(msg):
sleep(2)
print(ctime(), "--", msg)
return 200
# 创建进程池,进程池事件,必须写在上面
pool = Pool(4) # 不写参数,默认使用机器所有内核
# 向进程池中添... | nandadao/Python_note | note/my_note/second_month/day07/pool.py | pool.py | py | 803 | python | zh | code | 0 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.ctime",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_numb... |
35779258823 | import time
from collections import namedtuple
from adafruit_pybadger import pybadger
from states import DefaultMenuItemState, MainMenu, State, StateManager
from util import ALL_COLORS, display_bg_and_text, generate_qr_code_display_group
# These are constants, try changing them and saving the file!
NAME = "Pythonist... | nnja/pycon_pybadge_2020 | code.py | code.py | py | 2,967 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "util.ALL_COLORS",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "adafruit_pybadger.pybadger.pixels",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "adafruit_pybadger.pybadger",
"line_number": 14,
"usage_type": "name"
},
{
... |
15495359464 | import json
import requests
url = "https://dsci551project-1ff87-default-rtdb.firebaseio.com/"
def ls(inp):
a = inp.split()
root = 'root'
resp = requests.get(url + root + a[1] + '.json').json()
res = json.dumps(resp , indent = 4)
return str(res)
if __name__ == '__main__':
ls() | fawzansayed/DSCI551_Project | EDFS/ls_firebase.py | ls_firebase.py | py | 304 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 11,
"usage_type": "call"
}
] |
29317257290 | import re
import rpm
from spacewalk.common import rhn_pkg
from spacewalk.common.rhnException import rhnFault
from spacewalk.server import rhnPackageUpload
CACHE_DIR = '/var/cache/rhn/reposync/'
class ContentPackage:
def __init__(self):
# map of checksums
self.checksum_type = None
self.ch... | spacewalkproject/spacewalk | backend/satellite_tools/repo_plugins/__init__.py | __init__.py | py | 2,832 | python | en | code | 640 | github-code | 7 | [
{
"api_name": "rpm.labelCompare",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "spacewalk.common.rhnException.rhnFault",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "spac... |
37531774996 | #import Classes.Person
from Classes import Person,Meeting,Course,Attendance,Class
import os
import sqlite3
import csv
class Teacher(Person.Person):
def __init__(self,userid="KKumar",name="KrishnaKumar",dob="7-6-1990",ph="33256",email="krishna3@gmail.com",type='T',dept="CSE",cou_tau="OS,SE"):
super().__ini... | ucantfindme/Aqua | src/Classes/Teacher.py | Teacher.py | py | 4,131 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "Classes.Person.Person",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "Classes.Person",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "Classes.Meeting.Meeting",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "Class... |
37381003041 | import os
from requests import get, post, delete
def get_token() -> dict:
url = 'https://api.moltin.com/oauth/access_token'
data = {
'client_id': os.getenv('CLIENT_ID'),
'client_secret': os.getenv('CLIENT_SECRET'),
'grant_type': 'client_credentials'
}
response = post(url, data=... | IBA20/FishTradeBot | moltin.py | moltin.py | py | 4,379 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 20,... |
1974531766 | from common.types import *
from common.utils import *
from model.assets import modelStoreConfig
from YOLOv5n.models.common import DetectMultiBackend
from YOLOv5n.utils.general import non_max_suppression, xyxy2xywh
from .functions import *
import os
import json
import shutil
import subprocess
from datetime import da... | YeongRoYun/BearTeam | service/backend/model/utils/mymodel.py | mymodel.py | py | 7,270 | python | ko | code | 0 | github-code | 7 | [
{
"api_name": "torch.device",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "YOLOv5n.models.common.DetectMultiBackend",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "model.assets.modelStoreConfig",
"line_number": 39,
"usage_type": "name"
},
{
... |
19606693600 | #!/usr/bin/env python
try:
# try setuptools, so devs can run bdist_wheel
from setuptools import setup, Command
except ImportError:
# but most users really don't require it
from distutils.core import setup, Command
import versioneer
versioneer.versionfile_source = "ecdsa/_version.py"
versioneer.versionf... | aburan28/python-ecdsa | setup.py | setup.py | py | 1,866 | python | en | code | null | github-code | 7 | [
{
"api_name": "versioneer.versionfile_source",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "versioneer.versionfile_build",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "versioneer.versionfile_source",
"line_number": 11,
"usage_type": "at... |
14198445995 | #! /usr/bin/env python3
from typing import List, Tuple, Dict
from collections import Counter
# from random import randint
from math import log
from collections import defaultdict
from bisect import bisect_left, bisect_right
"""08/20/2019
Solution1:
I predict, without even writing Solution1, it will time out.
And my ... | FanchenBao/leetcode | Contest_149/1157.py | 1157.py | py | 8,945 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 68,
"usage_type": "name"
},
{
"api_name": "collections.Counter",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 80,
"usage_type": "name"
},
{
"api_name": "math.log",
"line_numb... |
1767380192 | from setuptools import setup, find_packages, Extension
from glob import glob
from Cython.Build import cythonize
import platform
import os
import versioneer
include_dirs = ['ffld2', 'ffld2/lib']
library_dirs = []
extra_compile_args = []
extra_link_args = []
libraries = []
sources = (['cyffld2/ffld2/HOGPyramid.cpp',
... | menpo/cyffld2 | setup.py | setup.py | py | 3,017 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "platform.platform",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
... |
30185992841 | import matplotlib.pyplot as plt
import numpy as np
# 100 samples from normal distribution with 0 mean and 1 variance
samples = np.random.normal(0, 1, 100)
# Visualize data with a histogram
plt.hist(samples, bins=50)
plt.show()
# Sort them to increasing order
sorted_samples = np.sort(samples)
# Draw a line plot f... | DarthKipsu/machine-learning | python for ml/ex1.py | ex1.py | py | 417 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.random.normal",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
33847260473 | import datetime
from random import choice
class MonteCarlo(object):
def __init__(self, board, **kwargs):
# Takes an instance of a Board and, optionally, some keyword arguments.
# Initialises the list of game states, and the statistics tables.
self.board = board
self.states = []
... | shaneHowearth/TinsleyAI | game_engine/monte_carlo.py | monte_carlo.py | py | 2,183 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.timedelta",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "da... |
23358643722 | import aiofiles
import ffmpeg
import asyncio
import os
import shutil
import psutil
import subprocess
import requests
import aiohttp
import yt_dlp
import aiohttp
import random
import shutil
import re
import subprocess
import os
import sys
from git import Repo
from pyrogram.types import Message
from Codexun.utils.filter... | xHamaster/rare6 | Codexun/modules/client.py | client.py | py | 35,407 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "git.Repo",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "git.Repo",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "git.exc.InvalidGitRepositoryError",
"line_number": 115,
"usage_type": "name"
},
{
"api_name": "git.Repo.init",... |
25497882305 | from django.urls import path
from .views import *
urlpatterns = [
path("", dashboard, name="dashboard"),
path("login/", Login, name="login"),
path('is_admin/', ProductFilter, name='productfilter'),
path('about/<int:pk>/', About, name='about'),
path('logins/', Logins, name='logins'),
path('log-o... | Abduxoliq1826/Olx | main/urls.py | urls.py | py | 2,416 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"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",
... |
20438436157 | """
Это файл, описывающий игрока. Игрок должен:
- Летать
- Стрелять
"""
from cocos.sprite import Sprite
from bullet import Bullet
from pyglet.window import key
from math import pi, sin, cos
class Player(Sprite):
def __init__(self, player, controls, x, y, rot=0):
"""
П... | School-projects-tamarinvs-239/AstroParty | AstroParty_/player.py | player.py | py | 2,570 | python | ru | code | 0 | github-code | 7 | [
{
"api_name": "cocos.sprite.Sprite",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "math.pi",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "math.pi",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "math.sin",
"line_number": 57,... |
23159099523 | # https://maas.ubuntu.com/docs1.7/api_authentication.html?highlight=api
# 0-legged OAuth: the consumer accesses protected resources by submitting OAuth signed requests.
import oauth.oauth as oauth
import requests
import uuid
def perform_API_request(site, uri, method, key, secret, consumer_key):
resource_tok_strin... | adrianlzt/cerebro | programacion/python/oauth_example.py | oauth_example.py | py | 1,093 | python | en | code | 18 | github-code | 7 | [
{
"api_name": "oauth.oauth.OAuthToken.from_string",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "oauth.oauth.OAuthToken",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "oauth.oauth",
"line_number": 11,
"usage_type": "name"
},
{
"api_na... |
37939855975 | import socket
import time
import argparse
HOST = 'localhost'
PORT = 5555
HEADER_SIZE = 2
class Client:
def __init__(self, host, port, name):
self._host = host
self._port = port
self._name = name
self._client_socket = None
def connect(self):
self._client_socket = socke... | WindsOfHades/LongLivingClientsTcp | client.py | client.py | py | 1,735 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "socket.socket",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "time.sleep"... |
20269832341 | import os
import logging
import jsonpickle
import boto3
import sentry_sdk
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
if 'SENTRY_DSN' in os.environ:
sentry_sdk.init(os.environ['SENTRY_DSN'], integrations=[AwsLambdaIntegration()])
logger = logging.getLogger()
logger.setLevel(logging.INFO)
... | fixthestatusquo/collect-sqs-splitter | src/lambda_function.py | lambda_function.py | py | 1,807 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sentry_sdk.init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sentry_sdk.integrations.... |
31573578238 | ## Author: Ankita Pasad
# Created on: 22.09.2016
# Implementation of zero frequency filtering of speech signal for epoch detection
# Reference: http://speech.iiit.ac.in/svlpubs/article/MurtyK.S.R.Yegna2008.pdf
import numpy as np
import scipy.signal as sigpy
import pandas as pd
import matplotlib as mpl
import matplotli... | KaminiSabu/VAD | zffs.py | zffs.py | py | 8,908 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 25... |
45036961074 | # -*- coding:utf-8 -*-
import gevent
def f1(n):
for i in range(n):
# gevent.getcurrent()显示当前的协程任务
print(gevent.getcurrent(), i)
#用来模拟一个耗时操作,注意不是time模块中的sleep
gevent.sleep(1)
def f2(n):
for i in range(n):
print(gevent.getcurrent(), i)
#用来模拟一个耗时操作,注意不是time模块中的sle... | FelixZFB/Python_advanced_learning | 02_Python_advanced_grammar_supplement/002_多线程_多进程_协程_进阶汇总/003_协程_迭代器_生成器/014_协程_多任务_gevent.spawn_自动切换任务.py | 014_协程_多任务_gevent.spawn_自动切换任务.py | py | 1,256 | python | zh | code | 2 | github-code | 7 | [
{
"api_name": "gevent.getcurrent",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "gevent.sleep",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "gevent.getcurrent",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "gevent.sleep",
"l... |
33212450064 | # Interactive NSEM map plot
import numpy as np
import matplotlib.pyplot as plt
from .. import receivers as rx
from .plot_utils import ApparentResPhsStationPlot, TipperAmplitudeStationPlot
class NSEM_data_viewer:
"""
An interactive SimPEG NSEM Data viewer.
Generates a clickble location map of the data, ... | simpeg/simpeg | SimPEG/electromagnetics/natural_source/utils/data_viewer.py | data_viewer.py | py | 4,903 | python | en | code | 438 | github-code | 7 | [
{
"api_name": "numpy.unique",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "plot_utils.ApparentResPhsStationPlot",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "plot_ut... |
39872359992 | import logging.config
import datetime
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
run_file = sys.argv[0]
run_file_name = os.path.basename(os.path.splitext(run_file)[0])
print(run_file_name)
log_name = run_file_name+datetime.datetime.now().strftime('%Y%m%d')+'.log'
LOG_DIR = os.path.join(... | shadongdong2019/Interface_GUI_0622 | interface_frame/basic_config/log/__init__.py | __init__.py | py | 1,577 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number... |
20581915438 | import json
import dict2xml
import sys
def formatLogs(logs,format):
"""
Formats the logs according to the specified format in the config yaml
"""
formattedLogs=[]
if(format.__eq__("json")):
for log in logs:
formattedLogs.append(json.dumps(dict(log)))
return fo... | sathley/RDS-MySql-LogShipper | RDSMysqlLogShipper/src/LogFormatter.py | LogFormatter.py | py | 510 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.dumps",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "dict2xml.dict2xml",
"line_number": 19,
"usage_type": "call"
}
] |
70328703585 | from flask import render_template, redirect, request, session, flash, url_for
from flask_login import login_user
from app import app, login, utils
from app.models import *
import hashlib
@app.route("/")
def index():
return render_template("index.html")
@app.route("/home")
def home():
return render_template("d... | mailamtx/StudentManagement | app/main.py | main.py | py | 4,131 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.render_template",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "app.app.route",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
... |
29652630350 | from colorama import Fore, Style
class Department:
"""
A class to represent a department.
...
Attributes
----------
name : str
the name of the department, a 3 letter abbreviation
chair : Admin
the administrator who is chair of the d... | savinadd/python-course-project | department.py | department.py | py | 910 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "colorama.Fore.YELLOW",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "colorama.Style.RESET_ALL",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": ... |
7794922516 | from tkinter import *
import notebook
def find_notes():
notebook.search_record()
def add_note():
notebook.new_record()
def change_note():
notebook.edit_record()
def del_note():
notebook.remuve_record()
def exit_but():
tkn.destroy()
def main():
global tkn
tkn = Tk()
tkn.geometry("5... | Sedigor/drem_team | dream_helper/dream_helper/notebook_menu.py | notebook_menu.py | py | 1,452 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "notebook.search_record",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "notebook.new_record",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "notebook.edit_record",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "noteboo... |
30679580943 | from typing import Dict, Optional
from uuid import UUID
from autoinsight.ident.IdentObjectBase import IdentObjectBase
from .ServiceBase import ServiceBase
class ContextManagementService(ServiceBase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._registeredContexts: ... | shangerxin/autoinsight | src/autoinsight/services/ContextManagementService.py | ContextManagementService.py | py | 2,410 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "ServiceBase.ServiceBase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "uuid.UUID",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "autoinsight.ident.IdentO... |
28224568590 | # from collections import Counter
# n, m = map(int, input().split())
# k = list()
# l = list()
# for i in range(m):
# k.append(int(input()))
# l.append(list(map(int, input().split())))
# d = Counter([l[i][0] for i in range(m)])
# s = set()
# for k, v in d.items():
# if v > 1:
# s.add(k)
# for i in... | blueletter123456789/atc | abc216/d/d.py | d.py | py | 1,629 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 36,
"usage_type": "call"
}
] |
9852285539 | from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from django.contrib import messages
from django.db.models import Q
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import User... | Jessy-py/taskmgt | base/views.py | views.py | py | 5,732 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_number": 30,
"usage_t... |
7187159963 | import matplotlib.pyplot as plt
import csv
import numpy as np
import os
import re
import random
#defs
def getCleanPowerTen(crappyPower):
valueLength = 1 + 3;
if('E-' in crappyPower):
key = re.sub(r'[0-9.]+', '', crappyPower.split('E')[0])
print(key)
value = crappyPower.split(key)[1].split('E')[0];
if(len(va... | Kwarthys/BeeKeeper | BeeKeeper/pythonAnalytics/NewAnalytics.py | NewAnalytics.py | py | 15,731 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "re.sub",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 105,
"... |
9189001571 | import numpy as np
import gtsam
import matplotlib.pyplot as plt
from Load_Data_2D import sensor_xy #Import functions from Load_Data to load sensor x and y coordinates from .G2O file
is3D = False
graph, initial = gtsam.readG2o("input_INTEL_g2o.g2o", is3D)
priorModel = gtsam.noiseModel.Diagonal.Variances(gtsam.Point3(1... | ShubhamOmprakashPatil/Simulataeous_Localisation_and_Mapping_using_GTSAM | 2-Dimensonal Trajectory Optimization/2D Batch Trajectory Optimization.py | 2D Batch Trajectory Optimization.py | py | 1,213 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "gtsam.readG2o",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "gtsam.noiseModel.Diagonal.Variances",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "gtsam.noiseModel",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "... |
72869754142 | import copy
import logging
import numpy as np
from typing import Callable, List, Union
import torch
from panopticapi.utils import rgb2id
from detectron2.config import configurable
from detectron2.data import MetadataCatalog
from detectron2.data import detection_utils as utils
from detectron2.data import transforms as ... | Ascend/ModelZoo-PyTorch | PyTorch/dev/cv/image_classification/SlowFast_ID0646_for_PyTorch/detectron2/projects/Panoptic-DeepLab/panoptic_deeplab/dataset_mapper.py | dataset_mapper.py | py | 4,405 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "detectron2.data.transforms.Augmentation",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": ... |
41044613622 | import io
import matplotlib.pyplot as plt
import numpy as np
import os
import requests
import shutil
import tensorflow as tf
from pathlib import Path
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.models import Sequential
from utils import extract_dataset, filter_dataset, limit_d... | reesealanj/MothClassifierProject | final-project/ml/mmodel.py | mmodel.py | py | 8,863 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "utils.extract_dataset",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "utils.filter_dataset",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "utils.print_metadata",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "utils... |
44024853960 | from typing import TYPE_CHECKING, Any, Callable, List
from torch import Tensor, nn
from flash.core.data.utilities.classification import _is_list_like
if TYPE_CHECKING:
from flash.core.data.io.input import ServeInput
class _ServeInputProcessor(nn.Module):
def __init__(
self,
serve_input: "Se... | Lightning-Universe/lightning-flash | src/flash/core/data/batch.py | batch.py | py | 2,305 | python | en | code | 1,717 | github-code | 7 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
... |
36474244443 | # taken from <https://python-gtk-3-tutorial.readthedocs.io/en/latest/dialogs.ht
# ml>
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk # noqa
class file_choooser_window(Gtk.Window):
def __init__(self, action="open"):
Gtk.Window.__init__(self, title="Choose a file.")
if ... | vonHartz/IliasVideoDownloader | src/gui/file_chooser.py | file_chooser.py | py | 1,692 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "gi.require_version",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "gi.repository.Gtk.Window",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "gi.re... |
43095157529 | import shutil
import subprocess as sp
from pathlib import Path
from distutils.spawn import find_executable
import mps
try:
import matplotlib # noqa: F401
except ImportError:
missing_mpl = True
else:
missing_mpl = False
try:
import imageio_ffmpeg # noqa: F401
except ImportError:
missing_ffmpeg ... | ComputationalPhysiology/mps | tests/test_scripts.py | test_scripts.py | py | 2,632 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "distutils.spawn.find_executable",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pathlib... |
4392825567 | from rest_framework import serializers
from base.models.person import Person
from continuing_education.api.serializers.address import AddressSerializer, AddressPostSerializer
from continuing_education.api.serializers.continuing_education_person import ContinuingEducationPersonSerializer, \
ContinuingEducationPerso... | uclouvain/osis-continuing-education | api/serializers/admission.py | admission.py | py | 6,129 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "rest_framework.serializers.HyperlinkedModelSerializer",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.HyperlinkedIdentityField",
"... |
44629877993 | import torch
from torch import Tensor
from torch.distributions import Distribution
def quantization_offset(distribution: Distribution) -> Tensor:
"""Computes a distribution-dependent quantization offset.
For range coding of continuous random variables, the values need to be
quantized first. Typically, it... | facebookresearch/NeuralCompression | neuralcompression/functional/_quantization_offset.py | _quantization_offset.py | py | 1,409 | python | en | code | 412 | github-code | 7 | [
{
"api_name": "torch.distributions.Distribution",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.tensor",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.roun... |
25148825221 | from datetime import datetime
from json import loads, dumps
from decouple import config
from psycopg2 import sql
from psycopg2.extras import DictCursor
from requests import get
from .connection import Connection
from .gb_search import GBWrapper
from .populate import execute_queries, get_value
class NYT:
def __i... | BloomTech-Labs/betterreads-ds | readrr_api/route_tools/nyt.py | nyt.py | py | 3,781 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "decouple.config",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "gb_search.GBWrapper",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "connection.Connection",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.ge... |
19310468104 | import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import torch
import torch.nn as nn
import torch.nn.functional as F
import pickle
import numpy as np
from lib.models.networks.intaghand_encoder import load_encoder
from lib.models.networks.intaghand_decoder import l... | zijinxuxu/PDFNet | lib/models/networks/intaghand_model.py | intaghand_model.py | py | 2,577 | python | en | code | 17 | github-code | 7 | [
{
"api_name": "sys.path.insert",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
27765985459 | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
import io
import json
import re
from googlecloudsdk.api_lib.container import util as c_util
from googlecloudsdk.command_lib.compute.instance_templates import service_proxy_aux_data
from go... | twistedpair/google-cloud-sdk | google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/instance_templates/mesh_util.py | mesh_util.py | py | 35,461 | python | en | code | 55 | github-code | 7 | [
{
"api_name": "collections.namedtuple",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "googlecloudsdk.core.exceptions.Error",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": ... |
16314771126 | from cirq import Circuit
from pennylane import from_qasm as pennylane_from_qasm
from pennylane.tape import QuantumTape
from pennylane.wires import Wires
from pennylane_qiskit.qiskit_device import QISKIT_OPERATION_MAP
from mitiq.interface.mitiq_qiskit import from_qasm as cirq_from_qasm
from mitiq.interface.mitiq_qiskit... | unitaryfund/mitiq | mitiq/interface/mitiq_pennylane/conversions.py | conversions.py | py | 2,122 | python | en | code | 300 | github-code | 7 | [
{
"api_name": "pennylane_qiskit.qiskit_device.QISKIT_OPERATION_MAP.keys",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pennylane_qiskit.qiskit_device.QISKIT_OPERATION_MAP",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pennylane.tape.QuantumTape",
"li... |
39764862357 | """
Estimate a probability with FORM
================================
"""
# %%
# In this example we estimate a failure probability with the `FORM` algorithm on the :ref:`cantilever beam <use-case-cantilever-beam>` example. More precisely, we show how to use the associated results:
#
# - the design point in both physica... | openturns/openturns.github.io | openturns/1.16/_downloads/fe12fbe9ad1f0567ffb9c4698d2f37bf/plot_estimate_probability_form.py | plot_estimate_probability_form.py | py | 4,087 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "openturns.Log.Show",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "openturns.Log",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "openturns.usecases.cantilever_beam.CantileverBeam",
"line_number": 37,
"usage_type": "call"
},
... |
764429828 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import sys
import time
import config.housead as configHouseAd
import config.adx as configAdx
import config.db as configDb
import lib.mysql as db
from adx_date_to_infobright import AdxDataToInforbright
LIMIT_COUNTS = configAdx.LIMIT_COUNTS
class AdxHouseadToInfor... | ljphalen/mobgi_housead | cron_script/adx/adx_housead_to_infobright.py | adx_housead_to_infobright.py | py | 1,510 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "config.adx.LIMIT_COUNTS",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "config.adx",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "adx_date_to_infobright.AdxDataToInforbright",
"line_number": 15,
"usage_type": "name"
},
{
... |
25081308969 | # %%
# import scipy.linalg as linalg
import numpy as np
def classicalMDS(dist: np.array, D=2, J=None, allowZero=True):
distSqM = dist ** 2
if J is None:
N = len(distSqM)
J = np.eye(N) - np.ones((N, N)) / N
distSqM = distSqM.reshape(N, N)
B = -0.5 * J.dot(distSqM).dot(J)
ei... | pokleung5/FYP | mds/cmds.py | cmds.py | py | 1,699 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.eye",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.eigh",
"line_nu... |
2354728387 | # -*- coding: utf-8 -*-
import json
import sys
from collections import defaultdict
def get_ingredients(recipe):
"""Return list of ingredients"""
ings = []
if "ingredients" in recipe:
for ingredient in recipe["ingredients"]:
ings.append(ingredient["name"])
return ings
def calculate... | mglhacks/nikpad | count_ingredient.py | count_ingredient.py | py | 1,587 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"li... |
30724786489 | """
Adds support for the Ariston Boiler
"""
import logging
from datetime import timedelta
import json
import os
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
CURRENT_HVAC_OFF,
HVAC_MODE_AUTO,
HVA... | chomupashchuk/ariston-remotethermo-home-assistant | ariston/climate.py | climate.py | py | 11,638 | python | en | code | 20 | github-code | 7 | [
{
"api_name": "homeassistant.components.climate.const.HVAC_MODE_OFF",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "homeassistant.components.climate.const.HVAC_MODE_HEAT",
"line_number": 65,
"usage_type": "name"
},
{
"api_name": "homeassistant.components.climate.const... |
72284858463 | from rest_framework import serializers
from reviews.models import Category, Comment, Genre, Review, Title, User
from reviews.validators import validate_username
class SignUpSerializer(serializers.Serializer):
"""Сериализатор для проверки входящих данных при входе."""
email = serializers.EmailField(max_lengt... | Elllym-em/review_service_api | api_yamdb/api/serializers.py | serializers.py | py | 2,905 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "rest_framework.serializers.Serializer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.EmailField",
"line_number": 10,
"usage_typ... |
39055829316 | #Web scraping script that takes a user's input, googles it and prints descriptions of top results!, User is allowed multiple inputs respectively.
#importing presents, the chrome web driver, the Keys library to press keys, and the "By" library to select elements by class name.
from selenium import webdriver
from... | AbdallahZein12/selenium-python | googler.py | googler.py | py | 2,040 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 13,
"usage_type": "name"
},
{
... |
26480332234 | from cmath import inf
import networkx as nx
import matplotlib.pyplot as plt
import sys
def getGraph(filename) :
graph = {}
G = nx.Graph()
file = open(filename, 'r')
lines = file.readlines()
file.close()
n, *lines = lines
for line in lines:
first = line.rstrip().split()[0]
second = line.rstrip().split()[1]... | DYernar/graph-theory | dijkstra/init.py | init.py | py | 629 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "networkx.Graph",
"line_number": 8,
"usage_type": "call"
}
] |
22947431589 | import boto3
s3 = boto3.client( 's3',
aws_access_key_id='AKIATSF6SDROSKWO5XEE',
aws_secret_access_key='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' )
url = s3.generate_presigned_url(
ClientMethod='get_object',
Params={
'Bucket': 'djangoapi',
'Key': 'media/s... | amitjamwal85/django_game_api | DjangoDRF/utils/getS3Signed.py | getS3Signed.py | py | 372 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "boto3.client",
"line_number": 3,
"usage_type": "call"
}
] |
8966479384 | from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from HydrodynamicUtilities.Models.DataFile import UnknownOneSlashWord, DataFile
from typing import Callable
from .RUNSPEC import RUNSPEC
from .GRID import GRID
from .EDIT import EDIT
from .PROPS import PROPS
from .REGIONS i... | demidmaksim/HydrodynamicUtilities | HydrodynamicUtilities/Models/DataFile/Sections/NoneSection.py | NoneSection.py | py | 1,467 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "HydrodynamicUtilities.Models.DataFile.Base.Section",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "HydrodynamicUtilities.Models.DataFile.DataFile",
"line_number": 21,
... |
12453902987 | #!/usr/bin/env python
import numpy as np
import math
from pylab import *
from matplotlib import pyplot as plt
def columnToList(text,colnumber):
with open(text) as f:
lista=[]
for line in f:
spl=line.split()
lista.append(spl[colnumber])
return lista
data = 'lanemden.dat'... | ggrillo93/School | Grad School/Fall 2016/AEP 4380/HWs/Final Project/Scripts/fpplot4.py | fpplot4.py | py | 468 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.ylabel",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "m... |
29059447840 | from flask_socketio import SocketIO
from field_capture import celery
from field_capture.main import game_objects
from flask import current_app
import os
broker = os.environ.get('AMQP_BROKER')
socketio = SocketIO(message_queue=broker, async_mode='threading')
@celery.task(name="task.clock")
def game_clock(room_id, cu... | StoVictor/field_capture_game | services/web/field_capture/main/tasks.py | tasks.py | py | 1,038 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "flask_socketio.SocketIO",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.current_app... |
4964006774 | """
Author: Reinaldo Mateus R J, Test version: 0.1
Leia: https://docs.python.org/3.6/tutorial/classes.html#multiple-inheritance
"""
from selenium import webdriver
import login
import logout
import find_test_case
class testsCase(login.LoginTest, logout.LogoutTest, find_test_case.FindTestCase):
def __init__(self)... | reinaldorossetti/qa_ninja | heranca_exemplo/test_case_01.py | test_case_01.py | py | 982 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "login.LoginTest",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logout.LogoutTest",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "find_test_case.FindTestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_... |
70065789982 | from setuptools import setup, Distribution, find_packages
import sys
from pathlib import Path
from argparse import ArgumentParser
import os
import shutil as sh
import re
#
# Process our cmd line args
#
parser = ArgumentParser()
parser.add_argument("--arch")
parser.add_argument("--pyver")
parser.add_argument("--version... | cunnane/xloil | libs/xlOil_Python/Package/setup.py | setup.py | py | 3,320 | python | en | code | 103 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "setuptools.Distrib... |
70828414944 | from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
class BasePaginator(PageNumberPagination):
page_size_query_param = 'page_size'
max_page_size = 10
def get_counts(self):
return {
'count': self.page.paginator.count,
'pag... | pdskygate/skygate_challenge1 | exams_app/exams/response_builder.py | response_builder.py | py | 1,318 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rest_framework.pagination.PageNumberPagination",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 31,
"usage_type": "call"
}
] |
40092808174 | #!/usr/bin/env python
from __future__ import print_function, division
import argparse, os, re, time
import pdb
from gehrmann_rouge_opennmt.rouge_baselines.g_rouge import rouge
from gehrmann_rouge_opennmt.rouge_baselines.util import has_repeat, n_grams
from functools import reduce
import numpy as np
def split_sente... | neulab/BARTScore | SUM/gehrmann_rouge_opennmt/rouge_baselines/baseline.py | baseline.py | py | 11,447 | python | en | code | 275 | github-code | 7 | [
{
"api_name": "re.findall",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 135,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 162,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 19... |
7586622369 | import torch.nn as nn
import torch
import torch.nn.functional as F
from torch.nn.modules.conv import _ConvNd
from torch.nn.modules.utils import _pair
import numpy as np
import math
from models.layers.config import cfg
def Norm2d(in_channels):
"""
Custom Norm Function to allow flexible switching
"""
la... | ShiHanQ/GFANet | models/layers/GatedSpatialConv.py | GatedSpatialConv.py | py | 2,172 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "models.layers.config.cfg.MODEL",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "models.layers.config.cfg",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.nn.modules.conv._ConvNd",
"line_number": 20,
"usage_type": "name"
},... |
35382693554 | #!/usr/bin/env python
# coding: utf-8
# Data attributes:
#
# 1. Admit: 0-not admitted, 1- admitted
# 2. gre: gre score
# 3. Gpa: Gpa score
# 4. Rank: School rank
#
# You need to create a machine learning model if a student is admitted or not given attributes.
#
# 1. Run logistic model and naive bayes. Compare the ... | sayedamayesha/Naive_bayes | naive_bayes.py | naive_bayes.py | py | 2,627 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 95,
"usage_type": "call"
... |
27190347066 | """
Description:
This is an example of an additional application layer you can build with this daf.
The application sends a message saying 'Good morning' every day at 10 AM and then sends a picture of a coffe cup from a randomized list.
"""
import os
import daf
import random
from datetime import datetime, timedelta
@d... | davidhozic/discord-advertisement-framework | Examples/Additional Application Layer Example/Coffee/main_coffee.py | main_coffee.py | py | 1,425 | python | en | code | 29 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
25062086226 | __author__='AlVictor'
import datetime
from acesso_API import AcessoAPI
epoch = datetime.datetime(1970,1,1)
#string_date = input("Insira a Data Inicial: ")
string_date = "2018-08-01 00:00:00"
format = "%Y-%m-%d %H:%M:%S"
DataInicio = datetime.datetime.strptime(string_date, format)
#print("Data Inicio",DataInicio)
Eph... | AlexandreVictor/Extrator_Direct_T | old/principal.py | principal.py | py | 999 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "da... |
24123642159 | import boto3
import pickle
import pandas as pd
import sys
pd.set_option('display.max_rows', None)
pd.set_option('display.max_columns', None)
pd.set_option('display.width', None)
pd.set_option('display.max_colwidth', None)
person='butz'
try:
person=sys.argv[1]
except:
pass
print(sys.argv)
print(person)
ec2 =... | tonybutzer/iac | docker/app-aws-price/code/awsprice.py | awsprice.py | py | 1,959 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.set_option",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.set_option"... |
22023532170 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import pytest
import click
import json
from click.testing import CliRunner
from .. import cli
from ..version import __version__
# Server
def test_version():
runner = CliRunner()
result = runner.invoke(cli.cli, ['version'])
assert result.... | Koheron/koheron-python | koheron/test/cli_tests.py | cli_tests.py | py | 1,590 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "click.testing.CliRunner",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "version.__version__",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "click.testing.CliRunner",
"line_number": 23,
"usage_type": "call"
},
{
"api_name"... |
36195789091 | import csv
import sys
import json
import requests
fieldnames=["id","postal_code","revenue","lat","lng"]
def convert():
csv_filename = "data.csv"
print ("Opening CSV file: ", csv_filename)
f = open(csv_filename, 'r')
csv_reader = csv.DictReader(f,fieldnames)
json_filename = csv_filename.split(".")... | geerdink/hack_maps | convert.py | convert.py | py | 1,201 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "csv.DictReader",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
}
] |
27026047158 | import re
import os
import unittest
from unittest import mock
import logging
import json
import datetime
from flask import jsonify
from community_share import setup, app, mail, config, time_format, store
from community_share.models.share import EventReminder, Event
from community_share.models.user import User
from co... | TimmyTomTom/commshare | community_share/tests.py | tests.py | py | 37,636 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "community_share.config.BASEURL",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "community_share.config",
"line_number": 49,
"usage_type": "name"
},
{
"api_... |
28337895535 | from flask import url_for
from app.identity.routes import sessions
class AuthTestMixin(object):
def tearDown(self):
sessions.clear()
def login_as(self, user):
session_id = sessions.create(user)
self.client.set_cookie('localhost', 'session_id', session_id)
return session_id
... | jcomo/oauth-app | tests/identity/auth_mixin.py | auth_mixin.py | py | 666 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "app.identity.routes.sessions.clear",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "app.identity.routes.sessions",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.identity.routes.sessions.create",
"line_number": 11,
"usage_type": "cal... |
19429220788 | #code to plot mean with confidence interval band
#code to plot mean with max and min band
import numpy as np
import matplotlib.pyplot as plt
import sys
from matplotlib import rc
from scipy import stats
#font
rc('font',**{'family':'serif','serif':['Times']})
rc('text', usetex=True)
def line_tuple(filename):
retur... | SaumikDana/LANL-Postdoc-Graph-Theory-UQ | plot_max_min_confidence_interval.py | plot_max_min_confidence_interval.py | py | 5,108 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.rc",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number... |
4860525112 | #!/usr/bin/env python
# coding: utf-8
# In[15]:
get_ipython().system('pip install sympy')
# In[2]:
from sympy import symbols, diff, limit, SympifyError
from sympy.parsing.sympy_parser import parse_expr
from tkinter import *
from tkinter import ttk
def derivada():
try:
x = symbols('x') # Declarar va... | chamilqs/calculadora-deriv | CALCULADORA DE LIMITES & DERIVADAS.py | CALCULADORA DE LIMITES & DERIVADAS.py | py | 3,608 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "sympy.symbols",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sympy.parsing.sympy_parser.parse_expr",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sympy.diff",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sympy.... |
18965228126 | import torch.nn as nn
import functools
class NetworksFactory:
def __init__(self):
pass
@staticmethod
def get_by_name(network_name, *args, **kwargs):
if network_name == 'AlexNet':
from .networks import AlexNet
network = AlexNet(*args, **kwargs)
elif network_... | cassiePython/RCNN | networks/network_factory.py | network_factory.py | py | 922 | python | en | code | 20 | github-code | 7 | [
{
"api_name": "networks.AlexNet",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "networks.SVM",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "networks.RegNet",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"... |
3235453220 | """added label to flow
Revision ID: d2b23f410d02
Revises: 4a7ac9143bb1
Create Date: 2020-09-26 17:17:27.078419
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd2b23f410d02'
down_revision = '4a7ac9143bb1'
branch_labels = None
depends_on = None
def upgrade():
... | Kraken-CI/kraken | server/kraken/migrations/versions/d2b23f410d02_added_label_to_flow.py | d2b23f410d02_added_label_to_flow.py | py | 461 | python | en | code | 107 | github-code | 7 | [
{
"api_name": "alembic.op.add_column",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Unicode... |
20295451960 | import streamlit as st
from hear import WavLocalFileStore
from plunk.sb.front_experiments.data_visualizer.utils.tools import (
store_to_key_fvs,
key_fvs_to_tag_fvs,
mk_Xy,
)
import umap
# import umap.plot
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
root_dir = '/Users/sylvain/Dr... | otosense/plunk | plunk/sb/front_experiments/data_visualizer/apps/app0.py | app0.py | py | 1,045 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "hear.WavLocalFileStore",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "plunk.sb.front_experiments.data_visualizer.utils.tools.store_to_key_fvs",
"line_number": 22,
"usag... |
36863716098 | from math import *
import time
import socket
import random
import os
import numpy
from scipy import fftpack
import sys
import matplotlib.pyplot as plt
def compute_p2(wave_function,tab_momentum):
# n=wave_function.size
# p2=0.0
# norm=0.0
# for i in range(n):
# p2+=((i+quasi_momentum-n/2)*abs(wave_function[i]... | tnotenson/quantum-chaos | kr_periodic.py | kr_periodic.py | py | 5,988 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.sum",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 57,
... |
389578475 | import numpy as np
import glob
import os
import tensorflow as tf
import collections
Dataset = collections.namedtuple("Dataset", "iterator, color, uv, mask, basis, index")
def parse_tfrecord_np_shape(record):
ex = tf.train.Example()
ex.ParseFromString(record)
shape = ex.features.feature['shape'].int64_list... | Lambda44/NeuralLighting | src/data_min_size.py | data_min_size.py | py | 4,473 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.namedtuple",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tensorflow.train.Example",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.train",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "... |
31112942723 | import SCons
def GlobRecursive(env, pattern, node=".", exclude=None):
results = []
if isinstance(node, str):
node = env.Dir(node)
for f in node.glob("*", source=True, exclude=exclude):
if isinstance(f, SCons.Node.FS.Dir):
results += env.GlobRecursive(pattern, f, exclude)
re... | nonamecoder/FlipperZeroHondaFirmware | flipperzero-firmware/site_scons/site_tools/sconsrecursiveglob.py | sconsrecursiveglob.py | py | 575 | python | en | code | 407 | github-code | 7 | [
{
"api_name": "SCons.Node",
"line_number": 9,
"usage_type": "attribute"
}
] |
23283121974 | from flask import Flask, current_app ,jsonify,request,abort
import boto3
#set up static resources so we can serve the ng front-end
app = Flask(__name__,static_url_path='/static')
@app.route('/api/ec2Info', methods=['POST'])
def retrieveEC2Info():
#Get the json that came in
request_data = request.get_json(forc... | Millsky/amazon-ec2-reporter | app/main.py | main.py | py | 2,243 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "boto3.resource",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.