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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10511865086 | from django.urls import path
from . import views
urlpatterns = [
path('',views.chat_view,name="chat"),
path('join_chat/',views.join_chat,name="join_chat"),
path('create_chat/',views.create_chat,name="create_chat"),
path('send_message/',views.send_message,name="send_message"),
path('get_message/<in... | LucaYan0506/NoteBook | chat/urls.py | urls.py | py | 569 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
28063509953 | import torch
from PIL import Image
from time import time
from torchvision import transforms
from torchvision.utils import save_image
from psal import PSAttention
PSIZE = 7
HPSIZE = PSIZE//2
tf = transforms.ToTensor()
imgb = "data/img1_512.png"
imga = "data/img2_512.png"
s = 512
a = tf(Image.open(imga).resize((s,... | ncherel/psal | test.py | test.py | py | 874 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": ... |
12107422451 | # -*- coding: utf-8 -*-
"""
Created on Dec 05 2016
@author: LiuYang lfliuy@gmail.com
# Following Li Yu Huai's program.
"""
import pyvisa as visa
import numpy as np
import enum
import time
import csv
import os
class Instrument:
def __init__(self, instr_name=""):
self.instr_name = instr_name
self.r... | hwaipy/InteractionFree | InteractionFreeLocal/Instrument/old/Services/WaveformGenerator/TekAWG70kService.py | TekAWG70kService.py | py | 36,021 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyvisa.ResourceManager",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 167,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 177,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"lin... |
2089173924 | from matplotlib.figure import Figure
class ChartFigure(Figure):
"""Chart figure class with drawing method"""
def __init__(self, *chart_data):
self.chart_data = chart_data
Figure.__init__(self, (5.0, 4.0), facecolor="white")
self.__axes = self.add_subplot(111)
self.draw_chart(... | mnagel/pyspread | pyspread/src/lib/charts.py | charts.py | py | 1,038 | python | en | code | null | github-code | 6 | [
{
"api_name": "matplotlib.figure.Figure",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "matplotlib.figure.Figure.__init__",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.figure.Figure",
"line_number": 9,
"usage_type": "name"
}
] |
39077230635 | from random import *
import random
import requests
from check import *
class Board:
"""
Initialize the board with different difficulty
Level range from 1 to 3
"""
def __init__(self, level):
self.board = [ [0 for row in range(9)] for column in range(9)]
params = {'size': 9, 'level': level}
request = reques... | ChrisWang0901/SudokuGame | board.py | board.py | py | 1,762 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
}
] |
43903174026 | import requests
import json
import time
import vk
import telebot
with open('config.json', 'r') as configFile: # config load
config = configFile.read()
obj = json.loads(config)
owner_id = str(obj['owner_id'])
vk_token = str(obj['vk_token'])
tg_token = str(obj['tg_token'])
unsplash_token = str(obj['unsplash_token']... | maabadot/fuckeveryword | app.py | app.py | py | 4,380 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "vk.Session",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "vk.API",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "telebot.TeleBot",
"line_number": 18,
... |
1492730937 | from django.shortcuts import render
# Create your views here.
from baiyu.views import *
from common.utils import *
def index(request):
return render(request,'index_danji.html')
'''
#渲染接口,展示祖代引种入舍总量
#by sujie 2019/05/27
'''
def show_progenitor_introduced(request):
bird_type = 3 # 白羽肉鸭
nGen = 1 # 祖代
... | Suefly/BoyarForecastSystem | danji/views.py | views.py | py | 3,445 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 31,
"usage_type": "call"
},
{
"api_name":... |
26214051514 | import feedparser
import requests
from requests.exceptions import HTTPError
def checkUrl(url):
urlString = url
try:
r = requests.get(urlString)
r.raise_for_status()
except :
return False
else:
return True
def mois (dateMois):
if dateMois == "Jan":
return '01... | Tenchigreed/twitterBot | rss.py | rss.py | py | 2,525 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "feedparser.parse",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "feedparser.parse",
"line_number": 77,
"usage_type": "call"
}
] |
37032381521 | import torch
import os
def write_scalar(writer, scalar_name, scalar, step):
writer.add_scalar(scalar_name, scalar, step)
def save_model(score, step, model, saves, log_path):
model_path = os.path.join(log_path, 'model')
if not os.path.exists(model_path):
os.makedirs(model_path)
new_save = [sc... | liuziyang365/TransformerCap | utils/save.py | save.py | py | 709 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
21381127513 | import wx, datetime, os.path, sys
from taskcoachlib import widgets, patterns
from taskcoachlib.gui import render, viewer, uicommand
from taskcoachlib.widgets import draganddrop
from taskcoachlib.i18n import _
from taskcoachlib.domain import task, category, date, note, attachment
from taskcoachlib.thirdparty import desk... | HieronymusCH/TaskCoach | branches/Release0_72_Branch/taskcoachlib/gui/dialog/editor.py | editor.py | py | 40,168 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "taskcoachlib.widgets.DateTimeCtrl",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "taskcoachlib.widgets",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "taskcoachlib.widgets.PanelWithBoxSizer",
"line_number": 41,
"usage_type": "attribu... |
73763793148 | from flask import Flask
from flask import render_template
from app.configs import init_configs
from app.extentions import db, init_extentions
from app.views import mainbp,postbp,userbp
blueprints = (
(mainbp,''),
(userbp,'/user'),
(postbp,'/post')
)
def config_blueprints(app):
for name,prefix in blue... | helloluoc/flaskblog | App/__init__.py | __init__.py | py | 684 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.views.mainbp",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "app.views.userbp",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "app.views.postbp",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "app.configs.registe... |
11208311583 | from urllib.request import urlopen
import urllib.parse
import json
with open("BGG_configuration.json", "r") as f:
config = json.load(f)
url_base_api = config['scraping']["URL_BASE_API"]
api_client_id = config['scraping']["API_CLIENT_ID"]
game_name_list = ['Brass: Birmingham', 'Pandemic Legacy: Season 1', 'Gloomh... | orielcoding/Board-Games-Geek-scraping | BGA_API_request.py | BGA_API_request.py | py | 1,549 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "urllib.request.parse.quote_... |
17953658697 | # -*- coding: utf-8 -*-
import os
import torch
from torch import distributed as dist
# init process group
def init_dist(backend='nccl', **kwargs):
torch.cuda.set_device(int(os.environ.get('LOCAL_RANK', 0)))
dist.init_process_group(backend, **kwargs)
# get rank and world_size in DDP mode
def get_dist_info(... | Tencent/Lichee | lichee/utils/parallel.py | parallel.py | py | 933 | python | en | code | 295 | github-code | 6 | [
{
"api_name": "torch.cuda.set_device",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
71461348668 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author: An Tao
@Contact: ta19@mails.tsinghua.edu.cn
@File: reconstruction.py
@Time: 2020/1/2 10:26 AM
"""
import os
import sys
import time
import shutil
import torch
import torch.optim as optim
import numpy as np
from tensorboardX import SummaryWrite... | tgy97/mba | joint.py | joint.py | py | 14,893 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
31788059693 | import re
from typing import Dict, List
def translate_types(typestr: str, type_table: Dict[str, str]) -> List[str]:
tokens = _tokenize_type(typestr)
return _translate_types(tokens, type_table)
def translate_type(typestr: str, type_table: Dict[str, str]) -> str:
tokens = _tokenize_type(typestr)
retur... | jedevc/fyp | tools/builtin_generator/translate.py | translate.py | py | 2,560 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Dict",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "re.split",
"line_number": 16,
... |
1568981722 | import keyboard
import rhinoscriptsyntax as rs
from scriptcontext import escape_test
import random
def add_circle():
center = rs.GetPoint()
radius = rs.Distance((0,0,0), center)
circle = rs.AddCircle(center, radius)
red = random.randrange(0,255,1)
green = random.randrange(0,255,1)
blue = random... | mcericson/arch_441_repo_fall_22 | 11_week/key_board.py | key_board.py | py | 547 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rhinoscriptsyntax.GetPoint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "rhinoscriptsyntax.Distance",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "rhinoscriptsyntax.AddCircle",
"line_number": 9,
"usage_type": "call"
},
{
"ap... |
29326020992 | #A function that convert and hdf5 dataset to a numpy dataset
import h5py
import sys
import numpy as np
def load_data():
hf = h5py.File('/home/ichiro19/Desktop/GITREPO/Image-Recognition-Dogs-vs-Cats/datasets/trainset.hdf5', 'r')
X_train = np.array(hf['/X_train'])
Y_train = np.array(hf['/Y_train'])
... | ichiro10/DeepLearning_Image_Recognition_Dogs_vs_Cats | utilities.py | utilities.py | py | 723 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "h5py.File",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 11,
... |
14426449996 | #testing co-relativity of data with clustering
from numpy import array
from scipy.cluster.vq import vq,kmeans,whiten
import redis
import numpy
import numpy as np
from random import choice
con=redis.Redis('localhost')
parameters=['happy','angry','unhapppy','neutral']
error_cluster=[0]*len(parameters)
#have to hack into ... | aniketshukla/AudioSentiment | cluster.py | cluster.py | py | 1,717 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "redis.Redis",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "scipy.cluster.vq.kmeans",
... |
16740191677 | import json
import os
from pyramid.httpexceptions import HTTPNotFound
from pyramid.view import view_config
@view_config(route_name='complete', renderer='cinchworm:templates/complete.jinja2')
def complete_upload(request):
metadata_path = os.path.join(os.getcwd(
), 'uploads', 'meta', '%s.json' % request.GET['id... | austinworks/cinchworm | cinchworm/views/complete.py | complete.py | py | 966 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": ... |
17302132562 | import uvicorn
from fastapi import FastAPI , Request
import os
import sys
from elasticsearch import Elasticsearch
import json
from fastapi.middleware.cors import CORSMiddleware
import threading
es = Elasticsearch(hosts="http://localhost:9200")
app = FastAPI(
title="IR API",
description="..",
version="0.1"... | mohamadhase/ES-Assigment | back/IR/__init__.py | __init__.py | py | 1,826 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "fastapi.FastAPI",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 15,
"usage_type": "argument"
},
{
... |
42896374282 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
N_SAMPLES = 10_000
T = 250
D = 30
PLOT = True
GPU = True
csmc_grad = np.load(f"csmc-{D}-{T}-25-{GPU}-True.npz")
csmc = np.load(f"csmc-{D}-{T}-25-{GPU}-False.npz")
kalman_1 = np.load(f"kalman-1-{D}-{T}-25-{GPU}-True.npz")
kalman_2 = np.load(f"kalma... | AdrienCorenflos/aux-ssm-samplers | aux_samplers/examples/stochastic_volatility/results/results_analysis_gpu.py | results_analysis_gpu.py | py | 2,853 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "numpy.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 14,
... |
36310845512 | from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^$', 'website.views.index', name='index'),
url(r'^task/$', 'website.views.task', name='task'),
url(r'^task/(?P<task_id>\d+)/$', 'website.views.task', name='task'),
url(r'^view-task/$', 'website.views.view_task', name='... | nice/todo | website/urls.py | urls.py | py | 647 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "djan... |
9310298692 | import pandas as pd
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB
from VisualizeData import plotConfusionMatrix
# Train a Gaussian Naive Bayes model
def trainNaiveBayes(df):
print('Trying Naive Bayes...')
X = df.drop(... | acnolan/Academy-Award-Predictions | NaiveBayes.py | NaiveBayes.py | py | 943 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.naive_bayes.GaussianNB",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.accuracy_score",
"line_number": 24,
"usage_type":... |
1906738075 | import logging, logging.handlers
import multiprocessing
from isix.log import core
logger = logging.getLogger("isix.daemon")
# to dispatch al messages to subhandlers
logger.setLevel( logging.DEBUG )
logger.propagate = False
# main queue
q = multiprocessing.Queue()
# queueHandler = core.MultiProcessingLogHandler(q... | teto/xp_couplage | isix/service/__init__.py | __init__.py | py | 1,070 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.Queue",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.han... |
30506288083 | # -*- coding: utf-8 -*-
import csv
from sklearn import linear_model
import numpy as np
from matplotlib import pyplot as plt
dates=[]
prices=[]
def get_data(filename):
with open(filename,'r') as csvfile:
csvfilereader = csv.reader(csvfile)
next(csvfilereader)
for row in csvfilereader:
... | tirumudi/machine-learning | linear_regression_sample.py | linear_regression_sample.py | py | 1,785 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": ... |
44177212395 | import datetime
import pytz
time_fmt = "%H:%M %Z. %B %d, %Y"
def utc_time():
""" Return current time in UTC """
utc_dt = datetime.datetime.utcnow()
utc_dt = utc_dt.replace(tzinfo=pytz.timezone('UTC'))
return utc_dt
def local_time():
""" Return current time according to the Pacific time zone """
... | d-chen/hexchat-plugins | twitch_chat_bot/modules/timemod.py | timemod.py | py | 1,025 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pytz.timezone",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
72682142907 | from matplotlib import pyplot as plt
from math import sqrt
from numba import njit
from numpy import array, cumsum, delete, histogram, loadtxt, polyfit, transpose, zeros
from numpy.random import choice, normal, randint
from os import path
from skimage.measure import label
from tqdm import tqdm
from utils import perform... | tee-lab/patchy-ecosterics | consistency_checks/temporal.py | temporal.py | py | 7,069 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.transpose",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number... |
21955321528 | import numpy as np
from skimage.io import imread, imshow
import pandas as pd
import matplotlib.pyplot as plt
import os
from sklearn.model_selection import train_test_split, StratifiedKFold, KFold
from model import Nest_Net
from losses import dice_coef_loss_bce, dice_coef, hard_dice_coef, binary_crossentropy
from my_to... | Danil328/PicsArt | main.py | main.py | py | 13,162 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "cv2.setNumThreads",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "cv2.ocl.setUseOpenCL",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "cv2.ocl",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.GPUOpt... |
16601379489 | import sqlite3
import time
import random
import math
import rpyc
import os
import datetime
from escpos.printer import Network
from kivy.app import App
from kivy.core.audio import SoundLoader
from kivy.core.window import Window
from kivy.uix.widget import Widget
from kivy.clock import Clock
running_on_pie = False # pi... | RG11rant/donuts | mainV2.py | mainV2.py | py | 18,919 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "kivy.core.window.Window.size",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "kivy.core.window.Window",
"line_number": 23,
"usage_type": "name"
},
{
"api_nam... |
33721128601 | from telethon import events
from time import sleep
from forex_python.converter import CurrencyCodes, CurrencyRates
from forex_python.bitcoin import BtcConverter
@events.register(events.NewMessage(outgoing=True, pattern=r'\.ci'))
async def runci(event):
await event.edit("Checking...")
sleep(2)
await event.d... | khdjkahkjhaskhjhdsflkjsffu/fajslajfsjflfflvakjhakhfashf | modules/currencyinformation.py | currencyinformation.py | py | 1,600 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.sleep",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "forex_python.converter.CurrencyCodes",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "forex_python.converter.CurrencyRates",
"line_number": 21,
"usage_type": "call"
},
{
... |
4214061368 | import serial
import time
import requests
import json
from gpiozero import LED
SERIAL_PORT = 9600
API_endpoint = "http://3.1.194.44:3000/api/sensor"
led = LED(17)
ser = serial.Serial('/dev/ttyACM0', SERIAL_PORT)
time.sleep(2)
while True:
led.on()
data = ser.readline().decode()
print(data)
if "{" in ... | NghiaTranUIT/intro-it-assignment-2 | raspberry pi/server.py | server.py | py | 624 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "gpiozero.LED",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "serial.Serial",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_numbe... |
33875674549 | # Import the required libraries
import requests
# Define the function to get the tool name
def get_tool_name(attack_name):
# Set the URL of the online tool database
url = "https://toolswatch.org/cyber-tools-list/"
# Send the GET request to the tool database
response = requests.get(url)
# Check t... | 0xDracarys/What-next | ToolChecker.py | ToolChecker.py | py | 801 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
}
] |
44320333914 | import torch
import exp_utils, utils
import argparse
def main(dataset):
batch_size = 64
val_size = 5000
train_size = 45000
if dataset == 'CIFAR10':
num_classes = 10
_, __, testloader = utils.get_CIFAR10(batch_size, val_size, train_size)
elif dataset == 'CIFAR100':
num_clas... | mertunsall/accordion | get_centralized_results.py | get_centralized_results.py | py | 3,391 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utils.get_CIFAR10",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.get_CIFAR100",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "exp_utils.get_resul... |
75269696188 | from pathlib import Path
monkeys, numbers, operations = [], [], []
for i, line in enumerate(Path.read_text(Path('input/day21.txt')).strip().split('\n')):
monkeys.append(line.split(':')[0])
if line[6:].split(' ')[0].isnumeric():
numbers.append(int(line[6:].split(' ')[0]))
operations.append(None)... | ingribenedicte/adventofcode2022 | day21.py | day21.py | py | 1,353 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path.read_text",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "name"
}
] |
12859909671 | import numpy as np
import pandas as pd
import signal
import multiprocessing
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Dropout
from gidi_env.gidi_sim.utils import DataLoader, PickleLoader
import tensorflow as tf
from gidi_env.gidi_sim.env_r... | smsr7/PFRNN | rnn_single_no_action.py | rnn_single_no_action.py | py | 2,970 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.models.Sequential",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "keras.layers.LSTM",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dropout",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras.... |
33869907123 | from thulac_cutter import Thulac
import os
import argparse
import json
parser = argparse.ArgumentParser()
parser.add_argument('--id', '-i')
args = parser.parse_args()
platform = int(args.id)
cutter = Thulac("/home/zhx/THULAC/models", "/home/zhx/THULAC/dict.txt")
num_process = 40
data_dir = "/data/disk1/data/wenshu_d... | xcjthu/TopTextClassification | cutter/cut.py | cut.py | py | 1,883 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "thulac_cutter.Thulac",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
70069776507 | import os.path as osp
import torch
import pandas as pd
import glob
from torch_geometric.io import read_ply
from torch_geometric.data import download_url, extract_zip
import os
import shutil
import numpy as np
# Edited because newest push to master in PytorchGeom is not in pip package (yet)
from helpers.in_memory_datas... | fclairec/geometric-ifc | datasets/BIMGEOM.py | BIMGEOM.py | py | 8,965 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "helpers.in_memory_dataset.InMemoryDataset",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.load",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "torch_geometric.data.download_url",
"line_number": 91,
"usage_type": "call"
},
{... |
72578892027 | #!/usr/bin/env python
# coding: utf-8
import h5py
import scipy.io as io
import PIL.Image as Image
import numpy as np
import os
import glob
from matplotlib import pyplot as plt
from scipy.ndimage.filters import gaussian_filter
import scipy
import json
import torchvision.transforms.functional as F
from matplotlib impor... | haoxuhao/CSRNetWithSeg | test.py | test.py | py | 3,900 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": ... |
29356972242 | import psutil
import subprocess as sp
import keyboard
WEBHOOK = False #Toggle True or False
if WEBHOOK:
#Discord webhook information
discordid = "" #If you dont know how to get it google it
webhookurl = "" #Your webhook
from discord_webhook import DiscordWebhook, DiscordEmbed
content = f"<@!{discor... | idonthaveoneatm/Autolauncher | checker.py | checker.py | py | 1,104 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "discord_webhook.DiscordWebhook",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "discord_webhook.DiscordEmbed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "psutil.process_iter",
"line_number": 23,
"usage_type": "call"
},
{
"a... |
17435174579 | import pytest
from typing import List
class Solution:
def findMin(self, nums: List[int]) -> int:
"""
[l, left, ...r][l,,.right...r]
^
if mid > r -> in the left half
-> search right
else
<- search left
When to stop... | naubull2/codingtests | leetcode/quick-prep/153_Find_Minimum_in_Rotated_Sorted_Array/solution.py | solution.py | py | 1,390 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "pytest.main",
... |
5382602794 | from typing import Tuple, List, Any
import pandas as pd
from prefect import task
from prefect.engine.results import LocalResult
from prefect.engine.result import Result
from core import DataTask
@task(checkpoint=True)
def concat_dict(datasets: List[Tuple[Any, str]]) -> dict:
"""Concat data and return dict.
A... | takafk/ml_bots | src/lib/transform/reduce.py | reduce.py | py | 1,789 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "prefect.task",
"line_number":... |
15926609240 | import argparse
import oiio_techcheck as oiiotc
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser(description="Check for files of type: "
"'.exr', '.tif', '.hdr', '.jpg', '.png'"
"in input directory.\n"
... | mileslauridsen/oiio_techcheck | oiio_techcheck/oiio_techcheck_cli.py | oiio_techcheck_cli.py | py | 1,484 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "argparse.RawTextHelpFormatter",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "oiio_techcheck.seq_stats_checker",
"line_number": 26,
"usage_type": "call"
},... |
10328057388 | from django.shortcuts import render, redirect
from . import forms
# from django import forms
from django.urls import reverse
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth import authenticate, login, logout
from django.contri... | Abdisalanvp77/GKitchen | globalkitchenapp/views.py | views.py | py | 5,877 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Booking.objects.all",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.Booking.objects",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "models.Booking",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": ... |
71315174907 | import os
import numpy as np
import datetime
from copy import deepcopy
from env.curling_env import CurlingEnv
from config import Config
from utils import Utils
class DclParser:
@staticmethod
def is_dcl(file_name):
return file_name.strip()[-4:] == ".dcl"
@staticmethod
def walk_all_dcls(root_... | leekwoon/KR-DL-UCT | src/lib/dcl_utils.py | dcl_utils.py | py | 7,643 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "os.walk",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 49... |
33019826766 | import json
from typing import Any, Dict, List
import pandas as pd
from streamlit_app.filter.Filter import Filter
class FilterSelection:
def __init__(self, name: str, filters: List[Filter]) -> None:
self._name = name
self._filters = filters
def select(self) -> None:
for filter in se... | Minor-comments/melanoma-phd | streamlit_app/filter/FilterSelection.py | FilterSelection.py | py | 765 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "streamlit_app.filter.Filter.Filter",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Any... |
14025868579 | """
@author: Yuhao Cheng
@contact: yuhao.cheng[at]outlook.com
"""
import numpy as np
import torch
import os
import pickle
from collections import OrderedDict
from torch.utils.data import DataLoader
from pyanomaly.datatools.evaluate.utils import psnr_error
from pyanomaly.core.utils import flow_batch_estimate... | YuhaoCheng/PyAnomaly | pyanomaly/core/hook/functions/anopred_hooks.py | anopred_hooks.py | py | 4,771 | python | en | code | 107 | github-code | 6 | [
{
"api_name": "abstract.EvaluateHook",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torch.randint",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "numpy... |
26504966881 | import random
from art import logo
start_game = input("Do you want to play a game of Blackjack? Type 'y' or 'n': ")
cards = [11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]
if start_game == 'y':
print(logo)
def deal_card():
return random.choice(cards)
user_cards = []
computer_cards = []
# ... | cipriancozma/Python | blackjack/blackjack.py | blackjack.py | py | 391 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "art.logo",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "random.choice",
"line_number": 12,
"usage_type": "call"
}
] |
42711226956 | from django.template import Library
from django.template.loader import get_template
from django.template.context import Context
register = Library()
@register.simple_tag
def bootstrap_horizontal_field(field):
tpl = get_template('forms/bootstrap_horizontal_field.html')
return tpl.render(Context({
'fiel... | aramael/airtkts | airtkts/libs/forms/templatetags/simple_forms.py | simple_forms.py | py | 816 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.template.Library",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.template.loader.get_template",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.template.context.Context",
"line_number": 10,
"usage_type": "call"
},
... |
22066574479 | """
K. Sweebe
elsa.main.urls shows the listing of all current urls associated with elsa's main app.
"""
from django.conf.urls import url
from . import views
app_name='main'
urlpatterns = [
# elsa's main views.
url(r'^$', views.index, name='index'),
url(r'^about/$', views.about, name='about'),
url(r... | atmospheresnode/ELSA | main/urls.py | urls.py | py | 797 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django... |
18848941804 | #!/usr/bin/env python
import io
import struct
import sys
from datetime import datetime, timedelta, timezone
from subprocess import run, PIPE
def read_u32(s):
data = s.read(4) # little-endian
return struct.unpack("<I", data)[0]
def read_u64(s):
data = s.read(8) # little-endian
return struct.unp... | ydb-platform/nbs | cloud/blockstore/tools/fs/detect-raid/__main__.py | __main__.py | py | 4,870 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "struct.unpack",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
43695675570 | # -*- coding: utf-8 -*-
"""Application agents."""
import json
import time
from datetime import datetime
from multiprocessing import Queue
from threading import Thread
from dusty_acorn.pacman import Pacman
class Agent(Thread):
"""An agent.
This is a thread, used as the agent, responsible for listen to event... | guolivar/dusty-acorn | dusty_acorn/agents.py | agents.py | py | 2,989 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "threading.Thread",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "datetime.... |
74362948029 | import cv2
import face_recognition
import face_recognition_models
import numpy as np
import dlib
import os
print("starting visualization test")
image_path = "/Users/Daniel/Desktop/pips1.jpg"
print("attempting to load image from path: {}. \nCurrent working dir: {}".format(image_path, os.getcwd()))
image = face_recogni... | danjcosg/Final-Year-Project-prototype | pipeline_testing/visualising_landmarks.py | visualising_landmarks.py | py | 2,094 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "face_recognition.load_image_file",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "face_recognition_models.pose_predictor_model_location",
"line_number": 21,
"usage_type": "call... |
1416143884 | import matplotlib.pyplot as plt
import random as rd
import math
def create_point():
"insert area and population of node and point of base station"
area_x = int(40) #meter
area_y = int(40) #meter
# num_base = int(input(" How many base sation in area = "))
station, ran_nodeX, ran_nodeY = [],[],[]
... | jjanee/Wireless-sensor | max_create_point.py | max_create_point.py | py | 2,904 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.ceil",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number"... |
24107213923 | from typing import TYPE_CHECKING
from .command_context import CommandContext, SeleniumWebdriverCommandContext
from .object_registry import ObjectRegistry, SeleniumWebdriverObjectRegistry
if TYPE_CHECKING:
from typing import Optional
from ..common.connection import USDKConnection
class USDKProtocol(object):... | Kashif186/python-eccomerce-testing | myenv/Lib/site-packages/applitools/selenium/protocol.py | protocol.py | py | 922 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "object_registry.ObjectRegistry",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "command_context.CommandContext",
"line_number": 16,
"usage_type": "name"
},
{
... |
7140442424 | import youtube_dl
import os
import traceback
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
formatter = logging.Formatter("%(levelname)s:%(asctime)s:%(name)s:%(message)s")
file_handler = logging.FileHandler("mp3-youtube-dl.log")
file_handler.setLevel(logging.ERROR)
file_handler.set... | WaltonChain/BambooWallet | mp3_downloader.py | mp3_downloader.py | py | 1,899 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.FileHandle... |
4453065174 | import re
from datetime import date
# FONCTIONS PERMETTANT D'INCLURE LES MÉTADONNÉES (teiHeader)
def var_metadata(data):
"""
Création de variables permettant de stocker certaines parties du texte relatives aux métadonnées à l'aide des
étiquettes "date-pub", "meeting-legislature", "meeting-session", "mee... | FannyLbr/Memoire-AGODA-TNAH2022 | C - Encodage automatique/C2 - Scripts Python/script_metadonnees.py | script_metadonnees.py | py | 10,832 | python | fr | code | 2 | github-code | 6 | [
{
"api_name": "re.search",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 36,
... |
20326983826 | import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import re
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor
from sklearn.preprocessing import OrdinalEncoder
from sklearn.metrics import mean_squared_error
# I... | ejahanpour/NFL_prediction_Repo | models/RF_model.py | RF_model.py | py | 2,402 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 24,
"usage_type": "call"
},
{
"api_name... |
9536385125 | #!/usr/bin/env python3
import json
import os
import sys
from datetime import datetime as dt
from functools import partial
from pathlib import Path
from typing import Annotated, Optional
import boto3
import typer
from environs import Env
from loguru import logger
from rich import print_json
cli = typer.Typer()
env = ... | flypenguin/code-misc | tools/aws-sqs-clitools/sqs-consume.py | sqs-consume.py | py | 4,286 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "typer.Typer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "environs.Env",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "loguru.logger.remove",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"li... |
72124228347 | import torch
import sys
sys.path.append(r'..\..\AnswerExtraction_demoVbdi')
from mrc.xlmroberta_mrc.data_utils import SquadExample ,convert_examples_to_features
from mrc.xlmroberta_mrc.model import XLM_MIXLAYER_single
from transformers import XLMRobertaConfig, XLMRobertaTokenizer
import numpy as np
PATH = "/content/d... | Davido111200/QuestionAnswering_demoVbdi | mrc/xlmroberta.py | xlmroberta.py | py | 3,559 | python | en | code | 20 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "transformers.XLMRobertaTokenizer.from_pretrained",
"line_number": 15,
"usage_type": "call"
},
{
"api_... |
19239086002 | # 2206 벽 부수고 이동하기
# 역대급으로 어려웠던 문제, 벽을 부순 경우와 부수지 않은 경우 각각 visited 2개 만들어 해결
import sys
from collections import deque
def bfs(VR, VC, WALL):
global ans
q = deque()
q.append([VR, VC, WALL])
visited[VR][VC] = 1
visited2[VR][VC] = 1
while q:
vr, vc, wall = q.popleft()
if vr == N-1 ... | sdh98429/dj2_alg_study | BAEKJOON/dfs/b2206.py | b2206.py | py | 1,767 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 40,
"usage_type": "attribute"
}
] |
5521796844 | import os
import random
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
from torchvision import datasets, transforms
from torch.utils.data import DataLoader
import time
import copy
import numpy as np
from torch_models.resnet import resnet18
from torch_models.mobilenetv1 import Mobil... | SuperKK72/pytorch_qat_tool | quantization_utils.py | quantization_utils.py | py | 8,331 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "torch.manual_seed",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.backends",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.backends",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "numpy.rando... |
21905438095 | # -*- coding: utf-8 -*-
from urllib.parse import urljoin
import expanddouban
from bs4 import BeautifulSoup
import csv
import requests
import time
from selenium import webdriver
import codecs
# Task 1————————————————————————————————————————————————————————————
def getMovieUrl(category, location):
url = ... | lubocsu/Udacity-Python-introduction-Project | 毕业作业/DoubanCrawler.py | DoubanCrawler.py | py | 7,005 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.parse.urljoin",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "expanddouban.getHtml",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "time.slee... |
26846774530 | #!/usr/bin/env python
# coding: utf-8
# %%
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
#from torchstat import stat
import math
import time
from collections import OrderedDict
# %%
def channel_split(x, split):
return torch.split(x, split, dim=1)
# %%
class Flatten(nn.Module):
... | YuWenLo/HarDNet-DFUS | lib/kingnet.py | kingnet.py | py | 9,320 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "torch.split",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"... |
32726455481 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime , timedelta
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db/vehicle_db.sqlite3' # Config to use sqlalchemy
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
clas... | yahyahajlaoui/car_det_reco | database.py | database.py | py | 5,931 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "d... |
21813749560 | import unittest
from itertools import permutations
from bfs import BFS
from utils import Problem, Node
class TestBFS(unittest.TestCase):
def test_that_a_simple_tree_search_returns_optimised_path(self):
actions = {'A':['B', 'E'], 'B': ['C','A'], 'C': ['D', 'H', 'E', 'B'], 'D': ['C','J'], 'E':['A', 'C', 'F']... | skcajs/ntnu-artificial-intelligence | search_algorithms/test/test_bfs.py | test_bfs.py | py | 3,533 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "utils.Node",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utils.Node",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "utils.Problem",
"line_... |
3477321480 | import logging
import ntpath
import os
import posixpath
import threading
from contextlib import suppress
from itertools import takewhile
from typing import TYPE_CHECKING, Callable, Optional, Tuple, Type, Union
from fsspec.spec import AbstractFileSystem
from funcy import cached_property, wrap_prop, wrap_with
from dvc_... | gshanko125298/Prompt-Engineering-In-context-learning-with-GPT-3-and-LLMs | myenve/Lib/site-packages/dvc/fs/dvc.py | dvc.py | py | 14,428 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Callable",... |
6606663036 | # 주사위를 굴리는게 아닌 주사위는 그냥 옮기고 위에 있는 숫자를 돌려준다고 생각
from collections import deque
dx = [0,1,0,-1]
dy = [1,0,-1,0]
def getscore(x, y):
visited = [[False for _ in range(m)] for _ in range(n)]
ret = 1
pivot = Map[x][y]
q = deque()
q.append([x, y])
visited[x][y] = True
while q:
x, y = q.pople... | JeongGod/Algo-study | leehyowonzero/15week/23288.py | 23288.py | py | 1,912 | python | ko | code | 7 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
}
] |
30071850504 | import http.client
import json
import pandas as pd
from pqdm.threads import pqdm
def get_access_token():
conn = http.client.HTTPSConnection("staging.midrc.org")
# payload = ""
payload = json.dumps({"api_key": "", "key_id": ""})
headers = {
"Content-Type": "application/json",
}
conn... | uc-cdis/midrc-etl | misc/remove_dicom.py | remove_dicom.py | py | 1,269 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "http.client.client.HTTPSConnection",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "http.client.client",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "http.client",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "j... |
39179144093 | from email import message
from importlib.resources import read_binary
from django.shortcuts import render,redirect # redirecting users back to the home page
from django.contrib import messages # django flash messages
from django.http import HttpResponse
from django.db.models import Q # optional serach
from django.cont... | LANREADE/Django-Research-Network- | base/views.py | views.py | py | 7,554 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.User.objects.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.User.objects",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "models.User",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "django.c... |
12117736025 | import argparse
import copy
import math
import os.path
import sys
import yaml
JOURNAL_DEVICE_KEY = 'journal-devices'
OSD_DEVICE_KEY = 'osd-devices'
CEPH_STANDALONE = 'ceph-standalone'
TEMPLATE_ROLES_KEY = 'roles'
MON_ROLE = 'ceph-monitor'
OSD_ROLE = 'ceph-osd'
openstack_keys = [
{'name': 'client.glance',
'v... | open-power-ref-design-toolkit/ceph-services | scripts/ulysses_ceph/generate_ceph_ansible_input.py | generate_ceph_ansible_input.py | py | 14,674 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "yaml.safe_load",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "yaml.YAMLError",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "yaml.dump",
"line_num... |
43540201679 |
import subprocess
import netifaces
from functools import reduce
from numpy.core import long
ip2int = lambda ip: reduce(lambda a,b: long(a)*256 + long(b), ip.split('.'))
int2ip = lambda num: '.'.join( [ str((num >> 8*i) % 256) for i in [3,2,1,0] ])
# print(netifaces.interfaces())
addrs = netifaces.ifaddresses('wlp2s0'... | mineralsfree/ksis_1_python | lol.py | lol.py | py | 1,545 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "functools.reduce",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.core.long",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "netifaces.ifaddresses",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "netifaces.AF_INET... |
6643317024 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
def derivada(t, y):
return ((2 * (t ** 3)) + 2) * y
def exata(t):
return np.exp((t ** 4) / 2) * np.exp(2 * t)
def euler_explicito(f, t0, y0, h, n):
t = t0
y = y0
resultados = {'x': [t0], 'Euler Explicito': [y0], 'Exata': [... | MarcoVMF/Matematica-Aplicada | Trabalho I/main.py | main.py | py | 9,153 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "numpy.exp",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"l... |
22029893709 | from io import BytesIO
from django.core.files.base import ContentFile
from django.core.files.uploadedfile import InMemoryUploadedFile
from PIL import Image
from cv2 import VideoCapture
from videos.models import Video
def create_poster(pk):
"""Create videos.Video poster.
Keyword arguments:
pk -- video... | Kshubhranshu/hunchat-api | videos/tasks.py | tasks.py | py | 964 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "videos.models.Video.objects.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "videos.models.Video.objects",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "videos.models.Video",
"line_number": 19,
"usage_type": "name"
},
{
... |
24910509843 | import matplotlib.pyplot as plt
import csv
import os
x_threads = []
y_time = []
dir = "./outputs/"
file = "output_{}.csv"
for i in range(0, 4):
csv_file = dir+file.format(i);
with open(csv_file, encoding="utf8") as f:
csv_reader = csv.reader(f)
for line in csv_reader:
x_t... | Rushmore75/JavaMultithreadedData | graph.py | graph.py | py | 634 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
18100742564 | """
https://leetcode.com/problems/minimum-score-of-a-path-between-two-cities/
2492. Minimum Score of a Path Between Two Cities
You are given a positive integer n representing n cities numbered from 1 to n. You are also given a 2D array roads where roads[i] = [ai, bi, distancei] indicates that there is a bidirectional r... | hirotake111/leetcode_diary | leetcode/2492/solution.py | solution.py | py | 1,684 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 26,
"usage_type": "call"
}
] |
20535095679 | import requests
from aws_requests_auth.boto_utils import BotoAWSRequestsAuth
host = "aws-auth-jwt-exchange.chammock.cloud"
auth = BotoAWSRequestsAuth(aws_host=host,
aws_region='us-east-1',
aws_service='execute-api')
response = requests.post(f'https://{host}', aut... | chammock/aws-auth-jwt-exchange | example/test_endpoint.py | test_endpoint.py | py | 349 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "aws_requests_auth.boto_utils.BotoAWSRequestsAuth",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 10,
"usage_type": "call"
}
] |
12731846835 | # scatter plots
import numpy as np
import matplotlib.pyplot as plt
num_points = 100
gradient = 0.5
x = np.array(range(num_points))
y = np.random.randn(num_points)*10+x*gradient
fig, ax = plt.subplots(figsize=(8,4))
'''
colors = np.random.rand(num_points)
size = (2+np.random.rand(num_points)*8)**2
ax.scatter(x,y,s=size... | ndlopez/learn_python | source/scatter_plt.py | scatter_plt.py | py | 581 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.subpl... |
32836998231 | #%%
import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
class Residual(nn.Module):
def __init__(self, fn):
super().__init__()
self.fn = fn
def forward(self, x):
return self.fn(x) + x
class Shrinkage(nn.Module):
def __init__(self, gap... | KNChiu/infrared_KFold_Torch | model/patch_RepLKNet_DRSN.py | patch_RepLKNet_DRSN.py | py | 6,413 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
21158965790 | from __future__ import print_function
from builtins import range
from reproject.utils import parse_input_data, parse_output_projection
try:
from reproject.interpolation.core_celestial import _reproject_celestial as reproj_interp
except ModuleNotFoundError:
from reproject.interpolation.core import _reproject_ful... | mhardcastle/ddf-pipeline | utils/reproj_test.py | reproj_test.py | py | 6,901 | python | en | code | 22 | github-code | 6 | [
{
"api_name": "reproject.utils.parse_input_data",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "reproject.utils.parse_output_projection",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "six.string_types",
"line_number": 31,
"usage_type": "attribute"
... |
27506623350 | import random
import logging
logging.basicConfig(level=logging.DEBUG,
filename="logs.log", filemode="a",
format="We have next logging message: "
"%(asctime)s:%(levelname)s-%(message)s"
)
class restaurant:
def __init__(self, name="restaurant" ):
self.name = name
self.money = 1000
self.ingre... | Fixoregg/piton | homework.py | homework.py | py | 2,642 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "logging.info",
... |
37431867998 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
name: mongodb 未授权漏洞
referer: unknown
author: Lucifer
description: 开启MongoDB服务时不添加任何参数时,默认是没有权限验证的,登录的用户可以通过默认端口无需密码对数据库任意操作而且可以远程访问数据库!
'''
import sys
import pymongo
from urllib.parse import urlparse
class mongodb_unauth_BaseVerify:
def __init__(self, url):
... | iceyhexman/onlinetools | scanner/plugins/system/mongodb/mongodb_unauth.py | mongodb_unauth.py | py | 1,436 | python | en | code | 1,626 | github-code | 6 | [
{
"api_name": "urllib.parse.urlparse",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 45,
"usage_type": "attribute"
}
] |
11188878977 | from unittest import loader
import discord
from discord import app_commands
from discord.ext import commands
import asyncio
import datetime
import random
import yaml
from yaml import Loader
from fetchdata import create_career_data
yaml_file = open("assets/yamls/emojis.yml", "rb")
emojis = yaml.load(yaml_file, Loader ... | Error-0xf4364c/Limon-fork | cogs/work/fishing.py | fishing.py | py | 6,905 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "yaml.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "yaml.Loader",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "yaml.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "yaml.Loader",
"line_number": 17,
... |
4013301291 | # flake8: noqa
from importlib import import_module
from pkgutil import walk_packages
from colorama import Fore
from colorama import Style
from colorama import init
from sapp.plugins.sqlalchemy.alembic import AlembicScript
# import or define all models here to ensure they are attached to the
# SqlTable.metadata prior ... | socek/cabal | backend/code/migrations/env.py | env.py | py | 1,435 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pkgutil.walk_packages",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "colorama.Fore.RED",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "... |
31869012605 | import qrcode
from qrcode import constants
qr = qrcode.make('alphabet')
qr = qrcode.QRCode(
version=1,
box_size=15,
border=5
)
data = 'wellford.nft'
qr.add_data(data)
qr.make(fit=True)
img = qr.make_image(fill_color=(255, 0, 0), back_color=(0, 0, 255))
img.save('site.png')
| lefth-nd/projects | qrcode/qr.py | qr.py | py | 298 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "qrcode.make",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "qrcode.QRCode",
"line_number": 8,
"usage_type": "call"
}
] |
3024274414 | import PySimpleGUI as sg
import openai
import pyperclip
# Set up OpenAI API credentials
openai.api_key = "YOUR_API_KEY"
# Define the ChatGPT function that sends a prompt to OpenAI and returns the response
def chat_gpt(prompt):
response = openai.Completion.create(
engine="davinci",
prompt=prompt,
... | LopeKinz/chatgpt-client-python | main_pygui.py | main_pygui.py | py | 2,462 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "openai.api_key",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "openai.Completion.create",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "openai.Completion",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "Py... |
26038824846 | from pants.backend.codegen.protobuf.protoc import Protoc
from pants.engine.rules import collect_rules, rule
from pants.engine.target import (
COMMON_TARGET_FIELDS,
AllTargets,
BoolField,
Dependencies,
MultipleSourcesField,
OverridesField,
SingleSourceField,
Target,
TargetFilesGenerat... | pantsbuild/pants | src/python/pants/backend/codegen/protobuf/target_types.py | target_types.py | py | 3,867 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "pants.engine.target.Dependencies",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "pants.engine.target.BoolField",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "pants.engine.target.Targets",
"line_number": 35,
"usage_type": "name"
},... |
3102892307 | """
Funçães para o processamento de imagem
"""
from PIL import Image
def RGBAConverter(imageColored):
"""
Função que converte pixels transparente em brancos e pretos
"""
w, h = imageColored.size
# Nova imagem rgb
imagePretoBranco = Image.new("RGB",(w,h))
for x in range(w):
... | SobrancelhaDoDragao/Digit_Recognizer | DjangoIA/model/pre_processamento.py | pre_processamento.py | py | 2,226 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.new",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 14,
"usage_type": "name"
}
] |
74183024189 | from django import test
from pacientes_app import forms
from pacientes_app import models
class PacienteEditFormTestCase(test.TestCase):
def setUp(self):
self.paciente = models.Paciente.objects.create(
cedula='18423347',
fecha_nacimiento='1988-03-26'
)
def test_valid_form(self):
data =... | gustavoatt/consultas | consultas_proyecto/pacientes_app/tests/test_forms.py | test_forms.py | py | 1,548 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.test",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pacientes_app.models.Paciente.objects.create",
"line_number": 8,
"usage_type": "call"
},
{
"a... |
26189454203 | import numpy as np
import cv2
def save_image(img, name):
cv2.imwrite(name, img.astype(np.uint8), [int(cv2.IMWRITE_PNG_COMPRESSION), 100])
baboon = cv2.imread('../baboon.png')
height = baboon.shape[0]
width = baboon.shape[1]
slices = np.zeros(shape=(16, height//4, width//4, 3))
height = height//4
width = width/... | thales-mro/basic-image-processing | exercise-1-4.py | exercise-1-4.py | py | 798 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imwrite",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.IMWRITE_PNG_COMPRESSION",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread... |
30971857135 | """Add modified and completion percentage columns to survey statistics.
Revision ID: 20220921134624
Revises:
Create Date: 2022-09-21 11:42:25.215599
"""
from alembic import op
from osha.oira.upgrade.utils import has_column
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "20220921134624"
... | euphorie/osha.oira | src/osha/oira/upgrade/alembic_statistics/versions/20220921134624_.py | 20220921134624_.py | py | 999 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "osha.oira.upgrade.utils.has_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op.add_column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "s... |
34105465151 | import cv2 as cv
import numpy as np
def segmentacao_por_movimento(img_1, img_2):
imgRGB = cv.subtract(img_2, img_1)
imgHSV = cv.cvtColor(imgRGB, cv.COLOR_BGR2HSV)
tomClaro = np.array([0, 120, 120])
tomEscuro = np.array([180, 255, 255])
imgSegmentada = cv.inRange(imgHSV, tomClaro, tomEscuro)
re... | gabrielga-dev/visao-computacional-2022 | s11/atividades/A/atividade_a.py | atividade_a.py | py | 826 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "cv2.subtract",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line... |
70861320508 | import boto3
import time
from datetime import date
import json
import os # # Importiert das os-Modul für die Codierung und Decodierung von JSON-Daten
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('Orders')
sqs = boto3.client('sqs')
sqs_queue_url = os.environ["SQS_QUEUE_URL"] # Erstellt di... | lindnech/DHL-Projekt | testordner/orderlambdatesthtmlinput.py | orderlambdatesthtmlinput.py | py | 2,340 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "boto3.resource",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_num... |
1059597899 | """
This module defines the interface for communicating with the expression.
.. autoclass:: _Expression
:members:
:undoc-members:
:show-inheritance:
"""
from __future__ import with_statement
import math
import os
import random
from functools import partial
import cmath
from opsoro.console_msg import *
from... | OPSORO/OS | src/opsoro/expression.py | expression.py | py | 8,571 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "functools.partial",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
... |
70472901627 | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
def read_data(path):
data = []
with open(path, 'r', encoding='utf-8') as file:
for line in file:
data_line = line.split()
data_line = [float(ele) / 100.0 for ele in data_line]
data.append(data_line... | phuc180155/GraduationThesis | other_model_repo/combine_chart/bar_chart.py | bar_chart.py | py | 3,357 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
1379651451 | import logging
_loggers = {}
def create_logger(name, filename):
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
# create console handler with a higher log level
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
# create formatter and add it to the handlers
formatter ... | thoriuchi0531/realtime_sound_plot | log.py | log.py | py | 990 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.DEBU... |
5452311338 | import os
import sys
import argparse
parser = argparse.ArgumentParser(description="Arguments for %s" % __file__)
parser.add_argument("--verbose", "-v", action="count", default=0)
parser.add_argument("--debug", "-d", action="store_true", default=False)
parser.add_argument("inputs", metavar="files", nargs="+", help="fil... | leedoowon/MTraceCheck | src_main/rand_stat.py | rand_stat.py | py | 986 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_numb... |
38284299336 | import tensorflow as tf
import os
import numpy as np
import sys
import tarfile
import cv2
import csv
from six.moves import urllib
import logger
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # for disable the info log of tensorflow
MODEL_DIR = "./model"
DATA_URL = 'http://download.tensorflow.org/models/image/imagenet/inc... | lanardo/Image_processing_server | Inception_model/classifier.py | classifier.py | py | 6,690 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.gfile.FastGFile",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tensorflow.gfile",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.p... |
33574397285 | import utils
if __name__ == '__main__':
timer = utils.Timer()
# Part 1
"""
timer.start()
data = {
elem.split('=')[0]: {
'min': int(elem.split('=')[1].split('..')[0]),
'max': int(elem.split('=')[1].split('..')[1])
}
for elem
in utils.read_str_... | 742617000027/advent-of-code-2021 | 17/17.py | 17.py | py | 1,685 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utils.Timer",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "utils.read_str_lines",
"line_number": 30,
"usage_type": "call"
}
] |
1758691166 | ''' HappyQLearningAgentClass.py: Class for a basic happiness-based QLearningAgent '''
# Python imports.
import random
import numpy
import time
from collections import defaultdict
import math
# Other imports.
from simple_rl.agents.AgentClass import Agent
from simple_rl.experiments import Experiment
from simple_rl.tasks... | rach0012/happiness_RL | simple_rl/agents/HappyQLearningAgentClass.py | HappyQLearningAgentClass.py | py | 18,399 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "simple_rl.agents.AgentClass.Agent",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "simple_rl.agents.AgentClass.Agent.__init__",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "simple_rl.agents.AgentClass.Agent",
"line_number": 34,
"usag... |
42892277412 | from django import forms
from .models import ContactMessage
from phonenumber_field.formfields import PhoneNumberField
from phonenumber_field.widgets import PhoneNumberPrefixWidget, RegionalPhoneNumberWidget, PhonePrefixSelect
class BlogSearchForm(forms.Form):
search_query = forms.CharField(max_length=100, wi... | haradhansharma/sincehence_com | sincehence_core/forms.py | forms.py | py | 1,324 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.Form",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.for... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.