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
71132158120
from dotenv import load_dotenv from dataclasses import dataclass from enum import Enum from typing import Sequence import tibber from influxdb_client.client.influxdb_client_async import InfluxDBClientAsync load_dotenv() @dataclass class Price: time: str level: str total: float unit: str async def f...
aurlien/tibber-influxdb
src/tibber-influx/price_service.py
price_service.py
py
1,246
python
en
code
0
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 11, "usage_type": "name" }, { "api_name": "tibber.Tibber", "line_number": 19, "usage_type": "attribute" }, { "api_name": "typing.Seq...
28141440650
from PyQt5 import QtWidgets, QtGui, QtCore from PyQt5.QtWidgets import QFileDialog as Qfd from ui_views.Views import toolbox, Menubar # from numpy import unique # from ui_views.vector_edit import Ui_vector_widget class MainUI(QtWidgets.QMainWindow): keyPressed = QtCore.pyqtSignal(QtCore.QEvent) def __init__...
kny5/strucpy
ui_views/MainUI.py
MainUI.py
py
3,316
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 10, "usage_type": "call" }, { "api_name":...
13438589292
import numpy as np import cv2 image = cv2.imread('../Table4.jpg') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) image_flt = np.float32(gray) dst = cv2.cornerHarris(image_flt, 20, 3,10) dst = cv2.dilate(dst, None) image[dst > 0.01 * dst.max()] = [0, 0, 255] cv2.imshow('Detected corners', image) cv2.waitKe...
cmurph77/python_vision_ass
IGNORE/python_vision_practise/corners/harris_corner.py
harris_corner.py
py
352
python
en
code
0
github-code
18
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.float32", "lin...
42358768702
from game import GameOfChess import pygame import sys from pygame.constants import QUIT from pygame.draw import rect from pieces import * import LegalMove import ai import Engine pygame.init() pygame.font.init() WIN = pygame.display.set_mode([830, 870]) pygame.display.set_caption("Quin's Chess Game!") myfont = pygam...
QuinPoley/ChessGame
main.py
main.py
py
12,830
python
en
code
1
github-code
18
[ { "api_name": "pygame.init", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.font.init", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mode...
26784093630
from typing import cast from Charon.VirtualFile import VirtualFile #To open UFP files. from Charon.OpenMode import OpenMode #To indicate that we want to write to UFP files. from io import StringIO #For converting g-code to bytes. from UM.Logger import Logger from UM.Mesh.MeshWriter import MeshWriter #The writer we ne...
Szu-Chi/3d-printing-with-moveo
Cura/Cura/plugins/UFPWriter/UFPWriter.py
UFPWriter.py
py
6,021
python
en
code
9
github-code
18
[ { "api_name": "UM.i18n.i18nCatalog", "line_number": 18, "usage_type": "call" }, { "api_name": "UM.Mesh.MeshWriter.MeshWriter", "line_number": 21, "usage_type": "name" }, { "api_name": "UM.MimeTypeDatabase.MimeTypeDatabase.addMimeType", "line_number": 25, "usage_type": "ca...
5488525803
import numpy as np import pandas as pd from pandas_ods_reader import read_ods # importation of linked python file import fonctions_machine_learning as ml from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error from sklearn.metrics import r2_score pd.set_option('display.max_...
dimitri-feniou/django_abrestauration
Ml/main.py
main.py
py
3,231
python
en
code
0
github-code
18
[ { "api_name": "pandas.set_option", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas_ods_reader.read_ods", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas_ods_reader.read_ods", "line_number": 19, "usage_type": "call" }, { "api_name"...
71210639079
import httplib import ssl import logging import traceback import socket from cpc.network.com.connection_base import ConnectionBase from cpc.network.https.real_https_connection import HttpsConnectionWithCertReq, \ HttpsConnectionNoCertReq from cpc.network.https_connection_pool import ServerConnectionPool, Connectio...
gromacs/copernicus
cpc/network/com/server_connection.py
server_connection.py
py
5,412
python
en
code
17
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "cpc.util.CpcError", "line_number": 16, "usage_type": "name" }, { "api_name": "cpc.network.com.connection_base.ConnectionBase", "line_number": 21, "usage_type": "name" }, { ...
30743448136
import uproot import matplotlib.pyplot as plt import numpy as np #import functions as fnc # Viewing particular event of particular file. # Open the data, apply to variable file = r"D:\Documents 2\Uni\YEAR5\MPhys\ROOT_FILES\RUN000008\Run_8_PMT_162_Loc_9_Test_N.root" # File directory specific, just to remove the E:\PMT...
CasperMcTavish/MPhys
Misc Macros/eventview.py
eventview.py
py
1,153
python
en
code
0
github-code
18
[ { "api_name": "uproot.open", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 32, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 32, "usage_type": "name" }, { "api_name": "matplotlib.pyplo...
9067363670
from PIL.Image import Image from django.contrib.auth import authenticate, login, logout from django.shortcuts import render,redirect from.forms import SignupUser,UserLoginForm from django.contrib.auth.models import User from RegisterApp.models import * from django.contrib.auth.decorators import login_required #...
dipakbaghele/User_Sign_Login-form
RegisterApp/views.py
views.py
py
2,483
python
en
code
0
github-code
18
[ { "api_name": "forms.SignupUser", "line_number": 14, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 17, "usage_type": "call" }, { "api_name": "forms.SignupUser", "line_number": 19, "usage_type": "call" }, { "api_name": "django.sh...
40119822347
import tensorflow as tf #config = tf.ConfigProto(log_device_placement=True, allow_soft_placement=True) config = tf.ConfigProto(allow_soft_placement=True) config.gpu_options.allow_growth = True #config.gpu_options.per_process_gpu_memory_fraction = 0.4 sess = tf.Session(config=config) from keras import backend as K K.s...
GaopanHuang/DigitRecognizer
loadvgg16formnist.py
loadvgg16formnist.py
py
2,417
python
en
code
0
github-code
18
[ { "api_name": "tensorflow.ConfigProto", "line_number": 3, "usage_type": "call" }, { "api_name": "tensorflow.Session", "line_number": 7, "usage_type": "call" }, { "api_name": "keras.backend.set_session", "line_number": 10, "usage_type": "call" }, { "api_name": "ker...
31499894891
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @desc: @author: DYL @contact: chng547835@163.com @site: www.xxxx.com @software: PyCharm @since:python 3.5.2 on 2016/11/3.10:49 """ import tornado.ioloop import tornado.web from tornado import gen from tornado.concurrent import Future ##tornado 异...
DYL521/web_python
支持异步非阻塞的框架/s4.py
s4.py
py
1,127
python
en
code
1
github-code
18
[ { "api_name": "tornado.ioloop.web", "line_number": 16, "usage_type": "attribute" }, { "api_name": "tornado.ioloop", "line_number": 16, "usage_type": "name" }, { "api_name": "tornado.httpclient.AsyncHTTPClient", "line_number": 20, "usage_type": "call" }, { "api_nam...
72895899879
import os from flask import Flask, render_template, request, redirect, url_for import cv2 app = Flask(__name__) # Set the upload folder and allowed extensions app.config['UPLOAD_FOLDER'] = 'uploads' app.config['ALLOWED_EXTENSIONS'] = {'jpg', 'jpeg', 'png'} # Create a HOGDescriptor object hog = cv2.HOGDesc...
SaiNishanth-cloud/PedestrianTracking
pedestriandetection.py
pedestriandetection.py
py
2,679
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.HOGDescriptor", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.HOGDescriptor_getDefaultPeopleDetector", "line_number": 13, "usage_type": "call" }, { "api_name"...
40691043849
# -*- coding: utf-8 -*- import os,sqlite3 db_file = os.path.join(os.path.dirname(__file__),'test.db') if os.path.isfile(db_file): os.remove(db_file) conn = sqlite3.connect(db_file) cursor = conn.cursor() users = [('A-001', 'Adam', 95), ('A-002', 'Bart', 62), ('A-003', 'Lisa', 78)] cursor.execute('cre...
tuhongwei/python-exercise
db/sqlite.py
sqlite.py
py
1,052
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_num...
8383377200
# standard library imports import logging, os, md5, sys import hashlib, json import simplejson import time from datetime import datetime from HTMLParser import HTMLParser # google from google.appengine.ext import ndb from google.appengine.api import urlfetch from google.appengine.api import channel # related webapp2 ...
kordless/stackmonkey-site
web/handlers/apihandlers.py
apihandlers.py
py
29,871
python
en
code
0
github-code
18
[ { "api_name": "web.basehandler.BaseHandler", "line_number": 41, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 53, "usage_type": "call" }, { "api_name": "web.models.models.Appliance.get_by_token", "line_number": 61, "usage_type": "call" }, { "a...
4250162610
import os import random import sys import time import requests from bs4 import BeautifulSoup headers = [ "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome...
azusachino/little-python
little-spider/yandre/fetcher.py
fetcher.py
py
4,531
python
en
code
0
github-code
18
[ { "api_name": "os.sep", "line_number": 36, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 52, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 52, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_...
36599462564
from django.urls import path, include from .views import MainPageView, SPageView, TPageView, NewsFieldDetail, NewsFieldUpdate, NewsFieldDelete urlpatterns = [ path('', MainPageView.as_view(), name='main'), path('s', SPageView.as_view(), name='s'), path('t', TPageView.as_view(), name='t'), path('t/<i...
herasimprokofiev/djangoredsite
thesitefolder/urls.py
urls.py
py
527
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "views.MainPageView.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "views.MainPageView", "line_number": 7, "usage_type": "name" }, { "api_name": "django.ur...
2837315512
import pandas as pd import numpy as np from numpy.core.fromnumeric import size import scipy from sklearn.neighbors import NearestNeighbors import matplotlib.pyplot as plt def sampling_neighbors(gene_unsplice_splice,step=(30,30),percentile=25): from scipy.stats import norm def gaussian_kernel(X, mu = 0, sigma...
GuangyuWangLab2021/cellDancer
src/celldancer/sampling.py
sampling.py
py
11,402
python
en
code
46
github-code
18
[ { "api_name": "numpy.exp", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.min", "line_number": 16,...
8928368585
import datetime import json import os import random import time import xml.sax.saxutils as saxutils from datetime import datetime import azurelinuxagent.common.conf as conf import azurelinuxagent.common.logger as logger import azurelinuxagent.common.utils.textutil as textutil from azurelinuxagent.common.datacontract i...
pexip/os-walinuxagent
azurelinuxagent/common/protocol/wire.py
wire.py
py
52,190
python
en
code
0
github-code
18
[ { "api_name": "azurelinuxagent.common.exception.HttpError", "line_number": 51, "usage_type": "name" }, { "api_name": "azurelinuxagent.common.exception.ProtocolError", "line_number": 60, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 66, "usage_type":...
11852783179
#!/usr/bin/env python # _*_ coding: utf-8 _*_ import serial import time from functools import reduce MAX_ANGLE = 270 MIN_ANGLE = 0 def ListToStr(data): strings = "".join(map(str, data)) return strings def DataToStr(x, y): if isinstance(x, str): return x + chr(y) else: return chr(x) ...
MONOcircle/electric_shovel
ics35_py/serialServo.py
serialServo.py
py
2,287
python
en
code
0
github-code
18
[ { "api_name": "serial.Serial", "line_number": 28, "usage_type": "call" }, { "api_name": "serial.PARITY_EVEN", "line_number": 30, "usage_type": "attribute" }, { "api_name": "serial.STOPBITS_ONE", "line_number": 31, "usage_type": "attribute" }, { "api_name": "functo...
71874881321
from django.shortcuts import render from rest_framework.views import APIView from django.http import JsonResponse, HttpResponse from .models import TopicHub, Hub, PlaylistOfHub, HubOfTopic from .serializers import TopicHubSerializers, HubSerializers from random import choice from playlists.models import Playlists, Arti...
DUC-LV/zingmp3_projects
src/topic_category/views.py
views.py
py
5,742
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.views.APIView", "line_number": 13, "usage_type": "name" }, { "api_name": "rest_framework.permissions.AllowAny", "line_number": 14, "usage_type": "name" }, { "api_name": "django.http.HttpResponse", "line_number": 19, "usage_type": "call" }, ...
10026246279
import random import math import collections import datetime import math def get_user_brands(reco_file_path, end_date): '''用户商品倒插表''' beta = 0.5 reco_file=open(reco_file_path,"r") reco_file.readline() brand_pref = collections.defaultdict(lambda :0) for line in reco_file: line = line.str...
siegfang/draft
recommond/lfm/lfm.py
lfm.py
py
5,030
python
en
code
7
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 17, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 33, "usage_type": "call" }, { "api_name": "collect...
14941860821
#----------------------------------------------- # Import #----------------------------------------------- from __future__ import print_function import pickle import os.path from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Req...
nealliddle/Automate-SOP-Creation
Read ARIS Files 2.py
Read ARIS Files 2.py
py
13,947
python
en
code
0
github-code
18
[ { "api_name": "enchant.Dict", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 55, "usage_type": "call" }, { "api_name": "os.path", "line_number": 55, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_numb...
37302259864
M = 998244353 from collections import Counter N = 1 + 10 ** 6 v = [False] * N spf = [1] * N for i in range(2, N, 2): spf[i] = 2 for i in range(3, N, 2): if not v[i]: spf[i] = i j = i while j * i < N: if not v[j * i]: v[j * i] = True spf[j *...
theabbie/leetcode
miscellaneous/E_Combinatorics_Problem.py
E_Combinatorics_Problem.py
py
759
python
en
code
11
github-code
18
[ { "api_name": "collections.Counter", "line_number": 25, "usage_type": "call" } ]
71453666600
from PyQt5.QtWidgets import QMainWindow, QTableWidget, QTableWidgetItem, QApplication, QHeaderView,\ QMessageBox, QInputDialog, QDialog from UI import Ui_MainWindow from binarytree import BinaryTree class MainWindow(QMainWindow): def __init__(self, parent=None): super(MainWindow, self).__init__(parent...
dt50/Translate-binary-sotring-tree
mainwindow_.py
mainwindow_.py
py
2,377
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 7, "usage_type": "name" }, { "api_name": "UI.Ui_MainWindow", "line_number": 10, "usage_type": "call" }, { "api_name": "binarytree.BinaryTree", "line_number": 12, "usage_type": "call" }, { "api_name": "PyQ...
14667583212
class Events: def __init__(self, config, template, timesheet, text_color): self.config = config self.template = template self.timesheet = timesheet self.text_color = text_color def read_config(self): import configparser import logging logger = l...
mehulved/fill_certificates
certificate-rewrite.py
certificate-rewrite.py
py
3,451
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "logging...
29691999765
import roslibpy import numpy as np import quaternion import time import ros_mobile_client as rmc from grounded_action import GroundedAction, GroundedActionPool, GroundedStep import area_globalization as ag from occupancygrid_tools import AreaChecker from typing import List, Dict, Sequence import matplotl...
wwwshwww/seeker
sagashimono.py
sagashimono.py
py
6,690
python
en
code
0
github-code
18
[ { "api_name": "typing.Sequence", "line_number": 27, "usage_type": "name" }, { "api_name": "numpy.random.randint", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 28, "usage_type": "attribute" }, { "api_name": "typing.List", ...
35360004616
import unittest from bitcoin import LecturaInputs class Test_Lecturas(unittest.TestCase): def test_dict(self): # Comprobamos si las funciones nos retornan un diccionario dict_test = {} # Creo uno vacio que nos sirva de referencia self.assertEqual(type(LecturaInputs.lectura_blocks()), type...
JaimePerez89/Bitcoin
test/testsLecturas.py
testsLecturas.py
py
695
python
es
code
0
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 4, "usage_type": "attribute" }, { "api_name": "bitcoin.LecturaInputs.lectura_blocks", "line_number": 9, "usage_type": "call" }, { "api_name": "bitcoin.LecturaInputs", "line_number": 9, "usage_type": "name" }, { "ap...
19019395275
#coding:utf-8 ''' 定义一个graph Runner ''' from PySide6.QtCore import QObject,Signal from time import sleep class VGRunner(QObject): progress = Signal(int) finished = Signal() def __init__(self,func,*args,**kwds): super().__init__() self.func = func self.args = args self.k...
GAMEOMETRICS/VisualGraph-python
src/editor/tools/GraphRunner.py
GraphRunner.py
py
525
python
en
code
71
github-code
18
[ { "api_name": "PySide6.QtCore.QObject", "line_number": 10, "usage_type": "name" }, { "api_name": "PySide6.QtCore.Signal", "line_number": 12, "usage_type": "call" }, { "api_name": "PySide6.QtCore.Signal", "line_number": 13, "usage_type": "call" } ]
1195135064
import torch import os import wandb import json import torch.optim as optim from PIL import Image from utils import parser, misc from utils.config import * from tools import builder from tqdm import tqdm from my_datasets.my_PCN import get_dataloader from utils.logger import * from utils.AverageMeter import AverageMeter...
Soaring666/PoinTr
fold_registry.py
fold_registry.py
py
6,080
python
en
code
0
github-code
18
[ { "api_name": "torch.cuda.is_available", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 19, "usage_type": "attribute" }, { "api_name": "wandb.login", "line_number": 23, "usage_type": "call" }, { "api_name": "wandb.init", ...
71279977639
from django.urls import path, include from .views import * urlpatterns = [ path('', home_budget, name="budget home"), path('test/', test_page), path('transactions', transactions_overview, name="transactions"), path('categories', categories_summary, name="categories"), path('accounts', accounts_summ...
DarioFi/BudgetApp
Budgeting/urls.py
urls.py
py
1,166
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
70954658600
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import * from PlasticRinseDialog import PlasticRinseDialog from RecycleDialog import RecycleDialog from ServoFuncs import openLid from Worker import Worker class PlasticFoodLiquidDialog(object): def setupPlasticFoodLiquid(self, Dialog): ...
brettsherwood/EMMA
PlasticFoodLiquidDialog.py
PlasticFoodLiquidDialog.py
py
4,204
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QGridLayout", "line_number": 14, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets", "line_number": 14, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 19, "usage_type": "call" }, { "api_name": "Py...
23694174017
from django.shortcuts import render from rest_framework.views import APIView from rest_framework.response import Response from django.forms.models import model_to_dict from .models import Team from .errors import * import ipdb from datetime import datetime class TeamView(APIView): def post(self, request): ...
Kenzie-Academy-Brasil-Developers/kopa-do-mundo-victor
teams/views.py
views.py
py
3,006
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.views.APIView", "line_number": 10, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "name" }, { "api_nam...
2546480706
#!/usr/bin/env python2 from __future__ import print_function import sys, subprocess, os, time def usage(): print("Usage: {0} tcid genomeid".format(sys.argv[0])) exit(1) def makedb(fn, outdir): title = os.path.splitext(os.path.basename(fn))[0] outpath = outdir + '/' + title title += ' {}'.format(time.strftime('...
SaierLaboratory/TCDBtools
bin/genomebot.py
genomebot.py
py
4,404
python
en
code
4
github-code
18
[ { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.splitext", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.basename", "li...
42621675684
from modules.configuration import Configuration from tensorboard import default from tensorboard import program import tensorflow as tf import datetime class TensorboardManager(): def __init__(self, configuration: Configuration): self.tensorboard_current_run_log_directory = "{}\Shakespear-{}".format(confi...
nekon1987/shakespear-lstm
modules/tensorboard.py
tensorboard.py
py
1,369
python
en
code
0
github-code
18
[ { "api_name": "modules.configuration.Configuration", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "attribute" }, { "a...
44361107688
#!/usr/bin/python3 # coding: utf-8 """ Define a partial view to display packages in the list""" # # (c) 2018-2022 Siveo, http://www.siveo.net # # This file is part of Pulse 2, http://www.siveo.net # # Pulse 2 is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License ...
medulla-tech/kiosk-interface
kiosk_interface/views/toaster.py
toaster.py
py
4,541
python
en
code
1
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 34, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 35, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.Qt.Widget", "line_number": 67, "usage_type": "attribute" }, { "api_n...
71941509159
# Biblioteca SQLite3 import sqlite3 # Conexão com o banco de dados con = sqlite3.connect("my_dbpython") cursor = con.cursor() # Criando função para cadastrar usuários def CadastrarUsuario(): # Nome do usuário nome = input("\nEntre com o nome: ") # Senha do usuário senha = input("\nEntre com uma senha:...
guferrara12/Projeto-Python-SQL
Sistema_Emprestimo_Python_SQLite/main.py
main.py
py
9,291
python
pt
code
0
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 5, "usage_type": "call" } ]
72959757481
import numpy as np from scipy.stats import spearmanr, norm import matplotlib.pyplot as plt from brainsmash.mapgen.base import Base from visualisation import plot_correlations_ci def corr_single(sc_isv,fc_grads,n_grads=5): """Calculate spearman correlation coeff. of given SC ISV and functional gradients""" cor...
ChrisAlexNorman/CUBRIC_FC
gradients/corr_functions.py
corr_functions.py
py
8,166
python
en
code
0
github-code
18
[ { "api_name": "scipy.stats.spearmanr", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.load", "line_...
73955077480
#!/usr/bin/env python3 from __future__ import annotations import datetime as dt import http.cookies import json import tempfile import time import urllib.parse from http.cookiejar import Cookie from pathlib import Path from typing import Sequence import httpx from httpx import AsyncClient, Request, Response from . ...
Congee/httpx.har
httpxhar/main.py
main.py
py
5,526
python
en
code
1
github-code
18
[ { "api_name": "httpx.Request", "line_number": 33, "usage_type": "name" }, { "api_name": "httpx.AsyncClient", "line_number": 54, "usage_type": "name" }, { "api_name": "typing.Sequence", "line_number": 57, "usage_type": "name" }, { "api_name": "httpx.__version__", ...
18622813954
import numpy as np import torch as th from torch import nn from torch import optim import random from collections import deque np.random.seed(1) class DeepQLearning: def __init__( self, n_actions, n_features, learning_rate, discount_fa...
radajakub/DQN
src/DQN.py
DQN.py
py
4,075
python
en
code
0
github-code
18
[ { "api_name": "numpy.random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 38, "usage_type": "call" }, { "api_name": "torch.optim.Adam"...
38453335068
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render from maintenance.models import MaintenanceRequest from maintenance.serializers import MaintenanceReadSerializer, MaintenancePostSerializer, MaintenanceUpdateSerializer, CommentSerializer from rest_framework.views import...
kdenny/parrot-dj-app
maintenance/views.py
views.py
py
4,393
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.views.APIView", "line_number": 14, "usage_type": "name" }, { "api_name": "maintenance.models.MaintenanceRequest.objects.exclude", "line_number": 18, "usage_type": "call" }, { "api_name": "maintenance.models.MaintenanceRequest.objects", "line_numb...
32196752918
import os import sys import constants import argparse from HTMLOperations import HTMLOperations from XMLOperations import XMLOperations from AggregateOperations import AggregateOperations parser = argparse.ArgumentParser(description="Generate insights from text snapshots of your Whatsapp group chats.") parser.add_argu...
ace-racer/WhatsAppMessagesInsights
main.py
main.py
py
2,655
python
en
code
7
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.split", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "l...
2518483187
import os import unittest from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.by import By class SearchTests(unittest.TestCase): def setUp(self): dire = os.path.dirname(os.path.abspath(__file__...
Cheryl008/iCure
test/test_search.py
test_search.py
py
904
python
en
code
0
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.abspath", ...
22912231363
import logging logger = logging.getLogger(__name__) from .base_info_loss import BaseInfoLossMetric from .am import AttributeInfoLoss from .dm import OutDegreeInfoLoss, InDegreeInfoLoss, OutInDegreeInfoLoss class AttributeOutInDegreeInfoLoss(BaseInfoLossMetric): def __init__(self, subgraph, args): super(...
tuhoag/sequential-anonygraph
anonygraph/info_loss/adm.py
adm.py
py
1,203
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 3, "usage_type": "call" }, { "api_name": "base_info_loss.BaseInfoLossMetric", "line_number": 10, "usage_type": "name" }, { "api_name": "am.AttributeInfoLoss", "line_number": 14, "usage_type": "call" }, { "api_name"...
39812898732
""" https://www.youtube.com/watch?v=PjhlUzp_cU0&t=960s 나도코딩 파이썬 코딩 무료 강의 (활용편5) - 데이터 분석 및 시각화, 이 영상 하나로 끝내세요 2022-08-02 03:58:10 ~ 04:05:02 """ import matplotlib.pyplot as plt import matplotlib matplotlib.rcParams['font.family'] = 'AppleGothic' matplotlib.rcParams['font.size'] = 15 matplotlib.rcParams['axes.unicode...
jungmyung-kr/Python_Review
Others/DataAnalysis_and_Visualization/2_Matplotlib/09_Barplot_advanced.py
09_Barplot_advanced.py
py
1,252
python
ko
code
0
github-code
18
[ { "api_name": "matplotlib.rcParams", "line_number": 12, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 13, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 14, "usage_type": "attribute" }, { "api_na...
23137836380
from rest_framework import viewsets from currency.models import Rate, Source, ContactUs from currency.api.serializers import RateSerializer, SourceSerializer, ContactUsSerializer from currency.api.paginators import TenThousandPagination from currency.filters import RateFilter, ContactUsFilter from django_filters impo...
Giperelk/currency
app/currency/api/views.py
views.py
py
1,457
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 12, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 12, "usage_type": "name" }, { "api_name": "currency.models.Source.objects.all", "line_number": 13, "usage_type": "...
1340876580
# Created by matveyev at 18.02.2021 """ General class for opened file/stream """ import numpy as np import logging from PyQt5 import QtCore from petra_viewer.main_window import APP_NAME logger = logging.getLogger(APP_NAME) class BaseDataSet(object): # --------------------------------------------------------...
yamedvedya/data_viewer
petra_viewer/data_sources/base_classes/base_data_set.py
base_data_set.py
py
16,626
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "petra_viewer.main_window.APP_NAME", "line_number": 14, "usage_type": "argument" }, { "api_name": "numpy.array", "line_number": 31, "usage_type": "call" }, { "api_name": "n...
42260244758
import difflib import string from nltk import word_tokenize # This function extracts the name of the user from the user's input. def extract_name(sentence): # Handle exception if sentence.strip().find(' ') == -1: return sentence # De-punctuate and tokenise sentences. tran_punc = str.maketran...
single-single/Interactive-NLP-based-System
identityManagement.py
identityManagement.py
py
1,067
python
en
code
0
github-code
18
[ { "api_name": "string.punctuation", "line_number": 14, "usage_type": "attribute" }, { "api_name": "nltk.word_tokenize", "line_number": 16, "usage_type": "call" }, { "api_name": "difflib.SequenceMatcher", "line_number": 27, "usage_type": "call" } ]
19218901717
import requests import urllib3 import os.path from datetime import datetime from urllib3 import disable_warnings def printmsg(msg): print(f"{str(datetime.now())[:-7]}\t{msg}") session = requests.session() path = os.path.split(os.path.realpath(__file__))[0] if os.path.exists(path + "/jwt"): printmsg("cookie存...
TwoOnefour/biyapay
Api.py
Api.py
py
2,178
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "name" }, { "api_name": "requests.session", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.path.s...
5694262292
import binascii from Crypto.Random import get_random_bytes from Crypto.Cipher import AES from Crypto.Util import Counter import argparse # length in bytes KEY_LEN = 16 NONCE_LEN = 16 # counter length in bits CTR_LEN = 128 def int_of_string(s): return int(binascii.hexlify(s), 16) def byte_xor(ba1, ba2): non_...
ericcao119/ermalloc
encryption-test/ctr.py
ctr.py
py
2,157
python
en
code
2
github-code
18
[ { "api_name": "binascii.hexlify", "line_number": 15, "usage_type": "call" }, { "api_name": "Crypto.Random.get_random_bytes", "line_number": 30, "usage_type": "call" }, { "api_name": "Crypto.Util.Counter.new", "line_number": 31, "usage_type": "call" }, { "api_name"...
43337960885
#! /usr/bin/env python3 from __future__ import division import os, sys import tqdm import torch import torch.optim as optim from terminaltables import AsciiTable from torchsummary import summary from src.Model.load_model import load_model from src.utils.gUtils import Logger from src.utils.torchUtils import to_cpu, s...
kurosh-z/project_detection
src/trainME.py
trainME.py
py
7,537
python
en
code
0
github-code
18
[ { "api_name": "src.utils.torchUtils.set_seed", "line_number": 47, "usage_type": "call" }, { "api_name": "src.utils.gUtils.Logger", "line_number": 51, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 54, "usage_type": "call" }, { "api_name": "os....
3408881328
import pygame from variables import * def plot_results(herbivores_counts, predators_counts, plants_counts): import matplotlib.pyplot as plt time_steps = list(range(len(herbivores_counts))) plt.plot(time_steps, herbivores_counts, label="Herbivores", color="blue") plt.plot(time_steps, predators_counts,...
MartinovG/VSE_9klas_ecosystem_simulator
src/Graphs.py
Graphs.py
py
1,435
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 10, "usage_type": "call" }, { "api_name": "matplot...
22844594101
import matplotlib.pyplot as plt from utils import roundup import random import math from config import config as cfg import os dest = os.path.dirname(__file__) def rr_plot(list_of_processes, timestamp): # every file will be saved to given dir target = dest + "/" + timestamp os.makedirs(target, exist_ok...
adinsoon/scheduling_algorithms
matplotlib_processes.py
matplotlib_processes.py
py
6,414
python
en
code
0
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_numbe...
1530594299
import os import datetime from flask import url_for from flask import Blueprint, render_template from flask import Flask from flask_cors import CORS from flask_restplus import Resource, Api, fields PATH_TO_TEMPLATES = "./tpl/" app = Flask(__name__) # Default web page Blueprint START ################################...
divlv/sampleweb
www/index.py
index.py
py
2,662
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.Blueprint", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime",...
20008882178
import numpy as np import pandas as pd from scipy import interpolate as intp from scipy import optimize import matplotlib.pyplot as plt import gsw from tqdm import tqdm import multiprocessing from joblib import Parallel,delayed def find_sigma0_z(salinity, temperature, pressure, latitude, longitude, sigmas): """ ...
ashao/glodap_analysis
calc_sigma_depths.py
calc_sigma_depths.py
py
4,937
python
en
code
1
github-code
18
[ { "api_name": "numpy.square", "line_number": 32, "usage_type": "call" }, { "api_name": "gsw.sigma0", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 36, "usage_type": "attribute" }, { "api_name": "numpy.nan", "line_number":...
73515735721
import numpy as np from sympy import Matrix import random from modules.alphabet import getAlphabet def getModularMatrix(matrix): ''' ------------ DESCRIPCIÓN: Función que se encarga de encontrar la matriz modular inversa. :param matrix: (numpy matrix) Representa la llave que se utiliza...
ngutierrezp/Sisteco1-2020
Lab3/modules/utilities.py
utilities.py
py
1,977
python
es
code
0
github-code
18
[ { "api_name": "modules.alphabet.getAlphabet", "line_number": 25, "usage_type": "call" }, { "api_name": "sympy.Matrix", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", ...
3156163901
#!/usr/bin/env python3 import os import sys import psutil import subprocess import time from pathlib import Path import typer from unoserver import converter # from pdf2pdfa import pdf2pdfa def start_uno_server(): if uno_server_running(): return subprocess.Popen( Path(Path.home(), ".local/b...
Preservation-Workbench/PWConvert
bin/unoconv2x.py
unoconv2x.py
py
1,779
python
en
code
0
github-code
18
[ { "api_name": "subprocess.Popen", "line_number": 19, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 20, "usage_type": "call" }, { "api_name": "pathlib.Path.home", "line_number": 20, "usage_type": "call" }, { "api_name": "subprocess.DEVNULL", ...
72412963880
import dateutil import functools import json import random import requests import urllib import common.constants as const from common.anilist import add_anotd_bl, anilist_search, anilist_rand_series, rm_anotd_bl from common.arg_parsers import mal_arg_parser from common.mal import mal_url_info from common.utils import...
Hippopotas/hippobotas
commands.py
commands.py
py
29,250
python
en
code
1
github-code
18
[ { "api_name": "user.User.compare_ranks", "line_number": 55, "usage_type": "call" }, { "api_name": "user.User", "line_number": 55, "usage_type": "name" }, { "api_name": "user.User.compare_ranks", "line_number": 56, "usage_type": "call" }, { "api_name": "user.User",...
554901543
from pathlib import Path import openpyxl as xl import datelist import os import master step = "one" status = "" # making the dir if path not exist path = Path("c:/it/PayrollAuto/") if path.exists(): # making temp directory if not exist if not Path(master.temppath).exists(): os.mkdir(master.temppath) ...
ddhairya/dataautomation
stepone.py
stepone.py
py
2,627
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "call" }, { "api_name": "master.temppath", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_n...
12356719882
"""ORM-like approach to neo4j nodes """ import json from abc import ABC, abstractmethod from typing import Literal class _Neo4jObject(ABC): @property @abstractmethod def label(self) -> str: raise NotImplementedError('This method must be implemented') @classmethod @abstractmethod def ...
adamcohenhillel/deepAI
backend/db/neo4j/entities.py
entities.py
py
3,019
python
en
code
0
github-code
18
[ { "api_name": "abc.ABC", "line_number": 8, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 11, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Literal", "li...
1954059388
import cv2 import matplotlib.pyplot as plt img = cv2.imread('A.jpeg') cv2.imshow('Original',img) cv2.waitKey() gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) cv2.imshow('GrayScale',gray) cv2.imwrite('gray.jpeg',gray) cv2.waitKey() hist = cv2.calcHist([gray],[0],None,[256],[0,256]) plt.xlabel('Pixel Value') plt.ylabel(...
anantpednekar/ImageProcessing
HistogramEqualisation/histogram.py
histogram.py
py
679
python
en
code
0
github-code
18
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 8, ...
22398807299
#!/usr/bin/env python3 import subprocess, time, re, socket, argparse, os, asyncio, sys import urllib import socket import geoip2.database from IPy import IP from prometheus_client import Counter, start_http_server, Gauge metric_labels = ['src_pod', 'src_user', 'src_org', 'dst_ip', 'dst_proto', 'dst_country', 'dst_cont...
shota-matsumoto-lm/network_output_exporter
network-output-exporter.py
network-output-exporter.py
py
4,028
python
en
code
0
github-code
18
[ { "api_name": "geoip2.database.database.Reader", "line_number": 11, "usage_type": "call" }, { "api_name": "geoip2.database.database", "line_number": 11, "usage_type": "attribute" }, { "api_name": "geoip2.database", "line_number": 11, "usage_type": "name" }, { "api...
34062493804
import unittest from unittest.mock import patch import cli import click from click.testing import CliRunner order_data = { "data_format": "csv", "products": [ { "product_category": "drink", "type": "coke_zero" }, { "product_category": "pizza", ...
JonathanJTang/Pizza-Ordering
tests/cli_tests.py
cli_tests.py
py
3,648
python
en
code
0
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 39, "usage_type": "attribute" }, { "api_name": "cli.convert_to_csv", "line_number": 42, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 46, "usage_type": "attribute" }, { "api_name": "clic...
1110935474
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 15 14:55:14 2021 @author: sahyadri """ import json import numpy as np import re import argparse import glob import os from datetime import date def find_star(data): """ Function to find the position of a given star (Alpheratz; could be an...
sidgan/nasaweb
backend/constellations/const_update.py
const_update.py
py
5,382
python
en
code
11
github-code
18
[ { "api_name": "numpy.where", "line_number": 37, "usage_type": "call" }, { "api_name": "json.load", "line_number": 58, "usage_type": "call" }, { "api_name": "re.split", "line_number": 120, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_n...
9061725336
# A subscribers example import rx from rx.subjects import Subject from datetime import datetime # You can choose which of these to use # source = rx.from_([2, 3, 5, 7]) # source = rx.from_iterable([2, 3, 5, 7]) source = rx.from_list([2, 3, 5, 7]) class TimeStampSubject(Subject): """ Class implementing a Subject...
johnehunt/advancedpython3
chapter34/reactive2.py
reactive2.py
py
1,247
python
en
code
47
github-code
18
[ { "api_name": "rx.from_list", "line_number": 10, "usage_type": "call" }, { "api_name": "rx.subjects.Subject", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datet...
73487536360
"""bussiness_admin URL Configuration.""" # Django from django.contrib import admin from django.urls import include, path urlpatterns = [ path('admin/', admin.site.urls), path('', include(('app.users.urls', 'users'), namespace='users')), path('', include(('app.companies.urls', 'companies'), namespace='com...
Julian-Bio0404/Business_Admin
conf/urls.py
urls.py
py
333
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 9, "usage_type": "name" }, { "api_name": "dja...
14950154171
from collections import defaultdict from typing import Dict, Any, List, Union import re from io import BytesIO import serial import bdDetect import braille import inputCore from logHandler import log import hwIo from baseObject import ScriptableObject import wx import threading from globalCommands import SCRCAT_BRAILL...
nvaccess/nvda
source/brailleDisplayDrivers/eurobraille/driver.py
driver.py
py
13,593
python
en
code
1,802
github-code
18
[ { "api_name": "braille.BrailleDisplayDriver", "line_number": 28, "usage_type": "attribute" }, { "api_name": "baseObject.ScriptableObject", "line_number": 28, "usage_type": "name" }, { "api_name": "hwIo.IoBase", "line_number": 29, "usage_type": "attribute" }, { "ap...
21843588439
# To do: # 1)Make sure start and end matches. # -Take last element in list and compare to click destination # -if (x orgin - x dest) < 5 and (y orgin - y dest) < 5 # -if not remove import pygame import random import keyboard import os import win32gui import win32api import time impo...
pokkagrinti/Aim_Game
aimmap.py
aimmap.py
py
6,534
python
en
code
0
github-code
18
[ { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pygame.font.SysFont", "line_number": 41, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 41, "usage_type": "attribute" }, { "api_name": "pygame.mouse.get...
27869462900
''' @program: Otsu_Thresholding.py @description: Otsu最佳全局阈值处理 @author: doubleZ @create: 2019/12/14 ''' import cv2 def Otsu_Thresholding(image): ''' :description: Otsu最佳全局阈值 :param image: 原图 :return gray: 原图的灰度图像 :return thresh: 简单阈值处理后的图像 :return th1: 对灰度图像进行Otsu最佳全局阈值处理后对图像 :return b...
doubleZ0108/Digital-Image-Processing
Fingerprint Image Extraction/src/Otsu_Thresholding.py
Otsu_Thresholding.py
py
1,572
python
en
code
7
github-code
18
[ { "api_name": "cv2.cvtColor", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGRA2GRAY", "line_number": 24, "usage_type": "attribute" }, { "api_name": "cv2.threshold", "line_number": 26, "usage_type": "call" }, { "api_name": "cv2.THRESH_BINARY...
3458985191
# -*- encoding: utf-8 -*- """ ------------------------------------------------- File Name: vocabulary.py Description : Author : Wings DH Time: 2020/1/4 2:47 下午 ------------------------------------------------- Change Activity: 2020/1/3: Create -------------------------...
Wingsdh/transformer-xl-refactoring
data_processing/vocabulary.py
vocabulary.py
py
10,824
python
en
code
11
github-code
18
[ { "api_name": "abc.ABC", "line_number": 28, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 31, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 35, "usage_type": "name" }, { "api_name": "abc.abstractmethod", ...
5350856985
import requests import pandas as pd API_URL = "https://data.binance.com/api/v3/ticker/24hr" response = requests.get(API_URL) if response.status_code == 200: data = response.json() else: print("Failed to retrieve the data from the API") exit() df = pd.DataFrame(data) csv_filename ="api_data.csv" df.to_...
RajatBagadi17/COB
TASK1.PY
TASK1.PY
py
430
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" } ]
2022180951
import cv2 import glob import os inputFolder='/content/drive/My Drive/Dataset/test_set/right' folderLen=len(inputFolder) os.mkdir('right_test') for img in glob.glob(inputFolder+"/*jpg"): image = cv2.imread(img) imgResized=cv2.resize(image,(256,256)) cv2.imwrite("right_test"+img[folderLen:],imgResized)
nandhukrishnan/Guidance-System-for-Autonomous-Vehicles
Google Colab/Sample Model/image-resize.py
image-resize.py
py
307
python
en
code
0
github-code
18
[ { "api_name": "os.mkdir", "line_number": 7, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 10, "u...
13909662165
# !/usr/bin/python3 # coding:utf-8 import json import requests from bs4 import BeautifulSoup from datetime import datetime import time from datetime import timedelta from collections import Counter import sqlite3 from time import sleep import json import random conn = sqlite3.connect('sqlite.db') c = conn.cursor() a...
lloyd3126/behavior_analysis
xapi_crawler_sqlite.py
xapi_crawler_sqlite.py
py
6,721
python
en
code
0
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 70, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 73, "usage_type": "call" }, { "api_name": "requests.get", "line_...
22632627479
from bs4 import BeautifulSoup import requests import pandas as pd from random import randint import re import spotipy from spotipy.oauth2 import SpotifyClientCredentials from random import randint from time import sleep from sklearn import datasets # K-means import numpy as np import matplotlib.pyplot as plt from sklea...
Javianalista/music_project
asking.py
asking.py
py
7,577
python
en
code
0
github-code
18
[ { "api_name": "re.findall", "line_number": 29, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 30, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 77, "usage_type": "call" }, { "api_name": "random.randint", "line_numbe...
14330257210
import open3d as op3d, numpy as np, logging from scipy.io import loadmat from scipy.spatial import KDTree from typing import Union, Tuple, List from pathlib import Path from frontalization.mesh import Mesh from utils_mesh import MeshOperator, create_sphere_mesh path_bfm_model = Path('../BFM/01_MorphableModel.mat') p...
Mikhail-Klochkov/Deep3dFaceRecognitionMod
frontalization/basel_face_model_2009.py
basel_face_model_2009.py
py
13,896
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_numbe...
11706630100
import re from collections import OrderedDict from rest_framework import serializers from rest_framework.relations import Hyperlink, PKOnlyObject from drf_img_crop.serializers import ImageCreateSerializer from core.models import Profile from core.api.serializers import ProfileDetailSerializer, ProfileListSerializer ...
esaburruss/djangular-blog
backend/src/content/api/serializers.py
serializers.py
py
6,778
python
en
code
0
github-code
18
[ { "api_name": "validators.TitleValidator", "line_number": 58, "usage_type": "call" }, { "api_name": "drf_hateoas.serializers.HateoasSerializer", "line_number": 62, "usage_type": "name" }, { "api_name": "drf_hateoas.serializers.HateoasSerializer", "line_number": 67, "usage...
71491361320
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1' import pandas as pd import numpy as np import matplotlib.pyplot as plt from keras.models import Sequential from keras.layers import Dense, LSTM from keras.optimizers import SGD from keras.utils import to_categorical from keras.callbacks import EarlyStopping from kera...
BayleeDevers/Introduction-to-Artificial-Intelligence
lstm_clf_model.py
lstm_clf_model.py
py
3,381
python
en
code
0
github-code
18
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "preprocessing.full_pipeline.fit_transform", "line_number": 21, "usage_type": "call" }, { "api_name...
22885853150
import re import nltk from nltk import word_tokenize, TreebankWordDetokenizer from nltk.corpus import stopwords #nltk.download() def extract_line_contains(data: str) -> str: return "" def remove_unwanted_characters(text: str) -> str: cleanTxt = text.replace("_", "") cleanTxt = cleanTxt.replace("-", "") ...
ahmedrafed99/paymentReceiptReader
text_processor.py
text_processor.py
py
1,290
python
en
code
0
github-code
18
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 29, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 29, "usage_type": "name" }, { "api_name": "re.findall", "line_number": 32, "usage_type": "call" }, { "api_name": "nltk.Tre...
35142797881
import os import utils import re scans = utils.read_file(os.getcwd() + "\\input.txt") def parse_input(scans): map = {} for y, line in enumerate(scans[:-2]): for x, char in enumerate(line): if char != " ": map[x, y] = char instructions = [] current_num = "" for...
Biboulet/AdventOfCode
2022/Exercice/22/exerice.py
exerice.py
py
2,402
python
en
code
0
github-code
18
[ { "api_name": "utils.read_file", "line_number": 5, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 5, "usage_type": "call" } ]
74657071081
from santaspkg.cost_function import reference_cost_function from santaspkg.dataset import sample_submission from pathlib import Path submission_template = sample_submission.copy(deep=True) submissions_dir = Path(__file__).parent.parent / 'submissions' submissions_dir.mkdir(exist_ok=True) def mk_submit(assignment...
JEHoctor/Kaggle-Santas-Workshop-Tour-2019
santaspkg/mk_submit.py
mk_submit.py
py
529
python
en
code
1
github-code
18
[ { "api_name": "santaspkg.dataset.sample_submission.copy", "line_number": 7, "usage_type": "call" }, { "api_name": "santaspkg.dataset.sample_submission", "line_number": 7, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" }, ...
71426920360
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/...
aorursy/new-nb-3
greenarrow2018_santander-value-prediction-challenge.py
greenarrow2018_santander-value-prediction-challenge.py
py
10,119
python
en
code
0
github-code
18
[ { "api_name": "os.walk", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number"...
15233752890
''' tree sum Write a function, tree_sum, that takes in the root of a binary tree that contains number values. The function should return the total sum of all values in the tree. test_00: a = Node(3) b = Node(11) c = Node(4) d = Node(4) e = Node(-2) f = Node(1) a.left = b a.right = c b.left = d b.right = e c.right = ...
VictorHeDev/structy
module4/tree_sum.py
tree_sum.py
py
1,309
python
en
code
1
github-code
18
[ { "api_name": "collections.deque", "line_number": 81, "usage_type": "call" } ]
4000033034
import re import gast from tensorflow.python.autograph.pyct import anno from tensorflow.python.autograph.pyct import origin_info from tensorflow.python.autograph.pyct import parser from tensorflow.python.autograph.pyct import transformer from tensorflow.python.platform import test class TransformerTest(test.TestCase...
tensorflow/tensorflow
tensorflow/python/autograph/pyct/transformer_test.py
transformer_test.py
py
10,582
python
en
code
178,918
github-code
18
[ { "api_name": "tensorflow.python.platform.test.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "tensorflow.python.platform.test", "line_number": 11, "usage_type": "name" }, { "api_name": "tensorflow.python.autograph.pyct.transformer.EntityInfo", "line...
21560982496
'''Train CIFAR10 with PyTorch.''' import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.backends.cudnn as cudnn import torchvision import torchvision.transforms as transforms import os import argparse from models import * from utils import progress_bar parser...
nisargshah1999/Adversarial-attacks
adversarial_training.py
adversarial_training.py
py
7,861
python
en
code
2
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 32, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 32, "usage_type": "attribute" }, { "api_name": "torch...
4404011857
import requests import json # id = input("Enter student id: ") # URL = "http://127.0.0.1:8000/stuinfo/"+id # r = requests.get(url = URL) # print(r.json()) URL = "http://127.0.0.1:8000/stucreate/" data = { 'name': 'kfjlsadkjf', 'roll': 1983, 'city': 'jamalpur' } json_data = json.dumps(data) r = requests.post(url =...
mdimranh/django_rest_framework
myapp.py
myapp.py
py
372
python
en
code
0
github-code
18
[ { "api_name": "json.dumps", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 17, "usage_type": "call" } ]
13669996616
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ lines_bars_and_markers/using_span_where.py Matplotlib > Gallery > Lines, bars and markers > Using span_where https://matplotlib.org/gallery/lines_bars_and_markers/span_regions.html#using-span-where """ import numpy as np import matplotlib.pyplot as plt import matplot...
aimldl/python
matplotlib/gallery/lines_bars_and_markers/using_span_where.py
using_span_where.py
py
1,065
python
en
code
0
github-code
18
[ { "api_name": "numpy.arange", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 15, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.subplots", ...
20077399077
import pytest from sqlite_utils.utils import column_affinity EXAMPLES = [ # Examples from https://www.sqlite.org/datatype3.html#affinity_name_examples ("INT", int), ("INTEGER", int), ("TINYINT", int), ("SMALLINT", int), ("MEDIUMINT", int), ("BIGINT", int), ("UNSIGNED BIG INT", int), ...
simonw/sqlite-utils
tests/test_column_affinity.py
test_column_affinity.py
py
1,285
python
en
code
1,356
github-code
18
[ { "api_name": "sqlite_utils.utils.column_affinity", "line_number": 39, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 37, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 37, "usage_type": "attribute" }, { "api_n...
72116392039
from reportlab.lib.units import inch, cm, pica class Length: def __init__(self, size, unit): self.size = size if unit in ['inch', 'in']: self.unit = 'in' self._scale = inch elif unit in ['cm', 'mm']: self.unit = 'cm' self._scale = cm ...
margotphoenix/curly-brackets
curlybrackets/pdf/pages.py
pages.py
py
1,339
python
en
code
8
github-code
18
[ { "api_name": "reportlab.lib.units.inch", "line_number": 11, "usage_type": "name" }, { "api_name": "reportlab.lib.units.cm", "line_number": 14, "usage_type": "name" }, { "api_name": "reportlab.lib.units.pica", "line_number": 19, "usage_type": "name" } ]
37082470796
import logging import sys class StreamToLogger(object): """ Fake file-like stream object that redirects writes to a logger instance. """ def __init__(self, logger, default_output, log_level=logging.INFO, only_on_error=True): self.logger = logger self.log_level = log_level self...
fx-kirin/py-stdlogging
stdlogging.py
stdlogging.py
py
1,322
python
en
code
5
github-code
18
[ { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 32, "usage_type": "attribute" }, { "api_name": "logging.ERROR", "line_number": 32, "usage_type": "attribute" }, { "api_name": "logging.getLog...
20255382925
from torch import nn import torch class Encoder(nn.Module): def __init__(self, num_channel=3, num_feature=64, latent_dim=100, data_parallel=True): super(Encoder, self).__init__() features = nn.Sequential( # input is (num_channel) x 64 x 64 nn.Conv2d(num_channel, num_feature...
FengHZ/VAEGAN
model/encoder.py
encoder.py
py
2,417
python
en
code
2
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
27264629851
import sys import requests import json from django.core.mail import EmailMultiAlternatives from django.template import RequestContext, TemplateDoesNotExist from django.template.loader import render_to_string from django.conf import settings def send_mail(subject, email_template_name, context, to_email,...
ashaffir/dnd_sos
dndsos/templates/dndsos/utils.py
utils.py
py
2,390
python
en
code
0
github-code
18
[ { "api_name": "django.template.RequestContext", "line_number": 27, "usage_type": "call" }, { "api_name": "django.conf.settings", "line_number": 36, "usage_type": "argument" }, { "api_name": "django.template.loader.render_to_string", "line_number": 38, "usage_type": "call"...
1417396317
from typing import Iterable import pygame import math from objects import Ball from player import Player SCREEN_X = 1920 SCREEN_Y = 1080 WALL_HEIGHT = 25000 TILE_SIZE = 60 QUALITY1 = TILE_SIZE / 16 QUALITY2 = TILE_SIZE / 256 FOV_MULTIP = 1 REACH = TILE_SIZE / 1 """ class Player: rect: pygame.Rect def d...
en0/TsHomework
T's-raycaster/main.py
main.py
py
12,080
python
en
code
0
github-code
18
[ { "api_name": "typing.Iterable", "line_number": 82, "usage_type": "name" }, { "api_name": "math.floor", "line_number": 91, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 92, "usage_type": "call" }, { "api_name": "pygame.Surface", "line_numb...
17781831087
import cv2 import omegaconf import numpy as np import tensorflow as tf import tensorflow.keras as tfk from imgaug import augmenters as iaa from tensorflow.keras.utils import Sequence from typing import List class DataGenerator(Sequence): def __init__(self, paths: List, labels: List, steps: int):...
azin536/driver-drowsiness
src/data_pipeline.py
data_pipeline.py
py
2,359
python
en
code
0
github-code
18
[ { "api_name": "tensorflow.keras.utils.Sequence", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.asarray...
13524376160
from flask import current_app as app class Current_Balance: def __init__(self, balance): self.balance = balance class Balance: def __init__(self, trans_id, trans_date, trans_ts, user_id, trans, trans_description, balance): self.trans_id = trans_id self.trans_date = trans_date ...
linzhao0351/Mini-Amazon
app/models/balance.py
balance.py
py
2,243
python
en
code
0
github-code
18
[ { "api_name": "flask.current_app.db.execute", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.current_app.db", "line_number": 20, "usage_type": "attribute" }, { "api_name": "flask.current_app", "line_number": 20, "usage_type": "name" }, { "api_name...
21721206972
import torch import torch.nn as nn from torch.distributions.categorical import Categorical import numpy as np class GFN(nn.Module): def __init__(self, m, learn_Z=False, architecture=None, h=None): """ :param architecture: nn.Module with input layer of size m and output layer of size m+1 :p...
GFNOrg/Dropout-Posterior-GFN
gfn.py
gfn.py
py
6,421
python
en
code
3
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
39728413901
""" WORKER MODULE - This module contains our inbuilt Workers and the base Worker. All Workers inherit the Worker base class. Users wanting to create their own custom Worker, should inherit from Worker. For detailed information on Workers, please see our Readme on our Github. https://github.com/R...
RTMAAI/CO600-Musical-Analysis
rtmaii/worker.py
worker.py
py
10,847
python
en
code
2
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 23, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 35, "usage_type": "call" }, { "api_name": "thr...
72782989481
import pygame import pymunk as physics class WaterParticle(object): def __init__(self, world, x, y, vx, vy): self.radius = 4 self.max_force = 8 self.force = self.max_force speed = 2000 self.world = world self._mark_for_dea...
fathat/bregma
source/water_particle.py
water_particle.py
py
2,691
python
en
code
0
github-code
18
[ { "api_name": "pymunk.moment_for_circle", "line_number": 28, "usage_type": "call" }, { "api_name": "pymunk.Body", "line_number": 29, "usage_type": "call" }, { "api_name": "pymunk.Circle", "line_number": 31, "usage_type": "call" }, { "api_name": "pygame.draw.circle...
35226973355
from random import randint import sqlite3 class BankingDatabase: db_file = '../card.s3db' sql_create_card_table = """CREATE TABLE IF NOT EXISTS card ( id INTEGER PRIMARY KEY AUTOINCREMENT , number TEXT NOT NULL , pin TEXT ...
data-anna/simple_banking_system
banking/banking.py
banking.py
py
8,151
python
en
code
0
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlite3.Error", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sqlite3.Error", "line_number": 38, "usage_type": "attribute" }, { "api_name": "sqlite3.Integri...
26517119195
import operator import time from typing import Dict, List, Optional from acme import core from acme.tf import losses from acme.tf import networks from acme.tf import savers as tf2_savers from acme.tf import utils as tf2_utils from acme.utils import counting from acme.utils import loggers import numpy as np import reve...
deepmind/acme
acme/agents/tf/crr/recurrent_learning.py
recurrent_learning.py
py
17,344
python
en
code
3,100
github-code
18
[ { "api_name": "acme.core.Learner", "line_number": 19, "usage_type": "attribute" }, { "api_name": "acme.core", "line_number": 19, "usage_type": "name" }, { "api_name": "sonnet.RNNCore", "line_number": 27, "usage_type": "attribute" }, { "api_name": "acme.tf.networks...
12605466869
from aiogram import Bot,Dispatcher,executor,types from config import API_TOKEN import logging from buttons import natija,natijaa logging.basicConfig(level=logging.INFO) bot=Bot(token=API_TOKEN) dp=Dispatcher(bot) @dp.message_handler(commands=['start']) async def start(message: types.Message): ism = message.from...
fayzulloh11/fayzulloh
main.py
main.py
py
1,044
python
en
code
0
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 6, "usage_type": "attribute" }, { "api_name": "aiogram.Bot", "line_number": 8, "usage_type": "call" }, { "api_name": "config.API_TOKEN", ...
17689295011
from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http.request import Request from test_scrapy.items import TestScrapyItem class WoblogSpider(BaseSpider): name = "woblog" allowed_domains = ["tetsuwo.tumblr.com"] start_urls = ["http://tetsuwo.tumblr.com"] de...
tetsuwo/test-scrapy
test_scrapy/spiders/WoblogSpider.py
WoblogSpider.py
py
1,050
python
en
code
0
github-code
18
[ { "api_name": "scrapy.spider.BaseSpider", "line_number": 6, "usage_type": "name" }, { "api_name": "scrapy.selector.HtmlXPathSelector", "line_number": 12, "usage_type": "call" }, { "api_name": "scrapy.http.request.Request", "line_number": 16, "usage_type": "call" }, { ...