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
74240834914
import json from tqdm import tqdm import fileUtils DATA_PATH = fileUtils.get_data_path() RESULTS_CSV = fileUtils.get_csv_results_file() POLICY_RESULTS_JSON = fileUtils.get_policy_results_file() data_directories = fileUtils.get_data_dirs() for directory in tqdm(data_directories): admin_file_path = fileUtils.get_ad...
TvOuwerkerk/evading-policy
Analysis/deleteResults.py
deleteResults.py
py
867
python
en
code
1
github-code
1
[ { "api_name": "fileUtils.get_data_path", "line_number": 5, "usage_type": "call" }, { "api_name": "fileUtils.get_csv_results_file", "line_number": 6, "usage_type": "call" }, { "api_name": "fileUtils.get_policy_results_file", "line_number": 7, "usage_type": "call" }, { ...
12194676789
# Databricks notebook source # MAGIC %%capture # MAGIC !pip install tf_slim # COMMAND ---------- import os import pickle import numpy as np from core import TEST_K, SEED, DATA_CLEAN_PATH, RES_PATH, SAVEMODEL_PATH from core.neural_based_methods.ncf.ncf_recommender import NCFRecommender from utils.evaluation import g...
ymengxu/KP_RecSys_Eval
run_ncf.py
run_ncf.py
py
4,589
python
en
code
0
github-code
1
[ { "api_name": "core.DATA_CLEAN_PATH.find", "line_number": 17, "usage_type": "call" }, { "api_name": "core.DATA_CLEAN_PATH", "line_number": 17, "usage_type": "name" }, { "api_name": "core.DATA_CLEAN_PATH", "line_number": 20, "usage_type": "name" }, { "api_name": "o...
30922424427
import logging import pyrax import sys # import pyconru # @UnusedImport logger = logging.getLogger(__name__) if __name__ == '__main__': # check authentication logger.debug('authenticated: %s' % pyrax.identity.authenticated) cs = pyrax.cloudservers server_name = "pyconru-%s" % pyrax.utils.random_a...
siso/pyconru
pyconru/cloudservernew.py
cloudservernew.py
py
884
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "pyrax.identity", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pyrax.cloudservers", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pyrax.ut...
35755402245
import pandas as pd from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.service import Service from selenium.webdriver.chrome.options import Options from webdriver_manager.chrome import ChromeDriverManager from ...
Dave-170/SIA_Checker_0.5
mian.py
mian.py
py
3,987
python
en
code
0
github-code
1
[ { "api_name": "tkinter.Tk", "line_number": 23, "usage_type": "call" }, { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 32, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 32, "usage_type": "name" }, { "api_name": "sele...
31708657528
''' Luigi Poker - Python Version This version of Luigi Poker should be used to be used in Discord Red. ''' import discord from random import randint from discord.ext import commands class Card: def __init__(self): self.__number = randint(1,6) self.__suit = self.__suit() def __suit(s...
themario30/MyPersonalCogs
LuigiPoker/LuigiPoker.py
LuigiPoker.py
py
13,688
python
en
code
0
github-code
1
[ { "api_name": "random.randint", "line_number": 14, "usage_type": "call" }, { "api_name": "discord.ext.commands.command", "line_number": 180, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 180, "usage_type": "name" }, { "api_name": "di...
14760552115
import sys from pathlib import Path import numpy as np import pandas as pd from loguru import logger import matplotlib.pyplot as plt from catboost import Pool from satio.utils.logs import proclogs from worldcereal.utils.spark import get_spark_context from worldcereal.utils.training import get_pixel_data from worldcer...
WorldCereal/worldcereal-classification
src/worldcereal/train/worldcerealpixelcatboost_realms.py
worldcerealpixelcatboost_realms.py
py
13,657
python
en
code
12
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 31, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 32, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 37, "usage_type": "call" }, { "api_name": "loguru.logger.info", "line...
38889833201
import cv2 import mediapipe as mp import math class HandDetector: """ Finds Hands using the mediapipe library. Exports the landmarks in pixel format. Adds extra functionalities like finding how many fingers are up or the distance between two fingers. Also provides bounding box info of th...
lironfarzam/Gestures-IO
branch_main/hand_tracking_module.py
hand_tracking_module.py
py
10,960
python
en
code
0
github-code
1
[ { "api_name": "mediapipe.solutions", "line_number": 26, "usage_type": "attribute" }, { "api_name": "mediapipe.solutions", "line_number": 30, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_number": 42, "usage_type": "call" }, { "api_name": "cv2.CO...
34506093536
from telegram.ext import Updater, MessageHandler, Filters, CommandHandler, ConversationHandler, CallbackContext from telegram import Update # Definindo os estados da conversa INICIO, AGUARDANDO_MENSAGEM = range(2) # Função para iniciar a conversa def iniciar(update: Update, context: CallbackContext) -> int: ...
MaykonSulivan/bot_telegram
bot.py
bot.py
py
1,615
python
pt
code
0
github-code
1
[ { "api_name": "telegram.Update", "line_number": 8, "usage_type": "name" }, { "api_name": "telegram.ext.CallbackContext", "line_number": 8, "usage_type": "name" }, { "api_name": "telegram.Update", "line_number": 15, "usage_type": "name" }, { "api_name": "telegram.e...
39155053663
import cv2 def getFrame(videoPath, svPath): cap = cv2.VideoCapture(videoPath) numFrame = 0 list_file = svPath + '/test.txt' f = open(list_file, 'w') while numFrame < 300: numFrame += 1 if cap.grab(): flag, frame = cap.retrieve() if not flag: ...
ZL92/Traffic-Violation-Detection
lane-detection/mp4tolist.py
mp4tolist.py
py
1,809
python
en
code
0
github-code
1
[ { "api_name": "cv2.VideoCapture", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.INTER_CUBIC", "line_number": 21, "usage_type": "attribute" }, { "api_name": "cv2.imencode", "l...
24363628668
import os import sys import requests import subprocess def pause_for_effect(): # Pause execution so the user sees what happened try: raw_input() except NameError: input() def parse_version(v): try: return [int(part) for part in v.split('.')] except ValueError: re...
sindrig/spoppy
spoppy/update_checker.py
update_checker.py
py
2,558
python
en
code
12
github-code
1
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 50, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 51, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
34736497418
""" Return a DataFrame containing the mould analysis dataset. Takes a DataFrame as input and applies functions from thefuzz and Levenshtien libraries, returning the mould analysis dataset DataFrame. Typical usage: ``` from steps.fuzzy_lookup import get_fuzzy_lookup get_fuzzy_lookup(df, key_...
Pobl-Group/mould-analysis
steps/fuzzy_lookup.py
fuzzy_lookup.py
py
3,084
python
en
code
7
github-code
1
[ { "api_name": "re.sub", "line_number": 37, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 38, "usage_type": "call" }, { "api_name": "re.escape", "line_number": 38, "usage_type": "call" }, { "api_name": "string.punctuation", "line_number": 38, ...
74137148193
"""Functions and utilities used to format the databases.""" import numpy as np import jax.numpy as jnp from scipy.integrate import quadrature import tools21cm as t2c def apply_uv_coverage(Box_uv, uv_bool): """Apply UV coverage to the data. Args: Box_uv: data box in Fourier space uv_bool: mask...
dprelogo/21cmRNN
rnn21cm/database.py
database.py
py
5,543
python
en
code
0
github-code
1
[ { "api_name": "numpy.empty", "line_number": 33, "usage_type": "call" }, { "api_name": "tools21cm.noise_model.get_uv_map", "line_number": 37, "usage_type": "call" }, { "api_name": "tools21cm.noise_model", "line_number": 37, "usage_type": "attribute" }, { "api_name"...
12614948759
import psycopg2 import md5 from moot.base import Base class UserAlreadyExistsException(Exception): def __init__(self, err): self.err = err def __str__(self): return 'Exception: ' + self.err class NoUserExistsException(Exception): def __init__(self, err): self.err = err def __s...
erinbleiweiss/Moot
moot/moot/mootdao.py
mootdao.py
py
7,906
python
en
code
0
github-code
1
[ { "api_name": "moot.base.Base", "line_number": 25, "usage_type": "name" }, { "api_name": "moot.base.Base.__init__", "line_number": 28, "usage_type": "call" }, { "api_name": "moot.base.Base", "line_number": 28, "usage_type": "name" }, { "api_name": "psycopg2.connec...
13044635908
import pytest import logging import tempfile from iotile.core.hw.hwmanager import HardwareManager from iotile.core.hw.transport.adapter.sync_wrapper import SynchronousLegacyWrapper from iotile.core.hw.transport import VirtualDeviceAdapter from iotile.core.utilities import BackgroundEventLoop from iotile_transport_socke...
iotile/coretools
transport_plugins/socket_lib/test/unix/conftest.py
conftest.py
py
2,316
python
en
code
14
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "iotile.core.utilities.BackgroundEventLoop", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 13, "usage_type": "call" }, { "api_na...
26207056174
from lib.model.Analysis import Analysis import base64 import jinja2 import os dirname = os.path.realpath(os.path.dirname(os.path.realpath(__file__))+'/../../') class ReportGenerator: @staticmethod def b64encode(text): return base64.b64encode(text).decode('utf8') def generate(self, path, param)...
Areizen/Android-Malware-Sandbox
lib/report/ReportGenerator.py
ReportGenerator.py
py
1,319
python
en
code
265
github-code
1
[ { "api_name": "os.path.realpath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "base64.b64encode", "li...
41573344919
import torch import torch.nn as nn from torch import optim import torch.nn.functional as F class myRNN(nn.Module): def __init__(self,input_size,hidden_size,num_layers): super(RNN, self).__init__() self.rnn = nn.RNN( input_size=input_size, hidden_size=hidden_size, # RNN隐藏神经...
stellar749/Singing-voice-conversion
Model.py
Model.py
py
734
python
en
code
4
github-code
1
[ { "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.RNN", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn", "line_number"...
44084478838
# Data Extraction packages import os import requests from bs4 import BeautifulSoup # stats per champion def extract_stats(): filename = "data/stats.txt" if os.path.isfile(filename): return stats_per_champion_url = 'https://www.op.gg/statistics/ajax2/champion/' stats_response = requests.post(...
jgabrielmaia-old/champion-pool-simplex
extraction/stats.py
stats.py
py
1,498
python
en
code
1
github-code
1
[ { "api_name": "os.path.isfile", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line...
415355000
# pylint: disable=too-many-lines import abc import os import sys import argparse import logging from urllib.parse import urlparse from typing import Optional, Dict, Any, Type import fsspec from jinja2 import Template from dae.import_tools.import_tools import MakefilePartitionHelper, \ construct_import_annotation...
iossifovlab/gpf
impala_storage/impala_storage/schema1/import_commons.py
import_commons.py
py
36,738
python
en
code
1
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 34, "usage_type": "call" }, { "api_name": "abc.abstractmethod", "line_number": 40, "usage_type": "attribute" }, { "api_name": "jinja2.Template", "line_number": 51, "usage_type": "call" }, { "api_name": "jinja2.Temp...
16239699644
import torch import torch.nn as nn import torch.nn.functional as F from modeling.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d from modeling.aspp import build_aspp from modeling.decoder import build_decoder from modeling.backbone import build_backbone from operations import ABN, NaiveBN class DeepLab(nn.Mod...
NoamRosenberg/autodeeplab
modeling/deeplab.py
deeplab.py
py
2,542
python
en
code
306
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "operations.ABN", "line_number": 19, "usage_type": "name" }, { "api_name": "operations.NaiveBN", ...
26767590300
#!/usr/bin/env python # coding: utf-8 # In[1]: #Output # In[2]: import cv2 import os from glob import * # In[3]: list_of_dirs = glob('./data/*/**.mp4') list_of_dirs # In[4]: list_of_dirs[0].split('\\') # In[5]: # alp_name = list_of_dirs[0].split('\\')[1] # d_name = 'frame/'+str(alp_name) # try: # ...
MdOmarFaruque/CNN-models-on-a-custom-Datastet
01_extract_image_.py
01_extract_image_.py
py
2,388
python
en
code
1
github-code
1
[ { "api_name": "os.mkdir", "line_number": 77, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 87, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 104, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "l...
19988464891
# -*- coding: utf-8 -*- import base64 from odoo import models, fields, api, tools from odoo.modules.module import get_resource_path #这个要去掉,直接利用odoo的,在设置中设置 class AnodooProduct(models.Model): _name = 'anodoo.product' _description = '产品描述和配置,单例实体' _rec_name = 'product_name' _order = 'id' def _...
anodoo/anodoo
base/anodoo_base/models/base_models.py
base_models.py
py
3,949
python
zh
code
12
github-code
1
[ { "api_name": "odoo.models.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 9, "usage_type": "name" }, { "api_name": "odoo.modules.module.get_resource_path", "line_number": 16, "usage_type": "call" }, { "api_name":...
8095027836
import torch import torch.nn as nn import torch.optim as optim import torchvision import torchvision.transforms as transforms import os import argparse from resnet import ResNet, BasicBlock from utils import progress_bar # Set up argument parser parser = argparse.ArgumentParser(description='PyTorch CIFAR10 Training') ...
fredc1/hpml-lab2
lab2.py
lab2.py
py
2,586
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch...
1667367088
import cv2 import numpy as np import torch from Pytorch_model.model_process import create_model from Pytorch_model.model_process import load_model from utils.image import get_affine_transform import time from torchvision.models.resnet import resnet18 from torch2trt.torch2trt import torch2trt class BaseDetector(objec...
kobewangSky/CenterNet_TensorRT_Nano
detectors/base_detector.py
base_detector.py
py
5,302
python
en
code
7
github-code
1
[ { "api_name": "torch.device", "line_number": 15, "usage_type": "call" }, { "api_name": "Pytorch_model.model_process.create_model", "line_number": 17, "usage_type": "call" }, { "api_name": "Pytorch_model.model_process.create_model", "line_number": 18, "usage_type": "call" ...
73564766754
from CSP import Constraint, ConstraintSatisfactionProblem, print_sudoku from typing import Dict, List, Optional import time import json # A map constraint is a two way constraint between two variables class MapConstraint(Constraint[str, str]): def __init__(self, place1: str, place2: str) -> None: super()....
grubtub19/ConstraintSatisfactionSolver
CSP_Runner.py
CSP_Runner.py
py
5,744
python
en
code
0
github-code
1
[ { "api_name": "CSP.Constraint", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 14, "usage_type": "name" }, { "api_name": "CSP.Constraint", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.List", "line_numb...
14666186834
# Imported Libraries import numpy as np import matplotlib.pyplot as plt ''' I want to compute the sum over time of the mass density for radiation form black hole accretion and from HMXB emission. This is a replica of figure 10 from Jeon et al. 2014. ''' ''' Importing data files of the highest lines from the top and ...
higgins4286/First-Population-of-Stars
Xray_Jeon_Replica.py
Xray_Jeon_Replica.py
py
2,961
python
en
code
0
github-code
1
[ { "api_name": "numpy.loadtxt", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplo...
11479830806
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import numpy as np import cv2 import io import requests from PIL import Image import pdb from skimage.transform import resize import matplotlib.pyplot as plt import math import random import collections import xml.etree.ElementTree as ET from sklearn.metrics import pre...
santoshreddy254/Localization-of-Objects-Using-Unsupervised-Representation-Learning-and-Object-Proposal-Techniques
utils/gradcam.py
gradcam.py
py
8,719
python
en
code
2
github-code
1
[ { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "numpy.ascontiguousarray", "line_number": 128, "usage_type": "call" }, { "api_name": "numpy.transpose", "line_number": 128, "usage_type": "call" }, { "api_name": "torch.from_n...
74538785312
import os import subprocess import sys import pytest from conftest import cache_clear import chartpress from chartpress import PRERELEASE_PREFIX, yaml def check_version(tag): chartpress._fix_chart_version(tag, strict=True) def test_git_repo_fixture(git_repo): # assert we use the git repo as our current wo...
jupyterhub/chartpress
tests/test_repo_interactions.py
test_repo_interactions.py
py
18,231
python
en
code
50
github-code
1
[ { "api_name": "chartpress._fix_chart_version", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.realpath", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.getcwd...
911740610
from django.http import HttpResponse from django.shortcuts import render,redirect import requests import urllib.parse # Create your views here. def home(request): if 'username' in request.session: return render(request,'home.html') else: return redirect(login) def login(request): if request...
nitsuh21/clienttest
home/views.py
views.py
py
5,633
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 9, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 18, "usage_type": "call" }, { "api_name": "reques...
34539016350
import librosa import numpy as np import matplotlib.pyplot as plt import scipy as sp from sklearn.metrics import accuracy_score, confusion_matrix import seaborn as sns import pandas as pd from sklearn.decomposition import PCA from scipy.signal import hamming import scipy.signal.windows def segment_vowel_silence(audio...
YukiTinNguyen/XLTHS
Bai2Trinh.py
Bai2Trinh.py
py
10,259
python
vi
code
0
github-code
1
[ { "api_name": "librosa.util.frame", "line_number": 16, "usage_type": "call" }, { "api_name": "librosa.util", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.sum", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.square", "li...
12095751954
# -*- coding: utf-8 -*- import azureml.core from azureml.core import Experiment, Workspace def main(): print('Testing Azure ML with a standalone Python script') # Load the workspace from the saved config file ws = Workspace.from_config() print('Ready to use Azure ML {} to work with {}'.format(azur...
ThordurPall/MLOpsExercises
src/azure/azure_test_standalone_script.py
azure_test_standalone_script.py
py
1,173
python
en
code
0
github-code
1
[ { "api_name": "azureml.core.Workspace.from_config", "line_number": 10, "usage_type": "call" }, { "api_name": "azureml.core.Workspace", "line_number": 10, "usage_type": "name" }, { "api_name": "azureml.core.core", "line_number": 11, "usage_type": "attribute" }, { "...
9991795351
from tkinter import* from tkinter import ttk from PIL import Image, ImageTk from attendance import Attendance from student import Student import os from face_recognition import Face_Recognition from train import Train class Face_Recognition_System_Student: def __init__(self,root): self.root=root ...
KhushiGoyal123/face-recognition-student-attendance-system
main_student.py
main_student.py
py
3,603
python
en
code
1
github-code
1
[ { "api_name": "PIL.Image.open", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 19, "usage_type": "name" }, { "api_name": "PIL.Image.ANTIALIAS", "line_number": 20, "usage_type": "attribute" }, { "api_name": "PIL.Image", "li...
32395021882
from django.db import models #import datetime # Create your models here. BLACKLISTED_SHORTCUT_NAMES = ("admin","api") class shortcut(models.Model): shortcut_key = models.CharField(max_length=20,help_text="Key of the shortcut") shortcut_value = models.URLField(help_text="The target of the shortcut") # URL of ...
Emojigit/shortcuts
main/models.py
models.py
py
1,447
python
en
code
0
github-code
1
[ { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 9, "usage_type": "call" }, { "api_name": "...
31637283761
import json from starter.objects import Starter, default_workflow_params from starter.starter_helper import NullRequiredDataException """ Amazon SWF PostPerfectPublication starter, for API and Lens publishing etc. """ class starter_PostPerfectPublication(Starter): def __init__(self, settings=None, logger=None): ...
elifesciences/elife-bot
starter/starter_PostPerfectPublication.py
starter_PostPerfectPublication.py
py
1,674
python
en
code
19
github-code
1
[ { "api_name": "starter.objects.Starter", "line_number": 10, "usage_type": "name" }, { "api_name": "starter.objects.default_workflow_params", "line_number": 17, "usage_type": "call" }, { "api_name": "starter.starter_helper.NullRequiredDataException", "line_number": 20, "us...
704341784
import requests from bs4 import BeautifulSoup import json link=requests.get("https://www.rottentomatoes.com/top/bestofrt/top_100_animation_movies/") data=BeautifulSoup(link.text,"html.parser") def movieData(): list=[] x=0 mainDiv=data.find("div",class_="body_main container") subDiv=mainDiv.find("table",...
Deepa-DD/web_scraping
Task1.py
Task1.py
py
1,279
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 5, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 32, "usage_type": "call" } ]
34652128255
from django import template from selia_templates.custom_tags.components.base import ComplexNode def tab(parser, token): content = parser.parse(('endtab',)) parser.delete_first_token() try: _, url = token.split_contents() except ValueError: raise template.TemplateSyntaxError( ...
CONABIO-audio/selia-templates
selia_templates/custom_tags/components/navbars.py
navbars.py
py
522
python
en
code
0
github-code
1
[ { "api_name": "django.template.TemplateSyntaxError", "line_number": 12, "usage_type": "call" }, { "api_name": "django.template", "line_number": 12, "usage_type": "name" }, { "api_name": "selia_templates.custom_tags.components.base.ComplexNode", "line_number": 16, "usage_t...
30739211294
from typing import List from fastapi import APIRouter, HTTPException from ..models.user import User from ..models.review import UserReview, Movie from ..schemas.review import ( MovieResponseModel, MovieRequestModel, ReviewRequestModel, ReviewRequestPutModel, ReviewResponseModel ) router = APIRouter(prefix='/revie...
Zozi96/api-fast
app/routers/review.py
review.py
py
2,606
python
en
code
0
github-code
1
[ { "api_name": "fastapi.APIRouter", "line_number": 10, "usage_type": "call" }, { "api_name": "schemas.review.MovieRequestModel", "line_number": 14, "usage_type": "name" }, { "api_name": "models.review.Movie.create", "line_number": 15, "usage_type": "call" }, { "api...
9621780474
import os import glob from bs4 import BeautifulSoup,Comment import urllib.request import requests import json uri = "https://www.carcomplaints.com/" #read the webpage and store it as a string webpage = urllib.request.urlopen(uri).read() soup = BeautifulSoup(webpage,'html.parser') #find all the <a> tags which consis...
ShreyashAF2704/RaH-Project
Scrapers/Cars_Complaint_Scraper.py
Cars_Complaint_Scraper.py
py
7,859
python
en
code
0
github-code
1
[ { "api_name": "urllib.request.request.urlopen", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 11, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 11, "usage_type": "name" }, { "api_nam...
30025220732
import csv import datetime def mark_attendance(student_id): timestamp = datetime.datetime.now() date = timestamp.date() time = timestamp.time() attendance_file = f"attendance_{date}.csv" file_exists = check_file_exists(attendance_file) with open(attendance_file, mode='a', newline='...
JAINMOHIT23/PROJECT-Bharat-Intern
PROJECT/attendance tracking.py
attendance tracking.py
py
1,135
python
en
code
0
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 5, "usage_type": "attribute" }, { "api_name": "csv.writer", "line_number": 13, "usage_type": "call" }, { "api_name": "csv.reader", ...
41612546375
import os import shutil from typing import List, Tuple import pytest from src.models.running_token import RunningToken from src.models.token import Token # folder names and paths of all test files test_files_folder_name = 'test_files' xml_files_folder_name = 'xml' temp_xml_files_folder_name = 'temp_xml' def pytes...
rathaustreppe/bpmn-analyser
test/conftest.py
conftest.py
py
3,398
python
en
code
3
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.join", "line...
22034815063
import os import cv2 from WordSegmentation import wordSegmentation, prepareImg def main(): """reads images from data/ and outputs the word-segmentation to out/""" # read input images from 'in' directory path = os.getcwd() imgFiles = os.listdir(path + '/out/') direc = 'segmented words' os.mkdir(os.path.join(path,...
sanchitjain002/Handwritten
main1.py
main1.py
py
2,286
python
en
code
0
github-code
1
[ { "api_name": "os.getcwd", "line_number": 9, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 10, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 12, ...
30766428537
import logging from django.core.exceptions import ObjectDoesNotExist from django.forms.models import model_to_dict from core.services.file_interface.file_interface import FileInterface from core.services.git_interface.git_auth import OAuth2Token from core.models import Folder, FolderRepo, File # from core.services.t...
meoook/Abyss-Translate
back/core/services/folder_interface.py
folder_interface.py
py
7,781
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "core.services.git_interface.git_interface.GitInterface", "line_number": 22, "usage_type": "call" }, { "api_name": "core.models.Folder.objects.get", "line_number": 24, "usage_type"...
30533875447
from django import template register = template.Library() @register.filter def rating(digit): try: digit = int(digit/2) value = [1 for x in range(digit)] for i in range(len(value),5): value.append(0) return value except: return [00000]
SkyRiS3s/Database-Project
blog/templatetags/extra_tags.py
extra_tags.py
py
297
python
en
code
0
github-code
1
[ { "api_name": "django.template.Library", "line_number": 3, "usage_type": "call" }, { "api_name": "django.template", "line_number": 3, "usage_type": "name" } ]
26940616488
from common import read from prime import is_prime ''' main block that accepts upper and lower limit. Finds the prime numbers within this range. ''' def main() : lower = read('Enter the lower range.\n') upper = read('Enter the upper range.\n') print(f'\nPrime numbers within the range ({lower},{upper}) are:...
Vi5iON/Cumulation
prime_series.py
prime_series.py
py
476
python
en
code
0
github-code
1
[ { "api_name": "common.read", "line_number": 9, "usage_type": "call" }, { "api_name": "common.read", "line_number": 10, "usage_type": "call" }, { "api_name": "prime.is_prime", "line_number": 13, "usage_type": "call" } ]
30036989484
#!/usr/bin/env python3 import json import os import codecs from werkzeug.utils import secure_filename from flask import Flask, render_template, request, flash, redirect, send_from_directory, make_response, Markup app = Flask(__name__) app.secret_key = "super secret key" app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * ...
cwirks01/NLP_Project
Lib/Dev/main_test.py
main_test.py
py
1,371
python
en
code
1
github-code
1
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 13, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 21...
39616087477
__author__ = 'jeremyma' import os import cPickle from frontend import frontend import sys, pdb import config import time import numpy as np from scipy.misc import logsumexp from gmmmc import GMM import sklearn.mixture from gmmmc import MarkovChain, AnnealedImportanceSampling import logging import bob.bio.gmm.algorithm ...
jeremy-ma/bayesian-speaker-verification
system/mcmc_system.py
mcmc_system.py
py
9,837
python
en
code
3
github-code
1
[ { "api_name": "bob.bio.gmm.algorithm.GMM", "line_number": 26, "usage_type": "call" }, { "api_name": "gmmmc.GMM", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "logging.info", "l...
19706165449
from django.test import TestCase from .forms import RecipeDetail class TestForms(TestCase): def test_recipe_detail(self): form = RecipeDetail({'name': '', 'ingredients': '', 'directions': ''}) self.assertFalse(form.is_valid()) self.assertIn('name', form.errors.keys()) self.assertE...
Kat24C/recipe
recipes/test_forms.py
test_forms.py
py
623
python
en
code
0
github-code
1
[ { "api_name": "django.test.TestCase", "line_number": 5, "usage_type": "name" }, { "api_name": "forms.RecipeDetail", "line_number": 8, "usage_type": "call" }, { "api_name": "forms.RecipeDetail", "line_number": 14, "usage_type": "call" } ]
5139072916
import speech_recognition as sr import sys import os import time os.system('espeak "{}"'.format("hello shivang, we welcome you to this device, Have a great time")) os.system('espeak "{}"'.format("When you want to close your devise please say stop")) os.system('espeak "{}"'.format("Say start to start your devise")...
32shivang/Blind-Eye
speech_to_text.py
speech_to_text.py
py
1,185
python
en
code
0
github-code
1
[ { "api_name": "os.system", "line_number": 5, "usage_type": "call" }, { "api_name": "os.system", "line_number": 6, "usage_type": "call" }, { "api_name": "os.system", "line_number": 7, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_...
22873473584
from playwright.sync_api import sync_playwright from time import sleep def clicker(path): page.click(path) def input_text(path, text): page.fill(path, text) email = "your email" senha = "your key" while True: print('start btc') with sync_playwright() as p: browser = p.chromium.launch() ...
AllanCristiano/botFreeBtcNoCaptcha
main.py
main.py
py
1,062
python
en
code
0
github-code
1
[ { "api_name": "playwright.sync_api.sync_playwright", "line_number": 19, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 23, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 29, "usage_type": "call" }, { "api_name": "time.sleep"...
30491801057
__author__ = 'breddels' import logging logger = logging.getLogger("vaex.file") import vaex.file.other def can_open(path, *args, **kwargs): for name, class_ in list(vaex.file.other.dataset_type_map.items()): if class_.can_open(path, *args): return True def open(path, *args, **kwargs): dataset_class = None fo...
Al33Bundy/Vaex
vaex/file/__init__.py
__init__.py
py
639
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 3, "usage_type": "call" }, { "api_name": "vaex.file.other.file.other.dataset_type_map.items", "line_number": 8, "usage_type": "call" }, { "api_name": "vaex.file.other.file", "line_number": 8, "usage_type": "attribute" },...
34277876627
from django.urls import path from .views import ( PostList, PostSearch, PostDetail, PostCreate, PostUpdate, PostDelete, AppointmentView, CategoryListView, subscribe, ) from django.contrib.auth.views import LogoutView, LoginView from django.contrib.auth.decorators import login_required from sign.views imp...
dimasiksergeevi4/newspaper
news/urls.py
urls.py
py
1,530
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "views.PostList.as_view", "line_number": 12, "usage_type": "call" }, { "api_name": "views.PostList", "line_number": 12, "usage_type": "name" }, { "api_name": "django.urls.pa...
11910534693
from flask import jsonify, request from app.models import Manufacturer, Pharmacokinetic_properties, Token from app import db def updatePharmacokinetic(): '''update pharmacokinetic properties record''' data = request.get_json() token = request.headers['TOKEN'] id=int(data['id']) t=Token.query....
the1Prince/drug_repo
app/updates/updatePharmacokineticProps.py
updatePharmacokineticProps.py
py
1,978
python
en
code
0
github-code
1
[ { "api_name": "flask.request.get_json", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 7, "usage_type": "name" }, { "api_name": "flask.request.headers", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.re...
2427092929
from src.dataset.create_dataset import DataframePrepAllMod from src.constants.constants import * from src.model.model import ConvModel, train_cp from src.utils.cross_val import TrainTestSplitter from src.utils.utils import * import tensorflow as tf import argparse import os def main(args): device = "GPU" if tf....
dheerajpr97/Explainable-AI-Non-EEG
train.py
train.py
py
5,465
python
en
code
0
github-code
1
[ { "api_name": "tensorflow.config.list_physical_devices", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.config", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_number": 18, "usage_type": "call" }, { "api...
22525713243
from setuptools import setup with open("README.md") as f: readme = f.read() setup( name="dpr", version="1.0.0", description="Facebook AI Research Open Domain Q&A Toolkit", url="https://github.com/facebookresearch/DPR/", classifiers=[ "Intended Audience :: Science/Research", "Li...
microsoft/LMOps
uprise/DPR/setup.py
setup.py
py
930
python
en
code
2,623
github-code
1
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" } ]
35462627946
import argparse import cv2 import random import time #constructing arguements ap=argparse.ArgumentParser() ap.add_argument("-i","--image",required=True,help="path to the input image") ap.add_argument("-m","--method",type=str,default="fast",choices=["fast","quality"],help="selective search method") args=vars(ap.parse_a...
Gaurav4604/MachineLearning-mainly-object-detection
Selective Search using OpenCV/selective_search.py
selective_search.py
py
1,713
python
en
code
1
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.ximgproc.segmentatio...
24231103307
# We are U19886 ## Imports & pre-proceessing import os import networkx as nx import matplotlib.pyplot as plt from matplotlib import pylab import numpy as np import pickle os.chdir('desktop/ELU 501 data science') ## Loading the graph G = nx.read_gexf("mediumLinkedin.gexf") ## Loading the data colleges = {} locat...
mehdah/ELU-501-Data-Science
ELU 501 Challenge 1.py
ELU 501 Challenge 1.py
py
3,106
python
en
code
0
github-code
1
[ { "api_name": "os.chdir", "line_number": 12, "usage_type": "call" }, { "api_name": "networkx.read_gexf", "line_number": 16, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 26, "usage_type": "call" }, { "api_name": "pickle.load", "line_numbe...
9930223943
from tqdm import tqdm import json import numpy as np import torch import torch.nn as nn LABEL2ID = { "NO-LABEL": 0, "обеспечение исполнения контракта": 1, "обеспечение гарантийных обязательств": 2 } class TokenCLFModel(torch.nn.Module): def __init__(self, pretrained_model, droupout=0.5, num_clas...
aebogdanova/text-fragment-extraction
scripts/TokenCLF/train.py
train.py
py
6,755
python
en
code
0
github-code
1
[ { "api_name": "torch.nn", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn.Dropout", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 18, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_n...
5928114479
import math import torch from ocpmodels.modules.scaling import ScaleFactor from .atom_update_block import AtomUpdateBlock from .base_layers import Dense, ResidualLayer from .efficient import EfficientInteractionBilinear from .embedding_block import EdgeEmbedding class InteractionBlock(torch.nn.Module): """ ...
Open-Catalyst-Project/ocp
ocpmodels/models/gemnet_oc/layers/interaction_block.py
interaction_block.py
py
23,399
python
en
code
518
github-code
1
[ { "api_name": "torch.nn", "line_number": 13, "usage_type": "attribute" }, { "api_name": "base_layers.Dense", "line_number": 95, "usage_type": "call" }, { "api_name": "torch.nn.ModuleList", "line_number": 171, "usage_type": "call" }, { "api_name": "torch.nn", "...
1311232607
"""Module containing class for collection of cases""" from typing import Union, List, Dict from sumo.wrapper import SumoClient from fmu.sumo.explorer.objects._document_collection import DocumentCollection from fmu.sumo.explorer.objects.case import Case from fmu.sumo.explorer.pit import Pit _CASE_FIELDS = [ "_id", ...
equinor/fmu-sumo
src/fmu/sumo/explorer/objects/case_collection.py
case_collection.py
py
4,117
python
en
code
0
github-code
1
[ { "api_name": "fmu.sumo.explorer.objects._document_collection.DocumentCollection", "line_number": 18, "usage_type": "name" }, { "api_name": "sumo.wrapper.SumoClient", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 21, "usage_type": ...
24295593369
from itertools import combinations def isPrime(number): if number < 2: return False else: for num in range(2, number): if number % num == 0: return False return True def Prime(n): prime_num = [] for num in range(n): if isPrime(num): ...
HyunSung-Na/TIL-algorism
알고리즘/3주 모의고사 소수.py
3주 모의고사 소수.py
py
646
python
en
code
0
github-code
1
[ { "api_name": "itertools.combinations", "line_number": 21, "usage_type": "call" } ]
38819126631
from flask import Flask, render_template, request import jsonify import requests import pickle import numpy as np import sklearn app = Flask(__name__) model = pickle.load(open('insurance_rf.pkl', 'rb')) @app.route('/') def home(): return render_template('index.html') @app.route("/predict", methods=['POST']) def ...
helloraghav1305/Medical-Insurance-Forecast
app.py
app.py
py
1,540
python
en
code
1
github-code
1
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request.method", ...
71547921315
import subprocess as sp from collections import defaultdict import numpy as np import pandas as pd import argparse import pickle import os import re ''' This script creates feature matrix from VCF files for downstream ML analysis ''' parser=argparse.ArgumentParser(description='Append MIC phenotype to MIC dataframe') ...
SSID08/ML_thesis
Scripts/Append_MIC_Phenotype.py
Append_MIC_Phenotype.py
py
1,205
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pandas.Series",...
37453131182
import numpy as np from qiskit import Aer, QuantumCircuit from qiskit.circuit import Parameter from qiskit.circuit.library import RealAmplitudes, ZZFeatureMap from qiskit.opflow import StateFn, PauliSumOp,AerPauliExpectation,ListOp,Gradient from qiskit.utils import QuantumInstance,algorithm_globals algorithm_globals...
Rin-The-QT-Bunny/quantum_networks
basic_qnns.py
basic_qnns.py
py
1,572
python
en
code
0
github-code
1
[ { "api_name": "qiskit.utils.algorithm_globals.random_seed", "line_number": 10, "usage_type": "attribute" }, { "api_name": "qiskit.utils.algorithm_globals", "line_number": 10, "usage_type": "name" }, { "api_name": "qiskit.opflow.AerPauliExpectation", "line_number": 13, "us...
727123219
from RadialBasisFunction import * import numpy as np from sklearn import datasets C=3 F=2 X,Y = datasets.make_classification( n_features=C, n_classes=F, n_samples=200, n_redundant=0, n_clusters_per_class=1 ) X=X.T Y=np.array([Y]) RBF =RadialBasisFunction(C,4) RBF.Train(X,Y,5,100)
dani2442/DeepLearning
RadialBasisFunction/test.py
test.py
py
305
python
en
code
2
github-code
1
[ { "api_name": "sklearn.datasets.make_classification", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" } ]
39631632894
import os from pathlib import Path from unittest.mock import patch import pytest import pytest_check as check import yaml from msticpy.config.comp_edit import CompEditStatusMixin from msticpy.config.ce_azure_sentinel import CEAzureSentinel, _validate_ws from msticpy.config.ce_common import get_def_tenant_id from mstic...
sh9369/msticpy
tests/config/test_item_editors.py
test_item_editors.py
py
12,896
python
en
code
null
github-code
1
[ { "api_name": "msticpy.config.comp_edit.CompEditStatusMixin.testing", "line_number": 30, "usage_type": "attribute" }, { "api_name": "msticpy.config.comp_edit.CompEditStatusMixin", "line_number": 30, "usage_type": "name" }, { "api_name": "msticpy.config.mp_config_control.get_mpcon...
4699497508
import os import sys import json import requests from dotenv import load_dotenv load_dotenv() try: path = sys.argv[1] except IndexError: path = input('Path to .md file:\n') with open(path, 'r') as file: md_text = file.read() TOKEN = os.getenv('TOKEN') URL = 'https://api.github.com/markdown' HEADERS = {...
eo-uk/markdown-to-html-converter
main.py
main.py
py
1,302
python
en
code
0
github-code
1
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.post", "line_n...
6874429677
from functools import reduce numeros = input("ingrese numeros:") numerosEnList = sorted(numeros) print(numerosEnList) numerosImpares = [] for i in numerosEnList: if int(i) % 2 != 0: numerosImpares.append(int(i)) print(numerosImpares) def suma(a, b): return a + b resultado = reduce(suma, num...
Guido564/open-bootcamp-fullstack
Python/Modulo 9/tarea2.py
tarea2.py
py
352
python
pt
code
0
github-code
1
[ { "api_name": "functools.reduce", "line_number": 17, "usage_type": "call" } ]
16098184030
import pygame import datetime pygame.init() WIDTH=1080 HEIGHT=720 screen = pygame.display.set_mode((WIDTH, HEIGHT)) clock=pygame.image.load("images/main-clock.png").convert() scale_clock = pygame.transform.scale( clock, (clock.get_width() // 2, clock.get_height() // 2)) clockr=scale_clock.get_rect(ce...
aminazhumabayeva/PP2
lab7/1clock.py
1clock.py
py
1,400
python
en
code
0
github-code
1
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.image.loa...
25845095235
# Creating a Bouncing Ball Screensaver using OpenCV-Python # Task- Create a Window that we can write text on. If we don’t write for 5 seconds screensaver will start. import cv2 import numpy as np def screensaver(): img = np.zeros((480,640,3),dtype='uint8') dx,dy =1,1 x,y = 100,100 while True: ...
aryaniiit002/Computer-Vision
Basic Programs/screensaver.py
screensaver.py
py
1,769
python
en
code
2
github-code
1
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 15...
2036561592
import numpy as np import gudhi import gudhi.representations import cv2 from skimage.feature import local_binary_pattern def img_gray(path): img = cv2.imread(path) h,w = img.shape[:2] #获取图片的high和wide img_gray=np.zeros([h,w],img.dtype) #创建一张和当前图片大小一样的单通道图片 for i in range(h): for j in range(w): m...
Yuhan0524/TDA_face_morph_detection
get_features.py
get_features.py
py
1,594
python
en
code
1
github-code
1
[ { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 10, "usage_type": "call" }, { "api_name": "skimage.feature.local_binary_pattern", "line_number": 22, "usage_type": "call" }, { "api_name": "gudhi.Rips...
4223512763
import numpy as np import pandas as pd import imageio as io from skimage.measure import label, regionprops from skimage.color import label2rgb,gray2rgb from skimage.segmentation import watershed import cv2 import os import scipy.ndimage as ndi def watershedSegStack(seg_stack,num_lesions,postprocess_dir,cam_num): ...
mattposka/PDPS
postprocess.py
postprocess.py
py
7,502
python
en
code
0
github-code
1
[ { "api_name": "numpy.sum", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cv2.imwrite", "line_number": ...
4384202526
''' RESPONSE WITH HTML CONTENTS Let's response with our first web page written in HTML. We know nothing about HTML. It is the language used for the creating web pages,that describes the structure of the document. Web browsers receive HTML documents from a web server or from local storage and render the documents int...
helenyaben/2018-19-PNE-practices
PNE-Session11/HTML_response.py
HTML_response.py
py
3,059
python
en
code
0
github-code
1
[ { "api_name": "termcolor.cprint", "line_number": 38, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 79, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 79, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM...
70802571555
from sys import platform import pandas as pd import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.metrics.pairwise import cosine_similarity from tabulate import tabulate import string import settings df = pd.read_csv("Cleaned_dataset.csv") df = df.iloc[0:10000,:] features = ['N...
kusai99/Game-Recommendation-system
GameRec.py
GameRec.py
py
3,958
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.platform", "line_number": 73, "usage_type": "name" }, { "api_name": "sys.platform", "line_number": 74, "usage_type": "name" }, { "api_name": "sys.platform", "line_num...
25587263944
from flask import Flask, request, render_template import numpy as np import tensorflow as tf from tensorflow.keras.preprocessing import image import os app = Flask(__name__) # Get the absolute path to your application's directory #app_directory = os.path.dirname(os.path.abspath(__file__)) # Construct the absolute pa...
Aravind0510/plant_disease
app.py
app.py
py
2,650
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.models.load_mod...
2733857930
import requests from bs4 import BeautifulSoup import os #os.chdir('~/crawl') from selenium import webdriver from selenium.webdriver import FirefoxOptions from selenium.webdriver.common.by import By opts = FirefoxOptions() opts.add_argument("--headless") browser = webdriver.Firefox(firefox_options=opts) #browser = webd...
elSomewhere/AnalyticsTextGen_DL
crawl_SKA.py
crawl_SKA.py
py
1,701
python
en
code
0
github-code
1
[ { "api_name": "selenium.webdriver.FirefoxOptions", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "ap...
41285122264
from __future__ import unicode_literals import json import datetime from django.template.defaultfilters import escape from program.models import Program from notification.models import Notif from ourjseditor import api from .models import Comment # /program/PRO_ID/comment/new @api.StandardAPIErrors("POST") @api.lo...
OurJSEditor/OurJSEditor
django_code/comment/api.py
api.py
py
5,876
python
en
code
29
github-code
1
[ { "api_name": "json.loads", "line_number": 18, "usage_type": "call" }, { "api_name": "models.Comment.objects.get", "line_number": 27, "usage_type": "call" }, { "api_name": "models.Comment.objects", "line_number": 27, "usage_type": "attribute" }, { "api_name": "mod...
4246358935
import pandas as pd import re from utils import ANALYTICS_DATASET, ENVIRONMENT_SHORT_NAME def get_data_archiving(sql_file): """Run SQL query and save data in a dataframe.""" params = {"{{ANALYTICS_DATASET}}": ANALYTICS_DATASET} file = open(sql_file, "r") sql = file.read() for param, table_name ...
pass-culture/data-gcp
jobs/etl_jobs/external/metabase-archiving/archiving.py
archiving.py
py
6,570
python
en
code
2
github-code
1
[ { "api_name": "utils.ANALYTICS_DATASET", "line_number": 9, "usage_type": "name" }, { "api_name": "pandas.read_gbq", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 31, "usage_type": "call" }, { "api_name": "utils.ENVIR...
16805215564
import multiprocessing as mp from parallel_data_processing.parallel_join.hash_join import hash_join def range_partition(data, range_indices): result = [] new_data = data[:] new_data=sorted(new_data,key=lambda new_data:new_data[1]) # Calculate the number of bins range_index = len(range_indices) ...
OceanicSix/Python_program
parallel_data_processing/parallel_join/disjoint.py
disjoint.py
py
2,271
python
en
code
1
github-code
1
[ { "api_name": "multiprocessing.Pool", "line_number": 48, "usage_type": "call" }, { "api_name": "parallel_data_processing.parallel_join.hash_join.hash_join", "line_number": 51, "usage_type": "argument" } ]
31325561176
import glob import os import corner import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy.stats import matplotlib.lines as mlines VIOLET_COLOR = "#8E44AD" BILBY_BLUE_COLOR = '#0072C1' PARAMS = dict( # chi_eff=dict(l=r"$\chi_{eff}$", r=(-1, 1)), # chi_p=dict(l=r"$\chi_{p}$", r=(...
avivajpeyi/bh_getting_kicks
creating_an_agn_prior/add_agn_spins_to_samples.py
add_agn_spins_to_samples.py
py
3,970
python
en
code
0
github-code
1
[ { "api_name": "numpy.pi", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 24, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_numbe...
38202371506
from datetime import datetime, timedelta import requests import json import eel @eel.expose def ten_newest_question(tag): url = "http://api.stackexchange.com/2.2/search?order=desc&sort=creation&tagged=" + tag + \ "&site=stackoverflow&filter=withbody&pagesize=10" data = requests.get(url).js...
Taichi-Pink/Android-related-questions-Stackoverflow
Web.py
Web.py
py
954
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 14, "usage_type": "call" }, { "api_name": "eel.expose", "line_number": 7, "usage_type": "attribute" }, { "api_name": "datetime.datetime.today", "...
29520479895
import pytest import requests @pytest.fixture def api_base_address(): return "http://localhost:5000" @pytest.fixture def pq_data(): return [(0, 4), (1, 7)] @pytest.fixture def pq_get_data(): return {"highest": {"index": 1, "key": 7}, "content": [ {"index": 1, "key": 7}, {"index": 0, "key": 4} ...
AlanKev117/demo-restful-api
test/test_api.py
test_api.py
py
2,189
python
en
code
0
github-code
1
[ { "api_name": "pytest.fixture", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pytest.fixture", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pytest.fixture", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pytest.fix...
6912998800
#!/usr/bin/env python3 import collections import os import subprocess DATE = "2022-01-01" BRANCH = 'main' print("Statistics on the %s branch after %s" % (BRANCH, DATE)) print("cwd: %s" % os.getcwd()) proc = subprocess.run(['git', 'log', '--after=%s' % DATE, BRANCH], stdout=subprocess.PIPE, ...
vstinner/misc
python/git_commit_stats.py
git_commit_stats.py
py
657
python
en
code
22
github-code
1
[ { "api_name": "os.getcwd", "line_number": 10, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 12, "usage_type": "attribute" }, { "api_name": "collections.Counter", ...
15111556685
import argparse import zipfile import io from lxml import etree namespace = "{http://schemas.microsoft.com/3dmanufacturing/core/2015/02}" if __name__ == "__main__": parser = argparse.ArgumentParser(description='Strip metadata from 3MF files') parser.add_argument('source', metavar='source', type=str, nargs='...
nallath/3MFMetadataStripper
stripMetadata.py
stripMetadata.py
py
1,789
python
en
code
1
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 21, "usage_type": "call" }, { "api_name": "zipfile.ZIP_DEFLATED", "line_number": 21, "usage_type": "attribute" }, { "api_name": "lxm...
40888320190
from tkinter import simpledialog import math import pygame pygame.init() tamanho = (850, 560) tela = pygame.display.set_mode(tamanho) pygame.display.set_caption("Space Marker") # Definir o ícone da janela icone = pygame.image.load("space.png") pygame.display.set_icon(icone) fundo = pygame.image.load("bg.jpg") pygame...
biecoski/spacemaker
main.py
main.py
py
4,644
python
pt
code
0
github-code
1
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.display.s...
31509541216
from django.db import models from django.shortcuts import reverse from django.utils import timezone from django.contrib.auth.models import User class Callout(models.Model): BWD = 'BWD' CCH = 'CCH' HND = 'HND' SYO = 'SYO' FACILITY = ( (BWD, 'BWD'), (CCH, 'CCH'), (HND, 'HND')...
Megaprotas/work_project
my_app/models.py
models.py
py
2,445
python
en
code
0
github-code
1
[ { "api_name": "django.db.models.Model", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 45, "usage_type": "call" }, { "api_name":...
17145944405
import json import random import re import string import sys from json import JSONDecodeError from entities import ConfigEntity, UserEntity from network import exponential_backoff_request API_URL = 'http://127.0.0.1:8000' API_METHOD_SIGNUP = '/api/signup' API_METHOD_SIGNIN = '/api/token/' API_METHOD_CREATE_POST = '/a...
Omkommersind/drf_template_bot
bot.py
bot.py
py
3,957
python
en
code
0
github-code
1
[ { "api_name": "json.load", "line_number": 21, "usage_type": "call" }, { "api_name": "entities.ConfigEntity", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 24, "usage_type": "call" }, { "api_name": "json.JSONDecodeError", "...
35110283677
import threading from mqtt_utils import publish_single #, subscribe_callback import config import time import json import paho.mqtt.client as mqtt import ssl import config class ApproveThread(threading.Thread): def __init__(self, gameId, amount_of_players, cb, playerId=None, amountXRT=0): super(ApproveThr...
Vourhey/aira-monopoly-server
approve.py
approve.py
py
2,272
python
en
code
1
github-code
1
[ { "api_name": "threading.Thread", "line_number": 11, "usage_type": "attribute" }, { "api_name": "paho.mqtt.client.Client", "line_number": 26, "usage_type": "call" }, { "api_name": "paho.mqtt.client", "line_number": 26, "usage_type": "name" }, { "api_name": "config...
2016504957
from __future__ import division import sys from math import* import numpy from numpy import* import random from matplotlib import pyplot as plt R=10**12 #cm Radius Tau=10 #Opacity Lambda=R/Tau #Mean Free Path c=3.0*10**9 #cm/s nph=10000 TimeS=numpy.empty(nph) for p in range(nph): i=1 ...
chatcher99/Cassandra_Hatcher
Finished Thesis Codes (Unused)/Timing Scattered Photons in Star.py
Timing Scattered Photons in Star.py
py
1,892
python
en
code
0
github-code
1
[ { "api_name": "numpy.empty", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.arccos", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.random", "line_n...
71015854435
from collections import deque class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Codec: def serialize(self, root) -> str: if not root: return '[]' ans = [] q = deque() ...
yskang/AlgorithmPractice
libs/leet_code_utils.py
leet_code_utils.py
py
1,580
python
en
code
1
github-code
1
[ { "api_name": "collections.deque", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 41, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 42, "usage_type": "call" }, { "api_name": "collections.deq...
41146694685
import multiprocessing """ result = [] def Calculate_Square(numbers): for i in numbers: print("Square :", i * i) result.append(i * i) print("Inside Function :", result) if __name__ == "__main__": list = [1, 2, 3, 4, 5] p1 = multiprocessing.Process(target = Cal...
naveedeveloper/operating-system
sharingData.py
sharingData.py
py
1,414
python
en
code
0
github-code
1
[ { "api_name": "multiprocessing.Array", "line_number": 40, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 41, "usage_type": "call" } ]
17159878700
from .models import Coleccion, Autor, Libro from django.core.cache import cache from django.conf import settings from django.contrib.sites.models import Site def colecciones(request): return { 'colecciones': Coleccion.objects.filter(orden__lt=9).order_by("orden"), "DEBUG": settings.DEBUG, ...
ignacionf/cuenco
home/context_processors.py
context_processors.py
py
757
python
en
code
0
github-code
1
[ { "api_name": "models.Coleccion.objects.filter", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Coleccion.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.Coleccion", "line_number": 10, "usage_type": "name" }, { "ap...
26661553275
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html from pymongo import MongoClient from crop_spiders.items import CropItem, PestItem, PestItem2 class CropPipeline(object): ...
jllan/spiders_mess
crop_spiders/crop_spiders/pipelines.py
pipelines.py
py
899
python
en
code
0
github-code
1
[ { "api_name": "pymongo.MongoClient", "line_number": 15, "usage_type": "call" }, { "api_name": "crop_spiders.items.CropItem", "line_number": 22, "usage_type": "argument" }, { "api_name": "crop_spiders.items.PestItem", "line_number": 24, "usage_type": "argument" }, { ...
9058951679
from __future__ import annotations from typing import List, Tuple, Optional import re import os from .basic import Unit from .pattern import PatternLoader class VplParser: @staticmethod def finish(text): return text if text.endswith("\n") else text + "\n" @staticmethod def unwrap(text): ...
senapk/tko
src/tko/loader.py
loader.py
py
8,186
python
en
code
2
github-code
1
[ { "api_name": "typing.Optional", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 29, "usage_type": "name" }, { "api_name": "re.sub", "line_number": 48, "usage_type": "call" }, { "api_name": "re.MULTILINE", "line_numbe...
40475531621
import cv2 import numpy as np import os import torch from torch.utils.data import Dataset class MaskDataset(Dataset): def __init__(self, data_dir, img_transform, msk_transform, img_resize=(256, 256), msk_resize=(32, 32)): self.image_paths = [] self.masks_paths = [] self.img_transform = img...
OYMiss/ssdd-net
ssdd/dataset.py
dataset.py
py
1,693
python
en
code
1
github-code
1
[ { "api_name": "torch.utils.data.Dataset", "line_number": 8, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.resize", "line_...
12171462089
import torch import torch.nn as nn from attention import MultiHeadedAttention class FeedForward(nn.Module): def __init__(self, input_dim: int, dim: int = 2048, dropout: float = 0.1) -> None: super(FeedForward, self).__init__() self.feed_forward = nn.Sequential( nn.Linear(input_dim, dim...
VashishtMadhavan/transformers-scratch
blocks.py
blocks.py
py
2,597
python
en
code
1
github-code
1
[ { "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.Sequential", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
4190657104
################################# # Your name:Yonatan Gertskin ################################# # Please import and use stuff only from the packages numpy, sklearn, matplotlib import numpy as np import matplotlib.pyplot as plt import numpy.random from sklearn.datasets import fetch_mldata from scipy.io import loadmat...
Maltmark/hello-world
perceptron - Copy.py
perceptron - Copy.py
py
4,050
python
en
code
0
github-code
1
[ { "api_name": "numpy.zeros", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.sign", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 29, ...
45021048063
import os import cv2 global i global coordinates def on_event(event, x, y, flags, img): global i global coordinates if i < 4: if event == cv2.EVENT_LBUTTONDOWN: xy = "%d,%d" % (x, y) coordinates[i][0] = int(x) coordinates[i][1] = int(y) cv2.circle(...
INFWOLAD/OCR_BookPages
assistant/mark.py
mark.py
py
1,272
python
en
code
0
github-code
1
[ { "api_name": "cv2.EVENT_LBUTTONDOWN", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cv2.circle", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.putText", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.FONT_HERSHEY_PL...
39956940067
from models.yolo import * from models.ssd import * from util import * from collections import defaultdict import argparse import time import pickle as pkl import random import pdb import os.path as osp #Path vars dirname = os.path.dirname(__file__) CLASS_NAMES_PATH = os.path.join(dirname, 'data/image/coco/coco.names')...
RaedShabbir/Object-Detection
main.py
main.py
py
15,219
python
en
code
0
github-code
1
[ { "api_name": "os.path.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 13, "usage_type": "name" }, { "api_name": "os.path.path.join", ...
18718545308
import logging import sys from pathlib import Path from typing import Union import datetime import discord.ext.commands from discord import Message from discord.ext.commands.bot import Bot from google.cloud import firestore from discord.ext import commands from discord_slash import SlashCommand, SlashContext from .an...
suhail339/Discord-Dictionary-Bot
discord_dictionary_bot/discord_bot_client.py
discord_bot_client.py
py
4,500
python
en
code
null
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "discord.ext.commands.bot.Bot", "line_number": 23, "usage_type": "name" }, { "api_name": "discord.Message", "line_number": 23, "usage_type": "name" }, { "api_name": "discor...
13589234475
from django import forms from django.utils.translation import gettext_lazy as _ from django.contrib.auth import get_user_model from .models import Blog class BlogForm(forms.ModelForm): class Meta: model = Blog fields = ['title', 'slug', 'content', 'categories', 'cover', 'is_vip', 'status', 'autho...
Adler-KZ/AKLog
blogs/forms.py
forms.py
py
1,164
python
en
code
0
github-code
1
[ { "api_name": "django.forms.ModelForm", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 8, "usage_type": "name" }, { "api_name": "models.Blog", "line_number": 10, "usage_type": "name" }, { "api_name": "django.forms.TextI...
19979055197
"""This module contains a function for loading and processing the distributed representations for the dataset in question. Then generating a BatchGenerator that is compatible with the modified pipeline. The modified pipeline will then train the specified model with the input distributed representations along with its ...
paulmorio/DrugPairScoringDR
train_dr_model.py
train_dr_model.py
py
8,143
python
en
code
5
github-code
1
[ { "api_name": "chemicalx.data.BatchGenerator", "line_number": 55, "usage_type": "call" }, { "api_name": "chemicalx.data.BatchGenerator", "line_number": 63, "usage_type": "call" }, { "api_name": "chemicalx.modified_dr_pipeline", "line_number": 72, "usage_type": "call" },...