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
32633364752
from aiogram.dispatcher.filters import state from aiogram.dispatcher import FSMContext from main import bot, dp from aiogram import types from aiogram.types import ParseMode from language_middleware import i18n from sql import SQL from config import DB_NAME dp.middleware.setup(i18n) _ = i18n.gettext database = SQL(f...
7Dany6/wave-me-bot
functions.py
functions.py
py
3,965
python
en
code
1
github-code
36
[ { "api_name": "main.dp.middleware.setup", "line_number": 11, "usage_type": "call" }, { "api_name": "language_middleware.i18n", "line_number": 11, "usage_type": "argument" }, { "api_name": "main.dp.middleware", "line_number": 11, "usage_type": "attribute" }, { "api...
467939918
import math from binance_api import Binance import config_trade import statistics as st import time import requests def SMA(data, period): if len(data) == 0: raise Exception("Empty data") if period <= 0: raise Exception("Invalid period") interm = 0 result = [] nan_in...
OGKuz/binance_shift_bot
shift_bot.py
shift_bot.py
py
7,247
python
en
code
1
github-code
36
[ { "api_name": "math.isnan", "line_number": 19, "usage_type": "call" }, { "api_name": "math.nan", "line_number": 20, "usage_type": "attribute" }, { "api_name": "math.nan", "line_number": 26, "usage_type": "attribute" }, { "api_name": "math.isnan", "line_number"...
30677005666
#--------------------import some mould-------------# from flask import Flask ,render_template,request,redirect,url_for,flash,session import os import mysql.connector db=mysql.connector.connect( host="localhost", user="root", password="1889", database="AirPort" ) #----------StartProject------------# #l...
zakariyae1889/AirportWeb
Views.py
Views.py
py
19,623
python
en
code
1
github-code
36
[ { "api_name": "mysql.connector.connector.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 5, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 5, "usage_type": "name" }, { "api...
16822733733
import requests # Replace this value with your own Discord API token TOKEN = input("Enter your Discord API token: ") headers = { "Authorization": f"Bot {TOKEN}", "User-Agent": "MyBot/1.0", } # Send a GET request to the Discord API to retrieve the webpack chunk data response = requests.get("https://discordapp...
catgirlasn/discord
eavesdrop.py
eavesdrop.py
py
1,607
python
en
code
1
github-code
36
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" } ]
29808972190
import webapp2 import json import nltk_utils class MainHandler(webapp2.RequestHandler): def renderJSON(self, dictionary): dataJSON = json.dumps(dictionary) self.response.headers["Content-Type"] = "application/json; charset=UTF-8" self.response.write(dataJSON) def get(self): s...
sivu22/nltk-on-gae
GAE/main.py
main.py
py
1,183
python
en
code
1
github-code
36
[ { "api_name": "webapp2.RequestHandler", "line_number": 6, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 8, "usage_type": "call" }, { "api_name": "nltk_utils.getTagsAndFreqDist", "line_number": 26, "usage_type": "call" }, { "api_name": "nl...
7291178560
from pyramid.config import Configurator from sqlalchemy import engine_from_config from os import environ from api.models.sql_automap import DBSession, Base def main(global_config, **settings): sqlalchemy_url_value = environ.get('STR_CONNECTION', 'mysql://root:pass@172.17.0.3:3306/matomo') settings.update({'sq...
scieloorg/scielo-sushi-api
api/__init__.py
__init__.py
py
1,052
python
en
code
0
github-code
36
[ { "api_name": "os.environ.get", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "name" }, { "api_name": "os.environ.get", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number"...
10496870550
from tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2 from onnx_tf.backend import prepare as prepare_onnx_model import tensorflow as tf import argparse import onnx parser = argparse.ArgumentParser() parser.add_argument("--onnx_dir", type=str, help="Path where ONNX models...
chansoopark98/Tensorflow-Keras-Object-Detection
convert_onnx_to_tf.py
convert_onnx_to_tf.py
py
2,815
python
en
code
6
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "tensorflow.device", "line_number": 18, "usage_type": "call" }, { "api_name": "onnx.load", "line_number": 23, "usage_type": "call" }, { "api_name": "onnx_tf.backend.pr...
5392824044
import cv2 import os import pydicom import argparse from tqdm import tqdm parser = argparse.ArgumentParser() parser.add_argument('-t', '--type', type=str, required=True, choices=['train', 'test'], help='whether to convert train images or test images') args = vars(parser.parse_args()) if args['ty...
sovit-123/Pneumonia-Detection-using-Deep-Learning
dcm_to_jpg.py
dcm_to_jpg.py
py
1,011
python
en
code
9
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 21, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_n...
3650828458
from flask import Blueprint, request, send_from_directory, Response from config import IS_LOCALHOST import yaml import dotenv from os import getenv dotenv.load_dotenv() bp = Blueprint("plugin", __name__) print('localhost started? ', IS_LOCALHOST) AUTHO_CLIENT_URL = getenv('AUTHO_CLIENT_URL') AUTHO_AUTHORIZATION_URL ...
matthewlouisbrockman/the_one_plugin
backend/plugin/plugin_routes.py
plugin_routes.py
py
2,688
python
en
code
0
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.Blueprint", "line_number": 9, "usage_type": "call" }, { "api_name": "config.IS_LOCALHOST", "line_number": 10, "usage_type": "argument" }, { "api_name": "os.getenv", ...
16402536741
import sqlite3 as s3 db_name = "/home/egws/ESCAPE_GAMES" def create_table(room): """Create Table for a room""" try: db = s3.connect(db_name) except: print("Connexion à la base " + db_name + " impossible") try: cursor = db.cursor() try: cursor.execute(""" ...
piment/egws
database.py
database.py
py
2,445
python
en
code
1
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 34, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 47, "usage_type": "call" }, { "api_name": "sqlite3.connect", ...
74774265705
import sys import treeswift as ts from sys import platform as _platform import tempfile from subprocess import Popen, PIPE import pkg_resources import time import logging def print_ident(tree): for i in tree.root.children: print(len(list(i.traverse_postorder())),) print("") def reestimate_backbone(opt...
balabanmetin/apples
apples/reestimateBackbone.py
reestimateBackbone.py
py
4,332
python
en
code
22
github-code
36
[ { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api_name": "treeswift.read_tree", "line_number": 18, "usage_type": "call" }, { "api_name": "tempfile.NamedTemporaryFile", "line_number": 50, "usage_type": "call" }, { "api_name": "sys.platfor...
22755402141
import privateConfig from selenium.webdriver.chrome.options import Options URL_PISOS = "https://www.pisos.com" URL_PLACE = "/venta/pisos-esparreguera/" URL_LOG_IN = "https://www.pisos.com/Login" USER_PISOS = "informe.casas@gmail.com" PW_PISOS = "17InformeCasas" USER_MAIL = "informe.casas@gmail.com" PW_MAIL = "17Info...
paucampana/pisosScrapper
app/src/config.py
config.py
py
1,095
python
en
code
1
github-code
36
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 23, "usage_type": "call" }, { "api_name": "privateConfig.PathNeeded", "line_number": 30, "usage_type": "attribute" }, { "api_name": "privateConfig.ChromeDriverPath", "line_number": 31, "usage_type":...
21143828586
import torch from ipdb import set_trace import torch.nn as nn import torch.nn.functional as F import logging from torch.nn.utils.rnn import pad_sequence from config import MyBertConfig from src.models.bert_model import BaseBert from src.models.flash import GAU from src.ner_predicate import vote, span_predicate from ...
KeDaCoYa/MKG-GC
entity_extraction/src/models/inter_bert_span.py
inter_bert_span.py
py
16,287
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "src.models.bert_model.BaseBert", "line_number": 20, "usage_type": "name" }, { "api_name": "config.MyBertConfig", "line_number": 21, "usage_type": "name" }, { "api_name": "...
1243434549
""" uncertainty_analysis.py ========================================= Python script that performs uncertainty analysis on profile estimation. """ import time import pandas as pd import numpy as np from src.instance import Instance from src.optimization_profile_time import ProfileOptTime from scipy.stats import dirichl...
carolinetjes/CFRrecruitment
uncertainty_analysis.py
uncertainty_analysis.py
py
4,391
python
en
code
0
github-code
36
[ { "api_name": "scipy.stats.dirichlet.rvs", "line_number": 24, "usage_type": "call" }, { "api_name": "scipy.stats.dirichlet", "line_number": 24, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.re...
29465356973
## This module aims to compute the number and energy flux of DM particles from a supernova import numpy as np import matplotlib.pyplot as plt from ..Step1_Kinematics import Kinematics import scipy.integrate as integrate #Particle Property #Neutrino M_nu = 0.32 # Unit:eV/c2 E_total_nu = 3.6e53*6.24150913e11 ...
CrazyAncestor/DM_Neutrino_Flux
old_codes/one_direction/Steps/Step2_DM_Flux/DM_flux.py
DM_flux.py
py
2,634
python
en
code
0
github-code
36
[ { "api_name": "Step1_Kinematics.Kinematics.energy_kicked_by_neutrino", "line_number": 25, "usage_type": "call" }, { "api_name": "Step1_Kinematics.Kinematics", "line_number": 25, "usage_type": "name" }, { "api_name": "numpy.sum", "line_number": 27, "usage_type": "call" }...
31932657319
from sympy import isprime import random import re class ElGammal: def __init__(self): self.p=0 self.alpha=0 self.private_a=0 self.beta=0 # self.p=11 # self.alpha=2 # self.private_a=3 # self.beta=8 def genKey(self): primes_list=[i for i ...
JuanDa14Sa/Cripto
Main/ElGammal.py
ElGammal.py
py
3,154
python
en
code
0
github-code
36
[ { "api_name": "sympy.isprime", "line_number": 19, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 20, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 21, "usage_type": "call" }, { "api_name": "random.randint", "line...
26946887509
import numpy as np import rogues import scipy.linalg as sl def condex(n, k=4, theta=100): """ CONDEX `Counterexamples' to matrix condition number estimators. CONDEX(N, K, THETA) is a `counterexample' matrix to a condition estimator. It has order N and scalar parameter THETA (default 100)....
macd/rogues
rogues/matrices/condex.py
condex.py
py
2,556
python
en
code
16
github-code
36
[ { "api_name": "numpy.array", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 40, "usage_type": "call" }, { "api_name": "rogues.triw", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 5...
18046654139
import pandas as pd from konlpy.tag import Komoran import tensorflow as tf import numpy as np from keras.layers import Dense, Conv1D, GlobalMaxPooling1D, Embedding, Dropout from keras.models import Sequential from keras.layers import LSTM, Bidirectional from keras.models import Sequential, load_model from keras.metrics...
jaehyun1209/Deeplearning_AbuseFind
PreProcessAndModel.py
PreProcessAndModel.py
py
4,595
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.to_numeric", "line_number": 35, "usage_type": "call" }, { "api_name": "konlpy.tag.Komoran", "line_number": 50, "usage_type": "call" }, { "api_name": "tensorflow.keras...
3532508808
import os os.system('cls') from math import sqrt from functools import reduce class chofer(): def __init__(self, nombreCompleto): self.__nombreCompleto = nombreCompleto def getNombreCompleto(self): return self.__nombreCompleto class camion(): def __init__(self, patente, lit...
IgnacioVelliz/Programa-Python
Parcial2.py
Parcial2.py
py
5,595
python
es
code
0
github-code
36
[ { "api_name": "os.system", "line_number": 2, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 132, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 137, "usage_type": "call" } ]
38013843478
# # Author: Denis Tananaev # File: makeTFrecords.py # Date:9.02.2017 # Description: tool for the tfrecords convertion of the SUN3D dataset # import numpy as np import skimage.io as io import scipy.misc import tensorflow as tf def centered_crop(image,new_w,new_h): '''Make centered crop of the image''' height...
Dtananaev/DepthNet
tfCNN/data_processing/tools/makeTFrecords.py
makeTFrecords.py
py
2,914
python
en
code
2
github-code
36
[ { "api_name": "scipy.misc.misc.imresize", "line_number": 28, "usage_type": "call" }, { "api_name": "scipy.misc.misc", "line_number": 28, "usage_type": "attribute" }, { "api_name": "scipy.misc", "line_number": 28, "usage_type": "name" }, { "api_name": "scipy.misc.m...
38115229575
from app import app from flask import jsonify, request from models import Host, HostSchema from scheduling import th @app.route('/api/1.0/test') def index(): return 'ok' @app.route('/api/1.0/host', methods=['POST']) def create_host(): if request.methods == 'POST': ip = (request.json['ip'])...
evgeneh/pinger_back_py
view.py
view.py
py
2,078
python
en
code
0
github-code
36
[ { "api_name": "app.app.route", "line_number": 7, "usage_type": "call" }, { "api_name": "app.app", "line_number": 7, "usage_type": "name" }, { "api_name": "flask.request.methods", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.request", "l...
27969617509
# type: ignore from flask import render_template, redirect, url_for, session from main import app, db from admin import admin from products.models import Product import os app.register_blueprint(admin) @app.route('/') def index(): products=Product.query.all() return render_template('index.html', produc...
muchirajunior/flask-ecommerce
routes.py
routes.py
py
904
python
en
code
1
github-code
36
[ { "api_name": "main.app.register_blueprint", "line_number": 9, "usage_type": "call" }, { "api_name": "admin.admin", "line_number": 9, "usage_type": "argument" }, { "api_name": "main.app", "line_number": 9, "usage_type": "name" }, { "api_name": "products.models", ...
17156680991
import torch import numpy as np from transformers import AutoTokenizer from tqdm import tqdm def get_lm_embeddings(mapper_model, test_df, trained_model_name, use_first_token_only = False): mapper_model.set_parameters() # Load pre-trained model tokenizer (vocabulary) tokenizer = AutoTokenizer.from_pretrain...
Peter-Devine/Feedback-Mapping
utils/bert_utils.py
bert_utils.py
py
2,182
python
en
code
0
github-code
36
[ { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 10, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 30, "usage_type": "cal...
37897597748
""" practice advance read-write options & strategies with pandas """ import pandas as pd import matplotlib.pyplot as plt def start(): """set options for pandas""" options = { 'display': { 'max_columns': None, 'max_colwidth': 25, 'expand_frame_repr': False, # Don't ...
nguyentu1602/pyexp
pyexp/pandas_practice.py
pandas_practice.py
py
4,025
python
en
code
0
github-code
36
[ { "api_name": "pandas.set_option", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 43, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
4123119834
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import pandas as pd import matplotlib.pyplot as plt # In[2]: dataset = pd.read_csv(r'E:\Udemy corurse\[DesireCourse.Net] Udemy - Machine Learning A-Z™ Hands-On Python & R In Data Science\1.Machine Learning A-Z New\Part 2 - Regression\Section 4 - S...
Rizwan-khan-7/Machine-Learning
Regression_Analysis_Part I.py
Regression_Analysis_Part I.py
py
1,045
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 41, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 53, "usage_type": "call" ...
20338749336
import cv2 import numpy as np # VARIABLES # True while mouse button down, False while mouse button up drawing = False ix,iy = -1,-1 # FUNCTION def draw_rectangle(event, x,y, flags, param): global ix,iy,drawing if event == cv2.EVENT_LBUTTONDOWN: drawing = True ix,iy = x,y elif event == cv2.EVEN...
eliottjohnson/VS_code
draw_circle_with_mouse.py
draw_circle_with_mouse.py
py
798
python
en
code
0
github-code
36
[ { "api_name": "cv2.EVENT_LBUTTONDOWN", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cv2.EVENT_MOUSEMOVE", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cv2.circle", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy....
24614073845
import requests # for api calls import time # for converting epoch to timedate format import pprint as pp # for debugging def convert_epoch_to_datetime(epoch): return time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(epoch)) def get_news(ticker, startDate, endDate): """ Purpose: Get a list of news ur...
ajsalagundi/Stock_Intelligence
data_application/web_scrapers/news_articles_retriever.py
news_articles_retriever.py
py
1,137
python
en
code
0
github-code
36
[ { "api_name": "time.strftime", "line_number": 7, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 24, "usage_type": "call" } ]
13170391452
# this file exists to help tune the parameters of the stressor functions that put learners in different states # it doesn't make sense to put the same load on a Jetson Nano as on a raspberry pi. What would moderately inconvenience the Nano would completely cripple the pi # for this reason, we need to tune stressor para...
DuncanMays/multi_orchestrator_pl
tests/tune_stressors.py
tune_stressors.py
py
1,205
python
en
code
0
github-code
36
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "axon.client.RemoteWorker", "line_number": 17, "usage_type": "call" }, { "api_name": "axon.client", ...
42578862241
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import importlib importlib.reload(sys) import time import requests import csv url = "https://rdap.registro.br/domain/" domains = ['stz.com.br', 'viasullogistica.com', 'eletronor.com', 'intelbras.com.br', 'bmlog.com.br', 'blueticket.com.br', ...
fiilipeneto/pandorasbox
Busca CNPJ.py
Busca CNPJ.py
py
1,758
python
en
code
0
github-code
36
[ { "api_name": "importlib.reload", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 43, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 45, "usage_type": "call" }, { "api_name": "time.sleep", "line_...
15184343497
"""Advent of Code - Day 1.""" from pathlib import Path from typing import List FILE_PATH = Path(__file__).parent.parent / "data" / "day_1.txt" def find_elves_most_calories(calories: List, n: int) -> int: """Fat elf detection. Find the elf carrying the most calories. Args: calories: Calorie list...
albutz/aoc-2022
src/day_1.py
day_1.py
py
1,360
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 8, "usage_type": "name" } ]
42558176076
#!/usr/bin/env python3 ## Estimates errors using Monte Carlo sampling # Hamish Silverwood, GRAPPA, UvA, 23 February 2015 import numpy as np import gl_helper as gh import pdb import pickle import sys import numpy.random as rand import matplotlib.pyplot as plt #TEST this will eventually go outside def ErSamp_gauss_l...
PascalSteger/gravimage
programs/gi_mc_errors.py
gi_mc_errors.py
py
2,025
python
en
code
0
github-code
36
[ { "api_name": "numpy.loadtxt", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 25, "usage_type": "name" }, { "api_name": "numpy.random.random", ...
9246343257
from typing import Any from fastapi import APIRouter, HTTPException, status from tortoise.exceptions import DoesNotExist from project.app.src.suppliers.service import create from project.app.src.suppliers.service import delete from project.app.src.suppliers.service import get_all from project.app.src.suppliers.servic...
ademchenkov/wm
project/app/src/suppliers/router.py
router.py
py
3,086
python
en
code
0
github-code
36
[ { "api_name": "fastapi.APIRouter", "line_number": 15, "usage_type": "call" }, { "api_name": "project.app.src.suppliers.service.get_all", "line_number": 26, "usage_type": "call" }, { "api_name": "fastapi.status.HTTP_200_OK", "line_number": 21, "usage_type": "attribute" }...
37849511311
#!/usr/bin/env python # # lib.py # # Helper code for CLI for interacting with switches via console device # try: import click import re import swsssdk import subprocess import sys except ImportError as e: raise ImportError("%s - required module not found" % str(e)) DEVICE_PREFIX = "/dev/ttyUSB...
liang2biao/official_sonicbuild_201911_all
src/sonic-utilities/consutil/lib.py
lib.py
py
4,829
python
en
code
0
github-code
36
[ { "api_name": "subprocess.Popen", "line_number": 41, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 41, "usage_type": "attribute" }, { "api_name": "click.echo", "line_number": 45, "usage_type": "call" }, { "api_name": "sys.exit", "line...
694104358
from .models import Event, Slot, SignUp from groups.methods import get_user_group_membership, group_to_json from authentication.methods import user_to_json from common.parsers import parse_datetime_to_epoch_time # Constants from common.constants import ( EVENT_ID, TITLE, DESCRIPTION, START_DATE_TIME, ...
cs3216-2021-a3-group12/slotify-backend
slotify/events/methods.py
methods.py
py
4,696
python
en
code
1
github-code
36
[ { "api_name": "models.Event.objects.filter", "line_number": 40, "usage_type": "call" }, { "api_name": "models.Event.objects", "line_number": 40, "usage_type": "attribute" }, { "api_name": "models.Event", "line_number": 40, "usage_type": "name" }, { "api_name": "mo...
15205290527
from rest_framework import permissions from rest_framework.views import Request, View, status from championships.models import Championship from teams.models import Team from datetime import datetime class IsChampionshipOwner(permissions.BasePermission): def has_object_permission( self, request: Request, ...
gamer-society-org/gamer-society
championships/permissions.py
permissions.py
py
4,861
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.permissions.BasePermission", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.permissions", "line_number": 8, "usage_type": "name" }, { "api_name": "rest_framework.views.Request", "line_number": 10, "usage_type": "...
2863809841
import requests import lxml.etree import re session = requests.Session() response = session.get('http://www.baidu.com') content = response.content.decode() # print(content) # -------------解析 doc = lxml.etree.HTML(content) tree = doc.getroottree() nodes = tree.xpath('//title/text()') for i in nodes: print(i)
XiaJune/A-small
miller_cre/baidu.py
baidu.py
py
323
python
en
code
0
github-code
36
[ { "api_name": "requests.Session", "line_number": 5, "usage_type": "call" }, { "api_name": "lxml.etree.etree.HTML", "line_number": 12, "usage_type": "call" }, { "api_name": "lxml.etree.etree", "line_number": 12, "usage_type": "attribute" }, { "api_name": "lxml.etre...
20219566108
import os from . import utils import ipywidgets as widgets from IPython.display import display, clear_output, Javascript class FileBrowser(object): def __init__(self, funcName): self.path = os.getcwd() self._update_files() self._chosenFileName = None self.funcName = funcName @p...
gudasergey/pyFitIt
pyfitit/fileBrowser.py
fileBrowser.py
py
2,642
python
en
code
28
github-code
36
[ { "api_name": "os.getcwd", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 2...
25718178961
# This exports all networks and their base attributes from an organization to a file # and then imports them to another organization. # # You need to have Python 3 and the Requests module installed. You # can download the module here: https://github.com/kennethreitz/requests # or install it using pip. # # To ...
meraki/automation-scripts
copynetworks.py
copynetworks.py
py
8,232
python
en
code
361
github-code
36
[ { "api_name": "requests.get", "line_number": 47, "usage_type": "call" }, { "api_name": "requests.codes", "line_number": 49, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 68, "usage_type": "call" }, { "api_name": "requests.codes", "l...
15991467145
import torch import torch.nn as nn import torch.nn.functional as F from timm.models.layers import DropPath, trunc_normal_ import math import numpy as np from models.head import * up_kwargs = {'mode': 'bilinear', 'align_corners': False} def load_state_dict(module, state_dict, strict=False): """Load state_dict to...
zyxu1996/Efficient-Transformer
models/volo.py
volo.py
py
34,846
python
en
code
67
github-code
36
[ { "api_name": "torch.nn.functional.interpolate", "line_number": 82, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 82, "usage_type": "name" }, { "api_name": "torch.load", "line_number": 105, "usage_type": "call" }, { "api_name": "torch...
44539221196
from flask import Flask, request, jsonify from flask_sqlalchemy import SQLAlchemy from flask_marshmallow import Marshmallow import uuid app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///employees.db' db = SQLAlchemy(app) ma = Marshmallow(app) # Модель данных для сотрудника class Employee(db.M...
InKarno27/CRUD_on_Python
main.py
main.py
py
3,267
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_marshmallow.Marshmallow", "line_number": 10, "usage_type": "call" }, { "api_name": "u...
22861904779
import pandas as pd import datetime as dt from sodapy import Socrata from airflow.hooks.base_hook import BaseHook class Extract: chicago_crime_portal = "https://data.cityofchicago.org/resource/ijzp-q8t2.json" def __init__(self, start_time , end_time ) -> None: self.start_time = start_time self...
prabha-git/airflow
dags/chicago_crime_etl/extract.py
extract.py
py
1,041
python
en
code
0
github-code
36
[ { "api_name": "sodapy.Socrata", "line_number": 12, "usage_type": "call" }, { "api_name": "airflow.hooks.base_hook.BaseHook.get_connection", "line_number": 12, "usage_type": "call" }, { "api_name": "airflow.hooks.base_hook.BaseHook", "line_number": 12, "usage_type": "name"...
39783045715
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="diss-iamhectorotero", version="0.0.1", author="Hector Otero", author_email="7hector2@gmail.com", description="A package to train RNN in physical microworlds in a supervised or RL manner", ...
iamhectorotero/learning-physical-properties-with-rnns
libraries/setup.py
setup.py
py
702
python
en
code
4
github-code
36
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 15, "usage_type": "call" } ]
10358617907
from __future__ import annotations import math import os import pygame from pgbot import emotion EMOTIONS_PER_ROW = 2 NEGATIVE_EMOTIONS = {"bored": "exhausted", "happy": "sad"} EMOTION_COLORS = { "happy": (230, 28, 226), "sad": (28, 28, 230), "anger": (230, 36, 18), "bored": (230, 181, 18), "exh...
gresm/PygameCommunityBot
pgbot/commands/utils/vibecheck.py
vibecheck.py
py
6,443
python
en
code
null
github-code
36
[ { "api_name": "math.cos", "line_number": 88, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 88, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 89, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 89, ...
19029066252
import logging import requests import time import json from cifsdk.exceptions import AuthError, TimeoutError, NotFound, SubmissionFailed, InvalidSearch, CIFBusy from cifsdk.constants import VERSION, PYVERSION, TOKEN from pprint import pprint from base64 import b64decode from cifsdk.client.plugin import Client import os...
csirtgadgets/cifsdk-py-v3
cifsdk/client/http.py
http.py
py
8,165
python
en
code
8
github-code
36
[ { "api_name": "cifsdk.constants.PYVERSION", "line_number": 15, "usage_type": "name" }, { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 19, "usage_type": "call" }, { "api_name": "requests.packages", "line_number": 19, "usage_type": "attribute" ...
73349162343
import pygame pygame.init() screen = pygame.display.set_mode((720, 480)) clock = pygame.time.Clock() FPS = 60 BLACK = (0, 0, 0) WHITE = (255, 255, 255) ballsurface = pygame.Surface((50,50)) ballsurface.set_colorkey((0,0,0)) pygame.draw.circle(ballsurface, (255,0,0), (25,25),25) ballsurface...
Tevvur/lab8
lab8(1).py
lab8(1).py
py
1,257
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 2, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 3, "usage_type": "attribute" }, { "api_name": "pygame.time.Cloc...
5953172719
try: from grove import grove_temperature_humidity_aht20 from grove.adc import ADC from gpiozero import DigitalOutputDevice import chainable_rgb_direct except: grove_temperature_humidity_aht20 = None ADC = None DigitalOutputDevice = None chainable_rgb_direct = None import random class Plant: def __ini...
Xermax3/ContainerFarm
Hardware/plant.py
plant.py
py
2,790
python
en
code
0
github-code
36
[ { "api_name": "grove.grove_temperature_humidity_aht20", "line_number": 7, "usage_type": "name" }, { "api_name": "grove.adc.ADC", "line_number": 8, "usage_type": "name" }, { "api_name": "gpiozero.DigitalOutputDevice", "line_number": 9, "usage_type": "name" }, { "ap...
74330392745
# How to detect specific color inside python # from cv2 import getTrackbarPos import numpy as np import cv2 as cv # img=cv.imread("resources/image.png") # Convert in HSV (Hue, Saturation, Value) # hue_img=cv.cvtColor(img,cv.COLOR_BGR2HSV)#rang barangi sakal my chla gye ga jb show kary gye def slider(): ...
amirasghar123/Opencv-vision
20_chptr.py
20_chptr.py
py
1,970
python
en
code
0
github-code
36
[ { "api_name": "cv2.namedWindow", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.resizeWindow", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.createTrackbar", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.createTrackba...
3460979087
import pickle import os from bs4 import BeautifulSoup from numpy import vectorize import spacy import unidecode from word2number import w2n import os import pickle #import contractions nlp = spacy.load('en_core_web_lg') # exclude words from spacy stopwords list deselect_stop_words = ['no', 'not'] for w in deselect_st...
abde0103/H-index-prediction
Code/PreprocessingAndGetIndices.py
PreprocessingAndGetIndices.py
py
4,195
python
en
code
0
github-code
36
[ { "api_name": "spacy.load", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 21, "usage_type": "call" }, { "api_name": "unidecode.unidecode", "line_number": 32, "usage_type": "call" }, { "api_name": "word2number.w2n.word...
13990583368
""" While the previous DFS approach works, it can potentially traverse long sections of the graph without a real need. In order to improve further, we can leverage the previously ignored properties of the similar relation: it is an equivalence relation. Equivalence relations bring a natural partition to the set, where...
dariomx/topcoder-srm
leetcode/zero-pass/google/sentence-similarity-ii/Solution1.py
Solution1.py
py
2,622
python
en
code
0
github-code
36
[ { "api_name": "itertools.izip", "line_number": 87, "usage_type": "call" } ]
27786608731
# -*- coding: utf-8 -*- # * Credits: # * # * original Audio Profiles code by Regss # * updates and additions through v1.4.1 by notoco and CtrlGy # * updates and additions since v1.4.2 by pkscout import xbmc import json import os import sys from resources.lib.fileops import * from resources.lib.xlogger import Logge...
pkscout/script.audio.profiles
resources/lib/audioprofiles.py
audioprofiles.py
py
10,698
python
en
code
7
github-code
36
[ { "api_name": "resources.lib.apsettings.loadSettings", "line_number": 19, "usage_type": "call" }, { "api_name": "resources.lib.apsettings.loadSettings", "line_number": 29, "usage_type": "call" }, { "api_name": "resources.lib.xlogger.Logger", "line_number": 30, "usage_type...
74267315625
# -*- coding: utf-8 -*- # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
line/line-bot-sdk-python
linebot/models/recipient.py
recipient.py
py
2,083
python
en
code
1,739
github-code
36
[ { "api_name": "future.utils.with_metaclass", "line_number": 25, "usage_type": "call" }, { "api_name": "abc.ABCMeta", "line_number": 25, "usage_type": "argument" }, { "api_name": "base.Base", "line_number": 25, "usage_type": "argument" } ]
74642998183
# -*- coding: utf-8 -*- """ @author: Florian Koch @license: All rights reserved """ import pandas as pd import json with open('../../data/city_of_zurich/aussichtspunkt.json') as data_file: data = json.load(data_file) df = pd.io.json.json_normalize(data, ['features', ['geometry', 'coordinates']],['name', ['features...
limo1996/ETH-DataScience
src/preprocess/aussichtspunkt.py
aussichtspunkt.py
py
646
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.io.json.json_normalize", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.io", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pandas.merge",...
12813950306
# 연구소 import sys from itertools import combinations from collections import deque import copy input = sys.stdin.readline N,M = map(int,input().split()) board = [] for i in range(N): board.append(list(map(int,input().split()))) virus = [] comb = [] for i in range(N): for j in range(M): if board[i][j] =...
Girin7716/PythonCoding
Etc/PS/Q16.py
Q16.py
py
1,217
python
en
code
1
github-code
36
[ { "api_name": "sys.stdin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "copy.deepcopy", "line_number": 26, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 27, "usage_type": "call" }, { "api_name": "itertools.combinations"...
31541638918
import os from setuptools import setup def read_project_file(path): proj_dir = os.path.dirname(__file__) path = os.path.join(proj_dir, path) with open(path, 'r') as f: return f.read() setup( name = 'pyronic', version = '0.1.1', description = 'Suppress command output on success', lo...
JonathonReinhart/pyronic
setup.py
setup.py
py
936
python
en
code
0
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6...
38716436502
#!/usr/bin/env python3 import re from collections import defaultdict from pprint import pprint allergen_sets = defaultdict(list) # allergen => list of sets of foods with open('input.txt', 'r') as infile: line_re = re.compile(r'((\w+\s+)+)\(contains(.*)\)') for line in infile: m = line_re.match(line) ...
lvaughn/advent
2020/21/food_list_2.py
food_list_2.py
py
1,264
python
en
code
1
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 7, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "re.split", "line_number": 12, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_n...
70955301864
"""Add description for 15 puzzle Revision ID: bdeb38c37fg1 Revises: 05923bad79cf Create Date: 2020-10-23 14:23:00.123969 """ from sqlalchemy.sql import table, column from sqlalchemy import String from alembic import op # revision identifiers, used by Alembic. revision = 'bdeb38c37fg1' down_revision = '05923bad79cf' ...
euphwes/cubers.io
migrations/versions/047_bdeb38c37fg1_add_desc_to_15_puzzle.py
047_bdeb38c37fg1_add_desc_to_15_puzzle.py
py
1,041
python
en
code
27
github-code
36
[ { "api_name": "sqlalchemy.sql.table", "line_number": 19, "usage_type": "call" }, { "api_name": "sqlalchemy.sql.column", "line_number": 19, "usage_type": "call" }, { "api_name": "sqlalchemy.String", "line_number": 19, "usage_type": "argument" }, { "api_name": "alem...
17849208142
import torch import torch.nn as nn from prodict import Prodict class ODEFunc(nn.Module): def __init__(self, dims: Prodict, device: str = torch.device("cpu")): """The Neural ODE decoder Module of TDNODE. Neural network function that considers as input a tumor state and p-dimensional parameter encod...
jameslu01/TDNODE
src/model/SLD/ode_func.py
ode_func.py
py
3,303
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "prodict.Prodict", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.device", "line_n...
3110630730
""" Creator: Dhruuv Agarwal Github: Dhr11 """ import os import numpy as np import torch import torch.nn as nn from torch.utils import data from tqdm import tqdm from Voc_loader import VOCLoader from Unet_model import Unet from metrics import custom_conf_matrix def train(): device = torch.device("cuda" if tor...
Dhr11/Semantic_Segmentation
Main_src.py
Main_src.py
py
3,992
python
en
code
2
github-code
36
[ { "api_name": "torch.device", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.utils.data...
32413559312
import abc from typing import Callable, Dict, List, Optional, Union import torch import torchmetrics from pytorch_lightning import LightningModule, Trainer from pytorch_lightning.loggers.logger import Logger from torch.utils.data import DataLoader, Dataset from renate import defaults from renate.data.datasets import ...
awslabs/Renate
src/renate/evaluation/evaluator.py
evaluator.py
py
7,525
python
en
code
251
github-code
36
[ { "api_name": "pytorch_lightning.LightningModule", "line_number": 17, "usage_type": "name" }, { "api_name": "abc.ABC", "line_number": 17, "usage_type": "attribute" }, { "api_name": "renate.models.RenateModule", "line_number": 34, "usage_type": "name" }, { "api_nam...
40027566811
import cv2 import os import imutils import time import numpy as np from matplotlib import pyplot as plt MODEL_MEAN_VALUES = (78.4263377603, 87.7689143744, 114.895847746) age_list = [ '(0, 2)', '(4, 6)', '(8, 12)', '(15, 20)', '(25, 32)', '(38, 43)', '(48, 53)', '(60, 100)' ] gender_list = ['Male', 'Female'] ...
cNille/Agender
prediction.py
prediction.py
py
2,143
python
en
code
0
github-code
36
[ { "api_name": "cv2.dnn.readNetFromCaffe", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cv2.dnn.readNetFromCaffe", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.dn...
73969955624
import torch from torch import nn import torch.nn.functional as F from onerl.networks.norm_layer import normalization_layer class PreactResBlock(nn.Module): def __init__(self, in_channels: int, out_channels: int, stride: int, norm_type: str, ...
imoneoi/onerl
onerl/networks/resnet.py
resnet.py
py
2,604
python
en
code
16
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "onerl.networks.norm_layer.normalization_layer", "line_number": 18, "usage_type": "call" }, { "api_nam...
719879844
from collective.honeypot import _ from collective.honeypot.config import ACCEPTED_LOG_LEVEL from collective.honeypot.config import DISALLOW_ALL_POSTS from collective.honeypot.config import EXTRA_PROTECTED_ACTIONS from collective.honeypot.config import HONEYPOT_FIELD from collective.honeypot.config import IGNORED_FORM_F...
collective/collective.honeypot
collective/honeypot/utils.py
utils.py
py
5,278
python
en
code
3
github-code
36
[ { "api_name": "plone.restapi.deserializer.json_body", "line_number": 18, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "collective.honeypot.config.HONEYPOT_FIELD", "line_number": 37, "usage_type": "name...
938560702
import json import jieba import os import argparse frequency = {} word2id = {"PAD": 0, "UNK": 1} min_freq = 10 def cut(s): arr = list(jieba.cut(s)) for word in arr: if word not in frequency: frequency[word] = 0 frequency[word] += 1 return arr if __name__ == "__main__": ...
china-ai-law-challenge/CAIL2020
sfks/baseline/utils/cutter.py
cutter.py
py
1,406
python
en
code
150
github-code
36
[ { "api_name": "jieba.cut", "line_number": 12, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 31, "usage_type": "call" }, { "api_name": "os.listdir", "line_...
32065161333
import random from django.shortcuts import render , redirect , get_object_or_404 from django.http import HttpResponse from django.contrib.auth.models import User , auth from django.contrib import messages from .models import Profile, Post, Likepost, FollowersCount , Notification , Comment from django.contrib.auth.decor...
ahmedradwan21/ATR_Social
core/views.py
views.py
py
13,622
python
en
code
2
github-code
36
[ { "api_name": "django.contrib.auth.models.User.objects.filter", "line_number": 31, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 31, "usage_type": "attribute" }, { "api_name": "django.contrib.auth.models.User", "line_number": ...
4965329236
from settings.database import get_all_resumes, add, clear_table from settings.config import ProfessionStep, ResumeGroup from settings.tools import group_steps_to_resume import locale from typing import NamedTuple from operator import attrgetter from datetime import datetime, date from rich.progress import track ...
SalomanYu/Trajectory
test.py
test.py
py
3,493
python
ru
code
1
github-code
36
[ { "api_name": "locale.setlocale", "line_number": 9, "usage_type": "call" }, { "api_name": "locale.LC_TIME", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 12, "usage_type": "attribute" }, { "api_name": "da...
11025748669
"""user token nonce Revision ID: 71503b29c05a Revises: aac9a548d9f5 Create Date: 2018-05-04 13:42:42.222974 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '71503b29c05a' down_revision = 'aac9a548d9f5' branch_labels = None depends_on = None def upgrade(): ...
akahard2dj/Blackberry
migrations/versions/71503b29c05a_user_token_nonce.py
71503b29c05a_user_token_nonce.py
py
661
python
en
code
0
github-code
36
[ { "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"...
16969152957
# -*- coding: utf-8 -*- from jsonfield.fields import JSONField from natasha import ( Segmenter, MorphVocab, MoneyExtractor, NamesExtractor, NewsEmbedding, NewsMorphTagger, NewsSyntaxParser, NewsNERTagger, PER, LOC, ORG ) from natasha.grammars.date import Date, MONTHS, MO...
infolabs/django-edw
backend/edw/models/mixins/nlp/ner.py
ner.py
py
9,781
python
ru
code
6
github-code
36
[ { "api_name": "natasha.grammars.date.MONTHS.__getitem__", "line_number": 41, "usage_type": "call" }, { "api_name": "natasha.grammars.date.MONTHS", "line_number": 41, "usage_type": "name" }, { "api_name": "natasha.grammars.date.MONTHS.get", "line_number": 43, "usage_type":...
995230871
# Authors: Antoine Ginies <aginies@suse.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distri...
aginies/virt-scenario
src/virtscenario/configuration.py
configuration.py
py
22,528
python
en
code
5
github-code
36
[ { "api_name": "os.path.expanduser", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path", "line_number": 47, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
19416762509
from check_your_heuristic.dataset.ReCoRDDataset import ReCoRDDataset from check_your_heuristic.heuristics.Heuristic import BaseHeuristicSolver from typing import Dict, Any, List import pandas as pd import string import numpy as np import logging class ReCoRDHeuristics(BaseHeuristicSolver): def __init__(self, conf...
tatiana-iazykova/check_your_heuristic
check_your_heuristic/heuristics/ReCoRDHeuristics.py
ReCoRDHeuristics.py
py
7,723
python
en
code
0
github-code
36
[ { "api_name": "check_your_heuristic.heuristics.Heuristic.BaseHeuristicSolver", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 11, "usage_type": "name" }, { ...
19698435188
import numpy as np from numpy import ma import matplotlib.pyplot as plt import matplotlib.patches as mp from matplotlib.collections import PatchCollection m_s = 4 m_e = 1 x_s, y_s = 0, 0 x_e, y_e = 2, 0 x_c, y_c = (m_s*x_s+m_e*x_e)/(m_s+m_e), (m_s*y_s+m_e*y_e)/(m_s+m_e) gamma = 1.0 x = np.linspace(-2.5, 4, 1000) y = ...
JakeI/PlaneteSimulator
LagrangePoints/lagrangePoints.py
lagrangePoints.py
py
2,767
python
en
code
1
github-code
36
[ { "api_name": "numpy.linspace", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_n...
31063781935
from ..utils import Object class MessageForwardInfo(Object): """ Contains information about a forwarded message Attributes: ID (:obj:`str`): ``MessageForwardInfo`` Args: origin (:class:`telegram.api.types.MessageForwardOrigin`): Origin of a forwarded message dat...
iTeam-co/pytglib
pytglib/api/types/message_forward_info.py
message_forward_info.py
py
2,080
python
en
code
20
github-code
36
[ { "api_name": "utils.Object", "line_number": 6, "usage_type": "name" }, { "api_name": "utils.Object.read", "line_number": 43, "usage_type": "call" }, { "api_name": "utils.Object", "line_number": 43, "usage_type": "name" } ]
73391053864
from gym import spaces from gym import Env import numpy as np from pathlib import Path from PIL import Image from gym.utils import seeding from spg.view import TopDownView import arcade from spg.playground import Playground, Room from spg.playground.collision_handlers import get_colliding_entities from spg.utils.defi...
aomerCS/IN3007
gym_env/envs/perturbation_world.py
perturbation_world.py
py
6,057
python
en
code
0
github-code
36
[ { "api_name": "spg.playground.Playground", "line_number": 24, "usage_type": "name" }, { "api_name": "spg.playground.collision_handlers.get_colliding_entities", "line_number": 25, "usage_type": "call" }, { "api_name": "resources.apple.Apple", "line_number": 27, "usage_type...
22057061997
import pandas as pd import helper import weaviate # initiate the Weaviate client client = weaviate.Client("http://localhost:8080") client.timeout_config = (3, 200) # empty schema and create new schema client.schema.delete_all() schema = { "classes": [ { "class": "Wine", "properties...
weaviate/weaviate-examples
semanticsearch-transformers-wines/import.py
import.py
py
2,091
python
en
code
253
github-code
36
[ { "api_name": "weaviate.Client", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 31, "usage_type": "call" }, { "api_name": "helper.generate_uuid", "line_number": 52, "usage_type": "call" }, { "api_name": "helper.log", ...
6862212397
# Utilities ############################################################################ # Imports from sklearn.metrics.pairwise import cosine_similarity import numpy as np import pickle ############################################################################ # Function to read the embedding_dataset from...
TuvalZit/Capstone-Project-23-1-R-18
GUI/Backend/GetEmbedding.py
GetEmbedding.py
py
1,878
python
en
code
0
github-code
36
[ { "api_name": "pickle.load", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.metrics.pairwise.cosine_similarity", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.clip", "line_number": 39, "usage_type": "call" } ]
36127494424
from fastapi import FastAPI, Path from typing import Optional from pydantic import BaseModel class Item(BaseModel): name: str price: float color: Optional[str] = None inventory = { 1: { 'name': 'Milk', 'price': 3.99, 'color': 'white' } } app = FastAPI() @app.get('/') asy...
Kelvingandhi/kafka_sample
test_main.py
test_main.py
py
761
python
en
code
2
github-code
36
[ { "api_name": "pydantic.BaseModel", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 9, "usage_type": "name" }, { "api_name": "fastapi.FastAPI", "line_number": 19, "usage_type": "call" }, { "api_name": "fastapi.Path", "...
23992985122
''' 542. 01 Matrix https://leetcode.com/problems/01-matrix/ ''' from collections import defaultdict, deque from typing import List # Approach 1: BFS from '1' columns to '0' # The problem is we do BFS for 1, which is sub-optimal class Solution: def updateMatrix(self, matrix: List[List[int]]) -> List[List[int]]: ...
asset311/leetcode
bfs/01_matrix.py
01_matrix.py
py
2,531
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 19, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 50, "usage_type": "name" }, { "api_name": "collections.deque", "li...
29981196912
# Example: echo server, using StreamServer import logging import argparse from gruvi import get_hub, util from gruvi.stream import StreamServer logging.basicConfig() parser = argparse.ArgumentParser() parser.add_argument('port', type=int) args = parser.parse_args() def echo_handler(stream, protocol, client): p...
cocagne/gruvi
examples/echoserver1.py
echoserver1.py
py
667
python
en
code
null
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "gruvi.util.saddr", "line_number": 17, "usage_type": "call" }, { "api_name": "gruvi.uti...
3315546924
import nltk def nouns_transform(sentence): tokenized = nltk.word_tokenize(sentence) def is_noun (pos): return pos[:2] == 'NN' return [word for (word, pos) in nltk.pos_tag(tokenized) if is_noun(pos)] def render_template(template_name='html pages/home.html', context={}): html_str = "" wit...
valya007/junior_technical_test
webapp.py
webapp.py
py
1,171
python
en
code
0
github-code
36
[ { "api_name": "nltk.word_tokenize", "line_number": 5, "usage_type": "call" }, { "api_name": "nltk.pos_tag", "line_number": 9, "usage_type": "call" } ]
18736574490
from django import forms from ..contrib.sysdate import dateFromLocal class DateBigInput(forms.DateInput): def value_from_datadict(self, data, files, name): valData = super().value_from_datadict(data, files, name) return dateFromLocal(valData) def get_context(self, name, value, attrs): ...
MindKafuu/demo
demoWeb/extends/formext.py
formext.py
py
4,630
python
en
code
0
github-code
36
[ { "api_name": "django.forms.DateInput", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 4, "usage_type": "name" }, { "api_name": "contrib.sysdate.dateFromLocal", "line_number": 7, "usage_type": "call" }, { "api_name": "d...
28700017158
#aoc20150101 import pathlib import sys def parse(path): return list(pathlib.Path(path).read_text()) def solve(puzzleInput): finalFloor = 0 for datum in puzzleInput: if datum == '(': finalFloor += 1 else: finalFloor -= 1 return finalFloor if __name__ == "__main__": for path in sys.ar...
dbm19/aoc2015
aoc201501/aoc20150101.py
aoc20150101.py
py
401
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 22, "usage_type": "attribute" } ]
69846477224
import logging from random import randint from time import sleep from typing import List import pandas as pd import requests # type: ignore from models.auction import Lot, Lots from models.item import Item, Items from models.media import Media, Medias from scrape.item_scraper import ItemScraper from scrape.lot_scrape...
lassebenni/scraper-wow-auctionhouse
scrape/auction_scraper.py
auction_scraper.py
py
4,503
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "utils.aws.S3Connector", "line_number": 22, "usage_type": "call" }, { "api_name": "scrape.lot_scraper.LotScraper", "line_number": 25, "usage_type": "call" }, { "api_name": ...
26285045448
from functools import wraps from . import database as db from .reddit import user_exists, subreddit_exists from sqlalchemy.exc import IntegrityError from . import constants as c from .template import get_template from .utils import message_url from sqlalchemy.orm import joinedload _COMMANDS = {} _MENTION_COMMANDS = {...
necessary129/InformsYouBot
InformsYouBot/commands.py
commands.py
py
6,941
python
en
code
0
github-code
36
[ { "api_name": "template.get_template", "line_number": 50, "usage_type": "call" }, { "api_name": "template.get_template", "line_number": 71, "usage_type": "call" }, { "api_name": "template.get_template", "line_number": 115, "usage_type": "call" }, { "api_name": "te...
9173707874
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ from the month of edge deletion, find the SR before, at the time and after """ from collections import defaultdict import codecs import os import json import numpy as np IN_DIR = "../../../DATA/General/MO_MENT_networks" os.chdir(IN_DIR) F_IN = "mention_edges_monthly_...
sanja7s/SR_Twitter
src_graph/create_MO_MENT_networks.py
create_MO_MENT_networks.py
py
1,146
python
en
code
0
github-code
36
[ { "api_name": "os.chdir", "line_number": 13, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 21, "usage_type": "call" } ]
71713008103
import os import time from dotenv import dotenv_values from selenium import webdriver from selenium.webdriver import Chrome from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.chrome.service import Service from utilities.commons.exceptions import DriverSetupFailedException from utilities.co...
HarshDevSingh/python-behave
environment.py
environment.py
py
4,291
python
en
code
0
github-code
36
[ { "api_name": "dotenv.dotenv_values", "line_number": 16, "usage_type": "call" }, { "api_name": "utilities.commons.context.Context", "line_number": 22, "usage_type": "name" }, { "api_name": "selenium.webdriver.chrome.service.Service", "line_number": 32, "usage_type": "call...
19021910953
from collections import Iterable l = isinstance('abc',Iterable) print(l) L=list(range(1,11)) print(L) L2 = [x * x for x in range(1,20)] print(L2) L3 = [m + n for m in 'abc' for n in 'hkl'] print(L3) import os L4 = [d for d in os.listdir('.')] print('all dir',L4) L5 = ['Hello','World',18,'Apple',None] L6 = [s.lower...
jacena/python3
iterable.py
iterable.py
py
484
python
en
code
0
github-code
36
[ { "api_name": "collections.Iterable", "line_number": 2, "usage_type": "argument" }, { "api_name": "os.listdir", "line_number": 15, "usage_type": "call" } ]
25412177948
from ..shared.list_arithmatic import add from ..shared.digits import to_digits from itertools import permutations from ..shared.solver import Solver def digit_sum(n:int)->int: return add(to_digits(n)) def digit_sums(biggest: int): pool = list(range(0,biggest)) for a, b in permutations(pool,2): po...
bathcat/pyOiler
src/pyoiler/problems/euler056.py
euler056.py
py
1,033
python
en
code
1
github-code
36
[ { "api_name": "shared.list_arithmatic.add", "line_number": 8, "usage_type": "call" }, { "api_name": "shared.digits.to_digits", "line_number": 8, "usage_type": "call" }, { "api_name": "itertools.permutations", "line_number": 12, "usage_type": "call" }, { "api_name"...
14696977373
import json import os.path as osp from typing import Union class Prompter(object): __slots__ = ("template", "_verbose") def __init__(self, template_name: str = "", verbose: bool = False): self._verbose = verbose if not template_name: template_name = "KoRAE_template" file_n...
gauss5930/KoRAE
finetuning/utils/prompter.py
prompter.py
py
1,553
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, ...
14505653809
import os import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader import torchvision as tv from time import time from src.model.madry_model import WideResNet from src.attack import FastGradientSignUntargeted from src.utils import makedirs, create_logger, tensor2cuda,...
ylsung/pytorch-adversarial-training
cifar-10/main.py
main.py
py
9,835
python
en
code
230
github-code
36
[ { "api_name": "torch.optim.SGD", "line_number": 32, "usage_type": "call" }, { "api_name": "torch.optim", "line_number": 32, "usage_type": "attribute" }, { "api_name": "torch.optim.lr_scheduler.MultiStepLR", "line_number": 35, "usage_type": "call" }, { "api_name": ...
10744207821
import numpy import numpy as np from matplotlib import pyplot as plt from matplotlib.pyplot import figure img_path = '/home/moby/PycharmProjects/datasets_processing/figures/' plt.rcParams.update({ 'font.family': 'serif', 'font.sans-serif': ['Times'], 'text.latex.preamble': r'\usepackage[T2A]{fonte...
SergWh/datasets_processing
thesis_plots/gpt_classes.py
gpt_classes.py
py
1,188
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 7, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "...
45923290828
from SortAlgs import * import matplotlib.pyplot as plt import plotly.express as px import timeit import random import numpy as np N = 10000 X = [random.randint(0, N) for _ in range(N)] naive_time = timeit.timeit("naive_sort(X, X)", globals=globals(), number=1) merge_time = timeit.timeit("merge_sort(X, X)", globals=gl...
SchardtS/Coding-Club
2023_12_18_SortingAlgorithms/Simon/ComplexityVisualization.py
ComplexityVisualization.py
py
1,087
python
en
code
2
github-code
36
[ { "api_name": "random.randint", "line_number": 9, "usage_type": "call" }, { "api_name": "timeit.timeit", "line_number": 11, "usage_type": "call" }, { "api_name": "timeit.timeit", "line_number": 12, "usage_type": "call" }, { "api_name": "timeit.timeit", "line_n...
21618269201
from __future__ import absolute_import import logging import tempfile import unittest from apache_beam.examples.cookbook import group_with_coder from apache_beam.testing.util import open_shards # Patch group_with_coder.PlayerCoder.decode(). To test that the PlayerCoder was # used, we do not strip the prepended 'x:' ...
a0x8o/kafka
sdks/python/apache_beam/examples/cookbook/group_with_coder_test.py
group_with_coder_test.py
py
2,877
python
en
code
59
github-code
36
[ { "api_name": "apache_beam.examples.cookbook.group_with_coder.PlayerCoder", "line_number": 12, "usage_type": "attribute" }, { "api_name": "apache_beam.examples.cookbook.group_with_coder", "line_number": 12, "usage_type": "name" }, { "api_name": "apache_beam.examples.cookbook.grou...
34373633188
from django.urls import path from . import views from django.urls import include, path, re_path # /playlist # /user/<id> urlpatterns = [ path('index/', views.index, name='index'), # page re_path('^index/registration/', views.registration), path('login/', views.login), # page path('logout/', views.log...
Maxgioman/Python
playlist/urls.py
urls.py
py
900
python
en
code
0
github-code
36
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.re_path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.pat...
32699799681
import io import json import sys INDENT = 4 * " " DEFAULT_NEWRESPARAM = "res" def toCppType(t): if isinstance(t, list): if len(t) == 2: return "{}<{}>".format(t[0], t[1]) elif len(t) == 3: return "{}<{}<{}>>".format(t[0], t[1], t[2]) else: raise Runtime...
daphne-eu/daphne
src/runtime/local/kernels/genKernelInst.py
genKernelInst.py
py
10,745
python
en
code
51
github-code
36
[ { "api_name": "sys.argv", "line_number": 168, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 173, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 175, "usage_type": "call" }, { "api_name": "sys.argv", "line_number":...
1636559220
import sys import os import subprocess import graphviz_gen from PySide6.QtWidgets import QApplication, QWidget, QPushButton, QLineEdit, QPlainTextEdit, QVBoxLayout from PySide6.QtCore import QFile, QThread, Slot, Qt from PySide6.QtUiTools import QUiLoader from PySide6.QtSvgWidgets import QSvgWidget class Base(QWidge...
0x000922/Network-Troubleshooter
main.py
main.py
py
2,487
python
en
code
0
github-code
36
[ { "api_name": "PySide6.QtWidgets.QWidget", "line_number": 12, "usage_type": "name" }, { "api_name": "PySide6.QtWidgets.QLineEdit", "line_number": 17, "usage_type": "argument" }, { "api_name": "PySide6.QtWidgets.QPlainTextEdit", "line_number": 18, "usage_type": "argument" ...
506390690
""" Snapping """ def snap_points_to_near_line(lineShp, pointShp, epsg, workGrass, outPoints, location='overlap_pnts', api='grass', movesShp=None): """ Move points to overlap near line API's Available: * grass; * saga. """ ...
jasp382/glass
glass/gp/snp.py
snp.py
py
4,241
python
en
code
2
github-code
36
[ { "api_name": "glass.wenv.grs.run_grass", "line_number": 30, "usage_type": "call" }, { "api_name": "grass.script.setup.init", "line_number": 34, "usage_type": "call" }, { "api_name": "grass.script.setup", "line_number": 34, "usage_type": "name" }, { "api_name": "g...
43300161534
"""Implements the core parts of flow graph creation. """ import sys import collections import types import __builtin__ from rpython.tool.error import source_lines from rpython.rlib import rstackovf from rpython.flowspace.argument import CallSpec from rpython.flowspace.model import (Constant, Variable, Block, Link, ...
mozillazg/pypy
rpython/flowspace/flowcontext.py
flowcontext.py
py
45,650
python
en
code
430
github-code
36
[ { "api_name": "rpython.flowspace.model.const", "line_number": 20, "usage_type": "call" }, { "api_name": "rpython.tool.error.source_lines", "line_number": 30, "usage_type": "call" }, { "api_name": "rpython.flowspace.model.Block", "line_number": 38, "usage_type": "name" }...
3678250480
from typing import Any, List, Text from rasa.nlu.config import RasaNLUModelConfig from rasa.nlu.tokenizers.tokenizer import Token, Tokenizer from rasa.nlu.training_data import Message, TrainingData from rasa.nlu.constants import TEXT_ATTRIBUTE, TOKENS_NAMES, MESSAGE_ATTRIBUTES from rasa.utils.io import DEFAULT_ENCODI...
msamogh/rasa-frames
rasa/nlu/tokenizers/mitie_tokenizer.py
mitie_tokenizer.py
py
2,085
python
en
code
4
github-code
36
[ { "api_name": "rasa.nlu.tokenizers.tokenizer.Tokenizer", "line_number": 11, "usage_type": "name" }, { "api_name": "rasa.nlu.constants.TOKENS_NAMES", "line_number": 13, "usage_type": "name" }, { "api_name": "rasa.nlu.constants.MESSAGE_ATTRIBUTES", "line_number": 13, "usage...
37803606526
""" Wrapper Class for the Github Secrets Filler """ import os import sys import dotenv import github from ..GithubEnvironmentSecret import GithubEnvironmentSecret class Filler: dotenv_values = None github_repository = None environment = None gh_env_secret = None def __init__(self, args): ...
ArteGEIE/github-secrets-filler
bin/libraries/filler/Filler.py
Filler.py
py
2,996
python
en
code
0
github-code
36
[ { "api_name": "GithubEnvironmentSecret.GithubEnvironmentSecret", "line_number": 37, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 49, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 51, "usage_type": "call" }, { "api_nam...
70472354663
''' Created on Aug 1, 2019 @author: jsaavedr Reading an image ''' import pai_io import matplotlib.pyplot as plt if __name__ == '__main__': filename = '../images/gray/lion_gray.jpg' image = pai_io.imread(filename, as_gray = True) print('shape: {}'.format(image.shape)) ##showing image plt.imshow (...
Cotorrra/CC5508-Imagenes
Basic Tools/pai_basis/example_1.py
example_1.py
py
399
python
en
code
0
github-code
36
[ { "api_name": "pai_io.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "matplotlib.p...
40294323346
import time import random import lxc import code import string from multiprocessing.pool import ThreadPool import os from os.path import join, isfile, exists import json LXC_BASE = "tmpl_apach" MOUNTPOINT = "files" LXC_IP = "10.10.13.7" ##### GRADER FUNCTIONS import http.client ip1 = '127.0.0.1' ip2 = LXC_IP ...
mabdi/ctf-pylxc
challs/Apache_Man_2/grader.py
grader.py
py
8,833
python
en
code
0
github-code
36
[ { "api_name": "socket.socket", "line_number": 24, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 24, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 24, "usage_type": "attribute" }, { "api_name": "ssl.wrap_so...