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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
19125151057 | import base64
import json
import logging
from common import constants
from common import appengine_util
from common.base_handler import BaseHandler
from common.base_handler import Permission
from crash import crash_pipeline
from crash.crash_report import CrashReport
from gae_libs.gitiles.cached_gitiles_repository impo... | mithro/chromium-infra | appengine/findit/handlers/crash/crash_handler.py | crash_handler.py | py | 5,155 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "common.base_handler.BaseHandler",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "common.base_handler.Permission.ANYONE",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "common.base_handler.Permission",
"line_number": 16,
"usage_typ... |
19300662791 | import boto3
import os
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
ec2_client = boto3.client('ec2')
ec2 = boto3.resource('ec2')
def clean_up(instance_id):
response = ec2_client.terminate_instances(
InstanceIds=[
instance_id,
]
)
waiter = ec2_clien... | Weizhou-Sun/CleanUpLambda | cleanUp.py | cleanUp.py | py | 1,971 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "boto3.client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"l... |
42663466079 | import os
import torch
import datetime
import numpy as np
from torch.utils.data import DataLoader
#Set seeds
np.random.seed(0)
torch.manual_seed(0)
torch.cuda.manual_seed(0)
torch.cuda.manual_seed_all(0)
class MakeVisualizations(object):
def __init__(self, descriptor, base_results_dir,
results_di... | rachellea/explainable-ct-ai | src/plot/main_viz.py | main_viz.py | py | 2,445 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.cuda.manual_... |
20255903312 | from django.shortcuts import render, redirect
def vet_login_and_active(function=None):
def wrapper(request, *args, **kwargs):
if request.user.is_authenticated:
if request.user.is_active:
return function(request, *args, **kwargs)
else:
return render(r... | SJECollins/ci-pp4-pet-rx | petrx/decorators.py | decorators.py | py | 441 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 12,
"usage_type": "call"
}
] |
22163180454 | from setuptools import setup, find_packages
base_packages = [
'pandas',
'numpy',
'scikit-learn',
'python-Levenshtein',
'thefuzz',
'modAL-python',
'pytest',
'multipledispatch',
'dill',
'graphframes',
'scipy'
]
doc_packages = [
'sphinx',
'nbsphinx',
'sphinx_rtd_th... | ing-bank/spark-matcher | setup.py | setup.py | py | 1,369 | python | en | code | 26 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 46,
"usage_type": "call"
}
] |
7797856841 | from data.mnist_data import *
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from tqdm import tqdm
import matplotlib
import matplotlib.pyplot as plt
device = "cuda:0"
device = "cpu"
n_epochs=100
beta1 = 0.5
lr = 0.001
# Number of channels
nc = 1
# Latent vector length... | dancwpark/ml-shell | gan.py | gan.py | py | 4,053 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
30450336081 | #!/usr/bin/env python3
"""
Script for getting metadata from advertisements of openbiblio (https://jobs.openbiblio.eu/) using BeautifulsSoup.
See: https://www.crummy.com/software/BeautifulSoup/bs4/doc/
"""
# === Import statements ===
from bs4 import BeautifulSoup as bs
import glob
import re
from os.path import join
... | dh-trier/cldh-jobs | metadaten_indeed.py | metadaten_indeed.py | py | 3,924 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 42,... |
22688618151 | from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('customers/', include('apps.customers.urls', namespace='customsers')),
path('orders/', include('apps.orde... | ordemdigitale/django-crm-v2 | core/urls.py | urls.py | py | 706 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "dja... |
35901494646 | import io
import cv2
import numpy as np
def ela(rgb_bitmap, quality=100):
_rgb_bitmap = rgb_bitmap.copy()
_, buffer = cv2.imencode('buffer.jpg', _rgb_bitmap, [cv2.IMWRITE_JPEG_QUALITY, quality])
io_buffer = io.BytesIO(buffer)
recompressed_img = cv2.imdecode(np.frombuffer(io_buffer.getbuffer(), np.uin... | testrep213324/lib | forensics/ela.py | ela.py | py | 625 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imencode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.IMWRITE_JPEG_QUALITY",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "io.BytesIO",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imdecode",
... |
71359817467 | # from tkinter import *
import requests
from datetime import datetime
import smtplib
import time
MY_EMAIL = "benbenthecoder@gmail.com"
MY_PASSWORD = "ilovecoding!234"
#
# # Make a get () request to the Kanye Rest API
# # Raise an exception if the request returned an unsuccessful status code
# # parse the JSON to obtai... | bennisyiu/day33_sunrise_sunset | main.py | main.py | py | 2,579 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
39125900879 | #coding:utf-8
import demjson,jieba,jieba.posseg as pseg
def saveFile(data,i):
if i>10:
path = "data\\train_fenci\\result_" + str(i-10) +".txt"
else:
path = "data\\test_fenci\\result_"+str(i)+".txt"
file = open(path,'a+b')
file.read()
for d in data:
d = str(d)+" "
fil... | VickyDong/dm2017 | project/分词-终板.py | 分词-终板.py | py | 2,821 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "demjson.decode",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "jieba.cut",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "jieba.posseg.cut",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "jieba.posseg",
"line_nu... |
2138860801 | import streamlit as st
import pandas as pd
import pickle
st.write("""
# MSDE4 : Cloud computing Course
## Diabete Prediction App
This app predicts the **diabete**
""")
st.sidebar.header('User Input Parameters')
def user_input_features():
Pregnancies = st.sidebar.slider('Pregnancies', 0.0, 17.0,... | hayatehtp/appservicemsde | app.py | app.py | py | 1,645 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.write",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar.header",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "stream... |
70967900668 | import pickle
import torch
import copy
import os
import numpy as np
import GCL.losses as L
import GCL.augmentors as A
from tqdm import tqdm
from torch.optim import Adam
from GCL.models import DualBranchContrast, SingleBranchContrast
from torch_geometric.loader import DataLoader
from torch_geometric.data import Data
fr... | hamed1375/Self-Supervised-Models-for-GGM-Evaluation | GIN_train_pyg.py | GIN_train_pyg.py | py | 5,644 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "torch.no_grad",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch_geometric.loader.DataLoader",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "GCL.augmentors.Identity",
"line_number": 48,
"usage_type": "call"
},
{
"api_name"... |
71861352509 | from __future__ import annotations
from collections import Counter
# 解析活动数据
act_info_list: list[tuple[str, str]] = []
with open("短期活动统计.csv", encoding="utf-8") as input_file:
input_file.readline()
for line in input_file:
date_str, name = line.strip().split(" ", 1)
act_info_list.append((date... | fzls/djc_helper | others/activity_stat/act_stat.py | act_stat.py | py | 954 | python | en | code | 319 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "collections.Counter",
"line_number": 18,
"usage_type": "name"
}
] |
75010850748 | import tkinter as tk
from tkinter import filedialog
from PIL import Image, ImageTk
from StegoHandler import ImageLSBSteganography
class EmbedMessageUI:
def __init__(self, root) -> None:
self.embedMessageApp = tk.Toplevel(root)
self.embedMessageApp.title("Message Embedding Tile")
se... | Anonymous-988/Steganography-Using-Python | EmbedMessageUI.py | EmbedMessageUI.py | py | 2,922 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.Toplevel",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "StegoHandler.ImageLSBSteganography",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tkinter.StringVar",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "... |
36969508039 | import os
import sqlite3
def checkExistingDatabase():
#Check if the required Database exists
if os.path.isfile("../data/database.db") == True:
connect = sqlite3.connect("../data/database.db")
cursor = connect.cursor()
print("Database is existing")
print("Now... | Simulacrum-Surface/QuestLogGMP | sys/datahandler.py | datahandler.py | py | 2,237 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.isfile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line... |
26983456077 | # This uses the EpuckBasic code as the interface to webots, and the epuck2 code to connect an ANN
# to webots.
from __future__ import division
#import epuck2
import epuck_basic as epb
#import graph
import prims1
import imagepro
import robot
# The webann is a descendent of the webot "controller" class, and it has the ... | iernie/IT3708 | project4/swarm-epuck/webswarm/webswarm.py | webswarm.py | py | 1,633 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "epuck_basic.EpuckBasic",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "epuck_basic.EpuckBasic.__init__",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "epuck_basic.EpuckBasic",
"line_number": 29,
"usage_type": "attribute"
},
... |
35303085389 | import time
# * This import allows us to use Appium's By class to locate elements within a native mobile app or a web view.
from appium.webdriver.common.appiumby import AppiumBy
# * This import provides the ActionChains class, which allows us to perform complex actions like click-and-hold, drag-and-drop, or double-cli... | qateam-neo/fe-connect-automation | helpers/locator_helper.py | locator_helper.py | py | 5,178 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "helpers.swipe_helper.SwipeHelper",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.support.ui.WebDriverWait",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.support.expected_conditions.element_to_be_clickab... |
19726425232 | import time
from data import Access
from Queue import Empty
class Source:
def __init__(self, transverse):
self.t = transverse
def get_new_submissions(self, limit=10):
bad_flairs = ('meta post', 'Reported faulty')
size = self.t.queue.qsize()
submissions = self.t.reddit.get_sub... | admgrn/Switcharoo | scraper/scraper/source.py | source.py | py | 1,135 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "Queue.Empty",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "data.Access",
"line_number": 34,
"usage_type": "call"
}
] |
27146973153 | import json
import csv
import datetime
import queue
# Reads in log files and splits them up a
# way which allows them to be matched with packets
def read_in_log(log_file):
result = []
with open(log_file, 'r') as data:
# Read in and format the data so it can later some of it can
# be converted t... | dyllew3/Timing-Attacks-Against-Opennym | Testing/format.py | format.py | py | 8,696 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 61,
... |
40128751704 | #!/usr/bin/env python3
# fast input
from heapq import heappop, heappush
import sys
input = sys.stdin.buffer.readline
INF = 10 ** 10
# INF = float("inf")
def main(H, W, K, x1, y1, x2, y2, mapdata):
start = x1 * W + y1
goal = x2 * W + y2
NUM_DIR = 4
distances = [(INF, 0)] * (H * W * NUM_DIR)
key = ... | nishio/atcoder | abc170/f_finetune.py | f_finetune.py | py | 4,114 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.stdin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "heapq.heappop",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line... |
3392747814 | import re
from django.core.exceptions import ValidationError
from tools.global_validator import GlobalValidator
class AbrigoValidator(GlobalValidator):
@classmethod
def validar_numero_de_celular(cls, numero_de_celular:str):
formato_correto_do_numero = r'^\d{2}9\d{8}$'
resultado = re.match(formato_correto_... | AntonioPGR/Furry-Friends-Refuge-BackEnd | abrigos/validators.py | validators.py | py | 770 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "tools.global_validator.GlobalValidator",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "re.match",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 19,
"usage_type": "call"
}
] |
75063847547 | from os import environ as env
from pyspark.sql import SparkSession
from pyspark.sql.functions import col, lit, when, udf
from pyspark.sql.types import *
import pandas as pd
import json
from datetime import datetime
import pytz
import random
DRIVER_PATH = env["DRIVER_PATH"]
env['PYSPARK_SUBMIT_ARGS'] = f'--driver-cl... | yaninacarletti/ETL_Airplane_Tickets | airflow_spark/scripts/spark_data_transformation.py | spark_data_transformation.py | py | 6,538 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pytz.timezone",
"line_number": 1... |
16675238933 | from threading import RLock
from uuid import uuid4
from weavelib.exceptions import ObjectNotFound
class BaseApplication(object):
def __init__(self, name, url, app_token):
self.name = name
self.url = url
self.app_token = app_token
class SystemApplication(BaseApplication):
pass
clas... | HomeWeave/WeaveServer | messaging/application_registry.py | application_registry.py | py | 1,817 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "threading.RLock",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "weavelib.exceptions.ObjectNotFound",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "weaveli... |
73409855229 | import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.chrome.options import Options
opts = Options()
opts.add_argument(
'user-agent=Mozil... | estebanhirzfeld/Python-Web-Scrapping | ML Selenium/mercadolibre.py | mercadolibre.py | py | 2,191 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 12,
"usage_type": "name"
},
{
... |
3986823660 | """The http middleware"""
from functools import partial
from .http_callbacks import HttpRequestCallback, HttpMiddlewareCallback
from .http_request import HttpRequest
from .http_response import HttpResponse
async def _call_handler(
handler: HttpRequestCallback,
request: HttpRequest
) -> HttpResponse:... | rob-blackbourn/bareASGI | bareasgi/http/http_middleware.py | http_middleware.py | py | 924 | python | en | code | 26 | github-code | 6 | [
{
"api_name": "http_callbacks.HttpRequestCallback",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "http_request.HttpRequest",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "http_response.HttpResponse",
"line_number": 13,
"usage_type": "name"
},
{... |
31267267561 | import bpy
# When bpy is already in local, we know this is not the initial import...
if "bpy" in locals():
# ...so we need to reload our submodule(s) using importlib
import importlib
if "config" in locals():
importlib.reload(config)
if "report" in locals():
importlib.reload(report)
... | OGRECave/blender2ogre | io_ogre/ui/__init__.py | __init__.py | py | 3,101 | python | en | code | 187 | github-code | 6 | [
{
"api_name": "importlib.reload",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "importlib.reload",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "importlib.reload",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "importlib.reload",
... |
34704945101 | ##########################################################################################
# Authors: Jacky Dam and Ali Zaidi
# Making Better Decisions with Logistic Regression and the Softmax Classifier in Python
# CSE 151B: PA1
# Date: Oct 18, 2020
################################################################... | jacky3331/LR-Softmax | PA1.py | PA1.py | py | 21,523 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fashion_mnist_dataset.utils.mnist_reader.load_mnist",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "fashion_mnist_dataset.utils.mnist_reader",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "fashion_mnist_dataset.utils.mnist_reader.load_mnist"... |
11779866600 | import json
import requests
from tqdm import tqdm
import os
# DATASET = 'geoengineering'
DATASET = 'climate'
LIMIT = 10000
SOURCE_FILE = f'data/{DATASET}/tweets_filtered_{LIMIT}.jsonl'
TARGET_FILE = f'data/{DATASET}/urls_resolved_{LIMIT}.jsonl'
if os.path.exists(TARGET_FILE):
print(f'The file {TARGET_FILE} alrea... | TimRepke/twitter-climate | code/pipeline/05_01_unroll_urls.py | 05_01_unroll_urls.py | py | 1,887 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tqdm.tqdm",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number":... |
7212779146 | from django.urls import include, path
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'education', views.EducationViewSet)
urlpatterns = [
path('', include(router.urls)),
path('portfolio', views.PortfolioLis... | FrancoLoto/portfolio_django_react | api/portfolio/urls.py | urls.py | py | 416 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_na... |
39791632774 | # import mysql.connector
# dbconfig = { 'host': '127.0.0.1',
# 'user': 'SiemGHM',
# 'password': '$iemGH12',
# 'database': 'dexdb', }
# conn= mysql.connector.connect(**dbconfig)
import pymysql
import json
def dictDB(word):
query = "select word, Meaning, WordCat, wordPro, def_res, pro... | SiemGHM/Dictionary- | dexdb.py | dexdb.py | py | 2,923 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymysql.connect",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pymysql.connect",
"line_number": 38,
"usage_type": "call"
}
] |
32645631697 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains custom Maya callbacks used by ueGear.
"""
from __future__ import print_function, division, absolute_import
import maya.OpenMayaUI as OpenMayaUI
from mgear.uegear import log
logger = log.uegear_logger
def register_callbacks():
try:
... | mgear-dev/mgear4 | release/scripts/mgear/uegear/callbacks.py | callbacks.py | py | 1,419 | python | en | code | 209 | github-code | 6 | [
{
"api_name": "mgear.uegear.log.uegear_logger",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "mgear.uegear.log",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "maya.OpenMayaUI.MExternalDropCallback.addCallback",
"line_number": 20,
"usage_type":... |
71374856188 | import Graphics as artist
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import rcParams
rcParams['text.usetex'] = True
def accuracy_plot(start,accuracy, stop, memory,idx=0,savename=''):
fig = plt.figure()
start_plot = plt.subplot2grid((1,5),(0,0))
accuracy_p = plt.subplot2grid((1,5),(0,1),c... | mac389/synchrony | visualization.py | visualization.py | py | 3,413 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplot... |
26228738922 | import json
import jsonlab
# 属性是自定义类型,属性是字典类型,属性是基础类型
def test1():
class B:
def __init__(self, bbb: str):
self.bbb = bbb
class A:
def __init__(self, name: str, b: B, dict: dict):
self.name = name
self.b = b
self.dict = dict
js1 = '{"name":... | kainhuck/jsonlab | example/unmarshal_demo.py | unmarshal_demo.py | py | 5,744 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "jsonlab.unmarshal",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "jsonlab.unmarshal",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "jsonlab.unmarshal",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "jsonlab.unmarsh... |
3559694661 | from functools import reduce
nums=[5,10,6,33,8,999,52,4,2,1000,20,1]
#Filter. So filtering means selecting some data based onsome logic
evens= list(filter(lambda n:n%2==0,nums))
print(evens)
#Map. MAp means to apply some operation on each data present in the list
doubles= list(map(lambda n:n*2, evens))
print(doubles... | shilpijoshi22/PythonBasics | Python Basic/PythonUnitPrograms/MapReduceFilter.py | MapReduceFilter.py | py | 548 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "functools.reduce",
"line_number": 15,
"usage_type": "call"
}
] |
16531092545 | from random import randrange
from pyglet.resource import image as p_image
from domain import Sticks
from domain.utils import splitPartition
from init import selectKey
from .actor import Actor
class SticksActor(Actor):
def __init__(self, position: tuple, count: int = None):
"""
Sticks Actor in ga... | Intey/pygamed | actors/sticks_actor.py | sticks_actor.py | py | 1,561 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "actor.Actor",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "random.randrange",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "domain.Sticks.MIN",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "domain.Sticks",
... |
19481481907 | import numpy as np
import pandas as pd
import re
import collections
from sklearn.model_selection import train_test_split
from nltk.corpus import stopwords
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.utils.np_utils import to_categorical
from keras.mode... | rishyraj/twittersentimentanalysis | twitter_classification_sentiment.py | twitter_classification_sentiment.py | py | 6,606 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 67,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "matpl... |
31449469327 | """VAE augmentation"""
import pandas
from AugmentStrat.CVAE_strat.CVAE import CVAE_meta
from data.DataProcessor import separate_per_class
import torch
from AugmentStrat.VAE_strat.utils import to_var
class CVAE():
def __init__(self, argdict):
self.argdict=argdict
self.algo_is_trained=False
s... | smolPixel/DataAugmentationEMNLP2023 | AugmentStrat/CVAE.py | CVAE.py | py | 2,113 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "AugmentStrat.CVAE_strat.CVAE.CVAE_meta",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "AugmentStrat.VAE_strat.utils.to_var",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_number": 33,
"usage_type": "call"
}
] |
25751933661 | from typing import List
# Leetcode #990: Satisfiability of Equality Equations
class unionFind:
def __init__(self, n):
self.count = n # Number of unions
self.parents = [i for i in range(n)] # Initially all parents are itself
def find(self, i):
if self.parents[i] != i: # Equal to itself... | eba472/knowledge | competition/algos/unionFind.py/unionFind.py | unionFind.py | py | 1,248 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 25,
"usage_type": "name"
}
] |
33530162811 | import bs4
import requests
def get_internships():
res = requests.get(
"https://www.linkedin.com/jobs-guest/jobs/api/seeMoreJobPostings/search?currentJobId=3644104559&f_C=10667%2C1586%2C162479&geoId=103644278&keywords=intern%20OR%20internship&location=United%20States&refresh=true"
)
return res.text... | BobaTalks/internship-tracker | scraper/scraper.py | scraper.py | py | 2,928 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.ResultSet",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "bs4.Tag",
"line_... |
10420063573 | from __future__ import annotations
from collections import defaultdict
from typing import TYPE_CHECKING
from randovania.games.cave_story.layout.cs_configuration import CSConfiguration
from randovania.games.game import RandovaniaGame
from randovania.layout.preset_describer import (
GamePresetDescriber,
fill_te... | randovania/randovania | randovania/games/cave_story/layout/preset_describer.py | preset_describer.py | py | 3,918 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "randovania.layout.preset_describer.GamePresetDescriber",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "randovania.layout.base.base_configuration.BaseConfiguration",
"li... |
19480284852 | """
@package base
Base Page class implementation
It implements methods which are common to all the pages throughout the application
This class needs to be inherited by all the page classes
This should not be used by creating object instances
Example:
Class loginPage(BasePage)
"""
import requests
from base.seleni... | rishabgarg14/ex2 | base/basepage.py | basepage.py | py | 2,852 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "base.selenium_driver.SeleniumDriver",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "utilities.util.Util",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "traceback.print_stack",
"line_number": 41,
"usage_type": "call"
},
{
"api... |
74338086588 | import os
import pickle as pkl
import math
import networkx as nx
import numpy as np
import scipy.sparse as sp
import copy
import dgl
import torch
import torch.distributed as dist
from math import ceil
from random import Random
from torch.utils.data import Dataset
from scipy.sparse import csr_matrix
from collections im... | jiayouwyhit/deepdrawing | data.py | data.py | py | 13,771 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "networkx.bfs_successors",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_... |
22723806036 | import json
import time
import random
from tweepy import OAuthHandler, Cursor, API, TweepError
from fetcher.settings import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_SECRET, NUM_CRAWLED
from fetcher.whitelist import ADJECTIVE_SUPERLATIVE_MAP
consumer_key = CONSUMER_KEY
consumer_secret = CONSUMER_SECRET
acce... | fahmitok97/crowd-review | fetcher/fetcher.py | fetcher.py | py | 1,938 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fetcher.settings.CONSUMER_KEY",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "fetcher.settings.CONSUMER_SECRET",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "fetcher.settings.ACCESS_TOKEN",
"line_number": 11,
"usage_type": "name"
}... |
39859262173 | from django import template
register = template.Library()
"""
solution from https://simpleisbetterthancomplex.com/
snippet/2016/08/22/dealing-with-querystring-parameters.html
simply registering a querystring to make it easy to
search model fields and the order in which you want it sorted
"""
@register.simple_tag
de... | PatrickCoakley23/KMS | properties/templatetags/properties_extras.py | properties_extras.py | py | 1,188 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.template.Library",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 3,
"usage_type": "name"
}
] |
73787044029 | """
Utils to plot graphs with arrows
"""
import matplotlib.transforms
import matplotlib.patches
import matplotlib.colors
import matplotlib.cm
import numpy as np
import pandas as pd
import logging
from tctx.util import plot
def _clip_arrows(arrows, tail_offset, head_offset):
"""
shorten head & tail so the ... | comp-neural-circuits/tctx | tctx/util/plot_graph.py | plot_graph.py | py | 31,733 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.sqrt",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.square",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.newaxis",
"line_number": ... |
3226070031 | import kivy
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.gridlayout import GridLayout
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.core.window import Window
from kivy.uix.textinput import TextInput
Window.clearcolor=(1,1,1,1)
... | wenses/ASC | main_kivy.py | main_kivy.py | py | 3,412 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "kivy.core.window.Window.clearcolor",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "kivy.core.window.Window",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "kivy.uix.gridlayout.GridLayout",
"line_number": 14,
"usage_type": "name"
... |
7163191755 | import io
import aiohttp
from aiohttp.test_utils import unittest_run_loop
from tests import BaseTestCase
class UploadTestCase(BaseTestCase):
@unittest_run_loop
async def test_upload_single(self):
data = io.FileIO(self.test_paths[0])
request = await self.client.request("POST", "/api/v1/upload... | bndr/basic-uploader | tests/v1/test_upload.py | test_upload.py | py | 1,073 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "tests.BaseTestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "io.FileIO",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "aiohttp.test_utils.unittest_run_loop",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "aioh... |
4535285076 | import os, sys
from os.path import join as pjoin
from setuptools import setup
from distutils.extension import Extension
from distutils.spawn import spawn, find_executable
from Cython.Distutils import build_ext
import subprocess
import numpy as np
def find_in_path(name, path):
"Find a file in a search path"
# A... | sangwook236/SWDT | sw_dev/python/rnd/test/object_detection/non_maximum_suppression/setup_cuda.py | setup_cuda.py | py | 10,505 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "os.pathsep",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
8032922490 | import torch
import torch.nn as nn
from models.GraphNet import GraphNet
class Decoder(nn.Module):
def __init__(self, num_nodes, node_size, latent_node_size, num_hidden_node_layers, hidden_edge_size, output_edge_size,
num_mps, dropout, alpha, intensity, batch_norm=True, device=None):
if de... | zichunhao/mnist-graph-autoencoder | models/Decoder.py | Decoder.py | py | 1,599 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.device",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
... |
29750174814 | #!/usr/bin/env python
import sys
import logging
import multiprocessing
from itertools import imap, chain, islice
import argparse
import numpy as np
import h5py
import gomill
import gomill.sgf, gomill.sgf_moves
from gomill.gtp_states import History_move
from deepgo import cubes, state, rank
"""
This reads sgf's from... | jmoudrik/deep-go-wrap | make_dataset.py | make_dataset.py | py | 16,167 | python | en | code | 20 | github-code | 6 | [
{
"api_name": "itertools.chain.from_iterable",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "deepgo.cubes.reg_cube",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name... |
35632524244 | import torch.nn as nn
import torch.nn.functional as F
import torch
import numpy as np
from torchvision.models import resnet18
##############################
# Generator
##############################
##############################
# Encoder
##############################
class Encoder(nn.Module):
... | jerome1121/Bicycle-Dehaze | models.py | models.py | py | 2,830 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torchvision.models.resnet18",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.nn.Se... |
19314860613 | import json
from dataProcessor.gloablCountryList import globalCountryList
def writeOfficalNameJson():
data = open("data/officialNames/refined.csv", "r")
jsonDict = {}
for row in data:
reg, official = row.split(",")
jsonDict[reg] = {}
jsonDict[reg]["official_name"] = official.r... | dylanbl/mil-map | src/dataProcessor/create_json.py | create_json.py | py | 2,192 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dump",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 55,
... |
4910367913 | import os
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.keras import regularizers
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.layers import Input, Flatten, Dense, Dropout, BatchNormalization, Add, Concatenate
from tensorflow.keras.layers impor... | shivhare-anshul/AI_for_Healthcare | Anshul_Flask/DnCNN_IISc/infer_sarnet.py | infer_sarnet.py | py | 4,984 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.config.run_functions_eagerly",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tensorflow.config",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 26,
"usage_type": "attribute"
},
{
"ap... |
26664134245 | import threading
from functools import partial
import asyncio
import time
from flask import Flask, jsonify, request, send_file, session
from flask_cors import CORS
from flask_restful import reqparse
from ir.ir import create_IR, run
from comprehension.summary_producer import summary_producer
from comprehension.compreh... | DEIB-GECO/DSBot | DSBot/app.py | app.py | py | 10,731 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "log_helpers.setup_logger",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "flask_session.Se... |
2083420016 | import os
from typing import List, Optional, Tuple
def parse_image_paths(
file_paths: Optional[List[str]] = None,
dir_paths: Optional[List[str]] = None,
txt_paths: Optional[List[str]] = None,
xts: Tuple[str, ...] = (".jpg", ".jpeg", ".png"),
) -> List[str]:
"""Parse image paths from List, List of ... | gorodnitskiy/yet-another-lightning-hydra-template | src/datamodules/components/parse.py | parse.py | py | 1,544 | python | en | code | 128 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_numb... |
41648956784 | from django.shortcuts import render,redirect,reverse
from django.views.generic import View
from apps.news.models import NewsCategory,News
from utils import restful
from apps.cms.forms import WriteNewsForm
from django.views.decorators.http import require_GET,require_POST
import qiniu
from django.core.paginator import Pa... | c727657851/xzf_project | apps/cms/views.py | views.py | py | 6,669 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "apps.cmsauth.forms.LoginForm",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 31,
"usage_type": "call"
},
{
... |
5759732674 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 27 19:14:33 2019
@author: fh
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import scipy.spatial.distance as sc
#%% Importar datos.
cancelacion = pd.read_csv('cancelacion_2017.csv',encoding='latin-1')
dirty1 = pd.read_... | OscarFlores-IFi/CDINP19 | Examen1/parcial_1.py | parcial_1.py | py | 2,582 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
16839950280 | from typing import Any, List
from itertools import groupby
import time
import rclpy
import rclpy.node
import led_strip_msgs.msg
import random
from .utils import Map
import numpy as np
def color() -> List[int]:
return [random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)]
class TestStripsNod... | Gabry993/pointing-user-interface-hri | docker/pointing-user-interface/code/conveyor_utils/conveyor_utils/test_strips.py | test_strips.py | py | 3,666 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "random.randint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "rclpy.node",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "led_strip_msgs.msg.msg",
... |
74637140986 | from geopy.distance import distance
from config import Fields
from typing import Any
class Field:
value: Any
def __init__(self, table_number: int, display_name: str | None = None):
self.table_number = table_number
self.display_name = display_name
def set_value(self, data: list):
... | akuzik101/hackaton | cultobject.py | cultobject.py | py | 2,242 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Any",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "config.Fields.ID",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "config.Fields",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "config.Fields.OBJ",
... |
11812819032 | import os
import yaml
from config import BASE_PATH
def read_yaml(filename):
# 定义一个空列表
arr = []
# 组合路径
"""os.sep 为了实现WINDOWS MAC等不同平台的路径下划线动态匹配"""
file_path = BASE_PATH + os.sep + "data" + os.sep + filename
# 打开文件流
with open(file_path, "r", encoding="utf-8") as f:
# 使用yaml.safe_lo... | Cchenyw/uiAutoTestHmtt | tools/read_yaml.py | read_yaml.py | py | 856 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "config.BASE_PATH",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.sep",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "yaml.safe_load",
"line_number": 17,
"usage_type": "call"
}
] |
19437126445 | import cv2
import numpy as np
from my_working_space.kalman_filter.moving_object import MovingObject, BoundingBox
class yolo_detector:
def __init__(self, tfNet):
self.tfNet = tfNet
self.list_moving_obj = []
self.frame_index = 0
def detect(self, frame):
self.frame_index += 1
... | vohoangan123456/ThesisImplementationObjectTracking | ThesisImplementationObjectTracking/my_working_space/kalman_filter/yolo_detector.py | yolo_detector.py | py | 1,773 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.putText",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.FONT_HERSHEY_SIMPLEX",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "my_working_space.kalman_filter.moving_object.BoundingBox",
"line_number": 24,
"usage_type": "ca... |
24168292999 |
import collections
import datetime
import math
import random
import re
import sys
import bio
import variation
# constants
DEFAULT_VCF_COVERAGE = 10
DEFAULT_VCF_ZYGOSITY = "1" # choose alt
MAX_QUALITY = 160 # else too many 9s for Python
class MultiChromosomeVCF(object):
'''
manages a vcf with multiple chromos... | supernifty/mgsa | mgsa/bio/vcf.py | vcf.py | py | 18,391 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "bio.log_stderr",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "bio.log_stderr",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "variation.VariationManager",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "va... |
7770698664 | import tensorflow as tf
import pathlib
from tensorflow import keras
import numpy as np
# model path
model = keras.models.load_model(pathlib.Path.cwd()/'trained_model')
# choose photo
sunflower_path = pathlib.Path.cwd() / 'test_img' / '20x b 1.bmp'
img_height = 180
img_width = 180
img = keras.preprocessing.image.loa... | ChiaN-Yang/TensorFlow_Classification | graphenePredict_load.py | graphenePredict_load.py | py | 755 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras",
"line_number": 7,
"usage_type": "name"
},
{
"api... |
71474375227 | # Using masks for Image.composite
import numpy as np
from PIL import Image, ImageChops
def main():
# Open Lenna
lenna = Image.open('../lenna.png')
lenna.show('Lenna')
# Open Lenna's mask, convert it to binary
lenna_mask = Image.open('../lenna_mask.png').convert('1')
lenna_mask.show('Lenna\'s ... | gkostadinov/py-pil-imageprocessing | 3-masks/2.lenna_mask.py | 2.lenna_mask.py | py | 1,244 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": ... |
30354241211 | import unittest
# Local imports.
from . import datasets
from .common import get_example_data
# Enthought library imports
from mayavi.core.null_engine import NullEngine
from mayavi.sources.vtk_data_source import VTKDataSource
from mayavi.modules.scalar_cut_plane import ScalarCutPlane
from mayavi.sources.unstructured_g... | enthought/mayavi | mayavi/tests/test_cut_plane.py | test_cut_plane.py | py | 2,249 | python | en | code | 1,177 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "mayavi.core.null_engine.NullEngine",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "mayavi.modules.scalar_cut_plane.ScalarCutPlane",
"line_number": 41,
"usage_type... |
71829523388 | from django.contrib import messages
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
from django.shortcuts import redirect, render
from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _
from django.views.generic import TemplateView, Upd... | dkratzert/messlog | mysite/core/views.py | views.py | py | 2,815 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "django.views.generic.CreateView",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "mysite.core.forms.SignupForm",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.urls.reverse_lazy",
"line_number": 16,
"usage_type": "call"
},
{
... |
8650541109 | import markdown
from markdown.util import etree
class MarkdownCaption(markdown.treeprocessors.Treeprocessor):
def run(self,root):
self.search_and_change(root)
return root
def iterparent(self, tree):
for parent in tree.getiterator():
for child in parent:
yield parent, child
# Add... | anteprandium/mdx_figcaption | mdx_figcaption.py | mdx_figcaption.py | py | 1,040 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "markdown.treeprocessors",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "markdown.util.etree.Element",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "markdown.util.etree",
"line_number": 22,
"usage_type": "name"
},
{
"api_n... |
30127132579 | import argparse
import os
import pickle
import numpy as np
import cv2
from descriptors.feat_hsv_hst import retrieve_best_results as retrieve_best_results_hsv, get_hsv_hist
from data_handler import Data
from dataset_w1_gt import ground_truth_W5, ground_truth_W4
from descriptors.feat_wavelet_hash import retrieve_best_r... | mcv-m1-project-2018/Team7_Project2 | retrieve_img_5.py | retrieve_img_5.py | py | 3,513 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.resize",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dataset_w1_gt.ground_truth_W5",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "data_handler.Data",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "descriptor... |
26652930329 | import cv2 as cv
import numpy as np
img = cv.imread('data/photos/WhatsApp Image 2022-08-12 at 20.24.22 (2).jpeg')
blank = np.zeros((500, 500, 3), np.uint8)
#resize
resized = cv.resize(img, (500,500), interpolation=cv.INTER_AREA)
cv.imshow('Resized', resized)
print(resized.shape)
gray = cv.cvtColor(resized, cv.COLOR... | waguii/workspace-opencv | opencv_tutorial_1/contours.py | contours.py | py | 800 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
"line_number": ... |
72532726909 | import logging
import simcore_postgres_database.webserver_models as orm
from aiohttp import web
from aiopg.sa.result import ResultProxy
from servicelib.aiohttp.application_keys import APP_DB_ENGINE_KEY
from sqlalchemy.sql import func
log = logging.getLogger(__name__)
async def prune_expired_api_keys(app: web.Applic... | ITISFoundation/osparc-simcore | services/web/server/src/simcore_service_webserver/login/api_keys_db.py | api_keys_db.py | py | 810 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "aiohttp.web.Application",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "aiohttp.web",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "servicelib.... |
2417300077 | #custom libraries used
from HSI_math import *
from HSI_draw import *
from HSI_waypoints import *
#system libraries used
import math
import sys
import pygame
from datetime import time, timedelta
import serial
import threading
class Flightplan:
def __init__(self,wpnames): # eats a list of waypoint names on invocati... | klappj/HuHSI | HSI_main.py | HSI_main.py | py | 14,258 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.degrees",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "math.degrees",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "math.radians",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "math.degrees",
"line_numbe... |
11997979915 | # Functions Needed For This Application
from colorama import Fore
import os
from gtts import gTTS
import normal
# Convert whole text file
def convertFileToAudio():
print(Fore.YELLOW)
print()
path = input("Enter the path of file : ")
path = os.path.abspath(path)
data = open(str(path),'r'... | SwarupVishwas18/text-to-speech-converter | funcs.py | funcs.py | py | 1,562 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "colorama.Fore.YELLOW",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"... |
24274626012 | #!/usr/bin/env python
import json
import math
import socket
import struct
import threading
from decimal import *
import geopy
import requests
import rospy
from aiders.models import (BuildMapImage, BuildMapSession, Drone, Operation,
User)
from django.conf import settings
from django.contrib.g... | KIOS-Research/AIDERS | aidersplatform/django_api/logic/algorithms/build_map/img_georeference.py | img_georeference.py | py | 12,415 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "aiders.models.BuildMapImage.objects.create",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "aiders.models.BuildMapImage.objects",
"line_number": 65,
"usage_type": "attribute"
},
{
"api_name": "aiders.models.BuildMapImage",
"line_number": 65,
"usa... |
12402163063 | """
@File : MIS_function.py
@Date : 2022/4/26 9:47
@Author: 九层风(YePing Zhang)
@Contact : yeahcheung213@163.com
"""
import logging
import asyncio
import random
import string
import time
from uuid import uuid4
from faker import Faker
from signalrcore_async.hub_connection_builder import HubConnectionBuilder
URL = 'http... | cappuccino213/signalR | MIS_function.py | MIS_function.py | py | 4,447 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "faker.Fak... |
30916642200 | import re
from typing import List
from CookLangPy.ingredient import Ingredient
from CookLangPy.cookware import Cookware
from CookLangPy.timer import Timer
replaceSpecialReg = re.compile(r"(([#@])(?:[^#@\n{}]+{\S*}|\w+))")
stepOutReg = re.compile(r"(\$[CIT])(\d+)")
blockCommentReg = re.compile(r".*\[-(.*)-\]")
timerRe... | JonaEnz/CookLangPy | CookLangPy/step.py | step.py | py | 2,615 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 11,
... |
45522416836 | import numpy as np
import pandas as pd
import math
import cv2
def get_wavelength(voltage):
'''
get the wavelength of an electron beam accelerated to a given voltage, value in kV.
'''
#print('Voltage=', voltage)
planck = 6.62607015e-34
lightspeed=3e+08
#electron_rest_mass= 9.1093837015e-31 ... | gabriel-ing/CTF_sim | CTF_functions.py | CTF_functions.py | py | 5,237 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.DataFrame",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "math.pi",
"line_number": 69,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_numb... |
273211415 | # PyGame library
import pygame
import math
# Particle class
class Particle:
# Constructor
def __init__(self, x, y, mass, color, scale, trail, velocity = [0, 0]):
self.x = x
self.y = y
self.mass = mass
self.color = color
self.velocity = velocity
self.acceleration ... | giusgo/poor-quality-particle-gravity-simulator | newton/particle.py | particle.py | py | 1,505 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.draw.lines",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.circle",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
... |
18465939609 | import streamlit as st
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier
df = pd.read_csv("Air_Quality.csv")
# Vectorize the text data using TfidfVectorizer
X=df[['SOi','Noi','Rpi','SPMi']]
Y=df['AQI']
X... | Deepakkumar1901/Air-Quality | AQ_app.py | AQ_app.py | py | 2,492 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeRegressor",
"line_number": 17,
"usage_type": "call"
},... |
32142281587 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 24 17:51:52 2019
@author: hrishi
"""
import numpy as np
from itertools import combinations
import pandas as pd
file_name = "associationruletestdata"
#Code for getting data from the file and converting it into a matrix for processing
def getData(f... | hrishi-n/Academics | CSE-601-Data-Mining-and-Bioinformatics/Project1/Association/Code/apriori.py | apriori.py | py | 13,488 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.combinations",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 95,
"usage_type": "call"
}
] |
37014627524 | """Simple Network Layer
A basic text-based protocol for transferring chunks between peers,
mainly for testing, benchmark, and demonstration purposes.
"""
from connection_manager import ConnectionManager
import share
import logging
log = logging.getLogger("bp2p.net")
class SimpleNetwork(object):
"""
Main ent... | nadirizr/betterp2p | core/src/libbp2p/network/simple/__init__.py | __init__.py | py | 3,072 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "connection_manager.ConnectionManager",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "share.file_id",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_nam... |
20554237715 | from argparse import ArgumentParser
import re
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
import torchtext
from torchtext import data
from torchtext.data import Field
import torch
import torch.nn as nn
import pytorch_lightning as pl
from pytorch_lightning.metrics.clas... | 21jun/deep-learning-project-template | project/lit_text_classifier.py | lit_text_classifier.py | py | 9,154 | python | en | code | null | github-code | 6 | [
{
"api_name": "pytorch_lightning.LightningModule",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "pytorch_lightning.metrics.classification.accuracy.Accuracy",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": ... |
32067007363 | # pip install fastapi-mail
from fastapi import APIRouter, BackgroundTasks, UploadFile, File, Form
from starlette.requests import Request
from starlette.responses import JSONResponse
from config.config import settings
from scripts.common.deploy import ProjectInfo, deploy_service, ClientAliyun, sync_aliyun
from uuid impo... | milespeng/myops_fastapi | ops/deploy/route.py | route.py | py | 1,391 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "scripts.common.deploy.ProjectInfo",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "fastapi.BackgroundTasks",
"line_number": 13,
"usage_type": "name"
},
{
"api_na... |
28677031658 | import hashlib
import sys
from contextlib import contextmanager
from functools import partial
from io import StringIO
@contextmanager
def rewind(buffer=None, *, default=StringIO):
"""
>>> with rewind() as buffer:
... buffer.write('ayy')
3
>>> buffer.read()
'ayy'
>>> with rewind(buffer)... | doctaphred/phrecipes | buffers.py | buffers.py | py | 3,663 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "io.StringIO",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "contextlib.contextmanager",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "functools.partial",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
... |
12218382332 | # type: ignore
from contextlib import contextmanager
from dataclasses import dataclass
import os
from typing import Optional
import pytest
from loadenv import EnvEnum, loadenv_into_dataclass
@contextmanager
def override_env(env_vars):
old_env, os.environ = os.environ, env_vars
yield
os.environ = old_env
... | ucodery/loadenv | test/test_loadenv.py | test_loadenv.py | py | 7,294 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "contextlib.contextmanager",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "dataclasses... |
34735315205 | from django.urls import path
from .views import index, list_users, user_details, create_user, update_user, delete_user
from .views import UserDetailsView, UserCreateView, UsersListView
from .views import login_user, register_user, logout_user
urlpatterns = [
path('', index, name='index'),
path('login/', log... | DestructionCatalyst/vk_education_project | vk_education_project/users/urls.py | urls.py | py | 1,086 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "views.index",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "views.login_user",
... |
16642318597 | import removeLight
import imgTransparent
import kornia
import torch
import cv2
import numpy as np
import matplotlib.pyplot as plt
from svglib.svglib import svg2rlg
from reportlab.graphics import renderPM
kornia.__version__
def machinRunning(fileName):
# 오리진은 빛 제거 전, 그냥은 빛 제거 후
img = removeLight.removeLight(fil... | SsokSsok-CAU/API_ssokssok | convertImg.py | convertImg.py | py | 1,465 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "kornia.__version__",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "removeLight.removeLight",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.COLO... |
30353872681 | from math import sqrt
# Enthought library imports.
from traits.api import Instance, Bool, Trait, Delegate, Button
from traitsui.api import View, Group, Item, InstanceEditor
from tvtk.api import tvtk
from tvtk.tvtk_base import PrefixList
# Local imports
from mayavi.core.module import Module
from mayavi.core.pipeline_i... | enthought/mayavi | mayavi/modules/streamline.py | streamline.py | py | 9,822 | python | en | code | 1,177 | github-code | 6 | [
{
"api_name": "mayavi.core.module.Module",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "traits.api.Instance",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tvtk.api.tvtk.StreamTracer",
"line_number": 25,
"usage_type": "attribute"
},
{
"api... |
10423132863 | from __future__ import annotations
import json
import os
from unittest.mock import ANY, MagicMock, call
import pytest
from randovania.games.prime1.exporter.game_exporter import PrimeGameExporter, PrimeGameExportParams, adjust_model_names
from randovania.games.prime1.layout.prime_configuration import EnemyAttributeRa... | randovania/randovania | test/games/prime1/exporter/test_prime_game_exporter.py | test_prime_game_exporter.py | py | 10,957 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "unittest.mock.MagicMock",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "randovania.games.prime1.layout.prime_configuration.EnemyAttributeRandomizer",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "unittest.mock.MagicMock",
"line_number": ... |
37211613415 | '''
2022/9/30
Weiguang Zhang
V2 is a final version
'''
from gettext import bind_textdomain_codeset
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class createThinPlateSplineShapeTransformer(nn.Module):
def __init__(self, I_r_size, fiducial_num=[31, 31], device=torch.device('... | hanquansanren/unified_doctransformer | tpsV2.py | tpsV2.py | py | 8,381 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.device",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional.grid_s... |
10775299549 | from collections import deque, namedtuple
import json
from pprint import pprint
from requests_cache import CachedSession
from parse import parse
from dataclasses import dataclass, field
import numpy as np
data = (
CachedSession()
.get('https://adventofcode.com/2022/day/10/input', cookies=json.load(open('cookie... | knjmooney/Advent-Of-Code | 2022/10-signal.py | 10-signal.py | py | 862 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests_cache.CachedSession",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
}
] |
20521764040 | from qsim.code_block import command_type
from qsim.configuration import configuration
from qsim.event_queue import queue, event_response, event_start_response, event_ignore
from qsim.expression_analyser import expression_analyser
from qsim.json_builder import json_builder
from qsim.http_client import http_client
... | annoviko/sandbox | applications/qsim/qsim/task.py | task.py | py | 18,912 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "qsim.script.script.exist",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "qsim.script.script",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "qsim.logging.logging.warning",
"line_number": 21,
"usage_type": "call"
},
{
"api_name... |
8105434201 | # coding=utf-8
import os
import torch
import collections
import numpy as np
from attrdict import AttrDict
from nlp.sentiment_analysis_bart.script.models import BertModel
from nlp.sentiment_analysis_bart.script.tokenizer import BasicTokenizer, WordpieceTokenizer
import torch.nn.functional as F
class BertTokenizer(obje... | ys201810/pytorch_work | nlp/sentiment_analysis_bart/script/check_same_word_difference.py | check_same_word_difference.py | py | 6,411 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nlp.sentiment_analysis_bart.script.tokenizer.BasicTokenizer",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "nlp.sentiment_analysis_bart.script.tokenizer.WordpieceTokenizer",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDi... |
23912353061 | from django.shortcuts import render, HttpResponse, get_object_or_404
from django.contrib.auth.models import User, Group
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.decorators import action
from rest_framework... | andrewnippard/jabberwocky | backend/calc/views.py | views.py | py | 5,039 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.User.objects.all",
"line_number": 24,
"usage... |
31063567308 | """
average - 0.636077398285
"""
import os
import json
import numpy as np
import mir_eval
import librosa
def get_mdb_test_split_fn():
split_file = os.environ['medleydb']
split_file = os.path.join(split_file, '..', 'V1_auxiliary', 'data_splits_jiri.json')
with open(split_file, 'rb') as fh:
split_... | drwangxian/dilated_conv_model_for_melody_extraction | general/basaran/mdb.py | mdb.py | py | 2,974 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_numbe... |
25548873631 | from bs4 import BeautifulSoup
import requests
date = input("what year you would like to travel to in YYY-MM-DD format: ")
# URL= f"https://www.billboard.com/charts/hot-100/{date}/"
# print(URL)
URL= "https://www.billboard.com/charts/hot-100/2000-08-10/"
response = requests.get(URL)
webpage = response.text
# print(... | harisuryaa/Python-Projects | Time Machine/main.py | main.py | py | 1,992 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "spotipy.Spotify",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "spotipy.oauth2.Spotify... |
6909788426 | #encoding='utf-8'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import tree
import pydotplus
import operator
import pickle
import copy
import re
import os
os.environ["PATH"] += os.pathsep + 'C:/Program Files (x86)/Graphviz2.38/bin/'
class_name='好瓜'
class TrieNode(object):
def... | hsqStephenZhang/LeetCode | tree/!leetcode/Decision_Tree_byhand.py | Decision_Tree_byhand.py | py | 9,383 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.pathsep",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.log2",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "operator.itemgetter",
... |
4784255330 | from collections import deque
n = int(input())
s = input()
stack = deque()
b = [0]*n
cnt = 1
length = 0
for i in range(n):
if s[i] == "(":
stack.append(i)
length += 1
elif s[i] == ")" and 1 <= length:
b[stack.pop()],b[i] = cnt,cnt
cnt += 1
length -= 1
flg = 0
for i in ra... | K5h1n0/compe_prog_new | ABC307/d/main.py | main.py | py | 525 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
}
] |
25510893630 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import wq.db.contrib.files.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('files',... | sheppard/wq-website-v1 | db/content/migrations/0001_initial.py | 0001_initial.py | py | 5,716 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 12,
"usage_type": "call... |
28018802040 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from utils import Variable
class MultiGRU(nn.Module):
def __init__(self, vocab_size):
super(MultiGRU, self).__init__()
self.embedding = nn.Embedding(vocab_size, 128)
self.gru_1 = nn.GRUCell(128, 512)
... | RUIMINMA1996/PolymerAI | rnn.py | rnn.py | py | 3,274 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.