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
3734279867
from __future__ import annotations from dataclasses import dataclass from typing import Any import docker @dataclass class PythonCommand: """Represents a python command. Parameters ---------- script : name Python script to invocate. args : dict Python scripts arguments. na...
anyForecast/anyforecast
anyforecast/deployments/docker_utils.py
docker_utils.py
py
4,577
python
en
code
0
github-code
18
[ { "api_name": "dataclasses.dataclass", "line_number": 9, "usage_type": "name" }, { "api_name": "docker.from_env", "line_number": 85, "usage_type": "call" }, { "api_name": "docker.models", "line_number": 87, "usage_type": "attribute" }, { "api_name": "typing.Any", ...
1396699454
from datetime import datetime, timedelta def add_working_days(start_date: datetime, n_days: int) -> datetime: """Calculate date in `n_days` working days Function to calculate the date in n working days, excluding weekends Parameters ---------- start_date : datetime date to add days to ...
UMCU-Digital-Health/No_Show
src/noshow/preprocessing/utils.py
utils.py
py
638
python
en
code
3
github-code
18
[ { "api_name": "datetime.datetime", "line_number": 4, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 23, "usage_type": "call" } ]
73607918439
import sys from PyQt5.QtWidgets import (QApplication, QWidget, QHBoxLayout, QVBoxLayout, QFrame, QFormLayout, QPushButton, QTabWidget, QGroupBox, QLineEdit, QTextEdit, QLabel, QScrollArea, QInputDialog, ...
clolsonus/madesigner
madesigner/madgui/sheet_ui.py
sheet_ui.py
py
5,247
python
en
code
18
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QFrame", "line_number": 48, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QVBoxLayout", "line_number": 49, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QFrame", "line_number": 52, "usage_type": "call" }, { "api_nam...
17592568164
import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go import pandas as pd app = dash.Dash() df = pd.read_csv( 'log.csv', header=None) rows_global=len(df); #available_indicators = df['Indicator Name'].unique() app.layout = html.Div([ dcc.Dropdo...
gaurav-bansal/spartan
app.py
app.py
py
1,697
python
en
code
0
github-code
18
[ { "api_name": "dash.Dash", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "dash_html_components.Div", "line_number": 15, "usage_type": "call" }, { "api_name": "dash_core_components...
25354366621
from __future__ import print_function import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.optim.lr_scheduler import StepLR import numpy as np import os import cv2 #from utils import preprocess,load_dataset from torch.utils.data import TensorDataset, ...
burrussmp/Dermatoscopic-Image-Classifier
src/test.py
test.py
py
5,944
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 25, "usage_type": "name" }, { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 26, "usage_type": "call" }, { "api_n...
4493653419
import os import psycopg2 as sql from psycopg2 import OperationalError DATABASE_URL = os.environ['DATABASE_URL'] ''' Executes the SQL query on the database connected to the connection object. :type connection: Connection :type query_db: String :return: void ''' def query(connection, query_db): connec...
48nes/leetbot
tables.py
tables.py
py
5,879
python
en
code
3
github-code
18
[ { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "psycopg2.OperationalError", "line_number": 19, "usage_type": "name" }, { "api_name": "psycopg2.connect", "line_number": 29, "usage_type": "call" }, { "api_name": "psycopg2.co...
73889081001
from .config import * import pymysql import urllib.request import pandas as pd import shutil import osmnx as ox from . import assess import math # This file accesses the data # Cache for postcodes global POSTCODE_POSITIONS POSTCODE_POSITIONS = None #Builds the DB #Takes a set of credentials + database details # :p...
runezor/fynesse_ads_assignment
fynesse/access.py
access.py
py
9,146
python
en
code
0
github-code
18
[ { "api_name": "pandas.DataFrame", "line_number": 70, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 84, "usage_type": "call" }, { "api_name": "urllib.request.request.urlretrieve", "line_number": 112, "usage_type": "call" }, { "api_name": "...
32002769042
import pytest import time from algo.tris import tri_selection, tri_insertion, tri_bulle, tri_fusion liste_fonctions = [tri_bulle, tri_fusion] # tri_selection, tri_insertion def grandes_listes(): import random aleatoire = [random.randint(1, 2000) for _ in range(5000)] tri_fait = aleatoire.copy() tri...
efloti/plc_nsi_algo
tests/test_tris.py
test_tris.py
py
1,016
python
fr
code
1
github-code
18
[ { "api_name": "algo.tris.tri_bulle", "line_number": 7, "usage_type": "name" }, { "api_name": "algo.tris.tri_fusion", "line_number": 7, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 12, "usage_type": "call" }, { "api_name": "time.time", ...
8663390139
from selenium import webdriver from selenium.webdriver.common.by import By import time class FindElements: def find_elements_to_interact(self): baseurl = "https://letskodeit.teachable.com" driver = webdriver.Firefox() driver.maximize_window() driver.get(baseurl) driver.imp...
Sreenuraj/Selenium
basics/working_with_elements.py
working_with_elements.py
py
962
python
en
code
0
github-code
18
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.XPATH", "line_number": 18, "usage_type": "attribute" }, ...
14334959330
import utils import numpy as np from scipy import integrate import torch import matplotlib.pyplot as plt import os current_file = os.path.abspath(__file__) folder_pa = os.path.dirname(current_file) folder_path = f"{folder_pa}/" confi = [1e-03, 3, 20, "tanh", "Glorot normal", 1, 1, 100] a = utils.create_system(confi) ...
gcappellini/pinns_bioheat
CDC23/replicating_CDC/run.py
run.py
py
1,450
python
en
code
0
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
9201885191
from django.shortcuts import render, redirect from django.http import HttpResponse from .models import Planner from .forms import PlannerForm from django.views import generic from django.shortcuts import redirect from .forms import UserRegisterForm from django.contrib.auth.forms import UserCreationForm from django.cont...
matthewcao/final_schedule
schedule_app/views.py
views.py
py
2,550
python
en
code
0
github-code
18
[ { "api_name": "django.shortcuts.redirect", "line_number": 15, "usage_type": "call" }, { "api_name": "models.Planner.objects.all", "line_number": 20, "usage_type": "call" }, { "api_name": "models.Planner.objects", "line_number": 20, "usage_type": "attribute" }, { "...
23810575693
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence # from Model.model import CharRNN from Utils.utils.metric_reward import MetricsReward import torch.nn.utils.rnn as rnn_utils class CharRNN(nn.Module): def __init__(self, voc...
ggkong/tfCompared
Model/organ_model.py
organ_model.py
py
10,297
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.nn", "line...
13979459695
import re import argparse __all__ = ['parse_cmd_args', 'parse_dict_args'] def create_parser(): parser = argparse.ArgumentParser(description='PyTorch ImageNet Training') # Technical details parser.add_argument('-j', '--workers', default=4, type=int, metavar='N', help='n...
iBelieveCJM/pseudo_label-pytorch
util/Config.py
Config.py
py
4,540
python
en
code
318
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 83, "usage_type": "call" }, { "api_name": "argparse.ArgumentTypeError", "line_number": 102, "usage_type": "call" } ]
30061299028
import argparse import sys def main(): #Making a argparse object parser = argparse.ArgumentParser() #Taking inputs of variables through the CLI parser.add_argument('--x', type=float, default=1.0, help='What is the first number?') parser.add_argument('--y', type=floa...
SunnyVikasMalviya/Python
Intermediate Python/Argparse_For_CLI.py
Argparse_For_CLI.py
py
1,394
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.stdout.write", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 17, "usage_type": "attribute" } ]
1650070653
""" This module holds tests for error messages and stacktraces Created on Oct 18, 2013 @author: pupssman """ from hamcrest import has_property, assert_that, has_properties, has_string from hamcrest.library.text.stringcontainsinorder import string_contains_in_order def has_error(message='', trace=''): return ha...
elhe/allure-python
tests/test_traces.py
test_traces.py
py
3,579
python
en
code
null
github-code
18
[ { "api_name": "hamcrest.has_property", "line_number": 14, "usage_type": "call" }, { "api_name": "hamcrest.has_property", "line_number": 15, "usage_type": "call" }, { "api_name": "hamcrest.has_property", "line_number": 16, "usage_type": "call" }, { "api_name": "ham...
41316366799
#!/usr/bin/env python # coding: utf-8 # In[1]: import pandas as pd import numpy as np from pandas import DataFrame get_ipython().run_line_magic('matplotlib', 'inline') import matplotlib.pyplot as plt import seaborn as sns from sklearn import preprocessing import math from sklearn.model_selection import train_test_s...
Sriram1437/Employee-Attrition-prediction
Attrition Prediction Project (HCL).py
Attrition Prediction Project (HCL).py
py
4,529
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 26, "usage_type": "name" }, { "api_name...
39446961970
# -*- coding: utf-8 -*- """ Created on Sat Aug 22 12:07:01 2020 @author: Hui Z """ from nltk.cluster.util import cosine_distance import numpy as np import networkx as nx import math def get_doc(nlp, file_name, encoding_='utf-8'): return nlp(open(file_name, 'r', encoding=encoding_).read()) def get_sentences(doc)...
arkzgd/docsummary
doc_analyze.py
doc_analyze.py
py
3,781
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 33, "usage_type": "attribute" }, { "api_name": "numpy.mean", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.dot", "line_numbe...
10371798299
import json import spacy from spacy_download import load_spacy #before running : # python -m spacy download en_core_web_trf #following https://towardsdatascience.com/building-sentiment-classifier-using-spacy-3-0-transformers-c744bfc767b #to train: # python -m spacy train config.cfg --output ./data/units/unit_models/tr...
vivkaz/CQE
CQE/unit_classifier/train_classifier_bert.py
train_classifier_bert.py
py
7,063
python
en
code
16
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 31, "usage_type": "call" }, { "api_name": "json.load", "line_number": 47, "usage_type": "call" }, { "api_name": "spacy_download.load_spacy", "line_number": 65, "usage_type": "call" }, { "api_name": "spacy.tokens.DocBin"...
16718866750
import cv2 import imagehash import xml.etree.ElementTree import sys from PIL import Image from pathlib import Path hashes = {} class Extractor(): def __init__(self, root_path, video_file_path, images_dir, skipped_frames=1000, interactive=False): self.video_file = str(video_file_path) event_name...
sveatlo/detektilo
pkg/extractor.py
extractor.py
py
2,356
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 27, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_FRAME_COUNT", "line_number": 28, "usage_type": "attribute" }, { "api_name": "cv2.CAP_P...
34617483916
import discord from discord.ext import commands from Models.Context import Context class SameTimeAttackAddMemberCog(commands.Cog): """ 同時凸するメンバーの追加 """ def __init__(self, bot: commands.Bot): self.bot = bot @commands.command("dadd") async def add_member(self, ctx: commands.context.Cont...
Teara-exe/clanBattleBot
Cogs/SameTimeAttackAddMemberCog.py
SameTimeAttackAddMemberCog.py
py
673
python
en
code
0
github-code
18
[ { "api_name": "discord.ext.commands.Cog", "line_number": 6, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 6, "usage_type": "name" }, { "api_name": "discord.ext.commands.Bot", "line_number": 10, "usage_type": "attribute" }, { "ap...
16093587181
import time import numpy as np import tools import warnings from typing import Dict, List, Tuple _BIG_NUMBER = int(1e9) State = Dict[str, np.ndarray] Action = List[List[int]] Info = Dict[str, str] class Environment: def step(self, solution: Action) -> Tuple[State, int, bool, Info]: raise NotImplemente...
ortec/euro-neurips-vrp-2022-quickstart
environment.py
environment.py
py
15,664
python
en
code
78
github-code
18
[ { "api_name": "typing.Dict", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 10, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Dict", "line_nu...
38181074791
import sys import os from sklearn.naive_bayes import BernoulliNB from sklearn.feature_extraction.text import CountVectorizer from nltk.corpus import stopwords import numpy as np from sklearn.externals import joblib from sklearn.base import clone from sklearn.dummy import DummyClassifier from scipy import sparse sys.pa...
rdvoskin/msccs-t23
classifier/Classify_with_evaluation.py
Classify_with_evaluation.py
py
13,421
python
en
code
0
github-code
18
[ { "api_name": "sys.path.insert", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sklearn.naive_bayes.BernoulliNB", "line_number": 29, "usage_type": "call" }, { "api_name": "os.list...
71932053801
#!/usr/bin/python3 import numpy as np import sys from astropy import units as u from skyfield.api import load from skyfield.api import Topos class shadow_calc(object): def __init__(self, observatory_name="LCO", observatory_elevation=2380.0*u.m, observatory_lat='29.0146S', observatory_lon = '70.6926W', ...
sdss/lvmsurveysim
lvmsurveysim/utils/shadow_height_lib.py
shadow_height_lib.py
py
17,016
python
en
code
3
github-code
18
[ { "api_name": "astropy.units.m", "line_number": 10, "usage_type": "attribute" }, { "api_name": "astropy.units", "line_number": 10, "usage_type": "name" }, { "api_name": "skyfield.api.load", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.exit", "...
2690632423
#!/usr/bin/python #-*- coding: utf-8 -*- import sys import time import urllib import urllib.parse import requests import numpy as np import imp from bs4 import BeautifulSoup from openpyxl import Workbook from urllib import request from urllib import error from fake_useragent import UserAgent imp.reload(sys) # Fake Us...
LQYClaude/spider-for-builders
spider.py
spider.py
py
7,088
python
en
code
0
github-code
18
[ { "api_name": "imp.reload", "line_number": 16, "usage_type": "call" }, { "api_name": "fake_useragent.UserAgent", "line_number": 19, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.random.rand", ...
5749929245
# version: 0.0.1 # import logging import msvcrt import os from datetime import datetime, timedelta, time import sys from pydub import AudioSegment, effects import shutil def resource_path(relative_path): try: base_path = sys._MEIPASS except Exception: base_path = os.path.abspath(".") re...
smolikja/voicetelling
voicetelling.py
voicetelling.py
py
6,478
python
en
code
0
github-code
18
[ { "api_name": "sys._MEIPASS", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.join", "li...
33395155990
from typing import List class Solution: def threeSumClosest(self, nums: List[int], target: int) -> int: n=len(nums) nums.sort() res=nums[0]+nums[1]+nums[2] for i in range(n): l,r=i+1,n-1 while(l<r): sum=nums[i] + nums[l] + nums[r] ...
Marloweeee/LeetCodeCollection
2022.04/4.09-16最接近的三数之和.py
4.09-16最接近的三数之和.py
py
697
python
en
code
1
github-code
18
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" } ]
8223082870
from flask import render_template from flask import request from flask import Flask from replit import db import datetime import time app = Flask(__name__) @app.route('/') def index(): return render_template('index.html') @app.route('/history', methods=['GET', 'POST']) def history(): if request.method == 'GET'...
wa1ker38552/internet
replit/main.py
main.py
py
1,111
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 18, "usage_type": "attribute" }, { "api_name": "flask.req...
28439898838
import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QTreeView from PyQt5.Qt import QStandardItemModel, QStandardItem from PyQt5.QtGui import QFont, QColor class StandardItem(QStandardItem): def __init__(self, txt = "", fontSize = 12, setBold = False, color = QColor(0, 0, 0)): super().__init__...
Hector290601/EDA2
primerProyecto/qt/basics/treeWidget/third/main.py
main.py
py
1,422
python
en
code
2
github-code
18
[ { "api_name": "PyQt5.Qt.QStandardItem", "line_number": 6, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QColor", "line_number": 7, "usage_type": "call" }, { "api_name": "PyQt5.QtGui.QFont", "line_number": 9, "usage_type": "call" }, { "api_name": "PyQt5.QtWidg...
14334588110
import os import deepxde as dde from matplotlib import pyplot as plt import numpy as np import skopt from skopt import gp_minimize from skopt.plots import plot_convergence, plot_objective from skopt.space import Real, Categorical, Integer from skopt.utils import use_named_args import pandas as pd from openpyxl import l...
gcappellini/pinns_bioheat
1d_no_source/utils.py
utils.py
py
23,042
python
en
code
0
github-code
18
[ { "api_name": "deepxde.backend", "line_number": 18, "usage_type": "attribute" }, { "api_name": "deepxde.backend", "line_number": 19, "usage_type": "attribute" }, { "api_name": "deepxde.backend", "line_number": 20, "usage_type": "attribute" }, { "api_name": "deepxd...
34357845040
import os import sys from io import BytesIO, IOBase def main(): t = int(input()) for _ in range(t): n = int(input()) A = list(map(int, input().rstrip().split())) MaximumCandies = list(map(int, input().rstrip().split())) distA = [0] distB = [0] for pos in range(n...
subho2107/Codechef
May lunchtime/Weird walk.py
Weird walk.py
py
2,660
python
en
code
1
github-code
18
[ { "api_name": "io.IOBase", "line_number": 40, "usage_type": "name" }, { "api_name": "io.BytesIO", "line_number": 45, "usage_type": "call" }, { "api_name": "os.read", "line_number": 51, "usage_type": "call" }, { "api_name": "os.fstat", "line_number": 51, "u...
72139125800
import numpy as np import scipy.special as sps def the_transform(x,Nt = 500,Np = 500): N = x.shape[0] - 1 thetas = np.linspace(1e-10,np.pi,Nt) phis = np.linspace(0,2*np.pi,Np) # duplicate the signal X = np.kron(x,np.ones((Np,Nt,1))).T # maps of angles Thetas, Phis = np.meshgr...
bpascal-fr/kravchuk-transform-and-its-zeros
include/kravchuk_transform.py
kravchuk_transform.py
py
1,843
python
en
code
5
github-code
18
[ { "api_name": "numpy.linspace", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number"...
70026832999
from flask import Response from flask_restful import Resource from html5lib import serialize from models import LikePost, db import json from . import can_view_post from my_decorators import post_id_is_integer_or_400_error, id_is_integer_or_400_error, test import flask_jwt_extended class PostLikesListEndpoint(Resource...
yvanchu/cs396-photo-app
views/post_likes.py
post_likes.py
py
2,387
python
en
code
0
github-code
18
[ { "api_name": "flask_restful.Resource", "line_number": 10, "usage_type": "name" }, { "api_name": "flask.Response", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" }, { "api_name": "models.LikePost", ...
3914770794
from sql.select_tables.utils.data import DataManager from nltk.util import ngrams from typing import List from tqdm import tqdm from json import dump from sql.select_tables.config import parse_args def _ngram_process(s: str, n: List[int]) -> List[str]: ngram = [] for x in n: ngram = ngram +...
EvansongBBR/sgccTunnel2
BART_SP-chinese/sql/select_tables/select_tables.py
select_tables.py
py
4,817
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 9, "usage_type": "name" }, { "api_name": "nltk.util.ngrams", "line_number": 12, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "sql.select_tables.utils.data....
13825510990
''' Created on 25 Jan 2013 @author: Dave Wilson ''' import wx import enhanced_status_bar FRAME_STYLE = (wx.FRAME_FLOAT_ON_PARENT | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX | wx.CLIP_CHILDREN | wx.FRAME_NO_TASKBAR) ...
Yoriz/Utilities
src/wx_lib/frames.py
frames.py
py
3,809
python
en
code
0
github-code
18
[ { "api_name": "wx.FRAME_FLOAT_ON_PARENT", "line_number": 11, "usage_type": "attribute" }, { "api_name": "wx.SYSTEM_MENU", "line_number": 11, "usage_type": "attribute" }, { "api_name": "wx.CAPTION", "line_number": 11, "usage_type": "attribute" }, { "api_name": "wx....
24803390063
import sys from collections import deque def bfs(i, j): di = [1, 0, 0, -1] dj = [0, 1, -1, 0] visited = [[-1] * M for _ in range(N)] queue = deque() queue.append([i, j]) visited[i][j] = 0 result = [] while queue: x, y = queue.popleft() for d in range(4): ni =...
hongjungkimm/python_practice
baekjoon/2178.py
2178.py
py
834
python
en
code
0
github-code
18
[ { "api_name": "collections.deque", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdin.readline", "line_number": 26, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sys.stdin.readline...
44065444488
from torchvision import models from torch import nn from classBlock import ClassBlock import torch class resnet50(nn.Module): def __init__(self, class_num, pretrained=False, model_name='resnet50'): super(resnet50, self).__init__() self.model_name = model_name self.class_num = class_num ...
zhujiabao/face_attr
net/moudle.py
moudle.py
py
1,386
python
en
code
3
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": "torchvision.models", "line_number": 14, "usage_type": "argument" }, { "api_name": "torch.nn.AdaptiveA...
28682757418
from vosk import Model, KaldiRecognizer import pyaudio import socket s = socket.socket() print('socket created') s.bind(('localhost',9999)) s.listen(2) print('waiting for connections') c,addr = s.accept() print("Connected with",addr) model = Model(r"C:\Users\samya\Documents\HALProject\Working_files\vosk-model-en-in-0...
samyakshingi/VRM
recog_sock.py
recog_sock.py
py
760
python
en
code
0
github-code
18
[ { "api_name": "socket.socket", "line_number": 5, "usage_type": "call" }, { "api_name": "vosk.Model", "line_number": 13, "usage_type": "call" }, { "api_name": "vosk.KaldiRecognizer", "line_number": 14, "usage_type": "call" }, { "api_name": "pyaudio.PyAudio", "l...
36922370066
from django.shortcuts import render from lxml import etree import urllib.request from BaseXClient import BaseXClient import xmltodict # Create your views here. xml = etree.parse("app/xml_files/cursos.xml") # create session session = BaseXClient.Session('localhost', 1984, 'admin', 'admin') def cursos2(request): i...
pedralmeida22/EDC
aula3/ex1/app/views.py
views.py
py
4,407
python
pt
code
0
github-code
18
[ { "api_name": "lxml.etree.parse", "line_number": 8, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 8, "usage_type": "name" }, { "api_name": "BaseXClient.BaseXClient.Session", "line_number": 11, "usage_type": "call" }, { "api_name": "BaseXClient...
6810534371
from PIL import Image from os import listdir from os import remove def resizeImages(path, size=(255,255) ): try: for file in listdir(path): target = path+'/'+file print(f'[Resizing]\t {target}') img = Image.open(target).convert('RGB') img.resize(size, Image....
CyberGoat9152/vouyer-scrapper
utils/resizeImages.py
resizeImages.py
py
610
python
en
code
0
github-code
18
[ { "api_name": "os.listdir", "line_number": 7, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 11, "usage_type": "name" }, { "api_name": "PIL.Image.Resampling", "line_n...
4961495530
#coding:utf-8 from django.shortcuts import render import subprocess import os, sys from django.views.generic.base import TemplateView import dazhu import tools.webTools as tools from django.shortcuts import redirect from multiprocessing.dummy import Pool as ThreadPool class index(TemplateView): template_name ...
Christings/dazhu
pan/views.py
views.py
py
2,233
python
en
code
0
github-code
18
[ { "api_name": "django.views.generic.base.TemplateView", "line_number": 12, "usage_type": "name" }, { "api_name": "django.views.generic.base.TemplateView.get", "line_number": 16, "usage_type": "call" }, { "api_name": "django.views.generic.base.TemplateView", "line_number": 16,...
37110140229
# https://leetcode.com/problems/time-based-key-value-store/ from collections import defaultdict #! failed test cases class TimeMap1: def __init__(self): self.store = defaultdict(dict) def set(self, key: str, value: str, timestamp: int) -> None: self.store[key][timestamp] = value def g...
carlosviniciusfernandes/code_problems
neetcode/binary_search/981_time_based_key_value_store.py
981_time_based_key_value_store.py
py
1,672
python
en
code
0
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 46, "usage_type": "call" } ]
14950294051
# A part of NonVisual Desktop Access (NVDA) # This file is covered by the GNU General Public License. # See the file COPYING for more details. # Copyright (C) 2022 NV Access Limited from . import ( Role, State, ) from typing import ( Tuple, Set, ) def transformRoleStates(role: Role, states: Set[St...
nvaccess/nvda
source/controlTypes/roleAndStateSpecialCases.py
roleAndStateSpecialCases.py
py
1,473
python
en
code
1,802
github-code
18
[ { "api_name": "typing.Set", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 16, "usage_type": "name" } ]
10112735234
import os import subprocess from pathlib import Path from jinja2 import Environment, PackageLoader from fika.templates.util import ( _create_dir, _create_project_dir, _get_model_type_kwarg, ) class TemplateGenerator(object): # Prepare environment and source data env = Environment( loade...
karthikraja95/fika
fika/templates/template_generator.py
template_generator.py
py
1,777
python
en
code
1
github-code
18
[ { "api_name": "jinja2.Environment", "line_number": 17, "usage_type": "call" }, { "api_name": "jinja2.PackageLoader", "line_number": 18, "usage_type": "call" }, { "api_name": "fika.templates.util._create_dir", "line_number": 23, "usage_type": "call" }, { "api_name"...
8978701177
# -*- coding: utf-8 -*- """ Created on Thu Mar 14 16:35:22 2019 @author: """ import mne from mne.time_frequency import psd_welch import numpy as np def ffff(fname, tmin, tmax, fmin, fmax, n_fft = 2048): ##ffff return psds psdsrrr = ffff(fname='') #-----------------------------------------------------------...
brainwavesurf/Headcoils_data_analysis
spyder/psd/psd_base.py
psd_base.py
py
3,945
python
en
code
0
github-code
18
[ { "api_name": "mne.io.read_raw_fif", "line_number": 20, "usage_type": "call" }, { "api_name": "mne.io", "line_number": 20, "usage_type": "attribute" }, { "api_name": "mne.pick_types", "line_number": 22, "usage_type": "call" }, { "api_name": "mne.time_frequency.psd...
37640053917
#!/usr/bin/python3 from application import app, db from application.models import Parent, Player, Add, AddPlayer, Delete, Update from flask import Flask, render_template, request, redirect, url_for from flask_wtf import FlaskForm from wtforms import StringField, SubmitField @app.route('/home', methods=['GET', 'POST'...
abusyd1/SFIAProject1
application/routes.py
routes.py
py
2,745
python
en
code
0
github-code
18
[ { "api_name": "flask.request.method", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.render_template", "line_number": 14, "usage_type": "call" }, { "api_name": "applica...
34735203790
import gzip import json import logging import mimetypes import re import sys import traceback from enum import Enum import extruct import rdflib import requests import urllib import ssl from requests.packages.urllib3.exceptions import * from tika import parser from fuji_server.helper.preprocessor import Preprocessor ...
EOSC-synergy/fuji.sqaaas
fuji_server/helper/request_helper.py
request_helper.py
py
13,680
python
en
code
0
github-code
18
[ { "api_name": "enum.Enum", "line_number": 19, "usage_type": "name" }, { "api_name": "fuji_server.helper.preprocessor.Preprocessor.logger", "line_number": 40, "usage_type": "attribute" }, { "api_name": "fuji_server.helper.preprocessor.Preprocessor", "line_number": 40, "usa...
7585168290
import numpy as np import gym from common_files.utils import T import matplotlib.pyplot as plt from common_files.gym_to_gif import combine_gifs, label_with_episode_number, plot_from_saved_metrics import seaborn as sns; sns.set() import os import imageio import numpy as np import json np.seterr('raise') AGENT = 'sac'...
pranav-deo/rl-algos
verify_code.py
verify_code.py
py
2,307
python
en
code
0
github-code
18
[ { "api_name": "seaborn.set", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.seterr", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 25, "usage_type": "call" }, { "api_name": "common_files.utils.T", "line_...
4445892469
""" 너무 복잡하게 푼 것 같다. cnt를 처음에는 [0] * len(bridge_length)로 선언하여 풀려고 했는데, index 확인이 어려워서 dependency가 아예 동일하게 q와 cnt를 둘다 deque()로 통일시켜 풀었다. """ from collections import deque def solution(bridge_length, weight, truck_weights): answer = 0 q = deque() # 다리를 건너는 트럭 queue cnt = deque() # 다리 위에서 몇 초나 있었는지 확인하는 queu...
prography-6th-study/algorithm-code
seongwoo/2-다리를지나는트럭.py
2-다리를지나는트럭.py
py
1,036
python
ko
code
4
github-code
18
[ { "api_name": "collections.deque", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 12, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 13, "usage_type": "call" } ]
38420159305
import matplotlib.pyplot as plt import pandas as pd import numpy as np url = 'https://datahub.io/core/co2-ppm/r/co2-mm-mlo.csv' url2='https://pkgstore.datahub.io/JohnSnowLabs/nasa-global-temperature-anomalies-time-series-1880-2017/nasa-global-temperature-anomalies-time-series-1880-2017-csv_csv/data/d0f07b1b1f0f66bd16e...
tonycheng555027/Global_Warming_Analysis
main.py
main.py
py
3,841
python
en
code
2
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
3840333047
import logging import os import torch import wordninja from PIL import Image from torchvision import transforms logging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt='%m/%d/%Y %H:%M:%S', level=logging.INFO) logger = logging.getLogger(__nam...
marvel2120/MsdBert
utils.py
utils.py
py
8,125
python
en
code
14
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join",...
1036839252
from time import sleep from datetime import datetime from sh import gphoto2 as gp import signal, os, subprocess import shutil shot_date = datetime.now().strftime("%Y-%m-%d") shot_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") triggerCommand = ["--capture-image-and-download"] save_folder = "image-"+shot_date def...
Swanpy/Raspi
imagecap.py
imagecap.py
py
836
python
en
code
0
github-code
18
[ { "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": 7, "usage_type": "call" }, { "api_name": "datetime.d...
31288100429
# -*- coding: utf-8 -*- """ Created on Fri Nov 12 15:46:47 2021 @author: naisf """ import datetime import numpy as np import matplotlib.gridspec as gridspec import scipy.constants as cst from matplotlib import pyplot as plt from tqdm import tqdm from astropy.time import Time...
Nfargette/Magnetic_reconnection
SOLO_reconnection.py
SOLO_reconnection.py
py
13,149
python
en
code
0
github-code
18
[ { "api_name": "numpy.lib", "line_number": 19, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.close", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 25, "usage_type": "name" }, { "api_name": "numpy.loadtx...
12824300971
import os import logging import telegram import openai from flask import Flask, redirect, request, url_for from dotenv import load_dotenv load_dotenv() # Initialize Flask app app = Flask(__name__) # Set environment variables OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") TELEGRAM_API_KEY = os.getenv("TELEGRAM_API_KEY...
Xamerzaev/rezumeGPT_bot
app.py
app.py
py
2,002
python
en
code
0
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 15, "usage_type": "call" }, { "api_name": "os.getenv", "line_number"...
25217069102
# https://leetcode.com/problems/insertion-sort-list/ # tags: #linked_list, #sorting # # Solution: Sort by swapping nodes # Using insertion sort we need to remove current from its original position and insert it at its correct position: # * Update current.next to behind which is the position before which current needs t...
ronelzb/leetcode
linked_list/0147_insertion_sort_list.py
0147_insertion_sort_list.py
py
1,817
python
en
code
0
github-code
18
[ { "api_name": "typing.Optional", "line_number": 24, "usage_type": "name" }, { "api_name": "sys.maxsize", "line_number": 25, "usage_type": "attribute" } ]
73199476201
import sys import random from random import shuffle from tqdm import tqdm import os.path import urllib import urllib.error import urllib.request import imghdr from ssl import CertificateError from socket import timeout as TimeoutError from socket import error as SocketError import time import pickle import hashlib impo...
fhvilshoj/torch_imagenet
download_imagenet_images.py
download_imagenet_images.py
py
4,916
python
en
code
0
github-code
18
[ { "api_name": "random.seed", "line_number": 18, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 26, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 41, "usage_type": "call" }, { "api_name": "urllib.request", "...
1642387844
# -*- coding: utf-8 -*- import os from pkg_resources import parse_version import pkginfo def _egg_info(path_to_egg='../../src/'): path_to_egg = os.path.join( os.path.dirname(__file__), path_to_egg) egg_info = pkginfo.Develop(path_to_egg) release = egg_info.version version = '%s.%s' % tuple(m...
dinoboff/github-tools
docs/source/conf.py
conf.py
py
1,065
python
en
code
88
github-code
18
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
20924571542
import json import logging logging.basicConfig(filename='app.log', filemode='w', format='%(name)s - %(levelname)s - %(message)s') def unpack_json(file): try: with open(file) as json_file: data = json.load(json_file) return data except FileNotFoundError: logging.error(f...
IlyaGrynyshyn/python-online-marathon
sprint 06 ( With (in, out). Serialization )/Task 2/Task 2.py
Task 2.py
py
1,095
python
en
code
0
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 4, "usage_type": "call" }, { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 13, "usage_type": "call" }, { "api_name": "json.dump", "line_numb...
39233453903
import cv2 import omni2 values = [25, 25, 0, 65, 65, 65, 0, 170] thrower = 100 speed = 40 cv2.namedWindow("Controller") while True: k = cv2.waitKey(1) & 0xFF if k == ord("w"): print("Forward") omni2.forward(values, speed) if k == ord("s"): print("Backward") omni2.forward(...
lauriraudla/pOliver
manual.py
manual.py
py
862
python
en
code
0
github-code
18
[ { "api_name": "cv2.namedWindow", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 11, "usage_type": "call" }, { "api_name": "omni2.forward", "line_number": 15, "usage_type": "call" }, { "api_name": "omni2.forward", "line_nu...
17955882085
from bs4 import BeautifulSoup import copy import re def getTabmeta(tabstr):#type是否引入加粗,等于1不加粗;way是否以#区分,1是不区分;method是百分号是否加前面的东西 """ 把带表格的html字符串,从中提取内容和描述信息,还原为list。 先以<tr>或<thead>字符串表行标识,拆分表格字符串,其中<thead>部分为表头部分。 以<td>字符串为标识,逐行找寻列数据,以</td>为标识,拆分列信息。 获取列的行合并,列合并属性。 获取列的文字属性,判断是否存在空格或tab。 完...
Dwyanepeng/test
py37/parse_tools/tabletool.py
tabletool.py
py
16,481
python
zh
code
1
github-code
18
[ { "api_name": "bs4.BeautifulSoup", "line_number": 15, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 101, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 186, "usage_type": "call" }, { "api_name": "re.findall", "lin...
42813378611
import json import pytest from dbt.tests.util import run_dbt ref_models__table_comment_sql = """ {{ config( materialized = "table", persist_docs = {"relation": true, "columns": true}, ) }} select 'foo' as first_name, 'bar' as second_name """ ref_models__view_comment_sql = """ {{ config( m...
bytehouse-cloud/bytehouse-dbt
tests/integration/adapter/test_comments.py
test_comments.py
py
1,881
python
en
code
1
github-code
18
[ { "api_name": "pytest.fixture", "line_number": 56, "usage_type": "call" }, { "api_name": "dbt.tests.util.run_dbt", "line_number": 69, "usage_type": "call" }, { "api_name": "dbt.tests.util.run_dbt", "line_number": 70, "usage_type": "call" }, { "api_name": "json.loa...
27528222950
from __future__ import print_function from builtins import range import numpy as np import pandas as pd import sys import argparse import os from sklearn.datasets import load_boston from sklearn.linear_model import LinearRegression, Ridge, Lasso, LogisticRegression from sklearn.svm import SVR from sklearn.ensemble i...
Kipok/clr_prediction
grid_search.py
grid_search.py
py
6,637
python
en
code
15
github-code
18
[ { "api_name": "numpy.min", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random", "line_numb...
7801183266
import numpy as np import matplotlib.pyplot as plt from scipy.io import wavfile def plot_fourier_spectrum(freq, spectrum, title): plt.plot(freq, np.abs(spectrum)) plt.xlabel("Frequency (Hz)") plt.ylabel("Magnitude") plt.title(title) # Load the WAV file sample_rate, audio_data = wavfile.read("C:/Users/...
baiibhav/FourierDecomposition
FourierSeries.py
FourierSeries.py
py
2,016
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "numpy.abs", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.xla...
25221222460
import requests from html import unescape from bs4 import BeautifulSoup from tkinter import * from tkinter import ttk import os def review_button(): tp = Toplevel() tp.title("Flashcard_Studio/Sets") tp.geometry("800x350") global setnames global setnamesStrVar setnames = [] label2 = Label(...
Thom16911/Flashcard_Project
source.py
source.py
py
4,333
python
en
code
1
github-code
18
[ { "api_name": "os.listdir", "line_number": 19, "usage_type": "call" }, { "api_name": "tkinter.ttk.OptionMenu", "line_number": 23, "usage_type": "call" }, { "api_name": "tkinter.ttk", "line_number": 23, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", ...
4346308591
import pandas as pd from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from sklearn.metrics import confusion_matrix from sklearn.metrics import accuracy_score # Charger les données dans un DataFrame Pandas df = pd.read_csv('data/LDA_transformed_data.csv') #Neural network couches = 80 from sklearn.ne...
trebla-88/Geoscience
MPLLDA.py
MPLLDA.py
py
1,507
python
fr
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.neural_network.MLPClassifier", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.neural_network.MLPClassifier", "line_number": 16, "usage_type": "call" }, ...
73052148521
""" code by Tae Hwan Jung(Jeff Jung) @graykode, Derek Miller @dmmiller612, modify by shwei Reference: https://github.com/jadore801120/attention-is-all-you-need-pytorch https://github.com/JayParks/transformer """ """ 代码位置: 手把手教你用Pytorch代码实现Transformer模型(超详细的代码解读) https://ugirc.blog.csdn.net/article/details/1...
fry404006308/fry_course_materials
220412-计算机视觉几分钟精通系列/课程资料/10-transformer/transformer代码/transformer代码.py
transformer代码.py
py
22,799
python
en
code
444
github-code
18
[ { "api_name": "torch.LongTensor", "line_number": 80, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", "line_number": 86, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 86, "usage_type": "name" }, { "api_name": "torch...
74246275560
import os from datetime import datetime from pprint import pprint as pp import numpy as np import tensorflow as tf from sklearn.model_selection import train_test_split from common import * from optparse import OptionParser # LEARNING_RATE = 0.02 LEARNING_RATE = 0.1 DATASET_SIZE = 1000 EPOCHS = 1200 # Collection of d...
maciejsikora2302/PP_iga_pinn_nn
part2/ANN3_training.py
ANN3_training.py
py
1,486
python
en
code
0
github-code
18
[ { "api_name": "numpy.linspace", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 22...
13380544549
import os import time import sys import traceback import glob import cv2 import numpy as np import onnxruntime def main(args): classes = ['nsfw', 'sfw'] session = onnxruntime.InferenceSession(args.model_path, providers=['CUDAExecutionProvider']) input_name = session.get_inputs()[0].name output_name...
mxer/ImageClassificationTemplate
onnx_test.py
onnx_test.py
py
2,627
python
en
code
0
github-code
18
[ { "api_name": "onnxruntime.InferenceSession", "line_number": 15, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 23, "usage_type": "call" }, { "api_name": "time.time", "li...
32337609391
import ase.io import fire from ai2_kit.core.log import get_logger from ai2_kit import res from ai2_kit.domain.cp2k import dump_coord_n_cell from typing import Optional, Literal from ase import Atoms, Atom from string import Template import re import os import json logger = get_logger(__name__) DEEPMD_DEFAULT_TEMPLA...
chenggroup/ai2-kit
ai2_kit/feat/catalysis.py
catalysis.py
py
12,019
python
en
code
31
github-code
18
[ { "api_name": "ai2_kit.core.log.get_logger", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "ai2_kit.res.DIR...
35870728015
"""Added double indexes Revision ID: 5783809706d2 Revises: 4e2dde2d15e6 Create Date: 2015-06-01 21:08:15.106408 """ # revision identifiers, used by Alembic. revision = '5783809706d2' down_revision = '4e2dde2d15e6' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Ale...
ebu/radiodns-manager
RadioDns-PlugIt/alembic/versions/5783809706d2_added_double_indexes.py
5783809706d2_added_double_indexes.py
py
823
python
en
code
14
github-code
18
[ { "api_name": "alembic.op.create_index", "line_number": 19, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 19, "usage_type": "name" }, { "api_name": "alembic.op.create_index", "line_number": 20, "usage_type": "call" }, { "api_name": "alembic.op...
5399201663
import paddle import itertools import log import sys import time import datetime import paddle.vision.transforms as T from paddle.vision.datasets import Cifar10 from paddle.optimizer import Adam from paddle.optimizer.lr import CosineAnnealingDecay from paddle.optimizer.lr import LinearWarmup from paddle.regularizer imp...
dlcg-Lab/Data-and-Channel-efficient-vision-Transformer
train.py
train.py
py
4,265
python
en
code
0
github-code
18
[ { "api_name": "paddle.optimizer.lr.CosineAnnealingDecay", "line_number": 19, "usage_type": "name" }, { "api_name": "paddle.optimizer.lr.LinearWarmup", "line_number": 25, "usage_type": "name" }, { "api_name": "sys.stdout", "line_number": 39, "usage_type": "attribute" }, ...
5362593454
"""bitforum URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-base...
maazravian/BitForum
bitforum/bitforum/urls.py
urls.py
py
2,455
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 25, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 25, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 25, "usage_type": "name" }, { "api_name": "...
15964773751
import torch import torch.nn as nn import torch.nn.functional as Functional def square_distance(src, dst): B, N, _ = src.shape _, M, _ = dst.shape dist = -2 * torch.matmul(src.float(), dst.float().permute(0, 2, 1)) dist += torch.sum(src ** 2, -1).view(B, N, 1) dist += torch.sum(dst ** 2, -1).view(B...
remotebiosensing/rppg
nets/models/gcn_utils.py
gcn_utils.py
py
5,444
python
en
code
185
github-code
18
[ { "api_name": "torch.matmul", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.sum", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.sum", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.arange", "line_number": 27, ...
10080613868
"""Binary tree/non-tree classifier(s).""" import glob from os import path import dask import maxflow as mf import numpy as np import rasterio as rio from dask import diagnostics from sklearn import ensemble from . import pixel_features, pixel_response, settings, utils __all__ = ["ClassifierTrainer", "Classifier"] M...
martibosch/detectree
detectree/classifier.py
classifier.py
py
21,422
python
en
code
169
github-code
18
[ { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 176, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 176, "usage_type": "call" }, { "api_name": "os.path", "line_number": 176...
41812042169
import cocotb from cocotb.clock import Clock from cocotb.triggers import RisingEdge, FallingEdge, Timer, ClockCycles @cocotb.test() async def test_hex_sr(dut): dut._log.info("start") clock = Clock(dut.clk, 10, units="us") cocotb.start_soon(clock.start()) cycles = 512 sr_len = 100 dut.recirc....
brouhaha/tt02-hex-sr-big
src/test.py
test.py
py
938
python
en
code
0
github-code
18
[ { "api_name": "cocotb.clock.Clock", "line_number": 9, "usage_type": "call" }, { "api_name": "cocotb.start_soon", "line_number": 10, "usage_type": "call" }, { "api_name": "cocotb.triggers.RisingEdge", "line_number": 18, "usage_type": "call" }, { "api_name": "cocotb...
74928666919
""" [베스트 앨범] https://school.programmers.co.kr/learn/courses/30/lessons/42579 스트리밍 사이트에서 장르 별로 가장 많이 재생된 노래를 두 개씩 모아 베스트 앨범을 출시 노래를 수록하는 기준 - 속한 노래가 많이 재생된 장르를 먼저 수록합니다. - 장르 내에서 많이 재생된 노래를 먼저 수록합니다. - 장르 내에서 재생 횟수가 같은 노래 중에서는 고유 번호가 낮은 노래를 먼저 수록합니다. 제한 사항 - genres와 plays의 길이는 동일 - 장르 종류 < 100개 - 장르에 속한 곡이 하나라면, 하나...
JeHa00/TIL
DataStructure_Algorithum/Programmers_High_score_kit/hash/베스트앨범.py
베스트앨범.py
py
1,887
python
ko
code
1
github-code
18
[ { "api_name": "typing.List", "line_number": 20, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 24, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 25, "usage_type": "call" } ]
15925281856
import torch import torch.nn as nn import functools from loss import * class Res_Enhancement(nn.Module): def __init__(self): super(Res_Enhancement, self).__init__() self.conv1 = nn.Sequential( nn.Conv2d(in_channels=3, out_channels=16, kernel_size=3, padding=1), ...
k914/contrastive-alternative-learning
code/part_enhancement.py
part_enhancement.py
py
2,075
python
en
code
4
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.Sequential", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
3769892873
import asyncio from typing import Optional, Any, List, Dict, Union from simnet.client.components.chronicle.base import BaseChronicleClient from simnet.client.routes import RECORD_URL from simnet.errors import DataNotPublic, BadRequest from simnet.models.genshin.chronicle.abyss import SpiralAbyss, SpiralAbyssPair from ...
PaiGramTeam/SIMNet
simnet/client/components/chronicle/genshin.py
genshin.py
py
11,273
python
en
code
12
github-code
18
[ { "api_name": "simnet.client.components.chronicle.base.BaseChronicleClient", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 35, "usage_type": "name" }...
72827373800
from sqlalchemy.ext.associationproxy import _AssociationList class RightMixin: @staticmethod def _fields_base_read(): return set() @staticmethod def _fields_export_csv(): return { "software", "software_version", "http_referrer", "user_ag...
monarc-project/version-checker
src/web/models/right_mixin.py
right_mixin.py
py
1,246
python
en
code
0
github-code
18
[ { "api_name": "sqlalchemy.ext.associationproxy._AssociationList", "line_number": 41, "usage_type": "argument" } ]
39269717958
""" Tests for tunes app. """ from django.test import TestCase from tunes.models import Song class SongDeserializeTest(TestCase): def _test_deserialize(self, line, fields): """ Runs a serialization test. """ song = Song() song.deserialize_itunes_tsv(line) song_fields...
benatkin/tuneage
tunes/tests.py
tests.py
py
2,111
python
en
code
1
github-code
18
[ { "api_name": "django.test.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "tunes.models.Song", "line_number": 13, "usage_type": "call" } ]
3998281846
#!/usr/bin/env python import sys import os import numpy import scipy.interpolate as interp import matplotlib.pyplot as plt import clawpack.visclaw.colormaps as colormaps def read_deformation(path): r"""""" data = numpy.loadtxt(path) x = data[:,0] y = data[:,1] z = data[:,2] # Find maximum...
mandli/tohoku-pc
transform_dtopo.py
transform_dtopo.py
py
5,913
python
en
code
1
github-code
18
[ { "api_name": "numpy.loadtxt", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 31, ...
33008702443
from copy import deepcopy import json, os from random import random DEBUG = True BRUCE_STORY_LINE = "bsl" BRUCE_SHOW_UP = "bsu" BRUCE_LOVE = "brl" BRUCE_INTRODUCE = "bri" OLIVER_STORY_LINE = "osl" OLIVER_LOVE = "oll" SINESTRO_STORY_LINE = "ssl" SINESTRO_LOVE = "sil" SINESTRO_TAME = "sit" BARRY_LOVE = "bal" SWORD_HOT...
zhuty18/EmeraldKnight
script/constant.py
constant.py
py
3,168
python
en
code
3
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 62, "usage_type": "call" }, { "api_name": "os.path", "line_number": 62, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 64, "usage_type": "call" }, { "api_name": "os.path.join", "line_numbe...
21052747348
'3' import signal from neuron import h, gui import numpy as np import matplotlib.pyplot as plt from open_pickle import read_from_pickle import os from tqdm import tqdm from add_figure import add_figure from glob import glob import pickle from calculate_F_factor import calculate_F_factor path_single_traces=glob('data/t...
moriafrid/data_analysis
fit.py
fit.py
py
12,147
python
en
code
0
github-code
18
[ { "api_name": "glob.glob", "line_number": 14, "usage_type": "call" }, { "api_name": "neuron.h.load_file", "line_number": 35, "usage_type": "call" }, { "api_name": "neuron.h", "line_number": 35, "usage_type": "name" }, { "api_name": "neuron.h.load_file", "line_...
71427588520
# load libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import seaborn as sns import sklearn sns.set() # load dataset train_df = pd.read_csv('../input/train.csv') test_df = pd.read_csv('../input/test.csv') train_df.shape test_df.shape train_df.col...
aorursy/new-nb-3
jeppbautista_eda-feature-selection-xgboost-classifier.py
jeppbautista_eda-feature-selection-xgboost-classifier.py
py
21,466
python
en
code
0
github-code
18
[ { "api_name": "seaborn.set", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "missingno.matrix", "li...
5435161414
from django.db.models.aggregates import Sum from rest_framework.response import Response from rest_framework.serializers import ModelSerializer from rest_framework.viewsets import ViewSet from rest_framework.decorators import action from whereithurtsapi.models import Patient, Healing, Treatment, Hurt from rest_framewor...
gavinschriver/whereithurts-server
whereithurtsapi/views/Profile.py
Profile.py
py
2,690
python
en
code
1
github-code
18
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 11, "usage_type": "name" }, { "api_name": "whereithurtsapi.models.Healing", "line_number": 13, "usage_type": "name" }, { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 16, ...
19511170142
# Importing required modules from config import * from email_service import send_email from scraper_service import get_latest_interruption_pdf, download_pdf from ocr_service import ocr_pdf, extract_date_time import os from datetime import datetime def read_file(file_path): with open(f"templates/{file_path}", "r")...
annkimathi/KPLCInterruptions
main.py
main.py
py
2,130
python
en
code
0
github-code
18
[ { "api_name": "scraper_service.get_latest_interruption_pdf", "line_number": 20, "usage_type": "call" }, { "api_name": "scraper_service.download_pdf", "line_number": 23, "usage_type": "call" }, { "api_name": "ocr_service.ocr_pdf", "line_number": 24, "usage_type": "call" ...
34212461299
import io import sys _INPUT = """\ 4 4 1 2 2 3 3 4 4 1 """ sys.stdin = io.StringIO(_INPUT) N, M = map(int, input().split()) connect = [[] for _ in range(N+1)] for i in range(M): A, B = map(int, input().split()) connect[A].append(B) from collections import deque def BFS(start): visited = [False] * (N+1...
kkchart9/atcoder
ABC/204_c.py
204_c.py
py
722
python
en
code
0
github-code
18
[ { "api_name": "sys.stdin", "line_number": 11, "usage_type": "attribute" }, { "api_name": "io.StringIO", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 27, "usage_type": "call" } ]
2910319422
from django.contrib import admin from django.urls import path,include from . import views urlpatterns = [ path('', views.display,name="display"), path('dis',views.d1,name="inner_page"), path('bookt',views.booktic,name="booktic"), path('cancelt',views.cantic,name="cantic"), path('ticdet',views.ticket...
abisheg0213/Decentralised-Railway-reservation-application-using-Django
bcapp/urls.py
urls.py
py
403
python
en
code
1
github-code
18
[ { "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", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
35149065579
from collections import Iterable, Mapping import kjbuckets from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.db.models import Model, Q from django.template.loader import render_to_string from django.db.models.loading import get_model from django.contrib.sites.models impo...
esimorre/openplm
openPLM/plmapp/mail.py
mail.py
py
6,060
python
en
code
3
github-code
18
[ { "api_name": "django.db.models.Q", "line_number": 20, "usage_type": "call" }, { "api_name": "openPLM.plmapp.models.ROLE_SIGN", "line_number": 23, "usage_type": "name" }, { "api_name": "django.db.models.Q", "line_number": 24, "usage_type": "call" }, { "api_name": ...
3769914393
from typing import Dict, Any, Optional, List, Union from urllib import parse from simnet.client.base import BaseClient from simnet.client.routes import YSULOG_URL from simnet.models.genshin.transaction import BaseTransaction, TransactionKind, ItemTransaction, Transaction from simnet.utils.lang import create_short_lang...
PaiGramTeam/SIMNet
simnet/client/components/transaction.py
transaction.py
py
3,811
python
en
code
12
github-code
18
[ { "api_name": "simnet.client.base.BaseClient", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 20, "usage_type": "name" }, { "api_name": "typing....
6220853997
import pytest INSTANCE_ID = 1 PROJECT_ID = 1 MODEL_ID = 1 FLOW_ID = 1 BK_USERNAME = 'unittest' VERSION_ID = '96wsipgxk5hc4nzd7jqey1mbv8fau0lt' MAIN_TABLE_ID = '591_main_table' BK_BIZ_ID = 591 INDICATOR_RESULT_TABLE_ID = '591_indicator_table' CALCULATION_ATOM_NAME = 'max_price' def _init_complete_model_instance(): ...
Tencent/bk-base
src/api/datamanage/tests/datamodel/init_data.py
init_data.py
py
4,092
python
en
code
85
github-code
18
[ { "api_name": "datamanage.pro.datamodel.models.application.DmmModelInstance.objects.create", "line_number": 19, "usage_type": "call" }, { "api_name": "datamanage.pro.datamodel.models.application.DmmModelInstance", "line_number": 19, "usage_type": "attribute" }, { "api_name": "dat...
26707953273
#!/usr/bin/env python # -*- coding: utf-8 -*- import pytest import sys import tempfile import json import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) import config from arm_compozure.arm_file import ArmFile def test_init_check_attribute_src(): test = ArmFile('https://raw.githubuse...
TimSwart/arm-compozure
tests/test_arm_file.py
test_arm_file.py
py
5,544
python
en
code
0
github-code
18
[ { "api_name": "urllib3.disable_warnings", "line_number": 10, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 10, "usage_type": "attribute" }, { "api_name": "arm_compozure.arm_file.ArmFile", "line_number": 15, "usage_type": "call" }, { "a...
71388474281
import os from django.conf import settings from django.core.management.base import NoArgsCommand from Plugins.ckeditor.views import get_image_files from Plugins.ckeditor.utils import get_thumb_filename from Plugins.ckeditor.image_processing import get_backend class Command(NoArgsCommand): """ Creates thumbn...
cornelioroyer/ERPProject
Plugins/ckeditor/management/commands/generateckeditorthumbnails.py
generateckeditorthumbnails.py
py
1,120
python
en
code
3
github-code
18
[ { "api_name": "django.core.management.base.NoArgsCommand", "line_number": 11, "usage_type": "name" }, { "api_name": "django.conf.settings", "line_number": 18, "usage_type": "argument" }, { "api_name": "Plugins.ckeditor.image_processing.get_backend", "line_number": 19, "us...
27336633081
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Joan Massich <mailsik@gmail.com> # # License: BSD Style. import numpy as np from ...utils import verbose from ._utils import _fetch_one, _data_path, TEMAZEPAM_SLEEP_RECORDS from ._utils import _check_subjects data_path = _...
soheilbr82/BluegrassWorkingMemory
Python_Engine/Lib/site-packages/mne/datasets/sleep_physionet/temazepam.py
temazepam.py
py
4,230
python
en
code
5
github-code
18
[ { "api_name": "_utils._data_path", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.loadtxt", "line_number": 79, "usage_type": "call" }, { "api_name": "_utils.TEMAZEPAM_SLEEP_RECORDS", "line_number": 79, "usage_type": "argument" }, { "api_name": "_u...
25795529311
#! pip install transformers #! pip install -U sentence-transformers #! pip install konlpy ########################################## ### 1. Load Clean Korean Legal Dataset ### ########################################## import konlpy from konlpy.tag import Mecab file_path = "./data/cklc-small.txt" with open(file_path)...
Navy10021/Semantic-Legal-Searcher
pre-training/1_3_TSDAE.py
1_3_TSDAE.py
py
7,690
python
en
code
2
github-code
18
[ { "api_name": "torch.utils.data.Dataset", "line_number": 26, "usage_type": "name" }, { "api_name": "konlpy.tag.Mecab", "line_number": 30, "usage_type": "call" }, { "api_name": "sentence_transformers.readers.InputExample.InputExample", "line_number": 34, "usage_type": "cal...
37304422624
from collections import Counter M1 = 10 ** 9 + 7 M2 = 10 ** 9 + 33 p1 = 10 ** 9 + 9 p2 = 10 ** 9 + 87 pw1 = [1] * 26 pw2 = [1] * 26 for i in range(1, 26): pw1[i] = p1 * pw1[i - 1] pw2[i] = p2 * pw2[i - 1] pw1[i] %= M1 pw2[i] %= M2 class Solution: def mins(self, stickers, i, n, rem, rctr, h1, h2): ...
theabbie/leetcode
stickers-to-spell-word.py
stickers-to-spell-word.py
py
1,403
python
en
code
11
github-code
18
[ { "api_name": "collections.Counter", "line_number": 25, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 43, "usage_type": "call" } ]
900389082
import time from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse from Journal.auth_accounts.models import Profile from Journal.web_app.models import Journal UserModel = get_user_model() class TestJournalViews(TestCase): VALID_USER_DATA = { 'ema...
NikolaKolew/Journal
Journal/web_app/test/views/test_journal_view.py
test_journal_view.py
py
3,277
python
en
code
0
github-code
18
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 10, "usage_type": "call" }, { "api_name": "django.test.TestCase", "line_number": 13, "usage_type": "name" }, { "api_name": "Journal.web_app.models.Journal.objects.create", "line_number": 35, "usage_type": ...
30926206736
import os import cv2 import optics import argparse import tfrecord import numpy as np import tensorflow as tf from util import * class TensorHolographyModel(): def __init__(self, hologram_params, training_params, model_params, loss_params, ...
adelansari/tensor_holography
main.py
main.py
py
28,476
python
en
code
null
github-code
18
[ { "api_name": "tensorflow.compat.v1.ConfigProto", "line_number": 32, "usage_type": "call" }, { "api_name": "tensorflow.compat", "line_number": 32, "usage_type": "attribute" }, { "api_name": "tensorflow.compat.v1.Session", "line_number": 34, "usage_type": "call" }, { ...
26515338415
from absl.testing import absltest from bsuite.baselines.utils import sequence import dm_env from dm_env import specs import numpy as np class BufferTest(absltest.TestCase): """Tests for the sequence buffer class.""" def test_buffer(self): # Given a buffer and some dummy data... max_sequence_length = 10 ...
deepmind/bsuite
bsuite/baselines/utils/sequence_test.py
sequence_test.py
py
2,099
python
en
code
1,400
github-code
18
[ { "api_name": "absl.testing.absltest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "absl.testing.absltest", "line_number": 9, "usage_type": "name" }, { "api_name": "bsuite.baselines.utils.sequence.Buffer", "line_number": 16, "usage_type": "call" ...
21732873426
from typing import Callable, TypeVar from typing_aliases import Binary, Nullary, Quaternary, Ternary, Unary from typing_extensions import ParamSpec from wraps.future import Future __all__ = ( "FutureCallable", "FutureNullary", "FutureUnary", "FutureBinary", "FutureTernary", "FutureQuaternary"...
nekitdev/wraps
wraps/typing.py
typing.py
py
855
python
en
code
3
github-code
18
[ { "api_name": "typing_extensions.ParamSpec", "line_number": 20, "usage_type": "call" }, { "api_name": "typing.TypeVar", "line_number": 22, "usage_type": "call" }, { "api_name": "typing.TypeVar", "line_number": 23, "usage_type": "call" }, { "api_name": "typing.Type...
17893043762
import subprocess from typing import Optional def sub_com(command, input_pipe=None) -> Optional[str]: stderr = "" # subprocess communicate # https://stackoverflow.com/questions/11269575/how-to-hide-output-of-subprocess-in-python-2-7 # Command Should be None, guard for False for sanity if command ...
rosenberg-c/public_rpi_styra_src
tools_lib/lib/user_sys/sub_com.py
sub_com.py
py
1,058
python
en
code
0
github-code
18
[ { "api_name": "subprocess.Popen", "line_number": 14, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 14, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 5, "usage_type": "name" } ]