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
72859714462
from StreamManagerApi import * import os import cv2 import json import numpy as np import MxpiDataType_pb2 as MxpiDataType import time import sys def save_infer_result(result, result_name, image_name): """ save the infer result to name_1.txt the file content top5: class_id1, class_id2, class_id3, ...
Ascend/ModelZoo-PyTorch
PyTorch/contrib/cv/classification/MnasNet/infer/sdk/main.py
main.py
py
2,999
python
en
code
31
github-code
7
[ { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 51, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 52, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number"...
42414816177
# -*- coding: utf-8 -*- """ Created on Sat Mar 30 09:45:17 2019 @author: Keshik References https://github.com/hunkim/PyTorchZeroToAll https://gist.github.com/HarshTrivedi/f4e7293e941b17d19058f6fb90ab0fec https://towardsdatascience.com/taming-lstms-variable-sized-mini-batches-and-why-pytorch-is-good-for-yo...
keshik6/deep_learning
lstm-names-classification/model.py
model.py
py
2,266
python
en
code
0
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 20, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 30, "usage_type": "call" }, { "api_name": "torch.nn", "line...
3950627229
import numpy as np import torch from torch import nn from torch import autograd from src.architectures.linear_sequential import linear_sequential from src.architectures.convolution_linear_sequential import convolution_linear_sequential from src.architectures.vgg_sequential import vgg16_bn class Network(nn.Module): ...
TUM-DAML/dbu-robustness
src/models/ensemble_networks/Network.py
Network.py
py
4,123
python
en
code
23
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.set_default_tensor_type", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.Flo...
15312740747
import numpy as np import scipy.io from numpy.linalg import inv as inv from keras.models import Sequential from keras.layers import Dense, LSTM, Dropout, Activation from sklearn.preprocessing import MinMaxScaler import time def kr_prod(a, b): return np.einsum('ir, jr -> ijr', a, b).reshape(a.shape[0] * b.sh...
ChenXu02/traffic_SEDA
models/predicter/LSTM-GL-ReMF/LSTM-GL-ReMF.py
LSTM-GL-ReMF.py
py
13,437
python
en
code
1
github-code
7
[ { "api_name": "numpy.einsum", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.einsum", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.moveaxis", "line_num...
29595053588
"""This module contains the code to translate with https://www.deepl.com/. The API allows to process a batch of 50 texts at a time and allows parallel calls to the API from processes or threads. The secret API is contained in a file which should never be committed! The documentation for the API can be found here: ht...
covid-19-impact-lab/twitter_analysis
src/pre_processing/translate.py
translate.py
py
3,190
python
en
code
2
github-code
7
[ { "api_name": "pandas.Series", "line_number": 44, "usage_type": "attribute" }, { "api_name": "pandas.Series", "line_number": 46, "usage_type": "attribute" }, { "api_name": "yaml.safe_load", "line_number": 49, "usage_type": "call" }, { "api_name": "pathlib.Path", ...
10106146217
import os import argparse import pickle import csv import torch from torch.utils.data import DataLoader from transformers import GPT2Tokenizer, GPT2LMHeadModel from tqdm import tqdm from src.model.data_full import PromtDataset from src.model.pipeline import copy_data_to_device, init_random_seed from typing import List...
edbons/faiky-tails
generate.py
generate.py
py
8,378
python
en
code
0
github-code
7
[ { "api_name": "warnings.simplefilter", "line_number": 15, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "os.path.join", "li...
17530823376
from interface import chess_game import chess_utils import engine.endgame_and_opening_move_finder as endgame_and_opening_move_finder from engine.pieces.piece import Roi, Tour, Fou, Cavalier, Dame, Pion import time def piece_from_symbol(symbol: str): symbol_piece_dict = { 'K': (Roi, "blanc"), 'Q': (Dame, "...
AngelFireLA/NSI-Chess
engine/partie.py
partie.py
py
9,046
python
fr
code
0
github-code
7
[ { "api_name": "engine.pieces.piece.Roi", "line_number": 10, "usage_type": "name" }, { "api_name": "engine.pieces.piece.Dame", "line_number": 10, "usage_type": "name" }, { "api_name": "engine.pieces.piece.Tour", "line_number": 10, "usage_type": "name" }, { "api_nam...
35321466467
from django.shortcuts import render, HttpResponse, redirect from django import forms from app1 import models import time def update(request): if request.method == "GET": corpus = request.GET.get('corpus') nid = request.GET.get('id') user = corpus.split('_')[1] corpus_name = corpus....
lscLucienLee/Parallel-corpus-management-system
Code/PCMS/app/views/Update.py
Update.py
py
1,288
python
en
code
2
github-code
7
[ { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 19, "usage_type": "call" } ]
38119098742
import unittest from flask import json from app.test.base import BaseTestCase from app.main.models.user import User from app.main import db from util import create_test_user, create_test_portfolio class UserRoutesTest(BaseTestCase): def test_app_is_running(self): # Test if the app is running by sending a ...
tiziaco/crypto-exchange-dashboard
app/test/test_user.py
test_user.py
py
2,159
python
en
code
0
github-code
7
[ { "api_name": "app.test.base.BaseTestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.json.dumps", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.json", "line_number": 19, "usage_type": "name" }, { "api_name": "app.main.models...
41088659631
import datetime from sqlalchemy import Column, DateTime, MetaData, Table, TypeDecorator __all__ = [ "PublicSchema", "TZDateTime", ] from sqlalchemy.engine import Dialect class PublicSchema(type): metadata = MetaData(schema="public") __table__ = None def __init__(cls, name, bases, dct): # type...
VyachAp/FastAPISample
svc/persist/schemas/metadata.py
metadata.py
py
1,135
python
en
code
0
github-code
7
[ { "api_name": "sqlalchemy.MetaData", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 20, "usage_type": "argument" }, { "api_name": "sqlalchemy.Table", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlalchemy...
24930222517
# Utils for augmentation import itertools from sklearn.model_selection import GridSearchCV from sklearn.metrics import matthews_corrcoef import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.nn.functional as F import random from inspect import getmembers, isfunction import augmentations mem...
alexander-moore/MolecularRepresentation
alex_files/augutils.py
augutils.py
py
4,535
python
en
code
0
github-code
7
[ { "api_name": "inspect.getmembers", "line_number": 15, "usage_type": "call" }, { "api_name": "inspect.isfunction", "line_number": 15, "usage_type": "argument" }, { "api_name": "itertools.product", "line_number": 24, "usage_type": "call" }, { "api_name": "sklearn.m...
11913301759
import torchvision.utils as vutils import copy import math import os import numpy as np from PIL import Image, ImageFile from matplotlib import pyplot as plt import matplotlib.image as mpimg import torch import torch.nn as nn from torch.nn import functional as F import torch.optim as optim import torchvision.models as ...
HailongZeng/ECE285Project
CycleGAN/dataset.py
dataset.py
py
3,755
python
en
code
0
github-code
7
[ { "api_name": "torch.utils.data.Dataset", "line_number": 24, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 24, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path",...
38827978301
"""Added columns in similar tracks songs Revision ID: 1be5a4ddae1c Revises: 2737e100c02c Create Date: 2022-05-29 22:35:07.310292 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '1be5a4ddae1c' down_revision = '2737e100c0...
NwaforAugustine321/ktizo-backend
alembic/versions/1be5a4ddae1c_added_columns_in_similar_tracks_songs.py
1be5a4ddae1c_added_columns_in_similar_tracks_songs.py
py
1,337
python
en
code
0
github-code
7
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
24409836490
# -*- coding:utf8 -*- import os from PIL import Image import tensorflow as tf import numpy as np import matplotlib.pyplot as plt source_image_dir = 'image' source_image_size = 16 target_image_size = 28 # 读取图片至image # 卷积自编码器 inputs = tf.placeholder(tf.float32, (1, source_image_size, source_image_size, 1), name='image_i...
zhcong/AINumber
make.py
make.py
py
2,029
python
en
code
0
github-code
7
[ { "api_name": "tensorflow.placeholder", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tensorflow.image.resize_images", "line_number": 16, "usage_type": "call" }, { "api...
30795180950
import fugashi from collections import Counter def extractVocab(filePath): tagger = fugashi.Tagger() f = open(filePath, encoding="utf-8") text = f.read() test_list = [] res = [] output = [] outputText = '[' for word in tagger(text): ...
mike-summ/Japanese-Frequency-Generator
vocabextractor.py
vocabextractor.py
py
934
python
en
code
0
github-code
7
[ { "api_name": "fugashi.Tagger", "line_number": 5, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 18, "usage_type": "call" } ]
42067397358
#!/usr/bin/env python # _*_ encoding: utf-8 _*_ # --------------------------------------- # Created by: Jlfme<jlfgeek@gmail.com> # Created on: 2016-03-21 20:24:18 # --------------------------------------- from django.conf.urls import url from django.views.generic import TemplateView from blog.views import views, adm...
jlfme/jlfme-blog
blog/urls.py
urls.py
py
1,268
python
en
code
0
github-code
7
[ { "api_name": "django.conf.urls.url", "line_number": 15, "usage_type": "call" }, { "api_name": "django.views.generic.TemplateView.as_view", "line_number": 15, "usage_type": "call" }, { "api_name": "django.views.generic.TemplateView", "line_number": 15, "usage_type": "name...
6879501973
import numpy as np import scipy.special as sp # function to handle input exceptions def get(instr, message): var = -1 while(var == -1): try: var = float(input(instr)) except: print(message) pass return var # base functions - manipulating distributions ...
ashwin2802/EE683
base.py
base.py
py
3,112
python
en
code
0
github-code
7
[ { "api_name": "numpy.random.uniform", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 20, "usage_type": "attribute" }, { "api_name": "numpy.log", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.e", "line_...
14248049507
import os import sys import argparse import datetime import shutil import traceback from pathlib import Path from git import Git, exc # this calls the configuration of the logger which is done in the settings module from autoreduce_utils.settings import logging ISIS_MOUNT_PATH = Path("/isis") AUTOREDUCTION_PATH = Pa...
autoreduction/scripts
autoreduce_scripts/backup_reduction_scripts.py
backup_reduction_scripts.py
py
3,563
python
en
code
0
github-code
7
[ { "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": 19, "usage_type": "call" }, { "api_name": "autoreduce_utils.settings.logg...
3214597560
from selenium import webdriver from selenium.webdriver.chrome.options import Options # 从options模块中调用Options类 import time chrome_options = Options() # 实例化Option对象 chrome_options.add_argument('--headless') # 把Chrome浏览器设置为静默模式 driver = webdriver.Chrome(options = chrome_options) driver.get('https://localprod.pandateach...
xyzdudu/python_code
L9_2.py
L9_2.py
py
1,086
python
en
code
0
github-code
7
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 5, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { ...
19990806853
from itertools import combinations, chain, permutations import networkx as nx import matplotlib.pyplot as plt import random random.seed(0) class Atom: def __init__(self,info): self.atom = info[0] self.electrons = info[1] self.atomic_numb = info[2] self.valence = info[3] self.orbit...
TinacciL/Isomers_generator
IG_lib.py
IG_lib.py
py
21,134
python
en
code
4
github-code
7
[ { "api_name": "random.seed", "line_number": 6, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 28, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 29, "usage_type": "call" }, { "api_name": "itertools.combinati...
18033893637
#!/usr/bin/python3 # testing command: sudo socat PTY,link=/dev/ttyS10 PTY,link=/dev/ttyS11 # /dev/ttyS10 - write socket # /dev/ttyS11 - read socket # credits: https://stackoverflow.com/a/10555885 from argparse import ArgumentParser from concurrent.futures import Future, ProcessPoolExecutor from functools import parti...
raidgar98/wserial
main.py
main.py
py
3,641
python
en
code
0
github-code
7
[ { "api_name": "functools.partial", "line_number": 23, "usage_type": "call" }, { "api_name": "wserial.libs.logger.get_logger", "line_number": 24, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 27, "usage_type": "call" }, { "api_name...
25819092578
''' RUN COMMAND python -i example.py PRINT env AND INTERACT TO TEST PRINT sys.path TO CHECK REPO ROOT DIR Note: If installed using PIP then package is added to PATH by default. If installed using GIT: sys.path.insert(0, [PATH TO REPO_ROOT_DIR]) ''' import sys import gym import gym_lunar_land...
kaiyuanmifen/adaptivebottlenecking
DeepQ/example.py
example.py
py
879
python
en
code
1
github-code
7
[ { "api_name": "gym.make", "line_number": 16, "usage_type": "call" } ]
74081070302
# Core django libraries from django.contrib import admin from django.urls import path, include, re_path # Django rest framework from rest_framework.urlpatterns import format_suffix_patterns from rest_framework.urlpatterns import format_suffix_patterns from rest_framework.routers import DefaultRouter # My stuff from ....
e-shevchuk/MIMA2
mysite/urls.py
urls.py
py
1,197
python
en
code
1
github-code
7
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 14, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 19, "usage_type": "call" }, { "api_name": "django.urls.include", "line_number": 19, "usage_type": "call" }, { "api_nam...
37399109432
""" :mod:`papy.util.config` ======================= Configures logging to monitor the execution of **PaPy** pipelines and OS-dependent defaults for different variables. """ import time import os, socket import logging.handlers from numap import imports @imports(['os', 'socket']) def get_defaults(): """ R...
mcieslik-mctp/papy
src/papy/util/config.py
config.py
py
4,374
python
en
code
28
github-code
7
[ { "api_name": "os.pathconf_names", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.pipe", "line_number": 25, "usage_type": "call" }, { "api_name": "os.fpathconf", "line_number": 26, "usage_type": "call" }, { "api_name": "socket.socket", "line...
18747593673
import pika from redis_multiple_saving.consumer import callback # Creating connection and channel with localhost RabbitMQ connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost')) channel = connection.channel() # Creating a new Exchange and Queue channel.exchange_declare(exchange='save_on_redi...
duanribeiro/RabbitMQ_exercises
redis_multiple_saving/rabbitMQ.py
rabbitMQ.py
py
999
python
en
code
0
github-code
7
[ { "api_name": "pika.BlockingConnection", "line_number": 5, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 5, "usage_type": "call" }, { "api_name": "redis_multiple_saving.consumer.callback", "line_number": 22, "usage_type": "name" } ]
70935631585
import numpy as np from numpy.random import default_rng import h5py import numpy as np import numpy.linalg as la #import cppimport.import_hook #import cpp_ext.tensor_kernels as tensor_kernels class SparseTensor: ''' For single-node testing purposes only (in Jupyter). Does not have an MPI component. '...
vbharadwaj-bk/rdist_tensor
experimental/serial/sparse_tensor_singlenode.py
sparse_tensor_singlenode.py
py
1,320
python
en
code
0
github-code
7
[ { "api_name": "h5py.File", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 31, "usage_type": "name" }, { "api_name": "numpy.random.default_rng", ...
25204005189
# 昇順をスライドさせてできた数列の中で最小値を見つける。 # 4 5 1 2 3 # 入力のサイズが10**8以下だったら、O(N)の方法で行ける。 # nums = list(map(int, input().split())) # for i in range(len(nums)-1): # if nums[i] < nums[i+1]: # continue # else: # print(nums[i+1]) # break # else: # print(nums[0]) # 入力のサイズが10**8以上だったら、O(log(N))の方法で...
kazuya0208442/Algorithm
binary_serch.py
binary_serch.py
py
1,453
python
ja
code
1
github-code
7
[ { "api_name": "typing.List", "line_number": 47, "usage_type": "name" }, { "api_name": "sys.stdin", "line_number": 69, "usage_type": "attribute" } ]
17146172061
# build-in import asyncio import os import shutil import tempfile import time from datetime import date from pathlib import Path from typing import TypedDict from zipfile import ZipFile # third-party from geopandas import GeoSeries from sentinelsat import SentinelAPI from sentinelsat.exceptions import LTATriggered fro...
Taraman12/Solarpark-detection
Archive/downloader/archive/api_call_handler_old.py
api_call_handler_old.py
py
7,910
python
en
code
1
github-code
7
[ { "api_name": "typing.TypedDict", "line_number": 30, "usage_type": "name" }, { "api_name": "sentinelsat.SentinelAPI", "line_number": 38, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 40, "usage_type": "name" }, { "api_name": "datetime.date"...
27804420266
from PyQt5.QtGui import ( QKeySequence, ) from PyQt5.QtWidgets import ( QMainWindow, ) class MainWindowGuiUserAction(QMainWindow): page_idx = 0 def setup_signal_connections_for_user_actions(self): self.buttons_bot_type[0].clicked.connect(self.play_mouse_click_sound) self.buttons_bot_t...
WhiteSlope1000/white-slope-portfolio
ai_talkbot_version01/application/gui_talkbot_main_action.py
gui_talkbot_main_action.py
py
3,084
python
en
code
0
github-code
7
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 32, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QKeySequence", "line_number": 36, "usage_type": "call" }, { "a...
2955208870
import time import torch def benchmark_mm(m, n, k, num_iterations=100): A = torch.randn(m, n).half().to("cuda:0") B = torch.randn(n, k).half().to("cuda:0") C = torch.empty(m, k).half().to("cuda:0") num_warmup_iterations = 50 for i in range(num_warmup_iterations + num_iterations): if i == n...
jahatef/TransformerSizing
mm_flops.py
mm_flops.py
py
4,578
python
en
code
2
github-code
7
[ { "api_name": "torch.randn", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.randn", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.empty", "line_number": 8, "usage_type": "call" }, { "api_name": "time.time", "line_number": 12, ...
73675172063
import config from graphdatascience import GraphDataScience gds = GraphDataScience( config.host, auth=(config.user, config.password), database="neo4j" ) bham = gds.find_node_id(["Station"], {"name": "Birmingham New Street"}) eboro = gds.find_node_id(["Station"], {"name": "Edinburgh"}) shortest_path = gds.shortes...
TheRobBrennan/explore-python-neo4j-graph-data-science
examples/example-01-neo4j-python-example-graph-projection/02-find-the-shortest-path-between-two-stations.py
02-find-the-shortest-path-between-two-stations.py
py
1,778
python
en
code
0
github-code
7
[ { "api_name": "graphdatascience.GraphDataScience", "line_number": 4, "usage_type": "call" }, { "api_name": "config.host", "line_number": 5, "usage_type": "attribute" }, { "api_name": "config.user", "line_number": 5, "usage_type": "attribute" }, { "api_name": "conf...
14195957745
# from pudb import set_trace; set_trace() from typing import List import heapq class Solution1: def scheduleCourse(self, courses: List[List[int]]) -> int: """LeetCode 630 This solution is based on hint, although I have basically the same idea as the hint. Yet, I was not sure to pursue the...
FanchenBao/leetcode
2021_05_challenge/05_02_2021.py
05_02_2021.py
py
4,027
python
en
code
1
github-code
7
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "heapq.heappush", "line_number": 47, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 51, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_nu...
39231717715
# { # "national": # [ # "THW force all news organizations to be non profit(i.e. NHK, BBC, PBS)", # "THR the romanticization of success stories about educational achievement(e.g Biri Gal, Dragon Zakura)", # ], # "international": # "" # [ # ], # } import json from collections import OrderedDict impo...
kokhayas/sbert_on_server
main11_create_motions_json.py
main11_create_motions_json.py
py
1,470
python
en
code
0
github-code
7
[ { "api_name": "json.loads", "line_number": 28, "usage_type": "call" }, { "api_name": "json.JSONEncoder", "line_number": 40, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 53, "usage_type": "call" } ]
3962191685
from uuid import UUID from crm_pilates.command.command_bus import CommandBus from crm_pilates.command.response import Response from crm_pilates.command.saga_handler import SagaHandler from crm_pilates.domain.attending.session import ConfirmedSession from crm_pilates.domain.commands import SessionCreationCommand from c...
bbougon/crm-pilates
crm_pilates/domain/attending/session_checkin_saga_handler.py
session_checkin_saga_handler.py
py
2,091
python
en
code
0
github-code
7
[ { "api_name": "crm_pilates.event.event_store.Event", "line_number": 15, "usage_type": "name" }, { "api_name": "uuid.UUID", "line_number": 16, "usage_type": "name" }, { "api_name": "crm_pilates.domain.scheduling.attendee.Attendee", "line_number": 16, "usage_type": "name" ...
31367091093
#Program to tanslate languages.This uses google translate module to do the transilation #Created by Aswin KS import googletrans from tkinter import * #for creating GUI from tkinter import messagebox #for message box from googletrans import Translator from numpy import common_type import pyperclip #for copy to clipb...
aswinks123/Python-Projects
Intermediate/Language-Transilator-GUI/trans.py
trans.py
py
2,530
python
en
code
0
github-code
7
[ { "api_name": "googletrans.Translator", "line_number": 16, "usage_type": "call" }, { "api_name": "pyperclip.copy", "line_number": 27, "usage_type": "call" }, { "api_name": "tkinter.messagebox.showinfo", "line_number": 28, "usage_type": "call" }, { "api_name": "tki...
7892504868
######################################################### ## Stat 413 - Homework 3 ## Author: Luxi Li ## Date : 2/18/2018 ## Description: This script implements an adaboost classifier ######################################################### ############################################################# ## INSTRUCTIONS...
monologue110/Code
Adaboost.py
Adaboost.py
py
5,385
python
en
code
0
github-code
7
[ { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "sklearn.datasets.load_digits", "line_number": 36, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 36, "usage_type": "name" }, { "api_name": "numpy.asarr...
9102636277
from graphviz import Digraph #class ExecuteTaskGraph(task_graph): #def __init__(self, task_graph): #print ('init ExecuteTaskGraph') #def execute_tool(tool_name, tool_args): #args = ast.literal_eval(tool_args) #tool_instance = globals()[tool_name]() #tool_result = tool_instance...
rkreddyp/securitygpt
securitygpt/utils/graph_utils.py
graph_utils.py
py
2,279
python
en
code
1
github-code
7
[ { "api_name": "graphviz.Digraph", "line_number": 17, "usage_type": "call" }, { "api_name": "graphviz.Digraph", "line_number": 34, "usage_type": "call" }, { "api_name": "IPython.display.display", "line_number": 78, "usage_type": "call" }, { "api_name": "IPython.dis...
33213561034
import scooby import unittest from SimPEG import Report class TestReport(unittest.TestCase): def test_version_defaults(self): # Reporting is now done by the external package scooby. # We just ensure the shown packages do not change (core and optional). out1 = Report() out2 = scooby...
simpeg/simpeg
tests/utils/test_report.py
test_report.py
py
1,294
python
en
code
438
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "SimPEG.Report", "line_number": 10, "usage_type": "call" }, { "api_name": "scooby.Report", "line_number": 11, "usage_type": "call" }, { "api_name": "unittest.main", ...
28779803411
from database import db from datetime import date from sqlalchemy import and_ from .inventoryModel import Inventory from ..theatre.theatreRepository import get_theatre_by_id import os, sys # Add the project's root directory to the Python path current_dir = os.path.dirname(os.path.realpath(__file__)) project_root = os...
munishka-vijay/Movie-Ticket-Booking-System
backend/apis/modules/inventory/inventoryRepository.py
inventoryRepository.py
py
5,912
python
en
code
0
github-code
7
[ { "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.realpath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.abspath", "...
37276604134
from typing import Type import torch from loss import temperature from patch import Patch class ContrastiveWeightedKNN(): def __init__(self, contrastive_model: Type[torch.nn.Module], train, train_subset_ratio=.5, k=10): self.contrastive_model = contrastive_model self.train_x, self.train_y = trai...
zia-badar/SelfSupervisedClassification
classifier.py
classifier.py
py
1,576
python
en
code
0
github-code
7
[ { "api_name": "typing.Type", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.randperm", "line_number": 17, "usage_type": "call" }, { "api_name": "patch.Patch.classes", "l...
3981134666
import numpy as np import nengo from nengo.dists import Uniform from nengo.solvers import NoSolver from nengo.utils.numpy import rmse from nengolib import Lowpass, DoubleExp from nengolib.signal import s from utils import decodeNoF, WNode, learnEncoders, setWeights, decode, plotState, plotActivity from neurons import L...
psipeter/detailed_neurons
detailed_neurons/diffMemory.py
diffMemory.py
py
9,590
python
en
code
0
github-code
7
[ { "api_name": "seaborn.set", "line_number": 13, "usage_type": "call" }, { "api_name": "nengo.processes.WhiteSignal", "line_number": 17, "usage_type": "call" }, { "api_name": "nengo.processes", "line_number": 17, "usage_type": "attribute" }, { "api_name": "nengo.Ne...
43621267880
from flask import Flask, render_template, request, redirect, Response, jsonify import pandas as pd import json from sklearn.cluster import KMeans from sklearn import metrics from sklearn.decomposition import PCA from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import StandardScaler from sklearn...
aakashsbhatia2/Visualisation-MiniProject-2
flaskDirectory/app.py
app.py
py
11,008
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.jsonify", "...
12511937044
"""A class that provides methods used to properly format and display replay data""" import copy from immutabledict import immutabledict from typing import Iterable, Optional from . import game_ids from replays import models # These table fields configure the display of the stage split columns # These may differ f...
n-rook/thscoreboard
project/thscoreboard/replays/game_fields.py
game_fields.py
py
19,004
python
en
code
7
github-code
7
[ { "api_name": "immutabledict.immutabledict", "line_number": 14, "usage_type": "call" }, { "api_name": "immutabledict.immutabledict", "line_number": 40, "usage_type": "call" }, { "api_name": "immutabledict.immutabledict", "line_number": 66, "usage_type": "call" }, { ...
24297066362
"""Credit Calculator Project""" # Libraries import math import argparse class CreditCalculator: def __init__(self): """Initialize the class""" self.payment: float = 0 self.principal: float = 0 self.interest: float = 0 self.overpayment: float = 0 self.periods = 0 ...
gerasimovamargo/DICT_python_education_Herasymova_Marharyta
credit_calculator/credit_calculator.py
credit_calculator.py
py
4,381
python
en
code
0
github-code
7
[ { "api_name": "math.ceil", "line_number": 20, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 29, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 38, "usage_type": "call" }, { "api_name": "math.log", "line_number": 38, "...
7712516907
# coding=utf-8 import threading import logging import argparse import sys import atexit import mimetypes import pkg_resources import gettext from . import config, utils from . import coordinator from .__version__ import __version__ from .channel import EFBChannel from .middleware import EFBMiddleware # gettext.insta...
staniya/CYBEX
cybeXtelegram/ehForwarderBot/ehforwarderbot/__main__.py
__main__.py
py
8,384
python
en
code
1
github-code
7
[ { "api_name": "gettext.translation", "line_number": 19, "usage_type": "call" }, { "api_name": "pkg_resources.resource_filename", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.version_info", "line_number": 26, "usage_type": "attribute" }, { "api_nam...
72832571102
import torch import torch.optim as optim from lib.progressbar import progress_bar def train_epoch(model, criterion, optimizer, train_loader, device=torch.device('cuda'), dtype=torch.float): model.train() train_loss = 0 for batch_idx, (inputs, targets) in enumerate(train_loader): inputs, targets =...
hsed/fyp
trainer/_solver.py
_solver.py
py
3,844
python
en
code
8
github-code
7
[ { "api_name": "torch.device", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.float", "line_number": 6, "usage_type": "attribute" }, { "api_name": "lib.progressbar.progress_bar", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.device...
28927376817
import cv2 import numpy as np import matplotlib.pyplot as plt # range color def detect_chess_board(path): hh = 500 ww = 400 image = cv2.imread(path) # resize image image = cv2.resize(image,(hh,ww)) #1. Tách màu sáng, giữ lại màu đen # converting frame(image == BGR) to HSV(hue-sat...
phamdu2001/estimate_center_object_3d
get_mask.py
get_mask.py
py
7,595
python
en
code
0
github-code
7
[ { "api_name": "cv2.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_numbe...
36350302693
import select import os import subprocess from collections import namedtuple import logging # project from .exceptions import ( AzureHostedCommandException, AzureHostedCommandNotFoundException ) logger = logging.getLogger('Azure_LI_Services') class Command(object): """ **Implements command invocatio...
SUSE-Enceladus/azure-li-services
azure_li_services/command.py
command.py
py
6,019
python
en
code
7
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 53, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 56, "usage_type": "attribute" }, { "api_name": "path.Path.wh...
9961962304
#!/usr/bin/env python """Utilitys for working with chemicals arrays. Author: Dominic Phillips (dominicp6) """ import os import contextlib import psutil import sys import traceback from typing import Optional, Callable, Union, TextIO import numpy as np import numpy.typing as npt import scipy.interpolate as interp...
dominicp6/CV_learning
utils/general_utils.py
general_utils.py
py
6,415
python
en
code
0
github-code
7
[ { "api_name": "typing.Union", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.TextIO", "line_number": 21, "usage_type": "name" }, { "api_name": "sys.exc_info", "line_number": 37, "usage_type": "call" }, { "api_name": "traceback.extract_tb", "l...
35918745938
# -*- coding: utf-8 -*- import codecs, requests, urllib, webbrowser, json, os, math, time, logger, sys from threading import Thread # Application settings client_id = "3998121" client_secret = "AlVXZFMUqyrnABp8ncuU" runThread = 10 # API call function def api_call(method, param): api_url = "https://api.vk.com/method...
anashansson/vk-dump-user
run.py
run.py
py
4,152
python
en
code
0
github-code
7
[ { "api_name": "urllib.urlencode", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "logger.fail", "line_...
9923457503
#!/usr/bin/env python import ROOT import os from CombineUtils import CombineWorkspace as cw if __name__ == "__main__": import argparse parser = argparse.ArgumentParser() parser.add_argument( "-w", "--workspace", type=str, help="path to workspace ROOT-file. Should contain workspace names 'w'." ...
UHH2/JetMass
rhalph/plotToys.py
plotToys.py
py
1,353
python
en
code
1
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "CombineUtils.CombineWorkspace", "line_number": 18, "usage_type": "call" }, { "api_name": "ROOT.gROOT.SetBatch", "line_number": 22, "usage_type": "call" }, { "api_nam...
30187787073
# MLP 26 november import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.image as mpimg from matplotlib import pyplot from statsmodels.graphics.tsaplots import plot_acf, plot_pacf import os import datetime import math import IPython import IPython.display import matplotlib as mpl im...
jaimestinson/tfm
Datos_esios/MLP v0.py
MLP v0.py
py
10,500
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.Timestamp", "line_number": 43, "usage_type": "attribute" }, { "api_name": "numpy.sin", ...
37251622258
import numpy as np import matplotlib.pyplot as plt import numpy as np from matplotlib import pyplot as plt #Definindo a função def f(x): return x**3 -x -1 x = np.linspace(0 , 10 ,100) y = f(x) #Definindo o plotamento def p(A, B): plt.plot(x, y) plt.xlabel("x") plt.ylabel("y = f(x)") plt.grid(Tr...
ViniciusPuerto/Metodos
minimos.py
minimos.py
py
1,037
python
pt
code
0
github-code
7
[ { "api_name": "numpy.linspace", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.py...
17600139210
import setuptools with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name="navigation_analytics", version="0.0.1", author="Jose Mielgo", author_email="mielgosez@gmail.com", description="Toolkit that creates portable objects specialized on analyz...
mielgosez/navigation_analytics
setup.py
setup.py
py
972
python
en
code
0
github-code
7
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 24, "usage_type": "call" } ]
1908425014
''' Thomas constructing a Tree of N nodes, nodes labelled as 0, 1, 2, .. ,n-1. He is given a list of N-1 edges[], where edge[i]=[v1, v2], is an undirected edge between v1 and v2. He can construct the tree by selecting any node as root node. Your task is to find out the trees with the smallest height, among all the t...
sharuk2k3/FS-Elite-2021-22
Day-26/Day_26_P_2.py
Day_26_P_2.py
py
1,684
python
en
code
1
github-code
7
[ { "api_name": "collections.defaultdict", "line_number": 62, "usage_type": "call" } ]
25456803468
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2017/4/24 16:46 # @Version : python 3.4 # @Author : KingDow from common import commFunc from common import globalParams from common.httpConfig import GetHttp from common.logConfig import GetLog from common.readConfig import ReadConfig class PhpLogin(object)...
Paladin1412/practise
proAPI/interfaces/PhpLogin.py
PhpLogin.py
py
3,440
python
zh
code
0
github-code
7
[ { "api_name": "common.httpConfig.GetHttp", "line_number": 16, "usage_type": "call" }, { "api_name": "common.logConfig.GetLog", "line_number": 17, "usage_type": "call" }, { "api_name": "common.commFunc.get_app_sign", "line_number": 29, "usage_type": "call" }, { "ap...
72844391262
import argparse import sys import torch sys.path.append('../../src/utils/') sys.path.append('../../src/transformer/') from transformer import Transformer parser = argparse.ArgumentParser("Speech-Transformer-pth2onnx-decoder") parser.add_argument('--pth-path', type=str, default='./final.pth.tar') parser.add_argument...
Ascend/ModelZoo-PyTorch
ACL_PyTorch/contrib/audio/Speech-Transformer/SpeechTransformer_pth2onnx_tgt_word_prj.py
SpeechTransformer_pth2onnx_tgt_word_prj.py
py
1,082
python
en
code
31
github-code
7
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
19132591853
import json from django.test import TestCase # Create your tests here. from django.urls import reverse class RenderTextTestCase(TestCase): def setUp(self): pass def test_can_render_image(self): _url = reverse("render:detail") payload = { "timestamp": 1526616756, ...
Bit03/django-text2img
testapp/render/tests.py
tests.py
py
1,844
python
zh
code
1
github-code
7
[ { "api_name": "django.test.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "django.urls.reverse", "line_number": 13, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 21, "usage_type": "call" }, { "api_name": "django.urls.revers...
18240652415
# -*- coding: utf-8 -*- """ Onyx Project https://onyxlabs.fr Software under licence Creative Commons 3.0 France http://creativecommons.org/licenses/by-nc-sa/3.0/fr/ You may not use this software for commercial purposes. @author :: Cassim Khouani """ from .. import api from flask import request, Response from onyx.deco...
OnyxAI/onyx_v1
onyx/core/controllers/api/views/Room.py
Room.py
py
1,404
python
en
code
5
github-code
7
[ { "api_name": "onyx.api.assets.Json", "line_number": 19, "usage_type": "call" }, { "api_name": "onyx.api.room.Room", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.Response", "line_number": 26, "usage_type": "call" }, { "api_name": "onyx.api.excep...
24776921960
import os import pandas as pd import pkgutil import re from datetime import datetime from io import StringIO class ccr(object): _boat_classes = ['VA','LA'] _ccr_units = ['main','interface','expansion'] def __init__(self,serialNum:int,classType:str): if not isinstance(serialNum,int): r...
ojosh15/CCR_DVT
CCR/ccr.py
ccr.py
py
4,141
python
en
code
0
github-code
7
[ { "api_name": "pkgutil.get_data", "line_number": 30, "usage_type": "call" }, { "api_name": "io.StringIO", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 33, "usage_type": "call" }, { "api_name": "datetime.datetime.now", ...
18426273116
from lxml import html from decimal import Decimal import sys import os import json import requests import re import inspect import logging import argparse import yaml #TODO: Add documentation class Product: def __init__(self, asin, name, price_new, price_used, link, price_external=None): self.asin = asin ...
oswalya/crawl-me-nuts
crawler.py
crawler.py
py
7,446
python
en
code
0
github-code
7
[ { "api_name": "decimal.Decimal", "line_number": 26, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 27, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 33, "usage_type": "call" }, { "api_name": "decimal.Decimal", ...
5072970697
import numpy as np from numba import njit, float64 from numba.experimental import jitclass from fast1dkmeans.smawk import interpolate @njit() def reduce_iter(rows, cols, calculator, col_buffer): # https://courses.engr.illinois.edu/cs473/sp2016/notes/06-sparsedynprog.pdf m = len(rows) S = col_buffer ...
Feelx234/fast1dkmeans
fast1dkmeans/smawk_iter.py
smawk_iter.py
py
2,954
python
en
code
0
github-code
7
[ { "api_name": "numba.njit", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 41, "usage_type": "call" }, { "api_name": "numba.njit", "line_number": 28, "usage_type": "name" }, { "api_name": "numpy.ones", "line_number": 48, ...
10680299818
""" Analyze model results """ import os import sys import json import argparse import pandas as pd import numpy as np FORMAT_F = { "MaxReward_alpha=1": "MaxReward1", "CartesianEqualPortion_p=1": "CartesianEqualPortion1", "CartesianMuPortion_alpha=1": "CartesianMuPortion1", "TempSoftmax_temp=1_p=1": "...
tomron/CSRviaMAB
AnalyzeResults.py
AnalyzeResults.py
py
3,749
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path", "line_n...
2389875926
import numpy as np import cv2 FINAL_LINE_COLOR = (0, 0, 0) WORKING_LINE_COLOR = (255, 255, 255) class Draw(object): def __init__(self, window_name, clean_img=None, img_size=None): self.window_name = window_name # Name for our window self.img_size = img_size self.done = False # Flag signall...
AdvaitKoparkar/Image-Restoration
lib/draw.py
draw.py
py
2,564
python
en
code
5
github-code
7
[ { "api_name": "cv2.EVENT_MOUSEMOVE", "line_number": 28, "usage_type": "attribute" }, { "api_name": "cv2.EVENT_LBUTTONDOWN", "line_number": 30, "usage_type": "attribute" }, { "api_name": "cv2.EVENT_RBUTTONDOWN", "line_number": 32, "usage_type": "attribute" }, { "ap...
4414891641
import os import random import pypokedex import discord from discord.ext import commands from dotenv import load_dotenv from banWord import banWord load_dotenv(dotenv_path='config') class UselessBot(commands.Bot): def __init__(self): super().__init__(command_prefix='=') self.add_command(self.pi...
theopg1/discordUselessBot
main.py
main.py
py
8,861
python
en
code
0
github-code
7
[ { "api_name": "dotenv.load_dotenv", "line_number": 10, "usage_type": "call" }, { "api_name": "discord.ext.commands.Bot", "line_number": 13, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 13, "usage_type": "name" }, { "api_name": ...
650919900
from google.appengine.ext import ndb import webapp2 from base_handler import BaseHandler PAGE_SIZE = 5 class SuggestionByCursor(ndb.Model): """Model for storing suggestions contributed to the application. Suggestions will be displayed in the order they were created. """ suggestion = ndb.StringProp...
googlearchive/appengine-paging-python
suggest_cursor.py
suggest_cursor.py
py
2,767
python
en
code
21
github-code
7
[ { "api_name": "google.appengine.ext.ndb.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "google.appengine.ext.ndb", "line_number": 10, "usage_type": "name" }, { "api_name": "google.appengine.ext.ndb.StringProperty", "line_number": 15, "usage_type": "...
9196923472
"""Zernike polynomials.""" from collections import defaultdict import numpy as truenp from .jacobi import jacobi, jacobi_der, jacobi_sequence from prysm.mathops import np, kronecker, sign, is_odd from prysm.util import sort_xy from prysm.plotting import share_fig_ax def zernike_norm(n, m): """Norm of a Zernik...
brandondube/prysm
prysm/polynomials/zernike.py
zernike.py
py
17,969
python
en
code
205
github-code
7
[ { "api_name": "numpy.sqrt", "line_number": 16, "usage_type": "call" }, { "api_name": "prysm.mathops.kronecker", "line_number": 16, "usage_type": "call" }, { "api_name": "jacobi.jacobi", "line_number": 50, "usage_type": "call" }, { "api_name": "prysm.mathops.np.sin...
26395855479
import argparse class Config(object): """ Manually setting configuration. """ parser = argparse.ArgumentParser() parser.add_argument("--gpu_count", default=1, type=int) parser.add_argument("--image_per_gpu", type=int, default=16) parser.add_argument("--epoch", default=300, type=int) pa...
zhuyiche/IronClassification
keras_model/keras_config.py
keras_config.py
py
1,043
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 28, "usage_type": "call" } ]
30703704808
import json import statistics files = range(1, 13) directory = "KeySlide/" data = [] times = [] for i in files: try: f = open(directory + str(i) + "/data.txt", 'r') content = json.loads(f.read()) data.append(content) f.close() f = open(directory + str(i) + "/user.txt", 'r') content = int(f.read()) tim...
info-design-lab/KeySlide
User Study/Testing Data/keyslide analysis.py
keyslide analysis.py
py
1,033
python
en
code
0
github-code
7
[ { "api_name": "json.loads", "line_number": 12, "usage_type": "call" }, { "api_name": "statistics.mean", "line_number": 50, "usage_type": "call" }, { "api_name": "statistics.stdev", "line_number": 50, "usage_type": "call" }, { "api_name": "statistics.mean", "li...
24336499078
import cv2 def main(): cap = cv2.VideoCapture(0) while True: ret, frame = cap.read() if not ret: print("Error: Failed to capture frame") continue cv2.imshow("Camera", frame) if cv2.waitKey(1) == ord("q"): break cap.release() cv2.d...
NguyenBao23131/AI-algorithm
DL/OpenCV/Module1/2.camera.py
2.camera.py
py
378
python
en
code
1
github-code
7
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "l...
21595598989
import PySimpleGUI as sg from config import BabbleConfig from config import BabbleSettingsConfig from collections import deque from threading import Event, Thread from babble_processor import BabbleProcessor, CamInfoOrigin from enum import Enum from queue import Queue, Empty from camera import Camera, CameraState from ...
SummerSigh/ProjectBabble
BabbleApp/camera_widget.py
camera_widget.py
py
15,769
python
en
code
68
github-code
7
[ { "api_name": "osc.Tab", "line_number": 18, "usage_type": "name" }, { "api_name": "config.BabbleConfig", "line_number": 18, "usage_type": "name" }, { "api_name": "queue.Queue", "line_number": 18, "usage_type": "name" }, { "api_name": "osc.Tab.CAM", "line_numbe...
22259948287
import zipfile import sys import os import shared class rec: def __init__(self, hash, path): self.sha = hash self.path = path def load_sha1(shafile): with open(shafile, "r") as f: lines = f.readlines() for line in lines: hash = line[5:44] path = line[46:...
pprchal/gphotounzip
gounzip.py
gounzip.py
py
2,517
python
en
code
0
github-code
7
[ { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_n...
36058238638
#! python3 # judyTweets.py - scrapes judge judy quotes from IMDB and saves them as shelf file # tweets one quote daily at 9am to your twitter account import os, bs4, requests, shelve, datetime, time, math from twitter import * ACCESS_TOKEN = '' ACCESS_TOKEN_SECRET = '' CONSUMER_KEY = '' CONSUMER_SECRET ='' # FUN...
newb1234/github
judyTweets.py
judyTweets.py
py
3,305
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 20, "usage_type": "call" }, { "api_name": "shelve.open", "line_number": 28, "usage_type": "call" }, { "api_name": "shelve.open", "line_nu...
23668106707
from datetime import datetime from hashlib import md5 from nonebot import on_command from nonebot.adapters import Bot, Event from nonebot.typing import T_State ex = ['大吉', '吉', '半吉', '小吉', '末吉', '大凶', '凶', '半凶', '小吉', '末凶'] # 求签结果选项 week = ['一', '二', '三', '四', '五', '六', '日'] # 将日期转换为汉字 # 获取格式化的日期字符串 def Date(): ...
retroxz/HinamoeBot
plugins/fortune/__init__.py
__init__.py
py
1,830
python
en
code
5
github-code
7
[ { "api_name": "datetime.datetime.now", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "name" }, { "api_name": "hashlib.md5", "line_number": 22, "usage_type": "call" }, { "api_name": "nonebot.on_comman...
32018337457
""" File: filter_trainer.py Author: Nrupatunga Email: nrupatunga.s@byjus.com Github: https://github.com/nrupatunga Description: trainer code """ import pytorch_lightning as pl from custom_nets import FIP class LitModel(pl.LightningModule): """Docstring for LitModel. """ def __init__(self, ...
nrupatunga/Image-filters
litmodel.py
litmodel.py
py
732
python
en
code
1
github-code
7
[ { "api_name": "pytorch_lightning.LightningModule", "line_number": 15, "usage_type": "attribute" }, { "api_name": "custom_nets.FIP", "line_number": 30, "usage_type": "call" } ]
9616455923
from tabulate import tabulate from .utils.enums import ShipDirection, ShipType, SquareStatus class Grid: ''' Module for working with game grid. ''' def __init__(self) -> None: self.__x = 10 self.__y = 10 self.__grid = list() for i in range(self.__y): ...
mili-ae/sea-battle
game/grid.py
grid.py
py
2,348
python
en
code
0
github-code
7
[ { "api_name": "utils.enums.SquareStatus.NONE", "line_number": 15, "usage_type": "attribute" }, { "api_name": "utils.enums.SquareStatus", "line_number": 15, "usage_type": "name" }, { "api_name": "utils.enums.ShipDirection", "line_number": 21, "usage_type": "name" }, { ...
8039981519
import pytest from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC @pytest.fixture def driver(): wd = webdriver.Chrome() wd.quit return wd def login(driver, ur...
MASQA/seleniumtrainingPython
test5_9.py
test5_9.py
py
4,835
python
en
code
0
github-code
7
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 8, "usage_type": "attribute" }, { "api_name": "selen...
17128506977
import unittest from pyjsg.jsglib.loader import loads as jsg_loads from ShExJSG import ShExJ shex = """{ "@context": [ "http://www.w3.org/ns/shex.jsonld", { "@base": "http://bioentity.io/vocab/" } ], "type": "Schema", "shapes": [ { "id": "http://a.example/S1", "ty...
hsolbrig/ShExJSG
tests/test_issues/test_issue_6.py
test_issue_6.py
py
538
python
en
code
4
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 25, "usage_type": "attribute" }, { "api_name": "pyjsg.jsglib.loader.loads", "line_number": 27, "usage_type": "call" }, { "api_name": "ShExJSG.ShExJ", "line_number": 27, "usage_type": "argument" }, { "api_name": "un...
38675248265
import pandas as pd import gspread from search_google import * gc = gspread.service_account(filename='creds.json') sheet_1 = gc.open_by_key('16Ez6gDbBHtIbZRkoe3h6yG4eZeERZZEZ_LzNQ-w1lpM') sheet_2 = gc.open_by_key('1SXBaISO7rlmxBkEhS7Gz98BtCQSJLs9JyV3RKDE4KEc') oxygen_db_1 = sheet_1.worksheet('Sheet For Users') oxygen...
yashbg/covid_selfhelp_chatbot
extract_data.py
extract_data.py
py
7,928
python
en
code
0
github-code
7
[ { "api_name": "gspread.service_account", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_records", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 13, "usage_type": "attribute" }, { "api_na...
45358136167
import xmltodict,requests f=open(r'C:\\Users\\pirog\\Desktop\\map1.osm',"wb") #открываем файл для записи, в режиме wb ufr = requests.get("https://stepik.org/media/attachments/lesson/245681/map2.osm") #делаем запрос f.write(ufr.content) #записываем содержимое в файл; как видите - content запроса f.close() f = open('C:\\...
pirogov-p/phyton
course_python/3.3.py
3.3.py
py
881
python
ru
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 3, "usage_type": "call" }, { "api_name": "xmltodict.parse", "line_number": 9, "usage_type": "call" } ]
30400687124
from datetime import date, datetime from Service.card_service import CardService from Service.film_service import FilmService from Service.rezervare_service import RezervareService from Service.undoredo_service import UndoRedoService from ViewModels.cardclient_str import CardClientString from ViewModels.film_str impor...
CarnuStefan/Portofoliu-CV
Cinema-Python/UserInterface/console.py
console.py
py
23,310
python
ro
code
0
github-code
7
[ { "api_name": "Service.card_service.CardService", "line_number": 29, "usage_type": "name" }, { "api_name": "Service.film_service.FilmService", "line_number": 30, "usage_type": "name" }, { "api_name": "Service.rezervare_service.RezervareService", "line_number": 31, "usage_...
9137108688
# Author: Bishal Sarang # Visualise input size vs time graph for worst and best case import matplotlib.pyplot as plt import random import time from merge_sort import merge_sort from insertion_sort import insertion_sort def visualise(): sample_size = 1 x, y1, y2, y3 = [], [], [], [] for n in ...
Bishalsarang/COMP-314-Algorithms-and-Complexity-Labworks
Lab-2 Sorting/plotter.py
plotter.py
py
1,883
python
en
code
0
github-code
7
[ { "api_name": "time.perf_counter", "line_number": 19, "usage_type": "call" }, { "api_name": "insertion_sort.insertion_sort", "line_number": 20, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 21, "usage_type": "call" }, { "api_name": "tim...
73467923744
import glob from skimage import registration, io import numpy as np g = sorted(glob.glob("movie/*jpg")) shifts = np.full((len(g), len(g), 3), np.nan, dtype=np.double) error = np.full((len(g), len(g)), np.nan, dtype=np.double) phasediff = np.full((len(g), len(g)), np.nan, dtype=np.double) image_data = [] for fname in...
dakoner/microscope_ui_experimental
old/compare.py
compare.py
py
769
python
en
code
0
github-code
7
[ { "api_name": "glob.glob", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.full", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.double", "line_number": 6,...
17209276824
from django.forms import ModelForm from .models import Post class PostForm(ModelForm): class Meta: model = Post fields = ('text', 'group') labels = { 'group': 'Группа', 'text': 'Текст поста', } help_texts = { 'group': 'Выберите группу из...
Erinnerungen/hw03_forms
yatube/posts/forms.py
forms.py
py
450
python
ru
code
0
github-code
7
[ { "api_name": "django.forms.ModelForm", "line_number": 6, "usage_type": "name" }, { "api_name": "models.Post", "line_number": 8, "usage_type": "name" } ]
74027675742
import pyglet import contextlib import colorsys import random UP = 0, +1 DOWN = 0, -1 LEFT = -1, 0 RIGHT = +1, 0 @contextlib.contextmanager def pushed_matrix(): pyglet.gl.glPushMatrix() try: yield finally: pyglet.gl.glPopMatrix() def lerp(a, b, t): return a * (1-t) + b * t def fli...
encukou/caterpillar-game
caterpillar_game/util.py
util.py
py
990
python
en
code
1
github-code
7
[ { "api_name": "pyglet.gl.glPushMatrix", "line_number": 14, "usage_type": "call" }, { "api_name": "pyglet.gl", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pyglet.gl.glPopMatrix", "line_number": 18, "usage_type": "call" }, { "api_name": "pyglet.gl...
235675361
# -*- coding: utf-8 -*- """ Created on Tue Jul 28 17:47:20 2020 @author: akanksha """ import pandas as pd import numpy as np import joblib from sklearn.ensemble import RandomForestClassifier from itertools import combinations import sklearn from functools import reduce import os import argparse impor...
comprna/METEORE
combination_model_train.py
combination_model_train.py
py
4,745
python
en
code
64
github-code
7
[ { "api_name": "warnings.filterwarnings", "line_number": 18, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 47, "usage_type": "call" }, { "api_name": "funct...
12414039875
# _*_ coding:utf-8 _*_ ''' Latent Dirichlet Allocation ''' from pyspark.sql import SparkSession from pyspark.ml.clustering import LDA spark = SparkSession.builder.appName("LDA").getOrCreate() paths="/export/home/ry/spark-2.2.1-bin-hadoop2.7/data/mllib/" dataset=spark.read.format("libsvm").load(paths+"...
ruanyangry/Spark-ML-study
scripts/LDA.py
LDA.py
py
870
python
en
code
0
github-code
7
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 10, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 10, "usage_type"...
26411193856
from enum import Enum from kivy.lang import Builder from kivy.properties import StringProperty, BooleanProperty, ListProperty from kivy.uix.boxlayout import BoxLayout from kivy.uix.label import Label from kivy.uix.togglebutton import ToggleButton from kivy.uix.widget import Widget from pubsub import pub from emulato...
jeremytrips/robot
emulator/interface/pinlayout.py
pinlayout.py
py
1,648
python
en
code
0
github-code
7
[ { "api_name": "kivy.uix.boxlayout.BoxLayout", "line_number": 32, "usage_type": "name" }, { "api_name": "kivy.uix.widget.Widget", "line_number": 32, "usage_type": "name" }, { "api_name": "kivy.properties.ListProperty", "line_number": 33, "usage_type": "call" }, { "...
42723606662
import cplex from time import time import pyrulelearn.utils def _call_cplex(imli, A, y): # A = pyrulelearn.utils._add_dummy_columns(A) no_features = -1 no_samples = len(y) if(no_samples > 0): no_features = len(A[0]) else: print("- error: the dataset is corrupted, does not have suff...
meelgroup/MLIC
pyrulelearn/cplex_wrap.py
cplex_wrap.py
py
14,253
python
en
code
15
github-code
7
[ { "api_name": "cplex.Cplex", "line_number": 20, "usage_type": "call" }, { "api_name": "cplex.SparsePair", "line_number": 131, "usage_type": "call" }, { "api_name": "cplex.SparsePair", "line_number": 161, "usage_type": "call" }, { "api_name": "cplex.SparsePair", ...
74250591584
# -*- coding: utf-8 -*- # Create your views here.here. from django import forms from models import Sale from books.models import Book from members.models import Member from django.contrib.auth.decorators import login_required from django.core.exceptions import ValidationError from django.shortcuts import render_to_resp...
chao2zhang/Library
sales/views.py
views.py
py
3,233
python
en
code
3
github-code
7
[ { "api_name": "django.forms.ModelForm", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 14, "usage_type": "name" }, { "api_name": "django.forms.ModelChoiceField", "line_number": 15, "usage_type": "call" }, { "api_name":...
70045453664
import pygame from configuracoes import Configuracoes from nave import Nave from botao import Botao import funcoes_game as fg from tela_pontuacao import TelaPontuacao from pygame.sprite import Group def rodar_game(): pygame.init() #inicializa a biblioteca paygame configuracoes = Configuracoes() #cria ...
deilsonmartins/Game-Invasao-Alien
invasao_alien.py
invasao_alien.py
py
1,897
python
pt
code
0
github-code
7
[ { "api_name": "pygame.init", "line_number": 10, "usage_type": "call" }, { "api_name": "configuracoes.Configuracoes", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 14, "usage_type": "call" }, { "api_name": "pygam...
16256634934
import pygame BLACK = (0,0,0) WHITE = (255,255,255) pygame.init() size=(800,600) screen =pygame.display.set_mode(size) pygame.display.set_caption("laser5.ogg") backgroud_position = [0,0] backgroud_image = pygame.image.load("saturn_family1.jpg").conveert() player_image = pygame.image.l...
Alancow/AE402_Alanco
41.py
41.py
py
1,056
python
en
code
0
github-code
7
[ { "api_name": "pygame.init", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pygame.displa...
18600593186
import requests from bs4 import BeautifulSoup import pandas as pd def parser(number, username): target_url = "https://home.gamer.com.tw/acgbox.php?page=" + str(number) + "&owner=" + str(username) + "&tab=&m=" HEADERS = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like G...
hong539/acgbox_crawler
src/test/check_pd01.py
check_pd01.py
py
1,090
python
zh
code
1
github-code
7
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_html", "line_number": 14, "usage_type": "call" } ]
26352979569
import os import tempfile import argparse from pysubparser import parser from pydub import AudioSegment import pyttsx3 def time_to_ms(time): return ((time.hour * 60 + time.minute) * 60 + time.second) * 1000 + time.microsecond / 1000 def generate_audio(path, rate=200, voice_idx=0): print("Generating a...
DeeepMaker/subtitle-to-audio
subtitle_to_audio.py
subtitle_to_audio.py
py
2,167
python
en
code
10
github-code
7
[ { "api_name": "pysubparser.parser.parse", "line_number": 14, "usage_type": "call" }, { "api_name": "pysubparser.parser", "line_number": 14, "usage_type": "name" }, { "api_name": "pyttsx3.init", "line_number": 16, "usage_type": "call" }, { "api_name": "pydub.AudioS...
14513391196
import os import sys import winsound from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QHBoxLayout, QGroupBox, QDialog, QVBoxLayout from PyQt5.QtGui import QIcon from playsound import playsound # from Tkinter import Tk from tkinter.filedialog import askopenfilename, Tk import PyQt5 import simpleaudio imp...
tobiaszkubiak31/Voice-freq-converter
newidea.py
newidea.py
py
5,654
python
en
code
0
github-code
7
[ { "api_name": "gettext.install", "line_number": 27, "usage_type": "call" }, { "api_name": "gettext.install", "line_number": 28, "usage_type": "call" }, { "api_name": "gettext.install", "line_number": 29, "usage_type": "call" }, { "api_name": "librosa.display", ...
1618564064
import sys #import json import urllib.parse #import urllib.request #import shutil import datetime import re import subprocess import os import os.path #import glob import signal import threading import queue import pprint #import http.client #import PIL.Image #import magic import hashlib import binascii import redis im...
qsniyg/dlscripts
download.py
download.py
py
37,960
python
en
code
3
github-code
7
[ { "api_name": "sys.path.append", "line_number": 23, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "util.tokens", "line_number": 27, "usage_type": "attribute" }, { "api_name": "util.tokens", "lin...
30648557268
from django.shortcuts import render, redirect from django.http import HttpResponse from django.contrib import messages from django.contrib.auth.decorators import login_required from django.db.models import Q # from django.contrib.auth.models import User from django.contrib.auth import authenticate, login, logout from ...
Viestar/NarrArtive
users/views.py
views.py
py
10,066
python
en
code
0
github-code
7
[ { "api_name": "django.db.models.Q", "line_number": 17, "usage_type": "call" }, { "api_name": "django.db.models.Q", "line_number": 18, "usage_type": "call" }, { "api_name": "django.db.models.Q", "line_number": 19, "usage_type": "call" }, { "api_name": "django.db.mo...
71270899745
import click from text_detection import TextDetection @click.command() @click.option( '-i', '--image', prompt=True, required=True, type=click.Path(dir_okay=False, exists=True), help='Input image to be OCR\'d.') @click.option( '-o', '--output', type=click.Path(file_okay=False, exists=True), ...
estebansolo/text-recognition
app.py
app.py
py
1,398
python
en
code
1
github-code
7
[ { "api_name": "text_detection.TextDetection", "line_number": 38, "usage_type": "call" }, { "api_name": "click.command", "line_number": 4, "usage_type": "call" }, { "api_name": "click.option", "line_number": 5, "usage_type": "call" }, { "api_name": "click.Path", ...
13333831490
# © Deltares 2023. # License notice: This file is part of RA2CE GUI. RA2CE GUI is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version # 3 of the License, or (at your option) any later version. RA2...
Deltares/ra2ce-gui
src/guitools/pyqt5/date_edit.py
date_edit.py
py
2,729
python
en
code
0
github-code
7
[ { "api_name": "widget_group.WidgetGroup", "line_number": 17, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QDateTimeEdit", "line_number": 22, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 30, "usage_type": "call" }, { "api...
121807663
from PIL import Image, ImageDraw, ImageFont from os.path import dirname, join # Constants POS_DIREC = "in.png" FILE_TYPE = ".png" _FONT_RETGULAR = ".\\fonts\\" + "Alibaba-PuHuiTi-B.ttf" _FONT_BODY = ".\\fonts\\" + "Alibaba-PuHuiTi-Regular.ttf" safe_margin = 110 def paste_all(post_path, out_path, font_path, data_Di...
JANERUBBISHTOEAT/GPA-Mentor-Mentee
CARD/make_png.py
make_png.py
py
6,440
python
en
code
1
github-code
7
[ { "api_name": "PIL.Image.open", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 17, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line...