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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41724455675 | from keras import applications
from keras.preprocessing.image import ImageDataGenerator
from keras import Sequential, Model, optimizers
from keras.layers import Dropout, Flatten, Dense, Input
import os
# Run with GPU
import tensorflow as tf
config = tf.compat.v1.ConfigProto( device_count = {'GPU': 1 , 'CPU': 56} )
s... | lucas2298/midtermIMP | vgg16.py | vgg16.py | py | 2,816 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow.compat.v1.ConfigProto",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1.Session",
"line_number": 11,
"usage_type": "call"
},
{
... |
7419507068 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensor2tensor.layers import common_attention
from tensor2tensor.layers import common_hparams
from tensor2tensor.layers import common_layers
from tensor2tensor.layers import discretization
from tensor2tenso... | ml4astro/galaxy2galaxy | galaxy2galaxy/models/autoencoders_utils.py | autoencoders_utils.py | py | 11,475 | python | en | code | 27 | github-code | 1 | [
{
"api_name": "tensorflow.spectral.rfft2d",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tensorflow.spectral",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.complex",
"line_number": 24,
"usage_type": "call"
},
{
"api_name":... |
70880919075 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
# 传入URL
r = requests.get('https://www.csdn.net/')
# 解析URL
soup = BeautifulSoup(r.text, 'html.parser')
content_list = soup.find_all('div', attrs={'class': 'title'})
comment_count = soup.find_all('dl', attrs={'class': 'list_u... | CHOPPERJJ/Python | LearningProject/PythonBasics/Crawler.py | Crawler.py | py | 397 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
}
] |
17599916978 | import threading
import time
from datetime import datetime
class StartOverException(Exception):
"""Raise to restart the tails thread loop"""
pass
class FluffyTailsThread(threading.Thread):
def __init__(self, bot_object, bot):
threading.Thread.__init__(self)
# self.new_reminder = threadin... | Petricpwnz/NyAI | modules/fluffy_tails_thread.py | fluffy_tails_thread.py | py | 2,234 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "threading.Thread",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": ... |
12252245392 | import pandas as pd
import numpy as np
import os
import warnings
from .dataset import Dataset
from .dataframe_tools import *
from .exceptions import FailedReindexWarning, ReindexMapError
class Endometrial(Dataset):
def __init__(self, version="latest", no_internet=False):
"""Load all of the endometrial dat... | noaoch/CPTAC-data-parser | cptac/endometrial.py | endometrial.py | py | 13,971 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dataset.Dataset",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.sep",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"lin... |
5951517574 | import openai
openai.api_key = "Fill your API key here"
days = 4
place = "Paris"
prompt = f"Make me a travel plan for {days} days to {place}"
response = openai.Completion.create(
engine="text-davinci-002",
prompt=prompt,
max_tokens=4000,
temperature=0.6,
n=1,
stop=None
)
print(str(response[... | snagnik-coder/Travel-Planner | main.py | main.py | py | 344 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "openai.api_key",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "openai.Completion.create",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "openai.Completion",
"line_number": 10,
"usage_type": "attribute"
}
] |
35871335694 | from multiprocessing.managers import BaseManager
import random
import time
import queue
BaseManager.register('get_task_queue')
BaseManager.register('get_result_queue')
server_addr = '127.0.0.1'
manager = BaseManager(address=(server_addr,5000),authkey=b'abc')
manager.connect()
task = manager.get_task_queue()
result ... | PETERMAOSX/Pycharm_Code | Demo_one/page_1/t13.py | t13.py | py | 612 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "multiprocessing.managers.BaseManager.register",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "multiprocessing.managers.BaseManager",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "multiprocessing.managers.BaseManager.register",
"line_number... |
8476706656 | from flask import Flask, jsonify, request
import json
import numpy as np
from datetime import datetime
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def filtering_api():
if request.method == 'GET':
with open('data.txt', 'r') as f:
data = f.read().splitlines()
data = [j... | elahe-mohammadi/bounding-box-filtering | app.py | app.py | py | 1,534 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "json.loads",
"... |
41244608097 | import logging
import socket
import threading
from src import (
parse_args,
TestObject,
TestCase,
TEST_CASE_TO_TEST,
OBJECTS,
)
def perform_calculations(test_object, test_case):
test = TEST_CASE_TO_TEST[test_case]()
test.run(OBJECTS[TestObject(test_object)])
return str(test.report)
... | miska924/Serialization | src/server/__init__.py | __init__.py | py | 2,226 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "src.TEST_CASE_TO_TEST",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "src.OBJECTS",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "src.TestObject",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.debug",
... |
28098104562 | #!/bin/env python
# This is a script to use descriptive statistics calculated previously to produce presentation-quality graphics
# and save them as PNG files for use in a powerpoint presentation
# written by Justin Meyer
# last edited 2022-05-04
#
# import required modules
import pandas as pd
import matp... | meyer443/ABE65100-Final-Project | Temp_Graphic.py | Temp_Graphic.py | py | 1,507 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.chdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot"... |
32731325683 | """
Driver for PES-Learn
"""
import timeit
import sys
import os
import json
from six.moves import input
from collections import OrderedDict
import peslearn
import numpy as np
import pandas as pd
with open('input.dat', 'r') as f:
input_string = f.read()
input_obj = peslearn.InputProcessor(input_string)
if input_o... | CCQC/PES-Learn | peslearn/driver.py | driver.py | py | 1,993 | python | en | code | 57 | github-code | 1 | [
{
"api_name": "peslearn.InputProcessor",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "six.moves.input",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "timeit.default_timer",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "peslearn... |
22540069696 | import numpy as np
import matplotlib.pyplot as plt
# Color
# https://matplotlib.org/stable/gallery/color/named_colors.html
#https://www.yutaka-note.com/entry/matplotlib_subplots
x = np.linspace(-3,3)
y1 = x**2
y2 = x
fig, ax = plt.subplots(1, 2, squeeze=False,figsize=(8,3),tight_layout=True)
ax[0,0].plot(x, y1,"Ste... | ken-100/Investment_Python | Basic/Chart/Subplots.py | Subplots.py | py | 663 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.linspace",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "matplotli... |
72358637153 | # -*- coding: utf-8 -*-
from flask import Flask, render_template, request
from webapp.forms import db, ModelPosts, ModelComments, ModelTags
from read_db import *
# импорт семантического анализа
from semantic import semantic_res
def f_toxic_vals(v0, v1, v2):
# processing results function for provide into web-page... | Leonid-SV/ToxicStackOverflow | webapp/__init__.py | __init__.py | py | 3,469 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "webapp.forms.db.init_app",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "webapp.forms.db",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "flask.request.me... |
72417026914 | from aiogram import Bot, Dispatcher,executor,types
from token_auth import token
from script import get_user_info,get_user_subs,get_friends_user,get_user_photo
import json
def telegram_bot(token):
bot = Bot(token=token,parse_mode=types.ParseMode.HTML)
dp = Dispatcher(bot=bot)
#@dp.message_handl... | antifalcone/myhobby | searchingforwatching.py | searchingforwatching.py | py | 4,285 | python | ru | code | 1 | github-code | 1 | [
{
"api_name": "aiogram.Bot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "token_auth.token",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "aiogram.types.ParseMode",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "aiogram.types"... |
22408996664 | import sys
from collections import deque
input = sys.stdin.readline
# bfs와 이분탐색 활용문제
# 처음에는 다리무게를 활용하여 도착지에 갈 수 있는 최소 무게를 탐색
# 나중에는 이분탐색을 활용해 도달할 수 있는 무게의 최대값을 탐색
def bfs(w):
q = deque()
q.append(S)
visited = [0] * (N+1)
visited[S] = 1
while q:
A = q.popleft()
for B, C in G[A]:
... | kky0455/Beakjoon_code | rank/gold/1939.py | 1939.py | py | 999 | python | ko | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
}
] |
70976183713 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 19 11:41:36 2018
@author: Susan
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# making phi matrix
def base_func(x,j,M,s):
muj = np.asarray(4*j/M).reshape(1,len(j)) # 各種不同muj
phi = (np.tile(x,M)-np.tile(muj,(x.shape[0],1)))/s # si... | chunshou-Liu/MachineLearning | Assignment2/Bayesian Linear Regression.py | Bayesian Linear Regression.py | py | 8,786 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.asarray",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.tile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number... |
33821375551 | from tkinter import *
from tkinter import filedialog
from tkinter import messagebox
import PyPDF2
import os
files=Tk()
files.title('Easy Files')
files.geometry(f'400x600')
files.resizable(False,False)
# Add a frame to set the size of the window
frame= Frame(files, relief= 'sunken')
frame.pack(fill= BOTH, e... | irfanrasheedkc/pdf_to_doc | easyfiles.py | easyfiles.py | py | 3,409 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.path.split",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "o... |
1155368532 | import sqlite3, datetime
from EmployeeEdit import randserial
from Login import clear
from Inventory import unique
conn = sqlite3.connect('MarksHardware.db')
cursor = conn.cursor()
def uniquesales(ID): #ensures unique Ids
for id in conn.execute("SELECT SALESID FROM SALES"):
if id[0] == ID:
return False
... | m247murray/MacroHard | Sales.py | Sales.py | py | 3,169 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlite3.connect",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "Login.clear",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "EmployeeEdit.randserial",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "Inventory.unique",... |
72582152355 | import pandas as pd
from re import split
from tqdm import tqdm
## COUNT GAMES BY INITIAL PLYS
d = pd.read_csv('../data/csv/caissa_clean.csv', index_col=0)
f = lambda pgn: sum([m.strip().split() for m in split(r'\d+\.', pgn) if len(m) > 0],[])
def extract_first_plys(row):
plys = {}
plys['Year'] = row.Year
... | EgorLappo/cultural_transmission_in_chess | data_processing/generate_tables.py | generate_tables.py | py | 1,957 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.NA",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "tqdm.tqdm",
"line_number": ... |
17363307259 | import torch.optim as optim
import torchvision.transforms as T
# For list of supported models use timm.list_models
MODEL_NAME = "resnet18"
NUM_ClASSES = 10
IN_CHANNELS = 3
USE_TORCHVISION = False # If you need to use timm models set to False.
# USE_TORCHVISION = True # Should use Torchvision Models or timm models
P... | oke-aditya/pytorch_cnn_trainer | examples/config.py | config.py | py | 1,462 | python | en | code | 26 | github-code | 1 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 30,
"usage_type": "call"
},
{
... |
10000155956 | import pytest
from rest_framework.test import APIClient
from django.urls import reverse
from website.models import Trip
from website.models.profile import UserDetail
import mock
from rest_framework.response import Response
from website.api.v1.main_page.serializers import TripSerializerRetrieve
from django.shortcuts imp... | mahdi-darvishzadeh/Travelo-BackEnd | core/website/tests/main_page/test_trip_retrieve.py | test_trip_retrieve.py | py | 1,273 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.test.APIClient",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "website.models.Trip.objects.create",
"line_number": 20,
"usage_type": "call"
},
{
... |
72507372834 | from __future__ import division
import cv2
import numpy as np
# global
# HSV 色值:
GREEN = [40, 65, 13, 80, 255, 255] # Green
YELLOW = [20, 103, 80, 40, 255, 255] # Yellow
BLUE = [94, 81, 82, 126, 255, 255] # Blue
RED = [0, 144, 0, 20, 255, 255] # Red
# default value: Blue 蓝色
lowHue = BLUE[0]
lowSat = BLUE[1]
lowV... | SPOOKY01/Vanilla | RASPBERRYPI/detected_END.py | detected_END.py | py | 4,752 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "cv2.cvtColor",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"li... |
72143450595 | import datetime
from typing import Any, Dict, List, Optional, Type, TypeVar, Union, cast
import attr
from dateutil.parser import isoparse
from ..types import UNSET, Unset
T = TypeVar("T", bound="PatchedStepInvocation")
@attr.s(auto_attribs=True)
class PatchedStepInvocation:
"""Dynamically removes fields from s... | caltechads/brigid-api-client | brigid_api_client/models/patched_step_invocation.py | patched_step_invocation.py | py | 3,288 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.TypeVar",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "types.UNSET",
"line_number... |
1401342227 | import pandas as pd
import numpy as np
import pdfplumber
import re
import zipfile
import os
def unzipper(zip):
"""
unzips zipfile and stores content in tempfolder on same level directory.
returns list of directories of pdf files in temp folder.
______
takes in the zipfile.
"""
path = 'data... | moritzgeiger/stockist | stockist/pdfparser.py | pdfparser.py | py | 2,792 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
14205279543 | from django.conf import settings
from django.contrib.auth import (
login as auth_login,
logout as auth_logout,
REDIRECT_FIELD_NAME
)
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import redirect, render, resolve_url, reverse
from django.utils.http import is_s... | reactsuperwizard/clublink_django_certificate | cms/modules/dashboard/views.py | views.py | py | 3,571 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "django.contrib.auth.REDIRECT_FIELD_NAME",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "django.utils.http.is_safe_url",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.resolve_url",
"line_number": 25,
"usage_type":... |
43959272703 | import pandas as pd
import streamlit as st
import plotly.express as px
st.set_page_config(page_title="Tickets Dashboard 📊 ", layout="wide" )
df = pd.read_csv('customer_support_tickets.csv')
print(df)
st.title("📊 Tickets Dashboard")
st.markdown("##")
st.sidebar.header("Please Filter Here:")
# ticket_ID = st.... | asmaakhaledd/-Automatic-Ticket-Classification-Tool | app.py | app.py | py | 1,749 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.mar... |
10786456409 | import cv2
import numpy as np
import glob
import re
img_array = []
files = sorted(glob.glob('C:\\Users\\Rodrigo\\Documents\\GitHub\\computerVision\\images\\output\\brighter\\*.png'))
files = sorted(files, key=lambda x:float(re.findall("(\d+)",x)[0]))
outputPath = 'C:\\Users\\Rodrigo\\Documents\\GitHub\\computerVision\... | B4nr/computerVision | mainPython/videoProcessing.py | videoProcessing.py | py | 668 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "glob.glob",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter",
"line_number": 19... |
6623708133 | '''This program is run separately and manually to add new entries in the
csv file that is not in the database, to the database.
'''
import csv
import sqlite3
db_connection = sqlite3.connect('events.db')
db_cursor = db_connection.cursor()
db_cursor.execute('''DROP TABLE IF EXISTS events''')
db_cursor.execute('''CREATE... | secondspass/emreminder | addtodb.py | addtodb.py | py | 845 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlite3.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 20,
"usage_type": "call"
}
] |
8675293214 | import aiohttp
API_URL = "http://gfapi.mlogcn.com/weather/v001/hour"
API_KEY = "" # 请替换为您的API密钥
class WeatherForecast:
def __init__(self, db_manager):
self.db_manager = db_manager
async def get_unique_district_codes(self):
async with self.db_manager.pool.acquire() as conn:
... | hieda-raku/forecast-project | src/forecast_request.py | forecast_request.py | py | 1,755 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "aiohttp.ClientSession",
"line_number": 20,
"usage_type": "call"
}
] |
43199315422 | import bpy
from bpy.props import StringProperty, BoolProperty
from ... utils.collection import get_groups_collection, get_scene_collections
class CreateCollection(bpy.types.Operator):
bl_idname = "machin3.create_collection"
bl_label = "MACHIN3: Create Collection"
bl_description = "description"
bl_op... | AtixCG/Universal-3D-Shortcuts | Blender/With Addons/scripts/addons/MACHIN3tools/ui/operators/collection.py | collection.py | py | 5,714 | python | en | code | 38 | github-code | 1 | [
{
"api_name": "bpy.types",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "bpy.data.collections.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bpy.data",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "bpy.props.String... |
72387707234 | from collections import deque
def solution(board: list[str]):
answer = 0
dx = [1,0,-1,0]
dy = [0,1,0,-1]
n = len(board)
m = len(board[0])
q = deque()
matrix = [[0 for _ in range(len(board[0]))] for _ in range(len(board))]
for idx in range(len(board)):
for jdx in ... | cafe-jun/codingTest-Algo | programmers/리코쳇로봇.py | 리코쳇로봇.py | py | 1,305 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 12,
"usage_type": "call"
}
] |
21520963102 | from jinja2 import Environment, FileSystemLoader
from netaddr import IPAddress, IPNetwork
from yamlreader import yaml_load
from nameko.rpc import rpc, RpcProxy
import ast
from nameko.standalone.rpc import ClusterRpcProxy
CONFIG = {'AMQP_URI': "amqp://guest:guest@localhost:5672"}
def check_ip_network(ip, network):
... | mmfiorenza/fwunify | services/translators/openflow/openflow.py | openflow.py | py | 10,913 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "netaddr.IPAddress",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "netaddr.IPNetwork",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "yamlreader.yaml_load",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "jinja2.File... |
1026582185 | #!pipenv run python3
from pprint import pprint
from PyInquirer import prompt, Separator
from git import Repo
import os
import sys
def get_git_root():
try:
git_repo = Repo(os.getcwd(), search_parent_directories=True)
git_root = git_repo.git.rev_parse("--show-toplevel")
return git_root
ex... | dmaahs2017/git-utils | gbdm/__main__.py | __main__.py | py | 1,055 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "git.Repo",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "git.Repo",
"line_number": 17,
"us... |
35196253380 | from direct.gui.OnscreenImage import OnscreenImage
from pandac.PandaModules import TransparencyAttrib, VBase3
from direct.showbase.DirectObject import DirectObject
from direct.gui.DirectGui import DirectButton, DGG
from direct.interval.IntervalGlobal import Sequence, LerpHprInterval
from gui.Popup import Popup
from gu... | czorn/Modifire | net/modifire/gui/menus/MainMenu.py | MainMenu.py | py | 7,038 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "direct.showbase.DirectObject.DirectObject",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "event.ClientEvent.ServerJoinResponseEvent.EventName",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "event.ClientEvent.ServerJoinResponseEvent",
... |
73476461794 | import os
from dotenv import load_dotenv
from dataclasses import dataclass, asdict
import os
import openai
from metaphor_python import Metaphor
import html2text
from gtts import gTTS, lang
# set up environment
load_dotenv()
# Class represents information about the articles collected (title, author, published date, co... | bhargavilanka/Audicle | main.py | main.py | py | 7,140 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dataclasses.asdict",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "gtts.lang... |
37657073356 | import os
import copy
import logging
import numpy as np
import json_tricks
from gym import spaces
import nni
from nni.tuner import Tuner
from nni.utils import OptimizeMode, extract_scalar_reward
from .model import Model
from .util import set_global_seeds
from .policy import build_lstm_policy
logger = logging.getLog... | danijimmy19/nni | src/sdk/pynni/nni/ppo_tuner/ppo_tuner.py | ppo_tuner.py | py | 23,509 | python | en | code | null | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "util.set_global_seeds",
"line_number": 117,
"usage_type": "call"
},
{
"api_name": "policy.build_lstm_policy",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "mo... |
41332458191 | import json
from django.http import JsonResponse
from django.views import View
from owners.models import Owner, Dogs
class OwnerRegister(View):
def get(self, request):
result = []
owner = Owner.objects.all()
# 쿼리문이기 때문에 바로 response를 하지못한다 그래서 반복문을 통해 딕셔너리형테로 만들어준뒤에 response를 해야한다.
... | nicholas019/crud2_owner | owners/views.py | views.py | py | 3,456 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.views.View",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "owners.models.Owner.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "owners.models.Owner.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
... |
40420058444 | from pathlib import Path
import numpy as np
import re
from bisect import bisect_left
from copy import deepcopy
from itertools import compress
reg = re.compile(r"(y|x)=(\d+), (y|x)=(\d+)\.\.(\d+)")
def main():
data_folder = Path(".").resolve()
data = data_folder.joinpath("input.txt").read_text()
res = Rese... | eirikhoe/advent-of-code | 2018/17/sol.py | sol.py | py | 5,780 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.full",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 8... |
75153371233 | from scipy.io import wavfile as wav
from os import walk
import os, glob, wave
import csv
path = 'C:/Users/Muhammad/Desktop/REU19/Talker_Speaker.csv'
audio_location = 'C:/Users/Muhammad/Desktop/REU19/lombardgrid/audio'
with open(path, 'a') as csv_file:
csv_reader = csv.reader(csv_file, delimiter = ',')
... | asgharm1999/Script-for-REU | Generate_CSV.py | Generate_CSV.py | py | 2,599 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "csv.reader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
... |
3710806835 | from django.shortcuts import render, get_object_or_404, redirect
from blog.models import Post
from .models import Reply
from .forms import CommentForm, PostReplyForm
def post_comment(request, post_pk):
post = get_object_or_404(Post, pk=post_pk)
user = request.user
if request.method == 'POST':
form... | xiaoming000/blog_django | comments/views.py | views.py | py | 1,803 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "blog.models.Post",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "forms.CommentForm",
"line_number": 11,
"usage_type": "call"
},
{
"api_name"... |
17360391205 | """Name hold a name choice for a Request
"""
# from . import db, ma
from marshmallow import fields
from sqlalchemy import event
from sqlalchemy.orm import backref
from sqlalchemy.orm.attributes import get_history
from namex.models import db, ma
class Name(db.Model):
__tablename__ = 'names'
id = db.Column(db... | bcgov/namex | api/namex/models/name.py | name.py | py | 8,023 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "namex.models.db.Model",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "namex.models.db",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "namex.models.db.Column",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "nam... |
72255698915 | import requests
import json
import jsonpath
import openpyxl
from DataDriven import Library
def test_add_multiple_students():
# API
API_URL = "http://thetestingworldapi.com/api/studentsDetails"
file = open("/home/afzhal-ahmed-s/PycharmProjects/AddNewStudent.json")
json_request = json.loads(file.read())... | Afzhal-ahmed-s/Noduco_SDET_training | PycharmProjects/PyTest_Learning/DataDriven/TestCase.py | TestCase.py | py | 725 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "DataDriven.Library.Common",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "DataDriven.Library",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "requests.post... |
74952017313 |
"""
Module plotpages
Utilities for taking a set of plot files and creating a set of html and/or
latex/pdf pages displaying the plots.
"""
from __future__ import absolute_import
from __future__ import print_function
import os, time, string, glob
import sys
from functools import wraps
# increase resolution for images ... | clawpack/visclaw | src/python/visclaw/plotpages.py | plotpages.py | py | 112,744 | python | en | code | 29 | github-code | 1 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
18687715314 | #-*- encoding:utf-8 -*-
import MySQLdb
import sqlite3
import sys
import codecs
reload(sys)
sys.setdefaultencoding('utf-8')
def transfer(sqliteConn, mysqlConn, srcTableName, dstTableName, baseNo, ids, cityNo = 0):
mysqlCursor = mysqlConn.cursor()
sql = "select * from %s" % dstTableName
mysqlCursor.execute(... | waklin/wxSymphony | DbFiles/Sqlite3ToMySql.py | Sqlite3ToMySql.py | py | 2,102 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "MySQLdb.connect",
"line_number": 61,
"usage_type": "call"
}
] |
30160807315 | from django.shortcuts import render
from datetime import datetime
import random
import requests
# Create your views here.
#1. 기본 로직
def index(request):
return render(request, 'pages/index.html')
def introduce(request):
return render(request, 'pages/introduce.html')
def images(request):
return render(req... | hyseo33/TIL | 03_Django/01_django_intro/pages/views.py | views.py | py | 5,792 | python | ko | code | 0 | github-code | 1 | [
{
"api_name": "django.shortcuts.render",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name"... |
6008443264 | import pandas as pd
from tsfresh import extract_features, select_features
from os import listdir
from os.path import isfile, join
from auto_feature_extraction.config import *
def select():
features_files = [f for f in listdir(features_dir) if isfile(join(features_dir, f))]
# Select features individually from each ... | JoaquinRives/Deep-Learning-Project | auto_feature_extraction/select_features.py | select_features.py | py | 1,441 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_numb... |
16473614058 | import torch
import torch.nn as nn
import torch.nn.functional as F
NOISE_VECTOR_DIM = 100
class Generator(nn.Module):
'''
Generator model definition.
In the Conditional Deep Convolutional GAN it is defined as an CNN model with
input size equal to noise vector plus the 10-class one-ho-encoding vector.
... | CristianCosci/Generative_Adversarial_Networks_GAN__Overview | cDCGAN/Generator.py | Generator.py | py | 2,048 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
73948619875 | import matplotlib
matplotlib.use("agg")
import matplotlib.pyplot as plt
import numpy as np
# Create the point data.
x = np.linspace(-1, 1)
y = x + np.random.normal(size=x.size)
# Vary the marker size.
fig = plt.figure()
ax = fig.gca()
ax.scatter(x, y, s=80)
fig.savefig("images/markers_large.png")
# Make markers di... | brohrer/taming_matplotlib | points_examples.py | points_examples.py | py | 1,404 | python | en | code | 22 | github-code | 1 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"l... |
41559488736 | def summary(outroot='summary-18.05.17'):
from hsaquery import overlaps
from grizli import utils
overlaps.summary_table(output='pointing_summary')
tab = utils.GTable.gread('pointing_summary.fits')
roots = tab['NAME']
tab['Full'] = ['<a href=https://s3.amazonaws.com/aws-gr... | grizli-project/grizli-aws | grizli_aws/master_catalog.py | master_catalog.py | py | 19,456 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "hsaquery.overlaps.summary_table",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "hsaquery.overlaps",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "grizli.utils.GTable.gread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name... |
41334766042 | import re
from pathlib import Path
import torch
def load_checkpoint(path, device='cpu'):
path = Path(path).expanduser()
is_deepspeed = False
if path.is_dir(): # DeepSpeed checkpoint
is_deepspeed = True
latest_path = path / 'latest'
if latest_path.is_file():
with open(... | DiffEqML/kairos | src/utils/checkpoint.py | checkpoint.py | py | 881 | python | en | code | 15 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 25,
"usage_type": "call"
}
] |
22495146693 | from tkinter import *
from tkinter import ttk
from PIL import Image,ImageTk
import sqlite3
from tkinter import messagebox
from student import Student
import os
import subprocess
class Login:
def __init__(self, root):
self.root=root
self.root.geometry("1750x900+0+0")
self.root.title("Login S... | nagendra-h/Pyhton_Placement_Management | check.py | check.py | py | 6,215 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "PIL.Image.ANTIALIAS",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"li... |
14879425734 | from django.conf.urls import url
import views
# from django.views.generic import TemplateView #TemplateView.as_view(template_name="about.html")
app_name = 'park'
urlpatterns = [
# url(r'^$', views.Index.as_view(), name='index'), #index is button to check, list to charge, free space to public
url(r'^log... | Ganben/pygo | park/urls.py | urls.py | py | 941 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "views.LoginView.as_view",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "views.LoginView",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "dja... |
70318908513 | #!/bin/env python3
from utils.Verilog import Verilog
import utils.APIs.APIs as api
import argparse, os
import utils.APIs.from_module as mp
calculator = Verilog("calculator", "calculator.v")
adder = mp.asVerilog({"module" : "resources/rtl/test.v"})#Verilog("adder", "adder")
subtractor = Verilog("subtractor", "subtracto... | jinrudals/generate-verilog-template | example.py | example.py | py | 1,345 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "utils.Verilog.Verilog",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "utils.APIs.from_module.asVerilog",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "utils.APIs.from_module",
"line_number": 7,
"usage_type": "name"
},
{
"api_na... |
24928316156 | from django.shortcuts import render, redirect
from django.core.files.storage import FileSystemStorage
from django.utils.datastructures import MultiValueDictKeyError
from django.core.mail import EmailMessage
from django.template.loader import render_to_string
from django.contrib.auth import authenticate,login,logout
fro... | Anandu-SK/K10 | Admin/views.py | views.py | py | 7,614 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.shortcuts.render",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 33,
"usage_type": "call"
},
{
... |
27345275869 | import matplotlib.pyplot as plt
import numpy as np
import itertools
# from numba import njit
#import pandas as pd
#@njit
def transfer_matrix(N1, N2, polar='TE', n1=1, n2=1):
tm = np.empty((2,2), dtype = np.complex)
if polar == 'TE':
tm[0, 0] = (N2 + N1) / (2. * N2)
tm[0, 1] = (N2 - N1) / (2. * N2)
tm[1, 0] = (... | Enedys/TMM_Otto | tmm_utils.py | tmm_utils.py | py | 11,969 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.empty",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.complex",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number"... |
40646941205 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed ... | kromar/blender_Shelves | preferences.py | preferences.py | py | 2,844 | python | en | code | 42 | github-code | 1 | [
{
"api_name": "bpy.types.AddonPreferences",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "bpy.props.StringProperty",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "bpy.types",
"line_number": 44,
"usage_type": "attribute"
}
] |
7786560335 | import pandas as pd
import nltk
import numpy as np
def init_df(buffer, events):
df = pd.DataFrame()
df["text_buffer"] = buffer
df["events"] = events
return df
def extract_sent(df):
sentence_buffer = []
num_sentences = []
for text in df["text_buffer"]:
sentences = nltk.tokenize.s... | vishalraj247/CoAuthorViz_Dashboard | events.py | events.py | py | 5,643 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.sent_tokenize",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.... |
24752379576 | """ JWTValidate Logic """
import argparse
import jwt
class JwtTokenValidator:
""" JWT Token Validator Class """
def __init__(self):
self.arg_parser = self.init_arg_parser()
def execute(self, args):
""" Execute """
parsed_args = self.arg_parser.parse_args(args)
secret = ''... | TeleTrackingTechnologies/forge-jwtvalidate | jwtvalidate_logic/jwtvalidate_logic.py | jwtvalidate_logic.py | py | 1,293 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "jwt.decode",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 29,
"usage_type": "call"
}
] |
42384509045 | import django
from os import path
SECRET_KEY = 'not secret'
INSTALLED_APPS = ('dumper', 'test', 'django.contrib.contenttypes')
TEMPLATE_DEBUG = DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
ROOT_URLCONF = 'test.urls'
TEMPLATES = []
# Testing
if django.VERSION[:2... | canada-nyc/django-dumper | test/settings.py | settings.py | py | 959 | python | en | code | 33 | github-code | 1 | [
{
"api_name": "django.VERSION",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "name"
}
] |
71830595234 | #%%
import pandas as pd
import numpy as np
import json
from datetime import datetime
from pathlib import Path
import os
from django.core.management.base import BaseCommand, CommandError
from trade_perf.models import AcctStatement
from sqlalchemy import create_engine
#%%
class Command(BaseCommand):
def handle(self... | loerllemit/portfolio | trade_perf/management/commands/getdata.py | getdata.py | py | 1,215 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pandas.read_excel",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 30,
"usage_type": "call"
},
{
"api_... |
17860688347 | # From http://zetcode.com/gui/pyqt4/firstprograms/
import sys
from PyQt5 import QtWidgets
def main():
app = QtWidgets.QApplication(sys.argv)
w = QtWidgets.QWidget()
w.resize(250, 150)
w.move(300, 300)
w.setWindowTitle('Simple Test')
w.show()
sys.exit(app.exec_())
if __name__ ... | meonBot/conda-recipes | pyqt5/run_test.py | run_test.py | py | 346 | python | en | code | null | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidge... |
13649087156 | import json
from rest_framework import status
from api.constans import AutoNotificationConstants, TaskStageConstants
from api.models import *
from api.tests import GigaTurnipTestHelper
class CaseTest(GigaTurnipTestHelper):
def test_case_info_for_map(self):
json_schema = {
"type": "object",
... | KloopMedia/GigaTurnip | api/tests/test_case.py | test_case.py | py | 1,860 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "api.tests.GigaTurnipTestHelper",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_200_OK",
"line_number": 49,
"usage_type": "attribute"
},
{
"a... |
20436885034 | import os
import pygame
####################################################################
# 기본 초기화(무조건 해야함)
pygame.init() # 초기화
screen_width = 640
screen_height = 480
screen = pygame.display.set_mode((screen_width, screen_height))
# 화면 타이틀 설정
pygame.display.set_caption("Hana Love")
# FPS
clock = pygame.time.Cloc... | SeungWookHan/Python-pygame | pygame_project/2_weapon_keyevent.py | 2_weapon_keyevent.py | py | 3,507 | python | ko | code | 0 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
27476889408 | """ Enhancement of pathlib, representation with a tree data-structure.
This module enhances the functionalities of pathlib, interpreting the Path
objects as nodes of a tree and automatically creating their subtrees. The tree
can be explored for analysis purposes.
"""
from pathlib import Path
from typing import U... | MCallagher/pathtreelib | pathtreelib/__init__.py | __init__.py | py | 33,778 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 98,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 98... |
26578612425 | import numpy as np
import matplotlib.pyplot as plt
import itertools as it
from numpy import random
from scipy.stats import multivariate_normal
from math import exp, sqrt, pi
from scipy.spatial import distance
## this function draws an o when the value is -1 and x otherwise
def draw_x_o(data, m, text):
print(text)
... | jaskhalsa/machine-learning-models | model-selection-q26-q29.py | model-selection-q26-q29.py | py | 5,814 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scipy.spatial.distance.squareform",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.distance",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "scipy.spatial.distance.pdist",
"line_number": 24,
"usage_type": "call"
},
{
... |
70172202595 | from __future__ import division
from functools import partial
import pandas as pd
import os
from geography import fmesh_distance, quarter_meshcode, prefecture, load_prefs
from attenuation import amp_factors
nb_sites_max = 50000
exposure_path = '../04-Exposure/'
gem_path = 'GEM/'
site_effects_path = '../02-Site Effects... | charlesco/EQCAT | EQCAT/sites.py | sites.py | py | 3,792 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "geography.fmesh_distance... |
32440994065 | #-----------------------------------------------------------------------------------------------#
# #
# I M P O R T L I B R A R I E S #
# ... | usamazf/cpi-extraction | modules/preprocessing/extract_interact_words.py | extract_interact_words.py | py | 6,926 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
30698941822 | '''
4C specific. Extracts the 5'->3' DNA sequence between a primer and its
restriction enzyme cut site.
'''
# TODO add check that tags starts with primers.
# output renamed primer.fa (fix _fwd _rev postfix)
import Bio.SeqIO
from pybedtools import BedTool
import collections
import bisect
from bx.intervals import inters... | eivindgl/GenerateTags | generatetags/find_possible.py | find_possible.py | py | 9,987 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logbook.notice",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logbook.info",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "gzip.open",
"line_number":... |
21906658165 | import datetime
from elasticsearch import Elasticsearch
from mitmproxy import http
es = Elasticsearch(['localhost'], port=9200)
def request(flow: http.HTTPFlow) -> None:
sendDataToEs(index="msteams_request", flow=flow)
def response(flow: http.HTTPFlow) -> None:
sendDataToEs(index="msteams_response", flow=fl... | CaledoniaProject/public-src | mitmproxy/to-elasticsearch.py | to-elasticsearch.py | py | 701 | python | en | code | 15 | github-code | 1 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "mitmproxy.http.HTTPFlow",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "mitmproxy.http",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "... |
977322900 | from xmlrpc.client import NOT_WELLFORMED_ERROR
import torch
import torch.utils.data as data
import torch.optim as optim
import torch.nn as nn
import numpy as np
from PIL import Image
from torchvision import transforms
import cv2
import dlib
import time
import imutils
from imutils.face_utils import rect_to_bb
from imuti... | XiaYu-max/face.Concentration.train | capture.py | capture.py | py | 2,758 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.device",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "dlib.cnn_face_de... |
27069900658 | import json
import requests
from flask import current_app
from graphqlclient import GraphQLClient
class GraphQLClientRequests(GraphQLClient):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def _send(self, query, variables):
data = {"query": query, "variables": variabl... | drkane/ngo-explorer | ngo_explorer/classes/graphqlclientrequests.py | graphqlclientrequests.py | py | 877 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "graphqlclient.GraphQLClient",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.current_app.logger.info",
"line_number": 20,
"usage_type": "call"
},
{
"api_name":... |
15896783909 | import gitlab
import argparse
import subprocess
import os
import sys
import re
from datetime import datetime
from urllib import quote
# GitLab API configuration
GITLAB_URL = 'https://gitlabe1.ext.net.nokia.com' # Update with your GitLab URL
GITLAB_TOKEN = '2wtY6dsFnu5Xas7BUDw2' # Update with your GitLab access token... | lucewang/NewMakefile | tr_checkcommit.py | tr_checkcommit.py | py | 10,662 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number... |
7757734215 | import dog
from cat import cat
#访问属性
mydog=dog.dog('willie',6)
print("My dog's name is "+mydog.name.title()+".")
print("My dog is "+str(mydog.age)+" years old")
#调用方法
mydog.sit()
#更改属性的值
mydog.age=20
print("My dog is "+str(mydog.age)+" years old")
#继承,cat继承dog 子类继承父类所有属性方法,子类也可以添加新的属性方法
mycat=cat('paris',2)
mycat.roo... | zXin1112/Python-Practice | cless/cless/cless.py | cless.py | py | 892 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dog.dog",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cat.cat",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 24,
"usage_type": "call"
}
] |
18209134724 | # This program include
# 1. receiving data from USB by pyserial
# 2. Normalize the data between 0 and 1
# 3. Store the data in image/ directory in .jpg format
PRINT_DATA=True
from models.model_classes.convNet import *
from txtToJpg import *
from test import *
from const import *
from utils import removeTxt
from tim... | navilo314hku/FYP | realTimePrediction.py | realTimePrediction.py | py | 3,387 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "serial.tools.list_ports.tools.list_ports.comports",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "serial.tools.list_ports.tools",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "serial.tools.list_ports",
"line_number": 16,
"usage_... |
20079881856 | # -*- coding: utf-8 -*-
import feedparser
import json
import os
import time # besoin pour time_obj->json
# see https://docs.python.org/2/library/time.html#time.struct_time
# def json_serial(obj):
# """JSON serializer for objects not serializable by default json code"""
# print('hello')
# ... | xdze2/lesMotsDesJournaux | getData_feedparser.py | getData_feedparser.py | py | 5,475 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.version_info",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "time.strftime",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
72068568354 | import sys
import copy
import math
import torch
from torch import nn
from torch.nn import functional as F
from torch.nn import Conv1d, ConvTranspose1d, AvgPool1d, Conv2d
from torch.nn.utils import weight_norm, remove_weight_norm, spectral_norm
sys.path.append('../..')
import modules.commons as commons
import modules.... | justinjohn0306/so-vits-svc-4.0-v2 | models.py | models.py | py | 39,167 | python | en | code | 497 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"li... |
72359488674 | import asyncio
from connectionBDD import *
from connectionZabbix import *
from Zapi import *
from datetime import datetime
import time
import sys
import pandas as pd
import os
from pandasql import sqldf
from pyzabbix import ZabbixAPI
#On récupère le path pour que le fichier exécutable soit créé dans le même répertoire... | Energies-citoyennes-en-Pays-de-Vilaine/Indicateurs-ELFE | indicateurs/main.py | main.py | py | 26,063 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.executable",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.no... |
1412018915 | import pandas as pd
import requests
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from matplotlib import transforms
import numpy as np
# Fetch data from the Elering API
start = "2022-04-01T00%3A00%3A00.000Z"
end = "2023-03-31T23%3A59%3A59.999Z"
url = f"https://dashboard.elering.ee/api/nps/price?sta... | adaresa/nutipistik | analysis/electricity_costs.py | electricity_costs.py | py | 3,880 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.cumsum",
"... |
12733542788 | import base64
import hashlib
import json
from urllib import quote_plus
from internetofmoney.managers.BaseManager import BaseManager
class PayPalBaseManager(BaseManager):
def __init__(self, database, cache_dir='cache'):
super(PayPalBaseManager, self).__init__(database, cache_dir=cache_dir)
self.p... | devos50/ipv8-android-app | app/src/main/jni/lib/python2.7/site-packages/internetofmoney/managers/paypal/PayPalBaseManager.py | PayPalBaseManager.py | py | 2,747 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "internetofmoney.managers.BaseManager.BaseManager",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "hashlib.sha256",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "base64.encodestring",
"line_number": 43,
"usage_type": "call"
},
{
... |
73737537315 | # -*- coding: utf-8 -*-
"""Realise an optimisation of the hyper-parameters.
"""
__authors__ = "emenager, tnavez"
__contact__ = "etienne.menager@inria.fr, tanguy.navez@inria.fr"
__version__ = "1.0.0"
__copyright__ = "(c) 2022, Inria"
__date__ = "Nov 7 2022"
import sys
import os
import optuna
import pathlib
import tor... | SofaDefrost/CondensedFEMModel | Applications/NetworkHyperparametersOptimisation.py | NetworkHyperparametersOptimisation.py | py | 11,073 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.path.insert",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"lin... |
39603560145 | import math
import torch
import torch.nn as nn
from torch.nn import CrossEntropyLoss
from transformers import BertModel
d_model = 768
from transformers import BertTokenizer
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased', do_lower_case=True)
def gelu(x):
"""Implementation of the gelu activation fun... | cathy345345/SD-based-on-AIEN-and-ICA | models.py | models.py | py | 8,329 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "transformers.BertTokenizer.from_pretrained",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "transformers.BertTokenizer",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.erf",
"line_number": 17,
"usage_type": "call"
},
{
"api... |
12300684128 | '''
Parses Yahoo Groups messages originally in JSON into e-mail readable format.
Must be placed in folder with JSON files to parse - however, could easily be
modified to work from single location.
'''
import json
import glob, os
import email
import html
import re
redacted = input("Should the archive be re... | apdame/YG-tools | threadparser.py | threadparser.py | py | 4,201 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "email.message_from_string",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "html.unescape",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "email.message_from_string",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "htm... |
43963665477 |
from inspect import getsourcefile
import os.path as path, sys
current_dir = path.dirname(path.abspath(getsourcefile(lambda:0)))
sys.path.insert(0, current_dir[:current_dir.rfind(path.sep)])
from AP import *
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
from scipy import optimize
import ... | brouwerb/AP3 | XST/Detektortotzeit.py | Detektortotzeit.py | py | 2,086 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "inspect.getsourcefile",
"lin... |
28444767550 | import base64
import json
import os
import time
import yaml
from io import BytesIO
import logging
import logging.config
import numpy as np
import tensorflow as tf
from azureml.core.model import Model
from PIL import Image
from utils import label_map_util
from azureml.monitoring import ModelDataCollecto... | liupeirong/tensorflow_objectdetection_azureml | aml_deploy/score.py | score.py | py | 5,888 | python | en | code | 15 | github-code | 1 | [
{
"api_name": "os.getenv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "azureml.monitoring.ModelDataCollector",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "azure.storage.blob.BlockBlobService",
"line_number": 35,
"usage_type": "call"
},
{
... |
35471287132 | # This test must be executed after test_account_transfer_funds tests in order to work properly
from ...parabank.src.base_element import BaseElement
from ...parabank.src.pages.account_services_pages.find_transactions_page import FindTransactionsPage
# from web.parabank.tests.test_account_transfer_funds import transfe... | vshkugal/pythonProject | parabank/tests/test_account_find_transactions.py | test_account_find_transactions.py | py | 8,080 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.date.today",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pytest.fixture",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "parabank.src.pages.a... |
34007480515 | from itertools import permutations as permu
INF = 10**18
N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]
M = int(input())
XY = [list(map(int, input().split())) for _ in range(M)]
invalids = set()
for x, y in XY:
x -= 1
y -= 1
invalids.add((x, y))
invalids.add((y, x))
def sol... | yojiyama7/python_competitive_programming | atcoder/else/typical90/032_atcoder_ekiden.py | 032_atcoder_ekiden.py | py | 679 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "itertools.permutations",
"line_number": 28,
"usage_type": "call"
}
] |
69943940193 | """
Handles /templates endpoint
Doc: https://developers.mailersend.com/api/v1/templates.html
"""
import requests
from mailersend.base import base
class NewTemplate(base.NewAPIClient):
"""
Instantiates the /templates endpoint object
"""
def __init__(self):
"""
NewTemplate constructor
... | digiajay/LabVIEW-to-SaaS-World | venv/Lib/site-packages/mailersend/templates/__init__.py | __init__.py | py | 1,364 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "mailersend.base.base.NewAPIClient",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "mailersend.base.base",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "mailersend.base.base.NewAPIClient",
"line_number": 19,
"usage_type": "call"
... |
32811509112 | from .metric import *
from scipy.spatial.distance import cosine
import torch
from feerci import feerci
def asnorm(enroll_test_scores, enroll_xv, test_xv, cohort_xv):
"""
Calculate adaptive s-norm
A direct and continuous measurement of speaker confusion between all
training samples is computationally ... | deep-privacy/SA-toolkit | satools/satools/sidekit/scoring/__init__.py | __init__.py | py | 2,379 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "torch.einsum",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.einsum",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.distance.cosine",
"line_number": 53,
"usage_type": "call"
}
] |
10052981995 | import argparse
import os
import chc.util.fileutil as UF
import chc.reporting.ProofObligations as RP
from chc.app.CApplication import CApplication
def parse():
parser = argparse.ArgumentParser()
parser.add_argument("cwe", help="name of cwe, e.g., CWE121")
parser.add_argument("test", help="name of test c... | static-analysis-engineering/CodeHawk-C | chc/cmdline/juliet/chc_report_juliettest.py | chc_report_juliettest.py | py | 1,690 | python | en | code | 20 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "chc.util.fileutil.get_juliet_testpath",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "chc.util.fileutil",
"line_number": 23,
"usage_type": "name"
},
{
"a... |
35712666035 | from django.urls import path
from . import views
app_name = 'todo'
urlpatterns = [
path('', views.index, name='index'),
path('completed', views.get_completed, name='get_completed'),
path('unfinished', views.get_unfinished, name='get_unfinished'),
path('add', views.add, name='add'),
path('edit/<int:... | jkirira/todo-project | todo/urls.py | urls.py | py | 592 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
73435931555 | import cv2
import numpy as np
cap = cv2.VideoCapture(r'Copy_of_offsside7.mp4')
fourcc = int(cap.get(cv2.CAP_PROP_FOURCC))
fourcc = cv2.VideoWriter_fourcc(*'XVID')
fps = cap.get(cv2.CAP_PROP_FPS)
size = (int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)), int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)))
out = cv2.VideoWriter('output.avi'... | cjustacoder/Soccer-Offside | src/player_tracking/track_players_test.py | track_players_test.py | py | 2,140 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FOURCC",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.CAP... |
20669709910 | from typing import (
Any,
Dict,
List,
Tuple,
Union,
)
from eth_utils import (
to_canonical_address,
decode_hex,
big_endian_to_int,
)
from eth_typing import (
Address,
)
from sharding.contracts.utils.smc_utils import (
get_smc_json,
)
from sharding.handler.exceptions import (
... | ethereum/sharding | sharding/handler/utils/log_parser.py | log_parser.py | py | 2,781 | python | en | code | 477 | github-code | 1 | [
{
"api_name": "typing.Dict",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "sharding.contracts.utils.smc_utils.get_smc_json",
"line_number": 42,
"usage_type": "call"
},
{
"api_name":... |
11637373168 | from flask import Blueprint, render_template
from flask import current_app as app
about_bp = Blueprint(
name = "about_bp",
import_name = __name__,
template_folder = "templates",
static_folder = 'assets'
)
@about_bp.route("/about")
def about_page():
return render_template(
"about.html", t... | brasil-em-numeros/brasil-em-numeros | dashboard/about/about.py | about.py | py | 354 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
}
] |
32247268331 | import os
import subprocess
import unittest
from click.testing import CliRunner
from impulsare_config import Reader as ConfigReader
from impulsare_distributer.queue_listener import cli
base_path = os.path.abspath(os.path.dirname(__file__))
# https://docs.python.org/3/library/unittest.html#assert-methods
class TestQue... | impulsare/distributer | tests/test_queue_listener.py | test_queue_listener.py | py | 3,170 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"li... |
74326021153 | import argparse
from cmath import e
import enum
import logging
from collections import OrderedDict
import os
import random
from shutil import copyfile
import sys
import time
import numpy as np
from sklearn import metrics
from tensorboardX import SummaryWriter
import torch
import torch.backends.cudnn as cudnn
import to... | Jeonsec/LG_Innotek_Hackathon | bin/train_TabNet.py | train_TabNet.py | py | 11,389 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
2807200688 | # -*- coding: utf-8 -*-
import sys
sys.path.append('.')
from src import *
from joblib import Parallel, delayed
from multiprocessing import cpu_count
from multiprocessing import Pool
from src.data import *
from src.dataset.base import *
from src.utils.util import *
from src.utils.util_data import *
from src.utils.u... | CGCL-codes/code_summarization_meta | src/dataset/unilang_dataloader.py | unilang_dataloader.py | py | 4,080 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "joblib.Parallel",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "joblib.delayed",
"lin... |
28207011902 | from tkinter import *
from tkinter.ttk import *
import ttkbootstrap as ttk
from ttkbootstrap.tooltip import ToolTip
from tkinter import filedialog
import sys, os, re
import tkinter
from tkinter import messagebox
from Excel_optimize import settings
from cle.data_clean import CleanWOExcel, CleanBugExcel
from sum.data_tra... | Layneliang24/Excel_optimize | UI.py | UI.py | py | 10,029 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.walk",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "re.I",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 23,
... |
38925814728 | import torch
"""
"""
import time
class data_prefetcher():
def __init__(self, loader):
st = time.time()
self.loader = iter(loader)
self.origin_loader = iter(loader)
# print('Generate loader took', time.time() - st)
self.stream = torch.cuda.Stream()
self.preload()
... | TsinghuaDatabaseGroup/AI4DBCode | FACE/train/prefetcher.py | prefetcher.py | py | 758 | python | en | code | 56 | github-code | 1 | [
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cuda.Stream",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.stream",
"l... |
20105856322 | from django.utils.translation import gettext_lazy as _
from .base import ModelBase
from django.db import models
class Entity(ModelBase):
class Meta:
db_table = "nlp_entity"
ordering = ["pk"]
verbose_name = _("entity")
verbose_name_plural = _("entities")
bot = models.ForeignKey... | tomodachii/mytempura | nlp/models/entity.py | entity.py | py | 843 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "base.ModelBase",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.gettext_lazy",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.gettext_lazy",
"line_number": 11,
"usage_type": "call"
},
... |
24621919782 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2022/5/2 9:48
# @Author : yaomy
# real+render+fuse 所有物体
import json
import torch
import random
import torch.utils.data
import torch.nn.functional as F
import torchvision.transforms as transforms
import pickle as pkl
import numpy as np
import yaml
import os
... | yaomy533/pose_estimation | dataset/linemod/lm_bop.py | lm_bop.py | py | 29,087 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.