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
2841468959
from PyQt5.QtCore import QObject from model.ConfigParser.ConfigParserPostToGroup.ConfigParserPostToGroup import ConfigParser from model.ActionsDelayer.ActionDelayer import ActionDelayer from model.ConfigParser.ConfigContainerPostToGroup.ConfigContainerPostToGroup import ConfigContainerPostToGroup from model.SplashS...
SokolnikSergey/VkPoster
model/Start/Starter.py
Starter.py
py
14,228
python
en
code
3
github-code
18
[ { "api_name": "PyQt5.QtCore.QObject", "line_number": 47, "usage_type": "name" }, { "api_name": "datetime.datetime.timestamp", "line_number": 51, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 51, "usage_type": "name" }, { "api_name": "da...
73126982441
# Import libraries from google.cloud import vision import io import os # Instantiates a client client = vision.ImageAnnotatorClient() # Loads the image from local source_image = "images/street.jpg" with io.open(source_image, "rb") as image_file: content = image_file.read() image = vision.Image(content=content) #...
elmoallistair/googleapis-python
vision/detect_label.py
detect_label.py
py
888
python
en
code
3
github-code
18
[ { "api_name": "google.cloud.vision.ImageAnnotatorClient", "line_number": 7, "usage_type": "call" }, { "api_name": "google.cloud.vision", "line_number": 7, "usage_type": "name" }, { "api_name": "io.open", "line_number": 11, "usage_type": "call" }, { "api_name": "go...
22781424738
import torch.nn as nn class eca_layer(nn.Module): """Constructs a ECA module. Args: channel: Number of channels of the input feature map k_size: Adaptive selection of kernel size """ def __init__(self, channel, k_size=3): super(eca_layer, self).__init__() self.avg_poo...
c123456y/pytorch-inpainting
utilatten/attention.py
attention.py
py
3,005
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.AdaptiveAvgPool2d", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", ...
29435468009
import matplotlib.pyplot as plt from pylab import rcParams import numpy as np class Plot: def __init__(self): self.temp_c = "skyblue" self.sunlight_c = "khaki" self.greenhouse_temp_c = "mediumspringgreen" self.heating_c = "red" self.ventilation_c = "blue" self.max_...
aronbencsiknu/KV6002_RL-BEMS
python_code/plot.py
plot.py
py
3,327
python
en
code
0
github-code
18
[ { "api_name": "pylab.rcParams", "line_number": 21, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 23, "usage_type": "name" }, { "api_name": "matplotlib.py...
5314644033
import random import geohash import route # A function to randomly select k items from stream[0..n-1]. def selectKItems(numPoints, numPointsToSample): # reservoir[] is the output array. Initialize it with # first k elements from stream[] reservoir = range(numPointsToSample) # Iterate from the (k+1)th elemen...
EmmanuelBoidot/geosign
geomUtils.py
geomUtils.py
py
1,205
python
en
code
0
github-code
18
[ { "api_name": "random.randrange", "line_number": 16, "usage_type": "call" }, { "api_name": "geohash.decode", "line_number": 27, "usage_type": "call" }, { "api_name": "geohash.decode", "line_number": 28, "usage_type": "call" }, { "api_name": "route.Location", "...
25465068266
import weakref from numbers import Integral import numpy as np from mygrad._utils import SkipGradient from mygrad.operation_base import Operation from mygrad.tensor_base import Tensor try: from numba import njit, vectorize except ImportError: # pragma: no cover raise ImportError( "The package `numba...
rsokl/MyGrad
src/mygrad/nnet/layers/gru.py
gru.py
py
18,148
python
en
code
181
github-code
18
[ { "api_name": "numpy.exp", "line_number": 26, "usage_type": "call" }, { "api_name": "numba.vectorize", "line_number": 18, "usage_type": "call" }, { "api_name": "numba.vectorize", "line_number": 29, "usage_type": "call" }, { "api_name": "numba.vectorize", "line...
7475679817
import numpy as np from sklearn.compose import ColumnTransformer from sklearn.impute import SimpleImputer from sklearn.pipeline import Pipeline from sklearn.preprocessing import OneHotEncoder, MinMaxScaler from .custom_transforms import MedianScaler, DropColumns def build_pipeline() -> Pipeline: transformer = Co...
made-ml-in-prod-2021/lenaso
ml_project/transform_pipelines/sample_pipeline.py
sample_pipeline.py
py
1,291
python
en
code
0
github-code
18
[ { "api_name": "sklearn.compose.ColumnTransformer", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.pipeline.Pipeline", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.impute.SimpleImputer", "line_number": 19, "usage_type": "call" }, ...
8649687275
import sys sys.path.append('../../') import numpy as np import nnabla as nn import nnabla.functions as F import nnabla.parametric_functions as PF import nnabla.solvers as S import nnabla.monitor as M from nnabla.experimental.trainers import Trainer from nnabla.experimental.trainers import Updater from nnabla.experim...
minatosato/nlp-nnabla
word-embeddings/glove/train.py
train.py
py
5,025
python
en
code
9
github-code
18
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" }, { "api_name": "nnabla.ext_utils....
37027271996
from collections import OrderedDict from os import getcwd from yaml import load with open("tokens.yaml", 'r') as yaml_file: _tokens = load(yaml_file)['tokens'] # Basic: TELEGRAM_TOKEN = _tokens['telegram'] ENDPOINTS = OrderedDict(sorted({ "1) /start": "Welcome message", "2) /help": "List of a valid comm...
amarusyak/Telegram-Bot
config.py
config.py
py
1,069
python
en
code
0
github-code
18
[ { "api_name": "yaml.load", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 24, "usage_type": "call" } ]
26931118271
"""Settings Module functions behind the settings window ui-elements """ import logging import logging.config from PyQt5.QtCore import pyqtSlot as Slot # ui elements communication import os.path import os import configparser import sys import client sys.path.append('../client') import backend import client_functions d...
alessacher/htl-tk-chat
frontend/settings_functions.py
settings_functions.py
py
5,325
python
en
code
1
github-code
18
[ { "api_name": "sys.path.append", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_num...
72748466279
import os import sys sys.path.insert(1,'./functions/') import functions from matplotlib import pyplot import matplotlib as mpl #Set Parameters K = 3 max_iters = 16 # Load image (.png) A = mpl.image.imread(os.path.join('images', 'image.png')) # Divide by 255 to map values between 0 and 1 img = A / 255 ...
srjeyasa/k-meansComp
compress.py
compress.py
py
1,175
python
en
code
0
github-code
18
[ { "api_name": "sys.path.insert", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "matplotlib.image.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.image"...
6790364584
import pandas as pd import numpy as np import sklearn.impute import sklearn.model_selection import sklearn.preprocessing def drop_columns(df): df.drop(columns = ['species_id', 'measurement_id'], inplace = True) return df def rename_columns(df): df.rename(columns = {'species_name':'species'}, inplace = Tru...
noahmelngailis/ds-methodologies-exercises
classification/prepare.py
prepare.py
py
3,183
python
en
code
0
github-code
18
[ { "api_name": "sklearn.impute.preprocessing.OneHotEncoder", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.impute.preprocessing", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sklearn.impute", "line_number": 16, "usage_type": "name" }...
23087379957
import numpy as np import torch.optim as optim import torch.utils.data as Data import os from network import * def standardization(data): mu = np.mean(data, axis=0) sigma = np.std(data, axis=0) return (data - mu) / sigma loss = torch.nn.MSELoss(reduction='mean') BATCH_SIZE = 2000 learning_rate = 1e-...
ZeroAda/DeepSeparator
Exp7/train.py
train.py
py
3,371
python
en
code
0
github-code
18
[ { "api_name": "numpy.mean", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.std", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.optim.nn.MSELoss", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.optim.nn", "lin...
34212415569
import io from re import X import sys _INPUT = """\ 3 1 2 3 """ sys.stdin = io.StringIO(_INPUT) N = int(input()) A = list(map(int, input().split())) mod = 10**9 + 7 ans = 0 A_sum = sum(A) for i in range(N): A_sum -= A[i] ans += A_sum * A[i] print(ans % mod)
kkchart9/atcoder
ABC/177_c.py
177_c.py
py
276
python
en
code
0
github-code
18
[ { "api_name": "sys.stdin", "line_number": 9, "usage_type": "attribute" }, { "api_name": "io.StringIO", "line_number": 9, "usage_type": "call" } ]
42155471856
import random import matplotlib.pyplot as plt # Перемешиваем массив def monty_hall_without_change(choices): random.shuffle(choices) return choices[random.randrange(len(choices))] # Перемешиваем массив def monty_hall_with_change(choices): random.shuffle(choices) # Первый выбор first_c...
TalkoDenis/Probability_theory_and_statistics
Monty_hall_problem/Monty_Hall_Problem.py
Monty_Hall_Problem.py
py
2,425
python
ru
code
0
github-code
18
[ { "api_name": "random.shuffle", "line_number": 6, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 7, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 12, "usage_type": "call" }, { "api_name": "random.randrange", "...
3619941514
import torch from .synth import SynthData from .fscd import build as build_fscd from .gmot import build as build_gmot from .coco import build as build_coco class JOINTFSCD(torch.utils.data.Dataset): def __init__(self, args, datasets) -> None: super().__init__() self.datasets = datasets sel...
thomasreolon/GMOTRv2
datasets_old/joint2.py
joint2.py
py
1,512
python
en
code
0
github-code
18
[ { "api_name": "torch.utils", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.rand", "line_number": 31, "usage_type": "call" }, { "api_name": "gmot.build", "line_number": 43, "usage_type": "call" }, { "api_name": "fscd.build", "line_number":...
74604734118
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import seaborn as sns from sklearn.model_selection import train_test_split from sklearn.metrics import classification_report, confusion_matrix, f1_score def create_model(image_size, num_classes): base_model = tf.keras.applications.I...
varshan013/Bird-identifier-classifier
programs/model_edit_1.py
model_edit_1.py
py
3,733
python
en
code
0
github-code
18
[ { "api_name": "tensorflow.keras.applications.InceptionV3", "line_number": 9, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 9, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.Sequential", "line_number": 16, "usage_type": "call" }, ...
71266774439
#!/usr/bin/env python3 #-*- coding: utf-8 -*- #======================================================================================= # Imports #======================================================================================= #========================================================== #========================...
Aziroshin/bin
simplecryptopiascanner.py
simplecryptopiascanner.py
py
13,109
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path", "line_number": 42, "usage_type": "attribute" }, { "api_name": "os.path.expanduser", "line_number": 42, "usage_type": "call" }, { "api_name": "kivy.app", "line_num...
32474586806
# Importing required packages import streamlit as st import openai # Set the API key openai.api_key = "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" st.set_page_config(page_title="OpenAI Text Completion", page_icon=":guardsman:", layout="wide") st.title("OpenAI Text Completion") prompt = st.text_inp...
Piyushlamsoge/Openai-App
streamlit_app.py
streamlit_app.py
py
541
python
en
code
0
github-code
18
[ { "api_name": "openai.api_key", "line_number": 6, "usage_type": "attribute" }, { "api_name": "streamlit.set_page_config", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.title", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit....
21762283358
from atom import Atom class Molecule: """이름과 원자 리스트를 갖는 분자""" def __init__(self, name: str) -> None: """어떤 원자도 없는 name이라는 분자를 생성한다. """ self.name = name self.atoms = [] def add(self, a: Atom) -> None: """a를 이 분자의 Atom 리스트에 추가한다. """ self.atoms....
gilbutITbook/007016
chap14/molecule.py
molecule.py
py
1,851
python
ko
code
6
github-code
18
[ { "api_name": "atom.Atom", "line_number": 13, "usage_type": "name" }, { "api_name": "atom.translate", "line_number": 24, "usage_type": "call" }, { "api_name": "atom.Atom", "line_number": 54, "usage_type": "call" }, { "api_name": "atom.Atom", "line_number": 55,...
7742186286
from urllib.request import Request, urlopen from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.firefox.options import Options def paper_titles_for_id(person_id, selenium_path=None#"/usr/local/bin/geckodriver" ): options = Options() options.headless = ...
kmdn/RefBee
refbee/platforms/acm.py
acm.py
py
896
python
en
code
1
github-code
18
[ { "api_name": "selenium.webdriver.firefox.options.Options", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 14, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 14, "usage_type": "name" }, ...
27346244451
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division import pytest from psychopy.visual.window import Window from psychopy.visual.slider import Slider from psychopy.visual.grating import GratingStim from psychopy.visual.elementarray import ElementArrayStim from psychopy.visual.circle import ...
soheilbr82/BluegrassWorkingMemory
Python_Engine/Lib/site-packages/psychopy/tests/test_all_visual/test_slider.py
test_slider.py
py
6,442
python
en
code
5
github-code
18
[ { "api_name": "psychopy.visual.window.Window", "line_number": 21, "usage_type": "call" }, { "api_name": "psychopy.visual.slider.Slider", "line_number": 31, "usage_type": "call" }, { "api_name": "psychopy.visual.slider.Slider", "line_number": 40, "usage_type": "call" }, ...
13226501696
from utils.LogInitilizer import LogInitilizer logger=LogInitilizer.getLogger() class ElementsMeta: __instance = False __element=None @staticmethod def getElements(): if not ElementsMeta.__instance: ElementsMeta.__element=dict() ElementsMeta.__instance=True retu...
ravindrab5/SeleniumPython
utils/FindLocator.py
FindLocator.py
py
2,329
python
en
code
0
github-code
18
[ { "api_name": "utils.LogInitilizer.LogInitilizer.getLogger", "line_number": 2, "usage_type": "call" }, { "api_name": "utils.LogInitilizer.LogInitilizer", "line_number": 2, "usage_type": "name" } ]
25963404311
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from datetime import timezone class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Report', fields=[...
MiiRaGe/miilibrary
mii_interface/migrations/0001_initial.py
0001_initial.py
py
745
python
en
code
0
github-code
18
[ { "api_name": "django.db.migrations.Migration", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 15, "usage_type": "call" }, ...
7661932824
import torch.nn as nn import codebase.utils as ut from codebase.models.nns.BBBLinear import BBBLinear from codebase.models.nns.BBBRNN import BBBRNN from torch.autograd import Variable import torch class BBBTimeSeriesPredModel(nn.Module): """ A time series prediction architecture with configurable input an...
parachutel/bayes-by-backprop
codebase/models/BBBTimeSeriesPredModel.py
BBBTimeSeriesPredModel.py
py
6,312
python
en
code
6
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.MSELoss", "line_number": 52, "usage_type": "call" }, { "api_name": "torch.nn", "line_num...
3853024632
#!/usr/bin/env python import pandas as pd import numpy as np import itertools as it from pathlib import Path from argparse import ArgumentParser from scipy.sparse import csr_matrix, csc_matrix from scipy.sparse.csgraph import maximum_bipartite_matching, min_weight_full_bipartite_matching def select_armor(data, class...
babolins/destiny_armor_ranker
destiny_armor_ranker.py
destiny_armor_ranker.py
py
8,998
python
en
code
2
github-code
18
[ { "api_name": "numpy.arange", "line_number": 41, "usage_type": "call" }, { "api_name": "scipy.sparse.csr_matrix", "line_number": 56, "usage_type": "call" }, { "api_name": "scipy.sparse.csgraph.maximum_bipartite_matching", "line_number": 58, "usage_type": "call" }, { ...
8706680311
""" Perform inference with Convolutional Neural Network to for ParticleID & Energy Regression in CMS-HGCAL @author: Tony Di Pilato """ import itertools import sys import tensorflow as tf import keras from keras.models import Model, load_model from keras.layers import Input, Conv2D, MaxPooling2D, Concatenate, Batc...
tonydp03/ParticleID
inference.py
inference.py
py
6,383
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_pickle", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 58, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 62, "usage_type": "call" }, { "api_name": "keras.utils.to_categorical...
25561749558
import cv2 import numpy as np #import easyocr frameWidth = 640 #Frame Width franeHeight = 480 # Frame Height plateCascade = cv2.CascadeClassifier("pak.xml") minArea = 500 cap =cv2.VideoCapture(0) cap.set(3,frameWidth) # 3 is for width and frameWidth = 640, we can directly put 360 as well in place of frameWidth ...
zubair-source/Sindh_Number_Plate
setup.py
setup.py
py
2,061
python
en
code
0
github-code
18
[ { "api_name": "cv2.CascadeClassifier", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY...
32781844149
# loading necessay libraries import pandas as pd import numpy as np import csv import os import matplotlib.pyplot as plt # definition of working directory os.chdir('R:/Projects/2020081/Navigation/Water_Bottom_Picks_from_QC') # definition of variables (seq & line) seq = input('\n\n\n Enter 3 digit sequence number:') ...
rdallagnolo/repo_nav-tweaks
ready/echo.py
echo.py
py
1,201
python
en
code
0
github-code
18
[ { "api_name": "os.chdir", "line_number": 9, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "li...
70337088360
from webbot import Browser from pynput.keyboard import Key, Controller import time from random import choice import string user = input('Username: ') ## Variáveis de controle web = Browser() keyboard = Controller() values = string.ascii_letters + string.digits ## letras e números size = 8 ### quantidade d...
jcbarbosa20/bruteforce_ig-v.1.0
prj_beta.py
prj_beta.py
py
1,000
python
pt
code
0
github-code
18
[ { "api_name": "webbot.Browser", "line_number": 10, "usage_type": "call" }, { "api_name": "pynput.keyboard.Controller", "line_number": 11, "usage_type": "call" }, { "api_name": "string.ascii_letters", "line_number": 13, "usage_type": "attribute" }, { "api_name": "s...
8444747036
from flask import Flask, request import openai import json import mysql.connector from twilio.rest import Client app = Flask(__name__) @app.route('/') def hello_world(): # put application's code here return 'Hello World!' @app.route('/call', methods=['GET', 'POST']) def call_process(): # get openai auth i...
masoncfrancis/dynamic-chatbot
app.py
app.py
py
4,520
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "openai.api_key", "line_number": 19, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 19, "usage_type": "call" }, { "api_name": "json.load", "line_number...
19892542281
from services.base_service import BaseService from dao.organization_dao import OrganizationDao from dao.user_dao import UserDao import json import traceback class OrganizationService(BaseService): __dao = None def __init__(self, session, params, execution, enforce_session): super(OrganizationService...
Divyang-Soni/User-Authentication-using-blockchain-technology
services/organization_service.py
organization_service.py
py
3,267
python
en
code
4
github-code
18
[ { "api_name": "services.base_service.BaseService", "line_number": 8, "usage_type": "name" }, { "api_name": "dao.organization_dao.OrganizationDao", "line_number": 14, "usage_type": "call" }, { "api_name": "traceback.format_exc", "line_number": 31, "usage_type": "call" },...
34553577585
#!/usr/bin/env python3 import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import normalize, scale df = pd.read_csv('dataset.csv') Y = df['Class'] X = df.drop(['Class'], axis=1) X_train, X_test, y_train, y_test = train_test_split(X, Y, ...
giovannyortegon/TheSecuritySentinel
SEM2/nomelize_stable.py
nomelize_stable.py
py
508
python
en
code
1
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.normalize", "line_number": 16, "usage_type": "call" }, ...
4801141942
import sys import os import requests from datetime import datetime from partialdb import PartialDatabase from acsapi import AcsApi #Set up Django Environment import django sys.path.append(os.getcwd()) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "econosense.settings") django.setup() from data.models import Rent,Ar...
rykroon/econosense
econosense/data/build/acsbuild.py
acsbuild.py
py
3,346
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ.setdefault", "...
21924915378
from datetime import datetime from sqlalchemy import Column, DateTime, Integer from app.config import Base class BaseModel(Base): """ Base class for all models """ __abstract__ = True id = Column(Integer, primary_key=True) created_at = Column(DateTime, nullable=False, default=datetime.now(...
felipevargas-bz/extract-data-from-pdf
app/models/base_model.py
base_model.py
py
519
python
en
code
1
github-code
18
[ { "api_name": "app.config.Base", "line_number": 8, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 15, "usage_type": "argument" }, { "api_name": "sqlalchemy.Co...
35894348831
import simplejson from django.shortcuts import render from itertools import cycle from .utils import pairwise from django.http import HttpResponseRedirect, HttpResponse from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST from users import read_excel from .mod...
Napermial/research_helper_app
users/views.py
views.py
py
4,216
python
en
code
0
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "models.Experiment.objects.filter", "line_number": 21, "usage_type": "call" }, { "api_name": "models.Experiment.objects", "line_number": 21, "usage_type": "attribute" }, ...
23602837761
import os import torch import torchvision import pandas as pd from PIL import Image as pil from PIL import ImageOps as pilops from sklearn import model_selection ROOT_DATAPATH = 'datasets/covidx-cxr2' SUBSET_DATAPATH = 'datasets/covidx-cxr2/subset/' class CXR2Dataset(torch.utils.data.Dataset): def __init__(self,...
peppocola/Screening-COVID19
covidx/cxr2/dataset.py
dataset.py
py
5,154
python
en
code
3
github-code
18
[ { "api_name": "torch.utils", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 23, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 23, "usage_type": "attribute" }, { "api_...
71964798119
#!/usr/bin/python # -*- coding: UTF-8 -*- import os, sys, uuid, features, general import sqlite3 as sqlite from sqlite3 import Error from mimetypes import MimeTypes # Define the default extensions. QT_IMG = [".BMP", ".GIF", ".JPG", ".JPEG", ".PNG", ".PBM", ".PGM", ".PPM", ".XBM", ".XPM"] IMG_EXT = [".JPG", ".TIF",...
yufujimoto/SurveyDataCollector
modules/cleanup.py
cleanup.py
py
5,214
python
en
code
1
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 22, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 37, "usage_type": "call" }, { "api_name": "mimetypes.MimeTypes", "line_number": 48, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line...
27346309011
from __future__ import print_function from __future__ import division from builtins import str from builtins import range from os.path import abspath, basename, dirname, isfile, join as pjoin import os.path import shutil import numpy as np import io from psychopy import logging try: from PIL import Image except Im...
soheilbr82/BluegrassWorkingMemory
Python_Engine/Lib/site-packages/psychopy/tests/utils.py
utils.py
py
10,201
python
en
code
5
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.join", "line...
16397290699
import optparse import sys import os import wx from avnav_gui_design import * AVNAV_VERSION="development" try: from avnav_gui_version import AVNAV_VERSION except: pass import subprocess import re __author__ = 'andreas' class AvnavGui(Avnav): def __init__(self, *args, **kwds): Avnav.__init__(self,...
wellenvogel/avnav
linux/avnav_gui.py
avnav_gui.py
py
7,119
python
en
code
72
github-code
18
[ { "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", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line...
70291613161
#!/usr/bin/env python #! -*- coding: utf-8 -*- """ common functions """ import random import pygame import functools import math #from rom import dungeon CZ = - math.pi / 4 @functools.cache def rotate(r, size, cxy): r0 = r - CZ x = math.cos(r0) * size + math.sin(r0) * size + cxy[0] y = math.sin(r0...
peppermint8/bubba
bubba_lib.py
bubba_lib.py
py
1,734
python
en
code
0
github-code
18
[ { "api_name": "math.pi", "line_number": 14, "usage_type": "attribute" }, { "api_name": "math.cos", "line_number": 21, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 21, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 22, ...
19642025363
#!/usr/bin/env python """The setup script.""" from setuptools import setup, find_packages with open("README.rst") as readme_file: readme = readme_file.read() with open("HISTORY.rst") as history_file: history = history_file.read() def get_requirements(requirements_file="requirements.txt"): """Get the c...
Zlopez/fedora-infra-map
setup.py
setup.py
py
2,613
python
en
code
0
github-code
18
[ { "api_name": "setuptools.setup", "line_number": 47, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 72, "usage_type": "call" } ]
70681339880
""" Set parameters to image a tile """ import time import copy from astropy.coordinates import SkyCoord startRunTime=time.time() prevRunTime = startRunTime def tile_padding(band): """ Padding to add to the tile size for the full image This should be 2 x 0.8 x PB (FWHM) Parameters ---------- ...
annayqho/OTF-Mapping
code/setup_imaging.py
setup_imaging.py
py
6,053
python
en
code
0
github-code
18
[ { "api_name": "time.time", "line_number": 7, "usage_type": "call" }, { "api_name": "astropy.coordinates.SkyCoord", "line_number": 34, "usage_type": "call" }, { "api_name": "time.time", "line_number": 222, "usage_type": "call" } ]
42982321371
import json from .models import * def cookieCart(request): try: cart = json.loads(request.COOKIES['cart']) print("\nFrom cookieCart function. We got our cart started!") except: cart = {} print("From cookieCart function. We didn't get past this point!") print('Cart:', cart) ...
IsidoreDelpierro/ecommerceblog
store/utils.py
utils.py
py
2,874
python
en
code
0
github-code
18
[ { "api_name": "json.loads", "line_number": 6, "usage_type": "call" } ]
35780481302
# 골드 2 import sys from collections import deque from itertools import permutations input = sys.stdin.readline def can_move_to(x, y, z): return 0 <= x < n and 0 <= y < n and 0 <= z < n and cube[x][y][z] == "1" def bfs(x, y, z): visited = [[[0] * n for _ in range(n)] for _ in range(n)] visited[x][y][z] ...
what-the-study/what-the-algorithm
youngjoo/BOJ/DFS_BFS/16985_Maaaaaaaaaze.py
16985_Maaaaaaaaaze.py
py
1,648
python
en
code
0
github-code
18
[ { "api_name": "sys.stdin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 17, "usage_type": "call" }, { "api_name": "itertools.permutations", "line_number": 55, "usage_type": "call" } ]
16203718305
# -*- coding: utf-8 -*- from datetime import datetime from app.baseModel import BaseModel, fields, pydantic_model_creator class Hits(BaseModel): """ 自动化测试触发的问题记录 """ date = fields.CharField(128, default=datetime.now, description="问题触发日期") hit_type = fields.CharField(128, default="", description="问题类型") ...
zhongyehai/test-platform-fastapi-api
app/assist/models/hits.py
hits.py
py
1,656
python
en
code
3
github-code
18
[ { "api_name": "app.baseModel.BaseModel", "line_number": 7, "usage_type": "name" }, { "api_name": "app.baseModel.fields.CharField", "line_number": 10, "usage_type": "call" }, { "api_name": "app.baseModel.fields", "line_number": 10, "usage_type": "name" }, { "api_na...
21333664141
import os import random import hydra import logging import pyrootutils from omegaconf import DictConfig, OmegaConf from pandas import DataFrame from rich.progress import track from src.datamodules.components.dataset_base import DatasetBase import pandas pandas.options.mode.chained_assignment = None root = pyrootutil...
nico-ru/BAnDIT
src/induce_anomalies.py
induce_anomalies.py
py
4,053
python
en
code
1
github-code
18
[ { "api_name": "pandas.options", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pyrootutils.setup_root", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", ...
11889614734
from heapq import heapify class Solution: def max_heapify(self, heap, root, heap_len): p = root while p * 2 + 1 < heap_len: # 找到当前节点的左右孩子节点 l, r = p * 2 + 1, p * 2 + 2 # 找到孩子节点中较大的节点位置 if heap_len <= r or heap[r] < heap[l]: nex = l ...
cwlseu/code2022
basic/heap_sort.py
heap_sort.py
py
2,004
python
en
code
0
github-code
18
[ { "api_name": "collections.heapq.heappushpop", "line_number": 68, "usage_type": "call" }, { "api_name": "collections.heapq", "line_number": 68, "usage_type": "name" } ]
25052613260
import argparse import logging import os, json, math, time, shutil import numpy as np import pathlib2 import tensorflow as tf DEVELOP_MODE = False NBUCKETS = 5 # for embeddings NUM_EXAMPLES = 1000*1000 * 20 # assume 20 million examples DNN_HIDDEN_UNITS = '128,64,32' CSV_COLUMNS = ('duration,end_station_id,bike_id,...
amygdala/code-snippets
ml/kubeflow-pipelines/sbtb/components/kubeflow-resources/bikesw_training/bikes_weather.py
bikes_weather.py
py
9,209
python
en
code
156
github-code
18
[ { "api_name": "tensorflow.distribute.MirroredStrategy", "line_number": 23, "usage_type": "call" }, { "api_name": "tensorflow.distribute", "line_number": 23, "usage_type": "attribute" }, { "api_name": "tensorflow.data.experimental.make_csv_dataset", "line_number": 28, "usa...
70787239401
# attachedLocalSpace # # closestPolygonAndWeights # input: # p a point in world space # mesh a mesh node the p attach to # # return: # the vertex id list of polygon nearest to p # vertex weights with which the point on nearest polygon can be combined. # import pymel.core as pm import p...
bambooshoot/tree
py/test/attachedLocalSpace.py
attachedLocalSpace.py
py
4,234
python
en
code
0
github-code
18
[ { "api_name": "pymel.core.PyNode", "line_number": 39, "usage_type": "call" }, { "api_name": "pymel.core", "line_number": 39, "usage_type": "name" }, { "api_name": "maya.OpenMaya.MMeshIntersector", "line_number": 47, "usage_type": "call" }, { "api_name": "maya.Open...
34918758635
import requests from bs4 import BeautifulSoup import numpy as np import pandas as pd # import time url = r'https://oilprice.com/' # Request r1 = requests.get(url) r1.status_code # We'll save in coverpage the cover page content coverpage = r1.content # Soup creation soup1 = BeautifulSoup(coverpage, 'html5lib') # Th...
boernerr/web-scraper
src/scraper.py
scraper.py
py
820
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 17, "usage_type": "call" } ]
70599409959
#!/usr/bin/env python import sys from dataclasses import replace from enum import IntEnum from parser.parser.exceptions import ( MissingNonTerminalTypes, MissingRootNonTerminalType, ParseError, UnexpectedNonTerminalTypes, ) from parser.parser.models import ( ConcatenationExpression, Conjunction...
lk16/parser
parser/parser/parser.py
parser.py
py
8,714
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 32, "usage_type": "name" }, { "api_name": "parser.tokenizer.tokenizer.Token", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 33, "usage_type": "name" }, { "api_name": "enum.IntEnum...
35288138506
import copy import os import torch class StateCacher(object): def __init__( self, model, optimizer, criterion, memory_cache=True, cache_dir=None, ): # Check if the optimizer is already attached to a scheduler self.optimize...
sajnanshetty/deep-learning
utils/statecacher.py
statecacher.py
py
2,747
python
en
code
0
github-code
18
[ { "api_name": "tempfile.gettempdir", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "copy.deepcopy", "l...
10014695596
#!/bin/python3 import argparse import shutil import os PATH_BACKEND = "/home/exploit/backend/" vuln_manager_src = 'vuln_manager_samples/%s.xml' vuln_manager_dst = PATH_BACKEND + 'vulnerability_manager/nvd_db/nvdcve-2.0-Demo.xml' rss_server_src = 'rss_server/entries_rss/%s.xml' rss_server_dst = 'rss_server/enabled_e...
vigilate/tools
simulate.py
simulate.py
py
917
python
en
code
0
github-code
18
[ { "api_name": "os.path.isdir", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 20, "usage_type": "call" }, { "api_name": "shutil.copy", "line_number...
36925737951
import logging import os from flask import Flask, render_template, redirect, url_for, request, send_from_directory import settings from instacard import lobadapter from instacard.instagramadapter import InstagramAdapter from instacard.repo import TinyRepo logger = logging.getLogger(__name__) def create_app(): ...
eruvanos/instacard
instacard/__init__.py
__init__.py
py
3,464
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "instacard.instagramadapter.InstagramAdapter", "line_number": 17, "usage_type": "call" }, { "api_nam...
11996367312
import os import sys import json data = dict() data["node"] = dict() data["link"] = dict() def loadDataDirectory(dirPath): ''' Given the directory path to where the network tree is stored, this will traverse through the directory and grab all of the geojson files. ''' for dirName, subDir,...
ucd-cws/calvin-network-editor
parser/data2pri.py
data2pri.py
py
10,292
python
en
code
0
github-code
18
[ { "api_name": "os.walk", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 34, ...
25809740581
# ele usou reflect pra comparar com imageJ import numpy as np from numpy import asarray from PIL import Image from scipy import ndimage # Funções de abrir a imagem do ImageJ def openImageJ(path_image): image_in = Image.open(path_image) image_np = np.array(image_in) print('Imagem filtrada no ImageJ') ...
Nathalia-Urenha/Processamento-de-Imagens
Projeto 5/script/filtragem_espacial_convolucao.py
filtragem_espacial_convolucao.py
py
6,546
python
pt
code
1
github-code
18
[ { "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": "numpy.array", "line_number":...
29713630151
#!/usr/bin/python3 # from os import SCHED_OTHER from enum import Enum, auto from re import X from which_pyqt import PYQT_VER if PYQT_VER == 'PYQT5': from PyQt5.QtCore import QLineF, QPointF elif PYQT_VER == 'PYQT4': from PyQt4.QtCore import QLineF, QPointF else: raise Exception('Unsupported Version of PyQt: {}'.for...
jennanatkinson/cs312-proj4-gene-sequencing
GeneSequencing.py
GeneSequencing.py
py
6,599
python
en
code
0
github-code
18
[ { "api_name": "which_pyqt.PYQT_VER", "line_number": 7, "usage_type": "name" }, { "api_name": "which_pyqt.PYQT_VER", "line_number": 9, "usage_type": "name" }, { "api_name": "which_pyqt.PYQT_VER", "line_number": 12, "usage_type": "argument" }, { "api_name": "enum.En...
38407855413
import discord from discord.ext import commands from discord import Embed import pandas as pd class BlackMarket(commands.Cog): fruits = [ {"emoji": "🍎", "name": "Garden Fruit"}, {"emoji": "🍏", "name": "Hero Fruit"}, {"emoji": "🍊", "name": "Dark Fruit"}, {"emoji": "🍋", "name": "R...
nickshouse/Chao-Bot
src/cogs/black_market.py
black_market.py
py
5,903
python
en
code
0
github-code
18
[ { "api_name": "discord.ext.commands.Cog", "line_number": 6, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 6, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 81, "usage_type": "call" }, { "api_name": "dis...
6407394832
import setuptools from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() setuptools.setup( name='amazonstoreprice', packages=['amazonstoreprice'], package_dir={'amazonestoreprice': ...
Mirio/amazonstoreprice
setup.py
setup.py
py
1,105
python
en
code
1
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
6645152999
import logging import time from ctypes import * from functools import wraps r_log = logging.getLogger() logging.basicConfig(level=logging.INFO) def decorate_time(func): @wraps(func) def wrapper(*argv, **kwargv): start_t = time.clock() res_val = func(*argv, **kwargv) end_t = time.clock...
Achillesxu/leet_code_some
algorithm_files/leetcode1.py
leetcode1.py
py
109,923
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 7, "usage_type": "attribute" }, { "api_name": "time.clock", ...
10065447727
""" SATOSA microservice that uses an identifier asserted by the home organization SAML IdP as a key to search an LDAP directory for a record and then consume attributes from the record and assert them to the receiving SP. """ import satosa.micro_services.base from satosa.logging_util import satosa_logging import cop...
MESH-Research/SATOSA
src/satosa/micro_services/ldap_attribute_store.py
ldap_attribute_store.py
py
12,941
python
en
code
null
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "satosa.micro_services.base.micro_services", "line_number": 17, "usage_type": "attribute" }, { "api_name": "satosa.micro_services.base", "line_number": 17, "usage_type": "name" }...
71812779240
from operator import itemgetter from itertools import groupby # 필드별로 레코드 묶기 rows = [ {'address': '5412 N CLARK', 'date': '07/01/2012'}, {'address': '5148 N CLARK', 'date': '07/04/2012'}, {'address': '5800 E 58TH', 'date': '07/02/2012'}, {'address': '2122 N CLARK', 'date': '07/03/2012'}, {'address'...
Ma-rk/python-cookbook-3rd
01_DataStructuresAndAlgorithms/15_GroupingRecordsTogetherBasedOnField.py
15_GroupingRecordsTogetherBasedOnField.py
py
1,229
python
ko
code
1
github-code
18
[ { "api_name": "operator.itemgetter", "line_number": 18, "usage_type": "call" }, { "api_name": "itertools.groupby", "line_number": 22, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 22, "usage_type": "call" }, { "api_name": "collections...
29283348413
import multiprocessing import time class ClockProcess(multiprocessing.Process): ''' 两个函数比较重要 1.init 2.run ''' def __init__(self,interval): super().__init__() self.interval=interval def run(self): while True: print('the time is %s'%time.ctime()) ...
zhouzhou0/python_zhou
多线程/20.py
20.py
py
496
python
en
code
0
github-code
18
[ { "api_name": "multiprocessing.Process", "line_number": 4, "usage_type": "attribute" }, { "api_name": "time.ctime", "line_number": 16, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 17, "usage_type": "call" }, { "api_name": "time.sleep", "l...
22871623223
from dadata import Dadata import sqlite3 def save_users_data(name, token, language): with sqlite3.connect("database.db") as sqlite_connection: cursor_db = sqlite_connection.cursor() cursor_db.execute("""CREATE TABLE IF NOT EXISTS users ( id INTEGER PRIMARY KEY AUTOINCRE...
misha2212/test_task
task.py
task.py
py
2,403
python
ru
code
0
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "dadata.Dadata", "line_number": 24, "usage_type": "call" }, { "api_name": "dadata.suggest", "line_number": 26, "usage_type": "call" } ]
25217628622
# https://leetcode.com/problems/design-in-memory-file-system/ # tags: #google, #trie # # TrieNode Implementation. # Time Complexity: # * ls: O(l + k*log(k)) l=path length / k=number of entries in the current directory # * mkdir: O(l) # * addContentToFile: O(l + c) c=new content length # * readContentFromFile: O(l) # Sp...
ronelzb/leetcode
trie/0588_design_in_memory_file_system.py
0588_design_in_memory_file_system.py
py
2,536
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 83, "usage_type": "name" } ]
28721036120
from sys import argv, stdin import os.path from bilinear import BilinearMap, Key import base64 def b64(b): return base64.b64encode(b).decode('utf-8') from Crypto.PublicKey import RSA from Crypto.Random import get_random_bytes from Crypto.Cipher import AES, PKCS1_OAEP d = argv[1] with open(os.path.join(d, "kw")...
Praz314159/Public-Key-Encryption-with-Keyword-Search
router/encrypt.py
encrypt.py
py
1,061
python
en
code
7
github-code
18
[ { "api_name": "base64.b64encode", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "name" }, { "api_name": "os.path.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.path", "line_n...
71427120040
import matplotlib.pyplot as plt import matplotlib.image as mpimg plt.rcParams['font.size'] = 8 plt.rcParams['figure.figsize'] = (8,8) import os import numpy as np import cv2 import pickle from keras.models import Sequential, load_model from keras.layers import Dense, Conv2D, MaxPooling2D, UpSampling2D...
aorursy/new-nb-3
hengzheng_simple-autoencoder-keras-and-kmean-cluster.py
hengzheng_simple-autoencoder-keras-and-kmean-cluster.py
py
4,880
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 10, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 12, "usage_type": "attribute" }, { ...
25136067820
from django.urls import path from .views import CategoryViewSet, CategoryItemViewSet,ApiItemListView urlpatterns = [ path('list', ApiItemListView.as_view()), path('category', CategoryViewSet.as_view({ 'get': 'list' })), path('category-item', CategoryItemViewSet.as_view({ 'get': 'list'})), path('categ...
bista-gomogycojp/demo
OOnavi_Django-Vue/backend/categorybox/urls.py
urls.py
py
409
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "views.ApiItemListView.as_view", "line_number": 6, "usage_type": "call" }, { "api_name": "views.ApiItemListView", "line_number": 6, "usage_type": "name" }, { "api_name": "dja...
29223821408
import http.server import socketserver import webbrowser import threading # Define the handler to use for incoming requests handler = http.server.SimpleHTTPRequestHandler # Set the directory containing your index.html file handler.directory = "UI" # Define the port to listen on port = 8080 # Function to start the s...
3V1LXD/ROT
src/ROTUI.py
ROTUI.py
py
772
python
en
code
0
github-code
18
[ { "api_name": "http.server.server", "line_number": 7, "usage_type": "attribute" }, { "api_name": "http.server", "line_number": 7, "usage_type": "name" }, { "api_name": "socketserver.TCPServer", "line_number": 19, "usage_type": "call" }, { "api_name": "threading.Th...
73191826280
import MySQLdb db = MySQLdb.connect( host="mysql3.cs.stonybrook.edu", port=3306, user="dolphins", passwd="solongandthanks", db="dolphins" ) cursor = db.cursor() query = "SELECT ID FROM Districtings WHERE jobID = 259" cursor.execute(query) rows = cursor.fetchall() districtingIds = [t[0] for t in rows] district...
Dolphin-Party/districting-analyzer
district_precinct_ids.py
district_precinct_ids.py
py
869
python
en
code
2
github-code
18
[ { "api_name": "MySQLdb.connect", "line_number": 3, "usage_type": "call" } ]
11926731357
"""update Revision ID: 4e185fc8c651 Revises: 2d37229f23db Create Date: 2020-08-22 15:25:14.511265 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '4e185fc8c651' down_revision = '2d37229f23db' branch_labels = None depends_on = None def upgrade(): # ### com...
pbaesse/dados-livres
migrations/versions/4e185fc8c651_update.py
4e185fc8c651_update.py
py
1,394
python
en
code
7
github-code
18
[ { "api_name": "alembic.op.batch_alter_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy....
32463732731
import logging import requests from celery import shared_task from .utils.abstractScraper import AbstractScraper from .utils.saveScraper import SaveApartment from olxSearch.models import SearchingSettings, Category, City from django.db.models import Max from django.conf import settings from django.core.mail imp...
MrMario108/RealEstateSearch
RealEstateSearch/scrapingApp/tasks.py
tasks.py
py
6,604
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.auth.get_user_model", "line_number": 19, "usage_type": "call" }, { "api_name": "django.core.mail.send_mail", "line_number": 24, "usage_type": "call" }, { "a...
73519351401
import operator import random from collections import defaultdict import numpy as np from app.exceptions import WrongClustersNumberError class KMeans: def __init__(self, n_clusters: int, max_iterations: int): """ :param n_clusters: number of clusters :param max_iterations: iterations nu...
costefan/clustering-app
app/clustering/kmeans.py
kmeans.py
py
2,508
python
en
code
0
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 38, "usage_type": "attribute" }, { "api_name": "numpy.arr...
73656641320
#!/usr/bin/env python3 """ 协议格式为 TCP_CRC32: TCP header,4 bytes TCP_PAYLOAD_LEN:2 bytes UDP OR TCP PUBLIC BODY pad_length:1byte //加密的填充长度 user_id:16 bytes //用户key """ import sys, hashlib, struct, zlib TCP_HEADER_SIZE = 6 try: from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cry...
fdslight/fdslight
freenet/lib/racs.py
racs.py
py
3,177
python
en
code
139
github-code
18
[ { "api_name": "sys.exit", "line_number": 19, "usage_type": "call" }, { "api_name": "cryptography.hazmat.primitives.ciphers.Cipher", "line_number": 23, "usage_type": "call" }, { "api_name": "cryptography.hazmat.primitives.ciphers.algorithms.AES", "line_number": 23, "usage_...
18447014216
import matplotlib.pyplot as plt import numpy as np def plot_1_a(n: int, r_array: np.ndarray): iters = np.arange(1,r_array.size + 1) plt.plot(iters, r_array) plt.title(r'$\log_{10} ||r_k||$ for n = ' + str(n)) plt.xlabel("Iterations") plt.ylabel("$\log_{10} ||r_k||$") filename = "scg_1_a_n" + st...
PJ6451/Optimization_HW
hw_3/plots.py
plots.py
py
2,599
python
en
code
0
github-code
18
[ { "api_name": "numpy.ndarray", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
26430781051
import torch import torch.nn as nn from pretrain import BertPreTrain from finetune import BertClassification class Trainer(object): def __init__(self, bert_model): self.bert_model = bert_model def pre_train(self, iterator, do_train, num_train_epochs=3, learning_rate=1e-5): print("***** Pre-tr...
Ginga1892/bert-x
trainer.py
trainer.py
py
3,142
python
en
code
0
github-code
18
[ { "api_name": "pretrain.BertPreTrain", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.optim", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn.Cros...
74941871079
import discord #imports the discord file, basically telling replit IMPORT EVERYTHING DISCORD RELATED import os import requests import json import random from replit import db from keep_alive import keep_alive from discord.ext import commands from discord.ext import tasks from random import choice client = commands.Bot...
LinkTheSinger/DiscordAIBot
main.py
main.py
py
7,607
python
en
code
0
github-code
18
[ { "api_name": "discord.ext.commands.Bot", "line_number": 13, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 13, "usage_type": "name" }, { "api_name": "discord.Game", "line_number": 34, "usage_type": "call" }, { "api_name": "random.cho...
35447319328
import moviepy.editor from tkinter.filedialog import * from k2 import speak def vd_2_au(): speak("Ok Sir! Please select the video") vid = askopenfilename() video = moviepy.editor.VideoFileClip(vid) speak("Converting in process. Please wait Sir") audio = video.audio audio.wri...
MrfoxAK/K2-AI
Vd_2_audio.py
Vd_2_audio.py
py
484
python
en
code
1
github-code
18
[ { "api_name": "k2.speak", "line_number": 6, "usage_type": "call" }, { "api_name": "moviepy.editor.editor.VideoFileClip", "line_number": 9, "usage_type": "call" }, { "api_name": "moviepy.editor.editor", "line_number": 9, "usage_type": "attribute" }, { "api_name": "...
17159884260
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import time import keyboard class InstagramCrawler: def __init__(self, driver, max_level, max_step,call_back): s...
jx06T/Self-introduction-annotation-relationship-diagram_instagram_PY
reptile.py
reptile.py
py
5,604
python
en
code
0
github-code
18
[ { "api_name": "keyboard.is_pressed", "line_number": 36, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 46, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.expected_conditions.presence_of_element_located", ...
32305665731
import threading import time from django.core.management.base import BaseCommand, CommandError from django.core.mail import send_mass_mail from django.contrib.auth import get_user_model from django.conf import settings User = get_user_model() class Command(BaseCommand): ''' 为bucket对应的表,清理满足彻底删除条件...
25280841/iharbor
apps/users/management/commands/email_notice.py
email_notice.py
py
4,659
python
en
code
null
github-code
18
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 9, "usage_type": "call" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 11, "usage_type": "name" }, { "api_name": "threading.Semaphore", "line_number": 15, "usage_type": "call" ...
1574376743
import schnetpack as spk import torch.nn as nn from schnetpack.nn.base import Dense from schnetpack.nn.blocks import MLP from schnetpack.nn.cfconv import CFConv from schnetpack.representation import SchNet, SchNetInteraction from schnetpack.nn.activations import shifted_softplus from schnetpack.atomistic.output_modules...
OMalenfantThuot/scripts_raman
utils/models/dropout_schnet.py
dropout_schnet.py
py
5,386
python
en
code
1
github-code
18
[ { "api_name": "schnetpack.representation.SchNet", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.ModuleList", "line_number": 30, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 30, "usage_type": "name" }, { "api_name": "schnetp...
12216374514
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('project', '0028_remove_project_amount_repaid'), ] operations = [ migrations.AddField( model_name='project', ...
calblueprint/revolv
revolv/project/migrations/0029_project_tagline.py
0029_project_tagline.py
py
557
python
en
code
29
github-code
18
[ { "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.AddField", "line_number": 14, "usage_type": "call" }, { ...
30340445881
import sys from collections import defaultdict #dont do networkx or numpy!!! #take input from CL inFile = sys.argv[1] input = open(inFile,'r').read().splitlines() ## Get 1st line numBoxes = int(input[0]) print('Number of Boxes:', numBoxes) #get boxes into correct format (list of lists of ints) boxes = input[1:] print...
bradjbailey/513-hw6
boxes.py
boxes.py
py
1,909
python
en
code
0
github-code
18
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 41, "usage_type": "call" } ]
32224895790
from greenev import Server import greenlet class MyServer(Server): def handler(self, request, fileno): g=greenlet.getcurrent() g.parent.switch("Info: ") self.sleep(2, fileno, g) return request if __name__ == "__main__": ser=MyServer(8080) ser.start(timeout=3)
KomaBeyond/greenev
sample.py
sample.py
py
306
python
en
code
0
github-code
18
[ { "api_name": "greenev.Server", "line_number": 4, "usage_type": "name" }, { "api_name": "greenlet.getcurrent", "line_number": 6, "usage_type": "call" } ]
2483448698
from pymongo import MongoClient import dns from bson.objectid import ObjectId def connect_db(): try: client = MongoClient() client = MongoClient( 'mongodb+srv://admin:admin@cluster0.ekv0t.mongodb.net/Resume-parser?retryWrites=true&w=majority') return client except ValueErro...
Code-with-ease/Smart-Talent-Resume-Ranker
database_functionalities.py
database_functionalities.py
py
4,688
python
en
code
3
github-code
18
[ { "api_name": "pymongo.MongoClient", "line_number": 8, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 9, "usage_type": "call" }, { "api_name": "bson.objectid.ObjectId", "line_number": 24, "usage_type": "call" }, { "api_name": "bson.obj...
42839100308
import matplotlib.pyplot as plt import numpy as np import pandas as pd df = pd.read_csv (r'simulation_result.csv') states = df.to_numpy() time = states[:,0] u = states[:,1] v = states[:,2] w = states[:,3] p = states[:,4] q = states[:,5] r = states[:,6] e0 = states[:,7] e1 = states[:,8] e2 = states[:,9] e3 = states[:...
parthp08/UAVFlightSimulator
plots.py
plots.py
py
3,426
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 35, "usage_type": "name" }, { "api_name": "matplotlib....
70628691881
from pages.login_page import LoginPage from technical import locators from technical.user_model import User def test_case_5_register_existing_email(get_main_page): main_page = get_main_page # Verify that home page is visible successfully assert main_page.check_el_visibility(locators.Main.main_slider_loc...
MichalGryszowka/automation_exercise_automated_tests
tests/test_case_5_register_existing_email.py
test_case_5_register_existing_email.py
py
901
python
en
code
0
github-code
18
[ { "api_name": "technical.locators.Main", "line_number": 11, "usage_type": "attribute" }, { "api_name": "technical.locators", "line_number": 11, "usage_type": "name" }, { "api_name": "pages.login_page.LoginPage", "line_number": 13, "usage_type": "argument" }, { "ap...
14493047852
# -*- coding: utf-8 -*- import numpy as np from scipy.stats import norm import matplotlib.pyplot as plt from astropy.io import fits from astropy.constants import c import astropy.wcs as fitswcs import astropy.units as u from astropy.modeling import models from astropy.table import Table from box import Box from spec...
miguelverdugo/pyFADO
pyfado/pyfado.py
pyfado.py
py
27,167
python
en
code
2
github-code
18
[ { "api_name": "astropy.units.AA", "line_number": 58, "usage_type": "attribute" }, { "api_name": "astropy.units", "line_number": 58, "usage_type": "name" }, { "api_name": "astropy.units.Unit", "line_number": 60, "usage_type": "call" }, { "api_name": "astropy.units"...
43628139355
from utils.parse import Parser from aoc.intcode import Machine from copy import deepcopy from enum import Enum class Pixel(Enum): SPACE = 0 SCAFFOLD = 1 class Camera: def __init__(self, program): self.__cpu = Machine(program, lambda: None, self.__get_pixel) self.__image = {} self...
tranzystorek-io/aoc2019-python
days/d17p1.py
d17p1.py
py
1,894
python
en
code
1
github-code
18
[ { "api_name": "enum.Enum", "line_number": 7, "usage_type": "name" }, { "api_name": "aoc.intcode.Machine", "line_number": 14, "usage_type": "call" }, { "api_name": "utils.parse.Parser", "line_number": 47, "usage_type": "call" }, { "api_name": "copy.deepcopy", "...
18016329243
import uuid import pytest from fakeredis.aioredis import FakeRedis from fastapi import FastAPI from httpx import AsyncClient from starlette import status @pytest.mark.anyio async def test_setting_value( fastapi_app: FastAPI, fake_redis: FakeRedis, client: AsyncClient, ) -> None: """ Tests that yo...
jamesvweston/fastapi_demo
asdf/tests/test_redis.py
test_redis.py
py
2,022
python
en
code
0
github-code
18
[ { "api_name": "fastapi.FastAPI", "line_number": 12, "usage_type": "name" }, { "api_name": "fakeredis.aioredis.FakeRedis", "line_number": 13, "usage_type": "name" }, { "api_name": "httpx.AsyncClient", "line_number": 14, "usage_type": "name" }, { "api_name": "uuid.u...
14173188115
import json import os import re import base64 from pathlib import Path scriptLocation = os.path.dirname(os.path.realpath(__file__)) TUTORIAL_JSON_FILES = [Path(scriptLocation) / 'archery' / 'archery.vue.json'] indexTemplate = open(Path(scriptLocation) / 'assets' / 'tutorial.html').read() bulmaCss = open(Path(scriptL...
asweigart/scratch_animated_gif_tutorials
generateVueTutorials.py
generateVueTutorials.py
py
2,655
python
en
code
2
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_n...
73631593639
# coding=utf-8 # import unittest2 from risk_report.asset import getAssetType, getAverageRatingScore, isInvestmentGrade from risk_report.main import ratingsApplicable from risk_report.data import getIdnType, getPortfolioPositions, getBlpData from itertools import filterfalse from functools import partial from utils.it...
ZhangSteven/risk_report
test/test_asset.py
test_asset.py
py
3,622
python
en
code
0
github-code
18
[ { "api_name": "unittest2.TestCase", "line_number": 16, "usage_type": "attribute" }, { "api_name": "risk_report.data.getPortfolioPositions", "line_number": 24, "usage_type": "call" }, { "api_name": "risk_report.data.getBlpData", "line_number": 25, "usage_type": "call" },...
2217784226
from racetrack import Racetrack import pygame import sys import argparse import time import LAO_search import BLAO_search import pygame.locals class Application: def __init__(self, filename: str, scale=20, fps=30): self.running = True self.displaySurface = None self.scale = scale ...
tinamil/bidirectional-mdp
main.py
main.py
py
6,544
python
en
code
0
github-code
18
[ { "api_name": "racetrack.Racetrack", "line_number": 21, "usage_type": "call" }, { "api_name": "BLAO_search.search", "line_number": 34, "usage_type": "call" }, { "api_name": "LAO_search.search", "line_number": 36, "usage_type": "call" }, { "api_name": "pygame.init"...
6213558716
from pathlib import Path from tkinter import Tk, Canvas, Entry, Text, Button, PhotoImage, ttk, END, messagebox from tkcalendar import DateEntry import tkinter.font as tkFont import staff, checkin, checkout, shift from tkinter.messagebox import askyesno import openpyxl class Schedule(ttk.Frame): def __init__(self...
Nolb226/Python-Project
python/build/schedule.py
schedule.py
py
13,447
python
en
code
0
github-code
18
[ { "api_name": "tkinter.ttk.Frame", "line_number": 11, "usage_type": "attribute" }, { "api_name": "tkinter.ttk", "line_number": 11, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "call" }, { "api_name": "pathlib.Path", "l...
6253704275
import requests import json import pytest url = 'https://petstore.swagger.io/v2/user' def base(**kwargs): with open(str(kwargs['json_file'])) as f: user = json.load(f)[str(kwargs['user'])] obj_post = requests.post(url, json=user) assert obj_post.status_code == int(kwargs['post_status']),...
octoEzh/tests
test_post.py
test_post.py
py
2,857
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" } ]
30677911764
import numpy as np import cv2 import imutils image= cv2.imread("/Users/sam/All-Program/App-DataSet/Image-Processing/sam.jpg") cv2.imshow("Original_image", image) cv2.waitKey(0) ## Our Image is too large, hence we first shorten it using resizing resized=imutils.resize(image, height=500) # Passing the new height of...
Sardhendu/Image-Processing-Tools
Basic-operations/10_masking.py
10_masking.py
py
1,974
python
en
code
1
github-code
18
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 8, "usage_type": "call" }, { "api_name": "imutils.resize", "line_number": 13...
17566071488
# Stdlib imports # Core Django imports from crispy_forms.bootstrap import Field, FieldWithButtons, StrictButton from crispy_forms.layout import ( HTML, Button, ButtonHolder, Column, Hidden, Layout, Row, Submit, ) from django import forms from django.contrib.gis.geos import Point as geoPo...
julienpaul/django-weathervis
src/stations/forms.py
forms.py
py
12,089
python
en
code
0
github-code
18
[ { "api_name": "src.utils.mixins.CrispyMixin", "line_number": 32, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 32, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 32, "usage_type": "name" }, { "api_name": ...
69852317159
import cv2 import numpy as np import os import sys import tensorflow as tf import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split EPOCHS = 10 IMG_WIDTH = 30 IMG_HEIGHT = 30 NUM_CATEGORIES = 43 TEST_SIZE = 0.4 def main(): # Check command-line arguments if len(sys.argv) not in [...
divypandya/CS-50-AI-Projects
5_NeuralNetworks/Traffic/traffic.py
traffic.py
py
3,663
python
en
code
0
github-code
18
[ { "api_name": "sys.argv", "line_number": 20, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 25, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.utils.to_catego...
25963662551
import os import mock from django.test import TestCase from django.test import override_settings from pyfakefs.fake_filesystem_unittest import TestCase as FSTestCase from mii_common import tools from mii_indexer.factories import MovieRelationFactory, MovieTaggingFactory from mii_interface.factories import ReportFact...
MiiRaGe/miilibrary
tests/test_interface.py
test_interface.py
py
9,526
python
en
code
0
github-code
18
[ { "api_name": "django.test.TestCase", "line_number": 19, "usage_type": "name" }, { "api_name": "mii_indexer.factories.MovieTaggingFactory.create_batch", "line_number": 22, "usage_type": "call" }, { "api_name": "mii_indexer.factories.MovieTaggingFactory", "line_number": 22, ...