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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12224154998 | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('accounts/', include('allauth.urls')),
path('admin/', admin.site.urls),
path('ckeditor/', include('ckeditor_uploader.urls')),
path('pag... | Sotonka/movie_site | movie_site/urls.py | urls.py | py | 699 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.include",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.contrib.adm... |
23019757215 | # Some attempts at discrete VAE.
import torch
import torch.nn as nn
import torchvision
from matplotlib import pyplot as plt
dataset = torchvision.datasets.MNIST('./data',
transform=torchvision.transforms.Compose([torchvision.transforms.ToTensor(), torchvision.transforms.Lambda(lambda x: 1.0-((x<0.5)*1.0))]),
... | jfrancis71/PyGenBrix | shaggy_dog/vae.py | vae.py | py | 2,368 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torchvision.datasets.MNIST",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torchvision.datasets",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 9,
"usage_type": "call"
},
{
"... |
2677533368 | # This code is based on https://github.com/openai/guided-diffusion
"""
Train a diffusion model on images.
"""
import os
import json
from mdm_utils.fixseed import fixseed
from mdm_utils.parser_util import train_args
from mdm_utils import dist_util
from train_utils.train_loop import TrainLoop
# from data_loaders.get_dat... | zyhbili/LivelySpeaker | scripts_beat/train_RAG.py | train_RAG.py | py | 2,491 | python | en | code | 38 | github-code | 6 | [
{
"api_name": "mdm_utils.parser_util.train_args",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "mdm_utils.fixseed.fixseed",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 35,
"usage_type": "call"
},
{
"api_name"... |
74132541308 | import os
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Dense, Dropout, Flatten, BatchNormalization, Activation
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlate... | meohoangdeptrai1407/Thesis_Psychology | Face Emotion Recognition/Code/Train DataSet.py | Train DataSet.py | py | 3,749 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type":... |
1864566947 | import couchdb.design
import os
basepath = os.path.dirname(__file__)
with open(os.path.join(basepath, 'design/bids.js')) as bids_file:
bids = bids_file.read()
with open(os.path.join(basepath, 'design/tenders.js')) as tenders_file:
tenders = tenders_file.read()
with open(os.path.join(basepath, 'design/lib/js... | openprocurement/reports | reports/design.py | design.py | py | 745 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6... |
23979759039 | import csv
from django.core.management.base import BaseCommand
from phones.models import Phone
class Command(BaseCommand):
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
with open('phones.csv', 'r') as csvfile:
phone_reader = csv.reader(csvfile, delimi... | NikolayBabankov/orm1 | phones/management/commands/import_phones.py | import_phones.py | py | 958 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "csv.reader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "phones.models.Phone",
"line_number": 27,
"usage_type": "call"
}
] |
30703110115 | import os
import sys
sys.path.insert(0,'/datasets/home/home-02/60/960/kshi/image2story')
import torch
from torch import nn
from torch.autograd import Variable
from torch import optim
from skip_thoughts.data_loader import DataLoader
from skip_thoughts.model import UniSkip
from skip_thoughts.config import *
from datetime... | ShaneTsui/image2story | skip_thoughts/uskip_train.py | uskip_train.py | py | 4,410 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
25352388030 | # coding: utf-8
""" This is exception handler module """
import sys
import os
from qt import *
import logging
from datetime import datetime
from App import App
class QExceptionHandler(QObject):
""" This is exception handler class """
errorSignal = Signal()
def __init__(self):
super(QException... | humkyung/AViewer | ExceptionHandler.py | ExceptionHandler.py | py | 1,423 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "App.App.NAME",
"line_number":... |
10808394551 | import networkx as nx
from AgentBasedModeling.helpers.bass_diffusion.bass_diffusion_model import BassDiffusionModel
from AgentBasedModeling.lists.list8 import labeler_plot
ps = [(i + 1) / 8 for i in range(8)]
complete_graph = nx.complete_graph(1000)
q = 0.38
prob_adoption_rate = {}
mc_steps = 50
for p in ps:
... | TheDecks/Studies | AgentBasedModeling/lists/list8/complete_graph_innovation_coefficient.py | complete_graph_innovation_coefficient.py | py | 1,091 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "networkx.complete_graph",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "AgentBasedModeling.helpers.bass_diffusion.bass_diffusion_model.BassDiffusionModel",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "AgentBasedModeling.lists.list8.labeler_p... |
74947920187 | # -*- coding: utf-8 -*-
# @Time : 2021/5/28 上午8:53
# @Author : daiyu
# @File : 3-1,低阶API示范.py
# @Software: PyCharm
# 下面的范例使用Tensorflow的低阶API实现线性回归模型和DNN二分类模型
# 低阶API主要包括张量操作,计算图和自动微分
import tensorflow as tf
# 打印时间分割线
@tf.function
def printbar():
today_ts = tf.timestamp() % (24 * 60 * 60)
hour = tf.c... | daiyuzz/ml_items | eat_tensorflow2_in_30_days/3-1,低阶API示范.py | 3-1,低阶API示范.py | py | 5,158 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.timestamp",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.cast",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tensorflow.int32",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "tensorflow... |
36967818788 | import sys
import os
from os.path import join
import numpy as np
import matplotlib.pyplot as plt
from Population import initialize_population
from NeuralSimulation import NeuralSimulation
from tools import return_freq_and_psd_welch
from plotting_convention import mark_subplots, simplify_axes
import LFPy
root_folder = '... | torbjone/aPop | aPop/intracellular_correlation_test.py | intracellular_correlation_test.py | py | 6,433 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.arange",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_nu... |
18453536016 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 2 21:59:10 2016
@author: SROY
"""
#runfile('C:/Users/SROY/Documents/CodeBase/PythonWorkspace/LinearReg.py', wdir='C:/Users/SROY/Documents/CodeBase/PythonWorkspace')
#load dataset
#select train
#select test
#select model
#fit train
#score or predict test
import matplot... | royxss/Machine-Learning-Academic-Problems | Practice/LinearReg.py | LinearReg.py | py | 920 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sklearn.cross_validation.train_test_split",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 29,
"usage_ty... |
73320090428 | import json
from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View, ListView, DetailView, CreateView, UpdateView, DeleteView
from django.db.models import Count, Q,Sum
from .models import PetroleumDetails
import requests
# Create your views here.
class IndexView(L... | bpdyl/young-innovations-challenges | core/views.py | views.py | py | 7,376 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "models.PetroleumDetails",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "js... |
320867341 | from torch.utils.data import Dataset, DataLoader
import numpy as np
import os
from PIL import Image
class MiniPlacesTestLoader(Dataset):
def __init__(self, **kwargs):
self.photos_path = kwargs['photos_path']
self.transform = kwargs['transform']
self.num_files = len(os.listdir(self.photos_... | landmann/miniplaces | Resnet Code/test_set.py | test_set.py | py | 778 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"l... |
44833004874 | from gpiozero import AngularServo, Motor, LED, DistanceSensor
# import pygame
# import sys
from time import sleep
import socket
# VARIABLES GLOBALES
velocidad = 0.00 # Ciclo de trabajo para el motor (entre 0 y 1)
angulo = -13 # Angulo para el servo
# INICIALIZACIONES
# Pygame
# pygame.init()
# p... | juanmanuelramallo/Monster-Pi | Pruebas/Monster-Test-3.py | Monster-Test-3.py | py | 2,458 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "gpiozero.Motor",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "gpiozero.AngularServo",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "gpiozero.DistanceSensor",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "gpiozero... |
44320339294 | # This is an implementation of Adaptable ResNets for flexible models in FL settings
# The code is adapted from the implementation: https://github.com/felixgwu/img_classification_pk_pytorch/blob/master/models/resnet.py
import math
import torch
from torch import nn
import time
def conv3x3(in_planes: int, out_planes: in... | mertunsall/accordion | models/AdaptableResNetCifar.py | AdaptableResNetCifar.py | py | 9,688 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Conv2d",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_num... |
2139014134 | import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="" # or even "-1"
# For running inference on the TF-Hub module.
import tensorflow as tf
import tensorflow_hub as hub
from tensorflow.python.client import device_lib
# For downloading the image.
import matplotlib.pyplot as plt
i... | NazimAliev/public | ai/helicopter-detection-python/od.py | od.py | py | 4,536 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.client.device_lib.list_local_devices",
"line_number": 28,
"usage_type": "call"
},
{
... |
40524706254 | import pygame
import sys
# Inicialize o Pygame
pygame.init()
# Defina as configurações da tela
largura, altura = 800, 600
tela = pygame.display.set_mode((largura, altura))
pygame.display.set_caption('Translação de Objeto')
# Defina as coordenadas iniciais do objeto
x_objeto, y_objeto = largura // 2, altura // 2
# D... | odevjorge/MATEMATICA-APLICADA-TDE-2 | translate.py | translate.py | py | 1,232 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
24638642259 | from django.contrib import admin
from .models import Green_card
@admin.register(Green_card)
class Green_cardAdmin(admin.ModelAdmin):
list_display = (
"name",
"expat",
"green_card_expiry_date",
"overseas_car_insurance_expiry_date",
"created_at",
"updated_at",
)
... | kaineus2999/ems-backend | green_cards/admin.py | admin.py | py | 403 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.register",
"line_number": 4,
"usage_type": "call"
},
{
... |
5999374022 | import cv2
import numpy as np
import matplotlib.pyplot as plt
img = cv2.imread('multi_1.png', cv2.IMREAD_GRAYSCALE)
y_centro1 =96
y_centro2 =137
d = y_centro2 - y_centro1
y_centro3 = y_centro2 + d
y_centro_1 = y_centro3 + d
y_centro_2 = y_centro_1 - d
h = round((106 - 81) / 2)
inter1 = img[y_centro1 - h : y_centro1 ... | Zeekk9/Programas | PSI/Multiple_ROI_test2.py | Multiple_ROI_test2.py | py | 633 | python | es | code | 1 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotli... |
1245355777 | import pandas as pd
from tqdm import tqdm
import numpy as np
def median_n_filter(_df):
# median_n cutoff for SpliceMap results
_df.loc[
_df['median_n_mmsplice_splicemap'] < snakemake.params['median_n_cutoff'],
'delta_logit_psi_mmsplice_splicemap'] = 0
_df.loc[
_df['median_n_mmsplic... | gagneurlab/AbSplice_analysis | workflow/scripts/common/benchmark/tp_preds_among_total_preds.py | tp_preds_among_total_preds.py | py | 3,342 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.concat",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.read_parquet",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_num... |
29187042142 | import os, sys
import argparse
from glob import glob
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from lib.visualizer import Visualizer
from lib.core.config import get_cfg_defaults, update_cfg
if __name__ == '__main__':
from lib.core.config import get_cfg_defaults, update_cfg... | yfeng95/DELTA | main_demo.py | main_demo.py | py | 3,405 | python | en | code | 175 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
9418864402 | # -----------------------------------------------------------
# This script will be used for classification
#
# We will use 3 algorithms: Support Vector Machines, Decision Tree - Random Forest
#
# The main goal of the script is not to test the performance of ML algorithms but to
# see how easily we can modify/manipulat... | Spykra/NBA-Predictions | Classification_2.py | Classification_2.py | py | 5,829 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.SVC",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sklearn.svm",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "... |
6362532132 | # import modules
import pandas as pd
from time import time
from Cottage import Cottage
import openpyxl
from math import exp
from random import random, choice, randint
from math import log10
pd.options.mode.chained_assignment = None
# Planner class
class Planner():
"""
Class that stores and maintaines all inf... | Alwin1234567/OR-Project | Planner.py | Planner.py | py | 48,454 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.options",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "math.log10",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "math.log10",
"line_number... |
27260789626 | #Script for the second experiments of the multi-channel DART paper
#In this experiment, the performance of MC-DART is compared to straighforward extensions of standard reconstruction algorithms (e.g. SIRT) to multi-channel input
# in terms of pixel errors over number of ARM invocations.
#Note: Turn off DetRed (determi... | mzeegers/MC-DART | scripts/MCDARTExp2.py | MCDARTExp2.py | py | 7,946 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"lin... |
37814377929 | #!/usr/bin/python3
import argparse
import os
import getpass as gt
import pwd
import subprocess
REPOSITORY = 'artofnothing'
DISTRIBUTION = "jammy"
IMAGE_POSTFIX = "lib"
DOCKER_FILE_PATH = "."
USER_ID = str(pwd.getpwnam(gt.getuser())[2])
USER = gt.getuser()
HOME = f'/home/{USER}'
HOST_REP = os.path.dirname(os.path.a... | artofnothingness/templates | envs/lib/d.py | d.py | py | 3,768 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pwd.getpwnam",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "getpass.getuser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "getpass.getuser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"l... |
8226801552 | import json
import logging
import random
from functools import reduce
from typing import List, TextIO, Union
from flair.data import Corpus, FlairDataset, Sentence
from torch.utils.data import Dataset
from torch.utils.data.dataset import Subset
from tqdm import tqdm
import config
logger = logging.getLogger(__name__)
... | Rosenberg37/EntityDetection | modules/data.py | data.py | py | 11,815 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flair.data.Sentence",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.List",
... |
6691672464 | import ast
import logging
from aiogram import Bot, types
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters import Text
from aiogram.dispatcher.filters.state import State, StatesGroup
from main import *
from dispatcher import dp
from co... | yusupovanton/invest_analytica | handlers/personal_actions.py | personal_actions.py | py | 12,910 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "aiogram.Bot",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "aiogram.contrib.fsm... |
25401902789 | import requests
def get_from_url(url, typ = 'np', file_write_path = None):
if typ == 'down':
try:
with viz_utils.DownloadProgressBar(unit='B', unit_scale=True,
miniters=1, desc=url.split('/')[-1]) as t:
urllib.request.urlretrie... | ankurAAITG/components | utils/data_utils.py | data_utils.py | py | 992 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
}
] |
28906989045 | from django.db import models
from django.db.models.deletion import CASCADE
from django.db.models.fields import DateField
from django.db.models.query_utils import PathInfo
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
# Create your model... | rishupages/cowin_web_app | home/models.py | models.py | py | 2,293 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 16,
"usage_type": "call"
},
{
"api_name"... |
4927080767 | import gatt
import datetime
import struct
from gi.repository import GObject, Gio
from .config import config
def get_current_time():
now = datetime.datetime.now()
# https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Characteristics/org.bluetooth.characteristic.current_time.xml
re... | Vistaus/siglo | src/bluetooth.py | bluetooth.py | py | 3,055 | python | en | code | null | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "struct.pack",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "gatt.DeviceMan... |
72014821628 | # coding=utf-8
import base64
from crumhorn.configuration.userdata import as_userdata_string
from crumhorn.platform.compatibility import gzip
class SimpleFileForCopyingRemote():
def __init__(self, content, target_path, flags=None):
if flags is None:
flags = []
self.content = content
... | jelford/crumhorn | tests/crumhorn/configuration/test_userdata.py | test_userdata.py | py | 4,893 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "crumhorn.configuration.userdata.as_userdata_string",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "crumhorn.configuration.userdata.as_userdata_string",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "crumhorn.configuration.userdata.as_userdata... |
2257557122 | # -*- coding: utf-8 -*-
"""
Created on Sat Jan 23 00:36:59 2016
@author: prcobol
"""
import urllib
import json
def buildURL(city, key):
city = city.replace(" ","+")
url = "http://api.openweathermap.org/data/2.5/weather?q=" + city + "&appid=" + key
return url
def getJSON(city):
url = buildURL(city,"4... | sarthfrey/Texty | weather.py | weather.py | py | 955 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "urllib.urlopen",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
}
] |
29537449721 | # -*- coding: utf-8 -*-
from __future__ import print_function
from openerp import models, fields, api
from datetime import datetime
import unicodedata
import pytz
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
import progressbar
progressbar.streams.wrap_stderr()
class AvancysOrm2Sql(models.Model):
_nam... | odoopruebasmp/productions_stage_venv | avancys_orm2sql/avancys_orm2sql.py | avancys_orm2sql.py | py | 8,779 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "progressbar.streams.wrap_stderr",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "progressbar.streams",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "openerp.models.Model",
"line_number": 13,
"usage_type": "attribute"
},
{
... |
70347976509 | import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from util import calc_t_emb, flatten
def swish(x):
return x * torch.sigmoid(x)
class Upsample(nn.Module):
def __init__(self, n_channels, with_conv=True):
super(Upsample, self).__init__()
self.with_conv = with_conv
... | FengNiMa/pytorch_diffusion_model_celebahq | UNet.py | UNet.py | py | 7,944 | python | en | code | 24 | github-code | 6 | [
{
"api_name": "torch.sigmoid",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"li... |
71984550267 | import multiprocessing
import os
import tensorboardX
from torch import autograd
from deoldify.fastai.transforms import TfmType
from deoldify.fasterai.transforms import *
from deoldify.fastai.conv_learner import *
from deoldify.fasterai.images import *
from deoldify.fasterai.dataset import *
from deoldify.fasterai.visua... | Ichaelus/video-colorization | colorize_frames.py | colorize_frames.py | py | 7,746 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "torch.cuda.set_device",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "torch.backends",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Pat... |
3477356450 | import os
from contextlib import contextmanager
from functools import partial, partialmethod
from typing import TYPE_CHECKING, Iterator, Optional
from dvc_ssh import DEFAULT_PORT, SSHFileSystem
from dvc.exceptions import DvcException
from dvc.utils.fs import makedirs
from .base import BaseMachineBackend
if TYPE_CHE... | gshanko125298/Prompt-Engineering-In-context-learning-with-GPT-3-and-LLMs | myenve/Lib/site-packages/dvc/machine/backend/terraform.py | terraform.py | py | 3,286 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tpi.TerraformProviderIterative.pemfile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tpi.TerraformProviderIterative",
"line_number": 21,
"usage_type": "name"
},... |
15056100992 | import matplotlib.pyplot as plt
import numpy as np
def selection_sort(lista):
plt.ion()
fig, ax = plt.subplots()
x = range(0, len(lista))
scatter_graph = ax.scatter(x, lista)
for cont in range(len(lista)):
index = cont
for cont2 in range(cont+1, len(lista)):
if lista[... | EDAII/lista2-eda2 | ordena.py | ordena.py | py | 1,731 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matpl... |
19412348859 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('picmodels', '0072_navigators_approved_clients_for_case_management'),
]
operations = [
migrations.CreateModel(
na... | bbcawodu/careadvisors-backend | picmodels/migrations/0073_auto_20180525_1702.py | 0073_auto_20180525_1702.py | py | 2,483 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 14,
"usage_type": "call"
},
... |
7275633694 | from eeg_to_fmri.data import data_utils, eeg_utils, fmri_utils
import sys
import numpy as np
from sklearn.utils import shuffle
import tensorflow as tf
import gc
#should eeg_limit be true??
def dataset(dataset, n_individuals=8, interval_eeg=6, ind_volume_fit=True, raw_eeg=False, standardize_fmri=True, standardize_... | eeg-to-fmri/eeg-to-fmri | src/eeg_to_fmri/data/preprocess_data.py | preprocess_data.py | py | 11,884 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "eeg_to_fmri.data.fmri_utils",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "eeg_to_fmri.data.data_utils.load_data",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "eeg_to_fmri.data.data_utils",
"line_number": 32,
"usage_type": "nam... |
20069922047 | #!/usr/bin/env python3
import collections
import utils
def part1():
graph = read_graph()
print(paths_1(graph, set(['start']), 'start'))
def part2():
graph = read_graph()
print(paths_2(graph, set(['start']), 'start', None))
def read_graph():
graph = collections.defaultdict(list)
for line in utils.iter_lines(1... | raylu/advent_of_code | 2021/day12.py | day12.py | py | 1,257 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "utils.iter_lines",
"line_number": 17,
"usage_type": "call"
}
] |
70269215229 | from typing import Optional
from urllib.parse import urlparse
class CDNURLBuilder:
def __init__(self, *, cdn_host: str) -> None:
self._cdn_host = cdn_host
def make_cdn_url(self, origin_url: str) -> str:
parsed_url = urlparse(origin_url)
server: Optional[str] = parsed_url.hostname and... | cyber-chuvash/redir-balancer | balancer/cdn_url_builder.py | cdn_url_builder.py | py | 595 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.parse.urlparse",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 12,
"usage_type": "name"
}
] |
315377167 | import whisper
#for reading url
import requests
import re # 正则表达式
import pprint
import json
import subprocess
import argparse
MODEL = ['tiny','base', 'small','medium', 'large']
STAMP = ['true', 'false']
SAVE = ['true', 'false']
def get_args():
parser = argparse.ArgumentParser(description='Choose your parameters')... | Jiecao-Boy/Web_Video2Text | video2text_public.py | video2text_public.py | py | 4,366 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "re.findall",
"lin... |
12196031160 | from yt.data_objects.particle_filters import add_particle_filter
from yt.utilities.physical_constants import mp, kb, mh
from yt.utilities.cosmology import Cosmology
from yt import YTArray
from agora_analysis.utils import convert_T_over_mu_to_T_func,agora_Zsun
import numpy as np
PartType_Gas_to_use_dict = {'art':'gas',... | claytonstrawn/agora_analysis | agora_analysis/field_setup/common_fields.py | common_fields.py | py | 21,706 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "yt.utilities.physical_constants.mh",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "yt.data_objects.particle_filters.add_particle_filter",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "yt.data_objects.particle_filters.add_particle_filter",
... |
36609567275 | import json
import re
with open('raw.json', 'r') as f:
data = json.load(f)
pe_py = "<filename>solutions/solution_1.py\n// Here is the correct implementation of the code exercise in python:\n"
output_data = []
for i in range(len(data)):
question_dict = data[i]
output_dict = question_dict
number = ques... | BoyuanJackChen/transformers-v4.32 | evaluations/humaneval/answers/starcoder/python/trim_py_full.py | trim_py_full.py | py | 1,247 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 42,
"usage_type": "call"
}
] |
14317930021 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 30 22:56:23 2018
@author: enrijetashino
"""
#------------------------#
# A 2nd Python Session #
#------------------------#
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from pandas... | enrijetashino/python-lectures | lecture2.py | lecture2.py | py | 5,797 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
12229456988 | import torch
import torch.nn as nn
from torch.nn.functional import softmax
import torchvision
from torchvision import transforms
import torch.optim as optim
from torch.optim import lr_scheduler
import cv2
import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
import copy
# =========... | pengxj/DeepLearningCourse | code/lecture4-cvtasks-classification.py | lecture4-cvtasks-classification.py | py | 5,879 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 45,
"usage_type": "call"
},
{
... |
29842245511 | import pandas
from docx import Document
from docx.oxml.ns import nsdecls
from docx.oxml import parse_xml
def create_doc(ay,department,account_num,s_5hr,s_10hr,p_10hr,p_12hr,p_15hr,total_primary,thanksgiving_hours,spring_hours,christmas_hours,summer_hours,i):
document = Document()
# Table Layout
table = do... | AhadKhan98/Individualize-Department-Allocations-Program | script/main.py | main.py | py | 6,493 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "docx.Document",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "docx.oxml.parse_xml",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "docx.oxml.ns.nsdecls",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "docx.oxml.parse... |
34401327445 |
from flask import Flask, request, abort, jsonify
from flask_sqlalchemy import SQLAlchemy
from auth import AuthError, requires_auth
from flask_cors import CORS
from models import setup_db,Movie,Actor,db
from auth import API_AUDIENCE, AUTH0_CALLBACK_URL, AUTH0_CLIENT_ID
AUTH0_DOMAIN = 'proj03.us.auth0.com'
ALGORITHMS =... | saranyab9064/Casting_Agency | app.py | app.py | py | 10,988 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "auth.API_AUDIENCE",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "auth.AUTH0_CLIENT_ID",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "auth.AUTH0_CALLBACK_URL",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask.... |
3530252653 | import re
import os
import subprocess
import threading
import aiohttp
from typing import (
Union,
Set,
Dict,
Any
)
import ordinance.writer
import ordinance.exceptions
import ordinance.util
# ordinance.ext.network -- common networking utilities
# also handles banning and whitelisting ips
def clean_ip... | Kalamuwu/Ordinance | ordinance/ext/network.py | network.py | py | 11,217 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "re.VERBOSE",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "re.IGNORECASE",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line... |
22841598452 | from apiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
import datetime
import os
import ciso8601
import google.oauth2.credentials
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from google_auth_oauthlib.flow import Installe... | tivvit/stalker | analysis/fit.py | fit.py | py | 8,020 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "oauth2client.file.Storage",
"line_number": 146,
"usage_type": "call"
},
{
"api_name": "oauth2client.file",
"line_number": 146,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 147,
"usage_type": "call"
},
{
"api_name": "os.path",... |
15709658012 | # -*- coding: UTF-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
import booking.constants as const
from booking.booking_filtration import BookingFiltration
from booking.booking_report import BookingReporter
class Booking(webdriver.Chrome):
def __init__(self, driver_path, teardow... | wty-yy/Crawler-Learning | 1_booking_bot/booking/booking.py | booking.py | py | 4,363 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 13,
"usage_type": "call"
},
{
... |
27246508492 | """
SLAM system to reconstruct objects and update occlusion volumes
use this whenever a new picture is obtained
"""
import profile
from object import ObjectModel
from occlusion import Occlusion
import numpy as np
import cv2
from visual_utilities import *
import open3d as o3d
from memory_profiler import profile
impor... | MiaoDragon/pracsys-vbcpm | problem_formulation/scripts/model_free/slam.py | slam.py | py | 24,779 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "occlusion.Occlusion",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_n... |
30044213334 | from art import logo
import random
print(logo)
number = random.randrange(1,100)
print("Welcome to the Number Guessing Game!\nI'm thinking of a number between 1 and 100.")
while True:
try:
difficulty = input("Choose a difficulty. Type 'easy' or 'hard': ").lower()
if difficulty == "easy" or diffic... | guilherme-pf/Python | Day12/project_number_guessing.py | project_number_guessing.py | py | 1,153 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "art.logo",
"line_number": 4,
"usage_type": "argument"
},
{
"api_name": "random.randrange",
"line_number": 5,
"usage_type": "call"
}
] |
36995229819 | import os
import matplotlib.pyplot as plt
import numpy as np
# #这是一组使用:
# x = np.arange(0, 100)
# #划分子图
# fig,axes=plt.subplots(2,2)
# ax1=axes[0,0]
# ax2=axes[0,1]
# ax3=axes[1,0]
# ax4=axes[1,1]
# #作图1
# ax1.plot(x, x)
# #作图2
# ax2.plot(x, -x)
# #作图3
# ax3.plot(x, x ** 2)
# ax3.grid(color='r', linestyle='--', linewi... | wangluyabupt/filepath_local | file_path/plot.py | plot.py | py | 1,867 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.arange",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
5942351397 | import mysql.connector
from mysql.connector import Error
from mysql.connector import errorcode
import sys
import mysql.connector
import yattag
from yattag import Doc
try:
mySQLconnection = mysql.connector.connect(host='localhost',
database='parlebot',
user=... | szenden/parlebot | code/Django/dboutput.py | dboutput.py | py | 1,501 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 11,
"usage_type": "name"
},
{
"... |
4464008140 | """Helper Functions"""
import os
import configparser
from qgis.core import Qgis, \
QgsClassificationQuantile, \
QgsRendererRangeLabelFormat, \
QgsStyle, \
QgsGraduatedSymbolRenderer, \
QgsMessageLog, \
... | petrarch1603/PeelOrange | peel_orange_functions.py | peel_orange_functions.py | py | 4,582 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
4547828430 | import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import cufflinks as cf
from plotly.offline import download_plotlyjs, plot, iplot
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.preprocessing import StandardScaler, OneHot... | suresh-kasipandy/Titanic | Titanic.py | Titanic.py | py | 30,932 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.StratifiedShuffleSplit",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 45,
"usage_type": "name"
},
... |
35374862655 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import traci
import numpy as np
import math
import numpy.linalg as LA
from math import atan2,degrees
from shapely.geometry import LineString, Point, Polygon
from shapely.ops import linemerge, unary_union, polygonize
from scipy import interpolate
egoID = 'auv1'
def calcul... | sanggu-park/blaft_simulation | SimpleMath.py | SimpleMath.py | py | 17,598 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.linalg.norm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"... |
8598753342 | import json
import requests
import os
import argparse
import pathlib
import shutil
from urllib.request import urlopen
from requests_toolbelt import MultipartEncoder
def upload_img(folder: str, imagename: str, access_token: str, page_id: str):
"""
This functions takes an image and uploads it to... | Mattia921/truebees | TrueBees/Facebook/facebook_upload_download.py | facebook_upload_download.py | py | 5,138 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests_toolbelt.MultipartEncoder",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "json.lo... |
43734414256 | from NodeGraphQt import BaseNode, BaseNodeCircle
from functools import wraps
import pandas as pd
import os
def _log_method(val):
@wraps(val)
def wrapper(*a, **ka):
print(val.__name__, 'is called')
val(*a, **ka)
return wrapper
class LogMethodCalls(type):
def __new__(cls, cls_name, base... | Jc856/docs | NodesPostPro/NodesPlt/nodes/read_file_nodes.py | read_file_nodes.py | py | 2,618 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "functools.wraps",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "NodeGraphQt.BaseNode",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "os.path.isfile",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
39187122523 | import os
import pandas as pd
import geopandas as gpd
import pyproj
import numpy as np
import matplotlib.pyplot as plt
# Common directory
username = os.environ.get("USERNAME")
# Pandas parameters
pd.set_option('display.max_columns', None)
pd.set_option('display.width', 1000)
# Import covid data
# @Nienke: Deze kun j... | AdamOps/geomap | voor_nienke.py | voor_nienke.py | py | 2,840 | python | nl | code | 0 | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pandas.set_option",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
... |
43243413981 | import logging
import logging.config
import os
import sys
import warnings
from os.path import dirname, expanduser
from shutil import which
from socket import socket
import tornado.ioloop
from PIL import Image
from tornado.httpserver import HTTPServer
from tornado.netutil import bind_unix_socket
from thumbor.config im... | thumbor/thumbor | thumbor/server.py | server.py | py | 4,554 | python | en | code | 9,707 | github-code | 6 | [
{
"api_name": "thumbor.config.Config.allow_environment_variables",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "thumbor.config.Config",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "os.curdir",
"line_number": 33,
"usage_type": "attribute"
},
{... |
18023257001 | from django.db import models
from django.core.validators import MinLengthValidator
from account.models import User
class Recipe(models.Model):
TITLE_MAX_LENGTH = 150
TITLE_MIN_LENGTH = 1
TIME_MAX_LENGTH = 10
TIME_MIN_LENGTH = 1
DESCRIPTION_MIN_LENGTH = 1
CATEGORY_CHOICE_OTHERS = 'Others'
... | liusska/Recipes-Blog-DRF-VFE | recipes_blog/recipe/models.py | models.py | py | 3,027 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": ... |
386742749 | """
Created on Tue Nov 10
This program finds the solution to the system Ax = b using Gauss-seidel method.
Parameters
----------
A : Invertible matrix
b : Constant vector
x0 : Initial aproximation
tol : Tolerance
n_max : Maximum number of iterations
Returns
-------
iter: Iterations number
x : Solution
E : error
@au... | jsperezsalazar2001/SADA_ANALYTICS | SADA_ANALYTICS/public/python/gauss_seidel.py | gauss_seidel.py | py | 2,102 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.inv",
"... |
607640241 | import shutil
import pysam
import gzip
import os
def validate():
directory = "test_data/"
# unzip gz files
for bamfile in os.listdir(directory):
if bamfile.endswith(".gz"):
bamfilepath = os.path.abspath(directory+bamfile)
with gzip.open(bamfilepath, 'rb') as f_in, open(bamf... | tedd-E/bam-local | validate.py | validate.py | py | 965 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "gzip.open",
"line_number"... |
72612836029 | from task5_2 import Task5_2
import pytest
import logging
@pytest.fixture(scope='class')
def db(request):
logging.info('----------------Setup method----------------')
database = "clients.db"
connection = Task5_2(database)
request.cls.db = connection
request.cls.table = 'CLIENTS'
yield
... | fedepacher/Wazuh-Test | Task_5/test_case_52.py | test_case_52.py | py | 1,752 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.info",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "task5_2.Task5_2",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_n... |
26126709843 | # -*- coding: utf-8 -*-
"""PAiP Web Build System - Program Class
This module contains the most core functionality,
needed by other functions and classes.
NAME - PAiP Web Build System
AUTHOR - Patryk Adamczyk <patrykadamczyk@paipweb.com>
LICENSE - MIT
"""
# Imports
import argparse as ap
from pwbs import __version__ as... | paip-web/pwbs | pwbs/pwbs_class.py | pwbs_class.py | py | 15,197 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pwbs.api.pwbs_event_manager.PWBSEventManager.getInstance",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pwbs.api.pwbs_event_manager.PWBSEventManager",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number"... |
10954405124 | import os
import errno
import json
from datetime import timedelta
from gi.repository import GLib, GObject, Gtk
from .clocks import Clock
from .utils import Alert, Dirs, LocalizedWeekdays, SystemSettings, TimeString, WallClock
from .widgets import Toolbar, ToolButton, SymbolicToolButton, SelectableIconView, ContentView
... | danigm/gnome-clocks | gnomeclocks/alarm.py | alarm.py | py | 21,448 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utils.WallClock.get_default",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utils.WallClock",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
30518298933 | from operator import truediv
from typing import List
import time
class Solution:
def exist(self, board: List[List[str]], word: str) -> bool:
self.times = 0
for i in range(len(board)):
for j in range(len(board[i])):
if word[0] == board[i][j]:
pSet = se... | Joel-Hwang/leetcode | Python3/_79_WordSearch.py | _79_WordSearch.py | py | 3,385 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 95,
... |
40129238594 | #!/usr/bin/env python3
from collections import deque
from collections import defaultdict
import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1 # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7
INF = 10 ** 10
def init():
global edges
edges = defaultdict(dict)
def add_edge(frm, to, capacity):
edges[frm... | nishio/atcoder | acl/d.py | d.py | py | 5,817 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "copy.d... |
1308726865 | import math
import torch
from pytorch_named_dims import nm
from torch import nn
__ALL__ = ['BaseResBlock', 'PreActivationResBlock', 'BottleneckResBlock', 'SimpleResNet']
class BaseResBlock(nn.Module):
"""
Original implementation of the ResNet block with skip options for batch norm and last activation
""... | Bartolo1024/Pixel2Vec | pixel2vec/models/simple_resnet.py | simple_resnet.py | py | 5,419 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pytorch_named_dims.nm.Conv2d",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pytorch_na... |
18840812563 | from osv import osv, fields
from tools.translate import _
import re
class verify_marks(osv.osv_memory):
""" Request buildbot to scan incomplete commits
"""
_name = 'software_dev.mirrors.wizard.verify_marks'
_description = 'Verify mirrored Marks'
_columns = {
'collection_id': fields.many2o... | xrg/openerp-buildbot | addons/software_dev_mirrors/wizard/verify_marks.py | verify_marks.py | py | 13,062 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "osv.osv.osv_memory",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "osv.osv",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "osv.fields.many2one",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "osv.fields",
"l... |
74077800188 | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 14 16:06:35 2023
@author: acer
"""
from azureml.core import Workspace
ws = Workspace.create(name = 'myworkspace',
subscription_id= '9d99d193-c40a-4065-a70f-dc3c40c2a8e0',
resource_group= 'AzureMLSDK_RG_01',
... | lali1999/Microsoft-Azure-ML-Studio-Practice | Creating Workspace.py | Creating Workspace.py | py | 442 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "azureml.core.Workspace.create",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "azureml.core.Workspace",
"line_number": 10,
"usage_type": "name"
}
] |
23196137877 | from pyspark.sql import Row
from splink_graph.node_metrics import eigencentrality, harmoniccentrality
import pytest
import pandas as pd
import networkx as nx
from pandas.testing import assert_frame_equal
import pyspark.sql.functions as f
import json
def test_eigencentrality_simple(spark):
data_list = [
{"... | moj-analytical-services/splink_graph | tests/test_node_metrics.py | test_node_metrics.py | py | 2,193 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "pyspark.sql.Row",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.functions.col",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.functions",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "splin... |
35712417244 | from motor import Motor
from beamer.pin_mapping import *
mot = Motor(MOT_DIR, MOT_STEP, MOT_ENn, direct=0, steps_per_mm=STEPS_PER_MM)
motors = [mot]
max_speed = 4.0
closed_position = -0.3
opened_position = 155
| clementnuss/hatch_controller | beamer/vars.py | vars.py | py | 214 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "motor.Motor",
"line_number": 4,
"usage_type": "call"
}
] |
19218071613 | from typing import Any
from rest_framework.authentication import TokenAuthentication as DrfTokenAuthentication
from rest_framework.authtoken.models import Token
from rest_framework_simplejwt.authentication import (
JWTAuthentication as DrfJwtAuthentication,
)
from users.models import User
from users.services.auth... | plathanus-tech/django_boilerplate | src/app/drf/authentication.py | authentication.py | py | 1,441 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "users.models.User",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "users.services.auth.user_update_last_login_on_succesfull_api_authentication",
"line_number": 19,
"usage_type... |
26113752225 | __authors__ = ["V. Valls"]
__license__ = "MIT"
__date__ = "21/09/2017"
import logging
import numpy
import unittest
import tempfile
import shutil
_logger = logging.getLogger(__name__)
import silx.io
import silx.io.utils
import h5py
try:
from .. import commonh5
except ImportError:
commonh5 = None
class _Tes... | silx-kit/silx | src/silx/io/test/test_commonh5.py | test_commonh5.py | py | 8,798 | python | en | code | 106 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "unittest.SkipTest",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "silx.io.io... |
71971576829 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | kubeflow/kubebench | examples/src/tf-cnn/post_processor.py | post_processor.py | py | 1,618 | python | en | code | 74 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_nu... |
21567617250 | #!/usr/bin/python3
import sys
import argparse
if sys.version_info[0] > 2:
import configparser as ConfParser
else:
import ConfigParser as ConfParser
import uuid
import glob
import os
import shutil
import numpy as np
import nibabel as nib
from subprocess import call
configFilePath = os.path.join(os.path.expan... | Inria-Empenn/Anima-Scripts-Public | diffusion/mcm_fiber_atlas_comparison/animaSubjectsMCMFiberPreparation.py | animaSubjectsMCMFiberPreparation.py | py | 14,043 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.version_info",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.expanduser",
... |
43339796573 | from random import shuffle
import glob
import numpy as np
import h5py
import cv2
#To shuffle the addresses
data_shuffle = True
#Path for the created .hdf5 file
file_path = 'D:\\Courses\\Internship\\dataset\\diya_or_notdiya.hdf5'
#Original data path
diya_or_notdiya_path = 'D:\\Courses\\Internship\\f_images\\*.jpg'
... | diyamahendru/Image-Classfication-from-scratch | hdf5_dataset.py | hdf5_dataset.py | py | 2,362 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 4... |
7647827473 | import telebot
from telebot import types
TOKEN = "5212514116:AAE6MoOvow9sLfsanaON8gdtWuES3VOr0zs"
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(commands=['start'])
def start(message):
markup = types.ReplyKeyboardMarkup(resize_keyboard = True)
item1 = types.KeyboardButton('🖥 Личный Кабинет')
... | Winslowww/telebot | main.py | main.py | py | 8,771 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "telebot.TeleBot",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "telebot.types.ReplyKeyboardMarkup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "telebot.types",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "telebot.... |
9311293997 | import numpy as np
import pandas as pd
import ccxt
from datetime import datetime
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader, TensorDataset
import matplotlib.pyplot as plt
from sklearn.preprocessing import MinMaxScaler
import random
def set_s... | kangmincho1/LTSF-NLinear-CryptoBot | forecasting.py | forecasting.py | py | 12,187 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.manual_seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cuda.manual_seed",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "numpy.random... |
30803420171 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence
class Attention(nn.Module):
def __init__(self, embed_dim, hidden_dim=None, out_dim=None, n_head=1, score_function='dot_product', dropout=0):
''' Attentio... | keyjhk/ABSA | layers/attention.py | attention.py | py | 7,107 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
23703275454 | import numpy as np
import os
import pandas as pd
import sklearn.datasets
from sklearn.decomposition import PCA
import sklearn.feature_extraction.text
import tensorflow as tf
import tensorflow_datasets as tfds
import torch
import torch.nn.functional
import torch.utils.data
import torchvision
def generate_mixture_of_ga... | RylanSchaeffer/FieteLab-RCRP | utils/data.py | data.py | py | 20,683 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.random.multivariate_normal",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.... |
4333787820 | import sys
from typing import Any, Callable, Iterable, Iterator, Optional, Type, TypeVar, Union
if sys.version_info < (3, 8): # pragma: no cover
from typing_extensions import Protocol
else: # pragma: no cover
from typing import Protocol
if sys.version_info < (3, 10): # pragma: no cover
from typing_exte... | Rogdham/bigxml | src/bigxml/typing.py | typing.py | py | 1,118 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "sys.version_info",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.version_info",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "typing.ParamSpec",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "typing.Typ... |
8732088462 | import pandas as pd
import pyrebase
import datetime
import plotly.offline as py
from matplotlib import pyplot as plt
from fbprophet import Prophet
from fbprophet.plot import plot_plotly
import streamlit as st # pylint: disable=import-error
NYC = "Ozone Prediction NYC"
LA = "Ozone Prediction LA"
CHICAGO = "Ozone Pre... | smacauda/AirQualityApp | AirQualityApp/app.py | app.py | py | 3,572 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyrebase.initialize_app",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.Data... |
72779289788 | from app.config import config_dict, config_database
from flask import Flask
from flask_cors import CORS
from flask_restful import Api
from flask_socketio import SocketIO
from pymongo.errors import ConnectionFailure
from pymongo import MongoClient
from monitoring.controllers import Main, Slack, Devices, Dataset
from mon... | guiderOrg/legacy-web | app/__init__.py | __init__.py | py | 1,928 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.config.config_dict",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "app.config",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"... |
41495653735 | #!coding:utf-8
import csv
import itertools
import os
import time
from datetime import datetime
import torch
from sklearn.preprocessing import MinMaxScaler
from torch import optim
from torch.optim import lr_scheduler
from torch.utils.data import TensorDataset, Dataset
import pandas as pd
from prediction.MT_TSNLNet imp... | CSUIIS/MsFEFNet-and-MT-TSNLNet | prediction/MT_TSNLNet/train.py | train.py | py | 12,695 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "torch.tensor",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "torch.long",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "prediction.MT_T... |
28763620115 | from curses import wrapper
from curses import start_color
from curses import use_default_colors
from curses import init_pair
from curses import color_pair
import curses
x = 0
y = 0
current_color_pair = 1
max_color_pair_defined = -1
mode = 'normal'
max_x = -1
max_y = -1
current_character = -1
hud_color = 8
quit = False... | chzchzchz/asciishade | main.py | main.py | py | 3,905 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "curses.color_pair",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "curses.color_pair",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "curses.color_pair",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "curses.color_pa... |
71357929147 | import json
import pandas as pd
from regex import D
def appendPRFADF(df, to_append):
df_length = len(df)
df.loc[df_length] = to_append
#given dictionary of results, calculate precision, recall, fscore, accuracy
def calculatePRFA(resultsDict, name, print):
precision = (resultsDict['truePositives'])/(resul... | HUNTINGHOUND/Terminus | code/Baseline/baseline_functions.py | baseline_functions.py | py | 7,377 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_dict",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 94,
"usage_type": "attribute"
},
{
"api_name": "json.load"... |
40390832962 | from typing import List
class Solution:
def searchInsert(self, num: List[int], target: int):
start, end = 0, len(num) - 1
while start <= end:
mid = (start + end) // 2
if target <= num[mid]:
end = mid - 1
elif target == num[mid]:
... | bomwo/algorithm | leetcode/easy/35-searchinsertposition.py | 35-searchinsertposition.py | py | 511 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
31512888884 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import urllib2
import requests
import codecs
import csv
import pprint as pp
import re
from collections import OrderedDict
url_standard = 'http://www.ripenear.me/blog'
url_next_page = '?page='
#web request function
def make_request_get(... | rjshanahan/RipeNearMe-Social-Media-Text-Analytics | webscrapers/ripnearme_blog_scraper.py | ripnearme_blog_scraper.py | py | 4,903 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "re.compile",
"li... |
33535914031 | from project import db
from datetime import datetime
class Comment(db.Model):
id = db.Column(db.Integer, primary_key=True)
commenter_id = db.Column(db.Integer,db.ForeignKey('user.id'))
post_id = db.Column(db.Integer,db.ForeignKey('post.id'))
comment = db.Column(db.TEXT)
date = db.Column(db.DateTime... | subhayan-bhattacharya/Flask_Blog_project | project/models/comments_model.py | comments_model.py | py | 1,025 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "project.db.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "project.db",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "project.db.Column",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "project.db",
"lin... |
37706422776 | # -*- coding: utf-8 -*-
import dataset
from flask import Flask, request
from flask_restful import Resource, Api
import json
from flask_restful.utils import cors
db = dataset.connect('postgresql://postgres:root@localhost:5432/postgres')
table = db['facts']
results=''
app = Flask(__name__)
api = Api(app, decorators=[co... | daiwin/web_scraping | REST_Server.py | REST_Server.py | py | 764 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dataset.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_restful.utils.cors... |
37657776821 | import io
import xlsxwriter
from fastapi import APIRouter, Depends
from starlette.responses import StreamingResponse, FileResponse
from tortoise.contrib.pydantic import pydantic_model_creator
from fastapi_admin.depends import QueryItem, get_model, get_query
from fastapi_admin.factory import app
router = APIRouter()
... | cjluzzl/fastapi-admin | fastapi_admin/routes/other.py | other.py | py | 1,226 | python | en | code | null | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "fastapi_admin.depends.QueryItem",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "fas... |
1890089597 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="easyQuake",
version="1.3.2",
author="Jake Walter",
author_email="jakeiwalter@gmail.com",
description="Simplified machine-learning driven earthquake detection, location, and analysis",
... | jakewalter/easyQuake | setup.py | setup.py | py | 1,475 | python | en | code | 50 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 15,
"usage_type": "call"
}
] |
71765749627 | """
Epocas v3, esquemas de pydantic
"""
from pydantic import BaseModel
from lib.schemas_base import OneBaseOut
class EpocaOut(BaseModel):
"""Esquema para entregar epocas"""
id: int | None
nombre: str | None
class Config:
"""SQLAlchemy config"""
orm_mode = True
class OneEpocaOut(E... | PJECZ/pjecz-plataforma-web-api-new | plataforma_web/v3/epocas/schemas.py | schemas.py | py | 383 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "lib.schemas_base.OneBaseOut",
"line_number": 21,
"usage_type": "name"
}
] |
22051701467 | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 6 20:44:35 2019
@author: longjiaqi
"""
#加载模块
import sys
sys.path.append("D:\项目\代码学习\my_code")
from kNN import *
#导入数据
datingDataMat, datingLabels = file2Matrix('data_datingTestSet2.txt')
#绘图
import matplotlib
import matplotlib.pyplot as plt
#%matplot... | longjiaqiuu/machine_learning_in_action | plot.py | plot.py | py | 1,058 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
3477264990 | """Manages dvc remotes that user can use with push/pull/status commands."""
import logging
from typing import TYPE_CHECKING, Iterable, Optional
from dvc_data.db import get_index
if TYPE_CHECKING:
from dvc_data.hashfile.db import HashFileDB
from dvc_data.hashfile.hash_info import HashInfo
from dvc_data.st... | gshanko125298/Prompt-Engineering-In-context-learning-with-GPT-3-and-LLMs | myenve/Lib/site-packages/dvc/data_cloud.py | data_cloud.py | py | 5,860 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "dvc.config.NoRe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.