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
10674707362
from decimal import Decimal import pytest import requests from ibptws.calculadoras import DeOlhoNoImposto from ibptws.calculadoras import CEM def test_deolhonoimposto_inicio(): calc = DeOlhoNoImposto() assert calc.carga_federal().is_zero() assert calc.carga_federal_nacional().is_zero() assert calc....
base4sistemas/ibptws
ibptws/tests/test_calculadoras.py
test_calculadoras.py
py
6,292
python
pt
code
10
github-code
70
[ { "api_name": "ibptws.calculadoras.DeOlhoNoImposto", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.instancia_resp_sucesso_produto", "line_number": 25, "usage_type": "attribute" }, { "api_name": "decimal.Decimal", "line_number": 28, "usage_type": "call" ...
13092272304
import numpy as np import matplotlib.pyplot as plt from math import sqrt, pi # ~ import calcMiso micdata = np.genfromtxt('MicrostructureText_Layer4.mic',skip_header=4) grains = np.genfromtxt('GrainsLayer4.csv',skip_header=9) nGrains,z = grains.shape out=np.zeros((nGrains,8)) for grainNr in range(nGrains): grain = grai...
marinerhemant/MIDAS
utils/PlotFFNF.py
PlotFFNF.py
py
978
python
en
code
18
github-code
70
[ { "api_name": "numpy.genfromtxt", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.mean", "line_num...
3663130973
# -*- coding: utf-8 -*- from testsIntegrationDB.context import instabotpatrik from testsIntegrationDB.context import testcommon import logging import unittest import pymongo import instabotpatrik.repository import instabotpatrik.model import datetime from testsIntegrationDB import common import pytz import freezegun l...
Patrik-Stas/InstabotPatrik
testsIntegrationDB/test_repository.py
test_repository.py
py
7,792
python
en
code
0
github-code
70
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 19, "usage_type": "attribute" }, { "api_name": "testsInt...
6061516069
import pygame from pygame.math import Vector2 import random import math import sys pygame.init() screen_info = pygame.display.Info() # Set the window size to match the screen size screen_width, screen_height = screen_info.current_w, screen_info.current_h window_size = (screen_width, screen_height) WIN = ...
ATR2400/Alex_T_Projects
Pong/Pong.py
Pong.py
py
6,038
python
en
code
0
github-code
70
[ { "api_name": "pygame.init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display.Info", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.display.set_m...
74817666787
import linecache import re from spell_checker import * def dict_all() -> dict: dic_data = {} count = 26 count_2 = 1000 letter = "A" for j in range(count): for i in range(count_2): k = "".join([letter, str(i).zfill(3)]) dic_data[k] = [] letter...
Levon-98/spell-checker
checker.py
checker.py
py
2,300
python
en
code
0
github-code
70
[ { "api_name": "linecache.getline", "line_number": 65, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 69, "usage_type": "call" } ]
70094861986
import cv2 faceCascade = cv2.CascadeClassifier("Model/OpenCVTrainedPara.xml") cap = cv2.VideoCapture(0) # open the camera cap.set(3, 640) # set Width cap.set(4, 480) # set Height while True: success, img = cap.read() # read in the information of the camera now gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ...
0010SS/MLXAIFaceRec
PlainFaceDetection.py
PlainFaceDetection.py
py
1,073
python
en
code
0
github-code
70
[ { "api_name": "cv2.CascadeClassifier", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY"...
31556609688
from databaseWorker import * from flask import Flask, render_template, redirect, request app = Flask("Chat", template_folder = "template") prepareDb("userLoginMessage.db") login = "" @app.route('/') def index(): rows = getLoginsAndMessages("userLoginMessage.db") saveLogin = "<textarea name=\"login\" id=\"tex...
Septiemiy/NG_2023_Paschenko_Danilo
Python/Lesson_6/Task1/webserver.py
webserver.py
py
842
python
en
code
0
github-code
70
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.request...
72381170785
""" This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT...
genomewalker/refine-contigs
refine_contigs/split.py
split.py
py
12,250
python
en
code
6
github-code
70
[ { "api_name": "logging.getLogger", "line_number": 40, "usage_type": "call" }, { "api_name": "sys.setrecursionlimit", "line_number": 42, "usage_type": "call" }, { "api_name": "datatable.options", "line_number": 46, "usage_type": "attribute" }, { "api_name": "datata...
71100510626
import socket from datetime import datetime from server import Server class ServerLinear(Server): def __init__(self) -> None: super().__init__() def run_server(self): server_socket = socket.socket( socket.AF_INET, socket.SOCK_STREAM, proto=0) server_socket.bind(('', self.p...
SpongeFrogy/Cpp_and_unix-algorithms
sem7/lab4/server_linear.py
server_linear.py
py
999
python
en
code
0
github-code
70
[ { "api_name": "server.Server", "line_number": 6, "usage_type": "name" }, { "api_name": "socket.socket", "line_number": 11, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 12, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", ...
12097125564
import os import json import boto3 def lambda_handler(event, context): TABLE_NAME = os.environ["TABLE_NAME"] dynamodb = boto3.resource('dynamodb') table = dynamodb.Table(TABLE_NAME) return { "statusCode": 200, "body": json.dumps({ "success": True, "items":...
a-poor/hello-cicd-sam
functions/items/app.py
app.py
py
367
python
en
code
0
github-code
70
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "boto3.resource", "line_number": 9, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 14, "usage_type": "call" } ]
35209379675
# -*- coding: utf-8 -*- # # Imports import torch from torch.utils.data.dataset import Dataset import torchlanguage.transforms import urllib import os import zipfile import json import codecs import random import pickle import numpy as np from datetime import datetime # Reuters C50 dataset class ReutersC50Dataset(Dat...
nschaetti/TorchLanguage
torchlanguage/datasets/ReutersC50Dataset.py
ReutersC50Dataset.py
py
8,602
python
en
code
9
github-code
70
[ { "api_name": "torch.utils.data.dataset.Dataset", "line_number": 20, "usage_type": "name" }, { "api_name": "torchlanguage.transforms.transforms.Token", "line_number": 52, "usage_type": "call" }, { "api_name": "torchlanguage.transforms.transforms", "line_number": 52, "usag...
13267434383
import numpy as np from matplotlib import pyplot as plt nes = [10, 20, 50, 80, 100, 120, 200] plt.rcParams.update({'font.size': 15}) fig = plt.figure() ax = fig.subplots() data = [] lines = [] names = [] for n in nes: data.append(np.load('data/energies-%d.npy' % n)) lines.append(ax.plot(data[-1][0], data[-1]...
SilverCol/DMRG-Methods
energy.py
energy.py
py
509
python
en
code
0
github-code
71
[ { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "...
29804954416
#!/usr/bin/python3 """Reformating a set of downloaded csvs.""" import pandas as pd import numpy as np import urllib import string import multiprocessing import os import argparse import sys # Base url and debugging stuff for pandas pd.set_option('max_colwidth', 2000) pd.set_option('display.width', 20000) BASE_URL = '...
pcrady/when_i_work
script.py
script.py
py
2,226
python
en
code
0
github-code
71
[ { "api_name": "pandas.set_option", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 15, "usage_type": "call" }, { "api_name": "string.ascii_lowercase", "line_number": 22, "usage_type": "attribute" }, { "api_name": "panda...
71034392226
import uuid from dataclasses import field from datetime import timedelta from typing import List, Optional, Union from jose import jwt from pydantic.dataclasses import dataclass from kpm.settings import settings as s from kpm.shared.domain.time_utils import now_utc_sec def _get_expire_time( valid_from: int, exp...
keepemapp/back
kpm/shared/entrypoints/auth_jwt.py
auth_jwt.py
py
5,406
python
en
code
0
github-code
70
[ { "api_name": "typing.Union", "line_number": 14, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 14, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 20, "usage_type": "argument" }, { "api_name": "typing.Optiona...
5979454854
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('geo', '0001_initial'), ('events', '0001_initial'), ] operations = [ migrations.CreateModel( name='Grante...
ecds/attorney
attorney/apps/people/migrations/0001_initial.py
0001_initial.py
py
2,087
python
en
code
0
github-code
71
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 15, "usage_type": "call" }, ...
7462780183
from pathlib import Path from shlib import Run import nestedtext as nt import arrow import os import re now = arrow.now() def create_logfile(age, extra=''): path = Path('test.log') path.write_text(f"entry written = {age} days ago.{extra}") ctime = now.shift(days=-age, seconds=-600) os.utime(str(path),...
KenKundert/ntlog
tests/test_script.py
test_script.py
py
5,671
python
en
code
2
github-code
70
[ { "api_name": "arrow.now", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "os.utime", "line_number": 14, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 41, ...
40547835316
import pygame as pygame pygame.init() fsize = 20 font = pygame.font.SysFont("comicsans", fsize) left = 42 middle = 540 right = 1030 first_height = 100 second_height = 250 third_height = 400 middle_height = 300 small_radius = 35 big_radius = 145 din = 10 small_delta = 37 big_delta = 177 army_price = 20...
Rudolf199/python-code-review
consts.py
consts.py
py
2,781
python
en
code
1
github-code
70
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.font.SysFont", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.transform.scale"...
38075733308
import cv2 import pandas as pd import matplotlib.pyplot as plt import datetime import numpy as np import os import progressbar class Dataset_Class(): def __init__(self, sequence, lidar=True, progress_bar=True, low_memory=True): self.lidar = lidar self.low_memory = low_memory ...
Smatnemo/EventBasedVisualOdometry
Event-BasedVisualOdometry/visual_odometry/dataclass.py
dataclass.py
py
6,371
python
en
code
0
github-code
70
[ { "api_name": "os.listdir", "line_number": 20, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 22, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 24, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 32, ...
37925822321
import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt def change_to_celsius(x): '''change temperature from Fahr to C''' degree = (x-32)*5/9 return degree def analyze(data, figure_filename): '''perform analysis on mosquito data data is a DataFrame with columns 'te...
yanssbu/software-carpentry-workshop
analyze_mosquito_data.py
analyze_mosquito_data.py
py
1,271
python
en
code
0
github-code
71
[ { "api_name": "statsmodels.api.OLS.from_formula", "line_number": 19, "usage_type": "call" }, { "api_name": "statsmodels.api.OLS", "line_number": 19, "usage_type": "attribute" }, { "api_name": "statsmodels.api", "line_number": 19, "usage_type": "name" }, { "api_nam...
25164755438
import os import shutil import v4l2capture from ctypes import * import struct import array from fcntl import ioctl import cv2 import numpy as np import time from sys import argv import getopt import sys import select import termios import tty import threading import paddlemobile as pm from paddlelite import * import co...
Amoza-Theodore/Baidu2020
src_old/Car_Class_client.py
Car_Class_client.py
py
36,913
python
en
code
0
github-code
71
[ { "api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES", "line_number": 28, "usage_type": "attribute" }, { "api_name": "PIL.ImageFile", "line_number": 28, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 37, "usage_type": "call" }, { "api_name": ...
37284784561
from __future__ import (absolute_import, division, print_function, unicode_literals) from itertools import groupby from urllib.request import urlopen import json import requests import pygal import math def download_file(): json_url = "https://raw.githubusercontent.com/muxuezi/btc/master/btc_close_2017.json" ...
sunyujun16/python_work
practices/chapter_16/16-2/btc_close_2017.py
btc_close_2017.py
py
3,511
python
en
code
0
github-code
71
[ { "api_name": "urllib.request.urlopen", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "json.load", "line_...
16438043046
from django.urls import path from .views import (cart,checkout,store,PoductDetailView, Product_tag_ListView,PoductCreateView,UpdateItem,store_search, productUpdateView,owner_ListView,productDeleteView) urlpatterns = [ path('',store.as_view(),name='store'), path('cart/',cart ,name='cart'), ...
Milansojitra/E-farmfactory
efarmfactory/store/store_urls.py
store_urls.py
py
1,007
python
en
code
0
github-code
71
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "views.store.as_view", "line_number": 8, "usage_type": "call" }, { "api_name": "views.store", "line_number": 8, "usage_type": "name" }, { "api_name": "django.urls.path", ...
27111261047
import pyodbc def loadDatabase(): databasenames = [] # database = 'master' # DESKTOP - P2C1O13\SQLEXPRESS2008 # N11 - TO - TBSQL01 DBload_cnxn = pyodbc.connect( 'DRIVER={SQL Server};SERVER=DESKTOP-P2C1O13\SQLEXPRESS2008;database=master;Trusted_Connection=yes;') cursor = DBload_c...
shivnaren/GUIDynamic
DD/LoadDatabase.py
LoadDatabase.py
py
603
python
en
code
0
github-code
71
[ { "api_name": "pyodbc.connect", "line_number": 7, "usage_type": "call" } ]
17874438561
import csv import numpy import time import selector as slctr from sklearn.model_selection import train_test_split import pandas as pd import fitnessFUNs import argparse import numpy as np from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler parser = argparse.ArgumentParser() parser.ad...
rabeeqasem/cervical_cancer_detection
task_3_modeling/Two-Step-Feature-Enhancement/main.py
main.py
py
5,155
python
en
code
0
github-code
70
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.expand_di...
16424227389
import cv2 def count_faces_webcam(): # Load the pre-trained face cascade classifier face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml') # Open the default webcam webcam = cv2.VideoCapture(0) while True: # Read the current frame fro...
Farhan-ali123/Count-number-of-faces
count number of faces.py
count number of faces.py
py
1,172
python
en
code
0
github-code
71
[ { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.data", "line_number": 5, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.cvtColor", ...
28402340091
from __future__ import print_function import json import boto3 print('Loading function') #Expects snapshotIds def lambda_handler(event, context): print("Received event: " + json.dumps(event, indent=2)) # get EC2 client ec2 = boto3.client('ec2') # get the snapshotIds passed snapshotIds ...
exNewbie/terraform-aws-automate-ebs-snapshot
scripts/SSM-Automation-CheckSnapshots.py
SSM-Automation-CheckSnapshots.py
py
1,019
python
en
code
0
github-code
71
[ { "api_name": "json.dumps", "line_number": 11, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 14, "usage_type": "call" } ]
10427929465
import pandas as pd from progressbar import * import os import json import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # minSupport, minConfigure minSupport = 0.1 minConfigure = 0.5 property = ['location', 'Area Id', 'beat', 'Priority', 'Incident Type Id', 'Event Number'] # Association_rules cla...
zhangguolei/TheSecondHomework
Algo.py
Algo.py
py
7,678
python
en
code
0
github-code
71
[ { "api_name": "pandas.read_csv", "line_number": 118, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 119, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 120, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
37244776188
from expertai.nlapi.cloud.client import ExpertAiClient import os import json language = 'en' os.environ["EAI_USERNAME"] = 'ambarish.ganguly@gmail.com' os.environ["EAI_PASSWORD"] = 'Ambarish@1234' class textinsights: keyphrases = "" keyentities = "" keyrelationsrelated ="" sentiments = "" emotions ...
ambarishg/expert_ai_app
textanalytics.py
textanalytics.py
py
3,499
python
en
code
0
github-code
71
[ { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "expertai.nlapi.cloud.client.ExpertAiClient", "line_number": 19, "usage_type": "call" }, { "api_name...
40974894368
# db.py import os import psycopg2 from langchain.vectorstores.pgvector import PGVector from psycopg2 import OperationalError from psycopg2.extras import Json, DictCursor class Database: def __init__(self): self.conn = None def connect(self): if not self.conn: try: ...
LiamConnell/codelabyrinth
coder/db.py
db.py
py
1,323
python
en
code
7
github-code
71
[ { "api_name": "psycopg2.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 21, "usage_type": "call" }, { "api_name": "psycopg2.OperationalError", "line_number": 23, "usage_type": "name" }, { "api_name": "psycopg2.extras....
3008753434
import json from indy.did import create_and_store_my_did from indy.ledger import build_node_request, build_nym_request, build_get_txn_request from indy.pool import refresh_pool_ledger from plenum.test.node_catchup.helper import waitNodeDataEquality, \ ensureClientConnectedToNodesAndPoolLedgerSame from plenum.test....
thesauri/indy-plenum
plenum/test/pool_transactions/helper.py
helper.py
py
28,924
python
en
code
null
github-code
70
[ { "api_name": "plenum.client.wallet.Wallet", "line_number": 34, "usage_type": "call" }, { "api_name": "plenum.common.constants.TXN_TYPE", "line_number": 39, "usage_type": "name" }, { "api_name": "plenum.common.constants.TARGET_NYM", "line_number": 40, "usage_type": "name"...
23470399848
''' Created on Mar 31, 2014 @author: anuvrat Use python 2.7 for this one ''' from ortools.constraint_solver import pywrapcp def read_puzzle(lines): puzzle_name = lines[0] puzzle = [] for line in lines[1:]: puzzle.extend(map(int, list(line.strip()))) return puzzle_name.strip(), puzz...
anuvrat/project-euler-python
src/problem_91_100/problem_96.py
problem_96.py
py
2,237
python
en
code
0
github-code
71
[ { "api_name": "ortools.constraint_solver.pywrapcp.Solver", "line_number": 24, "usage_type": "call" }, { "api_name": "ortools.constraint_solver.pywrapcp", "line_number": 24, "usage_type": "name" } ]
72014849511
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse import os import torch from dataloader import DataLoader from poketto.nlp.data import MachineTranslationDataLoader from poketto.pytorch.train import Trainer from transformer.models import Transformer def parse_args(): parser = argparse.ArgumentPars...
Yevgnen/transformer
examples/train.py
train.py
py
4,279
python
en
code
0
github-code
71
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "dataloader.DataLoader", "line_number": 57, "usage_type": "call" }, { "api_name": "poketto.nlp.data.MachineTranslationDataLoader", "line_number": 58, "usage_type": "argument"...
32454792626
import zmq import sys import hashlib import os import threading partSize = 1024 * 1024 * 10 def uploadFile2(filename, socket): with open(filename, "rb") as f: finished = False part = 0 while not finished: print("Uploading part {}".format(part)) f.seek(part*partSize)...
edgos7/cliente-servidor
ServidorArchivos/ftclient.py
ftclient.py
py
6,699
python
en
code
0
github-code
71
[ { "api_name": "hashlib.sha1", "line_number": 26, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 37, "usage_type": "call" }, { "api_name": "zmq.REQ", "line_number": 44, "usage_type": "attribute" }, { "api_name": "os.remove", "line_number":...
34875784737
# coding:utf-8 # @time:2022/3/4下午4:45 # @author:sdh from PIL import Image import os import glob def get_white_background_images(convert=True): """ get white background :param convert: :return: """ if convert: ori_images_path = "/media/lessmart/work/sdh/math/print_math/" ori_im...
newuserforstudy/latex2img
process_background.py
process_background.py
py
1,232
python
en
code
0
github-code
71
[ { "api_name": "glob.glob", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 24, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 24, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": ...
43483655438
#!/usr/bin/env python3 from datetime import datetime, timedelta import matplotlib.pyplot as plt from scipy.signal import filtfilt, butter import bench as _b import numpy as np _TPoint = tuple[datetime, float] def _last_n(data: list[_TPoint], delta: timedelta): assert len(data) > 0 res: list[_TPoint] = [] ...
twh2898/fridge
analyze/plot.py
plot.py
py
3,178
python
en
code
0
github-code
71
[ { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 12, "usage_type": "name" }, { "api_name": "scipy.signal.butter", "line_number": 56, "usage_type": "call" }, { "api_name": "scipy.signal....
24584275053
from typing import Optional, List import collections # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def levelOrderBottom(self, root: Optional[TreeNode]) -> List[List...
brandoneng000/LeetCode
medium/107.py
107.py
py
894
python
en
code
0
github-code
71
[ { "api_name": "typing.Optional", "line_number": 10, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 12, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 10, "usage_type": "name" } ]
24762643657
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djangocms_reversion2', '0003_pageversion_dirty'), ] operations = [ migrations.AlterModelOptions( name='pageversi...
Blueshoe/djangocms-reversion2
djangocms_reversion2/migrations/0004_auto_20170526_1128.py
0004_auto_20170526_1128.py
py
628
python
en
code
9
github-code
71
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterModelOptions", "line_number": 14, "usage_type": "call" ...
36627493814
import re from typing import Dict from pytranscoder import verbose from pytranscoder.media import MediaInfo valid_predicates = ['vcodec', 'res_height', 'res_width', 'runtime', 'filesize_mb', 'fps', 'path'] numeric_predicates = ['res_height', 'res_width', 'runtime', 'filesize_mb', 'fps'] class Rule: def __init__...
mlsmithjr/transcoder
pytranscoder/rule.py
rule.py
py
2,736
python
en
code
110
github-code
71
[ { "api_name": "typing.Dict", "line_number": 12, "usage_type": "name" }, { "api_name": "pytranscoder.media.MediaInfo", "line_number": 23, "usage_type": "name" }, { "api_name": "pytranscoder.verbose", "line_number": 24, "usage_type": "name" }, { "api_name": "pytrans...
7840439894
from django.urls import path from . import views urlpatterns = [ path('', views.home, name='home'), path('sign_up', views.sign_up, name='sign_up'), path('sign_in', views.sign_in, name='sign_in'), path('sign_out', views.sign_out, name='sign_out'), path('post/', views.post_list, name='post_list'), ...
kiritka-jain/my-first-blog
blog/urls.py
urls.py
py
665
python
en
code
0
github-code
71
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
38051232808
import numpy as np import matplotlib.pyplot as plt def u0(x): return x + np.cos(x) def F2(x, y1, y2): return x * np.sin(x) - np.cos(x) * y2 - np.sin(x) * y1 def F(x, y1, y2): F_y1 = y2 F_y2 = x * np.sin(x) - np.cos(x) * y2 - np.sin(x) * y1 return [F_y1,F_y2] def Euler(xn, y_y1, y_y2, h): for...
Mashhch/chislakilab
labachislaki5.py
labachislaki5.py
py
6,280
python
en
code
0
github-code
71
[ { "api_name": "numpy.cos", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 12, "us...
29459160281
import datasets as ds import torch import numpy as np from transformers import SwinForImageClassification, Trainer, TrainingArguments, AutoFeatureExtractor dataset = ds.load_dataset("imagefolder", data_dir="./datasmall",cache_dir='./cache') #print(dataset) ''' #making sure it is working ex=dataset['train'][40...
asparsa/face-quality-assessment
dataset_train.py
dataset_train.py
py
2,892
python
en
code
0
github-code
70
[ { "api_name": "datasets.load_dataset", "line_number": 6, "usage_type": "call" }, { "api_name": "transformers.AutoFeatureExtractor.from_pretrained", "line_number": 19, "usage_type": "call" }, { "api_name": "transformers.AutoFeatureExtractor", "line_number": 19, "usage_type...
30188244452
import sys _module = sys.modules[__name__] del sys input_data = _module model = _module test = _module word2vec = _module from _paritybench_helpers import _mock_config, patch_functional from unittest.mock import mock_open, MagicMock from torch.autograd import Function from torch.nn import Module import abc, collection...
eladhoffer/pytorch-jit-paritybench
generated/test_Adoni_word2vec_pytorch.py
test_Adoni_word2vec_pytorch.py
py
4,289
python
en
code
null
github-code
71
[ { "api_name": "sys.modules", "line_number": 2, "usage_type": "attribute" }, { "api_name": "_paritybench_helpers.patch_functional", "line_number": 16, "usage_type": "call" }, { "api_name": "unittest.mock.mock_open", "line_number": 17, "usage_type": "call" }, { "api...
13770456309
from cgi import print_form import discord import random import asyncio import cv2 import numpy as np from PIL import Image import copy num_of_rows = 4 num_of_cols = 4 empty_square = ':white_large_square:' blue_square = ':blue_square:' brown_square = ':brown_square:' orange_square = ':orange_square:' yellow_square = '...
Shynderio/Game2048
g2048.py
g2048.py
py
3,295
python
en
code
0
github-code
71
[ { "api_name": "random.randint", "line_number": 54, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.rot90", "line_number": 90, "usage_type": "call" }, { "api_name": "numpy.rot90", "line_num...
18428331192
#!/usr/bin/python3 """ BaseModel class that defines all common attributes/methods for other classes """ import uuid from datetime import datetime import models import json time_format = "%Y-%m-%dT%H:%M:%S.%f" class BaseModel: """ BaseModel: The base or parent class for all the classes Features: ...
Boscomunich/AirBnB_clone
models/base_model.py
base_model.py
py
2,204
python
en
code
1
github-code
71
[ { "api_name": "uuid.uuid4", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 29, "usage_type": "name" }, { "api_name": "datetime.datetime....
37967132644
import pygame as pg import math from enum import Enum size = width, height = 1400, 1000 num_players = 3 class ImageInsEnum(Enum): LEFT = 0 FORWARD = 1 RIGHT = 2 PAUSE = 4 control_mapping = {"0": ImageInsEnum.LEFT, "1": ImageInsEnum.FORWARD, "2": ImageInsEnum.RIGHT, "3": ImageInsEnum.PAUSE} data_dir ...
alessio-b-zak/SwishFish-game
settings.py
settings.py
py
855
python
en
code
0
github-code
71
[ { "api_name": "enum.Enum", "line_number": 8, "usage_type": "name" }, { "api_name": "math.atan2", "line_number": 29, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 33, "usage_type": "call" } ]
22765869924
from typing import Union, List, Tuple, Iterable, Any, cast, Dict, Iterator, Generator, Callable import math import json import elasticsearch.helpers from elasticsearch.exceptions import TransportError, RequestError from elasticsearch_dsl import Q, A, Search from elasticsearch_dsl.query import Query as EsQuery from pyda...
mohammadnakhaee/nomad
nomad/search.py
search.py
py
51,142
python
en
code
0
github-code
71
[ { "api_name": "typing.Any", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.cast", "line_number": 50, "usage_type": "call" }, { "api_name": "nomad.app.v1.models.Query", "line_number": 50, "usage_type": "argument" }, { "api_name": "nomad.metainfo.e...
38763983274
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, FileType import z3 from pysynthlab.helpers.parser.src.ast import CommandKind, ASTVisitor from pysynthlab.synthesis_problem import SynthesisProblem def main(args): file = args.input_file.read() problem = SynthesisProblem(file, int(args.sygus...
gschandan/PySynthLab
pysynthlab/runner.py
runner.py
py
4,545
python
en
code
0
github-code
71
[ { "api_name": "pysynthlab.synthesis_problem.SynthesisProblem", "line_number": 11, "usage_type": "call" }, { "api_name": "z3.Solver", "line_number": 16, "usage_type": "call" }, { "api_name": "z3.parse_smt2_string", "line_number": 18, "usage_type": "call" }, { "api_...
32709393055
import sys sys.path += ["."] # Python 3 hack from nose.tools import assert_equal, assert_is_instance, assert_in, assert_not_in, assert_true, assert_false from GeneratingDataset import * from Dataset import DatasetSeq import numpy as np import os import unittest import better_exchook better_exchook.replace_traceback...
mhsamavatian/CSE5245
get_supported_device/returnn/tests/test_GeneratingDataset.py
test_GeneratingDataset.py
py
1,630
python
en
code
0
github-code
71
[ { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "better_exchook.replace_traceback_format_tb", "line_number": 13, "usage_type": "call" }, { "api_name": "Log.log.initialize", "line_number": 15, "usage_type": "call" }, { "api_na...
17879022244
import uuid import subprocess import dash from dash import html from dash import dcc from dash.dependencies import Output, Input, State import plotly.graph_objects as go import base64 import tempfile import scipy.io.wavfile as wav import numpy as np external_stylesheets = [ 'https://stackpath.bootstrapcdn.com/boots...
ccrome/diy-pcb
app.py
app.py
py
2,731
python
en
code
0
github-code
71
[ { "api_name": "dash.html.Div", "line_number": 16, "usage_type": "call" }, { "api_name": "dash.html", "line_number": 16, "usage_type": "name" }, { "api_name": "dash.html.Div", "line_number": 17, "usage_type": "call" }, { "api_name": "dash.html", "line_number": ...
10890830047
import multiprocessing import os import threading import time from queue import Queue from threading import Thread from psutil import virtual_memory from grandpa.utils.standard import print_warning, check_debug class MultiprocessingManager: """ Manages the multiprocessing of the framework. """ def _...
Proxima7/GrandPa
src/grandpa/multiprocessing_manager.py
multiprocessing_manager.py
py
5,522
python
en
code
2
github-code
71
[ { "api_name": "queue.Queue", "line_number": 18, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 47, "usage_type": "attribute" }, { "api_name": "multiprocessing.cpu_count", "line_number": 51, "usage_type": "call" }, { "api_name": "threading.Threa...
38967624438
from PIL import Image, ImageFilter import os # Set maxsize of image(s) maxsize = (100, 100) # IMPORTS IMAGE THEN APPLIES GRAYSCALE AND SIZES IMAGE def proccess_img(): infile = "Chelsey1.png" f, e = os.path.splitext(infile) outfile = f + ".png" # If file is not the proper format then convert files if infile !...
AlejandroJRosales/iPhoneCompatableProjects
Python/projectmcc/1-6-18.py
1-6-18.py
py
1,048
python
en
code
0
github-code
71
[ { "api_name": "os.path.splitext", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image", "line_nu...
71521124390
from __future__ import print_function import sqlite3 import numpy as np from os.path import join from pandas import read_csv from perfect_match.data_access.batch_augmentation import BatchAugmentation class DataAccess(BatchAugmentation): DB_FILE_NAME = "twins.db" TABLE_PAIRS = "pairs" GENDER_MALE = 0 ...
d909b/perfect_match
perfect_match/data_access/twins/data_access.py
data_access.py
py
12,315
python
en
code
112
github-code
71
[ { "api_name": "perfect_match.data_access.batch_augmentation.BatchAugmentation", "line_number": 10, "usage_type": "name" }, { "api_name": "sqlite3.connect", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }...
10283237060
# -*- coding: utf-8 -*- """ Abstract Dataset Loader ======================= Defines the abstract class implementing support for dataset loading: - :class:`colour_datasets.loaders.AbstractDatasetLoader` """ from __future__ import division, unicode_literals from abc import ABCMeta, abstractmethod from six import ad...
dwtian/colour-datasets
colour_datasets/loaders/abstract.py
abstract.py
py
3,214
python
en
code
null
github-code
71
[ { "api_name": "abc.abstractmethod", "line_number": 122, "usage_type": "name" }, { "api_name": "six.add_metaclass", "line_number": 26, "usage_type": "call" }, { "api_name": "abc.ABCMeta", "line_number": 26, "usage_type": "argument" } ]
19756031621
#coding=utf-8 # File : cut_wav.py # Time : 2021/12/15 14:39:17 # Author : Jinghan Peng # Desciption: 切割无效音频为小的chunk import os, sys from re import L import wave from pydub import AudioSegment from pydub.utils import make_chunks from tqdm import tqdm from multiprocessing import Pool import collecti...
NeoBryant/audio_tools
tsvad/cut_chunk_wav_noise.py
cut_chunk_wav_noise.py
py
2,443
python
en
code
0
github-code
71
[ { "api_name": "os.makedirs", "line_number": 22, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31,...
19014301872
import cv2 import numpy as np import easyocr import PIL.Image as pil_img def Book_Image(Snap): pic = pil_img.open(Snap) img = np.array(pic).astype("uint8") picture = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) image = cv2.rotate(picture, cv2.cv2.ROTATE_90_COUNTERCLOCKWISE) reader = easyocr.Re...
rameshkumars12/BookShelf
Detect_Text.py
Detect_Text.py
py
465
python
en
code
0
github-code
71
[ { "api_name": "PIL.Image.open", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 1...
14056354796
import yaml import pandas as pd import numpy as np def build_cpu_and_mem_distribution_dataframes(trace_df : pd.DataFrame, col_flavor_cpu : str = 'vmcorecount', col_flavor_mem : str = 'vmmemory', col_vm_created : str = 'vmcreated', col_vm_deleted : str = 'vmdelete...
jacquetpi/cloudfactory
analyserlib/distributionanalyzer.py
distributionanalyzer.py
py
5,343
python
en
code
2
github-code
71
[ { "api_name": "pandas.DataFrame", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 32, "usage_type": "attribute" }, { "api_name": "pandas.Da...
15568341839
import sqlite3 fname = input('Enter file name: ') if(len(fname) < 1): fname = 'mbox.txt' fh = open(fname) emailList = list() dic = dict() for line in fh: if( line.startswith('From: ') ): pieces = line.split() email = pieces[1] secPc = email.split('@') orgN = secPc[1] ...
sunzid02/fun-with-python
database/assignment/assignment2.py
assignment2.py
py
1,574
python
en
code
0
github-code
71
[ { "api_name": "sqlite3.connect", "line_number": 37, "usage_type": "call" } ]
3434147452
# -*- coding: utf-8 -*- """ Created on Thu Jul 13 23:46:18 2017 @author: Yangzj """ import requests import re import os import time #page = 1 i=0 user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' headers = { 'User-Agent' : user_agent } def getHTML(url): try: r = re...
YZJ/python
dowpic/dowpic.py
dowpic.py
py
1,400
python
en
code
1
github-code
71
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 33, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 33, "usage_type": "call" }, { "api_name": "time.time", "line_numbe...
31622630368
# @Time : 2022-09-20 21:09 # @Author : Phalange # @File : 128. 最长连续序列.py # @Software: PyCharm # C'est la vie,enjoy it! :D from typing import List class Solution: def __init__(self): self.nodes = dict() self.parents = dict() self.sizeMap = dict() def longestConsecutive(self, nums: Lis...
enternityFan/LeetCodePythonVersion
哈希表/128. 最长连续序列.py
128. 最长连续序列.py
py
1,704
python
en
code
0
github-code
71
[ { "api_name": "typing.List", "line_number": 16, "usage_type": "name" } ]
25232096991
"""Deep Residual Network with Stochastic Depth.""" import cPickle as pickle import datetime as dt import gzip import lasagne as nn import numpy as np import sys import theano import theano.tensor as T import time from Deep_Residual_Learning_CIFAR10 import load_data from Deep_Residual_Learning_CIFAR10 import iterate_mi...
mollymr305/stochastic-depth
stochastic_depth.py
stochastic_depth.py
py
6,809
python
en
code
0
github-code
71
[ { "api_name": "sys.setrecursionlimit", "line_number": 19, "usage_type": "call" }, { "api_name": "helpers.report", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.d...
5748701276
import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import plotly.graph_objs as go import pandas as pd df = pd.read_csv('./data/Stapleton.csv') app = dash.Dash() # https://dash.plot.ly/dash-core-components/dropdown # We need to construct a d...
tytechortz/climate_project
practice_files/plot3.py
plot3.py
py
1,463
python
en
code
0
github-code
71
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "dash.Dash", "line_number": 10, "usage_type": "call" }, { "api_name": "dash_html_components.Div", "line_number": 19, "usage_type": "call" }, { "api_name": "dash_html_component...
24136532530
from django.shortcuts import render from django.http import JsonResponse from firstApp.models import Employee from rest_framework.permissions import IsAuthenticated # Create your views here. def employeeView(request): emp = { 'id':123, 'name':'Pavan', 'sal': 100000 } data = Employ...
pavan-suryawanshi/django_exercise
djangorest/firstProject/firstApp/views.py
views.py
py
485
python
en
code
0
github-code
71
[ { "api_name": "firstApp.models.Employee.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "firstApp.models.Employee.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "firstApp.models.Employee", "line_number": 14, "usage_type": "n...
35622816479
# -*- coding: utf-8 -*- """ Created on Thu Mar 31 17:35:22 2022 @author: Gabriel """ from osgeo import gdal import numpy as np import cv2 import tkinter as tk from tkinter import filedialog import os root = tk.Tk() img_new = filedialog.askopenfilename(filetypes=(("tif files","*.tif"),("All files",...
GabrielCampigoto/Classifcacao-e-modelagem-de-dados-geoespaciais
change.py
change.py
py
1,516
python
en
code
0
github-code
71
[ { "api_name": "tkinter.Tk", "line_number": 15, "usage_type": "call" }, { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 16, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 16, "usage_type": "name" }, { "api_name": "tkin...
20087321344
# * ---------------- * # # ** Deep Reinforcement Learning Nano Degree ** # project: Navigation # author: Matthias Schinacher # # the script implements Q-learning with transitions- replay # optionally using priority replay # # the model used for the Q- function approximation is a simple # neural network w...
MatthiasSchinacher/MS_DRLND_Navigation
ms_drlndnav_pr.py
ms_drlndnav_pr.py
py
19,540
python
en
code
0
github-code
71
[ { "api_name": "sys.argv", "line_number": 39, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 41, "usage_type": "attribute" }, { "api_name": "os.path.path.isfile", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path.path", "l...
41296249744
#!/usr/bin/env python # coding: utf-8 # In[1]: headers = { 'Connection': 'keep-alive', 'Accept': 'application/json, text/plain, */*', 'x-nba-stats-token': 'true', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36'...
angelozorn/NBA-MVP-Machine-Learning-Regression-Model
NBA MVP Machine Learning Regression Model.py
NBA MVP Machine Learning Regression Model.py
py
17,431
python
en
code
0
github-code
71
[ { "api_name": "requests.get", "line_number": 160, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 163, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 171, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", ...
8142537844
import numpy as np from sklearn.neighbors import NearestNeighbors import numpy as np def calc_SL(W,n_objs=3): num = min(n_objs,len(W)) neigh = NearestNeighbors(num) neigh.fit(W) neighbors = neigh.kneighbors(W, num)[0].tolist() SL = [np.prod(item[1:num]) for item in neighbors] return SL def d...
YUYUTA/MOEADpy
DeleteVector.py
DeleteVector.py
py
2,590
python
en
code
3
github-code
71
[ { "api_name": "sklearn.neighbors.NearestNeighbors", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.prod", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 28, "usage_type": "call" }, { "api_name": "nump...
35418989888
import numpy as np import pytest import torch from tsbatteries import preprocessing from tsbatteries.preprocessing.pipeline import (PipelineCompiler, PipelineDataset) from tsbatteries.tests.helpers import make_classification_problem @pytest.fixture() def static_pipelin...
jambo6/batteries
tsbatteries/tests/preprocessing/test_pipeline.py
test_pipeline.py
py
2,324
python
en
code
0
github-code
71
[ { "api_name": "tsbatteries.preprocessing.Pipeline", "line_number": 13, "usage_type": "call" }, { "api_name": "tsbatteries.preprocessing", "line_number": 13, "usage_type": "name" }, { "api_name": "tsbatteries.preprocessing.NegativeFilter", "line_number": 15, "usage_type": ...
2926054683
import pytest from sabnzbd.newsunpack import * class TestNewsUnpack: @pytest.mark.parametrize( "test_input, expected_output", [ (["cmd1", 9, "cmd3"], '"cmd1" "9" "cmd3"'), # sending all commands as valid string (["", "cmd1", "5"], '"" "cmd1" "5"'), # sending blank string...
Per9/sabnzbd
tests/test_newsunpack.py
test_newsunpack.py
py
1,050
python
en
code
null
github-code
71
[ { "api_name": "pytest.mark.parametrize", "line_number": 7, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 7, "usage_type": "attribute" } ]
74662231268
from typing import List class Solution: def maxArea(self, height: List[int]) -> int: left=0 right = len(height)-1 max_area = 0 while left < right: min_height = min(height[left], height[right]) area = (right - left) * min_height max_area = max(area,...
XinchaoGou/MyLeetCode
11. Container With Most Water.py
11. Container With Most Water.py
py
468
python
en
code
0
github-code
71
[ { "api_name": "typing.List", "line_number": 3, "usage_type": "name" } ]
33389925579
# sample 300 points from torus S1 x S1 and 100 points from circle S1 (belonging to the first S1) # Compute distance among the points import math import numpy as np import h5py def angle_distance(phi, theta): s = min(phi, theta) l = max(phi, theta) distance = min(l-s, s + 2 * math.pi - l) return dista...
UDATG/analogous_bars
examples/data/torus_circle/generate_data.py
generate_data.py
py
2,141
python
en
code
3
github-code
71
[ { "api_name": "math.pi", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random.uniform", "line_n...
33528487295
import datetime import logging import os import sys from datetime import date, timedelta from os.path import exists from pandas.tseries.offsets import * import numpy as np import pandas as pd from numpy.core.arrayprint import _formatArray from pandas._libs.tslibs import Timedelta, Timestamp from bsbetl import g from ...
t0rus1/bsbetl
bsbetl/calc_helpers.py
calc_helpers.py
py
27,220
python
en
code
0
github-code
71
[ { "api_name": "pandas.DataFrame", "line_number": 20, "usage_type": "attribute" }, { "api_name": "bsbetl.g.OVERVIEW_STORE_FQ.format", "line_number": 25, "usage_type": "call" }, { "api_name": "bsbetl.g.OVERVIEW_STORE_FQ", "line_number": 25, "usage_type": "attribute" }, ...
39389478309
import pygame pygame.font.init() def mostrar_texto_centrado(screen,texto,center_x,center_y,color,fuente): render = fuente.render(texto,True,color) rect_text = render.get_rect(center = (center_x,center_y)) #rect_text_saludar.center = rect_saludar.center screen.blit(render,rect_text) def crear_boton(s...
Aabril01/mi-primer-jueguito-pygame
otros.py
otros.py
py
749
python
en
code
0
github-code
71
[ { "api_name": "pygame.font.init", "line_number": 2, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 2, "usage_type": "attribute" }, { "api_name": "pygame.Rect", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pygame.font.SysFont"...
2594894170
''' Title : functions_file Objective : Functions to process and transform TCGA data from https://portal.gdc.cancer.gov/ with R Created by: Kevin Brinneman for UTSA Electrical & Computer Engineering Created on: 2022-01-23 This script will recursively iterate over all folder to decompress GZ files.Once decompr...
kbrinn/Cancer-XGBoost-UTSA-2022
TCGA_biomakers_feature_extraction/data_processing/data_processing_SQL/data_format_JSON.py
data_format_JSON.py
py
4,622
python
en
code
0
github-code
71
[ { "api_name": "pathlib.Path", "line_number": 64, "usage_type": "call" }, { "api_name": "gzip.open", "line_number": 66, "usage_type": "call" }, { "api_name": "shutil.copyfileobj", "line_number": 67, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_nu...
41226234340
from django.conf.urls import patterns, include, url from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^', include('website.urls', namespace='website')), url(r'^', include('registration.auth_urls...
gchandrasa/secondbook
secondbook/urls.py
urls.py
py
750
python
en
code
0
github-code
71
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 4, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 4, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 6, "usage_type": "call" }, { "api...
16968874191
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Aug 24 14:51:43 2023 @author: hafizzzh """ import json import time import calendar import hashlib import requests import pandas as pd import os from dotenv import load_dotenv load_dotenv() df_ev = pd.DataFrame() getLoop = True url = "https://gateway.m...
hafizzzh/marvel-character-analysis
codes/scrap_events.py
scrap_events.py
py
2,166
python
en
code
0
github-code
70
[ { "api_name": "dotenv.load_dotenv", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "time.gmtime", "line_number": 34, "usage_type": "call" }, { "api_name": "calendar.timegm", ...
18029786171
from django.db.models import Sum, F, Case, When from rest_framework import serializers from .models import StockTransaction from users.serializers import UserSerializer from stocks.serializers import StockSerializer class StockTransactionsSerializer(serializers.ModelSerializer): user = UserSerializer(read_only=T...
qhqnf/asset-dashboard
transactions/serializers.py
serializers.py
py
2,313
python
en
code
0
github-code
71
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 8, "usage_type": "name" }, { "api_name": "users.serializers.UserSerializer", "line_number": 10, "usage_typ...
37041127044
import numpy as np from utils import * from sklearn.ensemble import RandomForestClassifier def cv_train_rfcls(x,y,n_estimators,min_samples_leaf,max_feature,num_cross=10): cross_train_x, cross_train_y, cross_valid_x, cross_valid_y = cross_validation(x,y,num_cross) num_cross = len(cross_train_x) max_score = ...
USTBwanghao/TIGsPred
new_tigs/rfcls.py
rfcls.py
py
1,871
python
en
code
0
github-code
71
[ { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 37, "usage_type": "call" },...
15148153079
""" Bayesian Determinisitc Policy Gradient evaluated on th didactic "chain" environment """ import tensorflow as tf from gym import Wrapper from tensorflow.python.layers.utils import smart_cond from tensorflow.python.ops.variable_scope import get_local_variable import chi from chi import Experiment from chi import ex...
jhebmann/plow-7
chi/examples/experimental/bdpg_chains2.py
bdpg_chains2.py
py
3,857
python
en
code
0
github-code
71
[ { "api_name": "chi.Experiment", "line_number": 23, "usage_type": "name" }, { "api_name": "gym.make", "line_number": 32, "usage_type": "call" }, { "api_name": "gym.Env", "line_number": 31, "usage_type": "attribute" }, { "api_name": "chi.set_loglevel", "line_num...
15204462847
""" Class holding data of one or more features """ from logging import warning from typing import List, Tuple, Union import xarray as xa import pandas as pd import numpy as np import numpy.typing as npt from proteolizarddata.data import PyTimsDataHandleDDA from proteolizardalgo.feature_loader_dda import FeatureLoaderDD...
TimOliverMaier/pystoms
src/pystoms/aligned_feature_data.py
aligned_feature_data.py
py
4,544
python
en
code
0
github-code
71
[ { "api_name": "numpy.typing.NDArray", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.typing", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.float64", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.typin...
1559572423
import json from django.contrib import messages from django.shortcuts import get_object_or_404, redirect from django.urls import reverse_lazy from .models import Confirmation, PendingConfirmation from core.views import SearchAndMenuCreateView class ConfirmationCreateView(SearchAndMenuCreateView): model = Confir...
dreadkopp/activejob_bootstrap
activejob/activejob/datenweitergabe/views.py
views.py
py
1,238
python
en
code
0
github-code
70
[ { "api_name": "core.views.SearchAndMenuCreateView", "line_number": 11, "usage_type": "name" }, { "api_name": "models.Confirmation", "line_number": 12, "usage_type": "name" }, { "api_name": "django.urls.reverse_lazy", "line_number": 14, "usage_type": "call" }, { "a...
6946117297
import dash import dash_bootstrap_components as dbc from dash import Input, Output, State, dcc, html, Dash, callback dash.register_page(__name__, path="/nosotros") style = {"padding": "1rem 1rem"} layout = html.Div([ html.H2("Team 181"), html.Hr(), html.H4("We're so cool, give us prize!") ], style=style)
santiagotirado/DS4A-app
pages/nosotros.py
nosotros.py
py
320
python
en
code
0
github-code
71
[ { "api_name": "dash.register_page", "line_number": 5, "usage_type": "call" }, { "api_name": "dash.html.Div", "line_number": 9, "usage_type": "call" }, { "api_name": "dash.html", "line_number": 9, "usage_type": "name" }, { "api_name": "dash.html.H2", "line_numb...
71264500071
import unittest, pytest from utils import Utils from pathlib import Path import os import shutil import nltk nltk.download('wordnet') from nltk.corpus import wordnet as wn class TestUtils(unittest.TestCase): maxDiff = None # == TEST GET RANDOM WORD == # def test_get_random_word_returns_a_string_found_in...
CZboop/X-is-to-Y-API
tests/test_utils.py
test_utils.py
py
7,013
python
en
code
1
github-code
71
[ { "api_name": "nltk.download", "line_number": 7, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "utils.Utils", "line_number": 18, "usage_type": "call" }, { "api_name": "nltk.corpus.wordnet.w...
15568433296
#!/bin/python3 import os import argparse import torch import sys def add_padding_to_image(img, padding_width: int): # Array of zeros of shape (img + padding_width) img_with_padding = torch.zeros(( img.shape[0] + padding_width * 2, # Multiply with two because we need padding on all sides img....
ahmad-mirsalari/TransLib
mixed_precision/convolutioncl/data_generator.py
data_generator.py
py
12,697
python
en
code
2
github-code
71
[ { "api_name": "torch.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 44, "usage_type": "call" }, { "api_name": "torch.float16", "line_number": 51, "usage_type": "attribute" }, { "api_name": "torch.float16", "line_...
41174497657
# This is a brute force approach exploiting all the permutations # Which still runs in sufficiently short time. # For a more sophisticated approach: https://blog.dreamshire.com/project-euler-68-solution/ import itertools gon_dimension = 5 numbers = range(1, gon_dimension * 2 + 1) solutions = [] for outside_numbers i...
JakobTimmermann/coding_challenges
project_euler/p68-magic_5-gon_ring/main.py
main.py
py
1,493
python
en
code
0
github-code
71
[ { "api_name": "itertools.combinations", "line_number": 10, "usage_type": "call" }, { "api_name": "itertools.permutations", "line_number": 12, "usage_type": "call" } ]
6009362463
import pytest from ephios.core.models import Qualification, QualificationCategory, QualificationGrant from ephios.plugins.qualification_management.importing import ( DeserializedQualification, QualificationChangeManager, ) SANH_UUID = "b1faab38-2e7c-4507-b753-06d1e653412d" NOTSAN_UUID = "d114125b-7cf4-49e2-89...
ephios-dev/ephios
tests/plugins/qualification_management/conftest.py
conftest.py
py
2,579
python
en
code
20
github-code
71
[ { "api_name": "ephios.plugins.qualification_management.importing.DeserializedQualification", "line_number": 15, "usage_type": "call" }, { "api_name": "ephios.plugins.qualification_management.importing.DeserializedQualification", "line_number": 28, "usage_type": "call" }, { "api_n...
27261333454
from tensorflow.keras.models import Sequential, load_model as keras_load_model from tensorflow.keras.layers import Dense, Activation, Dropout, Flatten, Conv2D, MaxPooling2D, BatchNormalization from tensorflow.keras.optimizers import Adam, SGD from tensorflow.keras.metrics import categorical_crossentropy from tensorflow...
AngeloAlgarne/thesis-datasci04-ay2022-appendices
source-code/modules/m3_classification.py
m3_classification.py
py
21,753
python
en
code
0
github-code
71
[ { "api_name": "modules.utils.get_project_name", "line_number": 64, "usage_type": "call" }, { "api_name": "modules.utils.model_metadata", "line_number": 71, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 121, "usage_type": "call" }, { "api_na...
33238430160
import pygame import random pygame.init() BLACK = (0, 0, 0) WHITE = (255, 255, 255) BLUE = (0, 0, 255) GREEN = (0, 255, 0) RED = (255, 0, 0) ORANGE = (255,165,0) PI = 3.141592653 size = (400, 500) screen = pygame.display.set_mode(size) pygame.display.set_caption("MC Birdie spil") done= False clock = pygame.time.Cl...
AlberteJeberg/codes
MCBirdiespil.py
MCBirdiespil.py
py
2,063
python
en
code
0
github-code
71
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pygame.display...
9703477593
from django.conf.urls import url,include from django.contrib import admin from blog import views urlpatterns = [ url(r'^$',views.index),#기존에 프로젝트 단에서 설정할 수 있는 경로를 앱마다 따로 url 파일을 생성해 경로를 설정할 수 있음 url(r'^posts/$','blog.views.post_list'), url(r'^posts/(?P<pk>\d+)/$','blog.views.post_detail'), url(...
WoongJKIM/askdjango
blog/urls.py
urls.py
py
571
python
ko
code
0
github-code
71
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "blog.views.index", "line_number": 6, "usage_type": "attribute" }, { "api_name": "blog.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.conf.urls.u...
19288068545
from collections import namedtuple from pathlib import Path import matplotlib import matplotlib.pyplot as plt import numpy as np import pytest from mne import Epochs, compute_proj_evoked, read_cov, read_events from mne.channels import read_layout from mne.io import read_raw_fif from mne.time_frequency.tfr import Aver...
mne-tools/mne-python
mne/viz/tests/test_topo.py
test_topo.py
py
12,900
python
en
code
2,405
github-code
71
[ { "api_name": "pathlib.Path", "line_number": 24, "usage_type": "call" }, { "api_name": "mne.channels.read_layout", "line_number": 30, "usage_type": "call" }, { "api_name": "mne.read_events", "line_number": 35, "usage_type": "call" }, { "api_name": "mne.io.read_raw...
17642060240
import time from urllib.parse import urlparse import requests import json import backoff def get_my_friend_list(user_id, params): # get list of friends of the incoming user response_my_friends_list = [] params['user_id'] = user_id response = requests.get( 'https://api.vk.com/method...
Estafius/diplom
api.py
api.py
py
3,777
python
en
code
0
github-code
71
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 33, "usage_type": "call" }, { "api_name": "backoff.on_exception", "line...
8078034148
from flask import Flask import smtplib from email.mime.image import MIMEImage from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from email.mime.text import MIMEText from email import encoders import os gmail_user = "architechsdoom@gmail.com" gmail_pwd = raw_input('pwd > ') app = F...
sefffal/cisc-325-server
__main__.py
__main__.py
py
1,425
python
en
code
0
github-code
71
[ { "api_name": "flask.Flask", "line_number": 16, "usage_type": "call" }, { "api_name": "email.mime.multipart.MIMEMultipart", "line_number": 38, "usage_type": "call" }, { "api_name": "email.mime.text.MIMEText", "line_number": 44, "usage_type": "call" }, { "api_name"...
8795761210
import os from datetime import datetime, timedelta from airflow import DAG from airflow.contrib.hooks.aws_hook import AwsHook from airflow.models import Variable from airflow.operators.dummy_operator import DummyOperator from airflow.hooks.postgres_hook import PostgresHook from airflow.operators.postgres_operator impor...
juliaobenauer/Data-Pipelines-with-Airflow
airflow/dags/udac_example_dag.py
udac_example_dag.py
py
3,625
python
en
code
0
github-code
71
[ { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 18, "usage_type": "call" }, { "api_name": "airflow.DA...
24796502597
# m3.py # Drawings based on petentiometer input using a mcp3008 chip # 2014-05-16 PV import pygame import math import spidev # Function to read SPI data from MCP3008 chip # Channel must be an integer 0-7 def ReadChannel(channel): adc = spi.xfer2([1, (8+channel)<<4, 0]) data = ((adc[1]&3) << 8) + adc[2] return ...
FrenchBear/RPiExtra
mcp3008/m3.py
m3.py
py
2,668
python
en
code
0
github-code
71
[ { "api_name": "pygame.draw.rect", "line_number": 29, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 29, "usage_type": "attribute" }, { "api_name": "pygame.Color", "line_number": 29, "usage_type": "call" }, { "api_name": "pygame.draw.arc", ...
73731495911
import random import time import selenium.common.exceptions from .. import utils from .. import references from typing import * from selenium.webdriver.common.by import By import pyderman def ensure_chromedriver(): pyderman.install(pyderman.chrome, file_directory=".", filename="chromedriver.exe") def void(*args...
J0J0HA/wwshc
wwshc/utils/extra.py
extra.py
py
4,256
python
en
code
3
github-code
71
[ { "api_name": "pyderman.install", "line_number": 12, "usage_type": "call" }, { "api_name": "pyderman.chrome", "line_number": 12, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 29, "usage_type": "call" }, { "api_name": "random.random", ...
9729780322
from rest_framework import serializers from media.models import (Article, ArticleFile, Comment, Question, Section) from orgstructure.serializers import UserProfileSerializer class CommentSerializer(serializers.ModelSerializer): author = UserProfileSerializer() class Meta: model = Comment field...
Ewald-Studio/recenter-backend
media/serializers.py
serializers.py
py
2,061
python
en
code
0
github-code
71
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 5, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 5, "usage_type": "name" }, { "api_name": "orgstructure.serializers.UserProfileSerializer", "line_number": 6, ...
38748862699
# Author: Chien-Wei Lin from sklearn.tree import DecisionTreeClassifier from sklearn import preprocessing import numpy as np from numpy import argmax import os, sys, string unk = 'unk' out_file = 'SBD.test.out' class Feature: def __init__(self, dataset): self.formDictionary(dataset) def formDictionary(self, data...
wayne1199111810/NLP
sentence_boundary_detection/SBD.py
SBD.py
py
4,816
python
en
code
0
github-code
71
[ { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 31, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 31, "usage_type": "name" }, { "api_name": "sklearn.preprocessing.OneHotEncoder", "line_number": 35, "usage_type": "call" ...
36297301698
from ai.minimax import AI, possible_actions from utils.utils import starting_array def print_board(move, array): print(f'board #{move} is:') for i in range(8): for j in range(8): print(array[i][j] if array[i][j] is not None else '-', end=', ' if j + 1 < 8 else '\n') def compare_ai(bob: A...
NNargesNN/Othello-Game
othello-master/genetic/ai_vs_ai.py
ai_vs_ai.py
py
1,247
python
en
code
0
github-code
71
[ { "api_name": "ai.minimax.AI", "line_number": 12, "usage_type": "name" }, { "api_name": "utils.utils.starting_array", "line_number": 13, "usage_type": "call" }, { "api_name": "ai.minimax.possible_actions", "line_number": 17, "usage_type": "call" } ]
28371248880
from itertools import combinations n, c = map(int,input().split()) array = [] for i in range(n): array.append(int(input())) array.sort() data = list(combinations(array,c)) count = [] max_d = 0 for k in data: for i in range(c-1): for j in range(i+1,c): count.append(k[j]-k[i]) max_d = max(max_d, min(co...
jacey-h/Programming-language
Python_code/BinarySearch/P29_공유기설치.py
P29_공유기설치.py
py
804
python
en
code
0
github-code
70
[ { "api_name": "itertools.combinations", "line_number": 8, "usage_type": "call" } ]
8288768837
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np, scipy as sp, scipy.stats as stats from scipy.optimize import minimize from scipy.stats import multivariate_normal from numpy import exp, log, sqrt from scipy.misc import logsumexp import distributions as dist from scipy.spatial.distance import squ...
AnonymousPaperCode/Kernel_conditional_density_operators
rkhsop/kern/base.py
base.py
py
11,176
python
en
code
1
github-code
71
[ { "api_name": "scipy.spatial.distance.pdist", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.median", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.apply_along_axis", "line_number": 27, "usage_type": "call" }, { "api_name": "nump...
16264102354
import json import time import sys import cv2 import numpy as np from math import atan, tan, sin from cscore import CameraServer, VideoSource, UsbCamera, MjpegServer from networktables import NetworkTablesInstance, NetworkTables class CameraConfig: pass team = None server = False cameraConfigs = [] switchedCam...
mooky12345/detect-color-ball
Camera_colored_ball_detect.py
Camera_colored_ball_detect.py
py
7,561
python
en
code
0
github-code
71
[ { "api_name": "cscore.CameraServer.getInstance", "line_number": 125, "usage_type": "call" }, { "api_name": "cscore.CameraServer", "line_number": 125, "usage_type": "name" }, { "api_name": "cscore.UsbCamera", "line_number": 126, "usage_type": "call" }, { "api_name"...