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
19347715062
from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.keys import Keys chrome_webdriver = Service("/snap/bin/chromium.chromedriver") driver = webdriver.Chrome(service=chrome_webdriver) driver.get("http://secure-retreat-92358.herokuapp.com/") first_name = d...
anbuchelva/learn-python
075-selenium-web-driver/fill-a-form.py
fill-a-form.py
py
663
python
en
code
0
github-code
18
[ { "api_name": "selenium.webdriver.chrome.service.Service", "line_number": 5, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" } ]
71838389801
import socket import time from thrift.transport import TTransport from thrift.transport import TSocket from thrift.protocol import TBinaryProtocol from thrift import Thrift from milo.protocols.thrift import TMiloProtocol from milo.thrift.ttypes import EventType import milo.storage.thread_storage as thread_storage impo...
lenn0x/Milo-Tracing-Framework
src/py/milo/clients/thrift_client.py
thrift_client.py
py
3,653
python
en
code
4
github-code
18
[ { "api_name": "thrift.transport.TSocket.TSocket", "line_number": 15, "usage_type": "call" }, { "api_name": "thrift.transport.TSocket", "line_number": 15, "usage_type": "name" }, { "api_name": "thrift.transport.TTransport.TFramedTransport", "line_number": 27, "usage_type":...
12394223768
import functools import math import operator def find_earliest_departure(busses, timestamp): next_departure, bus = min((b * math.ceil(timestamp / b), b) for b in busses if b) return (next_departure - timestamp) * bus def find_perfect_timestamp(busses): M = functools.reduce(operator.mul, (b for b in buss...
simonschellaert/advent-of-code-2020
day13/solution.py
solution.py
py
991
python
en
code
0
github-code
18
[ { "api_name": "math.ceil", "line_number": 7, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 12, "usage_type": "call" }, { "api_name": "operator.mul", "line_number": 12, "usage_type": "attribute" } ]
415511118
"""Utilites related to training models.""" import torch def print_and_save_stats(epoch, stats, current_lr, train_loss, train_acc, valid_acc, valid_loss, target_acc, target_loss, target_clean_acc, target_clean_loss): """Print info into console and into the stats object.""" stats['trai...
JonasGeiping/poisoning-gradient-matching
forest/victims/utils.py
utils.py
py
2,739
python
en
code
78
github-code
18
[ { "api_name": "torch.grad.autograd", "line_number": 48, "usage_type": "call" }, { "api_name": "torch.grad", "line_number": 48, "usage_type": "attribute" }, { "api_name": "torch.no_grad", "line_number": 50, "usage_type": "call" }, { "api_name": "torch.max", "li...
73430613481
# import requests # headers = { # "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36" # } # data = { # 'identity':'1817020105', # 'password':'19951979kb', # } # url ='http://210.30.62.40:8080/jsxsd/xk/Login...
Bryson582/Python_GPA
main.py
main.py
py
3,719
python
en
code
0
github-code
18
[ { "api_name": "requests.Session", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.read_html", "line_number": 31, "usage_type": "call" } ]
70992062119
# -*- coding: utf-8 -*- """ Created on Sat Nov 12 16:54:32 2022 @author: Shu-wei Huang """ # Load trained models from keras.models import load_model model1 = load_model('CNN_DenseNet169.h5') model2 = load_model('CNN_ResNet152.h5') model3 = load_model('CNN_vgg19.h5') model4 = load_model('CNN_InceptionV3....
huangshuewei/MSc-Dissertation
3.Ensemble models (Extra).py
3.Ensemble models (Extra).py
py
4,352
python
en
code
1
github-code
18
[ { "api_name": "keras.models.load_model", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 12, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 13, "usage_type": "call" }, { "api_name"...
32015659430
import os import random import math import pyxel from Box2D import b2 import game as g class Player(): def __init__(self, world): self.walk_counter = 0 self.first_pos = (2,4) self.hit = False self.body = world.CreateDynamicBody(position=self.first_pos, angle=0) self.bod...
kojitaro/pyxel_jump
main.py
main.py
py
4,877
python
en
code
0
github-code
18
[ { "api_name": "game.game.input.btn", "line_number": 25, "usage_type": "call" }, { "api_name": "game.game", "line_number": 25, "usage_type": "attribute" }, { "api_name": "game.InputKey", "line_number": 25, "usage_type": "attribute" }, { "api_name": "game.game.input...
41948721245
from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.uix.button import Button from kivy.uix.label import Label from kivy.uix.textinput import TextInput from ExerciseRunning import * class ExerciseRunningInputWidget( GridLayout ): def __init__( self...
noooway/exj
exercises_and_metrics_types/ExerciseRunningInputWidget.py
ExerciseRunningInputWidget.py
py
5,092
python
en
code
0
github-code
18
[ { "api_name": "kivy.uix.gridlayout.GridLayout", "line_number": 10, "usage_type": "name" }, { "api_name": "kivy.uix.boxlayout.BoxLayout", "line_number": 21, "usage_type": "call" }, { "api_name": "kivy.uix.label.Label", "line_number": 23, "usage_type": "call" }, { "...
36444585638
# -*- coding: utf-8 -*- import json, requests from django.conf import settings # import views from apps.core.views.messaging_native_web.fbms.domain_whitelist import * def fbms_file_send_message(end_user_facebook, param): try: fbms_access_token = end_user_facebook.end_user.vendor_branch.vendor.fbms_access...
phonehtetpaing/ebdjango
apps/core/views/messaging_native_web/fbms/file_send_message.py
file_send_message.py
py
1,206
python
en
code
0
github-code
18
[ { "api_name": "django.conf.settings.FB_MESSAGE_URL", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 12, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 29, "usage_type": "call" }, { "api_name...
72322639081
"""Keyboard handler.""" import aiming, os, os.path, bird, pyglet from accessibility import system from random import random from pyglet.window import key from sound_lib.stream import FileStream weapons_path = os.path.join('sounds', 'weapons') weapons = [x[:x.find('.')] for x in os.listdir(weapons_path)] c...
chrisnorman7/robot_birds
handler.py
handler.py
py
2,221
python
en
code
1
github-code
18
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 10, "usage_type": "call" }, { "api_name": "sound_lib.stream.FileStream", ...
9486610933
# -*- coding: utf-8 -*- """ Created on Mon May 11 19:53:44 2020 @author: Vivian Imbriotis """ import os import seaborn import numpy as np import matplotlib.pyplot as plt from accdatatools.Utils.path import get_timeline_path, get_exp_id from accdatatools.Timing.synchronisation import get_lick_times from accdatatool...
vivian-imbriotis/AccDataTools
Observations/recordings.py
recordings.py
py
5,899
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 35, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 37, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 39,...
43356801570
import requests import json invoiceID = "INV2-7JLK-XELW-LVTA-NYWJ" url = "https://api.sandbox.paypal.com/v1/invoicing/invoices/" + invoiceID headers = { 'Content-Type':'application/json', 'Authorization':"*Auth*" } r = requests.get(url, headers=headers) print(r.text) paid = False while paid == False: ...
2904nando/Python-PaypalQRCode
checkInvoiceStatus.py
checkInvoiceStatus.py
py
675
python
en
code
1
github-code
18
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 20, "usage_type": "call" } ]
37562980211
import argparse import asyncio import logging import time from nimiqclient import * from payments import Payments LOG_LEVELS = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] DEFAULT_LOG_LEVEL = "INFO" class Range(object): def __init__(self, start, end): self.start = start self.end = end ...
jsdanielh/pool-payouts-script
pool-payouts.py
pool-payouts.py
py
6,546
python
en
code
0
github-code
18
[ { "api_name": "logging.debug", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 34, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 51, "usage_type": "call" }, { "api_name": "payments.register_payment", ...
70847597799
import openai import psycopg2 from fastapi import FastAPI from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT # <-- ADD THIS LINE from models.models import CoffeeShopStatus from services.menu_service import * from services.order_service import * openai.organization = "org-2bXqWp423OEFqEdoPm8vbjAl" app = Fast...
Vladislavskiy2002/DataLabTask
app/main.py
main.py
py
12,165
python
en
code
0
github-code
18
[ { "api_name": "openai.organization", "line_number": 10, "usage_type": "attribute" }, { "api_name": "fastapi.FastAPI", "line_number": 12, "usage_type": "call" }, { "api_name": "psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT", "line_number": 14, "usage_type": "argument" }...
38667841131
import sqlite3 class DatabaseInterface: ''' Enters data to hardcoded path from a list of tuples ''' def __init__(self): self.connection = sqlite3.connect('main test1.db') self.cursor = self.connection.cursor() self.create_table = ("CREATE TABLE IF NOT EXISTS posts" "(id...
anyfactor/JSON-Plaintext-to-SQL
OOP Style APP/dataop.py
dataop.py
py
1,390
python
en
code
1
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" } ]
74687187561
import pygame import random import os import sys import json import math from constants import * SETTINGS_PATH = os.path.join("data", "config_breakout.cfg") HIGHSCORE_PATH = os.path.join("data", "scores.txt") MAP_DIR = "naps" RECENT_HIT_RESET = 10 GAME_INTENSIFYING_CONSTANT = 1.02 PADDLE_VEL = 500 PADDLE_FRICTION = 3...
arthev/GameCraft
breakout/breakout.py
breakout.py
py
3,537
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10,...
14489994620
# django imports from django.http import Http404 from django.shortcuts import render # local imports from main.models import TextBlock, Blog, Project # python imports from datetime import datetime import pytz def home(request): context = {} context['blogs'] = Blog.get_ordered(count=3) context['projects'...
mosbasik/portfolio
main/views.py
views.py
py
2,902
python
en
code
0
github-code
18
[ { "api_name": "main.models.Blog.get_ordered", "line_number": 15, "usage_type": "call" }, { "api_name": "main.models.Blog", "line_number": 15, "usage_type": "name" }, { "api_name": "main.models.Project.get_ordered", "line_number": 16, "usage_type": "call" }, { "api...
12965340358
import docplex.mp.model as cpx import itertools #import pandas import random import pandas as pd # imput parameters T = 10 P = 12 #max number of players in dataset set_T = range(1, T+1) # i in set T set_P = range(1, P+1) # j in set P ## Import data values= {1:[112 for i in range(P)], 2:[116 for i in range(P)],...
yunwaiho/rarita-football-club
code-team-selection/archive/Modeling version 1.py
Modeling version 1.py
py
6,375
python
en
code
0
github-code
18
[ { "api_name": "random.randint", "line_number": 25, "usage_type": "call" }, { "api_name": "docplex.mp.model.Model", "line_number": 86, "usage_type": "call" }, { "api_name": "docplex.mp.model", "line_number": 86, "usage_type": "name" }, { "api_name": "pandas.DataFra...
72067984360
from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render # Create your views here. from django.utils.crypto import get_random_string from home.models import Setting, UserProfile from ord...
Bet06sari/Python_Django_OnlineOrderFood
order/views.py
views.py
py
5,843
python
en
code
5
github-code
18
[ { "api_name": "django.http.HttpResponse", "line_number": 15, "usage_type": "call" }, { "api_name": "order.models.ShopCart.objects.filter", "line_number": 22, "usage_type": "call" }, { "api_name": "order.models.ShopCart.objects", "line_number": 22, "usage_type": "attribute...
22353720210
import json import re import time from datetime import datetime from bs4 import BeautifulSoup import requests from decouple import config # Se 1, irá salvar a lista de concursos dentro de um arquivo em /listas/arquivo_data_horario.json salvar_json = config('SALVAR_ARQUIVO_JSON') def lista_concursos(uf): html_tex...
rangel-pci/concursosScraping
main.py
main.py
py
3,853
python
pt
code
1
github-code
18
[ { "api_name": "decouple.config", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.strp...
8561474029
import click import pandas as pd import numpy as np @click.command() @click.argument('dataset_fpath', default='../data/external/manual_after_auto_dataset.xlsx') @click.argument('result_fpath', default='../data/external/fgc_predicate_inference_v0.1.tsv') def main(dataset_fpath, result_fpath): df = pd.read_excel(dat...
ciaochiaociao/WikiQA
fgc_wiki_qa/manual_data/get_dataset.py
get_dataset.py
py
680
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_excel", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 12, "usage_type": "call" }, { "api_name": "click.command", "line_number": 5, "usage_type": "call" }, { "api_name": "click.argument", "line_...
40634005090
from aiogram import Dispatcher, types from aiogram.dispatcher.filters import CommandStart from tgbot.models.user_tg import UserTG async def start(message: types.Message, user: UserTG) -> None: text = f""" <b>Привет{f', {user.info}' if user.info else ''}!</b> """ await user.send_message(text) def register(...
TimNekk/TGBotTemplate
tgbot/handlers/start.py
start.py
py
406
python
en
code
5
github-code
18
[ { "api_name": "aiogram.types.Message", "line_number": 7, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 7, "usage_type": "name" }, { "api_name": "tgbot.models.user_tg.UserTG", "line_number": 7, "usage_type": "name" }, { "api_name": "aio...
39799973360
import pandas as pd from obspy import read from obspy.signal import PPSD from numpy import where,mean from glob import glob from matplotlib import pyplot as plt import numpy as np from pathlib import Path from noise_utils import psd_stack2hist_stack, _plot_histogram, get_percentile pq_file='../data/jgr_data/ambient...
timdittmann/psuedosynth_gnss_velocities
bin/noise/sac2noise.py
sac2noise.py
py
2,733
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_parquet", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 26, "usage_type": "call" }, { "api_name": "obspy.read", "line_number": 32, "usage_type": "call" }, { "api_name": "obspy.read", "line_nu...
1749538614
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path('add', views.add, name='add'), path('edit/<int:id>', views.edit, name='edit'), path('delete/<int:id>', views.delete, name='delete'), path('delete_audio/<int:id_pk>/<int:id_ad>', views....
cravengithub/hypnoAppStaff
hypno/urls.py
urls.py
py
416
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 4, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", ...
35812992644
import torch import torch.nn as nn class TripletLoss(nn.Module): """ Triplet loss with hard positive/negative mining """ def __init__(self, margin=0.1): super(TripletLoss, self).__init__() self.margin = margin def forward(self, x, target): # x is N x D dim = x.size(1) ...
Tarekbouamer/visloc_retrieval
retrieval/loss/triplet.py
triplet.py
py
981
python
en
code
1
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.sum", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.sum", "line_number": ...
75161176360
import datetime from .forms import * from .models import * from newsfeed_portal.settings import * from .tokens import account_activation_token # from .serializers import * from django.contrib import messages from django.contrib.auth import login from django.contrib.auth.decorators import login_required from django.c...
aqifcse/newsfeed
newsfeed_portal/portal/views.py
views.py
py
31,918
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.views.APIView", "line_number": 62, "usage_type": "name" }, { "api_name": "hashlib.sha256", "line_number": 73, "usage_type": "call" }, { "api_name": "datetime.datetime.timestamp", "line_number": 79, "usage_type": "call" }, { "api_name"...
3854840284
import time import functools from libvirt import libvirtError from libvirttestapi.src import sharedmod from libvirttestapi.utils import utils from libvirttestapi.repos.installation import install_common required_params = ('guestname',) optional_params = {} def get_guest_ip(guestname, logger, bridge='virbr0'): m...
libvirt/libvirt-test-API
libvirttestapi/repos/domain/get_guest_vcpus.py
get_guest_vcpus.py
py
3,134
python
en
code
12
github-code
18
[ { "api_name": "libvirttestapi.utils.utils.get_dom_mac_addr", "line_number": 14, "usage_type": "call" }, { "api_name": "libvirttestapi.utils.utils", "line_number": 14, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 20, "usage_type": "call" }, { ...
994431402
import requests from ..dto import Naver, MyProduct from danawa.services.danawa_separator import DanawaSeparator # 작성자: 양태영 # 작성일: 21.11.03 # 입력: query: 검색어 # 반환: naver api결과 리스트 객체 # 설명: 검색어(query)를 통해 네이버 쇼핑리스트를 조회하고 반환하는 것. def get_naver_shopping(query): url = "https://openapi.naver.com/v1/search/shop.json" h...
MaPDuck/MaPDuck-django
naver/services/naver_service.py
naver_service.py
py
1,096
python
ko
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "danawa.services.danawa_separator.DanawaSeparator", "line_number": 21, "usage_type": "call" }, { "api_name": "dto.MyProduct", "line_number": 27, "usage_type": "call" } ]
71427360040
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import matplotlib as mpl mpl.rcParams['axes.facecolor'] = '#ffffff' mpl.rcParams["axes.edgecolor"] = "0.15" mpl.rcParams["axes.linewidth"] = 1.25 import warnings warnings.filterwarnings('ignore') train = pd.read...
aorursy/new-nb-3
indrajit_short-data-exploration-for-desktop-mobile-data.py
indrajit_short-data-exploration-for-desktop-mobile-data.py
py
3,335
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.rcParams", "line_number": 15, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 17, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 19, "usage_type": "attribute" }, { "api_na...
7808516204
from pprint import pprint from torch import nn, optim from src.data.cifar100 import Cifar100 from src.models.baseline import Baseline def load_cifar100(): cifar100 = Cifar100() dataloaders = cifar100.load_branch_dataloaders() return dataloaders def load_baseline(branch_dataloaders: dict): resnet_l...
AmarCodes-22/Art_inspector
scripts/custom_train.py
custom_train.py
py
2,312
python
en
code
0
github-code
18
[ { "api_name": "src.data.cifar100.Cifar100", "line_number": 10, "usage_type": "call" }, { "api_name": "src.models.baseline.Baseline", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn.CrossEntropyLoss", "line_number": 52, "usage_type": "call" }, { ...
14736882901
""" PURPOSE: front-end interface to easily and reliably match against opponents and run Starcraft2 opponents. """ import argparse import sys from sc2common import types as t from sc2ladderMgmt import getKnownLadders from sc2maptool.functions import filterMapNames from sc2players import getKnownPlayers from...
ttinies/sc2gameLobby
sc2gameLobby/cli.py
cli.py
py
6,692
python
en
code
9
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "sc2gameLobby.__version__.__version__", "line_number": 26, "usage_type": "name" }, { "api_name": "sc2players.getKnownPlayers", "line_number": 29, "usage_type": "call" }, ...
38038719995
from time import time from functools import wraps EVEN = 0 # четные числа ODD = 1 # нечетные числа PRIME = 2 # простые числа def time_decor(func, *args): @wraps(func) def wrapper(*args, key = 2): time_start = time() ret = func(*args, key = key) time_end = time() ...
mages-py/lessons
lesson.3/main.py
main.py
py
1,516
python
en
code
0
github-code
18
[ { "api_name": "time.time", "line_number": 13, "usage_type": "call" }, { "api_name": "time.time", "line_number": 15, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 11, "usage_type": "call" } ]
25722167801
import os import json import datetime import numpy import re import nltk from sklearn import feature_extraction import string path = "../../Datasets/tweets/tweet_data/" #path = "F:/tweets/" # returns a list of lists of feature data between start and end-time from the input file # no of tweets # total retweets # sum ...
snisarg/UCLA-239AS
Projects/4/utility.py
utility.py
py
7,805
python
en
code
1
github-code
18
[ { "api_name": "numpy.add", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_number": 50, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 1...
38873166139
from collections import Counter from dataclasses import InitVar, dataclass, field from math import log from os.path import relpath from pathlib import Path from typing import Generic, List, Optional, Tuple import matplotlib.pyplot as plt import numpy as np import seaborn as sns from matplotlib.axes import Axes, loggin...
PolySTAR-mtl/cv
src/research/armors/evaluation/reporter.py
reporter.py
py
13,942
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.axes.logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.axes.logging", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.Generic", "line_number": 29, "usage_type": "name" }, { "api_name...
25518580436
import pygame from tile import Tile from explosion import Explosion from settings import TILE_SIZE, FPS from toolbox import check_group_positions, round_to_nearest class Bomb(Tile): def __init__( self, pos, groups, obstacle_sprites, explosion_sprites, destructive_...
Gustan13/ScribblesXSketches
bomb.py
bomb.py
py
8,887
python
en
code
2
github-code
18
[ { "api_name": "tile.Tile", "line_number": 10, "usage_type": "name" }, { "api_name": "settings.FPS", "line_number": 23, "usage_type": "name" }, { "api_name": "pygame.math.Vector2", "line_number": 40, "usage_type": "call" }, { "api_name": "pygame.math", "line_nu...
27068835511
import os import sys from geos_ats.common_utilities import TextTable, InfoTopic, Error, Log from geos_ats.suite_settings import testLabels import difflib import logging ################################################################################ # Config related classes and functions ##############################...
GEOS-DEV/integratedTests
scripts/geos_ats_package/geos_ats/configuration_record.py
configuration_record.py
py
15,716
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "geos_ats.common_utilities.Error", "line_number": 45, "usage_type": "call" }, { "api_name": "difflib.get_close_matches", "line_number": 67, "usage_type": "call" }, { "api_n...
73126601321
import datetime import json import connexion from connexion import NoContent import swagger_ui_bundle import mysql.connector import pymysql import yaml import logging import logging.config import sqlalchemy from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from base import...
zhaotongjia/dashboard
storage/app.py
app.py
py
3,584
python
en
code
0
github-code
18
[ { "api_name": "yaml.safe_load", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 30, "usage_type": "call" }, { "api_name": "base.Base.metadata", "line_number": 32, "usage_type": "attribute" }, { "api_name": "base....
41839789526
# coding=utf-8 # 代码文件:chapter19/ch19.6.6.py import wx # 自定义窗口类MyFrame class MyFrame(wx.Frame): def __init__(self): super().__init__(parent=None, title='静态图片控件', size=(300, 300)) self.bmps = [wx.Bitmap('images/bird5.gif', wx.BITMAP_TYPE_GIF), wx.Bitmap('images/bird4.gif', wx.B...
tonyguan/python1
code/chapter19/ch19.6.6.py
ch19.6.6.py
py
1,598
python
en
code
23
github-code
18
[ { "api_name": "wx.Frame", "line_number": 8, "usage_type": "attribute" }, { "api_name": "wx.Bitmap", "line_number": 11, "usage_type": "call" }, { "api_name": "wx.BITMAP_TYPE_GIF", "line_number": 11, "usage_type": "attribute" }, { "api_name": "wx.Bitmap", "line_...
11169655161
import logging from django.shortcuts import render, get_object_or_404 from django.contrib import messages from django.urls import reverse from django.http import HttpResponseRedirect from dojo.utils import add_breadcrumb from dojo.forms import LoginBanner from dojo.models import BannerConf from dojo.authorization.aut...
DefectDojo/django-DefectDojo
dojo/banner/views.py
views.py
py
1,626
python
en
code
3,128
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "django.shortcuts.get_object_or_404", "line_number": 20, "usage_type": "call" }, { "api_name": "dojo.models.BannerConf", "line_number": 20, "usage_type": "argument" }, { "a...
6414267691
# libaries import pygame import random # Constants WIDTH = 800 HEIGHT = 800 FPS = 120 SPEEDX = 2 SPEEDY = 1 # Colors in RGB BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) CYAN = (0, 255, 255) PURPLE = (255, 0, 255) YELLOW = (255, 255, 0) cl...
ussian/Game-Mechanics
Python/Collision/Collision.py
Collision.py
py
2,387
python
en
code
0
github-code
18
[ { "api_name": "pygame.sprite", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Sprite.__init__", "line_number": 27, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 27, "usage_type": "attribute" }, { "api_name": "p...
23447740354
from gym import Env from gym.spaces import Discrete, Box import numpy as np import random class ShowerEnv(Env): def __init__(self): #Actions we can take: Down, stay, up self.action_space= Discrete(3) #Temperature array self.observation_space = Box(low=np.array([0], high=np.array...
wilkp0/SURPL-V2
multiagent-particle-envs-master/multiagent/scenarios/shower.py
shower.py
py
2,338
python
en
code
1
github-code
18
[ { "api_name": "gym.Env", "line_number": 6, "usage_type": "name" }, { "api_name": "gym.spaces.Discrete", "line_number": 9, "usage_type": "call" }, { "api_name": "gym.spaces.Box", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_numb...
41078282800
from .models import Employee from typing import List # TODO: add readme to deploy, git and deploy class AlphabeticalGrouper: def __init__(self) -> None: self._employees = Employee.objects.order_by('last_name') self._number_of_names = Employee.objects.count() self._groups_calculator = Alph...
Atomnory/wallcrafttask-employee
employee/services.py
services.py
py
5,773
python
en
code
0
github-code
18
[ { "api_name": "models.Employee.objects.order_by", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Employee.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Employee", "line_number": 8, "usage_type": "name" }, { "api_na...
3380388844
import pymongo #和数据库连接 client = pymongo.MongoClient(host='localhost', port=27017) #访问“test”数据库 db = client.test print(db) # 访问‘movie’ 集合 collection = db.movie # 插入一条数据 item = { 'name': 'abc', 'actor': 'zhang san', } #result = collection.insert_one(item) #返回一个独一无二的ID值 #print(result) items =[{ 'name': ...
sileyouhe/Douban_movie_data_analysis
mongoDB/__init__.py
__init__.py
py
641
python
en
code
0
github-code
18
[ { "api_name": "pymongo.MongoClient", "line_number": 4, "usage_type": "call" } ]
29188768020
import random import sys from collections import Counter GAME_SIZE = 3 MATRIX_SIZE = GAME_SIZE + 2 MATRIX_LENGTH = MATRIX_SIZE - 1 def rnd(n, b=0): return int(round(random.random() * (b - n) + n, 0)) class Table: def __init__(self, table): self.table = table self.table_coords = \ ...
zolcsika71/JBA_Python
Tic-Tac-Toe with AI/Tic-Tac-Toe with AI/task/tictactoe.py
tictactoe.py
py
10,212
python
en
code
1
github-code
18
[ { "api_name": "random.random", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 160, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 305, "usage_type": "call" } ]
35979648903
# Python 3 server example import cgi from http.server import BaseHTTPRequestHandler, HTTPServer import time from pymongo import MongoClient hostName = "localhost" serverPort = 8080 client = MongoClient("mongodb+srv://test:test@cluster0.anx9a.mongodb.net/?retryWrites=true&w=majority") db = client.pasta collection = db...
tomermichaeli/pasta
pyserver.py
pyserver.py
py
4,001
python
en
code
0
github-code
18
[ { "api_name": "pymongo.MongoClient", "line_number": 10, "usage_type": "call" }, { "api_name": "http.server.BaseHTTPRequestHandler", "line_number": 14, "usage_type": "name" }, { "api_name": "cgi.parse_header", "line_number": 68, "usage_type": "call" }, { "api_name"...
2065282742
from flask import Flask, render_template from flask_bootstrap import Bootstrap from flask_moment import Moment from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager from config import config bootstrap = Bootstrap() moment = Moment() db = SQLAlchemy() login_manager = LoginManager() login_manage...
yuchunsheng/pathostream
app/__init__.py
__init__.py
py
1,667
python
en
code
0
github-code
18
[ { "api_name": "flask_bootstrap.Bootstrap", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_moment.Moment", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 11, "usage_type": "call" }, { "api_name...
2245302918
import os from maya import cmds #create directory DIRECTORY = os.path.expanduser("~\documents") LIBRARYPATH = os.path.join(DIRECTORY + "\AssetsLib") def createDirectory(): #Creates a directory to store all assets and returns path to it if not os.path.exists(LIBRARYPATH): os.makedirs(LIBRARYPATH, ex...
mikewa-git/Python--Advanced
02_style/L0dbrary_after.py
L0dbrary_after.py
py
1,419
python
en
code
0
github-code
18
[ { "api_name": "os.path.expanduser", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
28585955081
""" REM Layout classes and functions. """ import PySimpleGUI as sg import REM.constants as mod_const import REM.data_manipulation as mod_dm from REM.client import logger, settings, user # Modifier functions def set_size(window, element_key, size): """ Set new size for container-like elements. """ opt...
cnthornton/REM
REM/layouts.py
layouts.py
py
37,530
python
en
code
0
github-code
18
[ { "api_name": "REM.client.logger.warning", "line_number": 44, "usage_type": "call" }, { "api_name": "REM.client.logger", "line_number": 44, "usage_type": "name" }, { "api_name": "REM.constants.LARGE_FONT", "line_number": 54, "usage_type": "attribute" }, { "api_nam...
71722741479
import torch import torchvision from torchvision import datasets, transforms from torch.autograd import Variable import matplotlib.pyplot as plt transform = transforms.Compose([transforms.ToTensor(), # transforms.Lambda(lambda x: x.repeat(3,1,1)), # 而是因为图...
jayphone17/SOMETHIN-BOUT-CNN
RNN/RNN_on_MNIST.py
RNN_on_MNIST.py
py
3,797
python
en
code
0
github-code
18
[ { "api_name": "torchvision.transforms.Compose", "line_number": 7, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 7, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 7, "usage_type": "call" }, { ...
40490655070
from __future__ import (absolute_import, division, print_function, unicode_literals) import logging from scipy.ndimage import fourier_shift import numpy as np import operator import dxchange import gc logger = logging.getLogger(__name__) __author__ = ['Rafael Vescovi', 'Ming Du'] __credits__ ...
mdw771/tomosaic2
tomosaic/util/morph.py
morph.py
py
6,232
python
en
code
3
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.count_nonzero", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.isnan", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.round", "...
37838670238
# coding:utf-8 ''' funword -- 单词操作函数公用单元 Created on 2010-9-2 @author: tongjp findword() 根据搜素关键词返回查询结果 pageword() 以分页的形式返回单词查询结果,最多3000条记录 pagenword() 以分页的形式返回生词词查询结果 ''' from django.core.paginator import * from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.db.m...
szatjp/rabbitplan
jpstudy/study/funword.py
funword.py
py
2,288
python
en
code
0
github-code
18
[ { "api_name": "dictdata.models.JaWord.objects.filter", "line_number": 26, "usage_type": "call" }, { "api_name": "dictdata.models.JaWord.objects", "line_number": 26, "usage_type": "attribute" }, { "api_name": "dictdata.models.JaWord", "line_number": 26, "usage_type": "name...
13657160034
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('scenic', '0059_census_dev'), ] operations = [ migrations.RenameField( model_name='census', old_name=...
chen223-hz/hiyou
webapp/webapp/scenic/migrations/0060_auto_20171009_0928.py
0060_auto_20171009_0928.py
py
538
python
en
code
1
github-code
18
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.RenameField", "line_number": 14, "usage_type": "call" }, ...
15167557204
# -*- coding: utf-8 -*- """ Created on Sat Nov 20 21:48:17 2021 @author: vonGostev """ import __init__ import numpy as np import cupy as cp import matplotlib.pyplot as plt from lightprop2d import Beam2D, um, gaussian_beam from scipy.sparse.linalg import expm from scipy.sparse import csc_matrix npoints = 256 cradius =...
vongostev/RSF-21-12-00155-1-MMF
report_coherence_regular.py
report_coherence_regular.py
py
1,773
python
en
code
0
github-code
18
[ { "api_name": "lightprop2d.um", "line_number": 20, "usage_type": "name" }, { "api_name": "numpy.load", "line_number": 24, "usage_type": "call" }, { "api_name": "scipy.sparse.csc_matrix", "line_number": 26, "usage_type": "call" }, { "api_name": "lightprop2d.Beam2D"...
70883429479
__author__ = 'Zhiyang Ong' __version__ = '0.1' __date__ = 'February 25, 2025' ############################################################### """ Import modules from The Python Standard Library. sys Get access to any command-line arguments. os Use any operating system dependent functionality. os.path For pat...
eda-ricercatore/python-sandbox
file-io-and-other-io/verify_output_file_path.py
verify_output_file_path.py
py
5,541
python
en
code
1
github-code
18
[ { "api_name": "timing_measurements.performance_measurement_no_ns.execution_time_measurement_no_ns.set_initial_timestamp", "line_number": 68, "usage_type": "call" }, { "api_name": "timing_measurements.performance_measurement_no_ns.execution_time_measurement_no_ns", "line_number": 68, "usa...
30410587460
import numpy as np import matplotlib.pyplot as plt import nltk import textrank from random import shuffle from postprocessing import Postprocess from preprocessing import Preprocessing from text_cnn import TextCNN from extension import Extension from plotting import Plotting class Main(object): """ Runs the ...
louisharris/dissertation-text-summarisation
main.py
main.py
py
4,684
python
en
code
0
github-code
18
[ { "api_name": "preprocessing.Preprocessing", "line_number": 29, "usage_type": "call" }, { "api_name": "postprocessing.Postprocess", "line_number": 30, "usage_type": "call" }, { "api_name": "textrank.TextRank.run", "line_number": 41, "usage_type": "call" }, { "api_...
70320669481
# 2020.03.10-Homework-kamene ping from kamene.all import * from kamene.layers.inet import IP, ICMP import logging logging.getLogger('kamene.runtime').setLevel(logging.ERROR) def qytang_ping(ip): ping_pkt = IP(dst=ip) / ICMP() ping_result = sr1(ping_pkt, timeout=2, verbose=False) if ping_result: ...
JasperDiShu/QYT_Homework_Practice
Homework/2020_Mar_10/kamene_ping.py
kamene_ping.py
py
629
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 6, "usage_type": "attribute" }, { "api_name": "kamene.layers.inet.IP", "line_number": 10, "usage_type": "call" }, { "api_name": "kamene.layer...
9830653688
# -*- coding: utf-8 -*- """ data access @author: hch @date : 2021/12/8 """ from pymongo import MongoClient import redis from conf.config import APP_CONF class MongoDao: def __init__(self): self.client = MongoClient(APP_CONF.mongodb.conn) self.db = self.client.get_database('wx_chat_bot') de...
kjhch/wx-chat-bot
core/dao.py
dao.py
py
930
python
en
code
0
github-code
18
[ { "api_name": "pymongo.MongoClient", "line_number": 16, "usage_type": "call" }, { "api_name": "conf.config.APP_CONF.mongodb", "line_number": 16, "usage_type": "attribute" }, { "api_name": "conf.config.APP_CONF", "line_number": 16, "usage_type": "name" }, { "api_na...
18225998603
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Script to parse the mapping results of KMA, when the ref database is a set of VAMB bins Created on 5/3/21 @author: V.R.Marcelino """ import pandas as pd from argparse import ArgumentParser import os parser = ArgumentParser() parser.add_argument('-i', '--input_fp', ...
vrmarcelino/MetaModels
MetModels_parse_KMA.py
MetModels_parse_KMA.py
py
1,892
python
en
code
9
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 35, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path.join", ...
3584185938
#!/usr/bin/env python3 """Sample program which shows how to talk to a bioloid servo.""" import argparse import os import sys import serial import logging import time from bioloid.serial_bus import SerialPort, SerialBus from bioloid.device_type_parser import DeviceTypeParser from bioloid.device_type import DeviceType...
dhylands/Bioloid
test-servo.py
test-servo.py
py
3,244
python
en
code
5
github-code
18
[ { "api_name": "os.getenv", "line_number": 21, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 60, "usage_type": "attribute" }, { "api_name": "os.path.dirname", ...
17491808659
import tensorflow as tf from sparkflow.tensorflow_async import SparkAsyncDLModel from google.protobuf import json_format from pyspark.ml.pipeline import PipelineModel import json def load_tensorflow_model( path, inputCol, tfInput, tfOutput, predictionCol='predicted', tf...
lifeomic/sparkflow
sparkflow/tensorflow_model_loader.py
tensorflow_model_loader.py
py
1,572
python
en
code
302
github-code
18
[ { "api_name": "tensorflow.Session", "line_number": 16, "usage_type": "call" }, { "api_name": "tensorflow.Graph", "line_number": 16, "usage_type": "call" }, { "api_name": "tensorflow.train.import_meta_graph", "line_number": 17, "usage_type": "call" }, { "api_name":...
36982666416
# -*- coding: utf-8 -*- """ Created on Tue Feb 28 16:34:19 2017 @author: kurner """ import os import os.path import requests import xml.etree.ElementTree as ET PROJECT = "/Users/kurner/Downloads/session10" if not os.path.abspath(".") != PROJECT: os.chdir(PROJECT) #get_url = ("https://developer.trimet.org/w...
pbarton666/learninglab
kirby-course/session10/trimet.py
trimet.py
py
2,344
python
en
code
2
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.chdir", "line_number": 16, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.parse", ...
22642513235
import torch import torch.nn as nn import numpy as np import pickle iteration_num = 250 class MLPModel(nn.Module): # I defined the hyperparameters. These are in the parameters of the init function. def __init__(self,number_of_hidden_layers,number_of_neurons,learning_rate,activation_function,epoch): ...
nkilicarslan/Machine-Learning
ml_assignment_1/part3.py
part3.py
py
10,990
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
8074083863
import os import numpy as np from matplotlib import pyplot as plt import cv2 img_array = [] path = '/home/ash/labelme/IIIT_Labels/seq_5/SegmentationClassVisualization/' files = sorted(os.listdir(path))[60:240] for file in files: img = cv2.imread(os.path.join(path,file)) img_array.append(img) size = (img.sha...
RoboticsIIITH/LiDAR_small_obstacle
create_video.py
create_video.py
py
512
python
en
code
1
github-code
18
[ { "api_name": "os.listdir", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "...
38649086373
# This script takes a file containing ADCG chunks and decompresses them. # Pillow is required as a dependency. # # The decompressed ADCG chunks are output in the working directory with the extension .adcg. # The decompressed image data is then weaved into a complete image and saved as PNG. # In files that contain them,...
TheOpponent/st3-translation-notes
Scripts/decode_adcg.py
decode_adcg.py
py
7,585
python
en
code
7
github-code
18
[ { "api_name": "os.path.realpath", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.argv", "line_nu...
32648046076
from django.shortcuts import render, redirect from courses.models import Directions def index(request): template = 'landing/app.html' directions = Directions.objects.all() if request.method == 'POST': course_name = request.POST.get('course_name') select_course = request.POST.get('select_c...
civikash/education_works
education_courses/landing/views/landing.py
landing.py
py
1,324
python
en
code
0
github-code
18
[ { "api_name": "courses.models.Directions.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "courses.models.Directions.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "courses.models.Directions", "line_number": 8, "usage_type": "n...
42587897518
# -*- coding: utf-8 -*- """ Created on Fri Mar 02 15:36:19 2018 @author: zrssch """ from __future__ import division from __future__ import print_function import os import sys import utils.data_utils as data_utils from seq2seq import Encoder, Decoder, Seq2Seq import torch from torch import optim from to...
njuzrs/task2-pytorch_neural_dialogue_generation
gen/generator.py
generator.py
py
15,654
python
en
code
3
github-code
18
[ { "api_name": "sys.path.append", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.stdout.flush", "line_number": 36, "usage_type": "call" }, { "api_name": "sys.stdout", "line...
24728312158
from utils import read_file def get_views(pos, grid): x, y = pos right = grid[x][y + 1 :] left = grid[x][:y][::-1] grid_t = list(map(list, zip(*grid))) up = grid_t[y][:x][::-1] down = grid_t[y][x + 1 :] return up, down, left, right def is_visible(pos, grid): x, y = pos for v i...
neal-o-r/aoc22
aoc08.py
aoc08.py
py
1,412
python
en
code
0
github-code
18
[ { "api_name": "utils.read_file", "line_number": 68, "usage_type": "call" } ]
26540336510
''' Created on Aug 5, 2020 @author: gsq ''' import sys import time import math from shutil import get_terminal_size from scipy.ndimage import filters as filters from scipy.signal import convolve2d import cv2 import numpy as np import tensorflow as tf def generate_gaussian_kernel(k, sigma1=1.6, sigma2=1.6, angle=0):...
shangqigao/BayeSR
common/util.py
util.py
py
12,678
python
en
code
39
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 29, "usage_type": "call" }, { "api_name": "scipy.ndimage.filters.gaussian_filter", "line_number": 33, "usage_type": "call" }, { "api_name": "scipy.ndimage.filters", "line_number": 33, "usage_type": "name" }, { "api_name"...
25703953639
from pydub import AudioSegment from tqdm import tqdm import os def create_translated_audio(result_diarize, audio_files, Output_name_file): total_duration = result_diarize['segments'][-1]['end'] # in seconds # silent audio with total_duration combined_audio = AudioSegment.silent(duration=int(total_duration...
R3gm/SoniTranslate
soni_translate/audio_segments.py
audio_segments.py
py
1,051
python
en
code
33
github-code
18
[ { "api_name": "pydub.AudioSegment.silent", "line_number": 9, "usage_type": "call" }, { "api_name": "pydub.AudioSegment", "line_number": 9, "usage_type": "name" }, { "api_name": "tqdm.tqdm", "line_number": 12, "usage_type": "call" }, { "api_name": "pydub.AudioSegme...
70569491880
import requests import pandas as pd import numpy as np import datetime as dt from pandas_datareader import data as pdr def backtest(): pair = input("Enter a pair symbol: ") finalDate = dt.datetime.now() initialDate = finalDate - pd.DateOffset(months=1) URL = "https://fxmarketapi.com/apipa...
RafaVrech/GoodMorningBot
backtest.py
backtest.py
py
1,354
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pandas.DateOffset", "line_number": 11, "usage_type": "call" }, { "api_name": "reques...
14113101491
#참고 : https://velog.io/@waoderboy/알고리즘-백준-16236-아기상어-파이썬 from collections import deque import sys n = int(sys.stdin.readline()) graph = [list(map(int, sys.stdin.readline().split())) for _ in range(n)] x,y = 0,0 cnt,t = 0,0 move = ((1,0),(-1,0),(0,1),(0,-1)) size = 2 for i in range(n): for j in range(n): if...
YouHojoon/baekjoon_coding_test
bfs/16236.py
16236.py
py
1,408
python
en
code
0
github-code
18
[ { "api_name": "sys.stdin.readline", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.stdin.readline", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.stdin", "li...
34158876579
from fastapi import FastAPI, Request, status from fastapi.middleware.cors import CORSMiddleware from fastapi.exceptions import RequestValidationError from fastapi.responses import JSONResponse from typing import Union from pydantic import BaseModel import requests import random from package1 import poke_api class Quiz...
reitan4742/poke-quiz
back/main.py
main.py
py
1,744
python
en
code
0
github-code
18
[ { "api_name": "pydantic.BaseModel", "line_number": 11, "usage_type": "name" }, { "api_name": "fastapi.FastAPI", "line_number": 16, "usage_type": "call" }, { "api_name": "fastapi.middleware.cors.CORSMiddleware", "line_number": 26, "usage_type": "argument" }, { "api...
70124487081
import pandas as p import numpy as n import matplotlib.pyplot as plot from sklearn import metrics data1=p.read_csv("ww.csv") num = list(n.array(list(range(0,105,5)))/100) num1=[] for i in num: data1["data1_pr_ran"] = (data1["y_pred_random_forest"]>=i).astype(int) tp=sum((data1["y_act"]==1) & (data1["data1...
IRajkumar20/FresherTrain_ing
Day - 8/metrics_3.py
metrics_3.py
py
1,578
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.trapz", "line_n...
3974798070
"""Modified from Gluon CV""" """Prepare ImageNet Sketch datasets: https://github.com/HaohanWang/ImageNet-Sketch""" import os import shutil import argparse import tarfile import pathlib from download import download from filesystem import makedirs try: from google_drive_downloader import GoogleDriveDownloader as gdd...
tfwu/iVMCL-Release
mmdetection/tools_ivmcl/imagenet-sketch.py
imagenet-sketch.py
py
2,021
python
en
code
5
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.join", "line...
35571565145
import discord from discord.ext import commands from random import randint as rand import time import json intents=discord.Intents.all() allowed_mentions=discord.AllowedMentions(everyone=False, users=True, roles=False) bot = commands.Bot(command_prefix='=', intents=intents, allowed_mentions=allowed_mentions) token = ...
RKREEE/FaithBot
main.py
main.py
py
6,452
python
en
code
0
github-code
18
[ { "api_name": "discord.Intents.all", "line_number": 7, "usage_type": "call" }, { "api_name": "discord.Intents", "line_number": 7, "usage_type": "attribute" }, { "api_name": "discord.AllowedMentions", "line_number": 8, "usage_type": "call" }, { "api_name": "discord...
33319609954
import re import json from loader import bot, headers import rapid_api def city_api(message, hotel_dest, loc): querystring_search = {"query": loc, "locale": "en_US", "currency": "USD"} url_search = "https://hotels4.p.rapidapi.com/locations/v2/search" response = rapid_api.request_api.request_to_...
EKaritskii/hotel_bot
hotel_bot/rapid_api/city_group.py
city_group.py
py
1,119
python
en
code
0
github-code
18
[ { "api_name": "rapid_api.request_api.request_to_api", "line_number": 11, "usage_type": "call" }, { "api_name": "loader.headers", "line_number": 11, "usage_type": "argument" }, { "api_name": "rapid_api.request_api", "line_number": 11, "usage_type": "attribute" }, { ...
16458789486
import pygame class Counter: def __init__(self, screen, pos, nTotalItems, nCurrentItems, itemImage, spacerX, directionRight) -> None: self.screen = screen self.x, self.y = pos self.nTotalItems = nTotalItems self.nCurrentItems = nCurrentItems self.itemImage = itemImage ...
jtayped/TheQuest
files/elements/UI/UI_counter.py
UI_counter.py
py
1,453
python
en
code
0
github-code
18
[ { "api_name": "pygame.BLEND_RGBA_MULT", "line_number": 16, "usage_type": "attribute" } ]
39250624168
# $Id: tns.py 23 2006-11-08 15:45:33Z dugsong $ """Transparent Network Substrate.""" import dpkt class TNS(dpkt.Packet): __hdr__ = ( ('length', 'H', 0), ('pktsum', 'H', 0), ('type', 'B', 0), ('rsvd', 'B', 0), ('hdrsum', 'H', 0), ('msg', '0s', ''), ) def unpack(self, buf): ...
dragondjf/QMarkdowner
dpkt/tns.py
tns.py
py
615
python
en
code
118
github-code
18
[ { "api_name": "dpkt.Packet", "line_number": 7, "usage_type": "attribute" }, { "api_name": "dpkt.Packet.unpack", "line_number": 17, "usage_type": "call" }, { "api_name": "dpkt.Packet", "line_number": 17, "usage_type": "attribute" }, { "api_name": "dpkt.NeedData", ...
7835335510
''' 1/3/2018 Send t parameter by url, just change first two letters, ex: 5E9AF59D2467 # http://www.tjfdc.com.cn/Pages/fcdt/HouseInfo.aspx?t=7D4E9AF59D2467&loupan=经纬城市绿洲武清二期&projectname=学知华庭31号楼 Error:UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' change from f1.write(myNote.encode('gbk')) to f1.write(m...
liehuojdd/pythonstudy2
3.6/nv1/study/house/singleprice.py
singleprice.py
py
3,185
python
en
code
0
github-code
18
[ { "api_name": "splinter.browser.Browser", "line_number": 33, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 40, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 45, "usage_type": "call" } ]
42129712514
import unittest from unittest.mock import patch import tempfile import os from rhsmlib.facts import kpatch class TestKPatchCollector(unittest.TestCase): def setUp(self): self.dir_installed = tempfile.TemporaryDirectory() self.DIR_WITH_INSTALLED_KPATCH_MODULES = self.dir_installed.name os...
candlepin/subscription-manager
test/rhsmlib/facts/test_kpatch.py
test_kpatch.py
py
1,961
python
en
code
61
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "tempfile.TemporaryDirectory", "line_number": 12, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.j...
27237320970
from product import Product import random from datetime import datetime from user import Customer class Orders: def __init__(self): self.__item = {} @property def item(self): return self.__item @item.setter def item(self, item): self.__item = item def add_menu(self, ...
marena2004/Bake-My-Day
manage.py
manage.py
py
5,041
python
en
code
0
github-code
18
[ { "api_name": "product.Product", "line_number": 26, "usage_type": "call" }, { "api_name": "product.Product", "line_number": 29, "usage_type": "call" }, { "api_name": "product.Product", "line_number": 30, "usage_type": "call" }, { "api_name": "random.sample", "...
39723082401
import requests from bs4 import BeautifulSoup import jieba from wordcloud import WordCloud, ImageColorGenerator import matplotlib.pyplot as plt import numpy as np from PIL import Image # 爬取整页新闻函数 def news_get(base_url): # 发起请求 req = requests.get(base_url) # 设置编码 req.encoding = 'utf-8' # 获取网页内容 ...
MayBeTheWorld/python-work
thirdCourseWord/0302.py
0302.py
py
1,857
python
en
code
1
github-code
18
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 19, "usage_type": "call" }, { "api_name": "jieba.lcut", "line_number": 51, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
74560747561
import helpFunctions as hf import matplotlib.pyplot as plt import numpy as np from scipy import misc from PIL import Image dirIn = '/home/mehmet/Desktop/DTU_Spring/Math_Modelling/cn/Exercises/Exercise_1/ex1_campusnet/data/' multiIm, annotationIm = hf.loadMulti('multispectral_day20.mat' , 'annotation_day20.png', dirIn...
eyyupoglu/Image-Processing
script.py
script.py
py
7,584
python
en
code
0
github-code
18
[ { "api_name": "helpFunctions.loadMulti", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image.fromarray", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 12, "usage_type": "name" }, { "api_name": "PIL.Image.fromar...
27040765452
import json, argparse import logging, sys, datetime, os from shutil import copy from pydal.helpers.classes import RecordDeleter, RecordUpdater from pydal.objects import LazySet from applications.vidjil.models.VidjilAuth import PermissionEnum class MigrateLogger(): def __init__(self, level=logging.INFO): l...
NikaAb/FaIR
Code/CDR3_extraction_via_vidjil/vidjil-master-modified/server/web2py/applications/vidjil/scripts/migrator.py
migrator.py
py
15,339
python
en
code
0
github-code
18
[ { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.StreamH...
237250276
from django.shortcuts import render from rest_framework import viewsets from django.views.decorators.csrf import csrf_exempt from .serializers import CompanySerializer, HeadlineSerializer from .models import Company, Headlines from .views import * import requests from django.http import JsonResponse from django.http i...
danieljchang/djangoReact-articles
backend/webscraper/views.py
views.py
py
4,785
python
en
code
0
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 20, "usage_type": "call" }, { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 23, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 23, "usage_type": "name" }, ...
35136613571
tup = ('hello', object(), 42) tup[2] # This errors, tuples do not support item assignment # tup[2] = 23 # NamedTuples are immutable containers, they are "write once, read many" # Different that tuples because all atrributes are named and can be accessed # through a human-readable identifier from collections import nam...
gtcooke94/snippets
PythonTricks/named_tuples.py
named_tuples.py
py
2,043
python
en
code
0
github-code
18
[ { "api_name": "collections.namedtuple", "line_number": 13, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 46, "usage_type": "call" } ]
27939636849
#!python r"""Pac-Man - Random Search""" __author__ = 'Koosha Marashi' __email__ = 'km89f@mst.edu' #import used packages import random import json import time import argparse import os import sys from decimal import Decimal DIRECTORY = os.path.dirname(os.path.abspath(__file__)) NUMBER_OF_GHOSTS = 3 GAME_CONTINUES = 0...
koosham/Ms-Pac-Man
random_search/gpac.py
gpac.py
py
13,702
python
en
code
0
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 16, "usage_type": "call" }, { "api_name": "json.load", "line_nu...
32282843773
import json from collections import Counter from tabulate import tabulate import re class config: FILENAME = input("Введите имя файла JSON: ") tablefmt = "outline" open("result.txt", "w").close() def printAndWrite(text: str): with open("result.txt", "a", encoding="utf-8") as file: fi...
PyWebSol/TgAnalysis
main.py
main.py
py
5,316
python
en
code
0
github-code
18
[ { "api_name": "re.compile", "line_number": 19, "usage_type": "call" }, { "api_name": "re.UNICODE", "line_number": 32, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 43, "usage_type": "call" }, { "api_name": "collections.Counter", "line_...
38071500332
from bs4 import BeautifulSoup import requests from collections import Counter import smtplib import os headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", "Accept-Language": "en-US,en;q=0.9" } def remov_duplica...
MechaReagan/Pokemon-Repository
main.py
main.py
py
1,583
python
en
code
0
github-code
18
[ { "api_name": "collections.Counter", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.post", ...
10661538278
from django.test.runner import DiscoverRunner class UnManagedModelTestRunner(DiscoverRunner): """ From https://dev.to/patrnk/testing-against-unmanaged-models-in-django """ def setup_test_environment(self, *args, **kwargs): from django.apps import apps get_models = apps.get_models ...
Sentimentron/annotatron-old
annotatron/annotatron/utils.py
utils.py
py
786
python
en
code
6
github-code
18
[ { "api_name": "django.test.runner.DiscoverRunner", "line_number": 4, "usage_type": "name" }, { "api_name": "django.apps.apps.get_models", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.apps.apps", "line_number": 11, "usage_type": "name" } ]
72456073959
from ejercicios.ejercicio_use_en import EjercicioUseEn, ItemEjercicioUseEn from ejercicios.ejercicio_sustantivos import EjercicioSustantivos, ItemEjercicioSustantivos from ejercicios.ejercicio_verbos import EjercicioVerbos, ItemEjercicioVerbos from ejercicios.ejercicio_hiponimos import EjercicioHiponimos, ItemEjercicio...
joacolej/proygrado
src/ejercicios/importar.py
importar.py
py
2,605
python
es
code
3
github-code
18
[ { "api_name": "procesamientos.oraciones.sustituir_sustantivo", "line_number": 14, "usage_type": "call" }, { "api_name": "procesamientos.oraciones", "line_number": 14, "usage_type": "name" }, { "api_name": "nltk.word_tokenize", "line_number": 14, "usage_type": "call" }, ...
25356814594
import flask from flask import render_template, Flask, request from flask_pymongo import PyMongo app = Flask(__name__) mongodb_client = PyMongo(app, uri="mongodb://root:password@mongo:27017/db?authSource=admin") db = mongodb_client.db @app.route("/", methods=['POST', 'GET']) def home(): if request.method == 'PO...
Joaffzie/astro-app
app/app.py
app.py
py
896
python
en
code
1
github-code
18
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_pymongo.PyMongo", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.reque...
7280114130
import discord import json import os import time import aiohttp from cogs import db from logging import getLogger, config with open('./log_config.json', 'r') as f: log_config = json.load(f) config.dictConfig(log_config) logger = getLogger('main') bot = discord.Bot() @bot.event async def on_ready(...
Elite35P-Server/EliteBot
python_app/main.py
main.py
py
1,627
python
en
code
2
github-code
18
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.config.dictConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.config", "line_number": 11, "usage_type": "name" }, { "api_name": "logging.getLogger"...
71803836519
from bs4 import BeautifulSoup from bs4 import SoupStrainer from requests import get from classes.team import Team def load_teams_by_round(year, load_round): #Website with March Madness tournament brackets url="https://www.sports-reference.com/cbb/postseason/"+str(year)+"-ncaa.html" response = get...
cgunther13/march-madness
sports_reference_teams_by_round.py
sports_reference_teams_by_round.py
py
2,252
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.SoupStrainer", "line_number": 27, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 28, "usage_type": "call" }, { "api_name": "classes.team.Team", ...
21238306158
"""Azure Plugin.""" import re import os from typing import List from azure.storage.blob import BlobServiceClient from tempfile import NamedTemporaryFile from netskope.integrations.cls.plugin_base import PluginBase, ValidationResult from .utils.azure_validator import ( AzureValidator, ) from .utils.azure_client imp...
mayurdhamecha-crest/ta_cloud_exchange_plugins
azure_object_storage/main.py
main.py
py
5,860
python
en
code
null
github-code
18
[ { "api_name": "netskope.integrations.cls.plugin_base.PluginBase", "line_number": 19, "usage_type": "name" }, { "api_name": "utils.azure_client.AzureClient", "line_number": 30, "usage_type": "call" }, { "api_name": "tempfile.NamedTemporaryFile", "line_number": 31, "usage_t...
19215235175
import csv import re import pandas as pd from konlpy.tag import Okt from mbti_categories import * from user import * # 채팅의 한 줄을 이름과 메시지 형태로 파싱 def parsing(line): i = 1 name = "" while line[i] != ']': name += line[i] i += 1 i += 1 while line[i] != ']': i += 1 message = ...
bluejeans8/MBTI_prediction
scoring.py
scoring.py
py
2,652
python
ko
code
0
github-code
18
[ { "api_name": "konlpy.tag.Okt", "line_number": 26, "usage_type": "call" }, { "api_name": "re.search", "line_number": 36, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 56, "usage_type": "call" } ]
13487431698
"""Handles menu screens and text""" import pygame from constants import WIDTH, HEIGHT, BLACK, WHITE, HS, \ IMG, BUTTS, FROG, TUBRM, BUTTS_BIO, FROG_BIO, TUBRM_BIO class Display: """Handles menu screens and text Args: width: width of screen height: height of screen Attributes: ...
aejmmark/mr_butts_vs_gravity
src/display.py
display.py
py
6,434
python
en
code
0
github-code
18
[ { "api_name": "pygame.display.set_mode", "line_number": 18, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 18, "usage_type": "attribute" }, { "api_name": "constants.WIDTH", "line_number": 18, "usage_type": "name" }, { "api_name": "constants...
24914651226
from typing import Optional from omegaconf import DictConfig from torch import Tensor from eztorch.losses.ressl_loss import compute_ressl_loss, compute_ressl_mask from eztorch.models.siamese.shuffle_momentum_queue_base import \ ShuffleMomentumQueueBaseModel LARGE_NUM = 1e9 class ReSSLModel(ShuffleMomentumQueue...
juliendenize/eztorch
eztorch/models/siamese/ressl.py
ressl.py
py
5,483
python
en
code
25
github-code
18
[ { "api_name": "eztorch.models.siamese.shuffle_momentum_queue_base.ShuffleMomentumQueueBaseModel", "line_number": 13, "usage_type": "name" }, { "api_name": "omegaconf.DictConfig", "line_number": 47, "usage_type": "name" }, { "api_name": "omegaconf.DictConfig", "line_number": 4...
34963503926
import gevent.monkey gevent.monkey.patch_all() import base64 from email.mime.multipart import MIMEMultipart from email.message import Message from .model_map import get_model_for_lang import json import struct import os import requests from flask import Flask, request, Response, abort app = Flask(__name__) DEBUG = F...
mbalduccini/rebble-asr
asr/__init__.py
__init__.py
py
6,604
python
en
code
null
github-code
18
[ { "api_name": "gevent.monkey.monkey.patch_all", "line_number": 2, "usage_type": "call" }, { "api_name": "gevent.monkey.monkey", "line_number": 2, "usage_type": "attribute" }, { "api_name": "gevent.monkey", "line_number": 2, "usage_type": "name" }, { "api_name": "f...
18606216553
from flask import render_template, flash, redirect, url_for from flask_login import current_user, login_required from app import db from app.models import CompleteBloodCount, MetabolicPanel from app.labs import bp from app.labs.forms import AddCompleteBloodCellCount, AddMetabolicPanel import random from datetime impor...
smallfritspoo/health_tracker
app/labs/routes.py
routes.py
py
2,149
python
en
code
1
github-code
18
[ { "api_name": "app.labs.forms.AddMetabolicPanel", "line_number": 15, "usage_type": "call" }, { "api_name": "app.models.MetabolicPanel", "line_number": 17, "usage_type": "call" }, { "api_name": "flask_login.current_user", "line_number": 28, "usage_type": "name" }, { ...