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
72531926909
# pylint: disable=redefined-outer-name # pylint: disable=unused-argument # pylint: disable=unused-variable import os import shutil from pathlib import Path from typing import Callable import pytest import yaml @pytest.fixture def tmp_compose_spec(tests_data_dir: Path, tmp_path: Path): src = tests_data_dir / "doc...
ITISFoundation/osparc-simcore
packages/service-integration/tests/test_command_config.py
test_command_config.py
py
1,231
python
en
code
35
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "name" }, { "api_name": "shutil.copyfile", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 13, "usage_type": "attribute" }, { "api_name": "typing.Callable", ...
15304075993
from sklearn import model_selection from sklearn.metrics import classification_report from sklearn.metrics import confusion_matrix from sklearn.metrics import accuracy_score from sklearn.linear_model import LogisticRegression from sklearn.tree import DecisionTreeClassifier from sklearn.neighbors import KNeighborsClassi...
tunir27/ICDCN-2019
Chennai_Floods_code/ML.py
ML.py
py
2,819
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 34, "usage_type": "call" }, { "api_name": "sklearn.model_selection", "line_number": 34, "usage_type": "name" }, { "...
3240628422
from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from entrepreneur.models import Usuario from authentication.serializers import UserListSerializers, UserSerializer @api_view(['GET', 'POST']) def user_api_view(request): # lista los usuari...
DevApa/auth_em
register/api.py
api.py
py
2,157
python
en
code
0
github-code
6
[ { "api_name": "entrepreneur.models.Usuario.objects.filter", "line_number": 12, "usage_type": "call" }, { "api_name": "entrepreneur.models.Usuario.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "entrepreneur.models.Usuario", "line_number": 12, "usa...
2737490777
import wikipedia import pyfiglet word = pyfiglet.figlet_format("KAREN") print(word) while True: engine=input ("Search: ") def my_summary(): summ=wikipedia.summary(engine) return summ val = my_summary() print(val)
Shuklabrother/Search-engine.py
Index.py
Index.py
py
272
python
en
code
0
github-code
6
[ { "api_name": "pyfiglet.figlet_format", "line_number": 4, "usage_type": "call" }, { "api_name": "wikipedia.summary", "line_number": 11, "usage_type": "call" } ]
33138124964
#mass import import pandas as pd import urllib.request import json import numpy as np import matplotlib.pyplot as plt from datetime import datetime, timedelta from sklearn.cluster import KMeans pd.options.display.max_rows = 999 #for getting the date 5 days ago daydif = str(datetime.today() - timedelta(days=5)) dayref ...
nicr0ss/RainDance
KMeans_model.py
KMeans_model.py
py
3,524
python
en
code
0
github-code
6
[ { "api_name": "pandas.options", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datetime.datetime.today", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime...
19581541837
import textract import re import os import requests from bs4 import BeautifulSoup import time import random # ===================================== get paper url ===================================== urls = [ 'https://sj.ctu.edu.vn/ql/docgia/nam-2015/loaichuyensan-2/xuatban-782.html', 'https://sj.ctu.edu.vn/q...
oldguard69/lvtn
server/core/archive/crawl_data_1.py
crawl_data_1.py
py
3,229
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 31, "usage_type": "call" }, { "api_name": "random.randint", "lin...
8870924854
from collections import deque import sys while True: try: a=str(input('Input final configuration: ')) N=int(a.replace(' ','')) if ((N>87654321)|(N<12345678)): raise ValueError('Incorrect configuration, giving up...') break except ValueError: print('Incorrect configuration, giving up...') sys.exit() ...
hanxuwu/Learning-Python
Principles of Programming/Assignment/Assignment1/ASS question2.files/rubiks_rectangle.py
rubiks_rectangle.py
py
5,218
python
en
code
3
github-code
6
[ { "api_name": "sys.exit", "line_number": 13, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 55, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 110, "usage_type": "call" } ]
35154021664
import json import os import cherrypy from jinja2 import Environment, FileSystemLoader # GET CURRENT DIRECTORY from helper import get_redis_connection, get_sorted_list from scrapper import main1 CUR_DIR = os.path.dirname(os.path.abspath(__file__)) env = Environment(loader=FileSystemLoader(CUR_DIR), trim_blocks=True)...
jayanthns/bseproect
run.py
run.py
py
1,974
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "jinja2.Environment", ...
70808003389
from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing.image import ImageDataGenerator import numpy as np import cv2 import matplotlib.pyplot as plt import matplotlib.image as mpimg model = load_model("/home/yash/Desktop/PyImageSearch/checkpoints/emotion1.h5") classifier = cv2.CascadeClassi...
theartificialguy/Deep-Learning-Projects
Emotion and Gender Classification/Emotion Classification/recognition.py
recognition.py
py
1,841
python
en
code
2
github-code
6
[ { "api_name": "tensorflow.keras.models.load_model", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 9, "usage_type": "call" }, { "api_name": "tensorflow.keras.preprocessing.image.ImageDataGenerator", "line_number": 15, "usag...
27673629381
import numpy as np import math import cv2 #input hsvColor:[h,s,v], ranges between (0-180, 0-255, 0-255) #and output true hsvColor:[h,s,v] def get_right_V(hsvColor): h = float(hsvColor[0]) s = float(hsvColor[1]) s1 = float(hsvColor[1])/255 v1 = float(hsvColor[2]) h60 = h / 60.0 h60f ...
zznewclear13/Gradient_Colorizing_Fix
Gradient_Colorzing_Fix.py
Gradient_Colorzing_Fix.py
py
1,205
python
en
code
0
github-code
6
[ { "api_name": "math.floor", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 27, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_numb...
26693866815
import torch import logging from tqdm import tqdm from schnetpack.src.schnetpack import properties __all__ = ["TorchStructureLBFGS"] class TorchStructureLBFGS(torch.optim.LBFGS): """ LBFGS optimizer that allows for relaxation of multiple structures in parallel. The approximation of the inverse hessian is...
maltefranke/solubility_prediction
schnetpack/src/schnetpack/interfaces/batchwise_optimizer.py
batchwise_optimizer.py
py
5,582
python
en
code
1
github-code
6
[ { "api_name": "torch.optim", "line_number": 9, "usage_type": "attribute" }, { "api_name": "schnetpack.src.schnetpack.properties.R", "line_number": 32, "usage_type": "attribute" }, { "api_name": "schnetpack.src.schnetpack.properties", "line_number": 32, "usage_type": "name...
13015171086
import pickle import torch import argparse from foresight.models import * from foresight.pruners import * from foresight.dataset import * from foresight.weight_initializers import init_net def get_num_classes(args): return 100 if args.dataset == 'cifar100' else 10 if args.dataset == 'cifar10' else 120 def parse_...
SamsungLabs/zero-cost-nas
nasbench2_pred.py
nasbench2_pred.py
py
4,715
python
en
code
137
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 33, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 33, "usage_type": "call" }, { "api_name": "torch.cu...
9001276762
from time import time from gurobipy import Model class MDSP: def __init__(self, d: list, filename: str, optimize=False, time_limit=3600): self.D = d self.B = sum(d) self.k = len(self.D) self.D_ = self.get_unique_distances() self.M = self.get_mult() self.P = list(ra...
cleberoli/mdsp
model/mdsp.py
mdsp.py
py
1,706
python
en
code
0
github-code
6
[ { "api_name": "gurobipy.Model", "line_number": 19, "usage_type": "call" }, { "api_name": "time.time", "line_number": 25, "usage_type": "call" }, { "api_name": "time.time", "line_number": 28, "usage_type": "call" } ]
41295805453
import pygame from pygame.locals import * import numpy as np from conway import Life class GameOfLife(Life): def __init__(self, width = 1600, height = 1000, cell_size = 5, speed = 10): Life.__init__(self, width // 10, height // 10) self.width = width self.height = height self.cell_s...
hatiff/GameLife
Life.py
Life.py
py
2,437
python
en
code
0
github-code
6
[ { "api_name": "conway.Life", "line_number": 6, "usage_type": "name" }, { "api_name": "conway.Life.__init__", "line_number": 8, "usage_type": "call" }, { "api_name": "conway.Life", "line_number": 8, "usage_type": "name" }, { "api_name": "pygame.display.set_mode", ...
25867921082
#import libraries import pandas as pd import numpy as np import bokeh from bokeh.plotting import figure, output_file, show from bokeh.models.tools import HoverTool from bokeh.core.properties import value from bokeh.models import ColumnDataSource, FactorRange from bokeh.plotting import figure import math from bokeh....
Fremont28/miami_flights-
flights_viz1.py
flights_viz1.py
py
12,432
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.to_datetime",...
75189166908
import pygame, threading pygame.init() white = (255, 255, 255) green = (0, 255, 0) blue = (0, 0, 128) X = 400 Y = 400 display_surface = pygame.display.set_mode((X, Y )) pygame.display.set_caption('Show Text') font = pygame.font.Font('freesansbold.ttf', 32) text = font.render('GeeksForGeeks', True, green, blue) ...
ger534/Proyecto2Arqui2
examplePygame.py
examplePygame.py
py
779
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.display...
73025036669
from enum import Enum from typing import List import sqlalchemy as sa from sqlalchemy import orm as so from .base import BaseMixin, db, IdentityMixin, TimestampMixin __all__ = ['Chat', 'ChatEntry'] class Chat(BaseMixin, IdentityMixin, TimestampMixin, db.Model): """Chat Model. Represents a chat conversatio...
sergeyklay/promptly
backend/promptly/models/chat.py
chat.py
py
2,313
python
en
code
1
github-code
6
[ { "api_name": "base.BaseMixin", "line_number": 12, "usage_type": "name" }, { "api_name": "base.IdentityMixin", "line_number": 12, "usage_type": "name" }, { "api_name": "base.TimestampMixin", "line_number": 12, "usage_type": "name" }, { "api_name": "base.db.Model",...
73674519546
'''This script contains the functions used to contruct and train the GAN.''' import numpy as np import pandas as pd import matplotlib.pyplot as plt import os import tensorflow as tf # Change the environment variable TF_CPP_MIN_LOG_LEVEL to 2 to avoid the orderbooks about the compilation of the CUDA code os.environ['TF...
DanieleMDiNosse/GAN_Anomaly_Detection
train.py
train.py
py
17,245
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.CRITICAL", "line_number": 41, "usage_type": "attribute" }, { "api_name": "logging....
17372597106
# LinearlyVariableInfill """ Linearly Variable Infill for 3D prints. Author: Barnabas Nemeth Version: 1.5 """ from ..Script import Script from UM.Logger import Logger from UM.Application import Application import re #To perform the search from cura.Settings.ExtruderManager import ExtruderManager from collections imp...
vaxbarn/LinearlyVariableInfill
LinearlyVariableInfill.py
LinearlyVariableInfill.py
py
21,725
python
en
code
0
github-code
6
[ { "api_name": "UM.i18n.i18nCatalog", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 26, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 27, "usage_type": "call" }, { "api_name": "enu...
72492708988
import pytest from pytest_persistence import plugin plg = plugin.Plugin() @pytest.mark.parametrize("scope", ["session", "package", "module", "class", "function"]) @pytest.mark.parametrize("result", ["result", 42]) def test_store_fixture(result, scope): fixture_id = ('fixture1', scope, 'tests/test_mock.py') ...
JaurbanRH/pytest-persistence
tests/test_unit.py
test_unit.py
py
1,367
python
en
code
0
github-code
6
[ { "api_name": "pytest_persistence.plugin.Plugin", "line_number": 5, "usage_type": "call" }, { "api_name": "pytest_persistence.plugin", "line_number": 5, "usage_type": "name" }, { "api_name": "pytest.mark.parametrize", "line_number": 8, "usage_type": "call" }, { "a...
12702052399
""" To render html web pages """ import random from django.http import HttpResponse from django.template.loader import render_to_string from articles.models import Article def home_view(request, id=None, *args, **kwargs): """ Take in a request (Django send request) return HTML as a response (We pic...
L1verly/djproject-private
djproject/views.py
views.py
py
832
python
en
code
0
github-code
6
[ { "api_name": "random.randint", "line_number": 19, "usage_type": "call" }, { "api_name": "articles.models.Article.objects.get", "line_number": 22, "usage_type": "call" }, { "api_name": "articles.models.Article.objects", "line_number": 22, "usage_type": "attribute" }, ...
34097968081
#!/usr/bin/python import curses import sys import RPi.GPIO as GPIO def main(stdscr): # do not wait for input when calling getch stdscr.nodelay(1) initGPIO() while True: # get keyboard input, returns -1 if none available c = stdscr.getch() if c != -1: # print numer...
tophsic/gpio
one_led_controled_by_s.py
one_led_controled_by_s.py
py
914
python
en
code
0
github-code
6
[ { "api_name": "RPi.GPIO.cleanup", "line_number": 23, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 23, "usage_type": "name" }, { "api_name": "sys.exit", "line_number": 24, "usage_type": "call" }, { "api_name": "RPi.GPIO.setmode", "line_numbe...
41584638888
"""Celery를 사용하는 예제""" import random import time from os import path from urllib import parse import requests from celery import Celery from pydub import AudioSegment from my_logging import get_my_logger logger = get_my_logger(__name__) # 크롤링 요청 간격 리스트 정의 RANDOM_SLEEP_TIMES = [x * 0.1 for x in range(10, 4...
JSJeong-me/2021-K-Digital-Training
Web_Crawling/python-crawler/chapter_5/crawler_with_celery_sample.py
crawler_with_celery_sample.py
py
5,058
python
ko
code
7
github-code
6
[ { "api_name": "my_logging.get_my_logger", "line_number": 11, "usage_type": "call" }, { "api_name": "celery.Celery", "line_number": 32, "usage_type": "call" }, { "api_name": "urllib.parse.urlparse", "line_number": 68, "usage_type": "call" }, { "api_name": "urllib.p...
32756126137
# !/usr/bin/python import os import sys # Logging configuration import logging class logger(logging.Logger): def __init__(self): """Initializer.""" super().__init__() logging.basicConfig(filename="errlog.log", filemode="a", format="(%(asctime)s)...
MohdFarag/Musical-Instruments-Equalizer
src/logger.py
logger.py
py
478
python
en
code
0
github-code
6
[ { "api_name": "logging.Logger", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", ...
42591021729
import os import numpy as np import pickle import argparse from implicit.bpr import BayesianPersonalizedRanking from implicit.nearest_neighbours import CosineRecommender from scipy.sparse import csr_matrix from methods import consul, oracle, PrivateRank, PrivateWalk np.random.seed(0) def recall(li, gt): if gt...
joisino/consul
evaluate.py
evaluate.py
py
8,347
python
en
code
5
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.log2", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.bincount", "...
5153764381
import pandas as pd import numpy as np import matplotlib.pyplot as plt import sklearn from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix, classification_report import xlsxwriter #Reading the file into the system file1 = ...
Royston2708/Loan_Defaulter_Project
Models/Decision Trees and Random Forrest.py
Decision Trees and Random Forrest.py
py
2,138
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 21, "usage_type": "call...
24883752413
from django.conf.urls import patterns, include, url urlpatterns = patterns('', url(r'^$', 'informes.views.home', name='i_home'), url(r'^pendientes/$', 'informes.views.informes_pendientes', name='i_pend'), url(r'^arreglados/$', 'informes.views.informes_arreglados', name='i_fixed'), url(r'^noarreglados/...
efylan/ccreservas
informes/urls.py
urls.py
py
592
python
es
code
0
github-code
6
[ { "api_name": "django.conf.urls.patterns", "line_number": 4, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "djan...
26023698980
import matplotlib.pyplot as plt import numpy as np #plot 1 x=np.arange(-8,8,0.1) y=x**3 plt.subplot(2,2,1) plt.plot(x,y) plt.title("plot 1") #plot 2 x=np.linspace(0,3*np.pi,400) y=x/(1+(x**4)*(np.sin(x))**2) plt.subplot(2,2,2) plt.plot(x,y) plt.title("plot 2") #plot 3 x=np.linspace(1,10,400) y=np.sin(1/(x**(1/2))) p...
suanhaitech/pythonstudy2023
Wangwenbin/Matplotlib4.py
Matplotlib4.py
py
492
python
uk
code
2
github-code
6
[ { "api_name": "numpy.arange", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
36733301943
import re import json from collections import defaultdict def file_paths(file_path= 'logs_2/postcts.log1'): with open(file_path, 'r') as file: file_data = file.read() return file_data def parse_log_file(): file_contents = file_paths() # Compile regex patterns for improved ...
DavidJose2000/Log_parse
Zpharse.py
Zpharse.py
py
6,755
python
en
code
0
github-code
6
[ { "api_name": "re.compile", "line_number": 16, "usage_type": "call" }, { "api_name": "re.DOTALL", "line_number": 17, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 18, "usage_type": "call" }, { "api_name": "re.compile", "line_number": ...
6794457250
from __future__ import annotations import typing from dataclasses import dataclass from anchorpy.borsh_extension import EnumForCodegen import borsh_construct as borsh class UninitializedJSON(typing.TypedDict): kind: typing.Literal["Uninitialized"] class ActiveJSON(typing.TypedDict): kind: typing.Literal["Ac...
Ellipsis-Labs/phoenixpy
phoenix/types/market_status.py
market_status.py
py
4,121
python
en
code
5
github-code
6
[ { "api_name": "typing.TypedDict", "line_number": 8, "usage_type": "attribute" }, { "api_name": "typing.Literal", "line_number": 9, "usage_type": "attribute" }, { "api_name": "typing.TypedDict", "line_number": 12, "usage_type": "attribute" }, { "api_name": "typing....
5897258860
import pickle import numpy as np from flask import Flask, request, jsonify # Load the pickled model with open('model.pkl', 'rb') as file: model = pickle.load(file) app = Flask(__name__) # Endpoint for making predictions @app.route('/predict', methods=['POST']) def predict(): try: data = request.get_j...
mdalamin706688/copd-ml-model
app.py
app.py
py
1,327
python
en
code
0
github-code
6
[ { "api_name": "pickle.load", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request", "lin...
38336203002
#!/usr/bin/python from websocket import create_connection import unittest from common import read_info from common import read_message from common import check_action as c import time import json class websocket_request(unittest.TestCase): """32. 安装脚本""" def setUp(self): rt=read_info.ReadInfo() ...
leen0910/websocket_api
websocket_api/test_case/test10_InstallScript.py
test10_InstallScript.py
py
2,199
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "common.read_info.ReadInfo", "line_number": 17, "usage_type": "call" }, { "api_name": "common.read_info", "line_number": 17, "usage_type": "name" }, { "api_name": "web...
10691788495
import logging from sentry.client.handlers import SentryHandler logger = logging.getLogger() # ensure we havent already registered the handler if SentryHandler not in map(lambda x: x.__class__, logger.handlers): logger.addHandler(SentryHandler(logging.WARNING)) # Add StreamHandler to sentry's default so y...
8planes/langolab
django/web/sentry_logger.py
sentry_logger.py
py
475
python
en
code
3
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "sentry.client.handlers.SentryHandler", "line_number": 6, "usage_type": "name" }, { "api_name": "sentry.client.handlers.SentryHandler", "line_number": 7, "usage_type": "call" }, ...
3885504768
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.utils.html import mark_safe from rooms.models import Room from .models import User # admin.ModelAdmin을 상속받는 경우 # @admin.register(User) # class CustomUserAdmin(admin.ModelAdmin): # """ Custom User Admin """ # list_di...
Odreystella/Pinkbnb
users/admin.py
admin.py
py
1,838
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 22, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 22, "usage_type": "name" }, { "api_name": "rooms.models.Room", "line_number": 23, "usage_type": "name" }, { "ap...
11844211331
from flask import Flask, render_template, request from mbta_helper import find_stop_near app = Flask(__name__, template_folder="templates") @app.route("/") def index(): """ This function asks for the user's location """ return render_template("index.html") @app.route("/POST/nearest", methods=["POST...
nandini363/Assignment-3
app.py
app.py
py
917
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 19, "usage_type": "attribute" }, { "api_name": "flask.requ...
18002323535
from hydra import compose, initialize import logging import torch from torch.utils.tensorboard import SummaryWriter from data.dataset import get_dex_dataloader from trainer import Trainer from utils.global_utils import log_loss_summary, add_dict from omegaconf import OmegaConf from omegaconf.omegaconf import open_dict...
PKU-EPIC/UniDexGrasp
dexgrasp_generation/network/train.py
train.py
py
4,171
python
en
code
63
github-code
6
[ { "api_name": "os.makedirs", "line_number": 22, "usage_type": "call" }, { "api_name": "omegaconf.omegaconf.open_dict", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 25, "usage_type": "call" }, { "api_name": "tor...
34465917082
import torch from torch.utils.data import DataLoader from .coco_dataset import build_dataset def batch_collator(batch): images, boxmgrs = list(zip(*batch)) images = torch.stack(images, dim=0) return images, boxmgrs def build_dataloader(cfg, is_train=True): dataset = build_dataset(cfg, is_train=is_t...
lmyybh/computer-vision
yolo/yolo/data/dataloader.py
dataloader.py
py
558
python
en
code
0
github-code
6
[ { "api_name": "torch.stack", "line_number": 9, "usage_type": "call" }, { "api_name": "coco_dataset.build_dataset", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 20, "usage_type": "call" } ]
12483191239
# reference: J. P. Tignol # "Galois Thoery of Algebraic Equations" chapter 12 import numpy as np from sympy import factorint,root,expand class Period:# Gaussian periods @classmethod def init(cls,p):# p must be prime n = p-1 g = 2 # generator mod p f = factorint(n) ...
tt-nakamura/cyclo
cyclo.py
cyclo.py
py
5,447
python
en
code
0
github-code
6
[ { "api_name": "sympy.factorint", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.int", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.empty", "line_nu...
35160550288
from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from django.contrib import messages from django.db.models import Q from .models import Employee from .forms import AddEmployeeForm @login_required(login_url='authapp:login') def index(request): context = dict(...
somukhan9/django-employee-management-system
employee/views.py
views.py
py
3,206
python
en
code
0
github-code
6
[ { "api_name": "models.Employee.objects.all", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Employee.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "models.Employee", "line_number": 13, "usage_type": "name" }, { "api_name...
41039585752
import logging import random import string import time import sys from decimal import Decimal from typing import Any, Callable, Optional, TypeVar, Union import requests from vega_sim.grpc.client import VegaCoreClient, VegaTradingDataClientV2 from vega_sim.proto.data_node.api.v2.trading_data_pb2 import GetVegaTimeReque...
vegaprotocol/vega-market-sim
vega_sim/api/helpers.py
helpers.py
py
6,261
python
en
code
19
github-code
6
[ { "api_name": "typing.TypeVar", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "random.choices", "line_number": 31, "usage_type": "call" }, { "api_name": "string.ascii_lowercas...
15018597005
from utils.utils import OS import sys if OS.Linux: import matplotlib matplotlib.use("agg") import json import math import multiprocessing import random from multiprocessing import Pool from threading import Thread from typing import Union, Callable from uuid import UUID import networkx from Model.Computatio...
Moni5656/npba
Model/ModelFacade.py
ModelFacade.py
py
30,489
python
en
code
0
github-code
6
[ { "api_name": "utils.utils.OS.Linux", "line_number": 4, "usage_type": "attribute" }, { "api_name": "utils.utils.OS", "line_number": 4, "usage_type": "name" }, { "api_name": "matplotlib.use", "line_number": 7, "usage_type": "call" }, { "api_name": "Model.Network.Ne...
3955950488
# -*- coding: utf-8 -*- """check cache status * check cache status * this file uses standalone """ import sys import os import json import time import subprocess import configparser from glob import glob from state_list import get_error_message, DONE config = configparser.ConfigParser() config.read("conf...
Neilsaw/PriLog_web
watchdog_status.py
watchdog_status.py
py
4,426
python
en
code
30
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 19, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path.getctime", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path", "l...
38867577492
from inspect import signature from functools import wraps import werdsazxc from platforms.config import CODE_DICT as config import json import threading import inspect import pickle import time import requests import logging import re logger = logging.getLogger('robot') requests.packages.urllib3.disable_warnings() ale...
gleam542/platforms
platforms/wg/utils.py
utils.py
py
16,213
python
zh
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.packages", "line_number": 14, "usage_type": "attribute" }, { ...
35560642063
import numpy as np import matplotlib.pyplot as plt import matplotlib from mayavi import mlab from scipy.ndimage import map_coordinates from scipy import signal, interpolate from PIL import Image, ImageDraw from matplotlib.colors import ListedColormap from tqdm import tqdm, trange def create_block_diagram(strat, prop, ...
zsylvester/stratigraph
stratigraph/stratigraph.py
stratigraph.py
py
50,938
python
en
code
8
github-code
6
[ { "api_name": "numpy.shape", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_numbe...
11557761416
import sys from classes import * import pprint import os # system keword 에 대한 dfa를 자동생성한다. def make_system_dfa(name, keyword): digit = "1234567890" char = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" length = len(keyword) dfa = Dfa(name) dfa.set_final_states([length]) for i in range...
pula39/compiler_assignment1
lexical.py
lexical.py
py
8,178
python
en
code
0
github-code
6
[ { "api_name": "os.path.splitext", "line_number": 184, "usage_type": "call" }, { "api_name": "os.path", "line_number": 184, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 193, "usage_type": "call" }, { "api_name": "sys.argv", "line_numb...
1999311786
import os from enum import Enum, auto from random import randint import pygame class Main: @staticmethod def start(): pygame.font.init() os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (400, 100) surface = pygame.display.set_mode((1200, 900)) pygame.display.set_caption('Mineswe...
MaximCosta/messy-pypi
messy_pypi/done/main_minesweeper.py
main_minesweeper.py
py
7,807
python
en
code
2
github-code
6
[ { "api_name": "pygame.font.init", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pygame.display.set_...
34098196022
import uvicorn from pyroute2 import IPRoute from fastapi import FastAPI ipr = IPRoute() ipr.bind() app = FastAPI() @app.get("/iface/{iface_name}") async def iface_id(iface_name): with IPRoute() as ipr: iface = ipr.link_lookup(ifname=iface_name) return {"iface": iface[0]}
andreagarbugli/iaac-tc-quic
tc-daemon/router.py
router.py
py
293
python
en
code
0
github-code
36
[ { "api_name": "pyroute2.IPRoute", "line_number": 5, "usage_type": "call" }, { "api_name": "fastapi.FastAPI", "line_number": 9, "usage_type": "call" }, { "api_name": "pyroute2.IPRoute", "line_number": 14, "usage_type": "call" } ]
33040837881
import io import struct from typing import Any, BinaryIO class StructStream(int): PACK = "" """ Create a class that can parse and stream itself based on a struct.pack template string. """ def __new__(cls: Any, value: int): value = int(value) try: v1 = struct.unpack(cl...
snight1983/chia-rosechain
chia/util/struct_stream.py
struct_stream.py
py
1,440
python
en
code
369
github-code
36
[ { "api_name": "typing.Any", "line_number": 13, "usage_type": "name" }, { "api_name": "struct.unpack", "line_number": 16, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": 16, "usage_type": "call" }, { "api_name": "struct.calcsize", "line_numb...
6198323090
''' 1.입력받은 문자의 길이별 + 문자별 조건식? 2.BruteForce니까 로직만 짜서 1씩 증가? <- 이래도 되는게 가장 큰 수 해봐야 5^5임 시간초과는 안날걸 2번으로 진행해보도록 하고, 로직은 어떻게 하느냐가 문제일듯 ''' from itertools import product def solution(word): answer = [] for i in range(1,6): for v in product(["A","E","I","O","U"],repeat = i): answer.append("".join(v...
byeong-chang/Baekjoon-programmers
프로그래머스/lv2/84512. 모음 사전/모음 사전.py
모음 사전.py
py
518
python
ko
code
2
github-code
36
[ { "api_name": "itertools.product", "line_number": 10, "usage_type": "call" } ]
14007737341
import torch import torch.nn as nn import torch.nn.functional as F import torchvision from torchvision import datasets, transforms from torchvision.utils import save_image import matplotlib.pyplot as plt import numpy as np import random class AutoEncoderNet(torch.nn.Module): def __init__(self, n_channels, dim_last...
s183920/02582_Computational_Data_Analysis_Case2
autoencoder/ae.py
ae.py
py
1,937
python
en
code
0
github-code
36
[ { "api_name": "torch.nn", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.prod", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn.Sequential", "line...
39908117264
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient import logging import time import argparse import json import ast AllowedActions = ['both', 'publish', 'subscribe'] file_path = "../History.log" faults = [] fault_type = "" # Read in command-line parameters parser = argparse.ArgumentParser() parser.add_argument("-e...
ngonza27/ctp-ngv-23
src/py/send_data.py
send_data.py
py
5,270
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 59, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 60, "usage_type": "attribute" }, { "api_name": "logging....
22382283158
import shutil import tempfile from django.contrib.auth import get_user_model from django.test import Client, TestCase, override_settings from django.urls import reverse from django import forms from django.conf import settings from django.core.files.uploadedfile import SimpleUploadedFile from django.core.cache import ...
krankir/Social-network
yatube/posts/tests/test_views.py
test_views.py
py
12,656
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 14, "usage_type": "call" }, { "api_name": "tempfile.mktemp", "line_number": 17, "usage_type": "call" }, { "api_name": "django.conf.settings.BASE_DIR", "line_number": 17, "usage_type": "attribute" }, { ...
73507098983
from django import forms from .Config import EffectType class ChooseEffectRadioForm(forms.Form): def __init__(self, effect_type, effect_label, *args, **kwargs): super(ChooseEffectRadioForm, self).__init__(*args, **kwargs) self.fields["pref-effect"] = forms.BooleanField(label=effect_label,...
gwolan/pic_convolving_website
upload_pic/src/ChooseEffectRadioForm.py
ChooseEffectRadioForm.py
py
932
python
en
code
0
github-code
36
[ { "api_name": "django.forms.Form", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "django.forms.BooleanField", "line_number": 9, "usage_type": "call" }, { "api_name": "django.for...
73256078825
# add CBAM注意力机制模块 import torch from torch import nn class ChannelAttention(nn.Module): def __init__(self, channel, ratio=16): super(ChannelAttention, self).__init__() self.max_pool = nn.AdaptiveMaxPool2d(1) self.avg_pool = nn.AdaptiveAvgPool2d(1) self.fc = nn.Sequen...
DickensKP/Yolov3-vehicle-pedestrian-trafficsign-detection-system
CBAM.py
CBAM.py
py
2,002
python
en
code
4
github-code
36
[ { "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.AdaptiveMaxPool2d", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", ...
17887863275
""" 集成了流式布局、按钮排布的窗口。 """ from PySide2.QtWidgets import QScrollArea, QWidget, QToolButton, QVBoxLayout, QSpacerItem, QSizePolicy from PySide2.QtCore import Qt, QSize from typing import TYPE_CHECKING if TYPE_CHECKING: from PySide2.QtGui import QResizeEvent from widgets import PMFlowLayout class PMFlowAreaWidge...
pyminer/pyminer
pyminer/widgets/widgets/basic/containers/flowarea.py
flowarea.py
py
2,813
python
en
code
77
github-code
36
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 8, "usage_type": "name" }, { "api_name": "PySide2.QtWidgets.QWidget", "line_number": 13, "usage_type": "name" }, { "api_name": "PySide2.QtWidgets.QVBoxLayout", "line_number": 18, "usage_type": "call" }, { "api_n...
21993890104
from typing import List from unittest import TestCase import torch from torch import Tensor from attnganw import config from attnganw.randomutils import get_vector_interpolation class TestInterpolation(TestCase): def test_get_noise_interpolation(self): batch_size = 1 noise_vector_size = 3 ...
cptanalatriste/birds-of-british-empire
tests/test_train.py
test_train.py
py
2,304
python
en
code
null
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.randn", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.float", "line_nu...
33245288481
#!/usr/bin/env python import rospy import matplotlib.pyplot as plt import matplotlib.animation import numpy as np from ti_mmwave_rospkg.msg import RadarScan class MySimpleClass(object): def __init__(self): self.sub = rospy.Subscriber('/ti_mmwave/radar_scan',RadarScan,self.sub_callback) self.tmp_x ...
YiShan8787/mm-2sensor
src/micro_doppler_pkg/scripts/test3.py
test3.py
py
1,420
python
en
code
0
github-code
36
[ { "api_name": "rospy.Subscriber", "line_number": 11, "usage_type": "call" }, { "api_name": "ti_mmwave_rospkg.msg.RadarScan", "line_number": 11, "usage_type": "argument" }, { "api_name": "numpy.c_", "line_number": 36, "usage_type": "attribute" }, { "api_name": "ros...
6798077511
import logging from django.core.management.base import BaseCommand from django.core.exceptions import ObjectDoesNotExist from embed_video.backends import detect_backend from ...clients import VimeoClient from ...models import Resource from ...conf import settings logger = logging.getLogger('vimeo') class Command(...
tomasgarzon/exo-services
service-exo-medialibrary/resource/management/commands/import_vimeo_resources.py
import_vimeo_resources.py
py
5,577
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 15, "usage_type": "name" }, { "api_name": "clients.VimeoClient", "line_number": 18, "usage_type": "call" }, { "api...
32975944321
#Scripts for the search import mysql.connector import json class carrier(): Name = "" Email = "" Location = [] class seller(): Firstname = "" Surname = "" Email = "" Graduate = False Location = "" Products = [] class product(): menteeName = "" menteeGraduate = F...
Team-14-CodeForGood2014/Cherie-Blair-Foundation-Marketplace
Django/cbfm/searchEngine/scripts.py
scripts.py
py
6,321
python
en
code
0
github-code
36
[ { "api_name": "mysql.connector.connector.connect", "line_number": 86, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 86, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 86, "usage_type": "name" }, { "...
11352228515
import os clear = lambda : os.system('cls') import datetime from time import process_time_ns x = datetime.datetime.now() ulang = "y" while ulang=="y" or ulang=="Y": kodeGolongan = [1,2,3] gajiPokok = [2500000, 4500000, 6500000] tunjanganIstri = [0.01, 0.03, 0.05] kodeJK =[1,2] JK = ['...
20083000169RianHudaMaulana/Uas-
UAS_20083000169_Rian Huda Maulana_2G.py
UAS_20083000169_Rian Huda Maulana_2G.py
py
8,062
python
en
code
0
github-code
36
[ { "api_name": "os.system", "line_number": 2, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "attribute" } ]
74605387945
from petalo_calib.tdc_corrections import correct_tfine_wrap_around from petalo_calib.qdc_corrections import correct_efine_wrap_around from petalo_calib.tdc_corrections import apply_tdc_correction_tot from petalo_calib.tdc_corrections import compute_integration_window_size from petalo_calib.tdc_corrections import add_...
jmbenlloch/petalo_calib
petalo_calib/scripts/process_files_tot_new_clusters.py
process_files_tot_new_clusters.py
py
4,761
python
en
code
0
github-code
36
[ { "api_name": "numpy.concatenate", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.int32", "line_num...
42887542436
from collections import OrderedDict class Cache: """ A python class which used ordered dictionary (OrderedDict) to implement the LRU cache. Each entry of the dictinoary will be a key/value pair. The search would be by key. LRU Cache will have its maximum size defined at initiation. When adding n...
harsimrit/task1
cacheLRU.py
cacheLRU.py
py
4,971
python
en
code
0
github-code
36
[ { "api_name": "collections.OrderedDict", "line_number": 29, "usage_type": "call" } ]
21333304207
import unittest from climateeconomics.sos_processes.iam.witness.witness_coarse.usecase_witness_coarse_new import Study from sostrades_core.execution_engine.execution_engine import ExecutionEngine from tempfile import gettempdir from copy import deepcopy from gemseo.utils.compare_data_manager_tooling import delete_keys_...
os-climate/witness-core
climateeconomics/tests/_l1_test_witness_parallel.py
_l1_test_witness_parallel.py
py
4,198
python
en
code
7
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "tempfile.gettempdir", "line_number": 16, "usage_type": "call" }, { "api_name": "sostrades_core.execution_engine.execution_engine.ExecutionEngine", "line_number": 17, "usage_t...
43157370954
#!/usr/bin/python3 import sys, pygame from pygame.locals import * black = (0, 0, 0) white = (255,255,255) red = (255,0,0) green = (0, 255, 0) blue = (0, 0, 255) pygame.init() pygame.display.set_caption("drawing") # set the title of the window surface = pygame.display.set_mode((400, 300)) # return pygame.Surface su...
minskeyguo/mylib
python-edu/17-pygame-basic/02-geometry.py
02-geometry.py
py
1,223
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.display.set_caption", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pygame.dis...
34547412730
from PIL import Image import cv2 # 選擇第二隻攝影機 cap = cv2.VideoCapture(0) while(True): # 從攝影機擷取一張影像 ret, frame = cap.read() frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) edges = cv2.Canny(frame, 100 , 200) # img_fc, contours, hierarchy = cv2.findContours(edges, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE...
Amenoimi/Simple_OCR
QR_GET.py
QR_GET.py
py
1,322
python
en
code
0
github-code
36
[ { "api_name": "cv2.VideoCapture", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2.Canny", ...
73642772264
# ----------------------------------------------------------- # --------- Assignment 4 - PCA analysis with Python ------------------ # ----------------------------------------------------------- # Author: Tomas Milla-Koch # Purpose: The following script is script for clipping a scene to vector boundary and performing...
tomasmk/Remote-Sensing-Automation
PCA.py
PCA.py
py
4,658
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 31, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 31, "usage_type": "name" }, { "api_name": "os.getcwd", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path.exists", ...
71116093224
from common.httphandler import HttpHander from common.yml_util import YmlUtil import pytest, json http = HttpHander() YmlUt = YmlUtil() class TestCaseSingle: def get_case_all(self, case_data, url_map, header): if case_data.get("method") == 'get': resp = http.get(url=url_map, headers=header) ...
itol220/testapi
testcases/test_single.py
test_single.py
py
1,385
python
en
code
0
github-code
36
[ { "api_name": "common.httphandler.HttpHander", "line_number": 4, "usage_type": "call" }, { "api_name": "common.yml_util.YmlUtil", "line_number": 5, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 25, "usage_type": "call" }, { "api_n...
25321444319
import pandas as pd from glob import glob from datetime import datetime import os def removeDups(file): df = pd.read_excel(file) # Keep only FIRST record from set of duplicates df_first_record = df.drop_duplicates(subset="Date/Time", keep="first") #creates an excel file with sorted times if glob("n...
OliverSolomon/flaskExcel
reporter.py
reporter.py
py
3,444
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_excel", "line_number": 7, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 11, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_num...
17704956797
import numpy as np from PyQt5.QtWidgets import QWidget, QApplication, QVBoxLayout from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg from matplotlib.figure import Figure from SO3 import SO3 from rotation import Ui_Form class My_window(QWidget, Ui_Form): def __init__(self, parent=None, *args, **kwa...
rollingball-3/Learning-rotation
main.py
main.py
py
2,586
python
en
code
0
github-code
36
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 11, "usage_type": "name" }, { "api_name": "rotation.Ui_Form", "line_number": 11, "usage_type": "name" }, { "api_name": "SO3.SO3", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.figure.Fi...
40243436461
""" Beautify Images Utils """ import random import operator import heapq import math from scipy.interpolate import UnivariateSpline import cv2 import pilgram from PIL import Image, ImageStat import numpy as np from src.utils.image_process import ( do_we_need_to_sharpen, sharpen_my_image, adjust_contrast...
teyang-lau/you-only-edit-once
src/utils/beautify.py
beautify.py
py
6,911
python
en
code
6
github-code
36
[ { "api_name": "random.choice", "line_number": 46, "usage_type": "call" }, { "api_name": "heapq.nlargest", "line_number": 62, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 62, "usage_type": "call" }, { "api_name": "heapq.nlargest", ...
75091410342
import tensorflow as tf from transformers import GPT2Tokenizer, TFGPT2LMHeadModel import wikipediaapi # Set up Wikipedia API wiki = wikipediaapi.Wikipedia('en') # Set up tokenizer and model tokenizer = GPT2Tokenizer.from_pretrained('gpt2') model = TFGPT2LMHeadModel.from_pretrained('gpt2', pad_token_id=tokenizer.eos_t...
ethan-haynes/test
train.py
train.py
py
2,291
python
en
code
0
github-code
36
[ { "api_name": "wikipediaapi.Wikipedia", "line_number": 6, "usage_type": "call" }, { "api_name": "transformers.GPT2Tokenizer.from_pretrained", "line_number": 9, "usage_type": "call" }, { "api_name": "transformers.GPT2Tokenizer", "line_number": 9, "usage_type": "name" }, ...
27653523771
import time import utilities.custom_logger as cl import logging from base.basepage import BasePage from base.selenium_driver import SeleniumDriver class Register_courses_page(BasePage): log = cl.customLogger(logging.DEBUG) #Locators _search_box_id = "search-courses" _course_xpath = "/html/body/div...
akanksha2306/selenium_python_practice
pages/courses/register_courses_page.py
register_courses_page.py
py
3,129
python
en
code
0
github-code
36
[ { "api_name": "base.basepage.BasePage", "line_number": 9, "usage_type": "name" }, { "api_name": "utilities.custom_logger.customLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "utilities.custom_logger", "line_number": 11, "usage_type": "name" }, { ...
70168571944
import matplotlib.pyplot as plt import numpy as np x = np.linspace(0,10,100) y = [] up_limit = 0.8 for i in x: if i < 6: y.append(0) elif i < 9: y.append((i-6)/3 * up_limit) else: y.append(up_limit) plt.plot(x,y) plt.show()
CryptoGamer8/INFO6205-FINAL
Model/main/draw.py
draw.py
py
264
python
en
code
2
github-code
36
[ { "api_name": "numpy.linspace", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "matplotlib.pyp...
8640307873
"""Extract hourly real-time EIA data from the bulk-download zip file.""" import pandas as pd import json from os.path import join import os import zipfile import requests import logging from electricitylci.globals import data_dir def download_EBA(): """Add docstring.""" url = 'http://api.eia.gov/bulk/EBA.zip...
USEPA/ElectricityLCI
electricitylci/bulk_eia_data.py
bulk_eia_data.py
py
5,340
python
en
code
23
github-code
36
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "electricitylci.globals.data_dir...
7630680769
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('inicio', '0006_auto_20160820_2050'), ] operations = [ migrations.CreateModel( name='cargo', fields=[...
juanjavierlimachi/sistema-de-Informacion
mipagina/mipagina/apps/inicio/migrations/0007_auto_20160820_2141.py
0007_auto_20160820_2141.py
py
1,065
python
en
code
0
github-code
36
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
13790256283
#!/usr/bin/env python import rbd import rados import json import subprocess from itertools import chain from texttable import Texttable, get_color_string, bcolors def f(x): if x=="quota_max_bytes": return str(pool[x]/1024/1024) else: return str(pool[x]) p = subprocess.check_output('ceph osd du...
angapov/ceph-scripts
ceph.py
ceph.py
py
2,086
python
en
code
0
github-code
36
[ { "api_name": "subprocess.check_output", "line_number": 15, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 16, "usage_type": "call" }, { "api_name": "texttable.Texttable", "line_number": 17, "usage_type": "call" }, { "api_name": "texttable.get_...
15616400542
from typing import Dict from tools.coco_dataset_metrics import COCODatasetMetrics from tools.tools import load_json_data from detectron2_metrics import TrainingMetrics, InferenceMetrics def load_annotations(annotation_paths: Dict): """ Load annotations from path and assign them to corresponding key. :par...
Mathiasn21/household_object_detection
code/plot_metrics.py
plot_metrics.py
py
2,100
python
en
code
0
github-code
36
[ { "api_name": "typing.Dict", "line_number": 8, "usage_type": "name" }, { "api_name": "tools.tools.load_json_data", "line_number": 17, "usage_type": "call" }, { "api_name": "tools.coco_dataset_metrics.COCODatasetMetrics", "line_number": 49, "usage_type": "call" }, { ...
74950126185
#!/usr/bin/env python # coding: utf-8 # In[45]: # Choquet adaptive thresholding: two step algorithm import progressbar from time import sleep import math import cv2 import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg import PIL from skimage import measure from pynverse import inver...
lodeguns/FuzzyAdaptiveBinarization
fuzzy_adaptive_bin.py
fuzzy_adaptive_bin.py
py
36,527
python
en
code
3
github-code
36
[ { "api_name": "numpy.set_printoptions", "line_number": 31, "usage_type": "call" }, { "api_name": "sys.warnoptions", "line_number": 34, "usage_type": "attribute" }, { "api_name": "warnings.simplefilter", "line_number": 35, "usage_type": "call" }, { "api_name": "mat...
24390099064
import re from . import builder, cc, msvc from .. import log, shell from .common import choose_builder, guess_command, make_command_converter from ..languages import known_langs with known_langs.make('rc') as x: x.vars(compiler='RC', flags='RCFLAGS') x.exts(source=['.rc']) _c_to_rc = make_command_converter([...
jimporter/bfg9000
bfg9000/tools/rc.py
rc.py
py
1,858
python
en
code
73
github-code
36
[ { "api_name": "languages.known_langs.make", "line_number": 8, "usage_type": "call" }, { "api_name": "languages.known_langs", "line_number": 8, "usage_type": "name" }, { "api_name": "common.make_command_converter", "line_number": 12, "usage_type": "call" }, { "api_...
13744203488
import glob import os import requests import time import sys import numpy as np import pandas as pd from pandas.core.frame import DataFrame from geocoding_api_extract.utils.progress import Progress def create_geocoding_api_request_str(street, city, state, benchmark='Public_AR_Ce...
AndoKalrisian/geocoding_api_extract
src/geocoding_api_extract/__init__.py
__init__.py
py
9,005
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 61, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 91, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 98, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line...
31063677025
from ..utils import Object class LoginUrlInfoRequestConfirmation(Object): """ An authorization confirmation dialog needs to be shown to the user Attributes: ID (:obj:`str`): ``LoginUrlInfoRequestConfirmation`` Args: url (:obj:`str`): An HTTP URL to be opened d...
iTeam-co/pytglib
pytglib/api/types/login_url_info_request_confirmation.py
login_url_info_request_confirmation.py
py
1,365
python
en
code
20
github-code
36
[ { "api_name": "utils.Object", "line_number": 6, "usage_type": "name" } ]
39845550652
""" Iguana (c) by Marc Ammon, Moritz Fickenscher, Lukas Fridolin, Michael Gunselmann, Katrin Raab, Christian Strate Iguana is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. You should have received a copy of the license along with this work. If not, see <http://creativecommons.org...
midas66/iguana
src/timelog/validators.py
validators.py
py
1,138
python
en
code
null
github-code
36
[ { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "attribute" }, { "api_name": "django.utils.timezone.now", "line_number": 21, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 21, "usage_type": "name" }, { "api_name":...
31867884735
from setuptools import setup, find_packages from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() version = {} with open(path.join(here, "sonocrop", "__version__.p...
davycro/sonocrop
setup.py
setup.py
py
1,442
python
en
code
6
github-code
36
[ { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
70585542504
## # 邮件自动推送 -- 20191105 created by terrell # 配置相关变量 # 设置主题、正文等信息 # 添加附件 # 登录、发送# import time import os import smtplib import email import datetime import sys import traceback from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText year = in...
yudongjian/remember_word_tkinter
sent_mailToLeo.py
sent_mailToLeo.py
py
2,257
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "da...
12486383692
''' Created on Jan 29, 2020 @author: Michal.Busta at gmail.com ''' import numpy as np import neptune class Meter: '''A meter to keep track of losses scores throughout an epoch''' def __init__(self, phase, epoch, use_neptune=False, log_interval = 100, total_batches = 100): self.metrics = {} self.r...
drivendataorg/open-cities-ai-challenge
3rd Place/meter.py
meter.py
py
1,744
python
en
code
113
github-code
36
[ { "api_name": "numpy.mean", "line_number": 42, "usage_type": "call" }, { "api_name": "neptune.log_metric", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 47, "usage_type": "call" }, { "api_name": "numpy.mean", "line_numbe...
70585526504
import sys, copy from udp_interface import udp_interface import numpy as np import os # from ppo.run import train # from baselines.common import tf_util as U from utils.action_filter import ActionFilterButter from utils.reference_generator import ReferenceMotionGenerator from collections import deque from utils.utilit...
yichen928/RSR_Goalkeeper
src/rl_control/env.py
env.py
py
18,624
python
en
code
0
github-code
36
[ { "api_name": "numpy.ndarray", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 24, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 25, "usage_type": "attribute" }, { "api_name": "numpy.ndarra...
27435770961
import os import pathlib from matplotlib import pyplot as plt from skimage import io, img_as_float from skimage.color import rgb2gray from skimage.filters.edges import sobel from skimage.segmentation import felzenszwalb, watershed, mark_boundaries, slic, quickshift def read_boundaries(_img): # Read image _i...
206081/psio
Lab3/zad3.py
zad3.py
py
2,134
python
en
code
0
github-code
36
[ { "api_name": "skimage.io.imread", "line_number": 14, "usage_type": "call" }, { "api_name": "skimage.io", "line_number": 14, "usage_type": "name" }, { "api_name": "skimage.img_as_float", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.f...
38232459709
""" 获取csdn用户资料 """ import sys import json sys.path.append(r'D:\github\python\python-spider') from csdnTest import * #1.链接本地数据库服务 name = MongoClient('localhost') #2.链接本地数据库 demo 没有会创建 db = name.demo #demo数据库名 # 3.创建,连接集合 emp = db.employees # employees集合名 user = db.csdn_users # page集合名 # 爬取‘前端’模块 category = 'web' ...
guosimin/python-spider
csdnTest/getUser.py
getUser.py
py
2,266
python
en
code
6
github-code
36
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 39, "usage_type": "call" } ]
33164677249
""" 2019 La Brachistochrone Réelle Un TIPE réalisé par Gautier BEN AÏM http://tobog.ga """ import numpy as np # # I. Calculs physiques # ====================== # def generer_lign...
GauBen/Toboggan
toboggan.py
toboggan.py
py
14,074
python
fr
code
1
github-code
36
[ { "api_name": "numpy.random.randint", "line_number": 114, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 114, "usage_type": "attribute" }, { "api_name": "numpy.random.randint", "line_number": 115, "usage_type": "call" }, { "api_name": "numpy....
10328382240
from django.shortcuts import render,redirect,get_object_or_404 from django.http import HttpResponse from .models import Item,Category import datetime # Create your views here. def index(request): tasks = Item.objects.all() categories = Category.objects.all() context = {"task_list" : tasks, ...
FazalJarral/Notetaker
todo/views.py
views.py
py
1,004
python
en
code
0
github-code
36
[ { "api_name": "models.Item.objects.all", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Item.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.Item", "line_number": 9, "usage_type": "name" }, { "api_name": "models.Cate...
4409217473
from time import sleep import requests class AntiCaptcha: def __init__(self, client_key): self.base_url = "https://api.anti-captcha.com/" self.headers = {"Content-Type": "Application/json"} self.client_key = client_key def _post(self, endpoint: str, data: object): """Make requ...
ShayBox/AntiCaptcha
anticaptcha/main.py
main.py
py
2,693
python
en
code
3
github-code
36
[ { "api_name": "requests.post", "line_number": 27, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 75, "usage_type": "call" } ]
1398892267
from flask import Flask,render_template from time import time class Blockchain: def __init__(self): self.transactions = [] self.chain = [] self.create_block(0, '00') def create_block(self, nonce, previous_hash): block = { 'block_number': len(self.chain)+1, ...
Thilagavathycse/Block-Chain-learnings
blockchain.py
blockchain.py
py
687
python
en
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 29, "usage_type": "call" } ]
38877688552
import pandas as pd import numpy as np # For preprocessing the data from sklearn.preprocessing import Imputer from sklearn import preprocessing # To split the dataset into train and test datasets from sklearn.cross_validation import train_test_split # To model the Gaussian Navie Bayes classifier from sklearn.naive_baye...
XecureBot/DeepikaDS
data.py
data.py
py
2,534
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.cross_validation.train_test_split", "line_number": 52, "usage_type": "call" }, { "api_name": "sklearn.naive_bayes.GaussianNB", "line_number": 54, "usage_type": "call" }, ...
21011472446
import os from pytest import raises from pydantic.error_wrappers import ValidationError from pathlib import Path from unittest import TestCase from lazy_env_configurator import BaseConfig, BaseEnv from lazy_env_configurator.custom_warnings import EnvWarning class TestInvalidEnv(TestCase): def test_eager_validati...
satyamsoni2211/lazy_env_configurator
tests/test_eager_validation.py
test_eager_validation.py
py
1,131
python
en
code
2
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "pytest.raises", "line_number": 13, "usage_type": "call" }, { "api_name": "pydantic.error_wrappers.ValidationError", "line_number": 13, "usage_type": "argument" }, { "api_n...
8596743224
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Extract persistent network by removing ephemeral links and adding missing links. Two filters: 1. at least 100 daily views for target video 2. the mean daily views of source video is at least 1% of the target video Usage: python extract_persistent_network.py Input data...
avalanchesiqi/networked-popularity
wrangling/extract_persistent_network.py
extract_persistent_network.py
py
4,496
python
en
code
11
github-code
36
[ { "api_name": "sys.path.append", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number...
27687264440
from WGF import GameWindow, AssetsLoader, shared from os.path import join import logging log = logging.getLogger(__name__) SETTINGS_PATH = join(".", "settings.toml") LEADERBOARD_PATH = join(".", "leaderboard.json") LB_LIMIT = 5 def load_leaderboard(): if getattr(shared, "leaderboard", None) is None: fr...
moonburnt/WeirdLand
Game/main.py
main.py
py
4,372
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "WGF.shared", "line_numbe...
21928404743
# css selector 활용 크롤링 ''' # css란? Cascading Style Sheets html로 잡힌 골격에 스타일링(색, 크기 등)을 하는 것 스타일의 이름으로 구조가 특정지어질 수 있음(css selector) CSS selector - 웹 구성 시 CSS Selector을 직접 활용해 이름을 붙혀 만들기 때문에 CSS Selector로 찾아질 가능성이 높다 - Element Type 방식 태그 값들이 selector의 기준이 된다 - ID 방식 태그 내 id 값이 존재하면 id값이 selector의 기준이 된다 - Class 방식 태그 ...
sh95fit/Python_study
Python_Crawling/Crawling_Static/Static_Study06.py
Static_Study06.py
py
1,717
python
ko
code
1
github-code
36
[ { "api_name": "collections.Callable", "line_number": 31, "usage_type": "attribute" }, { "api_name": "collections.abc", "line_number": 31, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 35, "usage_type": "call" }, { "api_name": "bs4.Beaut...
4932293353
from transformers import GPT2Tokenizer import json import matplotlib.pyplot as plt ## This file was used to find the length of our longest input in tokens and visualize the distribution of token length with open('./combined_data.jsonl', 'r') as json_file: json_list = list(json_file) tokenizer = GPT2Tokenizer.f...
brennanem/CS324FinalProject
check_tokens.py
check_tokens.py
py
958
python
en
code
0
github-code
36
[ { "api_name": "transformers.GPT2Tokenizer.from_pretrained", "line_number": 11, "usage_type": "call" }, { "api_name": "transformers.GPT2Tokenizer", "line_number": 11, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 18, "usage_type": "call" }, { "...
1767000003
from setuptools import setup, find_packages REQUIREMENTS = [] with open("requirements.txt") as f: for line in f.readlines(): line = line.strip() if len(line) == 0: continue REQUIREMENTS.append(line) setup( name = "wallstreet", version = "0.1", packages = find_packag...
breakhearts/wallstreet
setup.py
setup.py
py
605
python
en
code
0
github-code
36
[ { "api_name": "setuptools.setup", "line_number": 11, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 14, "usage_type": "call" } ]
41076521456
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel class AlertDialogClass(QDialog): """ This class load the help dialog pyqt component """ def __init__(self, title, message, parent=None): """ Confirm dialog class constructor :param parent: """...
samuelterra22/Analysis-of-antenna-coverage
src/main/python/dialogs/alert_dialog_class.py
alert_dialog_class.py
py
855
python
en
code
5
github-code
36
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 6, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QDialog.__init__", "line_number": 16, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 16, "usage_type": "name" }, { "a...