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
3781330657
from decimal import Decimal import click from PyNFSe.cli import constants from PyNFSe.utils.entidades import Servico def servico(): servico = Servico() servico.valor_servico = Decimal(click.prompt('Valor serviço')) servico.iss_retido = int(click.prompt('ISS Retido (1 - Sim / 2 - Não)', type=click.Choice...
orlandosaraivajr/PyNFSe
PyNFSe/cli/cadastro/servico.py
servico.py
py
974
python
pt
code
null
github-code
18
[ { "api_name": "PyNFSe.utils.entidades.Servico", "line_number": 10, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 11, "usage_type": "call" }, { "api_name": "click.prompt", "line_number": 11, "usage_type": "call" }, { "api_name": "click.pro...
70771559079
# Standard packages import logging from enum import Enum import time from datetime import datetime, timedelta import asyncio import os import tqdm # External packages from django.core.management.base import BaseCommand, CommandError from twilio.rest import Client # Internal Packages from flint.db.models import KhojUs...
khoj-ai/flint
src/flint/db/management/commands/notify_users.py
notify_users.py
py
3,669
python
en
code
18
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 20, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "os.getenv", ...
29681831489
# -*- coding: utf-8 -*- import pymysql import uuid import re from common.getDataDef import get_data from bs4 import BeautifulSoup # 新建连接 db = pymysql.connect(host="192.168.5.210",user="root",password="root",db="law",charset='utf8') cursor = db.cursor() count=0 # 获取数据 for x in range(59,67): url='http...
Whitasnow/getLawData
law/flsp/legalVideo_zgfgpxw.py
legalVideo_zgfgpxw.py
py
1,828
python
en
code
0
github-code
18
[ { "api_name": "pymysql.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "common.getDataDef.get_data", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "common.ge...
71923574440
''' Author: lexcalibur Date: 2021-12-14 15:37:06 LastEditors: lexcaliburr LastEditTime: 2021-12-14 16:15:16 ''' import torch import torch.nn as nn from torch.onnx import register_custom_op_symbolic from torch.onnx.symbolic_helper import parse_args torch.ops.load_library("/home/lishiqi/myrepos/MyCodeRepo/trt_deploy_dem...
LexcaliburR/MyCodeRepo
trt_deploy_demo/model/customed_op/cpp_op.py
cpp_op.py
py
1,596
python
en
code
1
github-code
18
[ { "api_name": "torch.ops.load_library", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.ops", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.nn.Linear",...
4352272394
import torch from utilsmetric import psnr_loss, ssim, sam eps = torch.finfo(torch.float32).eps def get_metrics_reduced(img1, img2): # input: img1 {the pan-sharpened image}, img2 {the ground-truth image} # return: (larger better) psnr, ssim, scc, (smaller better) sam, ergas m1 = psnr_loss(img1, img2, 1.) ...
manman1995/Awaresome-pansharpening
py-tra/metricsutil.py
metricsutil.py
py
1,614
python
en
code
46
github-code
18
[ { "api_name": "torch.finfo", "line_number": 5, "usage_type": "call" }, { "api_name": "torch.float32", "line_number": 5, "usage_type": "attribute" }, { "api_name": "utilsmetric.psnr_loss", "line_number": 10, "usage_type": "call" }, { "api_name": "utilsmetric.ssim",...
72950129320
""" You are given a 0-indexed integer array nums and an integer threshold. Find the length of the longest subarray of nums starting at index l and ending at index r (0 <= l <= r < nums.length) that satisfies the following conditions: nums[l] % 2 == 0 For all indices i in the range [l, r - 1], nums[i] % 2 != n...
manumafe98/Grind75
Python/Leetcode/longest_even_odd_subarray_with_threshold.py
longest_even_odd_subarray_with_threshold.py
py
3,115
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 47, "usage_type": "name" } ]
72166379239
""" A wrapper to allow the use of oversampling algorithms for data augmentation in Active Learning experiments with multiple datasets. """ import warnings from collections import Counter, OrderedDict import numpy as np from sklearn.base import clone from sklearn.neighbors import NearestNeighbors from imblearn.over_samp...
joaopfonseca/ml-research
mlresearch/data_augmentation/_oversampling_augmentation.py
_oversampling_augmentation.py
py
9,301
python
en
code
3
github-code
18
[ { "api_name": "sklearn.neighbors.NearestNeighbors", "line_number": 19, "usage_type": "argument" }, { "api_name": "sklearn.base.clone", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.base.clone", "line_number": 23, "usage_type": "call" }, { "api_...
10170882203
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @author: zparteka """ import numpy as np # from chiapet_operations.chiapet_given_region import read_region from math import ceil from os import path from glob import glob from scripts.config import hg19_chromosomes_dict as chromosomes_hg19 from scripts.config import hg...
Zojka/juice2topdom
scripts/matrix_parsing_operations.py
matrix_parsing_operations.py
py
5,950
python
en
code
0
github-code
18
[ { "api_name": "scripts.config.hg19_chromosomes_dict", "line_number": 21, "usage_type": "name" }, { "api_name": "scripts.config.hg38_chromosomes_dict", "line_number": 23, "usage_type": "name" }, { "api_name": "scripts.config.mm10_chromosomes_dict", "line_number": 25, "usag...
2465944869
import streamlit as st from sklearn.preprocessing import MinMaxScaler import pickle import numpy as np st.title("Employee Promotion Project") st.info("Select values for each of the following features") dept = st.selectbox("Department",('Sales & Marketing','Operations','Technology','Procurement','Analytics', ...
divyeshjpatel/Project-P151-Employee-Promotion
P151_deploy.py
P151_deploy.py
py
2,859
python
en
code
0
github-code
18
[ { "api_name": "streamlit.title", "line_number": 6, "usage_type": "call" }, { "api_name": "streamlit.info", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.selectbox", "line_number": 10, "usage_type": "call" }, { "api_name": "streamlit.selectbox"...
71704322599
'''导入类''' # 导入多个类 from Chapter9_Class import Car, ElectricCar # from Chapter9_Class import ElectricCar my_new_car = Car('audi', 'a4', 2016) print(my_new_car.get_descriptive_name()) my_new_car.odometer_reading = 23 my_new_car.read_odometer() my_tesla = ElectricCar('tesla', 'model s', 2016) print(my_tesla.describe_...
TonyShng/PyPractice
my_car.py
my_car.py
py
1,030
python
en
code
0
github-code
18
[ { "api_name": "Chapter9_Class.Car", "line_number": 8, "usage_type": "call" }, { "api_name": "Chapter9_Class.ElectricCar", "line_number": 14, "usage_type": "call" }, { "api_name": "Chapter9_Class.Car", "line_number": 22, "usage_type": "call" }, { "api_name": "colle...
7608132726
#!/bin/env python # -*- coding: utf-8 -*- """\ Summary:: An =ICM=: a small example in traditional python style -- Not COMEEGA. """ from unisos import icm import collections G = icm.IcmGlobalContext() def g_paramsExtraSpecify( parser, ): """Module Specific Command Line Parameters. g_argsExtraSpecify is pa...
bisos/bpip1
bin/icmEx-miniCustomary.py
icmEx-miniCustomary.py
py
3,374
python
en
code
0
github-code
18
[ { "api_name": "unisos.icm.IcmGlobalContext", "line_number": 10, "usage_type": "call" }, { "api_name": "unisos.icm", "line_number": 10, "usage_type": "name" }, { "api_name": "unisos.icm.ICM_ParamDict", "line_number": 19, "usage_type": "call" }, { "api_name": "uniso...
18316794170
# This is a sample Python script. # Press Shift+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. import numpy as np import torch import torch.nn as nn import time from torch.optim.lr_scheduler import * from torch.utils....
zrya1/zry
main.py
main.py
py
2,680
python
en
code
0
github-code
18
[ { "api_name": "torch.device", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.load", ...
39034052445
#!/usr/bin/env python3 """Parse raw CESAR output for one query, get codon table.""" import argparse import sys from copy import deepcopy from version import __version__ try: # for robustness from modules.common import eprint from modules.common import die except ImportError: from common import eprint ...
hillerlab/TOGA
modules/parse_cesar_output.py
parse_cesar_output.py
py
10,050
python
en
code
114
github-code
18
[ { "api_name": "common.eprint", "line_number": 63, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 76, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 124, "usage_type": "call" }, { "api_name": "common.eprint", "line_...
2697365665
import numpy as np import time from backend import step, count_mean import pygame from pygame.draw import rect import matplotlib.pyplot as plt from tqdm.autonotebook import tqdm N = 50 dx = 1 g = 1 h = 1 dt = 0.005 n_eff = 2 block_size = 10 FPS = 1000 WHT = (255, 255, 255) B = np.array([0, 0, 1]) S1 = np.repeat(np.arr...
OksanichenkoFedor/SpinSimulation
simulation.py
simulation.py
py
2,961
python
en
code
0
github-code
18
[ { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.repeat", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.repeat", "line_number"...
36706664348
""" Description: Author: John Holl Github: https://github.com/hzylyh Date: 2022-03-19 13:42:16 LastEditors: John Holl LastEditTime: 2022-03-19 15:24:12 """ import logging import os from constant.constant import * po_manager = {} def load_project(): dir = APP['project']['path'] + PO_SUFFIX files = os.listdir(...
hzylyh/webUIAT
core/po_handler.py
po_handler.py
py
787
python
en
code
1
github-code
18
[ { "api_name": "os.listdir", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 22, "usage_type": "call" } ]
32616427885
"""Emulate hardware connected to the ATmega4809 microprocessor Usage: # Initialize sensor device = robot.getDevice('TETP4400') device.enable(TIME_STEP) # Initialize circuit and inputs circuit = PhototransistorCircuit(device) analogue_input = ADCInput(lambda: circuit.voltage()) digital_input = DigitalInput(lambda: c...
antroseco/idp
IDP_simulation/controllers/Robot_controller/hardware.py
hardware.py
py
4,026
python
en
code
3
github-code
18
[ { "api_name": "typing.Callable", "line_number": 32, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 63, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 74, "usage_type": "name" }, { "api_name": "controller.LightSensor...
24930963309
from django.core.management.base import BaseCommand, CommandError from main.scrapingSpells import lecturaSpells from main.models import Spell,Class,Subclass,Race from django.contrib.auth.models import User import re class Command(BaseCommand): help = 'Persistent dictionaries from DB' def handle(self,...
que-si-que-yo-acabo-este-ano/AII
Django_DnD/main/management/commands/populate.py
populate.py
py
2,536
python
en
code
0
github-code
18
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.create_superuser", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "li...
13295395215
import json from matplotlib import pyplot as plt import numpy as np import seaborn from Modules import functions as f import CoolProp.CoolProp as cp """ This program makes plots of the efficiency vs reheat final temperature. Steps: 1. Read in the json files 2. Plot the json files 3. Maybe, run some of the ...
sethjdana/NEUP_USU_SandBox
Reheat/NEUP_Python/Aiden's Thermo2 Project/PlotMaker.py
PlotMaker.py
py
4,434
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 30, "usage_type": "call" }, { "api_name": "json.load", "line_number": 39, "usage_type": "call" }, { "api_name": "json.load", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 42, ...
13707731935
################################## #encoding=utf8 # #version =py27, py33 # #author =sanhe # #date =2014-10-29 # # # # (\ (\ # # ( -.-)o I am a Rabbit! # # o_(")(") # # ...
yangmingming/HSH-toolbox-backup
HSH/DBA/sqlscripts.py
sqlscripts.py
py
3,269
python
zh
code
0
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 29, "usage_type": "call" }, { "api_name": "prettytable.from_db_cursor", "line_number": 78, "usage_type": "call" }, { "api_name": "HSH.DBA.hsh_sqlite3.iterC", "line_number": 80, "usage_type": "call" }, { "api_name": "...
31631667403
# -*- coding: utf-8 -*- """ Minor Project - Our main objective in this project is to develop a Machine Learning model that will be predicting the cost of the food served by the restaurants across different cities in India and to investigate the factors that really affect the cost. Size of training set: 12,690 reco...
piyush546/Machine-Learning-Bootcamp
Projects/Minor Project/Participants_Data_Final/main.py
main.py
py
1,796
python
en
code
1
github-code
18
[ { "api_name": "pandas.read_excel", "line_number": 42, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 43, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.FeatureHasher", "line_number": 54, "usage_type": "call" }, { "api_...
74597280998
# -*- coding: utf-8 -*- # @Time : 2019/12/2 19:21 # @Email : 986798607@qq.com # @Software: PyCharm # @License: BSD 3-Clause import numpy as np from numpy.linalg import matrix_rank from sklearn.utils import check_array from featurebox.combination.dim import Dim def dimension_check(x, y=None): if y is not No...
ghayth82/featurebox
featurebox/combination/dimanalysis.py
dimanalysis.py
py
684
python
en
code
0
github-code
18
[ { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.utils.check_array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.linalg...
29095484120
import logging import os from utils.logger import create_loggers_helper def create_logger(): _logger = logging.getLogger(__name__) _logger.setLevel(logging.DEBUG) return create_loggers_helper(_logger) logger = create_logger() def serialization_object_decorate( serialize_function, deserialize_f...
dykra/railwayPath
parcels_valuation/src/utils/serialization_module.py
serialization_module.py
py
862
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 8, "usage_type": "attribute" }, { "api_name": "utils.logger.create_loggers_helper", "line_number": 9, "usage_type": "call" }, { "api_name": "...
69960770922
from flask import Flask, render_template, jsonify, abort, make_response from flask import request, send_file from model import get_qcow_files, get_total_qcow, get_file from util import load_properties_file """ main application layer and web routes """ APP = Flask(__name__) IMGSRV_PROP = load_properties_file() @APP....
rhpit/paws-imgsrv
imgsrv/app.py
app.py
py
5,715
python
en
code
2
github-code
18
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "util.load_properties_file", "line_number": 9, "usage_type": "call" }, { "api_name": "model.get_total_qcow", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.render...
30584891467
#!/usr/bin/env python3 import argparse from help_functions import * from sub_orgs import * from sub_occs import * from sub_arts import * from qwikidata.json_dump import WikidataJsonDump import sys import time """ GENERAL Hľadané atribúty: id [ID]: samotny item type [Type]: P2308 (trieda = qualif...
Figliar/entity_kb_czech9
ent_parser.py
ent_parser.py
py
7,141
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 75, "usage_type": "call" }, { "api_name": "qwikidata.json_dump.WikidataJsonDump", "line_number": 97, "usage_type": "call" }, { "api_name": "time.time", "line_number": 104, "usage_type": "call" }, { "api_name"...
70961762281
import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.interpolate import CubicSpline from scipy.signal import argrelextrema def local_extrema(S): local_maxima = argrelextrema(S, comparator=np.greater_equal)[0] local_minima = argrelextrema(S, comparator=np.less_equal)[0] return ...
Bmajor98/emd
emd_02.py
emd_02.py
py
2,405
python
en
code
16
github-code
18
[ { "api_name": "scipy.signal.argrelextrema", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.greater_equal", "line_number": 9, "usage_type": "attribute" }, { "api_name": "scipy.signal.argrelextrema", "line_number": 10, "usage_type": "call" }, { "api_...
13723971464
from django.urls import path from station import views urlpatterns = [ path('list',views.StationView.as_view(),name='station_home'), path('upload_file',views.model_form_upload,name='upload_file'), path('audio_list',views.StationAudioView.as_view(),name='station_audio_home'), path('upload_audio_list',v...
freto85/superCEnv
superC/station/urls.py
urls.py
py
378
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "station.views.StationView.as_view", "line_number": 6, "usage_type": "call" }, { "api_name": "station.views.StationView", "line_number": 6, "usage_type": "attribute" }, { "ap...
39586521780
import numpy as np from scipy.io import savemat import scipy.io import matplotlib.pyplot as plt from scipy.optimize import curve_fit from Neural_Decoding.decoders import KalmanFilterDecoder def cal_cc(y,y1): ccx = np.corrcoef(y1[:,0],y[:,0])[0,1] ccy = np.corrcoef(y1[:,1],y[:,1])[0,1] return (ccx+ccy)/2 def...
Smullwy/bcihomework
code/decoding_QRP.py
decoding_QRP.py
py
5,576
python
en
code
0
github-code
18
[ { "api_name": "numpy.corrcoef", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.corrcoef", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.diff", "line_n...
24860692443
import logging import time import boto3 from botocore.config import Config from crhelper import CfnResource helper = CfnResource(json_logging=False, log_level="INFO", boto_level="ERROR", sleep_on_delete=0) logger = logging.getLogger(__name__) boto3_config = Config(retries={"max_attempts": 60}) @helper.create @helpe...
rsips/cc_net
venv/lib/python3.7/site-packages/pcluster/resources/custom_resources/custom_resources_code/wait_for_update.py
wait_for_update.py
py
1,338
python
en
code
0
github-code
18
[ { "api_name": "crhelper.CfnResource", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "botocore.config.Config", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.i...
40012892333
# version 1.0 # Includes # filtfilt # smooth # Hz # filterhum50 import scipy as sp from scipy import * from scipy import signal def lowpass(s,f,order=2,fs=1000.0): b,a=signal.butter(order,f/fs) return signal.lfilter(b,a,s) def highpass(s,f,order=2,fs=1000.0): b,a=signal.butter(order,f/fs,btype='highpa...
novabiosignals/BSAP-Presentation
createFigures/tools.py
tools.py
py
6,320
python
en
code
3
github-code
18
[ { "api_name": "scipy.signal.butter", "line_number": 16, "usage_type": "call" }, { "api_name": "scipy.signal", "line_number": 16, "usage_type": "name" }, { "api_name": "scipy.signal.lfilter", "line_number": 17, "usage_type": "call" }, { "api_name": "scipy.signal", ...
26561958807
import numpy as np import pytest from pytest import approx from desdeov2.solver.ASF import ( ASFError, AugmentedGuessASF, MaxOfTwoASF, PointMethodASF, ReferencePointASF, SimpleASF, StomASF, ) def test_simple_init(): weights_1 = np.array([1, 2, 3]) simple_asf = SimpleASF(weights_1)...
gialmisi/DESDEOv2
tests/solver/test_asf.py
test_asf.py
py
4,505
python
en
code
1
github-code
18
[ { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "desdeov2.solver.ASF.SimpleASF", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.all", ...
40254505345
#coding=utf8 ''' Created on Feb 14, 2016 @author: myue ''' import os from logging import config DEBUG = True LOG_PATH = os.getcwd() LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'simple': { 'format': '%(levelname)s %(asctime)s %(process)d %(message)s' ...
RominYue/SearchEngineDemo
common/logConf.py
logConf.py
py
1,389
python
en
code
1
github-code
18
[ { "api_name": "os.getcwd", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.config.dictConfig", "line_number": 59, "usage_type": "call" }, { "api_name": "logging.config", "line_number": 59, "usage_type": "name" } ]
25748430098
import cadquery as cq from math import sin, cos, pi def makeLeg( r_up: float = 80, r_down: float = 120, h: float = 350, k: float = 3, # k-parabola form ) -> cq.Workplane: sweep = ( cq.Workplane() .parametricCurve( #lambda x: (x,0,-h*si...
Opezdol/stool4ik
leg.py
leg.py
py
1,303
python
en
code
0
github-code
18
[ { "api_name": "cadquery.Workplane", "line_number": 11, "usage_type": "call" }, { "api_name": "cadquery.Workplane", "line_number": 22, "usage_type": "call" }, { "api_name": "cadquery.Workplane", "line_number": 27, "usage_type": "call" }, { "api_name": "cadquery.Wor...
7464893011
import mxnet as mx import numpy as np from mxnet import gluon from mxnet.gluon import data as gdata, loss as gloss, nn from mxnet.gluon import nn, Block, HybridBlock, Parameter import mxnet.ndarray as F import utilities import os class LossNet(Block): def __init__(self, vgg, content_weight, style_weight, batch_si...
xuganyu96/VAE-GAN-learnable-loss
models/LossNetwork.py
LossNetwork.py
py
4,695
python
en
code
3
github-code
18
[ { "api_name": "mxnet.gluon.Block", "line_number": 11, "usage_type": "name" }, { "api_name": "mxnet.gluon.loss.L2Loss", "line_number": 12, "usage_type": "call" }, { "api_name": "mxnet.gluon.loss", "line_number": 12, "usage_type": "attribute" }, { "api_name": "mxnet...
12585711514
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Apr 19 15:56:56 2020 @author: frederik """ import cv2 import numpy as np img = cv2.imread("references/spatula.jpg", cv2.IMREAD_GRAYSCALE) sift = cv2.xfeatures2d.SIFT_create() kp = sift.detect(img, None) img = cv2.drawKeypoints(img, kp, None) cv2.i...
frederikjchristensen/ROB4-Perception-Miniproject
feature_detector_sift.py
feature_detector_sift.py
py
438
python
en
code
0
github-code
18
[ { "api_name": "cv2.imread", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2.xfeatures2d.SIFT_create", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2....
23864230359
#!/usr/bin/env python import numpy as np import krpc import ephem_templates import os real_planet_names=["MERCURY","VENUS","EARTH","MARS","JUPITER","SATURN","URANUS","NEPTUNE","PLUTO"] real_planet_NAIF_codes=[199,299,399,499,599,699,799,899,999] base_output_dir="./ephemeris" from collections import defaultdict ...
bryan-lunt/KSP_GMAT
ephemgen/ephemgen.py
ephemgen.py
py
2,975
python
en
code
6
github-code
18
[ { "api_name": "krpc.connect", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 32, "usage_type": "call" }, { "api_name": "ephem_templates.setup_template.format", "line_number": 51, "usage_type": "call" }, { "api_na...
34308384178
""" 给定一个包括 n 个整数的数组 nums 和 一个目标值 target。找出 nums 中的三个整数,使得它们的和与 target 最接近。返回这三个数的和。假定每组输入只存在唯一答案。 例如,给定数组 nums = [-1,2,1,-4], 和 target = 1. 与 target 最接近的三个数的和为 2. (-1 + 2 + 1 = 2). 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/3sum-closest 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 解题思路:和15题类似,先排序,后两端向中间遍历 """ from t...
yeefea/CS-CheatSheet
python_workspace/leetcode/16_three_sum_closest.py
16_three_sum_closest.py
py
1,368
python
zh
code
2
github-code
18
[ { "api_name": "typing.List", "line_number": 18, "usage_type": "name" } ]
43027513368
# Imports import itertools as it import os import random from collections import deque from time import sleep, time import numpy as np import skimage.transform import torch import torch.nn as nn import torch.optim as optim import vizdoom as vzd import matplotlib.pyplot as plt from tqdm import trange from models.legacy...
Trenza1ore/doombot
models/legacy/walker.py
walker.py
py
7,946
python
en
code
1
github-code
18
[ { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "vizdoom.scenarios_path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.cuda.is_a...
6578508419
import logging import sys import unittest logger = logging.getLogger() handler = logging.StreamHandler(sys.stdout) handler.setFormatter( logging.Formatter( '[%(levelname)s] %(asctime)s %(filename)s:%(lineno)d %(message)s')) logger.addHandler(handler) logger.setLevel(logging.INFO) if __name__ == '__main__...
acisse01/demo
test_main.py
test_main.py
py
1,260
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.Formatte...
46233078764
import cv2 import numpy as np #load 2 images img1 = cv2.imread('egimg1.png') img2 = cv2.imread('egimg2.png') #mergebothimages #add = img1 + img2 #add = cv2.add(img1,img2)#addedallpixelvaluestogether weighted = cv2.addWeighted(img1, 0.6, img2, 0,4,0)#imposing them on one another identically cv2.imshow('weighted',weigh...
priyanka19697/imageprocessing1
imgartimetics.py
imgartimetics.py
py
364
python
en
code
0
github-code
18
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.addWeighted", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 1...
70489895400
import pytest from tests.integration.examples.utils import run_example from zenml.client import Client from zenml.post_execution.pipeline import get_pipeline def test_example(request: pytest.FixtureRequest) -> None: """Runs the airflow_orchestration example.""" import mlflow from mlflow.tracking import M...
zenml-io/apidocs-fork
tests/integration/examples/test_mlflow_tracking.py
test_mlflow_tracking.py
py
2,032
python
en
code
0
github-code
18
[ { "api_name": "pytest.FixtureRequest", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tests.integration.examples.utils.run_example", "line_number": 17, "usage_type": "call" }, { "api_name": "zenml.post_execution.pipeline.get_pipeline", "line_number": 23, "u...
27297039058
# p.207 모듈(moudule) # 모듈은 또다른 파이썬 파일이다! # 모듈 - 표준 모듈(=내장 모듈), [사용자 정의 모듈], 외부 모듈(추가로 설치) # 모듈 불러오기 ''' 1) import 모듈명 2) import 모듈명 as 별명/식별자 3) from 모듈 import 함수명,변수명 ※ 함수명, 변수명 <----> * ''' # 1. 표준모듈 math 불러오기 '''import math print(math.pi)''' # 2. 터틀그래픽스 불러오기 ''' from turtle import * ※ 가상환경, v3.9.1 오류 [경로, tkinter, ...
seonyeonghun2/Study_Python2
python_module.py
python_module.py
py
1,249
python
ko
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 34, "usage_type": "call" } ]
70985163879
# -*- coding: utf-8 -*- from PySide6.QtCore import QObject, Slot, Signal from PySide6.QtQml import QQmlApplicationEngine from scihub_eva.globals.preferences import * from scihub_eva.utils.preferences_utils import * class UIAddSciHubURL(QObject): show = Signal() def __init__(self, parent): super(UIA...
leovan/SciHubEVA
scihub_eva/ui/add_scihub_url.py
add_scihub_url.py
py
1,155
python
en
code
941
github-code
18
[ { "api_name": "PySide6.QtCore.QObject", "line_number": 10, "usage_type": "name" }, { "api_name": "PySide6.QtCore.Signal", "line_number": 11, "usage_type": "call" }, { "api_name": "PySide6.QtQml.QQmlApplicationEngine", "line_number": 18, "usage_type": "call" }, { "...
29278807620
# theano_mnist_knn.py import pandas as pd import numpy as np from theano import function import theano.tensor as T import time # Read in data training = pd.read_csv('MNIST_training.csv') # training = pd.read_csv('../datasets/fashion-mnist_train.csv') training_labels = training.iloc[:, 0] training_data = training.drop(...
ShahZafrani/machineLearningPractice
knn/theano_mnist_knn.py
theano_mnist_knn.py
py
2,452
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "theano.tensor.dvectors", "line_number": 18, "usage_type": "call" }, { "api_name": "theano.tensor",...
34070859872
from _datetime import datetime import json def decorator_logger(function): def get_info(*args, **kwargs): date = datetime.today().replace(microsecond=0) new_function = function(*args, **kwargs) information = f'Дата и время {date}, функция {decorator_logger.__name__}, аргументы: {args}, {kwa...
LiliyaVerchenko/decorator3
decoretors3.1.py
decoretors3.1.py
py
759
python
ru
code
0
github-code
18
[ { "api_name": "_datetime.datetime.today", "line_number": 6, "usage_type": "call" }, { "api_name": "_datetime.datetime", "line_number": 6, "usage_type": "name" }, { "api_name": "json.dump", "line_number": 10, "usage_type": "call" } ]
33121026249
import getopt import sys from os import listdir from os.path import join import os import random import torch from torch.utils import data import glob import numpy as np import scipy.misc import cv2 import warnings warnings.filterwarnings("ignore", category=UserWarning) class DRIVEData(data.Dataset): ''' Fini...
subercui/hypoxia-det
data/dataset.py
dataset.py
py
7,002
python
en
code
0
github-code
18
[ { "api_name": "warnings.filterwarnings", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 17, "usage_type": "name" }, { "api_name":...
36585700355
import os import subprocess from parameterized import parameterized from sflkitlib.events import event from sflkit import instrument_config from sflkit.config import Config from sflkit.mapping import EventMapping from utils import BaseTest class EventTests(BaseTest): def test_lines(self): config = Confi...
uds-se/sflkit
tests/test_events.py
test_events.py
py
14,785
python
en
code
5
github-code
18
[ { "api_name": "utils.BaseTest", "line_number": 13, "usage_type": "name" }, { "api_name": "sflkit.config.Config.create", "line_number": 15, "usage_type": "call" }, { "api_name": "sflkit.config.Config", "line_number": 15, "usage_type": "name" }, { "api_name": "os.pa...
35843631743
from stockstats import StockDataFrame from Models.Position import Position import pandas, sys class RSI_OverSold: def __init__(self, queuesHandler, dataProvider): self.queuesHandler = queuesHandler self.dataProvider = dataProvider self.__ignore_warnings() def perform( self, ticker, rsi_peri...
nmenescardi/Trader
StrategiesManager/Strategies/S01_RSI_OverSold.py
S01_RSI_OverSold.py
py
3,016
python
en
code
0
github-code
18
[ { "api_name": "stockstats.StockDataFrame.retype", "line_number": 48, "usage_type": "call" }, { "api_name": "stockstats.StockDataFrame", "line_number": 48, "usage_type": "name" }, { "api_name": "Models.Position.Position", "line_number": 63, "usage_type": "call" }, { ...
75120695401
"""Object representation of a song.""" from vocaloid.note import * from vocaloid.phonemesParser import parse_phonemes_by_syllables as parse_phonemes from vocaloid.phonemesParser import get_phonemes_ssml as get_ssml from vocaloid.phonemesParser import get_phonemes from vocaloid.syllablesParser import * from vocaloid.uti...
hw9603/Easy-Sing
vocaloid/song.py
song.py
py
8,477
python
en
code
1
github-code
18
[ { "api_name": "vocaloid.phonemesParser.parse_phonemes_by_syllables", "line_number": 60, "usage_type": "call" }, { "api_name": "vocaloid.phonemesParser.get_phonemes", "line_number": 60, "usage_type": "call" }, { "api_name": "vocaloid.phonemesParser.get_phonemes_ssml", "line_nu...
10688890197
# -*- coding: utf-8 -*- __author__ = 'JLPlata' from bs4 import BeautifulSoup import requests #ingrso la url URL_BASE = "https://www.scoresandodds.com" MAX_PAGES = 20 counter = 0 for i in range(1, MAX_PAGES): # Construyo la URL if i > 1: url = "%spage/%d/" % (URL_BASE, i) else: url = URL...
quiqueast/SportOdds
carga/wagers.py
wagers.py
py
860
python
es
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 28, "usage_type": "call" } ]
35180651649
from datetime import datetime from subprocess import Popen, call from threading import Thread from time import sleep class Alarm(Thread): def __init__(self, alarm_t=None, active=False): Thread.__init__(self) self.alarm_t = alarm_t self.active = active self._alarm_on = False de...
sjosund/spotify_alarm_clock
alarm.py
alarm.py
py
1,628
python
en
code
0
github-code
18
[ { "api_name": "threading.Thread", "line_number": 7, "usage_type": "name" }, { "api_name": "threading.Thread.__init__", "line_number": 9, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.dat...
2695288889
#!/usr/bin/env python # -*- coding: utf-8 - from PIL import Image import imagehash import urllib from io import BytesIO import numpy as np import time from pathlib import Path import logging logging.getLogger("requests").setLevel(logging.WARNING) log = logging.getLogger() class Matcher: """ Tries to match c...
roesel/scrapknight
libs/matcher.py
matcher.py
py
10,356
python
en
code
1
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "time.time", ...
74838322280
""" Pure subroutines of the MODL algorithm. Author : Quentin Ferré <quentin.q.ferre@gmail.com> """ import time from collections import defaultdict import numpy as np import pandas as pd from sklearn.decomposition import SparseCoder from sklearn.decomposition import MiniBatchDictionaryLearning from pygtftk.stats...
dputhier/pygtftk
pygtftk/stats/intersect/modl/subroutines.py
subroutines.py
py
19,709
python
en
code
37
github-code
18
[ { "api_name": "numpy.array", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 55, "usage_type": "call" }, { "api_name": "sklearn.decomposition.MiniBatchDictionaryLearning", "line_number": 58, "usage_type": "call" }, { "api_na...
30588584759
################################################################################ # Factorization algorithms ################################################################################ from math import floor, ceil from gmpy2 import mpz,mpq,mpfr,mpc from gmpy2 import is_square, isqrt, sqrt, log2, gcd, is_prime, next...
FACT0RN/factoring
python/lib/number_theory.py
number_theory.py
py
6,433
python
en
code
4
github-code
18
[ { "api_name": "os.environ.get", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_...
41971430218
#!/usr/bin/env python3 from math import gcd as gcd from os import system, name from random import randrange from colorama import Fore, Style '''gcd kan bepalen of twee integers co-primes zijn. Hij kijkt naar de modulo als deze op 1 uitkomt dan is het getal door niets anders deelbaar en zijn de twee integers dus co-pr...
rinmeister/rsa-calc
rsa-calculator.py
rsa-calculator.py
py
2,401
python
nl
code
0
github-code
18
[ { "api_name": "random.randrange", "line_number": 27, "usage_type": "call" }, { "api_name": "math.gcd", "line_number": 31, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 32, "usage_type": "call" }, { "api_name": "random.randrange", "li...
33971319013
import numpy as np import pandas as pd import torch import torch.nn as nn # import matplotlib.pyplot as plt # Plotting # from fast.ai notebook def gallery(x, nc=3): n,h,w,c = x.shape nr = n//nc assert n == nr*nc return (x.reshape(nr, nc, h, w, c) .swapaxes(1,2) .reshape(h*n...
jher123/Animal-Art-GAN-experiments
utils/utils.py
utils.py
py
1,313
python
en
code
1
github-code
18
[ { "api_name": "torch.nn.init.normal_", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.nn.init", "line_number": 31, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 31, "usage_type": "name" }, { "api_name": "torch.nn.init.norma...
72425841959
import json, os import numpy as np import torch from PIL import Image, ImageDraw import matplotlib.pyplot as plt from torch.utils.data import Dataset from glob import glob import torchvision.transforms as T def read_mask(label_path): label_data = json.load(open(label_path)) segs = label_data["shapes"][0]["poin...
saprrow/ForceMap
data/data_cls.py
data_cls.py
py
2,124
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 14, "usage_type": "attribute" }, { "api_name": "PIL.Image.fromarray", "lin...
72497988839
import os, json from django.shortcuts import render, redirect from django.urls import reverse from django.views import View from braintree import Subscription from braintree.error_result import ErrorResult from app_auth import models as AuthModels from app_auth import mixins as AuthMixins from payments import models as...
phillipmugisa/wapp
django/code/payments/views.py
views.py
py
9,470
python
en
code
0
github-code
18
[ { "api_name": "django.views.View", "line_number": 27, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 34, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 41, "usage_type": "call" }, { "api_name": "d...
17565762138
# Stdlib imports import pytest # Core Django imports from django.core.management import call_command # Third-party app imports from faker import Faker # Imports from my app from src.domains.models import Domain from src.domains.tests.factories import DomainFactory from src.margins.models import Margin from src.margi...
julienpaul/django-weathervis
src/conftest.py
conftest.py
py
3,779
python
en
code
0
github-code
18
[ { "api_name": "django.core.management.call_command", "line_number": 35, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 32, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 38, "usage_type": "call" }, { "api_name": "src...
3854651984
import os import sys import time import getopt import shutil import tempfile from .src import parser from .src import proxy from .src import generator from .src import env_clear from .src import process from .src import env_parser, env_inspect from .utils import log, utils from .utils.log import priorinit_logger from ...
libvirt/libvirt-test-API
libvirttestapi/main.py
main.py
py
15,368
python
en
code
12
github-code
18
[ { "api_name": "time.strftime", "line_number": 61, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 62, "usage_type": "call" }, { "api_name": "os.path", "line_number": 62, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_num...
22759450224
import numpy as np import matplotlib.pyplot as plt from numpy import pi from scipy import interpolate,integrate from tqdm import tqdm class spectrum: def __init__(self, KT = [0.05, 2000], \ U10 = 5, x = 20170, spectrum_type = 'Karaev'): # ускорение свободного падения. self.g = 9....
KirillPonur/water
water.py
water.py
py
19,542
python
ru
code
0
github-code
18
[ { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.logspace", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.log10", "line_number": 28, "usage_type": "call" }, { "api_name": "scipy.integrate.quad", "li...
16006253476
from flask import jsonify def book_serializer(bookinfo): book_list = [] for book in bookinfo: booktest_dict = { 'book_title': book.book_title, 'content_validity': book.content_validity, 'author': book.author, 'author_introduction': book.author_introducti...
Diuyilu/Book-Recommendation-System
backend/book/serializers.py
serializers.py
py
1,497
python
en
code
3
github-code
18
[ { "api_name": "flask.jsonify", "line_number": 35, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 44, "usage_type": "call" } ]
6203479287
from collections import defaultdict from queue import * from math import floor, ceil import matplotlib.pyplot as plt import random from itertools import cycle import subprocess import re netlistFilePath = 'netlist.txt' placementFilePath = 'cell_locs_pre_leg.txt' defFile = 'cts.def' verilogFile = 'place.v' n...
The-OpenROAD-Project/TritonCTS
src/scripts/remove_dummies.py
remove_dummies.py
py
7,014
python
en
code
33
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 17, "usage_type": "call" }, { "api_name"...
18388025282
"""musiclearn_cli.py Command line interface for the musiclearn project. Authors: Alex Kyllo and Jack Phan """ import logging import os import random from pathlib import Path import click import numpy as np from tensorflow.random import set_seed from musiclearn import (plotting, processing, sequential_models, ...
jackPhn/CSS586_Project
musiclearn_cli.py
musiclearn_cli.py
py
7,762
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 18, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.DEBU...
71426851560
import numpy as np import pandas as pd pd.set_option('display.float_format', lambda x: '%.3f' % x) import matplotlib.pyplot as plt import seaborn as sns from subprocess import check_output print(check_output(['ls', '../input']).decode('utf8')) import glob, re dfs = {re.search('/([^/\.]*)\.csv', fn).group(1): pd...
aorursy/new-nb-3
gobrando_instacart-eda.py
gobrando_instacart-eda.py
py
8,031
python
en
code
0
github-code
18
[ { "api_name": "pandas.set_option", "line_number": 3, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 7, "usage_type": "call" }, { "api_name": "re.search", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
5747755631
import cv2 import subprocess as sp rtspUrl = 'rtsp://11.73.12.184:554/test1' #这里改成本地ip,端口号不变,文件夹自定义 rtmpUrl = 'rtmp://8.136.105.93:10035/app/test' # 视频来源 地址需要替换自己的可识别文件地址 sourceUrl='rtsp://admin:hk123456@11.73.12.20' camera = cv2.VideoCapture(sourceUrl) # 从文件读取视频 # 视频属性 size = (int(camera.get(cv2.CAP_PROP_FRAME_WIDTH...
sophon-ai-algo/examples
other/py_demo_push_rtsp/test_push_rtsp.py
test_push_rtsp.py
py
2,506
python
zh
code
91
github-code
18
[ { "api_name": "cv2.VideoCapture", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_FRAME_WIDTH", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.CAP_PROP_FRAME_HEIGHT", "line_number": 11, "usage_type": "attribute" }, { "api_...
3953197444
import itertools from absl.testing import parameterized import numpy as np from tensorflow.compiler.tests import xla_test from tensorflow.python.ops import array_ops from tensorflow.python.ops import linalg_ops from tensorflow.python.platform import test class SelfAdjointEigOpTest(xla_test.XLATestCase, parameterize...
tensorflow/tensorflow
tensorflow/compiler/tests/self_adjoint_eig_op_test.py
self_adjoint_eig_op_test.py
py
1,345
python
en
code
178,918
github-code
18
[ { "api_name": "tensorflow.compiler.tests.xla_test.XLATestCase", "line_number": 12, "usage_type": "attribute" }, { "api_name": "tensorflow.compiler.tests.xla_test", "line_number": 12, "usage_type": "name" }, { "api_name": "absl.testing.parameterized.TestCase", "line_number": 1...
73027237480
from unified.core.app import App from emails.gmail.actions import GmailActions from emails.gmail.apis import GmailApi from emails.gmail.triggers import GmailTriggers class GmailApp(App, GmailActions, GmailApi, GmailTriggers): def __init__(self): super().__init__( name="Gmail", desc...
dipendrabaidawa/unified_api
unified/modules/main/categories/emails/gmail/app.py
app.py
py
532
python
en
code
0
github-code
18
[ { "api_name": "unified.core.app.App", "line_number": 6, "usage_type": "name" }, { "api_name": "emails.gmail.actions.GmailActions", "line_number": 6, "usage_type": "name" }, { "api_name": "emails.gmail.apis.GmailApi", "line_number": 6, "usage_type": "name" }, { "ap...
27353889427
import asyncio import logging from pupil_labs.realtime_api import Device, StatusUpdateNotifier, receive_gaze_data from pupil_labs.realtime_api.models import Event, Sensor from pupil_labs.invisible_lsl_relay import outlets logger = logging.getLogger(__name__) class Relay: def __init__(self, selected_device): ...
GazeIntelligence/GazeReplay
pupil_invisible/invisible_lsl_relay/relay.py
relay.py
py
5,761
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "pupil_labs.invisible_lsl_relay.outlets.PupilInvisibleGazeOutlet", "line_number": 16, "usage_type": "call" }, { "api_name": "pupil_labs.invisible_lsl_relay.outlets", "line_number": 16, ...
14210202509
from typing import List, Tuple # Approach 1 - Simpler def separateEvenOdd(inputList: List) -> Tuple: even = [] odd = [] for element in inputList: if element % 2 == 0: even.append(element) else: odd.append(element) return even, odd # Approach 2 - List Comprehen...
kmanadkat/leetcode-101
01 List/Problems/02_separate_even_odd.py
02_separate_even_odd.py
py
693
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": ...
39261053306
import os import re import requests import sys IMAGE_SOURCE = sys.argv[1] IMAGE_DESTINATION = sys.argv[2] TOKEN = os.environ['REGISTRY_AUTH'] HEADERS = { 'Accept': 'application/vnd.docker.distribution.manifest.v2+json', 'Authorization': 'Basic ' + TOKEN, } def extract_image_name(image_name): result = re....
buddyreview/remote-tag
remote_tag.py
remote_tag.py
py
1,242
python
en
code
0
github-code
18
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "re.match", "line_number"...
12257270489
#DATA E HORA from datetime import date, time, datetime def trabalhando_com_date(): data_atual = date.today() print(data_atual.strftime('%d/%m/%Y')) #DIA MÊS E ANO from datetime import date data_atual = date.today() print(data_atual.strftime('%A %B %Y')) def trabalhando_com_time(): horari...
Nathalia11/Estudos_Python
aula9.py
aula9.py
py
944
python
pt
code
0
github-code
18
[ { "api_name": "datetime.date.today", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 5, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.date", ...
29540687270
import numpy as np import keras import time from keras.callbacks import Callback class EarlyStoppingAtMinLoss(keras.callbacks.Callback): """Stop training when the loss is at its min, i.e. the loss stops decreasing. Arguments: patience: Number of epochs to wait after min has been hit. After this num...
ArabelaTso/DeepFD
CodeBook/Callbacks/EarlyStoppingAtMinLoss.py
EarlyStoppingAtMinLoss.py
py
2,058
python
en
code
10
github-code
18
[ { "api_name": "keras.callbacks", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.Inf", "line_number": 27, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.less", "line_n...
16600797440
from django.shortcuts import render,redirect from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse import cx_Oracle as oci from django.db import connection from . import models from base64 import b64encode import bcrypt import json model = models.Database() func = models.Func() @cs...
gobu82/RIP
rest/views.py
views.py
py
3,377
python
en
code
0
github-code
18
[ { "api_name": "django.shortcuts.redirect", "line_number": 17, "usage_type": "call" }, { "api_name": "django.views.decorators.csrf.csrf_exempt", "line_number": 14, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 21, "usage_type": "call" },...
28873056094
from django.core.management.base import BaseCommand from django.db.models import Count from mesads.app.models import ADS class Command(BaseCommand): def handle(self, **opts): handled = {} q = ( ADS.objects.filter(used_by_owner=True) .annotate(count=Count("adsuser")) ...
mesadsfr/mesads
mesads/app/management/commands/fix_ads_user_and_used_by_owner.py
fix_ads_user_and_used_by_owner.py
py
1,716
python
en
code
0
github-code
18
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 7, "usage_type": "name" }, { "api_name": "mesads.app.models.ADS.objects.filter", "line_number": 11, "usage_type": "call" }, { "api_name": "mesads.app.models.ADS.objects", "line_number": 11, "usage_typ...
2246171788
from openpyxl import Workbook wb = Workbook() ws = wb.active head=["reqkeyrate","SR1","SR2","finishtime1","finishtime2"] ws.append(head) ns=[0]*10 for i in range(10): ns[i]=i for j in range(10): ws.append([ns[j],ns[9-j],ns[j],ns[9-j],ns[j],ns[9-j]]) ws.append(['a','b','c','d']) ws.append([1,2,3,4]) ws.append...
Mikewanng/request-based-routing
alg/test.py
test.py
py
350
python
en
code
0
github-code
18
[ { "api_name": "openpyxl.Workbook", "line_number": 3, "usage_type": "call" } ]
72213301161
import os import sys sys.stdout.flush() import pprint from datetime import datetime, date, time from multiprocessing import Process, Queue, Pool from functools import partial from poloniex import Poloniex from relativetime import RelativeTime from mktdbinfo import MktDBInfo def Chunks(l, n): #Yield successive n-...
Yun-Hsuan/ScrapeCoinMarket
coin_market_data_base/poloniex_db.py
poloniex_db.py
py
12,026
python
en
code
0
github-code
18
[ { "api_name": "sys.stdout.flush", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 3, "usage_type": "attribute" }, { "api_name": "mktdbinfo.MktDBInfo", "line_number": 19, "usage_type": "name" }, { "api_name": "relativetime.Relat...
5193058892
import os from datetime import datetime from collections import deque from binance.client import Client import argparse import alpha_collection from utils import * from decimal import Decimal import time import csv from const import * def get_current_futures_position(symbols): account_info = client.futures_accou...
Mingyu-Kim-001/coin_trading
run_trading.py
run_trading.py
py
14,600
python
en
code
0
github-code
18
[ { "api_name": "decimal.Decimal", "line_number": 25, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 39, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 46, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
17694868692
# -*- coding: utf-8 -*- import datetime import logging from turtle import color import streamlit as st import streamlit.components.v1 as components from src.utils.dataio import get_data, create_transaction from src.utils.minter import * from src.utils.pinata import pin_image from web3 import Web3 from dotenv import loa...
Saving-the-world-org/save_the_world
pages/02_Donate.py
02_Donate.py
py
7,401
python
en
code
2
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 14, "usage_type": "call" }, { "api_name": "src.utils.dataio.get_data", "line_number": 19, "usage_type": "call" }, { "api_name": "src.utils.dataio.get_data", "line_number": 20, "usage_type": "call" }, { "api_name":...
8864849618
from flask import Flask from flask import render_template, abort from flask.ext.sqlalchemy import SQLAlchemy from pymongo import MongoClient from datetime import * app=Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"]='mysql://root@localhost/shiyanlou' db=SQLAlchemy(app) mongo=MongoClient('127.0.0.1',27017).shiyanl...
adaonline/pythonCourse
demo/Flask_news_with_mongodb/app.py
app.py
py
3,215
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.ext.sqlalchemy.SQLAlchemy", "line_number": 8, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.re...
22811652267
from unittest import mock import pytest from paasng.engine.controller.cluster import RegionClusterService pytestmark = pytest.mark.django_db @pytest.fixture(autouse=True) def helper(bk_app): # Make a mocked controller client mocked_client = mock.Mock() mocked_client.list_region_clusters.return_value = ...
leafage-collb/bk-paas
apiserver/paasng/tests/engine/test_controller.py
test_controller.py
py
1,942
python
en
code
null
github-code
18
[ { "api_name": "pytest.mark", "line_number": 7, "usage_type": "attribute" }, { "api_name": "unittest.mock.Mock", "line_number": 13, "usage_type": "call" }, { "api_name": "unittest.mock", "line_number": 13, "usage_type": "name" }, { "api_name": "paasng.engine.contro...
27153376828
# coding: utf-8 # Author: wanhui0729@gmail.com from functools import lru_cache ''' lru_cache 用于函数缓存,在连续用相同参数调用一个函数时,函数使用存储值作为返回值 接受maxsize和typed两个参数 maxsize为缓存最多maxsize个此函数的结果 typed为是否对参数类型敏感,例如设置为True时,f(3)和f(3.0)会被分别存储 ''' @lru_cache(maxsize=2) def add(x, y): print(f"calculating: {x} + {y}") return x+y if...
wan-h/Brainpower
Code/language/Python/grammer/functools/lru_cache_example.py
lru_cache_example.py
py
759
python
zh
code
1
github-code
18
[ { "api_name": "functools.lru_cache", "line_number": 13, "usage_type": "call" } ]
32423062613
from enum import Enum # noinspection PyArgumentList TYPE = Enum('TYPE', 'stimulus measurement scan_config analysis emka', module=__name__) FILE_TYPES = { TYPE.stimulus: ('.mat', [('matlab', '.mat'), ('json', '.json'), ('python', '.pkl')]), TYPE.measurement: ('.csv', [('table', '.csv'), ('matlab', '.mat'), ('p...
Palpatineli/uifunc
uifunc/common_file_types.py
common_file_types.py
py
568
python
en
code
0
github-code
18
[ { "api_name": "enum.Enum", "line_number": 4, "usage_type": "call" } ]
11929351420
import tornado.ioloop import tornado.web from tornado import gen from time import sleep from datetime import datetime from tornado.ioloop import IOLoop, PeriodicCallback loop = IOLoop.current() class MainHandler(tornado.web.RequestHandler): async def get(self): await gen.sleep(1) self.write('Hello...
devruji/test_concurrent_flask_vs_tornado
run_tornado_periodic_callback.py
run_tornado_periodic_callback.py
py
623
python
en
code
0
github-code
18
[ { "api_name": "tornado.ioloop.IOLoop.current", "line_number": 8, "usage_type": "call" }, { "api_name": "tornado.ioloop.IOLoop", "line_number": 8, "usage_type": "name" }, { "api_name": "tornado.ioloop.web", "line_number": 10, "usage_type": "attribute" }, { "api_nam...
71427520680
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/...
aorursy/new-nb-3
jarvispandey_bert-implementation.py
jarvispandey_bert-implementation.py
py
7,262
python
en
code
0
github-code
18
[ { "api_name": "os.walk", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number"...
40417400983
import typing import weakref from collections import defaultdict class BaseClass: __refs = defaultdict(list) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.__refs[self.__class__].append(self) @classmethod def instances(cls) -> typing.List: for in...
soar/github-team-organizer
github_team_organizer/classes/base.py
base.py
py
802
python
en
code
0
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 15, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 22, "usage_type": "call" }, { "api_name": "weakr...
42608976364
import os import glob import polars as pl import pandas as pd import config from utils import set_display_options, describe_numeric from etl import load_data set_display_options() asofdate = '2022-12-01' asofdate_fcst = '2023-01-01' id_fcst = 'best_public' # id_fcst = 'ens-naive_ema_theta-20220701-active-wavg-test-...
nicolaivicol/gd-mbiz-dens-fcst
tsfcst/get_rates_submission.py
get_rates_submission.py
py
5,286
python
en
code
0
github-code
18
[ { "api_name": "utils.set_display_options", "line_number": 10, "usage_type": "call" }, { "api_name": "config.DIR_ARTIFACTS", "line_number": 19, "usage_type": "attribute" }, { "api_name": "etl.load_data", "line_number": 21, "usage_type": "call" }, { "api_name": "pol...
14742701369
from flask import jsonify, request, g from app import app, db, auth from app.group import group from app.group.model import Group from app.group import mapper as group_mapper from app import views as common_views import constants @group.route("/", methods = ["POST"]) @auth.login_required def add_group(): if not re...
rishabh8866/python-bh
app/group/views.py
views.py
py
3,928
python
en
code
0
github-code
18
[ { "api_name": "flask.request.json", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 12, "usage_type": "name" }, { "api_name": "app.views.bad_request", "line_number": 13, "usage_type": "call" }, { "api_name": "app.views...
10760116114
from __future__ import annotations from typing import Callable, List, Dict from ndspy.rom import NintendoDSRom from range_typed_integers import u16_checked, u32_checked from skytemple_files.common.i18n_util import _, f from skytemple_files.common.ppmdu_config.data import ( GAME_REGION_EU, GAME_REGION_JP, ...
SkyTemple/skytemple-files
skytemple_files/patch/handler/change_evo.py
change_evo.py
py
9,830
python
en
code
16
github-code
18
[ { "api_name": "typing.Dict", "line_number": 53, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 53, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 70, "usage_type": "name" }, { "api_name": "typing.List", "line_number": ...
17996396345
""" Python script to scrape books from `Project Gutenberg` eBook library website: https://www.gutenberg.org/ """ # ===================================================================== # Import # ===================================================================== # import internal modules import re import requests ...
DerrickDDInAI/nlp-text-summarizer
app/scrape.py
scrape.py
py
4,279
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 34, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 50, "usage_type": "call" }, { "api_name": "re.findall", "lin...
4820009522
""" 840. Magic Squares In Grid A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, and both diagonals all have the same sum. Given a row x col grid of integers, how many 3 x 3 "magic square" subgrids are there? (Each subgrid is contiguous). Example1: Input: grid = [ [...
tkwang0530/LeetCode
0840.py
0840.py
py
3,311
python
en
code
4
github-code
18
[ { "api_name": "typing.List", "line_number": 38, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 72, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 89, "usage_type": "attribute" }, { "api_name": "unittest.main", "l...
4885589203
import imgaug as ia from imgaug import augmenters as iaa def get(): def sometimes(aug): return iaa.Sometimes(0.5, aug) return iaa.Sequential( [ # apply the following augmenters to most images iaa.Fliplr(0.5), # horizontally flip 50% of all images iaa.Flipud(0.2), ...
mukopikmin/bounding-box-augmentation
util/sequence.py
sequence.py
py
4,702
python
en
code
60
github-code
18
[ { "api_name": "imgaug.augmenters.Sometimes", "line_number": 6, "usage_type": "call" }, { "api_name": "imgaug.augmenters", "line_number": 6, "usage_type": "name" }, { "api_name": "imgaug.augmenters.Sequential", "line_number": 8, "usage_type": "call" }, { "api_name"...
35355418259
import sys import unittest import soundfile from porcupine import Porcupine from util import * class PorcupineTestCase(unittest.TestCase): @staticmethod def __append_language(s, language): if language == 'en': return s return f'{s}_{language}' @classmethod def __pv_model...
aceta-minophen/porcupine
binding/python/test_porcupine.py
test_porcupine.py
py
4,292
python
en
code
null
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "porcupine.Porcupine", "line_number": 42, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 43, "usage_type": "attribute" }, { "api_name": "soundfile.re...
7714576026
# Section12-1 # 파이썬 데이터베이스 연동(SQLite) # 테이블 생성 및 삽입 import sqlite3 import datetime # 삽입 날짜 생성 now = datetime.datetime.now() print('now : ', now) nowDatetime = now.strftime('%Y-%m-%d %H:%M:%S') print('nowDatetime : ',nowDatetime) # sqlite3 print('sqlite3.version : ', sqlite3.version) print('sqlite3.s...
louis-25/Python_basic
section12-1.py
section12-1.py
py
1,996
python
ko
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sqlite3.version", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sqlit...
36799181513
#!/usr/bin/env python import asyncio import websockets import json import time import sys from mrc88_interface import Interface from channel import Channel class WebSocketServer: def __init__(self, amp): self.nextStateUpdate = time.time() self.connections = set() self.amp = amp def ...
oscarbodell/mrc88Control
server/websocket_server.py
websocket_server.py
py
3,469
python
en
code
0
github-code
18
[ { "api_name": "time.time", "line_number": 15, "usage_type": "call" }, { "api_name": "websockets.serve", "line_number": 20, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 22, "usage_type": "call" }, { "api_name": "asyncio.get_event_l...
41155060779
import sys sys.path.append('C:\\Users\\Ruedi\\OneDrive\\Learning\\Learning\\World Bank') import GUI_Plots_Pannel import GUI_ListPannel import WorldBank from PyQt5.QtWidgets import QApplication, QWidget, QHBoxLayout class WIN( QWidget ): def __init__(self, parent = None): super(WIN, self).__init__(parent)...
rrutz/Learning
World Bank/Main.py
Main.py
py
905
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 9, "usage_type": "name" }, { "api_name": "WorldBank.WorldBan...
36360181684
# -*- coding: utf-8 -*- import pandas as pd import os df = pd.read_pickle(os.path.join('..', 'data_frame.pickle')) # Smaller object for easier vis small_df = df.iloc[49980:50019, :].copy() # Basic Excel small_df.to_excel("basic.xlsx") small_df.to_excel("no_index.xlsx", index=False) small_df.to_excel("c...
TamilNeram/python
பன்மை பார்வை/pandas-fundamentals/demos/m5/demo.py
demo.py
py
1,568
python
en
code
2
github-code
18
[ { "api_name": "pandas.read_pickle", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pandas.ExcelWriter", "l...
6012650692
from dataclasses import dataclass def bin8(value: int): """ Convert 8-bit register value to binary representation. """ return ("0"*8 + bin(value)[2:])[-8:] def metronome_pattern(bar_length): return [3, 0] + [1, 0] * (bar_length - 1) def timing_grade(time, target, margin): error = abs(target-t...
gurhanadiguzel/METU-Ceng
CENG336/THE/THE1/starting-project/the1.X/tests/grading.py
grading.py
py
4,684
python
en
code
0
github-code
18
[ { "api_name": "dataclasses.dataclass", "line_number": 19, "usage_type": "name" } ]
33745057829
import cv2 # Aquí coloca la ruta de la imagen con la cara a detectar imagenRuta = 'imagen.jpeg' # Cargar el modelo pre-entrenado para detección facial face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml') # Cargar la imagen en la que deseas realizar el reconocimiento fac...
LeoteauG/facepay
main.py
main.py
py
924
python
es
code
0
github-code
18
[ { "api_name": "cv2.CascadeClassifier", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.data", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line...
28963157811
import os import json from collections import namedtuple from tile2net.tileseg.config import cfg from runx.logx import logx from tile2net.tileseg.datasets.base_loader import BaseLoader from tile2net.tileseg.datasets.utils import make_dataset_folder from tile2net.tileseg.datasets import uniform Label = namedtuple( 'La...
VIDA-NYU/tile2net
src/tile2net/tileseg/datasets/satellite.py
satellite.py
py
5,063
python
en
code
108
github-code
18
[ { "api_name": "collections.namedtuple", "line_number": 11, "usage_type": "call" }, { "api_name": "tile2net.tileseg.datasets.base_loader.BaseLoader", "line_number": 59, "usage_type": "name" }, { "api_name": "tile2net.tileseg.config.cfg.DATASET", "line_number": 74, "usage_t...
22289999321
import requests import yaml with open('config.yaml', encoding='utf-8') as f: data = yaml.safe_load(f) S = requests.Session() def test_step1(user_login, post_title): result = S.get(url=data['address'], headers={'X-Auth-Token': user_login}, params={'owner': 'notMe'}).json()['data'] result_title = [i['titl...
SilverXuz/Python_Web_dz_1
task_2/test1_seminar2.py
test1_seminar2.py
py
1,269
python
en
code
0
github-code
18
[ { "api_name": "yaml.safe_load", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 7, "usage_type": "call" } ]