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
26113241125
__authors__ = ["T. Vincent"] __license__ = "MIT" __date__ = "02/03/2018" import functools import numpy from silx.utils.testutils import LoggingValidator from silx.gui import qt from silx.gui.plot import PlotWindow from silx.gui.plot import tools from silx.gui.plot.test.utils import PlotWidgetTestCase class TestPos...
silx-kit/silx
src/silx/gui/plot/tools/test/testTools.py
testTools.py
py
3,531
python
en
code
106
github-code
6
[ { "api_name": "silx.gui.plot.test.utils.PlotWidgetTestCase", "line_number": 16, "usage_type": "name" }, { "api_name": "silx.gui.plot.PlotWindow", "line_number": 20, "usage_type": "call" }, { "api_name": "silx.gui.qt.QToolBar", "line_number": 37, "usage_type": "call" }, ...
18004085485
""" Full model """ import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader # https://github.com/erikwijmans/Pointnet2_PyTorch from pointnet2_ops.pointnet2_modules import PointnetFPModule, PointnetSAModule from pointnet2.models.pointnet2_ssg_cls import PointNet2C...
PKU-EPIC/UniDexGrasp
dexgrasp_policy/dexgrasp/algo/pn_utils/model_3d.py
model_3d.py
py
2,213
python
en
code
63
github-code
6
[ { "api_name": "pointnet2.models.pointnet2_ssg_cls.PointNet2ClassificationSSG", "line_number": 16, "usage_type": "name" }, { "api_name": "torch.nn.ModuleList", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 18, "usage_type": "name" },...
6942888873
#!/usr/bin/env python3 import rospy from ros_assignment.srv import Trajectory, TrajectoryResponse import matplotlib.pyplot as plt class TrajectoryServer: def __init__(self): rospy.init_node('trajectory_server') self.state = {'x': 0.0, 'y': 0.0} self.default_vx = 1.0 self.default_vy...
Suraj945gh/Antariksh
ros_assignment/scripts/trajectory_server.py
trajectory_server.py
py
1,532
python
en
code
0
github-code
6
[ { "api_name": "rospy.init_node", "line_number": 9, "usage_type": "call" }, { "api_name": "rospy.Service", "line_number": 15, "usage_type": "call" }, { "api_name": "ros_assignment.srv.Trajectory", "line_number": 15, "usage_type": "argument" }, { "api_name": "rospy....
28075986130
import numpy as np from matplotlib import pyplot as plt import utility as ut import network as nt from tqdm import tqdm as tqdm import plot as pt # mnist spiking_input = False labels = [2, 4] (x_train, y_train), (x_test, y_test) = ut.mnist.load_data() selection = [y_test == label for label in labels] minimum_length =...
zimmerrol/spiking-bayesian-networks
mnist_continuous.py
mnist_continuous.py
py
2,201
python
en
code
6
github-code
6
[ { "api_name": "utility.mnist.load_data", "line_number": 11, "usage_type": "call" }, { "api_name": "utility.mnist", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.sum", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.any", ...
9838859435
import face_recognition as fr from PIL import Image,ImageDraw class Predict: def __init__(self, n, enc): self.names = n self.encodings = enc def get_name(self,img,fl): fen=fr.face_encodings(img,fl) names=[] for (t,r,b,l),face_en in zip(fl,fen): matches=fr.com...
shreyashgupta/Face-Recognition-System
Backend + Rpi/predict.py
predict.py
py
556
python
en
code
0
github-code
6
[ { "api_name": "face_recognition.face_encodings", "line_number": 9, "usage_type": "call" }, { "api_name": "face_recognition.compare_faces", "line_number": 12, "usage_type": "call" } ]
7246721636
from collections import Counter from menu import products def get_product_by_id(id: int): if not isinstance(id, int): raise TypeError("product id must be an int") for product in products: if product["_id"] == id: return product return {} def get_products_by_type(type: str): ...
Marchi8/python_kiosque
management/product_handler.py
product_handler.py
py
1,818
python
en
code
0
github-code
6
[ { "api_name": "menu.products", "line_number": 8, "usage_type": "name" }, { "api_name": "menu.products", "line_number": 18, "usage_type": "name" }, { "api_name": "menu.products", "line_number": 26, "usage_type": "name" }, { "api_name": "menu.products", "line_nu...
70143328827
from django.db import models from django.contrib.auth.models import User from django.dispatch import receiver from django.apps import apps from django.db.models.signals import post_save from auditlog.registry import auditlog from .validators import validate_external_consistency # Let's set a default category ("Misc"...
JokusPokus/pcb_shop
src/article/models.py
models.py
py
3,863
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 16, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 16, "usage_type": "name" }, { "api_name": "django.db.models.PositiveIntegerField", "line_number": 18, "usage_type": "call" }, { ...
39455194468
import readline, os, sys, argparse, traceback, time import re import itertools from suomilog.patternparser import ERROR_STACK, setDebug, PatternRef, Grammar, groupCauses from suomilog.finnish import tokenize, CASES, addNounToDictionary from .language import * from .tokenutils import * GRAMMAR = Grammar() GRAMMAR_STAC...
fergusq/retki
retki/compiler.py
compiler.py
py
64,836
python
en
code
3
github-code
6
[ { "api_name": "suomilog.patternparser.Grammar", "line_number": 9, "usage_type": "call" }, { "api_name": "suomilog.patternparser.Grammar", "line_number": 18, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 134, "usage_type": "call" }, { "a...
7641597433
""" Tests for :py:mod:`stems.gis.projections` """ from osgeo import osr from rasterio.crs import CRS import pytest from stems.gis import projections from stems.gis.tests import data PROJ_EPSG = [4326, 3857, 32619] # ============================================================================ # EPSG code @pytest.mar...
ceholden/stems
stems/gis/tests/test_gis_projections.py
test_gis_projections.py
py
4,585
python
en
code
3
github-code
6
[ { "api_name": "rasterio.crs.CRS.from_epsg", "line_number": 18, "usage_type": "call" }, { "api_name": "rasterio.crs.CRS", "line_number": 18, "usage_type": "name" }, { "api_name": "stems.gis.projections.epsg_code", "line_number": 19, "usage_type": "call" }, { "api_n...
1867975179
from flask_app import app from flask import render_template, redirect, session, request from flask_app.models.author import Author from flask_app.models.book import Book # ======================================== # Main Page / Dashboard # ======================================== @app.route("/books") def books(): ...
amlodzianowska/5_books_authors_demo
flask_app/controllers/books.py
books.py
py
1,361
python
en
code
0
github-code
6
[ { "api_name": "flask_app.models.book.Book.get_books_with_authors", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_app.models.book.Book", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.render_template", "line_number": 14, "usage_type": "ca...
12288763491
#-*- coding: utf-8 -*- #使用ID3决策树算法预测销量高低 import pandas as pd inputfile = r'D:\DataAnalysis\Python_practice\chapter5\demo\data\sales_data.xls' data = pd.read_excel(inputfile, index_col = u'序号') #数据是类别标签,要将它转化为数值 #用1来表示“好、是、高”,用-1来表示“坏、否、低” data[data == u'好'] = 1 data[data == u'是'] = 1 data[data == u'高'] = 1 data[data...
woinews/Python_Practice
decision_tree.py
decision_tree.py
py
1,403
python
en
code
3
github-code
6
[ { "api_name": "pandas.read_excel", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.tree.DecisionTreeClassifier", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 26, "usage_type": "call" }, { "api_name": ...
70777983228
import math import random import time import nltk from nltk.translate.bleu_score import sentence_bleu import numpy as np import sklearn from nltk.translate.meteor_score import meteor_score from torch import nn import torch from torch.optim import Adam,SGD,RMSprop,Adagrad,Adadelta,Adamax,AdamW from torch.utils.data imp...
stefanos50/Seq2Seq-Machine-Translation
Seq2Seq.py
Seq2Seq.py
py
18,170
python
en
code
0
github-code
6
[ { "api_name": "nltk.download", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 25, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 25, "usage_type": "name" }, { "api_name": "torch.optim.Adam", "l...
2788164997
import re import numpy as np import pandas as pd import preprocessor as p from nltk.stem.porter import * from sklearn.cluster import KMeans from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer, TfidfTransformer import csv def distCosin(vecA, vecB): # # Vec = np.vstack([vecA,vecB]) # # ...
jackyluo-learning/big_data_sentimental_analysis
sentiment_analysis_experiment_local/tf-idf.py
tf-idf.py
py
4,258
python
en
code
0
github-code
6
[ { "api_name": "numpy.mat", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.mat", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number...
40372678215
#!/usr/bin/python # -*- coding: utf-8 -*- import mock import unittest from cloudshell.networking.huawei.flows.huawei_save_flow import HuaweiSaveFlow class TestHuaweiSaveFlow(unittest.TestCase): def setUp(self): cli_handler = mock.MagicMock() logger = mock.MagicMock() super(TestHuaweiSave...
DYeag/cloudshell-networking-huawei
tests/networking/huawei/flows/test_huawei_save_flow.py
test_huawei_save_flow.py
py
5,032
python
en
code
null
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "mock.MagicMock", "line_number": 12, "usage_type": "call" }, { "api_name": "mock.MagicMock", "line_number": 13, "usage_type": "call" }, { "api_name": "cloudshell.netwo...
14715350667
import sys sys.path.insert(0, './Maps') import pandas as pd from joblib import dump, load import psycopg2 import warnings warnings.filterwarnings('ignore', category=FutureWarning) from datetime import datetime import random import statistics import MapQueries import csv def predict(XGB, mapid, addDB): #print(XG...
LiamRalph/CS-DB
Models/Maps/Predict.py
Predict.py
py
1,405
python
en
code
0
github-code
6
[ { "api_name": "sys.path.insert", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "warnings.filterwarnings", "line_number": 7, "usage_type": "call" }, { "api_name": "MapQueries.getData...
3690154277
import sys import os import json from copy import deepcopy from glob import glob import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from scipy.ndimage import label from scipy.optimize import linear_sum_assignment from sklearn import metrics from .const import * from .util...
samperochon/unsupervised_action_segmentation_of_untrimmed_egocentric_videos_ICASSP2023
src/metrics.py
metrics.py
py
9,747
python
en
code
5
github-code
6
[ { "api_name": "os.makedirs", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 65, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 67, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
30969944618
import math import random import pygame from objects.Bullet import Bullet from Constants import Constants from objects.Enemy import Enemy from Enum import TankType from gamecore.Game import Game from gamecore.GameObject import GameObject from objects.Player import Player from objects.Player2 import Player2 from gamecor...
lenghia2797/TankPyGame
GameScene.py
GameScene.py
py
10,503
python
en
code
0
github-code
6
[ { "api_name": "random.random", "line_number": 22, "usage_type": "call" }, { "api_name": "gamecore.Scene.Scene", "line_number": 25, "usage_type": "name" }, { "api_name": "gamecore.Game.Game", "line_number": 26, "usage_type": "name" }, { "api_name": "gamecore.SceneM...
23760195858
import re from selenium import webdriver import time from selenium.webdriver.common.keys import Keys example = "" driver = webdriver.Firefox() driver.get( "https://translate.google.fr/?hl=fr#view=home&op=translate&sl=zh-CN&tl=fr&text=%E9%87%8F%E5%8C%96%E5%BA%A6%E9%87%8F") source = driver.find_element_by_i...
chrche88/scrappers
trad.py
trad.py
py
767
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { "api_name": "re.sub", "line_number": 19, "usage_type": "call" }, { "api_name": "re.DOTALL", "l...
32584262084
from typing import Dict from .task import Task class TaskLabeled(Task): def __init__(self, name: str, token: str, label: str = ''): Task.__init__(self, name=name, token=token) self.label = label self.nameLabeled = self.name if self.label == '': return self.nam...
Cloudslab/FogBus2
containers/master/sources/utils/master/registry/types/taskLabeled.py
taskLabeled.py
py
821
python
en
code
17
github-code
6
[ { "api_name": "task.Task", "line_number": 6, "usage_type": "name" }, { "api_name": "task.Task.__init__", "line_number": 9, "usage_type": "call" }, { "api_name": "task.Task", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": ...
70398643067
"""helper functions for field of view (FOV) Author: Keisuke Okumura Affiliation: TokyoTech & OSX """ from __future__ import annotations import math import cost_to_go_wrapper import numpy as np from skimage.draw import disk def get_map_coord_2d(pos: np.ndarray, map_size: int) -> tuple[int, int]: """compute x, y...
omron-sinicx/ctrm
src/ctrm/learning/fov.py
fov.py
py
2,215
python
en
code
21
github-code
6
[ { "api_name": "numpy.ndarray", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 35, "usage_type": "attribute" }, { "api_name": "math.ceil", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.zeros", "li...
35078120684
from collections import defaultdict def load_data(inp_file): data = {} with open(inp_file, 'r', encoding='utf-8') as f: lines = list(f.readlines()) line_nums = len(lines) index = 0 while index < line_nums: pair_index, pair_line_nums = [int(z) for z in lines[index].strip().split()] index += 1 pair_la...
chenying3176/PairGCN_ECPE
stat.py
stat.py
py
1,969
python
en
code
8
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 53, "usage_type": "call" } ]
10952142836
# import libraries import sys import pandas as pd import numpy as np import sqlite3 import sqlalchemy from sqlalchemy import create_engine def load_data(messages_filepath, categories_filepath): """ Function to load and merge 2 datasets from the filepaths Parameters: messages_filepath: messages csv fi...
nmutham/Disaster-Response-Pipeline
data/process_data.py
process_data.py
py
3,829
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 68, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engin...
17782892054
from IPython.core.getipython import get_ipython from IPython.core import magic_arguments from IPython.core.magic import (Magics, magics_class, line_magic, cell_magic, line_cell_magic) from IPython.core.magic import register_cell_magic,register_line_cell_magic from IPython.core.error import UsageError from IPython.utils...
benmizrahi/jupyter-extra-magics
extra_magics/bq_estimation.py
bq_estimation.py
py
3,548
python
en
code
2
github-code
6
[ { "api_name": "IPython.core.magic.Magics", "line_number": 23, "usage_type": "name" }, { "api_name": "IPython.core.magic_arguments.parse_argstring", "line_number": 33, "usage_type": "call" }, { "api_name": "IPython.core.magic_arguments", "line_number": 33, "usage_type": "n...
33917778472
from __future__ import absolute_import, division, print_function import re import json import logging from StringIO import StringIO from datetime import datetime from flask import url_for, current_app from inspire_dojson.utils import strip_empty_values from inspire_schemas.utils import validate from inspire_utils.rec...
SCOAP3/scoap3-next
scoap3/modules/workflows/workflows/articles_upload.py
articles_upload.py
py
14,885
python
en
code
2
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 37, "usage_type": "call" }, { "api_name": "flask.current_app.config.get", "line_number": 42, "usage_type": "call" }, { "api_name": "flask.current_app.config", "line_number": 42, "usage_type": "attribute" }, { "api_...
14456954601
import time import json import urllib from core.dependence import urllib2 import http.client import argparse import socket import sys import os from core.utils import utils import subprocess import requests import hashlib, binascii from threading import Timer from multiprocessing import Process import atexit class Tr...
jofpin/trape
core/trape.py
trape.py
py
17,693
python
en
code
7,770
github-code
6
[ { "api_name": "core.utils.utils.generateToken", "line_number": 23, "usage_type": "call" }, { "api_name": "core.utils.utils", "line_number": 23, "usage_type": "name" }, { "api_name": "core.utils.utils.generateToken", "line_number": 24, "usage_type": "call" }, { "ap...
73500677948
from job_sources import BaseJobsCrawler, JobItem from scrapy.http import Request from scrapy.contrib.spiders import Rule from scrapy.contrib.linkextractors import LinkExtractor class SoCareersSpider(BaseJobsCrawler): name = 'so-careers' allowed_domains = ['careers.stackoverflow.com'] start_urls = ['http:/...
iximiuz/CareersAnalyzer-grabber
careers_analyzer/job_sources/so_careers.py
so_careers.py
py
2,079
python
en
code
1
github-code
6
[ { "api_name": "job_sources.BaseJobsCrawler", "line_number": 7, "usage_type": "name" }, { "api_name": "scrapy.contrib.spiders.Rule", "line_number": 11, "usage_type": "call" }, { "api_name": "scrapy.contrib.linkextractors.LinkExtractor", "line_number": 11, "usage_type": "ca...
42587928236
import tweepy import dataset import json from tweepy import StreamListener from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer from textblob import TextBlob from models import * from config import * analyser = SentimentIntensityAnalyzer() def sentiment_score(text): return analyser.polarity_scores(...
paulinaczheng/twitter-location
twitter_package/tweet-stream1.py
tweet-stream1.py
py
4,401
python
en
code
1
github-code
6
[ { "api_name": "vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer", "line_number": 10, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 14, "usage_type": "call" }, { "api_name": "tweepy.StreamListener", "line_number": 49, "usage_type": "attribute" ...
19378180475
import pandas as pd BHNames= ['crim','zn','indus','chas','nox','rm', 'age','dis','rad','tax','ptratio','black','lstat','medv'] url='https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data' data = pd.read_csv(url, delim_whitespace=True, names=BHNames) print(data.head(20)) ...
PacktPublishing/Keras-2.x-Projects
Chapter02/cap2.boston.housing.py
cap2.boston.housing.py
py
2,776
python
en
code
12
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 25, "usage_type": "call" }, { "api_name": "ma...
43510845603
from __future__ import print_function import torch from PIL import Image import pickle from torchvision import transforms from torch.autograd import Variable from models.combined_model import returnmodel from models.extraction_model import get_pretrained_model import numpy as np import os import string # Get vocabl...
VibhuJawa/vqa-2018
webdemo/test_new_forward_pass.py
test_new_forward_pass.py
py
3,022
python
en
code
4
github-code
6
[ { "api_name": "pickle.load", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number"...
28521027795
""" A decorator to validate inputs. If the input validation fails, this decorator will return the errors back to the user. In this case, the request will never reach the logic. If the validation is successful, this decorator continues on to the endpoint. NOTE: this WILL REMOVE all keys that are not mentioned in the c...
harveyslash/backend-cleaned
beatest/Sugar/ReqValDecorator.py
ReqValDecorator.py
py
1,792
python
en
code
0
github-code
6
[ { "api_name": "flask.request.json", "line_number": 34, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 34, "usage_type": "name" }, { "api_name": "flask.request.form", "line_number": 36, "usage_type": "attribute" }, { "api_name": "flask.r...
72532696189
""" Requests to catalog service API """ import asyncio import logging import urllib.parse from collections.abc import Iterator from contextlib import contextmanager from typing import Any from aiohttp import ClientSession, ClientTimeout, web from aiohttp.client_exceptions import ( ClientConnectionError, Clien...
ITISFoundation/osparc-simcore
services/web/server/src/simcore_service_webserver/catalog/client.py
client.py
py
6,001
python
en
code
35
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 32, "usage_type": "call" }, { "api_name": "aiohttp.web.Application", "line_number": 36, "usage_type": "attribute" }, { "api_name": "aiohttp.web", "line_number": 36, "usage_type": "name" }, { "api_name": "aiohttp.Cl...
37048758240
# -*- coding: utf-8 -*- # coding: utf8 import itertools import os import pickle import sys import warnings from collections import OrderedDict from contextlib import contextmanager from io import BytesIO, StringIO from string import Template from pptree import print_tree from sqlalchemy import exc as sa_exc from .exc...
itsolutionsfactory/dbcut
dbcut/utils.py
utils.py
py
7,076
python
en
code
20
github-code
6
[ { "api_name": "io.StringIO", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 22, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_nu...
13740895471
import sqlite3 import click from flask import current_app, g from flask.cli import with_appcontext #connect_db def get_db(): #current_app.logger.info(' DB: Check for db connexion before connexion') db = getattr(g, '_db', None) if db is None: # current_app.logger.info(' DB: No db connexion ... Con...
vkous/simple_dashboard
dashboard/model/db.py
db.py
py
2,223
python
en
code
0
github-code
6
[ { "api_name": "flask.g", "line_number": 9, "usage_type": "argument" }, { "api_name": "flask.g._db", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 12, "usage_type": "name" }, { "api_name": "sqlite3.connect", "line_numbe...
19329577559
import pandas as pd import numpy as np import requests import json import joblib import matplotlib.pyplot as plt from datetime import datetime from time import strftime, localtime, time from sklearn.preprocessing import OrdinalEncoder from sklearn.ensemble import RandomForestRegressor, ExtraTreesRegressor from window_o...
ClarissaMc/MBTA-Travel-Predictor
trip-predictor2.py
trip-predictor2.py
py
5,436
python
en
code
0
github-code
6
[ { "api_name": "pandas.set_option", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.to_datetime", ...
75154507066
from testtools import TestCase import logging import mock from qg.core.app.application import QApplication from qg.core.app.exts.log import QLogExtension from qg.core import log LOG = log.getLogger(__name__) class TestApplication(QApplication): name = 'test-application1' version = '0' def create(self)...
QunarOPS/qg.core
tests/unit/test_ext_log.py
test_ext_log.py
py
1,093
python
en
code
8
github-code
6
[ { "api_name": "qg.core.log.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "qg.core.log", "line_number": 10, "usage_type": "name" }, { "api_name": "qg.core.app.application.QApplication", "line_number": 13, "usage_type": "name" }, { "api_name":...
37751695548
# Import the appropriate libraries. import numpy as np import os import argparse import cv2 as cv from imutils import paths from tensorflow.keras.preprocessing.image import img_to_array # Import MyModel class. from model import MyModel def data_extractor(path,height=32,width=32): data=[] labels = [] image...
tyeborg/ml-image-classification
model/build_model.py
build_model.py
py
1,879
python
en
code
0
github-code
6
[ { "api_name": "imutils.paths.list_images", "line_number": 15, "usage_type": "call" }, { "api_name": "imutils.paths", "line_number": 15, "usage_type": "name" }, { "api_name": "cv2.imread", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.cvtColor", ...
27328306011
import random import sys import matplotlib.pyplot as plt import time def partition(low,high): global pivotpoint,sum pivotitem=S[low];j=low #取第一个数值,比较其他所有值,确定自己在第几个list的位子 for i in range(low+1,high+1): if S[i]<pivotitem: j+=1 k=S[i] S[i]=S[j] S[j]=k sum+=1 pivotpoint=j g=S[low] ...
sam880717/Quick-Sort-Map
Quick Sort.py
Quick Sort.py
py
1,553
python
zh
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.ion", "line_number": 30, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 30, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.clf", "line_number": 31, "usage_type": "call" }, { "api_name": "matplot...
36136786258
import os import operator from flask import Flask, render_template, redirect, request, url_for from flask_pymongo import PyMongo from bson.objectid import ObjectId from os import path if path.exists("env.py"): import env app = Flask(__name__) app.config["MONGO_DBNAME"] = 'wt_database' app.config["MONGO_URI"] = ...
trisdauvergne/milestone-project-03
run_copy.py
run_copy.py
py
6,314
python
en
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": ...
11776493334
from django.shortcuts import render, redirect from django.http import HttpResponse, HttpResponseRedirect import datetime from django.utils import timezone from .models import Meal, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday from django.urls import reverse def home(request): current_date ...
aleesha14/Narmeals
narmeal/views.py
views.py
py
6,590
python
en
code
0
github-code
6
[ { "api_name": "django.utils.timezone.now", "line_number": 16, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 16, "usage_type": "name" }, { "api_name": "models.Monday.objects.get", "line_number": 17, "usage_type": "call" }, { "api_nam...
9275600337
from django.db import models from django.utils import timezone # Create your models here. from django.utils.html import format_html class Producto(models.Model): nombre = models.CharField(max_length=30) proveedor = models.CharField(max_length=30) registro_invima = models.CharField(max_length=30) prod...
Cridafloni/CentroSaludUQ
models/models.py
models.py
py
8,114
python
es
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 9, "usage_type": "call" }, { "api_name": "...
36737258933
import boto3 from botocore.exceptions import ClientError from decouple import config class SESservice: def __init__(self, recipient, status, time): self.region = config("REGION") self.recipient = recipient self.status = status self.time = time self.ses = boto3.client('ses',...
LilkoPetkov/python-web-project
robomonitor/robomonitor/robo/SES.py
SES.py
py
2,953
python
en
code
0
github-code
6
[ { "api_name": "decouple.config", "line_number": 8, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 12, "usage_type": "call" }, { "api_name": "decouple.config", "line_number": 36, "usage_type": "call" }, { "api_name": "boto3.client", "line_...
21076310229
import os import re import chardet from tkinter import Tk from tkinter.filedialog import askopenfilename Tk().withdraw() #no full GUI testfile = askopenfilename() #show an "Open" dialog box to choose txt file #testfile = 'text.txt' #temporary filepath for testing purpose f = open(testfile) testpath = os.path.realpath(...
nikafiq/progkaihatu_textprocessor
main.py
main.py
py
1,665
python
en
code
0
github-code
6
[ { "api_name": "tkinter.Tk", "line_number": 7, "usage_type": "call" }, { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.realpath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path"...
31389541511
bl_info = { "name": "Blender VS Code Tools", "author": "Ian Karanja", "version": (0, 0, 1), "blender": (2, 80, 0), "location": "Text Editor > UI > Code Tools", "description": "Collection of tools for external addon development with VS Code.", "warning": "Early Development.", "doc_url": "...
ranjian0/blender-vscode-dev
__init__.py
__init__.py
py
2,210
python
en
code
2
github-code
6
[ { "api_name": "bpy.types", "line_number": 22, "usage_type": "attribute" }, { "api_name": "bpy.props.StringProperty", "line_number": 25, "usage_type": "call" }, { "api_name": "bpy.props", "line_number": 25, "usage_type": "attribute" }, { "api_name": "bpy.props.Stri...
12772901550
import os import json import timeit import pandas as pd import numpy as np import tensorflow as tf from sqlalchemy import create_engine from rna_learn.alphabet import ALPHABET_DNA from rna_learn.load_sequences import ( load_growth_temperatures, compute_inverse_effective_sample, assign_weight_to_batch_val...
srom/rna_learn
rna_learn/debug_profiling.py
debug_profiling.py
py
2,726
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.join", "line_number":...
32115962671
import jax import jax.numpy as jnp import chex from synthax.modules.base import ControlRateModule from synthax.parameter import ModuleParameterRange, from_0to1 from synthax.config import SynthConfig from synthax.types import ParameterSpec, Signal from typing import Optional class LFO(ControlRateModule): """ L...
PapayaResearch/synthax
synthax/modules/lfos.py
lfos.py
py
5,544
python
en
code
21
github-code
6
[ { "api_name": "synthax.modules.base.ControlRateModule", "line_number": 11, "usage_type": "name" }, { "api_name": "chex.Array", "line_number": 35, "usage_type": "attribute" }, { "api_name": "jax.numpy.exp", "line_number": 35, "usage_type": "call" }, { "api_name": "...
5906770771
# -*- coding: utf-8 -*- from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule from spider.items import item_loader from spider import items from scrapy import Request from selenium import webdriver import json import os from spider.utils.common import md5 class LagouSpider(Crawl...
shadow-zl/spider
spider/spiders/lagou.py
lagou.py
py
3,480
python
en
code
0
github-code
6
[ { "api_name": "scrapy.spiders.CrawlSpider", "line_number": 13, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 29, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 29, "usage_type": "name" }, { "api_name"...
7948585721
from django.shortcuts import render from .models import kontenModel # Create your views here. def blog(request): posting2 = kontenModel.objects.all() context={ 'judul':'BLOG', 'pos':posting2, } return render (request,'blog.html',context)
ENONGLOSKER/BJ_DJANGO
MUROJAAH/MJ_CRUD1/relasi/views.py
views.py
py
272
python
en
code
2
github-code
6
[ { "api_name": "models.kontenModel.objects.all", "line_number": 6, "usage_type": "call" }, { "api_name": "models.kontenModel.objects", "line_number": 6, "usage_type": "attribute" }, { "api_name": "models.kontenModel", "line_number": 6, "usage_type": "name" }, { "ap...
6800437188
import datetime as dt import json import os import random import re from datetime import datetime, timedelta import django from django.core.mail import send_mail from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.shortcuts import get_object_or_404 from django.template.defaultfilters i...
jamesbeamie/bolt-J
authors/apps/articles/views.py
views.py
py
11,537
python
en
code
1
github-code
6
[ { "api_name": "rest_framework.generics.ListCreateAPIView", "line_number": 34, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 34, "usage_type": "name" }, { "api_name": "models.Article.objects.all", "line_number": 38, "usage_type": "cal...
74494481788
import networkx as nx import math from collections import OrderedDict import heapq def dijkstra(G: nx.Graph,s,dest): ''' Find Dijkstra's shortest path algorithm G = Graph s = source node/vertex dest = Path to destinationL; If dest == 'all' then it will return the destination for all other the ...
ashishsubedi/comp_314_mini
Algorithm.py
Algorithm.py
py
3,267
python
en
code
1
github-code
6
[ { "api_name": "networkx.Graph", "line_number": 7, "usage_type": "attribute" }, { "api_name": "networkx.is_connected", "line_number": 14, "usage_type": "call" }, { "api_name": "math.inf", "line_number": 19, "usage_type": "attribute" }, { "api_name": "collections.Or...
225969587
import requests import app.api.table_handle as table_handle from app.api.sisense_endpoints import get_endpoint from app.setup_structlog import get_logger _logger = get_logger(__name__) def create_live_cube(parameter: dict): _logger.info('Creating live cube on LocalHost', Live_cube=parameter['datamodel_name']) ...
janhaviramanand/live-model-automation
insights-live-datamodels/app/api/live_models.py
live_models.py
py
3,462
python
en
code
0
github-code
6
[ { "api_name": "app.setup_structlog.get_logger", "line_number": 7, "usage_type": "call" }, { "api_name": "app.api.sisense_endpoints.get_endpoint", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 17, "usage_type": "call" }, { ...
20835748912
from typing import final from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By #for screenshotting from PIL import Image from time import sleep import io import os os.environ["GOOGLE_APPLICATION_CREDENTIALS"]=r'sturdy-carver-284009-c1...
FredHalliwell/funCAPTCHA-solver
captcha_solver.py
captcha_solver.py
py
3,579
python
en
code
1
github-code
6
[ { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 29, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 29, "usage_type": "name" }, { "api_name": "time.sle...
7797910637
import base64 from operator import index from types import NoneType import requests import pprint import sec clientId = sec.Id clientSecret = sec.KEY clientData = f"{clientId}:{clientSecret}" encodedData = str(base64.b64encode(clientData.encode("utf-8")), "utf-8") authorizationHeaderString = f"Basic {encodedData}" ...
Michalkassa/SkinportTradingBot
main.py
main.py
py
2,410
python
en
code
0
github-code
6
[ { "api_name": "sec.Id", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sec.KEY", "line_number": 9, "usage_type": "attribute" }, { "api_name": "base64.b64encode", "line_number": 11, "usage_type": "call" }, { "api_name": "pprint.PrettyPrinter", "l...
26867043685
import requests import json import pandas as pd data = requests.get(r'http://192.168.222.17:3000/api/laddermachine1/inputreadings').json() convert_to_json = json.dumps(data) parse_json = json.loads(convert_to_json) data = pd.DataFrame(parse_json) columns = list() for i in range(1, 7): column = f'Indgang 010{i}' ...
Danavell/Dolle
scripts/create_data.py
create_data.py
py
658
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 6, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number":...
30815447161
import argparse import json import requests import settings def main(): parser = argparse.ArgumentParser( description='Manage OX Cloud announcements.') subparsers = parser.add_subparsers(title="subcommands", description="valid subcommands", ...
wrosenauer/oxcloud-provisioning
announcements.py
announcements.py
py
3,726
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 48, "usage_type": "call" }, { "api_name": "settings.getRestHost", "line_number": 48, "usage_type": "call" }, { "api_name": "settings.ge...
21474742266
#!/usr/bin/python3 import numpy as np import serial import time import csv import sys import os class ls336: ''' Implements a lakeshore 336 box to interface with client scripts. Only contains locally relevant information; namely, port parameters. The state of the device is not stored locally to avoid the po...
zatkins2/testbed_optics
cold_load/modules/ls336.py
ls336.py
py
8,130
python
en
code
0
github-code
6
[ { "api_name": "serial.SEVENBITS", "line_number": 19, "usage_type": "attribute" }, { "api_name": "serial.PARITY_ODD", "line_number": 20, "usage_type": "attribute" }, { "api_name": "serial.STOPBITS_ONE", "line_number": 21, "usage_type": "attribute" }, { "api_name": ...
25666800651
import os import re import sys import logging as log import argparse import subprocess import collections import pyasn import scapy.all as scapy DIG_OUTPUT_MATCH = r"^;; Received \d+ bytes from ([^\(]+)\([^ ]*\) in \d+ ms$" IPASN_URL = "https://github.com/hadiasghari/pyasn" Host = collections.namedtuple("Host", "add...
NullHypothesis/ddptr
ddptr.py
ddptr.py
py
10,179
python
en
code
11
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 15, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 32, "usage_type": "call" }, { "api_name": "logging.critical", "line_number": 78, "usage_type": "call" }, { "api_name": "sys.e...
71449748987
#! encoding=utf-8 from flask import Flask import time print(__name__) app = Flask(__name__) @app.route('/dylan') def index_dylan(): time.sleep(2) test_dict = {1: 2, 3: 4} return test_dict @app.route('/bob') def index_bob(): time.sleep(2) return 'hello bob' @app.route('/margan') def index_mar...
haidongsong/spider_learn
zhang_xiaobo_spider_practice/myflask.py
myflask.py
py
395
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 12, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 19, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 25, ...
41095916993
''' This module allows to carry out navigation through any json file. ''' import json def read_json_file(path): """ Reads json file and returns it in dictionary format """ json_file = open(path,mode="r",encoding="UTF-8") json_data = json_file.read() obj = json.loads(json_data) return obj d...
LiliaMudryk/json_navigation
navigation.py
navigation.py
py
2,018
python
en
code
0
github-code
6
[ { "api_name": "json.loads", "line_number": 11, "usage_type": "call" } ]
28340784279
# -*- coding: utf-8 -*- import scrapy import re class Data1Spider(scrapy.Spider): name = 'data1' allowed_domains = ['healthyceleb.com/'] start_urls = ['https://healthyceleb.com/category/statistics/sports-stars/female-sports-stars/'] count = 0 def parse(self, response): links = response.xp...
t3chcrazy/Website-Scraper
mensdata/spiders/data1.py
data1.py
py
2,304
python
en
code
0
github-code
6
[ { "api_name": "scrapy.Spider", "line_number": 6, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 16, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 22, "usage_type": "call" }, { "api_name": "re.search", "line...
26456668043
from typing import Sequence class PostgresOption(object): """Base class for Postgres command options.""" class FluentClauseContainer(object): _current_clause = None def __getattr__(self, attr): if hasattr(type(self._current_clause), attr): return getattr(self._current_clause, attr) ...
nathan-rice/pgalchemy
pgalchemy/types.py
types.py
py
1,374
python
en
code
0
github-code
6
[ { "api_name": "typing.Sequence", "line_number": 49, "usage_type": "argument" } ]
160438544
# coding:utf-8 import numpy as np import os from matplotlib import pylab as plt from PIL import Image path = r"E:\python\PythonSpace\Data\cat_vs_dog\train" files = os.listdir(path) path = os.path.join(path, files[0]) cat = plt.imread(path) img = Image.open(path) img = img.resize((128, 128)) img = np.array(img) print...
TaoEnd/TensorFlow
猫狗识别/Test.py
Test.py
py
822
python
en
code
0
github-code
6
[ { "api_name": "os.listdir", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.pylab.imread", "l...
38632882994
from django.shortcuts import render from django.http import HttpResponse from rango.models import Category from rango.models import Page from rango.forms import CategoryForm from rango.forms import PageForm from rango.forms import UserForm, UserProfileForm from django.contrib.auth import authenticate, login from djang...
KirrageW/ITER
rango/views.py
views.py
py
10,254
python
en
code
0
github-code
6
[ { "api_name": "rango.models.Category.objects.order_by", "line_number": 23, "usage_type": "call" }, { "api_name": "rango.models.Category.objects", "line_number": 23, "usage_type": "attribute" }, { "api_name": "rango.models.Category", "line_number": 23, "usage_type": "name"...
19060429611
import subprocess from pathlib import Path import terminal as T class Selection: def __init__(self, buffer: "Buffer") -> None: self.buffer = buffer self.x1 = 0 self.y1 = 0 self.x2 = 0 self.y2 = 0 class Cursor: def __init__(self, buffer: "Buffer") -> None: sel...
aspizu/trax
trax/buffer.py
buffer.py
py
4,491
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 71, "usage_type": "name" }, { "api_name": "terminal.height", "line_number": 72, "usage_type": "attribute" }, { "api_name": "terminal.init", "line_number": 80, "usage_type": "call" }, { "api_name": "terminal.read", "...
72532084029
from typing import Annotated from fastapi import Depends, HTTPException, Security, status from fastapi.security import HTTPBasic, HTTPBasicCredentials from pydantic.types import PositiveInt from ...db.repositories.api_keys import ApiKeysRepository from ...db.repositories.users import UsersRepository from .database im...
ITISFoundation/osparc-simcore
services/api-server/src/simcore_service_api_server/api/dependencies/authentication.py
authentication.py
py
1,589
python
en
code
35
github-code
6
[ { "api_name": "fastapi.security.HTTPBasic", "line_number": 12, "usage_type": "call" }, { "api_name": "fastapi.HTTPException", "line_number": 21, "usage_type": "call" }, { "api_name": "fastapi.status.HTTP_401_UNAUTHORIZED", "line_number": 22, "usage_type": "attribute" },...
13464056697
#!/usr/bin/env python3 """usage: {} count_intron_exon.py -l <lasso> -b <bam> -o <outdir> -x <offsetx> -y <offsety> """ import os import sys import getopt import pysam import numpy as np import pandas as pd import time import subprocess class Options: sargs = 'hl:b:o:x:y:' largs = ['help','bam=', 'outdir=', 'o...
bgi-drosophila/easyBam
count_intron_exon.py
count_intron_exon.py
py
4,870
python
en
code
0
github-code
6
[ { "api_name": "sys.stdout", "line_number": 19, "usage_type": "attribute" }, { "api_name": "getopt.gnu_getopt", "line_number": 22, "usage_type": "call" }, { "api_name": "getopt.GetoptError", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.stderr....
1308783355
import os from typing import Callable from ignite.engine import Engine, Events from torch import nn from pixel2vec.utils import store_weights class PeriodicalH5NetSaver: """This saver saves the model on every n-th epoch""" def __init__(self, save_period: int, out__dir: str, model_variable_name: str = 'model...
Bartolo1024/Pixel2Vec
pixel2vec/utils/saver.py
saver.py
py
3,038
python
en
code
0
github-code
6
[ { "api_name": "os.makedirs", "line_number": 22, "usage_type": "call" }, { "api_name": "ignite.engine.Engine", "line_number": 24, "usage_type": "name" }, { "api_name": "ignite.engine.Events.EPOCH_COMPLETED", "line_number": 26, "usage_type": "attribute" }, { "api_na...
3626522375
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm #Investigate by modelling the differences when a (linear) is a constant and when a is u (non-linear) for a cyclic condition. #set u to a small value like 2 #Decide on your own initial conditions and valu...
teeyingyap/partial-differential-eq
problem2/burgers1.py
burgers1.py
py
1,899
python
en
code
0
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.roll", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_numb...
7543587397
import os import pytest from app import app from flask import url_for @pytest.fixture def client(): app.config['TESTING'] = True app.config['SERVER_NAME'] = 'TEST.test' client = app.test_client() with app.app_context(): pass app.app_context().push() yield client def test_index_page(c...
NicolasLgr/Flux-RSS_LEGER_FAVART
tests/test_integrations.py
test_integrations.py
py
784
python
en
code
0
github-code
6
[ { "api_name": "app.app.config", "line_number": 9, "usage_type": "attribute" }, { "api_name": "app.app", "line_number": 9, "usage_type": "name" }, { "api_name": "app.app.config", "line_number": 10, "usage_type": "attribute" }, { "api_name": "app.app", "line_num...
20428593197
import numpy as np from PIL import Image import sys import glob, os import copy import math np.set_printoptions(threshold=sys.maxsize) # map_path = "m2.png" map_path = "ex1.png" draw_path = "28.png" img_m = Image.open(map_path) imgm_arr = np.array(img_m) img_d = Image.open(draw_path).resize(img_m.size) imgd_arr = np....
tsaoni/route-planning
backup/path2.py
path2.py
py
16,877
python
en
code
0
github-code
6
[ { "api_name": "numpy.set_printoptions", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_number": 8, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image", ...
29457443699
import copy import pytest from utils import * def test_get_status_success(shared_zone_test_context): """ Tests that the status endpoint returns the current processing status, color, key name and version """ client = shared_zone_test_context.ok_vinyldns_client result = client.get_status() as...
vinyldns/vinyldns
modules/api/src/test/functional/tests/internal/status_test.py
status_test.py
py
3,656
python
en
code
334
github-code
6
[ { "api_name": "copy.deepcopy", "line_number": 66, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 58, "usage_type": "attribute" }, { "api_name": "pytest.mark", "line_number": 59, "usage_type": "attribute" } ]
12109857010
import os import warnings import pandas as pd import numpy as np import re import joblib import json import matplotlib.pyplot as plt import seaborn as sns from typing import Optional, Union, List, Literal from supervised import AutoML from sklearn.preprocessing import normalize from sklearn.preprocessing import Standar...
Eugene-Ovcharenko/CABG_register_analysis
analysis_automl.py
analysis_automl.py
py
17,962
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 33, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.se...
29577100210
# -*- coding: utf-8 -*- """ Created on Fri Jul 20 15:34:01 2018 @author: Akitaka """ # -*- coding: utf-8 -*- """ ML of Tc by SVM (0426) Created on Thu Jul 19 12:54:41 2018 @author: Akitaka """ import pandas as pd import numpy as np from time import time from matplotlib import pyplot as plt from p...
nakanishi-akitaka/python2018_backup
0719/test2_Tc_SVM.py
test2_Tc_SVM.py
py
5,839
python
en
code
5
github-code
6
[ { "api_name": "numpy.sqrt", "line_number": 36, "usage_type": "call" }, { "api_name": "sklearn.metrics.mean_squared_error", "line_number": 36, "usage_type": "call" }, { "api_name": "sklearn.metrics.mean_absolute_error", "line_number": 37, "usage_type": "call" }, { ...
36189585575
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 8 18:46:45 2020 @author: lahmwang """ import pygame import math import os width = 600 height = 600 num_cells = 40 # size of gap in between cells gap_size = width // 600 # size of each square cell cell_size = (width // num_cells) - gap_size # c...
RickyWang1020/A_Star_Visualization
a_star_visualization.py
a_star_visualization.py
py
10,845
python
en
code
0
github-code
6
[ { "api_name": "pygame.display.set_mode", "line_number": 35, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 35, "usage_type": "attribute" }, { "api_name": "pygame.display.set_caption", "line_number": 36, "usage_type": "call" }, { "api_name":...
29476924724
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import math from utils.progressbar import wrap_iterator def stack_frame(input_list, num_stack, num_skip, progressbar=False): """Stack & ...
hirofumi0810/tensorflow_end2end_speech_recognition
utils/io/inputs/frame_stacking.py
frame_stacking.py
py
3,085
python
en
code
312
github-code
6
[ { "api_name": "utils.progressbar.wrap_iterator", "line_number": 37, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.array", ...
44349797487
import pandas as pd import numpy as np import re import sklearn import seaborn as sns import matplotlib.pyplot as plt import warnings warnings.filterwarnings('ignore') # Going to use these 5 base models for the stacking from sklearn.ensemble import (RandomForestClassifier, AdaBoostClassifier, ...
Cracroule/deeplearning_work
titanic_survivors/classifier_stacking.py
classifier_stacking.py
py
15,447
python
en
code
1
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.random.s...
40646385645
import sys from Bio import Seq,SeqIO from Bio.Alphabet import IUPAC handle=open(sys.argv[1],'r') output=open(sys.argv[2],'w') for record in SeqIO.parse(handle,'fasta'): seq=record.seq ORF1=seq.translate() ORF2=seq[1::].translate() ORF3=seq[2::].translate() if record.id=="": print(reco...
yafeng/proteogenomics_python
3frame_translation.py
3frame_translation.py
py
589
python
en
code
9
github-code
6
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "Bio.SeqIO.parse", "line_number": 8, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_number...
31068425521
from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * import uuid import time import os import traceback, sys import wallet_api import mixin_asset_id_collection import sqlalchemy import mixin_sqlalchemy_type import exincore_api import oceanone_api import base64 import datetime class Worke...
myrual/pixinwallet
pixinwallet.py
pixinwallet.py
py
139,522
python
en
code
8
github-code
6
[ { "api_name": "traceback.print_exc", "line_number": 37, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_number": 38, "usage_type": "call" }, { "api_name": "traceback.format_exc", "line_number": 39, "usage_type": "call" }, { "api_name": "time.sleep", ...
28512099684
from wsgiref import simple_server from flask import Flask, request, render_template from flask import Response from flask_cors import CORS, cross_origin from apps.training.train_model import TrainModel from apps.core.config import Config app = Flask(__name__) CORS(app) @app.route('/training', methods=['POST']) @cro...
hanuel-89/employee_churn
main.py
main.py
py
1,274
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 10, "usage_type": "call" }, { "api_name": "apps.core.config.Config", "line_number": 25, "usage_type": "call" }, { "api_name": "apps.training.trai...
70555488509
import datetime from datetime import date import urllib3 from boto3 import client from get_raw_data_from_endpoints import call_records import pandas as pd S3_BUCKET = 'telecard-data' # Will be changed once separate bucket is made KEY = 'telecard_data_all_calls' df=pd.DataFrame(columns=['recordingfile','accountcode','...
zhnemati/data-projects
data-pipelines/telecard-redshift-pipeline/get-data-and-dump-to-s3/format_and_upload_calls_data_dump.py
format_and_upload_calls_data_dump.py
py
1,624
python
en
code
0
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 10, "usage_type": "call" }, { "api_name": "urllib3.disable_warnings", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 11, "usage_type": "attribute" }, { "api_name": "bot...
8019249336
import argparse import builtins import math import os import random import shutil import time import warnings import sys from datetime import date import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.optim import torch.multiproce...
Viraj-Joshi/Dynamic-Barrier-Gradient-Descent
lexicographic_regularization.py
lexicographic_regularization.py
py
8,815
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 37, "usage_type": "call" }, { "api_name": "utils.logging.get_logger", "line_number": 43, "usage_type": "call" }, { "api_name": "utils.logging", "line_number": 43, "usage_type": "name" }, { "api_name": "torch....
16204792792
import pytest from xdsl.dialects.affine import For, Yield from xdsl.dialects.builtin import AffineMapAttr, IndexType, IntegerAttr, IntegerType from xdsl.ir import Attribute, Block, Region from xdsl.ir.affine import AffineExpr from xdsl.utils.exceptions import VerifyException def test_simple_for(): f = For.from_r...
xdslproject/xdsl
tests/dialects/test_affine.py
test_affine.py
py
2,379
python
en
code
133
github-code
6
[ { "api_name": "xdsl.dialects.affine.For.from_region", "line_number": 11, "usage_type": "call" }, { "api_name": "xdsl.dialects.affine.For", "line_number": 11, "usage_type": "name" }, { "api_name": "xdsl.ir.Region", "line_number": 11, "usage_type": "call" }, { "api_...
71145072509
from flask import Flask, render_template, request import jsonify import requests import pickle import numpy as np import sklearn from sklearn.preprocessing import StandardScaler app = Flask(__name__, template_folder='templates') model = pickle.load(open('DecisionTreeClassifier.pkl', 'rb')) @app.route('/',metho...
dsatyam09/06_Aspire-Intelligence-1-
app.py
app.py
py
5,285
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.Sta...
7430214538
import pygame import sys # 初始化Pygame pygame.init() # 设置窗口大小和标题 window_width = 800 window_height = 600 window_title = "连发子弹示例" # 创建游戏窗口 screen = pygame.display.set_mode((window_width, window_height)) pygame.display.set_caption(window_title) # 子弹列表 bullets = [] # 设置子弹的尺寸和移动速度 bullet_width = 10 bullet_height = 5 bull...
SkingDuffy/PygameTest
tank_fire_blaze.py
tank_fire_blaze.py
py
1,921
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pygame.display...
16669934144
from django.contrib.auth import get_user_model from django.contrib.auth.decorators import login_required from django.shortcuts import get_object_or_404, redirect, render from django.views.decorators.cache import cache_page from .forms import CommentForm, PostForm from .models import Comment, Follow, Group, Post from ....
Vilenor/hw05_final
yatube/posts/views.py
views.py
py
4,147
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Post.objects.all", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 17, "usage_type": "attribute" }, { ...
2279833050
from twisted.web import resource from httplib import BAD_REQUEST class StorageResource(resource.Resource): """Common parent for all resources representing storage objects""" def __init__(self, avatar='Anonymous', delegated_user=None): resource.Resource.__init__(self) self.avatar = avatar ...
livenson/vcdm
src/vcdm/server/cdmi/cdmiresource.py
cdmiresource.py
py
820
python
en
code
14
github-code
6
[ { "api_name": "twisted.web.resource.Resource", "line_number": 5, "usage_type": "attribute" }, { "api_name": "twisted.web.resource", "line_number": 5, "usage_type": "name" }, { "api_name": "twisted.web.resource.Resource.__init__", "line_number": 9, "usage_type": "call" }...
37431364971
# -*- coding: utf-8 -*- """ Created on Mon Nov 30 11:12:05 2020 @author: zjermain15 """ import numpy as np import matplotlib.pyplot as plt size = [10,100,1000,10000,100000,1000000] error = [] for N in size: rv = np.random.randn(N) values = [] for j in range(N): values....
zjermain/Math-7390-Machine-Learning-Jermain
Homework 1.py
Homework 1.py
py
553
python
en
code
0
github-code
6
[ { "api_name": "numpy.random.randn", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line...
74190875388
import MySQLdb db = MySQLdb.connect(host = "localhost", user = "root", passwd = "wmmkscsie", db = "recommender_system", charset = "utf8") cursor = db.cursor() while(True): id = input("enter the id:\n") print(id) cursor.execute("SELECT a.storyline, a.relationship_type, a.scenario_type, b.emotion, b.event FROM movie...
Alex-CHUN-YU/Recommender-System
test/observation.py
observation.py
py
728
python
en
code
0
github-code
6
[ { "api_name": "MySQLdb.connect", "line_number": 3, "usage_type": "call" } ]
31036600057
from django.urls import path from . import views app_name = "profiles" urlpatterns = [ path("edit/profile/", views.EditProfile.as_view(), name= "edit"), path("delete/profile/", views.DeleteProfile.as_view(), name= "delete"), path("edit/picture/", views.EditPicture.as_view(), name= "picture"), path("delete/picture...
notkingsley/twitterx
profiles/urls.py
urls.py
py
705
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
420319442
import argparse from xfile.base import File, Engine def main(): parser = argparse.ArgumentParser() parser.add_argument('file') args = parser.parse_args() e = Engine() for results in e.run(File(args.file)): results.show() if __name__ == '__main__': main()
juanmera/xfile
xfile/main.py
main.py
py
292
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "xfile.base.Engine", "line_number": 10, "usage_type": "call" }, { "api_name": "xfile.base.File", "line_number": 11, "usage_type": "call" } ]
10444612469
from shapely.geometry import Polygon from shapely import normalize from rasterio.warp import transform_geom from rasterio.crs import CRS from shapely.geometry import shape def pol_from_points(t): x1, y1, x2, y2 = t return normalize(Polygon(((x1,y1),(x1,y2),(x2,y2),(x2, y1), (x1, y1)))) def wrap_pol(pol, epsg1...
ArthurCalvi/Disturbance-Attribution-Dataset-Joining
visualisation/utils.py
utils.py
py
888
python
en
code
0
github-code
6
[ { "api_name": "shapely.normalize", "line_number": 9, "usage_type": "call" }, { "api_name": "shapely.geometry.Polygon", "line_number": 9, "usage_type": "call" }, { "api_name": "shapely.geometry.shape", "line_number": 13, "usage_type": "call" }, { "api_name": "raste...
31484799903
import numpy as np import matplotlib as plt nums = [0.5,0.7,1,1.2,1.3,2.1] bins = [0,1,2,3] x_pos = [i for i, _ in enumerate(nums)] plt.bar(x_pos, nums, color='yellow') plt.xlabel("Nums") plt.ylabel("Bins") plt.title("Numpy Task 2") plt.xticks(x_pos, nums) plt.show()
m-kona/numpy_task
task_two.py
task_two.py
py
268
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.bar", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.xlabel", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.ylabel", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.title", ...
19239091382
# dfs !!! 물통 # bfs 사용해서 해결했다. # visited는 a, b, c 모두에 대해서 만들 필요 없이, a, b가 결정되면 c도 결정되니 2차원으로 만들어도 충분하다 # a b c 각각에서 나머지 둘로 옮겨주는 경우를 하드 코딩했고, 물이 넘치거나 부족한 경우 등을 to에서 처리해줬다 from collections import deque def bfs(): q = deque() visited[0][0] = 1 # a, b에 물이 없을 때 q.append((0, 0)) ans = [C] # C에 가능한 물의 양 wh...
sdh98429/dj2_alg_study
BAEKJOON/dfs/b2251.py
b2251.py
py
3,284
python
ko
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 8, "usage_type": "call" } ]
30165599645
import plotly.graph_objects as go import dash import plotly.express as px import pandas as pd import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State # dash bootstrap 1.0 or higher dfc = pd.read_csv( ...
pierreolivierbonin/Plotly-Dash-WebApps
Sunny Street Viz for Social Good app.py
Sunny Street Viz for Social Good app.py
py
15,115
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.to_datetime...
74348631227
# -*- coding: utf-8 -*- import torch import numpy as np import pickle import time from utils.get_detected_info import get_anchor_nums, get_anchor_box_size prior_info = 0 min_area = None saved_matching = {} saved_conf_loc = {} prior_to_ratio = None matching_timer = 0. def point_form(boxes): """ Convert prior_boxes...
ksh108405/aligned-matching
layers/box_utils.py
box_utils.py
py
26,387
python
en
code
2
github-code
6
[ { "api_name": "torch.cat", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.cat", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.min", "line_number": 52, "usage_type": "call" }, { "api_name": "torch.max", "line_number": 54, ...
35446532256
import os import requests from aws_lambda_client.aws_auth import AWSRequestsAuth class AWSLambdaRequester: """Creates a lambda http requester. Can take credentials for custom access. Args: secret (str) access_key (str) session_token (str) region (st...
AnupamJuniwal/aws-lambda-client
aws_lambda_client/requester.py
requester.py
py
1,862
python
en
code
1
github-code
6
[ { "api_name": "os.getenv", "line_number": 18, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 20, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 22, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 24, ...
29125172208
from django.conf import settings from django.forms.models import inlineformset_factory from django.shortcuts import render, redirect from django.views.generic import UpdateView from annoying.functions import get_object_or_None from annoying.views import MultipleModelFormsView from customProfile.views import ArtistProf...
TimBest/ComposersCouch
artist/views/music.py
music.py
py
4,194
python
en
code
1
github-code
6
[ { "api_name": "customProfile.views.ArtistProfileView", "line_number": 16, "usage_type": "name" }, { "api_name": "customProfile.views.ArtistProfileFormMixin", "line_number": 21, "usage_type": "name" }, { "api_name": "photos.views.ImageFormMixin", "line_number": 21, "usage_...
8309293088
from datetime import datetime from io import StringIO from xml.etree.ElementTree import ElementTree, Element, SubElement from django.urls import reverse from share.models import Contributor from share.oaipmh.util import format_datetime # For convenience def SubEl(parent, tag, text=None, attrib={}): element = Su...
dwtcourses/SHARE
share/oaipmh/renderers.py
renderers.py
py
8,318
python
en
code
null
github-code
6
[ { "api_name": "xml.etree.ElementTree.SubElement", "line_number": 13, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.Element", "line_number": 26, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 28, "usage_type": "call" }, { ...
73732953787
#!/usr/bin/env python #-*- encoding:utf-8 -*- import json import execjs import urllib import requests lang_dict = { "source_code_name":{ "auto":"检测语言", "sq":"阿尔巴尼亚语", "ar":"阿拉伯语", "am":"阿姆哈拉语", "az":"阿塞拜疆语", "ga":"爱尔兰语", "et":"爱沙尼亚语", "eu":"巴斯克语", "be":"白俄罗斯语", "bg":"保加利亚语", ...
fkxxyz/fkxxyz-wechatRequestHandler
googleTranslate.py
googleTranslate.py
py
8,605
python
ko
code
0
github-code
6
[ { "api_name": "execjs.compile", "line_number": 227, "usage_type": "call" }, { "api_name": "urllib.parse.urlencode", "line_number": 279, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 279, "usage_type": "attribute" }, { "api_name": "requests.g...
28832594290
# importings from keras.models import Sequential from keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D from keras.preprocessing.image import ImageDataGenerator import keras from keras import backend as K import matplotlib.pyplot as plt import numpy as np import tensorflow as tf # The 1./255 is to conve...
DenooVa/Simple_Shapes_recognition
Shapes_recognition.py
Shapes_recognition.py
py
1,913
python
en
code
1
github-code
6
[ { "api_name": "keras.preprocessing.image.ImageDataGenerator", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.Sequential", "line_number": 24, "usage_type": "call" }, { "api_name": "keras.layers.Conv2D", "line_number": 25, "usage_type": "call" }, { ...
3607875177
# -*- coding: utf-8 -*- from shutil import which from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule from selenium import webdriver from selenium.webdriver.firefox.options import Options as FirefoxOptions from selenium.webdriver.support.ui import WebDriverWait from bs4 import Be...
paudan/wsj-scraper
wsj/spiders/company_list.py
company_list.py
py
2,949
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.firefox.options.Options", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 17, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 17, "usage_type": "name" }, ...