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
20638129573
# -*- coding:utf-8 -*- import matplotlib.pyplot as plt import sys import os def painting(info, label_info, paint_img_dir): plt.text(len(info)*0.6, max(info), f"max: {max(info)}\nmin: {min(info)}\navg:{sum(info)/len(info)}", fontsize=10, color='black') # 示例 plt.plot(info, color='red', linew...
zhhy/auto
tools/LA50延迟优化脚本.py
LA50延迟优化脚本.py
py
2,019
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.text", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 14, "usage_type": "call" }, { "api_name": "matpl...
72908767720
import cv2 import numpy as np def direction_detect(detected_both, yolo_yellow_cones_center, yolo_red_cones_center, yolo_slopes_yellow, yolo_slopes_red): direction = [0,0] # -2 = very left; -1 = left; 0 = straight; 1 = right; 2 = very right #very left thres_for_very_left_yellow = 0.01 thres_for_ve...
henry-hks/AI-for-Cone-Detection
function/slope_fct.py
slope_fct.py
py
3,209
python
en
code
0
github-code
18
[ { "api_name": "cv2.drawMarker", "line_number": 72, "usage_type": "call" }, { "api_name": "cv2.MARKER_TRIANGLE_UP", "line_number": 72, "usage_type": "attribute" }, { "api_name": "cv2.putText", "line_number": 73, "usage_type": "call" }, { "api_name": "cv2.FONT_HERSH...
42015766798
import torch import torch.nn as nn class PinballLoss(nn.Module): def __init__(self, training_tau, device): super(PinballLoss, self).__init__() self.training_tau = training_tau self.device = device def forward(self, predictions, actuals): cond = torch.zeros_like(predictions).to...
mavarick/tft
losses/pinball_loss.py
pinball_loss.py
py
901
python
en
code
5
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.zeros_like", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.sub", "line_nu...
6490523810
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Oct 21 20:09:08 2021 ###################### ##### read h5 ######## ###################### # 1.read h5-file h5_file = h5py.File(files[1],'r') # 2.show all keys in h5-file h5_file.keys() # 3.循环读取所有 keys in h5-file for key in h5_file.keys(): onekey =...
OUCyf/NoiseCC
src/plot/S0_read_jld2.py
S0_read_jld2.py
py
1,936
python
en
code
6
github-code
18
[ { "api_name": "h5py.File", "line_number": 65, "usage_type": "call" } ]
31896317575
import os from setuptools import setup, find_packages from arizona.version import __version__ try: # pip >=20 from pip._internal.network.session import PipSession from pip._internal.req import parse_requirements except ImportError: try: # 10.0.0 <= pip <= 19.3.1 from pip._internal.down...
phanxuanphucnd/wav2asr
setup.py
setup.py
py
1,664
python
en
code
4
github-code
18
[ { "api_name": "pip.req.parse_requirements", "line_number": 23, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 32, "usage_type": "call" }, { "api_name": "arizona.version.__version__", "line_number": 32, "usage_type": "argument" }, { "api_name": "...
39899600195
import cv2 import numpy as np import math import time import pandas as pd import matplotlib.path as mplPath from sklearn.cluster import DBSCAN import matplotlib.pyplot as plt cap = cv2.VideoCapture('car5.mp4') _, frame = cap.read() W = frame.shape[1] H = frame.shape[0] frame = cv2.resize(frame, (W // 2, H // 2)) first...
namdang-exe/Computer_Vision_project
1st_algo.py
1st_algo.py
py
5,899
python
en
code
0
github-code
18
[ { "api_name": "cv2.VideoCapture", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.createBackgroundSubtractorMOG2", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy....
13064095566
"""add subnet indexes and defer Revision ID: 80419263930a Revises: 1bd7cff90384 Create Date: 2016-02-09 19:26:27.899610 """ # revision identifiers, used by Alembic. revision = '80419263930a' down_revision = '1bd7cff90384' from alembic import op def upgrade(): op.create_index(op.f('ix_quark_subnets_segement_ne...
MichaelPorras/quark
quark/db/migration/alembic/versions/80419263930a_add_subnet_indexes_and_defer.py
80419263930a_add_subnet_indexes_and_defer.py
py
638
python
en
code
null
github-code
18
[ { "api_name": "alembic.op.create_index", "line_number": 17, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 17, "usage_type": "name" }, { "api_name": "alembic.op.f", "line_number": 17, "usage_type": "call" }, { "api_name": "alembic.op.drop_index...
36737459389
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 易盾反垃圾云服务视频点播离线结果获取接口python示例代码 接口文档: http://dun.163.com/api.html python版本:python3.7 运行: 1. 修改 SECRET_ID,SECRET_KEY,BUSINESS_ID 为对应申请到的值 2. $ python video_callback.py """ __author__ = 'yidun-dev' __date__ = '2019/11/27' __version__ = '0.2-dev' import hashlib imp...
yidun/antispam-python-demo
video/video_callback.py
video_callback.py
py
4,338
python
en
code
22
github-code
18
[ { "api_name": "gmssl.sm3.sm3_hash", "line_number": 53, "usage_type": "call" }, { "api_name": "gmssl.sm3", "line_number": 53, "usage_type": "name" }, { "api_name": "gmssl.func.bytes_to_list", "line_number": 53, "usage_type": "call" }, { "api_name": "gmssl.func", ...
20210946819
from abstract_scraper import AbstractScraper from decimal import Decimal import time import datetime import requests from bs4 import BeautifulSoup class OglasiRsScraper(AbstractScraper): url = 'https://www.oglasi.rs/oglasi/nekretnine/prodaja/stanova/grad/novi-sad/deo/liman+liman-1+liman-2+liman-3+liman-4?p={PAGE_...
acailic/sls-basics
scraper/oglasi_rs_scraper.py
oglasi_rs_scraper.py
py
3,521
python
en
code
0
github-code
18
[ { "api_name": "abstract_scraper.AbstractScraper", "line_number": 8, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.Be...
11413358402
import os import numpy as np from pwfluo.objects import ( FluoImage, Particle, SetOfCoordinates3D, SetOfParticles, ) from pwfluo.protocols import ProtFluoBase from pyworkflow import BETA from pyworkflow.protocol import Form, Protocol, params from scipy.ndimage import affine_transform def split_ome_ti...
jplumail/scipion-fluo-singleparticle
singleparticle/protocols/protocol_extract_particles.py
protocol_extract_particles.py
py
5,404
python
en
code
0
github-code
18
[ { "api_name": "os.path.splitext", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "pyworkflow.protocol.Protocol", "line_number": 36, "usage_type": "name" }, { "api_name": "pwfluo.pro...
27003584273
import torch import numpy as np import cv2 CONFIDENCE = 0.60 MARGIN = 100 model = torch.hub.load( "ultralytics/yolov5", "custom", path="./model/train/exp/weights/last.pt", ) def runFaceDetection(name): cap = cv2.VideoCapture(0) while cap.isOpened(): ret, frame = cap.read() result...
ErikBenavides/faceRecognition
detection/main.py
main.py
py
2,446
python
en
code
2
github-code
18
[ { "api_name": "torch.hub.load", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.hub", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.rectangle", "lin...
11201496519
""" This is an SQLAlchemy session handler for Flask Original work by Alex Grönholm, found on https://gist.github.com/agronholm/7249102 """ from sqlalchemy.engine import create_engine from sqlalchemy.orm.scoping import scoped_session from sqlalchemy.orm.session import sessionmaker class SQLAlchemy: engine = None...
BenjaminSchubert/HEIG_2016_GEN_project
authentication_server/phagocyte_authentication_server/sqlalchemy_session.py
sqlalchemy_session.py
py
1,068
python
en
code
0
github-code
18
[ { "api_name": "sqlalchemy.engine.create_engine", "line_number": 26, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.scoping.scoped_session", "line_number": 27, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.session.sessionmaker", "line_number": 27, "usage_typ...
12954679884
import pandas as pd import sys from logzero import logger import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler, PolynomialFeatures from sklearn.linear_model import Lasso, LinearRegression, LogisticRegression from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier from sklea...
hehlinge42/credit_score_interpretability
src/surrogate.py
surrogate.py
py
4,957
python
en
code
0
github-code
18
[ { "api_name": "sys.modules", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 50, "usage_type": "call" }, { "api_name": "logzero.logger.info"...
18059317963
import copy import torch import torch.utils import os from utils.utils import load_pickle from utils.replay_buffer import ReplayBufferBarrier as ReplayBuffer import numpy as np from utils.plotter_reacher import plot_results from utils.models import GaussianDiffusion as ProbDiffusion from diffuser.models.temporal impor...
nicob15/Trajectory-Generation-Control-and-Safety-with-Denoising-Diffusion-Probabilistic-Models
train_DDPMs.py
train_DDPMs.py
py
14,461
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.manual_seed", "line_number": 82, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 83, "usage_type": "call" }, { "api_name": "numpy.ran...
14898511640
import json from datetime import datetime, timedelta, timezone # Importaciones de Flask from flask import Flask, jsonify, request from flask_cors import CORS # Importaciones de MongoDB from pymongo import MongoClient from bson import ObjectId # Importaciones para la autenticación from flask_jwt_extended import ( ...
SebastianAMo/MongoNotes
Backend/app.py
app.py
py
4,627
python
es
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 21, "usage_type": "call" }, { "api_name": "flask_jwt_extended.JWTManager", "line_number": 22, "usage_type": "call" }, { "api_name": "flask_co...
43423876718
from typing import List, Optional, Sequence from . import seq from .color import Color from .seq import Alphabet # TODO: Make as abstract class ColorRule: """ Define an interface for coloring individual symbols based on their position and identity. Subclasses should reimplement the symbol_color() method...
WebLogo/weblogo
weblogo/colorscheme.py
colorscheme.py
py
5,741
python
en
code
128
github-code
18
[ { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "color.Color", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 33, "usage_type": "name" }, { "api_name": "seq.Alphabet", "line_numb...
21349150375
#Credit to WeBots for the Mavic controller in C for robot movement: https://github.com/cyberbotics/webots/blob/released/projects/robots/dji/mavic/controllers/mavic2pro/mavic2pro.c import math import time import random import copy import cv2 import numpy as np from matplotlib import pyplot as plt from controller import...
Ccon012/Drone-Control-for-DJI-mavic
mavic.py
mavic.py
py
8,890
python
en
code
0
github-code
18
[ { "api_name": "controller.Robot", "line_number": 16, "usage_type": "call" }, { "api_name": "controller.Camera.enable", "line_number": 20, "usage_type": "call" }, { "api_name": "controller.Camera", "line_number": 20, "usage_type": "name" }, { "api_name": "controlle...
19201244555
from PyQt5.QtCore import Qt, QRectF from PyQt5.QtGui import QIntValidator, QColor from PyQt5.QtWidgets import QVBoxLayout, QHBoxLayout, QLabel, QLineEdit, QGraphicsView, QGraphicsScene, QCheckBox, \ QMessageBox class ScreenshotAreaLayout: def __init__(self, config, main_window, parent_layout): self.co...
wdragondragon/apex-yolov5
apex_yolov5/window_layout/screenshot_area_layout.py
screenshot_area_layout.py
py
11,334
python
en
code
8
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QVBoxLayout", "line_number": 14, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QHBoxLayout", "line_number": 17, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 18, "usage_type": "call" }, { "ap...
4005493734
import random from absl.testing import parameterized import numpy as np from tensorflow.python.client import session from tensorflow.python.eager import backprop from tensorflow.python.eager import context from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorfl...
tensorflow/tensorflow
tensorflow/python/ops/ragged/ragged_to_tensor_op_test.py
ragged_to_tensor_op_test.py
py
34,105
python
en
code
178,918
github-code
18
[ { "api_name": "tensorflow.python.ops.array_ops.placeholder_with_default", "line_number": 26, "usage_type": "call" }, { "api_name": "tensorflow.python.ops.array_ops", "line_number": 26, "usage_type": "name" }, { "api_name": "tensorflow.python.ops.ragged.ragged_tensor.RaggedTensor"...
11421850733
import random import time import requests import tweepy def randomTimes(averagesecondsbetweencalls): print(random.gauss(averagesecondsbetweencalls, 60*1)) return random.gauss(averagesecondsbetweencalls, 60*1) #check all of followers #if they have a star or a retweet, also retweet and/or star access_token = ...
jakeingit/Showerthoughts-Reddit-to-Twitter-Bot
practice2.py
practice2.py
py
2,471
python
en
code
0
github-code
18
[ { "api_name": "random.gauss", "line_number": 8, "usage_type": "call" }, { "api_name": "random.gauss", "line_number": 9, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 23, "usage_type": "call" }, { "api_name": "tweepy.API", "line_nu...
11099787620
import base64 import json import threading import time from io import BytesIO import qrcode from pyncm import load_response from pyncm.apis.login import LoginQrcodeUnikey, \ LoginQrcodeCheck, GetCurrentLoginStatus, write_login_info_and_dump_to_database, WriteLoginInfo, SetNewSession def check_qr_status(uuid, us...
tomly2019m/TheLiveMusicDjangoProject
liveMusicDjangoProject/n/cloudMusicLogin.py
cloudMusicLogin.py
py
2,064
python
en
code
1
github-code
18
[ { "api_name": "pyncm.apis.login.LoginQrcodeCheck", "line_number": 23, "usage_type": "call" }, { "api_name": "pyncm.apis.login.write_login_info_and_dump_to_database", "line_number": 27, "usage_type": "call" }, { "api_name": "pyncm.apis.login.GetCurrentLoginStatus", "line_numbe...
24933475846
# requires curl, and grib_copy for navgem (ECC grib_tools) import re import os import subprocess import time import re import requests from datetime import datetime, timedelta import sqlite3 import json import shutil # generalize to ecmwf (json), navgem(asc), and cmc # todo need a space margin (1 gb at least, as 500 ...
JRPdata/cyclone_genesis
download.py
download.py
py
34,348
python
en
code
0
github-code
18
[ { "api_name": "threading.Event", "line_number": 210, "usage_type": "call" }, { "api_name": "shutil.disk_usage", "line_number": 228, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 261, "usage_type": "call" }, { "api_name": "json.loads", ...
36434046222
from typing import Generator, NamedTuple, Optional from jaxtyping import Array, Float, Int import jax.numpy as jnp import jax.random as jr import numpy as np class Batch(NamedTuple): x: jnp.ndarray y: jnp.ndarray def num_batches(x: jnp.ndarray, batch_size: int) -> int: """ Compute the number of bat...
alexjackson1/opt-evo
loader.py
loader.py
py
1,852
python
en
code
0
github-code
18
[ { "api_name": "typing.NamedTuple", "line_number": 9, "usage_type": "name" }, { "api_name": "jax.numpy.ndarray", "line_number": 10, "usage_type": "attribute" }, { "api_name": "jax.numpy", "line_number": 10, "usage_type": "name" }, { "api_name": "jax.numpy.ndarray",...
23140714592
import gzip from pathlib import Path import shutil import sys import re import subprocess import toml import pytest from polycotylus._project import Project, expand_pip_requirements, \ check_maintainer from polycotylus._exceptions import PolycotylusUsageError, PresubmitCheckError, \ AmbiguousLicenseError, NoL...
bwoodsend/polycotylus
tests/test_project.py
test_project.py
py
14,290
python
en
code
0
github-code
18
[ { "api_name": "polycotylus._project.Project.from_root", "line_number": 22, "usage_type": "call" }, { "api_name": "shared.dumb_text_viewer", "line_number": 22, "usage_type": "argument" }, { "api_name": "polycotylus._project.Project", "line_number": 22, "usage_type": "name"...
28410682750
import unittest from ..quantities import LcQuantity from ...archives import BasicArchive, Qdb from ...lcia_engine import IPCC_2007_GWP mass_uuid = '93a60a56-a3c8-11da-a746-0800200b9a66' class QuantitiesTest(unittest.TestCase): @classmethod def setUpClass(cls): super(QuantitiesTest, cls).setUpClass...
AntelopeLCA/core
antelope_core/entities/tests/test_quantities.py
test_quantities.py
py
1,565
python
en
code
1
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 12, "usage_type": "attribute" }, { "api_name": "archives.Qdb.new", "line_number": 16, "usage_type": "call" }, { "api_name": "archives.Qdb", "line_number": 16, "usage_type": "name" }, { "api_name": "archives.BasicAr...
10658194612
''' Things we want to do here: - load saved rl model and watch the algorithm play - load log data from training environment and analyze it ''' import pickle import numpy as np import matplotlib.pyplot as plt # from torch import seed # from copy import deepcopy import time from scipy.signal import savgol_filter as...
AnthonyAborizk/ARPOD
analyse.py
analyse.py
py
2,345
python
en
code
0
github-code
18
[ { "api_name": "pickle.load", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 41, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 43, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
3699172604
import ctypes from ctypes import windll,Structure, c_ulong, byref import time import datetime import sys import tkinter as tk from functools import partial numclicks = 0 class MainWindow(tk.Frame): def __init__(self, parent, *args, **kwargs): tk.Frame.__init__(self, parent, *args, **kwargs...
Benny-Git/autoclicker
autoclick.py
autoclick.py
py
2,310
python
en
code
0
github-code
18
[ { "api_name": "tkinter.Frame", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tkinter.Frame.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "tkinter.Frame", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tkinter....
877962550
# -*- coding: utf-8 -*- """ Created on Fri Mar 4 16:07:33 2022 @author: rvishwakar23 """ # import the necessary packages from detection import Detection from scipy.spatial import distance as dist import numpy as np import argparse import pyautogui import imutils import cv2 import os import csv #fr...
Rankush888/Social-Distancing-Detector
SocialDistanceDetector/social_distance_detector.py
social_distance_detector.py
py
9,385
python
en
code
1
github-code
18
[ { "api_name": "loggingModule.makeLog", "line_number": 33, "usage_type": "call" }, { "api_name": "detection.Detection", "line_number": 35, "usage_type": "call" }, { "api_name": "cv2.dnn.readNetFromDarknet", "line_number": 43, "usage_type": "call" }, { "api_name": "...
26209926579
import json import numpy as np nodeData = [] adjMatrix = np.zeros([3,199,199],dtype = int) def getData(): with open('nodes.json') as json_file: data = json.load(json_file) for i in range(0,len(data)): thisNode = [] thisNode.append(data[i]['number']) thisNode.app...
Souruly/Scotland-Yard-Helper
scotland.py
scotland.py
py
2,964
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 5, "usage_type": "call" }, { "api_name": "json.load", "line_number": 9, "usage_type": "call" } ]
36630443123
from django.urls import path, include from api.product.views.add_product import ProductAddModelViewSet, ManufacturedProductAddModelViewSet from api.product.views.filter_product import ProductHistoryAPIView from api.product.views.price import CalculateProductPrice from api.product.views.product import * from rest_frame...
Aziz0507/beckend
api/product/urls.py
urls.py
py
1,057
python
en
code
1
github-code
18
[ { "api_name": "rest_framework.routers.SimpleRouter", "line_number": 9, "usage_type": "call" }, { "api_name": "rest_framework.routers.SimpleRouter", "line_number": 10, "usage_type": "call" }, { "api_name": "rest_framework.routers.SimpleRouter", "line_number": 11, "usage_ty...
14011847199
import numpy as np import cv2 import glob class CameraCalibration: def __init__(self, calib_image_dir, chessboard_size): self.chessboard_size = chessboard_size self.calib_image_dir = calib_image_dir self.objectPoints = [] self.imagePoints = [] self.setCalibrationPoints() ...
hkmangla/CarND-Advanced-Lane-Lines
code/calibration.py
calibration.py
py
1,592
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.mgrid", "line_number": 19, "usage_type": "attribute" }, { "api_name": "glob.glob", "line...
19245874439
#The main author of this code is Aparna Gupta. The maintenance and updates to this code are made by Prathyush Sambaturu. from gurobipy import * import argparse from datetime import datetime import random as rand # import input_preprocessing # import ecml_data_processing import pandas as pd import numpy as np ...
prathyush6/ExplainabilityCodeAAAI20
LP_rounding.py
LP_rounding.py
py
15,141
python
en
code
3
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 56, "usage_type": "call" }, { "api_name": "datetim...
69935016041
from urllib import request, parse from boto3 import client import boto3 from contextlib import closing def get_acapela_sound(message, end_point='us-east-1', output_format='mp3', voice_id='Celine'): #params = { #'cl_login' : loginType, #'cl_app' : loginUser, #'cl_pwd' : loginPassword, #'req_voice'...
e-lie/concerteur_ynh
sources/app/acapelaVaas.py
acapelaVaas.py
py
1,361
python
en
code
0
github-code
18
[ { "api_name": "boto3.client", "line_number": 18, "usage_type": "call" }, { "api_name": "contextlib.closing", "line_number": 26, "usage_type": "call" } ]
30963274939
# coding: utf-8 ''' 2020년5월19일 현재: tensorflow-gpu 2.2, 2.1 설치해도 error. 2.0.2는 error 안남. 버전 2.2 설치 해결책: https://github.com/tensorflow/tensorflow/issues/35618#issuecomment-596631286 <-- 여기 참고. latest microsoft visual c++ redistributable 설치하면, 해결된다. 1.x 에서의 contrib가 SIG Addons로 갔다. SIG(special Interes...
rheehot/hccho2FirstGitProject
TF2/TF2_basics.py
TF2_basics.py
py
10,907
python
en
code
null
github-code
18
[ { "api_name": "tensorflow.__version__", "line_number": 39, "usage_type": "attribute" }, { "api_name": "tensorflow.test.is_gpu_available", "line_number": 40, "usage_type": "call" }, { "api_name": "tensorflow.test", "line_number": 40, "usage_type": "attribute" }, { ...
28657132485
#!/usr/bin/env python3 import logging import os from asyncio import Event from configparser import ConfigParser from datetime import datetime from subprocess import check_output, CalledProcessError from sys import argv from sys import exit, exc_info, hexversion from traceback import format_exception from typing import ...
ihaveamac/Kurisu-old-new-and-improved
kurisu2.py
kurisu2.py
py
10,906
python
en
code
0
github-code
18
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 20, "usage_type": "name" }, { "api_name": "discord.ext.commands.Bot", "line_number": 24, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 24, "usage_type": "name" }, { "api_name"...
11830389103
# coding: utf-8 """ NiFi Rest API The Rest API provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ...
Chaffelson/nipyapi
nipyapi/nifi/models/state_map_dto.py
state_map_dto.py
py
5,090
python
en
code
228
github-code
18
[ { "api_name": "six.iteritems", "line_number": 136, "usage_type": "call" }, { "api_name": "pprint.pformat", "line_number": 160, "usage_type": "call" } ]
19762580404
''' Created on 22 jan 2012 @author: Batch ''' import os from datetime import datetime def create_directory(dir_path, dir_name=None): if dir_name: dir_path = os.path.join(dir_path, dir_name) dir_path = dir_path.strip() if not os.path.exists(dir_path): os.makedirs(dir_path) return dir_pa...
alicanlakot/alicanlakot-s-xbmc-plugins
plugin.video.furklibraryx/utils/filehelpers.py
filehelpers.py
py
1,438
python
en
code
3
github-code
18
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
22987155942
import pytest from starknet_py.serialization._context import SerializationContext from starknet_py.serialization.errors import InvalidTypeException, InvalidValueException @pytest.mark.parametrize( "initial_exception, wrapped_class", [ (ValueError("Test"), InvalidValueException), (TypeError("T...
software-mansion/starknet.py
starknet_py/serialization/_context_test.py
_context_test.py
py
569
python
en
code
231
github-code
18
[ { "api_name": "pytest.raises", "line_number": 15, "usage_type": "call" }, { "api_name": "starknet_py.serialization._context.SerializationContext.create", "line_number": 16, "usage_type": "call" }, { "api_name": "starknet_py.serialization._context.SerializationContext", "line_...
33808603534
import numpy as np import os import pandas as pd import argparse from PIL import Image import torchvision import torchvision.transforms as transforms from label_selection import choose_target from sample_generation import attack_to_target from util import * ################################ # Preparation ##############...
YogaLYJ/IJCNN2022_LabelFool
main.py
main.py
py
2,617
python
en
code
4
github-code
18
[ { "api_name": "torchvision.transforms.Compose", "line_number": 20, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 20, "usage_type": "name" }, { "api_name": "torchvision.transforms.Resize", "line_number": 21, "usage_type": "call" }, { ...
1121450681
from mars_rover_kata import mars_rover, turn, warp_drive from pytest import mark rover_params = [ ("F", "0:1:N"), ("FF", "0:2:N"), ("FFF", "0:3:N"), ("R", "0:0:E"), ("RLL", "0:0:W"), ("RF", "1:0:E"), ("RFLFLF", "0:1:W"), ("LF", "9:0:W"), ("RFFFFFFFFFF", "0:0:E"), ("FFFFFFFFFF", ...
sbackus/mars-rover
test_mars_rover.py
test_mars_rover.py
py
896
python
en
code
0
github-code
18
[ { "api_name": "mars_rover_kata.mars_rover", "line_number": 20, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 18, "usage_type": "name" }, { "api_name": "mars_r...
6505792251
from django.shortcuts import render, redirect from .models import Post from .forms import PostCreationForm def home(request): posts = Post.objects.all() return render(request, 'home.html', {'posts': posts}) def create(request): form = PostCreationForm() if request.method == 'POST': form = P...
m-muhammadjon/blogpost-with-image-or-video-uplaod
post/views.py
views.py
py
769
python
en
code
0
github-code
18
[ { "api_name": "models.Post.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 8, "usage_type": "name" }, { "api_name": "django.shor...
13142310079
from __future__ import print_function, division, absolute_import, unicode_literals import functools from ..base import BaseEstimator, BaseModel from ..utils.params import (param_def, check_int, check_string, check_boolean, check_float, check_variable, check_variable_list, ...
sassoftware/python-pipefitter
pipefitter/estimator/tree.py
tree.py
py
4,856
python
en
code
12
github-code
18
[ { "api_name": "base.BaseEstimator", "line_number": 10, "usage_type": "name" }, { "api_name": "utils.params.param_def", "line_number": 61, "usage_type": "call" }, { "api_name": "functools.partial", "line_number": 61, "usage_type": "call" }, { "api_name": "utils.par...
24933139694
from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains import time import os driver=webdriver.Chrome() file = "file:///" + os.path.abspath("../../../selenium2html/modal.html") driver.get(file) time.sleep(2) dr = driver.find_element_by_css_selector("#show_modal") dr.click() t...
cancanf/pythonProject
bit/test/seleiumAPI/练习/DIV框.py
DIV框.py
py
510
python
en
code
0
github-code
18
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 8, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", ...
33426351841
from django.urls import path from advertisement.views import AdvertisementCreateView, AdvertisementDetailView, AdvertisementListView, \ AdvertisementUpdateView urlpatterns = [ path('list/', AdvertisementListView.as_view(), name='adv-list'), path('detail/<str:upc>', AdvertisementDetailView.as_view(), name=...
shayanostovari/Divar-Clone
advertisement/urls.py
urls.py
py
497
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "advertisement.views.AdvertisementListView.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "advertisement.views.AdvertisementListView", "line_number": 7, "usage_typ...
24586398597
from __future__ import annotations import asyncio from collections.abc import AsyncIterator from collections.abc import Awaitable import contextlib import logging import pathlib from typing import Any from typing import Callable import libtorrent as lt from tvaf import caches from .. import config as config_lib fro...
AllSeeingEyeTolledEweSew/tvaf
src/tvaf/services/atp.py
atp.py
py
3,319
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 21, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 24, "usage_type": "name" }, { "api_name": "libtorrent.add_torrent...
30414654814
import os import zipfile import shutil import glob import tqdm from subprocess import PIPE, Popen, TimeoutExpired HEADER = '\033[95m' OK = '\033[94m' PASS = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' class Unbundler: def __init__(self, folderName): ...
ierezell/TeachingAssistant
Correcteur2000/Unbundler.py
Unbundler.py
py
3,547
python
en
code
0
github-code
18
[ { "api_name": "os.path.exists", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number...
1062305485
__author__ = "Jake Nunemaker" __copyright__ = "Copyright 2020, National Renewable Energy Laboratory" __maintainer__ = "Jake Nunemaker" __email__ = "Jake.Nunemaker@nrel.gov" from copy import deepcopy from itertools import product import pytest from wisdem.orbit.phases.design import OffshoreSubstationDesign base = {...
WISDEM/WISDEM
wisdem/test/test_orbit/phases/design/test_oss_design.py
test_oss_design.py
py
2,156
python
en
code
125
github-code
18
[ { "api_name": "wisdem.orbit.phases.design.OffshoreSubstationDesign", "line_number": 34, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 22, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 22, "usage_type": "attribute" ...
18920669483
# -*- coding: utf-8 -*- # Roger - Facial detection # Joseph - Canny # Lyndon - Canny line -> smoothing/thickness modifier along lines # Sabrina - Textures # Kelsey - Quantizing RGB/HSV """CS4476Prj.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/driv...
Cartoonify/Cartoonify.github.io
src/cs4476prj.py
cs4476prj.py
py
6,255
python
en
code
0
github-code
18
[ { "api_name": "numpy.set_printoptions", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.inf", "line_number": 29, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 44, "usage_type": "attribute" }, { "api_name": "numpy.zeros_...
32783199912
from django.db import models from django.utils.text import slugify from django.utils.translation import gettext_lazy as _ from Nectar.models import BaseModelNative, BaseModelSVG from Language.models import Language from Payment.models import Currency # Create your models here. class Country(BaseModelNative, BaseM...
shady-elnady/nectar
API/DjangoRest/Location/models.py
models.py
py
9,971
python
en
code
1
github-code
18
[ { "api_name": "Nectar.models.BaseModelNative", "line_number": 13, "usage_type": "name" }, { "api_name": "Nectar.models.BaseModelSVG", "line_number": 13, "usage_type": "name" }, { "api_name": "django.db.models.TextChoices", "line_number": 15, "usage_type": "attribute" },...
9227997025
import numpy as np from sklearn.neural_network import MLPClassifier from sklearn.preprocessing import LabelBinarizer from sklearn.model_selection import KFold import sqlite3 from sqlite3 import Error import sys def create_connection(db_file): """ create a database connection to the SQLite database specified...
vaggos99/Pattern-Recognition
mlp.py
mlp.py
py
4,606
python
en
code
0
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "sqlite3.Error", "line_number": 17, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
29258468531
#Mac setup, # First install matplotlib and networkx # then install graphviz using brew install graphviz # then install pygraphviz using pip install pygraphviz import networkx as nx import matplotlib.pyplot as plt from math import cos, sin, pi class mGraph: def __init__(self, path=None): self.curr_id = 0 ...
skakunm/mindGraph
mGraph.py
mGraph.py
py
6,667
python
en
code
0
github-code
18
[ { "api_name": "networkx.DiGraph", "line_number": 14, "usage_type": "call" }, { "api_name": "networkx.drawing.nx_agraph.graphviz_layout", "line_number": 132, "usage_type": "call" }, { "api_name": "networkx.drawing", "line_number": 132, "usage_type": "attribute" }, { ...
7802762299
from net import AlphaZeroResNet import torch import chess from input_representation import board_to_planes from output_representation import legal_moves_to_flat_planes from MCTS_search import MCTS import numpy as np import time import pandas as pd def get_priors(visits, legal_moves, color): ''' Helper function...
AdrianGlauben/Studienarbeit_DRL
alphazero/train.py
train.py
py
5,657
python
en
code
0
github-code
18
[ { "api_name": "numpy.sum", "line_number": 24, "usage_type": "call" }, { "api_name": "output_representation.legal_moves_to_flat_planes", "line_number": 25, "usage_type": "call" }, { "api_name": "chess.Board", "line_number": 48, "usage_type": "call" }, { "api_name":...
36548737134
import numpy as np import matplotlib.pyplot as plt import matplotlib.patheffects as path_effects import imageio import os import random as rnd import time import matplotlib.colors as colors import matplotlib.lines as lines from matplotlib import cm from matplotlib.ticker import LinearLocator from mpl_toolkit...
AlegrettiOwl/FDM
derivative.py
derivative.py
py
2,725
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros_like", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "...
21301007538
from tkinter import * from tkinter.ttk import * import time import serial import io # # Runs with python 3 # works for microlab 500 # root = Tk() master = Frame(root, name='master') master.pack(fill=BOTH) # fill both sides of the parent root.title('Syringe Control') # title for top-level window root.pr...
DolicaAkelloEgwel/syringeposter
syringeCtrlV3.py
syringeCtrlV3.py
py
13,520
python
en
code
0
github-code
18
[ { "api_name": "time.sleep", "line_number": 198, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 224, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 226, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 2...
41227161021
from deap import base from deap import creator from deap import tools from deap import algorithms import random import numpy import matplotlib.pyplot as plt import seaborn as sns import knapsack from utils import processing_str_lst # Genetic Algorithm constants: POPULATION_SIZE = 65 P_CROSSOVER = 0.9 # probability...
anhquan075/CS106-Knapsack
genetic_knapsack.py
genetic_knapsack.py
py
3,801
python
en
code
3
github-code
18
[ { "api_name": "utils.processing_str_lst", "line_number": 24, "usage_type": "call" }, { "api_name": "knapsack.Knapsack01Problem", "line_number": 35, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 43, "usage_type": "call" }, { "api_name": "deap....
74647863721
from django.urls import path from start import views urlpatterns = [ path('', views.start), path('candidates', views.getCandidates), path('add_candidate', views.addCandidate), path('change_candidate/<int:pk>', views.changeCandidate), path('change_job/<int:pk>', views.changeJob), path('change_j...
gurinboru/HR_CRM_System
start/urls.py
urls.py
py
966
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "start.views.start", "line_number": 6, "usage_type": "attribute" }, { "api_name": "start.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.urls.path", ...
5749646795
import sys import argparse import math from collections import defaultdict import itertools reset_report = None def print_usage(name, input_file): print(f"Usage: python3 {name} {input_file}") def load_inputs(input_file): global reset_report report = [] if reset_report is not None: report = r...
smokeytheblair/adventcode
2020/day13.py
day13.py
py
3,454
python
en
code
2
github-code
18
[ { "api_name": "itertools.combinations", "line_number": 79, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 121, "usage_type": "call" }, { "api_name": "argparse.FileType", "line_number": 122, "usage_type": "call" }, { "api_name": "sy...
1066359316
import asyncio import datetime import os import subprocess import discord import humanize import psutil from cogs.consts import * from cogs.handlers import Handlers from discord.ext import commands class Git(commands.Cog): def __init__(self, bot): self.bot = bot self.assignees = "PineaFan" ...
ClicksMinutePer/rsm
cogs/internal/git.py
git.py
py
11,859
python
en
code
1
github-code
18
[ { "api_name": "discord.ext.commands.Cog", "line_number": 14, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 14, "usage_type": "name" }, { "api_name": "cogs.handlers.Handlers", "line_number": 20, "usage_type": "call" }, { "api_nam...
41648872153
from discord.ext import commands import discord class Bot(commands.Bot): def __init__(self, command_prefix = '!', self_bot = False): intents = discord.Intents.all() intents.messages = True commands.Bot.__init__(self, command_prefix = command_prefix, intents = intents, self_bot = self_b...
dhrax/DisBots
bot.py
bot.py
py
692
python
en
code
0
github-code
18
[ { "api_name": "discord.ext.commands.Bot", "line_number": 4, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 4, "usage_type": "name" }, { "api_name": "discord.Intents.all", "line_number": 7, "usage_type": "call" }, { "api_name": "d...
73541665001
from unittest import mock import pytest from confluent_kafka import Consumer from streaming_data_types.fbschemas.forwarder_config_update_rf5k.UpdateType import ( UpdateType, ) from streaming_data_types.forwarder_config_update_rf5k import ( Protocol, StreamInfo, serialise_rf5k, ) from forwarder.common ...
ess-dmsc/forwarder-old
tests/store_configuration_test.py
store_configuration_test.py
py
5,809
python
en
code
3
github-code
18
[ { "api_name": "forwarder.common.Channel", "line_number": 22, "usage_type": "call" }, { "api_name": "forwarder.common.EpicsProtocol.PVA", "line_number": 22, "usage_type": "attribute" }, { "api_name": "forwarder.common.EpicsProtocol", "line_number": 22, "usage_type": "name"...
42901016043
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Tue Apr 14 17:20:17 2020 @author: Edyta Bosacka """ import os import librosa.display import matplotlib.pyplot as plt import numpy import librosa directory = 'E:/Nagrania' resultsDirectory = directory + "/MFCCsresult" for filename in os.li...
EdytaBosacka/Wspolczynniki_melcepstralne_mfccs
program_obliczajacy_wspolczynniki_mfccs.py
program_obliczajacy_wspolczynniki_mfccs.py
py
1,002
python
en
code
0
github-code
18
[ { "api_name": "os.listdir", "line_number": 18, "usage_type": "call" }, { "api_name": "librosa.load", "line_number": 20, "usage_type": "call" }, { "api_name": "librosa.feature.mfcc", "line_number": 21, "usage_type": "call" }, { "api_name": "librosa.feature", "l...
4592198877
import uuid import numpy as np class LearningModel: def __init__(self, w_vector: [float], d: float, model_id=None): self.model_id = model_id if model_id else str(uuid.uuid4()) self.w_vector = w_vector self.d = d self.score = 0 self.processed = False self.generati...
juanroldanbrz/dinobot
model/learning_model.py
learning_model.py
py
843
python
en
code
0
github-code
18
[ { "api_name": "uuid.uuid4", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 22, ...
22258335504
""" load data from the csv & sort_values adds days delta calc vs. failure date if available """ import time import pickle import pandas as pd import numpy as np from tqdm import tqdm from hlp_analysis import xstat def days_delta_calc(df): """ given data_frame returns days from the failure date """ return df.date....
yelled1/AmzTask
load_data.py
load_data.py
py
2,308
python
en
code
0
github-code
18
[ { "api_name": "time.time", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.datetime.strptime", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.datetime", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pandas.read_c...
41304458000
# -*- coding: utf-8 -*- """ Created on Fri May 5 18:41:06 2023 @author: mustafa """ import pydirectinput import time from PIL import ImageGrab from PIL import Image from numpy import asarray import pytesseract pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract' time.sleep(1) whil...
mustafacoban1994/LAWLOnlinePotBot
pot.py
pot.py
py
1,053
python
en
code
0
github-code
18
[ { "api_name": "pytesseract.pytesseract", "line_number": 16, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.ImageGrab.grab", "line_number": 32, "usage_type": "call" }, { "api_name": "PIL.ImageG...
29226758888
from typing import List from queue import PriorityQueue class Solution: def kthSmallest(self, matrix: List[List[int]], k: int) -> int: length = len(matrix) * (len(matrix[0]) if len(matrix) > 0 else 0) pq = PriorityQueue() for row in matrix: for n in row: pq.put(n...
3swu/programming-test
leetcode/378.py
378.py
py
520
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "queue.PriorityQueue", "line_number": 7, "usage_type": "call" } ]
9324600302
import numpy as np import pandas as pd import matplotlib.pylab as plt import seaborn as sns def load_data(): train_data_2011 = pd.read_csv('./data/gt_2011.csv').values train_data_2012 = pd.read_csv('./data/gt_2012.csv').values train_data_2013 = pd.read_csv('./data/gt_2013.csv').values train_data_2014 =...
lancec-7/24787-ML-AI
feature_label_relation.py
feature_label_relation.py
py
1,303
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "l...
14140361944
# This creates a table in a PostGIS enabled PostgreSQL database # with SMOS points and (circular) pixels. # table name table = 'smos_grid_ia' # set bounds for Iowa ia = { 'n': 44.0, 's': 40.0, 'e': -90.0, 'w': -97.0, } # connect to the database import psycopg2 conn = psycopg2.connect('') cur = conn.cursor...
jasoncpatton/jbragdon_code_examples
postgis_population/smos_grid_ia.py
smos_grid_ia.py
py
1,749
python
en
code
0
github-code
18
[ { "api_name": "psycopg2.connect", "line_number": 16, "usage_type": "call" } ]
29997419768
import torch import numpy from scipy.spatial.distance import cdist import distance as cuda from timeit import default_timer as Timer def cityblock(XA, XB): XC = list() for xa in XA: xa = xa.unsqueeze(0).expand_as(XB) XC.append( (xa-XB).abs().sum(0) ) return torch.stack(XC) XA = torch.rand...
timmlerc/phocnet-cvt
src/distances/pytorch/gpu/test.py
test.py
py
1,235
python
en
code
0
github-code
18
[ { "api_name": "torch.stack", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.randn", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.randn", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": ...
3406011101
import gym import numpy as np from gym.wrappers import Monitor # A states consists of the last images_per_state class CarRacingEnv(object): def __init__(self, vid_path, action_mode, images_per_state=4, time_diff_stack=1, num_skip=2, color="bw"): self.n = images_per_state self.t = time_diff_stack ...
SohamTamba/DeepRL
3 - Deep-Q Learning/env_wrapper.py
env_wrapper.py
py
4,145
python
en
code
1
github-code
18
[ { "api_name": "gym.make", "line_number": 11, "usage_type": "call" }, { "api_name": "gym.wrappers.Monitor", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.transpose", "line...
8879693036
import requests import datetime import os import csv import pandas as pd import pickle def get_time(): date = datetime.datetime.now() return date.strftime('%x').replace('/', '_') def load_obj(date, country=None): """ Loads existing pickle file to obj. :param date: search by date string format: '...
Tzvi23/COVID19-ITALY
data_func/request_class.py
request_class.py
py
5,815
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.sep.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path...
72580952680
# -*- coding:UTF-8 -*- import tensorflow as tf from tensorflow import keras import tushare as ts import numpy as np import pandas as pd import os import time import sys from absl import app from absl import flags import random sys.path.append("..") from common import base_common from common import np_common from commo...
Isaaclin007/tensorflow
regression/stockv2/extreme_wave.py
extreme_wave.py
py
7,803
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.setdefaultencoding", "line_number": 24, "usage_type": "call" }, { "api_name": "os.environ", ...
35565655215
#! /usr/bin/env python import numpy as np import json from tqdm import tqdm from typing import List, Dict, Tuple from pathlib import Path class InvalidEvaluationTypeError(Exception): def __init__(self, eval_type, message="Evaluation type is not in list [scale, goals]"): self.eval_type = eval_type ...
miguel-faria/task-legibility
legible_task/src/utilities.py
utilities.py
py
4,842
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 59, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 59, "usage_type": "name" }, { "api_name": "json.dump", "line_number": 67, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": ...
20200899669
#!/usr/bin/env python2.7 from __future__ import print_function from icalendar import Calendar, Event from datetime import datetime, timedelta from time import strptime, strftime, mktime """ See https://secure.wideworld-sports.me/wws_membership/PrintSchedule.asp?ID=1439 and https://secure.wideworld-sports.me/wws_member...
acaird/call-sched-parser
wwics.py
wwics.py
py
2,502
python
en
code
0
github-code
18
[ { "api_name": "icalendar.Calendar", "line_number": 18, "usage_type": "call" }, { "api_name": "icalendar.Event", "line_number": 21, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 50, "usage_type": "call" }, { "api_name": "time.strptime", ...
35514566636
from copy import deepcopy import logging import os from flamingo.core.errors import MultipleObjectsReturned, ObjectDoesNotExist from flamingo.core.data_model import Content, Q from flamingo.core.utils.string import slugify logger = logging.getLogger('flamingo.plugins.Menu') def is_active(section, menu, content): ...
pengutronix/flamingo
flamingo/plugins/menu/menu.py
menu.py
py
5,588
python
en
code
18
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "flamingo.core.data_model.Content", "line_number": 33, "usage_type": "argument" }, { "api_name": "flamingo.core.utils.string.slugify", "line_number": 50, "usage_type": "call" }, ...
25637023920
"""Обновлении таблицы успешных заказов Revision ID: 1d213c402d10 Revises: de9fdb3b95c9 Create Date: 2021-03-24 22:51:53.974240 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '1d213c402d10' down_revision = 'de9fdb3b95c9' branch_labels = None depends_on = None ...
lizatish/YandexBackendSchool2021
migrations/versions/1d213c402d10_обновлении_таблицы_успешных_заказов.py
1d213c402d10_обновлении_таблицы_успешных_заказов.py
py
894
python
en
code
0
github-code
18
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.DateTim...
34727849330
# -*- coding: utf-8 -*- """ Installer for the energy.content package. """ from os.path import join from setuptools import find_packages from setuptools import setup NAME = 'energy.content' PATH = ['src'] + NAME.split('.') + ['version.txt'] VERSION = open(join(*PATH)).read().strip() long_description = '\n\n'.join([ ...
eea/energy.content
setup.py
setup.py
py
2,324
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 20, "usage_type": "call" }, { "api_name": "setuptools.find_packages",...
18394640085
from django import forms from .models import ReflectIssues, ReflectContents, ReflectProblem # class ReflectIssues...で使う class ReflectIssuesForm(forms.ModelForm): class Meta: model = ReflectIssues fields = ('issues',) labels = {'issues': '論点'} class ReflectContentsForm(forms.ModelForm): ...
wasawasa12/idea-app
reflect/forms.py
forms.py
py
739
python
en
code
0
github-code
18
[ { "api_name": "django.forms.ModelForm", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "models.ReflectIssues", "line_number": 9, "usage_type": "name" }, { "api_name": "django.for...
74502355240
import pytest from src.entities import Room, Map, UndirectedGraph @pytest.mark.parametrize("room, expected", [ ({"id": 1, "name": "Hallway", "north": 2, "east": 7, "objects": []}, {2, 7}), ({"id": 7, "name": "Living room", "west": 1, "north": 4, "objects": []}, {1, 4}), ({"id": 5, "name": "Bedroom", "sou...
deborahdelgaudio/a-maze-ingly-retro-route-puzzle
tests/test_entities.py
test_entities.py
py
2,473
python
en
code
1
github-code
18
[ { "api_name": "src.entities.Room", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 6, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 6, "usage_type": "attribute" }, { "api_name": "src.entities...
38030515563
import tkinter as tk import consulta as c import push import slack_mensage import time from datetime import datetime root = tk.Tk() root.geometry('600x200') root.title("Monitor Maestro") root.iconbitmap('equiplano-logo-vertical.ico') sec = None consulta = c.Consulta() def tick(): global sec global respostas ...
Richielly/appStatusMaestro
main.py
main.py
py
2,187
python
pt
code
0
github-code
18
[ { "api_name": "tkinter.Tk", "line_number": 8, "usage_type": "call" }, { "api_name": "consulta.Consulta", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime",...
18955803502
# -*- coding: utf-8 -*- import pytest import ZConfig import transaction from collections import OrderedDict from ZODB import DB from ZODB.DemoStorage import DemoStorage from cromlech.zodb.utils import eval_loader, init_db from cromlech.zodb.utils import initialize_applications from ..testing import DummySite, MyApp...
clozinski/cromlech.zodb
src/cromlech/zodb/tests/test_utils.py
test_utils.py
py
2,318
python
en
code
null
github-code
18
[ { "api_name": "cromlech.zodb.utils.eval_loader", "line_number": 18, "usage_type": "call" }, { "api_name": "cromlech.zodb.utils.eval_loader", "line_number": 19, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 21, "usage_type": "call" }, { "api...
21251129472
import logging import textwrap from abc import abstractmethod from copy import copy from typing import Any, Iterable, List, Optional import numpy as np from scipy.stats import truncnorm import popart from pingpong.scope_manager import Scope def normal_init_data(dtype, shape, mean, std_dev): # Truncated random n...
alex-titterton/examples
applications/popart/bert/pingpong/nn.py
nn.py
py
7,460
python
en
code
null
github-code
18
[ { "api_name": "scipy.stats.truncnorm.rvs", "line_number": 16, "usage_type": "call" }, { "api_name": "scipy.stats.truncnorm", "line_number": 16, "usage_type": "name" }, { "api_name": "numpy.prod", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.ge...
32986765566
"""Scrape data for all symbols in data/symbols/*.json Called from the command line as: python scrape_symbols.py <exchange> [start-symbol] """ import json import sys import argparse import time import requests import getquote as getquote from dbhandler import DbHandler if __name__ == "__main__": # Start a timer f...
lhovon/SQLScreen_Scraper
scrape_symbols.py
scrape_symbols.py
py
2,725
python
en
code
0
github-code
18
[ { "api_name": "time.perf_counter", "line_number": 17, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "json.load", "line_number": 42, "usage_type": "call" }, { "api_name": "json.load", "...
43507022007
#!/usr/bin/env python from google.appengine.ext.webapp import template from google.appengine.ext import ndb import logging import os.path import webapp2 import json from webapp2_extras import auth from webapp2_extras import sessions from webapp2_extras.auth import InvalidAuthIdError from webapp2_extras.auth import ...
pokmnx/Stratpad-Web
scratch/stratweb1/security.py
security.py
py
4,664
python
en
code
0
github-code
18
[ { "api_name": "webapp2_extras.auth", "line_number": 32, "usage_type": "name" }, { "api_name": "webapp2_extras.auth.get_user_by_session", "line_number": 33, "usage_type": "call" }, { "api_name": "webapp2_extras.auth", "line_number": 33, "usage_type": "name" }, { "a...
12702314845
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import logging import os import sys from core.crawl.crawler import Crawler from core.lib.utils import * from core.scan.scanner import Scanner from core.util.util import Util def split_argv(argv): argvs = [] cur = 0 for a in argv: if a == ";": ...
adfnekc/web_cap
eye1c.py
eye1c.py
py
2,293
python
en
code
0
github-code
18
[ { "api_name": "os.path.exists", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path", "line_number": 40, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 41, "usage_type": "call" }, { "api_name": "logging.basicConfig", "li...
26516898615
import dataclasses import functools from typing import Callable, Optional from acme import specs from acme.agents.jax.mbop import models from acme.jax import networks import jax from jax import random import jax.numpy as jnp # Function that takes (n_trajectories, horizon, action_dim) tensor of action # trajectories a...
deepmind/acme
acme/agents/jax/mbop/mppi.py
mppi.py
py
9,040
python
en
code
3,100
github-code
18
[ { "api_name": "typing.Callable", "line_number": 16, "usage_type": "name" }, { "api_name": "jax.numpy.ndarray", "line_number": 16, "usage_type": "attribute" }, { "api_name": "jax.numpy", "line_number": 16, "usage_type": "name" }, { "api_name": "jax.numpy.ndarray", ...
7565544648
''' Split audio into segments for easier inference ''' import math import multiprocessing import os from multiprocessing import freeze_support from pydub import AudioSegment class SplitWavAudio: def __init__(self, file_path, file, dest_path): self.file_path = file_path self.file = file ...
tikhonova/what_would_alan_watts_say
speech_synthesis/3_audio_split_into_segments.py
3_audio_split_into_segments.py
py
2,753
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pydub.AudioSegment.from_wav", "line_number": 20, "usage_type": "call" }, { "api_name": "pydub.AudioSegm...
42606649413
import os import re import subprocess from typing import List, Optional, Set, Tuple from bygg.common_types import CommandStatus def create_shell_command(shell_command: str, message: Optional[str] = None): def call_shell_command(inputs: Optional[Set[str]], outputs: Optional[Set[str]]): # Map stderr onto s...
rikardg/bygg
src/bygg/util.py
util.py
py
1,561
python
en
code
2
github-code
18
[ { "api_name": "typing.Optional", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Set", "line_number": 10, "usage_type": "name" }, { "api_name": "subprocess.run", "line_...
34147852886
import os import unittest import json from flask_sqlalchemy import SQLAlchemy from flaskr import create_app from models import setup_db, Question, Category class TriviaTestCase(unittest.TestCase): """This class represents the trivia test case""" def setUp(self): """Define test variables and initiali...
dg405/Trivia-API
backend/test_flaskr.py
test_flaskr.py
py
7,022
python
en
code
0
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flaskr.create_app", "line_number": 15, "usage_type": "call" }, { "api_name": "models.setup_db", "line_number": 19, "usage_type": "call" }, { "api_name": "flask_sqlalc...
41776230206
""" Available commands: - fab release [--bump=minor] : insert new version to project settings and update Changelog file from git log - fab finish : commit updated ChangeLog file, update version line in project settings and commit changes with tag - fab check : checks code using isort, flake8, mypy, pylint, black wit...
serg-the-engineer/usefulls
fabfile.py
fabfile.py
py
8,364
python
en
code
0
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
38290619741
from bs4 import BeautifulSoup from .base import Base import re class Subscene(Base): async def search(self, title): """ search function gives a title and search for it in subscene results will be passed as list of dicts, sample: {"name": "movie/series title", "link": "link to that ...
sina-e/subscene-api
app/subscene.py
subscene.py
py
5,359
python
en
code
11
github-code
18
[ { "api_name": "base.Base", "line_number": 6, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 32, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_n...
18738381561
import cv2 import webbrowser cap = cv2.VideoCapture(0) detector = cv2.QRCodeDetector() while True: ret, frame = cap.read() data = detector.detectAndDecode(frame) if data[0] != "": print(data[0]) idata = str(data[0]) webbrowser.open(idata, new=0, autoraise=True) if cv2.waitKe...
TOMOKKU/python_tests
QRurl.py
QRurl.py
py
399
python
en
code
0
github-code
18
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.QRCodeDetector", "line_number": 6, "usage_type": "call" }, { "api_name": "webbrowser.open", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.waitKey", "...
28131939740
import requests from TOKEN import TOKEN name_papka_unittest = 'папка_для_unittests' name_papka_pytest = 'папка_для_pytest' def header(TOKEN): headers = {'Content-Type': 'application/json', 'Authorization': f'OAuth {TOKEN}' } return headers def create(name_papka): head...
IlyaDyakonov/Prof_Work_Python_HW
HW6/yandex_api.py
yandex_api.py
py
578
python
en
code
0
github-code
18
[ { "api_name": "TOKEN.TOKEN", "line_number": 9, "usage_type": "name" }, { "api_name": "TOKEN.TOKEN", "line_number": 14, "usage_type": "argument" }, { "api_name": "requests.put", "line_number": 17, "usage_type": "call" } ]
38965371194
from telebot.types import CallbackQuery from telebot.types import InlineQuery, InlineQueryResultCachedDocument, InlineQueryResultArticle, \ InputTextMessageContent from app.models import User from app.services.files import get_file from app.utils.helper import generate_inline_id from ...base import callback...
netbriler/telegram-study-bot
app/bot/handlers/users/files.py
files.py
py
3,275
python
en
code
4
github-code
18
[ { "api_name": "telebot.types.InlineQuery", "line_number": 16, "usage_type": "name" }, { "api_name": "telebot.types.InlineQueryResultArticle", "line_number": 19, "usage_type": "call" }, { "api_name": "app.utils.helper.generate_inline_id", "line_number": 20, "usage_type": "...
10219191908
from django.urls import path from solf.apps.classes.api import views urlpatterns = [ path( "", views.ClassViewSet.as_view({"get": "list"}), name="class-list", ), path( "<int:pk>/", views.ClassViewSet.as_view( { "get": "retrieve", ...
mortilele/solf
solf/apps/classes/api/urls.py
urls.py
py
1,369
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "solf.apps.classes.api.views.ClassViewSet.as_view", "line_number": 8, "usage_type": "call" }, { "api_name": "solf.apps.classes.api.views.ClassViewSet", "line_number": 8, "usage_type"...
74666941161
import time import datetime #run "pip install win10toast" if not done already from win10toast import ToastNotifier toaster = ToastNotifier() toaster.show_toast("Toast Reminders","This is how you will be reminded", icon_path="i.ico") data = [] for d in open("times").read().sp...
EmilyBoarer/ToastReminders
ToastReminder.pyw
ToastReminder.pyw
pyw
1,076
python
en
code
0
github-code
18
[ { "api_name": "win10toast.ToastNotifier", "line_number": 8, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime.today", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.d...
39517910718
from default.framework.request_handler import SearchRequestHandler from google.appengine.api import taskqueue class LoadURLs(SearchRequestHandler): def get(self): queue = taskqueue.Queue('parser') with open('modules/parser/src/food_com_small.txt', 'r') as list_urls: for url in list_url...
toddka/Recipe-Search-Website
modules/parser/src/food_website.py
food_website.py
py
537
python
en
code
1
github-code
18
[ { "api_name": "default.framework.request_handler.SearchRequestHandler", "line_number": 4, "usage_type": "name" }, { "api_name": "google.appengine.api.taskqueue.Queue", "line_number": 6, "usage_type": "call" }, { "api_name": "google.appengine.api.taskqueue", "line_number": 6, ...
27486476839
import http import os from base64 import b64encode from typing import Dict from urllib.parse import quote import requests from requests import Request, Session from requests.adapters import HTTPAdapter from requests.auth import CONTENT_TYPE_FORM_URLENCODED from yarl import URL class BasicAuth(requests.auth.AuthBase)...
dzaytsev91/admitad-example
main.py
main.py
py
3,768
python
en
code
0
github-code
18
[ { "api_name": "requests.auth", "line_number": 14, "usage_type": "attribute" }, { "api_name": "requests.Request", "line_number": 18, "usage_type": "name" }, { "api_name": "yarl.URL", "line_number": 24, "usage_type": "call" }, { "api_name": "requests.Session", "...
43861811408
"""Classe de template.""" import sys from .factory import Factory from .sh import Sh class TProjects__others__ezored__src__maindot_cpp(Factory): """Classe de template.""" def __init__(self, data_model, template_name): Factory.__init__(self, template_name) self.data_model = data_model ...
lopesivan/template-code
w-ezored-linux/w/v/tprojects__others__ezored__src__maindot_cpp.py
tprojects__others__ezored__src__maindot_cpp.py
py
913
python
en
code
0
github-code
18
[ { "api_name": "factory.Factory", "line_number": 8, "usage_type": "name" }, { "api_name": "factory.Factory.__init__", "line_number": 13, "usage_type": "call" }, { "api_name": "factory.Factory", "line_number": 13, "usage_type": "name" }, { "api_name": "sys.stderr", ...
12751609098
from .client import VSphereClient from pyVmomi import vim class VSphereResource(object): def __init__(self, config): self.client = VSphereClient().create_client(config) self.content = self.client.RetrieveContent() def get_instances(self, params): vim_type = [vim.VirtualMachine] ...
CloudChef/cloud-entries
cloudentries/vsphere/query/resources.py
resources.py
py
877
python
en
code
1
github-code
18
[ { "api_name": "client.VSphereClient", "line_number": 9, "usage_type": "call" }, { "api_name": "pyVmomi.vim.VirtualMachine", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pyVmomi.vim", "line_number": 14, "usage_type": "name" } ]
28261457695
import argparse,os,time,sys import numpy as np import tensorflow as tf from chiron_input import read_data_for_eval from utils.easy_assembler import simple_assembly from utils.easy_assembler import simple_assembly_qs #from utils.easy_assembler import section_decoding from cnn import getcnnfeature from cnn import getcnnl...
ramcn/tvm-chiron-0.3
chiron/chiron_eval.py
chiron_eval.py
py
5,098
python
en
code
0
github-code
18
[ { "api_name": "cnn.getcnnfeature", "line_number": 18, "usage_type": "call" }, { "api_name": "cnn.getcnnlogit", "line_number": 23, "usage_type": "call" }, { "api_name": "tensorflow.nn.top_k", "line_number": 27, "usage_type": "call" }, { "api_name": "tensorflow.nn",...