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
35347314615
# -*- coding: utf-8 -*- from flask import g,render_template import datetime ''' 自定义分页类 ''' def iPagination( params ): import math ret = { "is_prev":1, "is_next":1, "from" :0 , "end":0, "current":0, "total_pages":0, "page_size" : 0, "total" : 0, ...
mooc-class/python-flask-minapp
完整源码/common/libs/Helper.py
Helper.py
py
2,978
python
en
code
20
github-code
7
[ { "api_name": "math.ceil", "line_number": 26, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 34, "usage_type": "call" }, { "api_name": "flask.g", "line_number": 57, "usage_type": "name" }, { "api_name": "flask.g.current_user", "line_number":...
15802697287
""" Filename: text_extraction.py Purpose: This file implements the text extraction process of the pipeline. Functionality: This file provides functions for text extraction, including tasks like reading input files, preprocessing text, applying extraction techniques, and generating ex...
ghazio/OTC_SEC
Text_extraction/Securities_utils.py
Securities_utils.py
py
13,281
python
en
code
0
github-code
7
[ { "api_name": "regex.search", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 62, "usage_type": "attribute" }, { "api_name": "regex.search", "line_number": 64, "usage_type": "call" }, { "api_name": "regex.sub", "line_number...
12009837789
import matplotlib.pyplot as plt from random import randint import pickle import gym import numpy as np import argparse import wimblepong from agent import Agent parser = argparse.ArgumentParser() parser.add_argument("--headless", action="store_true", help="Run in headless mode") parser.add_argument("--housekeeping", ...
oskarij/rlproject
train_pong.py
train_pong.py
py
3,761
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "gym.make", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.py...
18357180466
# -*- coding: utf-8 -*- """ @author: Yifan Cheng, Skylar Du, Yashash Gaurav, Mark He """ import pandas as pd import helpers as h import numpy as np us_state_to_abbrev = { "Alabama": "AL", "Alaska": "AK", "Arizona": "AZ", "Arkansas": "AR", "California": "CA", "Colorado": "CO", "Connecticut"...
junhuih/DFP-Project
average_stats.py
average_stats.py
py
7,810
python
en
code
0
github-code
7
[ { "api_name": "helpers.read_final_data", "line_number": 75, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 98, "usage_type": "call" }, { "api_name": "numpy.round", "line_number": 103, "usage_type": "call" }, { "api_name": "numpy.round", ...
11386995191
from ...util import config import logging def logLoopProgress(count: int, last_check: int, N: int, name: str) -> int: """Function to log the progress of loops through the a of size N. Arguments: count {int} -- Current iteration count. last_check {int} -- Last time log...
rukmal/PaperRank
PaperRank/compute/util/helpers.py
helpers.py
py
1,319
python
en
code
0
github-code
7
[ { "api_name": "util.config.compute", "line_number": 21, "usage_type": "attribute" }, { "api_name": "util.config", "line_number": 21, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 35, "usage_type": "call" } ]
1103197729
from django.core.checks import messages from django.http import HttpResponseRedirect from django.shortcuts import render # Create your views here. from django.template import loader from home.models import Setting, ContactFormMessage, ContactFormu from product.models import Product def index(request): setting = ...
sevgiyilmaz/ecommerce_website
home/views.py
views.py
py
1,934
python
en
code
1
github-code
7
[ { "api_name": "home.models.Setting.objects.get", "line_number": 14, "usage_type": "call" }, { "api_name": "home.models.Setting.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "home.models.Setting", "line_number": 14, "usage_type": "name" }, { ...
37619390983
# -*- coding:utf-8 -*- """ File Name: visual.py Description : 可视化 Author : royce.mao date: 2020/3/2 16:20 """ import cv2 import json import numpy as np from PIL import Image, ImageDraw, ImageFont # CTPN定位之后的数字串小图 class DigitPic(object): def __init__(self, ): super(DigitPi...
RoyceMao/CRNN_ATTN_CTC
utils/visual.py
visual.py
py
3,667
python
en
code
1
github-code
7
[ { "api_name": "numpy.pad", "line_number": 29, "usage_type": "call" }, { "api_name": "cv2.getTextSize", "line_number": 41, "usage_type": "call" }, { "api_name": "cv2.FONT_HERSHEY_SIMPLEX", "line_number": 42, "usage_type": "attribute" }, { "api_name": "cv2.putText",...
357868669
"""library_system URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.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') Clas...
Sumitsdalvi/library_system
library_system/urls.py
urls.py
py
1,418
python
en
code
0
github-code
7
[ { "api_name": "django.urls.path", "line_number": 21, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 21, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 21, "usage_type": "name" }, { "api_name": "...
37954145251
import logging logger = logging.getLogger('server_logger') class ListenPort: def __set__(self, instance, value): if value < 1024 or value > 65535: logger.critical('Попытка запуска сервера с неверным номером порта. ' 'Номер порта должен быть из диапазона [1024;65535]...
AndreyYablokov/CourseNetApp
project/descriptors.py
descriptors.py
py
528
python
ru
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 2, "usage_type": "call" } ]
31723779712
import os import queue from multiprocessing import Process, cpu_count def search(paths, query_q, result_q): lines = [] for path in paths: lines.extend(l.strip() for l in open(path)) query = query_q.get() while query: result_q.put_([l for l in lines if query in l]) print(result_...
stoneyangxu/python-kata
oop/queue_search.py
queue_search.py
py
1,094
python
en
code
0
github-code
7
[ { "api_name": "multiprocessing.cpu_count", "line_number": 18, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "li...
1088085254
""" This module takes care of starting the API Server, Loading the DB and Adding the endpoints """ from flask import Flask, request, jsonify, url_for, Blueprint from api.models import db, User, Character, Favorite from api.utils import generate_sitemap, APIException api = Blueprint('api', __name__) ###################...
ChuchoAraujo/practicabd
src/api/routes.py
routes.py
py
2,937
python
en
code
0
github-code
7
[ { "api_name": "api.models", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "api.models.User.query.all", "line_number": 14, "usage_type": "call" }, { "api_name": "api.models.User.qu...
2630248855
# Data-guided multi-granularity selector for attribute reduction # Jiang Z, Dou H, Song J, et al. Data-guided multi-granularity selector for attribute reduction[J]. Applied Intelligence, 2021, 51: 876-888. import math import time import numpy as np from sklearn.preprocessing import MinMaxScaler from scipy.spatial.dist...
xiaochou866/PaperCode
Algorithm/compareAlgorithm6.py
compareAlgorithm6.py
py
6,967
python
en
code
0
github-code
7
[ { "api_name": "numpy.ndarray", "line_number": 13, "usage_type": "attribute" }, { "api_name": "scipy.spatial.distance.squareform", "line_number": 19, "usage_type": "call" }, { "api_name": "scipy.spatial.distance.pdist", "line_number": 19, "usage_type": "call" }, { ...
36689024810
from configuration import listOfCountries from configuration import listOfColors from configuration import randomDataMax from configuration import randomDataMin import pandas as pd import matplotlib.pyplot as plt import random import numpy as np from matplotlib import cm from matplotlib.colors import ListedColormap, Li...
HiszpanInk/RandomChartGenerator
main.py
main.py
py
8,899
python
en
code
0
github-code
7
[ { "api_name": "random.randint", "line_number": 34, "usage_type": "call" }, { "api_name": "configuration.listOfCountries", "line_number": 34, "usage_type": "argument" }, { "api_name": "configuration.listOfCountries", "line_number": 35, "usage_type": "name" }, { "ap...
24517770198
from Mordicus.Core.Containers import ProblemData as PD from Mordicus.Core.Containers import CollectionProblemData as CPD from Mordicus.Core.Containers import Solution as S from Mordicus.Core.DataCompressors import SnapshotPOD as SP from Mordicus.Modules.Scilab_ESI_Group import SciSolutionReader as SSR from sklearn.gaus...
feelpp/mordicus
src/poc-1/examples/Modules/Scilab_ESI_Group/OpenFOAMairfoil2D/AirfoilOffline.py
AirfoilOffline.py
py
4,311
python
en
code
0
github-code
7
[ { "api_name": "os.getcwd", "line_number": 15, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 17, "usage_type": "call" }, { "api_name": "Mordicus.Modules.Scilab_ESI_Group.Sci...
11809811990
# здесь контроллеры/хендлеры/представления для обработки запросов (flask ручки). сюда импортируются сервисы из пакета service from flask import request # Пример from flask_restx import Resource, Namespace from models import Movie, movies_schema, movie_schema from setup_db import db movie_ns = Namespace('movies') @mo...
AnitaKrav/Lesson_18_easy_Kravchenko
views/movies.py
movies.py
py
1,814
python
en
code
0
github-code
7
[ { "api_name": "flask_restx.Namespace", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_restx.Resource", "line_number": 12, "usage_type": "name" }, { "api_name": "setup_db.db.session.query", "line_number": 14, "usage_type": "call" }, { "api_name": "m...
35357886468
import tensorflow as tf from tfac.queue_input import QueueInput from tensorflow.examples.tutorials.mnist import input_data from functools import partial import time from tfac.ops_runner import OpRunner class ModeKeys(object): """Standard names for model modes. The following standard keys are defined: ...
Seraphli/tfac
example/mlp.py
mlp.py
py
5,167
python
en
code
0
github-code
7
[ { "api_name": "tensorflow.layers.dense", "line_number": 26, "usage_type": "call" }, { "api_name": "tensorflow.layers", "line_number": 26, "usage_type": "attribute" }, { "api_name": "tensorflow.nn", "line_number": 27, "usage_type": "attribute" }, { "api_name": "ten...
27785455671
import platform from pathlib import Path import shutil from pbpy import pblog, pbtools, pbunreal def publish_build(branch_type, butler_exec_path, publish_stagedir, butler_project, butler_manifest): # Test if our configuration values exist if not butler_project or not butler_manifest: pblog.error("bu...
ProjectBorealis/PBSync
pbpy/pbbutler.py
pbbutler.py
py
1,058
python
en
code
67
github-code
7
[ { "api_name": "pbpy.pblog.error", "line_number": 12, "usage_type": "call" }, { "api_name": "pbpy.pblog", "line_number": 12, "usage_type": "name" }, { "api_name": "platform.system", "line_number": 18, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_...
37808694261
from .task import LatexTask, TaskResult from .gtk import GObject from .types import TemplateName from .notify import Notify from ..abstraction import Letter, Design from ..latex.workspace import Workspace from ..latex.preamblecache import PreambleCache from typing import Optional, Tuple from warnings import warn from t...
mjziebarth/Hurtigbrief
hurtigbrief/gui/manager.py
manager.py
py
3,342
python
en
code
0
github-code
7
[ { "api_name": "threading.Thread", "line_number": 14, "usage_type": "name" }, { "api_name": "queue.Queue", "line_number": 18, "usage_type": "name" }, { "api_name": "latex.workspace.Workspace", "line_number": 19, "usage_type": "name" }, { "api_name": "latex.preamble...
22516127748
import graphene from graphene_django import DjangoObjectType from django.db.models import Q from graphene import relay, ObjectType from graphene_django.filter import DjangoFilterConnectionField from notes.models import Note, UserPreferences, UserInfo, User class NoteType(DjangoObjectType): class Meta: mod...
LenSunko01/PythonBackendCourse
project/project/schema.py
schema.py
py
1,719
python
en
code
1
github-code
7
[ { "api_name": "graphene_django.DjangoObjectType", "line_number": 9, "usage_type": "name" }, { "api_name": "notes.models.Note", "line_number": 11, "usage_type": "name" }, { "api_name": "graphene.relay.Node", "line_number": 14, "usage_type": "attribute" }, { "api_na...
15423079105
import sklearn.datasets as datasets import matplotlib.pyplot as plt import numpy as np from timeit import default_timer as timer from datetime import timedelta from sklearn import preprocessing from force.force_scheme import ForceScheme def main(): raw = datasets.load_iris(as_frame=True) X = raw.data.to_nump...
fpaulovich/dimensionality-reduction
force/force_scheme_main.py
force_scheme_main.py
py
821
python
en
code
2
github-code
7
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 12, "usage_type": "name" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 14, "usage_type": "call" }, { "...
20296479630
from flask import Flask, render_template app = Flask(__name__) COMMUNITIES =[ { 'id': 1, 'No. of Members': '40', 'title': 'Virtual Code Club', 'location': 'Bhopal' }, { 'id': 2, 'No. of Members': '50', 'title': 'Anime Club', 'location': 'Delhi' }, { 'id': 3, 'No. of Mem...
aditi755/Community-Bridge
app.py
app.py
py
647
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 28, "usage_type": "call" } ]
36677498102
"""Blender script to composite shots built with render_manager To test: "C:\Program Files\Blender Foundation\Blender 3.0\blender" -b "D:\Assets\Models\Mine\compositor recipes\defaullt_compositor_chain.blend" --python compositor_script.py -- "D:\Projects\Sitting Duck\Blender\blender_shot_list.json" film 1 1 .png """...
rolandjkay/video_production_scripts
blender_render_manager/compositor_script.py
compositor_script.py
py
11,214
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "li...
36099054099
from django.urls import path from . import views urlpatterns = [ path("api/get_messages", views.GetMessages.as_view() , name="get_messages"), path("api/add_new_message", views.AddNewMessage.as_view() , name="add_new_message"), path("chat", views.index, name="index"), path("chat/<str:room_name>", views...
tanujsonare/social-media
social_media_backend/chat/urls.py
urls.py
py
342
python
en
code
2
github-code
7
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
26906051730
from pickle import MARK import matplotlib.pyplot as plt from matplotlib.ticker import (MultipleLocator, FormatStrFormatter,AutoMinorLocator) import pandas as pd import numpy as np import math import os import shutil from PIL import Image import ipywidgets as widgets from IPython.display import display import nafuma....
rasmusthog/nafuma
nafuma/electrochemistry/plot.py
plot.py
py
22,515
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 47, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 47, "usage_type": "name" }, { "api_name": "nafuma.auxillary.update_options", "line_number": 51, "usage_type": "call" }, { ...
72223556703
from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize import os root = os.path.abspath(os.path.join(__file__, '..', '..', '..')) setup(ext_modules=cythonize(Extension( './target/client', sources=['client.pyx', 'InstrumnetGainer/InstrumnetGainer.cpp', 'C...
algo2019/algorithm
AlgorithmEngine/MarketDataServer/CTPClient/setup.py
setup.py
py
667
python
en
code
0
github-code
7
[ { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "distutils.core.setup", "li...
14415652650
"""API for fitbit bound to Home Assistant OAuth.""" import logging from typing import Any from fitbit import Fitbit from homeassistant.core import HomeAssistant from .model import FitbitDevice, FitbitProfile _LOGGER = logging.getLogger(__name__) class FitbitApi: """Fitbit client library wrapper base class.""...
peaqnetwork/core
homeassistant/components/fitbit/api.py
api.py
py
2,141
python
en
code
null
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "homeassistant.core.HomeAssistant", "line_number": 20, "usage_type": "name" }, { "api_name": "fitbit.Fitbit", "line_number": 21, "usage_type": "name" }, { "api_name": "mode...
13031402800
# -*- coding: utf-8 -*- """ Code to compile Tulsa football hit data into a DataFrame """ from __future__ import print_function, division import pandas as pd import numpy as np import toolz import copy #------------# # FUNCTIONS # #------------# @toolz.curry def during_practice(practice, hit_date): ...
smhilde/ut_hits
compile_data.py
compile_data.py
py
14,743
python
en
code
0
github-code
7
[ { "api_name": "numpy.logical_and", "line_number": 29, "usage_type": "call" }, { "api_name": "toolz.curry", "line_number": 14, "usage_type": "attribute" }, { "api_name": "toolz.curry", "line_number": 31, "usage_type": "attribute" }, { "api_name": "toolz.curry", ...
72721430302
__author__ = 'Justin Finkle' __email__ = 'jfinkle@u.northwestern.edu' import sys import os import pandas as pd from matplotlib.backends.backend_pdf import PdfPages import numpy as np import networkx as nx from collections import deque from Swing.util.Evaluator import Evaluator from Swing.util.lag_identification import...
jiawu/Roller
scripts/figure3/gardner_edge_promotion.py
gardner_edge_promotion.py
py
11,272
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.rcParams", "line_number": 22, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 23, "usage_type": "attribute" }, { "api_name": "pandas.read_pickle", "line_number": 26, "usage_type": "call" }, { "api_name": "...
8151947297
from scripts.entity import Entity from scripts.support import * import pygame import random # ENTITY THAT PLAYER CAPTURES class Pokemon(Entity): def __init__(self, pos, groups, barrier_group, visible_group, grass_group,death_group,pokemon_sprites,pokemon_on_level,pokemon,player,animations): super().__init...
bvolesky/Pokemon-Catch
scripts/pokemon.py
pokemon.py
py
4,408
python
en
code
0
github-code
7
[ { "api_name": "scripts.entity.Entity", "line_number": 8, "usage_type": "name" }, { "api_name": "pygame.time.get_ticks", "line_number": 39, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 39, "usage_type": "attribute" }, { "api_name": "pygame.ti...
15638774124
from aiogram import Dispatcher, types from aiogram.types import CallbackQuery, ReplyKeyboardRemove from aiogram.dispatcher import FSMContext from aiogram.dispatcher.filters.state import State, StatesGroup from bot.keyboards import KB_GET_PHONE_NUMBER, KB_CHANGE_QUESTIONNAIRE_MENU from bot.utils.main import delete_old_...
Tommy4chan/DatingBot
bot/handlers/user/questionnaire_menu_handler.py
questionnaire_menu_handler.py
py
5,183
python
en
code
0
github-code
7
[ { "api_name": "aiogram.dispatcher.filters.state.StatesGroup", "line_number": 16, "usage_type": "name" }, { "api_name": "aiogram.dispatcher.filters.state.State", "line_number": 17, "usage_type": "call" }, { "api_name": "aiogram.dispatcher.filters.state.StatesGroup", "line_numb...
43152839349
# -*- coding: utf-8 -*- __all__ = ('TheTVDB', 'TheTVDBSerie') import os import urllib from xml.etree import cElementTree class TheTVDB(object): """Class to manipulate the online TVDB Database.""" API_KEY = 'F034441142EF8F93' URL_API = 'http://thetvdb.com/api/' URL_BANNER = 'http://thetvdb.com/banne...
lightcode/SeriesWatcher
serieswatcher/serieswatcher/thetvdb.py
thetvdb.py
py
4,312
python
en
code
0
github-code
7
[ { "api_name": "urllib.urlopen", "line_number": 25, "usage_type": "call" }, { "api_name": "xml.etree.cElementTree.parse", "line_number": 26, "usage_type": "call" }, { "api_name": "xml.etree.cElementTree", "line_number": 26, "usage_type": "name" }, { "api_name": "ur...
25983061466
def start() : import pchain import libstarpy SrvGroup = libstarpy._GetSrvGroup(0) Service = SrvGroup._GetService("","") query = SrvGroup._NewQueryRecord() hostobj = Service.PCRealmBase._FirstInst(query) Service.PCRealmBase._QueryClose(query) if hostobj == None : print('PCRealmBase instance is not...
srplab/pchain
pchain/debug.py
debug.py
py
3,014
python
en
code
1
github-code
7
[ { "api_name": "libstarpy._GetSrvGroup", "line_number": 4, "usage_type": "call" }, { "api_name": "libstarpy._SRPUnLock", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 19, "usage_type": "call" }, { "api_name": "libstarpy._SRP...
70275029022
import boto3 # Get the service resource. dynamodb = boto3.resource('dynamodb', region_name = 'us-west-2') # Create the DynamoDB table. table = dynamodb.create_table( TableName='Games1', KeySchema=[ { 'AttributeName': 'gname', 'KeyType': 'HASH' }, { ...
Prashanth0797/AWS_assignment1
Q9/Q9.py
Q9.py
py
1,195
python
en
code
0
github-code
7
[ { "api_name": "boto3.resource", "line_number": 4, "usage_type": "call" } ]
4099914160
import face_recognition as fr from engine import reconhece_rosto, getRostos def register_face(matricula): while(True): desconhecido = reconhece_rosto(f"{matricula}.png") if desconhecido[0]: rosto_desconhecido = desconhecido[1][0] rostos_conhecidos, nome_rostos = getRostos(...
SrLucca/facial-recognition
picture.py
picture.py
py
674
python
pt
code
0
github-code
7
[ { "api_name": "engine.reconhece_rosto", "line_number": 7, "usage_type": "call" }, { "api_name": "engine.getRostos", "line_number": 11, "usage_type": "call" }, { "api_name": "face_recognition.compare_faces", "line_number": 12, "usage_type": "call" } ]
22654323807
import hashlib import os from typing import Any, Dict import cv2 import numpy as np import torch from theseus.base.metrics.metric_template import Metric from theseus.base.utilities.loggers import LoggerObserver from theseus.cv.base.utilities.visualization.visualizer import Visualizer # To fix tensorflow bug on Googl...
kaylode/theseus
theseus/cv/classification/metrics/projection.py
projection.py
py
3,684
python
en
code
30
github-code
7
[ { "api_name": "tensorflow.io", "line_number": 18, "usage_type": "attribute" }, { "api_name": "tensorboard.compat", "line_number": 18, "usage_type": "attribute" }, { "api_name": "theseus.base.metrics.metric_template.Metric", "line_number": 23, "usage_type": "name" }, {...
44983327765
# -*- coding: utf-8 -*- import re import os from redbot.core import commands, bank, checks import sqlite3 class InitDb(object): def __init__(self, db_file): try: postban_dir = os.path.expanduser('~/.postbank') os.mkdir(postban_dir) except FileExistsError: # Do...
BraveLittleRoaster/Roaster-Cogs
postbank/postbank.py
postbank.py
py
13,106
python
en
code
0
github-code
7
[ { "api_name": "os.path.expanduser", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_...
42849130188
"""This function uses BeautifulSoup to retrieve a table from the National Center for Education Statistics with the number of students enrolled in public schools for every state. Since the website (and much of the table format) is the same as the one used for the web_parser1 dataset, much of the code is very similar."...
pquarles/CS2316-FinalProject
Code for Data Collection & Cleaning/web_parser3.py
web_parser3.py
py
1,090
python
en
code
1
github-code
7
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 13, "usage_type": "call" } ]
9837694923
__title__ = "Reinforcement Drawing Configuration" __author__ = "Suraj" __url__ = "https://www.freecadweb.org" from pathlib import Path # stroke-width of structure in drawing svg STRUCTURE_STROKE_WIDTH = 0.5 # Fill style of structure # - set it to "Automatic" to automatically select structure color # - set it to "C...
amrit3701/FreeCAD-Reinforcement
ReinforcementDrawing/config.py
config.py
py
4,944
python
en
code
49
github-code
7
[ { "api_name": "pathlib.Path", "line_number": 43, "usage_type": "call" } ]
18449108526
import dash import dash_html_components as html import dash_core_components as dcc import plotly.graph_objs as go import visdcc import dash_table from dash.dependencies import Input, Output, State from dash_sunburst import Sunburst from datenhaltung import connection as connect from logik import kohortenabfrage as kh f...
Fuenfgeld/HS-Mannheim-I2B2-Projekt-2019-Gruppe2
visualisierung/website.py
website.py
py
21,815
python
en
code
1
github-code
7
[ { "api_name": "logik.tree_dictionary_import_export.treedictionary_aus_pickle_importieren", "line_number": 17, "usage_type": "call" }, { "api_name": "logik.tree_dictionary_import_export", "line_number": 17, "usage_type": "name" }, { "api_name": "logik.querystack.Querystack.getInst...
27291606644
# _*_ coding :utf-8 _*_ __author__ = 'du' __blog__ = 'www.cnblogs.com/anmutu;www.zmfei4.com;' __date__ = '2020/1/6 2:01' from collections import defaultdict from datetime import datetime # 效率最高的其实就是这个记忆搜索法。 total = defaultdict(int) total_memory = defaultdict(int) def fib_recursion(k): assert k > 0, "k的值必须大于0"...
anmutu/arithmetic
msic/fib_recursion_memory.py
fib_recursion_memory.py
py
1,609
python
en
code
1
github-code
7
[ { "api_name": "collections.defaultdict", "line_number": 12, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 41, "usage_type": "call" }, { "api_name": ...
41029754068
import threading import logging import time import random logging.basicConfig(level=logging.INFO, format='[%(levelname)s])] [%(threadName)s] [%(message)s]') class MyCounter: def __init__(self, start=0): self.lock = threading.Lock() self.counter = start def increment(self): logging.in...
sokolovdp/threading
thread-locks.py
thread-locks.py
py
1,860
python
en
code
0
github-code
7
[ { "api_name": "logging.basicConfig", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 6, "usage_type": "attribute" }, { "api_name": "threading.Lock", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.info", ...
72867700382
import torch import sys from vision.nn.mobilenet import MobileNetV1 from extract_tf_weights import read_weights def fill_weights_torch_model(weights, state_dict): for name in state_dict: if name == 'classifier.weight': weight = weights['MobilenetV1/Logits/Conv2d_1c_1x1/weights'] w...
Ascend/ModelZoo-PyTorch
PyTorch/dev/cv/detection/MobileNetV3-SSD_ID0408_for_PyTorch/translate_tf_mobilenetv1.py
translate_tf_mobilenetv1.py
py
3,277
python
en
code
31
github-code
7
[ { "api_name": "torch.tensor", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.float32", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.tensor", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.float32", "lin...
11028660197
import random, math from _functools import reduce from copy import copy, deepcopy from builtins import isinstance from resource import setrlimit, RLIMIT_AS, RLIMIT_DATA import sys from itertools import product from heapq import heappush, heappop from statistics import mean, variance import time class NPuzzle: """...
alexRot622/AI_beamSearch
schelet.py
schelet.py
py
18,485
python
en
code
0
github-code
7
[ { "api_name": "math.sqrt", "line_number": 41, "usage_type": "call" }, { "api_name": "copy.copy", "line_number": 42, "usage_type": "call" }, { "api_name": "copy.copy", "line_number": 43, "usage_type": "call" }, { "api_name": "_functools.reduce", "line_number": ...
44787113785
import pywhatkit import speech_recognition as sr def listen(): listener = sr.Recognizer() try: with sr.Microphone() as source: print("listening...") voice = listener.listen(source) command = listener.recognize_google(voice) command = command...
mrp21117/PERSONAL_AI
codes/take_command.py
take_command.py
py
910
python
en
code
0
github-code
7
[ { "api_name": "speech_recognition.Recognizer", "line_number": 7, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 9, "usage_type": "call" }, { "api_name": "pywhatkit.playonyt", "line_number": 34, "usage_type": "call" } ]
27602737369
from dataclasses import dataclass from typing import Union #jeder spieler sammelt chips bekommt punkte #pro zug bekommt spieler zufälligen chips #punktewert des neuen chips wird zu Punktestand addiert #mehr als 7 punkte nach weißem chip verloren #bei orange passiert nichts #bei rot und einem oder zwei orangenem extra ...
Mxt3usz/python_stuff
Projects/chips.py
chips.py
py
1,512
python
de
code
0
github-code
7
[ { "api_name": "dataclasses.dataclass", "line_number": 11, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 15, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 20, "usage_type": "name" }, { "api_name": "dat...
24507564335
import glob import logging import os from pathlib import Path from tempfile import NamedTemporaryFile import pandas as pd import pendulum from airflow.hooks.base import BaseHook from minio import Minio DATA_DIR = "/data" USE_COLS = ["city_ascii", "lat", "lng", "country", "iso2", "iso3"] BATCH_SIZE = 5000 BATCH_SIZE ...
mrn-aglic/examples
airflow-http-requests-dtm/dags/helpers/shared.py
shared.py
py
3,232
python
en
code
6
github-code
7
[ { "api_name": "pendulum.now", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 37, "usage_type": "call" }, { "api_name": "pathlib.Path.mkdir", "line_number": 56, "usage_type": "call" }, { "api_name": "pathlib.Path", "l...
9113436629
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import Advanced_1.confusionMatrix as cm import pickle from tensorflow.examples.tutorials.mnist import input_data from Advanced_1.dataBatcher import DataBatche...
fotherda/Assignment1
Advanced_1/src/Advanced_1/part2.py
part2.py
py
6,093
python
en
code
0
github-code
7
[ { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 36, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.set_printoptions", "line_number": 41, "usage_type": "call" }, { "api_name": "m...
74065141664
from django.db import models import pprint from django.conf import settings # Create your models here. class Game(models.Model): CATEGORY_PC = 1 CATEGORY_MOBILE = 2 CATEGORY_CONSOLE = 3 CATEGORY_OTHER = 4 GAME_CATEGORY = ( (CATEGORY_PC, 'PC'), (CATEGORY_MOBILE, 'Mobile'), ...
k-ysu/raptor-public
raptor/streamer/models/game.py
game.py
py
1,232
python
en
code
0
github-code
7
[ { "api_name": "django.db.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 20, "usage_type": "call" }, { "api_name": ...
14623183546
from loguru import logger import colorama class Episode: e_id = None num = None air_date = None link = None def __init__(self, e_id, num, air_date, link): logger.debug(f"Creating episode obj (id: {e_id}, num: {num})") self.e_id = e_id self.num = num self.air_date =...
ale-ben/AnimeUnityEngine
common_classes.py
common_classes.py
py
2,088
python
en
code
0
github-code
7
[ { "api_name": "loguru.logger.debug", "line_number": 12, "usage_type": "call" }, { "api_name": "loguru.logger", "line_number": 12, "usage_type": "name" }, { "api_name": "loguru.logger.debug", "line_number": 59, "usage_type": "call" }, { "api_name": "loguru.logger",...
36726709017
from connexion.resolver import Resolver from connexion.operations import AbstractOperation import os, traceback from flask import Flask, Response import connexion, json, logging from stratus.handlers.manager import Handlers from functools import partial from stratus_endpoint.util.config import Config, StratusLogger fro...
nasa-nccs-cds/stratus
stratus/handlers/openapi/legacy/app.py
app.py
py
3,119
python
en
code
1
github-code
7
[ { "api_name": "connexion.resolver.Resolver", "line_number": 12, "usage_type": "name" }, { "api_name": "connexion.resolver.Resolver.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "connexion.resolver.Resolver", "line_number": 15, "usage_type": "name" ...
16881390040
"""Script to migrate a Maestrowf YAML file to a CoRR YAML file To run use: $ python corr-sync.py --corr-output=corr.yaml --output-path=demo/sample_output To run the tests: $ py.test --doctest-modules migrate_yaml.py Test reading a sample Maestorwf file >>> data_path = os.path.join(get_path(), 'lulesh_samp...
usnistgov/contracts
contracts/transformers/corrhttptransformer.py
corrhttptransformer.py
py
4,664
python
en
code
0
github-code
7
[ { "api_name": "os.path.relpath", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "line_number": 50, "usage_type": "attribute" }, { "api_name": "mimetypes.guess_type", "line_number": 53, "usage_type": "call" }, { "api_name": "os.path.getsize", ...
41062738841
import pandas as pd from sklearn.linear_model import LinearRegression data = pd.read_csv("papsep2022.csv") features = data[["place","area"]] target = data["price"] print(features) print(target) model = LinearRegression() model.fit(features , target)
VedantMahale30/Machine-Learning-Training
L4/p1.py
p1.py
py
265
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 3, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 11, "usage_type": "call" } ]
29581646628
import torch from survboard.python.utils.utils import neg_par_log_likelihood class intermediate_fusion_mean_criterion(torch.nn.Module): def forward( self, predictions, target, alpha=0, ): joint_log_hazard, unimodal_log_hazards = predictions time, event = target...
BoevaLab/survboard
survboard/python/criterion.py
criterion.py
py
1,165
python
en
code
2
github-code
7
[ { "api_name": "torch.nn", "line_number": 6, "usage_type": "attribute" }, { "api_name": "survboard.python.utils.utils.neg_par_log_likelihood", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.unsqueeze", "line_number": 19, "usage_type": "call" }, { "...
43212949935
from flask import Flask,render_template,request import pickle from sympy import re model=pickle.load(open('stroke.pkl','rb')) app=Flask(__name__) @app.route('/',methods=['GET']) def home(): return render_template('stroke.html') @app.route('/predict',methods=['POST','GET']) def predict(): if request....
Praneethkanchanakuntla/Electronic-Health-Care-System
predict/Stroke/app.py
app.py
py
2,146
python
en
code
1
github-code
7
[ { "api_name": "pickle.load", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.method", ...
14098445157
import pandas as pd from datetime import datetime from sklearn.neighbors import KNeighborsRegressor def transform_and_normalize_data(df, stores_df): df = pd.merge(df, stores_df, on='Store') X = df[['Store', 'Type', 'Size', 'Dept', 'Date', 'IsHoliday']].as_matrix() max_size = 0 max_week = 0 for i i...
mickeycj/walmart-sales-predictor
walmart_knn_regressor.py
walmart_knn_regressor.py
py
1,708
python
en
code
0
github-code
7
[ { "api_name": "pandas.merge", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "name" }, { "api_name": "pandas.read_...
14610535073
import matplotlib from matplotlib import pyplot as plt from tqdm import tqdm import network import utils from torchvision import transforms as T import torch.nn as nn from PIL import Image from glob import glob import colorsys import os import time import numpy as np import torch from PIL import Ima...
updateforever/JointNet
setting/pred_setting/joint_v1.py
joint_v1.py
py
10,955
python
en
code
0
github-code
7
[ { "api_name": "numpy.array", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 33, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 38, "usage_type": "call" }, { "api_name": "utils.utils_bbox.decode_bbox", ...
27844318257
import contextlib import functools import logging import os import shutil import signal import socket import sys import tempfile import time from subprocess import CalledProcessError from subprocess import PIPE from subprocess import Popen from unittest import mock from testifycompat import assert_not_equal from testi...
Yelp/Tron
tests/sandbox.py
sandbox.py
py
8,064
python
en
code
340
github-code
7
[ { "api_name": "os.path.split", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.split", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
24834627837
from __future__ import print_function from pymongo import MongoClient db = MongoClient('localhost').condor reserved_ips = { '18.12': 'MIT', '23.22': 'AWS', '35.9': 'AGLT2', '40.78': 'Azure', '40.112': 'Azure', '50.16': 'AWS', '50.17': 'AWS', '54.144': 'AWS', '54.145': 'AWS', '...
dsschult/scripts
mongo_fix_condor_sites2.py
mongo_fix_condor_sites2.py
py
9,572
python
en
code
0
github-code
7
[ { "api_name": "pymongo.MongoClient", "line_number": 5, "usage_type": "call" } ]
4253069367
# coding: utf-8 # ## For Colab # In[ ]: from IPython.display import HTML, display def set_css(): display(HTML(''' <style> pre { white-space: pre-wrap; } </style> ''')) get_ipython().events.register('pre_run_cell', set_css) # In[ ]: from google.colab import drive drive.mount('/content/d...
cooljeremy/IMHAM
IMHAM.py
IMHAM.py
py
32,847
python
en
code
0
github-code
7
[ { "api_name": "IPython.display.display", "line_number": 12, "usage_type": "call" }, { "api_name": "IPython.display.HTML", "line_number": 12, "usage_type": "call" }, { "api_name": "google.colab.drive.mount", "line_number": 26, "usage_type": "call" }, { "api_name": ...
18452277500
from flask import Flask, request, render_template, redirect, url_for import json import time import random import string # Flask constructor app = Flask(__name__, template_folder="Templates") # A decorator used to tell the application # which URL is associated function result = {} starttime = 0 @app.route('/') def...
shreyasl10/Blockchain-based-MCS-system
Client/app.py
app.py
py
1,131
python
en
code
5
github-code
7
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "json.load", "line_number": 20, "usage_type": "call" }, { "api_name": "time.time", "line_number": 21, "usage_type": "call" }, { "api_name": "json.load", "line_number": 24, ...
70257989022
# -*- coding: utf-8 -*- import json import os import scrapy from he_or_she.scraping.items import ArticleItem class NYTimesSpider(scrapy.Spider): name = 'nytimes' allowed_domains = ['nytimes.com'] start_urls = ['http://nytimes.com/'] api_url = 'https://www.nytimes.com/svc/collections/v1/publish/' ...
zepp133/he-or-she
he_or_she/scraping/spiders/nytimes.py
nytimes.py
py
1,599
python
en
code
0
github-code
7
[ { "api_name": "scrapy.Spider", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "li...
41271149378
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import shutil import re import numpy as np import matplotlib.pyplot as plt from tabulate import tabulate from read_data import read_data_set from fit_data import emg, fit_emg, get_mean_and_variance DIR_NAME = "KD" ACCEPTANCE_RE = re.compile("^\d{2}_\d{3}\d?$")...
KDilch/P2_LAB
extract_means_and_variances.py
extract_means_and_variances.py
py
5,599
python
en
code
0
github-code
7
[ { "api_name": "re.compile", "line_number": 15, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, ...
37672087994
# -*- coding: utf-8 -*- from email.policy import default import os, pickle import argparse from torch import nn import numpy as np import torch import torchvision import pytorch_lightning as pl import warnings from torchvision import models warnings.filterwarnings("ignore") from pytorch_lightning.callbacks.early_stop...
harry-tian/ai-driven-tutorial
models/MTL_slow.py
MTL_slow.py
py
14,304
python
en
code
0
github-code
7
[ { "api_name": "warnings.filterwarnings", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path.insert", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pytorch_lightni...
26832690049
from typing import List from scipy.spatial import Voronoi import torch def get_centroid(pts): n = pts.size(0) return torch.sum(pts[:,0])/n , torch.sum(pts[:,1])/n def get_waypoints(map : torch.Tensor, N : int, range : float): free_idx = torch.argwhere(map==0) waypoints = free_idx[torch.randint(free_i...
KyleM73/cocomas
cocomas/path_planning/waypoint_generation.py
waypoint_generation.py
py
594
python
en
code
0
github-code
7
[ { "api_name": "torch.sum", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.argwhere", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.randint", "line_n...
38823270753
import torch.nn as nn import torch.nn.functional as F class ResBlock(nn.Module): """残差模块""" def __init__(self ,inChannals ,outChannals): """初始化残差模块""" super(ResBlock ,self).__init__() self.conv1 = nn.Conv2d(inChannals ,outChannals ,kernel_size=1 ,bias=False) self.bn1 = nn.Batch...
Sunda233/GAN_FACE_CREATE
SRGAN.py
SRGAN.py
py
5,161
python
en
code
0
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
21019522037
import pygame import aspose.words as aw class Boardimg: def __init__(self, img): self.img = img self.img_file = pygame.image.load(img) self.x = 0 self.y = 0 self.img_size = self.img_file.get_size() self.rect = pygame.Rect(self.x, self.y, self.img_size[0],...
sihen8/chess
boardimg.py
boardimg.py
py
1,177
python
en
code
0
github-code
7
[ { "api_name": "pygame.image.load", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.Rect", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.image.load", ...
10838291589
import xlrd file_Location = "C:/Users/Dou/Desktop/公示公告成果/历史遗留矿山核查图斑数据2022-06-20 11_13.xls" workbook = xlrd.open_workbook(file_Location) sheet = workbook.sheet_by_name('Export') curr_col = 5 goal_col = 6 k_col =10 col1 = sheet.col(curr_col) col2 = sheet.col(goal_col) col3 = sheet.col(k_col) # 提取列数据 # for i in col1: ...
jalerdau/excel_data
main.py
main.py
py
662
python
en
code
0
github-code
7
[ { "api_name": "xlrd.open_workbook", "line_number": 4, "usage_type": "call" } ]
35466513899
"""UniFi Protect Bootstrap.""" from __future__ import annotations import asyncio from copy import deepcopy from dataclasses import dataclass from datetime import datetime import logging from typing import Any, Dict, List, Optional, Set, Tuple, cast from uuid import UUID from aiohttp.client_exceptions import ServerDis...
AngellusMortis/pyunifiprotect
pyunifiprotect/data/bootstrap.py
bootstrap.py
py
20,549
python
en
code
86
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 48, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 66, "usage_type": "name" }, { "api_name": "pyunifiprotect.data.types.EventType", "line_number": 66, "usage_type": "name" }, { "api_name": "typ...
73278246944
# ============================ 1. Environment setup ============================ import os import dgl import time import torch import pickle import numpy as np import pandas as pd import networkx as nx import torch.nn as nn from tqdm import tqdm import torch.nn.functional as F from dgl.data import DGLDataset #torch.cud...
amanzadi/MS_Thesis
GNN_model2.py
GNN_model2.py
py
4,759
python
en
code
1
github-code
7
[ { "api_name": "time.time", "line_number": 18, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 21, "usage_type": "call" }, { "api_name": "time.time", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.utils.data.sampler.SubsetRandom...
35347438355
# -*- coding: utf-8 -*- from common.models.pay.PayOrder import PayOrder from common.libs.Helper import getFormatDate from common.libs.pay.PayService import PayService import datetime from application import app,db ''' python manager.py runjob -m pay/index ''' class JobTask(): def __init__(self): pass def run(self...
mooc-class/python-flask-minapp
完整源码/jobs/tasks/pay/index.py
index.py
py
752
python
en
code
20
github-code
7
[ { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 16, "usage_type": "call" }, { "api_name": "commo...
25908336015
# (C) 2020-2021 Sakuragasaki46. # See LICENSE for copying info. ''' A simple wiki-like note webapp. Pages are stored in SQLite/MySQL databases. Markdown is used for text formatting. Application is kept compact, with all its core in a single file. ''' #### IMPORTS #### from flask import ( Flask, Markup, abort, ...
sakuragasaki46/salvi
app.py
app.py
py
46,901
python
en
code
0
github-code
7
[ { "api_name": "os.path.dirname", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 48, "usage_type": "call" }, { "api_name": "os.environ", "line_nu...
18051852165
# make sure you're logged in with `huggingface-cli login` import os from pathlib import Path from diffusers import StableDiffusionPipeline token = os.environ.get("HUGGING_FACE_TOKEN") output_dir = Path("./artefacts") output_dir.mkdir(parents=True,exist_ok=True) output_dir = output_dir.resolve().absolute() pipe = Sta...
Newmi1988/diffuertest
src/diffusertest/main.py
main.py
py
863
python
en
code
0
github-code
7
[ { "api_name": "os.environ.get", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "diffusers.StableDiffusionPip...
41059890224
from collections import defaultdict from gtnlplib.clf_base import predict,make_feature_vector,argmax def perceptron_update(x,y,weights,labels): """compute the perceptron update for a single instance :param x: instance, a counter of base features and weights :param y: label, a string :param weights: a ...
Ananya10/NLP
Text Classification/gtnlplib/perceptron.py
perceptron.py
py
2,775
python
en
code
1
github-code
7
[ { "api_name": "gtnlplib.clf_base.predict", "line_number": 15, "usage_type": "call" }, { "api_name": "gtnlplib.clf_base.make_feature_vector", "line_number": 16, "usage_type": "call" }, { "api_name": "gtnlplib.clf_base.make_feature_vector", "line_number": 17, "usage_type": ...
27770171099
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import datetime from googlecloudsdk.api_lib.storage import cloud_api from googlecloudsdk.api_lib.storage import errors as api_errors from googlecloudsdk.command_lib.storage import errors as command_errors fr...
twistedpair/google-cloud-sdk
google-cloud-sdk/lib/googlecloudsdk/command_lib/storage/tasks/cp/copy_util.py
copy_util.py
py
5,586
python
en
code
55
github-code
7
[ { "api_name": "googlecloudsdk.command_lib.storage.tasks.task.Task", "line_number": 25, "usage_type": "attribute" }, { "api_name": "googlecloudsdk.command_lib.storage.tasks.task", "line_number": 25, "usage_type": "name" }, { "api_name": "googlecloudsdk.core.log.status.Print", ...
21006472760
import os import pickle import re import torch import nni.retiarii.nn.pytorch as nn from nni.retiarii.nn.pytorch import LayerChoice from nni.retiarii.serializer import model_wrapper from blocks import ShuffleNetBlock, ShuffleXceptionBlock @model_wrapper class ShuffleNetV2OneShot(nn.Module): block_keys = [ ...
microsoft/nni
examples/nas/legacy/oneshot/spos/network.py
network.py
py
5,034
python
en
code
13,409
github-code
7
[ { "api_name": "nni.retiarii.nn.pytorch.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "nni.retiarii.nn.pytorch", "line_number": 14, "usage_type": "name" }, { "api_name": "nni.retiarii.nn.pytorch.Sequential", "line_number": 38, "usage_type": "call" ...
4295781186
import io import math from pathlib import Path, PureWindowsPath from struct import unpack class PDB: def __init__(self, path): with open(path,"rb") as fh: pdb_data = fh.read() self.fp = io.BytesIO(pdb_data) self.magic = self.fp.read(32) self.block_size = unpack("<I",self.fp.read(4))[0] self.free_block_m...
MalwareSoup/pdb_func
pdb_func.py
pdb_func.py
py
6,257
python
en
code
0
github-code
7
[ { "api_name": "io.BytesIO", "line_number": 10, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 13, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 15, "usage_type": "call" }, { "api_name": "struct.unpack", "line_numb...
21901061938
import json import requests if __name__ == '__main__': post_url='https://fanyi.baidu.com/sug' word=input('key:') data={'kw':word} headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' } #确认响应数据是jso...
avilliai/webSpiderLearning
day1/baiduTrans.py
baiduTrans.py
py
532
python
en
code
0
github-code
7
[ { "api_name": "requests.post", "line_number": 13, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 16, "usage_type": "call" } ]
7392549532
from gettext import translation import random from django.shortcuts import render, redirect from django.db import connection from django.contrib.auth.hashers import make_password from django.http import HttpResponse, HttpResponseRedirect from datetime import datetime, timedelta from django.http import Http404, HttpResp...
CarolineFang1998/carBidder
carBidderApp/views.py
views.py
py
59,497
python
en
code
0
github-code
7
[ { "api_name": "dotenv.load_dotenv", "line_number": 22, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 25, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 42, "usage_type": "call" }, { "api_name": "django.db.connec...
5101842316
from typing import List from arrow import Arrow import arrow from datetime import datetime from sqlalchemy import create_engine from sqlalchemy import select, update from sqlalchemy.ext.automap import automap_base import sqlalchemy import numpy as np from common.enums import TaskTypeEnum from globalsurgespi...
evaseemefly/GlobalSurgeSys
background/spider/globalsurgespider/core/data.py
data.py
py
14,403
python
en
code
0
github-code
7
[ { "api_name": "typing.List", "line_number": 28, "usage_type": "name" }, { "api_name": "models.models.StationRealDataSpecific", "line_number": 28, "usage_type": "name" }, { "api_name": "core.db.DbFactory", "line_number": 32, "usage_type": "call" }, { "api_name": "a...
36520889041
import logging import docker class DockerSubmitter(object): @staticmethod def run_docker_container(image, command): client = docker.from_env() container = client.containers.run(image, command, detach=True) # Streaming the logs for line in container.logs(stream=True): ...
couler-proj/couler
couler/docker_submitter.py
docker_submitter.py
py
350
python
en
code
855
github-code
7
[ { "api_name": "docker.from_env", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 13, "usage_type": "call" } ]
39901793972
# %% import numpy as np import os import pandas as pd from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from sklearn.metrics.pairwise import cosine_similarity K = 5 n = 3 minihash = False proj_func_num = 10 work_dir = r'D:\Documents\course\junior\BigDataAna\12-20大作业' dataset_dir = work_dir...
zerofishnoodles/HUST-CS
BigDataAnalysis/exp3/CB.py
CB.py
py
4,631
python
en
code
2
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 40, "usage_type": "call" }, { "api_name": "sklearn.feature_extractio...
39825024062
import torch import onmt from onmt.Utils import use_gpu SRC_TMP = "" TRG_TMP = "" def load_model(opt): checkpoint = torch.load(opt.model, map_location=lambda storage, loc: storage) fields = onmt.IO.load_fields(checkpoint['vocab']) model_opt = checkpoint['opt'] model = onmt.ModelConstructor.make_base_...
zywallace/dual
utils/loader.py
loader.py
py
764
python
en
code
1
github-code
7
[ { "api_name": "torch.load", "line_number": 9, "usage_type": "call" }, { "api_name": "onmt.IO.load_fields", "line_number": 10, "usage_type": "call" }, { "api_name": "onmt.IO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "onmt.ModelConstructor.make...
28558376158
from src import util from src import eval import numpy as np import pyflux as pf if __name__ == '__main__': p = 4 q = 4 h_test = 6 ts, data = util.load_data("../data/NSW2013.csv", columnName="TOTALDEMAND") # ts, data = util.load_data("../data/bike_hour.csv", columnName="cnt") # ts, data = ut...
zhangxu0307/time_series_forecasting_pytorch
src/ARIMA.py
ARIMA.py
py
1,840
python
en
code
326
github-code
7
[ { "api_name": "src.util.load_data", "line_number": 13, "usage_type": "call" }, { "api_name": "src.util", "line_number": 13, "usage_type": "name" }, { "api_name": "src.util.divideTrainTest", "line_number": 20, "usage_type": "call" }, { "api_name": "src.util", "...
14482972527
from sympy import * from IPython.display import display, Latex import control.matlab as ml def printer(var_name, var_value, unit): return display(Latex("${name} = {var:.4f}\ {unit}$".format(var=var_value,name=var_name,unit=unit))) # Approximation for Eckfreq for PT1 TF # def find_eckfreq_PT1(mag,omega): ind...
ayham291/python_modules
myfuncs.py
myfuncs.py
py
1,965
python
en
code
1
github-code
7
[ { "api_name": "IPython.display.display", "line_number": 7, "usage_type": "call" }, { "api_name": "IPython.display.Latex", "line_number": 7, "usage_type": "call" }, { "api_name": "control.matlab.mag2db", "line_number": 13, "usage_type": "call" }, { "api_name": "con...
3772363677
import csv import os import itertools import ast import pandas as pd from sklearn.metrics.pairwise import pairwise_distances import pickle from sklearn import metrics import numpy as np # similarity based (noaudio) # popular rec (pop) # greatest artist (sagh) # collocation artist (cagh) - similarity based...
mir-aidj/playlist-generation
playlist_generation.py
playlist_generation.py
py
4,016
python
en
code
5
github-code
7
[ { "api_name": "csv.DictReader", "line_number": 23, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 27, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.concat", "...
6687019027
import collections import itertools import logging import random import string import threading import time from typing import ( Any, Callable, Dict, List, Mapping, Optional, Set, Tuple, Union, ) import doorpi.actions import doorpi.event from . import log LOGGER: doorpi.DoorPiLogg...
emphasize/DoorPi
doorpi/event/handler.py
handler.py
py
10,200
python
en
code
null
github-code
7
[ { "api_name": "doorpi.actions.DoorPiLogger", "line_number": 25, "usage_type": "attribute" }, { "api_name": "doorpi.actions", "line_number": 25, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "typ...
4168135306
""" homeassistant.components.sensor.forecast ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Forecast.io weather service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.forecast/ """ import logging from datetime import timedelta from homeassistant.util ...
hcchu/home-assistant-clone
homeassistant/components/sensor/forecast.py
forecast.py
py
7,597
python
en
code
1
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 45, "usage_type": "call" }, { "api_name": "forecastio.load_forecast", "line_number": 57, "usage_type": "call" }, { "api_name": "homeass...
15507779283
#Deep Cross Entropy #https://colab.research.google.com/github/Cheukting/rl_workshop/blob/master/exercises/rl_workshop_deep_crossentropy_method.ipynb ''' Instead of using a table (like for cross entropy use a function) Start with random uniform probability for policy loop: evaluate policy (using neural network...
Chief-Buka/Reinforcement-learning
CartPole - Solution.py
CartPole - Solution.py
py
5,190
python
en
code
0
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 22, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
1578558385
from copy import deepcopy import torch import torch.nn as nn from torch.nn.parallel.distributed import _find_tensors from ..builder import MODELS, build_module from ..common import set_requires_grad from .base_gan import BaseGAN # _SUPPORT_METHODS_ = ['DCGAN', 'STYLEGANv2'] # @MODELS.register_module(_SUPPORT_METHO...
chris901003/DeepLearning
mmgeneration/mmgen/models/gans/static_unconditional_gan.py
static_unconditional_gan.py
py
16,612
python
en
code
7
github-code
7
[ { "api_name": "base_gan.BaseGAN", "line_number": 16, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 61, "usage_type": "call" }, { "api_name": "builder.build_module", "line_number": 63, "usage_type": "call" }, { "api_name": "builder.build_mod...
8366052561
import torch import numpy as np def reservoir(seen_examples, buffer_size): if seen_examples < buffer_size: return seen_examples rand = np.random.randint(0, seen_examples + 1) if rand < buffer_size: return rand else: return -1 class Buffer: def __init__(self, buffer_size,...
albertozurli/cl_timeseries
utils/buffer.py
buffer.py
py
2,686
python
en
code
1
github-code
7
[ { "api_name": "numpy.random.randint", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.random.choice", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.random...
25864023586
# to allow running from terminal without pyCharm :( import sys sys.path.append('../ope') sys.path.append('../models/q_learning') sys.path.append('../models/attention/nn') sys.path.append('../models/ckconv/nn') sys.path.append('../models') import torch import argparse import pandas as pd from q_learning im...
thomas097/Haemodynamic-Optimization-Reinforcement-Learning
experiments/train_dqn_baselines.py
train_dqn_baselines.py
py
4,014
python
en
code
0
github-code
7
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
22743526808
import game_of_life_interface import numpy as np import matplotlib.pyplot as plt class GameOfLife(game_of_life_interface.GameOfLife): # This is the way you construct a class that heritage properties def __init__ (self, size_of_board, board_start_mode, rules, rle, pattern_position) : # constructor ...
dinazul42/Computer-Science-Assignment-2
exe2.py
exe2.py
py
9,077
python
en
code
0
github-code
7
[ { "api_name": "game_of_life_interface.GameOfLife", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 23, "usage_type": "call" }, { "api_name": ...
2775880024
from django.contrib import admin from django.urls import path from evotingapp import views urlpatterns = [ path('admin/', admin.site.urls), path('', views.uhome), path('uhome/', views.uhome), path('ureg/', views.ureg), path('uvreg/',views.uvreg), path('userv/',views.userv), path('ucontact/',...
jitudixit/django-project-evoting
evoting/urls.py
urls.py
py
1,010
python
en
code
0
github-code
7
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "dja...
43555018407
""" Use a simple Discrete Variable Representation method to solve one-dimensional potentials. A good general introduction to DVR methods is Light and Carrington, Adv. Chem. Phys. 114, 263 (2000) """ from matplotlib import pyplot as plt import numpy as np import scipy.sparse.linalg as sla import scipy.special.orthogon...
binggu56/pyqed
pyqed/dvr/dvr_1d.py
dvr_1d.py
py
23,112
python
en
code
10
github-code
7
[ { "api_name": "numpy.diag", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.transpose", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 4...
9463696295
from appium import webdriver """ 02: 使用Appium Desktop录制的脚本: 使用小米系统拨号,拨打10086 博客:https://blog.csdn.net/tt75281920/article/details/115646935?spm=1001.2014.3001.5501 """ caps = {} caps["platformName"] = "Android" caps["deviceName"] = "d0a49989" caps["appPackage"] = "com.android.contacts" caps["appActivity"] = "com.andro...
tang75281920/appiumdemo
testcasedemo/demo_02.py
demo_02.py
py
883
python
en
code
0
github-code
7
[ { "api_name": "appium.webdriver.Remote", "line_number": 17, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 17, "usage_type": "name" } ]
74149948384
from secrets import token_urlsafe from fastapi import APIRouter, HTTPException, status from fastapi.responses import RedirectResponse from pydantic import AnyUrl from db import DB api_router = APIRouter() @api_router.post("/link") def new_link(long_link: AnyUrl): db = DB.get_instance() length = 50 while...
hvuhsg/LinkSH
src/api/main.py
main.py
py
884
python
en
code
2
github-code
7
[ { "api_name": "fastapi.APIRouter", "line_number": 8, "usage_type": "call" }, { "api_name": "pydantic.AnyUrl", "line_number": 12, "usage_type": "name" }, { "api_name": "db.DB.get_instance", "line_number": 13, "usage_type": "call" }, { "api_name": "db.DB", "line...
36972489029
""" ------------------------------------------------------------------------------- Created on April,27, 2020 author: Suksmono@{STEI-ITB, MDR Inc.} Find a Hadamard matrix using QA Computer/DWave \------------------------------------------------------------------------------- """ # from sympy import * # #from pr...
suksmono/SciRep-2021
EXTENDED_TURYN/py_src_neal/ck_solve_neal_complete_XY.py
ck_solve_neal_complete_XY.py
py
7,551
python
en
code
0
github-code
7
[ { "api_name": "pandas.DataFrame", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_...
15529686496
import torch import torch.nn as nn from torch.utils.data import Dataset, DataLoader from torchvision import transforms import numpy as np from pathlib import Path from IPython.core.pylabtools import figsize import matplotlib.pyplot as plt from net import GlobalCoarseNet, LocalFineNet from loss import ScaleInvariantLo...
Z7Gao/CS172-Computer-Vision
hw4/train.py
train.py
py
6,247
python
en
code
3
github-code
7
[ { "api_name": "warnings.filterwarnings", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 20, "usage_type": "call" }, { "api_name": "util.load_train", "line_number": 30, "usage_type": "call" }, { "api_name": "pathlib.Path", ...
70035906144
# --------------------------------------------------------------- # transformer_croattn_relcaption_head.py # Set-up time: 2021/3/11 10:39 # Copyright (c) 2020 ICT # Licensed under The MIT License [see LICENSE for details] # Written by Kenneth-Wong (Wenbin-Wang) @ VIPL.ICT # Contact: wenbin.wang@vipl.ict.ac.cn [OR...
Kenneth-Wong/MMSceneGraph
mmdet/models/relational_caption_heads/transformer_croattn_relcaption_head.py
transformer_croattn_relcaption_head.py
py
22,138
python
en
code
54
github-code
7
[ { "api_name": "relational_caption_head.RelationalCaptionHead", "line_number": 31, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 42, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 42, "usage_type": "name" }, { "api_name":...
2554705525
from __future__ import annotations import logging from pathlib import Path import pandas as pd from ...core.mixins import GeoDBMixin from ...core.structure import Navaid, Route _log = logging.getLogger(__name__) class Airways(GeoDBMixin): """ An ATS route is a specified route designed for channelling the ...
xoolive/traffic
src/traffic/data/basic/airways.py
airways.py
py
5,981
python
en
code
325
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "core.mixins.GeoDBMixin", "line_number": 14, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 74, "usage_type": "name" }, { "api_name": "pandas.DataFram...