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
2997007497
import networkx as nx from gcn import GCN import numpy as np G = nx.karate_club_graph() x = np.random.normal(size=(len(G.nodes), 2)) y = 1 gcn = GCN(n_layers=2) gcn.fit_graphs([ (G, x, y) ])
kerighan/simple-gcn
test_graph_level.py
test_graph_level.py
py
198
python
en
code
3
github-code
21
[ { "api_name": "networkx.karate_club_graph", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 7, "usage_type": "attribute" }, { "api_name": "gcn.GCN...
10844651924
from collections import deque from sys import stdin n = int(stdin.readline()) graph = [[] for _ in range(n + 1)] master = [0] * (n + 1) visited = [0] * (n + 1) for _ in range(n - 1): a, b = map(int, stdin.readline().rstrip().split()) graph[a].append(b) graph[b].append(a) def bfs(node): que = deque() ...
K1A2/algorithm_python
baekjoon/bfs_dfs/11725_트리의_부모찾기.py
11725_트리의_부모찾기.py
py
636
python
en
code
0
github-code
21
[ { "api_name": "sys.stdin.readline", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 3, "usage_type": "name" }, { "api_name": "sys.stdin.readline", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdin", "line_nu...
4227149701
import logging import tensorflow as tf import tensorflow.keras.layers as Layer from tensorflow.keras.layers import ( Input, Conv2D, Conv2DTranspose, Concatenate, Add, Multiply, Subtract, LeakyReLU, GlobalAveragePooling2D, Dense, SeparableConv2D, UpSampling2D, Depthwis...
sitongExpedera/tflite_model
script/gen_layer.py
gen_layer.py
py
2,245
python
en
code
0
github-code
21
[ { "api_name": "tensorflow.keras.models.Model", "line_number": 25, "usage_type": "call" }, { "api_name": "tensorflow.keras.layers.Input", "line_number": 30, "usage_type": "call" }, { "api_name": "tensorflow.keras.layers.Conv2D", "line_number": 36, "usage_type": "call" },...
20054036391
import pytest from fb_post.exceptions import InvalidUserException, InvalidCommentException from fb_post.exceptions import InvalidReactionTypeException from fb_post.constants import ReactionType from fb_post.models import Reaction from fb_post.utils import react_to_comment pytestmark = pytest.mark.django_db def test...
GVK289/aws_folders
clean_code/clean_code_submissions/clean_code_assignment_004/fb_post/tests/test_react_to_comment.py
test_react_to_comment.py
py
3,607
python
en
code
0
github-code
21
[ { "api_name": "pytest.mark", "line_number": 9, "usage_type": "attribute" }, { "api_name": "fb_post.constants.ReactionType.HAHA", "line_number": 16, "usage_type": "attribute" }, { "api_name": "fb_post.constants.ReactionType", "line_number": 16, "usage_type": "name" }, ...
31396671731
import argparse from pathlib import Path import jinja2 from jinja2_strcase.jinja2_strcase import to_snake def main(): parser = argparse.ArgumentParser() parser.add_argument("name", type=str, nargs="?") parser.add_argument("--path", type=str, required=True) parser.add_argument("--template", type=str, ...
shikanime/algorithm
algorithm-python/algorithm/scripts/generate.py
generate.py
py
1,122
python
en
code
1
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "jinja2.PackageLoader", "line_number": 15, "usage_type": "call" }, { "api_name": "jinja2.Environment", "line_number": 16, "usage_type": "call" }, { "api_name": "pathli...
33159727320
from django.shortcuts import render, HttpResponse from MyFastDFS import settings import os import json import subprocess from fastdfs import utils from django.http import FileResponse from django.http.response import JsonResponse import configparser from fdfs_client.client import Fdfs_client def upload(request): ...
fzxxdyh/MyFastDFS
fastdfs/views.py
views.py
py
2,775
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "MyFastDFS.settings.CONF_DIR", "line_number": 26, "usage_type": "attribute" }, { "api_name": "MyFastDFS....
7994648032
from pathlib import Path import shutil import pandas as pd where_csv = Path(".") in_csv = where_csv / "random_codes.csv" where_pdf = Path("papersToPrint") dist_pdf = Path("distribute") def rename_and_move_spares(r): """Rename files based on info from each row of the spreadsheet.""" if not pd.isnull(r["sID"])...
plomgrading/plom
contrib/onlinedist_05b_rename_papers_spares.py
onlinedist_05b_rename_papers_spares.py
py
602
python
en
code
10
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.isnull", "line_number"...
25538193277
import unittest from flask import Flask from crypto_blueprint import crypto_blueprint from cryptos import Bitcoin app = Flask(__name__) app.register_blueprint(crypto_blueprint) c = Bitcoin(testnet=True) class TestGenerateCrypto(unittest.TestCase): @classmethod def setUpClass(cls): cls.test_client = a...
CryptoMexFund/steal_btc
backend/tests/test_generate_crypto.py
test_generate_crypto.py
py
1,049
python
en
code
3
github-code
21
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "crypto_blueprint.crypto_blueprint", "line_number": 7, "usage_type": "argument" }, { "api_name": "cryptos.Bitcoin", "line_number": 8, "usage_type": "call" }, { "api_name": "unitte...
73034573173
from twisted.internet import defer from collections import namedtuple from ._base import SQLBaseStore from synapse.util.caches.descriptors import cached, cachedInlineCallbacks from synapse.api.constants import Membership, EventTypes from synapse.types import get_domain_from_id import logging import ujson as json l...
LiuFang816/SALSTM_py_data
python/matrix-org_synapse/synapse-master/synapse/storage/roommember.py
roommember.py
py
19,833
python
en
code
9
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 17, "usage_type": "call" }, { "api_name": "_base.SQLBaseStore", "line_number": 26, "usage_type": "name" }, { "api_name": "synapse.a...
37571321942
import pygame import copy import time # import SolveSudoku pygame.init() # sudoku sudoku = [[0, 0, 0, 2, 6, 0, 7, 0, 1], [6, 8, 0, 0, 7, 0, 0, 9, 0], [1, 9, 0, 0, 0, 4, 5, 0, 0], [8, 2, 0, 1, 0, 0, 0, 4, 0], [0, 0, 4, 6, 0, 2, 9, 0, 0], [0, 5, 0, 0, 0, 3, 0, 2, 8], ...
rajatsrivas/Sudoku-Solver
SudokuSolver.py
SudokuSolver.py
py
11,623
python
en
code
0
github-code
21
[ { "api_name": "pygame.init", "line_number": 7, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.display", ...
29661922928
from manim.renderer.opengl_renderer import OpenGLRenderer from manim.opengl import * from manim import * from drum import Drum from manim_editor import PresentationSectionType as pst from itertools import cycle MAIN_PATH = Path(__file__).resolve().parent.parent RESOURCE_DIR = MAIN_PATH / "resources" sys.path.append(st...
shlomi-perles/kotler_lab_lecture
kotler_lab_lecture/code/drumScene.py
drumScene.py
py
59,808
python
en
code
0
github-code
21
[ { "api_name": "spring.Spring", "line_number": 42, "usage_type": "call" }, { "api_name": "spring.set_color", "line_number": 43, "usage_type": "call" }, { "api_name": "spring.right_spring", "line_number": 44, "usage_type": "attribute" }, { "api_name": "spring.get_st...
43629344420
import pytest from bgtrainer.board import Board, Point, Team def test_Point__default_is_empty(): point = Point(0) assert point.num_checkers == 0 assert point.color is None def test_Point__setting_to_0_checkers_removes_color(): point = Point(0, 3, Team.X) point.num_checkers = 0 assert point....
oradwastaken/backgammon_trainer
tests/board_test.py
board_test.py
py
1,551
python
en
code
1
github-code
21
[ { "api_name": "bgtrainer.board.Point", "line_number": 7, "usage_type": "call" }, { "api_name": "bgtrainer.board.Point", "line_number": 13, "usage_type": "call" }, { "api_name": "bgtrainer.board.Team.X", "line_number": 13, "usage_type": "attribute" }, { "api_name":...
620432671
# -*- coding: utf-8 -*- """ Created on Tue Mar 21 16:01:30 2023 @author: sebas """ import numpy as np import pandas as pd from statistics import mode, mean, variance, quantiles # Condiciones de desnaturalizante cond=[0.0,0.1,0.2,0.4,0.6,0.8,1.0,1.5,2.0,3.0] # Tratectorias trayec=[1,2,3,4] large_ = np.zeros((4,10)...
SebastianAlzate96/Enzimas
Datos_Experimentales_Medidas_Tendencia_Central.py
Datos_Experimentales_Medidas_Tendencia_Central.py
py
2,626
python
en
code
0
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.Index", "line_numb...
33000732013
import peewee from playhouse.pool import PooledPostgresqlExtDatabase class PeeweeSqliteDbFactory: def __init__(self, path): self.path = path def __call__(self): return peewee.SqliteDatabase(self.path) class PostgresDbFactory: def __init__(self, *args, **kwargs): self.kwargs = kw...
Forked-ONS/domain_reader
domain/reader/orms/peewee.py
peewee.py
py
1,691
python
en
code
0
github-code
21
[ { "api_name": "peewee.SqliteDatabase", "line_number": 10, "usage_type": "call" }, { "api_name": "playhouse.pool.PooledPostgresqlExtDatabase", "line_number": 18, "usage_type": "call" }, { "api_name": "peewee.Model", "line_number": 22, "usage_type": "attribute" }, { ...
25084363461
from tensorflow.keras.preprocessing.text import Tokenizer from tensorflow.keras.preprocessing.sequence import pad_sequences from tensorflow.keras.layers import Embedding, LSTM, Dense, Bidirectional,\ GRU, Dropout,GlobalAveragePooling1D, Conv1D, TimeDistributed,\ Input, Concat...
lab156/arxivDownload
embed/train_ner.py
train_ner.py
py
19,994
python
en
code
7
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_number": 36, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 36, "usage_type": "call" }, { "api_name": "inspect.getfile", "l...
7725575482
import sys import argparse import os.path import numpy as np import numpy.linalg def norm(x): return numpy.linalg.norm(x, ord=np.inf) def main(): parser = argparse.ArgumentParser( description='compare a numpy .npz file to a reference file') parser.add_argument('data', metavar='A.npz', help='file...
PoliHydra/hydra
utils/npzcmp.py
npzcmp.py
py
2,151
python
en
code
11
github-code
21
[ { "api_name": "numpy.linalg.norm", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.inf", "line_number": 9, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentPars...
39894368191
#!/usr/bin/python import serial, time # initialization and open the port # possible timeout values: # 1. None: wait forever, block call # 2. 0: non-blocking mode, return immediately # 3. x, x is bigger than 0, float allowed, timeout block call ser = serial.Serial() ser.port = "/dev/ttyUSB1" ser.baudrate = 11...
ptich9km/autotest
Promwadserial.py
Promwadserial.py
py
18,271
python
en
code
0
github-code
21
[ { "api_name": "serial.Serial", "line_number": 10, "usage_type": "call" }, { "api_name": "serial.EIGHTBITS", "line_number": 13, "usage_type": "attribute" }, { "api_name": "serial.PARITY_NONE", "line_number": 14, "usage_type": "attribute" }, { "api_name": "serial.ST...
16858996957
"""Class for solving nonlinear root-finding problems""" import numpy as np from scipy.optimize import root class NonlinearFunc: """Defines a class with methods to find roots of nonlinear functions""" def __init__(self, func, pert=1e-5): """Creates a new NonlinearFunc to solve func = 0. The g...
drcnic/rpi-numpe-fall-2021
In-class exercises/18/root_class.py
root_class.py
py
1,872
python
en
code
0
github-code
21
[ { "api_name": "numpy.ndarray", "line_number": 33, "usage_type": "call" }, { "api_name": "scipy.optimize.root", "line_number": 60, "usage_type": "call" } ]
23542931422
import json with open('src\data\mbfc.json') as f: data = json.load(f) accuracy = [] bias = [] for source in data["sources"]: accuracy.append(source["accuracy"]) bias.append(source["bias"]) accuracy = set(accuracy) bias = set(bias) print(accuracy) print(bias) # Accuracy Labels: # {'', 'very high', 'n...
nrking0/polario
script/data_info.py
data_info.py
py
620
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 4, "usage_type": "call" } ]
34845665823
from unittest.mock import Mock, patch from allianceauth.eveonline.evelinks import dotlan, evewho from app_utils.testing import NoSocketsTestCase from ..core.xml_converter import eve_xml_to_html from .testdata.esi_client_stub import load_test_data from .testdata.load_entities import load_entities from .testdata.load_e...
staropera/aa-memberaudit
memberaudit/tests/test_core.py
test_core.py
py
4,069
python
en
code
0
github-code
21
[ { "api_name": "app_utils.testing.NoSocketsTestCase", "line_number": 14, "usage_type": "name" }, { "api_name": "testdata.load_eveuniverse.load_eveuniverse", "line_number": 18, "usage_type": "call" }, { "api_name": "testdata.load_entities.load_entities", "line_number": 19, ...
34519390427
""" Pexpect makes Python a better tool for controlling other applications.\ Pexpect is a pure Python module for spawning child applications; controlling them; and responding to expected patterns in their output. """ import pexpect import os import pytesseract import re from config import * from PIL import Image curren...
paradisetechsoftsolutions/Making-OCR-from-a-object-detection-model
cropping_after_detection.py
cropping_after_detection.py
py
1,970
python
en
code
0
github-code
21
[ { "api_name": "os.getcwd", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pexpect.spawn", "line_number"...
21823478123
import json from asgiref.sync import async_to_sync from channels.generic.websocket import WebsocketConsumer from .models import Message, Contact, Chat from core.models import User import datetime import time class ChatConsumer(WebsocketConsumer): def fetch_messages(self, data): Messages = Chat.o...
Abdelrahman-Farah/elms-backend
chat/consumers.py
consumers.py
py
3,383
python
en
code
0
github-code
21
[ { "api_name": "channels.generic.websocket.WebsocketConsumer", "line_number": 11, "usage_type": "name" }, { "api_name": "models.Chat.objects.get", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Chat.objects", "line_number": 14, "usage_type": "attribute" ...
27772975425
import sys sys.path.append(".") sys.path.append("..") import numpy as np import tensorflow as tf import scipy.io from CX.CX_helper import * from CX.enums import TensorAxis, Distance from easydict import EasyDict as edict vgg_rawnet = scipy.io.loadmat('/home/xuanerzh/Documents/deepzoom/VGG_Model/imagenet-vgg-verydeep-...
ceciliavision/zoom-learn-zoom
loss.py
loss.py
py
8,655
python
en
code
306
github-code
21
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
31152032372
import matplotlib.pyplot as plt import tensorflow as tf import numpy as np from tensorflow.keras.models import Sequential XTrain,XTest,YTrain,YTest = np.load('xy.npy',allow_pickle = True) cnn=Sequential() cnn = tf.keras.models.load_model("FinalExam.h5") hist=cnn.fit(XTrain,YTrain,batch_size=28,epochs=100,validation_da...
BeTheWings/InteligenciaArtificial-
FinalExam/untitled3.py
untitled3.py
py
847
python
en
code
0
github-code
21
[ { "api_name": "numpy.load", "line_number": 6, "usage_type": "call" }, { "api_name": "tensorflow.keras.models.Sequential", "line_number": 7, "usage_type": "call" }, { "api_name": "tensorflow.keras.models.load_model", "line_number": 8, "usage_type": "call" }, { "api...
37004762128
""" Asynchronous Advantage Actor Critic (A3C) with Discrete action space, Reinforcement Learning by MoFan. Add API by MrFive """ import multiprocessing import threading import tensorflow as tf import numpy as np import os import shutil import sys import copy import matplotlib.pyplot as plt from tensorflow.contrib impo...
Mrfive1001/ReinforcementLearning
6 TSP/A3C_Dis.py
A3C_Dis.py
py
12,545
python
en
code
4
github-code
21
[ { "api_name": "multiprocessing.cpu_count", "line_number": 34, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 46, "usage_type": "attribute" }, { "api_name": "tensorflow.Session", "line_number": 53, "usage_type": "call" }, { "api_name": "tensorflow...
8838458160
from django.db import models # Create your models here. class pprofile(models.Model): MY_CHOICES = ( ('1', 'تهران'), ('2', 'خوزستان'), ('3', 'بوشهر'), ('4', 'خراسان رضوی'), ('5', 'اصفهان'), ('6', 'فارس'), ('7', 'آذربایجان شرقی'), ('8', 'مازندران'), ...
Parham-Mehrabi/parhamkala-v.1
parhamkala/pprofile/models.py
models.py
py
1,019
python
fa
code
2
github-code
21
[ { "api_name": "django.db.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 25, "usage_type": "call" }, { "api_name": ...
228004709
"""Objectify an FMU case (results) as it appears on the disk.""" import os from pathlib import Path import uuid import glob import time import logging import warnings import datetime import yaml import pandas as pd from fmu.sumo.uploader._fileondisk import FileOnDisk from fmu.sumo.uploader._upload_files import uploa...
hnformentin/fmu-sumo
src/fmu/sumo/uploader/caseondisk.py
caseondisk.py
py
15,791
python
en
code
null
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.CRITICAL", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 78, "usage_type": "call" }, { "api_name": "fmu.sumo.uploade...
25671625348
import datetime import logging import time import httpx import psycopg2 from apscheduler.schedulers.background import BackgroundScheduler from psycopg2 import extras as ex conn = psycopg2.connect(...) cursor = conn.cursor() cursor.execute('''CREATE TABLE IF NOT EXISTS public.danmaku ( roomid bigint, time big...
Drelf2018/api.nana7mi.link
database.py
database.py
py
7,549
python
en
code
5
github-code
21
[ { "api_name": "psycopg2.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "time.time", "line_number": 119, "usage_type": "call" }, { "api_name": "time.time", "line_number": 165, "usage_type": "call" }, { "api_name": "time.strftime", "line_numb...
27735000515
from pprint import pprint import requests import time url = 'https://api.vk.com/method' token = 'bc2b91e2ce1e94e69513f5cdaec19f9fcced8505e612541c8908882e4e68894eba6ee38778ff315b3f9b6' # params = { # 'user_ids': '2606515', # 'access_token': f'{token}', # 'v': '5.131', # 'fields': 'sex, universities, pho...
Dimach110/HomeWork_Projects
Requests/VK_requests_01.py
VK_requests_01.py
py
634
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 24, "usage_type": "call" } ]
24543390835
import aiohttp import asyncio from concurrent.futures import ALL_COMPLETED async def fetch(client, service): async with client.get(service) as resp: return await resp.text() async def asynchronous(n): async with aiohttp.ClientSession() as client: a = await asyncio.wait({fetch(client, 'http:/...
ARBaranov/Third-semester
Repository/w12/ex1_w12.py
ex1_w12.py
py
534
python
en
code
0
github-code
21
[ { "api_name": "aiohttp.ClientSession", "line_number": 12, "usage_type": "call" }, { "api_name": "asyncio.wait", "line_number": 13, "usage_type": "call" }, { "api_name": "concurrent.futures.ALL_COMPLETED", "line_number": 13, "usage_type": "name" }, { "api_name": "a...
22231553905
import pandas as pd from sklearn.ensemble.forest import RandomForestRegressor import time dset = pd.read_csv("./data/concrete_data.csv") X = dset.iloc[:, 0:7] y = dset.iloc[:, 8] estimator = RandomForestRegressor(max_features = 3, n_estimators = 50, n_jobs = 1, oob_score = True) t0 = time.time() estimator.fit(X, y...
paulstey/random_forests
testing/python_test.py
python_test.py
py
347
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.ensemble.forest.RandomForestRegressor", "line_number": 10, "usage_type": "call" }, { "api_name": "time.time", "line_number": 12, "usage_type": "call" }, { "api_name":...
40685639854
# -*- coding: utf-8 -*- """ Created on Mon Sep 18 12:53:01 2023 @author: candy """ import cv2 import time win = cv2.imread('win.png') win_hist = cv2.calcHist([win], [2], None, [256], [0, 256]) def win_judge(img): win_now_hist = cv2.calcHist([img[66:116, 105:208]], [2], None, [256], [0, 256]) comp_percent = c...
afuku08/jikken
rei.py
rei.py
py
553
python
en
code
0
github-code
21
[ { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.calcHist", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.calcHist", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.compareHist", "line_numb...
35908199675
''' Estimating Pi. Created 28/03/23 Developed by Fraser Love ''' import numpy as np import matplotlib.pyplot as plt def darts(n): ''' Places n points uniformly in the unit square and returns a n x 3 array storing their position and a boolean value describing if they fall within the unit circle. ...
fraserlove/algo-lab
mathematical-computing/estimating_pi.py
estimating_pi.py
py
2,321
python
en
code
21
github-code
21
[ { "api_name": "numpy.random.rand", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.sum", "line_...
70437575413
"""empty message Revision ID: 2e61722a3b29 Revises: 0fd42a67381a Create Date: 2016-12-06 22:26:52.945470 """ # revision identifiers, used by Alembic. revision = '2e61722a3b29' down_revision = '0fd42a67381a' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
KoiosChen/OLT-REGISTER
migrations/versions/2e61722a3b29_.py
2e61722a3b29_.py
py
797
python
en
code
1
github-code
21
[ { "api_name": "alembic.op.add_column", "line_number": 19, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 19, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 19, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
6501423650
import argparse import os from typing import Type, Any from pyobs import version def init_cli(): # init argument parsing # for all command line parameters we set the default to an environment variable, # so they can also be specified that way parser = argparse.ArgumentParser() # config parse...
pyobs/pyobs-core
pyobs/cli/pyobs.py
pyobs.py
py
2,559
python
en
code
8
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "pyobs.version", "line_number": 27, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 33, "usage_type": "attribute" }, { "api_name": "py...
42681122117
import torch import torch.nn as nn import torch.nn.functional as F class ConvGRUCell2(nn.Module): def __init__(self, input_channel, output_channel, kernel_size): super(ConvGRUCell2, self).__init__() # filters used for gates gru_input_channel = input_channel + output_channel self.o...
gpcv-liujin/REDNet-pytorch
models/module.py
module.py
py
16,379
python
en
code
14
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
9428824391
from django.contrib.auth import login, logout, authenticate from django.db import IntegrityError from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from django.core.mail import EmailMessage from django.template.loader import render_to_string from djan...
JossueJativa/LoginConCorreoVerificacion
UsoUsuariosAuth/LoginUser/views.py
views.py
py
14,848
python
es
code
0
github-code
21
[ { "api_name": "django.shortcuts.render", "line_number": 21, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 36, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 46, "usage_type": "call" }, { "api_name"...
14588674624
import requests from bs4 import BeautifulSoup import pandas as pd """Get reviews and store them in a file, the only problem is, it might not get all the reviews present on steam, but maybe 60-75% of them. Also, if there is an error, just run it again, that should work ig """ """You only need to set the 4 pa...
Shalaka003/CDPR-Sentiment-Analysis
steam_reviews.py
steam_reviews.py
py
2,883
python
en
code
1
github-code
21
[ { "api_name": "requests.get", "line_number": 31, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "l...
14406284722
from math import floor from functools import reduce def fuel_calculator(mass): """Function to return required fuel, takes mass as the only argument""" return (floor(mass / 3) - 2) def fuel_calculator_recursive(mass): """Recursive function to return required fuel, takes into account the mass of fuel itse...
thegreatmoonmoon/moony-advent-of-code
Day1/funcs.py
funcs.py
py
1,541
python
en
code
0
github-code
21
[ { "api_name": "math.floor", "line_number": 6, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 42, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 44, "usage_type": "call" }, { "api_name": "functools.reduce", "l...
837956914
# builder class for building the model import torch import torch.nn as nn import yaml import os import sys import sys import os current_dir = os.path.dirname(os.path.abspath(__file__)) parent_dir = os.path.dirname(current_dir) sys.path.insert(0, parent_dir) sys.path.insert(0, current_dir) from layers import Layers ...
bilalkah/MachineLearning
biloCNN/builder/model.py
model.py
py
3,458
python
en
code
0
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.dirname", "l...
5924009774
# -*- coding: utf-8 -*- """ Created on Thu Aug 17 10:35:17 2017 run time analysis $job_ID$/h/work/tachyonjob/host/summary.xml @author: vincchen """ import xml.etree.ElementTree as ET import numpy as np import matplotlib.pyplot as plt xml_file = ET.ElementTree(file='17_CTM+_summary.xml') xml_root = xm...
jchenpanyu/Python_SMO
run-time_extraction_and_plot/SMO_per-stage_run-time_extraction_and_plot.py
SMO_per-stage_run-time_extraction_and_plot.py
py
1,038
python
en
code
0
github-code
21
[ { "api_name": "xml.etree.ElementTree.ElementTree", "line_number": 15, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 15, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 26, "usage_type": "call" }, { "...
74533531251
import sys import pymysql from datetime import datetime from datetime import timedelta import os try: import urllib.request as urllib2 except ImportError: import urllib2 import codecs import re datasource_id = str(sys.argv[1]) dateToStart = str(sys.argv[2]) password = str(sys.argv[3]) irctype = st...
FLOSSmole/apache_irc
1getApacheLogs.py
1getApacheLogs.py
py
5,696
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
9146514275
import gym from PIL import Image from time import sleep import argparse import os from collections import namedtuple import pandas as pd import numpy as np from tqdm import tqdm import random from PIL import Image import PIL from time import sleep import argparse import os from collections import namedtuple import pand...
k4ntz/MOC
src/gt_bounding_boxes.py
gt_bounding_boxes.py
py
4,982
python
en
code
6
github-code
21
[ { "api_name": "os.makedirs", "line_number": 30, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 32, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 35, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 3...
70370091253
#螺旋矩阵 from typing import List # class Solution: # def spiralOrder(self, matrix: List[List[int]]) -> List[int]: # bottom=len(matrix) # right=len(matrix[0]) # ret=[] # top,left=0,0 # while top<bottom and left<right:#开区间还是闭区间,得用开区间 # for i in range(left,righ...
gouwei222/leetcode-python3
leetcode54.py
leetcode54.py
py
2,210
python
en
code
2
github-code
21
[ { "api_name": "typing.List", "line_number": 29, "usage_type": "name" } ]
38735169183
from django.contrib.auth.models import AbstractUser from django.db import models class User(AbstractUser): USER = 'user' ADMIN = 'admin' roles = ( (USER, USER), (ADMIN, ADMIN), ) email = models.EmailField( 'Email', unique=True, max_length=254, error_...
sem4kulem4/foodgram-project-react
backend/foodgram_backend/users/models.py
models.py
py
1,582
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.EmailField", "line_number": 12, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 12, "usage_type": "name" }, { ...
24059591820
import RPi.GPIO as GPIO import json import time import twitter # TODO: Turn these into command line arguments OR config file parameters HASHTAG = "%23avianaart" QUERY = f'q={HASHTAG}&result_type=recent&since_id=' PINS = [11, 13, 15, 16] # physical locations on the GPIO strip def setup_gpio(pins: list): """ Set u...
tjdaley/twitterswitch
app.py
app.py
py
2,646
python
en
code
0
github-code
21
[ { "api_name": "RPi.GPIO.setwarnings", "line_number": 19, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 19, "usage_type": "name" }, { "api_name": "RPi.GPIO.setmode", "line_number": 22, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_n...
71325653493
import serial import time comm_port = "COM8" ser = serial.Serial( comm_port, baudrate=115200, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, ...
glenn-edgar/esp32_python_client
modbus_test/python_loop_back_test.py
python_loop_back_test.py
py
509
python
en
code
0
github-code
21
[ { "api_name": "serial.Serial", "line_number": 6, "usage_type": "call" }, { "api_name": "serial.PARITY_NONE", "line_number": 9, "usage_type": "attribute" }, { "api_name": "serial.STOPBITS_ONE", "line_number": 10, "usage_type": "attribute" }, { "api_name": "serial.E...
19142433047
#Use the BeautifulSoup and requests Python packages to print out a list of all the article titles on the New York Times homepage. import requests from bs4 import BeautifulSoup url = 'https://www.nytimes.com/' r = requests.get(url) r_html = r.text soup = BeautifulSoup(r_html, "lxml") title = soup.find_all("h2") for ...
katepodbelnaya/python-exercises
decode_a_web_page.py
decode_a_web_page.py
py
533
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" } ]
18588935961
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This module implements the Slicing mixin to the NDData class. from astropy import log from astropy.wcs.wcsapi import ( BaseHighLevelWCS, # noqa: F401 BaseLowLevelWCS, # noqa: F401 HighLevelWCSWrapper, SlicedLowLevelWCS, ) __all__ = [...
astropy/astropy
astropy/nddata/mixins/ndslicing.py
ndslicing.py
py
4,498
python
en
code
4,015
github-code
21
[ { "api_name": "astropy.log.info", "line_number": 112, "usage_type": "call" }, { "api_name": "astropy.log", "line_number": 112, "usage_type": "name" }, { "api_name": "astropy.log.info", "line_number": 121, "usage_type": "call" }, { "api_name": "astropy.log", "l...
6611554944
import pickle import logging from pymongo import collection def dataset_splits(data, labels, batch_size): """ Given the data, return constantly sized batches of the dataset, which will be saved to the database""" for i in range(0, len(data), batch_size): yield data[i:i + batch_size],...
DiegoStock12/kubeml
python/storage/utils.py
utils.py
py
876
python
en
code
16
github-code
21
[ { "api_name": "pymongo.collection.Collection", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pymongo.collection", "line_number": 14, "usage_type": "name" }, { "api_name": "logging.debug", "line_number": 17, "usage_type": "call" }, { "api_name": "p...
71007349814
# -*- coding: utf-8 -*- """ Created on Tue May 29 22:26:46 2018 @author: Derek Christensen """ from __future__ import print_function from __future__ import division import random import math #import numpy as np #import pandas as pd import scipy.stats as stats #import matplotlib.pyplot as plt #import ...
cderekw4224/AdvSim_AdvSimStatTechs
t-test-testing.py
t-test-testing.py
py
1,278
python
en
code
1
github-code
21
[ { "api_name": "scipy.stats.t.ppf", "line_number": 40, "usage_type": "call" }, { "api_name": "scipy.stats.t", "line_number": 40, "usage_type": "attribute" }, { "api_name": "scipy.stats", "line_number": 40, "usage_type": "name" } ]
24211980150
from enum import Enum from typing import cast import numpy as np from board import Board, Empty, Number class Direction(Enum): UP = (0, -1) DOWN = (0, 1) LEFT = (-1, 0) RIGHT = (1, 0) class Player: def __init__(self, x_pos, y_pos): self.value = "@" self.x_pos = x_pos se...
ivenw/Portfolio
hungry-snail/hungry_snail/player.py
player.py
py
2,659
python
en
code
1
github-code
21
[ { "api_name": "enum.Enum", "line_number": 9, "usage_type": "name" }, { "api_name": "board.Board", "line_number": 22, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24,...
27601105766
import threading from modules.const import Const from modules.lib.agent_utils import get_mac from modules.lib.report_queue import ReportQueue from modules.lib.reporter_manager import ReporterManager from modules.things_cloud.device import ThingsCloudDevice from modules.things_cloud.operation_handler import OperationDis...
atmark-techno/ThingsCloud-samples
Armadillo-IoT_GW/modules/things_cloud/things_cloud.py
things_cloud.py
py
3,440
python
en
code
0
github-code
21
[ { "api_name": "modules.const.Const.DEFAULT_CLOUD_REPORT_INTERVAL_SEC", "line_number": 15, "usage_type": "attribute" }, { "api_name": "modules.const.Const", "line_number": 15, "usage_type": "name" }, { "api_name": "modules.lib.agent_utils.get_mac", "line_number": 48, "usag...
850675236
from netzob.all import * from xml.etree.ElementTree import Element from xml.etree.ElementTree import SubElement from xml.etree.ElementTree import ElementTree class PitConver: def __init__(self, proto_Obj = Symbol): self.proto_Obj = proto_Obj; self.no_num = 0 self.no_raw = 0 self.no...
Du-Mu/protofuzz
exprot_pit.py
exprot_pit.py
py
16,008
python
en
code
0
github-code
21
[ { "api_name": "xml.etree.ElementTree.SubElement", "line_number": 38, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.SubElement", "line_number": 56, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.SubElement", "line_number": 80, "usage_type": "ca...
26892043460
import pymlir import numpy as np import os import math import sys import datetime from tqdm import tqdm from utils.mlir_shell import mlir_lowering from utils.mlir_parser import MlirParser from utils.preprocess import preprocess from calibration.data_selector import DataSelector SKIP_OPERATION = [ 'top.Input', 'top...
ljqljq111/tpu-mlir
python/calibration/mix_precision.py
mix_precision.py
py
10,140
python
en
code
null
github-code
21
[ { "api_name": "sys.stdout", "line_number": 35, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_number": 36, "usage_type": "attribute" }, { "api_name": "os.devnull", "line_number": 36, "usage_type": "attribute" }, { "api_name": "utils.mlir_shell.mlir...
21823467363
from rest_framework import serializers from chat.models import Chat, Contact from core.models import User class ChatSerializer(serializers.ModelSerializer): participants = serializers.SerializerMethodField() class Meta: model = Chat fields = ['id', 'participants', 'messages'] def ...
Abdelrahman-Farah/elms-backend
chat/api/serializers.py
serializers.py
py
1,408
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "rest_framework.serializers.SerializerMethodField", "line_number": 7,...
22266448406
#!/usr/bin/env python from __future__ import print_function import argparse import os import six import chainer from chainer import training from chainer.training import extensions import cifar from updater import DCGANUpdater, WGANGPUpdater from visualize import out_generated_image from dataset import * #from chai...
eggplant60/dcgan_anime
train.py
train.py
py
6,078
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 34, "usage_type": "call" }, { "api_name": "net96.Generator", "line_number": 67, "usage_type": "call" }, { "api_name": "net96.Discriminator", "line_number": 68, "usage_type": "call" }, { "api_name": "chainer.c...
7688574533
import os import pathlib import tkinter as tk class HelpWindow(tk.Toplevel): ''' Toplevel window for displaying the help pannel ''' def __init__(self, master): tk.Toplevel.__init__(self, master, # width=width, ...
AddMELAB/pydrm_GUI
pydrm/app/window_help.py
window_help.py
py
756
python
en
code
0
github-code
21
[ { "api_name": "tkinter.Toplevel", "line_number": 5, "usage_type": "attribute" }, { "api_name": "tkinter.Toplevel.__init__", "line_number": 10, "usage_type": "call" }, { "api_name": "tkinter.Toplevel", "line_number": 10, "usage_type": "attribute" }, { "api_name": "...
2672943190
import json import sys import os from pathlib import Path from cloudpathlib import S3Path def create_execution_data_file( bucket_name: str, execution_data_key: str, new_and_updated_documents_file_name: str ) -> None: """Create the test execution data file dynamically from environment variables in the test.""...
climatepolicyradar/navigator-data-ingest
integration_tests/setup_execution_data_file.py
setup_execution_data_file.py
py
1,055
python
en
code
0
github-code
21
[ { "api_name": "cloudpathlib.S3Path", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_n...
16477966532
import math import time from matplotlib import pyplot as plt from matplotlib.ticker import MultipleLocator from mypylib import random as rn from mypylib import mat_iter as mi from mypylib import root_fit as rf import numpy as np import scipy.stats as stats def stat_mean1d(arr): if len(arr)==0: return ...
Enigma811/P346
DIY project/support.py
support.py
py
2,983
python
en
code
0
github-code
21
[ { "api_name": "numpy.pi", "line_number": 38, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_number": 38, "usage_type": "call" }, { "api_name": "time.time", "line_number": 51, "usage_type": "call" }, { "api_name": "mypylib.random.myLCG", "line_nu...
1739370623
from __future__ import annotations import dataclasses from ..shared import filteraction as shared_filteraction from ..shared import filterevent as shared_filterevent from ..shared import property as shared_property from dataclasses_json import Undefined, dataclass_json from enum import Enum from posthog import utils fr...
speakeasy-sdks/posthog-python-sdk
src/posthog/models/shared/trend.py
trend.py
py
3,012
python
en
code
0
github-code
21
[ { "api_name": "enum.Enum", "line_number": 11, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 33, "usage_type": "name" }, { "api_name": "shared.filteraction.FilterAction"...
1846341162
import contextlib import sys import cv2 import k4a import numpy as np import plotly import plotly.graph_objs as go def viz(device: k4a.Device): while True: capture = device.get_capture(-1) if capture.depth.data is not None: cv2.imshow('Depth', capture.depth.data) if capture.ir...
GiveMeTheReason/gestures-navigation
kinect/run_camera.py
run_camera.py
py
2,887
python
en
code
0
github-code
21
[ { "api_name": "k4a.Device", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.imshow", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number":...
40764225335
# coding=utf-8 from scrapy.spiders import Spider from scrapy.selector import Selector # from modules.crawler.crawler.items import PAPAnnonce class PAPSpider(Spider): name = "pap" allowed_domains = ["pap.fr"] start_urls = [ "http://www.pap.fr/annonce/locations-appartement-40-annonces-par-page" ...
qingl97/instantIdea
modules/crawler/crawler/spiders/pap.py
pap.py
py
1,662
python
en
code
0
github-code
21
[ { "api_name": "scrapy.spiders.Spider", "line_number": 8, "usage_type": "name" } ]
7424787752
import scrapy import re import hashlib import os class WWW58cheSpider(scrapy.Spider): name = 'WWW58cheSpider' allowed_domains = ['58che.com'] start_urls = ['http://www.58che.com/'] def parse(self, response): for url in response.css('div#iconav ul li>a::attr(href)').getall(): #print...
wForget/SpiderDemo
ScrapyDemo/FirstDemo/FirstDemo/spiders/WWW58cheSpider.py
WWW58cheSpider.py
py
2,113
python
en
code
0
github-code
21
[ { "api_name": "scrapy.Spider", "line_number": 6, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 15, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 22, "usage_type": "call" }, { "api_name": "scrapy.Request", ...
38908466969
# -*- coding: utf-8 -*- from Display import Display from Timer import Timer from Heater import Heater from enum import Enum from queue import Queue, LifoQueue import threading import time BREAD_IMAGE = '../assets/bread.jpg' ZOPF_IMAGE = '../assets/zopf.jpg' BANANE_IMAGE = '../assets/banane.png' class Application_St...
mitea1/dukital
src/Application.py
Application.py
py
6,881
python
en
code
0
github-code
21
[ { "api_name": "enum.Enum", "line_number": 16, "usage_type": "name" }, { "api_name": "Display.Display", "line_number": 28, "usage_type": "name" }, { "api_name": "Timer.Timer", "line_number": 29, "usage_type": "name" }, { "api_name": "Heater.Heater", "line_numbe...
39798953984
from math import sqrt import itertools def solution(nums): answer = 0 for i in list(map(sum, itertools.combinations(nums, 3))): for j in range(2, int(sqrt(i)) + 1): if i % j == 0: break else: answer += 1 return answer nums = [1,2,3,4] n...
cheol-95/Algorithm
Python/080. 소수만들기/Make Primenumber.py
Make Primenumber.py
py
752
python
en
code
0
github-code
21
[ { "api_name": "itertools.combinations", "line_number": 6, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 7, "usage_type": "call" } ]
36802498247
# -*- coding:utf-8 -*- import io import os from os import rename, listdir import sys # reader .csv file import csv # http caller import requests # create xls, xlsx import openpyxl from openpyxl import Workbook # check system info import platform from time import sleep from datetime import datetime # Crawling lib f...
Mineru98/AutoBench
AutoBench.py
AutoBench.py
py
25,701
python
en
code
2
github-code
21
[ { "api_name": "sys.stdout", "line_number": 35, "usage_type": "attribute" }, { "api_name": "io.TextIOWrapper", "line_number": 35, "usage_type": "call" }, { "api_name": "sys.stdout.detach", "line_number": 35, "usage_type": "call" }, { "api_name": "sys.stderr", "...
4628839332
from config.config import Configuration from obspy import read, Stream import os class Files: ''' Mendapatkan semua files sesuai konfigurasi pencarian ''' def __init__(self): self.config = Configuration().get() def search_default(self, date): input_directory = self.config['input_directory'...
martanto/another-converter
cores/files.py
files.py
py
8,171
python
en
code
0
github-code
21
[ { "api_name": "config.config.Configuration", "line_number": 8, "usage_type": "call" }, { "api_name": "obspy.read", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "lin...
38061552837
import argparse from PIL import Image import torch from torchvision import transforms import models import os from torchvision.utils import save_image as imwrite from torch.autograd import Variable import pyiqa #from models.cdfi_adacof import CDFI_adacof import skimage.metrics #from lpips_pytorch import lpips import...
junsang7777/VOS-VFI
interpolate_video_folder+accuracy_example.py
interpolate_video_folder+accuracy_example.py
py
7,714
python
en
code
19
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "torchvision.transforms.Compose", "line_number": 34, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 34, "usage_type": "name" }, { "api...
27709300256
from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column,Integer,String,Boolean,DateTime from sqlalchemy.schema import ForeignKey from sqlalchemy.orm import relationship Base = declarative_base() class GuacamoleClientInfo(Base): __tablename__='guac...
czx0619/frontend
LABOSS-dev/backend/orm/tables.py
tables.py
py
4,818
python
en
code
0
github-code
21
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 12, "usage_type": "argument" }, { ...
37706701483
import pandas as pd import numpy as np from sklearn.model_selection import KFold from sklearn import linear_model from tqdm import tqdm from tabulate import tabulate from sklearn.metrics import mean_squared_error filename = 'sd-data_cleanedv1.csv' data = pd.read_csv(filename) cl_data = data.values # Getting data an...
CarlaZdravkovicHugod/classification-and-regression-bodysignals
baseline_reg.py
baseline_reg.py
py
1,213
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.delete", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.model_selection.KFold", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.empt...
72100084533
#coding=utf-8 import random import warnings warnings.filterwarnings("ignore") import math import os import re import numpy as np import torch import torch.utils.data as tud import sklearn.metrics as metrics from sklearn.metrics import roc_auc_score from help_helper import * # 不在20个碱基内的用X表示 aa = {"...
CSUBioGroup/TripHLApan
TripHLApan/codes/helper.py
helper.py
py
10,604
python
en
code
0
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 139, "usage_type": "call" }, { "api_name": "numpy.insert", "line_number": 143, "usage_type": "call" }, { "api_name": "numpy.array", "...
6640566763
import json import torch import tempfile import inspect from fate_arch.computing.non_distributed import LocalData from fate_arch.computing._util import is_table from federatedml.model_base import ModelBase from federatedml.nn.homo.trainer.trainer_base import get_trainer_class, TrainerBase from federatedml.nn.backend.ut...
Seceum/SeceumFL
python/federatedml/nn/homo/client.py
client.py
py
14,452
python
en
code
15
github-code
21
[ { "api_name": "federatedml.nn.homo.trainer.trainer_base.ExporterBase", "line_number": 29, "usage_type": "name" }, { "api_name": "torch.nn", "line_number": 37, "usage_type": "attribute" }, { "api_name": "torch.optim", "line_number": 44, "usage_type": "attribute" }, { ...
31934128182
from config import CONFIG # Events staging table queries STAGING_EVENTS_TABLE_CREATE = ( """ CREATE TABLE events_staging ( artist_name VARCHAR, auth VARCHAR, first_name VARCHAR, gender CHAR(1), item_in_session INT, last_name VARCHAR, length DECIMAL, ...
fvendrameto/redshift-data-warehouse
sql_queries.py
sql_queries.py
py
5,648
python
en
code
0
github-code
21
[ { "api_name": "config.CONFIG", "line_number": 36, "usage_type": "name" }, { "api_name": "config.CONFIG", "line_number": 37, "usage_type": "name" }, { "api_name": "config.CONFIG", "line_number": 38, "usage_type": "name" }, { "api_name": "config.CONFIG", "line_n...
19767511042
## @package layers # Module caffe2.python.layers.layers from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core, schema, scope from caffe2.python.layers.tags import TagContext from collections i...
lumtis/react-native-caffe2
caffe2/caffe2/python/layers/layers.py
layers.py
py
10,652
python
en
code
39
github-code
21
[ { "api_name": "caffe2.python.schema.List", "line_number": 15, "usage_type": "call" }, { "api_name": "caffe2.python.schema", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.int64", "line_number": 15, "usage_type": "attribute" }, { "api_name": "caffe...
17947707383
import time import cv2 import mediapipe as mp import numpy as np from pose.stats import * from PIL import ImageFont, ImageDraw, Image import pyttsx3 class PoseDetector: mpDraw = mp.solutions.drawing_utils mpPose = mp.solutions.pose pose = mpPose.Pose() arrows = [] first_time = True speech = { ...
henna-kim/the-way-of-yoga-v2
pose/Pose.py
Pose.py
py
5,914
python
en
code
1
github-code
21
[ { "api_name": "mediapipe.solutions", "line_number": 11, "usage_type": "attribute" }, { "api_name": "mediapipe.solutions", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pose.stats", "line_number": 13, "usage_type": "name" }, { "api_name": "cv2.cvtC...
32064631011
import datetime import errno import getpass import happy.state import itertools import logging import multiprocessing.pool import os import pickle import socket import sys import time import urlparse import webhdfs LOG = logging.getLogger() def setup_socket(port, sock=socket.socket()): try: sock.bind(('1...
mk23/happy
lib/runner.py
runner.py
py
3,502
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 19, "usage_type": "call" }, { "api_name": "socket.error", "line_number": 24, "usage_type": "attribute" }, { "api_name": "errno.EADDRINUSE", ...
27118237403
import asyncio import copy from datetime import datetime import discord from discord.ext import commands class LockServer(commands.Cog): """Lock the server and block everyone to send messages""" def __init__(self, bot): self.bot = bot self.db = bot.plugin_db.get_partition(self) @commands....
sskewer/Modmail-Plugins
lockserver/lockserver.py
lockserver.py
py
1,698
python
en
code
1
github-code
21
[ { "api_name": "discord.ext.commands.Cog", "line_number": 8, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 8, "usage_type": "name" }, { "api_name": "copy.copy", "line_number": 21, "usage_type": "call" }, { "api_name": "copy.copy"...
70746942773
import requests import urllib.parse import json import csv import pandas as pd from time import sleep google_key = 'PUT_GOOGLE_KEY_HERE' base_url = 'https://maps.googleapis.com/maps/api/geocode/json?' wiki_df = pd.read_csv('project\data\wiki_table.csv') const_df = pd.read_csv('project\data\constituents_csv.csv') wit...
basedrhys/global-stock-vis
scripts/stock_location.py
stock_location.py
py
1,367
python
en
code
1
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 15, "usage_type": "call" }, { "api_name": "urllib.parse.parse.quote_p...
8252766984
from astropy.table import Table, hstack import numpy as np import pickle from astropy.stats import sigma_clip from scipy import stats from scipy.interpolate import CubicSpline from sklearn import neighbors from sklearn.neighbors import NearestNeighbors from src.models import StarCluster from src.param_loader import D...
jorgeanais/reddening-correction
src/difred.py
difred.py
py
12,228
python
en
code
1
github-code
21
[ { "api_name": "astropy.table.Table", "line_number": 23, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", ...
10071766504
"""Testing Sansorchi package""" import pytest from sansorchi import data from sansorchi import Sansorchi sansorchi = Sansorchi(level=None) @pytest.mark.parametrize("word", data.fa["word"]) def test_word(word): """Test word function""" assert sansorchi.remove_bad_words(word) == "" @pytest.mark.parametrize(...
mmdbalkhi/Sansorchi
tests/test_word.py
test_word.py
py
453
python
en
code
15
github-code
21
[ { "api_name": "sansorchi.Sansorchi", "line_number": 7, "usage_type": "call" }, { "api_name": "sansorchi.remove_bad_words", "line_number": 13, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 10, "usage_type": "call" }, { "api_name": ...
9669794417
from collections import namedtuple #data structure for what is stored in the database, corresponds to the db columns MetricTableData = namedtuple( 'MetricData', [ 'name', 'region_name', 'elevation', 'elevation_unit', 'value', 'cycletime', 'forecast_hour',...
NOAA-PSL/score-db
src/harvest_translator.py
harvest_translator.py
py
894
python
en
code
0
github-code
21
[ { "api_name": "collections.namedtuple", "line_number": 4, "usage_type": "call" } ]
11809323663
import numpy as np import os import pickle import collections def savetopickle(filepath, obj): with open(filepath, 'wb') as f: pickle.dump(obj, f, protocol=pickle.HIGHEST_PROTOCOL) f.close() def loadfrompickle(filepath): with open(filepath, 'rb') as f: obj = pickle.load(f...
isaac60103/text_summary
ts_case_model/common/statics.py
statics.py
py
5,055
python
en
code
3
github-code
21
[ { "api_name": "pickle.dump", "line_number": 9, "usage_type": "call" }, { "api_name": "pickle.HIGHEST_PROTOCOL", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 15, "usage_type": "call" }, { "api_name": "os.listdir", "...
19435008211
import sys import Settings import Tracker import datetime class JiraTracker(object): def main(self): try: settings = Settings.Settings(sys.argv[1]) try: date = datetime.date.strftime(sys.argv[2], '%Y-%m-%d') except IndexError: date = date...
dor-denis/JiraTracker
build/lib/JiraTracker/JiraTracker.py
JiraTracker.py
py
902
python
en
code
0
github-code
21
[ { "api_name": "Settings.Settings", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "datetime.date.strftime", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.date"...
38523355984
# Kashyap Todi. 13 May, 2020. # Script to check a folder containing video and subtitle files for compliance to SIGCHI requirements. # Before running the script, create a folder with all video and subtitle files (no sub-folders or other files) # Include the path to this folder as the argument # Optionally, include a tim...
kashtodi/SIGCHI-Video-Checker
check_format.py
check_format.py
py
4,552
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 23, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "...
12265171060
import scrapy def clear_text(text): return ( text .replace("\t", "") .replace("\n", "") .replace("\r", "") .strip() ) class BlogSpider(scrapy.Spider): name = 'blogspider' start_urls = ['https://www.ludopedia.com.br/leiloes/ultimas-24-horas'] def parse(self, r...
paulatavares16/ludotracker
myspider.py
myspider.py
py
2,147
python
en
code
0
github-code
21
[ { "api_name": "scrapy.Spider", "line_number": 12, "usage_type": "attribute" } ]
7227963057
import requests import matplotlib.pyplot as plt import concurrent.futures import yaml from datetime import date from utils import MatchData from PIL import Image import base64 import io import os yaml_file = yaml.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "keys.yaml")), Loader=yaml.FullLoader) ...
THajiyev/FRC-Head-to-Head-Record
graphing.py
graphing.py
py
6,599
python
en
code
24
github-code
21
[ { "api_name": "yaml.load", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_numbe...
7949340449
import math import pandas as pd from IPython.display import display # Function to get Option Price for a given M def optionpricecalculator(M, u, d, p): putoptionlist = [] calloptionlist =[] for i in range(M+1): calloptionlist.append(0) putoptionlist.append(0) for i in range(M+1): ...
jwalit24/Option-Pricing-and-CAPM
lab1/200123026_q1.py
200123026_q1.py
py
1,575
python
en
code
0
github-code
21
[ { "api_name": "math.exp", "line_number": 21, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 22, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 42, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 42, "us...
34426243885
import snowflake.connector con_def = snowflake.connector.connect(user='nidaalyssads', host='zh80053.ap-southeast-3.aws.snowflakecomputing.com', account='zh80053', region = 'ap-southeast-3', ...
kevin-developeramat/digitalskolade12
nida/datamart_delete_nida.py
datamart_delete_nida.py
py
1,782
python
en
code
null
github-code
21
[ { "api_name": "snowflake.connector.connector.connect", "line_number": 3, "usage_type": "call" }, { "api_name": "snowflake.connector.connector", "line_number": 3, "usage_type": "attribute" }, { "api_name": "snowflake.connector", "line_number": 3, "usage_type": "name" } ]
27176163953
import csv import io from models import Modelz from apps.home import blueprint from flask import render_template, request, jsonify, make_response, Response from jinja2 import TemplateNotFound import sys sys.path.append(r"C:\Users\Jodi\Documents\GitHub\beans") Modelz = Modelz() @blueprint.route('/overview', methods=...
joderz/beans
apps/home/routes.py
routes.py
py
11,871
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.Modelz", "line_number": 11, "usage_type": "name" }, { "api_name": "flask.request.method", ...
16650094424
import torch import torch.nn as nn __all__ = ['ConfidenceBCELoss'] class ConfidenceBCELoss(nn.Module): def __init__(self, *args, conf_factor=0, **kwargs): r"""Assumes input from model have already passed through sigmoid""" super(ConfidenceBCELoss, self).__init__() self.base_loss = nn.BCELo...
alabamagan/deep_learning_projects
rAIdiologist/rAIdiologist/config/loss/rAIdiologist_loss.py
rAIdiologist_loss.py
py
1,593
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.BCELoss", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn", "line_num...
25457006387
from collections import deque def bfs(startHeight, startWidth, goalHeight, goalWidth, visitList): global result, resultCheck bfsDeque = deque() bfsDeque.append([startHeight, startWidth, 0]) while bfsDeque: thisDeque = bfsDeque.popleft() thisHeight = thisDeque[0] thisWidth = th...
jy940408/algorithm_python
PYTHONBreadthFirstSearch/장군.py
장군.py
py
2,450
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" } ]
7303170257
import os import time import copy from scipy.io import loadmat, savemat import matplotlib.pyplot as plt import numpy as np fs = 16e3 # Sampling frequency def if_earlier(time_str, std_time_str='2014-07-01', fmt_str='%Y-%m-%d'): std_struct_time = time.strptime(std_time_str, fmt_str) struct_time = time.strpti...
yw5aj/YoshiRecordingData
data15/calibrate.py
calibrate.py
py
2,359
python
en
code
2
github-code
21
[ { "api_name": "time.strptime", "line_number": 13, "usage_type": "call" }, { "api_name": "time.strptime", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path.join", "line...
20985559182
import json import time import typing import bs4 import dotenv import numpy import requests from DBClient import DBClient from WatchTimestamp import WatchTimestamp ENV = dotenv.dotenv_values() DB_URI = ENV["DB_URI"] URL = ENV["URL"] TG_API_KEY = ENV["TELEGRAM_API_KEY"] TG_CHAT_ID = ENV["CHAT_ID"] TIMEOUT_SECONDS = ...
CodeOfRob/chrono24Scraper
app.py
app.py
py
1,911
python
en
code
0
github-code
21
[ { "api_name": "dotenv.dotenv_values", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 23, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 25, "usage_type": "call" }, { "api_name": "typing.Union", ...
37763352976
import os import secrets from flask import Flask, render_template, request, flash, redirect, send_from_directory from werkzeug.utils import secure_filename import torch import torchaudio from model import model, transform, channel, label_encoder UPLOAD_FOLDER = "static/upload" ALLOWED_EXTENSIONS = {"mp3"} SAVED_NAME ...
abdaloth/Quranthon
main_local.py
main_local.py
py
2,386
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 16, "usage_type": "call" }, { "api_name": "secrets.token_urlsafe", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 25, "usage_type": "call" }, { "api_name": "flask.request...
4514724238
from enum import Enum from typing import List, Iterable, Tuple import numpy as np from nptyping import Array import Strings class GameStatus(Enum): NOT_FINISHED = 1 PLAYER1_WIN = 2 PLAYER2_WIN = 3 DRAW = 4 class Board: def __init__(self, board_size: int = 3, symbol1: str = Strings.DEFAULT_SY...
aanellien/TicTacToe
Board.py
Board.py
py
6,279
python
en
code
0
github-code
21
[ { "api_name": "enum.Enum", "line_number": 11, "usage_type": "name" }, { "api_name": "Strings.DEFAULT_SYMBOL1", "line_number": 20, "usage_type": "attribute" }, { "api_name": "Strings.DEFAULT_SYMBOL2", "line_number": 21, "usage_type": "attribute" }, { "api_name": "S...
6974707714
import tkinter as tk from tkinter import filedialog as fd from tkinter import messagebox as mbox import os import imageio import PIL.Image, PIL.ImageTk import cv2 from tkinter import * from PIL import Image,ImageTk from matplotlib import pyplot as plt import numpy as np plt.style.use("dark_background") root= tk.T...
AbhishekKarmakar5/Brain-Tumour-Localization-and-Detection
Impro.py
Impro.py
py
13,072
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 13, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_na...
2836508644
import numpy as np import torch from torch import nn from torch.nn import TransformerEncoderLayer from torch.nn import TransformerEncoder def pos_enc(max_seq_len, emb_size): ''' Init the sinusoid position encoding table ''' # keep dim 0 for padding token position encoding zero vector position_enc = np.ar...
qianrenjian/bert4rec-1
bertModel.py
bertModel.py
py
3,532
python
en
code
1
github-code
21
[ { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 17...
20553851925
from typing import Union from fastapi import FastAPI #models from models.message_model import MessageApi #data conection Mysql from config.mysql_conection import hostMysql from config.mysql_conection import userMysql from config.mysql_conection import passwordMysql from config.mysql_conection import dbMysql #data c...
rodrigog84/fsatapi_reclamos
main.py
main.py
py
7,564
python
es
code
0
github-code
21
[ { "api_name": "openai.api_key", "line_number": 41, "usage_type": "attribute" }, { "api_name": "config.openai_conf.openai_apikey", "line_number": 41, "usage_type": "name" }, { "api_name": "fastapi.FastAPI", "line_number": 44, "usage_type": "call" }, { "api_name": "...
9097362501
import ray import jax.tree_util from .base import DeviceObject from .register import dispatch from secretflow.device.device.pyu import PYUObject class HEUObject(DeviceObject): """HEU Object Attributes: data: The data hold by this Heu object location: The party where the data actually resides ...
primihub/hackathon
winning-project/Vpcdap/code/隐私求交/PSI/secretflow/device/device/heu_object.py
heu_object.py
py
2,960
python
en
code
18
github-code
21
[ { "api_name": "base.DeviceObject", "line_number": 8, "usage_type": "name" }, { "api_name": "ray.ObjectRef", "line_number": 20, "usage_type": "attribute" }, { "api_name": "register.dispatch", "line_number": 36, "usage_type": "call" }, { "api_name": "register.dispat...