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
10018554512
''' This file impements cbc encryption using function from the ecb.py file. It breaks up a string into blocks and either encrypts or decrypts it. Author Cole Schumacher ''' from Crypto.Cipher import XOR import ecb import sys import binascii iv = binascii.unhexlify('000102030405060708090a0b0c0d0e0f') #encrypts an ind...
coleschumacher01/paddingoracle
cbc.py
cbc.py
py
3,630
python
en
code
0
github-code
71
[ { "api_name": "binascii.unhexlify", "line_number": 12, "usage_type": "call" }, { "api_name": "Crypto.Cipher.XOR.new", "line_number": 16, "usage_type": "call" }, { "api_name": "Crypto.Cipher.XOR", "line_number": 16, "usage_type": "name" }, { "api_name": "ecb.pad", ...
73062197348
#!/usr/bin/env python3 from configparser import SafeConfigParser import socket import ssl parser = SafeConfigParser() parser.read('config.ini') server_ip = parser.get('server', 'ip') server_port = int(parser.get('server', 'port')) certfile = parser.get('ssl','ssl_certfile') print(certfile) ''' ssl_sock = ssl.wrap_s...
lexfer/ObjectExporter
main.py
main.py
py
745
python
en
code
0
github-code
71
[ { "api_name": "configparser.SafeConfigParser", "line_number": 7, "usage_type": "call" }, { "api_name": "ssl.create_default_context", "line_number": 22, "usage_type": "call" }, { "api_name": "ssl.SSLContext", "line_number": 23, "usage_type": "call" }, { "api_name":...
35200604751
import logging import time from functools import partial from subprocess import call from mininet.cli import CLI from mininet.log import info, setLogLevel from mininet.net import Mininet from mininet.node import RemoteController, OVSKernelSwitch from mininet.link import TCLink, OVSLink logger = logging.getLogger(__na...
yurekten/sdn-topology
test_topology.py
test_topology.py
py
3,288
python
en
code
0
github-code
71
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 13, "usage_type": "attribute" }, { "api_name": "mininet.log.setLogLevel", "line_number": 20, "usage_type": "call" }, { "api_name": "subproces...
33238962599
from marvin import Bot class ResumeAnalyzer: def __init__(self): self.bot = Bot( name="ResumeAnalyzer", instructions=("Analyze a set of resumes for a specific job position, " "assign a score for each resume.") ) async def analyze_resumes(self, ...
redcpp/marvin-ai-examples
ResumeAnalyzer/resume_analyzer.py
resume_analyzer.py
py
945
python
en
code
1
github-code
71
[ { "api_name": "marvin.Bot", "line_number": 5, "usage_type": "call" } ]
35276180295
import glob import os import subprocess from pathlib import Path def find_files(): download_folder = Path(Path.home(), 'Downloads', 'Test') files = glob.glob('fmb_*.html', root_dir=download_folder) print(files) script_dir = Path(Path.home(), "work", "fmb") os.chdir(script_dir) for file in file...
sfgroups/python-tools
src/python_tools/web_read/gen_pdf_file.py
gen_pdf_file.py
py
890
python
en
code
0
github-code
71
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib.Path.home", "line_number": 8, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 9, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number...
21070236586
import bpy import math from dataclasses import dataclass from ..util import console_out, bad_mesh from .model_assets import model_util, armature, mesh, materials class Model: def __init__(self, nn, file_path, settings): self.file_path = file_path self.model = nn.model self.settings = sett...
Argx2121/Sega_NN_tools
modules/blender/model.py
model.py
py
7,786
python
en
code
22
github-code
71
[ { "api_name": "util.console_out", "line_number": 31, "usage_type": "call" }, { "api_name": "model_assets.armature.make_armature", "line_number": 31, "usage_type": "attribute" }, { "api_name": "model_assets.armature", "line_number": 31, "usage_type": "name" }, { "a...
28309217576
# cython: language_level=3 from flask import session from flask_jwt_extended import verify_jwt_in_request, get_jwt_identity from flask_jwt_extended.exceptions import (NoAuthorizationError, InvalidHeaderError) from flask_socketio import disconnect, emit def init_socketio_api(...
kylealexxander/BarFinder_Docker
api_collection/socketio_apis/__init__.py
__init__.py
py
989
python
en
code
0
github-code
71
[ { "api_name": "flask_socketio.SocketIO", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_jwt_extended.verify_jwt_in_request", "line_number": 19, "usage_type": "call" }, { "api_name": "flask_jwt_extended.exceptions.NoAuthorizationError", "line_number": 20, ...
31965976680
#!/usr/bin/env python3 import argparse import re def removeSentencePunc(line): line = re.sub("[,.?;:!\"]|\[|\]", "", line) #remove sentence punctuations line = re.sub("--", " ", line) #removes all instances of double hyphens line = re.sub("[']([\w']+[-]?[\w']*)[']", r'\1', line) #removes instances of 'wor...
a-hauger/Work-Training-Projects
ShakespeareRegEx/Main.py
Main.py
py
3,220
python
en
code
0
github-code
71
[ { "api_name": "re.sub", "line_number": 7, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 8, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 9, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 56, ...
11001243878
import pytest from flask import url_for from pytest_flask import fixtures from flask_login import login_user, current_user, logout_user from mdt_app.models import * from mdt_app.main.forms import * @pytest.mark.usefixtures('client_class', 'db_session', 'populate_db') class TestIndex: def setup(self): use...
stefpiatek/mdt-flask-app
tests/unit/test_main_views.py
test_main_views.py
py
4,421
python
en
code
0
github-code
71
[ { "api_name": "flask_login.login_user", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.url_for", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.mark.usefixtures", "line_number": 10, "usage_type": "call" }, { "api_name": "pytest.m...
3841539700
from django.shortcuts import render from django.http import JsonResponse, HttpResponse from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_GET, require_POST from django.apps import apps from .forms import UserForm...
droidroot1995/backend_exam_2020
studysystem/users/views.py
views.py
py
4,114
python
en
code
0
github-code
71
[ { "api_name": "django.apps.apps.get_model", "line_number": 17, "usage_type": "call" }, { "api_name": "django.apps.apps", "line_number": 17, "usage_type": "name" }, { "api_name": "forms.UserForm", "line_number": 19, "usage_type": "call" }, { "api_name": "django.htt...
6006422106
import cv2 import numpy as np import os import argparse import math from operator import xor clear = lambda: os.system('cls') class Scaler: angle = 0.0 def __init__(self, min, max, a, b): self.min = min self.max = max self.a = a self.b = b print("Min: " + str(self.min))...
SergioPereo/CV
TecbotCV.py
TecbotCV.py
py
9,029
python
en
code
0
github-code
71
[ { "api_name": "os.system", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.namedWindow", "line_number": 34, "usage_type": "call" }, { "api_name": "cv2.createTrackbar", "line_number": 39, "usage_type": "call" }, { "api_name": "cv2.createTrackbar", ...
7597896135
# Import des modules/ packages utiles au fonctionnement des routes # Relation templates et routes, manipulation requêtes et réponses HTTP, envoi de messages flash, redirection from flask import render_template, request, flash, redirect # Pour la gestion des comptes utilisateurs from flask_login import login_user, logou...
FannyLbr/BibPart_Projet_Python
BibPart/routes.py
routes.py
py
32,987
python
fr
code
0
github-code
71
[ { "api_name": "modeles.donnees.Oeuvre.query.filter", "line_number": 26, "usage_type": "call" }, { "api_name": "modeles.donnees.Oeuvre.query", "line_number": 26, "usage_type": "attribute" }, { "api_name": "modeles.donnees.Oeuvre", "line_number": 26, "usage_type": "name" ...
30502708139
from __future__ import annotations from typing import Dict, Generator, List, Tuple, Set # both above imports only for type hints from copy import deepcopy from rand import random from sys import stdout from time import time import scipy as sp from parsebin import * from utils import to_bytes from logger import Logge...
mousepad01/exploitation_workbench
binary_tests/exploit_controller/roputils_arm64.py
roputils_arm64.py
py
155,668
python
en
code
0
github-code
71
[ { "api_name": "stackview.Stack_view", "line_number": 38, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 39, "usage_type": "name" }, { "api_name": "effect.Effect_ARM64", "line_number": 39, "usage_type": "name" }, { "api_name": "typing.List", ...
9216575114
import math import random from Tkinter import * from PIL import Image, ImageTk class ShopHolo(object): @staticmethod def init(data): ShopHolo.img1 = Image.open("images/shopholo1.png") ShopHolo.img2 = Image.open("images/shopholo2.png") ShopHolo.img3 = Image.open("images/shopholo3.png") ...
zaberfire/TermProject
ShopHolo.py
ShopHolo.py
py
1,395
python
en
code
0
github-code
18
[ { "api_name": "PIL.Image.open", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 9, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 10, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": ...
14501472925
""" 线程同步解决方式: 事件(event) event事件是线程通信机制中最简单的实现,使用一个内部的标记flag ,通过flag的True或False的变化来进行操作 """ """ 问题: 工人和老板问题 """ import threading import logging import time logging.basicConfig(level=logging.INFO,format="%(message)s") root = logging.getLogger() root.setLevel(logging.INFO) n = 0 ...
UwonderMen/python
thread_test/线程同步.py
线程同步.py
py
956
python
zh
code
0
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 23, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.INFO"...
23416636053
from discord.ext import commands import json class Cog(commands.Cog, name="config"): def __init__(self, bot): self.bot = bot self.data = {} self.load_json() self.sections = [] def get_config(self, section): if section in self.data: data = self.data[section]...
otisdog8/bot
bot/cogs/config.py
config.py
py
1,540
python
en
code
1
github-code
18
[ { "api_name": "discord.ext.commands.Cog", "line_number": 5, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 5, "usage_type": "name" }, { "api_name": "json.load", "line_number": 27, "usage_type": "call" }, { "api_name": "json.dump"...
417186996
from iot.DB import DBSingleton db= DBSingleton.get_instance() db.connectDB() from iot.models import User, Room from iot.serializers import RoomSerializer from rest_framework.response import Response from rest_framework import status from rest_framework.decorators import APIView class RoomViewSet(APIView): def ...
HandsOfGoddest/SmartHome-HCMUT-HK212
BackEnd/src/iot/controller/roomController.py
roomController.py
py
2,659
python
en
code
0
github-code
18
[ { "api_name": "iot.DB.DBSingleton.get_instance", "line_number": 2, "usage_type": "call" }, { "api_name": "iot.DB.DBSingleton", "line_number": 2, "usage_type": "name" }, { "api_name": "rest_framework.decorators.APIView", "line_number": 13, "usage_type": "name" }, { ...
25083924856
from django.urls import path from .views import * urlpatterns = [ path('',inicio_view, name = 'inicio_view'), path('about/',about_view, name ='about_view'), path('contacto/',contacto_view, name='contacto_view'), path('productos/',productos_view, name='productos_view'), path('marcas/',marcas_view, na...
SantiRCruz/VideosFutbol
home/urls.py
urls.py
py
1,598
python
pt
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 4, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", ...
23695142509
from flix_web_app.domainmodel.actor import Actor from flix_web_app.domainmodel.director import Director from flix_web_app.domainmodel.genre import Genre from flix_web_app.domainmodel.movie import Movie from flix_web_app.domainmodel.user import User import pytest from flix_web_app.home import services as home_serv fro...
hazel00/CS235flix
flix_web_app/tests/test_services.py
test_services.py
py
3,621
python
en
code
0
github-code
18
[ { "api_name": "flix_web_app.domainmodel.movie.Movie", "line_number": 16, "usage_type": "call" }, { "api_name": "flix_web_app.domainmodel.movie.Movie", "line_number": 19, "usage_type": "call" }, { "api_name": "flix_web_app.domainmodel.movie.Movie", "line_number": 22, "usag...
25799704271
import numpy as np import torch from torch import nn from torch.utils.data import DataLoader from torch.functional import F MTU = 1514 def session_2d_histogram(ts, sizes, path, plot=False): # ts_norm = map(int, ((np.array(ts) - ts[0]) / (ts[-1] - ts[0])) * MTU) if len(ts) == 1: ts_norm = np.array([0....
mory91/digger
morteza/flowpic_model.py
flowpic_model.py
py
2,396
python
en
code
0
github-code
18
[ { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.histogram2d", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_nu...
38225529904
import numpy as np import torch def cg_solve(f_Ax, b, x_0=None, cg_iters=10, residual_tol=1e-10, callback=None, verbose=False): """ Goal: Solve Ax=b equivalent to minimizing f(x) = 1/2 x^T A x - x^T b Assumption: A is PSD, no damping term is used here (must be damped externally in f_Ax) Verbose mode w...
IanWangg/MATH273A-Project
mjrl/utils/cg_solve.py
cg_solve.py
py
1,828
python
en
code
0
github-code
18
[ { "api_name": "torch.Tensor", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.float16", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", ...
27590332354
import pickle from fastfeature.plotting.plotter import cool_plotting from fastsklearnfeature.candidates.CandidateFeature import CandidateFeature from fastsklearnfeature.candidates.RawFeature import RawFeature from typing import List, Dict, Any import numpy as np #file = "/tmp/chart.p" #file = '/home/felix/phd/fastfeat...
BigDaMa/DFS
new_project/fastsklearnfeature/plotting/average_accuracy_per_final_transformation_type.py
average_accuracy_per_final_transformation_type.py
py
1,660
python
en
code
12
github-code
18
[ { "api_name": "pickle.load", "line_number": 26, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 32, "usage_type": "name" }, { "api_name": "fastsklearnfeature.candidates.CandidateFeature.CandidateFeature", "line_number": 32, "usage_type": "name" }, ...
10447976485
# enhanced Stokes drag on spherical particle in cylindrical tube # r ... particle radius # R ... cylinder radius # drag ... reduced stokes drag # dimensionless parameters: # lam = r/R in [0,1] # mu = r/(R-r) in [0,inf] # rho = (R-r)/r = 1/lam - 1 in [0,inf] # empirical law: # drag = exp(2*r/(R-r)) = exp(2*lam/(1-l...
mitschabaude/nanopores
scripts/stokes_law/stokes_drag_comparison.py
stokes_drag_comparison.py
py
1,478
python
en
code
7
github-code
18
[ { "api_name": "numpy.genfromtxt", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 28, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "li...
43149338180
from pkg.decorators import setup_file_required from utils import CapturingOutput from test_commands import HERE import unittest class DecoratorTest(unittest.TestCase): def test_setup_file_required(self): func = setup_file_required(lambda: print('Function Done!')) with CapturingOutput() as output:...
hashem-nowruzi/pkg-cli
tests/test_decorators.py
test_decorators.py
py
655
python
en
code
1
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pkg.decorators.setup_file_required", "line_number": 9, "usage_type": "call" }, { "api_name": "utils.CapturingOutput", "line_number": 11, "usage_type": "call" }, { "api...
22087146422
# 두 리스트의 길이 차이가 1이므로 두 리스트 정렬하여 순서를 똑같이 만든 후 요소가 달라지는 부분에서 완주 못한 1명을 찾아내는 방법을 사용하였다. def solution(participant, completion): participant.sort() # participant 참가자 이름 알파벳 순서대로 정렬 completion.sort() # completion 참가자 이름 알파벳 순서대로 정렬 for i in range(len(completion)): # i는 인덱스 if participant[...
kanujoa/coding_test_practice
python_programmers_school/level 1/완주하지 못한 선수.py
완주하지 못한 선수.py
py
3,563
python
ko
code
0
github-code
18
[ { "api_name": "collections.Counter", "line_number": 29, "usage_type": "call" } ]
32382545836
import os import sys from pathlib import Path sys.path.insert(0, '../') from script_generator import * DATASET = ["sift10M"] SEARCH_L = [""] TYPE = ["distributed"] NUM_SHARD = ["1", "2", "4", "8", "16"] gen = ScriptGenerator(f"num_shard.sh") gen.options = {"DATASET": DATASET, "SEARCH_L": SEARCH_L, "TYPE": TYPE, "NU...
hjchoi-camelab/guitar
workload/script-generator/distributed/distributed.py
distributed.py
py
856
python
en
code
0
github-code
18
[ { "api_name": "sys.path.insert", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_num...
28807543830
# -*- coding: utf-8 -*- # @Author : Junru_Lu # @File : util.py # @Software: PyCharm # @Environment : Python 3.6+ # @Reference : https://github.com/likejazz/Siamese-LSTM # 基础包 from keras import backend as K from keras.layers import Layer from keras.preprocessing.sequence import pad_sequences import numpy as np impo...
14H034160212/HHH-An-Online-Question-Answering-System-for-Medical-Questions
BiLSTM+Attention/util.py
util.py
py
4,966
python
en
code
77
github-code
18
[ { "api_name": "re.sub", "line_number": 31, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 32, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 33, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 34, "usage_type"...
41731603272
from django.conf import settings from django.conf.urls.static import static from django.urls import path from . import views app_name = "recognition" urlpatterns = [ path('', views.index, name = 'index'), path('history/', views.history, name = 'history'), path('history/<int:id>/',views.detail, name = 'de...
Cunberss/study_project
Webservice/apps/recognition/urls.py
urls.py
py
649
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path",...
38487005803
import os import warnings from PIL import Image import numpy as np from sklearn.externals import joblib from test_model.config import * def tes1t1_data(file_path): img = Image.open(file_path) data = img.getdata() data = np.matrix(data) / 255 data1 = data.tolist() data2 = [] for i in data1: ...
MrDHY/anti-spider
SVM识别验证码/test_model/load_model_pattern.py
load_model_pattern.py
py
1,000
python
en
code
1
github-code
18
[ { "api_name": "PIL.Image.open", "line_number": 10, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.matrix", "line_number": 12, "usage_type": "call" }, { "api_name": "os.listdir", "line_number":...
5610888424
import pandas as pd import numpy as np import numpy.random import pandas as pd from astropy.convolution import convolve import matplotlib.pyplot as plt from astropy.convolution.kernels import Gaussian2DKernel import scipy.ndimage as spnd from matplotlib.colors import LogNorm ldv_x = [] ldv_y = [] ldv_z = [] ldv = pd...
gaoag/vehicle-electrification-mexico
plot_multiple.py
plot_multiple.py
py
2,508
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.histogram2d", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib...
29873964912
from collections import deque def melt(i, j): q = deque([(i, j)]) while q: y, x = q.popleft() for d in range(4): nr, nc = y + dr[d], x + dc[d] if nr < 0 or nr >= N or nc < 0 or nc >= M: continue if visited[nr][nc]: continue ...
essk13/Algorithm
01_problem/python/2022/BAEKJOON/BAEKJOON_2573/2573_BAEKJOON.py
2573_BAEKJOON.py
py
1,149
python
en
code
0
github-code
18
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" } ]
73635290600
import numpy import cv2 def main(): camaraWeb() #cargarVideo() #guardarVideo() return def camaraWeb(): cap = cv2.VideoCapture(0) while(True): # Captura frame por frame ret,frame = cap.read() gray = cv2.cvtColor(frame,...
ariel2k/PiScripts
Gabriel/05-VideoOnCamera/openCV.py
openCV.py
py
1,740
python
en
code
1
github-code
18
[ { "api_name": "cv2.VideoCapture", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 24, "usage_type": "attribute" }, { "api_name": "cv2.imshow", ...
73969852521
#!/usr/bin/python3 """ Script that sends a request to the URL with the letter as a parameter and displays the body of the response. """ import requests from sys import argv if __name__ == "__main__": url = "http://0.0.0.0:5000/search_user" data = {"q": ""} if len(argv) > 1: data["q"] = argv[1] ...
tommy457/alx-higher_level_programming
0x11-python-network_1/8-json_api.py
8-json_api.py
py
612
python
en
code
0
github-code
18
[ { "api_name": "sys.argv", "line_number": 15, "usage_type": "argument" }, { "api_name": "sys.argv", "line_number": 16, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 18, "usage_type": "call" } ]
8262927069
import argparse import logging from datetime import datetime from time import sleep from tqdm import tqdm from app import db from app.models import WatchlistItem, Title from lib.providers import Providers LOGGER = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) # Create argument parser parser =...
raphaelberly/journal
update_watchlist_providers.py
update_watchlist_providers.py
py
1,154
python
en
code
10
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 14, "usage_type": "attribute" }, { "api_name": "argparse.Argu...
32655080591
# -*- coding: utf-8 -*- """ Created on Sun Jan 19 16:52:22 2020 @author: Kokkinos """ """Example program to show how to read a multi-channel time series from LSL.""" import numpy as np import scipy.io as sio from pylsl import StreamInlet, resolve_stream from tkinter import * from graphics import Graphics class data...
BSPG-UoP/Real-time-BCI-system
data_recording.py
data_recording.py
py
4,089
python
en
code
0
github-code
18
[ { "api_name": "graphics.Graphics", "line_number": 16, "usage_type": "name" }, { "api_name": "graphics.Graphics.__init__", "line_number": 20, "usage_type": "call" }, { "api_name": "graphics.Graphics", "line_number": 20, "usage_type": "name" }, { "api_name": "numpy....
2204097675
import cv2 import numpy as np img = cv2.imread("../school_blurry.jpg", cv2.IMREAD_GRAYSCALE) cv2.imshow("original",img) kernel25x25 = np.ones((25,25), np.uint8) dilate = cv2.dilate(img,kernel25x25,iterations=1) erode = cv2.erode(img,kernel25x25,iterations=1) prom = cv2.addWeighted(dilate,0.5,erode,0.5,0) cv2.imshow("...
franyack/PDI2
TP1 - Morfología de grises/ej7.py
ej7.py
py
727
python
en
code
0
github-code
18
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 4, "usage_type": "attribute" }, { "api_name": "cv2.imshow", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.ones", "line_n...
947730388
import os from typing import Optional from pydantic import BaseModel from fastapi import FastAPI, File, UploadFile, Body from fastapi.responses import FileResponse from fastapi.middleware.cors import CORSMiddleware # Alec's basemodel from basemodel_v1 import RHRAD_online, resultsProcesser TEMP_PATH = os.environ.get("...
rhausman/coronal-backend
api.py
api.py
py
4,556
python
en
code
0
github-code
18
[ { "api_name": "os.environ.get", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "fastapi.FastAPI", "line_number": 27, "usage_type": "call" }, { "api_name": "fastapi.middleware.cor...
26952240149
"""Define the command line parser for each utility (pipeline, iotools, etc.).""" import abc from argparse import ArgumentParser from os import getcwd from os.path import expanduser, join PIPELINE_CATEGORIES = { "CLINICA_COMPULSORY": "Clinica mandatory arguments", "OPTIONAL": "Pipeline options", "CLINICA_O...
aramis-lab/clinica
clinica/engine/cmdparser.py
cmdparser.py
py
5,730
python
en
code
196
github-code
18
[ { "api_name": "abc.ABCMeta", "line_number": 25, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 38, "usage_type": "call" }, { "api_name": "abc.abstractmethod", "line_number": 80, "usage_type": "attribute" }, { "api_name": "abc....
69849920679
import random from datetime import datetime def sleeps(i:int): for n in range(i): horario_atual = datetime.now() segundos = horario_atual.second horario_atual = datetime.now() segundos2 = horario_atual.second while segundos2==segundos: horar...
codebuil/Python.utils
flash2d.py
flash2d.py
py
1,264
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime....
14411123994
from flask import g from datetime import datetime, timedelta from flask_apscheduler import APScheduler from acdumo import create_app from acdumo.email import send_notification_email from acdumo.models import get_db, User from acdumo.acdumo import ( TICKERS, BONDS, download_historical_price_data, compute_signals...
lingchingteng/acdumo
acdumo/apscheduler.py
apscheduler.py
py
2,334
python
en
code
1
github-code
18
[ { "api_name": "flask_apscheduler.APScheduler", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime.today", "line_number": 38, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 38, "usage_type": "name" }, { "api_name"...
41263171956
import os import requests import datetime from dataflows import Flow SCHEMAS = { 'groups': {'fields': [{'name': n, 'type': t} for n, t in { 'users': 'array', 'display_name': 'string', 'description': 'string', 'image_display_url': 'string', 'type': 'boolean', 'create...
OriHoch/dataflows-shell
dataflows_shell/processors/ckan.py
ckan.py
py
3,743
python
en
code
1
github-code
18
[ { "api_name": "requests.session", "line_number": 56, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 68, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 68, "usage_type": "attribute" }, { "api_name": "os...
21119101574
""" A binary heap can be a minheap or a maxheap. Following are some standard operations on minheap. 1. get_min(): O(1). Get the smallest element 2. extract_min(): O(log(n)). Pop the min element out. 3. update_value(): O(log(n)). Update the value of a node 4. insert/delete(): O(log(n)) 5. min_heapify...
rrwt/daily-coding-challenge
gfg/bin_heap/min_heap.py
min_heap.py
py
3,554
python
en
code
1
github-code
18
[ { "api_name": "typing.Optional", "line_number": 74, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 82, "usage_type": "name" } ]
30076478868
import json import os import argparse import requests import re import time from tools import try_parse_float # parse args from command line -- scan will just query, not download parser = argparse.ArgumentParser() parser.add_argument('-d', '--download') parser.add_argument('-s', '--scan') parser.add_argument('-l', ...
swixi/bird-id
downloader.py
downloader.py
py
3,010
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 30, "usage_type": "call" }, { "api_name": "time.time", "line_number": 34, "usage_type": "call" }, { "api_name": "requests.get", "line_...
40743458669
# -*- coding: utf-8 -*- """ Created on Sat Aug 25 21:37:03 2018 @author: Okaleb """ import cv2 as cv import numpy as np import matplotlib.pyplot as plt #import random as rnd from skimage.filters import gaussian #from skimage.measure import label from skimage.filters import threshold_otsu as otsu from sk...
OkalebH/videoCarril
segmentacion_autos.py
segmentacion_autos.py
py
8,198
python
es
code
1
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": ...
25662390621
import numpy as np import prizmatoid as pzt import data as da import read_vna_csv as cs from scipy import interpolate from scipy import signal from scipy import ndimage import healpy as hp from pygsm2016 import GlobalSkyModel2016 #ANALYSIS FUNCTIONS def sky_model(GSM, A, minutes, poly, low, high): bin1 = round(1...
PRIZM-Experiment/prizm-analysis
PrizmCalibration.py
PrizmCalibration.py
py
6,832
python
en
code
0
github-code
18
[ { "api_name": "numpy.where", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.nansum", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.nansum", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.nansum", "line_number...
11095357268
import sqlite3 import os # # # 本模块用来对路径为 "path_db" 数据库进行简单操作,一般步骤如下 # 1. 实例化DbManger,查看该数据库包含的所有表。可对数据库进行: # 查看已有表,表的列; 新建表,重命名表,备份表,删除列。 # 2. 实例化TableManger,可对表进行: # 查看列,查看行和id,显示并返回行,行的查找; 插入新行,删除行,修改行。 # 注意:所有表内部数据以隐藏的列 "id" 进行传递,id列会自动生成。 # # __Author__ = "J" class DbManager: def __init__(self...
360849048/MyProj
app/sqljob.py
sqljob.py
py
15,660
python
en
code
0
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 19, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 79, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 86, "usage_type": "call" }, { "api_name": "os.path", "line_...
34490685484
# -*- coding: utf-8 -*- """ Created on Mon Mar 21 15:35:12 2022 @author: antoine """ import numpy as np import pandas as pd from corrector import * from data_structurs import SeqManager, Appertures, TimeStruct from astropy.time import Time class Occult(Corrector): def __init__(self, seq = None, flatSeq = None...
antoinech13/Steroid
Steroid/occultation.py
occultation.py
py
13,934
python
en
code
0
github-code
18
[ { "api_name": "data_structurs.SeqManager", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.median", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 80, "usage_type": "call" }, { "api_name": "data_structu...
12751332028
import json from oauth2client.service_account import ServiceAccountCredentials from googleapiclient.discovery import build import httplib2 class Conn_GCP: def __init__(self, private_key_id, private_key, client_email, client_id): self.KEY_JSON = { "type": "service_account", "private...
CloudChef/cloud-entries
cloudentries/gcp/query/connection.py
connection.py
py
1,187
python
en
code
1
github-code
18
[ { "api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_dict", "line_number": 23, "usage_type": "call" }, { "api_name": "oauth2client.service_account.ServiceAccountCredentials", "line_number": 23, "usage_type": "name" }, { "api_name": "httplib2.Htt...
35453589638
import os import datetime from PyQt5 import QtWidgets from PyQt5.QtWidgets import QMessageBox from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric import padding from cryptography.hazmat.backends import default_...
Nachofc333/PracticaCSI
CA/CAMaster.py
CAMaster.py
py
4,243
python
en
code
0
github-code
18
[ { "api_name": "cryptography.x509.Name", "line_number": 28, "usage_type": "call" }, { "api_name": "cryptography.x509", "line_number": 28, "usage_type": "name" }, { "api_name": "cryptography.x509.NameAttribute", "line_number": 29, "usage_type": "call" }, { "api_name...
4497793253
import numpy as np import matplotlib.pyplot as plt import argparse import sys # Establecer subplots figure, axis = plt.subplots(1,2) y = np.genfromtxt('datosEstadisticaT.dat') a=0 axis[a].plot(y[:,0],y[:,2],'b') axis[a].set_ylabel('P') axis[a].set_xlabel('T') axis[a].grid(True, which='both') a=1 axis[a].plot(y[:,0...
DanoLV/MD
codigo/ploteT.py
ploteT.py
py
567
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.genfromtxt", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib...
34308333068
""" """ # Definition for a binary tree node. from typing import List class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None def level_order_bottom(root: TreeNode) -> List[List[int]]: """ 层序遍历 :param root: :return: """ res = [] ...
yeefea/CS-CheatSheet
python_workspace/leetcode/107_level_order_bottom.py
107_level_order_bottom.py
py
834
python
en
code
2
github-code
18
[ { "api_name": "typing.List", "line_number": 15, "usage_type": "name" } ]
38441259665
import pandas as pd from datetime import datetime,date import xlsxwriter import datetime as dt import numpy as np import PySimpleGUI as sg import traceback import os def my_function(filePath,filePath_INT,filePath2): filePath = filePath.strip("‪u202a") df=df2=df3=df4=df5=pd.read_excel (r'...
Felix-Perez200/ALGOSMICRC
master.py
master.py
py
9,450
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_excel", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.to_date...
23057911105
# -*- mode: python -*- block_cipher = None import os import sys import datetime import ntpath import PyQt5 import serial # Add working dir to path so we can use uPyLoader modules here sys.path += [os.getcwd()] from src.utility.build_info import BuildInfo BuildInfo().save("build_info.json") a = Analysis(['main.py']...
BetaRavener/uPyLoader
main.spec
main.spec
spec
1,648
python
en
code
345
github-code
18
[ { "api_name": "sys.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 13, "usage_type": "call" }, { "api_name": "src.utility.build_info.BuildInfo", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join...
18626585334
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #name: Yusen Wu #Email: wuyusen@bu.edu #Assigment: 12 #File Description: This file contains a set of functions to process a series of #stock prices returns and implemented a trading strategy to decide buy and sell #according to cross bewteen stock price and related statis...
RayNG123/FinancialTrading_Toolbox
Porfolio Management and Trading Utils/Backtesting/a12task1.py
a12task1.py
py
3,372
python
en
code
1
github-code
18
[ { "api_name": "pandas.options", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 50, "usage_type": "call" }, { "api_name": "pandas.DataFram...
25572646839
import json import tabfile # using files from http://compling.hss.ntu.edu.sg/omw/summx.html def callback(output, parts): if len(parts) != 3: return synset, word = parts[0].replace('-', ''), parts[2] if word in output: output[word].append(synset) else: output[word] = [synset] def conv(lang, path): output = {} t...
macairececile/AnnotVocab
wordnets/generate-synsets.py
generate-synsets.py
py
471
python
en
code
1
github-code
18
[ { "api_name": "tabfile.parse", "line_number": 14, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 17, "usage_type": "call" } ]
37862993049
from django.urls import path from . import views from .views import DisplayUserListings, ListingList, listingdetail, DisplayListingsRemove urlpatterns = [ path('', views.home, name='home'), path('profile/', views.profile, name='profile'), #path('sell/', views.sell, name='sell'), path('login/', views....
chrishassert/textbook-exchange
main/urls.py
urls.py
py
1,047
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "views.home", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "views.profile", "l...
19123191611
#!/usr/bin/env python # -*- coding: utf-8 -*- import re from django import template register = template.Library() # This regex is the one for a URI scheme where the name is forced to start # with "wom-" (see also https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Definition) WOM_PROTOCOL_RE = re.compile("^wo...
tibonihoo/wateronmars
wom_pebbles/templatetags/wom_protocol.py
wom_protocol.py
py
556
python
en
code
26
github-code
18
[ { "api_name": "django.template.Library", "line_number": 8, "usage_type": "call" }, { "api_name": "django.template", "line_number": 8, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 12, "usage_type": "call" } ]
72143137319
# """ # Idea by @Pokurt # Repo: https://github.com/pokurt/Nana-Remix/blob/master/nana/utils/aiohttp_helper.py # """ import asyncio from typing import Dict, Optional import ujson from aiohttp import ClientSession, ClientTimeout # """ # Success: status == 200 # Failure: ValueError if status != 200 or timeout # """ c...
code-rgb/USERGE-X
userge/utils/aiohttp_helper.py
aiohttp_helper.py
py
4,025
python
en
code
130
github-code
18
[ { "api_name": "aiohttp.ClientSession", "line_number": 21, "usage_type": "call" }, { "api_name": "ujson.dumps", "line_number": 21, "usage_type": "attribute" }, { "api_name": "aiohttp.ClientSession", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.O...
20302885560
from django.urls import path from evap.evaluation import views app_name = "evaluation" urlpatterns = [ path("", views.index, name="index"), path("faq", views.faq, name="faq"), path("set_lang", views.set_lang, name="set_lang"), path("legal_notice", views.legal_notice, name="legal_notice"), path("c...
e-valuation/EvaP
evap/evaluation/urls.py
urls.py
py
645
python
en
code
93
github-code
18
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "evap.evaluation.views.index", "line_number": 8, "usage_type": "attribute" }, { "api_name": "evap.evaluation.views", "line_number": 8, "usage_type": "name" }, { "api_name": "...
21415092960
import os import discord import random from discord.ext import commands from datetime import datetime, timedelta from dotenv import load_dotenv from public_transport import Public_transportView load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') TEST_CHANNEL_ID = int(os.getenv('TEST_CHANNEL_ID')) bot_description = "Kein...
2wenty1ne/Discord_Cloud_Manager
bot.py
bot.py
py
3,337
python
en
code
0
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 12, "usage_type": "call" }, { "api_name": "discord.Intents.all", "lin...
41969504184
import cv2 import cv2.aruco as aruco import numpy as np import os import time import math import turtle import tkinter as tk from tkinter import messagebox root = tk.Tk() def on_closing(): if messagebox.askokcancel("Quit", "Do you want to quit?"): root.destroy() t = turtle.Turtle(...
Percussor-hash/Aruco-marker-detection-and-mapping
finalgix.py
finalgix.py
py
3,190
python
en
code
0
github-code
18
[ { "api_name": "tkinter.Tk", "line_number": 11, "usage_type": "call" }, { "api_name": "tkinter.messagebox.askokcancel", "line_number": 14, "usage_type": "call" }, { "api_name": "tkinter.messagebox", "line_number": 14, "usage_type": "name" }, { "api_name": "turtle.T...
11838208764
import datetime import json import time from collections import Counter, OrderedDict from operator import itemgetter from .database.collection import db class Items(): def __init__(self): # item_lst = db['all_items'] collection = db['item_ids'] self.item_lst = collection.find_one({}, {'_i...
27bslash/dota2-pro-item-tracker
helper_funcs/items.py
items.py
py
5,737
python
en
code
2
github-code
18
[ { "api_name": "database.collection.db", "line_number": 13, "usage_type": "name" }, { "api_name": "collections.Counter", "line_number": 24, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 26, "usage_type": "call" }, { "api_name": "dateti...
4191294824
import psycopg2 from psycopg2 import extras class PostgresqlDataStore(): """Implements the datastore.""" def __init__( self, host='127.0.0.1', port=5432, db_name='dfdewey', autocommit=False): """Create a PostgreSQL client.""" super().__init__() try: self.db = psycopg2.connect( d...
google/dfdewey
dfdewey/datastore/postgresql.py
postgresql.py
py
8,708
python
en
code
17
github-code
18
[ { "api_name": "psycopg2.connect", "line_number": 13, "usage_type": "call" }, { "api_name": "psycopg2.OperationalError", "line_number": 16, "usage_type": "attribute" }, { "api_name": "psycopg2.extensions", "line_number": 20, "usage_type": "attribute" }, { "api_name...
25096680833
from snowflake.connector import DictCursor import json def object_row_access_policy_reference(self,full_object_name:str)->dict: # full object name should include any prefixes in the db name cur = self._conn.cursor(DictCursor) schema_name = full_object_name.split('.')[1] database_name = full_object_name...
metaopslabs/snowflake_deployer
src/snowflake/functions/object_row_access_policy_reference.py
object_row_access_policy_reference.py
py
1,669
python
en
code
0
github-code
18
[ { "api_name": "snowflake.connector.DictCursor", "line_number": 6, "usage_type": "argument" }, { "api_name": "json.loads", "line_number": 33, "usage_type": "call" } ]
34021734918
""" Tools for automatic serialization and deserialization. This module introduces two concepts: Keys and state. A class may be defined as "keyable," meaning that its instances will have an attribute called "key," which may be used to recreate that instance at another run time, e.g. after pickling and thawing. Keys al...
kreneskyp/Pydra
pydra/util/key.py
key.py
py
3,623
python
en
code
9
github-code
18
[ { "api_name": "functools.wraps", "line_number": 85, "usage_type": "call" } ]
70811349481
import json with open("twitterdev.json") as f: load1= json.loads(f.read()) print (load1) print () def get_tweets(): with open ("tweetj.json") as f2: load2= json.loads(f2.read()) return (load2) print (get_tweets()) print() def add_tweets(text, username): tweets = get_twe...
MikaMahaputra/Binus
Homework/JSON Homework/Jsontest.py
Jsontest.py
py
626
python
en
code
0
github-code
18
[ { "api_name": "json.loads", "line_number": 4, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 25, "usage_type": "call" } ]
6306923238
from django.urls import path,include from rest_framework.routers import DefaultRouter from .views import RecordsView,RecordView,ChangeRequestsView,AcordaoView,ChangeRequestView,Tags,Fields app_name = 'records' router = DefaultRouter() urlpatterns = [ path('tags/', Tags.as_view({'get': 'list'}), name='tag-list'),...
gweebg/acordb
server/records/urls.py
urls.py
py
956
python
en
code
2
github-code
18
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "views.Tags.as_view", "line_number": 11, "usage_type": "call" }, { "api_name"...
554898853
import master import os import openpyxl as xl from pathlib import Path step = "nine" status = "" if Path(master.masterpath+"costcenter.xlsx").exists() and Path(master.temppath+"exception_department.xlsx").exists() and Path(master.temppath+"delete.xlsx").exists(): print("Step "+step) wb1 = xl.load_workbook(mas...
ddhairya/dataautomation
stepnine.py
stepnine.py
py
8,605
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "master.masterpath", "line_number": 9, "usage_type": "attribute" }, { "api_name": "master.temppath", "line_number": 9, "usage_type": "attribute" }, { "api_name": "openpyxl.load_w...
24066133696
from ucondb.webapi import UConDBWebClient import sys, getopt, json Usage = """ python load_beam_data.py <server URL> <start run> <end run> <output directory> """ folder = "public.sp_protodune" object = "configuration" server_url, start_run, end_run, out_dir = sys.argv[1:] start_run = int(start_run) end_run = int(en...
ivmfnal/ucondb
DUNE/load_beam_data.py
load_beam_data.py
py
1,197
python
en
code
0
github-code
18
[ { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "ucondb.webapi.UConDBWebClient", "line_number": 16, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 30, "usage_type": "call" } ]
5681100039
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from agents.helpers import SinusoidalPosEmb class EasyBlock(nn.Module): def __init__(self, input_dim, t_embed_dim, s_embed_dim): super(EasyBlock, self).__init__() self.block_1 = nn.Linear(input_dim, input_dim) ...
twitter/diffusion-rl
agents/model.py
model.py
py
4,894
python
en
code
67
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
73501212521
import pygame from pygame.sprite import Sprite from Player import Player import random class Ball(Sprite): def __init__(self, screen): super(Ball,self). __init__() self.image = pygame.image.load("soccer_ball2.png") self.rect = self.image.get_rect() self.x = random.randrange(1, 900) self.y = random.randrang...
caseyezimmerman/SoccerGame
Ball.py
Ball.py
py
733
python
en
code
0
github-code
18
[ { "api_name": "pygame.sprite.Sprite", "line_number": 6, "usage_type": "name" }, { "api_name": "pygame.image.load", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 9, "usage_type": "attribute" }, { "api_name": "random.randrang...
71391816041
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import NoSuchElementException import time import re import datetime import winsound import logging import pathlib parent_directory = pathlib.Path(__file__).parent.absolute() PATH = 'C:\Program Files\chromedri...
Brook-A-CS/DMV-Appointment-Automation
main.py
main.py
py
4,020
python
en
code
2
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 13, "usage_type": "name" }, { "api_name": "re.finditer...
20399876199
#!/usr/bin/env python from glob import glob import json import logging def main(**kwargs): for fname in glob('coin/*.json'): try: coin = json.load(open(fname)) except ValueError as ex: logging.error('Error in %s' % fname, exc_info=ex) else: missing = [] ...
white602/coindatabase
coindatabase-master/find_missing_data.py
find_missing_data.py
py
652
python
en
code
2
github-code
18
[ { "api_name": "glob.glob", "line_number": 8, "usage_type": "call" }, { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 12, "usage_type": "call" } ]
71814300840
from datetime import datetime import os import re import numpy as np from lxml import html def get_datetime(s:str): date, time = s.split(', ') day, month, year = date.split('.') hour, minute = re.split(r'\W', time.split(' ')[0]) return datetime(int(year), int(month), int(day), int(hour), int(...
cuteredpwnda/nothilfe_tracker
src/helpers.py
helpers.py
py
2,475
python
en
code
2
github-code
18
[ { "api_name": "re.split", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "line_number": 15, "usage_type": "call" }, { "api_name": "lxml.html", "line...
16067152457
import json from django.shortcuts import render from django.http import HttpResponse from django.templatetags.static import static from django.views.decorators.http import require_GET, require_POST def home(request): context = { 'name': 'bbamsu211', 'profile': static('images/profile.jpeg'), ...
choibumsu/piro15_js
app/views.py
views.py
py
2,333
python
en
code
0
github-code
18
[ { "api_name": "django.templatetags.static.static", "line_number": 12, "usage_type": "call" }, { "api_name": "django.templatetags.static.static", "line_number": 14, "usage_type": "call" }, { "api_name": "django.templatetags.static.static", "line_number": 15, "usage_type": ...
71898822119
#Downloads RDS (data <=2019) Facility data (with origin data) which does not track waste type from this website: https://www2.calrecycle.ca.gov/LGCentral/DisposalReporting/Origin/FacilitySummary import pandas as pd from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.web...
Greatest125/CA_solid_waste_data
DRS/facility_origin.py
facility_origin.py
py
3,048
python
en
code
0
github-code
18
[ { "api_name": "chromedriver_autoinstaller.install", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 14, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 14, "usage_type": "name" }, {...
21764865758
import logging from pprint import pprint from sys import stdout as STDOUT # Example 1 class LazyDB(object): def __init__(self): self.exists = 5 def __getattr__(self, name): value = 'Value for %s' % name setattr(self, name, value) return value # Example 2 data = LazyDB() prin...
gilbutITbook/006764
item_32.py
item_32.py
py
3,069
python
en
code
89
github-code
18
[ { "api_name": "logging.exception", "line_number": 70, "usage_type": "call" }, { "api_name": "logging.exception", "line_number": 125, "usage_type": "call" } ]
1297102301
from rest_framework.routers import DefaultRouter from .viewsset import admin_images_viewsets, Profile_viewset, Messages, users, admin_info_viewsets router = DefaultRouter() router.register('images', admin_images_viewsets, basename='images') router.register('extra', admin_info_viewsets, basename='extra') router.regist...
mohamedmurra/realstate
api/routers.py
routers.py
py
507
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 5, "usage_type": "call" }, { "api_name": "viewsset.admin_images_viewsets", "line_number": 6, "usage_type": "argument" }, { "api_name": "viewsset.admin_info_viewsets", "line_number": 7, "usage_type": "arg...
5723550931
##graphics dependencies import tkinter as tk from tkinter import ttk from ttkbootstrap.constants import * import ttkbootstrap as tb ##functional dependencies import os from datetime import datetime import csv class DraggableTreeview(tb.Treeview): def __init__(self, *args, **kwargs): super().__init__(*args,...
madbailey/ProductionSearch2
draggable_treeview.py
draggable_treeview.py
py
1,232
python
en
code
0
github-code
18
[ { "api_name": "ttkbootstrap.Treeview", "line_number": 11, "usage_type": "attribute" } ]
74434729639
import logging logger = logging.getLogger("download_tool") APPEND_FAIL_MSG = """ Unable to append component to download error message while handling a download error. """ def download_error_handler(fpath, *args): err_str = "" for arg in args: err_str = append_err_comp(err_str, arg) with open(fp...
tharencandi/undergrad_capstone
src/download_tool/download/download_error_handler.py
download_error_handler.py
py
528
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 3, "usage_type": "call" } ]
39808530170
#!/usr/bin/env python """Tool to test the performances of MariaDB, Galera and CockroachDB with OpenStack on Grid'5000 Usage: juice [-h | --help] [-v | --version] <command> [<args>...] Options: -h --help Show this help -v --version Show version number Commands: deploy Claim resources f...
Marie-Donnie/juice
juice.py
juice.py
py
10,093
python
en
code
4
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 44, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 44, "usage_type": "attribute" }, { "api_name": "yaml.load", "line_number": 94, "usage_type": "call" }, { "api_name": "utils.g5k_deploy", ...
8937546965
## Harry Potter Group ## Comprehend import boto3 import json text = "I don't know how I feel about Severus Snape, \ he's OK but sometimes he's a really tough professor" comprehend = boto3.client(service_name='comprehend', region_name='us-east-1') print('Calling DetectSentiment') json_response = comprehend.d...
grantgasser/aws-hackathon
app/comprehend_test.py
comprehend_test.py
py
466
python
en
code
0
github-code
18
[ { "api_name": "boto3.client", "line_number": 10, "usage_type": "call" } ]
5160889092
#!/usr/bin/env python # log event for arduino yun RouterReset from datetime import datetime, timedelta import os import sys import updateWeb # function to log time/event def logEvent (directory): now = datetime.today() # command-line argument: status (startup/up/down) status = sys.argv[1] if len(sys.argv...
karlduino/RouterReset
Python/logEvent.py
logEvent.py
py
2,183
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.today", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join"...
20746598449
# -*- coding: utf-8 -*- import sys import os import numpy as np import pulp from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( QDialog, QPushButton, QGridLayout, QApplication, QLineEdit, QVBoxLayout, QLabel, QRadioButton, QWidget, QButto...
xiaochuan-li/LinearSolverUI
QTUI.py
QTUI.py
py
11,731
python
en
code
1
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 24, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 27, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLineEdit", "line_number": 28, "usage_type": "call" }, { "api_name...
19014292250
from settings import * import json feature_bitmask_file = open(os.path.join(MODELS_ROOT, 'feature_bitmask'), "r") feature_bitmask = json.loads(feature_bitmask_file.read()) def get_subset_features(X, feature_option): """ Get a subset of features from predefined settings :param feature_option: a string...
iamhuy/rumour-veracity-verification-server
models/utils.py
utils.py
py
790
python
en
code
0
github-code
18
[ { "api_name": "json.loads", "line_number": 5, "usage_type": "call" } ]
36769220301
from django.urls import path from . import views app_name = 'ez_rank' urlpatterns = [ # home page path('', views.home, name = 'home'), # team list path('teams/', views.teamlist, name='teamlist'), #game list path('games/', views.gamelist, name = 'gamelist'), #team detail pa...
akartje/EZ-Rank-Webapp
ez_rank/urls.py
urls.py
py
477
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path", ...
3855421324
import os from libvirt import libvirtError from libvirttestapi.src import sharedmod from libvirttestapi.utils import process required_params = ('poolname',) optional_params = {} def display_pool_info(conn): """Display current storage pool information""" logger.debug("current define storage pool: %s" ...
libvirt/libvirt-test-API
libvirttestapi/repos/storage/build_logical_pool.py
build_logical_pool.py
py
2,683
python
en
code
12
github-code
18
[ { "api_name": "libvirttestapi.utils.process.run", "line_number": 21, "usage_type": "call" }, { "api_name": "libvirttestapi.utils.process", "line_number": 21, "usage_type": "name" }, { "api_name": "libvirttestapi.utils.process.run", "line_number": 28, "usage_type": "call" ...
24237034851
import json from pprint import pprint import pandas as pd with open('data_file.json', 'r', encoding='utf-8') as file: res = json.load(file) pprint(res.get('features')[0]) pprint(res.get('features')[0]['geo_centroid']['coordinates']) pprint(res.get('features')[0].get('properties')) final_result = { 'point_id'...
arturUkr/ukraine_school_data
visikom_search_api_prepare_json.py
visikom_search_api_prepare_json.py
py
1,003
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 8, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 9, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number":...
34786789924
from typing import List from uuid import UUID from asyncpg import ForeignKeyViolationError, UniqueViolationError from fastapi import Depends from sqlalchemy import select from sqlalchemy.exc import IntegrityError from sqlalchemy.ext.asyncio import AsyncSession from app.database import get_session from app.models.base...
hutanmihai/FMI
Anul II/Semestrul II/MDS/ProiectMDS/calorie-tracker-backend/app/repositories/sqlalchemy_repo.py
sqlalchemy_repo.py
py
2,290
python
en
code
1
github-code
18
[ { "api_name": "app.repositories.abstract_repo.AbstractRepository", "line_number": 16, "usage_type": "name" }, { "api_name": "sqlalchemy.ext.asyncio.AsyncSession", "line_number": 17, "usage_type": "name" }, { "api_name": "sqlalchemy.ext.asyncio.AsyncSession", "line_number": 19...
24887256363
import sys from PyQt5.QtWidgets import QMainWindow, QApplication from bism_app import Ui_ReportSplitter class Window(QMainWindow, Ui_ReportSplitter): def __init__(self, parent=None): super().__init__(parent) self.setupUi(self) if __name__ == "__main__": app = QApplication(sys.argv) win =...
VladislavYurev/BISM_Reports_Splitter
main.py
main.py
py
369
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 6, "usage_type": "name" }, { "api_name": "bism_app.Ui_ReportSplitter", "line_number": 6, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 13, "usage_type": "call" }, { ...
14501405675
from wsgiref.simple_server import make_server,demo_app from webob import Request,Response,dec # def application(environ,start_response): # start_response("200 ok",[("Content-Type","text/html;charset=utf8")]) # return ["<html><head><title>my site</title></head><body><h1>hhh</h1></body></html>".encode()] ROUTET...
UwonderMen/python
async/基于wsgiref库实现简单的web服务.py
基于wsgiref库实现简单的web服务.py
py
1,086
python
en
code
0
github-code
18
[ { "api_name": "webob.Request", "line_number": 10, "usage_type": "name" }, { "api_name": "webob.Response", "line_number": 11, "usage_type": "call" }, { "api_name": "webob.Request", "line_number": 16, "usage_type": "name" }, { "api_name": "webob.Response", "line...
25217058264
from __future__ import print_function, division, absolute_import import numpy as np import scipy.linalg import warnings # from ..base import BaseEstimator # from ..utils import check_iter_of_sequences, array2d from sklearn.base import TransformerMixin __all__ = ['tICA'] # ---------------------------------------------...
williamgilpin/fnn
fnn/tica.py
tica.py
py
21,079
python
en
code
115
github-code
18
[ { "api_name": "sklearn.base.BaseEstimator", "line_number": 18, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 43, "usage_type": "attribute" }, { "api_name": "numpy.asanyarray", "line_number": 58, "usage_type": "call" }, { "api_name": "numpy....
36345469978
# encoding: utf-8 from __future__ import unicode_literals import codecs import json import re import pyparsing as pp import onto_data as od # device subgrammars with codecs.open('device_data.json', 'r', 'utf-8') as f: mapper = json.load(f, 'utf-8') concept_subgrs = [pp.Regex(mapper[cpt], flags=re.IGNORECASE)(u...
KlausEngelbrecht/HackathonNLU
gr_devices.py
gr_devices.py
py
1,462
python
en
code
0
github-code
18
[ { "api_name": "codecs.open", "line_number": 14, "usage_type": "call" }, { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "pyparsing.Regex", "line_number": 16, "usage_type": "call" }, { "api_name": "re.IGNORECASE", "line_numbe...
32980817974
from PyQt5 import uic, QtCore from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QAction from matplotlib.figure import Figure import matplotlib.pylab as plt from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt5agg import NavigationT...
sevanahmadzada/Arrhythmia-Detection
GUI/Test/test.py
test.py
py
1,484
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 12, "usage_type": "name" }, { "api_name": "PyQt5.uic.loadUi", "line_number": 17, "usage_type": "call" }, { "api_name": "PyQt5.uic", "line_number": 17, "usage_type": "name" }, { "api_name": "PyQt5.QtWidget...
36981525856
#CN11T-9MEM8-WAJGE-33XJT #py_multiproc_2.py #do you need a queue? #when to use popen import multiprocessing as mp import time import sys def worker(number): "here's where the actual work is done" print('Worker {} here!'.format(number)) time.sleep(.1) if __name__ == '__main__': #code is "hidden" here to avoid r...
pbarton666/learninglab
data_sci_long/tester.py
tester.py
py
756
python
en
code
2
github-code
18
[ { "api_name": "time.sleep", "line_number": 15, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 22, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 27, "usage_type": "call" } ]
10483826122
import argparse import logging import networkx as nx import random from collections import Counter from typing import Dict logger = logging.getLogger('sna') def choose_neighbor(neighbors: list, labels: Dict[int, int]) -> int: """ Choose a neighbor from a propagation starting node. A...
g-despot/social-network-analyzer
src/community_detection/label_propagation.py
label_propagation.py
py
2,463
python
en
code
3
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 13, "usage_type": "name" }, { "api_name": "random.sample", "line_number": 38, "usage_type": "call" }, { "api_name": "networkx.classes", "li...
450292827
import os import re from glob import glob from pathlib import Path from pympi.Elan import Eaf from utils.config import Config class HeadMovementParser: def __init__(self, fps): self.fps = fps self.fpms = fps * 0.001 def parse(self, eaf): return self.get_head_annotations(eaf) de...
Casvanrijbroek/Sign-Language-Thesis
dataset/labels/eaf_parser.py
eaf_parser.py
py
4,064
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 31, "usage_type": "call" }, { "api_name": "re.search", "line_number": 33, "usage_type": "call" }, { "api_name": "utils.config.Config", "line_number": 116, "usage_type": "call" }, { "api_name": "glob.glob", "line_num...
74085361000
import io import re import json import requests from glob import glob from bs4 import BeautifulSoup class Book: def __init__(self, book_id, author_id, author_name, author_dd, text, pages,category_id): self.book_id = book_id self.author_id = author_id self.author_name = author_name s...
mmayet/evolution_of_law_and_predictions
code/01_data_collection/02_clean_json.py
02_clean_json.py
py
1,778
python
en
code
2
github-code
18
[ { "api_name": "re.findall", "line_number": 19, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 24, "usage_type": "call" }, { "api_name": "re.compile", "line_numb...
17435862119
from utils import NMS, load_image, draw_boxes import torch import os import numpy as np import cv2 from Yolov4_architecture.model import Yolov4 import time import argparse def pred(img_path = '', conf_thresh = 0.1, iou_thresh = 0.45, classes = [], device = 'cuda', weig...
TmohamedashrafT/Yolov4-implementation
predict.py
predict.py
py
2,056
python
en
code
0
github-code
18
[ { "api_name": "torch.load", "line_number": 17, "usage_type": "call" }, { "api_name": "Yolov4_architecture.model.Yolov4", "line_number": 18, "usage_type": "call" }, { "api_name": "utils.load_image", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.as...
2367627985
# import math # import numpy as np # import matplotlib import matplotlib.pyplot as plt plt.rcParams['font.sans-serif'] = ['KaiTi'] plt.rcParams['axes.unicode_minus'] = False def calc(T): for i in range(0, len(T) - 1): S.append(S[i] - r * b * S[i] * I[i] / N) E.append(E[i] + r * b * S[i] * I[i] / ...
ljj771228/mygithub
seir2.py
seir2.py
py
1,322
python
zh
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 7, "usage_type": "attribute" }, { "ap...