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
70160489332
import numpy as np import cv2 import cv2.aruco as aruco aruco_dict = aruco.getPredefinedDictionary(aruco.DICT_4X4_250) cap = cv2.VideoCapture(1 ,cv2.CAP_DSHOW ) print(cap.get(cv2.CAP_PROP_FRAME_WIDTH),cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) width = 1920 height = 1080 cap.set(cv2.CAP_PROP_FRAME_WIDTH,wid...
akshatnagar50/Vision-Based-Drone-Controller
miscll/aruconew.py
aruconew.py
py
2,372
python
en
code
1
github-code
21
[ { "api_name": "cv2.aruco.getPredefinedDictionary", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.aruco", "line_number": 5, "usage_type": "name" }, { "api_name": "cv2.aruco.DICT_4X4_250", "line_number": 5, "usage_type": "attribute" }, { "api_name": "...
24239641420
import pytest from business.s3 import S3 from schema.s3 import BucketImageNameSchema file = {'file': open("./test/locate_thanos.jpeg", "rb")} user_guid = "test" path_name_location = "location" image_name_download = BucketImageNameSchema(image_name="locate_thanos.jpeg") class Image(object): file = open("./test/lo...
andrequeiroz2/boto3s3
src/test/test_s3.py
test_s3.py
py
1,405
python
en
code
0
github-code
21
[ { "api_name": "schema.s3.BucketImageNameSchema", "line_number": 8, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pytest.fixture", "line_number": 21, "usage_type": "attribute" }, { "api_name":...
32611370653
from Manga import Manga import argparse # parse range to list def parseRange(strRange): newRange = [] for r in strRange.split(','): if (not '-' in r): newRange.append(int(r)) else: rs = r.split('-') newRange.extend(list(range(int(rs[0]), int(rs[1])+1))) ...
Isaac-the-Man/MangaRock-dl
Main.py
Main.py
py
1,410
python
en
code
1
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "Manga.Manga", "line_number": 33, "usage_type": "call" } ]
33532798047
import requests from bs4 import BeautifulSoup import re def getevents(): r = requests.get('http://google.com/search?q=calls%20for%20proposals') soup = BeautifulSoup(r.content, 'html.parser') # print(soup) s = soup.find_all('a') # url=s.find_all('a') # print(url) data_list = [] url={} cnt=...
RahulPanwar1/Call-for-proposals-website
crawling links/tempCodeRunnerFile.py
tempCodeRunnerFile.py
py
1,095
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" }, { "api_name": "fastapi.FastAPI", "line_number": 33, "usage_type": "call" }, { "api_name": "fastapi.middleware.cors....
19784638441
''' 4. 计算准确率和召回率 ''' from sklearn.metrics import accuracy_score, recall_score def calculate_metrics(y_true, y_pred): accuracy = accuracy_score(y_true, y_pred) recall = recall_score(y_true, y_pred) return accuracy, recall if __name__ == "__main__": # 1. 根据区域点的数量生成这样的list,脏区域为全1 y_true = [0,...
john0819/Solar_panel_detection
Classification_get_data/Calculate_metrics.py
Calculate_metrics.py
py
752
python
en
code
0
github-code
21
[ { "api_name": "sklearn.metrics.accuracy_score", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.metrics.recall_score", "line_number": 11, "usage_type": "call" } ]
17276589959
#Fases necesarias para guardar información en archivos externos #creación, apertura, manipulación, cierre #=================== escritura =========================== #Accedemos a la libreria IO from io import open #dos parámetros, la ruta y que queremos hacer, lectura, escritura append #CREACIÓN-APERTURA archivoText...
Irissf/Archivos_Externos_Python
TextoPlano.py
TextoPlano.py
py
1,202
python
es
code
0
github-code
21
[ { "api_name": "io.open", "line_number": 11, "usage_type": "call" }, { "api_name": "io.open", "line_number": 22, "usage_type": "call" }, { "api_name": "io.open", "line_number": 34, "usage_type": "call" } ]
39685922701
from sklearn.decomposition.pca import PCA import numpy as np import pandas as pd prices = pd.read_csv("close_prices.csv") X = prices.loc[:, "AXP":] est = PCA(n_components=10) est.fit(X) total = 0.0 for num, val in enumerate(est.explained_variance_ratio_): total += val if total >= 0.9: with open("1", "...
GMKornilov/coursera-hse-ml
week_4/pca/pca.py
pca.py
py
719
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.decomposition.pca.PCA", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.r...
2845261731
from django.shortcuts import get_list_or_404, render from rest_framework.views import APIView from Gail_Backend import serializers from Gail_Backend.serializers import MotorSerializer from .models import Motor, Current, Voltage from rest_framework.response import Response from rest_framework import status # Create yo...
parthn2/GailBackend
Gail_Backend/views.py
views.py
py
1,608
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.views.APIView", "line_number": 11, "usage_type": "name" }, { "api_name": "models.Motor.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Motor.objects", "line_number": 14, "usage_type": "attribute" }, { "a...
36379291305
#Importing necessary libraries import string, pandas as pd, numpy as np from nltk.tokenize import sent_tokenize from imblearn.under_sampling import NearMiss from sklearn.metrics import confusion_matrix, accuracy_score, precision_score, recall_score from sklearn.metrics import ConfusionMatrixDisplay from sklearn.metrics...
Surya-Narayan/fake-reviews-detection
CODE/FeatureEngineering.py
FeatureEngineering.py
py
12,597
python
en
code
1
github-code
21
[ { "api_name": "wordcloud.WordCloud", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplo...
9660293338
import torch import torch.optim as optim import torch.nn as nn from model_new import CapGenerator from dataLoader import ImageCaptionSet, build_dictionary,get_loader, prepare_entry from torch.autograd import Variable import sys import numpy as np import os import pickle import shutil from torch.nn.utils.rnn import pack...
weixishuo/image-caption
train_new.py
train_new.py
py
8,138
python
en
code
0
github-code
21
[ { "api_name": "torch.manual_seed", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.cuda.manual_seed", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.exis...
22498619617
import os import sys import time from signal import SIGTERM, SIGKILL import errno import argparse import logging import signal from config.files import PID_FILE, LOG_FILE from config.config import FRONTEND from core.core import Core from core.libs.logger import Logger from gui import getPyHtmlGuiInstance class Daemon(...
perfect-privacy/vpn-client
launcher/services/linux_daemon.py
linux_daemon.py
py
8,163
python
en
code
10
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "signal.signal", "line_number": 21, "usage_type": "call" }, { "api_name": "signal.SIGTERM", "line_number": 21, "usage_type": "attribute" }, { "api_name": "signal.signal", ...
9114309415
import pandas as pd import argparse parser = argparse.ArgumentParser() parser.add_argument("--dir", help="the directory where raw files are stored", type=str, default='.') args = parser.parse_args() dir = args.dir barra_df = pd.read_csv("%s/barra_df.csv" % (dir), header=0, sep='|', dtype={'gvkey': str}, parse_dates=[0]...
timothyyu/ml_monorepo
statarb/show_raw.py
show_raw.py
py
684
python
en
code
59
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 3, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv"...
11530055939
# Name: Tessa Pham # File: PCA.py # Implements the PCA method to analyze and compare texts. # process the Brown corpus # calculate the frequencies of the function words import nltk from nltk.corpus import * # import pandas as pd import numpy as np from numpy import array, mean, cov from numpy.linalg import eig, svd ...
tessapham/PCA-python
PCA.py
PCA.py
py
3,356
python
en
code
0
github-code
21
[ { "api_name": "nltk.FreqDist", "line_number": 23, "usage_type": "call" }, { "api_name": "nltk.DefaultTagger", "line_number": 27, "usage_type": "call" }, { "api_name": "nltk.UnigramTagger", "line_number": 30, "usage_type": "call" }, { "api_name": "nltk.BigramTagger...
10604658365
import statistics from typing import Tuple, List import numpy as np import gym import time import tensorflow as tf import collections import tqdm from a2c import Actor, Critic class LunarLanderAI(object): def __init__(self): """initialize a LunarLanderAI to train with the a2c method.""" self._env...
Pirner/small_rl_projects
projects/beginner/lunar_lander/learning.py
learning.py
py
7,849
python
en
code
0
github-code
21
[ { "api_name": "gym.make", "line_number": 16, "usage_type": "call" }, { "api_name": "a2c.Actor", "line_number": 17, "usage_type": "call" }, { "api_name": "a2c.Critic", "line_number": 18, "usage_type": "call" }, { "api_name": "tensorflow.keras.losses.Huber", "li...
37596763792
import torch.nn as nn import torch.nn.functional as F import torch from .dgcnn_agent import DGCNNAgent, DGCNNAgent_logits class SACAgent(nn.Module): def __init__(self, input_shape, args): super(SACAgent, self).__init__() self.args = args self.device = args.device self.n_agents = arg...
sputnik524/3DV_2023
src/modules/agents/rlsac_agent.py
rlsac_agent.py
py
3,873
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.ModuleList", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
1907175421
import numpy as np import cv2 from matplotlib import pyplot as plt img = cv2.imread(r'c:\temp\batata.png',cv2.IMREAD_COLOR) height, width, chans = img.shape sw=width/4 sh=height/4 ew=sw*3 eh=sh*3 cv2.rectangle(img, (int(sw),int(sh)), (int(ew),int(eh)), (0,0,255),3) cv2.imshow('image',img) cv2.waitKey(0) cv2.destroyAll...
doronweiss/pythontesta
GeneralTests/pycv.py
pycv.py
py
474
python
en
code
1
github-code
21
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.IMREAD_COLOR", "line_number": 5, "usage_type": "attribute" }, { "api_name": "cv2.rectangle", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_n...
41847117201
from matplotlib import pyplot as plt import seaborn as sns import scipy.stats as stats import numpy as np n_bandits = 4 # number of arms p_bandits = [0.45, 0.50, 0.60, 0.70] # assumed probabilities of success for each arm # define a function to pull an arm def pull(chose_bandit): # iter is the index of the arm to pul...
abhay-lal/RL
adrec.py
adrec.py
py
1,891
python
en
code
0
github-code
21
[ { "api_name": "numpy.random.rand", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 26, "usage_type": "call" }, { "api_name": "scipy.stats.beta",...
35912474267
import time import torch import numpy as np import torch.nn as nn import torchvision as tv import torchvision.transforms as tr from torch.utils.data import DataLoader from tqdm import tqdm from datetime import timedelta from ExpUtils import * from utils.utils import plot from utils.eval_quality import eval...
sndnyang/Diffusion_ViT
Task/eval_tasks.py
eval_tasks.py
py
11,597
python
en
code
33
github-code
21
[ { "api_name": "torch.backends", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.backends", "line_number": 18, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.FloatTensor",...
12310107431
from django.shortcuts import render from rest_framework import views,status from rest_framework.response import Response from .models import Records,DailyRecord from .serializers import RecordSerializer , DailyRecordSerializer from Profile.models import Profile from users.models import User from datetime import ...
michaelkigen/testmanage
records/views.py
views.py
py
4,487
python
en
code
0
github-code
21
[ { "api_name": "users.models.User.objects.get", "line_number": 17, "usage_type": "call" }, { "api_name": "users.models.User.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": "users.models.User", "line_number": 17, "usage_type": "name" }, { "ap...
20727066402
import io from operator import mod import sys _INPUT = """\ 4 6 #.#3#. ###.#. ##.### #1..#. """ sys.stdin = io.StringIO(_INPUT) # --------------------------------- r, c = map(int, input().split()) grid = [list(input()) for _ in range(r)] def check(src, dst): if dst in [".", "#"]: return src dst_...
makima333/Atcoder-ganbaru
contest/abc295/B.py
B.py
py
1,250
python
en
code
0
github-code
21
[ { "api_name": "sys.stdin", "line_number": 14, "usage_type": "attribute" }, { "api_name": "io.StringIO", "line_number": 14, "usage_type": "call" } ]
31112225664
from sklearn.model_selection import train_test_split import pandas as pd previsores = pd.read_csv('entradas_breast.csv') classe = pd.read_csv('saidas_breast.csv') # dividir em classes de trainamento e de teste. No caso 25% de teste previsores_treinamento, previsores_teste, classe_treinamento, classe_teste = train_te...
lucasAguiar11/Deep-Learning-Python
classificacao_binaria/breast_cancer_simples.py
breast_cancer_simples.py
py
3,831
python
pt
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 9, "usage_type": "call" }, { "api_name": ...
73032839093
import os import theano import theano.tensor as T from neupy import layers, storage from imagenet_tools import (CURRENT_DIR, FILES_DIR, load_image, print_top_n, download_file) theano.config.floatX = 'float32' SQUEEZENET_WEIGHTS_FILE = os.path.join(FILES_DIR, 'squeezenet.pickle') def Fi...
LiuFang816/SALSTM_py_data
python/itdxer_neupy/neupy-master/examples/cnn/squeezenet.py
squeezenet.py
py
2,258
python
en
code
9
github-code
21
[ { "api_name": "theano.config", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "imagenet_tools.FILES_DIR", "line_number": 12, "usage_type": "argument" }, { "api_name": "os.path"...
38493647537
import copy import itertools import operator from typing import Literal Decks = tuple[list[int], list[int]] def get_player_decks() -> Decks: with open("input/input22.txt") as input_file: player_1, player_2 = input_file.read().strip().split("\n\n") return [int(n) for n in player_1.split('\n')[1:]], [in...
pviafore/AdventOfCode2020
challenge22.py
challenge22.py
py
2,055
python
en
code
0
github-code
21
[ { "api_name": "typing.Literal", "line_number": 23, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 46, "usage_type": "call" }, { "api_name": "itertools.starmap", "line_number": 47, "usage_type": "call" }, { "api_name": "operator.mul", "li...
17495507623
#!/usr/bin/python # by Yusuke Satoh (NIES->KAIST) import sys import os import itertools import numpy as np import matplotlib.pyplot as plt import numpy.ma as ma import pandas as pd import matplotlib as mpl import datetime from numpy import fromfile, array, zeros, where from numpy import divide, median, mean, subtract, ...
yusuke61/tfe_scripts
scripts/basicMaps.RCPxFuture.1Dcolorbar.py
basicMaps.RCPxFuture.1Dcolorbar.py
py
95,936
python
en
code
2
github-code
21
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 19, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "os.uname", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.d...
186005823
import pandas as pd import numpy as np import glob from datetime import date # regular dict functions the same way (being ordered) but backwards compatibility is an issue from collections import OrderedDict ''' USAGE: Execute in directory with arbitrary number of particle.star files. Program will compare particle ide...
LMalfoy/INI3DR
ParticleIdentities/ParticleIdentities.py
ParticleIdentities.py
py
5,736
python
en
code
0
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 83, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 101, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 102, "usage_type": "call" }, { "api_name": "numpy.ndarray", ...
28949487183
# li = ['aaa','bbb','ccc'] # with open(r'eng.txt', 'w') as f: # for i in li: # f.write(i + '\n') import numpy as np import json name = ['joker','joe','nacy'] filename = 'name.json' with open(filename,'w') as file_obj: json.dump(name,file_obj) with open(filename) as f: names = json.load(f) print(name...
pksolar/sailus
callSum/callbase_1.2_msk_1_1.1/tools/writeTxt.py
writeTxt.py
py
944
python
en
code
0
github-code
21
[ { "api_name": "json.dump", "line_number": 10, "usage_type": "call" }, { "api_name": "json.load", "line_number": 12, "usage_type": "call" } ]
23098102263
DEBUG=0 import math,copy import torch import torch.nn.functional as F from torch import nn from .pos_encode import RealEmbedding from collections import defaultdict #These are taken from the Annotated Transformer (http://nlp.seas.harvard.edu/2018/04/03/attention.html#attention) def clones(module, N): "Produce N ...
herobd/dessurt
model/attention.py
attention.py
py
9,814
python
en
code
46
github-code
21
[ { "api_name": "torch.nn.ModuleList", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.matmul", "line_n...
73028139573
from __future__ import print_function, division, absolute_import import sys import os import traceback import socket import subprocess import resource from pkg_resources import resource_filename from math import ceil import errno import logging import multiprocessing import time import pynisher SMAC_VERSION = "...
LiuFang816/SALSTM_py_data
python/automl_pysmac/pysmac-master/pysmac/remote_smac.py
remote_smac.py
py
14,837
python
en
code
9
github-code
21
[ { "api_name": "multiprocessing.get_logger", "line_number": 126, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 129, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 129, "usage_type": "attribute" }, { "api_name": "socke...
30548173106
import psycopg2 import logging import datetime from .connection import get_connection, close_connection from ..entities.student import Student from .student_proficiency import get_student_proficiency, insert_student_proficiency from .student_data import get_student_data, insert_student_data from ...misc.date_tools imp...
ALLUOS/ALLUOS_PUBLIC_APP
src/backend/db/student.py
student.py
py
4,882
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "connection.get_connection", "line_number": 28, "usage_type": "call" }, { "api_name": "student_proficiency.get_student_proficiency", "line_number": 37, "usage_type": "call" }, ...
8842431291
import cv2 from pyzbar.pyzbar import decode, ZBarSymbol from pyzbar import pyzbar img = cv2.imread( "imgs/bar1.jpeg", 2) # if use cv2 # specify code type codes = pyzbar.decode(img) # auto detect code type print('Decoded:', codes) if len(codes) == 0: imgr = cv2. rotate(img, rotateCode=2) h, w = img.sha...
Vicrrs/barcode_and_qrcode_reader
testes/testes3.py
testes3.py
py
1,395
python
en
code
1
github-code
21
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "pyzbar.pyzbar.decode", "line_number": 9, "usage_type": "call" }, { "api_name": "pyzbar.pyzbar", "line_number": 9, "usage_type": "name" }, { "api_name": "cv2.rotate", "line_num...
27647513648
#!/usr/bin/env python import sys import numpy import argparse import itertools from shapely.ops import cascaded_union from shapely.geometry import Point, MultiPoint, Polygon, box from shapely.affinity import rotate, scale, translate from fpdf import FPDF def Scale(x, y, scale): return numpy.multiply(x, scale), num...
shashankramesh/DOME-Website
DOME_GEAR/Gear_Production_Drawing.py
Gear_Production_Drawing.py
py
16,134
python
en
code
0
github-code
21
[ { "api_name": "numpy.multiply", "line_number": 15, "usage_type": "call" }, { "api_name": "shapely.affinity.scale", "line_number": 15, "usage_type": "argument" }, { "api_name": "numpy.add", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.cos", "...
73067926772
import os import sys import argparse import collections from fnmatch import fnmatch def accumulate_table(pattern, dir_name, files, result_table): for filename in files: if fnmatch(filename, pattern): fl_path = os.path.join(dir_name, filename) with open(fl_path, "r") as fl: ...
zaycev/mokujin
tools/reduce.py
reduce.py
py
1,959
python
en
code
1
github-code
21
[ { "api_name": "fnmatch.fnmatch", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", ...
26650042820
import pygame from ..entity import DirectedEntity from .. import container import random import math class DroppedItem(DirectedEntity): destroy_after = 20 * 10 width = 19 * 3/100 height = 16 * 3/100 def __init__(self, game, x, y, raw_item, direction=None, *, time_cant_be_taked=0, item_type=None, **...
AlphaNow37/PyCraft
code_src/items/dropped_item.py
dropped_item.py
py
1,577
python
en
code
2
github-code
21
[ { "api_name": "entity.DirectedEntity", "line_number": 10, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.Surface", "line_number": 21, "usage_type": "call" }, { "api_name": "math.dist", "...
71099267572
"""task user associaton Revision ID: 3a0223d92d26 Revises: 3e19a67ccd5d Create Date: 2020-03-11 13:47:32.723265 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '3a0223d92d26' down_revision = '3e19a67ccd5d' branch_labels = None depends_on = None def upgrade():...
vrcompugo/EV-Manager-Data-API
migrations/versions/3a0223d92d26_task_user_associaton.py
3a0223d92d26_task_user_associaton.py
py
863
python
en
code
0
github-code
21
[ { "api_name": "alembic.op.create_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.Integ...
23816189863
# -*- coding: utf-8 -*- """Proxy Module. Routes and ratelimits all calls to the API. """ import asyncio # noqa: F401 import json import logging import os import sys from datetime import datetime, timezone import settings import aiohttp import pytz from aiohttp import web sys.path.append(os.getcwd()) from middleware...
DoctressWasTaken/Lightshield_proxy
server.py
server.py
py
2,789
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 17, "usage_type": "call" }, { "api_name": "middleware.auth.ServerCheck",...
22353012784
# Arquivo principal de inicialização import socket from utils.log_server import custom_log from response import Response from request import Request import json class Snake: __ROUTES = {} __http_codes = { 'client': { '400': { 'Body': '@default-page', 'Messa...
jaedsonpys/SnakeServer
snake.py
snake.py
py
11,024
python
pt
code
0
github-code
21
[ { "api_name": "utils.log_server.custom_log", "line_number": 100, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 107, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 107, "usage_type": "attribute" }, { "api_name": "sock...
30637981440
""" Solution for 297. Serialize and Deserialize Binary Tree https://leetcode.com/problems/serialize-and-deserialize-binary-tree/ """ # Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None from collections import de...
KKosukeee/CodingQuestions
LeetCode/297_serialize_and_deserialize_binary_tree.py
297_serialize_and_deserialize_binary_tree.py
py
3,227
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 59, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 62, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 95, "usage_type": "call" } ]
36890851297
import cv2 # print(img) # cv2.imshow('image', img) # cv2.waitKey(5000) # cv2.destroyAllWindows() print(type(img)) flags = [i for i in dir(cv2) if i.startswith('COLOR_')] for j in range(190): filename = "C:\\images\\" + str(j) + ".png" imagetype = flags[j] print(imagetype) str1= print(fi...
iamravikc-python/AI
ML.py
ML.py
py
543
python
en
code
0
github-code
21
[ { "api_name": "cv2.imread", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_num...
73377731572
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from distutils.version import LooseVersion from . import helper as hlp from . import colors_and_lines as cl #%%============================================================================ def missi...
jsh9/python-plot-utils
plot_utils/multiple_columns.py
multiple_columns.py
py
41,055
python
en
code
6
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 45, "usage_type": "attribute" }, { "api_name": "pandas.Series", "line_number": 45, "usage_type": "attribute" }, { "api_name": "pandas.Series", "line_number": 48, "usage_type": "attribute" }, { "api_name": "pandas.Da...
35878297726
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import numpy as np from mpl_toolkits.basemap import Basemap from iconfuv.ionex import get_tecmap from matplotlib.lines import Line2D import datetime from skimage.draw import line def xy_to_rc(x,y): col = ((x+180)/5).astype(int)...
UIUC-SINE/icon-fuv
python3/asymmetry_flag/flagger.py
flagger.py
py
2,252
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "call" }, { "api_name": "iconfuv.ionex.get_tecmap", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.load", ...
31632253686
#! /usr/bin/env python3 # Author: Izaak Neutelings (June 2021) # Description: Simple module to compile sum of weights in MC # Instructions: # Locally: # python3 python/analysis/SumWeights.py # Or with PicoProducer: # pico.py channel sumw python/analysis/SumWeights.py # pico.py run -c sumw -y UL2018 -s DYJetsToLL_...
cms-tau-pog/TauFW
PicoProducer/python/analysis/SumWeights.py
SumWeights.py
py
5,399
python
en
code
5
github-code
21
[ { "api_name": "ROOT.PyConfig", "line_number": 15, "usage_type": "attribute" }, { "api_name": "PhysicsTools.NanoAODTools.postprocessing.framework.eventloop.Module", "line_number": 20, "usage_type": "name" }, { "api_name": "ROOT.TFile", "line_number": 24, "usage_type": "cal...
43315405195
import pandas as pd # Load the star data into a Pandas DataFrame stars = pd.read_csv('star_data.csv') # Check for missing values and remove or impute them stars.isna().sum() # Check for missing values stars.dropna(inplace=True) # Remove rows with missing values # Encode categorical variables using one-hot e...
Wolfie8935/python_codes_wolfie8935
code1.py
code1.py
py
895
python
en
code
1
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.get_dummies", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 17, "usage_type": "call" }, { "api_na...
8319634997
import torch import torch.nn as nn import torch.nn.functional as F from .net_utils import * from .ConvFilter import * from .SurfaceClassifier import * class ConvIFNet(nn.Module): ''' ConvPIFu network uses conv network as the image filter. ''' def __init__(self, opt, loss_func=nn.MSELoss(), mod="train...
zhuhao-nju/mvfr
model/ConvIFNet.py
ConvIFNet.py
py
5,126
python
en
code
59
github-code
21
[ { "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.MSELoss", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_num...
39983786487
# Import modules import pygame from pygame.locals import * # Initialise pygame pygame.init() # Screen screen_width = 1000 screen_height = 800 screen = pygame.display.set_mode((screen_width, screen_height)) # Colours RED = (255,0,0) GREEN = (0,255,0) BLUE = (0,0,255) WHITE = (255,255,255) BLACK = (0,0,0) class Stack...
LyleW473/Data-structures
DataStructures/Stack/Stack game/stack.py
stack.py
py
8,182
python
en
code
0
github-code
21
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.draw.re...
73039172853
from __future__ import print_function import sys from Dataset import DatasetSeq from CachedDataset2 import CachedDataset2 import gzip import xml.etree.ElementTree as etree from Util import parse_orthography, parse_orthography_into_symbols, load_json, NumbersDict, BackendEngine from Log import log import numpy import ...
LiuFang816/SALSTM_py_data
python/rwth-i6_returnn/returnn-master/LmDataset.py
LmDataset.py
py
26,611
python
en
code
9
github-code
21
[ { "api_name": "CachedDataset2.CachedDataset2", "line_number": 16, "usage_type": "name" }, { "api_name": "Log.log.v4", "line_number": 69, "usage_type": "attribute" }, { "api_name": "Log.log", "line_number": 69, "usage_type": "name" }, { "api_name": "Util.load_json"...
3182614804
from flask import Blueprint, request, jsonify from genre_classifier.predict import make_prediction from genre_classifier import __version__ as _version from api.config import get_logger from api import __version__ as api_version from api.validation import validate_inputs _logger = get_logger(logger_name=__name__) p...
KvRooijen/genre-classification
packages/ml_api/api/controller.py
controller.py
py
1,523
python
en
code
0
github-code
21
[ { "api_name": "api.config.get_logger", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.Blueprint", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask...
24358351122
from google.cloud import vision import io from pprint import pprint as pp import json import os from skimage.io import imread, imshow from skimage.transform import rescale from google.cloud import vision_v1 from google.cloud.vision_v1 import enums import six import matplotlib.pyplot as plt def sample_async_batch_an...
ShimonBezalel/gastronomy_ml
src/feature.py
feature.py
py
12,322
python
en
code
0
github-code
21
[ { "api_name": "google.cloud.vision_v1.ImageAnnotatorClient", "line_number": 19, "usage_type": "call" }, { "api_name": "google.cloud.vision_v1", "line_number": 19, "usage_type": "name" }, { "api_name": "six.binary_type", "line_number": 24, "usage_type": "attribute" }, ...
41891090725
from typing import Iterable import torch from imodal.Manifolds.Abstract import Manifold from imodal.StructuredFields import StructuredField_m, StructuredField_0 from imodal.StructuredFields.Abstract import SumStructuredField class NormalFrame(Manifold): def __init__(self, dim, nb_pts, gd=None, tan=None, cotan=N...
imodal/imodal
imodal/Manifolds/NormalFrame.py
NormalFrame.py
py
2,177
python
en
code
4
github-code
21
[ { "api_name": "imodal.Manifolds.Abstract.Manifold", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.dot", "line_number": 32, "usage_type": "call" }, { "api_name": "torch.einsum", "line_number": 33, "usage_type": "call" }, { "api_name": "torch.trans...
10149276243
import logging from collections import OrderedDict from dataclasses import dataclass from typing import Optional, Tuple, Union import torch from torch import nn from torch.nn import CrossEntropyLoss from transformers import BertPreTrainedModel, BertModel, PretrainedConfig, AutoConfig from transformers.models.bert.mode...
hkjeon13/koai
koai/benchmarks/modeling_dp.py
modeling_dp.py
py
5,478
python
en
code
1
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "transformers.models.bert.modeling_bert.ModelOutput", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 17, "usage_type": "name" }, { ...
24762558670
from flask import Flask, render_template, request, redirect from flask_sqlalchemy import SQLAlchemy from datetime import datetime from flask_wtf import FlaskForm from wtforms import StringField,SubmitField, BooleanField from wtforms.validators import InputRequired db=SQLAlchemy() app = Flask(__name__) app.config["S...
Vishakh2012/fl2do
app.py
app.py
py
2,729
python
en
code
2
github-code
21
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_wtf.FlaskForm", "line_number": 17, "usage_type": "name" }, { "api_name": "wtforms.S...
43703055807
from columns import * import pyspark.sql.functions as f def read_df(session, path, schema): """ Читання даних у фрейм даних із CSV Аргументи: session: spark сесія path: шлях до файлу csv schema: схема набору даних Результат: dataframe- датафрейм """ df = session.re...
PavloDemidov/imdb-spark-project2
read_write.py
read_write.py
py
2,531
python
uk
code
0
github-code
21
[ { "api_name": "pyspark.sql.functions.split", "line_number": 30, "usage_type": "call" }, { "api_name": "pyspark.sql.functions", "line_number": 30, "usage_type": "name" }, { "api_name": "pyspark.sql.functions.col", "line_number": 30, "usage_type": "call" }, { "api_n...
9573974103
import math from typing import List import matplotlib.pyplot as plt import matplotlib.ticker as ticker import os import numpy as np def get_vals(file): counter: int = 0 x_ax = list() vals = list() for line in file: if line != '': str_line = line.split('\t') try: ...
egorchernook/gmr
plotter.py
plotter.py
py
26,658
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.double", "line_number": 26, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.p...
4214477199
import orangecontrib.recommendation.optimizers as opt import numpy as np import collections import unittest import copy __optimizers__ = [ opt.SGD(learning_rate=0.1), opt.Momentum(learning_rate=0.1, momentum=0.5), opt.NesterovMomentum(learning_rate=0.1, momentum=0.5), opt.AdaGrad(learning_rate=0.1), ...
biolab/orange3-recommendation
orangecontrib/recommendation/tests/coverage/test_optimizers.py
test_optimizers.py
py
4,388
python
en
code
23
github-code
21
[ { "api_name": "orangecontrib.recommendation.optimizers.SGD", "line_number": 9, "usage_type": "call" }, { "api_name": "orangecontrib.recommendation.optimizers", "line_number": 9, "usage_type": "name" }, { "api_name": "orangecontrib.recommendation.optimizers.Momentum", "line_nu...
33126411585
from typing import Optional import httpx import structlog from yarl import URL from rssparser.api.models import Author logger = structlog.getLogger(__name__) class AuthorClient: def __init__(self, url: URL) -> None: self.url = URL(url) def get_by_name(self, name, feed_id: int) -> Optional[Author]...
kbondar17/pocket-rss
rss-parser/rssparser/api/authors.py
authors.py
py
1,201
python
en
code
6
github-code
21
[ { "api_name": "structlog.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "yarl.URL", "line_number": 14, "usage_type": "name" }, { "api_name": "yarl.URL", "line_number": 15, "usage_type": "call" }, { "api_name": "httpx.get", "line_number": 1...
10523632784
# -*- coding:utf-8 -*- ''' @Description: QLineEdit相关功能重写 @Author: lamborghini1993 @Date: self.m_MinNum19-03-13 11:28:22 @UpdateDate: 2019-03-13 14:14:12 ''' from PyQt5.QtWidgets import QLineEdit from PyQt5.QtCore import QSize class CVariableLengthLineEdit(QLineEdit): """ 可变长度的QLineEdit """ m_MinNum =...
lamborghini1993/pubcode
pubqt/lineedit.py
lineedit.py
py
1,256
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QLineEdit", "line_number": 13, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.QSize", "line_number": 25, "usage_type": "call" } ]
29291609371
from collections import defaultdict import random DEBUG = 0 HERE = 1 name = "GermanyRoadud" if HERE: filename = f"raw_graphs/{name}.txt" else: filename = f"/lfs/usrhome/btech/ee19b106/graph_algorithms/raw_graphs/{name}.txt" with open(filename) as f: l = f.readlines() # l = l[1:] for i in range(len(l)):...
PrasannaIITM/Graph-Algorithms-Framework-In-SYCL
scripts/csr.py
csr.py
py
1,262
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 21, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 29, "usage_type": "call" } ]
18674437787
import logging import typing from typing import Dict import json import aiohttp from bs4 import BeautifulSoup from yarl import URL import time import re from http.cookies import SimpleCookie from email.utils import parsedate from datetime import datetime from .constants import * class UnauthorizedError(Exception): ...
vr-hunter/vwapi
__init__.py
__init__.py
py
11,489
python
en
code
1
github-code
21
[ { "api_name": "typing.Optional", "line_number": 34, "usage_type": "attribute" }, { "api_name": "aiohttp.ClientSession", "line_number": 34, "usage_type": "attribute" }, { "api_name": "email.utils", "line_number": 35, "usage_type": "name" }, { "api_name": "yarl.URL"...
24462626457
from flask import Flask, request, jsonify from flask_cors import CORS import re app = Flask(__name__) CORS(app) @app.route("/", methods=['GET']) # `/?pos=<pos>&crs=<crs>` # pos: the query position, as `x,y` # crs: the crs of the query position # output: a json document with map info for the specified position: `{res...
sourcepole/qwc2-server
mapInfo.py
mapInfo.py
py
855
python
en
code
6
github-code
21
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.request", ...
26327261650
import tkinter as tk import sched as sd import time as tm from .conf import W, H, BG_COLOR from .board import Board from .figure import Figure class App: def __init__(self): self.window = tk.Tk() self.window.title("Catch the cat") self.scheduler = sd.scheduler(tm.time, tm.sleep) ...
szobin/catch_cat_lesson2
core/app.py
app.py
py
854
python
en
code
0
github-code
21
[ { "api_name": "tkinter.Tk", "line_number": 13, "usage_type": "call" }, { "api_name": "sched.scheduler", "line_number": 15, "usage_type": "call" }, { "api_name": "time.time", "line_number": 15, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_numb...
31467176458
import scrapy from dangdangwang.items import DangdangwangItem import time import re class DangdangSpider(scrapy.Spider): name = 'dangdang' allowed_domains = ['dangdang.com'] start_urls = ['http://bang.dangdang.com/books/bestsellers'] page_next_id = 2 def parse(self, response): for dd in re...
pipikai20/python
dangdangwang/dangdangwang/spiders/dangdang.py
dangdang.py
py
2,882
python
en
code
0
github-code
21
[ { "api_name": "scrapy.Spider", "line_number": 6, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 15, "usage_type": "call" }, { "api_name": "dangdangwang.items.DangdangwangItem", "line_number": 16, "usage_type": "call" }, { "api_name": "re.s...
71870014134
import wx import wx.dataview import logging import requests logger = logging.getLogger("ADVSEARCH") class AdvSearchFrame(wx.Dialog): def __init__(self, *args, **kwds): # begin wxGlade: MyDialog.__init__ kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(se...
tywtyw2002/easyEda2Kicad
gui_adv_search.py
gui_adv_search.py
py
5,222
python
en
code
4
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "wx.Dialog", "line_number": 11, "usage_type": "attribute" }, { "api_name": "wx.DEFAULT_DIALOG_STYLE", "line_number": 14, "usage_type": "attribute" }, { "api_name": "wx.Dialo...
42885368433
from django.urls import path from . import views urlpatterns = [ path('', views.home, name='home'), path('update/<int:id>', views.updatetask, name='update'), path('delete/<int:id>', views.deletetask, name='delete'), path('delete_all', views.deleteall, name='deleteall'), ]
arshmohd23/todo
todo/urls.py
urls.py
py
296
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
4389867884
import cv2 import numpy as np import pytesseract # read image img = cv2.imread('result.png') ori = cv2.imread('0001.jpg') # convert to grayscale gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) # threshold thresh = cv2.threshold(gray,128,255,cv2.THRESH_BINARY)[1] # get contours result = img.copy() contours = cv2.findCon...
MukulSingh105/Automatic-Form-Data-Extraction
boxes.py
boxes.py
py
1,312
python
en
code
1
github-code
21
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_numbe...
73774829173
from os import times from flask import Flask from worker.tasks import make_celery from driver import request_router flask_app = Flask(__name__) flask_app.config.update( CELERY_BROKER_URL='redis://localhost:6379', CELERY_RESULT_BACKEND='redis://localhost:6379' ) celery = make_celery(flask_app) @celery.task() ...
diganthdr/encryptserver
server/src/celeryapp.py
celeryapp.py
py
443
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "worker.tasks.make_celery", "line_number": 11, "usage_type": "call" }, { "api_name": "driver.request_router", "line_number": 16, "usage_type": "call" } ]
39059540237
from nmigen import * from nmigen.cli import main from nmigen_boards import icebreaker from util.quarter_wave import SinTable from util.dac import * import itertools class Main(Elaboratable): def __init__(self): self.in_port = Signal(8) self.out_port = Signal(signed(8)) def elaborate(self, pl...
TiltMeSenpai/nmigen_sketches
breathing.py
breathing.py
py
1,579
python
en
code
0
github-code
21
[ { "api_name": "itertools.count", "line_number": 17, "usage_type": "call" }, { "api_name": "util.quarter_wave.SinTable", "line_number": 31, "usage_type": "call" }, { "api_name": "nmigen_boards.icebreaker.ICEBreakerPlatform", "line_number": 47, "usage_type": "call" }, {...
28300812514
from datetime import datetime from typing import Any, Dict, List from ai_api_client_sdk.helpers.datetime_parser import parse_datetime from ai_api_client_sdk.models.artifact import Artifact from ai_api_client_sdk.models.enactment import Enactment from ai_api_client_sdk.models.status import Status from ai_api_client_sdk...
M4RINH0/licital
data/.venv/lib/python3.10/site-packages/ai_api_client_sdk/models/execution.py
execution.py
py
5,040
python
en
code
0
github-code
21
[ { "api_name": "ai_api_client_sdk.models.enactment.Enactment", "line_number": 11, "usage_type": "name" }, { "api_name": "ai_api_client_sdk.models.status.Status", "line_number": 46, "usage_type": "name" }, { "api_name": "ai_api_client_sdk.models.target_status.TargetStatus", "li...
23305154337
from __future__ import annotations from typing import TYPE_CHECKING, Optional from indi.message.const import State, SwitchState if TYPE_CHECKING: from indi.client.device import Device from indi.client.elements import Element from indi.client.vectors import Vector class BaseEvent: def __init__( ...
wlatanowicz/indipy
indi/client/events.py
events.py
py
2,962
python
en
code
5
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "indi.client.device.Device", "line_number": 16, "usage_type": "name" }, { "api_name": "typing....
1362055082
#!/usr/bin/env python import requests from bs4 import BeautifulSoup from headers_parser import headers_parser from pprint import pprint from pyhunter import PyHunter import re from time import sleep from random import randint import os class Google: def __init__(self): self.host = 'https://www.google.com/search'...
shreateh/recon
google_class1.py
google_class1.py
py
5,062
python
en
code
null
github-code
21
[ { "api_name": "requests.Session", "line_number": 18, "usage_type": "call" }, { "api_name": "headers_parser.headers_parser", "line_number": 29, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 81, "usage_type": "call" }, { "api_name": "bs4....
20890142363
#!/usr/bin/env python import json from huepy import * import os from os import path import requests import sys import time import hashlib import csv if "VTSCAN_API_KEY" in os.environ: api_key = os.environ.get("VTSCAN_API_KEY") # export VTSCAN_API_KEY=YOURAPIKEY or pass it with "-k" flag else: ap...
BJTUpupil/VirusTotal
vtscan.py
vtscan.py
py
5,570
python
en
code
1
github-code
21
[ { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_n...
8710015954
import shelve from main.models import Libro, Puntuacion from main.forms import UserForm, BookForm from django.shortcuts import render, get_object_or_404 from main.recommendations import transformPrefs, calculateSimilarItems, getRecommendations, getRecommendedItems, topMatches from main.populate import populateDatabase...
Servesus/CosasAII
SR/main/views.py
views.py
py
5,474
python
en
code
0
github-code
21
[ { "api_name": "shelve.open", "line_number": 13, "usage_type": "call" }, { "api_name": "main.models.Puntuacion.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "main.models.Puntuacion.objects", "line_number": 14, "usage_type": "attribute" }, { ...
26910746945
from sqlalchemy import Column, DateTime, Integer, String from sqlalchemy.ext.declarative import declarative_base from datetime import datetime Base = declarative_base() class FeedbackModel(Base): __tablename__ = "feedback" id = Column(Integer, primary_key=True) service_name = Column(String, nullable=False...
Loriaaa123/with_docker
models.py
models.py
py
460
python
en
code
0
github-code
21
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 9, "usage_type": "argument" }, { ...
6056543378
"""HTML components for displaying messages to the user in a banner format""" from dash import html def message_banner(category, message): """ Return a coronavirus dashboard-style changelog banner to be used to communicate to the user when the dashboard was last updated. See https://coronavirus.data.g...
communitiesuk/pkg_gov_uk_dashboards
gov_uk_dashboards/components/plotly/banners.py
banners.py
py
952
python
en
code
5
github-code
21
[ { "api_name": "dash.html.Div", "line_number": 12, "usage_type": "call" }, { "api_name": "dash.html", "line_number": 12, "usage_type": "name" }, { "api_name": "dash.html.P", "line_number": 13, "usage_type": "call" }, { "api_name": "dash.html", "line_number": 13...
12124134279
from constant import EMPTY_ARRAY from cosfft.cosseries import CosSeries from instrument.plainvanillaoption import PlainVanillaOption from nptyping import NDArray import numpy as np class VectorizeCosFft(): def __init__(self, cos_series: CosSeries) -> None: self.__cos_series = cos_series self.__str...
gfunk0704/deep_reinforcement_calibration
cosfft/vectorizecosfft.py
vectorizecosfft.py
py
1,392
python
en
code
0
github-code
21
[ { "api_name": "cosfft.cosseries.CosSeries", "line_number": 9, "usage_type": "name" }, { "api_name": "constant.EMPTY_ARRAY", "line_number": 11, "usage_type": "name" }, { "api_name": "constant.EMPTY_ARRAY", "line_number": 12, "usage_type": "name" }, { "api_name": "c...
9803113683
import logging import sqlite3 import sys import threading import time logging.basicConfig( level=logging.DEBUG, format="%(asctime)s (%(threadName)-10s) %(message)s", ) def writer(db_name, isolation_level_name, ready_event): with sqlite3.connect(db_name, isolation_level=isolation_level_name) as conn: ...
tinylambda/keep
module_sqlite3/sqlite3_isolation_levels.py
sqlite3_isolation_levels.py
py
1,962
python
en
code
1
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.debug", ...
30240649527
import torch def save_model(weights_file): model = torch.hub.load('ultralytics/yolov5', 'custom', path=weights_file) torch.save(model, './models/yolov5.pt') if __name__ == '__main__': save_model('./weights/best.pt') print('Saved model with custom weights in ./weights/best.pt to ./models/yolov5.pt')
mortenterhart/ros2-autonomous-driving
src/perception/save_yolov5_model.py
save_yolov5_model.py
py
320
python
en
code
1
github-code
21
[ { "api_name": "torch.hub.load", "line_number": 5, "usage_type": "call" }, { "api_name": "torch.hub", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.save", "line_number": 6, "usage_type": "call" } ]
74949983411
""" This script creates a new folder on the NAS and then converts yesterdays .wav recordings to .mp3. If conversion is sucessful it then moves the file to the NAS server mounted as /mnt/asterisk. It then updates the file name in the CDR to an mp3 extension and changes thepath. Upon processing ...
jkavenaugh/freepbx-cdr-to-mp3
archive_asterisk.py
archive_asterisk.py
py
5,958
python
en
code
1
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 27, "usage_type": "attribute" }, { "api_name": "io.StringIO",...
74514033331
from simplecrypt import encrypt, decrypt from pprint import pprint from netmiko import ConnectHandler import json from time import time import threading def read_devices(device_filename): # for reference the contents of the file is as follows # 192.168.122.205, cisco-ios, IOU1 # 192.168.122.207, cisco-ios...
JDFSHU/Python-for-Network-Engineers
NetmikoScripts/netmikoSequential.py
netmikoSequential.py
py
3,691
python
en
code
0
github-code
21
[ { "api_name": "simplecrypt.decrypt", "line_number": 37, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 39, "usage_type": "call" }, { "api_name": "netmiko.ConnectHandler", "line_number": 56, "usage_type": "call" }, { "api_name": "time.time", ...
33740874752
# -*- coding: utf-8 -*- """Models for transactions.""" import datetime as dt import uuid import stripe from sqlalchemy.dialects.postgresql import JSONB, UUID from ceraon.database import Column, IDModel, db, reference_col, relationship class Transaction(IDModel): """A transaction made by a user for a meal. ...
Rdbaker/Mealbound
ceraon/models/transactions.py
transactions.py
py
5,178
python
en
code
1
github-code
21
[ { "api_name": "ceraon.database.IDModel", "line_number": 12, "usage_type": "name" }, { "api_name": "ceraon.database.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "ceraon.database.db.DateTime", "line_number": 21, "usage_type": "call" }, { "api_na...
37553183276
import logging import click from wis2box import cli_helpers from wis2box.env import API_CONFIG from wis2box.handler import Handler from wis2box.api.backend import load_backend import wis2box.metadata.discovery as discovery_ from wis2box.topic_hierarchy import validate_and_load from wis2box.util import walk_path, yaml...
alexandreleroux/wis2box
wis2box/api/__init__.py
__init__.py
py
3,595
python
en
code
null
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "wis2box.metadata.discovery.DiscoveryMetadata", "line_number": 27, "usage_type": "call" }, { "api_name": "wis2box.metadata.discovery", "line_number": 27, "usage_type": "name" }, ...
28967265310
# stdlib import copy import threading import time import traceback # 3rd party import bqplot as bq import ipyparallel as ipp from IPython.display import display, clear_output, update_display import ipywidgets as ipw import numpy as np import pandas as pd import qgrid class ModelPlot(ipw.VBox): def __init__(self,...
sparticlesteve/cori-intml-examples
hpo_widgets.py
hpo_widgets.py
py
19,142
python
en
code
11
github-code
21
[ { "api_name": "ipywidgets.VBox", "line_number": 17, "usage_type": "attribute" }, { "api_name": "bqplot.LinearScale", "line_number": 34, "usage_type": "call" }, { "api_name": "bqplot.LinearScale", "line_number": 35, "usage_type": "call" }, { "api_name": "bqplot.Axi...
13731134983
""" DESCRIPTION: Real-time barcode and QR code reading with OpenCV DEPENDENCIES: OpenCV sudo apt-get install libzbar0 sudo pip install pyzbar sudo pip install imutils USE: python scanner2.py 'q' to quit """ # import the necessary packages from imutils.video import VideoStream from pyzbar import pyzbar import argparse...
ANTZ314/raspi
picam/qr_code/scanner3.py
scanner3.py
py
3,006
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" }, { "api_name": "imutils.video.VideoStream", "line_number": 37, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 38, "usage_type": "call" }, { "api_name": "imutils....
75033173491
import sys import pygame import uuid import numpy as np import collections import copy from Sprite import * from Keyboard import * from Mouse import * from constants import * from pygame_util import * class Screen: def __init__(self, color, title="StreetCode Academy", show_mouse_pos=False): pygame.init() ...
diwgan32/PyGameStreetcode
core/Screen.py
Screen.py
py
4,258
python
en
code
1
github-code
21
[ { "api_name": "pygame.init", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.font.init", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mode...
18347438521
from dataclasses import dataclass def input_shopping_item(): data = { "name": input("Item Name: "), "quantity": int(input("Quantity: ")), "price": float(input("Price: ")), "store": input("Store Name: ") } return data @dataclass class ShoppingItem: name: str quanti...
rickyg365/recipe_scraper
tui/models/shopping_item.py
shopping_item.py
py
619
python
en
code
1
github-code
21
[ { "api_name": "dataclasses.dataclass", "line_number": 14, "usage_type": "name" } ]
4075842666
import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.module import Module from torch.autograd import Variable """ This code is based on Thomas Kipf's repository. https://github.com/ethanfetaya/NRI """ class FC(nn.Module): """One-layer fully-connec...
YuJungHeo/CompTransR
units/layers.py
layers.py
py
7,167
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
75197651253
from itertools import combinations def solution(needs, r): answer = 0 combs = combinations(range(0, len(needs[0])), r) need_cnt_arr = [] for need in needs: need_cnt_arr.append(sum(need)); for comb in combs: temp_ans = 0 for i in range(len(needs)): need_cnt = need...
keeeeeey/baekjoon_algorithm
시험/이스트소프트2.py
이스트소프트2.py
py
552
python
en
code
0
github-code
21
[ { "api_name": "itertools.combinations", "line_number": 5, "usage_type": "call" } ]
44650670261
#importing all modules import pygame#pip install pygame from pygame.locals import * import random from pygame import mixer #initiating modules needed pygame.init() mixer.init() pygame.font.init() #variables s_width = 900 s_height = 700 play_width = 300 # meaning 300 // 10 = 30 width per block play_h...
AvanindraC/Alteriss
Game.py
Game.py
py
11,259
python
en
code
2
github-code
21
[ { "api_name": "pygame.init", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.mixer.init", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 9, "usage_type": "name" }, { "api_name": "pygame.font.init", "line_...
9245118914
from collections import OrderedDict import hashlib class Libriary: def __init__(self, init_str): self.lib = dict() for i in range (init_str.__len__() // 2): if (not init_str[i * 2] in self.lib): self.lib.update({init_str[i*2]: int(init_str[i*2+1])}) else: ...
Tka4uk-Andrei/ifmoPython
part_1/week_4/lab9_week_4.py
lab9_week_4.py
py
1,600
python
en
code
0
github-code
21
[ { "api_name": "hashlib.md5", "line_number": 27, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 29, "usage_type": "call" }, { "api_name": "hashlib.sha224", "line_number": 31, "usage_type": "call" }, { "api_name": "hashlib.sha256", "line_nu...
17822509231
#!/usr/bin/env python3 import hashlib import argparse import itertools import string def get_args(): parser = argparse.ArgumentParser(description='Looks for a hash that ends/begins with a given pattern.') parser.add_argument('--algorithm', type=str, required=True, help='Algorithm to use (md5, sha1, sha256, ......
jamarir/magic_hash_finder
magic_hash_finder.py
magic_hash_finder.py
py
2,429
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 18, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 20, "usage_type": "call" }, { "api_name": "hashlib.sha224", ...
29653328460
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('public', '0006_order_checkout'), ] operations = [ migrations.AddField( model_name='checkout', name='...
NobleSF/Cobra
apps/public/migrations/0007_checkout_currency_string.py
0007_checkout_currency_string.py
py
456
python
en
code
3
github-code
21
[ { "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" }, { ...
40756849362
from requests.auth import HTTPDigestAuth import requests from pprint import pprint from pymongo import MongoClient import logging import configparser logging.basicConfig( level=logging.INFO, #level=logging.WARNING, format="[%(asctime)s] %(name)s:%(levelname)s: %(message)s", ) class ExtractOPS(): def...
yyztc/itop
extract_ops.py
extract_ops.py
py
2,970
python
en
code
0
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser", "line_number": 18, "usage_type": "call" }, { "api_name": "pymongo...
22925791795
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http:# mozilla.org/MPL/2.0/. # # Contact: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import, divisi...
mozilla/jx-sqlite
jx_sqlite/expressions/leaves_op.py
leaves_op.py
py
1,783
python
en
code
35
github-code
21
[ { "api_name": "jx_base.expressions.LeavesOp", "line_number": 21, "usage_type": "name" }, { "api_name": "jx_base.language.is_op", "line_number": 24, "usage_type": "call" }, { "api_name": "jx_sqlite.expressions.variable.Variable", "line_number": 24, "usage_type": "argument"...
34003157994
from io import BytesIO import plotly import PIL from PIL import Image from PIL import Image, ImageFile, ImageFont, ImageDraw ImageFile.LOAD_TRUNCATED_IMAGES = True import plotly.graph_objects as go import plotly.figure_factory as ff from plotly.subplots import make_subplots from reportlab import platypus from reportlab...
Nikita-Pardeshi/Financial-Analytics
coverpage_2.py
coverpage_2.py
py
51,456
python
en
code
0
github-code
21
[ { "api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES", "line_number": 6, "usage_type": "attribute" }, { "api_name": "PIL.ImageFile", "line_number": 6, "usage_type": "name" }, { "api_name": "newsapi.NewsApiClient", "line_number": 46, "usage_type": "call" }, { "api_na...
25040645490
from pathlib import Path test_video_path = Path(__file__).parent / "test.mp4" out_dir = Path(__file__).parent / "out" def test_post_video(client): response = client.post("/api/video", data={ "video_file": test_video_path.open('rb'), }) assert response.status_code == 200 assert response.content_type =...
dharness/yogoflow
server/tests/test_video_routes.py
test_video_routes.py
py
504
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 4, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" } ]
10201865656
#!/usr/bin/env python3.10 import os import argparse parser = argparse.ArgumentParser( prog="gbooks-dl", description= "A command-line program for downloading online book previews to your local computer." ) parser.add_argument( 'URL', nargs='?', help="A URL containing a preview-able book to be d...
moosejaw/gbooks-dl
gbooks_dl/__main__.py
__main__.py
py
665
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 19, "usage_type": "call" }, { "api_name": "gbooks_dl.pipeline.pipeline", "line_number": 27, "usage_type": "call" } ]
24438413592
from typing import List from sqlalchemy.orm import Session from recording.recording_worker import RecordingConfiguration, RecordingWorker import os from settings import RECORDING_FOLDER class RecordingRunner(object): def __init__(self, session: Session): self.__session = session self.__workers: ...
AI-Lab-Makerere/COVID-19-ASR
radio-streaming/recording/recording_runner.py
recording_runner.py
py
1,706
python
en
code
5
github-code
21
[ { "api_name": "sqlalchemy.orm.Session", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "recording.recording_worker.RecordingWorker", "line_number": 13, "usage_type": "name" }, { "api...
74991527413
import pytest import import_path from main import ( process ) test_cases = [ (1, 2, 3, 4, 'impossible'), (2, 2, 3, 4, 'impossible'), (1, 1, 1, 0, 'possible'), (1, 1, 1, 1, 'impossible'), (100, 1, 1, 1, 'possible'), (100, 1, 1, 2, 'possible'), (100, 100, 1, 1, 'possible') ] @pytest....
jehalladay/AdvPy-jehalladay
final/eating_out/tests/test_main.py
test_main.py
py
498
python
en
code
0
github-code
21
[ { "api_name": "main.process", "line_number": 25, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 21, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 21, "usage_type": "attribute" } ]
41699288343
#Import modules import os import pandas as pd import numpy as np import tensorflow as tf from pandas import DatetimeIndex import dask import scipy import time import glob from functools import partial from abc import ABCMeta, abstractmethod import plottingTools import kalmanFilter import linearModel ...
mChataign/smileCompletion
Code/extendedKalmanFilter.py
extendedKalmanFilter.py
py
8,983
python
en
code
6
github-code
21
[ { "api_name": "kalmanFilter.kalmanFilter", "line_number": 52, "usage_type": "attribute" }, { "api_name": "pandas.concat", "line_number": 88, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 93, "usage_type": "call" }, { ...
29217077715
from django.urls import path from . import views urlpatterns = [ path('', views.store, name='store'), path('shop/', views.catalog, name='catalog'), path('blog/', views.blog, name='blog'), path('about/', views.about, name='about'), path('contact/', views.contact, name='contact'), path('cart/', v...
Flomasta/dress-shop
store/urls.py
urls.py
py
752
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
9798780093
import logging import sys import attr logging.basicConfig(stream=sys.stderr, level=logging.INFO) def on_setter(instance, attribute, new_value): if new_value < 0: raise ValueError("value should be > 0") @attr.s class C: x = attr.ib(on_setattr=on_setter) if __name__ == "__main__": c = C(-10) ...
tinylambda/keep
module_attrs/attrs_ib_on_setter.py
attrs_ib_on_setter.py
py
435
python
en
code
1
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 6, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 6, "usage_type": "attribute" }, { "api_name": "attr.ib", "lin...
41138119203
from django.db import migrations def create_data(apps, schema_editor): Welearner = apps.get_model('welearner', 'Welearner') Welearner(first_name="Welearner 001", last_name="Welearner 001", email="customer001@email.com", phone="00000000", address="Welearner 000 Address", description= "Welearner 001 description"...
RudeSoul/Learn-React-and-django
welearner/migrations/0002_welearner.py
0002_welearner.py
py
521
python
en
code
0
github-code
21
[ { "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.RunPython", "line_number": 12, "usage_type": "call" }, { ...