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
71992176033
# -*- coding: utf-8 -*- """ Package: iads File: utils.py Année: LU3IN026 - semestre 2 - 2021-2022, Sorbonne Université """ # Fonctions utiles pour les TDTME de LU3IN026 # Version de départ : Février 2022 # import externe import numpy as np import pandas as pd import matplotlib.pyplot as plt import math import seabo...
samynhl/Data-Science-Project
iads/utils.py
utils.py
py
11,437
python
fr
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 29, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 30, "usage_type": "call" }, { "api_name": ...
916189966
# -*- coding : UTF-8 -*- from urllib import request from urllib import parse import json if __name__ == "__main__": Request_URL = "http://fanyi.baidu.com/v2transapi" Form_Data = {} Form_Data['from'] = 'en' Form_Data['to'] = 'zh' Form_Data['query'] = 'Android' Form_Data['transtype'] = 'realtime'...
NotMyYida/AndroidBookNote
pycharmWS/webcrawler/translate.py
translate.py
py
2,579
python
en
code
0
github-code
1
[ { "api_name": "urllib.parse.urlencode", "line_number": 15, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 15, "usage_type": "name" }, { "api_name": "urllib.request.urlopen", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib.req...
21692068618
import discord from discord.ext import commands import random from discord.ext.commands.core import command import datetime from discord.utils import get class Utility(commands.Cog): """Utility commands for setting up the environment""" def __init__(self,bot): self.bot = bot self.c...
Navneety007/DoppleGanger
cogs/utility.py
utility.py
py
8,130
python
en
code
1
github-code
1
[ { "api_name": "discord.ext.commands.Cog", "line_number": 9, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 9, "usage_type": "name" }, { "api_name": "discord.ext.commands.command", "line_number": 15, "usage_type": "call" }, { "api...
36976850467
# -*- coding: utf-8 -*- ########################################################### # Send data from a simple device (raspberry, gpu, watch) to another device # version 0.5 # syntaxe: # python this_script_name remote_ip dataname [value] or python this_script_name start_server # eg: python this_script_name 1...
alexandre-mazel/electronoos
scripts/versatile/versatile.py
versatile.py
py
54,037
python
en
code
2
github-code
1
[ { "api_name": "sys.version_info", "line_number": 32, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 45, "usage_type": "attribute" }, { "api_name": "struct.pack", "line_number": 49, "usage_type": "call" }, { "api_name": "time.sleep", ...
15554629273
from django.contrib import admin from .models import Faq class FaqAdmin(admin.ModelAdmin): list_display = ( 'title', 'writer', 'hits', 'registered_date', ) search_fields = ('title', 'content', 'writer__user_id',) admin.site.register(Faq, FaqAdmin)
SangjunDev/ROHDE-SCHWARZ_Local
faq/admin.py
admin.py
py
302
python
en
code
0
github-code
1
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 4, "usage_type": "name" }, { "api_name": "django.contrib.admin.site.register", "line_number": 13, "usage_type": "call" },...
1911947262
from typing import List from core.point import POINT_AT_INFINITY, Point from utils.int_operations import is_prime from utils.mod_operations import divide, is_square, square_root class EllipticCurve: def __init__(self, a, b, p) -> None: # if self.is_non_singular(): self.__a = a self.__b = b...
duycao2001/elliptic_curve
elliptic-curve-python/core/elliptic_curve.py
elliptic_curve.py
py
3,694
python
en
code
0
github-code
1
[ { "api_name": "utils.mod_operations.is_square", "line_number": 23, "usage_type": "call" }, { "api_name": "utils.mod_operations.square_root", "line_number": 24, "usage_type": "call" }, { "api_name": "core.point.Point", "line_number": 28, "usage_type": "call" }, { "...
27663467805
# coding: utf-8 from flask import url_for from wtforms.widgets import html_params, HTMLString from cgi import escape from wtforms.compat import text_type class VerifyCode(object): html_params = staticmethod(html_params) def __call__(self, field, **kwargs): if field.hidden == True: html = '<input %s>' % self....
endsh/haoku-open
simin/simin/web/forms/widgets.py
widgets.py
py
1,490
python
en
code
6
github-code
1
[ { "api_name": "wtforms.widgets.html_params", "line_number": 10, "usage_type": "name" }, { "api_name": "flask.url_for", "line_number": 32, "usage_type": "call" }, { "api_name": "flask.url_for", "line_number": 33, "usage_type": "call" }, { "api_name": "flask.url_for...
14656769144
import warnings warnings.filterwarnings("ignore") from jax_sandbox.common import * from jax_sandbox.imitation import * from jax_sandbox.actor_critic import * from jax_sandbox.policy_gradient import * from jax_sandbox.value_based_methods import * import hydra import envs.dmc as dmc from utils import * def make_env(en...
dhruvsreenivas/jax_sandbox
main.py
main.py
py
2,384
python
en
code
1
github-code
1
[ { "api_name": "warnings.filterwarnings", "line_number": 2, "usage_type": "call" }, { "api_name": "envs.dmc.make", "line_number": 16, "usage_type": "call" }, { "api_name": "envs.dmc", "line_number": 16, "usage_type": "name" }, { "api_name": "hydra.main", "line_...
30500422685
import os import click import numpy as np import pandas as pd import os.path as op import nibabel as nib from tqdm import tqdm from glob import glob from joblib import Parallel, delayed from nilearn import masking, image from nistats.design_matrix import make_first_level_design_matrix from nistats.first_level_model imp...
NILAB-UvA/AOMIC-common-scripts
misc_qc/run_task_fmri_models.py
run_task_fmri_models.py
py
7,579
python
en
code
8
github-code
1
[ { "api_name": "os.path.basename", "line_number": 48, "usage_type": "call" }, { "api_name": "os.path", "line_number": 48, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 51, "usage_type": "call" }, { "api_name": "os.path.join", "line_num...
36192451748
import logging from time import sleep from collections import namedtuple from selenium import webdriver from selenium.webdriver.firefox.options import Options as FirefoxOptions from selenium.webdriver.chrome.options import Options as ChromeOptions from selenium.webdriver.common.keys import Keys from selenium.common.e...
louisabraham/paybybot
paybybot/bot.py
bot.py
py
9,890
python
en
code
3
github-code
1
[ { "api_name": "collections.namedtuple", "line_number": 19, "usage_type": "call" }, { "api_name": "selenium.webdriver.PhantomJS", "line_number": 46, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 46, "usage_type": "name" }, { "api_name":...
26162270266
from django.urls import path from .views import * app_name = 'pagecrud' urlpatterns = [ path('index/', index, name='index'), path('catalog/', CatalogView.as_view(), name='catalogcrud'), path('catalogDelete/<int:delete_id>/', catalogDelete, name='catalogdelete'), path('catalogUpdate/<int:id_catalog>/', ...
muhzulfik/project-library
crudPage/urls.py
urls.py
py
845
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
27805897926
import fire import pandas as pd from src import INPUT_DATA_PATH, TRAIN_DATA_PATH, VAL_DATA_PATH def create_spilts( train_val_split: float = 0.1, path_input_data: str = INPUT_DATA_PATH, path_train_data: str = TRAIN_DATA_PATH, path_val_data: str = VAL_DATA_PATH, ): df = pd.read_csv(path_input_data)...
karthikrangasai/sturdy-eureka
src/create_splits.py
create_splits.py
py
1,194
python
en
code
0
github-code
1
[ { "api_name": "src.INPUT_DATA_PATH", "line_number": 9, "usage_type": "name" }, { "api_name": "src.TRAIN_DATA_PATH", "line_number": 10, "usage_type": "name" }, { "api_name": "src.VAL_DATA_PATH", "line_number": 11, "usage_type": "name" }, { "api_name": "pandas.read_...
42310547395
#!/usr/bin/env python import numpy as np import os import pytest import requests # noqa: F401 from src.data_collection.Poloniex import poloniex_data def test_init(): with pytest.raises(TypeError): poloniex_data.PoloniexDataManager() @pytest.fixture(scope='function') def mock_retry_request(monkeypatch...
tobiasraabe/crypto
src/data_collection/Poloniex/test_poloniex_data.py
test_poloniex_data.py
py
2,125
python
en
code
0
github-code
1
[ { "api_name": "pytest.raises", "line_number": 12, "usage_type": "call" }, { "api_name": "src.data_collection.Poloniex.poloniex_data.PoloniexDataManager", "line_number": 13, "usage_type": "call" }, { "api_name": "src.data_collection.Poloniex.poloniex_data", "line_number": 13, ...
3018927991
# -*- coding: utf-8 -*- """ Performance test of cnn architectures on various degradation models. Created on Thu May 24 11:00:00 2018 Author: Prasun Roy | CVPRU-ISICAL (http://www.isical.ac.in/~cvpr) GitHub: https://github.com/prasunroy/cnn-on-degraded-images """ # imports from __future__ import division from __futur...
prasunroy/cnn-on-degraded-images
test.py
test.py
py
20,147
python
en
code
14
github-code
1
[ { "api_name": "numpy.random.randint", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 41, "usage_type": "attribute" }, { "api_name": "mlutils.callbacks.Telegram", "line_number": 70, "usage_type": "call" }, { "api_name": "os....
74064928034
import torch.nn as nn class stack_conv_layer(nn.Module): def __init__(self, filter): super(stack_conv_layer, self).__init__() self.activation = nn.ReLU(inplace=True) self.conv1 = nn.Conv2d(filter[0], filter[1], kernel_size=3, padding=1, bias=True) self.conv2 = nn.Conv2d(filter[1], ...
Cli98/tep-repo
Networks/customer_module.py
customer_module.py
py
2,042
python
en
code
0
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.ReLU", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.nn", "line_number"...
36698448915
from visual import * from visual.graph import * # graphing capability import math from matplotlib import pyplot as plt import random from random import randint import numpy as np from scipy.special import gamma # usando gamma import pylab from scipy.stats import beta import panda as pd from matplotlib.ticke...
lucassolanoc/UFRN
Roboteam/E-greedy/Algoritmos/ThompsonLearning.py
ThompsonLearning.py
py
14,821
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 15, "usage_type": "name" }, { "api_name": "scipy.special.gamma", "line_number": 20, "usage_type": "call" }, { "api_name": "math...
30890389119
"""Draft List application.""" import requests, random import pdb, os from flask import Flask, request, render_template, redirect, flash, session, jsonify from flask_debugtoolbar import DebugToolbarExtension from models import db, connect_db, User, List, PlayerList, Player from forms import RegisterForm, LoginForm, Comp...
cshellen1/fantasy-draft-list
app.py
app.py
py
9,165
python
en
code
0
github-code
1
[ { "api_name": "sqlalchemy.sql.functions.ReturnTypeFromArgs", "line_number": 10, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 14, "usage_type": "call" }, { "api_name":...
5866244481
from pip import main import numpy as np import pandas as pd import sklearn from sklearn.pipeline import Pipeline, FeatureUnion from sklearn.impute import SimpleImputer, MissingIndicator from sklearn.preprocessing import FunctionTransformer, LabelEncoder, Normalizer, StandardScaler, OneHotEncoder from sklearn.base impo...
woshicqy/CS598PSL_Project1
mymain_test.py
mymain_test.py
py
10,484
python
en
code
0
github-code
1
[ { "api_name": "numpy.abs", "line_number": 32, "usage_type": "call" }, { "api_name": "scipy.stats.zscore", "line_number": 32, "usage_type": "call" }, { "api_name": "scipy.stats", "line_number": 32, "usage_type": "name" }, { "api_name": "scipy.stats.mstats.winsorize...
16965598918
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on %(date)s @author: Yuanyuan Shi """ import pandas as pd import numpy as np from sklearn import preprocessing from sklearn.model_selection import train_test_split from sklearn.neural_network import MLPClassifier from sklearn.metrics import mean_squared_error...
Yuanyuan-Shi/PowerOutagePredictor
PowerOutagePredictor/NeuralNetwork/nn_sandbox.py
nn_sandbox.py
py
2,878
python
en
code
6
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 32, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 38, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.normalize", "line_number": 48, "usage_type": "call" }, ...
23983268226
import pygame from MENU.Application import Application class Versus(Application): def __init__(self, game): Application.__init__(self, game) #self.state will give the start self.state = "1 VS 1" #all this will give the positions of the different texts that will be displayed...
SlyLeoX/Cyber-Puck
Cyberpuck_ReleaseDirectory/MENU/Versus.py
Versus.py
py
4,897
python
en
code
1
github-code
1
[ { "api_name": "MENU.Application.Application", "line_number": 4, "usage_type": "name" }, { "api_name": "MENU.Application.Application.__init__", "line_number": 6, "usage_type": "call" }, { "api_name": "MENU.Application.Application", "line_number": 6, "usage_type": "name" ...
19842239008
import cv2 img = cv2.imread("aircraft.jpg") img = cv2.resize(img, (512, 512)) img1 = cv2.imread("aircraft1.jpg") img1 = cv2.resize(img1, (512, 512)) img1 = cv2.medianBlur(img1, 101) img2 = cv2.imread("polygons.png") img2 = cv2.medianBlur(img2, 25) img2 = cv2.resize(img2, (512, 512)) if img.shape == img...
REISOGLU53/OpenCV-Python
06_Alistirma/09_Resim_Karsilastirma.py
09_Resim_Karsilastirma.py
py
685
python
en
code
3
github-code
1
[ { "api_name": "cv2.imread", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 7, ...
72521554913
""" utils.py Manejo de ciertos utilitarios como: - Cargado de configuración """ import configparser import os import logging import hashlib from logging.handlers import RotatingFileHandler #SETTINGS_FILENAME = 'settings.ini' # De esta manera se ubica sobre el root del proyecto y no sobre /app SETTINGS_...
jpablochaves/filter_api
app/shared/utils.py
utils.py
py
5,559
python
es
code
0
github-code
1
[ { "api_name": "os.path.abspath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.dirname", "line...
26928070232
import PyQt5.QtCore as QtCore from imperialism_remake import start from imperialism_remake.base import constants, network from imperialism_remake.server import server def client_connect(): """ Client tries to connect. """ client.connect_to_host(constants.NETWORK_PORT) def send_shutdown(): """ ...
sumpfralle/imperialism-remake
test/network_process_start_shutdown_stresstest.py
network_process_start_shutdown_stresstest.py
py
988
python
en
code
null
github-code
1
[ { "api_name": "imperialism_remake.base.constants.NETWORK_PORT", "line_number": 10, "usage_type": "attribute" }, { "api_name": "imperialism_remake.base.constants", "line_number": 10, "usage_type": "name" }, { "api_name": "imperialism_remake.base.constants.C", "line_number": 16...
43707222394
import re import nltk.tokenize from six import text_type from cakechat.utils.text_processing.config import SPECIAL_TOKENS _END_CHARS = '.?!' _tokenizer = nltk.tokenize.RegexpTokenizer(pattern=u'\w+|[^\w\s]') def get_tokens_sequence(text, lower=True, check_unicode=True): if check_unicode and not isinstance(tex...
e11co/Astromind
Astrobaby-chat/cakechat/utils/text_processing/str_processor.py
str_processor.py
py
1,777
python
en
code
2
github-code
1
[ { "api_name": "nltk.tokenize.tokenize.RegexpTokenizer", "line_number": 10, "usage_type": "call" }, { "api_name": "nltk.tokenize.tokenize", "line_number": 10, "usage_type": "attribute" }, { "api_name": "nltk.tokenize", "line_number": 10, "usage_type": "name" }, { "...
6328911031
# -*- coding: utf-8 -*- from __future__ import annotations import json import os import typing as tp from PySide2.QtWidgets import QLineEdit, QSpinBox class model(object): def __init__(self, *args, **kwargs): super(model, self).__init__(*args, **kwargs) def debug(self): print("debug") ...
RyotaUnzai/pairpro
renamer/renamerModel.py
renamerModel.py
py
4,117
python
en
code
0
github-code
1
[ { "api_name": "os.rename", "line_number": 19, "usage_type": "call" }, { "api_name": "PySide2.QtWidgets.QLineEdit", "line_number": 22, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "lin...
73152367715
from aws_cdk import Stack, Duration from constructs import Construct import aws_cdk.aws_lambda as _lambda import aws_cdk.aws_iam as iam import aws_cdk.aws_stepfunctions_tasks as tasks import aws_cdk.aws_stepfunctions as sfn import aws_cdk.aws_sns as sns from aws_cdk.aws_dynamodb import Table class PostProcessStack(...
donkz/rtcwprostats
stacks/postprocess.py
postprocess.py
py
5,841
python
en
code
2
github-code
1
[ { "api_name": "aws_cdk.Stack", "line_number": 13, "usage_type": "name" }, { "api_name": "constructs.Construct", "line_number": 16, "usage_type": "name" }, { "api_name": "aws_cdk.aws_dynamodb.Table", "line_number": 18, "usage_type": "name" }, { "api_name": "aws_cdk...
42938740587
import argparse import getpass import json import difflib import sys import requests import colorama from colorama import Fore from zjusess import zjusess from scorenotification import scorenotification # 用于中文对齐输出 def pad_len(string, length): return length - len(string.encode('GBK')) + len(string) class LOG: ...
PeiPei233/ZJUScoreAssistant
zjuscore.py
zjuscore.py
py
12,488
python
en
code
7
github-code
1
[ { "api_name": "colorama.Fore.CYAN", "line_number": 17, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "line_number": 17, "usage_type": "name" }, { "api_name": "colorama.Fore.RESET", "line_number": 17, "usage_type": "attribute" }, { "api_name": "colora...
30562257637
from collections import OrderedDict import random from string import ascii_uppercase def rand_chars(length): return ''.join( random.choice(ascii_uppercase) for i in xrange(length) ) def is_int_in_range(val, low, high): # inclusive, None is ok if val is None: return True ...
justecorruptio/snatch_v3
src/utils.py
utils.py
py
1,513
python
en
code
0
github-code
1
[ { "api_name": "random.choice", "line_number": 9, "usage_type": "call" }, { "api_name": "string.ascii_uppercase", "line_number": 9, "usage_type": "argument" }, { "api_name": "random.randint", "line_number": 32, "usage_type": "call" }, { "api_name": "random.randint"...
32521435646
from flask import Flask, request, render_template from keras.models import load_model from keras.preprocessing import image import numpy as np from io import BytesIO app = Flask(__name__) model = load_model('brain_tumor_model.h5') @app.route('/', methods=['GET', 'POST']) def upload_file(): if request.method == 'P...
alfalfs/Cancer_Detection_using_CCN
app.py
app.py
py
1,086
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.req...
17137250502
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC driver = webdriver.Chrome() with open('boardgamelinks.txt', 'r') as links_file, open('boardgametime.txt', 'w') as file: ...
YKawesome/Python-Projects
Projects/Board Game Scraper/Times/boardgametimes.py
boardgametimes.py
py
1,203
python
en
code
1
github-code
1
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 12, "usage_type": "call" }, {...
24655058065
from flask import Blueprint from . import views bp = Blueprint( name="public", import_name=__name__, static_folder=None, template_folder=None, url_prefix="/", ) bp.add_url_rule( rule="/", endpoint="index", view_func=views.index, methods=["GET"], )
harrelchris/template-flask
app/public/urls.py
urls.py
py
287
python
en
code
0
github-code
1
[ { "api_name": "flask.Blueprint", "line_number": 5, "usage_type": "call" } ]
11637400068
import re import math import pandas as pd import datetime import itertools as it import plotly.express as px import plotly.graph_objects as go from textwrap import wrap from collections import ChainMap, OrderedDict from .downloader import download from more_itertools import partition pd.set_option("mode.chained_assig...
brasil-em-numeros/brasil-em-numeros
dashboard/provedores/pdt/despesas_publicas.py
despesas_publicas.py
py
8,234
python
pt
code
1
github-code
1
[ { "api_name": "pandas.set_option", "line_number": 14, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 32, "usage_type": "call" }, { "api_name": "collections.ChainMap", "line_number": 45, "usage_type": "call" }, { "api_name": "itertools.product", ...
10988878904
import unittest import torch from torch import nn from towhee.models.lightning_dot.bi_encoder import BiEncoder class MockUniterEncoder(nn.Module): """ A Mock UniterEncoder """ @classmethod def init_encoder(cls, config, checkpoint_path=None, project_dim=8): print( f"UniterEncod...
towhee-io/towhee
tests/unittests/models/lightning_dot/test_lightning_dot.py
test_lightning_dot.py
py
3,401
python
en
code
2,843
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.ones", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_nu...
9569632216
import requests from datetime import datetime import config import time MY_LAT = 46.482525 # Your latitude MY_LONG = 30.723309 # Your longitude # Function to check if ISS is overhead def is_iss_overhead(): response = requests.get(url="http://api.open-notify.org/iss-now.json") response.raise_for_status() ...
sined277/30_API_REQUESTS_iss_over_head
main.py
main.py
py
1,310
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
75168963873
"""This module includes api endpoints for auth.""" from fastapi import APIRouter, status, Depends from dependencies import verify_api_key from repositories.user import UserRepository from schemas.base import ResponseSchema from schemas.auth import ( LoginRequestSchema, TokenRequestSchema, DecodeResponseS...
Monoboard/monoboard.api.auth
src/api/auth.py
auth.py
py
4,661
python
en
code
0
github-code
1
[ { "api_name": "fastapi.APIRouter", "line_number": 28, "usage_type": "call" }, { "api_name": "schemas.auth.LoginRequestSchema", "line_number": 41, "usage_type": "name" }, { "api_name": "repositories.user.UserRepository.get_user", "line_number": 44, "usage_type": "call" }...
71103767073
# coding: utf-8 import pygame as pg import numpy as np class GameOfLife(): def __init__(self, width=640, height=480, cell_size=20, FPS=30): self.width = width self.height = height self.cell_size = cell_size self.screen = pg.display.set_mode((width, height)) self.Ncol = self.width // self.cell_size se...
astro-kaba4ek/Python_5
DZ4/game_of_life.py
game_of_life.py
py
3,257
python
en
code
0
github-code
1
[ { "api_name": "pygame.display.set_mode", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.zeros",...
21340483022
from collections import defaultdict from typing import List class Node: def __init__(self, val): self.val = val self.dfn = -1 self.low_dfn = -1 self.children = [] class ArticulationFinder: def __init__(self): self.nodes = defaultdict(list) self.ap ...
kannanParamasivam/datastructures_and_algorithm
graph/problems/find_articulation_points.py
find_articulation_points.py
py
1,991
python
en
code
1
github-code
1
[ { "api_name": "collections.defaultdict", "line_number": 15, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 54, "usage_type": "name" } ]
32903456096
#!/usr/bin/python # encoding: utf-8 #主要是对爬取39健康网的相关方法的封装相关操作的封装 import requests from pyquery import PyQuery as pq class health39util(object): def __init__(self): pass def parse_disease(self, url): ''' 解析疾病页面 ''' headers = {'user-agent': 'Mozilla/5.0 (Win...
mayi140611/crawl
requestProj/39jiankang/health39util.py
health39util.py
py
2,018
python
en
code
1
github-code
1
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "pyquery.PyQuery", "line_number": 19, "usage_type": "call" } ]
72550547235
from sklearn.model_selection import train_test_split import pandas as pd from sklearn.svm import SVC # 파일 load df = pd.read_excel('C:/BCI Data/ratio file/trainset588.xlsx') x = df[df.columns[1,4]] # ratio_mu, ratio_theta, ratio_beta y = df['ClickorNot'] # y label (0 or 1) X_train, X_test, y_train, y_test = train_tes...
seungcholcho/gazetracker
src/SVM_Classifier.py
SVM_Classifier.py
py
622
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_excel", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.svm.SVC", "line_number": 14, "usage_type": "call" } ]
74090940833
import os import sys import leveldb import logging import fileinput from wikiref.util import flush_dict_to_ldb from wikiref.settings import LDB_ARRAY_DELIM from wikiref.settings import INDEX_TAXONOMY_REL from wikiref.settings import INDEX_YAGO_TSV_DELIM from wikiref.settings import INDEX_YAGO_TAXONOMY_DIRNAME loggi...
zaycev/wikiref
scripts/run_index_taxonomy.py
run_index_taxonomy.py
py
1,343
python
en
code
0
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "logging.error", ...
2764211799
# Importing necessary libraries... import collections import numpy as np import pandas as pd from sklearn import datasets from sklearn.model_selection import train_test_split from math import * class GaussianNaiveBayes: total_prob = None mean, variance, n_class = None, None, None y_dict = None ...
zhuyuecai/Comp551Group53
Yuecai/integration/mlModels/naive_bayes.py
naive_bayes.py
py
3,375
python
en
code
0
github-code
1
[ { "api_name": "collections.Counter", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.ones", "line_numb...
24000790808
# reference 1 - https://www.youtube.com/watch?v=Dhc_fq5iCnU&list=PLpdmBGJ6ELULEfPWvvks0HtwzCvQo1zu0&index=5 # reference 2 - https://www.youtube.com/watch?v=9TxEQQyv9cE&list=PLpdmBGJ6ELULEfPWvvks0HtwzCvQo1zu0&index=8 # reference 3 - https://www.youtube.com/watch?v=MlK6SIjcjE8&t=322s from llama_index import LangchainEmb...
hastinmodi/Ramayana_GPT
streamlit_app.py
streamlit_app.py
py
2,898
python
en
code
0
github-code
1
[ { "api_name": "streamlit.title", "line_number": 16, "usage_type": "call" }, { "api_name": "streamlit.text_input", "line_number": 17, "usage_type": "call" }, { "api_name": "langchain.llms.base.LLM", "line_number": 20, "usage_type": "name" }, { "api_name": "transfor...
17087660357
from nornir import InitNornir from nornir.plugins.tasks import networking, text from nornir.plugins.functions.text import print_result from nornir.core.filter import F from nornir.core.task import Result from ciscoconfparse import CiscoConfParse from pathlib import Path import ipdb import re import time CONFIG_PATH =...
bfernando1/nornir-automation
week8/bgp_tool.py
bgp_tool.py
py
10,822
python
en
code
1
github-code
1
[ { "api_name": "nornir.plugins.tasks.networking.netmiko_send_command", "line_number": 34, "usage_type": "attribute" }, { "api_name": "nornir.plugins.tasks.networking", "line_number": 34, "usage_type": "name" }, { "api_name": "nornir.core.task.Result", "line_number": 50, "u...
18030830671
#%% # Analysis example import glob import os import sys from importlib import reload sys.path.append('/data/git_repositories_py/SCRAPC/') sys.path.append('/data/git_repositories_py/fUS_pytools/') import matplotlib.pyplot as plt import numpy as np import scipy.signal as signal import scrapc_analysis as scana import s...
fluongo/fUS_pyTools
analysis_scripts/09_12_19_Shapiro_lab_meeting.py
09_12_19_Shapiro_lab_meeting.py
py
13,271
python
en
code
4
github-code
1
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
682547229
import sys import pygame from pygame import gfxdraw from utils.mathhelper import clamp, is_inside_radius from utils.curves import Bezier class GUI: def __init__(self, width, height, offset_x=0, offset_y=0): pygame.init() self.offset_x = offset_x self.offset_y = offset_y self.size =...
burkap/osu-replay-analyzer
utils/gui.py
gui.py
py
16,562
python
en
code
0
github-code
1
[ { "api_name": "pygame.init", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pygame.Surfac...
37202277848
""" 0x Web3 Utilities author: officialcryptomaster@gmail.com """ from decimal import Decimal from enum import Enum from typing import Optional, Union from eth_utils import keccak, to_checksum_address from hexbytes import HexBytes from zero_ex.json_schemas import assert_valid from zero_ex.contract_artifacts import abi...
officialcryptomaster/pyveil
src/utils/zeroexutils.py
zeroexutils.py
py
30,368
python
en
code
6
github-code
1
[ { "api_name": "utils.web3utils.NetworkId.MAINNET", "line_number": 23, "usage_type": "attribute" }, { "api_name": "utils.web3utils.NetworkId", "line_number": 23, "usage_type": "name" }, { "api_name": "utils.web3utils.NetworkId.ROPSTEN", "line_number": 33, "usage_type": "at...
38604120141
# -*- coding: utf-8 -*- """ Created on Fri Mar 12 11:47:11 2021 @author: Souparno """ import torch #from transformers import AutoTokenizer, AutoModelWithLMHead from transformers import T5Tokenizer, T5ForConditionalGeneration from methodology_bs4 import * #from correlated_words_0 import * from summaryg...
Chattopadhyay-Souparno/Medical-Writing-Automation
main_file.py
main_file.py
py
1,785
python
en
code
3
github-code
1
[ { "api_name": "transformers.T5Tokenizer.from_pretrained", "line_number": 20, "usage_type": "call" }, { "api_name": "transformers.T5Tokenizer", "line_number": 20, "usage_type": "name" }, { "api_name": "transformers.T5ForConditionalGeneration.from_pretrained", "line_number": 21...
40772316728
# 1.导包 import time from selenium import webdriver from selenium.webdriver.common.by import By # 2.创建浏览器驱动对象 driver = webdriver.Chrome() # 3.打开测试网址打开注册A.html页面,完成以下操作 driver.get( "file:///C:/Users/sandysong/Desktop/pagetest/%E6%B3%A8%E5%86%8CA.html") # 4.业务操作 # 1).使用CSS定位方式中id选择器定位用户名输入框,并输入:admin driver.find_elemen...
1769778682/day03
test_09_css_前4种.py
test_09_css_前4种.py
py
1,063
python
zh
code
0
github-code
1
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR", "line_number": 12, "usage_type": "attribute" ...
30632337598
import mapclient.splash_rc from PySide6 import QtCore, QtGui, QtWidgets class SplashScreen(QtWidgets.QSplashScreen): def __init__(self): super(SplashScreen, self).__init__() pixmap = QtGui.QPixmap(":/mapclient/splash.png") self.setPixmap(pixmap) self._font = QtGui.QFont() ...
MusculoskeletalAtlasProject/mapclient
src/mapclient/splashscreen.py
splashscreen.py
py
1,179
python
en
code
19
github-code
1
[ { "api_name": "PySide6.QtWidgets.QSplashScreen", "line_number": 6, "usage_type": "attribute" }, { "api_name": "PySide6.QtWidgets", "line_number": 6, "usage_type": "name" }, { "api_name": "PySide6.QtGui.QPixmap", "line_number": 9, "usage_type": "call" }, { "api_nam...
74532493792
import random from art import logo from art import vs from game_data import data import os # make this as function # format the account data into printable format # name = random_data['name'] # follower_count = random_data['follower_count'] # description = random_data['description'] # country = random_data['country']...
yong197578/high-and-low-game
main.py
main.py
py
1,769
python
en
code
0
github-code
1
[ { "api_name": "art.logo", "line_number": 39, "usage_type": "argument" }, { "api_name": "random.choice", "line_number": 41, "usage_type": "call" }, { "api_name": "game_data.data", "line_number": 41, "usage_type": "argument" }, { "api_name": "random.choice", "li...
18332363530
import json from pathlib import Path # Define the input and output paths input_filepath = Path('./data/questions.json') output_directory = Path('./data/qna') # Expecting the questions.json with an array of { source, question, answer } pair tuples. with open(input_filepath, 'r') as input_file: input_json = json.lo...
CsabaConsulting/Vectara
augment_prep.py
augment_prep.py
py
1,458
python
en
code
0
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "json.load", "line_number": 10, "usage_type": "call" } ]
30002086737
import numpy as np from torch import nn from xavier.constants.type import Type from xavier.core.transformation import get_standard class Rnn(nn.Module): NAME_TYPE = Type.rnn def __init__(self, device=None): super(Rnn, self).__init__() self.output_layer = 3 self.device = device ...
fabriciotorquato/pyxaiver-v2
xavier/net/rnn.py
rnn.py
py
870
python
en
code
1
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "xavier.constants.type.Type.rnn", "line_number": 9, "usage_type": "attribute" }, { "api_name": "xavier...
27841424849
from flask import ( Blueprint, flash, g, redirect, render_template, request, url_for, Flask ) #from werkzeug.exceptions import abort #from flask_login import current_user, login_user, logout_user, login_required bp = Blueprint('home', __name__) @bp.route('/') @bp.route('/home') def index(): return ...
snickr42/cookbook
cookr/home.py
home.py
py
365
python
en
code
0
github-code
1
[ { "api_name": "flask.Blueprint", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" } ]
22290817065
from collections import deque class Solution: def solve(self, nums): # Write your code here def bfs(index, memo): visited = set([index]) queue = deque([(index, 0)]) best = 2 * len(nums) while queue: curr, length = queue.popleft() ...
dhrumilp15/Puzzles
binsearch/parity_jump_memo.py
parity_jump_memo.py
py
2,701
python
en
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 9, "usage_type": "call" }, { "api_name": "termcolor.cprint", "line_number": 59, "usage_type": "call" }, { "api_name": "termcolor.cprint", "line_number": 61, "usage_type": "call" } ]
40372539590
from bs4 import BeautifulSoup with open("indexTwo.html", "r") as f: document = BeautifulSoup(f, "html.parser") tags = document.find_all('input', type="text") for tag in tags: tag['placeholder'] = "I Love to change things :)" with open('change.html', 'w') as f: f.write(str(document))
Vselenis/Python-Advanced-April-2021
Web Scraping Project/demo/partTwo.py
partTwo.py
py
299
python
en
code
0
github-code
1
[ { "api_name": "bs4.BeautifulSoup", "line_number": 4, "usage_type": "call" } ]
6420744938
import math import gym from Acrobot_DQN import Acrobot_DQN from Acrobot_Game import Acrobot_Game env = gym.make("Acrobot-v1") min_len4train = 100 max_len4train = 50_000 DISCOUNT = 0.90 min_batch = 64 Batch_Size = 32 SHOW_EVERY = 200 UPDATE_SECONDARY_WEIGHTS = False UPDATE_SECONDARY_WEIGHTS_NUM = 4 ...
Soester10/DRL-Gym-Env
Acrobot/main.py
main.py
py
810
python
en
code
0
github-code
1
[ { "api_name": "gym.make", "line_number": 7, "usage_type": "call" }, { "api_name": "math.log", "line_number": 21, "usage_type": "call" }, { "api_name": "math.pow", "line_number": 22, "usage_type": "call" }, { "api_name": "Acrobot_DQN.Acrobot_DQN", "line_number"...
41973668035
from musikla.parser.printer import CodePrinter from typing import Any, Optional, Tuple, List from .statement_node import StatementNode from ..node import Node from musikla.core import Value, Context class MultiVariableDeclarationStatementNode( StatementNode ): def __init__ ( self, left : List[Node], right : Node, ...
pedromsilvapt/miei-dissertation
code/musikla/musikla/parser/abstract_syntax_tree/statements/multi_var_declaration_node.py
multi_var_declaration_node.py
py
2,354
python
en
code
0
github-code
1
[ { "api_name": "statement_node.StatementNode", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 8, "usage_type": "name" }, { "api_name": "node.Node", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Optional", ...
11747480348
from . import blueprint from .settings import SettingClass from .forms import SettingsForm from flask import request, current_app from .error import FormNotFound @blueprint.get('/') def ping(): return 'ping' @blueprint.post('/s/<setting_key>/set') def set_value(setting_key): setting: SettingClass = SettingC...
LordBex/flask-settings
flasky_settings/main.py
main.py
py
920
python
en
code
0
github-code
1
[ { "api_name": "settings.SettingClass", "line_number": 15, "usage_type": "name" }, { "api_name": "settings.SettingClass.get_group", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.json", "line_number": 18, "usage_type": "attribute" }, { "api...
22865648549
import pytest from src.app import create_app, DB from src.app import create_app from src.app.routes import routes from flask import json from sqlalchemy import event mimetype = 'application/json' headers = { 'Content-Type': mimetype, 'Accept': mimetype } @pytest.fixture(scope="session") def app(): # Esta...
juliasilvamoura/DEVinHousa-conectaNuvem
Modulo3/Modulo3-Flask/tests/conftest.py
conftest.py
py
1,713
python
pt
code
0
github-code
1
[ { "api_name": "src.app.create_app", "line_number": 17, "usage_type": "call" }, { "api_name": "src.app.routes.routes", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.json.du...
29845106401
from fastapi import APIRouter, Form, UploadFile, File from router.chart.upload_s3 import upload_s3 from database.db import save_chart_info from PIL import Image from pydub import AudioSegment import io import os import random, string import datetime import hashlib import json import requests with open("...
Kyonkrnk/ymfan
router/chart/upload.py
upload.py
py
3,799
python
en
code
1
github-code
1
[ { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "router.chart.upload_s3", "line_number": 19, "usage_type": "name" }, { "api_name": "fastapi.APIRouter", "line_number": 19, "usage_type": "call" }, { "api_name": "fastapi.UploadFile...
19015658590
from typing import Any import openai import os OPEN_AI_KEY: str | None = os.environ.get("OPENAI_API_KEY") if not OPEN_AI_KEY: raise ValueError("Missing OPENAI_API_KEY env variable") openai.api_key = OPEN_AI_KEY def get_chat_completion( user_message: str, model="gpt-3.5-turbo", max_tokens=500, temperature=0...
jakecyr/sms-gpt
sms_gpt/open_ai_client.py
open_ai_client.py
py
1,084
python
en
code
1
github-code
1
[ { "api_name": "os.environ.get", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "openai.api_key", "line_number": 10, "usage_type": "attribute" }, { "api_name": "typing.Any", "li...
20448987511
import json from random import Random from config_data import seed, armies_config from strategy import choose_squad from army import Army R = Random(seed) class Battlefield: def __init__(self, log_type, file=None): self.armies = [Army(army["id"], army["chosen_strategy"]) for army ...
QueVege/Task-3
battlefield.py
battlefield.py
py
3,225
python
en
code
0
github-code
1
[ { "api_name": "random.Random", "line_number": 7, "usage_type": "call" }, { "api_name": "config_data.seed", "line_number": 7, "usage_type": "argument" }, { "api_name": "army.Army", "line_number": 13, "usage_type": "call" }, { "api_name": "config_data.armies_config"...
38657153583
import sys from datetime import datetime from typing import Collection, Dict, Tuple, List, Optional if sys.version_info >= (3, 8): from typing import TypedDict else: from typing_extensions import TypedDict MAX_DATA_ROW_IDS_PER_EXPORT_V2 = 2_000 class SharedExportFilters(TypedDict): label_created_at: Op...
nicole-kozhuharova/bachelorArbeit
venv/Lib/site-packages/labelbox/schema/export_filters.py
export_filters.py
py
5,201
python
en
code
0
github-code
1
[ { "api_name": "sys.version_info", "line_number": 6, "usage_type": "attribute" }, { "api_name": "typing_extensions.TypedDict", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { "api_name": "typi...
11111319634
from apikeys import key_geocoder import requests import json def get_ll_by_name(name, pt=False): name = ''.join(name.split()) req = f"http://geocode-maps.yandex.ru/1.x/?apikey={key_geocoder}&geocode={name}&size=650,450&format=json" response = requests.get(req) # with open('response.json', 'w') as json...
ecol-master/Hackaton_AI
yandex_map/maps/geocoder.py
geocoder.py
py
3,846
python
en
code
0
github-code
1
[ { "api_name": "apikeys.key_geocoder", "line_number": 8, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "apikeys.key_geocoder", "line_number": 58, "usage_type": "name" }, { "api_name": "requests.get", ...
43649070052
import matplotlib.pyplot as plt import numpy as np from scipy import misc from math import sqrt #-------------------------------------------------- # code0.py : Première définitions #-------------------------------------------------- def u(x): # définition de la fonction u return x**4 def grad1(f, x...
oungaounga/project21808112.github.io
AllCodesProjet1.py
AllCodesProjet1.py
py
6,834
python
fr
code
0
github-code
1
[ { "api_name": "scipy.misc.derivative", "line_number": 15, "usage_type": "call" }, { "api_name": "scipy.misc", "line_number": 15, "usage_type": "name" }, { "api_name": "scipy.misc.derivative", "line_number": 19, "usage_type": "call" }, { "api_name": "scipy.misc", ...
74736843234
from unittest.mock import Mock import datetime import pytest from pytest_lazyfixture import lazy_fixture from boxsdk.util import datetime_formatter @pytest.mark.parametrize( "valid_datetime_format", ( "2035-03-04T10:14:24+14:00", "2035-03-04T10:14:24-04:00", lazy_fixture("mock_datet...
box/box-python-sdk
test/unit/util/test_datetime_formatter.py
test_datetime_formatter.py
py
2,309
python
en
code
395
github-code
1
[ { "api_name": "boxsdk.util.datetime_formatter.normalize_date_to_rfc3339_format", "line_number": 22, "usage_type": "call" }, { "api_name": "boxsdk.util.datetime_formatter", "line_number": 22, "usage_type": "name" }, { "api_name": "pytest.mark.parametrize", "line_number": 11, ...
75068479392
import bilby import numpy as np import matplotlib.pyplot as plt from bilby.core.utils import logger import scipy.special import matplotlib import json from distutils.version import LooseVersion import os import copy from ..PE.prior import Conditional_Dl2_prior_from_mu_rel_prior, condition_function def MakeLensedParams...
lemnis12/golum
golum/Tools/utils.py
utils.py
py
16,015
python
en
code
1
github-code
1
[ { "api_name": "numpy.sqrt", "line_number": 32, "usage_type": "call" }, { "api_name": "json.load", "line_number": 61, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 108, "usage_type": "call" }, { "api_name": "numpy.random", "line_n...
8556882106
from .settings import DATABASE, PATH import glob import os import pandas as pd import sqlalchemy as sqla import argparse from argparse import RawDescriptionHelpFormatter dataset_id = { 'srag': 1, 'sragflu': 2, 'obitoflu': 3, 'sragcovid': 4, 'obitocovid': 5, 'obito': 6 } # ### 1.2 Scale scale...
FluVigilanciaBR/seasonality
methods/data_filter/migration.py
migration.py
py
19,644
python
en
code
1
github-code
1
[ { "api_name": "pandas.DataFrame", "line_number": 64, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 145, "usage_type": "call" }, { "api_name": "settings.PATH", "line_number": 145, "usage_type": "argument" }, { "api_name": "os.path", "line...
20421083972
from itertools import combinations st=int(input()) c=int(input()) arr=[] for x in range(0,c): arr.append(input().split()) arr2=[] for y in range(0,len(arr)): arr[y]=[int(x) for x in arr[y]] for x in range(0,len(arr)): cnt=arr[x][0] for y in range(0,len(arr)): if arr[y][0]==cnt: if ar...
goltong1/NYPC
NYPC/2018/NYPC 08.py
NYPC 08.py
py
1,058
python
en
code
1
github-code
1
[ { "api_name": "itertools.combinations", "line_number": 22, "usage_type": "call" } ]
70007701475
import collections from collections import Counter, defaultdict import numpy as np import jsonlines import os import re from typing import * import torch from torch import nn import torch.nn as nn from torch.utils.data import Dataset, DataLoader torch.manual_seed(1792507) from model import Model # PRE-TRAINED EMBE...
lello5/university-projects
Master degree/Natural Language Processing/HW1/hw1/stud/implementation.py
implementation.py
py
5,750
python
en
code
8
github-code
1
[ { "api_name": "torch.manual_seed", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.rand", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.rand", "line_numb...
24849378108
import requests import csv url = "https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/ja.wikipedia.org/all-access/all-agents/%E9%AC%BC%E6%BB%85%E3%81%AE%E5%88%83/daily/20200601/20200630" headers = {"User-Agent": "smatsuda@x-hack.jp"} r = requests.get(url, headers=headers) data_file = open('data_file.csv...
xhackjp1/python-scraping
0623/scraping-pageview.py
scraping-pageview.py
py
453
python
en
code
null
github-code
1
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 10, "usage_type": "call" } ]
36044561026
# -*- coding: utf-8 -*- """ Created on Sun Jul 19 09:02:24 2020 @author: user """ import cv2 import numpy cap=cv2.VideoCapture(0) face_cascade=cv2.CascadeClassifier("haarcascade_frontalface_alt.xml") facedata=[] while True: ret,frame=cap.read() if ret==False: continue cv2.imshow(...
himanshisehgal19/Face-Detection-OpenCV-
imagecapture.py
imagecapture.py
py
1,259
python
en
code
1
github-code
1
[ { "api_name": "cv2.VideoCapture", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.rectangle", ...
40478697751
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torch.nn.functional as F from layers.utils import loss_tools from layers.box_annotation_layer import annotate_proposals def rcnn_loss_layer(score, delta, label_list, fg_delta_list, index_...
OYMiss/faster-rcnn
layers/rcnn_loss_layer.py
rcnn_loss_layer.py
py
3,285
python
en
code
1
github-code
1
[ { "api_name": "torch.tensor", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.cat", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.nn.functional.cross_entropy", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.nn.fun...
31445849910
import ast import json import re from pathlib import Path import numpy as np import pandas as pd from tqdm import tqdm from src.constants import DATA_PATH # noqa: I900 def get_hashtags(caption): if isinstance(caption, str): return re.findall("#[a-z0-9_]+", caption) return [] def get_mentions(cap...
Stardust87/VIP
scripts/extract_metadata.py
extract_metadata.py
py
3,268
python
en
code
0
github-code
1
[ { "api_name": "re.findall", "line_number": 15, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 40, "usage_type": "attribute" }, { "api_name": "numpy.nan", "line_number": 5...
14619951113
import dash_core_components as dcc import dash_html_components as html import pandas as pd import plotly.graph_objs as go from dash.dependencies import Input, Output from importlib import reload from mysql.connector.errors import OperationalError from app.app import app from app.datasources import laudos from app.apps...
IvanBrasilico/laudos_dash
app/apps/app2.py
app2.py
py
1,945
python
en
code
0
github-code
1
[ { "api_name": "dash_html_components.Div", "line_number": 13, "usage_type": "call" }, { "api_name": "app.apps.layout.menu", "line_number": 14, "usage_type": "name" }, { "api_name": "dash_html_components.H3", "line_number": 15, "usage_type": "call" }, { "api_name": ...
13210926327
import numpy as np from math import sqrt from matplotlib.pyplot import * from matplotlib import animation k1 = 0.6 k2 = 0.7 w1 = sqrt(k1 + 1) w2 = sqrt(k2 + 1) def wave(x,t): return np.sin(x*k1 - w1*t) + np.sin(x*k2 - w2*t) T = 20 dt = 1/60. t = 0 nt = int(T/dt) nx = 1001 x = np.linspace(0,100,1001) all_waves = ...
simehaa/University
fys2140/oblig3_a.py
oblig3_a.py
py
698
python
en
code
0
github-code
1
[ { "api_name": "math.sqrt", "line_number": 8, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 19, ...
27652958158
from sample_page import sample from bs4 import BeautifulSoup import urllib.request import time import os import sys from html_writer import TEMPLATE, ROW_TEMPLATE SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) print(SCRIPT_DIR) PROJECT_ROOT = os.path.normpath(SCRIPT_DIR + os.sep + os.pardir) print...
Mailman366/GIT_Repository
Projects/Price_Scraper/python/scratch.py
scratch.py
py
2,445
python
en
code
0
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.normpath", "li...
32038833506
from operator import add from typing import List, Tuple FILE_NAME = 'input8.in' rope = [[0, 0] for _ in range(11)] #0 -> head, 1 -> part1, 9 -> part2 dirs = {"R": [0, 1], "L": [0, -1], "U": [-1, 0], "D": [1, 0]} def sign_value(value: int) -> int: return (value > 0) - (value < 0) def get_diffs(h...
Jozkings/advent-of-code-2022
9.py
9.py
py
1,311
python
en
code
0
github-code
1
[ { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 14, "usage_type": "name" }, { "api_name": "operator.add", "line_number": 27, "usage_type": "argument" }, { "api_name": "operator.add", "line_nu...
9512999564
# -*- coding: utf-8 -*- # Coded By Kuduxaaa import json, requests from flask import request from flask_restful import Resource from app.service import PriceCalculator predictor = PriceCalculator() # This is example API Resource class PricePrediction(Resource): def get(self): """ Route get method...
Kuduxaaa/fintech
app/api/price.py
price.py
py
2,667
python
en
code
2
github-code
1
[ { "api_name": "app.service.PriceCalculator", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.request.args", "line_number": 21, "usage_type": "attribute" }, { "api_na...
18621907063
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: targetstree_service.py from requests import Session import xml.etree.ElementTree as ET import json import multiprocessing from joblib import Parallel, delayed from ..tools import (xmltools, log) from outpost24hiabclient.clients.hiabclient import HiabCli...
schubergphilis/outpost24hiabclient
outpost24hiabclient/services/target_service.py
target_service.py
py
10,384
python
en
code
2
github-code
1
[ { "api_name": "tools.log.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "tools.log", "line_number": 19, "usage_type": "name" }, { "api_name": "entities.targets_tree.TargetGroupNode", "line_number": 56, "usage_type": "call" }, { "api_name": "e...
35847125868
import ast import asyncio import time import traceback import rank_calc from data_base import DataBase from datetime import datetime class LeaderboardsCollector: def __init__(self, main_collector) -> None: self.main_collector = main_collector self.vime = main_collector.vime_archive.vime se...
FalmerF/VimeArchive
collector/leaderboards_collector.py
leaderboards_collector.py
py
9,211
python
en
code
1
github-code
1
[ { "api_name": "time.sleep", "line_number": 35, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 57, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 57, "usage_type": "name" }, { "api_name": "datetime.datetime....
11737215383
"""new fields p in project model Revision ID: dd4e694b3acf Revises: 966b658403b2 Create Date: 2018-08-09 13:10:41.624416 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'dd4e694b3acf' down_revision = '966b658403b2' branch_labels = None depends_on = None def u...
johndoe-dev/Ecodroid
migrations/versions/dd4e694b3acf_new_fields_p_in_project_model.py
dd4e694b3acf_new_fields_p_in_project_model.py
py
675
python
en
code
0
github-code
1
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
12194813975
# Import necessary modules import nextcord # Library for building Discord bots from nextcord.ext import commands # Additional classes for command handling from nextcord import SlashOption # Specific class for creating slash command options import openai # OpenAI's Python library, used to interact with the GPT-3 API...
CryptoAutistic80/Nextcord-Cog-Bot
retired cogs/paint.py
paint.py
py
9,970
python
en
code
1
github-code
1
[ { "api_name": "nextcord.ui", "line_number": 15, "usage_type": "attribute" }, { "api_name": "modules.buttons.ImageButton", "line_number": 21, "usage_type": "call" }, { "api_name": "modules.buttons.RegenerateButton", "line_number": 27, "usage_type": "call" }, { "api...
25009064577
import math import torch import torch.nn as nn import torch.nn.functional as F device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') def initialize_weight(x): nn.init.xavier_uniform_(x.weight) if x.bias is not None: nn.init.constant_(x.bias, 0) class MultiHeadAttentio...
zxh0916/WeeklyPaper
Week5-Transformer/module.py
module.py
py
9,868
python
en
code
4
github-code
1
[ { "api_name": "torch.device", "line_number": 5, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 5, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn.init.xavie...
8761905914
from Device import Device from datetime import datetime #import RPi.GPIO as GPIO class Led(Device): status = None laststatuschange = None GPIO = None def __init__(self, **kwargs): for key, value in kwargs.items(): setattr(self, key, value) Device.__init__(self) self...
flipsee/rpicenter
sandbox/internal_recipe/Led.py
Led.py
py
1,458
python
en
code
0
github-code
1
[ { "api_name": "Device.Device", "line_number": 5, "usage_type": "name" }, { "api_name": "Device.Device.__init__", "line_number": 13, "usage_type": "call" }, { "api_name": "Device.Device", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.datetime.n...
36999949572
import numpy as np import datasets.utils.image_utils as image_utils image_shape = (36546, 63245, 3) img = np.zeros(image_shape,dtype=np.uint8) upsampling_factor = 4 patch_size = (256*2**upsampling_factor,256*2**upsampling_factor,3) patch = image_utils.compute_patch_indices(image_shape=image_shape, patch_size=patch_si...
vuhoangminh/vqa_medical
tests/test_image_utils.py
test_image_utils.py
py
529
python
en
code
7
github-code
1
[ { "api_name": "numpy.zeros", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 5, "usage_type": "attribute" }, { "api_name": "datasets.utils.image_utils.compute_patch_indices", "line_number": 9, "usage_type": "call" }, { "api_na...
39674272083
#!/usr/bin/python """ Dirty script which provides some (not well maintained) functions for plotting data. """ from mpl_toolkits.basemap import Basemap import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation import logging from matplotlib.patches import Polygon, Circle def shoot(lon,...
Humpheh/twied
scripts/examples/polyplotter.py
polyplotter.py
py
7,684
python
en
code
11
github-code
1
[ { "api_name": "numpy.pi", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.abs", "line_numbe...
72499398113
from sqlalchemy import insert, select from sqlalchemy.ext.asyncio import AsyncSession from app.crud.base import CRUDBase, DatabaseModel from app.models import Question class CRUDQuesttion(CRUDBase): """Класс для работы с моделью Question.""" async def get_previous_object( self, sessi...
SergoSolo/quiz_questions
app/crud/question.py
question.py
py
1,245
python
en
code
0
github-code
1
[ { "api_name": "app.crud.base.CRUDBase", "line_number": 8, "usage_type": "name" }, { "api_name": "sqlalchemy.ext.asyncio.AsyncSession", "line_number": 13, "usage_type": "name" }, { "api_name": "sqlalchemy.select", "line_number": 16, "usage_type": "call" }, { "api_n...
12578117452
#!/usr/bin/env python3 import math, os.path import sys import argparse from toolbox import * from toolbox.files import file_groups def main(): parser = argparse.ArgumentParser( description="Tidy a folder by moving groups of similar files into separate sub-folders", ) parser.add_argument( ...
michaelgale/toolbox-py
toolbox/scripts/tidyfolder.py
tidyfolder.py
py
1,871
python
en
code
2
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "toolbox.files.file_groups.items", "line_number": 36, "usage_type": "call" }, { "api_name": "toolbox.files.file_groups", "line_number": 36, "usage_type": "name" }, { ...
4199959125
from collections import deque def solution(n, edge): answer = 0 # 연결된 노드 정보 그래프 graph =[[] for _ in range(n+1)] # 각 노드의 최단거리 리스트 distance = [-1] * (n+1) # 연결된 노드 정보 추가 - 양방향 for e in edge : graph[e[0]].append(e[1]) graph[e[1]].append(e[0]) q = deque(...
hyeonwook98/Algorithm
Programmers/가장 먼 노드.py
가장 먼 노드.py
py
683
python
ko
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 16, "usage_type": "call" } ]
74879021154
import requests from bs4 import BeautifulSoup import pandas as pd import os base = 'http://mit.spbau.ru' r = requests.get(base+'/students/se') html = r.text soup = BeautifulSoup(html, 'html.parser') names = [] images = [] hrefs = [] for div in soup.find_all('div', {'class': 'field-content alumni-userpic'}): for...
Forsenlol/SE_hi
data/scripts_for_parsing/au_alumni.py
au_alumni.py
py
2,383
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "li...
39329032276
import os.path import pathlib import subprocess import setuptools from setuptools import setup # The directory containing this file HERE = pathlib.Path(__file__).parent # get module version from git tag client_version = subprocess.run(['git', 'describe', '--tags'], stdout=subprocess.P...
xrgarcia/alphavantage_api_client
setup.py
setup.py
py
1,427
python
en
code
10
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 12, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 13, "usage_type": "attribute" }, { "api_name": "setuptools.setup", ...
12668151670
import cv2 as cv import numpy as np import matplotlib.pyplot as plt image = cv.imread("example.jpg") #change path for your image for i in range (0, image.shape[0]): for j in range (0, image.shape[1]): pixel = 255 - 1 -image[i][j] image[i][j] = pixel cv.imwrite('image.png',imag...
rafaelcbpy/ProcessImage-VisionCompute
filters/Negative_Filter.py
Negative_Filter.py
py
434
python
en
code
1
github-code
1
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 15,...
5432761830
import docker import logging from celery import Celery from celery.schedules import crontab app = Celery() @app.on_after_configure.connect def setup_periodic_tasks(sender, **kwargs): cli = docker.from_env(version="1.28") for node in cli.nodes.list(filters={"role": "worker"}): logging.info("Adding reb...
whole-tale/gwvolman
gwvolman/scheduler.py
scheduler.py
py
603
python
en
code
1
github-code
1
[ { "api_name": "celery.Celery", "line_number": 6, "usage_type": "call" }, { "api_name": "docker.from_env", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 13, "usage_type": "call" }, { "api_name": "celery.schedules.crontab", ...
34999124884
# -*- coding: UTF-8 -*- import template.leetcode as leetcode_template import template.question as question_template import resource.table as table_template import resource.datasource as ddl def fetch_all_problems(): table_template.normal(ddl.QUESTION_DROP) table_template.normal(ddl.QUESTION_CREATE) for d...
KochamCie/LeetCodeNote
core/problems.py
problems.py
py
714
python
en
code
7
github-code
1
[ { "api_name": "resource.table.normal", "line_number": 10, "usage_type": "call" }, { "api_name": "resource.table", "line_number": 10, "usage_type": "name" }, { "api_name": "resource.datasource.QUESTION_DROP", "line_number": 10, "usage_type": "attribute" }, { "api_n...
8489624117
from __future__ import division, print_function, absolute_import import os import numpy as np import pygame from highway_env.road.graphics import WorldSurface, RoadGraphics from highway_env.vehicle.graphics import VehicleGraphics CONTROL = { "throttle": 0, "brake": 0., "steering": 0 } ControlledVehicle_...
jasonplato/Highway_SimulationPlatform
highway_env/envs/graphics.py
graphics.py
py
7,307
python
en
code
0
github-code
1
[ { "api_name": "pygame.init", "line_number": 27, "usage_type": "call" }, { "api_name": "highway_env.vehicle.graphics.VehicleGraphics.FONT", "line_number": 28, "usage_type": "attribute" }, { "api_name": "highway_env.vehicle.graphics.VehicleGraphics", "line_number": 28, "usa...
35096521634
import os, sys, time import requests DEST_DIR = '.\\imgs' def show(data): print(data, end=' ') sys.stdout.flush() def save_file(img, filename): path = os.path.join(DEST_DIR, filename) with open(path, 'wb') as fp: fp.write(img) def download(url): # print(f'downloading {url}') resp = ...
Kiruen/kiruen_funbox
python_playground/fluent_python/future_demo/downloader_base.py
downloader_base.py
py
935
python
en
code
1
github-code
1
[ { "api_name": "sys.stdout.flush", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
14011134082
import requests import os import json from dotenv import load_dotenv load_dotenv() # To set your enviornment variables in your terminal run the following line: #export 'BEARER_TOKEN'='<your_bearer_token>' print(os.environ) def auth(): return os.environ.get('BEARER_TOKEN') def create_url(): ...
samkibe/Text-Mining-ON-Twitter----Sample-codes
Stream.py
Stream.py
py
1,483
python
en
code
1
github-code
1
[ { "api_name": "dotenv.load_dotenv", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ", "li...
24218220896
import requests from bs4 import BeautifulSoup from tabulate import tabulate header = { "user-agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0' } def get_ipl_table(): page = requests.get( f"https://www.sportskeeda.com/go/ipl/points-table", headers=header) sou...
Harsh1347/FootBot-DiscordBot
ipl.py
ipl.py
py
2,388
python
en
code
1
github-code
1
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 13, "usage_type": "call" }, { "api_name": "tabulate.tabulate", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.get", "...
41978714472
import struct from MemoryManager import * from Crypto.PublicKey import RSA from Crypto.Random import get_random_bytes from Crypto.Cipher import AES, PKCS1_OAEP from Crypto.Util.Padding import unpad TOTAL_LEN_WITHOUT_PAYLOAD = 23 FILE_NAME_LEN = 255 FILE_PREFIX_LEN = FILE_NAME_LEN + 4 + ID_SIZE IV_LEN = 16 BLOCK_SIZE ...
Naveh1/SecuredFileTransfer
Server/RequestProcessor.py
RequestProcessor.py
py
5,402
python
en
code
0
github-code
1
[ { "api_name": "struct.unpack", "line_number": 27, "usage_type": "call" }, { "api_name": "traceback.print_exc", "line_number": 46, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 50, "usage_type": "call" }, { "api_name": "Crypto.PublicKey.RSA....