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
38043006452
import cloudinary.uploader import requests # define your S3 bucket name here. S3_BUCKET_NAME = "akshayranganath" def get_file_name(url, transformation): # transformation will be of the format "t_text_removed/jpg". # remove the "/jpg" part and the "t_" part transformation = transformation.rsplit('/',1)...
akshay-ranganath/create-and-upload
demo_upload_and_download.py
demo_upload_and_download.py
py
2,558
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "cloudinary.uploader.uploader.destroy", "line_number": 31, "usage_type": "call" }, { "api_name": "cloudinary.uploader.uploader", "line_number": 31, "usage_type": "attribute" }, { ...
32869975011
from fastapi import APIRouter from api.schemes import relations, responses from database import redis def add_relation(rel: relations.Relation, rel_name: str) -> responses.RelationOperations: if redis.add_relation(rel_name, rel.user_id, rel.item_id): return responses.RelationOperations(status="successful...
Muti-Kara/sylvest_recommender
api/routers/relations.py
relations.py
py
1,755
python
en
code
2
github-code
6
[ { "api_name": "api.schemes.relations.Relation", "line_number": 7, "usage_type": "attribute" }, { "api_name": "api.schemes.relations", "line_number": 7, "usage_type": "name" }, { "api_name": "database.redis.add_relation", "line_number": 8, "usage_type": "call" }, { ...
15306370520
""" File: eulerCharacteristics.py Description: calculates the characteristics of the 2D Euler equation. This includes the flux and the eigenvectors associated with it Author: Pierre-Yves Taunay Date: November 2018 """ import numpy as np from utils import P_from_Ev GAM = 1.4 def compute_euler_flux(U,direction): ...
pytaunay/weno-tests
python/euler_2d/eulerCharacteristics.py
eulerCharacteristics.py
py
4,634
python
en
code
1
github-code
6
[ { "api_name": "utils.P_from_Ev", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_numbe...
12646866981
from django import forms from .models import Reservation, Testimonial class ReservationForm(forms.ModelForm): name = forms.CharField(label='Your Name', widget=forms.TextInput( attrs={ 'class': 'form-control', 'id': 'name', 'placeholder': 'Your Name' } ...
Dantes696/restaraunt
res/forms.py
forms.py
py
4,061
python
en
code
0
github-code
6
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 6, "usage_type": "call" }, { "api_name": "django.f...
7873679939
import numpy as np from multiprocessing import Pool h, w = 1080, 1920 def draw_pixel(): pixel = np.zeros(24, dtype=np.uint8) for i in range(24): pixel[i] = np.random.randint(0, 2) return pixel def draw_row(p): row = np.zeros((24, w), dtype=np.uint8) row[:, 0] = draw_pixel() for j in r...
e841018/ERLE
rand_img.py
rand_img.py
py
888
python
en
code
2
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.random.randint", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "li...
40124065659
from pymongo.mongo_client import MongoClient from pymongo.server_api import ServerApi import certifi from pprint import pprint class database: def __init__(self): uri = "mongodb+srv://user:user@harvest-hero.zdaj74u.mongodb.net/?retryWrites=true&w=majority" # Create a new client and connec...
SteveHuy/Harvest-Hero
Database+APIs/database.py
database.py
py
721
python
en
code
0
github-code
6
[ { "api_name": "pymongo.mongo_client.MongoClient", "line_number": 11, "usage_type": "call" }, { "api_name": "certifi.where", "line_number": 11, "usage_type": "call" } ]
25097354504
# -*- coding: utf-8 -*- """ Created on Thu Jul 21 13:56:29 2022 @author: maria """ import numpy as np import pandas as pd from numpy import zeros, newaxis import matplotlib.pyplot as plt import scipy as sp from scipy.signal import butter,filtfilt,medfilt import csv import re import functions2022_07_15 as fun #gettin...
mariacozan/Analysis_and_Processing
code_archive/2022-07-21-neuronal_classification.py
2022-07-21-neuronal_classification.py
py
5,001
python
en
code
0
github-code
6
[ { "api_name": "numpy.load", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 48, ...
74182080829
#!/usr/bin/env python from __future__ import print_function import boto3 from botocore.exceptions import ClientError import json import argparse import time import random import uuid ALL_POLICY = '''{ "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt''' + str(random.randint(100000, 999999)) +'''", ...
dagrz/aws_pwn
elevation/add_iam_policy.py
add_iam_policy.py
py
2,724
python
en
code
1,106
github-code
6
[ { "api_name": "random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 42, "usage_type": "call" }, { "api_name": "botocore.exceptions.ClientError", "line_number": 57, "usage_type": "name" }, { "api_name": "boto3.cli...
27673024131
import torch from torch import nn def init_weights_(m: nn.Module, val: float = 3e-3): if isinstance(m, nn.Linear): m.weight.data.uniform_(-val, val) m.bias.data.uniform_(-val, val) class Actor(nn.Module): def __init__(self, state_dim: int, ...
zzmtsvv/rl_task
spot/modules.py
modules.py
py
2,231
python
en
code
8
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_...
9651796880
import utils from utils import * # Arguments available def parse_args(): parser = argparse.ArgumentParser(description='Task1') parser.add_argument('--image_path', type=str, default=None, help='Path to an image on which to apply Task1 (absolute or relative path)') parser.add_argument('--save_pat...
SebastianCojocariu/Curling-OpenCV
task_1.py
task_1.py
py
3,759
python
en
code
1
github-code
6
[ { "api_name": "utils.show_images", "line_number": 32, "usage_type": "call" } ]
29788980815
from collections import Counter import numpy as np import pandas as pd import pickle from sklearn import svm, model_selection, neighbors from sklearn.ensemble import VotingClassifier, RandomForestClassifier from sklearn.model_selection import cross_validate, train_test_split # processing data for Machine Learning # ...
mihir13/python_for_finance
PythonForFinance9.py
PythonForFinance9.py
py
3,409
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.inf", "line_number": 63, "usage_type": "attribute" }, { "api_name": "numpy.nan", "l...
2542812722
import os import json import logging from infy_bordered_table_extractor import bordered_table_extractor from infy_bordered_table_extractor.bordered_table_extractor import OutputFileFormat from infy_bordered_table_extractor.providers.tesseract_data_service_provider import TesseractDataServiceProvider from infy_bordered_...
Infosys/Document-Extraction-Libraries
infy_bordered_table_extractor/tests/test_border_table_img.py
test_border_table_img.py
py
3,357
python
en
code
6
github-code
6
[ { "api_name": "os.path.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.basicConfig", "li...
23088053555
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Code by: Magnus Øye, Dated: 12.11-2018 Contact: magnus.oye@gmail.com Website: https://github.com/magnusoy/Balancing-Platform """ # Importing packages import numpy as np from numpy import sqrt, sin, cos, pi, arccos import matplotlib.pylab as plt # Plot style plt.style...
magnusoy/Balancing-Platform
src/balancing_platform/util/graphs.py
graphs.py
py
2,702
python
en
code
7
github-code
6
[ { "api_name": "matplotlib.pylab.style.use", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pylab.style", "line_number": 16, "usage_type": "attribute" }, { "api_name": "matplotlib.pylab", "line_number": 16, "usage_type": "name" }, { "api_name"...
30272112886
from .views import * from django.urls import path urlpatterns = [ path('', home, name='home'), path('login/', login_user, name='login'), path('contact/', contact, name='contact'), path('api/<str:userid>/', api, name='api'), path('logout/', logout_user, name='logout'), path('register/', register...
supratim531/hetc-web
scholarship/urls.py
urls.py
py
693
python
en
code
0
github-code
6
[ { "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", ...
20921293526
import numpy as np import matplotlib.pyplot as plt def plot_results(results, range_param, label='', color='r', marker='o'): mean_results = np.mean(results, axis=1) min_results = np.mean(results, axis=1) - np.std(results, axis=1) max_results = np.mean(results, axis=1) + np.std(results, axis=1) plt.plot...
sharpenb/Multi-Scale-Modularity-Graph-Clustering
Scripts/experiments/results_manager.py
results_manager.py
py
1,613
python
en
code
2
github-code
6
[ { "api_name": "numpy.mean", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.std", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 8, "...
71588771707
import pytest from pytest import approx from brownie import chain from brownie.test import given, strategy from decimal import Decimal from .utils import RiskParameter, transform_snapshot @pytest.fixture(autouse=True) def isolation(fn_isolation): pass @given( initial_fraction=strategy('decimal', min_value=...
overlay-market/v1-periphery
tests/state/test_volume.py
test_volume.py
py
5,680
python
en
code
3
github-code
6
[ { "api_name": "pytest.fixture", "line_number": 10, "usage_type": "call" }, { "api_name": "utils.RiskParameter.CAP_NOTIONAL", "line_number": 24, "usage_type": "attribute" }, { "api_name": "utils.RiskParameter", "line_number": 24, "usage_type": "name" }, { "api_name...
1306545281
import os, datetime def call_msra(): terr = input('код территории: ') if terr == "": print() call_msra() comp = input('номер АРМа: ') if comp == "": print() call_msra() else: os.system(r'C:\Windows\System32\msra.exe /offerra kmr-' + terr + '-' +...
Aarghe/some_scripts
msra/msra.py
msra.py
py
2,782
python
ru
code
0
github-code
6
[ { "api_name": "os.system", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 27, "usage_type": "attribute" } ]
5405379024
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import random # imports relevant libraries import operator import matplotlib.pyplot import agentframework import csv import matplotlib.animation num_of_agents = 10 num_of_iterations = 100 neighbourhood = 20 f = open('datain.txt') # open...
cman2000/Portfolioabm
model.py
model.py
py
1,832
python
en
code
0
github-code
6
[ { "api_name": "csv.reader", "line_number": 20, "usage_type": "call" }, { "api_name": "csv.QUOTE_NONNUMERIC", "line_number": 20, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.pyplot.imshow", "line_number": 31, "usage_type": "call" }, { "api_name": "...
14698252975
from flask import Flask, request, jsonify from SSAPI import app, api, db, guard from flask_restplus import Resource, reqparse, inputs import flask_praetorian from SSAPI.models import * @api.route('/Scrimmages') class ScrimmageList(Resource): @flask_praetorian.auth_required def get(self): """ Returns a...
ktelep/SSAPI
SSAPI/scrimmage_views.py
scrimmage_views.py
py
7,157
python
en
code
0
github-code
6
[ { "api_name": "flask_restplus.Resource", "line_number": 9, "usage_type": "name" }, { "api_name": "flask_praetorian.current_user", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_praetorian.current_user", "line_number": 14, "usage_type": "call" }, { ...
42132347145
import math import numpy as np from scipy.stats import bernoulli simlen = 1000000 pmf = np.full(10,0.1) def cdf(k): if(k>10): return 1 elif(k<=0): return 0 else: return k*0.1 print("Value equal to 7:") p1 = pmf[7] data_bern1 = bernoulli.rvs(size=simlen,p=p1) err_ind1 = np.nonzero...
gadepall/digital-communication
exemplar/10/13/3/30/codes/code.py
code.py
py
984
python
en
code
7
github-code
6
[ { "api_name": "numpy.full", "line_number": 7, "usage_type": "call" }, { "api_name": "scipy.stats.bernoulli.rvs", "line_number": 19, "usage_type": "call" }, { "api_name": "scipy.stats.bernoulli", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.nonze...
38740337725
import pytest import numpy as np from uncoverml import patch @pytest.mark.parametrize('make_multi_patch', ['make_patch_31', 'make_patch_11'], indirect=True) def test_grid_patch(make_multi_patch): timg, pwidth, tpatch, tx, ty = make_multi_patch patches = pa...
GeoscienceAustralia/uncover-ml
tests/test_patch.py
test_patch.py
py
593
python
en
code
32
github-code
6
[ { "api_name": "uncoverml.patch.grid_patches", "line_number": 14, "usage_type": "call" }, { "api_name": "uncoverml.patch", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.allclose", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.ma...
43984207586
# gdpyt-analysis: test.test_fit_3dsphere """ Notes """ # imports from os.path import join import math import numpy as np import pandas as pd import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from correction import correct from utils import fit, plotting, functions # read dataframe fp = '/Users...
sean-mackenzie/gdpyt-analysis
test/test_fit_3dsphere.py
test_fit_3dsphere.py
py
6,764
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_excel", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.stack", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
15306305960
""" WENO Lax-Friedrichs Author: Pierre-Yves Taunay Date: November 2018 """ import numpy as np import matplotlib.pyplot as plt ############### #### SETUP #### ############### # Grid npt = 200 L = 2 dz = L/npt zvec = np.linspace(-L/2 + dz/2,L/2-dz/2,npt) EPS = 1e-16 # Time dt = dz / 1 * 0.4 tmax = 2000 tc = 0 # Sche...
pytaunay/weno-tests
python/advection_1d/weno-advection.py
weno-advection.py
py
5,051
python
en
code
1
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 3...
75163149306
# -*- coding: utf-8 -*- """ Flask Skeleton """ from flask import Blueprint, request, redirect, url_for, render_template, flash, session from pymongo import errors as mongo_errors from bson.objectid import ObjectId from flask_login import login_required import datetime from app import mongo, login_manager from app.usu...
e-ruiz/big-data
01-NoSQL/atividade-04/src/app/blog/posts.py
posts.py
py
2,268
python
en
code
1
github-code
6
[ { "api_name": "app.usuario.model.Usuario.get_by_id", "line_number": 18, "usage_type": "call" }, { "api_name": "app.usuario.model.Usuario", "line_number": 18, "usage_type": "name" }, { "api_name": "app.login_manager.user_loader", "line_number": 16, "usage_type": "attribute...
2026773879
import json import os import pathlib import time from selenium import webdriver from selenium.webdriver import ActionChains driver = webdriver.Chrome() targetUrl = 'https://www.douban.com/' username = "" psw = "" def login_zhi_hu(): loginurl = targetUrl # 登录页面 # 加载webdriver驱动,用于获取登录页面标签属性 # driver = we...
Nienter/mypy
personal/douban.py
douban.py
py
3,789
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 9, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 30, "usage_type": "call" }, { "api_name": "time.sleep", ...
19400090459
from typing import List class Solution: def minFallingPathSum(self, A: List[List[int]]) -> int: h = len(A) w = len(A[0]) for i in range(1,h): for j in range(w): if j == 0: A[i][j] = min(A[i-1][j] + A[i][j],A[i-1][j+1] + A[i][j]) ...
Yigang0622/LeetCode
minFallingPathSum.py
minFallingPathSum.py
py
653
python
en
code
1
github-code
6
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
2502699508
# To manage matrices correctly # At deployment, check if new matrices have been added to old batch sizes import grid import orjson import sys # VERSION_FILE VERSION_FILE = "versioning.json" def readable_string(batch, num_infected, infection_rate): m,n = grid.parse_batch(batch) return f'{n} Samples (with {m} ...
Aakriti28/tapestry-server
old-server/matrix_manager.py
matrix_manager.py
py
4,223
python
en
code
0
github-code
6
[ { "api_name": "grid.parse_batch", "line_number": 12, "usage_type": "call" }, { "api_name": "orjson.loads", "line_number": 20, "usage_type": "call" }, { "api_name": "grid.generate_grid_and_cell_data", "line_number": 27, "usage_type": "call" }, { "api_name": "orjson...
8063903284
import logging import subprocess from subprocess import Popen, PIPE def run(command: str) -> None: """ :param command: shell statement :return: """ logging.debug(command) subprocess.call(command, shell=True, universal_newlines=True) def call(command: str) -> str: """ :param command:...
leaderli/li_py
li/li_bash.py
li_bash.py
py
1,123
python
en
code
0
github-code
6
[ { "api_name": "logging.debug", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 20, "usage_type": "call" }, { "api_name": "subprocess.Popen", "l...
24769179889
squaredWeight = None def performCollection(cityLevel, filename): import os if cityLevel: outputDir = 'GoogleTrendsCity/' if not os.path.exists(outputDir): os.mkdir(outputDir) else: outputDir = 'GoogleTrendsCountry/' if not os.path.exists(outputDir): ...
apanasyu/GoogleTrends
Main.py
Main.py
py
20,395
python
en
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number":...
37164877474
import torch import numpy import pandas import sys import os import copy import torch.nn as nn import torch.nn.functional as F import torch.optim as optim #Global option defaults that can be changed later by command line gcm_folder_path : str = "gcms" target_folder_path : str = "targets" class_index = "...
tigerwxu/gcm-cnn
gcm-cnn.py
gcm-cnn.py
py
10,296
python
en
code
0
github-code
6
[ { "api_name": "torch.set_printoptions", "line_number": 42, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 44, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 52, "usage_type": "attribute" }, { "api_name": "sys.argv", ...
36066284113
#%% from PIL import Image import numpy as np import onnxruntime import torch import cv2 def preprocess_image(image_path, height, width, channels=3): image = Image.open(image_path) image = image.resize((width, height), Image.LANCZOS) image_data = np.asarray(image).astype(np.float32) image_data = image_d...
cassiebreviu/onnxruntime-raspberrypi
inference_mobilenet.py
inference_mobilenet.py
py
2,000
python
en
code
4
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 9, "usage_type": "name" }, { "api_name": "PIL.Image.LANCZOS", "line_number": 10, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_n...
30117142033
import numpy as np from PIL import Image class predict_day_night_algos: def __init__(self,img_path,algorithm_choice): self.img_path = img_path self.algorithm_choice = algorithm_choice def select_algorithm(self): """ the function selects which algorithm, based on the ...
shivargha98/shivargha_bandopadhyay
predict_day_night.py
predict_day_night.py
py
2,888
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 42, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 42, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 5...
30669751378
import os import cv2 dir = "/Users/sunxiaofei/PycharmProjects/remote-server-projects/unlabeled_dataset/data" for i, eachVid in enumerate(os.listdir(dir)): vPath = os.path.join(dir, eachVid) vname = vPath.split("/")[-1][:-4] print(vname) print(vPath) vidcap = cv2.VideoCapture(vPath) success,image = vidcap....
sxfduter/python_utils
video_frame_extraction.py
video_frame_extraction.py
py
709
python
en
code
0
github-code
6
[ { "api_name": "os.listdir", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number...
4828707472
from fastapi.security import OAuth2PasswordBearer from sqlalchemy.orm import Session from models import Quote, Title, Year from schemas import QuoteBase, QuoteCreate, TitleBase, TitleCreate, YearBase, YearCreate import random import auth import models import schemas oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token...
rubenpinxten/herexamen_API
myProject/crud.py
crud.py
py
3,543
python
en
code
0
github-code
6
[ { "api_name": "fastapi.security.OAuth2PasswordBearer", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 12, "usage_type": "name" }, { "api_name": "schemas.QuoteCreate", "line_number": 12, "usage_type": "name" }, { "...
42319245603
from setuptools import setup, find_packages import codecs import os import re here = os.path.abspath(os.path.dirname(__file__)) import prefetch_generator # loading README long_description = prefetch_generator.__doc__ version_string = '1.0.2' setup( name="prefetch_generator", version=version_string, desc...
justheuristic/prefetch_generator
setup.py
setup.py
py
1,969
python
en
code
260
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "prefetch_generator.__doc__"...
29457712632
#! /usr/bin/env python # -*- coding: utf-8 -*- '''translate.translate: provides main() entry point.''' __version__ = '0.1.3' import logging import argparse import requests from bs4 import BeautifulSoup from terminaltables import AsciiTable logging.basicConfig( filename = '.log', filemode = 'a+', ...
alvarolopez/translate-term
translate/translate.py
translate.py
py
5,821
python
en
code
1
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 20, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" }, { "api_name": "logging...
15512669243
import pygame #Impordime pygame'i #Defineerime funktsiooni, mis joonistab ruudustiku def draw_grid(screen, ruudu_suurus, read, veerud, joone_värv): for i in range(read): #Esimene tsükel, mis käib läbi kõik read for j in range(veerud): #Teine tsükel, mis käib läbi kõik veerud rect = pygame.Rect(...
KermoV/Ulesanne_3
Ülesanne_3.py
Ülesanne_3.py
py
1,403
python
et
code
0
github-code
6
[ { "api_name": "pygame.Rect", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.draw.rect", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_nu...
14374871985
# coding=utf-8 """Unit tests for activitypub.py.""" from base64 import b64encode import copy from datetime import datetime, timedelta from hashlib import sha256 import logging from unittest import skip from unittest.mock import patch from flask import g from google.cloud import ndb from granary import as2, microformat...
snarfed/bridgy-fed
tests/test_activitypub.py
test_activitypub.py
py
76,984
python
en
code
219
github-code
6
[ { "api_name": "granary.as2.PUBLIC_AUDIENCE", "line_number": 82, "usage_type": "attribute" }, { "api_name": "granary.as2", "line_number": 82, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 84, "usage_type": "call" }, { "api_name": "granary.as...
27679859460
# Things to show # Name, Orbital Radius, Gravity, Mass, Distance, Planet Type, Goldilock, Discovery Date, Mass of hoststar from flask import Flask, jsonify, make_response from pandas import read_csv app = Flask(__name__) data = read_csv("csv/display.csv") @app.get("/") def index(): to_send = [] i = 1 while Tru...
CometConnect/python
api.py
api.py
py
1,549
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_num...
71186923
import boto3 import uuid import json from jwcrypto import jwt, jwk DDB_CLIENT = boto3.client('dynamodb') ddb_table = "iowt-devices" def create_new_device(): id = str(uuid.uuid4()) key = jwk.JWK(generate="oct", size=256) key_data = json.loads(key.export())['k'] token = jwt.JWT(header={"alg": "A256KW...
wilsonc101/iowt
www/create_device.py
create_device.py
py
886
python
en
code
0
github-code
6
[ { "api_name": "boto3.client", "line_number": 6, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 13, "usage_type": "call" }, { "api_name": "jwcrypto.jwk.JWK", "line_number": 14, "usage_type": "call" }, { "api_name": "jwcrypto.jwk", "line_numb...
42896164462
import jax import numpy as np import pytest import hilbert_sort.jax as jax_backend import hilbert_sort.numba as np_backend @pytest.fixture(scope="module", autouse=True) def config_pytest(): jax.config.update("jax_enable_x64", True) @pytest.mark.parametrize("dim_x", [2, 3, 4]) @pytest.mark.parametrize("N", [150...
AdrienCorenflos/parallel-Hilbert
tests/test_agree.py
test_agree.py
py
1,622
python
en
code
1
github-code
6
[ { "api_name": "jax.config.update", "line_number": 11, "usage_type": "call" }, { "api_name": "jax.config", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pytest.fixture", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random.seed", ...
29099504157
import xml.etree.ElementTree as ET from datetime import date from pathlib import Path def _convert_dict(temp_dict): """ Convert one dict to a new one :param temp_dict: A temporary dict :type temp_dict: dict :return: The same dict in a new formate that fits with the database :rtype: dict "...
ZexiDilling/structure_search
xml_handler.py
xml_handler.py
py
7,386
python
en
code
0
github-code
6
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 52, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 52, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 75, "usage_type": "call" }, { "api_name": ...
39001711691
import csv import MySQLdb mydb= MySQLdb.connect(host='localhost', user='root', db='celebal') cursor=mydb.cursor() with open('dataset1.csv', 'r') as csvfile: csv_data1 = csv.reader(csvfile, delimiter=',') next(csv_data1) cursor.execute("TRUNCATE TABLE data1") for row in csv_data1: cursor.execute("INSERT ...
shauryaa/CelebalAssignment1
try.py
try.py
py
910
python
en
code
0
github-code
6
[ { "api_name": "MySQLdb.connect", "line_number": 4, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 10, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 17, "usage_type": "call" } ]
36637137136
import tkinter as tk from tkinter import ttk from tkinter import * import numpy as np from PIL import ImageTk, Image from os import listdir from os.path import isfile, join from PIL.Image import Resampling from hopfield_clouds import HopfieldClouds # root.columnconfigure(0, weight=1) # root.columnconfigure(1, weigh...
behenate/hopfield-reconstruction
gui.py
gui.py
py
5,007
python
en
code
0
github-code
6
[ { "api_name": "hopfield_clouds.HopfieldClouds", "line_number": 21, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 22, "usage_type": "call" }, { "api_name": "tkinter.ttk.Button", "line_number": 26, "usage_type": "call" }, { "api_name": "tkinter....
15598819292
import sys sys.path.append('..') import torch from torch import nn from torch.nn import functional as F from ssd import config as cfg from basenet.vgg import vgg_feat from basenet.resnet import resnet101_feat from ssd.utils_ssd.priorbox import PriorBox from ssd.utils_ssd.L2Norm import L2Norm from ssd.utils_ssd.detect...
AceCoooool/detection-pytorch
ssd/ssd300.py
ssd300.py
py
4,567
python
en
code
24
github-code
6
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "torch.nn.MaxPool2d", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
1360530890
import Utils.Data as data from Utils.Data.DatasetUtils import is_test_or_val_set, get_train_set_id_from_test_or_val_set, \ get_test_or_val_set_id_from_train from Utils.Data.Features.Feature import Feature from Utils.Data.Features.Generated.EnsemblingFeature.MatrixEnsembling import ItemCBFMatrixEnsembling from Utils...
MaurizioFD/recsys-challenge-2020-twitter
Utils/Data/Features/Generated/EnsemblingFeature/SimilarityFoldEnsembling.py
SimilarityFoldEnsembling.py
py
7,398
python
en
code
39
github-code
6
[ { "api_name": "Utils.Data.Features.Generated.GeneratedFeature.GeneratedFeaturePickle", "line_number": 18, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 27, "usage_type": "call" }, { "api_name": "Utils.Data.Features.Feature.Feature.ROOT_PATH", "line_numb...
75136926587
import pytest import tgalice from dialog_manager import QuizDialogManager @pytest.fixture def default_dialog_manager(): return QuizDialogManager.from_yaml('texts/quiz.yaml') def make_context(text='', prev_response=None, new_session=False): if prev_response is not None: user_object = prev_response.u...
avidale/musiquiz
test_scenarios.py
test_scenarios.py
py
1,432
python
en
code
0
github-code
6
[ { "api_name": "dialog_manager.QuizDialogManager.from_yaml", "line_number": 9, "usage_type": "call" }, { "api_name": "dialog_manager.QuizDialogManager", "line_number": 9, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 7, "usage_type": "attribute" ...
160637604
import numpy as np import pandas as pd #Setting the recent season match yrBefore = np.arange(1900,2023) yrAfter = np.arange(1901,2024) yrBefore_list = [] yrAfter_list = [] for s in yrBefore: a = str(s) yrBefore_list.append(a) for j in yrAfter: b = str(j) yrAfter_list.append(b) seaso...
Taofeek26/Taofeek26
btttt.py
btttt.py
py
2,577
python
en
code
0
github-code
6
[ { "api_name": "numpy.arange", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_html", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.get_dummies", "li...
19809314779
import os from PIL import Image from typing import Dict, List from preprocessing.image_metadata import ImageMetadata class ImagesReader: def __init__(self, base_path: str) -> None: self.__basePath = base_path def read_train_images(self) -> Dict[str, List[ImageMetadata]]: images = {} d...
sachokFoX/caltech_256
code/preprocessing/images_reader.py
images_reader.py
py
1,666
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 2...
22002934531
""" Interfaces for Deep Q-Network. """ import random import numpy as np import tensorflow as tf from collections import deque from scipy.misc import imresize from qnet import QNet class DeepQLearner(object): """ Provides wrapper around TensorFlow for Deep Q-Network. """ def __init__(self, ac...
TianyiWu96/DQN
src/qlearn.py
qlearn.py
py
11,988
python
en
code
0
github-code
6
[ { "api_name": "qnet.QNet", "line_number": 85, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 109, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 122, "usage_type": "call" }, { "api_name": "numpy.mean", "line_nu...
71579186747
""" Optimizes GPST model hyperparameters via Optuna. """ import os import time import json import shutil import logging import argparse import tempfile import datetime import optuna from train import train from lumber import get_log from arguments import get_args def main() -> None: """ Run an Optuna study. ""...
langfield/spred
spred/gpst/optimize.py
optimize.py
py
4,018
python
en
code
3
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "attribute" }, { "api_name": "lumber.get_log", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.g...
72255300348
from __future__ import annotations import json import re from typing import TYPE_CHECKING import asyncpg import discord import pandas as pd from tweepy.asynchronous import AsyncClient from ..helpers import add_prefix if TYPE_CHECKING: from bot import Bot async def setup_cache(bot: Bot): prefixes = await b...
LeoCx1000/fish
src/utils/core/startup.py
startup.py
py
4,587
python
en
code
0
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 14, "usage_type": "name" }, { "api_name": "bot.Bot", "line_number": 18, "usage_type": "name" }, { "api_name": "bot.pool.fetch", "line_number": 19, "usage_type": "call" }, { "api_name": "bot.pool", "line_numb...
31957026711
from __future__ import annotations import asyncio from typing import TYPE_CHECKING, Any, Union, Optional, TypedDict, final from datetime import datetime import attr import ujson from tomodachi.utils import helpers from tomodachi.core.enums import ActionType if TYPE_CHECKING: from tomodachi.core.bot import Tomod...
httpolar/tomodachi
tomodachi/core/actions.py
actions.py
py
4,732
python
en
code
4
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.TypedDict", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.TypedDict", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Any", ...
14200847696
import discord import asyncio from discord.ext import commands class Channels(commands.Cog): def __init__(self, bot): self.bot = bot self.role_bot_id = int(self.bot.config['Zone']['role_bot_id']) self.channel_private_id = int(self.bot.config['Zone']['channel_private_id']) self.cate...
yutarou12/bot-zone
cogs/channels.py
channels.py
py
3,982
python
en
code
0
github-code
6
[ { "api_name": "discord.ext.commands.Cog", "line_number": 6, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 6, "usage_type": "name" }, { "api_name": "discord.Embed", "line_number": 22, "usage_type": "call" }, { "api_name": "discor...
18091289859
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('account', '0045_auto_20150130_0558'), ] operations = [ migrations.AlterField( model_name='basicmemberinformation...
hongdangodori/slehome
slehome/account/migrations/0046_auto_20150130_0600.py
0046_auto_20150130_0600.py
py
531
python
en
code
0
github-code
6
[ { "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.AlterField", "line_number": 14, "usage_type": "call" }, {...
17435023939
# coding: utf-8 """ Simple multithread task manager __author_ = 'naubull2 (naubull2@gmail.com)' """ import logging import random import json import time import atexit from queue import Queue from threading import Thread logger = logging.getLogger("dialog-tool") class Worker(Thread): """ Thread executing task...
naubull2/codingtests
frequent_subjects/task_manager.py
task_manager.py
py
3,836
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 17, "usage_type": "name" }, { "api_name": "threading.Thread.__init__", "line_number": 23, "usage_type": "call" }, { "api_name": "threadin...
73643617788
from __future__ import absolute_import import math from collections import OrderedDict import torch import torchvision from torch import nn from torch.nn import functional as F import torch.utils.model_zoo as model_zoo from .res2net import res2net50_26w_4s __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 're...
DeepAlchemist/video-person-reID
lib/model/resnet.py
resnet.py
py
11,011
python
en
code
1
github-code
6
[ { "api_name": "torch.nn.Conv2d", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 27, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 31, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_nu...
71877607227
#pyautogui 라이브러리 추가 #pip install pyautogui import pyautogui #듀얼모니터는 인식 안됨 #마우스 현재 좌표 출력 #pyautogui.position() #해당 좌표로 마우스 이동 #pyautogui.moveTo(40, 154) #이미지 추출 라이브러리 추가 #pip install opencv-python #해당하는 이미지와 유사한 화면이 존재하는 위치로 이동(출력결과 : x축 값, y축 값 , 가로 길이, 세로 길이) #pyautogui.locateOnScreen('') #좌표, 저장될 이미지 길이(x축 값, y축...
BrokenMental/Python-Study
pyautogui.py
pyautogui.py
py
1,032
python
ko
code
0
github-code
6
[ { "api_name": "pyautogui.screenshot", "line_number": 18, "usage_type": "call" }, { "api_name": "pyautogui.locateCenterOnScreen", "line_number": 21, "usage_type": "call" }, { "api_name": "pyautogui.locateCenterOnScreen", "line_number": 22, "usage_type": "call" }, { ...
73743939389
import os from os import walk, getcwd from PIL import Image """ Class label (BDD) """ # same order with yolo format class annotation classes = [ "bike" , "bus" , "car", "motor", "person", "rider", "traffic light", "traffic sign", "train", "truck"] """ Inverse convert function """ def i_convert(size, box): ...
jwchoi384/Gaussian_YOLOv3
bdd_evaluation/convert_txt_to_bdd_eval_json.py
convert_txt_to_bdd_eval_json.py
py
2,038
python
en
code
660
github-code
6
[ { "api_name": "os.getcwd", "line_number": 23, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 29, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 45, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 45, ...
36818284421
import pytest from database import Model, ModelAttribute pytestmark = pytest.mark.asyncio class A(Model): a = ModelAttribute() b = ModelAttribute() c = ModelAttribute() @pytest.mark.parametrize('count', (10, 15)) async def test_insert_find(db, count): c_true_count = 0 for i in range(count): ...
AzaubaevViktor/vk_grabber
src/database/tests/test_no_uid.py
test_no_uid.py
py
1,000
python
en
code
1
github-code
6
[ { "api_name": "pytest.mark", "line_number": 6, "usage_type": "attribute" }, { "api_name": "database.Model", "line_number": 9, "usage_type": "name" }, { "api_name": "database.ModelAttribute", "line_number": 10, "usage_type": "call" }, { "api_name": "database.ModelA...
39713348458
from os.path import join, dirname, realpath, exists from PIL import Image, ImageDraw, ImageFont import numpy import base64 from io import BytesIO # info: image (PNG, JPG) to base64 conversion (string), learn about base64 on wikipedia https://en.wikipedia.org/wiki/Base64 def image_base64(img, img_type): with Bytes...
katiehickman/m224_seals
image.py
image.py
py
6,588
python
en
code
1
github-code
6
[ { "api_name": "io.BytesIO", "line_number": 10, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
6387062201
from jupyterthemes import install_theme, get_themes from jupyterthemes import stylefx def install_themes(): themes = get_themes() for t in themes: try: install_theme(theme=t, monofont=mf, nbfont=nf, tcfont=tc) except Exception: return False return True def install_f...
dunovank/jupyter-themes
tests/test_themes.py
test_themes.py
py
939
python
en
code
9,665
github-code
6
[ { "api_name": "jupyterthemes.get_themes", "line_number": 5, "usage_type": "call" }, { "api_name": "jupyterthemes.install_theme", "line_number": 8, "usage_type": "call" }, { "api_name": "jupyterthemes.stylefx.stored_font_dicts", "line_number": 14, "usage_type": "call" },...
31678929018
# import and necessary libraries import dask.distributed import dask.utils import numpy as np import planetary_computer as pc import xarray as xr from IPython.display import display from pystac_client import Client import matplotlib.pyplot as plt import folium from odc.stac import configure_rio, stac_load # Function ...
Christobaltobbin/OpenDataCube
Scripts/odc_utils.py
odc_utils.py
py
3,287
python
en
code
0
github-code
6
[ { "api_name": "dask.distributed.distributed.Client", "line_number": 30, "usage_type": "call" }, { "api_name": "dask.distributed.distributed", "line_number": 30, "usage_type": "attribute" }, { "api_name": "dask.distributed", "line_number": 30, "usage_type": "name" }, {...
35257204680
import minerl from minerl.data import BufferedBatchIter import numpy as np import random from itertools import combinations from actions import action_names import cv2 import numpy as np import torch ''' The mineRL framework models actions as dictionaries of individual actions. Player recorded demonstrat...
anishhdiwan/DQfD_Minecraft
demo_sampling.py
demo_sampling.py
py
8,704
python
en
code
0
github-code
6
[ { "api_name": "actions.pop", "line_number": 31, "usage_type": "call" }, { "api_name": "actions.pop", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 4...
156567587
#-*- coding: utf-8 -*- import numpy as np from sklearn.cluster import AgglomerativeClustering as sk_AgglomerativeClustering from sklearn.externals.joblib import Memory from .clustering import Clustering class AgglomerativeClustering(Clustering): """docstring for AgglomerativeClustering.""" def __init__(self, d...
netoaraujjo/hal
clustering/agglomerative_clustering.py
agglomerative_clustering.py
py
1,946
python
en
code
0
github-code
6
[ { "api_name": "clustering.Clustering", "line_number": 7, "usage_type": "name" }, { "api_name": "sklearn.externals.joblib.Memory", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 12, "usage_type": "attribute" }, { "api_name": "...
32638070044
def voto(ano): from datetime import datetime atual = datetime.now().year idade = atual - ano if 16 <= idade <= 17 or idade > 60: return idade, 'VOTO OPCIONAL!' elif 18 <= idade < 60: return idade, 'VOTO OBRIGATÓRIO!' else: return idade, 'NÃO VOTA!' nas = int(input('Em q...
LeoWshington/Exercicios_CursoEmVideo_Python
ex101.py
ex101.py
py
396
python
pt
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 3, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 3, "usage_type": "name" } ]
7769213718
import numpy as np import torch import random from PIL import Image #---------------------------------------------------------# # 将图像转换成RGB图像,防止灰度图在预测时报错。 # 代码仅仅支持RGB图像的预测,所有其它类型的图像都会转化成RGB #---------------------------------------------------------# def cvtColor(image): if len(np.shape(image)) == 3 and np.shap...
yangshunzhi1994/SCD
object verification/utils/utils.py
utils.py
py
3,489
python
en
code
0
github-code
6
[ { "api_name": "numpy.shape", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image.BICUBIC", "line_number": 28, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_number": 28, "usage_type": "name" }, { "api_name": "PIL.Image.new", "lin...
31528905029
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- # $Id: setup.py 30 2005-10-30 07:24:38Z oli $ import os, sys from setuptools import setup, find_packages sys.path.insert(0, 'package/lib') from scapy import VERSION PACKAGE_NAME = 'scapy' DESCRIPTION="""Packet manipulation tool, packet generator, network scanner, ...
BackupTheBerlios/gruik-svn
trunk/projects/packaging_scapy/setup.py
setup.py
py
3,232
python
en
code
0
github-code
6
[ { "api_name": "sys.path.insert", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number...
32661723209
from decimal import Decimal from fractions import Fraction from typing import Generator from numeric_methods.language import TRANSLATE from numeric_methods.language.docs.one_variable import SECANT_METHOD_DOCS from numeric_methods.mathematics import compare, convert, widest_type NUMBER = Decimal | float | Fraction ...
helltraitor/numeric-methods
numeric_methods/one_variable/secant_method.py
secant_method.py
py
1,013
python
en
code
0
github-code
6
[ { "api_name": "decimal.Decimal", "line_number": 10, "usage_type": "name" }, { "api_name": "fractions.Fraction", "line_number": 10, "usage_type": "name" }, { "api_name": "numeric_methods.mathematics.widest_type", "line_number": 16, "usage_type": "call" }, { "api_na...
40687305933
import argparse import json from typing import List from google.protobuf import json_format from load_tests.common import ( benchmark_grpc_request, make_full_request_type, make_output_file_path, ) from magma.common.service_registry import ServiceRegistry from orc8r.protos.common_pb2 import Void from orc8r....
magma/magma
lte/gateway/python/load_tests/loadtest_directoryd.py
loadtest_directoryd.py
py
7,544
python
en
code
1,605
github-code
6
[ { "api_name": "orc8r.protos.directoryd_pb2_grpc.GatewayDirectoryServiceStub", "line_number": 29, "usage_type": "call" }, { "api_name": "magma.common.service_registry.ServiceRegistry.get_rpc_channel", "line_number": 30, "usage_type": "call" }, { "api_name": "magma.common.service_r...
24274585662
# ----------------------------------------------------------- # Creates the views for the database. # This views are called when user navigates to a certain url. # They are responsible for either rendering an HTML template or the API data that are requested # For example: Navigating to the url 'api/operations/' will tr...
KIOS-Research/AIDERS
aidersplatform/django_api/aiders/views.py
views.py
py
110,716
python
en
code
4
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 72, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 77, "usage_type": "attribute" }, { "api_name": "threading.Event", "line_number": 83, "usage_type": "call" }, { "api_name": "rest_framewor...
11165153113
from uuid import uuid4 from demo.data_loading.data_fetching import get_countries_data from demo.data_loading.fixes import fix_alpha2_value, fix_alpha3_value, fix_string_value from demo.server.config import get_pyorient_client def load_countries_and_regions(countries_df): graph = get_pyorient_client() countr...
obi1kenobi/graphql-compiler-cross-db-example
demo/data_loading/orientdb_loading.py
orientdb_loading.py
py
4,019
python
en
code
3
github-code
6
[ { "api_name": "demo.server.config.get_pyorient_client", "line_number": 9, "usage_type": "call" }, { "api_name": "demo.data_loading.fixes.fix_string_value", "line_number": 19, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 20, "usage_type": "call" }, ...
27264187100
""" GenT2_Rulebase.py Created 9/1/2022 """ from juzzyPython.generalType2zSlices.system.GenT2Engine_Intersection import GenT2Engine_Intersection from juzzyPython.generalType2zSlices.system.GenT2Engine_Union import GenT2Engine_Union from juzzyPython.generalType2zSlices.system.GenT2_Rule import GenT2_Rule from juzzyPython...
LUCIDresearch/JuzzyPython
juzzyPython/generalType2zSlices/system/GenT2_Rulebase.py
GenT2_Rulebase.py
py
7,915
python
en
code
4
github-code
6
[ { "api_name": "juzzyPython.generalType2zSlices.system.GenT2Engine_Union.GenT2Engine_Union", "line_number": 54, "usage_type": "call" }, { "api_name": "juzzyPython.generalType2zSlices.system.GenT2Engine_Intersection.GenT2Engine_Intersection", "line_number": 55, "usage_type": "call" }, ...
40319534507
from ansible.module_utils.basic import AnsibleModule from ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.api import \ Session from ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.cls import GeneralModule class General(GeneralModule): CMDS = { 'set': 'set', ...
ansibleguy/collection_opnsense
plugins/module_utils/main/webproxy_forward.py
webproxy_forward.py
py
2,388
python
en
code
158
github-code
6
[ { "api_name": "ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.cls.GeneralModule", "line_number": 8, "usage_type": "name" }, { "api_name": "ansible.module_utils.basic.AnsibleModule", "line_number": 61, "usage_type": "name" }, { "api_name": "ansible_collections.a...
71913785148
import qrcode as qr from PIL import Image q=qr.QRCode(version=1, error_correction=qr.constants.ERROR_CORRECT_H, box_size=10, border=4,) q.add_data("https://youtu.be/NaQ_4ZvCbOE") q.make(fit=True) img= q.make_image(fill_color='darkblue', back_color='steelblue') img.save("x.png")
Xander1540/Python-Projects
QRcode/QRcode.py
QRcode.py
py
316
python
en
code
0
github-code
6
[ { "api_name": "qrcode.QRCode", "line_number": 3, "usage_type": "call" }, { "api_name": "qrcode.constants", "line_number": 4, "usage_type": "attribute" } ]
73730161788
import torch import torch.optim as optim from torch.utils.data import DataLoader from torchvision import transforms from torchvision.datasets import MNIST from dae.dae import DAE from beta_vae.beta_vae import BetaVAE from history import History # hyperparameters num_epochs = 100 batch_size = 128 lr = 1e-4 beta = 4 sa...
BCHoagland/DARLA
train.py
train.py
py
1,115
python
en
code
8
github-code
6
[ { "api_name": "dae.dae", "line_number": 22, "usage_type": "name" }, { "api_name": "dae.dae.DAE", "line_number": 22, "usage_type": "call" }, { "api_name": "beta_vae.beta_vae", "line_number": 23, "usage_type": "name" }, { "api_name": "beta_vae.beta_vae.BetaVAE", ...
23012946135
import pandas as pd import numpy as np import geopandas as gpd from helper_functions import add_subset_address_cols, interpolate_polygon from data_constants import default_crs, make_data_dict from name_parsing import combine_names from address_parsing import clean_parse_address from helper_functions import make_panel f...
jfish-fishj/boring_cities
python_modules/clean_address_data.py
clean_address_data.py
py
15,391
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 14, "usage_type": "call" }, { "api_name": "fiona.open", "line_number": 19, "usage_type": "call" }, { "api_name": "geopandas.GeoDataFrame.from_features", "line_number": 20, "usage_type": "call" }, { "api_name"...
47036004516
import time from sqlalchemy import Column, Integer, String, Float, Boolean, ForeignKey import sqlalchemy.types as types from sqlalchemy.orm import relationship from sqlalchemy.sql.expression import func from sqlalchemy import or_, and_, desc from marshmallow import Schema, fields from database import Base class KycR...
djpnewton/zap-merchant
models.py
models.py
py
1,387
python
en
code
0
github-code
6
[ { "api_name": "marshmallow.Schema", "line_number": 12, "usage_type": "name" }, { "api_name": "marshmallow.fields.Float", "line_number": 13, "usage_type": "call" }, { "api_name": "marshmallow.fields", "line_number": 13, "usage_type": "name" }, { "api_name": "marshm...
35406045180
import json import os from elasticsearch import Elasticsearch, helpers, exceptions client = Elasticsearch(os.getenv("ELASTICSEARCH_URL")) f = open("dump", "r") def main(): while True: line = f.readline() if len(line) == 0: break data = json.loads(line) yield { ...
polianax/regex
upload.py
upload.py
py
506
python
en
code
0
github-code
6
[ { "api_name": "elasticsearch.Elasticsearch", "line_number": 5, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 5, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "elasticsearch.helpers....
11016530679
import os import discord import requests import asyncio from dotenv import load_dotenv from discord.utils import get from discord.ext import commands compteur = 301 nbConnected = 0 load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') SERVER_IP = os.getenv('SERVER_IP') SERVER_PORT = os.getenv('SERVER_PORT') CHANNEL_ID = i...
AudricCh/minecraft-discord-bot
bot/main.py
main.py
py
1,395
python
en
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "os.getenv", "line_number":...
10609649346
from createProtocol import ARP, EthernetII from parseProtocol import Parser from optparse import OptionParser from helper import subnet_creator, get_mac_address, get_ip_address from rich.progress import track from time import sleep import socket import netifaces import threading def get_user_parameters(): parse_o...
oguzhan-kurt/Network-Scanner
main.py
main.py
py
2,295
python
en
code
0
github-code
6
[ { "api_name": "optparse.OptionParser", "line_number": 13, "usage_type": "call" }, { "api_name": "netifaces.interfaces", "line_number": 19, "usage_type": "call" }, { "api_name": "createProtocol.EthernetII", "line_number": 34, "usage_type": "call" }, { "api_name": "...
27055803559
"""empty message Revision ID: 810e0afb57ea Revises: 22771e69d10c Create Date: 2022-01-19 19:59:08.027108 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "810e0afb57ea" down_revision = "22771e69d10c" branch_labels = None depends_on = None def upgrade(): # #...
CodeForPoznan/codeforpoznan.pl_v3
backend/migrations/versions/810e0afb57ea_.py
810e0afb57ea_.py
py
1,891
python
en
code
8
github-code
6
[ { "api_name": "alembic.op.create_table", "line_number": 20, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 20, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
26964335493
from setuptools import setup from hostinfo.version import __version__ as VERSION from build_utils import BuildCommand from build_utils import PublishCommand from build_utils import BinaryDistribution PACKAGE_NAME = 'pimjpeg' BuildCommand.pkg = PACKAGE_NAME # BuildCommand.py2 = False # BuildCommand.py3 = False Publish...
walchko/mjpeg
setup.py
setup.py
py
1,527
python
en
code
0
github-code
6
[ { "api_name": "build_utils.BuildCommand.pkg", "line_number": 9, "usage_type": "attribute" }, { "api_name": "build_utils.BuildCommand", "line_number": 9, "usage_type": "name" }, { "api_name": "build_utils.PublishCommand.pkg", "line_number": 12, "usage_type": "attribute" ...
36766609482
# date: 2021/09/06 # link: https://programmers.co.kr/learn/courses/30/lessons/17680 from collections import deque def solution(cacheSize, cities): answer = 0 status = deque() if cacheSize == 0: answer = len(cities) * 5 else: for city in cities: city = city.upp...
jiyoung-dev/Algorithm
Kakao 기출문제/캐시.py
캐시.py
py
608
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 8, "usage_type": "call" } ]
3653572970
import numpy as np import pandas as pd import matplotlib.pyplot as plt from skimage.color import rgb2lab from skimage.color import lab2rgb from sklearn.model_selection import train_test_split from sklearn.naive_bayes import GaussianNB from sklearn.pipeline import make_pipeline from sklearn.preprocessing import Function...
injoon2019/SFU_CMPT353
Exercise/e7/colour_bayes.py
colour_bayes.py
py
4,009
python
en
code
1
github-code
6
[ { "api_name": "numpy.vectorize", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 27, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.linspace", ...
74795986426
import openpyxl import tkinter as tk def add_data_to_excel(roll_number, name): # Open the Excel file or create a new one if it doesn't exist try: workbook = openpyxl.load_workbook('data.xlsx') except FileNotFoundError: workbook = openpyxl.Workbook() # Select the active sheet ...
Chandravarma2004/Push-the-data-given-to-excel-
project3.py
project3.py
py
1,441
python
en
code
0
github-code
6
[ { "api_name": "openpyxl.load_workbook", "line_number": 7, "usage_type": "call" }, { "api_name": "openpyxl.Workbook", "line_number": 9, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 32, "usage_type": "call" }, { "api_name": "tkinter.Label", ...
5508352220
import random, os, shutil, yaml, gzip import pandas as pd import numpy as np import prepare.configs as configs from google.cloud import storage import pickle import time storage_client = storage.Client() bucket = storage_client.bucket(configs.bucketName) def encodeConfigs(_confs): return [ _confs['sim ti...
R-Stefano/betse-ml
prepare/utils.py
utils.py
py
7,976
python
en
code
0
github-code
6
[ { "api_name": "google.cloud.storage.Client", "line_number": 9, "usage_type": "call" }, { "api_name": "google.cloud.storage", "line_number": 9, "usage_type": "name" }, { "api_name": "prepare.configs.bucketName", "line_number": 10, "usage_type": "attribute" }, { "ap...
35395847394
from django.core.paginator import InvalidPage class AlphabetGlossary(object): """Алфавитный глоссарий""" def __init__(self, object_list, on=None, num_groups=7): self.object_list = object_list # список объектов self.count = len(object_list) # количество объектов в списке self.max_fro...
zarmoose/eastwood_test
employees/glossary.py
glossary.py
py
5,105
python
ru
code
0
github-code
6
[ { "api_name": "django.core.paginator.InvalidPage", "line_number": 66, "usage_type": "name" } ]
3578166823
import os import torch import csv import pandas as pd from config import FoldersConfig def txt_to_csv(input_path, output_path): with open(input_path, 'r') as in_file: stripped = (line.strip() for line in in_file) lines = (line.split() for line in stripped if line) with open(output_path, '...
ferran-candela/upc-aidl-2021-image-retrieval
imageretrieval/src/prepare_datasets.py
prepare_datasets.py
py
2,898
python
en
code
3
github-code
6
[ { "api_name": "csv.writer", "line_number": 14, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 20, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number":...
9324609377
from flask import Blueprint, render_template redspine = Blueprint('redspine', __name__, template_folder='./', static_folder='./', static_url_path='/') redspine.display_name = "Redspine" redspine.published = False redspine.description =...
connerxyz/exhibits
cxyz/exhibits/redspine/redspine.py
redspine.py
py
491
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 15, "usage_type": "call" } ]
35175789251
from django.shortcuts import render from .models import Book, Shope def home(request): # qs = Post.objects.all() # # The DB query has not been executed at this point # x = qs # # Just assigning variables doesn't do anything # for x in qs: # print(x) # # The query is executed at this po...
Azhar-inexture-1/django_practice_models
query_optimization/views.py
views.py
py
2,036
python
en
code
0
github-code
6
[ { "api_name": "models.Book.objects.order_by", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Book.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": "models.Book", "line_number": 17, "usage_type": "name" }, { "api_name": "dja...
26683410836
#!/usr/bin/python3 '''Defines a Base class ''' import json from os import path class Base: '''Represents a base class Attributes: __nb_objects: holds the number of Base instances created ''' __nb_objects = 0 def __init__(self, id=None): '''Instantiates a Base object Args...
nzubeifechukwu/alx-higher_level_programming
0x0C-python-almost_a_circle/models/base.py
base.py
py
2,989
python
en
code
0
github-code
6
[ { "api_name": "json.dumps", "line_number": 39, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 67, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 86, "usage_type": "call" }, { "api_name": "os.path", "line_number": 86,...
72331238589
import gc import numpy as np import xarray as xr import scipy.ndimage.filters as conv from . import dc_utilities as utilities from datetime import datetime #################################################### # | TSM | #################################################### # 0.0001 for the scale of ls7 data. def _tsmi(...
ceos-seo/Data_Cube_v2
ui/django_site_v2/data_cube_ui/utils/dc_tsm.py
dc_tsm.py
py
1,835
python
en
code
26
github-code
6
[ { "api_name": "numpy.invert", "line_number": 24, "usage_type": "call" }, { "api_name": "xarray.Dataset", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 39, "usage_type": "call" }, { "api_name": "scipy.ndimage.filters.convolv...
9270626576
from dataclasses import dataclass @dataclass class block: name: str seperatorStart: str seperatorEnd: str def getBlock(blocks: list, input: list): strings = list() index = 0 offsetindex = 0 foundBlock = False dontAppend = False for string in input: dontAppend = False ...
superboo07/TextAdventure
TAUtilities.py
TAUtilities.py
py
2,998
python
en
code
0
github-code
6
[ { "api_name": "dataclasses.dataclass", "line_number": 3, "usage_type": "name" } ]
7713977328
#!/usr/bin/python # -*- coding: utf-8 -*- from flask import Flask, render_template import platform import netifaces myApp = Flask(__name__) @myApp.route('/') def home(): data = {'user': 'ramy', 'machine':platform.node(), 'os':platform.system(), 'dist':platform.linux_distribution(), 'interfaces':netifaces.interfa...
RMDHMN/pythonFlash_testing
system-template.py
system-template.py
py
469
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "platform.node", "line_number": 12, "usage_type": "call" }, { "api_name": "platform.system", "line_number": 12, "usage_type": "call" }, { "api_name": "platform.linux_distribution"...
6166872296
# -*- coding: utf-8 -*- """ Created on Thu Jun 15 09:32:16 2017 @author: Francesco """ from sklearn.preprocessing import StandardScaler import numpy as np import threading as th import time import re import matplotlib.pyplot as plt movement_kind = ["wrist up", "wrist down", ...
FrancesoM/UnlimitedHand-Learning
python_side/utilities.py
utilities.py
py
16,063
python
en
code
1
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 76, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 96, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", ...
30354806111
import sys # Enthought library imports from pyface.qt import QtCore, QtGui # Local imports from tvtk.util.gradient_editor import ( ColorControlPoint, ChannelBase, FunctionControl, GradientEditorWidget ) ########################################################################## # `QGradientControl` class. ######...
enthought/mayavi
tvtk/util/qt_gradient_editor.py
qt_gradient_editor.py
py
19,600
python
en
code
1,177
github-code
6
[ { "api_name": "pyface.qt.QtGui.QWidget", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pyface.qt.QtGui", "line_number": 15, "usage_type": "name" }, { "api_name": "pyface.qt.QtCore.Qt", "line_number": 23, "usage_type": "attribute" }, { "api_name": ...
41913795360
import logging from functools import partial from datasets import load_dataset from transformers import ( Seq2SeqTrainer, Seq2SeqTrainingArguments, WhisperForConditionalGeneration, WhisperProcessor, ) from src.callbacks import ShuffleCallback from src.config import Config, TrainingArgumentsConfig from...
Giorgi-Sekhniashvili/geo_whisper
train.py
train.py
py
1,605
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 18, "usage_type": "attribute" }, { "api_name": "src.config.Config", "line_number": 22, "usage_type": "call" }, { "api_name": "src.config.Tr...
8499225984
from booleano.exc import InvalidOperationError from booleano.operations.operands import Operand __all__ = ["String", "Number", "Arithmetic", "Set"] class Constant(Operand): """ Base class for constant operands. The only operation that is common to all the constants is equality (see :meth:`equals`). Constants ...
MikeDombo/Stock_Backtester
booleano/operations/operands/constants.py
constants.py
py
15,020
python
en
code
3
github-code
6
[ { "api_name": "booleano.operations.operands.Operand", "line_number": 7, "usage_type": "name" }, { "api_name": "sys.version_info", "line_number": 114, "usage_type": "attribute" }, { "api_name": "pyparsing.ParseResults", "line_number": 171, "usage_type": "name" }, { ...
86366418129
import numpy as np import matplotlib.pyplot as plt def radial_kernel(x0, X, tau): return np.exp(np.sum((X - x0) ** 2, axis=1) / (-2 * tau * tau)) def local_regression(x0, X, Y, tau): # add bias term x0 = np.r_[1, x0] X = np.c_[np.ones(len(X)), X] # fit model: normal equations with kernel xw ...
MitaAcharya/MachineLeaning
AndrewNG/Week2/Week2_LWR_Extra/LocalWeightedLinearRegression.py
LocalWeightedLinearRegression.py
py
2,053
python
en
code
0
github-code
6
[ { "api_name": "numpy.exp", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.r_", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.c_", "line_number": 12, ...