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
4381184566
#Licensed under AGPL-3.0-only import requests,getpass,time import payload,login,retrieve,download def main(): subjects=sorted(payload.subject) session=requests.Session() while True: for i in range(len(subjects)): print("{:2d}.{}".format(i+1,subjects[i])) try: choice=input("\nYour choice: ") subject=subj...
hzlmy2002/Edexcel_pastpaper_downloader
main.py
main.py
py
2,652
python
en
code
2
github-code
21
[ { "api_name": "payload.subject", "line_number": 5, "usage_type": "attribute" }, { "api_name": "requests.Session", "line_number": 6, "usage_type": "call" }, { "api_name": "getpass.getpass", "line_number": 43, "usage_type": "call" }, { "api_name": "login.Login", ...
7440666737
import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap def plot_decision_boundary(model, X, y): X = X.T y = y.T # Set min and max values and give it some padding x_min, x_max = X[0, :].min() - 1, X[0, :].max() + 1 y_min, y_max = X[1, :].min() - 1, X[1, :]....
DiploDatos/IntroduccionAprendizajeAutomatico
archive/2019/utils.py
utils.py
py
955
python
en
code
26
github-code
21
[ { "api_name": "numpy.meshgrid", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.c_", "line_number": 17, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.contourf"...
14113378604
""" APIs for Chat """ import json from django.core.paginator import Paginator, EmptyPage from django.db.models import Q, Count, F # from django.shortcuts import render from rest_framework import generics, mixins, status from rest_framework.decorators import api_view, permission_classes from rest_framework.permissions ...
metalgear-dev/gui-engine
chat/views.py
views.py
py
28,258
python
en
code
0
github-code
21
[ { "api_name": "models.Notice.objects.filter", "line_number": 45, "usage_type": "call" }, { "api_name": "models.Notice.objects", "line_number": 45, "usage_type": "attribute" }, { "api_name": "models.Notice", "line_number": 45, "usage_type": "name" }, { "api_name": ...
41803880750
import sys import Deepak from Deepak import BOTLOG_CHATID, PM_LOGGER_GROUP_ID from .Config import Config from .core.logger import logging from .core.session import legend from .start import killer from .utils import ( add_bot_to_logger_group, hekp, install_extrarepo, load_plugins, setup_bot, s...
OFFICIALHACKERERA/PLUGINSS
Deepak/__main__.py
__main__.py
py
1,815
python
en
code
2
github-code
21
[ { "api_name": "core.logger.logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "core.logger.logging", "line_number": 20, "usage_type": "name" }, { "api_name": "Deepak.__copyright__", "line_number": 22, "usage_type": "attribute" }, { "api_n...
3932896063
import keras_vggface import tensorflow as tf import numpy as np import config_file as conf import math import cv2 import model_v2_build import keras from sklearn.svm import SVC def initial_model_v2(): base_model = model_v2_build.Vggface2_ResNet50(mode='train') base_model.load_weights('./weights.h5') model...
GaryUSTC/FeatureTransform
evaluation.py
evaluation.py
py
7,115
python
en
code
0
github-code
21
[ { "api_name": "model_v2_build.Vggface2_ResNet50", "line_number": 13, "usage_type": "call" }, { "api_name": "keras.Model", "line_number": 15, "usage_type": "call" }, { "api_name": "keras_vggface.VGGFace", "line_number": 20, "usage_type": "call" }, { "api_name": "te...
9891808360
# Test to use argparse lib # import argparse parser = argparse.ArgumentParser(prog = 'top', description = 'Show top lines from the file') parser.add_argument('-l', '--lines', type=int, default=10) args = parser.parse_args() # Usage python test-argparse-lib.py --lines=5 data/lotto/source/otos.csv
ZoliQua/python-home-kezdo
test-argparse-lib.py
test-argparse-lib.py
py
312
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" } ]
33634999213
import logging import os import time from datetime import datetime from dateutil.relativedelta import relativedelta import pytz import MetaTrader5 as mt5 import numpy as np import pandas as pd from MT5Monitor_EMACross_DBv1.mt5monitor_dbv1.configuration.app_config import config, \ get_round_decimal from MT5Monitor_E...
nerusm/MT5Monitor_EMACross_DBv1
mt5monitor_dbv1/mt5_api/ema_cross_s1/ema_cross.py
ema_cross.py
py
14,198
python
en
code
0
github-code
21
[ { "api_name": "MT5Monitor_EMACross_DBv1.mt5monitor_dbv1.configuration.app_config.get_round_decimal", "line_number": 31, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 42, "usage_type": "call" }, { "api_name": "MT5Monitor_EMACross_DBv1.mt5monitor_dbv1.utilit...
5628072113
""" 기상 데이터를 관리합니다. serviceKey 인증키 numOfRows 한 페이지 결과 수 pageNo 페이지 번호 dataType 응답자료형식 base_date 발표일자 base_time 발표시각 nx 예보지점 X 좌표 ny 예보지점 Y 좌표 맑음 0 ~ 5 구름많음 6 ~ 8 흐림 9 ~ 10 """ import requests from xml.etree import ElementTree import time import re # base url url = 'http://apis.data.go.kr/1360000/Vilage...
dbckd999/My_OOTD
my_ootd/app/weather.py
weather.py
py
4,421
python
ko
code
0
github-code
21
[ { "api_name": "time.strftime", "line_number": 34, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 44, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 45, "usage_type": "call" }, { "api_name": "xml.etree...
72267186293
from django.conf.urls.defaults import patterns, include, url from exemple1.views import current_datetime from exemple1.books.views import search, contact, add_publisher, add_publisher_thanks, contact_thanks # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlp...
alvarporcar/exemples_django
exemple1/urls.py
urls.py
py
686
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 8, "usage_type": "name" }, { "api_name": "django.conf.urls.defaults.patterns", "line_number": 10, "usage_type": "call" }, ...
2055539770
from setuptools import setup, find_packages import sys, os version = '0.0' setup(name='mtj.evedb', version=version, description="EVE DB access helper", long_description=open("README.rst").read() + "\n" + open(os.path.join("mtj", "evedb", "README.rst")).read() + "\n" + ...
metatoaster/mtj.evedb
setup.py
setup.py
py
998
python
en
code
1
github-code
21
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "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.join", "line_nu...
33631077017
from playsound import playsound from pydub import AudioSegment import random import os import os.path import time from datetime import datetime import numpy as np import csv from pathlib import Path # This is to easily run the script from the command line # [] = optional # Usage: python Music.py -name fil...
Achtuur/BCIBAP
Authentication/Code/Data/Experiments/Music/Music.py
Music.py
py
3,613
python
en
code
1
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 48, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 49, "usage_type": "call" }, { "api_name": "random.randint", ...
28476364522
import cv2 import pytesseract from utils import resize_image pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files\\Tesseract-OCR\\tesseract.exe' """ Page segmentation modes: 0 Orientation and script detection (OSD) only. 1 Automatic page segmentation with OSD. 2 Automatic page segmentation, but ...
petargyurov/receipt-scanner
main.py
main.py
py
2,587
python
en
code
0
github-code
21
[ { "api_name": "pytesseract.pytesseract", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 28, "usage_type": "call" }, { "api_name": "utils.resize_image", "line_number": 29, "usage_type": "call" }, { "api_name": "pytesseract...
70462540212
import sqlite3 as lite import urllib2 from bs4 import BeautifulSoup page = urllib2.urlopen("https://www.studentbeans.com/student-discount/uk/cats/all?page=100#page_100").read() soup = BeautifulSoup(page,"html.parser") soup.prettify() divs = smydivs = soup.findAll("div", { "class" : "offer-info__header-info" }) h4 = []...
IMFIL/FreeScholars
env/app/DataBaseUKfiller.py
DataBaseUKfiller.py
py
1,472
python
en
code
2
github-code
21
[ { "api_name": "urllib2.urlopen", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 62, "usage_type": "call" } ]
10487592254
from tqdm import tqdm #progress bar import numpy as np import pandas as pd import nengo import pytry import gymnasium as gym import learnrules as rules import representations as rp import minigrid_wrap from actor_critic import ActorCritic, ActorCriticLDN ##Softmax Function used for selecting next action def softmax(x...
maddybartlett/Bio_Plausible_Memory_Continuous_Time_RL
network/ac_learn.py
ac_learn.py
py
7,832
python
en
code
1
github-code
21
[ { "api_name": "numpy.exp", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 16, "usage_type": "call" }, { "api_name": "pytry.Trial", "line_number": 18, ...
18690219841
from typing import Tuple, Dict from yacs.config import CfgNode import torch from torch.utils.data import DataLoader from torch.optim.lr_scheduler import OneCycleLR from torchmetrics.functional import accuracy, precision, recall, auroc import pytorch_lightning as pl from models.scheduler import CosineAnnealingWarmupRe...
youyoungjang/tab-transformer
tab_transformer/core/bank_learner.py
bank_learner.py
py
3,451
python
en
code
2
github-code
21
[ { "api_name": "pytorch_lightning.LightningModule", "line_number": 14, "usage_type": "attribute" }, { "api_name": "yacs.config.CfgNode", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 15, "usage_type": "name" }, { "api_name"...
2967040803
import torch.nn as nn import torch.nn.functional as F import torch from torch.autograd import Variable import numpy as np class AdaptiveInstanceNorm2d(nn.Module): """Reference: https://github.com/NVlabs/MUNIT/blob/master/networks.py""" def __init__(self, num_features, eps=1e-5, momentum=0.1): super(A...
vanduong0504/GAN_CPS
models/norm.py
norm.py
py
2,191
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.ones", "line_number...
4672952813
# Author: Vincent Dubourg <vincent.dubourg@gmail.com> # Jake Vanderplas <vanderplas@astro.washington.edu> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>s # License: BSD 3 clause import numpy as np from matplotlib import pyplot as plt from sklearn.gaussian_process import GaussianProcessRegressor f...
StoCon/pycon2016
scikit_test.py
scikit_test.py
py
2,248
python
en
code
2
github-code
21
[ { "api_name": "utils.daily", "line_number": 18, "usage_type": "attribute" }, { "api_name": "utils.yearly", "line_number": 18, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotli...
39731378405
from flask import Blueprint, request, jsonify, make_response, current_app import json from src import db subletters = Blueprint('subletters', __name__) # Add a sublettor profile to the database @subletters.route('/subletters', methods=['POST']) def create_subletter_profile(): # Access json data from request obj...
MiaHuebscher/project_flask
flask-app/src/subletters/subletters.py
subletters.py
py
6,819
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.current_app.logger.info", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.current_app.logger", "line_number": 13, "usage_type": "attribute" }, { "api_na...
74530825332
import tweepy from twill_util import Util class Twill(): def __init__(self, consumer_key=None, consumer_secret=None, access_token=None, access_token_secret=None): '''Initialize the tweepy api''' self.util = Util() if not consumer_key: ...
hasahmed/Twill
twill.py
twill.py
py
906
python
en
code
0
github-code
21
[ { "api_name": "twill_util.Util", "line_number": 12, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 22, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 24, "usage_type": "call" } ]
16486421286
""" Author Nicolas Peschke Date 29.07.2019 """ import redpitaya_scpi as scpi import time import argparse import numpy as np import matplotlib.pyplot as plt def eval_scpi_slow_out_trigger_speed(rp_ip: str): # Establish connection rp_s = scpi.scpi(rp_ip) # Reset acquisition rp_s.tx_txt(f"...
npeschke/redpitaya-testing
eval_scpi_trigger_speed.py
eval_scpi_trigger_speed.py
py
3,221
python
en
code
1
github-code
21
[ { "api_name": "redpitaya_scpi.scpi", "line_number": 16, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 28, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots"...
30688429611
#https://adventofcode.com/2022/day/3 #from __future__ import annotations from typing import Iterator import itertools_recipes as ir #import functools import string priority = " " + string.ascii_letters test_input=""" vJrwpWtwJgWrhcsFMMfFFhFp jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL PmmdzqPrVvPwwTWBwg wMqvLMZHh...
copperfield42/Advent-of-Code-2022
day03/day03.py
day03.py
py
1,216
python
en
code
0
github-code
21
[ { "api_name": "string.ascii_letters", "line_number": 9, "usage_type": "attribute" }, { "api_name": "itertools_recipes.interesting_lines", "line_number": 24, "usage_type": "call" }, { "api_name": "typing.Iterator", "line_number": 23, "usage_type": "name" }, { "api_...
22167566784
import numpy as np import re import glob import ntpath import os from matplotlib import pyplot as plt import sys from scipy import stats from kernelphysiology.utils import path_utils from kernelphysiology.utils.controls import natural_keys layer_type = 'relu' csf_dir = "/home/arash/Desktop/projects/csf/" activations_...
ArashAkbarinia/kernelphysiology
python/src/kernelphysiology/analysis/reports/csf_activations.py
csf_activations.py
py
11,409
python
en
code
3
github-code
21
[ { "api_name": "numpy.pi", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_number": 23, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 3...
73595914294
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Aug 24 11:06:43 2017 @author: Deermini """ from numpy import * import numpy as np from sklearn.ensemble import GradientBoostingClassifier import matplotlib.pyplot as plt import xgboost as xgb from GCForest import * from sklearn.metrics import roc_curve...
Deermini/flavor-tagging
main.py
main.py
py
9,326
python
en
code
1
github-code
21
[ { "api_name": "collections.Counter", "line_number": 23, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 33, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 42, "usage_type": "call" }, { "api_name": "collectio...
8597027797
import uuid from hamcrest import assert_that, equal_to, has_items, has_properties from wazo_call_logd.database.models import Tenant from .helpers.base import DBIntegrationTest class TestTenant(DBIntegrationTest): def test_create_all_empty(self): before_create = self.session.query(Tenant).all() ...
wazo-platform/wazo-call-logd
integration_tests/suite/test_db_tenant.py
test_db_tenant.py
py
1,860
python
en
code
0
github-code
21
[ { "api_name": "helpers.base.DBIntegrationTest", "line_number": 10, "usage_type": "name" }, { "api_name": "wazo_call_logd.database.models.Tenant", "line_number": 12, "usage_type": "argument" }, { "api_name": "wazo_call_logd.database.models.Tenant", "line_number": 17, "usag...
72748340214
from os import path from tornado import options from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop from tornado.web import Application, RequestHandler DIR_NAME = path.dirname(__file__) class IndexHandler(RequestHandler): def get(self, directory): try: self.render(path.join(direc...
jvandew/www
server.py
server.py
py
1,287
python
en
code
0
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "name" }, { "api_name": "tornado.web.RequestHandler", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.join", "...
152141413
from .models import User from .serializer import ComplaintsSerializer from django.http import JsonResponse from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework import status from .models import Complaints @api_view(['GET','POST']) def complain(request, format=...
Marushka0308/DormCareBackend
DormCare/complain_views.py
complain_views.py
py
2,366
python
en
code
0
github-code
21
[ { "api_name": "models.Complaints.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Complaints.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.Complaints", "line_number": 12, "usage_type": "name" }, { "ap...
20136603245
from selenium import webdriver from time import sleep # 导入动作链对应的类 from selenium.webdriver import ActionChains driver = webdriver.Chrome() driver.get('https://www.runoob.com/try/try.php?filename=jqueryui-api-droppable') # 如果定位的标签是存在与iframe标签之中的,则必须通过如下操作再进行标签定位 driver.switch_to.frame('iframeResult') # 切换浏览器标签定位的作用域 d...
2765776613/Spider
com/sl/第七章 动态加载数据处理/03动作链和iframe的处理.py
03动作链和iframe的处理.py
py
754
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "selenium.webdriver.ActionChains", "line_number": 14, "usage_type": "call" }, { "api_na...
71972861492
#!/usr/bin/env python # from node import Node import colorsys import copy import math from typing import List, NoReturn, Tuple from PIL import Image class Node: def __init__(self, x, y, h=0.0, g=0.0, f=0.0, prev=None): self.x = x self.y = y self.prev = prev # f(n) = h(n) + g(n...
AstRonin/findpath
index.py
index.py
py
9,194
python
en
code
0
github-code
21
[ { "api_name": "math.sqrt", "line_number": 32, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 37, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 48, "usage_type": "name" }, { "api_name": "typing.NoReturn", "line_number"...
42919407606
from django.contrib.auth import get_user_model from django.shortcuts import redirect from django.contrib.auth.views import redirect_to_login from PizzaProject.order.models import OrderItem class ProductFormValidationMixin: product = None product_available_sizes = None def get_context_data(self, **kwargs...
kristiyanradoslavov/PizzaOrderWebsite
PizzaProject/products/mixins.py
mixins.py
py
3,707
python
en
code
0
github-code
21
[ { "api_name": "PizzaProject.order.models.OrderItem.objects.filter", "line_number": 74, "usage_type": "call" }, { "api_name": "PizzaProject.order.models.OrderItem.objects", "line_number": 74, "usage_type": "attribute" }, { "api_name": "PizzaProject.order.models.OrderItem", "li...
29536138520
import json from metrics import ( prom_ignored_repos, prom_sync_error_cnt, prom_synced_repos, ) from rich.console import Console from rich.table import Table class Statistics: POS_SYNCED = 0 POS_IGNORED = 1 POS_ERRORS = 2 def __init__(self): self._repos = {} self.total =...
soerenschneider/git-repo-backup
git_repo_backup/stats.py
stats.py
py
2,385
python
en
code
1
github-code
21
[ { "api_name": "metrics.prom_ignored_repos.labels", "line_number": 35, "usage_type": "call" }, { "api_name": "metrics.prom_ignored_repos", "line_number": 35, "usage_type": "name" }, { "api_name": "metrics.prom_synced_repos.labels", "line_number": 41, "usage_type": "call" ...
3938292122
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set() df = pd.read_csv('desafio001\president_heights.csv') print(df.head()) height = np.array(df['height(cm)']) print(height) print('media das alturas =:',round(height.mean(),2)) print("Altura minima: ",heig...
Henrique11154/AnaliseDeDados1
texte.py
texte.py
py
446
python
en
code
0
github-code
21
[ { "api_name": "seaborn.set", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.hist", "li...
10796861463
import json data = { "1": { "name": "Flavio", "age": 25, "job": "random" }, "2": { "name": "Gabriel", "age": 44, "job": "random" }, "3": { "name": "Paulo", "age": 19, "job": "random" } } def handler(event, context): print(event) if not event["pathParameters"] or not event["pathParameters"][...
alsmd/Chat
test/ServerlessProject/lambdas/endpoints/getUser.py
getUser.py
py
802
python
en
code
0
github-code
21
[ { "api_name": "json.dumps", "line_number": 40, "usage_type": "call" } ]
38165575225
import time import numpy as np import cv2 import helpers class QueryState(object): def __init__(self, scan_interval = 100, handTracker=None, bodyTracker=None, emDetection=None): self.handTracker = handTracker self.bodyTracker = bodyTracker self.emDetection = emDetection self.sca...
Maddi97/cognitive_interaction_w_robots
control_unit/query_state.py
query_state.py
py
2,432
python
en
code
2
github-code
21
[ { "api_name": "cv2.VideoCapture", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "line_number": 30, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 32, "usage_type": "call" }, { "api_name": "helpers.mean_array...
16256184276
import pandas as pd from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.decomposition import TruncatedSVD from nltk.tokenize import sent_tokenize, word_tokenize from nltk.corpus import stopwords from sklearn.decomposition import TruncatedSVD import sys # import nltk # nltk.download('punkt') # ...
abinashp437/OCR-summariser
text_summarisation.py
text_summarisation.py
py
1,461
python
en
code
0
github-code
21
[ { "api_name": "nltk.tokenize.sent_tokenize", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 17, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 19, "usage_type": "call" }, { "api_name...
4964260811
""" SOFT VOTING - Scikit-learn's implementation allows for soft voting as well. - The only requirement is that the base learners implement the predict_proba function. - In our example, Perceptron does not implment the function at all, while SCV only produces probabilitie when it is passeed the probabil...
Akshaykumarcp/ML-ensemble-learning
0.1_non_generative_ensemble_methods/0.1.1_voting_method/0.1.1.2_soft_voting.py
0.1.1.2_soft_voting.py
py
3,455
python
en
code
0
github-code
21
[ { "api_name": "sklearn.datasets.load_breast_cancer", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 19, "usage_type": "name" }, { "api_name": "sklearn.neighbors.KNeighborsClassifier", "line_number": 34, "usage_type": "call" }...
75197546613
from collections import deque dx = [1, -1, 0, 0] dy = [0, 0, 1, -1] def bfs(x, y): q = deque() q.append((x, y, 0)) while q: x, y, sword = q.popleft() for d in range(4): nx = x + dx[d] ny = y + dy[d] if 0 <= nx < n and 0 <= ny < m and visited[nx][ny] >= ...
keeeeeey/baekjoon_algorithm
00.SSAFY_ALGORITHM/수업시간 문제풀이/공주님을 구해라!.py
공주님을 구해라!.py
py
1,215
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
29722781400
import os, sys, binascii, webbrowser user = os.getlogin() home = os.path.expanduser("~") token_file = os.path.join(home, '.dbtoken/dropbox_shorturl') token_pathdir = os.path.dirname(token_file) access_token = '' if os.path.isfile(token_file): try: with open(token_file, 'rb') as tkf: tk = tkf.read() access_to...
benbenbang/dropbox
authentication.py
authentication.py
py
2,430
python
en
code
0
github-code
21
[ { "api_name": "os.getlogin", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_num...
3087690081
import asyncio import os import random import big_model.xunfei.base as xunfei import persistent.base as persistent from context.main import context, Profile from core.comment.comments import * from core.video import get_all_videos # from persistent import delegate from persistent.simple import SIMPLE_MARKED_FILENAME ...
Blushyes/BChat
plugins/reply_myself/reply_myself.py
reply_myself.py
py
3,234
python
en
code
6
github-code
21
[ { "api_name": "asyncio.run", "line_number": 28, "usage_type": "call" }, { "api_name": "core.video.get_all_videos", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 36, "usage_type": "call" }, { "api_name": "persistent.simpl...
23543555671
# %% import numpy as np import matplotlib.pyplot as plt import scipy.optimize from utils.utils import p2Z import utils.set_matplotlib_default from numpy.random import choice # Hyperparameters for this run seed=1 n_trials = 100 n_trials_sig = 100 save_directory = "gf_test/" test_stat="MLSnormal_positiv" fff = "4_param...
IvanOleksiyuk/jet_cluster_scanning
dijet_full_fit.py
dijet_full_fit.py
py
7,831
python
en
code
0
github-code
21
[ { "api_name": "numpy.linspace", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 25, "usage_type": "attribute" }, { "api_name": "utils.test_statist...
72110516854
"""djangoProject URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/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...
WangTingYu2/chokonu-anti-smurf
anti-smurf/djangoProject/urls.py
urls.py
py
1,808
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 24, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 24, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 24, "usage_type": "name" }, { "api_name": "...
12364068825
from time import sleep import cv2 import numpy as np import pyautogui import pyocr import pyocr.builders from PIL import Image, ImageGrab TRIM_POS = (1474, 369, 2434, 1809) def trim_img(file_name): img = Image.open(file_name) img_trim = img.crop(TRIM_POS) img_trim.save('trim.png') return img_trim ...
y-tsutsu/auto-ztype
auto_ztype.py
auto_ztype.py
py
1,513
python
en
code
0
github-code
21
[ { "api_name": "PIL.Image.open", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 14, "usage_type": "name" }, { "api_name": "PIL.ImageGrab.grab", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.ImageGrab", "line...
25981607498
import xml.etree.cElementTree as et import os import re root = '/media/kai/DATA/dataset/VOC/VOCdevkit/VOC2012' xml_root = os.path.join(root,"Annotations") original_image_root = os.path.join(root,"JPEGImages") xml_files = os.listdir(xml_root) inputfile = open('/home/kai/person_jpgs.txt','w') is_person = 0 for file in x...
maxnchloebff/Object-classification-and-grasp-based-on-vision
something_else/classification_voc/try_reading_xml.py
try_reading_xml.py
py
1,157
python
en
code
2
github-code
21
[ { "api_name": "os.path.join", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, ...
70382503094
""" Setuptools script """ from setuptools import setup, find_packages kwargs = dict( name="blackboardpoll2canvas", description=( 'Import poll reports from BlackBoard Collaborate ' 'Ultra into Canvas gradebook format'), author='Giovanni Luca Ciampaglia', author_email='glc3@mail.usf.edu'...
glciampaglia/blackboardpoll2canvas
setup.py
setup.py
py
694
python
en
code
0
github-code
21
[ { "api_name": "setuptools.find_packages", "line_number": 14, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 27, "usage_type": "call" } ]
21404838720
from flask import Flask, render_template, url_for app = Flask(__name__) @app.route('/<title>') @app.route('/index/<title>') def index(title): return render_template('base.html', title=title) @app.route('/training/<prof>') def training(prof): if 'инженер' in prof.lower() or 'строитель' in prof.lower(): ...
dariapotapova/html
1.py
1.py
py
2,137
python
ru
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.url_for",...
18006470347
import os import pytest from selenium import webdriver import config # helper method - enables us to specify a custom runtime flag and set a sensible default # value gets passed through request variable def pytest_addoption(parser): parser.addoption("--baseurl", action="store", ...
ibnez32/python-selenium
python-selenium/tests/conftest.py
conftest.py
py
1,847
python
en
code
0
github-code
21
[ { "api_name": "config.baseurl", "line_number": 27, "usage_type": "attribute" }, { "api_name": "config.browser", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "l...
1787537760
""" .. module:: get_data_states :synopsis: Returns STATES spectral data as a JSON string. .. moduleauthor:: Scott W. Fleming <fleming@stsci.edu> """ import collections import numpy from data_series import DataSeries from parse_obsid_states import parse_obsid_states #-------------------- def get_data_states(obsid...
spacetelescope/MASTDataDelivery
get_data_states.py
get_data_states.py
py
2,834
python
en
code
1
github-code
21
[ { "api_name": "collections.namedtuple", "line_number": 39, "usage_type": "call" }, { "api_name": "parse_obsid_states.parse_obsid_states", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number": 53, "usage_type": "call" }, { "api...
6014921184
from flask import Flask,render_template,request,url_for,make_response,abort,redirect from werkzeug.routing import BaseConverter from werkzeug.utils import secure_filename from flask_script import Manager from os import path class RegexConverter(BaseConverter): def __init__(self,url_map,*items): super(Reg...
TomasWang28/flask_second_project
discards/unit1/app_old.py
app_old.py
py
1,752
python
en
code
0
github-code
21
[ { "api_name": "werkzeug.routing.BaseConverter", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "flask_script.Manager", "line_number": 17, "usage_type": "call" }, { "api_name": "flask....
30638037930
""" Solution for 340. Longest Substring with At Most K Distinct Characters https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/ """ from collections import defaultdict from collections import OrderedDict class Solution: """ Runtime: 72 ms, faster than 86.01% of Python3 online submiss...
KKosukeee/CodingQuestions
LeetCode/340_longest_substring_with_at_most_k_distinct_characters.py
340_longest_substring_with_at_most_k_distinct_characters.py
py
2,783
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 48, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 101, "usage_type": "call" } ]
27723818188
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Aug 23 14:36:28 2018 @author: william """ import getpass import csv from datetime import datetime import math compname = getpass.getuser() #datapath = "/home/"+ compname +"/full_tests/full_test_v3_6/" datapath = "" def generate_robot_gt_file...
tsangkai/multirobot_localization_utias
src/tools/read_csv.py
read_csv.py
py
3,255
python
en
code
4
github-code
21
[ { "api_name": "getpass.getuser", "line_number": 11, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.dateti...
73834920693
from collections import deque class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def minDepth(self, root: TreeNode) -> int: if root: return self.bfs(root) return 0 def isL...
kalmad99/CompetitiveProgramming
Week 7/minimumDepthofBinaryTree.py
minimumDepthofBinaryTree.py
py
874
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 19, "usage_type": "call" } ]
16420943996
import torch import torch.nn as nn from torchvision.datasets import CIFAR10 from torchvision import transforms from torch.utils.data import DataLoader from torch.utils.tensorboard import SummaryWriter CIFAR10Dataset = CIFAR10( root=r'cifar', train=False, transform=transforms.ToTensor(), download=True, ...
fl0w2Bloom/note
torch/ConvTest.py
ConvTest.py
py
1,694
python
en
code
0
github-code
21
[ { "api_name": "torchvision.datasets.CIFAR10", "line_number": 8, "usage_type": "call" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 11, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 11, "usage_type": "name" }, { ...
30126198091
# Creates a manifest of all files in a directory. The output is a CSV file that contains the path # to each file and the SHA1 hash. A hash file of the manifist and a README are also created. # # Usage: # python create_manifest.py <directory> <manifest> import datetime import os import sys import hashlib import manifes...
tjdistler/dev
file_utils/diff/create_manifest.py
create_manifest.py
py
2,716
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.argv",...
74391014453
#-*-coding =utf-8 -*- #@time :2021/12/6 11:16 #@Author: Anthony import os import re import numpy as np from torch.utils.data import Dataset from PIL import Image class catdog(Dataset): def __init__(self,root, transform): self.images = os.listdir(root) # print(self.images) self.images.sort(k...
anthonyluosen/pytorch
project/Efficientnet_practice/dataset.py
dataset.py
py
1,037
python
en
code
0
github-code
21
[ { "api_name": "torch.utils.data.Dataset", "line_number": 10, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 12, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "lin...
40697088315
from flask import render_template, g, request, jsonify, current_app, session, redirect, abort from info import db, constants from info.models import Category, News, User from info.modules.profile import profile_blu from info.utils.common import user_login_data from info.utils.image_storage import storage from info.uti...
18882028307/flask_newworld
info/modules/profile/views.py
views.py
py
12,761
python
en
code
0
github-code
21
[ { "api_name": "flask.g.user", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 15, "usage_type": "name" }, { "api_name": "flask.redirect", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.render_template", ...
24291585496
import os import discord import pickle from functions import * import gem import build dir = r'C:\Path\to\Gemtree' os.chdir(dir) token_file = open('token.txt', 'r') for token in token_file: TOKEN = token client = discord.Client() # a gem is represented as RPN, where a 1 is a basic gem and a ...
MasN2/Gemtree
main.py
main.py
py
4,436
python
en
code
0
github-code
21
[ { "api_name": "os.chdir", "line_number": 10, "usage_type": "call" }, { "api_name": "discord.Client", "line_number": 17, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 22, "usage_type": "call" }, { "api_name": "gem.BasicGem", "line_number":...
36294117842
from pathlib import Path import pandas as pd from prefect import flow, task from prefect_gcp.cloud_storage import GcsBucket from prefect_gcp import GcpCredentials @task(retries=3) def extract_from_gcs(color: str, year: int, month: int) -> Path: """Download trip data from GCS""" gcs_path = f"data/{color}/{colo...
daurensd/zoomcamp
week_2_workflow_orchestration/2.3_etl_gcs_to_bq.py
2.3_etl_gcs_to_bq.py
py
1,575
python
en
code
0
github-code
21
[ { "api_name": "prefect_gcp.cloud_storage.GcsBucket.load", "line_number": 12, "usage_type": "call" }, { "api_name": "prefect_gcp.cloud_storage.GcsBucket", "line_number": 12, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "call" }, ...
20785668052
import os,sys,glob from skimage.io import imread sys.path.append(os.path.join(os.getcwd(), "../util")) import numpy as np import pickle import matplotlib.pyplot as plt # allow GPU growth def to_gray(x_in): [rows,cols] = np.shape(x_in)[0:2] x = np.zeros((rows, cols)) for i in range(rows): for j in range(cols...
dyang37/Deep-Proximal-Map
python-plugandplay/cnn/raw_data_gen.py
raw_data_gen.py
py
985
python
en
code
2
github-code
21
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
465986403
import os import json import pickle import torch import gym from models.gail import GAIL from stable_baselines3 import SAC def main(env_name): ckpt_path = "ckpts" if not os.path.isdir(ckpt_path): os.mkdir(ckpt_path) expert_ckpt_path = "experts" expert_ckpt_path = os.path.join(expert_ckpt_p...
cJamesSmith/drive
IL/GAIL/train.py
train.py
py
1,492
python
en
code
0
github-code
21
[ { "api_name": "os.path.isdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_number":...
19676443955
#! python2 # -*- coding: utf-8 -*- import pprint import pymongo import datetime from pymongo import MongoClient import os import re from nltk import word_tokenize, pos_tag from nltk.tokenize import RegexpTokenizer from nltk.stem.porter import PorterStemmer import progressbar import spacy nlp = spacy.load('en_cor...
Palastore/FinalProject
code_for_project/preprocess.py
preprocess.py
py
4,681
python
en
code
0
github-code
21
[ { "api_name": "spacy.load", "line_number": 19, "usage_type": "call" }, { "api_name": "pprint.PrettyPrinter", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pprint.PrettyPrinter.format", "line_number": 32, "usage_type": "call" }, { "api_name": "ppri...
30210093726
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Config for app Author: lujianyu Email: iam@jianyujianyu.com """ from config import LANGUAGE if LANGUAGE == 'ch': text_images_directory = '原图目录' text_label = '标签' text_label_name = '名称:' text_add_label = '创建' text_delete_label = '删除' text_...
aimreant/rcnn-labeler
lang.py
lang.py
py
4,704
python
en
code
0
github-code
21
[ { "api_name": "config.LANGUAGE", "line_number": 12, "usage_type": "name" } ]
15643057862
import numpy as np import itertools import math import os def deg2num(lat_deg, lon_deg, zoom): lat_rad = math.radians(lat_deg) n = 2.0 ** zoom xtile = int((lon_deg + 180.0) / 360.0 * n) ytile = int((1.0 - math.asinh(math.tan(lat_rad)) / math.pi) / 2.0 * n) return (xtile, ytile) d...
abugnard/HGDR
basemap.py
basemap.py
py
6,260
python
en
code
0
github-code
21
[ { "api_name": "math.radians", "line_number": 9, "usage_type": "call" }, { "api_name": "math.asinh", "line_number": 12, "usage_type": "call" }, { "api_name": "math.tan", "line_number": 12, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 12, ...
41194084733
from django.urls import path from .views import * urlpatterns = [ path('login/', loginPage, name='login'), path('logout/', logoutPage, name='logout'), path('register/', registerPage, name='register'), path('', HomeListView.as_view(), name='home'), path('profile/<str:pk>/', ProfileDetailView.as_vi...
wenerikk5/dev_rooms
base/urls.py
urls.py
py
736
python
en
code
0
github-code
21
[ { "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", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
17057763833
import ctypes import logging from . import sss_api as apis from .keystore import KeyStore from .keyobject import KeyObject log = logging.getLogger(__name__) class PCR: # pylint: disable=too-few-public-methods """ PCR Operation """ def __init__(self, session_obj): """ Constructor ...
autopi-io/autopi-core
src/salt/base/state/secure_element/se05x_sss/sss/pcr.py
pcr.py
py
2,565
python
en
code
142
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "keystore.KeyStore", "line_number": 21, "usage_type": "call" }, { "api_name": "keyobject.KeyObject", "line_number": 22, "usage_type": "call" }, { "api_name": "ctypes.c_uint8...
6661559436
from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys sys.path.append("..") from modules.sequential import Sequential from modules.linear import Linear from modules.softmax import Softmax from modules.relu import Relu from modules.tanh import Tanh from ...
VigneshSrinivasan10/interprettensor
interprettensor/examples/mnist_convolutional.py
mnist_convolutional.py
py
6,958
python
en
code
99
github-code
21
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tensorflow.flags", "line_number": 24, "usage_type": "attribute" }, { "api_name": "tensorflow.logging"...
13075135535
import requests middlewareURL = 'http://localhost:5000' mgs = [{ 'name': 'random', 'port': '24000' }, { 'name': 'oneblock', 'port': '24004' }, { 'name': 'target', 'port': '24002' }, { 'name': 'fish', 'port': '24003' }, ] from connection import Connection connection = Connection(d...
illinois/cs340-sp22-infinite-maze-shared
local-reset-mgs.py
local-reset-mgs.py
py
758
python
en
code
5
github-code
21
[ { "api_name": "connection.Connection", "line_number": 22, "usage_type": "call" }, { "api_name": "connection.db.servers.delete_many", "line_number": 23, "usage_type": "call" }, { "api_name": "connection.db", "line_number": 23, "usage_type": "attribute" }, { "api_na...
29853760360
import argparse import glob import hashlib import json import os IRMAS_INDEX_PATH = '../mirdata/indexes/irmas_index.json' def md5(file_path): """Get md5 hash of a file. Parameters ---------- file_path: str File path. Returns ------- md5_hash: str md5 hash of data in file_...
sebastianrosenzweig/mirdata
scripts/legacy/make_irmas_index.py
make_irmas_index.py
py
6,590
python
en
code
null
github-code
21
[ { "api_name": "hashlib.md5", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number": 36...
13198001199
import logging from qkan.database.dbfunc import DBConnection VERSION = "3.0.8" logger = logging.getLogger("QKan.database.migrations") def run(dbcon: DBConnection) -> bool: sqllis = [ "SELECT DiscardGeometryColumn('flaechen_he8', 'geom')", "DROP TABLE flaechen_he8;", """ CREATE T...
hoettges/QKan
qkan/database/migrations/0016_recreate_flaechen_he8.py
0016_recreate_flaechen_he8.py
py
1,354
python
de
code
9
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "qkan.database.dbfunc.DBConnection", "line_number": 10, "usage_type": "name" } ]
40352693177
# -*- coding: utf-8 -*- """ Created on Mon Mar 2 11:43:45 2020 @author: gerha """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import itertools import click import seaborn as sns from tqdm import tqdm from sklearn.model_selection import train_test_split from sklearn.linear_model import Lin...
GerhardHarmsen/Physics-Machine-Learning-project
Shrinkage_methods.py
Shrinkage_methods.py
py
13,638
python
en
code
1
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 34, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 34, "usage_type": "name" }, { "api_name": "ma...
35441942154
# -*- coding: utf-8 -*- """ Created on Wed Apr 4 12:29:08 2018 @author: Ouch """ import cv2 path = 'C:/Users/chich/Desktop/learningImage/' pic = 'lena.png' #灰階開圖 image = cv2.imread(pic, cv2.IMREAD_GRAYSCALE) #視窗呈現圖 cv2.imshow('my image', image) cv2.waitKey() cv2.destroyAllWindows() ''' 用nump...
KikiHungNTU/LearningImageProcess
imageProcess.py
imageProcess.py
py
1,005
python
en
code
0
github-code
21
[ { "api_name": "cv2.imread", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.imshow", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.waitKey", "li...
23622493638
import os from fastapi import APIRouter, HTTPException, status, Depends, Path from fastapi.responses import FileResponse from backend.crud.crud_file import FileCruds from backend.core.config import settings from backend.db.db import get_db from sqlalchemy.orm import Session import uuid as uuid_pkg from backend.helpers....
Semolik/music
backend/api/api_v1/endpoints/files.py
files.py
py
1,962
python
ru
code
3
github-code
21
[ { "api_name": "fastapi.APIRouter", "line_number": 10, "usage_type": "call" }, { "api_name": "backend.core.config.settings.UPLOADS_ROUTE", "line_number": 10, "usage_type": "attribute" }, { "api_name": "backend.core.config.settings", "line_number": 10, "usage_type": "name" ...
73033198773
import numpy as np import matplotlib.pyplot as plt xs = [ 0.00, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00] # Features ys = [-0.82, -0.94, -0.12, 0.26, 0.39, 0.64, 1.02, 1.00] # Labels m = 0.297022 # Slope b = -0.860827 # Intercept x_line = np.arange(np.min(xs)-0.5, np.max(xs)+0.5, 0.001) y_line = m*x_line+b fig = ...
LiuFang816/SALSTM_py_data
python/jostmey_NakedTensor/NakedTensor-master/line_of_best_fit.py
line_of_best_fit.py
py
596
python
en
code
9
github-code
21
[ { "api_name": "numpy.arange", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line...
35364080105
import arcade from game import constants class GameOverView(arcade.View): def __init__(self, score): super().__init__() self.score = score def on_show(self): arcade.set_background_color(arcade.color.BLACK) def on_draw(self): WIDTH = constants.SCREEN_WIDTH HEIGHT = ...
gublerj/gublerj-cse210-project
game/game_over.py
game_over.py
py
1,132
python
en
code
1
github-code
21
[ { "api_name": "arcade.View", "line_number": 3, "usage_type": "attribute" }, { "api_name": "arcade.set_background_color", "line_number": 9, "usage_type": "call" }, { "api_name": "arcade.color", "line_number": 9, "usage_type": "attribute" }, { "api_name": "game.cons...
3408262761
from mechanism import * import numpy as np from matplotlib import pyplot as plt O2, A, B, C, D, E = get_joints('O2 A B C D E') # C.follow = True a = Vector((O2, A), r=2) b = Vector((B, A), r=10) c = Vector((O2, B), theta=0, style='ground') d = Vector((A, C), r=4) e = Vector((O2, E), theta=np.pi/2, style='ground') f = ...
gabemorris12/mechanism
examples/crankslider.py
crankslider.py
py
1,337
python
en
code
19
github-code
21
[ { "api_name": "numpy.pi", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.deg2rad", "line...
38873682757
# coding=utf-8 import time from selenium import webdriver from PIL import Image,ImageEnhance import pytesseract def get_auth_code(driver, code_element): # driver = webdriver.Chrome() driver.save_screenshot('../data/img/login.png') imgSize = code_element.size imgLocation = code_element.location ran...
yuyong1992/auto_duty
Duty/test_case/case_login.py
case_login.py
py
2,171
python
en
code
0
github-code
21
[ { "api_name": "PIL.Image.open", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 14, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number"...
13415546965
"""Menu item that is used to change the current setting for an enum value.""" import subprocess from bullet import Bullet, colors, Input, Numbers, SlidePrompt from getch import pause from vigorish.cli.components import print_message, yes_no_cancel_prompt, yes_no_prompt from vigorish.cli.menu_item import MenuItem from...
a-luna/vigorish
src/vigorish/cli/menu_items/change_config_setting.py
change_config_setting.py
py
7,641
python
en
code
2
github-code
21
[ { "api_name": "vigorish.cli.menu_item.MenuItem", "line_number": 21, "usage_type": "name" }, { "api_name": "vigorish.constants.EMOJIS.get", "line_number": 25, "usage_type": "call" }, { "api_name": "vigorish.constants.EMOJIS", "line_number": 25, "usage_type": "name" }, ...
12355961344
#!/usr/bin/python import re import sqlite3 as lite # https://days.pravoslavie.ru/Bible/Index.htm#V # https://pomog.org/bible_en/34_daniel.htm chapter = 14 with open("./dan_14en.txt", 'r') as content_file, lite.connect("./dan_en.sqlite") as con: content = content_file.read() content = ' '.join(content.split()...
alexeyismirnov/prayerbook_ios
scripts/daniel.py
daniel.py
py
580
python
en
code
1
github-code
21
[ { "api_name": "sqlite3.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 18, "usage_type": "call" } ]
42407422598
import numpy as np from batchgenerators.transforms.color_transforms import GammaTransform, ContrastAugmentationTransform from batchgenerators.transforms.spatial_transforms import SpatialTransform, MirrorTransform from batchgenerators.transforms.noise_transforms import GaussianBlurTransform, GaussianNoiseTransform from ...
zhangliyuan97/MedIArtifacts
cls_task/training/dataloading/augmentations.py
augmentations.py
py
2,164
python
en
code
1
github-code
21
[ { "api_name": "batchgenerators.transforms.color_transforms.GammaTransform", "line_number": 14, "usage_type": "call" }, { "api_name": "batchgenerators.transforms.color_transforms.ContrastAugmentationTransform", "line_number": 18, "usage_type": "call" }, { "api_name": "batchgenerat...
10439825754
from pathlib import Path from .files import CorpusFile, Formatter, IO, QueryFile from .invertedfile import InvertedFile from .lexer import Lexer, LexerStatistics from .packer import Packer from .retriever import Retriever from .types import counter, generator class InformationRetrieval: def __init__(self, filena...
ribbas/grad_courses
744_information_retrieval/assn/03/ir/__init__.py
__init__.py
py
4,643
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "name" }, { "api_name": "files.CorpusFile", "line_number": 14, "usage_type": "name" }, { "api_name": "invertedfile.InvertedFile", "line_number": 16, "usage_type": "name" }, { "api_name": "retriever.Ret...
38800167569
from celery import shared_task from django.conf import settings from django.core.mail import EmailMessage # @shared_task def send_email_message(message: str, subject: str): """ Метод для отправки сообщения менеджеру на email с контактными данными клиента. :param message: :param subject: :retur...
Senyaiforex/mercedes_project
shope/coreapp/tasks.py
tasks.py
py
721
python
en
code
0
github-code
21
[ { "api_name": "django.core.mail.EmailMessage", "line_number": 15, "usage_type": "call" }, { "api_name": "django.conf.settings.EMAIL_MANAGER", "line_number": 16, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 16, "usage_type": "name" },...
41621485384
from flask import Flask, request, jsonify, render_template import cv2 import cvlib as cv from cvlib.object_detection import draw_bbox import numpy as np app = Flask(__name__) @app.route('/', methods=['GET', 'POST']) def index(): if request.method == 'POST': image_file = request.files['...
agrharsh2000/object_detection
app.py
app.py
py
1,049
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 11, "usage_type": "name" }, { "api_name": "flask.request.file...
9160921823
import win32com.client import dss_function import numpy as np import networkx as nx import pandas as pd import matplotlib.pyplot as plt import re dss = win32com.client.Dispatch('OpenDSSEngine.DSS') dssText = dss.Text dssCircuit = dss.ActiveCircuit dssSolution = dssCircuit.Solution dss_data_dir = "..\\123Bus_Simple\\...
Abhijeet1990/GA-DistNWSegmentation
interact_dss_com.py
interact_dss_com.py
py
4,210
python
en
code
1
github-code
21
[ { "api_name": "win32com.client.client.Dispatch", "line_number": 9, "usage_type": "call" }, { "api_name": "win32com.client.client", "line_number": 9, "usage_type": "attribute" }, { "api_name": "win32com.client", "line_number": 9, "usage_type": "name" }, { "api_name...
41770051484
import csv import glob import numpy as np import os from PIL import Image, ImageEnhance import random import scipy.signal import soundfile as sf import torch import torchvision.transforms as transforms class MusicImgAudPairDataset(object): def __init__(self, args, pr, list_sample, split='train'): self.p...
hxixixh/mix-and-localize
data/music_img_aud_pair.py
music_img_aud_pair.py
py
7,728
python
en
code
15
github-code
21
[ { "api_name": "torchvision.transforms.Resize", "line_number": 30, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 30, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 31, "usage_type": "call" }, { ...
28179609102
from bs4 import BeautifulSoup import requests response = requests.get("https://web.archive.org/web/20200518073855/https://www.empireonline.com/movies/features/best-movies-2/") soup = BeautifulSoup(response.text, "html.parser") art_tag = soup.find_all(name='h3', class_='title') data = [item.getText() for item in art_...
JasonW25/Classes
100daypython/movie-scraper/main.py
main.py
py
603
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 6, "usage_type": "call" } ]
12898897315
import ply.lex as lex reversed = {'if': 'IF', 'int': 'INT', 'while': 'WHILE'} tokens = [ 'SEMICOLON', 'LB_BR', 'RB_BR','LL_BR', 'RL_BR', 'EQUAL', 'LT','GT', 'MINUS', 'PLUS', 'LSHIFT', 'RSHIFT', 'ID','INT', 'STRING', 'WHILE','IF' ] t_LL_BR = r'\(' t_RL_BR = r'\)' t_EQUAL = r'=' t_LT = r'<' t_GT=r'>' t_...
CColike/Soochow-University-CS
Compilation principle practice/test2/demo.py
demo.py
py
1,065
python
en
code
3
github-code
21
[ { "api_name": "ply.lex.lex", "line_number": 49, "usage_type": "call" }, { "api_name": "ply.lex", "line_number": 49, "usage_type": "name" } ]
42187456001
import sys, codecs def load_kg(path): kg = {} reverse_kg = {} kg_file_facts = 0 kg_file = codecs.open(path, 'r', encoding='utf-8', errors='ignore') line = kg_file.readline() while line: kg_file_facts += 1 tokens1 = line.split('\t') tokens2 = line.split() tokens =...
fgullo/kger
src/load.py
load.py
py
6,365
python
en
code
1
github-code
21
[ { "api_name": "codecs.open", "line_number": 7, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 40, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 78, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 9...
8755474261
import requests import csv import flask from flask import * from bs4 import BeautifulSoup def Vultr(): arr2=[] arr3=["STORAGE","CPU","MEMORY","BANDWIDTH","PRICE /mo"] result1=requests.get("https://www.vultr.com/products/cloud-compute/#pricing") soup1=BeautifulSoup(result1.content,"html.parser") rows...
NachivelKishoreKumar/Data-Scrapping
Final.py
Final.py
py
8,188
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_num...
70884851893
import datasets from transformers import AutoTokenizer, AutoModelForSequenceClassification, \ AutoModelForQuestionAnswering, Trainer, TrainingArguments, HfArgumentParser from helpers import prepare_dataset_nli, prepare_train_dataset_qa, \ prepare_validation_dataset_qa, QuestionAnsweringTrainer, compute_accuracy...
gregdurrett/fp-dataset-artifacts
run.py
run.py
py
11,180
python
en
code
10
github-code
21
[ { "api_name": "transformers.HfArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "transformers.TrainingArguments", "line_number": 13, "usage_type": "argument" }, { "api_name": "datasets.load_dataset", "line_number": 60, "usage_type": "call" }, {...
6878163703
import numpy as np import sys import os from scipy.io.wavfile import read,write import matplotlib.pyplot as plt def get_framevalue(sr, frame1, frame2): delta=np.finfo(float).eps fourier1 = np.log(np.abs(np.fft.rfft(frame1)) + delta) fourier2 = np.log(np.abs(np.fft.rfft(frame2)) + delta) nu...
CaptainSame/Speech-Segregation-with-Machine-Learning
Handcrafted features/sflux.py
sflux.py
py
2,587
python
en
code
1
github-code
21
[ { "api_name": "numpy.finfo", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.fft.rfft", "line_number": 10...
28504098500
from django.contrib.auth.models import User from django.contrib.auth import authenticate,login,logout from django.http import HttpResponse from django.shortcuts import render,redirect from django.views.decorators.cache import never_cache from django.contrib import messages #import modules import favicon import requests...
Sharisali241/swa
SEOAnalyzer/views.py
views.py
py
144,499
python
en
code
0
github-code
21
[ { "api_name": "requests.Session", "line_number": 58, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 60, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 256, "usage_type": "call" }, { "api_name": "re.sub", "line_number"...
19012277480
import json import argparse import camdkit.red.reader def main(): parser = argparse.ArgumentParser(description="Conver RED camera metadata to JSON according to the OSVP Camera Metadata Model.") parser.add_argument( 'meta_3_file_path', type=str, help="Path to CSV file generated using REDline (`REDline -...
SMPTE/ris-osvp-metadata-camdkit
src/main/python/camdkit/red/cli.py
cli.py
py
877
python
en
code
22
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "camdkit.red.reader.red.reader.to_clip", "line_number": 22, "usage_type": "call" }, { "api_name": "camdkit.red.reader.red", "line_number": 22, "usage_type": "attribute" }, ...
33132324205
from __future__ import annotations from fastapi import FastAPI from fastapi.requests import Request from fastapi.responses import JSONResponse from starlette.exceptions import HTTPException as StarletteHTTPException from logger import logger def setup_starlette_http_exception_handler(app: FastAPI) -> None: @app...
kbondar17/fast-api-eshop-template
app/core/exceptions/starlette_http_exception.py
starlette_http_exception.py
py
934
python
en
code
0
github-code
21
[ { "api_name": "fastapi.FastAPI", "line_number": 11, "usage_type": "name" }, { "api_name": "fastapi.requests.Request", "line_number": 14, "usage_type": "name" }, { "api_name": "starlette.exceptions.HTTPException", "line_number": 14, "usage_type": "name" }, { "api_n...
33486172187
import matplotlib.pyplot as plt import datetime as dt import pandas as pd import numpy as np def format_time_stamp(time_string: str) -> dt.datetime: return dt.datetime.strptime(time_string[:-3], "%Y-%m-%d %H:%M:%S") def get_time_stamps(time_strings: pd.DataFrame, format_str) -> np.array: time_stamps = [] ...
roshan2M/edX--harvard--using-python-for-research
Week 4/Case Study 5 - Bird Migration/MigrationTimeStamp.py
MigrationTimeStamp.py
py
2,005
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.strptime", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "attribute" }, { "api_name": ...
24138107372
import requests from bs4 import BeautifulSoup import re from datetime import datetime import os # listurl = 'https://www.youtube.com/playlist?list=PLiQ-AHFkVMznxM-NPbvtkVCQTR-8xXXI0' print("请输入播放列表链接(+至少一个空格):") listurl = input()[:-1:] filename = str(datetime.now().date()).replace("-","")[2::]+".txt" f = open(filena...
SyouTono242/YoutubeScraper
Youtube.py
Youtube.py
py
1,773
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", ...
17877969135
#!/usr/bin/python3.4 ## Pieterjan Montens 2016 ## https://github.com/PieterjanMontens import optparse import json, yaml import sys,os, os.path, importlib #from grimp_importer import Importer from solr_importer import SolrImporter import logging, logging.config, logging.handlers import pysolr abspath = os.path.abspath(...
PieterjanMontens/grimp
src/grimp.py
grimp.py
py
2,869
python
en
code
0
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.chdir", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_num...
21199519172
#!/usr/bin/env python3 # pylint: disable=C0209 """ Exaplanation: emoji_process. Process the downloaded emoji file into appropriate format Usage: $ python emoji_process [ options ] Style: Google Python Style Guide: http://google.github.io/styleguide/pyguide.html @name emoji_process @ver...
wayne-kirk-schmidt/emoji-tools
bin/emoji_process.py
emoji_process.py
py
3,282
python
en
code
0
github-code
21
[ { "api_name": "os.path.basename", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_number": 39, "usage_type": "attribute" }, { "api_name": "urllib.parse.parse.urlsplit", "line_number": 39, "usage_type": "call" }, { "api_name": "urllib.pars...
12256778351
from collections import defaultdict class Solution: def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]: if not nums1 or not nums2: return [] dct1 = defaultdict(int) dct2 = defaultdict(int) for i in nums1: dct1[i] += 1 for i in nums2...
PlutoaCharon/CodeExercise_Python
LeetCode/每日一题/0805-350. 两个数组的交集 II.py
0805-350. 两个数组的交集 II.py
py
487
python
en
code
3
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" } ]
7233805744
""" Turn data.json into a vectorized array of words, also known as a Bag of Words Cord Meados 2019 """ import pandas as pd from sklearn.feature_extraction.text import CountVectorizer # Load the data to a pandas dataframe object df = pd.read_json('data.json', orient='values') # Get some basic info, like an example r...
CS467-Lich/tweetanalyzer
how-to/getTweets/jsonToBagOfWords.py
jsonToBagOfWords.py
py
1,438
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_json", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 27, "usage_type": "call" } ]
31267086274
from tkinter import * import tkinter.ttk as ttk import tkinter.messagebox as mb import tkcalendar as cal root=Tk() root.geometry('1000x1000+100+100') photo1=PhotoImage(file='pictures/7.png') back=Label(root,image=photo1) back.pack(fill='both',expand='yes') import pymysql pymysql.install_as_MySQLdb() import...
Shubham2299/Job-Portal
project/workshop_info.py
workshop_info.py
py
4,893
python
en
code
0
github-code
21
[ { "api_name": "pymysql.install_as_MySQLdb", "line_number": 12, "usage_type": "call" }, { "api_name": "MySQLdb.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "tkinter.messagebox.showinfo", "line_number": 39, "usage_type": "call" }, { "api_name":...
72406332534
import requests import wget import sys from bs4 import BeautifulSoup def main(): base_url = 'http://www.cs.unm.edu/~saia/classes/527-s18/' fname_downloaded_list = '.downloaded.txt' r = requests.get(base_url) # print(r.status_code) if r.status_code != 200: print("Could not retrieve webpage:...
arjkb/lecture-sync-cs527
sync.py
sync.py
py
1,433
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 14, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "wget.download", "line_numb...
38782295292
import arff from bsddb import db def five_way(pearson): if pearson > .3: # high correlation return "STRONG_POS" elif pearson > .1 and pearson < .3: # mild correlation return "MILD_POS" elif pearson < -.3: # high negative correlation return "STRONG_NEG" elif pearson < -.1 and pea...
waltaskew/Honors-Thesis
get_features.py
get_features.py
py
4,776
python
en
code
0
github-code
21
[ { "api_name": "bsddb.db.DB", "line_number": 80, "usage_type": "call" }, { "api_name": "bsddb.db", "line_number": 80, "usage_type": "name" }, { "api_name": "bsddb.db.DB_HASH", "line_number": 81, "usage_type": "attribute" }, { "api_name": "bsddb.db", "line_numbe...