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
38800506512
import serial import tkinter as tk # ser = serial.Serial() # ser.baudrate = 115200 # ser.port = 'COM5' # ser.open() # a = [65,66,67,68] # byte_array = bytearray(a) # while 1: # a = int(input()) # byte_data = a.to_bytes(4,'little') # #print(byte_data) # ser.write(byte_data) # s = ser.read(2) # ...
niuyilong2010/ece395
user_interface.py
user_interface.py
py
2,871
python
en
code
0
github-code
21
[ { "api_name": "serial.Serial", "line_number": 60, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 65, "usage_type": "call" }, { "api_name": "tkinter.Frame", "line_number": 66, "usage_type": "call" }, { "api_name": "tkinter.Button", "line_num...
22925703025
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http:# mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __f...
mozilla/jx-sqlite
jx_sqlite/expressions.py
expressions.py
py
26,130
python
en
code
35
github-code
21
[ { "api_name": "mo_dots.Data", "line_number": 33, "usage_type": "call" }, { "api_name": "mo_dots.wrap", "line_number": 36, "usage_type": "call" }, { "api_name": "mo_dots.ROOT_PATH", "line_number": 36, "usage_type": "name" }, { "api_name": "jx_base.OBJECT", "lin...
13360084455
import os import sys from os.path import join as pjoin from setuptools import setup def read_version_string(): version = None sys.path.insert(0, pjoin(os.getcwd())) from django_visitor_information import __version__ version = __version__ sys.path.pop(0) return version with open('requirement...
Kami/django-visitor-information-middleware
setup.py
setup.py
py
1,719
python
en
code
13
github-code
21
[ { "api_name": "sys.path.insert", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getcwd", "line_numb...
23111861781
from django.conf.urls.defaults import patterns, include, url from pr1.autos.views import * from pr1.autos2.views import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() from django.conf import settings urlpatterns = patterns('', ('^$',start), (r'^previ...
v01d24/test
urls.py
urls.py
py
1,325
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 8, "usage_type": "name" }, { "api_name": "django.conf.urls.defaults.patterns", "line_number": 12, "usage_type": "call" }, ...
74865696053
import pandas as pd import os from matplotlib import pyplot as plt # 修补画图时 中文乱码的问题 plt.rcParams['font.sans-serif'] = ['SimHei'] plt.rcParams['axes.unicode_minus'] = False PATH = 'data/铁次100plus_v3.4.xlsx' if __name__ == '__main__': point_size = 10 # 点大小 # 修改工作路径方便测试开发 path = r"C:\Users\Administrator\Do...
Fivehours0/Proj-PerformanceGrade
project/根据攀钢给的分数标签画各个指标的散点分布/处理程序.py
处理程序.py
py
1,194
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 7, "usage_type": "attribute" }, { "ap...
74788529972
import discord from discord.ext import commands bot = commands.Bot(command_prefix='!') @bot.command() async def tomorrow(ctx): await ctx.send("tomorrow's shop https://stormleaks.tk/shopimage/screenshot-fnbr.co-2018-09-08-20-05-59-330.png") bot.run('NDg4MTg0NzMwNjQ3Mzk2Mzcz.DnYhCA.fxGnlBgyLbsrn90mDwUB2wGPkdo')
awesomehd1/StormLeaks-Bot
bot.py
bot.py
py
318
python
en
code
0
github-code
21
[ { "api_name": "discord.ext.commands.Bot", "line_number": 4, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 4, "usage_type": "name" } ]
1591942481
import pygame import lib pygame.init() class Game(): def __init__(self): self.screen = pygame.display.set_mode([lib.SCREEN_WIDTH, lib.SCREEN_HEIGHT]) pygame.display.set_caption("One Room") self.running = True self.clock = pygame.time.Clock() lib.events = pygame.event.get(...
Kassicus/one-room
main.py
main.py
py
1,025
python
en
code
0
github-code
21
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "lib.SCREEN_WIDTH...
26635573480
import argparse import random import numpy as np import matrix_io from timeit import default_timer as timer # add noise based on row std. This adds a gaussian noise to the data. def row_perturb(input, noise_level = 0., method='normal'): if noise_level == 0.: return input # perturb global noise (...
AluruLab/MCPNetPaper2022
scripts/simulate_with_noise/perturb.py
perturb.py
py
4,599
python
en
code
0
github-code
21
[ { "api_name": "numpy.random.uniform", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.random.uniform", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.ran...
26585342941
import os import argparse from tqdm import tqdm from PIL import Image def parse_arguments(): parser = argparse.ArgumentParser() parser.add_argument('--data_folder', type=str, required=True) parser.add_argument('--output_folder', type=str, default='preprocessed') parser.add_argument('--resize_shape', ty...
KyloRen1/Sequence-Classification-of-Human-Robot-Walking
data_preprocessing/dataset_preprocessing.py
dataset_preprocessing.py
py
1,736
python
en
code
2
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 17, "usage_type": "name" }, { "api_name": "os.makedirs", "li...
36642898032
import unittest import numpy as np from ...enums import FuelConstants from ...world.parameters import Fuel from ..config import Config from ..terrain import ( chaparral, delta_seed, m_x_seed, random_seed_list, sigma_seed, w_0_seed, ) class TerrainTest(unittest.TestCase): def setUp(self) ...
mitrefireline/simfire
simfire/utils/_tests/test_terrain.py
test_terrain.py
py
4,495
python
en
code
1
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "config.Config", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.random",...
38188292102
#!/usr/bin/python3 # -*- coding: utf-8 -*- import tkinter as tk from tkinter import ttk import subprocess import configparser from tkinter.scrolledtext import ScrolledText subporn = ('AbandonedPorn', 'AdPorn', 'AdrenalinePorn', 'AerialPorn', 'AgriculturePorn', 'AlbumArtPorn', 'AnimalPorn',\ 'ApocalypsePorn'...
Comm4nd0/background-updater
main.py
main.py
py
6,532
python
en
code
0
github-code
21
[ { "api_name": "configparser.ConfigParser", "line_number": 27, "usage_type": "call" }, { "api_name": "tkinter.Checkbutton", "line_number": 31, "usage_type": "attribute" }, { "api_name": "tkinter.scrolledtext.ScrolledText", "line_number": 33, "usage_type": "name" }, { ...
9754631811
from allennlp.training.callbacks.callback import TrainerCallback from typing import Dict, Any, List import numpy as np import logging logger = logging.getLogger(__name__) # pylint: disable=invalid-name @TrainerCallback.register("reload_training_data") class ReloadDataCallback(TrainerCallback): def __init__(self,...
mirthfulLee/SBR_classify
TreeVul_IR/custom_callback.py
custom_callback.py
py
5,405
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "allennlp.training.callbacks.callback.TrainerCallback", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 11, "usage_type": "name" }, { "...
11607603167
import torch import torch.nn as nn from torch.nn import functional as F class BasicBlock(nn.Module): expansion: int = 4 def __init__(self, inplanes, planes, stride = 1, downsample = None, groups = 1, base_width = 64, dilation = 1, norm_layer = None): super(BasicBlock, self).__init__(...
WeizhenLiuBioinform/Pork_Marbling_Segmentation
models/encnet.py
encnet.py
py
14,215
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.BatchNorm2d", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", ...
73353818614
__all__ = ['split_reverse_pull', 'split_pulls_at_point', 'Pulling', 'ExpList', 'group_by'] import os.path as opath from operator import itemgetter, attrgetter, methodcaller, and_ import operator as op import logging import cPickle as pickle from re import search as re_search from itertools import groupby,...
cfperez/smbanalyze
experiment.py
experiment.py
py
11,357
python
en
code
2
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "constants.logLevel", "line_number": 28, "usage_type": "attribute" }, { "api_name": "constants.logHandler", "line_number": 29, "usage_type": "attribute" }, { "api_name": "n...
23826960447
from tkinter import * import requests app = Tk() def get_weather(): city = cityField.get() key = 'YOUR_API_KEY' url = 'http://api.openweathermap.org/data/2.5/weather?units=metric' params = {'APPID':key, 'q':city, 'units':'metrics'} result = requests.get(url, params=params) weather = result.json(...
smaknomercy/tkinter-weather
main.py
main.py
py
923
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" } ]
24582538490
import chainer import chainer.functions as F from network.stream.audio_stream import Audio_Stream from network.stream.visual_stream import Visual_Stream from network.stream.fusion_stream import Fusion_Stream from network.loss import evaluate_loss import modules.operation as op import env as env from env import xp c...
meokz/looking-to-listen
network/src/network/double_complex_net.py
double_complex_net.py
py
2,921
python
en
code
152
github-code
21
[ { "api_name": "chainer.Chain", "line_number": 14, "usage_type": "attribute" }, { "api_name": "env.xp.asarray", "line_number": 18, "usage_type": "call" }, { "api_name": "env.xp", "line_number": 18, "usage_type": "name" }, { "api_name": "env.xp.float32", "line_n...
72731623732
#!/usr/bin/python3 ''' This module contains the routes for the visitor service ''' from flask import Flask, jsonify, request, redirect from flask_cors import CORS from api.v1.views import app_views import models from models import Url app = Flask(__name__) app.url_map.strict_slashes = False app.register_blueprin...
aucontraire/floyd-url-shortener
api/v1/app.py
app.py
py
888
python
en
code
1
github-code
21
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "api.v1.views.app_views", "line_number": 15, "usage_type": "argument" }, { "api_name": "flask_cors.CORS", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.jsonify"...
73365777014
from django.http import HttpRequest, HttpResponse from django.shortcuts import render from django.templatetags.static import static from utilities.format import format_kokoro_color ERROR_DICT = { 400: { "svg": { "file": static("images/kaomoji/400.svg"), "width": 414, "he...
baseplate-admin/CoreProject
backend/django_core/core/views.py
views.py
py
3,419
python
en
code
99
github-code
21
[ { "api_name": "django.templatetags.static.static", "line_number": 9, "usage_type": "call" }, { "api_name": "utilities.format.format_kokoro_color", "line_number": 14, "usage_type": "call" }, { "api_name": "django.templatetags.static.static", "line_number": 22, "usage_type"...
1427344072
import angr, claripy from securestoragehooks import UserInput, MAX_STRLEN, LifecycleCommandIds, InvokeCommandIds, DataFlags, TeeWhence from tcparams import TCParams, TCParam, TEECParamType, TypeCategories from securestorage import SecureStorage import struct # NOTE: angr does not support anonymous members of unions, ...
teesec/simta
simta/exec/securestorage/lifecycle_symbolic.py
lifecycle_symbolic.py
py
15,572
python
en
code
7
github-code
21
[ { "api_name": "angr.types", "line_number": 12, "usage_type": "attribute" }, { "api_name": "angr.types.parse_types", "line_number": 13, "usage_type": "call" }, { "api_name": "angr.types", "line_number": 13, "usage_type": "attribute" }, { "api_name": "angr.types.reg...
27623134175
import requests import datetime import pandas as pd def api_call(): API_KEY = '3faf1d1d4c95245aff49d70ebaf587b9' lat = '40.4406' lon = '79.9959' number_of_days = 30 current_time = 1668798184 start_time = current_time - number_of_days * 86400 dates = [] temps = [] for i in range(num...
CSGeoWizard/nov22_factoryday
wrapper.py
wrapper.py
py
734
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime.fromtimestamp", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "attribute" }, { "api_name": "p...
71066669174
from azure.cognitiveservices.vision.computervision import ComputerVisionClient from azure.cognitiveservices.vision.computervision.models import OperationStatusCodes from azure.cognitiveservices.vision.computervision.models import VisualFeatureTypes from msrest.authentication import CognitiveServicesCredentials from...
Alhamzy/USF-Logo-Detector
detectors pt2/text-detector.py
text-detector.py
py
2,626
python
en
code
1
github-code
21
[ { "api_name": "azure.cognitiveservices.vision.computervision.ComputerVisionClient", "line_number": 14, "usage_type": "call" }, { "api_name": "msrest.authentication.CognitiveServicesCredentials", "line_number": 14, "usage_type": "call" }, { "api_name": "time.sleep", "line_numb...
32408219160
# Code for the January 2023 CROC irradiation at Sandia National Lab # Max Herrmann CU Boulder January 2023 # maxwell.herrmann@colorado.edu # (563)726-3086 import os import sys import time import csv import subprocess import logging import colorlog import croniter import datetime import argparse #switch config to ne...
maxwellrherrmann/irradiationDAQ
irradiationDAQ.py
irradiationDAQ.py
py
6,066
python
en
code
0
github-code
21
[ { "api_name": "subprocess.run", "line_number": 20, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
1553257423
import json import pandas as pd import math import numpy as np import matplotlib.pyplot as plt import traceback import utils.functions_ZZ_extraction as fct from utils.import_data import * class NoOutputError(Exception): pass def bout_type(bout, df_bout): if df_bout['abs_Max_Bend_Amp'].iloc[bout] < 25: ...
wyartlab/Carbo-Tano_Lapoix_2023
SCAPE/utils/utils_behavior_dataset.py
utils_behavior_dataset.py
py
13,784
python
en
code
0
github-code
21
[ { "api_name": "numpy.nan", "line_number": 35, "usage_type": "attribute" }, { "api_name": "numpy.nan", "line_number": 39, "usage_type": "attribute" }, { "api_name": "numpy.nan", "line_number": 53, "usage_type": "attribute" }, { "api_name": "pandas.options", "li...
71217158133
from typing import Callable, List import lightgbm as lgb import pandas as pd from optuna.trial import Trial from sklearn.metrics import mean_squared_error from sklearn.model_selection import TimeSeriesSplit # Define objective function for Optuna def objective( trial: Trial, data: pd.DataFrame, features:Li...
Arsenchius/TradingExperiments
src/models/objective.py
objective.py
py
2,442
python
en
code
1
github-code
21
[ { "api_name": "optuna.trial.Trial", "line_number": 11, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 12, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "sklearn.model_se...
1311176423
import numpy as np import cv2 from scipy import optimize class BundleAdjuster: def init(self, mtx, dist): """ Constructor for BundleAdjuster class. Parameters: - mtx: intrinsic camera matrix - dist: distortion coefficients """ self.mtx = mtx self...
MichaelFYang/sfm-3d-vision
bundle_adjuster.py
bundle_adjuster.py
py
5,003
python
en
code
1
github-code
21
[ { "api_name": "numpy.float32", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 39, "usage_type": "call" }, { "api_name": "cv2.solvePnPRansac", "line_...
44249749801
# compute distance histogram and get wasserstein distance, uses multiple timeframes per amino acid and timeframe. from scipy.stats import wasserstein_distance print(numAA) distancePerBin = 20/50 mobility = np.zeros(numAA) # save a value for every aa to calculate a moviness value mobilityStd = np.zeros(numAA) avgDist ...
lesimon74/PeptideMovement
4.Mobility_Score_3/2.Calculate_Wasserstein_metric_use_multiple_timeframes.py
2.Calculate_Wasserstein_metric_use_multiple_timeframes.py
py
2,055
python
en
code
0
github-code
21
[ { "api_name": "scipy.stats.wasserstein_distance", "line_number": 43, "usage_type": "call" } ]
29743612933
############################################# # 상모고등학교 알림봇 스킬에 사용되는 파일임 ############################################ from flask import Flask, jsonify, request import requests #웹 크롤링에 사용(requests.get등 사용) from bs4 import BeautifulSoup #웹 크롤링에 사용하는 모듈 from datetime import datetime #yy mm dd 사용 app = Flask(__name__) y...
Chamin0806/Sangmo_Kakao
Kakao.py
Kakao.py
py
2,803
python
ko
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.today", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "name" }, { "api_name": "datetime.datetim...
13616191202
""" Programme réalisé dans le cadre d'un exercice Python CLI Il prend en entrée une requête à base de mots clés et,à partir de l'API EHR Portal, sort un fichier CSV (?) contenant les données qui y sont associées. """ import requests, json # Création du programme de base avant transformation en CLI # Requetage JSon: r...
PaulineChauvet/exercice_python_API_CLI
exercice_CLI.py
exercice_CLI.py
py
1,709
python
fr
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 25, "usage_type": "call" } ]
18353052639
##this code is created by Hamada import numpy as np import copy import matplotlib # matplotlib.use('Agg') import matplotlib.pyplot as plt # my imports from pddm.samplers import trajectory_sampler from pddm.utils.helper_funcs import do_groundtruth_rollout from pddm.utils.helper_funcs import turn_acs_into_acsK from pd...
AtsushiHAM/EEI_Analysis_model_based_rl
pddm/utils/utils.py
utils.py
py
15,575
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 22, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "matpl...
73061763892
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################################### # Filippos Klironomos, Berlin Institute for Medical Systems Biology, Max-Delbrück Center, Berlin ############################################################################...
fklirono/rnaseq
shuffleDinucleotides.py
shuffleDinucleotides.py
py
3,914
python
en
code
0
github-code
21
[ { "api_name": "sys.stdout", "line_number": 38, "usage_type": "attribute" }, { "api_name": "ghmm.Alphabet", "line_number": 41, "usage_type": "call" }, { "api_name": "Bio.SeqIO.parse", "line_number": 70, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_n...
72280368373
import os import json # read a json config file def readConfig(filename='config.json'): # build the absolute filepath if running via another script dirName = os.path.dirname(os.path.abspath(__file__)) fullPath = '/'.join([dirName, filename]) # read the config file with open(fullPath) as file: ...
OnionIoT/iot-door-lock
configHelper.py
configHelper.py
py
365
python
en
code
3
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "json.load", "line_numbe...
33816649531
import trn_classify import numpy as np import gc def evaluate_activations(model, X, layer): from keras.layers.core import K get_layer_output = K.function([model.layers[0].input, K.learning_phase()], [model.layers[layer].output]) return get_layer_output([X, 0])[0] if __name__ == "__main__": print("St...
skoppula/yoho-experiments
mfcc-feedforward-nn/test_classify.py
test_classify.py
py
1,491
python
en
code
0
github-code
21
[ { "api_name": "keras.layers.core.K.function", "line_number": 8, "usage_type": "call" }, { "api_name": "keras.layers.core.K", "line_number": 8, "usage_type": "name" }, { "api_name": "keras.layers.core.K.learning_phase", "line_number": 8, "usage_type": "call" }, { "...
9917965924
import papermill as pm import pytest import scrapbook as sb # Unless manually modified, python3 should be # the name of the current jupyter kernel # that runs on the activated conda environment KERNEL_NAME = "python3" OUTPUT_NOTEBOOK = "output.ipynb" @pytest.mark.notebooks def test_00_notebook_run(similarity_notebo...
microsoft/computervision-recipes
tests/unit/similarity/test_similarity_notebooks.py
test_similarity_notebooks.py
py
2,562
python
en
code
9,169
github-code
21
[ { "api_name": "papermill.execute_notebook", "line_number": 16, "usage_type": "call" }, { "api_name": "scrapbook.read_notebook", "line_number": 20, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 13, "usage_type": "attribute" }, { "api_name": "p...
20812298973
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
gtoonstra/etl-with-airflow
examples/hive-example/dags/process_hive_dwh.py
process_hive_dwh.py
py
3,410
python
en
code
1,235
github-code
21
[ { "api_name": "airflow.utils.dates.days_ago", "line_number": 25, "usage_type": "call" }, { "api_name": "airflow.utils", "line_number": 25, "usage_type": "attribute" }, { "api_name": "airflow.models.Variable.get", "line_number": 30, "usage_type": "call" }, { "api_n...
73614123574
import random from dataclasses import dataclass, field from typing import List from httpx import AsyncClient from nonebot import logger BASE_URL = "https://raw.githubusercontent.com/Chi-Task-Force/Chi-Corpus/master" @dataclass class Corpus: common: List[str] = field(default_factory=list) refuse: List[str] =...
chshzhe/Chi-QQBot
plugins/sell_vegetable/corpus.py
corpus.py
py
1,668
python
en
code
3
github-code
21
[ { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "dataclasses.field", "line_number": 13, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "api_name": "dataclasses.field", "li...
34839941503
import os from setuptools import find_packages, setup from freight import __version__ # read the contents of your README file this_directory = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(this_directory, "README.md"), encoding="utf-8") as f: long_description = f.read() # allow setup.py to b...
staropera/aa-freight
setup.py
setup.py
py
1,633
python
en
code
1
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
18747723968
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This is the script with the main code of the application """ import json import logging import aiohttp.web import connexion async def index(request): """ Redirecting root to index.html """ raise aiohttp.web.HTTPFound('/index.html') def go(): "...
altermarkive/python-experiments
api-with-aiohttp-connexion-container/app/app.py
app.py
py
976
python
en
code
0
github-code
21
[ { "api_name": "aiohttp.web.web.HTTPFound", "line_number": 18, "usage_type": "call" }, { "api_name": "aiohttp.web.web", "line_number": 18, "usage_type": "attribute" }, { "api_name": "aiohttp.web", "line_number": 18, "usage_type": "name" }, { "api_name": "connexion....
33913059137
from __future__ import print_function import pymysql from Calf import * import csv import sys calf_list = {} day = 0 def create_dict(total_study_days): # create new dict with INT as key and an object->(healthycount, sickcount, sick) # test Paula test=Calf(total_study_days) calf_tag = 101 print('Cre...
paulipotter/BCI-Scholar
Calf_Counter.py
Calf_Counter.py
py
8,454
python
en
code
0
github-code
21
[ { "api_name": "pymysql.connect", "line_number": 40, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_number": 64, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 80, "usage_type": "call" }, { "api_name": "csv.writer", "line_number...
29929478390
# -*- coding:utf-8 -*- """ Created on the 03/01/17 @author: Nicolas Thiebaut @email: nkthiebaut@gmail.com """ import argparse from os import path import pandas as pd from datascribe.audit import audit_dataframe parser = argparse.ArgumentParser( description='Generates a description file for csv data files', fo...
nkthiebaut/datascribe
scripts/audit_csv.py
audit_csv.py
py
988
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { ...
10684397942
""" nc_file_checks_register.py ========================== A register of checks for NetCDF4 files. """ import os from netCDF4 import Dataset from compliance_checker.base import Result from .callable_check_base import CallableCheckBase from checklib.code import nc_util, util from checklib.cvs.ess_voca...
cedadev/compliance-check-lib
checklib/register/nc_file_checks_register.py
nc_file_checks_register.py
py
22,161
python
en
code
1
github-code
21
[ { "api_name": "callable_check_base.CallableCheckBase", "line_number": 20, "usage_type": "name" }, { "api_name": "netCDF4.Dataset", "line_number": 24, "usage_type": "argument" }, { "api_name": "checklib.code.errors.FileError", "line_number": 25, "usage_type": "call" }, ...
25942147976
#!/usr/bin/env python """Sample script of recurrent neural network language model. This code is ported from the following implementation written in Torch. https://github.com/tomsercu/lstm """ from __future__ import division # import argparse import numpy as np import chainer import chainer.functions as F import chain...
vecto-ai/vecto
vecto/benchmarks/language_modeling/language_modeling.py
language_modeling.py
py
13,637
python
en
code
62
github-code
21
[ { "api_name": "chainer.Chain", "line_number": 32, "usage_type": "attribute" }, { "api_name": "chainer.links.Linear", "line_number": 46, "usage_type": "call" }, { "api_name": "chainer.links", "line_number": 46, "usage_type": "name" }, { "api_name": "chainer.links.L...
9204852126
import re import time import requests import pandas as pd from bs4 import BeautifulSoup import numpy as np import argparse def get_nationality(playerPage): link = playerPage.a["href"] page = requests.get('http://www.futhead.com/' + link) bs = BeautifulSoup(page.text, 'html.parser') if args.year in [17,...
Villux/world_cup
scripts/fifa_data_scraper.py
fifa_data_scraper.py
py
3,917
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 38, "usage_type": "call" }, { "api_name": "time.clock", ...
7173210887
import copy from jumpscale.loader import j from parameterized import parameterized from tests.base_tests import BaseTests class TestConfig(BaseTests): def test_01_get_default_config(self): """Test case for getting jsng default config. **Test Scenario** - Get the default config. ...
threefoldtech/js-ng
tests/core/config/test_config.py
test_config.py
py
6,523
python
en
code
5
github-code
21
[ { "api_name": "tests.base_tests.BaseTests", "line_number": 8, "usage_type": "name" }, { "api_name": "jumpscale.loader.j.core.config.get_default_config", "line_number": 18, "usage_type": "call" }, { "api_name": "jumpscale.loader.j.core", "line_number": 18, "usage_type": "a...
33775360636
import os import sys from gen3authz.client.arborist.errors import ArboristError from indexclient.client import IndexClient from psqlgraph import PsqlGraphDriver import json import pytest import requests import sheepdog import peregrine from peregrine.api import app as _app, app_init from . import utils # Python 2 an...
uc-cdis/peregrine
tests/conftest.py
conftest.py
py
9,571
python
en
code
11
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.path.insert", "l...
28425787138
"""sih URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based vie...
manideep-1/collaborator
sih/sih/urls.py
urls.py
py
1,896
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 23, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 24, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 25, "usage_type": "call" }, { "api_name": "django.urls.path",...
18605963836
import pandas as pd from enum import Enum import numpy as np from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import train_test_split from keras.utils import np_utils from keras.models import Sequential from keras.layers import Dense, Dropout from keras.layers.normalization import BatchNormal...
Cuki-Chang/Human-Drone-communication
Action/training/train.py
train.py
py
8,607
python
en
code
2
github-code
21
[ { "api_name": "enum.Enum", "line_number": 56, "usage_type": "name" }, { "api_name": "keras.callbacks.Callback", "line_number": 80, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 101, "usage_type": "call" }, { "api_name": "matplotl...
4183493860
from LSP.plugin import AbstractPlugin from LSP.plugin import register_plugin from LSP.plugin import unregister_plugin from LSP.plugin import DottedDict from LSP.plugin.core.typing import Any, Callable, List, Dict, Mapping, Optional, Tuple import sublime import os import urllib.request import zipfile import shutil impor...
alihsaas/LSP-robloxluau
plugin.py
plugin.py
py
5,285
python
en
code
1
github-code
21
[ { "api_name": "LSP.plugin.AbstractPlugin", "line_number": 17, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
43956628565
from __future__ import unicode_literals import pygal def twoline(file_name, title, line1, line1_label, line2, line2_label, x_labels): line_chart = pygal.Line(include_x_axis=True) line_chart.title = title line_chart.x_labels = x_labels line_chart.add(line1_label, line1) line_chart.add(line2_label, ...
WaltRCodes/pynet_test
lesson3/line_graph.py
line_graph.py
py
384
python
en
code
0
github-code
21
[ { "api_name": "pygal.Line", "line_number": 6, "usage_type": "call" } ]
26279005915
#!/usr/bin/python3 """ This piece of code is the main application file and consists of the routes and the calls that are to be made to the different components. @author: G V Datta Adithya """ from flask import Flask, redirect, render_template, url_for, request from forms import AnimalForm from db import Pet, DB app ...
dat-adi/mock_store
v1/main.py
main.py
py
3,239
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 22, "usage_type": "call" }, { "api_name": "db.DB", "line_number": 31, "usage_type": "name" }, { "api_name": "flask.render_template", "...
11094612275
import os import sys root_path = os.path.realpath(__file__).split('/multipose_get_people.py')[0] # os.chdir(root_path) sys.path.append(root_path) # from evaluate.tester import Tester from evaluate.multi_pose_net_estimator import Params, MultiPoseNetEstimator # Set Training parameters params = Params() params.backb...
fredericgo/learning_from_video
hmr/src/pytorch_multipose/multipose_get_people.py
multipose_get_people.py
py
687
python
en
code
0
github-code
21
[ { "api_name": "os.path.realpath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
25162128677
import math import random import numpy as np import torch from torch.autograd import Variable class Helper(object): """ 工具类: 用来提供各种工具函数 """ def __init__(self): self.timber = True self._preDict = {} def np2var(self, x, type=torch.FloatTensor): """ :param x(num...
Mediocre250/long-tail-recommendation
papers/(2019 CIKM ) Long-tail Hashtag Recommendation for Micro-videos with Graph Convolutional Network/VideoToHashtag/util.py
util.py
py
2,922
python
en
code
2
github-code
21
[ { "api_name": "torch.FloatTensor", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.autograd.Variable", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.aut...
42928381451
import rethinkdb as r from flask import Blueprint, render_template, request, g from remotelogging.server.util import requires_auth bp = Blueprint(__name__, __name__) def fill_text(template, data): t = list(r.table('templates').filter(dict(id=template)).run(g.rdb_conn)) if len(t) == 0: return f"{temp...
romangraef/remotelogging
remotelogging/server/logs.py
logs.py
py
722
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "rethinkdb.table", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.g.rdb_conn", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flask.g", "l...
24077999492
""" alona Description: An analysis pipeline for scRNA-seq data. How to use: https://github.com/oscar-franzen/alona/ Contact: Oscar Franzen, <p.oscar.franzen@gmail.com> """ import sys import logging from .constants import (RED, GREEN, END, YELLOW) def init_logging(loglevel, logfile): if loglevel == 'regula...
oscar-franzen/alona
alona/log.py
log.py
py
1,278
python
en
code
19
github-code
21
[ { "api_name": "logging.INFO", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.DEBUG", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.Stre...
23674593558
from rest_framework import status from rest_framework.request import Request from rest_framework.response import Response from rest_framework.views import APIView from drf_spectacular.utils import extend_schema from api_auth.serializers import EmptySerializer from api_order.models import Order from api_order.serializer...
Aleksiy2022/python_django_diplom
megano/api_order/api_views.py
api_views.py
py
3,385
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.views.APIView", "line_number": 14, "usage_type": "name" }, { "api_name": "api_order.serializers.OrderSerializer", "line_number": 16, "usage_type": "name" }, { "api_name": "rest_framework.request.Request", "line_number": 18, "usage_type": "nam...
13358279381
# --- # jupyter: # jupytext: # cell_metadata_filter: -all # custom_cell_magics: kql # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.14.6 # kernelspec: # display_name: venv # language: python # name: python3 # ...
srush/LLM-Training-Puzzles
Distributed.py
Distributed.py
py
26,730
python
en
code
511
github-code
21
[ { "api_name": "chalk.set_svg_height", "line_number": 32, "usage_type": "call" }, { "api_name": "chalk.set_svg_draw_height", "line_number": 33, "usage_type": "call" }, { "api_name": "lib.Model", "line_number": 41, "usage_type": "call" }, { "api_name": "drawing.draw...
33751451913
# coding=utf-8 """ File: case_handler.py Author: bot Created: 2023/8/8 Description: """ import json from typing import List, Union import re from app.handler.redis.api_redis import ApiRedis from app.schemas.api_case.api_case_schemas import OrmFullCase from app.handler.ahttp.async_http_client import AsyncRequest from a...
arcticlin/C137-New
app/handler/case/case_handler.py
case_handler.py
py
5,909
python
en
code
0
github-code
21
[ { "api_name": "app.handler.redis.api_redis.ApiRedis", "line_number": 25, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 28, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 52, "usage_type": "call" }, { "api_name": "re.compil...
73832252853
import logging import ckan from ckan import logic from ckan.logic import NotFound, check_access from ckanext.harvest.logic import HarvestJobExists from ckanext.harvest.plugin import DATASET_TYPE_NAME from ckanext.harvest.model import (HarvestSource, HarvestJob, HarvestObject, HarvestObjectExtra) from ckanext.har...
IFPRI/sda-ckan-ar
ckanext-harvest/ckanext/harvest/logic/action/create.py
create.py
py
5,867
python
en
code
2
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "ckan.lib", "line_number": 20, "usage_type": "attribute" }, { "api_name": "ckanext.harvest.plugin.DATASET_TYPE_NAME", "line_number": 65, "usage_type": "name" }, { "api_name...
10065197697
from itertools import permutations def char_list_to_number(char_list, perm): temp = map(lambda x: perm.index(x), char_list) return reduce(lambda x, y: x * 10 + y, temp) def symbol_to_function(symbol): symbol_function = { '+': lambda x, y: x + y, '-': lambda x, y: x - y, '*': lamb...
Symforian/University
Python/List 5/kryptoarytm.py
kryptoarytm.py
py
2,017
python
en
code
0
github-code
21
[ { "api_name": "itertools.permutations", "line_number": 24, "usage_type": "call" } ]
70962053814
from typing import Generator import numpy as np import pytest from qulacs import QuantumState class TestQuantumState: @pytest.fixture def init_state(self) -> Generator[None, None, None]: self.n = 4 self.dim = 2**self.n self.state = QuantumState(self.n) yield del self...
qulacs/qulacs
python/tests/single_cpu/test_state.py
test_state.py
py
1,071
python
en
code
358
github-code
21
[ { "api_name": "qulacs.QuantumState", "line_number": 14, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 10, "usage_type": "attribute" }, { "api_name": "typing.Generator", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.zeros"...
17639290726
# -*- coding: utf-8 -*- """ created by huash06 at 2015-05-12 09:06 """ __author__ = 'huash06' import sys import os import datetime import functools import itertools import collections # sys.stdin = open('input/sampleG.txt', 'r') # sys.stdin = open('input/B-small-practice.in', 'r') # sys.stdout = open('output/B-small...
shhuan/algorithms
py/codechef/challenge2015/G_SpecialEconomicZone.py
G_SpecialEconomicZone.py
py
1,247
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 23, "usage_type": "call" } ]
25591952923
from collections import defaultdict def solve(data, calc_diagonals: bool = False): coords_map = defaultdict(int) for (x1, y1), (x2, y2) in data: if not calc_diagonals and x1 != x2 and y1 != y2: continue points_to_add = max(abs(x1 - x2), abs(y1 - y2)) xs = range(x1, x2, (x2 ...
herbiebradley/aoc
2021/day5/day5.py
day5.py
py
986
python
en
code
1
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" } ]
30698253581
import torch import math import torch.nn as nn from torch.nn.modules.utils import _triple import torch.nn.functional as F def soft_nnc(embeddings1,embeddings2,check=1): # Please keep this line for possible arithmetic underflows embeddings1 = embeddings1.half().double() # for improved accuracy change `half()`...
alexandrosstergiou/Squeeze-and-Recursion-Temporal-Gates
train/test_cyclic.py
test_cyclic.py
py
2,824
python
en
code
64
github-code
21
[ { "api_name": "torch.nn.functional.avg_pool3d", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 22, "usage_type": "name" }, { "api_name": "torch.nn.functional.avg_pool3d", "line_number": 26, "usage_type": "call" }, { ...
20483462613
from django.conf.urls import url from . import views app_name='picstagram' urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^create_pictures/$', views.create_pictures, name='create_pictures'), url(r'^register/$', views.register, name='register'), url(r'^login_user/$', views.login_user, nam...
mbk1995/Picstagram
picstagram/urls.py
urls.py
py
550
python
en
code
0
github-code
21
[ { "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.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
25276346072
import fractions def main(): buf = input() buflist = buf.split() a = int(buflist[0]) b = int(buflist[1]) ans = a * b // fractions.gcd(a, b) print(ans) if __name__ == '__main__': main()
takumi152/atcoder
abc148c.py
abc148c.py
py
231
python
en
code
0
github-code
21
[ { "api_name": "fractions.gcd", "line_number": 9, "usage_type": "call" } ]
19232063930
# Imports from bs4 import BeautifulSoup from datetime import datetime import requests import pandas as pd import os import gzip import shutil from config import SOURCE_PATH, RAW_PATH # Script permettant d'extraire les données. Ici sont définis les urls et APIs cibles. ############################ # Variables #######...
samj344800/etl_test
workspace/scripts/extract.py
extract.py
py
3,613
python
fr
code
0
github-code
21
[ { "api_name": "datetime.datetime.today", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "name" }, { "api_name": "os.makedirs", "line_number": 26, "usage_type": "call" }, { "api_name": "config.SOURCE_P...
8319516637
from torch.utils.data import Dataset import numpy as np import cv2 import json import random import matplotlib.pyplot as plt from utils import * def gaussian(x, mu, sig): return np.exp(-np.power(x - mu, 2.) / (2 * np.power(sig, 2.))) class FSIFDataset(Dataset): def __init__(self, opt, id_list, mod="train"): ...
zhuhao-nju/mvfr
datasets/FSIFDataset.py
FSIFDataset.py
py
10,168
python
en
code
59
github-code
21
[ { "api_name": "numpy.exp", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.linspace", "...
243418496
from django.urls import include, path from rest_framework.routers import SimpleRouter from . import views from .views import (CategoryViewSet, CommentViewSet, GenreViewSet, RegistrUserView, ReviewViewSet, TitleViewSet, UserViewSet) router_v1 = SimpleRouter() router_v1.register('users', UserViewSet...
GEGorm/yamdb_final
api_yamdb/api/urls.py
urls.py
py
968
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.routers.SimpleRouter", "line_number": 8, "usage_type": "call" }, { "api_name": "views.UserViewSet", "line_number": 9, "usage_type": "argument" }, { "api_name": "views.ReviewViewSet", "line_number": 12, "usage_type": "argument" }, { "a...
16217060744
import os from argparse import ArgumentParser import lexer # Parse the command line arguments parser = ArgumentParser() parser.add_argument("-d", "--directory", type=str, help="Directory to parse structures from.", default="samples") args = parser.parse_args() # Get the list of input files from the source di...
RnaodmBiT/nibble
nibble.py
nibble.py
py
842
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
21329069490
import requests from lxml import etree import json import re import time from datetime import datetime from datetime import timedelta import xlrd import logging import traceback # 设置日志记录 LOG_FORMAT = "%(asctime)s %(filename)s %(levelname)s %(lineno)d %(message)s " # 配置输出日志格式 DATE_FORMAT = '%Y-%m-%d %H:%M:%S ' # 配置...
daiguobinit/project
sina/newcarts.py
newcarts.py
py
15,167
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "name" }, { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.D...
31825183350
from django import template from django.forms.boundfield import BoundField, BoundWidget from django.forms import Select, NumberInput from ..views.cards import get_card_or_top_map register = template.Library() @register.filter(name='adddtclass') def adddtclass(value, arg): a = arg.split(';') if len(a) > 0: ...
HADES-Cracovia/pasttrec-manager
pasttrec_trb3setup/templatetags/filters.py
filters.py
py
1,682
python
en
code
0
github-code
21
[ { "api_name": "django.template.Library", "line_number": 7, "usage_type": "call" }, { "api_name": "django.template", "line_number": 7, "usage_type": "name" }, { "api_name": "django.forms.boundfield.BoundField", "line_number": 21, "usage_type": "argument" }, { "api_...
5133300410
import SimpleCV import numpy as np import scipy def myconvolve(I, kernel): Inp = I.getGrayNumpy() rows = Inp.shape[0] cols = Inp.shape[1] d = kernel.shape[0] output= np.zeros((rows, cols)) Ipad = np.zeros((rows+d-1,cols+d-1)) Ipad[d/2:rows-d/2+2, d/2:cols-d/2+2] = Inp kernel_ = np.flipl...
lastlegion/DIP-Assign-2
my2Dconv.py
my2Dconv.py
py
1,200
python
en
code
0
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.fliplr", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.flipud", "line_number":...
71008846133
# coding=UTF-8 from telegram.ext import Updater, CommandHandler, MessageHandler, Filters from config import App import logging, telegram, datetime, collections #Enable logging logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level = logging.INFO) log = logging.getLogger(__nam...
cakism/slaskibot
slasktratt_bot.py
slasktratt_bot.py
py
6,339
python
en
code
0
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.Ord...
20093948004
from django.urls import path from scrapycmd import views urlpatterns = [ path('runSpider/<int:spider_id>', views.RunSpider.as_view()), path('runGroup/<int:group_id>', views.RunGroupSpiders.as_view()), path('stopSpider/<int:spider_id>', views.CancelSpider.as_view()), path('stopGroup/<int:group_id>', v...
ToonoW/SpiderManager
scrapycmd/urls.py
urls.py
py
470
python
en
code
28
github-code
21
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "scrapycmd.views.RunSpider.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "scrapycmd.views.RunSpider", "line_number": 7, "usage_type": "attribute" }, { "ap...
36221625114
############################################################ #Project : DACEE LIFE TEST PLOTTING # #Version : # #Name : soms_plots.py # #Author : t_randhawa # #Date : 02/13/2019 # #Purpose : Generates current and pwm from life test # .csv files. # # #Rev History : # # #TODO...
kaku3687/my_stuff
soms_plots.py
soms_plots.py
py
4,414
python
en
code
0
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 46, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 57, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 58, "usage_type": "call" }, { "api_name": "pandas.DataFrame",...
1615092532
from pyramid.renderers import render_to_response from pyramid.view import view_config import zipfile from datetime import datetime import csv from io import BytesIO, StringIO import base64 @view_config(route_name='csv_export', request_method='GET', renderer='views/export_csv.mako') def export_csv(request): return...
JonnoFTW/htm-models-adelaide
htm-site/htmsite/export_csv.py
export_csv.py
py
2,266
python
en
code
12
github-code
21
[ { "api_name": "pyramid.view.view_config", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 22, "usage_type": "name" }, { "api_name": ...
6859618758
import numpy as np from glob import glob import os import matplotlib.pyplot as plt import torch from torch.utils.data import DataLoader from torch.autograd import Variable from utils import CustomTensorDataset, cuda, load_checkpoint from model import BetaVAE_H ckpt_dir = '/l/vision/joltik_hdd/mhaghir/VAE-models_who...
mhaqir/Beta-VAE_GAN
inf_VAE.py
inf_VAE.py
py
3,566
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 28, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 28, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 28, "usage_type": "name" }, { ...
20043755382
# Application Project 1 # Code created by Yuzhe Lu import numpy as np import matplotlib.pyplot as plt import scipy as spi from scipy import integrate import cmath as math def simpson(f, a, b, N): if N % 2 == 1: raise ValueError("N must be an even integer") dx = (b-a)/N x = np.linspace(a, b, N + ...
yuzhelu/Calc2ApplicationProject1
venv/Project1.py
Project1.py
py
2,584
python
en
code
0
github-code
21
[ { "api_name": "numpy.linspace", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number"...
3744566386
from flask import Flask, render_template, request, jsonify from werkzeug.utils import secure_filename from LRClass import LRClass import os,json,re, math UPLOAD_FOLDER = 'data' ALLOWED_EXTENSIONS = set(['csv','xlsx']) app = Flask(__name__) app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER def allowed_file(filename): # a...
fadlytanjung/prediction_with_linear_regression
app.py
app.py
py
2,438
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.request.files", "line_number": 26, "usage_type": "attribute" }, { "api_name": "flask.reque...
41413664050
#!/usr/bin/python3 import requests, json, datetime, time, traceback from influxdb import InfluxDBClient import config as cfg client = InfluxDBClient(host='localhost', port=8086) def update_value(name, lite): miner_db = 'minerhash_lite' if lite else 'minerhash' client.switch_database('cryptovalues') price = list(cl...
Techjar/grafanascripts
profitestimate.py
profitestimate.py
py
1,774
python
en
code
1
github-code
21
[ { "api_name": "influxdb.InfluxDBClient", "line_number": 6, "usage_type": "call" }, { "api_name": "config.profitestimate_use_average", "line_number": 18, "usage_type": "attribute" }, { "api_name": "traceback.print_exc", "line_number": 29, "usage_type": "call" }, { ...
7980789320
from datetime import datetime, timedelta from pprint import pprint import requests def next_search_date(start): in_a_week = start.date() + timedelta(days=7) return in_a_week def url_for_date(search_date): url = "https://playtomic.io/api/v1/availability?user_id=me&tenant_id=da776daf-43b3-11e8-8674-5254004...
sentyaev/paddle-catcher
catcher.py
catcher.py
py
2,871
python
en
code
1
github-code
21
[ { "api_name": "datetime.timedelta", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 75, "usage_type": "call" }, { "api_name": "datetime.datetim...
9213059319
from django.shortcuts import render from .models import Student,Teacher from django.db import connection from django.db.models import Q # Create your views here. def student_list(request): posts = Student.objects.all() print(posts) print(posts.query) print(connection.queries) return render(request,"...
Pythonkrishna/test
ORM/views.py
views.py
py
1,187
python
en
code
0
github-code
21
[ { "api_name": "models.Student.objects.all", "line_number": 7, "usage_type": "call" }, { "api_name": "models.Student.objects", "line_number": 7, "usage_type": "attribute" }, { "api_name": "models.Student", "line_number": 7, "usage_type": "name" }, { "api_name": "dj...
10512006690
import datetime from unittest.mock import patch import pytest @pytest.fixture() def expires(): """Mocks/freezes utcnow() in craft_store.endpoints module. Provides a function for creating expected iso formatted expires datetime values. """ now = datetime.datetime.utcnow() def offset_iso_dt(s...
canonical/craft-store
tests/unit/conftest.py
conftest.py
py
908
python
en
code
2
github-code
21
[ { "api_name": "datetime.datetime.utcnow", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 17, "usage_type": "call" }, { "api_name": "un...
74504214771
from nevow import rend, loaders, tags from twisted.application import service, internet, strports from twisted.web import server, static from twisted.python import failure from nevow import inevow, rend, appserver, static, guard, url, loaders, stan from nevow.taglibrary import tabbedPane import Tree, Settings, formal,...
belasin/tums
tums/trunk/etch-release/Pages/Log.py
Log.py
py
7,182
python
en
code
0
github-code
21
[ { "api_name": "Pages.Reports.Page", "line_number": 30, "usage_type": "attribute" }, { "api_name": "Pages.Reports", "line_number": 30, "usage_type": "name" }, { "api_name": "Pages.Reports.Page.__init__", "line_number": 34, "usage_type": "call" }, { "api_name": "Pag...
22940038033
''' @File: addCategoryTaskListApi.py @time:2021/9/15 @Author:quanliu 181324 @Desc:任务中心-分类监控-新增分类接口服务类 ''' from apps.AllSystemData.DasSystem.das_api.dasSystem_interface_url import DasApiUrl from apps.Common_Config.operate_api_data import api_assemble_new from apps.Common_Config.parseRequestDatas import parseRequestDatas...
lhh5036/interface
apps/AllSystemData/DasSystem/das_api/task_center/addCategoryTaskListApi.py
addCategoryTaskListApi.py
py
2,445
python
en
code
0
github-code
21
[ { "api_name": "flask.current_app.logger.info", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.current_app.logger", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.current_app", "line_number": 17, "usage_type": "name" }, { "api...
38460420746
"""Test Puppet Class Parameter related Upgrade Scenario's :Requirement: Upgraded Satellite :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: API :TestType: Functional :CaseImportance: High :Upstream: No """ import json from nailgun import entities from robottelo.api.utils import delete_puppet_cl...
sghai/robottelo
tests/upgrades/test_classparameter.py
test_classparameter.py
py
6,559
python
en
code
null
github-code
21
[ { "api_name": "robottelo.test.APITestCase", "line_number": 69, "usage_type": "name" }, { "api_name": "nailgun.entities.Organization", "line_number": 94, "usage_type": "call" }, { "api_name": "nailgun.entities", "line_number": 94, "usage_type": "name" }, { "api_nam...
33721867381
import json import datetime def duration(): with open('acdc.json') as f: file_dict = json.load(f) seconds = 0 for track in file_dict['album']['tracks']['track']: seconds += int(track['duration']) return datetime.timedelta(seconds=seconds) print(duration())
ZemiosLemon/HillelPython
homework_06/task_4.py
task_4.py
py
309
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 11, "usage_type": "call" } ]
28326165857
from paths import * from util import * import ast import json import shutil import traceback import os import pandas as pd from sklearn.model_selection import train_test_split from statistics import mean,median from tree_sitter import Language, Parser import pickle from nltk import ngrams import codecs fopRQ1=fopRepF...
pdhung3012/ASTTrans
src/run_rq1.py
run_rq1.py
py
5,948
python
en
code
0
github-code
21
[ { "api_name": "pickle.load", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 52, "usage_type": "call" }, { "api_name": "os.path", "line_number": 52, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_numbe...
8059283523
import argparse import json import logging import os import traceback import requests from sqlalchemy.exc import OperationalError from htmengine.repository.queries import MetricStatus from nta.utils import error_reporting from nta.utils.config import Config from taurus_monitoring import logging_support from taurus_m...
bopopescu/numenta-apps-archived-htm.it-grokcli-htmitmobile
taurus_monitoring/taurus_monitoring/models_monitor/taurus_models_monitor.py
taurus_models_monitor.py
py
9,694
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 30, "usage_type": "call" }, { "api_name": "taurus_monitoring.taurus_monitor_utils.containsErrorFlag", "line_number": 53, "usage_type": "call" }, { "api_name": "taurus_monitoring.monitorsdb.schema.modelsMonitorErrorFlags", "lin...
8123469436
import os, copy, time, argparse, platform, pickle parser = argparse.ArgumentParser(description='Process some parameters.') # model param parser.add_argument('--subtype_num', type=int, default=3) parser.add_argument('--hdim', type=int, default=3) parser.add_argument('--encoder_hdim', type=int, default=20) parser.add_ar...
PHOENIXcenter/SRPS
scripts_py/train_models.py
train_models.py
py
34,479
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 3, "usage_type": "call" }, { "api_name": "platform.system", "line_number": 66, "usage_type": "call" }, { "api_name": "para_space.get_paras", "line_number": 76, "usage_type": "call" }, { "api_name": "matplotli...
40586064126
# @author: Sanjay Ram RR # --------------------- import os import re import sys import random import requests import webcolors from bs4 import BeautifulSoup from PyQt6.QtCore import Qt, QPoint, QUrl from PyQt6.QtGui import QImage, QPainter, QColor, QFont, QPixmap from PyQt6.QtWidgets import QApplication, Q...
rrsr28/geometric-images
main.py
main.py
py
8,607
python
en
code
0
github-code
21
[ { "api_name": "PyQt6.QtWidgets.QLabel", "line_number": 19, "usage_type": "name" }, { "api_name": "PyQt6.QtCore.QPoint", "line_number": 24, "usage_type": "call" }, { "api_name": "PyQt6.QtGui.QPainter", "line_number": 32, "usage_type": "call" }, { "api_name": "PyQt6...
40250386917
import sys, threading from collections import defaultdict from functools import lru_cache s = input() t = input() def main(): n, m = len(s), len(t) memo = defaultdict(lambda:-1) def dp(i, j): if (i, j) in memo: return memo[i,j] if i == n: memo[i,j] = m - j return mem...
Naboni/Competitive-Programming
C_Changing_a_String.py
C_Changing_a_String.py
py
1,404
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" }, { "api_name": "threading.stack_size", "line_number": 48, "usage_type": "call" }, { "api_name": "sys.setrecursionlimit", "line_number": 49, "usage_type": "call" }, { "api_name": "thr...
26948907373
import PySimpleGUI as sg import merge_functions import Source_code TEXT_OUTLINE_SIZE = 11 INITAL_BROWSE_FOLDER = 'C:/Users/Public' MERGING_STYLES_LIST = merge_functions.MERGING_STYLES_LIST HELP_TEXT = """Explanation of the different Merging Styles: Sequence: Merging 2 files 'Leading File...
Wowpro7/Python_Merging_pdf
Merge_pdfs_3/GUI_Main.py
GUI_Main.py
py
11,472
python
en
code
0
github-code
21
[ { "api_name": "merge_functions.MERGING_STYLES_LIST", "line_number": 8, "usage_type": "attribute" }, { "api_name": "PySimpleGUI.theme", "line_number": 60, "usage_type": "call" }, { "api_name": "PySimpleGUI.MenuBar", "line_number": 62, "usage_type": "call" }, { "api...
40495658604
# 조건문 # 주어진 상황에 따라 적절한 명령문을 수행하는 문장 # 프로그래밍에서 조건을 판단하여 해당 조건에 맞는 상황을 수행하는데 사용. # 조건문 작성시 반드시 들어쓰기에 따라 문장을 작성돠게되다. #if 조건문: # 수행할문장 #ex1) 총점이 90점보다 크면 '우수'라고 출력 total =85 if total >90: print('우수') age=19 if(age >18 and age <=20): print('성년을 축하한다') print('-=만 나이 계산 프로그램 =-') print('이...
2214ksj/py3
03If.py
03If.py
py
948
python
ko
code
0
github-code
21
[ { "api_name": "datetime.datetime.today", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 28, "usage_type": "name" }, { "api_name": "datetime.datetime.today", "line_number": 29, "usage_type": "call" }, { "api_name": "dat...
37926035925
import asyncio from chiasim.hashable import Body, CoinName, Header, HeaderHash, Unspent from chiasim.remote.client import request_response_proxy, xform_dict REMOTE_SIGNATURES = dict( get_tip=xform_dict(genesis_hash=HeaderHash.from_bytes, tip_hash=HeaderHash.from_bytes), next_block=xform_dict(header=Header.fr...
Chia-Network/ledger_sim
chiasim/clients/ledger_sim.py
ledger_sim.py
py
710
python
en
code
3
github-code
21
[ { "api_name": "chiasim.remote.client.xform_dict", "line_number": 8, "usage_type": "call" }, { "api_name": "chiasim.hashable.HeaderHash.from_bytes", "line_number": 8, "usage_type": "attribute" }, { "api_name": "chiasim.hashable.HeaderHash", "line_number": 8, "usage_type": ...
27267459686
# -*- coding: utf-8 -*- # tsdb.py import datetime import traceback from influxdb.influxdb08 import client as influxdb __db = influxdb.InfluxDBClient('125.7.128.54', 8086, 'dsuser', 'dsuser', 'doosan') def db(): return __db def date_time_to_influx_query_param(tm): return (tm - datetime.timedelta(hours=9))...
jeonghoonkang/doosan
search/dashboard/tsdb.py
tsdb.py
py
1,813
python
en
code
2
github-code
21
[ { "api_name": "influxdb.influxdb08.client.InfluxDBClient", "line_number": 9, "usage_type": "call" }, { "api_name": "influxdb.influxdb08.client", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 17, "usage_type": "call" }, { ...
24060713460
# ----------------------------------------- # My Solution # # Time Complexity: O(n) # Space Complexity: O(n) # ----------------------------------------- from collections import defaultdict class Solution: def longestConsecutive(self, nums): consecutive_dict = defaultdict(list) # { num: [start, end] }, whi...
DaMinaup6/algorithm-exercises
leetcode/hard/128_longest_consecutive_sequence.py
128_longest_consecutive_sequence.py
py
2,314
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 11, "usage_type": "call" } ]
14855756827
import torch import torch.nn as nn from Config import Config class ConvBlock(nn.Module): def __init__(self, input_dim, output_dim): super().__init__() self.block = nn.Sequential( nn.Conv2d(input_dim, output_dim, 3, 1, 1), nn.BatchNorm2d(output_dim), nn.ReLU(), ...
Chieh-Hung-Cheng/MLhw3_ImageClassification
ImageConvNet.py
ImageConvNet.py
py
1,529
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
34462730873
import os import sys # Añadir una descripción general de lo que hace este bloque de código. sys.path.insert(0, os.path.abspath('/home/ubuntu/Escritorio/IS2_STAGING/proyecto_CMS')) os.environ['DJANGO_SETTINGS_MODULE'] = 'core.settings' # Reemplaza 'core.settings' con la ubicación real de tu archivo settings si es dife...
aravalenzuela/proyecto_CMS
docs/source/conf.py
conf.py
py
2,110
python
es
code
0
github-code
21
[ { "api_name": "sys.path.insert", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number...
4112870519
from itertools import product from util import get_filename def get_neighbors(pos): factors = [[dim-1, dim, dim+1] for dim in pos] neighbors = set(product(*factors)) neighbors.remove(pos) return neighbors def solve(active, rounds): for i in range(rounds): new = set() for state ...
cescara/aoc20
day17.py
day17.py
py
1,152
python
en
code
1
github-code
21
[ { "api_name": "itertools.product", "line_number": 8, "usage_type": "call" }, { "api_name": "util.get_filename", "line_number": 30, "usage_type": "call" } ]
73728195573
"""Handler for jobs endpoint.""" import json import tornado.concurrent import tornado.gen import tornado.web from ndscheduler.corescheduler import constants from ndscheduler.corescheduler import utils from ndscheduler.server.handlers import base class Handler(base.BaseHandler): def _get_jobs(self): ""...
Nextdoor/ndscheduler
ndscheduler/server/handlers/jobs.py
jobs.py
py
10,200
python
en
code
1,071
github-code
21
[ { "api_name": "ndscheduler.server.handlers.base.BaseHandler", "line_number": 14, "usage_type": "attribute" }, { "api_name": "ndscheduler.server.handlers.base", "line_number": 14, "usage_type": "name" }, { "api_name": "ndscheduler.corescheduler.utils.get_job_name", "line_numbe...