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
73243352745
import streamlit as st import pytube as pt import os import subprocess import re from utils import logtime, load_ffmpeg import whisper from langchain.document_loaders import YoutubeLoader from langchain.text_splitter import RecursiveCharacterTextSplitter URL = 'URL' TEXT = 'TEXT' WHISPER = 'WHISPER' PROCESSING = 'PROC...
olanigan/Youtube_Assistant
app.py
app.py
py
4,825
python
en
code
0
github-code
36
[ { "api_name": "streamlit.title", "line_number": 20, "usage_type": "call" }, { "api_name": "streamlit.session_state", "line_number": 23, "usage_type": "attribute" }, { "api_name": "streamlit.session_state", "line_number": 24, "usage_type": "attribute" }, { "api_nam...
8714183178
""" meclas.py Package for running various laser utilities in MEC Apologies on behalf of: Eric Cunningham (and others) To load: use import meclas or use IPython's %run magic function Class list and brief description: LPL -- routines for LPL pulse shaping (with some aux functions), data acquisition, e...
efcunn/mecps
meclas.py
meclas.py
py
349,079
python
en
code
2
github-code
36
[ { "api_name": "numpy.array", "line_number": 232, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 263, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 292, "usage_type": "call" }, { "api_name": "numpy.cumsum", "line_numbe...
27490420908
import datetime from FileBlackHolePy import FileBlackHole, initLib, destroyLib from MigurdiaPy import Migurdia from json import dumps, loads from colors import log, bcolors from PIL import Image from credentials import __USERNAME__, __PASSWORD__, __TOKEN__ from os.path i...
iLikeTrioxin/PTMU
pixivToMigurdiaUploader.py
pixivToMigurdiaUploader.py
py
6,744
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_number": 24, "usage_type": "call" }, { "api_name": "PIL.Image...
21619772911
from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest import apache_beam as beam from apache_beam.runners.direct import direct_runner from apache_beam.runners.interactive import cache_manager as cache from apache_beam.runners.interactive import pi...
a0x8o/kafka
sdks/python/apache_beam/runners/interactive/pipeline_analyzer_test.py
pipeline_analyzer_test.py
py
10,712
python
en
code
59
github-code
36
[ { "api_name": "apache_beam.pipeline.Pipeline.from_runner_api", "line_number": 17, "usage_type": "call" }, { "api_name": "apache_beam.pipeline", "line_number": 17, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 22, "usage_type": "attribute" ...
27898714417
from datetime import datetime def foo(n): n = int(n) global start_time start_time = datetime.now() list = [] i = 0 while len(list) < n: flag = True if i == 0 or i == 1: i += 1 continue for j in range(i+1): if j == 0 or j == 1 or j == ...
stgolovin/js_hw
lesson2/task1.py
task1.py
py
556
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime....
8478439649
#Python imports import json from uuid import UUID from datetime import date from datetime import datetime from typing import Optional, List #Pydantic imports from pydantic import Field as FD from pydantic import BaseModel as BMW from pydantic import EmailStr #FastAPI imports from fastapi import FastAPI...
davidcordellatt/Twitter-Api-Fastapi-practice-
main.py
main.py
py
13,686
python
en
code
0
github-code
36
[ { "api_name": "fastapi.FastAPI", "line_number": 19, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 22, "usage_type": "name" }, { "api_name": "uuid.UUID", "line_number": 24, "usage_type": "name" }, { "api_name": "pydantic.Field", "li...
16759793113
import datetime from ..command_system import Command from ...models import Client, Schedule, Teacher, Subject from ...utils import awesome_date def next_lesson(domain): client = Client.query.filter(Client.social_network == 'https://vk.com/'+ domain['domain']).first() schedule = Schedule.query.filter((Schedule.c...
edukato/learning
app/home/commands/next_lesson.py
next_lesson.py
py
1,707
python
ru
code
0
github-code
36
[ { "api_name": "models.Client.query.filter", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Client.query", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Client", "line_number": 8, "usage_type": "name" }, { "api_name": "models...
6519049093
from tkinter import* import tkinter as tk import cv2 import numpy as np import webbrowser #GRAY ONLY def obj(): thres = 0.45 nms_threshold = 0.2 cap = cv2.VideoCapture(0) className = [] classFile = 'coco.names' with open(classFile, 'rt') as f: className = f.read().rstrip('\n').split(...
jahin44/Python
pythonopencv/pro_gui.py
pro_gui.py
py
6,916
python
en
code
1
github-code
36
[ { "api_name": "cv2.VideoCapture", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.dnn_DetectionModel", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 34, "usage_type": "call" }, { "api_name": "cv2.dnn.NMSBoxes"...
23306080113
import streamlit as st import plotting def stats_view(dfmedicine, dfuniques, visualization_mode): st.markdown("## Conteos generales del hospital respecto a los pacientes ingresados por trauma") metric_values = zip(dfuniques.iloc[:, 0].values, dfuniques.iloc[:, 1].values) metric_columns = st.colum...
SimonPGM/ds4adashboard
Dashboard/generalstatsvis.py
generalstatsvis.py
py
937
python
es
code
0
github-code
36
[ { "api_name": "streamlit.markdown", "line_number": 6, "usage_type": "call" }, { "api_name": "streamlit.columns", "line_number": 9, "usage_type": "call" }, { "api_name": "plotting.group_comparisons_bar", "line_number": 16, "usage_type": "call" }, { "api_name": "str...
4585824107
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jun 30 20:16:19 2020 @author: Antonio Hickey """ #------------------------------------------------------------------- # Importing Modules from bs4 import BeautifulSoup as soup from urllib.request import urlopen as uReq import pandas as pd import csv #--...
antonio-hickey/Economics
Yeild Curve/Data Collection/Web_Crawler_Bot.py
Web_Crawler_Bot.py
py
1,268
python
en
code
2
github-code
36
[ { "api_name": "urllib.request.urlopen", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 42, "usage_type": "call" } ]
7927334038
from PyQt5.QtWidgets import (QWidget, QCalendarWidget,QLabel, QApplication, QVBoxLayout,QPushButton) from PyQt5.QtCore import QDate import sys global ap class Example(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): vbox = QVBoxLayout(self) ...
fernandezjared1/Vodafone-Idea---PS1
cal.py
cal.py
py
1,361
python
en
code
0
github-code
36
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 5, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QVBoxLayout", "line_number": 10, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QCalendarWidget", "line_number": 12, "usage_type": "call" }, { ...
27052806329
from typing import List class Solution: def _fizzBuzz(self, number): if number % 15 == 0: return "FizzBuzz" elif number % 5 == 0: return "Buzz" elif number % 3 == 0: return "Fizz" else: return str(number) def fizzBuzz(self, n: in...
ikedaosushi/leetcode
problems/python/fizzBuzz.py
fizzBuzz.py
py
397
python
en
code
1
github-code
36
[ { "api_name": "typing.List", "line_number": 15, "usage_type": "name" } ]
27878022936
# First things, first. Import the wxPython package. from concurrent.futures import thread from tracemalloc import start from turtle import pos from numpy import size, true_divide import wx from wx.adv import * from Utilities.media_utils import batchDownload, download, spotifyToSearches, ytFromLink import misc from spot...
missing-atabey/PyraTunes
main.py
main.py
py
3,400
python
en
code
0
github-code
36
[ { "api_name": "ctypes.windll.shcore.SetProcessDpiAwareness", "line_number": 19, "usage_type": "call" }, { "api_name": "ctypes.windll", "line_number": 19, "usage_type": "attribute" }, { "api_name": "wx.App", "line_number": 25, "usage_type": "call" }, { "api_name": ...
21600216675
# -*- coding: utf-8 -*- """ ReferIt, UNC, UNC+ and GRef referring image segmentation PyTorch dataset. Define and group batches of images, segmentations and queries. Based on: https://github.com/chenxi116/TF-phrasecut-public/blob/master/build_batches.py """ import os import re # import cv2 import sys import json impo...
djiajunustc/TransVG
datasets/data_loader.py
data_loader.py
py
9,900
python
en
code
134
github-code
36
[ { "api_name": "sys.path.append", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "re.match", "line_number": 38, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", ...
42843762688
import pytest import time import json import logging from error_code.error_status import SignatureStatus from automation_framework.utilities.workflow import submit_request from automation_framework.work_order_get_result.work_order_get_result_params \ import WorkOrderGetResult import avalon_client_sdk.worker.worker...
manojsalunke85/avalon0.6_automaiton
tests/validation_suite/automation_framework/work_order_get_result/work_order_get_result_utility.py
work_order_get_result_utility.py
py
2,938
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "automation_framework.work_order_get_result.work_order_get_result_params.WorkOrderGetResult", "line_number": 32, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 35, ...
15827613862
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import * import logging import pymongo import emission.storage.timeseries.timequery a...
e-mission/e-mission-server
emission/storage/decorations/analysis_timeseries_queries.py
analysis_timeseries_queries.py
py
4,240
python
en
code
22
github-code
36
[ { "api_name": "future.standard_library.install_aliases", "line_number": 6, "usage_type": "call" }, { "api_name": "future.standard_library", "line_number": 6, "usage_type": "name" }, { "api_name": "emission.storage.timeseries.abstract_timeseries.TimeSeries.get_aggregate_time_serie...
13460739357
import torch, torchvision import os class CNN(torch.nn.Module): def __init__(self, network_type, dataset_name): super(CNN, self).__init__() self.network_type = network_type if dataset_name == 'dogscats': classes = 2 elif dataset_name == 'imagenet': class...
burklight/Adversarial-Attacks-Pytorch
src/networks.py
networks.py
py
943
python
en
code
0
github-code
36
[ { "api_name": "torch.nn", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torchvision.models.resnet18", "line_number": 17, "usage_type": "call" }, { "api_name": "torchvision.models", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torc...
5450602551
from enum import Enum import numpy as np import pandas as pd from dataclasses import dataclass from copy import deepcopy from typing import List, Union class Direction(Enum): UP = 'U' DOWN = 'D' LEFT = 'L' RIGHT = 'R' @dataclass class Motion: direction: Union[Direction, str] steps: int ...
wbonna352/adventofcode2022
day_09/main.py
main.py
py
3,827
python
en
code
0
github-code
36
[ { "api_name": "enum.Enum", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 18, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 16, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", ...
41636716649
import argparse def create_parser(): parser = argparse.ArgumentParser(description='HR invetory software') parser.add_argument('path', help='Path to file to be exported') parser.add_argument('--export', action='store_true', help='Export current settings to json file') return parser def main(): from hr import use...
hamakohako/hr_inventory_test
src/hr/cli.py
cli.py
py
510
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" }, { "api_name": "hr.inventory.export_users", "line_number": 16, "usage_type": "call" }, { "api_name": "hr.inventory", "line_number": 16, "usage_type": "name" }, { "api_name": "hr.inve...
9588027057
""" A Jarvis plugin for listening music according to your mood through Spotify's Web Player! Jarvis asks for your mood and based on your choice it opens a specific playlist of Spotify that fits your mood. """ import webbrowser from plugin import plugin from plugin import require from colorama import Fore @require(n...
sukeesh/Jarvis
jarviscli/plugins/mood_music.py
mood_music.py
py
3,509
python
en
code
2,765
github-code
36
[ { "api_name": "colorama.Fore.LIGHTCYAN_EX", "line_number": 36, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "line_number": 36, "usage_type": "name" }, { "api_name": "colorama.Fore.CYAN", "line_number": 38, "usage_type": "attribute" }, { "api_name": ...
1576881503
from setuptools import setup, find_packages with open('readme.md', encoding='utf-8') as f: long_description = f.read() setup( packages = find_packages(), name = 'pbat', version = '0.0.16', author = "Stanislav Doronin", author_email = "mugisbrows@gmail.com", url = 'https://github.com/mugise...
mugiseyebrows/pbat
setup.py
setup.py
py
705
python
en
code
0
github-code
36
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 7, "usage_type": "call" } ]
39924563926
from django.db import models from django.utils import timezone from . import Season class SeasonPlayerManager(models.Manager): def update_active(self, player, elo, wins, losses): """Update or create the season player instance for the active season.""" active_season = Season.objects.get_active() ...
dannymilsom/poolbot-server
src/core/models/season_player.py
season_player.py
py
1,847
python
en
code
4
github-code
36
[ { "api_name": "django.db.models.Manager", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.Model", "line_number": 32, "usage_type": "attribute" }, { "api_name...
4635120984
#coding=utf-8 from confluent_kafka import Producer import MySQLdb import json import time import random p = Producer({"bootstrap.servers": "118.24.53.99:9092"}) db = MySQLdb.connect("localhost", "root", "123456", "test_kafka", charset='utf8' ) cursor = db.cursor() sql = "SELECT msg_body FROM order_kafka_msg;" def ...
liu-xiaoran/demo
java/kafka/pd2.py
pd2.py
py
1,018
python
en
code
0
github-code
36
[ { "api_name": "confluent_kafka.Producer", "line_number": 9, "usage_type": "call" }, { "api_name": "MySQLdb.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 32, "usage_type": "call" }, { "api_name": "json.loads", "...
5318351393
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import scipy from scipy.misc import derivative def fn_plot1d(fn, x_min, x_max, filename): num_values = 1000 x = np.linspace(x_min, x_max, num_values) fnv = np.vectorize(fn) y = fnv(x) Xlabel = "X axis" Yl...
CS251-Fall-2020/outlab4-190050013-190070020
task4/task4.py
task4.py
py
2,230
python
en
code
0
github-code
36
[ { "api_name": "numpy.linspace", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.vectorize", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplo...
16551248169
import torch import torch.nn as nn class NegativeLabelLoss(nn.Module): """ https://www.desmos.com/calculator/9oaqcjayrw """ def __init__(self, ignore_index=-100, reduction='mean',alpha=1.0,beta=0.8): super(NegativeLabelLoss, self).__init__() self.softmax = nn.Softmax(dim=1) self...
p208p2002/qgg-utils
qgg_utils/__init__.py
__init__.py
py
897
python
en
code
2
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.Softmax", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn", "line_num...
19262690162
from __future__ import print_function import json import logging import os import datetime import calendar import sys from collections import OrderedDict from pokemongo_bot.base_dir import _base_dir from pokemongo_bot.services.item_recycle_worker import ItemRecycler ''' Helper class for updating/retrieving Inventory ...
PokemonGoF/PokemonGo-Bot
pokemongo_bot/inventory.py
inventory.py
py
53,475
python
en
code
3,815
github-code
36
[ { "api_name": "json.load", "line_number": 43, "usage_type": "call" }, { "api_name": "pokemongo_bot.services.item_recycle_worker.ItemRecycler", "line_number": 227, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 254, "usage_type": "call" }, { "...
13097992788
# !/usr/bin/env python # -*- coding: utf-8 -*- """ @author: lishuang @description: 利用 LSTM 预测股票价格 """ import os from itertools import chain import matplotlib.pyplot as plt import numpy as np import pandas as pd from tensorflow.keras.layers import Dense, Dropout, LSTM from tensorflow.keras.models import load_model, Se...
TatenLee/machine-learning
bi/core/l8/stock_lstm.py
stock_lstm.py
py
4,659
python
en
code
1
github-code
36
[ { "api_name": "pandas.DataFrame", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 51, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 67, "usage_type": "call" }, { "api_name": "numpy.array", "line_nu...
16964477743
from bs4 import BeautifulSoup import re import requests ENROLLMENT_BOUNDS = { 0: [0, 5000], 1: [5000, 15000], 2: [15000, 30000], 3: [30000, 10000000], } def get_college_basic(uni_id_list): where_str = '' order_by_str = 'ORDER BY (CASE' counter = 1 for id in uni_id_list: id_str...
michaelpri10/collegecalculator
query_schools.py
query_schools.py
py
10,807
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 211, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 212, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 216, "usage_type": "call" }, { "api_name": "re.sub", "line_numbe...
34222275021
from django.shortcuts import render, redirect from django.contrib.auth.forms import UserCreationForm, AuthenticationForm from django.contrib.auth import login as auth_login, logout as auth_logout from django.views.decorators.http import require_http_methods from .forms import CustomUserCreationForm @require_http_metho...
kimhyunso/exampleCode
django/ONE_TO_MANY/accounts/views.py
views.py
py
1,375
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.auth.forms.AuthenticationForm", "line_number": 11, "usage_type": "call" }, { "api_name": "django.contrib.auth.login", "line_number": 14, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 16, "usage_type": "call...
39332540750
from django.shortcuts import render from abb.models import visitors from abb.forms import visitorform # Create your views here. def show_data(request): form=visitorform() if request.method=='POST': form=visitorform(request.POST) if form.is_valid(): name=form.cleaned_data['name'] ...
dhokanerahul13/4-11-22
hotel/abb/views.py
views.py
py
610
python
en
code
0
github-code
36
[ { "api_name": "abb.forms.visitorform", "line_number": 8, "usage_type": "call" }, { "api_name": "abb.forms.visitorform", "line_number": 10, "usage_type": "call" }, { "api_name": "abb.models.visitors", "line_number": 15, "usage_type": "call" }, { "api_name": "abb.fo...
17849902067
from scripts.src.common.config import Color, Keywords, Direct, DataType from common_and_plotting_functions.functions import check_and_mkdir_of_direct from scripts.src.common.plotting_functions import multi_row_col_bar_plot from scripts.data.common_functions import common_data_loader from scripts.model.model_loader im...
LocasaleLab/Automated-MFA-2023
scripts/src/experimental_data_analysis/specific_data_model_combination/renal_carcinoma_invivo_infusion.py
renal_carcinoma_invivo_infusion.py
py
21,216
python
en
code
0
github-code
36
[ { "api_name": "scripts.data.common_functions.common_data_loader", "line_number": 12, "usage_type": "call" }, { "api_name": "scripts.src.common.config.DataType.renal_carcinoma", "line_number": 12, "usage_type": "attribute" }, { "api_name": "scripts.src.common.config.DataType", ...
17096720993
# ############################################################################# # 本題參數設定,請勿更改 seed = 0 # 亂數種子數 # ############################################################################# import warnings warnings.filterwarnings('ignore') import numpy as np import pandas as pd evaluation = pd.DataFrame({'Model...
neochen2701/TQCPans
機器學習Python 3答案檔/MLA305.py
MLA305.py
py
5,623
python
en
code
4
github-code
36
[ { "api_name": "warnings.filterwarnings", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.get_du...
16908305317
# import package import os, random, tweepy, time, schedule def job(): folder=r"F:\mat\twitterbot\pics" # Set your folder here, twitter allows .jpg, .jpeg, .png, .gif and mp4 videos to be uploaded as media. # Current limitations as of 18/07/2...
mdsmendes94/twitterdailybot
ttbot.pyw
ttbot.pyw
pyw
1,988
python
en
code
1
github-code
36
[ { "api_name": "random.choice", "line_number": 7, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 7, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 25, "usage_type": "call" }, { "api_name": "tweepy.API", "line_num...
41473256040
from PyQt5.QtWidgets import QLabel, QApplication, QDialog, QGridLayout, QHBoxLayout, QPushButton, QFormLayout, \ QWidget, \ QLineEdit import sys from PyQt5.QtCore import Qt from PyQt5.QtGui import QIcon class calculator_frame(QDialog): def __init__(self): super().__init__() self.shower = Q...
siuwhat/calculator
calculator_frame.py
calculator_frame.py
py
5,213
python
en
code
0
github-code
36
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QLineEdit", "line_number": 12, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 13, "usage_type": "call" }, { "api_name"...
19686841128
from argparse import ArgumentParser import tabulate argparser = ArgumentParser() argparser.add_argument('--device', type=int, required=True, help='id of device to run training on.') argparser.add_argument('--seed', type=int, required=True, help='random seed to use for training.') argparser.add_argument('--dir', type=s...
ChaseDuncan/2dunet
train.py
train.py
py
9,434
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 40, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 41, "usage_type": "call" }, { "api_name": "os.makedirs", "lin...
11677498007
# 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 distributed in the hope that it will be useful, but ...
blender-for-science/blendmsh
__init__.py
__init__.py
py
2,626
python
en
code
28
github-code
36
[ { "api_name": "bpy.utils.register_class", "line_number": 47, "usage_type": "call" }, { "api_name": "preferences.BlendmshPreferences", "line_number": 47, "usage_type": "argument" }, { "api_name": "bpy.utils", "line_number": 47, "usage_type": "attribute" }, { "api_n...
12303872667
from albumentations.augmentations.transforms import Normalize import torch import torchvision import albumentations import albumentations.pytorch from adamp import AdamP import torch.nn as nn from torch.utils.data import Dataset, DataLoader from torchsummary import summary as summary_ from dataset import C...
taeyang916/kaggle_fruits
train.py
train.py
py
2,350
python
en
code
1
github-code
36
[ { "api_name": "torch.cuda.is_available", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 18, "usage_type": "attribute" }, { "api_name": "albumentations.Compose", "line_number": 20, "usage_type": "call" }, { "api_name": "albume...
42493495025
from __future__ import absolute_import, print_function, division import os from string import Template import numpy as np import theano from theano import Apply from theano.tensor import as_tensor_variable from theano.tensor.sort import TopKOp from .basic_ops import (GpuKernelBase, Kernel, infer_context_name, ...
Theano/Theano
theano/gpuarray/sort.py
sort.py
py
12,720
python
en
code
9,807
github-code
36
[ { "api_name": "basic_ops.GpuKernelBase", "line_number": 26, "usage_type": "name" }, { "api_name": "theano.tensor.sort.TopKOp", "line_number": 26, "usage_type": "name" }, { "api_name": "theano.tensor.sort.TopKOp.__props__", "line_number": 33, "usage_type": "attribute" },...
2364287539
from PyQt5 import QtWidgets, uic,QtSql,QtCore from rajon_1 import Ui_Dialog import sqlite3 as sql from vypocet import vypocty from data import Databaze from PyQt5.QtWidgets import QFileDialog from cesta import path import math class Rajon(QtWidgets.QDialog,Ui_Dialog): def __init__(self,cesta_projektu): su...
ctu-yobp/2020-a
app/rajon_2.py
rajon_2.py
py
4,041
python
en
code
0
github-code
36
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 10, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 10, "usage_type": "name" }, { "api_name": "rajon_1.Ui_Dialog", "line_number": 10, "usage_type": "name" }, { "api_name": "data.D...
33390403216
from django.shortcuts import redirect, render from animalprofile.models import Animal, Kind from userprofile.models import UserAccount from .forms import SearchAnimalsForm def index(request): if request.method == 'POST': form = SearchAnimalsForm(request.POST) if form.is_valid(): try: ...
manulovich/zoo-friend
zoofriends/animalprofiles/views.py
views.py
py
1,839
python
en
code
0
github-code
36
[ { "api_name": "forms.SearchAnimalsForm", "line_number": 8, "usage_type": "call" }, { "api_name": "animalprofile.models.Animal.objects.filter", "line_number": 23, "usage_type": "call" }, { "api_name": "animalprofile.models.Animal.objects", "line_number": 23, "usage_type": ...
17079399924
from operator import itemgetter from typing import Dict, Iterable, List, Optional, Tuple import typer from lib.legiscan import BillDescriptor, download_and_extract from lib.util import load_json def wrangle_metadata(metadata: Dict) -> Tuple[BillDescriptor, Optional[str]]: """Get the stuff from a metadata blob th...
amy-langley/tracking-trans-hate-bills
lib/tasks/legiscan/retrieve_legislation.py
retrieve_legislation.py
py
1,373
python
en
code
2
github-code
36
[ { "api_name": "typing.Dict", "line_number": 9, "usage_type": "name" }, { "api_name": "lib.legiscan.BillDescriptor", "line_number": 11, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 11, "usage_type": "call" }, { "api_name": "typing.Tup...
8567322626
# coding: utf-8 #from PyInstaller.utils.hooks import copy_metadata, collect_data_files #datas = copy_metadata('google-api-python-client') #datas += collect_data_files('googleapiclient.discovery') #datas += collect_data_files('PyInstaller.utils.hooks') import os, sys, re import pandas as PD from datetime impo...
jameswhc/QUA
QUA_Classify.py
QUA_Classify.py
py
19,830
python
en
code
0
github-code
36
[ { "api_name": "re.compile", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 25, "usage_type": "name" }, { "api_name": "datetime.date...
17778652132
from PyQt4.QtGui import * from PyQt4.QtCore import * import matplotlib.pyplot as plt import matplotlib.backends.backend_qt4agg import ReportDBOps as db class ReportLogs(QWidget): def __init__(self): super(ReportLogs, self).__init__() # Main Layout self.mainGridLayout = QGridLayout() ...
subhamoykarmakar224/WindowsThreatAttackAnalyzer
ReportLogs.py
ReportLogs.py
py
2,477
python
en
code
0
github-code
36
[ { "api_name": "ReportDBOps.getUniqueReports", "line_number": 45, "usage_type": "call" }, { "api_name": "ReportDBOps.getReportCounts", "line_number": 54, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot2grid", "line_number": 56, "usage_type": "call" }, ...
7114744218
import numpy as np import pandas as pd from sklearn.preprocessing import Imputer import keras from keras.utils import np_utils # Veri dosya üzerinden okunur. data = pd.read_csv('spambase.data') # PART 1 - DATAPREPROCESSING # Okunan veri girdi ve çıktı olarak ayrıştırılır. input_datas = np.array(data.iloc[:,:57]) out...
zekikus/Yapay-Sinir-Agi-Uygulamalari
SpamBase_ANN/SpamBase_ANN.py
SpamBase_ANN.py
py
3,448
python
tr
code
8
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_...
18647131917
from django.http import HttpResponse from django.template import RequestContext from taikoexplorer_db.models import Video, Composer, Song, Group, SongStyle, ComposerSong, VideoSong, VideoGroup from django.core import serializers from django.forms.models import model_to_dict from django.db.models import Count import yo...
mitchfuku/taikoexplorer
taikoexplorer/data.py
data.py
py
12,403
python
en
code
1
github-code
36
[ { "api_name": "json.loads", "line_number": 25, "usage_type": "call" }, { "api_name": "taikoexplorer_db.models.Video.objects.get_or_create", "line_number": 31, "usage_type": "call" }, { "api_name": "taikoexplorer_db.models.Video.objects", "line_number": 31, "usage_type": "...
9195540013
import argparse import pickle import lmdb import torch from tqdm import tqdm from torch.utils.data import DataLoader from vq_text_gan.datasets import BPEDataset from vq_text_gan.utils import get_default_device def extract_codes(args): device = get_default_device(args.device) print('Loading model') mode...
kklemon/text-gan-experiments
legacy/vq_text_gan/extract_latents.py
extract_latents.py
py
1,643
python
en
code
0
github-code
36
[ { "api_name": "vq_text_gan.utils.get_default_device", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 17, "usage_type": "call" }, { "api_name": "vq_text_gan.datasets.BPEDataset", "line_number": 20, "usage_type": "call" }, { "a...
8435375603
from aiogram import types, Dispatcher from config import bot, dp, ADMINS import random async def game(message: types.Message): if message.text.startswith('game') and message.from_user.id in ADMINS: list_emoji = ['⚽', '🏀', '🎰', '🎳', '🎯', '🎲'] emoji_random = random.choice(list_emoji) awa...
kasi170703/bots
handlers/admin.py
admin.py
py
577
python
en
code
0
github-code
36
[ { "api_name": "aiogram.types.Message", "line_number": 5, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 5, "usage_type": "name" }, { "api_name": "config.ADMINS", "line_number": 6, "usage_type": "name" }, { "api_name": "random.choice", ...
24398919509
import requests from bs4 import BeautifulSoup import config ## setup url = 'https://eu4.paradoxwikis.com/Achievements' page = requests.get(url) soup = BeautifulSoup(page.content, 'html.parser') table = soup.find('table') def scrape(): table_dict = {} headers = config.headers url = 'https://e...
CarsenKennedy/EU4-flask-api
webscraper.py
webscraper.py
py
1,608
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 8, "usage_type": "call" }, { "api_name": "config.headers", "line_number": 13, "usage_type": "attribute" }, { "api_name": "requests.get", "...
72488882665
from rest_framework import viewsets, views from ..models import * from .serializers import * from rest_framework.permissions import * from rest_framework.response import Response from rest_framework.exceptions import NotFound, ValidationError from rest_framework import mixins from .custom_mixins import CreateListModelM...
artgas1/dlab_django
lab/lab_web/views/api.py
api.py
py
18,206
python
en
code
1
github-code
36
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 31, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 31, "usage_type": "name" }, { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 45, "usage_type":...
42932594486
import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Output, Input import dash_bootstrap_components as dbc import pandas as pd import plotly.express as px from plotly.graph_objs import * def run_dash(bales_graph_file_path, pie_chart_file_path, bar_...
Tijzz/ComptencyAnalysisTool
Dash.py
Dash.py
py
6,994
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
44007402888
from django.urls import path from .views import ( BasicInfoView, ContactFormView, FindProviderMedicationView, GetFormOptionsView, ) public_api_urlpatterns = [ path( 'options/', GetFormOptionsView.as_view(), ), path( 'find_providers/', FindPro...
ninjadevtrack/medifiner-api
public/api_urls_v1.py
api_urls_v1.py
py
521
python
en
code
1
github-code
36
[ { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "views.GetFormOptionsView.as_view", "line_number": 13, "usage_type": "call" }, { "api_name": "views.GetFormOptionsView", "line_number": 13, "usage_type": "name" }, { "api_na...
28145554362
from flask import Flask, request, jsonify from urllib.request import urlopen import json app = Flask(__name__, static_folder='static') @app.route('/') def index(): return app.send_static_file('index.html') @app.route('/api/submit', methods=['POST']) def submit(): data = request.get_json() message = data....
coconnor07/WebsiteTest
__main__.py
__main__.py
py
1,807
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.jsonify", "...
23452187462
# coding=utf-8 import datetime from OnlineClassroom.app.ext.plugins import db from .curriculums import * from .account import * from .catalog import * """ 购买记录 CREATE TABLE `shopping_carts` ( `aid` int DEFAULT NULL COMMENT '外键 用户id', `cid` int DEFAULT NULL COMMENT '外键 课程id', `number` int DEFAULT '1' COMMENT '课程...
z1421012325/flask_online_classroom
app/models/shopping_carts.py
shopping_carts.py
py
5,125
python
en
code
0
github-code
36
[ { "api_name": "OnlineClassroom.app.ext.plugins.db.Model", "line_number": 25, "usage_type": "attribute" }, { "api_name": "OnlineClassroom.app.ext.plugins.db", "line_number": 25, "usage_type": "name" }, { "api_name": "OnlineClassroom.app.ext.plugins.db.Column", "line_number": 2...
5023782942
# -*- coding: utf-8 -*- import os import shutil import torch # from torch.utils.data import * from torch.utils import data from imutils import paths import numpy as np import random from PIL import Image from torchvision.transforms import transforms import cv2 def cv_imread(path): img = cv2.imdecode(...
stlyl/crack_detection
crack_detection_python/crack_dataset.py
crack_dataset.py
py
2,601
python
en
code
2
github-code
36
[ { "api_name": "cv2.imdecode", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cv2.imencode", "line...
7582763868
import urllib.request, urllib.parse, urllib.error import twurl import json import ssl # https://apps.twitter.com/ # Create App and get the four strings, put them in hidden.py TWITTER_URL = 'https://api.twitter.com/1.1/friends/list.json' # Ignore SSL certificate errors ctx = ssl.create_default_context() ctx.check_hos...
soliashuptar/LAB3
twitter2.py
twitter2.py
py
1,574
python
en
code
0
github-code
36
[ { "api_name": "ssl.create_default_context", "line_number": 12, "usage_type": "call" }, { "api_name": "ssl.CERT_NONE", "line_number": 14, "usage_type": "attribute" }, { "api_name": "twurl.augment", "line_number": 23, "usage_type": "call" }, { "api_name": "urllib.re...
27819397243
import networkx as nx import numpy as np from params import args class JobDAG(object): def __init__(self, nodes, adj_mat, name): # nodes: list of N nodes # adj_mat: N by N 0-1 adjacency matrix, e_ij = 1 -> edge from i to j assert len(nodes) == adj_mat.shape[0] assert adj_mat.shap...
SpeedSchedulerProject/MDPA
spark_env/job_dag.py
job_dag.py
py
3,725
python
en
code
0
github-code
36
[ { "api_name": "numpy.inf", "line_number": 48, "usage_type": "attribute" }, { "api_name": "params.args.executor_data_point", "line_number": 62, "usage_type": "attribute" }, { "api_name": "params.args", "line_number": 62, "usage_type": "name" }, { "api_name": "param...
20371505372
import tensorflow as tf gpus = tf.config.list_physical_devices('GPU') if gpus: tf.config.set_logical_device_configuration(gpus[0], [tf.config.LogicalDeviceConfiguration(memory_limit=5292)]) import keras import matplotlib.pyplot as plt import numpy as np from keras import layers, optimizers, losses, metrics, Model...
Logann120/Logann120.github.io
img_gen/python_code/img_gen.py
img_gen.py
py
7,935
python
en
code
0
github-code
36
[ { "api_name": "tensorflow.config.list_physical_devices", "line_number": 2, "usage_type": "call" }, { "api_name": "tensorflow.config", "line_number": 2, "usage_type": "attribute" }, { "api_name": "tensorflow.config.set_logical_device_configuration", "line_number": 4, "usag...
24916190530
#encoding:utf-8 import os import requests class MyRequests(): def get_url(self, url, headers): re = self.request(url, headers) return re def request(self, url, headers): re = requests.get(url, headers=headers) return re def main(): url = "https://www.baidu.com" he...
fanpengcs/python
my_requests.py
my_requests.py
py
1,750
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" } ]
36901679046
import logging from math import sqrt from typing import Optional import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import torch from tqdm import trange from ..common import HistoricalData, get_device from ..exceptions import SimulationException from . import Simulations log...
ethanlee928/pyfmc
pyfmc/simulations/gbm.py
gbm.py
py
5,015
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 20, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 28, "usage_type": "call" }, { "api_name": "matplo...
41550884221
import math import warnings from typing import Sequence import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torchmetrics.functional import pairwise_cosine_similarity from mmcv.cnn import (build_activation_layer, build_conv_layer, build_norm_layer, xavier_ini...
parkyongjun1/rotated_deformabledetr
AO2-DETR/mmrotate/models/utils/rotated_transformer.py
rotated_transformer.py
py
59,187
python
en
code
0
github-code
36
[ { "api_name": "warnings.warn", "line_number": 33, "usage_type": "call" }, { "api_name": "torch.autograd.set_detect_anomaly", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.autograd", "line_number": 37, "usage_type": "attribute" }, { "api_name": "f...
6797208641
# app imports import random from django.utils.translation import ugettext_lazy as _ from django.conf import settings from utils.faker_factory import faker from ..mails import BaseMailView class InvitationConsultantProjectMailView(BaseMailView): template_name = 'mails/invitation_consultant_project.html' man...
tomasgarzon/exo-services
service-exo-mail/mail/mailviews/invitation_consultant_project.py
invitation_consultant_project.py
py
1,281
python
en
code
0
github-code
36
[ { "api_name": "mails.BaseMailView", "line_number": 12, "usage_type": "name" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 19, "usage_type": "call" }, { "api_name": "django.conf.settings.BRAND_NAME", "line_number": 19, "usage_type": "attribute" ...
35512038562
import json import shutil import unittest from src import SDF3dData, train_sdf from src.train_utils import * class SDFTrainTest(unittest.TestCase): @staticmethod def get_abs_path(): path = os.path.abspath(__file__) parent_dir = os.path.split(path)[0] return parent_dir def get_data...
amaleki2/graph_sdf
test/test_train.py
test_train.py
py
2,349
python
en
code
2
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 19, "usage_type": "call" }, { "api_name": "src.SDF3dData", "line_number": 21, "usage_type": "call" }, { "api_name": "json.load", "line_n...
33215612402
import os import torch import cflearn import numpy as np # for reproduction np.random.seed(142857) torch.manual_seed(142857) # preparation data_config = {"label_name": "Survived"} file_folder = os.path.dirname(__file__) train_file = os.path.join(file_folder, "train.csv") test_file = os.path.join(file_folder, "test.c...
TrendingTechnology/carefree-learn
examples/titanic/titanic.py
titanic.py
py
1,421
python
en
code
null
github-code
36
[ { "api_name": "numpy.random.seed", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.dirname", ...
74840516263
import glob import os, shutil import numpy as np import xml.etree.ElementTree as ET from skimage import io, transform from PIL import Image import cv2 class BatchPcik(): ''' 批量判断图片维度,并挑出不符合的文件至error文件夹 !!!error文件夹如果没有可以新建功能!!! ''' def __init__(self): self.imgdir_path = "F:/Fruit_dataset/...
CGump/dataset-tools
pick_img.py
pick_img.py
py
11,355
python
en
code
0
github-code
36
[ { "api_name": "os.listdir", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": ...
14381362201
# 1099 from typing import List def twoSumLessThanK(nums: List[int], k: int) -> int: nums = sorted(nums) ans = -1 i = 0 j = len(nums) - 1 while i < j: if nums[i] + nums[j] >= k: j -= 1 else: ans = max(ans, nums[i] + nums[j]) ...
jithindmathew/LeetCode
two-sum-less-than-k.py
two-sum-less-than-k.py
py
455
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
13998551053
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import unittest from os import path, listdir, curdir, remove import uproot as ur from astropy.io import fits from km3net_testdata import data_path from km3irf import build_irf class TestBuild_IRF(unittest.TestCase): def setUp(self): self.testdata = data_path...
KM3NeT/km3irf
tests/test_main.py
test_main.py
py
2,400
python
en
code
0
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 12, "usage_type": "attribute" }, { "api_name": "km3net_testdata.data_path", "line_number": 14, "usage_type": "call" }, { "api_name": "km3irf.build_irf.DataContainer", "line_number": 15, "usage_type": "call" }, { "a...
24369652375
from django.shortcuts import render, HttpResponseRedirect from django.contrib.auth import login, authenticate from .forms import SignUpForm, LoginForm, PostForm from django.contrib.auth import authenticate, login, logout from .models import Post # Create your views here. def Home(request): return render(request,...
SurajLodh/TaskProduct
User/views.py
views.py
py
2,617
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "forms.SignUpForm", "line_number": 16, "usage_type": "call" }, { "api_name": "django.shortcuts.HttpResponseRedirect", "line_number": 19, "usage_type": "call" }, { "ap...
2014305094
import speech_recognition as sr import pyttsx3 def SpeakText(command): engine = pyttsx3.init() engine.say(command) engine.runAndWait() def CollectText(x, gram): recognizer = sr.Recognizer() microphone = sr.Microphone() with microphone as source: recognizer.adjust_for_ambient_noise(sour...
Dorito-Dog/Python_Ktane_Bot
solvers/solverSpeech.py
solverSpeech.py
py
488
python
en
code
0
github-code
36
[ { "api_name": "pyttsx3.init", "line_number": 5, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 10, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 11, "usage_type": "call" } ]
43844905296
import argparse from dataclasses import dataclass from decimal import * import re import sys from typing import Dict, List int_re = re.compile('[-+]?[0-9]+') float_re = re.compile('[-+]?[0-9]+(\.[0-9]+)?') def extract_int(l: str) -> (int, str): m = int_re.match(l) assert m s = m.group() return int(...
brouhaha/gridcheck
gridcheck.py
gridcheck.py
py
4,133
python
en
code
0
github-code
36
[ { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 11, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 28, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", ...
20515420312
import os import PyPDF2 import openai from flask import Flask, redirect, render_template, request, url_for app = Flask(__name__) # Set your API key directly os.environ["OPENAI_API_KEY"] = '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' openai.api_key = os.getenv("OPENAI_API_KEY") @app.route("/", methods=["GET"...
OUABSL/Congreso
app.py
app.py
py
1,642
python
es
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "openai.api_key", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_n...
8445360878
import operator import warnings import numpy try: import scipy.sparse _scipy_available = True except ImportError: _scipy_available = False import cupy from cupy._core import _accelerator from cupy.cuda import cub from cupy.cuda import runtime from cupyx.scipy.sparse import _base from cupyx.scipy.sparse i...
cupy/cupy
cupyx/scipy/sparse/_csr.py
_csr.py
py
42,419
python
en
code
7,341
github-code
36
[ { "api_name": "cupyx.scipy.sparse._compressed._compressed_sparse_matrix", "line_number": 23, "usage_type": "attribute" }, { "api_name": "cupyx.scipy.sparse._compressed", "line_number": 23, "usage_type": "name" }, { "api_name": "scipy.sparse.sparse.csr_matrix", "line_number": ...
73491948585
# -*- coding: utf-8 -*- from __future__ import unicode_literals from utils.models import BaseModel, models from utils import constants as Constants, get_choices, get_kyc_upload_path from django.contrib.contenttypes.models import ContentType from django.db.models.signals import post_save from django.utils.timezone imp...
anjali-rao/backend-app-1
crm/models.py
models.py
py
8,059
python
en
code
0
github-code
36
[ { "api_name": "utils.models.BaseModel", "line_number": 14, "usage_type": "name" }, { "api_name": "utils.models.models.ForeignKey", "line_number": 15, "usage_type": "call" }, { "api_name": "utils.models.models", "line_number": 15, "usage_type": "name" }, { "api_nam...
35420476348
from PIL import Image import numpy as np import matplotlib.pyplot as plt path_gotowe = "kolos_1/obrazy/" path = "kolos_1/" def szary(w, h): t = (h, w) tab = np.zeros(t, dtype=np.uint8) for i in range(0, h, 1): for j in range(0, w, 1): tab[i, j] = (i + 3*j) % 256 return tab obraz...
AdrianAlbrecht/WdGM
kolos_1/zad7.py
zad7.py
py
910
python
en
code
0
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 11, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image", "line_num...
38875856666
import sys sys.path.append('.') from contextlib import contextmanager import time import torch import graphnet as GNN num_iters = 100000 NN = 128*1024 D = 128 DT = torch.float16 dev = torch.device('cuda:0') is_cuda = dev.type == 'cuda' #net = GNN.Mlp(3 * D, [D, D, D], layernorm=False).to(DT).to(dev) net = torch....
medav/meshgraphnets-torch
test/test_torch_mlp.py
test_torch_mlp.py
py
555
python
en
code
6
github-code
36
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "torch.float16", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.device", "li...
4511356839
import openpyxl from collections import Counter from difflib import SequenceMatcher from collections import OrderedDict import time import numpy import sys path = "F:\\Book1.xlsx" wb_obj = openpyxl.load_workbook(path) sheet_base = wb_obj.worksheets[0] sheet_area_1 = wb_obj.worksheets[1] sheet_area_2 = wb_obj.workshe...
ChinhTheHugger/vscode_python
excel.py
excel.py
py
1,448
python
en
code
0
github-code
36
[ { "api_name": "openpyxl.load_workbook", "line_number": 12, "usage_type": "call" }, { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 18, "usage_type": "call" }, { "api_name": "time.gmtime", "lin...
19417305890
import requests class Player: def __init__(self, dict): self.name = dict['name'] self.nationality = dict['nationality'] self.team = dict['team'] self.goals = dict['goals'] self.assists = dict['assists'] self.points = self.goals + self.assists def __str__(self):...
alannesanni/palautusrepositorio
viikko2/nhl-reader/src/player.py
player.py
py
1,119
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" } ]
30781006442
# -*- coding: utf-8 -*- import oss2 from oss2.credentials import EnvironmentVariableCredentialsProvider import os # 这里填写你的 OSS_ACCESS_KEY_ID 和 OSS_ACCESS_KEY_SECRET os.environ['OSS_ACCESS_KEY_ID'] = '' os.environ['OSS_ACCESS_KEY_SECRET'] = '' auth = oss2.ProviderAuth(EnvironmentVariableCredentialsProvider()) # 这里改成你...
source-dream/AliyunOSS-DownloadTool
main.py
main.py
py
1,190
python
zh
code
0
github-code
36
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "oss2.ProviderAuth", "line_number": 11, "usage_type": "call" }, { "api_name": "oss2.credentials.Envi...
73744223785
# -*- coding: utf-8 -*- from __future__ import print_function import os import logging BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) VERSION = "1.0" # Application definition INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', '...
lingdb/CoBL-public
ielex/settings.py
settings.py
py
5,555
python
en
code
3
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
38875732926
import torch import torch.nn as nn from torch.utils.cpp_extension import load import os import time import random import math cur_path = os.path.dirname(os.path.realpath(__file__)) if torch.cuda.is_available(): scatter_concat_cuda = load('scatter_concat_cuda', [f'{cur_path}/scatter_concat.cu'], ex...
medav/meshgraphnets-torch
kernels/scatter_concat/kernel.py
kernel.py
py
1,699
python
en
code
6
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda.is_available...
43082790642
import numpy as np from matplotlib import pyplot as plt def smooth(data, box_pts): box = np.ones(box_pts)/box_pts data_smooth = np.convolve(data, box, mode='same') return data_smooth filename = 'limited' ignore_lines = True x_min = np.inf x_max = -np.inf y_min = np.inf y_max = -np.inf z_min =...
dlech97/master-thesis
process_log.py
process_log.py
py
3,749
python
en
code
0
github-code
36
[ { "api_name": "numpy.ones", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.convolve", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.inf", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.inf", "line_number":...
11841445530
import torch from torch import nn from spdnet.spd import Normalize class GBMS_RNN(nn.Module): def __init__(self, bandwidth=0.1, normalize=True): super(GBMS_RNN, self).__init__() self.bandwidth = nn.Parameter(torch.tensor(bandwidth)) self.normalize = None if normalize: ...
Dandy5721/CPD-Net
MICCAI-2021/mean_shift/mean_shift.py
mean_shift.py
py
1,419
python
en
code
1
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": "torch.nn.Parameter", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
17930873755
#!/usr/bin/python import os import sys myPath = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.dirname(myPath)) import pytest import src.pre_commit as pre_commit import subprocess from mock import patch commit_is_ready_params = [ (["test/foo.py"], []), (["test/clean.c"], []), ("...
aws/amazon-freertos
tools/git/hooks/test/test_pre_commit.py
test_pre_commit.py
py
5,105
python
en
code
2,543
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.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path.insert", "line...
22805925879
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") # Create a custom App config app_config = fo.AppConfig() app_config.show_confidence = True app_config.show_attributes = True session = fo.launch_app(dataset, config=app_config, port=5151) session.wait()
patharanordev/ds51vis
sample.py
sample.py
py
300
python
en
code
0
github-code
36
[ { "api_name": "fiftyone.zoo.load_zoo_dataset", "line_number": 4, "usage_type": "call" }, { "api_name": "fiftyone.zoo", "line_number": 4, "usage_type": "name" }, { "api_name": "fiftyone.AppConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "fiftyone.l...
10759107890
import unittest import sys import time sys.path.append("..") from deltarest import DeltaRESTAdapter, DeltaRESTService from pyspark.sql import SparkSession class Test(unittest.TestCase): root_dir: str = f"/tmp/delta_rest_test_{int(time.time())}" spark: SparkSession = None dra: DeltaRESTAdapter @...
bonnal-enzo/delta-rest
test/test.py
test.py
py
3,975
python
en
code
0
github-code
36
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "time.time", "l...
31071015439
from core_algo.SGA import SGA import alarm import sys import json import time from tabulate import tabulate def average_res(ga, cal_times=100, **params): cost_sum = 0 runtime_sum = 0 gen_sum = 0 speed_sum = 0 for _ in range(cal_times): # solve the question res, runtime, last_gen =...
UTP-project/core-algo
exp_compare.py
exp_compare.py
py
7,044
python
en
code
0
github-code
36
[ { "api_name": "tabulate.tabulate", "line_number": 36, "usage_type": "call" }, { "api_name": "json.load", "line_number": 49, "usage_type": "call" }, { "api_name": "time.time", "line_number": 55, "usage_type": "call" }, { "api_name": "core_algo.SGA.SGA", "line_n...
8272041392
""" Test the OOD DiscDist2 scorer. It disentangle the feature into discriminative space and the residual space """ import pdb import numpy as np import matplotlib.pyplot as plt import os import argparse import torch from tqdm import tqdm import torch.backends.cudnn as cudnn from ood_scores.get_scorers ...
ivalab/WDiscOOD
test_feat_disc.py
test_feat_disc.py
py
5,166
python
en
code
4
github-code
36
[ { "api_name": "numpy.random.seed", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 23, "usage_type": "attribute" }, { "api_name": "utils.argparser.OODArgs", "line_number": 28, "usage_type": "call" }, { "api_name": "ood_score...
25969718175
# -*- coding: utf-8 -*- from django.http import HttpResponse from django.template import RequestContext, Template from django.views.decorators.csrf import csrf_exempt from django.utils.encoding import smart_str, smart_unicode import xml.etree.ElementTree as ET import urllib, urllib2, time, hashlib @csrf_exempt def ...
wqh872081365/weixin0324
weixin0324/views1.py
views1.py
py
2,306
python
en
code
0
github-code
36
[ { "api_name": "django.http.HttpResponse", "line_number": 15, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 18, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 21, "usage_type": "call" }, { "api_na...
22355151722
# coding: utf-8 import tkinter as tk from tkinter import messagebox, filedialog import os from PIL import Image, ImageTk from detector import PlateDetector from util import resized_size class LPRGUI: max_image_width = 600 max_image_height = 600 def __init__(self): self.detector = PlateDetector(...
QQQQQby/Car-Plate-Recognition
start_gui.py
start_gui.py
py
3,908
python
en
code
1
github-code
36
[ { "api_name": "detector.PlateDetector", "line_number": 17, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 20, "usage_type": "call" }, { "api_name": "tkinter.StringVar", "line_number": 25, "usage_type": "call" }, { "api_name": "tkinter.Canvas", ...
506681210
""" Resample Raster Files """ def match_cellsize_and_clip(rstBands, refRaster, outFolder, clipgeo=None, isint=None, ws=None): """ Resample images to make them with the same resolution and clip Good to resample Sentinel bands with more than 10 meters. Dependencies:...
jasp382/glass
glass/rst/rmp.py
rmp.py
py
4,165
python
en
code
2
github-code
36
[ { "api_name": "os.path.exists", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "glass.pys.oss.mkdir", "line_number": 27, "usage_type": "call" }, { "api_name": "glass.prop.prj.rst_ep...
24985603198
import pygame from settings import BOSSTELEPORTINGSOUND, ENEMYHITSOUND, importFolder, bossPositions from random import randint from os import path class Boss(pygame.sprite.Sprite): def __init__(self, pos, surface, level): super().__init__() #animation self.displaySurface = surface s...
Maltoros/Project-Pygame
boss.py
boss.py
py
8,327
python
en
code
0
github-code
36
[ { "api_name": "pygame.sprite", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.Rect", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.time.get_ticks", "line_number": 20, "usage_type": "call" }, { "api_name": "pygame.time", ...
37326026549
from zipline.pipeline.factors import CustomFactor from zipline.pipeline.data import USEquityPricing import numpy as np import warnings def recurs_sum(arr): arr_sum = np.zeros(arr.shape) arr_sum[0] = arr[0] for i in range(1, len(arr)): arr_sum[i] = arr_sum[i-1]+arr[i] return arr_sum class A...
ahmad-emanuel/quant_trading_system
Indicators/chaikin_oscilator.py
chaikin_oscilator.py
py
1,745
python
en
code
1
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "zipline.pipeline.factors.CustomFactor", "line_number": 17, "usage_type": "name" }, { "api_name": "zipline.pipeline.data.USEquityPricing.close", "line_number": 29, "usage_type": "attribut...
40926602467
from discord.ext.commands import bot, has_permissions import discord.ext from discord.ext import commands from config import * import asyncio import random # noinspection PyPackageRequirements intents = discord.Intents.default() intents.message_content = True bot = commands.Bot(command_prefix=PREFIX, intents=intents, ...
Juilfsjc/SeniorDesign
main.py
main.py
py
16,345
python
en
code
0
github-code
36
[ { "api_name": "discord.ext.commands.Intents.default", "line_number": 9, "usage_type": "call" }, { "api_name": "discord.ext.commands.Intents", "line_number": 9, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 9, "usage_type": "name" }, ...
18252823651
import bisect from typing import List class Solution: def maxEnvelopes(self, envelopes: List[List[int]]) -> int: items = sorted(envelopes, key=lambda x: (x[0], -x[1])) piles = [] for item in items: v = item[1] i = bisect.bisect_left(piles, v) if i == len...
hujienan/Jet-Algorithm
leetcode/354. Russian Doll Envelopes/index.py
index.py
py
554
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "bisect.bisect_left", "line_number": 11, "usage_type": "call" } ]
10840945598
import os import requests from bs4 import BeautifulSoup #os.system("clear") def crawl(): url = "https://www.iban.com/currency-codes" iban_result = requests.get(url) iban_soup = BeautifulSoup(iban_result.text, "html.parser") table = iban_soup.find("table", {"class": "table table-bordered downloads t...
cheonjiwan/python_challenge
assignment/Day5.py
Day5.py
py
1,568
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" } ]
15744786007
import errno import filecmp import glob import os import platform import random import re import shutil import stat import subprocess import sys import tarfile import tempfile import time from typing import List, NamedTuple import urllib.parse from color import Coloring from error import DownloadError from error impor...
GerritCodeReview/git-repo
project.py
project.py
py
160,523
python
en
code
267
github-code
36
[ { "api_name": "repo_logging.RepoLogger", "line_number": 49, "usage_type": "call" }, { "api_name": "typing.NamedTuple", "line_number": 52, "usage_type": "name" }, { "api_name": "error.RepoError", "line_number": 66, "usage_type": "name" }, { "api_name": "error.RepoE...
40174507966
# 访问链接 import requests # 进度条 from tqdm import tqdm # 定义一个类来构造方法 class Music: def __init__(self): """ 通过用户输入的歌曲名搜索对应的音乐列表 :return: 歌曲列表链接 """ a = input('请输入想要下载的歌曲名称:') __url = f'http://www.kuwo.cn/api/www/search/searchMusicBykeyWord?key={a}&pn=1&rn=20&http...
UIGNB123/kuwo
面向对象式酷我音乐爬虫,引入init方法和私有方法.py
面向对象式酷我音乐爬虫,引入init方法和私有方法.py
py
3,171
python
zh
code
1
github-code
36
[ { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 51, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 54, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number":...
31772755575
# coding=utf-8 import os import logging from bs4 import UnicodeDammit from subliminal.api import io, defaultdict from subliminal_patch.patch_provider_pool import PatchedProviderPool logger = logging.getLogger(__name__) def download_subtitles(subtitles, **kwargs): """Download :attr:`~subliminal.subtitl...
luboslavgerliczy/SubZero
Contents/Libraries/Shared/subliminal_patch/patch_api.py
patch_api.py
py
5,965
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "subliminal_patch.patch_provider_pool.PatchedProviderPool", "line_number": 20, "usage_type": "call" }, { "api_name": "subliminal.api.defaultdict", "line_number": 41, "usage_type": "...
69815035624
import os from pyspark.sql import DataFrame from pyspark.sql import types as t, functions as f from pyspark.sql import SparkSession from consts import COVID_DATE_FORMAT def get_dataframe(name: str, session: SparkSession, cols: list[str], type_mapping: dict, date_format: str = COV...
volodymyrkir/pyspark_ml
utils.py
utils.py
py
2,410
python
en
code
0
github-code
36
[ { "api_name": "pyspark.sql.SparkSession", "line_number": 10, "usage_type": "name" }, { "api_name": "consts.COVID_DATE_FORMAT", "line_number": 12, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.pat...
36867704347
import spacy nlp = spacy.load('en_core_web_md') ############ word1 = nlp("cat") word2 = nlp("monkey") word3 = nlp("banana") print(word1.similarity(word2)) print(word3.similarity(word2)) print(word3.similarity(word1)) ############# tokens = nlp('cat apple monkey banana') for token1 in tokens: for token2 in toke...
rauldesor/T38
semantic.py
semantic.py
py
1,163
python
en
code
0
github-code
36
[ { "api_name": "spacy.load", "line_number": 2, "usage_type": "call" } ]
17190663769
import PySimpleGUI as sg class GameGui: def __init__(self, box_size=15, title = 'Japanese Crossword Puzzle!', puzzle_size=500, coor_sys_height=130 ): self.box_size = box_size self.rows = 8 self....
chengcj-upenn/jp_crossword_puzzle
frontend.py
frontend.py
py
7,549
python
en
code
0
github-code
36
[ { "api_name": "PySimpleGUI.theme", "line_number": 13, "usage_type": "call" }, { "api_name": "PySimpleGUI.Text", "line_number": 16, "usage_type": "call" }, { "api_name": "PySimpleGUI.Graph", "line_number": 17, "usage_type": "call" }, { "api_name": "PySimpleGUI.Text...