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
5806628875
# -*- coding: utf-8 -*- import config import telebot from room import Room from functools import partial from random import shuffle bot = telebot.TeleBot(config.token) imagi_room = Room @bot.message_handler(commands=['start']) def start(message): # kb = telebot.types.ReplyKeyboardMarkup(resize_keyboard=True, on...
pirr/imagination_bot
bot.py
bot.py
py
5,306
python
en
code
0
github-code
1
[ { "api_name": "telebot.TeleBot", "line_number": 9, "usage_type": "call" }, { "api_name": "config.token", "line_number": 9, "usage_type": "attribute" }, { "api_name": "room.Room", "line_number": 10, "usage_type": "name" }, { "api_name": "functools.partial", "li...
1020282111
import glob import pandas as pd import seaborn as sns import matplotlib.pyplot as plt def plot_figure(data, x, y, filename, figsize=(24, 9), log_scale=False): sns.set(font_scale=1.5) plt.style.use("seaborn-poster") fig, ax = plt.subplots(figsize=figsize, dpi=300) g = sns.barplot(x=x, y=y, hue="Meth...
dmitrisaberi/bndads
bandits/scripts/plot_results.py
plot_results.py
py
5,119
python
en
code
0
github-code
1
[ { "api_name": "seaborn.set", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style.use", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 8, "usage_type": "attribute" }, { "api_name": "mat...
15564210957
import numpy as np import lime from lime.io import _LOG_EXPORT_DICT # Outputs file_address = 'manga_spaxel.txt' cube_plot_address = 'cube_manga_plot.png' spectrum_plot_address = 'spectrum_manga_spaxel.png' line_plot_address = 'Fe3_4658A_manga_spaxel.png' line_bands_file = f'manga_line_bands.txt' lines_log_file = f'man...
Vital-Fernandez/lime
tests/data_tests/check_saved_values.py
check_saved_values.py
py
3,070
python
en
code
9
github-code
1
[ { "api_name": "numpy.loadtxt", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.isnan", "line_number": 15, "usage_type": "call" }, { "api_name": "lime.load_cfg", "line_number": 21, "usage_type": "call" }, { "api_name": "lime.Spectrum", "line_num...
15925042278
import curses import io import time from rich.console import Console from rich.table import Table from rich.text import Text from rich import box def main(): # initialize curses screen = curses.initscr() curses.noecho() # turn off key echoing curses.cbreak() # respond to keys immediately (don't wait ...
townsag/terminal_2048
curses_test.py
curses_test.py
py
2,994
python
en
code
0
github-code
1
[ { "api_name": "curses.initscr", "line_number": 13, "usage_type": "call" }, { "api_name": "curses.noecho", "line_number": 14, "usage_type": "call" }, { "api_name": "curses.cbreak", "line_number": 15, "usage_type": "call" }, { "api_name": "rich.console.Console", ...
43009584424
import random from typing import List, Dict """ This file can be a nice home for your move logic, and to write helper functions. We have started this for you, with a function to help remove the 'neck' direction from the list of possible moves! """ def avoid_my_neck(my_head: Dict[str, int], my_body: List[di...
CaribbeanCool/BattleSnake-Fall-2021
project3(server_logic).py
project3(server_logic).py
py
7,876
python
en
code
0
github-code
1
[ { "api_name": "typing.Dict", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 48, "usage_type": "name" }, { "api_name": "typing.List", "line_number": ...
674848454
from typing import Optional, Union import cv2 import numpy as np from sklearn.cluster import KMeans def postprocess(image: np.ndarray, threshold: Optional[Union[str, int]] = None) -> np.ndarray: """Apply postprocessing on alpha prediction to make it appear better. Currently, the postprocessing steps are thre...
maibrahim2016/background_removal
src/postprocessing.py
postprocessing.py
py
1,783
python
en
code
0
github-code
1
[ { "api_name": "numpy.ndarray", "line_number": 8, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 8, "usage_type": "name" }, { "api_name": "sklearn.cluster.KMeans",...
8691452126
# -*- coding: utf-8 -*- """ Created on Sun Sep 6 08:37:49 2020 @author: USER """ import json import numpy as np f = open("C:\Ripplage\価格データ.json", "r") data = json.load(f) #dataは1時間足のロー測データ5999個分 #移動平均、BBの計算期間 term=20 #スクイーズを定義する期間 squeeze_term=15 #ARを取得する期間 average_range_term=5 #最小標準偏差がで...
jumpei7771/githubcodes
bb_btc.1.1.py
bb_btc.1.1.py
py
8,436
python
en
code
0
github-code
1
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.std", "line_number": 41, "usage_type": "call" } ]
6714140725
# -*- coding: utf-8 -*- # @Author: solicucu import sys sys.path.append('..') import os import argparse import logging import time import openpyxl as xl import torch import torch.nn as nn from config import cfg from torch.backends import cudnn from utils import setup_logger, R1_mAP from data import make_data_l...
solicucu/ReID
FasterReID/main/train.py
train.py
py
8,054
python
en
code
8
github-code
1
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 50, "usage_type": "call" }, { "api_name": "argparse.REMAINDE...
28459530367
from typing import Iterable from autowsgr.constants.image_templates import IMG from autowsgr.constants.positions import FLEET_POSITION from autowsgr.controller.run_timer import Timer from autowsgr.game.game_operation import MoveTeam from autowsgr.ocr.ship_name import recognize_ship from autowsgr.utils.api_image import...
huan-yp/Auto-WSGR
autowsgr/port/ship.py
ship.py
py
6,025
python
en
code
40
github-code
1
[ { "api_name": "autowsgr.controller.run_timer.Timer", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.Iterable", "line_number": 42, "usage_type": "name" }, { "api_name": "autowsgr.constants.image_templates.IMG.identify_images", "line_number": 56, "usage_ty...
288021247
from django.db import models class CRUDManager(models.Manager): def update_product(self, data, pk): product = self.get(pk=pk) product.name = data['name'] product.brand = data['brand'] product.description = data['description'] product.price = data['price'] product....
izzat1998/indicator
product/managers.py
managers.py
py
382
python
en
code
0
github-code
1
[ { "api_name": "django.db.models.Manager", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" } ]
34215818225
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse import markdown, pygments from comments.forms import CommentForm from .models import Post, Category def index(request): ''' 首页 ''' post_list = Post.objects.all() return render(request, 'blog/index.html', ...
huiiiuh/blogproject
blog/views.py
views.py
py
1,708
python
en
code
1
github-code
1
[ { "api_name": "models.Post.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 14, "usage_type": "name" }, { "api_name": "django.s...
11163059093
from collections import deque def solution(land): land = deque(land) while len(land)>1: tmp=land.popleft() for i in range(4): tmp1=[] for j in range(4): if i==j: continue else: tmp1.append(land[0][i]+...
ahrtz/study
코로나 기간 알고/프로그래머스/땅따먹기.py
땅따먹기.py
py
469
python
en
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 3, "usage_type": "call" } ]
19240445837
import time import numpy as np import numpy.matlib as matlib from scipy.optimize import dual_annealing class maxpro_design: def __init__(self): self.s = 2.0 self.n = 8 self.p = 2 self.random_seed = np.random.RandomState(100) self.no_local_search = True self.L_BFGS_B_...
yonghoonlee/pyMaxPro_lite
pymaxpro_lite/maxpro.py
maxpro.py
py
1,783
python
en
code
1
github-code
1
[ { "api_name": "numpy.random.RandomState", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.prod", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.abs", ...
16693613018
import urlparse import ujson as json import sys import time import itertools import getopt from shutil import copyfile import boto import warc from boto.s3.key import Key from gzip import GzipFile from mrjob.job import MRJob from mrjob.launch import _READ_ARGS_FROM_SYS_ARGV from mrjob.step import MRS...
hungtran1/PageRanking
linkgraph.py
linkgraph.py
py
3,019
python
en
code
0
github-code
1
[ { "api_name": "mrjob.job.MRJob", "line_number": 20, "usage_type": "name" }, { "api_name": "mrjob.protocol.RawValueProtocol", "line_number": 22, "usage_type": "name" }, { "api_name": "boto.connect_s3", "line_number": 29, "usage_type": "call" }, { "api_name": "boto....
30413465665
import os import boto3 import subprocess import threading from flask import request class Videofunc: def __init__(self): self.local = os.path.dirname(__file__) self.dir = os.path.dirname(self.local) self.strlocal = self.dir + "/videostreaming/downloadedvideo.mp4" self.s3c = boto3.c...
JunHaSonh0409/accident_handling_Blackbox
jgb/videocode/video_func.py
video_func.py
py
3,731
python
en
code
0
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
19234890989
from scipy.stats import kstest from create_plots import * def plot_power(raw_df,dir,name): for d in [1]: df = raw_df.sort_values(['alp']) # for alp in [0.00, 0.02, 0.04, 0.06, 0.08, 0.10]: for n in [1000,5000,10000]: subset_3 = df[df['n']==n] a,b,e = calc_error_bars...
MrHuff/kgformula
power_comparison_baseline_categorical.py
power_comparison_baseline_categorical.py
py
1,983
python
en
code
0
github-code
1
[ { "api_name": "scipy.stats.kstest", "line_number": 45, "usage_type": "call" } ]
36070263880
from aiogram import Router, F, Bot from aiogram.filters import Command from aiogram.types import Message, ReplyKeyboardRemove from aiogram.fsm.context import FSMContext from aiogram.fsm.state import StatesGroup, State from filters.user_admin import UserAdminFilter from filters.custom import bot_is_admin from keyboard...
bakanchev/bot_channel_helper
handlers/set_channels.py
set_channels.py
py
7,544
python
ru
code
0
github-code
1
[ { "api_name": "aiogram.Router", "line_number": 18, "usage_type": "call" }, { "api_name": "database.Database", "line_number": 20, "usage_type": "call" }, { "api_name": "aiogram.fsm.state.StatesGroup", "line_number": 23, "usage_type": "name" }, { "api_name": "aiogra...
41862226624
import json from nextcord.ext import commands import discordlists with open('config.txt') as f: config = [g.strip('\r\n ') for g in f.readlines()] class DiscordListsPost(commands.Cog): def __init__(self, bot): self.bot = bot self.api = discordlists.Client(self.bot) # Create a Client instan...
HexCodeFFF/discordlists.py
tests/post.py
post.py
py
1,380
python
en
code
0
github-code
1
[ { "api_name": "nextcord.ext.commands.Cog", "line_number": 11, "usage_type": "attribute" }, { "api_name": "nextcord.ext.commands", "line_number": 11, "usage_type": "name" }, { "api_name": "discordlists.Client", "line_number": 14, "usage_type": "call" }, { "api_name...
31992355781
#! /usr/bin/python3 import tabulate from ctypes import * from pye3datapath.e3client import clib from pye3datapath.e3client import api_call_exception from pye3datapath.e3client import api_return_exception from pye3datapath.e3client import register_service_endpoint ''' enum node_type{ node_type_misc=0, node_type_...
chillancezen/DEPRECATED-e3datapath
e3api_export/pye3datapath/infra/node.py
node.py
py
3,572
python
en
code
1
github-code
1
[ { "api_name": "pye3datapath.e3client.clib.infra_api_get_node", "line_number": 73, "usage_type": "call" }, { "api_name": "pye3datapath.e3client.clib", "line_number": 73, "usage_type": "name" }, { "api_name": "pye3datapath.e3client.api_call_exception", "line_number": 75, "u...
9857093608
#!/usr/bin/env python3 '''video dsp fice read''' #人脸识别器官 def fice_read(img): gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) #将图片你转化为灰色 # OpenCV人脸识别分类器 classifier = cv2.CascadeClassifier( r"/Users/yefeng/Desktop/python-test/ficedriver/haarcascade_frontalface_default.xml" #\u是转义字符 所以前面要加r 不然会识别不到文件位置 ) colo...
isyefeng/python-test
ficedriver/opencv/video_fice_read.py
video_fice_read.py
py
1,129
python
zh
code
1
github-code
1
[ { "api_name": "cv2.VideoCapture", "line_number": 30, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 35, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "line_number": 38, "usage_type": "call" } ]
2851930186
import eel import random @eel.expose def start_game(): global game_word game_word = list(random.choice(["roman", "itsafe", "hacking", "cyber", "python"])) for data in range(len(game_word)): game_state.append("_") print (game_word) @eel.expose def guess_character(character): global tries ...
tomergilor/tomergilor
Python course - IT Safe/day6/guess_the_word/app.py
app.py
py
781
python
en
code
0
github-code
1
[ { "api_name": "random.choice", "line_number": 7, "usage_type": "call" }, { "api_name": "eel.expose", "line_number": 4, "usage_type": "attribute" }, { "api_name": "eel.expose", "line_number": 13, "usage_type": "attribute" }, { "api_name": "eel.init", "line_numb...
25209483126
import json import numpy as np import datetime import pandas as pd from flask import Flask, request from pymongo import MongoClient ''' run localhost:5000 ''' app = Flask(__name__) myclient = MongoClient("mongodb://localhost:27017/") # DOCKER-COMPOSE # = MongoClient( # os.environ['DB_PORT_27017_TCP_ADDR'], # 27017) ...
MPiorunn/Master-Thesis
Master/WebApp.py
WebApp.py
py
2,487
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request.json", "line_number": 25, "usage_type": "attribute" }, { "api_name": "flask.request...
70801657313
#!/usr/bin/env python3 import logging import os from broadcaster import Broadcaster from common.heartbeat_sender import HeartbeatSender def parse_config_params(): config_params = {} try: config_params["row_queue"] = os.environ["ROW_QUEUE"] config_params["queues_to_send"] = os.environ["QUEUES_T...
chortas/7574-TP4
broadcaster/main.py
main.py
py
1,295
python
en
code
1
github-code
1
[ { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "common.heartbeat_send...
71405998434
#!/usr/bin/env python """ MachineLog Docstring The Machine Log class logs the input/output data from the Turing Machine.. """ import math import copy import pandas as pd from typing import List from lib.controllers.IOPair import IOPair __author__ = "Dylan Pozorski" __project__ = "TuringMachine" __class__ = "Machi...
dpozorski/TuringMachine
lib/data/log/MachineLog.py
MachineLog.py
py
3,097
python
en
code
0
github-code
1
[ { "api_name": "typing.List", "line_number": 34, "usage_type": "name" }, { "api_name": "lib.controllers.IOPair.IOPair", "line_number": 34, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 59, "usage_type": "call" }, { "api_name": "lib.controlle...
20485557893
from PIL import Image import torch from torch.utils import data from torchvision import transforms device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") class ImageTransform(): def __init__(self, resize, mean, std): self.data_transform = { 'train': transforms.Compose([ ...
Jeong-Labo/katsurayama_classificate
vgg16/create_dataset.py
create_dataset.py
py
2,578
python
ja
code
0
github-code
1
[ { "api_name": "torch.device", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torchvision.transfo...
31511284164
from pathlib import Path numbers = [int(l.strip()) for l in open(Path(__file__).resolve().parent / 'input.txt')] def move(l,i,d): j = (i+d)%(len(l)-1) tmp = l[:i] + l[i+1:] return tmp[:j] + [l[i]] + tmp[j:] def mixing(numbers,times=1): result = numbers for _ in range(times): for n,i in numbers: j...
andiwand/adventofcode
2022/day20/solution.py
solution.py
py
716
python
en
code
1
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 3, "usage_type": "call" } ]
7517821187
import sys from PyQt5.uic import loadUi from PyQt5 import QtWidgets from PyQt5.QtWidgets import QDialog, QApplication, QMainWindow, QFileDialog import json from PyQt5 import QtGui class MainWindow(QMainWindow): def __init__(self): super(MainWindow, self).__init__() path = r'C:\\Users\ASUS\labs\EO\e...
YelizavetaP/EOlabs2022
Project/main.py
main.py
py
5,258
python
en
code
0
github-code
1
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5.uic.loadUi", "line_number": 12, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QTableWidgetItem", "line_number": 30, "usage_type": "call" }, { "api_...
28570613993
"""Create a food log file for each client Create an exercise log file for each client. Ask the user whether they want to log or retrieve client data. Write a function that takes the user input of the client's name. After the client's name is entered, it will display a message as "What you want to log- Diet or Exerci...
mannu776/pyhtonproject
main_pro.py
main_pro.py
py
2,093
python
en
code
0
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" } ]
15161754778
# Import relevant packages import base64 import requests import pandas as pd import numpy as np import json from pandas import json_normalize import schedule import time from datetime import date import os # store private authentication key from environment files key = str(os.environ.get('fantasyPoolApiKey')) # once ...
JordanFortney/fantasyHockeyPool
eodApiPullFantasyHockeyPool.py
eodApiPullFantasyHockeyPool.py
py
4,174
python
en
code
5
github-code
1
[ { "api_name": "os.environ.get", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "base64.b64encode", "l...
26716641606
import math import torch import torch.nn as nn from . import lovasz_losses from torch.nn.modules.loss import _WeightedLoss import torch.nn.functional as F class SmoothCrossEntropyLoss(_WeightedLoss): # https://stackoverflow.com/questions/55681502/label-smoothing-in-pytorch def __init__(self, weight=None, reduc...
tattaka/ukiyoe
src/utils/losses.py
losses.py
py
4,995
python
en
code
8
github-code
1
[ { "api_name": "torch.nn.modules.loss._WeightedLoss", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.no_grad", "line_number": 19, "usage_type": "call" }, { "api_name": "to...
16244186470
import matplotlib.pyplot as plt import scipy import numpy as np A = -0.004 B = 1 C = 0.048 kp = 0.607338773069937 ki = 0.00245637321622817 kd = 0 def model(t, x, yd): e = yd - x[0] #feedback e_int = x[1] u = kp * e + ki * e_int if u > 1: u = 1 if u < 0: u = 0...
xalpol12/pid-controller-with-resistor-heating
test.py
test.py
py
999
python
en
code
0
github-code
1
[ { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 23, "usage_type": "name" }, { "api_name": "matplotlib.pyp...
7528142616
from flask import Flask, request, jsonify import requests import os from datetime import datetime, timedelta from pymongo import MongoClient from threading import Thread app = Flask(__name__) date_format = "%Y%m%d" # Format for the date in the URL destination_directory = "storage_1" # Destination directory to save ...
Raja1802/gitblock
download.py
download.py
py
5,497
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 51, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
17914119640
import smtplib import email.message def enviar(): email_escopo = """ <p>email enviado por python</p> """ msg = email.message.Message() msg['Subject'] = "assunto do email" msg['From'] = "usuario@gmail.com" msg['To'] = "usuario@gmail.com" senha = 'senha_do_e...
RafaelBernardo18/python
11-Exemplo/envio_emails.py
envio_emails.py
py
636
python
pt
code
0
github-code
1
[ { "api_name": "email.message.message.Message", "line_number": 10, "usage_type": "call" }, { "api_name": "email.message.message", "line_number": 10, "usage_type": "attribute" }, { "api_name": "email.message", "line_number": 10, "usage_type": "name" }, { "api_name":...
1156692101
from inspect import signature as sig from functools import wraps def typeassert(*ty_args, **ty_kwargs): def decorate(func): if not __debug__: return func fun_sig = sig(func) # 将签名与参数字典绑定 bound_types = fun_sig.bind_partial(*ty_args, **ty_kwargs).arguments @wrap...
wotulong/python-cookbook-note
9_7_typeassert.py
9_7_typeassert.py
py
1,017
python
en
code
0
github-code
1
[ { "api_name": "inspect.signature", "line_number": 10, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 14, "usage_type": "call" } ]
15873614763
import os import shutil import argparse def move_to_processed(file_path): destination = "C:/Users/craig/Google Drive/CaptainsLog/Processed" shutil.move(file_path, destination) if __name__ == '__main__': parser = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawDe...
craig3050/CaptainsLog
Test Modules/move_to_processed.py
move_to_processed.py
py
482
python
en
code
0
github-code
1
[ { "api_name": "shutil.move", "line_number": 8, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "argparse.RawDescriptionHelpFormatter", "line_number": 14, "usage_type": "attribute" } ]
20653306291
from qtpy.QtWidgets import ( QFormLayout, QHBoxLayout, QLineEdit, QPushButton, QVBoxLayout, QWidget, QCheckBox, QComboBox, ) from superqt import QCollapsible class ProjectControl(QWidget): def __init__(self, parent=None): super().__init__() main_layout = QVBoxLayout...
NHPatterson/napari-wsireg
src/napari_wsireg/gui/setup_sub/project.py
project.py
py
2,963
python
en
code
11
github-code
1
[ { "api_name": "qtpy.QtWidgets.QWidget", "line_number": 14, "usage_type": "name" }, { "api_name": "qtpy.QtWidgets.QVBoxLayout", "line_number": 17, "usage_type": "call" }, { "api_name": "qtpy.QtWidgets.QFormLayout", "line_number": 20, "usage_type": "call" }, { "api_...
23406486493
# Libraries import numpy import scipy import sklearn import pandas import matplotlib # Visualization from pandas.tools.plotting import scatter_matrix import matplotlib.pyplot as plt # Metrics from sklearn import model_selection from sklearn.metrics import classification_report from sklearn.metrics import confusion_matr...
thesamchris/ml-mastery
iris-dataset.py
iris-dataset.py
py
2,771
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 54, "usage_type": "call" }, { "api_name": "sklearn.model_selection", "line_number": 54, "usage_type": "name" }, { "...
27915418590
import datetime import sys from time import time from typing import List from highlighter.utils.load import DataSetLoader, VideoChatsData from highlighter.utils.predict import enumerate_fvs_df if "-i" in sys.argv and len(sys.argv) > sys.argv.index("-i") + 1: target = sys.argv[sys.argv.index("-i") + 1] else: t...
MycroftKang/highlighter-core
tools/predict.py
predict.py
py
1,935
python
en
code
1
github-code
1
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.argv.index", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv.index", "line_n...
35806321081
import pandas as pd import os import cv2 import numpy as np from keras.models import load_model import keras_metrics import keras # path = os.getcwd() # parent = os.path.dirname(path) # Base_path = os.path.join(parent , 'Mobilaty\\project\\public') execution_path = os.getcwd() Base_path=os.path.join(execu...
amrfahmy5/Mobilaty-gp-backEnd
project/models/MobileClassfication.py
MobileClassfication.py
py
8,121
python
en
code
0
github-code
1
[ { "api_name": "os.getcwd", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number":...
38329543772
import torch from PIL import Image import torchvision.transforms.functional as TF import torch import torch.nn as nn # image management MEAN = (0.485, 0.456, 0.406) STD = (0.229, 0.224, 0.225) def prep_img(imagename: str, size=None, mean=MEAN, std=STD): """Preprocess image. 1) load as PIl 2) resize ...
arthur-cahu/ranvgg
utils.py
utils.py
py
4,458
python
en
code
0
github-code
1
[ { "api_name": "PIL.Image.open", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 21, "usage_type": "name" }, { "api_name": "torchvision.transforms.functional.resize", "line_number": 24, "usage_type": "call" }, { "api_name": "tor...
4490764262
# 실습 # outlier1 을 행렬형태로 적용할 수 있도록 수정 import numpy as np aaa = np.array([[1,2,3,4,10000,6,7,5000,90,100], [10,20,3,40,50,60,70,8,90,100]]) aaa = aaa.transpose() print(aaa.shape) # (10, 2) def outliers(data_out): data = data_out.transpose() outlier = [] for i in range(data.shape[0]): ...
Taerimmm/ML
ml/m46_2_outliers2.py
m46_2_outliers2.py
py
1,028
python
en
code
3
github-code
1
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.percentile", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_numbe...
20910669439
# -*- coding: utf-8 -*- # this file contains all variables that are set by the user and other configuration options # import libraries import nltk import shutil from pathlib import Path from dataclasses import dataclass from fasttext.util import download_model # Define directories DATA_DIR = Path(__file__).parent.p...
andreeaiana/geneg_benchmarking
src/config.py
config.py
py
4,066
python
en
code
2
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "l...
13485505567
from django.db import models # Create your models here. class StatusCrm(models.Model): Status_name = models.CharField(max_length=200, verbose_name='Название статуса') def __str__(self): return self.Status_name class Meta: verbose_name = 'статус' verbose_name_plural = 'статусы' c...
syrovezhko/platform
crm/models.py
models.py
py
1,753
python
en
code
0
github-code
1
[ { "api_name": "django.db.models.Model", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 5, "usage_type": "call" }, { "api_name": "...
73747256675
from flask import request from flask_restplus import Resource, Namespace, abort, reqparse from rest import api from rest.entities.templates.models import entity_template, entity_template_request from rest.entities.templates.service import EntityTemplateService from rest.common.base_models import response from rest.com...
samshinde/Flask-MVC
entity_mgmt_app/rest/entities/templates/views.py
views.py
py
4,478
python
en
code
0
github-code
1
[ { "api_name": "flask_restplus.Namespace", "line_number": 12, "usage_type": "call" }, { "api_name": "rest.entities.templates.service.EntityTemplateService", "line_number": 14, "usage_type": "call" }, { "api_name": "rest.entity_types.service.EntityTypeService", "line_number": 1...
29019620725
import pytorch3d.loss import pytorch3d.utils import torch import torch.nn as nn import torch.nn.parallel import torch.utils.data from einops import rearrange import numpy as np from Utils.LossCatSim_keyPtsDefor_utils.cages import deform_with_MVC from Utils.LossCatSim_keyPtsDefor_utils.utils import normalize_to_box, ...
Orgnizzz/CLPE
CLPE/Utils/LossCatSim_KeyPtsDefor.py
LossCatSim_KeyPtsDefor.py
py
8,418
python
en
code
0
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 17, "usage_type": "name" }, { "api_name": "einops.rearrange", "line_number": 28, "usage_type": "name" }, { "api_name": "pytorch3d.loss.utils.i...
15534537748
import argparse import pickle import json from copy import deepcopy from src.config import conf # diayn with model-free RL from src.diayn import DIAYN # diayn with evolution stratigies from src.diayn_es import DIAYN_ES # diayn with evolution model-based RL # from src.diayn_mb import DIAYN_MB from src.utils import ...
FaisalAhmed0/SLUSD
src/finetune.py
finetune.py
py
22,907
python
en
code
3
github-code
1
[ { "api_name": "torch.set_num_threads", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.multiprocessing.set_sharing_strategy", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.multiprocessing", "line_number": 19, "usage_type": "attribute" }...
4433340756
#modcom.co.ke/datascience #modcom.co.ke/flask #modcom.co.ke/flask/datascience/banks #modcom.co.ke/bank import pandas as pd df = pd.read_csv("school.csv") #df is the dataframe # print(df) # print(df["StudyTime"]) print(df[["StudyTime", "Gender"]]) #narrow down subset = df[["StudyTime", "Gender"]] #example of...
Manyanky/ML-MODELS
graphs.py
graphs.py
py
3,853
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 53, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 53, "usage_type": "name" }, { "api_name": "matplotli...
23078099282
import requests import traceback import os import SimpleITK as sitk from SimpleITK.utilities.pyside import sitk2qpixmap from SimpleITK.utilities.resize import resize import pandas as pd import numpy as np import inspect from sklearn import metrics import matplotlib.pyplot as plt import tempfile from PySide6.QtWidgets ...
niaid/rap_tb_ntb_service_frontend
tb_ntb_gui.py
tb_ntb_gui.py
py
46,953
python
en
code
1
github-code
1
[ { "api_name": "PySide6.QtWidgets.QFileDialog", "line_number": 41, "usage_type": "name" }, { "api_name": "PySide6.QtWidgets.QFileDialog.DontUseNativeDialog", "line_number": 49, "usage_type": "attribute" }, { "api_name": "PySide6.QtWidgets.QFileDialog", "line_number": 49, "...
26181183663
#!/usr/bin/env python ''' Process file produced by: https://cdcvs.fnal.gov/redmine/projects/dunetpc/wiki/_ProtoDUNE-SP_Wire_Dumps_ Columns: 0) channel :: [0-15359] 1) cryostat :: 0 2) tpc :: [0,11] 3) plane :: [0,2] 4) wire :: [0,1147] 5) wire beg x 6) wire beg y 7) wire beg z 8) wire end x 9) wire end y 10) wire en...
DUNE/protodune-numbers
python/larsoftwires.py
larsoftwires.py
py
5,498
python
en
code
0
github-code
1
[ { "api_name": "collections.namedtuple", "line_number": 30, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 36, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.clf", "line_number": 83, "usage_type": "call" }, { "api_name": "...
10022924118
import datetime import numpy as np from itertools import groupby from skimage import measure from PIL import Image class PycocoCreatorTools: @staticmethod def bbox(img): rows = np.any(img, axis=1) cols = np.any(img, axis=0) rmin, rmax = np.where(rows)[0][[0, -1]] cmin, cmax = n...
lifunudt/blender_based_render
src/utility/Coco/pycococreatortools.py
pycococreatortools.py
py
4,882
python
en
code
1
github-code
1
[ { "api_name": "numpy.any", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.any", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 14, ...
41202240590
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 15 20:03:52 2017 @author: jonbaird Sum square difference Problem 6 The sum of the squares of the first ten natural numbers is, 12 + 22 + ... + 102 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)2 = 552 = 3025 ...
jontrabai/project_euler
project_euler6.py
project_euler6.py
py
1,138
python
en
code
0
github-code
1
[ { "api_name": "tqdm.tqdm", "line_number": 31, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 43, "usage_type": "call" } ]
13439713692
import pandas as pd import sqlalchemy as sa import psycopg2 import config from tweet_analysis_functions import prefilter_tweet engine = sa.create_engine(config.engine ,connect_args={"connect_timeout": 60}) def create_postgres_database(tweet_data_frame_list, tweet_users_frame_list, data_table, users_table): data_...
bdawton/twitter_scraping_labelling
postgres_connection.py
postgres_connection.py
py
1,123
python
en
code
0
github-code
1
[ { "api_name": "sqlalchemy.create_engine", "line_number": 7, "usage_type": "call" }, { "api_name": "config.engine", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "attribute" }, { "api_name": "panda...
25272716860
# import torch # import torchvision #import knockoff.datasets.GTSRB as GTSRB #import knockoff.datasets as datasets # import torch.nn as nn # import pretrainedmodels import caffe import numpy as np import pickle import imageio from PIL import Image from torchvision import transforms transform_gtsrb = transforms.Comp...
chenyanjiao-zju/Defense-Resistant-Backdoor
backdoor/gtsrb/ASR.py
ASR.py
py
3,245
python
en
code
0
github-code
1
[ { "api_name": "torchvision.transforms.Compose", "line_number": 17, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 17, "usage_type": "name" }, { "api_name": "torchvision.transforms.Resize", "line_number": 18, "usage_type": "call" }, { ...
5167662236
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from scipy.stats import norm import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.patches as mpatches import math #Esta funcion representa la matriz de confusion de un modelo mediante la TDS def plot(Pa, Pfa, returnP = False, show = T...
manu-torres/portfolio
projects/tdsPlot.py
tdsPlot.py
py
3,819
python
en
code
0
github-code
1
[ { "api_name": "scipy.stats.norm.ppf", "line_number": 22, "usage_type": "call" }, { "api_name": "scipy.stats.norm", "line_number": 22, "usage_type": "name" }, { "api_name": "scipy.stats.norm.ppf", "line_number": 23, "usage_type": "call" }, { "api_name": "scipy.stat...
22950138673
#!/usr/bin/python3 ######################################################################## # This file is part of the Honeyris project made by the Astar Company: # # https://github.com/astar-security/Honeyris # # The project is published under GPLv3 license # # Author...
astar-security/Honeyris
honeyris.py
honeyris.py
py
7,702
python
en
code
3
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 131, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 132, "usage_type": "attribute" }, { "api_name": "logging.Formatter", "line_number": 133, "usage_type": "call" }, { "api_name": "logging.Stre...
42455767228
import cv2 import pytesseract from PIL import Image import sys import os import pyocr import pyocr.builders import datetime import argparse import unidecode import codecs ap = argparse.ArgumentParser() ap.add_argument("-i", "--image", required=True, help="Path to the image") args = vars(ap.parse_args()) ...
vkit/KYC
img_ocr.py
img_ocr.py
py
1,722
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "attribute" }, { "api_name": "...
33489932488
import importlib import copy import os import re import sys import warnings from collections import OrderedDict import traceback import h5py import numpy as np import deeprank from deeprank.models.variant import PdbVariantSelection from deeprank import config from deeprank.config import logger from deeprank.generate ...
DeepRank/DeepRank-Mut
deeprank/generate/DataGenerator.py
DataGenerator.py
py
64,833
python
en
code
1
github-code
1
[ { "api_name": "deeprank.config.logger.debug", "line_number": 100, "usage_type": "call" }, { "api_name": "deeprank.config.logger", "line_number": 100, "usage_type": "name" }, { "api_name": "deeprank.config.logger.debug", "line_number": 103, "usage_type": "call" }, { ...
40543739437
import math, json import bpy, mathutils # ExportHelper is a helper class, defines filename and # invoke() function which calls the file selector. from bpy_extras.io_utils import ExportHelper from bpy.props import StringProperty, BoolProperty, EnumProperty class TransverseMercator: radius = 6378137 def __ini...
vvoovv/prokitektura-studio
export/geojson.py
geojson.py
py
3,496
python
en
code
2
github-code
1
[ { "api_name": "math.radians", "line_number": 21, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 24, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 25, "usage_type": "call" }, { "api_name": "math.sin", "line_number": ...
17775036057
import sys sys.path.insert(0, './src') # import os # os.getcwd() # os.chdir('./DriverActionEstimators') from importlib import reload import numpy as np np.set_printoptions(suppress=True) import pickle import os def pickle_this(item, data_files_dir, item_name): data_files_dir += '/'+item_name+'.pickle' ...
saArbabi/DriverActionEstimators
src/data/latent_mlp/data_collection.py
data_collection.py
py
3,189
python
en
code
4
github-code
1
[ { "api_name": "sys.path.insert", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "numpy.set_printoptions", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.exists", ...
22554324082
# var.py # # Read the var files. # NB: the f array returned is C-ordered: f[nvar, nz, ny, nx] # NOT Fortran as in Pencil (& IDL): f[nx, ny, nz, nvar] # # Authors: # J. Oishi (joishi@amnh.org) # T. Gastine (tgastine@ast.obs-mip.fr) # S. Candelaresi (iomsn1@gmail.com). """ Contains the read class for the VAR file re...
JosephMouallem/pencil_code
python/pencilnew/read/var.py
var.py
py
17,478
python
en
code
1
github-code
1
[ { "api_name": "sim.__Simulation__", "line_number": 51, "usage_type": "argument" }, { "api_name": "os.path.exists", "line_number": 59, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 59, "usage_type": "call" }, { "api_name": "os.path.exists", ...
29744161462
import jwt from rest_framework import authentication, exceptions from django.conf import settings from django.contrib.auth.models import User from jwt.algorithms import get_default_algorithms class JWTAuthentication(authentication.BaseAuthentication): def authenticate(self, request): auth_data = authenti...
Kigbu/contactListApp
authentication/backends.py
backends.py
py
1,297
python
en
code
0
github-code
1
[ { "api_name": "rest_framework.authentication.BaseAuthentication", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.authentication", "line_number": 8, "usage_type": "name" }, { "api_name": "rest_framework.authentication.get_authorization_header", "l...
12045470381
import pwd import subprocess from datetime import datetime, timedelta import iso8601 # https://bitbucket.org/micktwomey/pyiso8601 from enum import Enum # https://pypi.python.org/pypi/enum34 QuotaType = Enum('block', 'inode') QuotaState = Enum('no_quota', 'under_quota', 'soft_limit', 'hard_limit', 'grace_expired') ...
asciiphil/quotanotify
model.py
model.py
py
10,553
python
en
code
1
github-code
1
[ { "api_name": "enum.Enum", "line_number": 9, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 10, "usage_type": "call" }, { "api_name": "iso8601.parse_date", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "li...
15416613529
from __future__ import print_function import os, math from pyspark.sql import SparkSession # Map 1: extract words from a file # input: file_name # output: (term, doc_name), 1 def map1(doc_name): file = open(doc_name) while True: line = file.readline() if line == '': break ...
dungcao/bigdata
tfidf_spark.py
tfidf_spark.py
py
3,109
python
en
code
1
github-code
1
[ { "api_name": "math.log", "line_number": 84, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 93, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 93, "usage_type": "attribute" }, ...
20246487008
import sys from collections import deque N,M= map(int,sys.stdin.readline().split()) #row,col maps=[] for _ in range(N): a=list(sys.stdin.readline().strip()) maps.append(list(map(int,a))) state=deque() state.append((1,0,0))#cnt,row,col dx=[0,0,1,-1] dy=[1,-1,0,0] while state: d,x,y=state.popleft() fo...
jhan-04/Test
baekjoon/no.2178.py
no.2178.py
py
1,849
python
en
code
0
github-code
1
[ { "api_name": "sys.stdin.readline", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.stdin.readline", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.stdin", "li...
26052410847
from jbi100_app.main import app from jbi100_app.data import Data from jbi100_app.visualizations.map import Map_Visualization from jbi100_app.visualizations.heatmap import HeatMap from jbi100_app.visualizations.stackedareachart import StackedAreaChart from jbi100_app.visualizations.barchart2 import BarChart from jbi10...
dharmsen/jbi100-g35
dashframework-main/app.py
app.py
py
12,701
python
en
code
0
github-code
1
[ { "api_name": "jbi100_app.data.Data", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 30, "usage_type": "call" }, { "api_name": "jbi100_app.visualizations.map.Map_Visualization", "line_number": 42, "usage_type": "call" }, ...
8671312099
import pandas as pd import time import requests from pyquery import PyQuery as pq # 定义一个字母列表 Fam_List = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] # 定义基础网站地址 base_url = 'https://commons.wikimedia.org' # 定义...
SongKunUPC/Art_Image_Spider
Art_Spider.py
Art_Spider.py
py
2,452
python
en
code
0
github-code
1
[ { "api_name": "pandas.DataFrame", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 38, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 48, "usage_type": "call" }, { "api_name": "pyquery.PyQuery", "...
16845175684
import cv2 import numpy as np original = cv2.imread("C:/Users/gkami/Documents/GitHub/ImageComparissonDualCam/test_files/1.jpg") duplicate = cv2.imread("images/duplicate.jpg") def testShow(): cv2.imshow("1", original) cv2.waitKey(0)
Pagos3DGit/ImageComparissonDualCam
Source/ImgComp.py
ImgComp.py
py
245
python
en
code
1
github-code
1
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 10, ...
27170667969
from django.db import models class TgUser(models.Model): tg_id = models.IntegerField() first_name = models.CharField(max_length=64, blank=True, null=True) username = models.CharField(max_length=64, blank=True, null=True) admin = models.BooleanField(blank=True) tz_info = models.CharField(max_length=...
HolidayMan/reminder_bot
bot/models.py
models.py
py
1,416
python
en
code
0
github-code
1
[ { "api_name": "django.db.models.Model", "line_number": 3, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 3, "usage_type": "name" }, { "api_name": "django.db.models.IntegerField", "line_number": 4, "usage_type": "call" }, { "api_name"...
74122169952
import numpy as np from sklearn.metrics import roc_curve, auc from scipy.interpolate import interp1d from scipy.optimize import brentq def calculate_accuracy(threshold, dist, actual_issame): predict_issame = np.less(1-dist, 1-threshold) tp = np.sum(np.logical_and(predict_issame, actual_issame)) fp = np.su...
ChenqiKONG/Detect_and_Locate
utils/metrics_intra.py
metrics_intra.py
py
1,092
python
en
code
6
github-code
1
[ { "api_name": "numpy.less", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.logical_and", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 9,...
23911415558
from subfind_provider_subscene import get_short_lang __author__ = 'hiepsimu' import logging import unittest logging.basicConfig(level=logging.DEBUG) class LangTestCase(unittest.TestCase): def test_01(self): self.assertEqual('vi', get_short_lang('vietnamese')) self.assertEqual('vi', get_short_lan...
thongdong7/subfind
tests/TestLang.py
TestLang.py
py
506
python
en
code
4
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "subfind_p...
7904683532
from Code.Scripts.popularity_calculator import calculate_popularity,freq_of_popularity import xlrd import matplotlib.pyplot as plt file_name = 'D:\\Users\\yashk\\Campaign-Assistant\\Data\\Annotated\\graph_month_input.xls' workbook = xlrd.open_workbook(file_name) sheet = workbook.sheet_by_index(0) rows = sheet.nrows pr...
vr97/finalyearproject2018-19
Code/Scripts/plot_for_month.py
plot_for_month.py
py
1,107
python
en
code
1
github-code
1
[ { "api_name": "xlrd.open_workbook", "line_number": 6, "usage_type": "call" }, { "api_name": "Code.Scripts.popularity_calculator.freq_of_popularity", "line_number": 21, "usage_type": "call" }, { "api_name": "Code.Scripts.popularity_calculator.freq_of_popularity", "line_number"...
26191588756
import http.client # Create a large sample HTTP request with a size larger than 1024 bytes large_request = "GET /example HTTP/1.1\r\n" + ("X" * 1500) # Total size exceeds 1024 bytes # Set up the HTTP connection to your server conn = http.client.HTTPConnection("localhost", 6789) # Replace with your server's host and...
smartlocus/Distributed-Banksystem-Communication
networking/httpclient.py
httpclient.py
py
552
python
en
code
0
github-code
1
[ { "api_name": "http.client.client.HTTPConnection", "line_number": 7, "usage_type": "call" }, { "api_name": "http.client.client", "line_number": 7, "usage_type": "attribute" }, { "api_name": "http.client", "line_number": 7, "usage_type": "name" } ]
13043280148
import pytest import struct import json import os.path from iotile.core.hw.hwmanager import HardwareManager from iotile.core.dev.registry import ComponentRegistry from iotile.core.hw.exceptions import RPCNotFoundError, RPCInvalidArgumentsError from typedargs.exceptions import KeyValueException from iotile.core.hw.virtu...
iotile/coretools
iotilecore/test/test_rpc/test_rpc.py
test_rpc.py
py
2,455
python
en
code
14
github-code
1
[ { "api_name": "iotile.core.dev.registry.ComponentRegistry", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 16, "usage_type": "attribute" }, { "ap...
26940624558
from math import factorial as fact import common as c ''' main block that uses is_strong() to check if its strong number ''' def main() : num = c.read('Enter the number.\n') if is_strong(num) : print(f'{num} is a strong number.') else : print(f'{num} isn\'t a strong number.') # is_strong...
Vi5iON/Cumulation
strong.py
strong.py
py
758
python
en
code
0
github-code
1
[ { "api_name": "common.read", "line_number": 8, "usage_type": "call" }, { "api_name": "common.add", "line_number": 26, "usage_type": "call" }, { "api_name": "math.factorial", "line_number": 26, "usage_type": "call" }, { "api_name": "common.digit_retriver", "lin...
24573682795
from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from meals.models import Meals from order.models import orderDetail # Create your views here. @login_required def add_user_order(request): count_product = int(request.POST.get("count")) product_ID = req...
moeinparvizi/resturan
order/views.py
views.py
py
834
python
en
code
1
github-code
1
[ { "api_name": "meals.models.Meals.objects.filter", "line_number": 16, "usage_type": "call" }, { "api_name": "meals.models.Meals.objects", "line_number": 16, "usage_type": "attribute" }, { "api_name": "meals.models.Meals", "line_number": 16, "usage_type": "name" }, { ...
36598916219
import asyncio import aioconsole import json from abc import abstractmethod from prompt_toolkit import print_formatted_text from prompt_toolkit.formatted_text import FormattedText from monstr.event.event import Event from monstr.encrypt import Keys from monstr.inbox import Inbox from monstr.client.client import Client...
monty888/monstr_terminal
cmd_line/util.py
util.py
py
20,593
python
en
code
14
github-code
1
[ { "api_name": "monstr.client.client.Client", "line_number": 23, "usage_type": "name" }, { "api_name": "monstr.event.event.Event", "line_number": 23, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 22, "usage_type": "name" }, { "api_name"...
3511448246
import os import tensorflow as tf import xlsxwriter from tflite import Model from tflite.BuiltinOperator import BuiltinOperator ignore = { # TF "Placeholder", "Const", "Identity", "Shape", "FIFOQueueV2", "QueueDequeueManyV2", "TensorArrayV3", "Enter", "Merge", "Range", "...
gomida/ParseModels
parse_all.py
parse_all.py
py
3,740
python
en
code
0
github-code
1
[ { "api_name": "tensorflow.GraphDef", "line_number": 99, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 107, "usage_type": "call" }, { "api_name": "os.path", "line_number": 107, "usage_type": "attribute" }, { "api_name": "tflite.Model.Mode...
3797849770
import schedule import vars import time import win32com.client import logging from datetime import datetime from os import environ def run_job(url, start_time, end_time): logging.info('Start job: %s', url) if start_time: t_now = datetime.now() t_start = datetime.strptime(start_time, '%H:%M') ...
Nefritful/HDESKbot
cron.py
cron.py
py
2,305
python
en
code
0
github-code
1
[ { "api_name": "logging.info", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.datetim...
12000961818
# -*- coding: utf-8 -*- """Classes for extinction calculation""" from addict import Dict from copy import deepcopy from ELDAmwl.bases.factory import BaseOperation from ELDAmwl.bases.factory import BaseOperationFactory from ELDAmwl.component.interface import IExtOp from ELDAmwl.component.interface import IMonteCarlo fro...
actris-scc/ELDAmwl
ELDAmwl/extinction/operation.py
operation.py
py
9,736
python
en
code
3
github-code
1
[ { "api_name": "ELDAmwl.bases.factory.BaseOperationFactory", "line_number": 22, "usage_type": "name" }, { "api_name": "ELDAmwl.bases.factory.BaseOperation", "line_number": 67, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 106, "usage_type": "call" ...
10459298523
"""website URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based...
darkus007/DjangoAPIBlog
website/website/urls.py
urls.py
py
2,013
python
en
code
0
github-code
1
[ { "api_name": "drf_yasg.views.get_schema_view", "line_number": 22, "usage_type": "call" }, { "api_name": "drf_yasg.openapi.Info", "line_number": 23, "usage_type": "call" }, { "api_name": "drf_yasg.openapi", "line_number": 23, "usage_type": "name" }, { "api_name": ...
33519016942
from robotide.lib.robot.utils import seq2str from robotide.lib.robot.errors import DataError from .visitor import SuiteVisitor class SuiteConfigurer(SuiteVisitor): def __init__(self, name=None, doc=None, metadata=None, set_tags=None, include_tags=None, exclude_tags=None, include_suites=None, ...
robotframework/RIDE
src/robotide/lib/robot/model/configurer.py
configurer.py
py
2,782
python
en
code
910
github-code
1
[ { "api_name": "visitor.SuiteVisitor", "line_number": 7, "usage_type": "name" }, { "api_name": "robotide.lib.robot.errors.DataError", "line_number": 54, "usage_type": "call" }, { "api_name": "robotide.lib.robot.utils.seq2str", "line_number": 64, "usage_type": "call" }, ...
40419934704
from pathlib import Path import numpy as np import re from collections import defaultdict import re from collections import deque reg = re.compile( r"p=< *(-?\d+), *(-?\d+), *(-?\d+)>, v=< *(-?\d+), *(-?\d+), *(-?\d+)>, a=< *(-?\d+), *(-?\d+), *(-?\d+)>" ) def man_dist(v): return np.sum(np.abs(v)) def vel_cr...
eirikhoe/advent-of-code
2017/20/sol.py
sol.py
py
3,665
python
en
code
0
github-code
1
[ { "api_name": "re.compile", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.sign", "line_number": 16, ...
25283111198
import requests import os import subprocess def download_file(url, local_fname=None, force_write=False): if local_fname is None: local_fname = url.split('/')[-1] if not force_write and os.path.exists(local_fname): return local_fname r = requests.get(url, stream=True) assert r.status_co...
houqi/mxnet
example/image-classification/common/util.py
util.py
py
816
python
en
code
null
github-code
1
[ { "api_name": "os.path.exists", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.check_output", ...
28850425103
# -*- coding: utf-8 -*- from node.test.base_test import BaseTestCase from node.plugins.uptime import Plugin from mock import Mock, patch class UptimeTest(BaseTestCase): def set_up_mock(self, filemock): fs_mock = Mock() filemock.return_value = fs_mock fs_mock.readline.return_value = '344.12...
gperetin/seamon
node/test/plugins/uptime_test.py
uptime_test.py
py
1,023
python
en
code
1
github-code
1
[ { "api_name": "node.test.base_test.BaseTestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "mock.Mock", "line_number": 9, "usage_type": "call" }, { "api_name": "node.plugins.uptime.Plugin.data", "line_number": 12, "usage_type": "call" }, { "api_name...
11000881684
import requests from random import randint class Person: def __init__(self,imya="", falimia="", login="", parol=""): self.__data = requests.get("https://api.randomdatatools.ru/").json() self.__lorem="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris tempor dictum quam, ut tincidunt p...
Viktor228989/python
lesson_26/instclone/klass.py
klass.py
py
1,276
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 16, "usage_type": "call" } ]
20333424939
import serial import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib import style import datetime as dt fig=plt.figure() axl=fig.add_subplot(1,1,1) ser=serial.Serial("COM4",115200) beat=[] avg_beat=[] xs=[] ys=[] y_range=[30,150] def mov_avg (mylist): N = 3 ...
Uzama/Smart-Driver-Drowsiness-Detection
pulse.py
pulse.py
py
2,300
python
en
code
1
github-code
1
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "serial.Serial", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datet...
26346503086
import fcsparser import numpy as np from numpy import genfromtxt from auto_encoder_updated import file_io as io import os.path import sklearn.preprocessing as prep from sklearn.model_selection import train_test_split class Sample: x = None y = None def __init__(self, x, y=None): self.x = x ...
lthp/2019_SingleCell
legacy/auto_encoder_updated/data_hander.py
data_hander.py
py
2,961
python
en
code
1
github-code
1
[ { "api_name": "numpy.log", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 20, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.prep...
26781815105
import datetime import json import os import pandas as pd import twitter def create_twitter_api(): """Check environment and return appropriate twitter API""" # API CREDENTIALS path = "twitter-credentials.json" # if running from local machine if os.path.exists(path): with open(path, "r"...
SamEdwardes/sentiment-cdn-election
src/twitter_data.py
twitter_data.py
py
4,061
python
en
code
0
github-code
1
[ { "api_name": "os.path.exists", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", "line_number":...
37290512441
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from Grid import Grid class GraphicGrid(object): colours = ['b', 'g', 'r', 'c', 'm', 'y', 'k'] colours_redundant = [el + '--' for el in colours] def __init__(self, grid=None, union_find = None, **kwargs): self.grid = grid ...
dj8yfo/union_find_matplotlib
erdesh_renie/graphic_sample.py
graphic_sample.py
py
3,931
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 81, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 81, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.axes", "line_number": 82, "usage_type": "call" }, { "api_name": "mat...
42262730136
#!/usr/bin/python3 # -*- coding: utf-8 -*- # import argparse, subprocess, Bio, os, sys, shutil, re, time, datetime, socket, random, requests, xmltodict, json, csv, sqlite3, types from Bio import SeqIO from Bio import Phylo from Bio import Entrez from Bio import AlignIO from Bio.Blast import NCBIWWW from Bio.Blast impor...
mjeltsch/VEGFphylo
2_analysis.py
2_analysis.py
py
72,342
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 76, "usage_type": "call" }, { "api_name": "phylolib.expand_complex_taxa", "line_number": 85, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 93, "usage_type": "call" }, { "api_name": "tim...
30770286097
import sqlite3 # from flask import jsonify # from flask import request conn = sqlite3.connect('cards.db') c = conn.cursor() # c.execute(""" # CREATE TABLE DominionGames ( # game_id integer PRIMARY KEY, # Player1Name text NOT NULL, # Player1Score text NOT NULL, # Player2Name text NOT N...
jtstrunk/boardgameFlask
app/database.py
database.py
py
716
python
en
code
0
github-code
1
[ { "api_name": "sqlite3.connect", "line_number": 5, "usage_type": "call" } ]
40019937175
import numpy as np import matplotlib.pyplot as plt def f(x): if x < 0 or x > 1: return 0 else: return 1 - x def g(x): if x < 0 or x > 2: return 0 else: return 1 - x/2 def riemann(f, g, bounds = [-3, 4], delta_x = 0.001): s = 0 for x in np.arange(bounds[0], bou...
wbernoudy/signal_processing
triangles.py
triangles.py
py
621
python
en
code
0
github-code
1
[ { "api_name": "numpy.arange", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
73527997474
import sqlite3 '''LETS KNOW THE DATA TYPES WE HAVE IN sqlite3 Null --> means doesnot exist integers --> means real numbers REAL --> means numbers with decimal TEXT --> means just a Text BLOB --> means kind of images mp3file or music file ''' '''STEPS IN CREATING A DATA IN THE DATABASE''' # #STEP ONE: # # creating...
Gentility01/new-python
data2.py
data2.py
py
5,639
python
en
code
0
github-code
1
[ { "api_name": "sqlite3.connect", "line_number": 61, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 90, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 174, "usage_type": "call" }, { "api_name": "sqlite3.connect", ...
36975879377
# -*- coding: utf-8 -*- """ script launched during summer with Patricia coming """ import cv2 import datetime import mutex import numpy as np import os import time import threading #~ from skimage.measure import structural_similarity as ssim # apt-get install python-skimage #~ import paramiko # Captures a single imag...
alexandre-mazel/electronoos
capture/capture.py
capture.py
py
13,916
python
en
code
2
github-code
1
[ { "api_name": "cv2.cv", "line_number": 23, "usage_type": "attribute" }, { "api_name": "cv2.cv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "cv2.cv", "line_number": 25, "usage_type": "attribute" }, { "api_name": "cv2.cv", "line_number": 52, ...
26677394683
from typing import Callable, Dict, List from redis import StrictRedis import time from slackclient import SlackClient from .data import Bot, Command, Event class PyBot(SlackClient): def __init__(self, token: str, bot: Bot, db: StrictRedis) -> None: super().__init__(token) if (not self.rtm_connec...
albertywu/pybot
slack_pybot/bot.py
bot.py
py
3,378
python
en
code
1
github-code
1
[ { "api_name": "slackclient.SlackClient", "line_number": 9, "usage_type": "name" }, { "api_name": "data.Bot", "line_number": 11, "usage_type": "name" }, { "api_name": "redis.StrictRedis", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Dict", "...
37676968693
from ..helper import config, get_class_from_dot_string from ..logging import logger default_storage = config('DEFAULT_FILE_STORAGE') class DefautStorageBackend: default_backend = None instance = None def __init__(self): if not default_storage: raise Exception('Default storage backend...
goldnetonline/django-rest-api-test
support/storages/default_backend.py
default_backend.py
py
874
python
en
code
0
github-code
1
[ { "api_name": "helper.config", "line_number": 4, "usage_type": "call" }, { "api_name": "helper.get_class_from_dot_string", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.logger.exception", "line_number": 31, "usage_type": "call" }, { "api_name":...
3247018559
from numba import jit from jit_talib import jit_ma import numpy as np from datetime import datetime @jit(nopython=True) def jit_ttm_strategy(tick, chart, position, global_data): now_pos = global_data['chart_pos'] open_volume = 0.05 open_array, high_array, low_array, close_array = chart[1][: ...
dajinforjustice/bitcoin
strategy/JitTTMStrategy.py
JitTTMStrategy.py
py
6,541
python
en
code
0
github-code
1
[ { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 26, "usage_type": "name" }, { "api_name": "numpy.max", "...
17459832619
from . import views from django.urls import path """ Url paths extended from from django.urls BUG: enabling app_name causes a django.urls.exceptions.NoReverseMatch error 500. """ app_name = 'blog' urlpatterns = [ path('blog/', views.PostList.as_view(), name='blog'), path("blog/<slug:slug>/", views.pos...
sgs22/needapc
blog/urls.py
urls.py
py
351
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" } ]
23155170555
import fnmatch import os import argparse import uuid # PARAMETERS parser = argparse.ArgumentParser(description='Rearrange a Unity\'s project folder guids.') parser.add_argument('-i, --input', metavar='FOLDER', type=str, nargs=1, required=True, dest='input_folder', help='input folder') args = parser.parse_args() i...
fani-kiran/Unity-AssetDuplicator
DuplicateFolder.py
DuplicateFolder.py
py
2,969
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.walk", "line...
71082237155
from django.views.decorators.csrf import ensure_csrf_cookie import time from urllib import request from django.http import JsonResponse from django.shortcuts import render from django.views.generic import ListView, CreateView, TemplateView, View from django.utils.translation import gettext_lazy as _ from .models impor...
Evgen2209/tolgobol
TolgobolVillage/MainService/views.py
views.py
py
19,643
python
en
code
0
github-code
1
[ { "api_name": "django.views.generic.TemplateView", "line_number": 21, "usage_type": "name" }, { "api_name": "django.utils.translation.gettext_lazy", "line_number": 25, "usage_type": "call" }, { "api_name": "django.urls.base.reverse_lazy", "line_number": 47, "usage_type": ...