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
72052621172
from flask import Blueprint, render_template, redirect, url_for from flask_login import login_required, current_user from sqlalchemy import desc from .models import Note views = Blueprint("views", __name__) @views.route("/") @login_required def home() : note = Note.query.filter_by(user_id=current_user.id).order_...
jun3d4y/Self-Hosted-Notes-Web-App
website/views.py
views.py
py
1,170
python
en
code
1
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 7, "usage_type": "call" }, { "api_name": "models.Note.query.filter_by", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Note.query", "line_number": 12, "usage_type": "attribute" }, { "api_name": "mod...
21344674268
# STUDENT DETAILS # NAME: Augustus Samuel Tettey # ID: 10948149 import PySimpleGUI as psg import pyttsx3 Speech_Engine = pyttsx3.init() Speech_Voice = Speech_Engine.getProperty('voices') layout = [ [psg.Text('Enter Message:',text_color='black',background_color='white',)], [psg.Inp...
SamAug09/SCHOOL-PROJECTS
Text_To_Speech.py
Text_To_Speech.py
py
1,146
python
en
code
0
github-code
21
[ { "api_name": "pyttsx3.init", "line_number": 9, "usage_type": "call" }, { "api_name": "PySimpleGUI.Text", "line_number": 14, "usage_type": "call" }, { "api_name": "PySimpleGUI.InputText", "line_number": 16, "usage_type": "call" }, { "api_name": "PySimpleGUI.Button...
42118193802
import requests from bs4 import BeautifulSoup import csv from helper_alvin import Helper2 class CitySOLScrapper: SUCCESS = 200 base_url = "https://www.zillow.com/<city>-<state>/home-values/" base_url_2 = "https://www.zillow.com/<state>/home-values/" kiplinger_url = "https://www.kiplinger.com/tool/real-estate/T010-...
royli1013/15388_project
src/city_sol_scraper.py
city_sol_scraper.py
py
2,167
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 19, "usage_type": "call" }, { "api_name": "helper_alvin.Helper2", "line_number": 21, "usage_type": "call" }, { "api_name": "csv.reader", "line_n...
31857379961
from bitarray import bitarray from numpy.random import Generator, MT19937 import sys def cyclic_redundancy_check(filename: str, divisor: str, len_crc: int) -> int: """ This function computes the CRC of a plain-text file arguments: filename: the file containing the plain-text divisor: the generato...
ivanbamz/CRC_analisis
laboratorio_4.py
laboratorio_4.py
py
4,568
python
es
code
0
github-code
21
[ { "api_name": "bitarray.bitarray", "line_number": 14, "usage_type": "call" }, { "api_name": "bitarray.bitarray", "line_number": 15, "usage_type": "call" }, { "api_name": "bitarray.bitarray", "line_number": 16, "usage_type": "call" }, { "api_name": "bitarray.bitarr...
5887517228
import os import pandas as pd import constants from utils import create_dir, snake_case from tqdm import tqdm import shutil create_dir(constants.RAW_DATA_PATH, remove_if_exists=True) if constants.PYTORCH_STRUCTURE: classes = [snake_case(doggo_class) for doggo_class in list(set(constants.DOGGO_CLASSES.keys()))] ...
arthurgtllr/doggos-classifier
data_loader.py
data_loader.py
py
4,170
python
en
code
0
github-code
21
[ { "api_name": "utils.create_dir", "line_number": 8, "usage_type": "call" }, { "api_name": "constants.RAW_DATA_PATH", "line_number": 8, "usage_type": "attribute" }, { "api_name": "constants.PYTORCH_STRUCTURE", "line_number": 11, "usage_type": "attribute" }, { "api_...
31920831598
import os import logging from terrasnek.api import TFC logging.basicConfig(format='%(asctime)s - %(message)s',level=logging.INFO) OLD_TFC_URL = os.environ["OLD_TFC_URL"] OLD_TFC_TOKEN = os.environ["OLD_TFC_TOKEN"] OLD_TFC_ORG = os.environ["OLD_TFC_ORG"] NEW_TFC_URL = os.environ["NEW_TFC_URL"] NEW_TFC_TOKEN = os.envi...
wallacepf/tfc-vcs-migration
main.py
main.py
py
1,952
python
en
code
1
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ", "...
26428677335
# 220812 14940 쉬운 최단거리 # n <= 1000, 출발점찾고 bfs로 전체탐색 import sys from collections import deque input = sys.stdin.readline def bfs(r,c): global board,n,m moves = [[0,1],[0,-1],[1,0],[-1,0]] result = [[float('inf')]*(m) for _ in range(n)] for row in range(n): for col in range(m): if bo...
seho27060/aug-algo-study
0812/14940_seho.py
14940_seho.py
py
1,231
python
en
code
2
github-code
21
[ { "api_name": "sys.stdin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 16, "usage_type": "call" } ]
45017123581
import json from django.http import JsonResponse, HttpResponse from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView from rest_framework.parsers import JSONParser from .models import Good from .serializers import GoodSerializer from users.views import TokenHandler tokenHandler = TokenHand...
BenAAndrew/django-app
api/goods/views.py
views.py
py
2,570
python
en
code
1
github-code
21
[ { "api_name": "users.views.TokenHandler", "line_number": 9, "usage_type": "call" }, { "api_name": "rest_framework.generics.ListCreateAPIView", "line_number": 11, "usage_type": "name" }, { "api_name": "serializers.GoodSerializer", "line_number": 12, "usage_type": "name" ...
6226150571
from sklearn.linear_model import LogisticRegression from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split from sklearn.model_selection import KFold from sklearn.pipeline import Pipeline from data_generator import data_generator from sklearn.metrics import confusion_mat...
damiano/pan2020-rmit
main.py
main.py
py
4,569
python
en
code
1
github-code
21
[ { "api_name": "sklearn.pipeline.make_pipeline", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.svm.LinearSVC", "line_number": 20, "usage_type": "call" }, ...
43683725375
import sys import logging as log import time from os import environ as env from json import dumps try: import httpx except ImportError: log.warning("Module: httpx not imported, please run pip3 install httpx") sys.exit(1) ## Config settings def main(): try: env['HOST_IP'] except KeyError: ...
exNihlio/echo_demo
tests.py
tests.py
py
12,989
python
en
code
0
github-code
21
[ { "api_name": "logging.warning", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 19...
17054021959
import tensorflow as tf from tensorflow import keras #added to save model from tensorflow.keras import layers #format matches MNIST example from tensorflow.keras.callbacks import EarlyStopping from tensorflow.keras.models import Sequential, model_from_json from tensorflow.keras.layers import Dense from sklearn.metrics...
imics-lab/time-series-label-assist
prediction/model.py
model.py
py
4,549
python
en
code
1
github-code
21
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.Sequential", "line_number": 63, "usage_type": "call" }, { "api_name": "tensorflow....
73027936053
import argparse parser = argparse.ArgumentParser() parser.add_argument("-g", "--gpu", metavar="gpuid", type=int, default=-1, help="GPU device ID (CPU if negative)") parser.add_argument("-m", "--model", metavar="model", type=str, default="ram.chainermodel", help="chainer model fil...
LiuFang816/SALSTM_py_data
python/amasky_ram/ram-master/infer.py
infer.py
py
2,461
python
en
code
9
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 2, "usage_type": "call" }, { "api_name": "sklearn.datasets.fetch_mldata", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 15, "usage_type": "attribute" }, { "api_name"...
31917385617
# -*- coding: utf-8 -*- import numpy as np from scipy.optimize import curve_fit from scipy.interpolate import UnivariateSpline from scipy.spatial import ConvexHull import scipy.sparse as sparse from numpy.linalg import norm from sklearn import preprocessing import rampy def get_portion_interest(x,y,bir): """Extra...
hududed/raman-analysis
rampy/baseline.py
baseline.py
py
8,917
python
en
code
12
github-code
21
[ { "api_name": "numpy.array", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.transpose", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.where", "line_numb...
21261214320
import pandas as pd import itertools import numpy as np from scipy.stats import norm import scipy.stats from joblib import Parallel, delayed import multiprocessing import subprocess import random import os from sklearn.utils.extmath import cartesian import sys from datetime import datetime import argparse parser = arg...
NSSAC/AMMFluForecasting
code/gen_seasonal.py
gen_seasonal.py
py
4,076
python
en
code
3
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.read_...
37100781761
import requests from lxml import html import urllib import openpyxl as excel def remove_fobidden_chr(txt): txt = txt.replace('/', '') txt = txt.replace('>', '') txt = txt.replace('<', '') txt = txt.replace(':', '') txt = txt.replace('"', '') txt = txt.replace('\\', '') txt = txt.replace('\n...
Metwalli/download_ecommerce_contents
read_page.py
read_page.py
py
5,958
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "line_number": 31, "usage_type": "call" }, { "api_name": "lxml.html", "line_number": 31, "usage_type": "name" }, { "api_name": "urllib.request.urlretriev...
18034960134
import pygame import random pygame.init() white = (255, 255, 255) yellow = (255, 255, 192) black = (0, 0, 0) red = (213, 50, 80) green = (0, 255, 0) blue = (75, 139, 190) dis_width = 300 dis_height = 200 dis = pygame.display.set_mode((dis_width, dis_height)) pygame.display.set_caption('Snake Game') ...
montipython94/pySnake
pysnake.py
pysnake.py
py
4,168
python
en
code
0
github-code
21
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pygame.display...
38793908022
"""Count frequent event(verb) type.""" import logging import os from collections import Counter from tqdm import tqdm from mcpredictor.utils.document import document_iterator logger = logging.getLogger(__name__) def count_stop_event(corp_dir, work_dir, file_type="tar", ...
waltbai/MCPredictor
mcpredictor/preprocess/stop_event.py
stop_event.py
py
1,937
python
en
code
14
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.exists", "lin...
25390364322
# Hidden Markov Models # # Author: Ron Weiss <ronweiss@gmail.com> # Shiqiao Du <lucidfrontier.45@gmail.com> # API changes: Jaques Grobler <jaquesgrobler@gmail.com> # Modifications to create of the HMMLearn module: Gael Varoquaux # More API changes: Sergei Lebedev <superbobry@gmail.com> """ The :mod:`hmmlearn.h...
lidh966/GDROM
base_code/hmm_DT.py
hmm_DT.py
py
15,842
python
en
code
0
github-code
21
[ { "api_name": "base_DT._BaseHMM", "line_number": 36, "usage_type": "name" }, { "api_name": "base_DT._BaseHMM.__init__", "line_number": 154, "usage_type": "call" }, { "api_name": "base_DT._BaseHMM", "line_number": 154, "usage_type": "name" }, { "api_name": "copy.de...
70180870454
import logging import os from telegram import Update from telegram.ext import ApplicationBuilder, ContextTypes, MessageHandler, filters import requests import asyncio logging.basicConfig( format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO ) async def handleMessage(update: Updat...
yotamhermes/woof-automation
bot_service/app.py
app.py
py
1,269
python
en
code
0
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "telegram.Update", "line_number": 14, "usage_type": "name" }, { "api_name": "telegram.ext.Con...
28622455813
import logging logger = logging.getLogger(__name__) AIRFLOW_API_MODE_TO_SUFFIX = { "flask-admin": "/admin/data_export_plugin/export_data", "rbac": "/exportdataviewappbuilder/export_data", "experimental": "/api/experimental/export_data", } class AirflowFetchingConfiguration(object): def __init__( ...
kalebinn/dbnd
modules/dbnd-airflow-monitor/src/airflow_monitor/airflow_servers_fetching.py
airflow_servers_fetching.py
py
2,725
python
en
code
null
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" } ]
19758394628
#!/usr/bin/python import logging import logging.handlers from constants import LOG_FILE def configure(): logger = logging.getLogger("pricewatch") logger.setLevel(logging.DEBUG) # fileHandler = logging.handlers.RotatingFileHandler(fileName, encoding='utf8', # ...
hashknot/stashbin
stashbin/logger.py
logger.py
py
749
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.For...
4336196916
import cv2 global img global point1, point2 # 鼠标响应函数 def Rectangular_box(event, x, y, flags, param): global img, point1, point2 img2 = img.copy() if event == cv2.EVENT_LBUTTONDOWN: # 左键点击 point1 = (x, y) elif event == cv2.EVENT_MOUSEMOVE and (flags & cv2.EVENT_FLAG_LBUTTON): # 按住左键拖曳 ...
jindengfeng/duel-links-bot
util/rect.py
rect.py
py
1,306
python
en
code
0
github-code
21
[ { "api_name": "cv2.EVENT_LBUTTONDOWN", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.EVENT_MOUSEMOVE", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cv2.EVENT_FLAG_LBUTTON", "line_number": 13, "usage_type": "attribute" }, { "a...
17475908193
# encoding: utf-8 import time import gym from double_network_DQN import double_network_DQN import pprint as pp env = gym.make('CartPole-v0') env = env.unwrapped observation = env.reset() DQN = double_network_DQN(num_of_actions=env.action_space.n, num_of_features=env.observation_space.shape[0]) print(env.action_spa...
AKAAKAIplus/Cartpole_DQN_with_tensorflow
environment_implement.py
environment_implement.py
py
1,396
python
en
code
1
github-code
21
[ { "api_name": "gym.make", "line_number": 8, "usage_type": "call" }, { "api_name": "double_network_DQN.double_network_DQN", "line_number": 13, "usage_type": "call" }, { "api_name": "time.time", "line_number": 25, "usage_type": "call" }, { "api_name": "time.time", ...
71743818933
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # (c) Shrimadhav U K # the logging things import logging from pyrogram import ( Client, CallbackQuery ) from anydlbot import AUTH_USERS from anydlbot.plugins.youtube_dl_button import youtube_dl_call_back from anydlbot.plugins.dl_button import ddl_call_back loggi...
DEEKSB48/anydlbots
anydlbot/plugins/cb_buttons.py
cb_buttons.py
py
1,109
python
en
code
1
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.getL...
832571449
import json import regex as re with open('wulgaryzmy.json', 'r', encoding='utf-8') as fh: wulgarki = json.load(fh) while True: wulgaryzm = input("Podaj wulgaryzm: ") if wulgaryzm != 'Koniec !@#$%^&': regex = re.compile('|'.join(re.escape(x) for x in wulgarki)) cenzura = re.sub(regex, '!...
AvirFrog/Algorytmy_Uczenia_Maszynowego
Lab01/zad_1_2.py
zad_1_2.py
py
461
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 5, "usage_type": "call" }, { "api_name": "regex.compile", "line_number": 12, "usage_type": "call" }, { "api_name": "regex.escape", "line_number": 12, "usage_type": "call" }, { "api_name": "regex.sub", "line_number": 14...
26163368191
from rest_framework import serializers from module.picking.picking.models import Picking class PickingSerializer(serializers.ModelSerializer): last_modification = serializers.DateTimeField(format="%Y-%m-%d %H:%M:%S", required=False) status = serializers.CharField(source='status.name', required=False) respo...
sebastiannarvaez23/wmsbk
module/picking/picking/api/serializers.py
serializers.py
py
726
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 4, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 4, "usage_type": "name" }, { "api_name": "rest_framework.serializers.DateTimeField", "line_number": 5, "us...
13443931845
from __future__ import annotations from enum import IntEnum, auto from app.schemas.util import normalize_string_lm3 class BidirectionalClass(IntEnum): NONE = 0 LEFT_TO_RIGHT = auto() RIGHT_TO_LEFT = auto() ARABIC_LETTER = auto() EUROPEAN_NUMBER = auto() EUROPEAN_SEPARATOR = auto() EUROPE...
a-luna/unicode-api
app/schemas/enums/bidirectional_class.py
bidirectional_class.py
py
3,509
python
en
code
2
github-code
21
[ { "api_name": "enum.IntEnum", "line_number": 8, "usage_type": "name" }, { "api_name": "enum.auto", "line_number": 10, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 11, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 12, ...
18403395989
from itertools import accumulate; from math import floor,ceil; import operator; import random; import string; from bisect import *; from collections import deque, defaultdict, Counter, OrderedDict; from functools import reduce,cache; from heapq import *; import unittest; from typing import List,Optional; from functools...
afzalsiddique/problem-solving
Problem_Solving_Python/interview_bit/distinct_numbers_in_window.py
distinct_numbers_in_window.py
py
1,087
python
en
code
1
github-code
21
[ { "api_name": "collections.Counter", "line_number": 7, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 23, "usage_type": "attribute" } ]
21256202850
import sqlite3 from django.urls import reverse from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from datetime import date from hrapp.models import Employee from hrapp.models import Computer from hrapp.models import TrainingProgram from hrapp.models import EmployeeT...
nss-day-cohort-33/bangazon-workforce-management-vendacien-caliphate
hrapp/views/employees/details.py
details.py
py
4,014
python
en
code
0
github-code
21
[ { "api_name": "sqlite3.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "connection.Connection.db_path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "connection.Connection", "line_number": 15, "usage_type": "name" }, { "api_name...
74428745012
import boto3 dynamodb = boto3.resource("dynamodb") table = dynamodb.Table("hosts") response = table.scan() data = response["Items"] while "LastEvaluatedKey" in response: response = table.scan(ExclusiveStartKey=response["LastEvaluatedKey"]) data.extend(response["Items"]) print(data)
lucasjct/python_dynamoDB
scan_items.py
scan_items.py
py
296
python
en
code
0
github-code
21
[ { "api_name": "boto3.resource", "line_number": 3, "usage_type": "call" } ]
17930736000
import pygame from board import boards import math pygame.init() # initializing pygame # width and height of our screen WIDTH = 635 HEIGHT = 700 screen = pygame.display.set_mode([WIDTH, HEIGHT]) # Setting the pygame screen using HEIGHT AND WIDTH variable """STATIC VARIABLES""" timer = pygame.time.Clock() # to co...
faizkhan77/PacMan-Python
pacman2.py
pacman2.py
py
5,451
python
en
code
0
github-code
21
[ { "api_name": "pygame.init", "line_number": 5, "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.time.Cl...
41486493116
import os import PySimpleGUI as sg import json from datetime import datetime as dt from dotenv import * from genericpath import exists from web3 import Web3 class WrappedElection: def __str__(self): return self.name def __init__(self, election_address: str, election_name: str): with open("abi...
xavierdmello/Blockchain_Elections
ElectionsCanada.py
ElectionsCanada.py
py
32,562
python
en
code
5
github-code
21
[ { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "genericpath.exists", "line_number": 182, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 183, "usage_type": "call" }, { "api_name": "PySimpleGUI.Text", "line...
20833168164
#-*-coding:utf-8-*- #/usr/bin/env python __author__ = "Allan" import unittest from function import add_and_multiply import mock class MyTestCase(unittest.TestCase): @mock.patch('function.multiply') def test_add_and_multiply(self,mock_multiply): x = 3 y = 5 mock_multiply.return_value =...
nurruden/training
NonTraining/mock/test.py
test.py
py
555
python
en
code
0
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "function.add_and_multiply", "line_number": 17, "usage_type": "call" }, { "api_name": "mock.patch", "line_number": 10, "usage_type": "call" }, { "api_name": "unittest.m...
42927243754
from flask import Flask, render_template, request, jsonify, send_file import networks, plotting import networkx as nx import os # from intro_to_flask import app # port = int(os.environ.get("PORT", 5000)) # app.run(debug=True, host='0.0.0.0', port=port) app = Flask(__name__) @app.route('/') def home(): return ...
kojino/network-visualizer
visualizer.py
visualizer.py
py
2,496
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 22, "usage_type": "call" }, { "api_name": "flask.request...
28426050762
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed u...
gitmirgut/bb_stitcher
bb_stitcher/helpers.py
helpers.py
py
17,883
python
en
code
2
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", ...
18405278989
from itertools import accumulate; from math import floor,ceil,log2; import operator; import random; import string; from bisect import *; from collections import deque, defaultdict, Counter, OrderedDict; from functools import reduce,cache; from heapq import *; import unittest; from typing import List,Optional; from func...
afzalsiddique/problem-solving
Problem_Solving_Python/leetcode/lc2122.py
lc2122.py
py
1,717
python
en
code
1
github-code
21
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "collections.Counter", "line_number": 7, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 31, "usage_type": "attribute" } ]
40350845144
# from dataclasses import dataclass import yt_dlp from yt_dlp.utils import DownloadError from PIL import Image from core.settings import OUTPUT_AUDIO_PATH, OUTPUT_TEMP_PATH, OUTPUT_IMAGE_PATH from apis.song.tasks import adownload class YouTube: id: str = "youtube" name: str = "YouTube" code: int = 1 ...
Marak123/SoundTime
backend/apis/song/DlerMedia/platform_class.py
platform_class.py
py
2,704
python
en
code
0
github-code
21
[ { "api_name": "yt_dlp.YoutubeDL", "line_number": 73, "usage_type": "call" }, { "api_name": "apis.song.tasks.adownload.delay", "line_number": 78, "usage_type": "call" }, { "api_name": "apis.song.tasks.adownload", "line_number": 78, "usage_type": "name" }, { "api_na...
13751821086
from backend.sensors.Sensor import Sensor from typing import List, Dict, Iterable import atexit class sr04Wrapper: def __init__(self, trigger_pins, echo_pins, angles): self._sensors = {} self._distances = {} if trigger_pins and echo_pins and angles: self._sensors = [ Sensor(trigger_pin, echo_pin, angl...
MarioBartolome/GII_0_17.02_SNSI
backend/sensors/sr04Wrapper.py
sr04Wrapper.py
py
974
python
en
code
2
github-code
21
[ { "api_name": "backend.sensors.Sensor.Sensor", "line_number": 14, "usage_type": "call" }, { "api_name": "atexit.register", "line_number": 22, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 24, "usage_type": "name" }, { "api_name": "backend.sen...
73898613814
import torch.nn as nn class MLP(nn.Module): """ Simple 3 layer MLP for benchmarking""" def __init__(self, in_feature, out_feature, dropout=0): super().__init__() self.layer1 = nn.Linear(in_feature, 100) self.layer2 = nn.Linear(100, 100) self.layer3 = nn.Linear(100, out_feature) ...
Tianananana/GAT-implementation
Model/MLPBlock.py
MLPBlock.py
py
798
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 3, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 3, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
70982917494
# -*- coding:utf-8 -*- ''' Created on 2016年12月12日 @author: frankzhan ''' import numpy as np #np.random.seed(100) from keras.optimizers import SGD import os import matplotlib.pyplot as plt import h5py from keras.models import Sequential from keras.layers.convolutional import Convolution2...
cxf2015/KerasModel
test/kerastest/test1.py
test1.py
py
2,807
python
zh
code
0
github-code
21
[ { "api_name": "keras.callbacks.Callback", "line_number": 28, "usage_type": "name" }, { "api_name": "keras.models.Sequential", "line_number": 36, "usage_type": "call" }, { "api_name": "keras.layers.convolutional.Convolution2D", "line_number": 38, "usage_type": "call" }, ...
26885027852
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'HealerSettings.description' db.add_column(u'dashboard_healersettings', 'description', ...
RumorIO/healersource
apps/dashboard/south_migrations/0002_auto__add_field_healersettings_description.py
0002_auto__add_field_healersettings_description.py
py
1,154
python
en
code
0
github-code
21
[ { "api_name": "south.v2.SchemaMigration", "line_number": 8, "usage_type": "name" }, { "api_name": "south.db.db.add_column", "line_number": 12, "usage_type": "call" }, { "api_name": "south.db.db", "line_number": 12, "usage_type": "name" }, { "api_name": "south.db.d...
39610871695
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Mar 26 12:12:52 2021 @author: karl """ import pandas as pd import scipy.io as sio import numpy as np tab = pd.read_csv('timestamps_seconds.csv').dropna() base_mat_path = '/media/karl/DATA/bigMats/' target_mat_folder = '/media/karl/DATA/berk_submats...
ksm2264/automatic-spoon
split_mat_files.py
split_mat_files.py
py
3,231
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 27, "usage_type": "call" }, { "api_name": "scipy.io", "line_number": 27, "usage_type": "name" }, { "api_name": "numpy.array", "line_num...
30366791781
''' Integrantes: Amanda Fernandes de Oliveira Guilherme Gomes Nogueira Chaves ''' import cv2 as cv2 def resizeImage(image, scale): #image = cv2.imread(filepath, cv2.IMREAD_UNCHANGED) scale_percent = scale width = int(image.shape[1] * scale_percent / 100) height = int(image.shape[0] * scale_percent / 100) dim = (...
guilhermegnc/Trabalho-Processamento-Digital-De-Imagens
Source/ResizeRegion.py
ResizeRegion.py
py
473
python
en
code
0
github-code
21
[ { "api_name": "cv2.resize", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_number": 15, "usage_type": "attribute" } ]
19626041248
import csv from io import TextIOWrapper from time import strftime from django.http import HttpResponse from rest_framework.response import Response from rest_framework.views import APIView from csv_file.models import User class CSVHandleView(APIView): def post(self, request, *args, **kwargs): if 'file'...
nguyenhuuhai98/django_csv
csv_file/views.py
views.py
py
1,749
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.views.APIView", "line_number": 13, "usage_type": "name" }, { "api_name": "io.TextIOWrapper", "line_number": 17, "usage_type": "call" }, { "api_name": "csv_file.models", "line_number": 18, "usage_type": "name" }, { "api_name": "csv.rea...
72268016374
import random import datetime from bgconvert import * #TEMPORARY POWER FOR DEBUGGING--------------- import sqlite3 from bgconvert import bgconvert db_handle = sqlite3.connect('citybloodorg.db', timeout=10) command = db_handle.cursor() #TEMP---------------------------------------- def registerUser(): n...
FortemDave/WEEKEND-HACKATHON
hackathonoop/user.py
user.py
py
4,694
python
en
code
0
github-code
21
[ { "api_name": "sqlite3.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "bgconvert.bgconvert", "line_number": 15, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 27, "usage_type": "call" }, { "api_name": "random.randrange"...
20359421413
import serializers from rest_framework import viewsets, permissions from rest_framework.response import Response from rest_framework import status from .models import * import json class TracksViewSet(viewsets.ModelViewSet): """ViewSet for the Tracks class""" queryset = Tracks.objects.all() serializer_cla...
himmu/say2gov
say2govApp/views.py
views.py
py
4,993
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 8, "usage_type": "name" }, { "api_name": "serializers.TracksSerializer", "line_number": 12, "usage_type": "attribut...
25739730853
import csv import json csvFilepath = "for_main_json.csv" jsonFilepath = "ALL_mainJson.json" #----- Read the CSV and add the data to a dictionary data = {} with open(csvFilepath) as csvFile: csvReader = csv.DictReader(csvFile) for csvRow in csvReader: clipUUID = csvRow["clipUUID"] data[clipUUI...
caitlinttl/For_HF
For_HF/Sound_database/sound_json.py
sound_json.py
py
1,529
python
en
code
1
github-code
21
[ { "api_name": "csv.DictReader", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": ...
35364074725
from game import constants import arcade import math class Create_zombie(arcade.Sprite): """This class will allow us to create basic zombies with ease""" def __init__(self, sprite, scalling, zombie_modifier): super().__init__(sprite, scalling) self.hit = False self.count = 0 se...
gublerj/gublerj-cse210-project
game/create_zombie.py
create_zombie.py
py
4,429
python
en
code
1
github-code
21
[ { "api_name": "arcade.Sprite", "line_number": 5, "usage_type": "attribute" }, { "api_name": "game.constants.RIGHT_FACING", "line_number": 18, "usage_type": "attribute" }, { "api_name": "game.constants", "line_number": 18, "usage_type": "name" }, { "api_name": "gam...
20391940914
from typing import Any, Iterable, Union, get_args from stift.exceptions import FunctionError ANY_NUM_ARGS = "ANY_NUM_ARGS" ANY = Any NUMERICAL = Union[int, float, complex] REALS = Union[int, float] class BaseFunction: """Basic function class meant to be overloaded. arg_counts, arg_types, and process() need...
pluots/stift
stift/functions/base.py
base.py
py
2,871
python
en
code
0
github-code
21
[ { "api_name": "typing.Any", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 8, "usage_type": "name" }, { "api_name": "stift.exceptions.FunctionError", ...
9093852145
# ANALISIS EXPLORATORIO import pandas as pd import numpy as np import warnings warnings.filterwarnings("ignore") df = pd.read_csv("C:/Users/juane/AnaliticaComputacional/Proyecto3/datosValle4000.csv") #Limpiar base de datos-------------------------------------------------------------------------------------...
juangar7/Garces_AnaliticaComp2023-02
ArchivoParaMonty.py
ArchivoParaMonty.py
py
4,795
python
en
code
0
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.factori...
32015065074
import json import requests import os import time from pymongo import MongoClient from database_connection import mongoconn from dotenv import load_dotenv ## NoSQL DB세팅 ## # -> 데이터가 API를 통해서 대량으로 가져오다보니, 가공해서 적재를 할 수 없음 # load_dotenv() # take enviroment variables from .env ## MongoDB 적재할 계정정보 입력 ## coll = mongocon...
GitPolyMath/project03
data_etl_module/api_NoSQL_pipline.py
api_NoSQL_pipline.py
py
2,056
python
ko
code
0
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 12, "usage_type": "call" }, { "api_name": "database_connection.mongoconn", "line_number": 16, "usage_type": "call" } ]
34832151263
from typing import Tuple from django.contrib.auth.models import User from django.db import models from django.utils.translation import gettext_lazy as _ from esi.errors import TokenExpiredError, TokenInvalidError from esi.models import Token from eveuniverse.models import EveEntity, EveSolarSystem, EveType from allia...
staropera/aa-blueprints
blueprints/models.py
models.py
py
25,249
python
en
code
1
github-code
21
[ { "api_name": "app_utils.logging.LoggerAddTag", "line_number": 25, "usage_type": "call" }, { "api_name": "allianceauth.services.hooks.get_extension_logger", "line_number": 25, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 28, "usage_type":...
16181130406
import time import inspect import subprocess from contextlib import contextmanager import torch def int_tuple(s): return tuple(int(i) for i in s.split(',')) def float_tuple(s): return tuple(float(i) for i in s.split(',')) def str_tuple(s): return tuple(s.split(',')) def bool_flag(s): if s == '1': r...
google/sg2im
sg2im/utils.py
utils.py
py
1,624
python
en
code
1,275
github-code
21
[ { "api_name": "inspect.currentframe", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.cuda.synchronize", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 35, "usage_type": "attribute" }, { "api_name": "subproces...
10523909854
# based on this github : https://github.com/nicknochnack/Langchain-Crash-Course # Bring in deps import os import streamlit as st from langchain.llms import OpenAI from langchain.prompts import PromptTemplate from langchain.chains import LLMChain, SequentialChain from langchain.memory import ConversationBuff...
lberthod/WordForge
app.py
app.py
py
10,975
python
en
code
1
github-code
21
[ { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "streamlit.secrets", "line_number": 15, "usage_type": "attribute" }, { "api_name": "streamlit.set_page_config", "line_number": 18, "usage_type": "call" }, { "api_name": "stre...
31266935634
from tkinter import * import tkinter.messagebox as mb import tkinter.ttk as ttk import session root=Tk() root.geometry('500x525') photo1=PhotoImage(file='pictures/6.png') back=Label(root,image=photo1) back.pack(fill='both',expand='yes') import pymysql pymysql.install_as_MySQLdb() import MySQLdb def call...
Shubham2299/Job-Portal
project/login_panel2.py
login_panel2.py
py
1,946
python
en
code
0
github-code
21
[ { "api_name": "pymysql.install_as_MySQLdb", "line_number": 11, "usage_type": "call" }, { "api_name": "MySQLdb.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "session.setDeg", "line_number": 21, "usage_type": "call" }, { "api_name": "tkinter.mes...
39856896410
import cv2 import argparse import numpy as np from keras.utils import np_utils import glob from os.path import join from os import listdir from random import shuffle ap = argparse.ArgumentParser() ap.add_argument( "-img_size", "--img_size", required=True, type=int, help="Resize face image", def...
AKASH2907/deepfakes_video_classification
00.train_data_prepare.py
00.train_data_prepare.py
py
2,185
python
en
code
54
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path.join", "l...
21793861311
import openpyxl as openpyxl import psycopg2 connect = psycopg2.connect( host='26.42.46.181', port='5432', user='postgres', password='123123', database='Hakaton') with connect: with connect.cursor() as cursor: cursor.execute('select * from "public"."Requests"') se...
Wolfesz2/Hakaton
main.py
main.py
py
2,591
python
en
code
0
github-code
21
[ { "api_name": "psycopg2.connect", "line_number": 4, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 44, "usage_type": "call" } ]
35711291768
import re from typing import Iterator, List MEM_REGEX = re.compile(r"mem\[(\d+)\] = (\d+)") # Thanks to https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfsc1yj/ for this. # # I attempted to use `itertools.permutations` based on the number of "X"s in `apply_mask::base`, but # when the num...
Celeo/adventofcode
2020/day14/part2.py
part2.py
py
1,629
python
en
code
0
github-code
21
[ { "api_name": "re.compile", "line_number": 5, "usage_type": "call" }, { "api_name": "typing.Iterator", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 27, "usage_type": "name" } ]
15513453580
from PyQt5.QtWidgets import * from PyQt5.uic import loadUi from PyQt5.QtWidgets import QMainWindow, QApplication, QPushButton from PyQt5 import QtGui import sys from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FingureCanvas from matplotlib.figure import Figure from deneme2 import Ui_MainWindow import...
ziyacannikel/PYTHON-GUI
main.py
main.py
py
2,399
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 12, "usage_type": "name" }, { "api_name": "deneme2.Ui_MainWindow", "line_number": 16, "usage_type": "call" }, { "api_name": "PyQt5.QtGui.QColor", "line_number": 32, "usage_type": "call" }, { "api_name": "...
29426370473
import os import sys import requests import json from pystrict import strict from typing import List, Set, Dict, Tuple, Optional, Any, Union, NewType from enum import Enum, unique from urllib.parse import quote_plus from pprint import pprint path = os.path.abspath(os.path.dirname(__file__)) (head, tail) = os.path.spl...
dhlab-basel/0826-wordweb-scripts
02_import_scripts/knora/models/user.py
user.py
py
26,855
python
en
code
0
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.split", "lin...
29377487622
# coding=utf8 """ map/reduce 递归 Version: 1.0 Author: 杨黎 """ from functools import reduce def f(x): return x * x def fn(x, y): return x * y a = [1, 2, 3, 4] t = map(f, a) print("map对列表求f(x)=x*x") for i in t: print(i, end=' ') print() # 求阶乘n! k = 10 print("reduce求解{}!={}".format(k, reduce(fn, range(1, ...
996426872/python_q_a
demos/demo00009.py
demo00009.py
py
544
python
en
code
0
github-code
21
[ { "api_name": "functools.reduce", "line_number": 27, "usage_type": "call" } ]
8044545014
# Python code to reading an image using OpenCV import numpy as np import cv2 import os if __name__ == '__main__': # Init video capture cap = cv2.VideoCapture(0) if cap is None or not cap.isOpened(): print('Error: unable to open video source: ', source) exit(0) while True: # C...
iproduct/intro-python
06-up-2021/cv2_camera_tresholding.py
cv2_camera_tresholding.py
py
2,425
python
en
code
6
github-code
21
[ { "api_name": "cv2.VideoCapture", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "lin...
6188512266
from itertools import combinations def solve_task1(file_name, preamble_len): numbers = read_file(file_name) for curr_idx in range(preamble_len, len(numbers)): if not is_valid(numbers[curr_idx], numbers[curr_idx - preamble_len: curr_idx]): return numbers[curr_idx] def solve_task2(file_name,...
fuszti/advent_of_code_2020
day_09/task.py
task.py
py
1,363
python
en
code
0
github-code
21
[ { "api_name": "itertools.combinations", "line_number": 23, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 30, "usage_type": "call" } ]
73036357173
import cupy from cupy import core def column_stack(tup): """Stacks 1-D and 2-D arrays as columns into a 2-D array. A 1-D array is first converted to a 2-D column array. Then, the 2-D arrays are concatenated along the second axis. Args: tup (sequence of arrays): 1-D or 2-D arrays to be stacke...
LiuFang816/SALSTM_py_data
python/pfnet_chainer/chainer-master/cupy/manipulation/join.py
join.py
py
3,329
python
en
code
9
github-code
21
[ { "api_name": "cupy.ndarray", "line_number": 20, "usage_type": "attribute" }, { "api_name": "cupy.newaxis", "line_number": 26, "usage_type": "attribute" }, { "api_name": "cupy.core.concatenate_method", "line_number": 49, "usage_type": "call" }, { "api_name": "cupy...
18866245542
import os import requests import json import codecs import pymysql # useful for handling different item types with a single interface from itemadapter import ItemAdapter class WeatherPipeline: def process_item(self, item, spider): base_dir = os.getcwd() filename = base_dir + '/data/weather.txt' ...
ChengYaoYan/event-extraction
data/crawler/exercise/weather/weather/pipelines.py
pipelines.py
py
2,076
python
en
code
0
github-code
21
[ { "api_name": "os.getcwd", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 31, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 34,...
14233263920
#!/usr/bin/python3 import sys import heapq import math import itertools import collections math.inf = float('Inf') # priority node queue class NodeQueue: """ NodeQueue uses a heapq but allows nodes to be deleted from the queue without any costly reordering. This is achieved by maintain...
mcgaw/psychic-garbanzo
3/week6/friend_suggestion/friend_suggestion.py
friend_suggestion.py
py
4,040
python
en
code
0
github-code
21
[ { "api_name": "math.inf", "line_number": 9, "usage_type": "attribute" }, { "api_name": "itertools.count", "line_number": 23, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 25, "usage_type": "call" }, { "api_name": "heapq.heappush",...
28385431933
from PyQt5 import QtWidgets, QtCore import clientgui_2 import requests import xml.etree.ElementTree as ET import json class ExampleApp(QtWidgets.QMainWindow, clientgui_2.Ui_MainWindow): def __init__(self): super(ExampleApp, self).__init__() self.setupUi(self) self.EnumirateBoard.pressed.co...
7eleron/client_sever
client_server.py
client_server.py
py
4,796
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 8, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 8, "usage_type": "name" }, { "api_name": "clientgui_2.Ui_MainWindow", "line_number": 8, "usage_type": "attribute" }, { "api_...
4589075922
#!/bin/python3 import argparse import datetime import getpass import logging import os import requests import sys import spotipy from spotipy.oauth2 import SpotifyClientCredentials, SpotifyOAuth MAX_ITEMS = 50 MAX_SET_ITEMS = 20 ## # Classes to model the Spotify libary: ## class Artist: def __init__(self, i...
plustik/scriptify
scriptify.py
scriptify.py
py
24,452
python
en
code
0
github-code
21
[ { "api_name": "logging.debug", "line_number": 42, "usage_type": "call" }, { "api_name": "spotipy.exceptions", "line_number": 45, "usage_type": "attribute" }, { "api_name": "logging.warning", "line_number": 46, "usage_type": "call" }, { "api_name": "logging.debug",...
37534818471
""" 匹马印第安人糖尿病预测数据集 pima.data """ # 1、导库 import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns plt.style.use("ggplot") # plt.style.use("fivethirtyeight") # 2、数据读取(原始数据无列名,手动添加) data = pd.read_csv("pima.data", header=None) data.columns = ["times_pregnant", "plasma_g...
ljczxy/Feature-Engineering
特征增强:清洗数据.py
特征增强:清洗数据.py
py
6,349
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_na...
34901561415
import os from pathlib import Path from typing import List import dateparser import pandas as pd from loguru import logger import variables as v from models.cr import PresenceRegexPattern, presence_regex_mapping from processing.pdf_processing import PDFProcessing from processing.text_processing import FromTextToDF fr...
spacewaterbear/cr-analysis
main.py
main.py
py
4,564
python
en
code
0
github-code
21
[ { "api_name": "loguru.logger.info", "line_number": 18, "usage_type": "call" }, { "api_name": "loguru.logger", "line_number": 18, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "lin...
1596999592
import datetime from django.utils import timezone from django.conf import settings from django.core.mail import send_mail from django.shortcuts import render # la carpeta de teplates debe ser declarada # en TEMPLATES.DIRS en el fichero gestion/settings.py # Create your views here. from django.http import HttpRespons...
lifofernandez/cursos
gestion/views.py
views.py
py
25,267
python
es
code
0
github-code
21
[ { "api_name": "forms.InscriptoForm", "line_number": 29, "usage_type": "call" }, { "api_name": "django.core.mail.send_mail", "line_number": 60, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 71, "usage_type": "call" }, { "api_name"...
43427850067
from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F from torchvision import datasets, transforms from torch.autograd import Variable import pandas as pd import numpy as np class Net(nn.Module): def __init__(self): super(Net, self).__init__() sel...
roma141/mnist
try 3/api.py
api.py
py
10,548
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
13768722353
import os, time, argparse, json from flask import Flask, request from flask_restful import Resource, Api from flask_restful import reqparse from werkzeug.utils import secure_filename from darknet import get_tiny_yolo_detection import sys UPLOAD_FOLDER = '/inference/temp' app = Flask(__name__) app.config['UPLOAD_FOLD...
rdsea/sys4bigml
tutorials/MLServing/edge-inference-server/server.py
server.py
py
1,377
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 14, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.request.fi...
22011740551
from PyQt5.QtCore import pyqtSlot from PyQt5.QtGui import QFont from PyQt5.QtWidgets import (QHBoxLayout, QLabel, QPushButton, QSizePolicy, QTextEdit, QVBoxLayout, QWidget) from languages.lang import lang from nlptools.kernels.wordnet import Wordnet from .BaseWindow import BaseWindow cl...
salehmontazeran/nlp-project
nlptools/windows/WordnetWindow.py
WordnetWindow.py
py
2,077
python
en
code
2
github-code
21
[ { "api_name": "BaseWindow.BaseWindow", "line_number": 12, "usage_type": "name" }, { "api_name": "languages.lang.lang", "line_number": 16, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QFont", "line_number": 23, "usage_type": "call" }, { "api_name": "PyQt5.QtW...
19817023260
from sklearn.metrics.pairwise import cosine_similarity from sklearn.feature_extraction.text import TfidfVectorizer def fit_tfidf_model(train_docs): vectorizer = TfidfVectorizer() docs_tfidf = vectorizer.fit_transform(train_docs) return vectorizer, docs_tfidf def get_most_similar_term(term_name, vectoriz...
abdullahyldz/Cmpe493TermProject
functions_tfidf.py
functions_tfidf.py
py
3,666
python
en
code
0
github-code
21
[ { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.metrics.pairwise.cosine_similarity", "line_number": 13, "usage_type": "call" } ]
28391336305
import numpy as np import pandas as pd from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor from synthpop.method import Method, proper, smooth # global variables from synthpop import NUM_COLS_DTYPES, CAT_COLS_DTYPES class CARTMethod(Method): def __init__(self, dtype, smoothing=False, proper=Fal...
hazy/synthpop
synthpop/method/cart.py
cart.py
py
2,519
python
en
code
37
github-code
21
[ { "api_name": "synthpop.method.Method", "line_number": 10, "usage_type": "name" }, { "api_name": "synthpop.method.proper", "line_number": 14, "usage_type": "name" }, { "api_name": "synthpop.CAT_COLS_DTYPES", "line_number": 18, "usage_type": "name" }, { "api_name":...
16008394753
from collections import deque from statistics import mean from collections import deque import time import math import numpy as np LEFT_EYE_INDEX = 0 RIGHT_EYE_INDEX = 1 REAL_IPD = 6.5 # cm. Physical distance between my pupils xq = deque([0] * 3, 3) yq = deque([0] * 3, 3) zq = deque([0] * 3, 3) def convertBoundi...
adewinter/perspective
python/utils.py
utils.py
py
3,717
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 14, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 16, "usage_type": "call" }, { "api_name": "math.sqrt", ...
5111560001
from collections import namedtuple import fnmatch import json import dateutil from PIL.Image import Image from django.contrib.auth import password_validation from rest_framework.authtoken.views import ObtainAuthToken from rest_framework.authtoken.models import Token from rest_framework.exceptions import ValidationError...
crescsanski/Budget-Buddy
backend/app/views/receipt_upload.py
receipt_upload.py
py
17,872
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.generics.GenericAPIView", "line_number": 45, "usage_type": "name" }, { "api_name": "rest_framework.decorators.parser_classes", "line_number": 47, "usage_type": "name" }, { "api_name": "rest_framework.parsers.MultiPartParser", "line_number": 47, ...
16966473216
from flask import Flask, request from flask_restful import Api, Resource, reqparse, abort, fields, marshal_with from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) # creating a new Flask app api = Api(app) # wrap our app in a rest API app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///database.db" db = SQ...
calzoom/FlaskRestAPITutorial
main.py
main.py
py
4,484
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_restful....
10245559411
import unittest from pathlib import Path import shutil class FileMoveTestCase(unittest.TestCase): def setUp(self): self.source_folder = Path('/path/to/source/') self.target_folder = Path('/path/to/target/') # Create some temporary files for testing source_file1 = self.sourc...
nprasad2077/scripts
tests/find_move_version_2_test.py
find_move_version_2_test.py
py
1,552
python
en
code
0
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "shutil.rmtree", "li...
10709170246
from django.urls import path from rest_framework.urlpatterns import format_suffix_patterns from library import views urlpatterns = [ path('', views.api_root), path('library/', views.BookList.as_view(), name='library-list'), path('library/featured/', views.FeatureBook.as_view(), name='featured_book'), ...
Momentum-Team-14/drf-library-api-Ajsteph89
library/urls.py
urls.py
py
852
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "library.views.api_root", "line_number": 7, "usage_type": "attribute" }, { "api_name": "library.views", "line_number": 7, "usage_type": "name" }, { "api_name": "django.urls.p...
33744624613
#!/usr/bin/python3 """ # -*- coding: utf-8 -*- # @Time : 2020/8/28 11:04 # @File : train.py """ from cProfile import label from pickletools import optimize import torch import torchvision from django.utils import timezone from training.lenet import LeNet import training.pre_process as pre_process from trai...
Hsu1023/THSS-CRACKER
2nd Summer/程序设计实践/hw4/src/training/train.py
train.py
py
4,999
python
en
code
7
github-code
21
[ { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "threading.Lock", "line_number": 26, "usage_type": "call" }, { "api_name": "torchvision.datasets.MNIST", "line_number": 31, "usage_type": "call" }, { "api_name": "torchvision...
12520212740
#!/usr/bin/env python3 import sys import matplotlib.pyplot as plt import numpy as np from fastdtw import fastdtw from scipy.spatial.distance import euclidean file_1 = sys.argv[1] file_2 = sys.argv[2] pv_1 = np.array([float(line.strip()) for line in open(file_1, 'r')]) pv_2 = np.array([float(line.strip()) for line in...
orestisfl/thxou2016-qbsh
src/pv_plot.py
pv_plot.py
py
1,012
python
en
code
5
github-code
21
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_numbe...
72970126772
from Lib.pacman.pacman_exclusive.simulation import PacmanExclusiveSimulation from Lib.pacman.pacman_with_ghosts.simulation import PacmanGhostSimulation from pathlib import Path base_path = Path(__file__).parent pacman_ghost_config_path = (base_path / "../conf/config.conf").resolve() pacman_exclusive_config_path = (b...
AshtonGit/NEAT-Pacman
Lib/pacman/main.py
main.py
py
2,713
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "call" }, { "api_name": "Lib.pacman.pacman_exclusive.simulation.PacmanExclusiveSimulation", "line_number": 47, "usage_type": "call" }, { "api_name": "Lib.pacman.pacman_with_ghosts.simulation.PacmanGhostSimulation", ...
13719815464
import datetime import re import zipfile from io import BytesIO, StringIO from depot.io.utils import FileIntent from tg import abort, expose, flash, redirect, request, require, response, url from tg.predicates import has_permission, not_anonymous import algobowl.lib.problem as problemlib from algobowl.lib.base import...
jackrosenthal/algobowl
algobowl/controllers/group.py
group.py
py
15,148
python
en
code
4
github-code
21
[ { "api_name": "re.compile", "line_number": 24, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 25, "usage_type": "call" }, { "api_name": "algobowl.lib.base.BaseController", "line_number": 28, "usage_type": "name" }, { "api_name": "tg.predicates....
38617341721
from tkinter import * from pystray import MenuItem as item from PIL import Image from time import sleep import tkinter.messagebox import pystray import pyperclip import keyboard import os.path # Создаем окно приложения main_window = Tk() main_window.title("Simpless Clipboard") main_window.configure(background="white")...
justc0de-it/simpless-clipboard
main.py
main.py
py
3,651
python
ru
code
0
github-code
21
[ { "api_name": "tkinter.messagebox", "line_number": 31, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_number": 49, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 49, "usage_type": "name" }, { "api_name": "pystray.MenuItem", ...
46781241724
from base64 import b64encode, b64decode from Crypto.Cipher import AES import threading import hashlib import json class Util: def __init__(self, *args): pass def hash(self, str_input): return hashlib.sha256(str_input.encode()).hexdigest() def str_join(self, *args): return ''.join(ma...
LixurProtocol/Lixur-Python-Archive
Lixur Protocol/server/util.py
util.py
py
4,240
python
en
code
1
github-code
21
[ { "api_name": "hashlib.sha256", "line_number": 11, "usage_type": "call" }, { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "json.load", "line_number": 24, "usage_type": "call" }, { "api_name": "threading.Thread", "line_numbe...
1209128587
import numpy as np from numpy import mat, zeros from scipy.integrate import ode class Simulation: def __init__(self, max_time, time_step): self.max_time = max_time self.time_step = time_step self.num_steps = round(max_time / time_step) + 1 # numeric drift correction constants ...
treygreer/treb
treb_sim/src/dynamics/simulation.py
simulation.py
py
5,998
python
en
code
0
github-code
21
[ { "api_name": "numpy.mat", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.mat", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.mat", "line_number": 45, ...
40293685334
from django.shortcuts import render from .models import Movie from directors.models import Director from starts.models import Actor from user.models import CustomUser from django.views.generic import ListView import pandas as pd from django.http.response import HttpResponse from festivals.models import Festival # cla...
Stink-Po/imdbi
movies/views.py
views.py
py
1,499
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "festivals.models.Festival", "line_number": 33, "usage_type": "call" }, { "api_name": "django.http.response.HttpResponse", "line_number": 39, "usage_type": "call" } ]
31626419080
# Version Date Developer Comments #-------------------------------------------------------------------------- # 0.1 ? ? initial development # 0.1.1 2019-07-31 Drew Thompson remove hardcoded values # 0.1.2 ...
shlienlab/WGS_somatic_pipeline
dockerfiles/shlienlab-filtering:3.6/filterpipeline/cFilter.py
cFilter.py
py
23,065
python
en
code
3
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 32, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 60, "usage_type": "call" }, { "api_name": "warnings.warn", "line_number": 72, "usage_type": "call" }, { "api_name": "warnings.warn", "lin...
28456942718
import configparser import datetime import json import os import re import discord import requests import spotipy import spotipy.util client = discord.Client() @client.event async def on_ready(): print('------') print('Logged in as: {}:{}'.format(client.user.name, client.user.id)) print('------') @cli...
daot/playlistBot
bot.py
bot.py
py
6,422
python
en
code
1
github-code
21
[ { "api_name": "discord.Client", "line_number": 12, "usage_type": "call" }, { "api_name": "spotipy.util.prompt_for_user_token", "line_number": 28, "usage_type": "call" }, { "api_name": "spotipy.util", "line_number": 28, "usage_type": "attribute" }, { "api_name": "s...
11647778492
import unittest import keyboard from base import input_cmd from commands import CMD from fixtures.fixtures_cmd import (cmd_list_1, cmd_list_2, cmd_list_3, cmd_list_4, cmd_list_5, cmd_list_6) from fixtures.fixtures_res import (res_list_1, res_list_2, res_list_3, ...
SergSukh/code_testing_examples
tests_unit.py
tests_unit.py
py
5,326
python
ru
code
1
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "fixtures.fixtures_cmd.cmd_list_1", "line_number": 19, "usage_type": "argument" }, { "api_name": "fixtures.fixtures_cmd.cmd_list_1", "line_number": 20, "usage_type": "name" ...
23097569643
import sys, json,random with open('jsons.txt') as f: articles = f.readlines() random.shuffle(articles) articles = articles[:int(len(articles)*0.2)] with open('french_news.txt','w') as f: for i,article in enumerate(articles): with open(article.strip()) as a: art = json.load(a) f.w...
herobd/handwriting_line_generation
data/compile_french_new.py
compile_french_new.py
py
391
python
en
code
59
github-code
21
[ { "api_name": "random.shuffle", "line_number": 4, "usage_type": "call" }, { "api_name": "json.load", "line_number": 9, "usage_type": "call" } ]
42525949555
# -*- coding: utf-8 -*- #@+leo-ver=5-thin #@+node:pimgeek.20181113171208.1: * @file eel_test.py #@@first #@@language python import eel # 指定包含前端代码的文件夹 eel.init('web') # 把下方的 python 方法暴露给前端(以便 javascript 调用) # 发生前端调用时,可以顺带接收到来自前端的数据(即方法参数) @eel.expose def js_to_py(js_param, is_over): print('[py] js_to_py 方法:%s' % j...
pimgeek/play
leo/eel_test.py
eel_test.py
py
1,421
python
zh
code
0
github-code
21
[ { "api_name": "eel.init", "line_number": 10, "usage_type": "call" }, { "api_name": "eel.py_to_js", "line_number": 20, "usage_type": "call" }, { "api_name": "eel.expose", "line_number": 14, "usage_type": "attribute" }, { "api_name": "eel.py_to_js", "line_number...
31289216904
import collections from typing import List class Solution: def networkBecomesIdle(self, edges: List[List[int]], patience: List[int]) -> int: ans = 3 n = len(patience) g = [[] for _ in range(n)] for u, v in edges: g[v].append(u) g[u].append(v) visite...
sengami-yuka/py
coding_problems/leetcode/2039_the_time_when_the_network_becomes_idle.py
2039_the_time_when_the_network_becomes_idle.py
py
1,405
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
7746258892
import csv import cv2 import numpy as np from keras.models import Sequential from keras.layers import Flatten, Dense, Lambda, Dropout from keras.layers.convolutional import Convolution2D, Cropping2D standard_path = '../../opt/carnd_p3/data/' def get_csv_lines(): """ Puts the lines of provided csv file 'drivin...
chrMenzel/CarND-Behavioral-Cloning
model.py
model.py
py
5,047
python
en
code
0
github-code
21
[ { "api_name": "csv.reader", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 49, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 58, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2RGB", "line_numb...
39018603721
#!/usr/bin/env python3 """ SGLD sampler """ import jax.numpy as jnp from jax import jit, random import numpy as np import time from tqdm import tqdm def sgld_grad(key, theta, gradf_0, gradf_i_batch, x, y, n, replacement): """ Function to evaluate SGLD stochastic gradient Inputs: key - ...
srshtiputcha/sgmcmc_preferential_subsampling
src/samplers/sgld.py
sgld.py
py
3,995
python
en
code
3
github-code
21
[ { "api_name": "jax.random.split", "line_number": 33, "usage_type": "call" }, { "api_name": "jax.random", "line_number": 33, "usage_type": "name" }, { "api_name": "jax.random.choice", "line_number": 34, "usage_type": "call" }, { "api_name": "jax.random", "line_...
9375010769
import nltk def main(): while True: text = input("Text: ") text_tokenized = nltk.word_tokenize(text) pos_tags = nltk.pos_tag(text_tokenized) pos_tags = [pos_tag[1] for pos_tag in pos_tags] print("POS: ", ' '.join(pos_tags)) if __name__ == "__main__": main()
potsawee/py-tools-ged
old-scripts/pos_generator.py
pos_generator.py
py
309
python
en
code
0
github-code
21
[ { "api_name": "nltk.word_tokenize", "line_number": 6, "usage_type": "call" }, { "api_name": "nltk.pos_tag", "line_number": 7, "usage_type": "call" } ]
45169719211
import log import os os.environ['TZ'] = 'UTC' import logging logger = logging.getLogger(__name__) import hashlib import json import uuid import time from contextlib import contextmanager from redis import Redis import docker import psycopg2 import psycopg2.pool from psycopg2.extras import RealDictCursor r = Redis(h...
thalida/unpack.link
unpack/helpers.py
helpers.py
py
13,741
python
en
code
1
github-code
21
[ { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": 20, "usage_type": "call" }, { "api_name": "os.environ", "line_nu...
69928101812
import pygame, sys, os from pygame.locals import * dir(pygame) pygame.init() window = pygame.display.set_mode((900, 500)) pygame.display.set_caption("Drop and Shoot") screen = pygame.display.get_surface() #images needed are wheels that rotate, rig, explosion, explosive rock, rock, background #music ne...
MarioMingoia/DropandShoot
Drop and Shoot/main.py
main.py
py
383
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": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.display.s...