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
73866156666
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Apr 28 00:46:02 2020 @author: Dani Kiyasseh """ #%% """ Functions in this script: 1) make_saving_directory_continual 2) make_dir 3) train_model 4) perform_MC_or_normal_training """ #%% import os import numpy as np import copy import to...
danikiyasseh/CLOPS
run_experiment.py
run_experiment.py
py
36,629
python
en
code
12
github-code
6
[ { "api_name": "prepare_acquisition_functions.perform_MC_sampling", "line_number": 38, "usage_type": "call" }, { "api_name": "prepare_acquisition_functions.perform_MC_sampling", "line_number": 42, "usage_type": "call" }, { "api_name": "prepare_acquisition_functions.perform_MC_samp...
73796354429
import numpy as np from numpy import log, dot, e from numpy.random import rand from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.datasets import make_blobs from sklearn.model_selection import GridSearchCV from sklearn.utils.multiclass import check_classification_targets from sklearn.utils.validation ...
jorge-rivero/sklearn_estimator
classifier/LogisticRegression.py
LogisticRegression.py
py
3,499
python
en
code
0
github-code
6
[ { "api_name": "numpy.e", "line_number": 11, "usage_type": "name" }, { "api_name": "sklearn.base.BaseEstimator", "line_number": 13, "usage_type": "name" }, { "api_name": "sklearn.base.ClassifierMixin", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy...
34531674088
#!/usr/bin/python3 """ISS Tracking using python""" # import(*always at top) request import requests import reverse_geocoder as rg import datetime # define URL ISSLOCATION = 'http://api.open-notify.org/iss-now.json' def main(): """runtime code""" # call api currentpos = requests.get(ISSLOCATION) #pri...
JustJohns/mycode
challenges/iss_tracker.py
iss_tracker.py
py
1,067
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.fromtimestamp", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 28, "usage_type": "attribute" }, { "api_name": "r...
35127764684
from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_similarity import torch class TfidfKnn: def __init__(self, example_sentences): self.cache(example_sentences) def cache(self, example_sentences): if example_sentences is None: ...
salesforce/DNNC-few-shot-intent
models/tfidf_knn.py
tfidf_knn.py
py
998
python
en
code
42
github-code
6
[ { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.metrics.pairwise.cosine_similarity", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.FloatTensor", "line_number": 25, "usage_...
15716493302
""" 一些通用的函数 """ import os import pypinyin from cnradical import Radical, RunOption import hashlib import json # 根据文件夹名,从当前文件路径中获取文件夹路径,当文件夹名为 APTS 时,返回的是该项目的根目录,默认值为 APTS def get_folder_path(folder_name='APTS'): # 获取当前文件的路径 current_file_path = os.path.abspath(__file__) # 从文件路径中查找文件夹名的位置 folder_name_i...
liyugz/apts
base_utils/base_funcs.py
base_funcs.py
py
3,088
python
zh
code
0
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pypinyin.pinyin", "line_number": 30, "usage_type": "call" }, { "api_name": "cnradical.Radical", ...
36464326111
from torchaudio.datasets import SPEECHCOMMANDS import argparse if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("--save_dir", required = True, help='path to save files') args = parser.parse_args() traindataset = SPEECHCOMMANDS(root = args.save_dir, download = True) ...
VirajBagal/Keyword-Spotting
code/download_dataset.py
download_dataset.py
py
321
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "torchaudio.datasets.SPEECHCOMMANDS", "line_number": 9, "usage_type": "call" } ]
28345298214
import random import time import matplotlib.pyplot as plt def linear_search(arr, x): """ Performs a linear search to find the index of x in arr. Returns -1 if x is not found in arr. """ for i in range(len(arr)): if arr[i] == x: return i return -1 # Generate li...
hemasri322/simple-html-code
python lab/linear.py
linear.py
py
797
python
en
code
0
github-code
6
[ { "api_name": "random.randint", "line_number": 20, "usage_type": "call" }, { "api_name": "time.time", "line_number": 22, "usage_type": "call" }, { "api_name": "time.time", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line...
30043796448
# -*- coding: utf-8 -*- import scrapy from scrapy.selector import Selector from scrapy.http import Request,FormRequest import requests import json import re import uuid import hashlib import logging import subprocess from datetime import datetime,date from autodata.items import AutodataItem, MetaItem class AlfarooqSpi...
vartika102/Web-Scraping
spiders/alfarooq.py
alfarooq.py
py
4,571
python
en
code
0
github-code
6
[ { "api_name": "scrapy.Spider", "line_number": 15, "usage_type": "attribute" }, { "api_name": "scrapy.http.Request", "line_number": 24, "usage_type": "call" }, { "api_name": "autodata.items.MetaItem", "line_number": 28, "usage_type": "call" }, { "api_name": "autoda...
3098913797
#! /usr/bin/env python3 # coding=utf-8 import pytest def Fibonacci(n): if n<0: print("No") elif n==1: return 1 elif n==0: return 0 else: return Fibonacci(n-1)+Fibonacci(n-2) def factorial(m): fac=1 for i in range(1,m+1): fac=fac*i return fac class Tes...
songx2-xy/Fibonacci
Fibonacci.py
Fibonacci.py
py
725
python
en
code
0
github-code
6
[ { "api_name": "pytest.main", "line_number": 31, "usage_type": "call" } ]
35809892192
import nltk from newspaper import Article from nltk.sentiment.vader import SentimentIntensityAnalyzer from runner.console_monochrome import Console logger = Console() nltk.download('vader_lexicon') #from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer # using https://www.forbes.com/sites/katinastefan...
meko-deng/ECSE456
manipulation/vader_sentiment.py
vader_sentiment.py
py
3,441
python
en
code
0
github-code
6
[ { "api_name": "runner.console_monochrome.Console", "line_number": 6, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 8, "usage_type": "call" }, { "api_name": "nltk.sentiment.vader.SentimentIntensityAnalyzer", "line_number": 20, "usage_type": "call" ...
19922305657
import requests import re # make a request to get a specific page r = requests.get('https://www.basketball-reference.com/playoffs/') # get the response text (the HTML) webpage_HTML = r.text # write a regex to parse the champions champions_regex = r"<td class=\"left \" data-stat=\"champion\" ><a href=\".*?([\d]*?).h...
samuelfullerthomas/python-web-scraper
scraper.py
scraper.py
py
903
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 17, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 18, "usage_type": "call" } ]
1820553170
import time import traceback from datetime import timedelta, datetime import random import subprocess import shutil import os import sys import traceback from minio import Minio from minio.error import (ResponseError, BucketAlreadyOwnedByYou, BucketAlreadyExists) import urllib.request import re...
jhodges10/goes-dashboard-pub
server/basic_image_tool.py
basic_image_tool.py
py
5,728
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path", "line_num...
70926699388
import numpy as np import json import os import geopandas as gp import rasterio from matplotlib.colors import LightSource from pyproj import Transformer, Proj import utils as reutil import tempfile import urllib.request import rasterio.windows from rasterio.transform import Affine #ll_proj = Proj('epsg:4326') #dep_pro...
jetolan/warner_dixie_fire
src/usgs_dsm.py
usgs_dsm.py
py
5,582
python
en
code
0
github-code
6
[ { "api_name": "rasterio.windows.Window", "line_number": 67, "usage_type": "call" }, { "api_name": "rasterio.windows", "line_number": 67, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 78, "usage_type": "call" }, { "api_name": "os.path"...
12062260040
import requests from bs4 import BeautifulSoup from pyecharts.charts import Bar from pyecharts import options as opts ALL_DATA =[] def parse_page(url,num): url = url headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.3...
hireach/hireach
day01/zhongguotianqi.py
zhongguotianqi.py
py
2,165
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 20, "usage_type": "call" }, { "api_name": "pyecharts.charts.Bar...
41297486703
"""Тестирование моделей для работы с товарами.""" from datetime import date from freezegun import freeze_time import pytest from dateutil.relativedelta import relativedelta from wares.models import Category, Wares, Order @pytest.mark.django_db def test_create_models(): """Тест создания записей.""" assert C...
moFrant/skypro_test
tests/models/test_wares.py
test_wares.py
py
3,377
python
en
code
0
github-code
6
[ { "api_name": "wares.models.Category.objects.count", "line_number": 15, "usage_type": "call" }, { "api_name": "wares.models.Category.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "wares.models.Category", "line_number": 15, "usage_type": "name" ...
14025927759
""" @author: Yuhao Cheng @contact: yuhao.cheng[at]outlook.com """ import abc import glob import os from collections import OrderedDict from torch.utils.data import Dataset from .readers import ImageLoader, VideoLoader from ..datatools_registry import DATASET_REGISTRY __all__ = ['AbstractVideoDataset', 'Fr...
YuhaoCheng/PyAnomaly
pyanomaly/datatools/abstract/video_dataset.py
video_dataset.py
py
9,568
python
en
code
107
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 14, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 31, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 32, "usage_type": "call" }, { "api_name...
15785238873
from django.urls import path, include, re_path from . import views from .models import Elective from .views import ( ElectiveListView, ElectiveDetailView, CommentCreateView ) # import csv urlpatterns = [ path('', ElectiveListView.as_view(), name='electives-home'), path('about/', views...
ankit8697/jindal-electives
electives/urls.py
urls.py
py
623
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "views.ElectiveListView.as_view", "line_number": 12, "usage_type": "call" }, { "api_name": "views.ElectiveListView", "line_number": 12, "usage_type": "name" }, { "api_name":...
71971225469
from __future__ import absolute_import from __future__ import division from __future__ import print_function import base64 import json import os import subprocess from containerregistry.client import docker_name class BadManifestException(Exception): """Exception type raised when a malformed manifest is encounte...
kubeflow/fairing
containerregistry/client/v2/util_.py
util_.py
py
3,900
python
en
code
336
github-code
6
[ { "api_name": "base64.urlsafe_b64decode", "line_number": 43, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 48, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 74, "usage_type": "call" }, { "api_name": "json.dumps", "line...
19152583674
""" Message of the Day (motd) to add a pinch of salt... Motd help to cheer you up on a long day or even to get the started in the first place. """ from random import randint # https://stackoverflow.com/questions/6028000/how-to-read-a-static-file-from-inside-a-python-package try: import importlib.resources as pkg...
fsteppich/fsteppich-datascience-utilities
fs_ds_util/motd.py
motd.py
py
973
python
en
code
0
github-code
6
[ { "api_name": "importlib_resources.open_text", "line_number": 20, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 34, "usage_type": "call" } ]
39476534235
import requests import json from lxml import etree class Wyjy(): def __init__(self): self.url='http://www.51jiuyi.cn/ask/list_21_0_1_1.html' self.headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36"} ...
zhang8929/zhangyuguang
zhangbingshen/erbihou.py
erbihou.py
py
2,428
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "line_number": 30, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 30, "usage_type": "name" }, { "api_name": "requests.get", "line_numb...
25070688585
""" purplship server graph module urls """ import pydoc import typing from django.conf import settings from django.urls import path from django.views.decorators.csrf import csrf_exempt from graphene_django.views import GraphQLView as BaseGraphQLView from rest_framework import exceptions ACCESS_METHOD = getattr( se...
danh91/purplship
server/modules/graph/purplship/server/graph/urls.py
urls.py
py
1,491
python
en
code
null
github-code
6
[ { "api_name": "django.conf.settings", "line_number": 13, "usage_type": "argument" }, { "api_name": "typing.Any", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pydoc.locate", "line_number": 17, "usage_type": "call" }, { "api_name": "graphene_django...
12109867770
import os import numpy as np import pandas as pd from pandas import DataFrame import xlsxwriter import matplotlib.pyplot as plt import seaborn as sns import scipy from scipy.stats import fisher_exact from sklearn.feature_selection import mutual_info_regression import warnings warnings.filterwarnings("ignore") path...
Eugene-Ovcharenko/CABG_register_analysis
data_stat.py
data_stat.py
py
5,577
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 16, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 23, "usage_type": "name" }, { "api_name": "pandas.DataFrame...
23044171592
from django.contrib.auth import get_user_model from django.db import models from core.models import DateAbstractModel User = get_user_model() class Post(DateAbstractModel): text = models.TextField( 'Текст поста', help_text='Введите текст поста' ) author = models.ForeignKey( User,...
rshafikov/hw05_final
yatube/posts/models.py
models.py
py
2,620
python
ru
code
1
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 6, "usage_type": "call" }, { "api_name": "core.models.DateAbstractModel", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.models.TextField", "line_number": 10, "usage_type": "call" }, ...
30815175471
from typing import Tuple def powerset(s): x = len(s) masks = [1 << i for i in range(x)] for i in range(1 << x): yield frozenset({ss for mask, ss in zip(masks, s) if i & mask}) def divide(b: float, a: float) -> Tuple[float, float]: """ Returns the quotient and positive remainder as a tupl...
Wroppy/werry_math
mathmatics/abstract/algebra/method.py
method.py
py
2,251
python
en
code
0
github-code
6
[ { "api_name": "typing.Tuple", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 54, "usage_type": "name" } ]
40543737940
import sys from typing import Generator, Optional, List from dataclasses import dataclass from lark import Lark, Transformer, v_args from lark.ast_utils import Ast as LarkAST, WithMeta, create_transformer from lark.tree import Meta class AST(LarkAST): pass @dataclass class Name(AST): name: str @dataclass...
vityaman-edu/ai-prolog
src/parse.py
parse.py
py
1,941
python
en
code
0
github-code
6
[ { "api_name": "lark.ast_utils.Ast", "line_number": 10, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Gener...
3971506694
from setuptools import setup APP = ['main.py'] DATA_FILES = ['images', 'images'] OPTIONS = { 'argv_emulation': True } setup( app=APP, data_files=DATA_FILES, options={'py2app': OPTIONS}, setup_requires=['py2app'] ) from setuptools import setup import os APP = ['manage.py'] DATA_DIRS = ['reverseR...
TahirAlauddin/KonnectedReverseRaffle
setup.py
setup.py
py
973
python
en
code
0
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 9, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28,...
37377301276
import os import json from sbfl.base import SBFL import numpy as np from settings import TESTCASES_RESULT_PATH, THRESHOLD_LINE_NUM, MAX_OUTPUT_LINE, RESULT_FILE def start_fl(result_vector, coverage_matrix, file_line_map): if result_vector.count(True) == 0: # 全部测试点WA message = "所有测试点均WA,无法定位错误位置" ...
Fewing/compilify-sbfl
fault_location.py
fault_location.py
py
3,613
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "settings.TESTCASES_RESULT_PATH", "line_number": 12, "usage_type": "argument" }, { "api_name": "settings.RESULT_FILE", "line_number": 12, "usage_type": "argument" }, { "api_name...
19679465860
# -*- coding: utf-8 -*- # ************************************************************************** # * # * Authors: Scipion Team # * # * National Center of Biotechnology, CSIC, Spain # * # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public Licen...
scipion-em/scipion-em-pyseg
pyseg/protocols/protocol_pre_seg.py
protocol_pre_seg.py
py
14,793
python
en
code
2
github-code
6
[ { "api_name": "enum.Enum", "line_number": 48, "usage_type": "name" }, { "api_name": "tomo.objects.SetOfSubTomograms", "line_number": 49, "usage_type": "name" }, { "api_name": "tomo.objects.SetOfTomoMasks", "line_number": 50, "usage_type": "name" }, { "api_name": "...
32822168326
import sys sys.path.append("../wikisearch") import unittest import wikisearch from wikisearch.searcher.searcher_util import * from wikisearch.searcher.filter import * from wikisearch.searcher.score import * from wikisearch.searcher.search import searcher import logging logging.basicConfig(level=logging.INFO) import t...
QimingZheng/WSM-Project-WikiSearch
testings/test_searcher.py
test_searcher.py
py
9,305
python
en
code
4
github-code
6
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO", "l...
25237823622
import os import math import random import logging import argparse import numpy as np from tokenizers import Tokenizer import tokenizers from tokenizers.trainers import BpeTrainer from tokenizers.pre_tokenizers import Whitespace, ByteLevel from tokenizers.models import BPE from tokenizers.decoders import ByteLevel as ...
berlino/btg-seq2seq
neural_btg/commands/train_utils.py
train_utils.py
py
13,624
python
en
code
12
github-code
6
[ { "api_name": "neural_btg.utils.setup_logger", "line_number": 20, "usage_type": "call" }, { "api_name": "tokenizers.Tokenizer", "line_number": 87, "usage_type": "call" }, { "api_name": "tokenizers.models.BPE", "line_number": 87, "usage_type": "call" }, { "api_name...
22846400166
import pandas as pd import numpy as np from scipy import stats from statsmodels.stats.diagnostic import lilliefors data = pd.read_excel("project1.xlsx" ) data = pd.DataFrame(data) #models x = data.loc[data["Модель"]==1]["Дальность"].tolist() y = data.loc[data["Модель"]==2]["Дальность"].tolist() z = data.loc[data["Мо...
semtim/DS2021
проект 1 (самолеты)/flightsP.py
flightsP.py
py
1,368
python
ru
code
0
github-code
6
[ { "api_name": "pandas.read_excel", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 7, "usage_type": "call" }, { "api_name": "scipy.stats.kruskal", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.stats", ...
650354747
#! /bin/python # IMPORTANT do threadctl import first (before numpy imports) from threadpoolctl import threadpool_limits import os import sys import json import numpy as np import luigi import nifty.tools as nt from scipy.ndimage.morphology import distance_transform_edt import cluster_tools.utils.volume_utils as vu ...
constantinpape/cluster_tools
cluster_tools/morphology/region_centers.py
region_centers.py
py
5,902
python
en
code
32
github-code
6
[ { "api_name": "luigi.Task", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "luigi.Parameter", "l...
30594027920
from django.urls import path from .views import index, mostratabela, contato, adicionar, excluir, editar, resumo urlpatterns = [ path('', index, name='index'), path('mostratabela/<str:tabela>', mostratabela, name='mostratabela'), path('contato/', contato, name='contato'), path('adicionar/', adicionar, ...
ErickFernan/Mercadinho-Web-CRUD
core/urls.py
urls.py
py
475
python
pt
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "views.index", "line_number": 5, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "views.mostratabela", ...
37952011714
# Import the necessary modules import os import csv import openpyxl SCRIPT_LOC = os.path.abspath(__file__) # Construct a path to get location of the current script(csvToExcelConverter.py) SCRIPT_DIR = os.path.dirname(SCRIPT_LOC) # Get the directory where the script(csvToExcelConverter.py) is located ROOT_DIR = ...
8anime/Csv2Excel-Converter
dataConverter/csvToExcelConverter.py
csvToExcelConverter.py
py
3,039
python
en
code
0
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
19399703099
from typing import List # 课程表 # https://leetcode-cn.com/problems/course-schedule/ class Solution: graph_valid = True def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool: edges = [[] for _ in range(numCourses)] # 0未搜索 1搜索中 2已搜索 visited = [0] * numCourses ...
Yigang0622/LeetCode
canFinish.py
canFinish.py
py
1,239
python
en
code
1
github-code
6
[ { "api_name": "typing.List", "line_number": 11, "usage_type": "name" } ]
8492342326
import sqlite3 class DB: def __init__(self): self.con = sqlite3.connect("SIFRE_YONETIM.db") # Veritabani varsa baglanir, yoksa olusturur ve baglanir self.cursor = self.con.cursor() tablo_sql = '''CREATE TABLE IF NOT EXISTS SIFRELER( Id INTEGER Primary Ke...
kagandedeturk/CreativeHubYazilim
Python Dersleri/Ders16/sifre_uret_proje/ProjeDB.py
ProjeDB.py
py
1,369
python
tr
code
5
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 8, "usage_type": "call" } ]
72274908029
import random from typing import Tuple, List from math import lcm from sympy import gcd random.seed(42) STARKFp = 3618502788666131213697322783095070105623107215331596699973092056135872020481 BN254Fp = 21888242871839275222246405745257275088696311157297823662689037894645226208583 p = STARKFp q = BN254Fp n = 3 # number...
keep-starknet-strange/garaga
tests/python_tests/casting_out_primes.py
casting_out_primes.py
py
5,020
python
en
code
113
github-code
6
[ { "api_name": "random.seed", "line_number": 5, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 17, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number...
43970241176
#!/usr/bin/env python import sys import copy import logging import argparse from CPT_GFFParser import gffParse, gffWrite logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) def fix_genemarks(gff3): for rec in gffParse(gff3): new_features = [] for feature in rec.features: ...
TAMU-CPT/galaxy-tools
tools/gff3/gff3_fix_genemarks.py
gff3_fix_genemarks.py
py
1,051
python
en
code
5
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "CPT_GFFParser.gf...
26330243375
from torch.utils.data import Dataset from PIL import Image class DogsDataset(Dataset): def __init__(self, labels, root_dir, subset=False, transform=None): self.labels = labels self.root_dir = root_dir self.transform = transform def __len__(self): return len(self.labels) ...
francescorubbo/DogBreed
utils.py
utils.py
py
952
python
en
code
0
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 4, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 16, "usage_type": "name" }, { "api_name": "numpy.array", "l...
23513945230
from urllib.parse import quote_plus from bs4 import BeautifulSoup from selenium import webdriver baseUrl = 'https://www.google.com/search?q=' plusUrl = input('무엇을 검색할까요? :') url = baseUrl + quote_plus(plusUrl) # 한글은 인터넷에서 바로 사용하는 방식이 아니라, quote_plus가 변환해줌 # URL에 막 %CE%GD%EC 이런 거 만들어주는 친구 driver = webdriver.Chrome(exe...
sooheeoh/python_trial
google_crawling.py
google_crawling.py
py
847
python
en
code
0
github-code
6
[ { "api_name": "urllib.parse.quote_plus", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "b...
36307808456
# -*- coding: utf-8 -*- # =========================== Author and Copyright. =========================== # Author: Hiroki TAKAGAHARA(Hexadrive Inc.) # Licence: MIT License (https://opensource.org/licenses/mit-license.php) # ============================================================================= import xml.etr...
hexagit/MayaPythonGuiDemo
demowindow.py
demowindow.py
py
2,254
python
en
code
1
github-code
6
[ { "api_name": "PySide.QtGui.QPixmap", "line_number": 27, "usage_type": "call" }, { "api_name": "PySide.QtCore.Qt.KeepAspectRatio", "line_number": 28, "usage_type": "attribute" }, { "api_name": "PySide.QtCore.Qt", "line_number": 28, "usage_type": "name" }, { "api_n...
6105849643
import requests import sys import urllib3 from bs4 import BeautifulSoup import re urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) proxies = {'http': 'http://127.0.0.1:8080', 'https': 'http://127.0.0.1:8080'} def get_csrf_token(s, url): r = s.get(url, verify=False, proxies=proxies) soup =...
rkhal101/Web-Security-Academy-Series
business-logic-vulnerabilities/lab-10/business-logic-flaw-lab-10.py
business-logic-flaw-lab-10.py
py
3,074
python
en
code
396
github-code
6
[ { "api_name": "urllib3.disable_warnings", "line_number": 7, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 7, "usage_type": "attribute" }, { "api_name": "bs4.BeautifulSoup", "line_number": 13, "usage_type": "call" }, { "api_name": "re.f...
73790989309
from typing import Tuple, List from abstract_puzzles import AbstractPuzzles DATA_TYPE = List[int] class Puzzles(AbstractPuzzles): def __init__(self, method_name): super().__init__( method_name, day=20, puzzle_1_example_answer=3, puzzle_1_answer=7225, ...
Lynxens/AdventOfCode2022
advent_of_code/day20.py
day20.py
py
1,700
python
en
code
4
github-code
6
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" }, { "api_name": "abstract_puzzles.AbstractPuzzles", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.List",...
30575388870
from __future__ import division, print_function from PyQt5 import QtCore, QtWidgets, QtGui class EditDownsampleDialog(QtWidgets.QDialog): """ """ def __init__(self, points, xloc=None, yloc=None): """ Args: points: xloc: yloc: """ super...
jmilhone/piscope
source/gui/downsample_dialog.py
downsample_dialog.py
py
1,876
python
en
code
2
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 5, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 5, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QIcon", "line_number": 19, "usage_type": "call" }, { "api_name": "PyQt5.Qt...
70820329149
import torch import torch.nn as nn import torch.nn.functional as F class ExtractorHead(nn.Module): def __init__(self, ext, head): super(ExtractorHead, self).__init__() self.ext = ext self.head = head self.head.fc.weight = nn.parameter.Parameter(F.normalize(self.head.fc.weight.data, dim=-1)) def forward(sel...
devavratTomar/TeSLA
networks/classification/ssh.py
ssh.py
py
533
python
en
code
15
github-code
6
[ { "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.Parameter", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn.par...
39071221244
"""View module for handling requests about movieNights""" from django.contrib.auth.models import User #pylint:disable=(imported-auth-user) from django.core.exceptions import ValidationError from django.http import HttpResponseServerError from rest_framework import status from rest_framework.decorators import action fro...
Nickarmani03/WhoDunIt-Server
whodunitapi/views/movie_night.py
movie_night.py
py
7,115
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.viewsets.ViewSet", "line_number": 14, "usage_type": "name" }, { "api_name": "whodunitapi.models.Player.objects.get", "line_number": 22, "usage_type": "call" }, { "api_name": "whodunitapi.models.Player.objects", "line_number": 22, "usage_type"...
38257517815
# Databricks notebook source # MAGIC %md # MAGIC ###Intesting qualifying folder # COMMAND ---------- dbutils.widgets.text("p_data_source","") v_data_source=dbutils.widgets.get("p_data_source") # COMMAND ---------- # MAGIC %run "../includes/configuration" # COMMAND ---------- # MAGIC %run "../includes/common_comma...
kpkrishan/Formula-1-Data-Analysis
data ingestion/qualifying_folder_ingestion.py
qualifying_folder_ingestion.py
py
2,458
python
en
code
0
github-code
6
[ { "api_name": "pyspark.sql.types.StructType", "line_number": 29, "usage_type": "call" }, { "api_name": "pyspark.sql.types.StructField", "line_number": 29, "usage_type": "call" }, { "api_name": "pyspark.sql.types.IntegerType", "line_number": 29, "usage_type": "call" }, ...
11221575931
from selenium import webdriver driver_add = 'C:\\Users\\roy79\\Desktop\\Research\\product-analysis\\walmart_scraper\\chromedriver.exe' def sel_get_url(url): options = webdriver.ChromeOptions() options.add_argument('--ignore-certificate-errors') options.add_argument('--headless') driver = webdriver.Ch...
renyc432/headphone-product-analysis
selenium_helper.py
selenium_helper.py
py
542
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 10, "usage_type": "call" }, { "api_n...
72532302589
# pylint:disable=unused-variable # pylint:disable=unused-argument # pylint:disable=redefined-outer-name # pylint:disable=protected-access # pylint:disable=no-value-for-parameter import datetime from dataclasses import dataclass from typing import Any, Final from uuid import uuid4 import networkx as nx import pytest ...
ITISFoundation/osparc-simcore
services/director-v2/tests/unit/test_utils_dags.py
test_utils_dags.py
py
22,843
python
en
code
35
github-code
6
[ { "api_name": "models_library.projects.NodesDict", "line_number": 35, "usage_type": "name" }, { "api_name": "simcore_service_director_v2.utils.dags.create_complete_dag", "line_number": 38, "usage_type": "call" }, { "api_name": "networkx.is_directed_acyclic_graph", "line_numbe...
13906198620
import pandas as pd from sklearn.linear_model import LogisticRegression from sklearn.cross_validation import train_test_split def create_samples(df, fraction_for_testing): '''Given a dataframe and fraction for testing data (given as decimal), splits the data into random samples of training and testing data. ...
lmcindewar/CAPP30254-lmcindewar
Assignment2/models.py
models.py
py
1,274
python
en
code
0
github-code
6
[ { "api_name": "sklearn.linear_model.LogisticRegression", "line_number": 31, "usage_type": "call" } ]
33257829967
import pandas as pd from flask import Blueprint, render_template, request, redirect, url_for from flask_login import login_required, current_user from kino_app import visit_count from utils import get_db_connection from kino_app.models.kino_model import * main = Blueprint('main', __name__) @main.route('/') def main...
Aight99/cinema-database-flask
kino/kino_app/routes/main_route.py
main_route.py
py
3,624
python
en
code
1
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 9, "usage_type": "call" }, { "api_name": "utils.get_db_connection", "line_number": 14, "usage_type": "call" }, { "api_name": "flask_login.current_user.is_authenticated", "line_number": 16, "usage_type": "attribute" }, { ...
31086445870
import os from dotenv import load_dotenv from tkinter import Tk, PhotoImage from ui.ui import UI from ui.buttons import Buttons dirname = os.path.dirname(__file__) try: load_dotenv(dotenv_path=os.path.join(dirname, "..", ".env")) except FileNotFoundError: print("not found") window = Tk() window.title("Shakuhac...
ElectricShakuhachi/shakunotator
src/index.py
index.py
py
556
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "dotenv.load_dotenv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line...
19951879467
from django import forms from django.forms import Textarea, ChoiceField, CharField from crispy_forms.bootstrap import InlineCheckboxes from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout from ajax_select.fields import AutoCompleteSelectField from .models import FeedBack, Comment, Rating...
Baradys/star_wars
movies/forms.py
forms.py
py
3,223
python
en
code
0
github-code
6
[ { "api_name": "django.forms.ModelForm", "line_number": 13, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 13, "usage_type": "name" }, { "api_name": "models.FeedBack", "line_number": 15, "usage_type": "name" }, { "api_name": "django.forms...
24958733359
import bpy from bpy.props import * from bpy.types import Node, NodeSocket from arm.logicnode.arm_nodes import * class BoneIKNode(Node, ArmLogicTreeNode): '''Bone Inverse Kinematics node''' bl_idname = 'LNBoneIKNode' bl_label = 'Bone IK' bl_icon = 'QUESTION' def init(self, context): self.in...
phillipmacon/armory-3d-engine
blender/arm/logicnode/animation_bone_ik.py
animation_bone_ik.py
py
618
python
en
code
0
github-code
6
[ { "api_name": "bpy.types.Node", "line_number": 6, "usage_type": "name" } ]
35026741683
def warn(*args, **kwargs): pass import warnings warnings.warn = warn from sklearn.preprocessing import FunctionTransformer from reskit.norms import binar_norm, wbysqdist from reskit.norms import spectral_norm from reskit.features.degree import degrees from sklearn.feature_selection import VarianceThreshold fr...
neuro-ml/PRNI2016
calculation.py
calculation.py
py
7,073
python
en
code
0
github-code
6
[ { "api_name": "warnings.warn", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 40, "usage_type": "call" }, { "api_name": "pandas.core", "lin...
6957640835
import pycld2 as cld2 import argparse argparser = argparse.ArgumentParser() argparser.add_argument('-s', '--srcLang', required=True, help='Short version of the source language') argparser.add_argument('-t', '--trgLang', required=False, help='Short version of the target language') argparser.add_argument('-sc', '--srcc'...
akshairamesh/Lores_DA_Assignment
cleaning_scripts/cld2_clean.py
cld2_clean.py
py
2,405
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" }, { "api_name": "pycld2.detect", "line_number": 32, "usage_type": "call" }, { "api_name": "pycld2.detect", "line_number": 36, "usage_type": "call" } ]
8784078157
''' Author: allendred Date: 2023-05-20 17:51:00 LastEditors: allendred LastEditTime: 2023-05-23 09:59:50 FilePath: /Play-Monopoly-like-with-ChatGPT/src/prompts/prompts.py Description: Follow your heart ''' import os import openai from dotenv import load_dotenv load_dotenv(verbose=True) # Load your API key from an env...
allendred/Play-Monopoly-like-with-ChatGPT
src/prompts/prompts.py
prompts.py
py
839
python
en
code
3
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 13, "usage_type": "call" }, { "api_name": "openai.api_key", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 16, "usage_type": "call" }, { "api_name": "openai.api_key", ...
36544786628
""" chess using mcts """ import mcts import chess import math import numpy as np from random import choice from pprint import pprint NUMBER_OF_PLAYOUTS = 100 MAX_PLAYOUT_LEN = 50 class UctSelectPolicy: @staticmethod def uct(node): if node.playout_count == 0: return 10000 # return high ...
joshsteiner/szachy-si
deprecated/mcts.py
mcts.py
py
5,546
python
en
code
0
github-code
6
[ { "api_name": "math.sqrt", "line_number": 23, "usage_type": "call" }, { "api_name": "math.log", "line_number": 23, "usage_type": "call" }, { "api_name": "chess.status", "line_number": 38, "usage_type": "call" }, { "api_name": "chess.IN_PROGRESS", "line_number"...
9836277081
import maya.cmds as cmds import random, math ''' List of procedures in the module: def convertToRgb(colour): Converts hue, saturation and brightness of a colour to corresponding RGB value. def getRandomValue(range): Picks a random value between a start point and endpoint, wrapping back to 0 ...
hcbsundberg/City_Generator
cityGenerator/tools.py
tools.py
py
2,987
python
en
code
0
github-code
6
[ { "api_name": "random.uniform", "line_number": 54, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 56, "usage_type": "call" }, { "api_name": "maya.cmds.sets", "line_number": 72, "usage_type": "call" }, { "api_name": "maya.cmds", "line_nu...
74261585147
from google.cloud import storage from datetime import datetime from dotenv import load_dotenv import pandas as pd from time import time import os key_path = os.path.join('infrastructure/credentials/key.json') class StorageProvider: def __init__(self, bucket): self.client = storage.Client.from_s...
Adriana031991/process-matches-python
infrastructure/external/storage_provider.py
storage_provider.py
py
994
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "google.cloud.storage.Client.from_service_account_json", "line_number": 12, "usage_type": "call" }, { "api...
25534291141
from django.core.management.base import BaseCommand from location.models import Region class Command(BaseCommand): def handle(self, *args, **options): kantoni = ['Sarajevo', 'Unsko-sanski', 'Posavski', 'Tuzlanski', 'Zeničko-dobojski', 'Bosansko-podrinjski', 'Srednjobosanski', 'Hercego...
HarunColic/ZizaRepo
post/management/commands/KantoniRegije.py
KantoniRegije.py
py
586
python
hr
code
0
github-code
6
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 5, "usage_type": "name" }, { "api_name": "location.models.Region", "line_number": 15, "usage_type": "call" } ]
30985237204
import tensorflow as tf import numpy as np import gym from dqn import dqn def add_dense(inputs, output_size, activation=None, kernel_initializer=None, name="default"): layer = tf.layers.dense(inputs, output_size, activation=activation, kernel_initializer=kernel_initializer, name=name) with tf.variable_s...
Osj1614/tensorboard_guide
cartpole.py
cartpole.py
py
4,085
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.layers.dense", "line_number": 7, "usage_type": "call" }, { "api_name": "tensorflow.layers", "line_number": 7, "usage_type": "attribute" }, { "api_name": "tensorflow.variable_scope", "line_number": 8, "usage_type": "call" }, { "api_name": ...
3979243202
import streamlit as st import tensorflow as tf import numpy as np from urllib.request import urlopen # rdn = RDN(weights='psnr-small') from tensorflow import keras from tensorflow.keras.preprocessing import image import pandas as pd from sklearn.neighbors import NearestNeighbors from tensorflow.keras.applications.resne...
Hira-Naseer/ImageClassification_ReverseImageSearch
main.py
main.py
py
6,132
python
en
code
0
github-code
6
[ { "api_name": "os.listdir", "line_number": 39, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 40, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 42, "usage_type": "call" }, { "api_name": "tensorflow.keras.applications.resnet...
73783137149
import grovepi from grovepi import * from grove_rgb_lcd import * from time import sleep from math import isnan import csv import socket, struct, dweepy, time, platform, random import sqlite3 from sqlite3 import Error thingName = [] thingRate = [] #newRate = map(lambda line: [int(x) for x in line],thingRate) from s...
jackbourkemckenna/IOT-data
data.py
data.py
py
2,976
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 17, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 20, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 22, "usage_type": "call" }, { "api_name": "time.sleep", "lin...
41877671346
import os import json import copy import pickle import logging import numpy as np import matplotlib.pyplot as plt import torch import torch.nn.init import torch.nn as nn from torch.nn import functional as F from utils import utils, imsitu_scorer, imsitu_loader, imsitu_encoder from models import ggnn_baseline, ggnn_r2...
haofanwang/KGRN-SR
visualization/role_accuracy.py
role_accuracy.py
py
11,060
python
en
code
1
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 17, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 20, "usage_type": "call" }, { "api_name": "argparse.ArgumentPars...
19064410808
from flask import request, Blueprint from api.ver1.utils import field_missing_resp, runtime_error_resp, \ not_found_resp, check_form_data, no_entry_resp from api.ver1.offices.controllers import OfficeCont from api.strings import name_key, post_method, get_method, type_key, ok_str from api.ver1.offices.strings ...
pcf26536/politico-api
api/ver1/offices/endpoints.py
endpoints.py
py
1,696
python
en
code
1
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 14, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 14, "usage_type": "name" }, { "api_name": "api.strings.po...
70860770428
import os import sys sys.path.append("..") from utils.graph_builder_uitls import OPPOSITE, TreeNode, json_loader, json_saver, node_box_update, posotion_judge def get_item(id,list): for item in list: if id==item["id"]: return item def get_line_bbox(bboxs): x = [bboxs[i][j] for i in ran...
Line-Kite/GraphLayoutLM
data/cord/graph_cord.py
graph_cord.py
py
5,386
python
en
code
1
github-code
6
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "utils.graph_builder_uitls.posotion_judge", "line_number": 63, "usage_type": "call" }, { "api_name": "...
13122900142
import json import random import pandas as pd import numpy as np import torch from torch import nn from sklearn.metrics import f1_score from sklearn.utils import shuffle from sklearn.utils.class_weight import compute_class_weight from transformers import AutoModel, BertTokenizer from utils import get_labels, ...
DimitrisPatiniotis/Human-Value-Detection
dpat/bert_with_svm/finetune_bert.py
finetune_bert.py
py
7,795
python
en
code
3
github-code
6
[ { "api_name": "utils.get_column", "line_number": 31, "usage_type": "call" }, { "api_name": "utils.get_labels", "line_number": 34, "usage_type": "call" }, { "api_name": "utils.get_column", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.DataFrame",...
21347362745
# -*- coding: utf-8 -*- """ @author: vv """ import os import math import pandas as pd import numpy as np import networkx as nx from tkinter import _flatten from collections import Counter from rdkit import Chem from rdkit.Chem.rdchem import Mol,Atom from rdkit.Chem import BRICS from rdkit.Chem.rdmolfile...
XiaowenDAI/KID
codes/0.merge_fragment_pairs.py
0.merge_fragment_pairs.py
py
21,726
python
en
code
5
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "rdkit.Chem.MolFromSmiles", "line_number": 39, "usage_type": "call" }, { "api_name": "rdkit.Chem", "line_number": 39, "usage_type": "name" }, { "api_name": "rdkit.Chem.MolSta...
25274232770
from itertools import combinations N = int(input()) str_num = [str(n) for n in range(9, -1, -1)] arr = [] for i in range(1, 11): comb_nums = list(combinations(str_num, i)) for comb_num in reversed(comb_nums): arr.append(''.join(comb_num)) if N < len(arr): print(arr[N]) else: print(-1)
powerticket/algorithm
자정까지 방탈출 시즌1/0125_1038_2.py
0125_1038_2.py
py
311
python
en
code
0
github-code
6
[ { "api_name": "itertools.combinations", "line_number": 7, "usage_type": "call" } ]
38453793622
import sys input = sys.stdin.readline from itertools import combinations class vector: def __init__(self,p1,p2): self.x = p2[0]-p1[0] self.y = p2[1]-p1[1] def __repr__(self): return (self.x,self.y) def dotProd(v1,v2): return v1.x*v2.x + v1.y*v2.y n = int(input()) L = [list(map(in...
LightPotato99/baekjoon
math/geometry/triangle/rightTri.py
rightTri.py
py
585
python
en
code
0
github-code
6
[ { "api_name": "sys.stdin", "line_number": 2, "usage_type": "attribute" }, { "api_name": "itertools.combinations", "line_number": 18, "usage_type": "call" } ]
23054466223
import whisper import gradio as gr import time from pyChatGPT import ChatGPT import warnings import os from gtts import gTTS warnings.filterwarnings('ignore') try: secret_token = os.environ['CHATGPT_SESSION_TOKEN'] except: input('Please enter your ChatGPT session token: ') model = whisper.load_model('base')...
liam-e/chatgpt-voice
main.py
main.py
py
1,449
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "whisper.load_model", "line_number": 16, "usage_type": "call" }, { "api_name": "whisper.lo...
35401703408
import random import matplotlib.pyplot as plt import numpy as np #Reading in data file for round 6: rps_file = open('rpsdataset.txt', encoding="utf8") text = rps_file.read() #Round 0: The setup roundd = 0 #Roundd will keep track of our stages, which will be how we're going to navigate what we're doing at each turn w...
ewong30/web
AnnualCS/final/Python Final Project/Python_Project.py
Python_Project.py
py
25,686
python
en
code
0
github-code
6
[ { "api_name": "random.choice", "line_number": 75, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 284, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 428, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title",...
14703256307
from datetime import datetime from os.path import dirname, join import pytest from city_scrapers_core.constants import BOARD, COMMITTEE from city_scrapers_core.utils import file_response from freezegun import freeze_time from city_scrapers.items import Meeting from city_scrapers.spiders.lawa import LawaSpider test_r...
washabstract/city-scrapers-ca
tests/test_lawa.py
test_lawa.py
py
4,737
python
en
code
1
github-code
6
[ { "api_name": "city_scrapers_core.utils.file_response", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "c...
7555775668
from flask import Blueprint, render_template, request, redirect, abort, url_for from paapas.pa.pa_db import get_from_db, add_to_db, remove_from_db from paapas.pa import options, input_types from pymongo import DESCENDING, ASCENDING bp_ui = Blueprint('ui', __name__, url_prefix='/ui') @bp_ui.route('/') def home(): ...
adamurish/computer
paapas/pa/ui.py
ui.py
py
2,079
python
en
code
1
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 17, "usage_type": "call" }, { "api_name": "paapas.pa.options", "line_number": 18, "usage_type": "name" }, { "api_name": "paapas.pa.pa_d...
8642724034
import pytest from trainspotting import SingletonDependenciesContainer @pytest.mark.parametrize( 'container_type, expected_is_same_instance', ((SingletonDependenciesContainer, True),), ) def test_dependencies_containers(container_type, expected_is_same_instance): container = container_type() class T...
avito-tech/trainspotting
tests/test_containers.py
test_containers.py
py
1,737
python
en
code
5
github-code
6
[ { "api_name": "pytest.mark.parametrize", "line_number": 6, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 6, "usage_type": "attribute" }, { "api_name": "trainspotting.SingletonDependenciesContainer", "line_number": 8, "usage_type": "name" }, { ...
21521002202
import aiohttp import asyncio async def register(session, i): # login payload = { "username": f"并发测试用户_{i:05}", "password": "123" } resp = await session.post('https://729222.iterator-traits.com/auth/login', json=payload) cookies = resp.cookies # register payload = { ...
AerysNan/ChallengeHub
utils/bulk_register_contest.py
bulk_register_contest.py
py
1,086
python
en
code
0
github-code
6
[ { "api_name": "aiohttp.ClientSession", "line_number": 25, "usage_type": "call" }, { "api_name": "asyncio.gather", "line_number": 31, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 35, "usage_type": "call" } ]
650290187
#! /bin/python import os import sys import json import pickle import numpy as np import luigi from sklearn.ensemble import RandomForestClassifier import cluster_tools.utils.volume_utils as vu import cluster_tools.utils.function_utils as fu from cluster_tools.cluster_tasks import SlurmTask, LocalTask, LSFTask # # L...
constantinpape/cluster_tools
cluster_tools/learning/learn_rf.py
learn_rf.py
py
4,290
python
en
code
32
github-code
6
[ { "api_name": "luigi.Task", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "luigi.DictParameter", ...
21934500971
# https://towardsdatascience.com/how-to-use-natural-language-processing-to-analyze-product-reviews-17992742393c import spacy import pandas as pd import os DATA_DIR="path to data" """Create a list of common words to remove""" stop_words=["i", "me", "my", "myself", "we", "our", "ours", "ourselves", "you", "your", "you...
br8km/pynlp
run/example/aspect_extract.py
aspect_extract.py
py
2,133
python
en
code
0
github-code
6
[ { "api_name": "spacy.load", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37...
37027813861
import streamlit as st import pandas as pd import matplotlib.pyplot as plt from instagrapi import Client import json # Read the credentials from the JSON file with open('credentials.json') as file: credentials = json.load(file) # Access the individual credentials username = credentials['username'] pas...
maazirfan/instagram_hashtag_analysis
insta_stc.py
insta_stc.py
py
3,536
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "instagrapi.Client", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 32, "usage_type": "call" }, { "api_name": "streamlit.title", "li...
410941991
from functools import partial import jax.numpy as jnp import jax.random import numpy.testing as npt import pytest from bayesian_sde_solver.foster_polynomial import get_approx as parabola_approx from bayesian_sde_solver.foster_polynomial import get_approx_and_brownian as parabola_approx_and_brownian from bayesian_sde_...
hallelujahylefay/bayesianSDEsolver
tests/test_foster.py
test_foster.py
py
2,067
python
en
code
0
github-code
6
[ { "api_name": "bayesian_sde_solver.foster_polynomial.get_approx", "line_number": 12, "usage_type": "name" }, { "api_name": "bayesian_sde_solver.foster_polynomial.get_approx_and_brownian", "line_number": 12, "usage_type": "name" }, { "api_name": "bayesian_sde_solver.foster_polynom...
18669817333
import requests import time url = 'https://playground.learnqa.ru/ajax/api/longtime_job' response = requests.get(url) parsed_responce = response.json() token = parsed_responce["token"] times = parsed_responce["seconds"] print("Задача начата, время выполнения " + str(times) + " сек.") playoad = {'token': token} respon...
Therny/LearnQA_PythonAPI
HomeWork/Ex8_tokens.py
Ex8_tokens.py
py
924
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_number":...
3061089754
''' EAST + Tesseract East + melhor para cenáros naturais Processamento de imagens Arquitetura east suporta apenas imagens com dimensões múltipas de 32 ''' import cv2 import numpy as np from imutils.object_detection import non_max_suppression import pytesseract detector = '../../Util/modelos/frozen...
masilvasql/OCR-With_Python
pythonCodes/step3/OCR1.py
OCR1.py
py
3,095
python
pt
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 35, "usage_type": "call" }, { "api_name": "cv2.dnn.readNet", "line_number": 43, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 43...
36436562621
#!/usr/bin/env python """ This script is to plot live CII map from the recorded telemetry data Usage: Plot_Recorded_CII_map_live.py Recorded_TelmetryFile.pkl:BkgStartTime:BkgEndTime Recorded_TelmetryFile.pkl:StartTime:EndTime Start and End times are in the unit of day of the year. They are optional. If one wants th...
indiajoe/T100_pyTelemetryLive
T100_pyTelemetryLive/Plot_Recorded_CII_map_live.py
Plot_Recorded_CII_map_live.py
py
8,320
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 41, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 43, "usage_type": "call" }, { "api_name": "collections.defaultdi...
6501871441
from uuid import UUID from sqlalchemy.orm import contains_eager, defer from sqlalchemy.sql import exists from mobile_endpoint.dao import AbsctractDao, to_generic from mobile_endpoint.exceptions import NotFound from mobile_endpoint.models import db, Synclog, FormData, CaseData, CaseIndex, cls_for_doc_type from mobile_...
dimagi/mobile-endpoint
prototype/mobile_endpoint/backends/sql/dao.py
dao.py
py
4,533
python
en
code
0
github-code
6
[ { "api_name": "mobile_endpoint.dao.AbsctractDao", "line_number": 12, "usage_type": "name" }, { "api_name": "mobile_endpoint.models.db.session.begin", "line_number": 17, "usage_type": "call" }, { "api_name": "mobile_endpoint.models.db.session", "line_number": 17, "usage_ty...
32482978161
import datetime from email import message from functools import wraps # from pyexpat.errors import messages from flask import Flask, render_template, request, redirect, url_for, flash, session from peewee import * from hashlib import md5 app = Flask(__name__) app.secret_key = 'secretkeyuye' DATABASE ...
LifeStlR/CurhatIn
curhatIn/app.py
app.py
py
9,247
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 29, "usage_type": "attribute" }, { "api_name": "datetime.dat...
21718450823
import torch import numpy as np import time import torch.nn as nn import torch.nn.functional as F from utils import MatrixEuclideanDistances,str_to_bool SEED = 0 torch.manual_seed(SEED) torch.cuda.manual_seed(SEED) np.random.seed(SEED) def MatrixEuclideanDistances_tensor(a, b): sq_a = a**2 sum_sq_a = torch...
bill315lee/IIDM-FQCT
explain_stream/model_enids_feature_uniform/opt_explain_fu.py
opt_explain_fu.py
py
5,382
python
en
code
0
github-code
6
[ { "api_name": "torch.manual_seed", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.cuda.manual_seed", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.random....
6679933192
import argparse import csv import os import matplotlib.pyplot as plt import numpy as np import joblib import warnings warnings.filterwarnings('ignore') import torch from torch.autograd import Variable import torch.nn as nn import torch.optim as optim import torchvision.transforms as transforms import torchvision.datas...
gdqb233/inm363prj
mixup.py
mixup.py
py
7,859
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.backends.cudnn.benchmark", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.backends.cudnn", "line_number": 18, "usage_type": "name" }, { "a...
37018702761
from flask import Flask, jsonify, abort, url_for, request from general_db import db_connect from models import Problem, User, Entities, Tag, Levels, Scores app = Flask(__name__) conn = None app.config['JSONIFY_PRETTYPRINT_REGULAR'] = True ''' ======================= ======= PROBLEMS ====== ======================= ''...
mgbarsky/VIRTUAL_LAB
experiments/server_side/app.py
app.py
py
6,279
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.url_for", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Problem.db_get_problems", "line_number": 21, "usage_type": "call" }, { "api_name": "models.Proble...
19918932346
import requests image_url = "https://www.cryptocompare.com/media/352312/xci.png" def download(image_url): res = requests.get(image_url) if res.status_code == 200: image_name = image_url.split("/")[-1] with open(image_name, 'wb') as file: file.write(res.content) download(image_url)
Lexion13/py
original/download_image.py
download_image.py
py
302
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" } ]
13678818340
from django.urls import path, include from . import views urlpatterns = [ path('', views.index, name='index'), path('search/', views.search, name='search'), path('accounts/login/', views.userLogin, name='login'), path('accounts/', include('django.contrib.auth.urls')), path('accounts/profile/', views.profile, name...
MukulBarai/The-STEM-Blog
blog/urls.py
urls.py
py
823
python
en
code
0
github-code
6
[ { "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", ...
44904257533
import torch from model.BaseModel import Base from model.layer import FeaturesEmbedding,InteractionLayer, FusionLayer class AOA(Base): def __init__(self, args) -> None: super(AOA, self).__init__() self.args = args self.embed = FeaturesEmbedding(args.field_dims, args.emb_size) se...
Jarlene/Experiment
model/aoa.py
aoa.py
py
1,375
python
en
code
0
github-code
6
[ { "api_name": "model.BaseModel.Base", "line_number": 8, "usage_type": "name" }, { "api_name": "model.layer.FeaturesEmbedding", "line_number": 13, "usage_type": "call" }, { "api_name": "model.layer.InteractionLayer", "line_number": 14, "usage_type": "call" }, { "ap...
21764221165
from data import DataSet import time import cv2 import pickle import grpc import humanaction_pb2 import humanaction_pb2_grpc import numpy as np vs = cv2.VideoCapture(-1) time.sleep(2) def generate_image(): while True: ret_val,frame = vs.read() if ret_val == True: ...
NEBYUzekarias/examples
python/humanaction/humanaction_client.py
humanaction_client.py
py
1,799
python
en
code
0
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 13, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number...
72453533627
import os import shutil import datetime import logging ''' User-modifiable parameters ''' LOCAL_EXP_NAME = 'Iordanova_06082022_SOC-R9-F_NeuN-cFOS' # This is the EXPERIMENT_NAME when pipeline is run locally. EXPERIMENT_NAME = os.environ.get('EXPERIMENT_NAME', LOCAL_EXP_NAME) # Get EXPERIMENT_NAME passed from the SLURM...
Quorumetrix/brain_segmentations
config.py
config.py
py
6,067
python
en
code
0
github-code
6
[ { "api_name": "os.environ.get", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 50, "usage_type": "call" }, { "api_name": "os.environ", "line_nu...
16822801577
''' Created on Apr 3, 2019 @author: Tavis ''' from itertools import permutations class Matrix(): def __init__(self, d=[0,1,2]): self.data = d def __add__(self, other): return Matrix(Matrix.operate_lists_elementwise(self.data, other.data, lambda x,y: (x+y)%3)) def __sub__(self, other)...
NoahW314/Python-Testing
Testing/src/root/nested/math/cube_matrix.py
cube_matrix.py
py
1,985
python
en
code
0
github-code
6
[ { "api_name": "itertools.permutations", "line_number": 30, "usage_type": "call" }, { "api_name": "itertools.permutations", "line_number": 48, "usage_type": "call" }, { "api_name": "itertools.permutations", "line_number": 49, "usage_type": "call" } ]
37048467675
import sqlite3 from sqlite3 import Error from flask import Flask from flask_sqlalchemy import SQLAlchemy import json from sqlalchemy.sql import func from .db_requirement import item_requirement def create_connection(db_file): conn = None try: conn = sqlite3.connect(db_file) return conn excep...
Kelly-Kxx/fyp_selenium_flask
website/data_processing/db_model.py
db_model.py
py
5,796
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlite3.Error", "line_number": 13, "usage_type": "name" }, { "api_name": "sqlite3.Error", "line_number": 29, "usage_type": "name" }, { "api_name": "sqlite3.Error", "line...
6814462847
import torch.nn as nn import torch import math class MultiHeadedAttention(nn.Module): def __init__(self, dimension, heads, dropout=0.0): super().__init__() assert dimension % heads == 0 self.heads = heads self.dimension = dimension self.wq = nn.Linear(dimension, dimension)...
dawnik17/transformer
transformer/model/attn.py
attn.py
py
5,828
python
en
code
0
github-code
6
[ { "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.Linear", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
23542179431
# Changes the key by a user-specified number of semitones import librosa import soundfile def main(): filename = librosa.example("brahms") y, sr = librosa.load(filename) steps = float(input("Number of semitones to shift audio file: ")) new_y = librosa.effects.pitch_shift(y, sr, steps) soundfile.w...
JessPaley/PitchShiftingWithLibrosa
pitchShiftingWithLibrosa.py
pitchShiftingWithLibrosa.py
py
366
python
en
code
1
github-code
6
[ { "api_name": "librosa.example", "line_number": 8, "usage_type": "call" }, { "api_name": "librosa.load", "line_number": 9, "usage_type": "call" }, { "api_name": "librosa.effects.pitch_shift", "line_number": 11, "usage_type": "call" }, { "api_name": "librosa.effect...
32863970975
from django.shortcuts import render from rest_framework.views import APIView from rest_framework.decorators import api_view,authentication_classes,permission_classes from rest_framework.response import Response from .models import * from .serializers import * from rest_framework.authtoken.models import Token from rest_...
sabeelgithub/Learn-Django-Rest-Framework
home/views.py
views.py
py
7,255
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.generics.ListAPIView", "line_number": 15, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 15, "usage_type": "name" }, { "api_name": "rest_framework.generics.CreateAPIView", "line_number": 15, "usage_type":...
32581797933
import os import time import cv2 as cv import numpy as np import tflite_runtime.interpreter as tflite EDGETPU_SHARED_LIB = 'libedgetpu.so.1' class Inference: def __init__(self, model_dir): self.model_dir = model_dir self.interpreter = tflite.Interpreter( model_path=self.model_dir, ...
tphanson/ohmni-collision-prevention
src/floorNet.py
floorNet.py
py
2,204
python
en
code
0
github-code
6
[ { "api_name": "tflite_runtime.interpreter.Interpreter", "line_number": 13, "usage_type": "call" }, { "api_name": "tflite_runtime.interpreter", "line_number": 13, "usage_type": "name" }, { "api_name": "tflite_runtime.interpreter.load_delegate", "line_number": 16, "usage_ty...