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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
34921941272 | import numpy as np
import pandas as pd
import torch
import pickle
import random
import re
from tqdm import tqdm
from transformers.modeling_utils import PoolerAnswerClass
data_path={
'mfc': '/data/news/mfc/',
'gvfc': '/data/news/GVFC/GVFC/GVFC_headlines_and_annotations.xlsx',
'twitter': '/data/tweet/twitter... | xymou/Frame_Detection | data/load_data_multi.py | load_data_multi.py | py | 11,117 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pickle.dump",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pickle.HIGHEST_PROTOCOL",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pickle.load",
... |
28580043069 | from django.shortcuts import render
from rest_framework import generics
from rest_framework.permissions import IsAuthenticated
from order.models import Order
from order.serializers.order import OrderSerializer
class OrderView(generics.ListCreateAPIView):
queryset = Order.objects.all()
serializer_class = Orde... | PROFabdalla/payment_app | order/views.py | views.py | py | 999 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.generics.ListCreateAPIView",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "order.models.Order.objects.all",
"line_number": 10,
"usage_type": "c... |
448240955 | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import numpy as np
import keras
from keras.models import Model
from keras.layers import Dense,Activation,Input
from keras.callbacks import ModelCheckpoint
X = np.random.normal(0,1,(100,8))
Y = np.random.normal(0,1,(100,1))
... | avilin66/Pyspark_codes | keras_basic_model.py | keras_basic_model.py | py | 1,902 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.random.normal",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.normal",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.rando... |
19337719477 | import pygame
import math
from global_timer import TimedObject
class BossDeathCutscene(TimedObject):
def __init__(self, map_center_pos, boss) -> None:
self.lifetime = 999990
self.map_center_pos = map_center_pos
self.boss = boss
self.boss.global_timer.attach(self)
self.bos... | jordenskraften/snake-python | boss_death_cutscene.py | boss_death_cutscene.py | py | 3,964 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "global_timer.TimedObject",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "pygame.font.SysFont",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pygame.f... |
27048798228 | import zedlib
import pygame
import math
class GameSprite:
def __init__(self, image, x, y):
self.image = image
self.rect = self.image.get_rect()
self.position = zedlib.Position(x, y)
self.x_acceleration = 0.0
self.y_acceleration = 0.0
self.x_velocity = 0.0
se... | JoeZlonicky/ZedLib | zedlib/game_sprite.py | game_sprite.py | py | 3,403 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "zedlib.Position",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "math.fabs",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "math.copysign",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "math.copysign",
"line_num... |
69954683303 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/3/21 0021
# @Author : justin.郑 3907721@qq.com
# @File : covid.py
# @Desc : 获取疫情数据
import json
import time
import demjson
import jsonpath
import requests
import pandas as pd
from io import BytesIO
from PIL import Image
from bs4 import BeautifulSoup... | justinzm/gopup | gopup/event/covid.py | covid.py | py | 24,122 | python | en | code | 2,477 | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_num... |
734577939 |
# https://randerson112358.medium.com/email-spam-detection-using-python-machine-learning-abe38c889855
# https://blog.textedly.com/spam-text-message-examples
#Import libraries
import numpy as numpy
import pandas as panda
import nltk
from nltk.corpus import stopwords
import string
#Load the data
# dataFrame = panda.... | hatem-elsheref/email-spam-detection | main.py | main.py | py | 3,394 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "n... |
71873734503 | import pygame as pg
pg.init()
COLOR_INACTIVE = pg.Color('lightskyblue3')
COLOR_ACTIVE = pg.Color('dodgerblue2')
FONT = pg.font.Font(None, 32)
class InputBox:
def __init__(self, x, y, w, h, text=''):
self.rect = pg.Rect(x, y, w, h)
self.color = COLOR_INACTIVE
self.text = text
s... | andreidumitrescu95/Python-Sorting-Algorithm-Visualizer | Helper/input_helper.py | input_helper.py | py | 1,768 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.Color",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.Color",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.font.Font",
"line_numbe... |
16823182799 | '''
author: Ramayan Mardi
email: jaymisra.programmer@gmail.com
=======================================
:about: This is script file of the game,
:name: Flappy Game
:version: 1.0.1
:requirement:
python -> 3.10.0 or upper
pygame -> 2.5.2
This script file controls, all the game related stuff i.e game state, render... | ramayanbindas/Flappy | flappy.py | flappy.py | py | 16,627 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 47,
"usage_type": "call"
},
{
"api_name":... |
30668828069 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
##
# @file genCode.py
# @brief 根据json文件生成错误码头文件以及文档
# 头文件:./release/tuya_error_code.y
# 文档 :./release/tuya_error_code.md
# @author huatuo
# @version 1.0.0
# @date 2021-09-27
# @note 支持参数1修改文件名,如:"base",使用默认命名则传递空:""
# @note 支持参数2传入指定模块列表,参数形式支持如下:
# "... | tuya/tuyaos-development-board-t2 | software/TuyaOS/scripts/error_code/genCode.py | genCode.py | py | 9,935 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "sys.version_info",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sys.setdefaultencoding",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 198,
"usage_type": "call"
},
{
"api_name": "json.load",... |
43319941106 | import torch
import shutil
import torch.optim as optim
import numpy as np
from torch import nn
from torch.utils.data import DataLoader
from torchvision import transforms
from utils import AverageMeter, min_max_normalize, save_checkpoint
from dataset import DAEDataset
from model import ModelRec
transform = transforms... | ANnick2908/Data_Science_Projects | Denoising_Autoencoder/train.py | train.py | py | 2,622 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Resize",
"line_number": 14,
"usage_type": "call"
},
{
... |
7175166932 | import matplotlib.pyplot as plt
import cv2
import time
start_time = time.time()
# Titik awal
x1 = 1
y1 = 7
# Titik Akhir
x2 = 7
y2 = 15
dy = y2-y1
dx = x2-x1
step = dx if dx > dy else dy
xInc = dx / step
yInc = dy / step
x=x1
y=y1
len=y2+x2
# x axis value list.
x_number_list = []
x_number_list.append(x1)
... | albirrkarim/dda-bresenham | dda.py | dda.py | py | 966 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "guppy.hpy",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_nu... |
25544326890 | import numpy as np
import cvxpy as cp
import matplotlib.pyplot as plt
# double integrator
# state is [x, vx, y, vy]
T = 0.1 # timestep in seconds
A = np.kron(np.eye(2),np.array([[1, T], [0, 1]]))
B = np.kron(np.eye(2), np.array([[0.5*T**2], [T]]))
class MPC:
def __init__(self, prediction_horizon = 10, number_of... | dev10110/interagent_mpc | no_obstacle_mpc.py | no_obstacle_mpc.py | py | 2,690 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.kron",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.eye",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.kron",
"line_number": 12,
... |
73857162662 |
import math
from SynRD.publication import Publication, Finding, VisualFinding, TAXONOMY
import numpy as np
import pandas as pd
import statsmodels as sm
import statsmodels.stats.weightstats
class Assari2019Baseline(Publication):
DEFAULT_PAPER_ATTRIBUTES = {
'id': 'assari2019baseline',
'length_page... | DataResponsibly/SynRD | SynRD/papers/assari2019baseline.py | assari2019baseline.py | py | 18,601 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "SynRD.publication.Publication",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "SynRD.publication.Finding",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "SynRD.publication.TAXONOMY.MEAN_DIFFERENCE",
"line_number": 46,
"usage_type": "at... |
25651671407 |
from typing import Iterable, Tuple, TypeVar, Callable, Any, List, Dict, Union
import math
import numpy as np
import os.path
import torch
import torchaudio
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
import warnings
import pandas as pd
import plots
from utils import validate_audio
# Useful ... | rfalcon100/seld_dcase2022_ric | dataset/dcase_dataset.py | dcase_dataset.py | py | 51,279 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "numpy.pi",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": ... |
70848016743 | import sys
import os.path
import re
import warnings
from io import StringIO
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.api as sm
from patsy import dmatrices
import six
class PerfData():
__DATETIME_HEADER__ = "start-time"
_... | cloudfoundry/credhub-perf-release | src/headroomplot/headroomplot.py | headroomplot.py | py | 5,644 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.finditer",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "six.text_type",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_... |
4100346454 | from django.urls import path
from myapp import views
urlpatterns = [
path('project/create', views.projectcreate),
path('project/show', views.projectshow),
path('employee/create', views.employeecreate),
path('employee/show', views.employeeshow),
path('project/view/<int:id>', views.projectview, name='proj... | mudassir-cm/m2m | myapp/urls.py | urls.py | py | 802 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "myapp.views.projectcreate",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "myapp.views",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.urls.... |
2927331509 | import os
import time
from pathlib import Path
template = "#include<bits/stdc++.h>\n#define mod 1000000007\n#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)\n#define pb push_back\n#define mp make_pair\n#define ll long long int\n#define fi first\n#define se second\n#define vll std::vector<ll>... | Aditya20kul/450-DSA-questions | createFile.py | createFile.py | py | 1,387 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
... |
23495813882 | import datetime
import tkinter.messagebox as tm
from tkinter import *
import tkinter.ttk as ttk
import sqlite3
from PIL import ImageTk,Image
path="logo1.png"
sum=0
def myfunction(event):
canvas.configure(scrollregion=canvas.bbox("all"), width=1328, height=455)
def Numberonly1(event):
glob... | Adrish1999/Python-GUI | Reg_Form_Without_Login.py | Reg_Form_Without_Login.py | py | 54,535 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "tkinter.messagebox.showinfo",
"line_number": 62,
"usage_type": "call"
},
{
"api_name... |
19107043906 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 3 10:54:37 2018
@author: Administrator
"""
from greedyBandit import GreedyBandit
from decGreedyBandit import DecGreedyBandit
from optiBandit import OptiBandit
from UCBBandit import UCBBandit
from TSBandit import TSBandit
import matplotlib.pyplot as plt
... | JJ-Tom-Li/Reinforcement-Machine-Learning | Programming Project -1 -MAB/main.py | main.py | py | 1,356 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "greedyBandit.GreedyBandit",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "decGreedyBandit.DecGreedyBandit",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "optiBandit.OptiBandit",
"line_number": 21,
"usage_type": "call"
},
{
"a... |
22905033389 | import requests
import json
import re
req=requests.Session()
header={
"user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36"
}
url="http://www.122.gov.cn/m/map/select"
page=req.get(url=url,headers=header)
print(page.text)
patte... | nanxung/testProject | test.py | test.py | py | 585 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.Session",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.S",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "re.findall",
"line_number": ... |
15239706297 | # Downloadable Modules
import os
import socket
import argparse
import atexit
import time
from threading import Thread
# Self-made Modules
import database_utility as db_util
from ping_utility import ping_service
from handlers import conn_handler
import schemas
import config
# Startup of server
# Initialize Variabl... | arhamchopra/decentralized-file-storage | server/server.py | server.py | py | 2,094 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "schemas.file",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "schemas.storage",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "config... |
902272609 | from multiprocessing import Process,Queue
import os,time
def write(q):
print('启动写子进程%s' % os.getpid())
for chr in ["A","B","C","D"]:
q.put(chr)
time.sleep(1)
print('结束写子进程%s' % os.getpid())
def read(q):
print('启动读子进程%s'% os.getpid())
while True:
value= q.get(True)
... | hughgo/Python3 | 基础代码/进程/10 进程间通信.py | 10 进程间通信.py | py | 805 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "os.getpid",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 13,
"... |
25451901336 | from flask import Blueprint
from marketplace import db, login_required
from marketplace.models import Item, Tag
tag_item = Blueprint('tag_item', __name__)
@tag_item.route('/tag_item/<item_id>/<tag>')
@login_required
def tag_an_item(item_id, tag):
# Get matching item
matching_items = db.session.query(Item).fi... | adicu/marketplace | marketplace/routes/tag_item.py | tag_item.py | py | 1,239 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "flask.Blueprint",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "marketplace.db.session.query",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "marketplace.models.Item",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name"... |
71984366824 | import pandas as pd
from sklearn import metrics
from sklearn import preprocessing
from chapter5 import config
from chapter5 import model_dispatcher
from common import utils
def run(fold):
df = pd.read_csv(config.CENSUS_FILE_FOLDS)
# 目的変数を変換
target_mapping = {"<=50K": 0, ">50K": 1}
df.loc[:, "incom... | YasudaKaito/aaamlp_transcription | project/src/chapter5/census_lbl_xgb.py | census_lbl_xgb.py | py | 1,606 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "chapter5.config.CENSUS_FILE_FOLDS",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "chapter5.config",
"line_number": 13,
"usage_type": "name"
},
{
"api_name":... |
670561323 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import pandas as pd
import datetime
import matplotlib.pyplot as plt
import paths as paths
from DataBaseProxy import DataBaseProxy
from util import Utility
util = Utility()
dbp = DataBaseProxy()
year = 2017
month = 5
day = 6
#km macchine per enjoy e car2go in una settim... | michelelt/MyTool | Analysis/parkingsAnalysis.py | parkingsAnalysis.py | py | 8,244 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "util.Utility",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "DataBaseProxy.DataBaseProxy",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
975733751 | """
File: model_ops.py
Author: Tomáš Daniš
Login: xdanis05
Description: Module holding functions implementing model operations - such as training, predicting or evaluating
"""
import torch.nn as nn
import torch.nn.utils as tut
import torch.optim as optim
import torch
from tqdm import tqdm
import torchtext.data as tor... | AgiNetz/FIT-VUT-projects | Thesis - Machine Comprehension using Commonsense Knowledge/Source codes/Baseline/model_ops.py | model_ops.py | py | 4,576 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "torch.optim.Adamax",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "torch.optim",
... |
42186826955 | import discord
from discord.ext import commands
from discord.utils import get
import json
from discord.ext.commands import has_permissions, MissingPermissions
import asyncio
bot = commands.Bot(command_prefix="!")
@bot.event
async def on_ready():
print("Ticket bot running...")
@bot.command()
async def help_me(ctx... | stevewoz1234567890/disocrd-bot | ticket_bot.py | ticket_bot.py | py | 5,611 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "discord.Embed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.load",... |
9567324814 | import logging
import airflow
from airflow.models import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.operators.dummy_operator import DummyOperator
from utils.slugify import slugify
args = {
'owner': 'airflow',
'start_date': airflow.utils.dates.days_ago(2)
}
categorias = [
... | erikriver/mixtli-etc | dags/03_siem_informacion_empresarial.py | 03_siem_informacion_empresarial.py | py | 2,866 | python | es | code | 2 | github-code | 36 | [
{
"api_name": "airflow.utils.dates.days_ago",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "airflow.utils",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "airflow.models.DAG",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "ai... |
3883658721 |
# =============================================================
# Imports
# =============================================================
import logging
import smtplib
from server.utils import notification
# =============================================================
# Constant
# ==============================... | CaptFrank/EsxiController | server/utils/notification/notificationdispatch.py | notificationdispatch.py | py | 2,687 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.INFO",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "server.utils",
"line_number": 69,
"usage_type": "name"
},
{
"api_name": "smtplib.SMTP",
"... |
22776733908 | import json
import sys
import os
import exceptions as e
import dev
from decouple import config
import time
import itemdat
import pathlib
pathto = str(pathlib.Path().absolute())
devmsg = dev.Dev.SendMessage()
devmsg("Setting up RPG module...")
class RPG():
def __call__(self):
self.start_up()
pass
... | Maxuss/XAI | rpg.py | rpg.py | py | 11,367 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dev.Dev.SendMessage",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dev.Dev",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_n... |
40967939697 | from django.db import models
# null=True, blank=True это значит что данное поле может быть пустым, т.е. аватар не обязателен
NULLABLE = {'blank': True, 'null': True}
class Student(models.Model):
first_name = models.CharField(max_length=150, verbose_name='имя') # обязательно
last_name = models.CharField(max_... | DSulzhits/06_3_20_1_django_ORM | main/models.py | models.py | py | 1,958 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "... |
1593524531 | import sqlite3
conn = sqlite3.connect('employee.db')
c = conn.cursor()
# c.execute("""CREATE TABLE employees (
# first text,
# last text,
# pay integer
# )""")
# c.execute("INSERT INTO employees VALUES ('Mary', 'oza', 70000)")
conn.commit()
c.execute("SELECT * FROM employees")
print(c.fetchall())
c... | Parth-Ps/python | sqlite3_database/employees.py | employees.py | py | 347 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 3,
"usage_type": "call"
}
] |
14625474319 | from django.shortcuts import render,redirect
from .forms import RegisterForm
# Create your views here.
def register(request):
# 从 get 或者 post 请求中获取 next 参数值
# get 请求中,next 通过 url 传递,即 /?next=value
# post 请求中,next 通过表单传递,即 <input type="hidden" name="next" value="{{ next }}"/>
redirect_to = request.POST.... | rainy0824/blog_project | users/views.py | views.py | py | 1,686 | python | zh | code | 0 | github-code | 36 | [
{
"api_name": "forms.RegisterForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "forms.RegisterForm",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "djang... |
2940420975 | import datetime
# An object for representing a package to be delivered.
class Package():
def __init__(self, package_id, address, city, state, zip, delivery_deadline, mass, special_notes,
arrival_time="8:00 AM", required_truck=-1, deliver_with=[]):
# an integer which is unique to each packag... | joshsizer/wgu_projects | wgu_data_structures_and_algorithms_2/package.py | package.py | py | 2,855 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 56,
"usage_type": "attribute"
}
] |
28798444261 | #I pledge my honor that I have abided by the Stevens Honor System.
#Zachary Jones
#HW6 Problem 2
import datetime
def get_date():
date = str(input('Enter date M/D/YYYY: '))
return date
def validate_date(date):
format = '%m/%d/%Y'
try:
datetime.datetime.strptime(date, format)
print('{... | Eric-Wonbin-Sang/CS110Manager | 2020F_hw6_submissions/joneszachary/ZacharyJonesCH7P2.py | ZacharyJonesCH7P2.py | py | 464 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "attribute"
}
] |
74318817382 | try:
from urlparse import urljoin
except ImportError:
# python3 compatibility
from urllib.parse import urljoin
from zope.dottedname.resolve import resolve
def get_page_url(skin_name, page_mappings, page_id):
""" Returns the page_url for the given page_id and skin_name """
fallback = '/'
if pag... | davidemoro/pytest-pypom-navigation | pypom_navigation/util.py | util.py | py | 1,916 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "zope.dottedname.resolve.resolve",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "zope.dottedname.resolve.resolve",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urljoin",
"line_number": 56,
"usage_type": "call"
}
] |
11171979751 | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
#Teht 1
df = pd.read_csv('emp-dep.csv')
df.plot.scatter('age', 'salary')
plt.title('Työntekijät ja palkat')
plt.xlabel('Palkat')
plt.show()
count = df['dname'].value_counts()
#kind barh flips to horizontal
count.plot(kind="bar")
plt.show... | emilsto/Data-analytics-and-machinelearning | week37/t1/t1.py | t1.py | py | 1,019 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
73434601064 | import pickle
from tqdm import tqdm
import os
import pandas as pd
import numpy as np
from statsmodels.tsa.arima.model import ARIMA
from pmdarima.arima import auto_arima
def arima_model(test_codes, csv_filename, folder_path, n_output):
df = pd.read_csv(csv_filename)
n_output = n_output # output -> forecas... | stergioa/masterThesis4 | src/forecasting_models/trash/test_ARIMA.py | test_ARIMA.py | py | 1,313 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
14151407552 | import logging
from datetime import datetime
from pythonjsonlogger import jsonlogger
from src.config import LOG_LEVEL
import os
path = os.path
logger = logging.getLogger()
logHandler = logging.StreamHandler()
fileHandler = logging.FileHandler("logger/journals/log_file.log")
class CustomJsonFormatter(jsonlogger.J... | Safonovdv91/web_gymkhana_bot_server | logger/logger.py | logger.py | py | 1,168 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.FileHandl... |
74644371943 | import sys
import pygame
import pygame.gfxdraw
class Rubrika:
def __init__(self, x, y, a, b, szin, szoveg):
self.x = x
self.y = y
self.a = a
self.b = b
self.szin = szin
self.szoveg = szoveg
def negyzet(self, kepernyo):
return pygame... | pdoszpod11/SchoolProjects | WhoWantsToBeAMillionaire/Game/NHF_UI_v1.py | NHF_UI_v1.py | py | 12,337 | python | hu | code | 0 | github-code | 36 | [
{
"api_name": "pygame.Rect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.image.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pygame.Rect",
"li... |
22015297058 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 14 12:17:00 2021
@author: paradeisios
"""
import cv2
def get_video_secs(video):
vidcap = cv2.VideoCapture(video)
fps = vidcap.get(cv2.CAP_PROP_FPS)
totalNoFrames = vidcap.get(cv2.CAP_PROP_FRAME_COUNT)
vidcap.release()
return in... | paradeisios/luminance | utils/get_video_secs.py | get_video_secs.py | py | 358 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FPS",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_COUNT",
"line_number": 13,
"usage_type": "attribute"
}
] |
31025430607 | import numpy as np
import cv2
import faceTools
import moodTools
from PIL import Image
emojis_data = {
'angry': cv2.imread("./data/emojis/Angry.png"),
'disgust': cv2.imread("./data/emojis/Poisoned.png"),
'fear': cv2.imread("./data/emojis/Fearful.png"),
'happy': cv2.imread("./data/emojis/Happy.png"),
... | CVandermies/Facelook | main.py | main.py | py | 2,121 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 11,
... |
22354196775 | import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "64d90a1a69bc"
down_revision = "e5594ed3ab53"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"background_tasks",
... | mlrun/mlrun | server/api/migrations_sqlite/versions/64d90a1a69bc_adding_background_tasks_table.py | 64d90a1a69bc_adding_background_tasks_table.py | py | 1,069 | python | en | code | 1,129 | github-code | 36 | [
{
"api_name": "alembic.op.create_table",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
22024978373 | # Assignment: Draw Stars
# Karen Clark
# 2018-06-04
# Assignment: Stars
# Write the following functions.
# Part I
# Create a function called draw_stars() that takes a list of numbers and
# prints out *.
from __future__ import print_function
from colorama import init, Fore
from termcolor import colored
def draw_sta... | clarkkarenl/codingdojo_python_track | draw-stars.py | draw-stars.py | py | 1,388 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "colorama.init",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "colorama.init",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
... |
15361552534 | from conans import ConanFile, CMake
import os
class StringIdConan(ConanFile):
name = "string_id"
version = "2.0-2"
description = "A small C++ library to handle hashed strings serving as identifiers."
license="Modified BSD License (3-Clause BSD license)"
settings = "os", "compiler", "build_type", "arch"
url... | pjohalloran/conan-stringid | conanfile.py | conanfile.py | py | 1,343 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "conans.ConanFile",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "os.chdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 21... |
25124748823 | import numpy as np
class GradientDescentLinearRegression:
def __init__(self, learning_rate=0.01, iterations=1000):
self.learning_rate, self.iterations = learning_rate, iterations
def fit(self, X, y):
b = 0
m = 5
n = X.shape[0]
for _ in range(self.iterations):
... | TanizzCoder/ANN | Gradient_Regression.py | Gradient_Regression.py | py | 1,163 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.sum",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number... |
3449169916 | # -*- coding: utf-8 -*-
"""
Módulo ``PreProcWindow``
========================
Implementa uma janela com funcionalidades de pré-processamento dos dados.
.. raw:: html
<hr>
"""
import inspect
import numpy as np
import pyqtgraph as pg
from PyQt5 import QtCore
from framework import file_m2k, file_civa, file_omni... | matheusfdario/role-finder | AUSPEX-smart_wedge/guiqt/Windows/PreProcWindow.py | PreProcWindow.py | py | 10,993 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "guiqt.Windows.PreProcWindowDesign.Ui_pre_proc_dialog",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "guiqt.Windows.PreProcWindowDesign",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "inspect.getmembers",
"line_number": 56,
"usag... |
35609284688 | from dataclasses import dataclass
from queue import Empty
import queue
import cv2, time, os
import numpy as np
import torch.multiprocessing as mp
from ..util.profiler import Profiler
from .twitch_realtime_handler import (
TwitchAudioGrabber,
TwitchImageGrabber
)
from .youtube_recoder.image_recoder import Youtu... | gmlwns2000/sharkshark-4k | src/stream/recoder.py | recoder.py | py | 7,577 | python | en | code | 14 | github-code | 36 | [
{
"api_name": "numpy.ndarray",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "util.profiler.Profiler",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "dataclas... |
19839716589 | from __future__ import print_function
import cv2 as cv
import matplotlib.pyplot as plt
if __name__ == "__main__":
img = cv.imread('images/dog1.jpeg')
gray_img = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
dst = cv.equalizeHist(gray_img)
gray_hst = cv.calcHist([gray_img], [0], None, [256], [0, 256])
gray_hs... | AnhVietPham/Deep-Learning | Computer-Vision/opencv-course/histogram.py | histogram.py | py | 683 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.equalizeHist",
"... |
32952196842 | from django.shortcuts import render, redirect
from kajaki_app.models import Route, Kayak, Order, OrderKayak
from django.urls import reverse, reverse_lazy
from datetime import date
from django.views import View
from kajaki_app.forms import AddKayakForm, AddRouteForm, ContactForm
from django.views.generic import ListView... | KamilNurzynski/Kajaki | kajaki_app/views.py | views.py | py | 4,243 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.views.View",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "kajaki_app.forms.AddRouteForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name"... |
38807167453 | #%% [markdown]
# We need to create bar charts for our fancy plot to show the fraction of stuff from
# each region. We'll do that here.
#%%
group_ids_to_plot = [0, 431, 88, 299, 9]
#%%
from ltcaesar import read_data_from_file
import numpy as np
import matplotlib.pyplot as plt
#%%
# Setup our favourite stylesheet
plt.... | JBorrow/lagrangian-transfer-paper | figures/plotgen/create_bar_charts_fancy.py | create_bar_charts_fancy.py | py | 1,612 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_na... |
19996296105 | from django.shortcuts import render, redirect
from django.http import Http404, HttpResponseRedirect
from django.urls import reverse
from .models import Article, Category, ArticleCategoryRelation
from django.utils import timezone
from .forms import UserRegistrationForm
from django.core.paginator import Paginator, PageNo... | osinkel/articles-django | newnotes/views.py | views.py | py | 9,576 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "models.Article.objects.all",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.Article.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "models.Article",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": ... |
17582018412 | import sys
import typing as t
import importlib
from pathlib import Path
import pkg_resources
from starwhale.utils import console
from starwhale.utils.venv import (
guess_current_py_env,
get_user_python_sys_paths,
check_python_interpreter_consistency,
)
def import_object(
workdir: t.Union[Path, str],... | star-whale/starwhale | client/starwhale/utils/load.py | load.py | py | 1,988 | python | en | code | 171 | github-code | 36 | [
{
"api_name": "typing.Union",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "starwhale.utils.venv.gues... |
7168853562 | import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
import dash
from app import app
from app import server
from apps.gas_monitoring import gas_app
navBar = dbc.NavbarSimple(
children=[
dbc.NavItem(dbc.NavLink("Home", href="/")),
d... | muntakim1/gas-oil-plant-monitoring | index.py | index.py | py | 2,435 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dash_bootstrap_components.NavbarSimple",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dash_bootstrap_components.NavItem",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dash_bootstrap_components.NavLink",
"line_number": 13,
"usage_ty... |
22226405639 | import pandas as pd
import argparse
from gtfparse import read_gtf
parser = argparse.ArgumentParser()
parser.add_argument('--phenotype', type=str, required=True)
# parser.add_argument('--ncRNA', type=str, required=True)
if __name__ == '__main__':
args = parser.parse_args()
phenotype = args.phenotype
... | bfairkun/ChromatinSplicingQTLs | code/scripts/NonCodingRNA/GetNonCodingRNAFromFeatureCounts.py | GetNonCodingRNAFromFeatureCounts.py | py | 1,685 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "gtfparse.read_gtf",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
}
] |
3323022532 | # -*- coding: utf-8 -*-
import psycopg2
# the module that connects to the database
"""
The task is to create a reporting tool that prints out reports (in plain text)
based on the data in the database.
1.What are the most popular three articles of all time?
Which articles have been accessed the most? Present this in... | laurafang/-logs_ana | log_ana.py | log_ana.py | py | 2,577 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "psycopg2.connect",
"line_number": 26,
"usage_type": "call"
}
] |
9911287046 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Custom filters for use in openshift_aws
'''
from ansible import errors
class FilterModule(object):
''' Custom ansible filters for use by openshift_aws role'''
@staticmethod
def scale_groups_serial(scale_group_info, upgrade=False):
''' This function w... | barkbay/openshift-ansible-gravitee | roles/lib_utils/filter_plugins/openshift_aws_filters.py | openshift_aws_filters.py | py | 2,484 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "ansible.errors.AnsibleFilterError",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "ansible.errors",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "ansible.errors.AnsibleFilterError",
"line_number": 39,
"usage_type": "call"
},
{
... |
74332199142 | from Bio import SeqIO
import sys
def readin_fasta(input_file, batch_size):
"""Read fasta file with a fast, memory-efficient generator."""
title_list = []
seq_list = []
seq_num = len([1 for line in open(input_file) if line.startswith(">")])
for i, seq_record in enumerate(SeqIO.FastaIO.SimpleFastaPa... | elond/11785_Project | data_processing/encoding_convert/readin_fasta.py | readin_fasta.py | py | 697 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "Bio.SeqIO.FastaIO.SimpleFastaParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO.FastaIO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "Bio.SeqIO",
"line_number": 10,
"usage_type": "name"
}
] |
30934317618 | #!/usr/bin/python3
# USE THIS WHEN IN NOTEBOOK -> %python
# CHANGE ACCORDINGLY: the field XXX
import sys
import time
from azure.identity import ClientSecretCredential
from azure.storage.filedatalake import DataLakeServiceClient,FileSystemClient
ACCOUNT_NAME = "XXX"
FILE_SYSTEM = "XXX"
TARGET_DIR = "XXX"
def set_p... | eosantigen/devops-tools | apps/python/azure/azure_datalake_set_acl.py | azure_datalake_set_acl.py | py | 2,087 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "azure.storage.filedatalake.DataLakeServiceClient",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 55,
"usage_type": "call"
}
] |
27688638873 | """Config file and logging related utility functions."""
import configparser
import json
import os
import sys
from pprint import pprint
import yaml
def read_cfg(location, verbose=True):
"""
Read config file at location using ConfigParser.
Parameters
----------
location : str
Where the con... | seankmartin/PythonUtils | skm_pyutils/config.py | config.py | py | 5,936 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path.exists",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",... |
20824479856 | import dlib
from imutils import face_utils
dlib_path = "dlibb/shape_predictor_68_face_landmarks.dat"
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor(dlib_path)
import argparse
import pickle
import cv2
import os
import mpmath
import numpy as np
# face_classifier = cv2.CascadeClassifier('ha... | Hassan1175/MY_FYP_CODE | MY_CODE/videoframes.py | videoframes.py | py | 3,060 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dlib.get_frontal_face_detector",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "dlib.shape_predictor",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.Vid... |
74298299622 | #!/usr/bin/env python
#encoding=utf8
from json import dumps
def get_node(tree, name):
if tree.label == name:
return True, [tree.label]
if not tree.children:
return False, None
for child in tree.children:
found, addr = get_node(child, name)
if found:
return True... | xiaket/exercism | python/pov/pov.py | pov.py | py | 2,553 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.dumps",
"line_number": 56,
"usage_type": "call"
}
] |
34696045892 | import os
import yaml
import openai
"""
使用openai API的方式访问ChatGPT/azure GPT
"""
def set_env(cfg_file):
with open(cfg_file) as f:
config_data = yaml.safe_load(f)
azure = config_data["azure"]
if azure is not None:
for k, v in azure.items():
os.environ[k] = v
os.... | zzfengxia/python3-learn | dailytool/connect_openai_api.py | connect_openai_api.py | py | 1,851 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "yaml.safe_load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "openai.api_type",
... |
34761383240 | import sys, os
import subprocess
import datetime as dt
from random import randint
import argparse
import web3
from web3 import Web3
from web3.middleware import geth_poa_middleware
from eth_utils import decode_hex
# Project modules
import utils
from TextColor.color import bcolors
URL = "http://127.0.0.1:8545"
ACCOUNT_... | acid9reen/bas | car.py | car.py | py | 10,656 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.MGMT_CONTRACT_DB_NAME",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "utils.MGMT_CONTRACT_SRC_PATH",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "utils.open_data_base",
"line_number": 19,
"usage_type": "call"
},
... |
74226159463 | import argparse
import utils
parser = argparse.ArgumentParser(description="User need to submit job informations")
parser.add_argument('--min', type=int, required=True, help='min num of nodes')
parser.add_argument('--max', type=int, required=True, help="max num of nodes")
parser.add_argument('--N', type=int, required=T... | BFTrainer/BFTrainer | BFSub.py | BFSub.py | py | 1,166 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "utils.submit_job",
"line_number": 15,
"usage_type": "call"
}
] |
39901615627 | from django.http import HttpResponse, HttpResponseNotAllowed, \
HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.template import loader
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.core.exceptions import ValidationError
from ... | brhoades/sweaters-but-with-peer-reviews | new/views.py | views.py | py | 9,719 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "new.utils.MODEL_MAP.keys",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "new.utils.MODEL_MAP",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "new.utils.json_error",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "new... |
37298965152 | import time
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
import json
from pymongo import MongoClient
i = 0
client = MongoClient('localhost',27017)
db=client.comment
collection=db.comment
collection2=db.after
def sentiment_classify(data):
access_token=''
http=urllib3.PoolM... | LogicJake/data_analysis | classfy/label.py | label.py | py | 1,396 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "url... |
35146672008 | import matplotlib.pyplot as plt
import numpy as np
fil = open("Breakout_step_RL")
ret_RL = []
for line in fil:
x = float(line)
if(x==-10):
x=0
ret_RL.append(x)
fil.close()
# fil = open("breakout_aveReturn")
# ret_MT = []
# for line in fil:
# ret_MT.append(float(line))
# fil.close()
# fil = op... | sidistic/Atari-Breakout-Reinforcement-Learning | graph.py | graph.py | py | 581 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.average",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
22355735455 | import pytest
import mlrun.common.schemas
import mlrun.runtimes
def test_enum_yaml_dump():
function = mlrun.new_function("function-name", kind="job")
function.status.state = mlrun.common.schemas.FunctionState.ready
print(function.to_yaml())
@pytest.mark.parametrize(
"exclude_params,expected_result,... | mlrun/mlrun | tests/test_model.py | test_model.py | py | 2,821 | python | en | code | 1,129 | github-code | 36 | [
{
"api_name": "mlrun.common.schemas.new_function",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "mlrun.common.schemas",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "mlrun.common.schemas.common",
"line_number": 9,
"usage_type": "attribute"
},
{
... |
74249579945 | """"
Controls EC2 Services
"""
import boto3
import logging
import os
"""
Ec2 controller: finds ec2 instances that have a devday tag, has the ability to stop, start and to modify their shutdown behaviour - to avoid termination
"""
class ec2Controller:
STOPBEHAVIOUR = 'stop'
def __init__(self, region, searchT... | evoraglobal/SleepSaver | ec2Controller.py | ec2Controller.py | py | 7,948 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "boto3.client",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 22,
"usage_type": "attribute"
}
] |
6939797470 | from threading import Thread
from flask import Flask, render_template
from tornado.ioloop import IOLoop
from bokeh.embed import server_document
from bokeh.layouts import column
from bokeh.plotting import figure
from bokeh.server.server import Server
from bokeh.themes import Theme
import numpy as np
from bokeh.models... | marnatgon/Senior-Design | software/example/flask/mqtt.py | mqtt.py | py | 1,891 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bokeh.models.ColumnDataSource",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "bokeh.plotting.figure",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy... |
35866803773 | import re
from datetime import date
from typing import Optional
import docx # type: ignore
from adaptive_hockey_federation.parser.user_card import BaseUserInfo
NAME = '[И|и][М|м][Я|я]'
SURNAME = '[Ф|ф][А|а][М|м][И|и][Л|л][И|и][Я|я]'
PATRONYMIC = '[О|о][Т|т]?[Ч|ч][Е|е][С|с][Т|т][В|в][О|о]'
DATE_OF_BIRTH = '[Д|д][А|а... | Studio-Yandex-Practicum/adaptive_hockey_federation | adaptive_hockey_federation/parser/docx_parser.py | docx_parser.py | py | 12,958 | python | ru | code | 2 | github-code | 36 | [
{
"api_name": "re.search",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 63... |
10665778183 | import math
import os
from glumpy import glm
from PIL import Image, ImageTk
import numpy
import tkinter
import cv2
def load_image(file_name, size):
image = Image.open(file_name)
image = numpy.array(image)
image = cv2.cvtColor(image, cv2.COLOR_BGRA2BGR)
image = cv2.resize(image, size, interpolation=cv... | chahyon-ku/ImgToChunk | ImgToChunk.py | ImgToChunk.py | py | 14,064 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PIL.Image.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number"... |
21626075739 | from datetime import datetime
import os
def capture_pic(driver):
pt = datetime.now().strftime('%Y%m%m%H%M%S')
base_path = os.path.dirname(os.getcwd())
pic_name = os.path.join(base_path, 'picture', pt+'.png')
driver.get_screenshot_as_file(pic_name)
| litongtongx/test | common/picCapture.py | picCapture.py | py | 268 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
24752052108 | import os
from sqlalchemy import (
Column,
MetaData,
String, Integer, Float,
Table,
Text,
ForeignKey,
create_engine,
select
)
from domain.repositories import RepositoryInterface
metadata = MetaData()
users_table = Table(
'user', metadata,
Column('userId', Integer, primary_key... | armyost/hexagonalSampleV2 | src/app/infrastructure/adapters/mysql_adapter.py | mysql_adapter.py | py | 2,513 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.MetaData",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Table",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Int... |
20869179523 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
smartstorelogin_url = 'https://nid.naver.com/nidlogin.login?url=https%3A%2F%2Fsell.smartstore.naver.com%2F%23%2FnaverLoginC... | hdh4545/SSAutomation | findxpath.py | findxpath.py | py | 1,724 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.ui.WebDriverWait",
"line_number": 21,
"usage_type": "call"
},
... |
24399113 | import plotly.graph_objects as go
from plotly.subplots import make_subplots
import numpy as np
import maths
def mass_flow_funnel(mass_flows,moisture_content):
fig = go.Figure(go.Funnelarea(
# textinfo = [str(round(mass_flows[0],2))+" kg/h <br>Before Drying",str(round(mass_flows[1],2))+" kg/h <br>After Dry... | drpsantos/torr | 210921/charts.py | charts.py | py | 2,905 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "plotly.graph_objects.Figure",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objects",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "plotly.graph_objects.Funnelarea",
"line_number": 8,
"usage_type": "call"
},
{
"api... |
6842050847 | import cv2
import numpy as np
import re
from tqdm import tqdm
import os
import random
from PIL import Image, ImageEnhance
def augment(image):
def transform():
return random.choice([0,1,2])
# every image has to flip
transform_seed = transform()
if transform_seed == 0:
i... | czkat/real-time-ship-classification-by-resnet-transfer-learning-with-original-dataset | augment.py | augment.py | py | 2,111 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "random.choice",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.flip",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.flip",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.flip",
"line_number": 20,
... |
34377275517 | """
Pipeline modules to prepare the data for the PSF subtraction.
"""
import time
import warnings
from typing import Optional, Tuple
import numpy as np
from astropy.coordinates import EarthLocation
from astropy.time import Time
from typeguard import typechecked
from pynpoint.core.processing import ProcessingModule... | PynPoint/PynPoint | pynpoint/processing/psfpreparation.py | psfpreparation.py | py | 27,088 | python | en | code | 17 | github-code | 36 | [
{
"api_name": "pynpoint.core.processing.ProcessingModule",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 36,
"usage_type": "name"
},
{
"api_nam... |
12136530301 | """
This file is meant to optimize the import speed. Import modules from YOLOv7 projects
and Ultralytics take significant amount of time
"""
import glob
import math
import logging
import numpy as np
import os
import re
import time
import urllib
from pathlib import Path
from PIL import Image, ImageDraw, ImageFont
from ... | CMPUT-492-W2023-Capstone/cstc-backend-v7 | app/src/module.py | module.py | py | 28,870 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "torch.min",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line... |
11162728846 | #
# Hardware:
# A USB C / PIC32 Breakout Board connected to an SSD1306-based OLED display
# (128x64 pixels) and an M5Stack joystick, both via I2C.
#
# Purpose:
# Illustrates the I2C Master functionality to manipulate two I2C Slaves for
# the purposes of the Kickstarter demo.
#
from usb_device import UsbDevice
from ups... | lophtware/UsbCPic32Breakout | src/examples/pong/python/pong.py | pong.py | py | 2,980 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "usb_device.UsbDevice",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "upside_down_display.UpsideDownDisplay",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "ssd1306_i2c_slave_display.Ssd1306I2cSlaveDisplay",
"line_number": 32,
"usage_t... |
1842938709 | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, SelectField
from wtforms.validators import DataRequired
from wtforms import ValidationError
class MyEmailValidation(object):
def __init__(self, message=None):
if not message:
message = "Email isn't valid."
se... | a-yarohovich/control-panel | core/app/create_users/forms.py | forms.py | py | 773 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "wtforms.ValidationError",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask_wtf.FlaskForm",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "wtforms.StringField",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "wtfor... |
19525909188 | from sqlalchemy.orm import Session
from fastapi import APIRouter, Depends, status
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions a... | GeumBinLee/test | youtube/router.py | router.py | py | 3,630 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "random.uniform",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.chrome.servic... |
18586892058 | import numpy
import scipy.interpolate
import scipy.optimize
import scipy.stats
# Columns of csv input file
incols = ['name','Vinoc','dilmin','dilfac','ntot','ninf','comments']
# Columns added to csv output file
outcols = ['mode','68lb','68ub','95lb','95ub','RM','SK']
# label/header for assay parameters
label = {
#... | cbeauc/midSIN | src/__init__.py | __init__.py | py | 6,705 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "numpy.nan",
"line_number": 65,
"usage_type": "attribute"
},
{
"api_name": "numpy.sum",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "numpy.sum",
"line_number"... |
34837660944 | from IPython.display import clear_output
def basic_info():
print("Welcome to Tic Tac Toe Board Game.")
choice = "Wrong"
choice1 = 'Wrong'
while choice != 'Y':
user1 = input("Please Your Name as User 1: ")
choice = input(f"Your Name is {user1}, Correct? Y or N: ").upper()
while choice... | aajmlao/Notes-for-learning-Python | project1.py | project1.py | py | 2,942 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "IPython.display.clear_output",
"line_number": 26,
"usage_type": "call"
}
] |
5784044260 | import atexit
import logging.config
import logging.handlers
import os
import tempfile
import zmq
import slivka
_context = zmq.Context()
atexit.register(_context.destroy, 0)
class ZMQQueueHandler(logging.handlers.QueueHandler):
def __init__(self, address, ctx: zmq.Context = None):
ctx = ctx or _context
... | bartongroup/slivka | slivka/conf/logging.py | logging.py | py | 3,460 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "zmq.Context",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "atexit.register",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.config.handlers",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "logging.conf... |
28198353586 | """
FLUX: OPTIMUM RANGE
===================
"""
from math import isclose
from pathlib import Path
from typing import Literal
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.legend_handler import HandlerTuple
from pandas import DataFrame
fr... | holukas/diive | diive/pkgs/analyses/optimumrange.py | optimumrange.py | py | 18,102 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.Literal",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.Literal",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.Literal",
"... |
8567341457 | import numpy as np
import pandas as pd
from scipy.stats import norm
from sklearn.preprocessing import MinMaxScaler
from dash import ALL
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from contents.app import *
@app.callback(
Output('var-plot-sliders-container', 'ch... | ThomasHuggett/Quant-Toolkit-main | contents/_analysis_tools/distributions.py | distributions.py | py | 7,532 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.DataFrame.from_dict",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "dash.dependencies.Output",
"line_number": 14,
"usage_type": "call"
},
{
"api_nam... |
16146023785 | import datetime as dt
f = open("def.dat", "r")
CLAIM_NUM = int(f.readline())
HST_RATE = float(f.readline)
CURR_DATE = dt.datetime.now()
f.close()
while True:
emp_name = input("Employee name: ")
emp_num = input("Employee number: ")
location = input("Location: ")
start_date = "2023-11-06"
end_date... | sweetboymusik/Python | Lesson 29/question.py | question.py | py | 1,411 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "attribute"
}
] |
12338761878 | ################011011100110010101101111####
### neo Command Line #######################
############################################
def getcmdlist():
cmds = {
"f" :"Find And Replace : Find and replace in family parameters.",
"froxl" :"Family Replacer : Open Excel file.",
... | 0neo/pyRevit.neoCL | neoCL.extension/neocl_f.py | neocl_f.py | py | 1,152 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "lib.find.neo_findreplace_main.Main",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "lib.find.neo_findreplace_main",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "lib.xl.neo_xl_type_replacer.GetWb",
"line_number": 21,
"usage_type": "ca... |
20890209940 | import os
import glob
import pickle
import logging
import argparse
from multiprocessing import Pool
import numpy as np
import pandas as pd
from core.utils import timer, do_job
# PATH
DATA_PATH = os.getenv("DATA_PATH")
PREPROCESSED_DATA_PATH = os.getenv("PREPROCESSED_DATA_PATH")
TXT_DATA_NAME = os.getenv("TXT_DATA_NA... | GENZITSU/DynamicWordEmbedding | main.py | main.py | py | 3,016 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.getenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 18,
... |
31246785423 | import pandas as pd
import scipy.stats as stats
import operator
import numpy as np
from time import sleep as sl
import argparse
from sklearn.metrics import pairwise_distances,pairwise_distances_chunked
from sklearn.cluster import AgglomerativeClustering,DBSCAN
import time
from datetime import timedelta
import... | Adalijuanluo/MGTSEnT | MGTSEnT_MGT9_singlelinkagecluster.py | MGTSEnT_MGT9_singlelinkagecluster.py | py | 24,576 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 33,
"usage_type": "call"
},
{
"api... |
38666222212 | from __future__ import absolute_import
import logging
import string
from zipfile import ZipFile, ZIP_STORED, ZIP_DEFLATED
import re
# py2 vs py3 transition
from ..six import text_type as unicode
from ..six import string_types as basestring
from ..six import ensure_binary
from io import BytesIO
## XML isn't as forgivi... | JimmXinu/FanFicFare | fanficfare/writers/writer_epub.py | writer_epub.py | py | 39,444 | python | en | code | 664 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "base_writer.BaseStoryWriter",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "base_writer.BaseStoryWriter.__init__",
"line_number": 36,
"usage_type": "call"
},
{
... |
1194624429 | """
Definitions of the GA4GH protocol types.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import json
import inspect
from sys import modules
import google.protobuf.json_format as json_format
import google.protobuf.message as message
... | ga4ghpoc/server | ga4gh/protocol.py | protocol.py | py | 10,280 | python | en | code | null | github-code | 36 | [
{
"api_name": "datetime.datetime.utcfromtimestamp",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": "google.protobuf.struct_pb2.Value",
"line_number": 91,
"usage_type": "attribute"... |
6519474113 | from core_functions import Chain, Reel
from tabulate import tabulate
from colorama import init as colorama_init, Fore
class ChainOutput():
# constant: colorama colours for output
COLORS = {
"element": Fore.LIGHTWHITE_EX,
"element_loop": Fore.LIGHTYELLOW_EX,
"edge": Fore.LIGHTBLACK_EX,
... | jahinzee/FourHasFourLetters | outputs.py | outputs.py | py | 2,885 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "colorama.Fore.LIGHTWHITE_EX",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "colorama.Fore.LIGHTYELLOW_EX",
"line_number": 10,
"usage_type": "attribute"
},
{
"ap... |
39140033433 | import argparse
import os
from time import sleep
# === subroutines ===
def collect_files_for_removal(root: str) -> tuple[list[str], list[str]]:
if not os.path.exists(root):
return ([], [])
res_files = list()
res_folders = list()
for (dir_path, dirs, files) in os.walk(root, topdown=False):
... | vpa-research/jsl-spec-generated | clear.py | clear.py | py | 1,122 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.exists",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.walk",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 1... |
26072099672 | from PySide2 import QtWidgets
from PySide2.QtCore import Signal
# widget to get input for vector 3 types
class Vector3Widget(QtWidgets.QWidget):
# Signals
on_value_changed = Signal(tuple)
_main_layout = None
def __init__(self, value=(0, 0, 0)):
QtWidgets.QWidget.__init__(self)
self... | JonathanVeit/building_generator | scripts/gui/Vector3Widget.py | Vector3Widget.py | py | 1,746 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PySide2.QtWidgets.QWidget",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "PySide2.QtWidgets",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "PySide2.QtCore.Signal",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "P... |
36683998868 | import os
import json
from typing import List
from datetime import datetime
import pandas as pd
#############Load config.json and get input and output paths
with open('config.json','r') as f:
config = json.load(f)
input_folder_path = config['input_folder_path']
output_folder_path = config['outpu... | wonyoungseo/ex-risk-assessment-ml-model-deployment-monitoring-system | ingestion.py | ingestion.py | py | 2,461 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
73521408425 | import numpy as np
import pandas as pd
import os
import cv2
import re
import torch
import torchvision
from torchvision import transforms
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
from torchvision.models.detection import FasterRCNN
from torchvision.models.detection.rpn import AnchorGenerato... | fparaggio/wind-turbine-detector | src/wind_turbine_detector/pipelines/train/nodes.py | nodes.py | py | 7,569 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms",
"line_number": 72,
"usage_type": "name"
},
{
"api_name": "cv2.imread",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.