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
16638837739
# !/usr/bin/python # -*- coding: utf-8 -*- """ __author__ = 'qing.li' """ from django import template from django.conf import settings import re from collections import OrderedDict from django.conf import settings register = template.Library() @register.inclusion_tag('rbac/menu.html') def menu(request): menu_ord...
QingqinLi/nb_crm
rbac/templatetags/rabc.py
rabc.py
py
2,027
python
en
code
0
github-code
6
[ { "api_name": "django.template.Library", "line_number": 12, "usage_type": "call" }, { "api_name": "django.template", "line_number": 12, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 17, "usage_type": "call" }, { "api_name": "djang...
10420483101
""" .. moduleauthor:: Martí Congost <marti.congost@whads.com> """ from typing import Any, Optional, Set, Tuple from httplib2 import Http from base64 import urlsafe_b64encode from json import loads, dumps from cocktail.modeling import overrides from .exceptions import CacheKeyError from .cachekey import CacheKey from ...
marticongost/cocktail
cocktail/caching/restcachestorage.py
restcachestorage.py
py
4,258
python
en
code
0
github-code
6
[ { "api_name": "cachestorage.CacheStorage", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 26, "usage_type": "name" }, { "api_name": "cacheserializer.CacheSerializer", "line_number": 26, "usage_type": "name" }, { "api_nam...
7795341803
import json from random import randint import ideas.utils as utils IDEA_PATH = './ideas/ideas.json' class Generator: def __init__(self, context='general', keys=[]): self.idea_path = IDEA_PATH self.context = context self.rand_items = [] with open(self.idea_path, 'r') as json_fil...
kjbyleni/My_Art_tools
ideas/generator.py
generator.py
py
1,757
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 28, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 34, "usage_type": "call" }, { "api_name": "random.randint", "line_number...
779154686
from typing import Annotated from fastapi import APIRouter, Depends, status from fastapi.encoders import jsonable_encoder from fastapi.responses import JSONResponse from pydantic_core import ValidationError from readconnect.shared.domain.dtos.error_response_dto import ErrorResponse from readconnect.shared.domain.exce...
YeisonKirax/readconnect-back
src/readconnect/auth/infrastructure/routes/auth_routes.py
auth_routes.py
py
3,939
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 19, "usage_type": "call" }, { "api_name": "domain.dtos.login_request_dto.LoginRequestDTO", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.Annotated", "line_number": 33, "usage_type": "name" }, { "...
29918439800
#Tarea 20, para lenguajes de programacion import matplotlib.pyplot as plt import numpy as np print ("Minimos cuadrados") print ("Este programa calcula la pendiente (m), la intercepcion(b) y el coeficiente de relacion(r) de una regresion lineal") print ("¿Cuantos datos (en pares (x1,y1) se considera 1) desea evaluar? (m...
EdmundoD3/Ejercicios-de-Python
programas python parte 2/T20_Minimos_cuadrados.py
T20_Minimos_cuadrados.py
py
2,290
python
es
code
0
github-code
6
[ { "api_name": "numpy.arange", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "...
32129407183
import json import bitarray from find_recipes_simple import process_recipe import time import sys PROCESS_SIZE = 50000000 def execute_find_recipe(item_str, recipe_data): if not item_str: return 0, 0 hp_crit, hp, price = process_recipe(recipe_data, item_str) # crit increases hp by 12, we just ne...
iTNTPiston/botw-recipe
dump/dump.py
dump.py
py
4,729
python
en
code
1
github-code
6
[ { "api_name": "find_recipes_simple.process_recipe", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.stdout.write", "line_number": 110, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 110, "usage_type": "attribute" }, { "api_name": ...
29510369443
import pandas as pd import numpy as np from sklearn.base import BaseEstimator, TransformerMixin from sklearn.model_selection import cross_val_predict from sklearn.metrics import classification_report data = pd.read_csv('./ner_dataset.csv', encoding='latin1') data = data.fillna(method="ffill") # ffill前值填充,pfill后值填充 ...
jiangq195/tanxin
starter_code1/NER/majority_voting.py
majority_voting.py
py
1,532
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.base.BaseEstimator", "line_number": 17, "usage_type": "name" }, { "api_name": "sklearn.base.TransformerMixin", "line_number": 17, "usage_type": "name" }, { "api_name"...
648044037
import time import h5py from affogato.segmentation import InteractiveMWS def debug(): z = 0 path = '/home/pape/Work/data/ilastik/mulastik/data/data.h5' with h5py.File(path, 'r') as f: # raw = f['raw'][z] affs = f['prediction'][:, z] strides = [4, 4] offsets = [[-1, 0], [0, -1], [-...
constantinpape/affogato
example/interactive/debug.py
debug.py
py
1,168
python
en
code
9
github-code
6
[ { "api_name": "h5py.File", "line_number": 9, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 17, "usage_type": "call" }, { "api_name": "affogato.segmentation.InteractiveMWS", "line_number": 21, "usage_type": "call" }, { "api_name": "time.time", ...
37370928668
import torch import torchvision # post-processing def handle_preds(preds, device, conf_thresh=0.25, nms_thresh=0.45): total_bboxes, output_bboxes = [], [] # 将特征图转换为检测框的坐标 N, C, H, W = preds.shape bboxes = torch.zeros((N, H, W, 6)) pred = preds.permute(0, 2, 3, 1) # 前背景分类分支 pobj = pred[:, ...
Zhefan-Xu/onboard_detector
scripts/yolo_detector/utils/tool.py
tool.py
py
2,179
python
en
code
9
github-code
6
[ { "api_name": "torch.zeros", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.meshgrid", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.arange", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.cat", "line_number"...
31629715534
from flask import Flask, render_template, redirect, request from flask import Blueprint from models.visit import Visit import repositories.visit_repository as visit_repository import repositories.country_repository as country_repository import repositories.user_repository as user_repository visits_blueprint = Bluepri...
paolaguerralibrero/bucket_list_python_project_w5
controllers/visit_controller.py
visit_controller.py
py
1,562
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 9, "usage_type": "call" }, { "api_name": "repositories.visit_repository.show_all", "line_number": 14, "usage_type": "call" }, { "api_name": "repositories.visit_repository", "line_number": 14, "usage_type": "name" }, { ...
13543436023
import pandas as pd import numpy as np import scipy.stats as stats import pylab as pl import re import seaborn as sns import matplotlib.pyplot as plt import random sns.set(font_scale = 1.5) pd.set_option('display.max_columns', 15) pd.set_option('display.max_rows', 40) filepath = '\\Coding\\DataAnalystI...
avielchow/Property-Assessment-Analysis
Analysis.py
Analysis.py
py
5,400
python
en
code
0
github-code
6
[ { "api_name": "seaborn.set", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
71740452349
#/usr/bin/env python import yaml import os, sys, re import subprocess import argparse ## Arguments parser = argparse.ArgumentParser(description='Create a shared cuda.yml for docker-compose') parser.add_argument('--gpu', '-g', action='append', dest='gpus', default=[]) parser.add_argument('--verbose', action='stor...
auser/docker-tensorflow-ipython-celery-rest-server
shared/create_cuda.py
create_cuda.py
py
4,297
python
en
code
7
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 52, "usage_type": "call" }, { "api_name": "os.devnull", "line_number": 52, "usage_type": "attribute" }, { "api_name": "subprocess.ST...
42913447777
import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.animation as animation import matplotlib.cm as cm import matplotlib.patches as mpatches import json import sys from helpers.helpers_visualisation import get_colors from scipy.misc import imread import matplotlib.image as mpimg ...
elbuco1/AttentionMechanismsTrajectoryPrediction
src/visualization/classes/animation.py
animation.py
py
7,151
python
en
code
49
github-code
6
[ { "api_name": "json.load", "line_number": 20, "usage_type": "call" }, { "api_name": "json.load", "line_number": 21, "usage_type": "call" }, { "api_name": "json.load", "line_number": 22, "usage_type": "call" }, { "api_name": "json.load", "line_number": 23, ...
26041286196
from __future__ import annotations import itertools import logging import os from typing import Callable, Iterable, cast from packaging.utils import canonicalize_name as canonicalize_project_name from pants.backend.python.goals.lockfile import synthetic_lockfile_target_name from pants.backend.python.macros.common_fi...
pantsbuild/pants
src/python/pants/backend/python/macros/common_requirements_rule.py
common_requirements_rule.py
py
6,084
python
en
code
2,896
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 41, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 42, "usage_type": "name" }, { "api_name": "typing.Iterable", "line_number": 42, "usage_type": "name" }, { "api_name": "pants.util.pip_requ...
6015616240
#!/usr/bin/env python #coding: utf-8 import asyncio import yaml import sys from NetDevices import DeviceHandler from git import Repo import time FILEPATH = "/root/device_cfg/" async def get_config(device): hostname = device.get("hostname") conn = DeviceHandler(device) conn.connect() await conn.login()...
netdevops-engineer/newbie_book
Chapter13/Chapter13/Device.asyncio/Device6.py
Device6.py
py
989
python
en
code
36
github-code
6
[ { "api_name": "NetDevices.DeviceHandler", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 28, "usage_type": "call" }, { "api_name": "yaml.load", "line...
34075662644
import random import sys from UI import Ui_MainWindow from PyQt5.QtCore import QPoint, QRect from PyQt5.QtGui import QPainter, QColor from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow MAX_X = MAX_Y = 400 class MyWidget(QMainWindow, Ui_MainWindow): def __init__(self): super().__init__() ...
Orisphera/random-circles
main.py
main.py
py
1,188
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 11, "usage_type": "name" }, { "api_name": "UI.Ui_MainWindow", "line_number": 11, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 19, "usage_type": "call" }, { "api_name": "random.ra...
4756037188
"""This module provides the CLI for the wrangle-ukds-trade-directories app.""" from . import __app_name__ import argparse from pathlib import Path def typecast_args(args): args.input = Path(args.input) args.output = Path(args.output) return args def test_args(args): if not Path(args.input).is_dir(...
Living-with-machines/wrangle-ukds-trade-directories
wrangle_ukds_trade_directories/argparse.py
argparse.py
py
1,285
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number...
15169976693
from typing import List from fastapi_utils.inferring_router import InferringRouter from sqlalchemy.ext.asyncio import AsyncSession from fastapi import Depends, Request from admins.models import Category from crud_handler import BaseHandler from database import get_async_session from fastapi_utils.cbv import cbv from ...
AlexeyShakov/helpdesk_fast_api
src/staff/endpoints.py
endpoints.py
py
3,364
python
en
code
0
github-code
6
[ { "api_name": "fastapi_utils.inferring_router.InferringRouter", "line_number": 17, "usage_type": "call" }, { "api_name": "fastapi_utils.inferring_router.InferringRouter", "line_number": 20, "usage_type": "call" }, { "api_name": "crud_handler.BaseHandler", "line_number": 25, ...
7318961586
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^modules/$', views.modules, name='modules'), url(r'^module/(?P<module>\w+)/list$', views.module_list, name='module_list'), url(r'^module/(?P<module>\w+)/detail/(?P<id>[\w-]+)/$', v...
sanchezfauste/bPortal
portal/urls.py
urls.py
py
2,424
python
en
code
1
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.co...
12237739567
import tensorflow as tf import numpy as np tf.enable_eager_execution() # Dataset import tensorflow_datasets as tfds # Constants to eventually parameterise LOGDIR = './logs/autoencoder_gg/' # Activation function to use for layers act_func = tf.nn.tanh # Enable or disable GPU SESS_CONFIG = tf.ConfigProto(device_coun...
bfakhri/TensorflowEager
autoencoder.py
autoencoder.py
py
7,158
python
en
code
3
github-code
6
[ { "api_name": "tensorflow.enable_eager_execution", "line_number": 4, "usage_type": "call" }, { "api_name": "tensorflow.nn", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tensorflow.ConfigProto", "line_number": 16, "usage_type": "call" }, { "api_na...
6484230311
import os import shutil import subprocess from pathlib import Path import numpy as np from PIL import Image, ImageOps from lib import BruteForce, database from .utils import timeit MAX_RATIO = 0.90 # 0.60 MIN_RATIO = 0 # PARAM FOR THE RADIOMETRIC APPROACH # Try to normalize respect mean and std to reject static fr...
franioli/COLMAP_SLAM
lib/static_rejection.py
static_rejection.py
py
11,514
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 22, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": ...
3081253994
# -*- coding: utf-8 -* """Input .. module:: input :synopsis: Module for processing input """ import resoncalc.output as output import resoncalc.detection as detection from argparse import ArgumentParser from os import path from json import load, JSONDecodeError def process_command(): """Process command ...
hydratk/resoncalc
src/resoncalc/input.py
input.py
py
3,159
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 37, "usage_type": "call" }, { "api_name": "resoncalc.output.log_level", "line_number": 49, "usage_type": "attribute" }, { "api_name": "resoncalc.output", "line_number": 49, "usage_type": "name" }, { "api_name...
27535933658
import torch from torch import nn import torch.nn.functional as F from timm.models.layers import to_2tuple, DropPath, trunc_normal_ import math class Mlp(nn.Module): def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.): super().__init__() out_feature...
fym1057726877/Defense
TransGAN/TransGanModel.py
TransGanModel.py
py
26,999
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.GELU", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_nu...
17168418038
import json import re from urllib import request import requests from panopto_oauth2 import PanoptoOAuth2 server = "sph.hosted.panopto.com" client_id = "29bd20b2-fd78-4bdd-9c40-af7a0133c139" client_secret = "oZVXzyYlRQun/+xrxaItsdSDm1n7Np6rNqlmjHjgcyQ=" def read_coursera_to_time_sentence(input_path, video_id): w...
Zhou-Xun/panopto_video_extraction
convert_caption_url.py
convert_caption_url.py
py
4,773
python
en
code
1
github-code
6
[ { "api_name": "re.sub", "line_number": 63, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 110, "usage_type": "call" }, { "api_name": "json.load", "line_number": 115, "usage_type": "call" } ]
4592746162
__all__ = [ 'Canceled', 'DuplicateDestinationError', 'Record', 'get_download_manager', ] import os import dbus import logging from collections import namedtuple from io import StringIO from pprint import pformat try: import pycurl except ImportError: # pragma:...
ubports/system-image
systemimage/download.py
download.py
py
9,745
python
en
code
2
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "pprint.pformat", "line_number": 38, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 46, "usage_type": "call" }, { "api_name": "io.StringIO",...
43987707276
# test CurlypivSetup """ Notes about program """ # 1.0 import modules import numpy as np # plotting import matplotlib.pyplot as plt import matplotlib from matplotlib import colors import matplotlib.image as mgimg from matplotlib import animation from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar mat...
sean-mackenzie/curlypiv
curlypiv/CurlypivPIVSetup.py
CurlypivPIVSetup.py
py
7,120
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.rcParams", "line_number": 16, "usage_type": "attribute" }, { "api_name": "matplotlib.font_manager.FontProperties", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.font_manager", "line_number": 18, "usage_type": "name" }, ...
29047649100
import atexit import os import re import shutil import subprocess import sys import tempfile def usage(): sys.stderr.write('Usage: {} [-h] -d <directory> [-b <bitrate>]\n'.format(sys.argv[0])) sys.stderr.write(' -h display help\n') sys.stderr.write(' -b bitrate [32-320, default 192]\n') sys.stderr...
eskaton/py-ripcd
ripcd.py
ripcd.py
py
3,527
python
en
code
0
github-code
6
[ { "api_name": "sys.stderr.write", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.stderr.write", ...
43633170723
from __future__ import absolute_import import logging import math #typing import torch import torch.nn.functional as F #overrides from allennlp.data import Vocabulary from allennlp.models.model import Model from allennlp.modules.token_embedders import Embedding from allennlp.modules import FeedForward from allennlp....
plasticityai/magnitude
pymagnitude/third_party/allennlp/models/coreference_resolution/coref.py
coref.py
py
32,507
python
en
code
1,607
github-code
6
[ { "api_name": "itertools.izip", "line_number": 22, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "allennlp.models.model.Model", "line_number": 28, "usage_type": "name" }, { "api_name": "allennlp...
73928144189
import django_rq import logging from datetime import datetime, timedelta import time from django.core.management.base import BaseCommand from django_rq import job from reviews.models import Review #@job def get_count_reviews(): logger = logging.getLogger('counter') count = Review.objects.count() time.sle...
idesu/review_moderation_lite
reviews/management/commands/log.py
log.py
py
881
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "reviews.models.Review.objects.count", "line_number": 14, "usage_type": "call" }, { "api_name": "reviews.models.Review.objects", "line_number": 14, "usage_type": "attribute" }, ...
20001859716
from nltk.stem import WordNetLemmatizer import re from nltk.tokenize import word_tokenize, sent_tokenize def myTokenizer(readFileDir, saveFileDir, stopwords, lim): readFile = open(readFileDir, "r", encoding="UTF8") saveFile = open(saveFileDir, "w", encoding="UTF8") preprocessed = [] lemmatizer = WordNe...
jkjan/NLP
Word2VecSkip-Gram/myTokenizer.py
myTokenizer.py
py
1,370
python
en
code
0
github-code
6
[ { "api_name": "nltk.stem.WordNetLemmatizer", "line_number": 9, "usage_type": "call" }, { "api_name": "nltk.tokenize.sent_tokenize", "line_number": 16, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 19, "usage_type": "call" }, { "api_name": "nltk.to...
27082652563
import time from datetime import timedelta import requests from celery import Celery from celery.utils.log import get_task_logger app = Celery('parsing') app.conf.update(broker_url='amqp://guest:guest@rabbitmq:5672', broker_connection_retry_on_startup=True) app.conf.beat_schedule = { 'add-every-monday-morning': {...
puplishe/testproject
fastapi1/celery/celery.py
celery.py
py
654
python
en
code
0
github-code
6
[ { "api_name": "celery.Celery", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 13, "usage_type": "call" }, { "api_name": "celery.utils.log.get_task_logger", "line_number": 17, "usage_type": "call" }, { "api_name": "time...
26495796671
from django.contrib import admin,messages from .models import * from inline_actions.admin import InlineActionsModelAdminMixin from commun.util import Util from django.utils.translation import ugettext_lazy as _ from django.conf import settings media_root = settings.MEDIA_ROOT admin.site.site_header = "Administration E...
bofilio/erp-backend
couriers/admin.py
admin.py
py
2,740
python
en
code
0
github-code
6
[ { "api_name": "django.conf.settings.MEDIA_ROOT", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 8, "usage_type": "name" }, { "api_name": "django.contrib.admin.site", "line_number": 9, "usage_type": "attribute" }, { ...
20571972816
from ply.lex import LexToken from windyquery.validator import ValidationError from ._base import Base TOKEN = 'SCHEMA' class SchemaToken(LexToken): def __init__(self, value): self.type = TOKEN self.value = value self.lineno = 0 self.lexpos = 0 class Schema(Base): def schema...
bluerelay/windyquery
windyquery/collector/schema.py
schema.py
py
540
python
en
code
68
github-code
6
[ { "api_name": "ply.lex.LexToken", "line_number": 9, "usage_type": "name" }, { "api_name": "_base.Base", "line_number": 17, "usage_type": "name" }, { "api_name": "windyquery.validator.ValidationError", "line_number": 21, "usage_type": "name" } ]
15018836415
import tkinter as tk import customtkinter as ctk from customtkinter import ThemeManager from View.GUI.CustomWidgets.NotebookCloseableTabs import NotebookCloseableTabs from View.GUI.Windows.ResultWindow.ComputationStatusBoard import ComputationStatusBoard from View.Observer import Observer class ComputationNotebook(...
Moni5656/npba
View/GUI/Windows/ResultWindow/ComputationNotebook.py
ComputationNotebook.py
py
2,306
python
en
code
0
github-code
6
[ { "api_name": "View.GUI.CustomWidgets.NotebookCloseableTabs.NotebookCloseableTabs", "line_number": 11, "usage_type": "name" }, { "api_name": "View.Observer.Observer", "line_number": 11, "usage_type": "name" }, { "api_name": "customtkinter.ThemeManager.theme", "line_number": 1...
18187153319
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D t = np.linspace(0, 2*np.pi, 20) p = np.linspace(0, np.pi, 10) theta,phi = np.meshgrid(t,p) x = np.cos(theta)*np.sin(phi) y = np.sin(theta)*np.sin(phi) z = np.cos(phi) fig = plt.figure(figsize=(10,4)) ax1 = fig.add_subplot(1...
notmatthancock/notmatthancock.github.io
code/py/sphere-sampling/sphere-uniform-theta-phi.py
sphere-uniform-theta-phi.py
py
524
python
en
code
0
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number"...
28130211082
## import that shit babyyy from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel, QPushButton,QStackedWidget,QScrollArea, QProgressBar, QHBoxLayout, QLineEdit from PyQt5.QtCore import QObject, QThread, pyqtSignal,Qt # from pyqtgraph import PlotWidget, plot import pyqtgraph as pg from os.path impor...
BadCodeswJamie/Sponitor
sponitor.py
sponitor.py
py
68,332
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 17, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QVBoxLayout", "line_number": 20, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 21, "usage_type": "call" }, { "api_na...
38858291652
""" Place to register all blueprints """ def customize_social_auth(): """ Customize certain routes of social auth """ from datetime import datetime from flask import Blueprint, current_app, g from flask_user import login_required, signals from social_core.actions import do_auth, do_comple...
Vixx-X/ati-project
src/backend/blueprints.py
blueprints.py
py
2,801
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 18, "usage_type": "call" }, { "api_name": "social_flask.routes.do_login", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime.utcnow", "line_number": 25, "usage_type": "call" }, { "api_name": ...
42295145901
import geopy bairros_list = [ "Boa Vista", "Bom Pastor", "Centro", "Granbery", "Jardim Glória", "Santa Helena", "São Mateus", "Teixeiras", "Bairu", "Bonfim", "Botanágua", "Centenário", "Cesário Alvim", "Graj...
igortitoneli/Api_Vitrine
bairro_location.py
bairro_location.py
py
2,455
python
is
code
0
github-code
6
[ { "api_name": "geopy.geocoders.Nominatim", "line_number": 88, "usage_type": "call" }, { "api_name": "geopy.geocoders", "line_number": 88, "usage_type": "attribute" } ]
14974723036
import torch import torch.nn as nn from torch_geometric.loader import DataLoader from torch_geometric.data import Data, Batch from torch.utils.data import Dataset import torch_geometric.transforms as T from torch_geometric.nn import GATConv import torch.nn.functional as F class GATNet(torch.nn.Module): def __init_...
mo7amed7assan1911/Floor_Plan_Generation_using_GNNs
model.py
model.py
py
5,015
python
en
code
3
github-code
6
[ { "api_name": "torch.nn", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch_geometric.nn.GATConv", "line_number": 14, "usage_type": "call" }, { "api_name": "torch_geometric.nn.GATConv", "line_number": 17, "usage_type": "call" }, { "api_name": "t...
25457066690
import telegram from twilio.rest import Client from twilio.base.exceptions import TwilioRestException import threading class MessageSender: def __init__(self, config): self.lock = threading.Lock() self.telegram_bot = None if config["telegram"] is not None: self.telegram_chat_id ...
wanmeihuali/Agressive-Store-Bots
MessageSender.py
MessageSender.py
py
1,434
python
en
code
null
github-code
6
[ { "api_name": "threading.Lock", "line_number": 8, "usage_type": "call" }, { "api_name": "telegram.Bot", "line_number": 12, "usage_type": "call" }, { "api_name": "twilio.rest.Client", "line_number": 20, "usage_type": "call" }, { "api_name": "twilio.base.exceptions....
16539466565
# -*- coding: utf-8 -*- """Главный и единственный модуль в игре. Игра специально написана в минималистичном стиле, мне хотелось воплотить текстовый движок настолько лаконично, насколько это вообще возможно. Подкладывая этому скрипту различные json с метаданными, можно запускать произвольные текстовые истории. """ im...
IgorZyktin/BGCGame
game/__main__.py
__main__.py
py
6,720
python
ru
code
0
github-code
6
[ { "api_name": "typing.NewType", "line_number": 18, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.NewType", "line_numb...
9499182379
import torch from torch import nn from torch.utils.data import DataLoader from torchvision import datasets from torchvision.transforms import ToTensor # 공개 데이터셋에서 학습 데이터를 내려받습니다. training_data = datasets.FashionMNIST( root="Fashion_MNIST_Data", train=True, download=True, transform=ToTensor(), ) # 공개 데이터셋에서 테스...
hotsoycandy/learn-pytorch
train.py
train.py
py
2,907
python
en
code
1
github-code
6
[ { "api_name": "torchvision.datasets.FashionMNIST", "line_number": 8, "usage_type": "call" }, { "api_name": "torchvision.datasets", "line_number": 8, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 12, "usage_type": "call" }, { ...
5544798991
from common import execute_sh from retry import retry import os import logging import json """ Issue kubectl commands on the running linode cluster """ WEATHER_API_TOKEN = os.environ.get("WEATHER_API_TOKEN") KUBERNETES_NODE_COUNT = "2" @retry(tries=60, delay=30) def get_nodes(): # Verify kubectl is communicatin...
HarrisKirk/blue-green-dreams
gwa-deploy/kubectl.py
kubectl.py
py
2,558
python
en
code
2
github-code
6
[ { "api_name": "os.environ.get", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "common.execute_sh", "line_number": 19, "usage_type": "call" }, { "api_name": "json.loads", "li...
10899943389
import cv2 import numpy as np from keras.models import load_model image = cv2 .imread("Bore2.jpg",0) image = cv2.resize(image, (48, 48)) image = image[..., np.newaxis] # dst = np.expand_dims(image, axis=1) print(image.shape) # exit() model = load_model("model_v6_23.hdf5") predicted_class = np.argmax(model.predict(i...
hassanahmed95/My_True_Face
ML_training/test_file.py
test_file.py
py
1,134
python
en
code
1
github-code
6
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.newaxis", "line_number": 6, "usage_type": "attribute" }, { "api_name": "keras.models.load_model", "...
655272067
import os import napari import z5py def view_result(sample, checkpoint_name): halo = [25, 512, 512] path = f'./data/{sample}.n5' with z5py.File(path, 'r') as f: ds = f['raw'] bb = tuple(slice(max(sh // 2 - ha, 0), min(sh // 2 + ha, sh)) for sh, ...
constantinpape/torch-em
experiments/unet-segmentation/mitochondria-segmentation/mito-em/challenge/check_result.py
check_result.py
py
2,239
python
en
code
42
github-code
6
[ { "api_name": "z5py.File", "line_number": 10, "usage_type": "call" }, { "api_name": "napari.gui_qt", "line_number": 64, "usage_type": "call" }, { "api_name": "napari.Viewer", "line_number": 65, "usage_type": "call" }, { "api_name": "os.path.split", "line_numbe...
25968013406
import argparse import time from threading import Thread import requests class RequestThread(Thread): def __init__(self, url): self.url = url super(RequestThread, self).__init__(target=self.make_request) def make_request(self): requests.get(self.url) class Worker(object): def _...
wgaggioli/elk-example
threaded_requests.py
threaded_requests.py
py
1,602
python
en
code
6
github-code
6
[ { "api_name": "threading.Thread", "line_number": 8, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 43, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", ...
6771398570
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import pymysql class ProxyPoolCrawlerPipeline(object): def process_item(self, item, spider): return item # 存储到mys...
ShawnRong/proxy-pool-crawler
proxy_pool_crawler/pipelines.py
pipelines.py
py
2,136
python
en
code
0
github-code
6
[ { "api_name": "pymysql.connect", "line_number": 42, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 48, "usage_type": "attribute" } ]
22257701787
"""Filters module with a class to manage filters/algorithms for polydata datasets.""" import collections.abc import logging import numpy as np import pyvista from pyvista import ( abstract_class, _vtk, NORMALS, generate_plane, assert_empty_kwargs, vtk_id_list_to_array, get_array ) from pyvista.core.errors import ...
rohankumardubey/pyvista
pyvista/core/filters/poly_data.py
poly_data.py
py
77,050
python
en
code
0
github-code
6
[ { "api_name": "pyvista.core.filters.data_set.DataSetFilters", "line_number": 17, "usage_type": "name" }, { "api_name": "pyvista.PolyData", "line_number": 29, "usage_type": "attribute" }, { "api_name": "pyvista.PolyData", "line_number": 30, "usage_type": "call" }, { ...
26829757478
#!/usr/bin/python import json import utils import logging import os import subprocess import smt_encoding import pysmt.shortcuts import re import requests import core_data import hyportage_pattern import hyportage_db from pysmt.smtlib.parser import SmtLib20Parser import cStringIO """ This file contains all the f...
HyVar/gentoo_to_mspl
host/scripts/reconfigure.py
reconfigure.py
py
16,982
python
en
code
10
github-code
6
[ { "api_name": "utils.get_new_temp_file", "line_number": 47, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 49, "usage_type": "call" }, { "api_name": "utils.phase_start", "line_number": 56, "usage_type": "call" }, { "api_name": "subprocess.Popen"...
31228319050
#coding=utf-8 from thuproxy.alipay_api import * from thuproxy.proxy_account_views import * import datetime import uuid import urllib.request from django.views.decorators.csrf import csrf_exempt from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseRedirect from djan...
flyz1360/scholarcloud
thuproxy/pay_views.py
pay_views.py
py
14,990
python
en
code
1
github-code
6
[ { "api_name": "django.http.HttpResponseRedirect", "line_number": 25, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 30, "usage_type": "call" }, { "api_name": "django.shortcuts.render_to_response", "line_number": 31, "usage_type": ...
11047387601
from astropy.wcs.utils import wcs_to_celestial_frame as wcs from astropy.coordinates import SkyCoord import astropy.units as u from scipy import ndimage import numpy as np import math as m __author__ = "Norbert Gyenge" __email__ = "n.g.gyenge@sheffield.ac.uk" def Sunspot_coord(photosphere_full, dx, dy, spot): ''...
gyengen/SheffieldSolarCatalog
engine/ssc/sunspot/coordinates.py
coordinates.py
py
2,040
python
en
code
1
github-code
6
[ { "api_name": "scipy.ndimage.measurements.center_of_mass", "line_number": 36, "usage_type": "call" }, { "api_name": "scipy.ndimage.measurements", "line_number": 36, "usage_type": "attribute" }, { "api_name": "scipy.ndimage", "line_number": 36, "usage_type": "name" }, ...
12168811050
# import requests module import requests import logging import time # Setting up Logging logging.basicConfig(level = logging.INFO) logger = logging.getLogger() # URL url = "https://google.com" # Make request method def make_request(url): logging.info("Fetching URL") try: response = requests.get(url...
tolkiger/terraform-ecs-fargate-cicd-pipeline
monitoring.py
monitoring.py
py
891
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.info", ...
32644440027
"""Shifters Rig Main class.""" import datetime import getpass import os.path import sys import json # Maya import pymel.core as pm from pymel.core import datatypes from pymel import versions # mgear import mgear import mgear.core.utils from . import guide, component from mgear.core import primitive, attribute, skin,...
mgear-dev/mgear4
release/scripts/mgear/shifter/__init__.py
__init__.py
py
31,325
python
en
code
209
github-code
6
[ { "api_name": "sys.version_info", "line_number": 25, "usage_type": "attribute" }, { "api_name": "pymel.core.pluginInfo", "line_number": 28, "usage_type": "call" }, { "api_name": "pymel.core", "line_number": 28, "usage_type": "name" }, { "api_name": "pymel.core.loa...
43627424884
from typing import List class Solution: def numOfMinutes(self, n: int, headID: int, manager: List[int], informTime: List[int]) -> int: employees = {} for i, m in enumerate(manager): if i != headID: employees[m] = employees.get(m, []) + [i] queue = [[headID, info...
MichaelTQ/LeetcodePythonProject
solutions/leetcode_1351_1400/LeetCode1376_TimeNeededToInformAllEmployees.py
LeetCode1376_TimeNeededToInformAllEmployees.py
py
1,290
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
31994054521
#coding: utf-8 import json, random, os import hashlib import requests from flask_babel import _ from webapp import app #利用百度翻译API提供文本翻译 def translate(text, source_language, dest_language): if 'BD_TRANSLATOR_KEY' not in app.config or not app.config['BD_TRANSLATOR_KEY']: return _('Error: the translation ser...
huawenjin1995/Microblog
webapp/translate.py
translate.py
py
1,421
python
en
code
0
github-code
6
[ { "api_name": "webapp.app.config", "line_number": 11, "usage_type": "attribute" }, { "api_name": "webapp.app", "line_number": 11, "usage_type": "name" }, { "api_name": "flask_babel._", "line_number": 12, "usage_type": "call" }, { "api_name": "random.randint", ...
36093046858
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import unittest import mock from napixd.exceptions import InternalRequestFailed from napixd.application import Napixd from napixd.services.contexts import NapixdContext from napixd.loader.loader import Loader, Load from napixd.http...
napix/NapixServer
tests/test_application.py
test_application.py
py
4,444
python
en
code
1
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 34, "usage_type": "attribute" }, { "api_name": "mock.patch", "line_number": 38, "usage_type": "call" }, { "api_name": "mock.Mock", "line_number": 42, "usage_type": "call" }, { "api_name": "napixd.loader.loader.Load...
3708389787
import re import redis import pickle import requests from bs4 import BeautifulSoup from dateutil.parser import parse import errors red = redis.StrictRedis(host='redis', port=6379, db=0) try: red.get('test') except ConnectionError: red = None _POST_COMMENT_URL = \ 'https://telopeapark.managebac.com/group...
samdroid-apps/ManageBacToTheFuture
lib/message.py
message.py
py
6,140
python
en
code
1
github-code
6
[ { "api_name": "redis.StrictRedis", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 33, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 36, "usage_type": "call" }, { "api_name": "re.search", "lin...
26423979164
import numpy as np import torch import time from torch.autograd import Variable import torchvision.transforms as transforms import torchvision.datasets as dsets import collections import torch.utils.data as data class Model(torch.nn.Module): def __init__(self, input_dim=784, output_dim=10): ...
WENLIXIAO-CS/FL-IoT-Demo
Fed-IoT-demo-lightly/Pytorch_Model.py
Pytorch_Model.py
py
5,470
python
en
code
1
github-code
6
[ { "api_name": "torch.nn", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn.Linear", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.utils.data.Dataset"...
39312594943
import os import requests from bs4 import BeautifulSoup, Tag from collections import Counter import re import string import nltk from nltk.corpus import stopwords from nltk.corpus import words from nltk.tokenize import word_tokenize from gensim.models import Word2Vec import pandas as pd import matplotlib.pyplot as plt ...
PhiloSolares/seo_analysis
seo_analysis_tool.py
seo_analysis_tool.py
py
18,812
python
en
code
0
github-code
6
[ { "api_name": "nltk.download", "line_number": 33, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 34, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 35, "usage_type": "call" }, { "api_name": "openai.api_key", "line_...
70945127228
# remote DB 연동 import MySQLdb import pandas as pd import numpy as np import ast import csv """ config = { 'host':'127.0.0.1', 'user':'root', 'password':'123', 'database':'test', 'port':3306, 'charset':'utf8', 'use_unicode':True } """ try: # db 읽는 방법 with open("mar...
kangmihee/EX_python
py_pandas_db/pack/pandas_db2.py
pandas_db2.py
py
3,238
python
en
code
0
github-code
6
[ { "api_name": "ast.literal_eval", "line_number": 28, "usage_type": "call" }, { "api_name": "MySQLdb.connect", "line_number": 35, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 48, "usage_type": "call" }, { "api_name": "pandas.read_csv", "li...
36802074369
#! /usr/bin/python3 import sqlite3 import pandas as pd pd.set_option('display.max_columns', 500) path = '/home/mayijun/CITI2017/' # Calculate station days conn = sqlite3.connect(path + 'CITI2017.sqlite3') sql = """SELECT DISTINCT startstationid AS stationid,startdate AS date FROM trip WHERE startweekday NOT IN ('S...
NYCPlanning/td-citibike
2017/stationdays.py
stationdays.py
py
1,726
python
en
code
1
github-code
6
[ { "api_name": "pandas.set_option", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_sql", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_sql", ...
31215041211
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('siteScrape', '0001_initial'), ] operations = [ migrations.AddField( model_name='teacher', name='aver...
anikan/Classify
migrations/0002_auto_20150910_1439.py
0002_auto_20150910_1439.py
py
755
python
en
code
0
github-code
6
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
13956703300
from django.db.models import Field from . import forms from . import validators from .ipv6cidr import clean_ipv6_cidr from django.utils.translation import gettext_lazy as _, ngettext_lazy class GenericIPNetworkField(Field): """ Support CIDR input ipv4 0.0.0.0/0 ipv6 ::::/0 """ empty_strings_...
MilkBotttle/BFP
fields/cidr.py
cidr.py
py
2,978
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Field", "line_number": 7, "usage_type": "name" }, { "api_name": "django.utils.translation.gettext_lazy", "line_number": 14, "usage_type": "call" }, { "api_name": "ipdb.set_trace", "line_number": 55, "usage_type": "call" }, { "api_na...
26191759535
import requests import json import re import time import csv import MySQLdb as mdb from bs4 import BeautifulSoup import numpy as np import pandas as pd from helpers import * """ This script scrapes and stores the fantasy points achieved by each player for the 2013 season. The data is stored in a .csv file. """ def mai...
kwheeler27/insight_datasci
data/actual_fantasy_pts.py
actual_fantasy_pts.py
py
1,604
python
en
code
1
github-code
6
[ { "api_name": "csv.writer", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 28, "usage_type": "call" }, { "api_name": "re.search", "line_numbe...
14839168624
from django.contrib.auth import get_user_model from django.shortcuts import get_object_or_404, render, redirect from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator from django.conf import settings from .forms import PostForm, CommentForm from .models import Post, Group...
Medbrat4669/yatube_project
yatube/posts/views.py
views.py
py
4,552
python
en
code
0
github-code
6
[ { "api_name": "models.User", "line_number": 10, "usage_type": "name" }, { "api_name": "django.contrib.auth.get_user_model", "line_number": 10, "usage_type": "call" }, { "api_name": "django.core.paginator.Paginator", "line_number": 14, "usage_type": "call" }, { "ap...
26682571553
import sys import os import re import logging from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QComboBox, QPushButton, QLabel, QFileDialog, QMainWindow, QMessageBox, QCheckBox from gui import Ui_MainWindow from function import * project_file = ".project" cproject_file = ".cproject" recove...
maivananh111/stm-edf
tools/setup/setup.py
setup.py
py
38,714
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 34, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 34, "usage_type": "attribute" }, { "api_name": "gui.Ui_MainWindow", "line_number": 39, "usage_type": "name" }, { "api_name": "PyQt5.QtWidge...
27213329955
import sys from collections import deque dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] INF = 1e9 N, M = map(int, sys.stdin.readline().rstrip().split()) maps = [list(map(int, sys.stdin.readline().rstrip().split())) for _ in range(N)] hospital_comb = [] answer = INF def dfs(hospital_list, pick_list, idx): if idx == len(h...
hammii/Algorithm
CodeTree_python/바이러스_백신.py
바이러스_백신.py
py
1,804
python
en
code
2
github-code
6
[ { "api_name": "sys.stdin.readline", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.stdin.readline", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.stdin", "li...
12960752319
import warnings warnings.filterwarnings('ignore') from popsycle import synthetic import numpy as np import matplotlib.pyplot as plt from astropy.table import Table import h5py def test_h5_output(ebf_file, reference_h5_file, extra_col= False): """" Parameters ---------- ebf_file : str Name of t...
jluastro/PopSyCLE
popsycle/tests/output_test_synthetic.py
output_test_synthetic.py
py
4,102
python
en
code
13
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 2, "usage_type": "call" }, { "api_name": "popsycle.synthetic.perform_pop_syn", "line_number": 26, "usage_type": "call" }, { "api_name": "popsycle.synthetic", "line_number": 26, "usage_type": "name" }, { "api_...
35721608965
import os import json import numpy as np import preprocessing as preprocessing from tensorflow import keras def init(): global model global vocab global max_len model = keras.models.load_model(os.path.join(os.getenv('AZUREML_MODEL_DIR'), 'model'), compile=False) with open(os.path.join(os.getenv('AZ...
luisespriella9/disastersLocator
src/scoring.py
scoring.py
py
809
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.keras.models.load_model", "line_number": 11, "usage_type": "call" }, { "api_name": "tensorflow.keras.models", "line_number": 11, "usage_type": "attribute" }, { "api_name": "tensorflow.keras", "line_number": 11, "usage_type": "name" }, { "...
44632376656
# coding:utf-8 from bs4 import BeautifulSoup import urllib.request as req import sqlite3 from contextlib import closing url="http://su-gi-rx.com/2017/07/16/python_4/" dbname='database.db' conn=sqlite3.connect(dbname) c=conn.cursor() table_name = 'test' def get_html(): #urlopen()でデータ取得 res=req.ur...
riku-nagisa/python1
html_ren.py
html_ren.py
py
1,261
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 15, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 15, "usage_type": "name" }, { "api_name": "bs4.BeautifulSou...
2721248561
import copy, random, datetime suppliesDataSets = [ [ { "labels": [], #food "data": [] }, { "labels": [], #drink "data": [] }, { "labels": [], #medicine "data": [] } ] ] now = datetime.datetime...
e1833-tomohiro/Kadai
backend/store.py
store.py
py
680
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 21, "usage_type": "call" }, { "api_name": "rando...
29520352035
import requests from bs4 import BeautifulSoup as bs import csv from itertools import chain def get_urls(): """ Skilar lista sem inniheldur slóðir á allar undirsíður með kosningaúrslitum """ main_page = requests.get("http://www.kosningastofnun.in/") page_soup = bs(main_page.content, "html.parse...
flother/data-acq-viz
2018/kosningaskrapari-lausn.py
kosningaskrapari-lausn.py
py
2,713
python
is
code
1
github-code
6
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 29, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
73264632828
from game_objects.projectile import Projectile from game_objects.player import Player from pyglet import clock from widgets.event_window import EventWindow import pyglet import cv2 as cv import time window = EventWindow(fullscreen=True) # soul_image = pyglet.image.load('soul.png') # soul = pyglet.sprite.Sprite(soul_im...
KimPalao/Headshot
collision_test.py
collision_test.py
py
1,686
python
en
code
0
github-code
6
[ { "api_name": "widgets.event_window.EventWindow", "line_number": 9, "usage_type": "call" }, { "api_name": "game_objects.player.Player", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 18, "usage_type": "call" }, { "api_name": ...
72588123388
from numpy.testing import * import numpy import numpy.random from adolc import * from adolc.cgraph import * from adolc.tangent import * class TangentOperationsTests(TestCase): def test_constructor(self): t1 = Tangent(1,2) t2 = Tangent(adouble(1),2) def test_float_tangent_float_tangent(self): ...
b45ch1/pyadolc
adolc/tests/test_tangent.py
test_tangent.py
py
3,503
python
en
code
43
github-code
6
[ { "api_name": "numpy.random.rand", "line_number": 81, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 81, "usage_type": "attribute" }, { "api_name": "numpy.random.rand", "line_number": 82, "usage_type": "call" }, { "api_name": "numpy.random", ...
27009702338
import numpy as np import run as r ''' [id] 115 [name] BayesianRidge [input] x_train 训练集 训练集标签数据集 二维数组 必须 定数 y_train 测试集 测试集数据集 二维数组 必须 定数 x_test 训练集标签 训练集标签标签 一维数组 必须 定数 y_test 测试集标签 测试集标签 一维数组 必须 定数 n_iter n_iter 默认为300,最大迭代次数。应该大于或等于1,可选整数 整数 不必须 定数 tol tol 默认为1e-3,如果w收敛,则停止算法,可选浮点数 浮点数 不必须 定数 alpha_1 alpha_1 默认...
lisunshine1234/mlp-algorithm-python
machine_learning/regression/linear_models/BayesianRidge/main.py
main.py
py
5,830
python
zh
code
0
github-code
6
[ { "api_name": "run.run", "line_number": 93, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 112, "usage_type": "call" }, { "api_name": "numpy.delete", "line_number": 116, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": ...
38852384412
from django.core import validators from rest_framework import serializers from django.utils.translation import gettext_lazy as _ from degvabank.apps.account.models import Account from degvabank.apps.card.models import CreditCard from degvabank.apps.transaction.utils import is_our_number from .models import Transactio...
Vixx-X/DEGVABank-backend
degvabank/degvabank/apps/transaction/serializers.py
serializers.py
py
5,507
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 12, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 12, "usage_type": "name" }, { "api_name": "models.Transaction", "line_number": 14, "usage_type": "name" ...
38696958854
# coding=utf-8 import requests class Airbnb(object): """Interface to get data from airbnb api. You can use : api_instance = Airbnb() api_instance.get_logement("Paris") api_instance.get_review(logement_id) api_instance.get_logement_details(logement_id)""" def get_user_infos(self, us...
pablo-a/airbnb
airbnb_api.py
airbnb_api.py
py
6,552
python
en
code
1
github-code
6
[ { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 45, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 65, "usage_type": "call" }, { "api_name": "requests.get", "line_numbe...
70321394427
import multiprocessing as mp from skopt import Optimizer from skopt.space import Real, Integer import subprocess import time import pickle from ID_CNN_V01 import setup_thread_environment from _utils.ID_utils import get_convolutions, Colors, check_available_gpus n_calls = 7 dim_learning_rate = Real(low=1e-7, high=3e-...
lorenz-h/DataRepresentationLearning
Old Experiments/ImitationDuckie_V1/_old_versions/ID_Optimizer.py
ID_Optimizer.py
py
4,792
python
en
code
0
github-code
6
[ { "api_name": "skopt.space.Real", "line_number": 13, "usage_type": "call" }, { "api_name": "skopt.space.Integer", "line_number": 14, "usage_type": "call" }, { "api_name": "skopt.space.Integer", "line_number": 15, "usage_type": "call" }, { "api_name": "_utils.ID_ut...
28173684280
# importing all libraries import cadquery as cq from cadquery import exporters import pyaudio import json from vosk import Model, KaldiRecognizer import pyttsx3 from tkinter import * from PIL import ImageTk, Image import tkinter.font as TkFont import os from word2number import w2n #loading vosk ml audio recognition m...
N3dal/YourFirstContribution
Python/interactivedesign.py
interactivedesign.py
py
9,411
python
en
code
null
github-code
6
[ { "api_name": "vosk.Model", "line_number": 15, "usage_type": "call" }, { "api_name": "vosk.KaldiRecognizer", "line_number": 19, "usage_type": "call" }, { "api_name": "pyaudio.PyAudio", "line_number": 21, "usage_type": "call" }, { "api_name": "pyaudio.paInt16", ...
72764469628
from sklearn.feature_extraction.text import TfidfVectorizer from wordcloud import WordCloud import numpy as np def get_wordcloud(data, stop_words): vectorizer = TfidfVectorizer( use_idf=False, stop_words=stop_words, ngram_range=(2, 2)) vectors = vectorizer.fit_transform(data) counts = np.array(ve...
Amayas29/review-analysis
src/iads/nlp/visualisation.py
visualisation.py
py
607
python
en
code
0
github-code
6
[ { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "wordcloud.WordCloud", "line_number": 20, "usage_type": "call" } ]
26531291291
from pyhpecfm import system from lib.actions import HpecfmBaseAction class eventLookup(HpecfmBaseAction): def run(self): cfm_audits = system.get_audit_logs(self.client) if isinstance(cfm_audits, list): # Create a empty list for alarms event_data = [] # Loop throu...
HewlettPackard/stackstorm-hpe-cfm
actions/get_events.py
get_events.py
py
1,125
python
en
code
1
github-code
6
[ { "api_name": "lib.actions.HpecfmBaseAction", "line_number": 4, "usage_type": "name" }, { "api_name": "pyhpecfm.system.get_audit_logs", "line_number": 6, "usage_type": "call" }, { "api_name": "pyhpecfm.system", "line_number": 6, "usage_type": "name" } ]
34540300851
import configparser import argparse import json import boto3 import utility from collections import OrderedDict global emr_configuration, emr_applications, cluster_config, optional_instance_config emr_configuration = "emr_cluster.config" emr_applications = ["Hadoop", "Spark", "Ganglia"] cluster_config = "source/cluste...
VCCRI/Falco
launch_cluster.py
launch_cluster.py
py
7,234
python
en
code
37
github-code
6
[ { "api_name": "utility.check_config", "line_number": 19, "usage_type": "call" }, { "api_name": "utility.check_upload_config", "line_number": 23, "usage_type": "call" }, { "api_name": "utility.check_config", "line_number": 27, "usage_type": "call" }, { "api_name": ...
42535314476
# OKANCAN COSAR # 12253018 import Helper import Constant import Step import sys populasyon = [] def Calculate(populasyonlar): # for i in Helper.populasyonDict(populasyonlar): # # guzel yazdirma # ff = "" # for ix in i[0]: # ff = ff + str(ix) # print("(", ff, "),", i[1...
OkancanCosar/01-Knapsack-with-GA
python/index.py
index.py
py
1,827
python
tr
code
2
github-code
6
[ { "api_name": "Step.parentSelect", "line_number": 23, "usage_type": "call" }, { "api_name": "Step.recombineAndMutate", "line_number": 27, "usage_type": "call" }, { "api_name": "Step.survivalSelect", "line_number": 31, "usage_type": "call" }, { "api_name": "Constan...
41095556533
import sqlite3 conn = sqlite3.connect("tickets5.db") cur = conn.cursor() def displayAllTickets(): sql = "SELECT * FROM tickets" cur.execute(sql) results = cur.fetchall() if results: printStuff(results) else: print("No data found") print() def addTicket(): actual_sp...
LilGotit/brain-drizzle
TicketsDatabase/ticketDatabase.py
ticketDatabase.py
py
2,130
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" } ]
29875084962
## ~~~~~~~~~~~~~~~~~~ # Deep Willy Network ## ~~~~~~~~~~~~~~~~~~ import numpy as np, json, sys, os sys.path.append(os.path.dirname(__file__)) from willies import * class DeepWilly(object): _willy_classes = {'connected': ConnectedWilly, 'dropout': DropoutWilly, '...
gavarela/willyai
willyai/deepWilly.py
deepWilly.py
py
6,171
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number...
30906490211
import requests, re def scrape_images(link): # define our user headers headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36" } gallery_append = 'media?id=media0&ref=photoCollage&channel=RES_BUY' link_...
GregorMonsonFD/holmly_sourcing_legacy
scripts/python/pdfGen/rightmove_image_extract.py
rightmove_image_extract.py
py
717
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 19, "usage_type": "call" } ]
70829089789
import logging.config DEFAULT_LEVEL = logging.WARNING DEFAULT_FMT = '%(asctime)s | %(levelname)-8s | %(message)s' def install(level=DEFAULT_LEVEL, fmt=DEFAULT_FMT): logging.basicConfig(level=level, format=fmt) try: import sys import colorlog formatter = colorlog.ColoredFormatter( ...
Arcensoth/pymcutil
pymcutil/logging/__init__.py
__init__.py
py
799
python
en
code
3
github-code
6
[ { "api_name": "logging.config.WARNING", "line_number": 3, "usage_type": "attribute" }, { "api_name": "logging.config", "line_number": 3, "usage_type": "name" }, { "api_name": "logging.config.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "lo...
43634658293
from __future__ import division from __future__ import absolute_import #typing #overrides from allennlp.common import squad_eval from allennlp.training.metrics.metric import Metric class SquadEmAndF1(Metric): u""" This :class:`Metric` takes the best span string computed by a model, along with the answer ...
plasticityai/magnitude
pymagnitude/third_party/allennlp/training/metrics/squad_em_and_f1.py
squad_em_and_f1.py
py
1,963
python
en
code
1,607
github-code
6
[ { "api_name": "allennlp.training.metrics.metric.Metric", "line_number": 13, "usage_type": "name" }, { "api_name": "allennlp.common.squad_eval.metric_max_over_ground_truths", "line_number": 32, "usage_type": "call" }, { "api_name": "allennlp.common.squad_eval", "line_number": ...
19181221365
"""Add agreed to TOS int field Revision ID: 51398a87b2ef Revises: 95c58503e9c0 Create Date: 2020-12-02 09:43:04.949189 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "51398a87b2ef" down_revision = "95c58503e9c0" branch_labels = None depends_on = None def upgr...
Almenon/couchers
app/backend/src/couchers/migrations/versions/51398a87b2ef_add_agreed_to_tos_int_field.py
51398a87b2ef_add_agreed_to_tos_int_field.py
py
696
python
en
code
null
github-code
6
[ { "api_name": "alembic.op.add_column", "line_number": 20, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 20, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 20, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer...
16760366561
from django.shortcuts import render,redirect,get_object_or_404 # CSRF from django.views.decorators.csrf import csrf_exempt from django.utils.http import urlsafe_base64_encode,urlsafe_base64_decode from django.utils.encoding import force_bytes from django.core.mail import EmailMessage from django.utils.encoding import ...
suna-ji/RockJiggu
RockJiggu/views.py
views.py
py
2,535
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 22, "usage_type": "call" }, { "api_name": "django.core.mail.send_mail", "line_number": 35, "usage_type": "call" }, { "api_name": "django.core.mail.BadHeaderError", "line_number": 36, "usage_type": "name" }, { ...
648818691
from argparse import ArgumentParser from inference import Infer parser = ArgumentParser() parser.add_argument("modelname", help="name of model to use") parser.add_argument("imagepath", help="relative path to image") parser.add_argument("--use_gpu", help="use gpu or not", nargs="?", default=False, const=True, type = ...
Deepesh22/Crowd-Counting
cli.py
cli.py
py
482
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "inference.Infer", "line_number": 12, "usage_type": "call" } ]
40176582534
#import gevent.monkey #gevent.monkey.patch_all() import os import sys import time import pprint import logging import requests import grequests import threading import urllib.parse from bs4 import BeautifulSoup import db import parse logger = logging.getLogger('scraper') logger.setLevel(logging.DEBUG) SRC_DIR = os....
JohnMcAninley/beer-goggles
scraper/src/scraper.py
scraper.py
py
7,113
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "l...
30544609936
# stemming # e.g. stemming will convert ["python","pythoner","pythoning","pythoned","pythonly"] to python # e.g. stemming will convert ["interesting","interested"] to interest # stemming may create some words that do not exits from nltk.stem import PorterStemmer from nltk.tokenize import word_tokenize ps = PorterStemm...
limingwu8/ML
NLP/demo03.py
demo03.py
py
669
python
en
code
1
github-code
6
[ { "api_name": "nltk.stem.PorterStemmer", "line_number": 8, "usage_type": "call" }, { "api_name": "nltk.tokenize.word_tokenize", "line_number": 16, "usage_type": "call" } ]
2026784639
import msvcrt import zipfile import threading from selenium import webdriver from selenium.webdriver.edge.options import Options from bs4 import BeautifulSoup from concurrent.futures import ThreadPoolExecutor,wait, FIRST_COMPLETED, ALL_COMPLETED resultList = [] unfoundList = [] alltask = [] def main(): file = 'C...
Nienter/mypy
personal/getNewestVersion.py
getNewestVersion.py
py
3,123
python
en
code
0
github-code
6
[ { "api_name": "zipfile.is_zipfile", "line_number": 21, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 23, "usage_type": "call" }, { "api_name": "concurrent.futures.ThreadPoolExecutor", "line_number": 25, "usage_type": "call" }, { "api_name...
71885865788
#! /usr/bin/env python import sys from collections import defaultdict from intcode import IntCode lines = [] for line in sys.stdin: lines.append(line.rstrip('\n')) class Robot(): program=None direction=(0,1) position=(0,0) panels=None def __init__(self, line) -> None: self.program = ...
albatros69/aoc-2019
day-11/paint.py
paint.py
py
1,580
python
en
code
0
github-code
6
[ { "api_name": "sys.stdin", "line_number": 8, "usage_type": "attribute" }, { "api_name": "intcode.IntCode", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 19, "usage_type": "call" } ]
16731268894
from abc import ABC, ABCMeta, abstractmethod from datetime import datetime from pprint import pprint from typing import Dict try: from dialogflow_v2 import SessionsClient from dialogflow_v2.proto.session_pb2 import ( DetectIntentResponse, QueryInput, QueryResult, TextInput, ...
autogram/Botkit
botkit/builtin_services/nlu/nluservice.py
nluservice.py
py
3,231
python
en
code
10
github-code
6
[ { "api_name": "dialogflow_v2.SessionsClient", "line_number": 15, "usage_type": "name" }, { "api_name": "dialogflow_v2.proto.session_pb2.DetectIntentResponse", "line_number": 16, "usage_type": "name" }, { "api_name": "dialogflow_v2.proto.session_pb2.QueryInput", "line_number":...
10120432429
""" Library and Wrapper for DHT11 and DHT22 sensors. Based on https://github.com/JurassicPork/DHT_PyCom/tree/pulses_get Extensions: Renamed module filename to dht (from dth.py) and added wrapper function For hardware connection: YELLOW/WHITE: PIN1 VCC through GPIO, PIN2: DATA through GPIO, PIN3: NC, PIN4: G...
insighio/insighioNode
insighioNode/lib/sensors/dht.py
dht.py
py
3,993
python
en
code
5
github-code
6
[ { "api_name": "machine.Pin", "line_number": 40, "usage_type": "call" }, { "api_name": "machine.Pin.OPEN_DRAIN", "line_number": 40, "usage_type": "attribute" }, { "api_name": "utime.sleep", "line_number": 43, "usage_type": "call" }, { "api_name": "pycom.pulses_get"...
10251411217
""" Configuration reader for the population_gravity model @author Chris R. Vernon @email: chris.vernon@pnnl.gov License: BSD 2-Clause, see LICENSE and DISCLAIMER files """ import datetime import os import simplejson import rasterio import yaml import pandas as pd import population_gravity.downscale_utilitie...
IMMM-SFA/population_gravity
population_gravity/read_config.py
read_config.py
py
26,485
python
en
code
4
github-code
6
[ { "api_name": "population_gravity.downscale_utilities.get_raster_with_metadata", "line_number": 260, "usage_type": "call" }, { "api_name": "population_gravity.downscale_utilities", "line_number": 260, "usage_type": "name" }, { "api_name": "population_gravity.downscale_utilities.c...
6131848495
import numpy as np from PIL import Image radar = np.load('./origin_data/radars_2020-11-01_2022-12-31.npy') color_image = Image.open('./cool_data/mask.png') mask = np.array(color_image.convert('L')) for i in range(825): for j in range(200): if mask[i, j] > 200: mask[i, j] = 0 ...
Ronningen/DDIN1
ice_mask_generation.py
ice_mask_generation.py
py
720
python
en
code
1
github-code
6
[ { "api_name": "numpy.load", "line_number": 4, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 5, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 5, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 7, ...
43627572834
from typing import List class Solution: def maxBoxesInWarehouse(self, boxes: List[int], warehouse: List[int]) -> int: boxes.sort() p1, p2 = 0, len(warehouse)-1 res = 0 for i in range(len(boxes)-1, -1, -1): if boxes[i] <= warehouse[p1]: p1 += 1 ...
MichaelTQ/LeetcodePythonProject
solutions/leetcode_1551_1600/LeetCode1580_PutBoxesIntoTheWarehouseII.py
LeetCode1580_PutBoxesIntoTheWarehouseII.py
py
918
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]