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
74074471080
import sys import numpy as np import scipy.linalg as la import scipy.sparse.linalg as las if len(sys.argv)!=6: print("Use: cg.py <herm pos def matrix> <target> <x0> <#iterations> <tolerance>\n",file=sys.stderr) sys.exit(1) A=np.array(sys.argv[1].split(',')).astype(int) m=np.sqrt(A.shape[0]).astype(int) A=A....
ericjvandervelden/machine_learning
cg2.py
cg2.py
py
1,309
python
en
code
0
github-code
18
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
36149035419
import webapp2 import os import jinja2 import json import datetime from math import sin, cos, sqrt, atan2, radians from stop_models import Stop from notification_models import Notification #from seed_stops_db import seed_data from twilio.rest import Client from google.appengine.ext import ndb import logging my_file = ...
HaykTheKhulyan/StopGo
main.py
main.py
py
4,770
python
en
code
1
github-code
18
[ { "api_name": "json.loads", "line_number": 16, "usage_type": "call" }, { "api_name": "jinja2.Environment", "line_number": 20, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.dirname...
25873095542
import youtube_dl import os ydl_opts = { 'format': 'bestaudio/best', 'postprocessors': [{ 'key': 'FFmpegExtractAudio', 'preferredcodec': 'mp3', 'preferredquality': '192', }], 'outtmpl': 'music/%(title)s.mp3', 'quiet': False } def dl_file(url): with yo...
Schmidt23/Portfolio
Bots/HObot/music.py
music.py
py
511
python
en
code
0
github-code
18
[ { "api_name": "youtube_dl.YoutubeDL", "line_number": 18, "usage_type": "call" } ]
13239814510
from datasets import kitti, mpo def define_dataset(cfg, phase: str = "train", modality=["depth"]): if cfg.name == "kitti_odometry": dataset = kitti.KITTIOdometry( root=cfg.root, split=phase, shape=cfg.shape, min_depth=cfg.min_depth, max_depth=cfg...
Abdurrasith/dusty-gan
datasets/__init__.py
__init__.py
py
754
python
en
code
null
github-code
18
[ { "api_name": "datasets.kitti.KITTIOdometry", "line_number": 6, "usage_type": "call" }, { "api_name": "datasets.kitti", "line_number": 6, "usage_type": "name" }, { "api_name": "datasets.mpo.MPOSparse", "line_number": 16, "usage_type": "call" }, { "api_name": "data...
25216853902
# https://leetcode.com/problems/house-robber/ # tags: #array, #blind_75_must_do, #dp, #top_interview_questions from typing import List class Solution: def rob(self, nums: List[int]) -> int: n = len(nums) max_amount = [0] * n max_amount[0] = nums[0] for i in range(1, n): ...
ronelzb/leetcode
dynamic_programming/0198_house_robber.py
0198_house_robber.py
py
554
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" } ]
39173795083
from django.core.management.base import BaseCommand, CommandError from tooskie.populate import populate_db, populate_db_one_recipe class Command(BaseCommand): help = 'Populate database from scrapped data' def add_arguments(self, parser): parser.add_argument( '--recipe', dest='r...
anth2o/tooskie
tooskie/recipe/management/commands/populate.py
populate.py
py
621
python
en
code
0
github-code
18
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 4, "usage_type": "name" }, { "api_name": "tooskie.populate.populate_db_one_recipe", "line_number": 16, "usage_type": "call" }, { "api_name": "tooskie.populate.populate_db", "line_number": 18, "usage_t...
36463265001
from django.shortcuts import redirect, render from . models import JobModel from django.core.paginator import Paginator from . forms import ApplyForm, JobModelForm from django.contrib.auth.decorators import login_required from . filters import jobFilter # Create your views here. def home(request): context= { ...
Abderahim-Bh/JobBoardRepo
job/views.py
views.py
py
1,860
python
en
code
0
github-code
18
[ { "api_name": "models.JobModel.objects.all", "line_number": 13, "usage_type": "call" }, { "api_name": "models.JobModel.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "models.JobModel", "line_number": 13, "usage_type": "name" }, { "api_name...
17885872139
# -*- coding:utf-8 -*- import random import time from utils.config import config from utils.es_client import ElasticsearchClient from utils.mq_client import RocketProducer, RocketPushConsumer rocket_producer = RocketProducer({"host": "172.31.236.21", "port": 9876}) rocket_producer.start() for i in range(10): data...
nightfall-w/hydrogen
utils/testmq.py
testmq.py
py
1,548
python
en
code
1
github-code
18
[ { "api_name": "utils.mq_client.RocketProducer", "line_number": 9, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 13, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 14, "usage_type": "call" }, { "api_name": "random.ra...
14041972602
import scrapy from pbl.items import PblSpider from pbl.items import ShopCard import json class SpiderasortiSpider(scrapy.Spider): name = 'spiderAsorti' allowed_domains = ['www.assorti.lt'] start_urls = ['https://www.assorti.lt/katalogas/maistas/'] item = [] list = [{ 'sid': 1, 'name...
mrghosti3/cheaper-marketplace
src/crawler/pbl/spiders/spiderAsorti.py
spiderAsorti.py
py
2,261
python
en
code
4
github-code
18
[ { "api_name": "scrapy.Spider", "line_number": 6, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 32, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 40, "usage_type": "call" }, { "api_name": "pbl.items.ShopCard", ...
23719581068
import falcon from resources import athlete from resources import plan from resources import exercise from services import database_service from middlewares import ( ContentEncodingMiddleware, ) conn = database_service.connect() api = falcon.API(middleware=[ ContentEncodingMiddleware(), ]) # api = falcon.AP...
mertingen/python-falcon-framework-api
app/app.py
app.py
py
755
python
en
code
0
github-code
18
[ { "api_name": "services.database_service.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "services.database_service", "line_number": 11, "usage_type": "name" }, { "api_name": "falcon.API", "line_number": 13, "usage_type": "call" }, { "api_name":...
10884964296
import binascii from PIL import Image new = Image.open('cat_with_secrets.png').load() old = Image.open('cat_with_secrets_original.jpg').load() width = 512 in_hex = '' for y in range(3): for x in range(width): if (y, x) <= (2, 125) and new[x, y] != old[x, y]: in_hex += '%x' % (x % 16) print(...
PequalsNP-team/pequalsnp-team.github.io
assets/pixel_extraction.py
pixel_extraction.py
py
347
python
en
code
16
github-code
18
[ { "api_name": "PIL.Image.open", "line_number": 4, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 4, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 5, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 5...
10759128884
from __future__ import annotations from typing import List MAX_COPY = 0x7 MAX_SINGLE = 0x7 class RleNibbleCompressor: def __init__(self, uncompressed_data: bytes): if not isinstance(uncompressed_data, memoryview): uncompressed_data = memoryview(uncompressed_data) self.uncompressed_da...
SkyTemple/skytemple-files
skytemple_files/compression/rle_nibble/compressor.py
compressor.py
py
2,093
python
en
code
16
github-code
18
[ { "api_name": "typing.List", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" } ]
3272829291
from bench.common import ( SampleConfig, register_sample, SampleSource, SampleTag, ) import numpy as np def get_sample_config(): return SampleConfig( args_cases=[(12, 12, 12), (16, 16, 16), (32, 32, 32)], requires_grad=[False] * 3, backward=[False] * 2, performance_...
DeepLink-org/DLOP-Bench
bench/samples/long_tail/greedy_decoder/__init__.py
__init__.py
py
977
python
en
code
38
github-code
18
[ { "api_name": "bench.common.SampleConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "bench.common.SampleSource.ASSEMBLYAI", "line_number": 17, "usage_type": "attribute" }, { "api_name": "bench.common.SampleSource", "line_number": 17, "usage_type": "name" ...
18703702083
from sys import stdin from fractions import Fraction input = lambda: stdin.readline().strip() MOD = 1000000007 class Sphere: __slots__ = ['x', 'r'] def __init__(self, x=0, r=0): self.x = x self.r = r def __lt__(self, other) -> bool: if self.x + self.r != other.x + other.r: ...
thecasterian/Sandbox
17378.py
17378.py
py
2,793
python
en
code
0
github-code
18
[ { "api_name": "sys.stdin.readline", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 3, "usage_type": "name" }, { "api_name": "fractions.Fraction", "line_number": 44, "usage_type": "call" }, { "api_name": "fractions.Fraction", ...
24653645908
import json import os import argparse def main(output_folder: str, source: str, output_file: str): """ Retrieve missing twitter handles. Args: output_folder (str): Path to folder with files named after the retrieved users. source (str): Path to file containing list of users to be retrieve...
sachalevy/tweepipe
scripts/get_remaining.py
get_remaining.py
py
1,772
python
en
code
0
github-code
18
[ { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "json.load", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 25, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_nu...
21959973979
import numpy as np import matplotlib.pyplot as plt import scipy.linalg as sci ti=0 tf=10. x,h=np.linspace(0,1,100,retstep=True) dt=0.000052 t=ti i=0 us= np.where(x<0.5,x,1-x) m=(dt/h**2) line,=plt.plot(x,us) A = np.array(np.zeros((98,98), dtype = np.float)) B = np.array(np.zeros((98,98), dtype = np.flo...
AmitPratap175/3rd-year
ODE_Euler Algorithm_Heat equation/q3_cranknickolson.py
q3_cranknickolson.py
py
879
python
en
code
0
github-code
18
[ { "api_name": "numpy.linspace", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
15654966544
from django.urls import path from . import views urlpatterns=[ path('',views.home,name="home"), path(r'transfer/(?P<value>\d+)/$',views.modelview,name='modelview'), path('download/',views.download,name='download'), path('home/',views.returnhome,name='returnhome'), path('about/',views.about,name='abo...
swahan1230/sample
transfer/urls.py
urls.py
py
430
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 4, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", ...
34467486756
import logging import netCDF4 as nc import numpy as np import pandas as pd import pygrib import xarray as xr from abc import ABC, abstractmethod from datetime import datetime, timedelta from os import rename from pathlib import Path from typing import Optional, Union from urllib.error import URLError from globsim.dow...
geocryology/globsim
globsim/download/JRA3Qdownload.py
JRA3Qdownload.py
py
19,850
python
en
code
18
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "globsim.download.GenericDownload.GenericDownload", "line_number": 28, "usage_type": "name" }, { "api_name": "globsim.download.JRAdownload.getPressureLevels", "line_number": 39, "u...
70879321961
"""MNet V6""" from collections import OrderedDict import tensorflow as tf import tensorflow.contrib.layers as tfc_layers from tensorflow.contrib.framework import arg_scope from tensorflow.contrib.framework import nest import numpy as np from timitate.utils.utils import CoorSys import tpolicies.ops as tp_ops import tp...
tencent-ailab/TPolicies
tpolicies/net_zoo/mnet_v6/mnet_v6d6.py
mnet_v6d6.py
py
37,036
python
en
code
4
github-code
18
[ { "api_name": "tpolicies.net_zoo.mnet_v6.data.MNetV6Config", "line_number": 46, "usage_type": "name" }, { "api_name": "tpolicies.net_zoo.mnet_v6.utils._make_inputs_palceholders", "line_number": 47, "usage_type": "call" }, { "api_name": "tpolicies.net_zoo.mnet_v6.data.MNetV6Inputs...
14489833295
# textarea.py # # Class to show, save, submit text entries # # W.Burnside <wburnsid@u.washington.edu> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, ...
UWOneLaptop/Classroom-Presenter
ClassroomPresenter.activity/textarea.py
textarea.py
py
2,743
python
en
code
5
github-code
18
[ { "api_name": "gtk.HBox", "line_number": 26, "usage_type": "attribute" }, { "api_name": "gtk.HBox.__init__", "line_number": 29, "usage_type": "call" }, { "api_name": "gtk.HBox", "line_number": 29, "usage_type": "attribute" }, { "api_name": "logging.getLogger", ...
9707295671
# Converts my Resume from YAML to TeX. # Just don't forget to drop pdflatex on the output :) # ------------------------------------------------------------------------------ # @contributor Aleksandr Mattal <https://github.com/qutebits> # inspired by work of Brandon Amos <https://github.com/bamos/cv> import re import y...
QuteBits/resume_42
resume_tex.py
resume_tex.py
py
1,465
python
en
code
33
github-code
18
[ { "api_name": "yaml.safe_load", "line_number": 14, "usage_type": "call" }, { "api_name": "jinja2.Environment", "line_number": 16, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.da...
74312915239
import torch from tokenizer import Tokenizer class TrieNode: def __init__(self): self.children = {} self.end_point = 0 self.word_num = 0 class White_list: def __init__(self, poi_list, tokenizer: Tokenizer, vocab_size=32000, suffix_constrain=False): # poi_list = [(poi_id, cat...
liujiaozhiren/lit_llama
pill_each/white_list.py
white_list.py
py
2,714
python
en
code
1
github-code
18
[ { "api_name": "tokenizer.Tokenizer", "line_number": 14, "usage_type": "name" }, { "api_name": "tokenizer.encode", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 49, "usage_type": "call" } ]
15634665109
import cv2 import numpy as np import surround_view.param_settings_2 as param camera_name = "resize_moil_front" img = cv2.imread("images/"+ camera_name +".png") matrix = "yaml/"+ camera_name +".yaml" # print(img.shape) # # src = [[231, 264], [537., 231], # [54., 387.], [862., 326.]] # # dst = [[420, 300], [700, ...
aji-ptn/Bird_view
perspective.py
perspective.py
py
1,669
python
en
code
0
github-code
18
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "surround_view.param_settings_2.project_shapes", "line_number": 17, "usage_type": "attribute" }, { "api_name": "surround_view.param_settings_2", "line_number": 17, "usage_type": "name" }...
14097889629
import aiohttp_cors from aiohttp import web from database import Database routes = web.RouteTableDef() @routes.post('/add_user') async def add_user(request): request_data = await request.json() user_code = str(request_data["user_code"]) client_type = request_data["client_type"] user_id = await dat...
stounfo/vegetables
main.py
main.py
py
7,071
python
en
code
0
github-code
18
[ { "api_name": "aiohttp.web.RouteTableDef", "line_number": 8, "usage_type": "call" }, { "api_name": "aiohttp.web", "line_number": 8, "usage_type": "name" }, { "api_name": "database.user_exists", "line_number": 16, "usage_type": "call" }, { "api_name": "aiohttp.web....
45508653694
# -*- coding: utf-8 -*- """ Created on Mon Jun 19 11:58:49 2017 @author: daniel """ import psycopg2 import math import utm from collections import Counter import numpy as np import gdal import pandas as pd import os #import sys #sys.path.append(r'g:\Water_Nexus\_A3\_scripts_py3') #import DTBSE_sed_...
dzamrsky/SLR_gw_impacts
_fc_scripts/ws_datatools_py3.py
ws_datatools_py3.py
py
14,040
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 60, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 140, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 141, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
41147488605
import torch as t class Debug_Dataset(t.utils.data.Dataset): def __init__(self, opt, wrapped_dataset): self.batch_size = opt.batch_size self.img_size = opt.img_size self.dataset = wrapped_dataset self.classes = wrapped_dataset.classes self.calls = 0 self.ids...
chrishenn/find_strings
datasets/debug_dataset.py
debug_dataset.py
py
574
python
en
code
0
github-code
18
[ { "api_name": "torch.utils", "line_number": 5, "usage_type": "attribute" } ]
28798831000
from django.shortcuts import render, HttpResponse, redirect from models import * from django.contrib import messages from django.db.models import Count def index(request): # Giving value to session try: request.session['userid'] except KeyError: request.session['userid'] = "" if reque...
inyhsu/Book
apps/belt_review/views.py
views.py
py
4,191
python
en
code
0
github-code
18
[ { "api_name": "django.shortcuts.redirect", "line_number": 15, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" }, { "api_name": "django.contrib.messages.warning", "line_number": 24, "usage_type": "call" }, { ...
33552467184
import rospy from cv_bridge import CvBridge from sensor_msgs.msg import Image import cv2 from kinect import imgMsg2cv2 import numpy as np def imgMsg2cv2(msg): if msg.encoding == 'bgra8': image = np.frombuffer(msg.data, dtype=np.uint8) image = image.reshape([msg.height, msg.width, 4]) image ...
zhouxian/franka
camera/record_video.py
record_video.py
py
1,982
python
en
code
2
github-code
18
[ { "api_name": "numpy.frombuffer", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.frombuffer", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.uint8", ...
39719717134
import gym from gym import spaces from gym.utils import seeding class RouletteEnv(gym.Env): """Simple roulette environment The roulette wheel has 37 spots. If the bet is 0 and a 0 comes up, you win a reward of 35. If the parity of your bet matches the parity of the spin, you win 1. Otherwise you rece...
AI4Finance-Foundation/FinRL-Tutorials
DQN-DDPG_Stock_Trading/gym/envs/toy_text/roulette.py
roulette.py
py
1,392
python
en
code
599
github-code
18
[ { "api_name": "gym.Env", "line_number": 6, "usage_type": "attribute" }, { "api_name": "gym.spaces.Discrete", "line_number": 19, "usage_type": "call" }, { "api_name": "gym.spaces", "line_number": 19, "usage_type": "name" }, { "api_name": "gym.spaces.Discrete", ...
38977981914
import sqlite3 from DESCipher import DESCipher from collections import namedtuple import os def gen_doc(db_name='exam_somarx.db', password=None): if not os.path.exists('output'): os.mkdir('output') cipher = DESCipher(password) if password else None db = sqlite3.connect(db_name) courses = ['mzd...
netcan/MyCrawler
HFUT_Exam_Crawler_Py/gen_doc.py
gen_doc.py
py
1,927
python
en
code
55
github-code
18
[ { "api_name": "os.path.exists", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 9, "usage_type": "call" }, { "api_name": "DESCipher.DESCipher", "line_num...
32148841424
# 假如A被感染,前3天为潜伏期,不发作也不会传染人, # 第4天开始发作,从发作到治愈需要7天时间,期间每天传染3个人 # 探究一下传播曲线 import matplotlib.pyplot as plt import matplotlib.animation as ani from matplotlib.font_manager import FontProperties def covid(n): days = incubation + cure_period # 列表:潜伏期, 发病期, 发病, 治愈, 现存, 累计 temp = [0 for _ in range(days + 4)] ...
hongm32/2020design
其他教学参考/公开课/【公开课《周而复始的循环》(陶)】/新冠疫情传播.py
新冠疫情传播.py
py
2,683
python
en
code
2
github-code
18
[ { "api_name": "matplotlib.font_manager.FontProperties", "line_number": 59, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 60, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 60, "usage_type": "name" }, { ...
13707909406
# src/tests/conftest.py import pytest from app import main # see: http://flask.pocoo.org/docs/1.0/testing/ @pytest.fixture def client(): main.app.config['TESTING'] = True client = main.app.test_client() yield client # http://flask.pocoo.org/docs/1.0/testing/#testing-json-apis def test_hello_greets_greete...
keblato/RecommendationMicroservice
src/tests/conftest.py
conftest.py
py
912
python
en
code
0
github-code
18
[ { "api_name": "app.main.app", "line_number": 9, "usage_type": "attribute" }, { "api_name": "app.main", "line_number": 9, "usage_type": "name" }, { "api_name": "app.main.app.test_client", "line_number": 10, "usage_type": "call" }, { "api_name": "app.main.app", ...
21805863883
import zhipuai import requests import json import base64 import wave import pydub from io import BytesIO from aip import AipSpeech baidu_keys = {} def set_bd_keys(keys): global baidu_keys baidu_keys = keys BOTS = {} class Bot: def __init__(self): with open("background.txt", "r", encoding="utf-8") ...
LeChocolatChaud/ElderlyAssistant
server/utils.py
utils.py
py
1,957
python
en
code
0
github-code
18
[ { "api_name": "zhipuai.model_api.sse_invoke", "line_number": 20, "usage_type": "call" }, { "api_name": "zhipuai.model_api", "line_number": 20, "usage_type": "attribute" }, { "api_name": "aip.AipSpeech", "line_number": 32, "usage_type": "call" }, { "api_name": "zhi...
14769278571
from django.contrib.auth import login, authenticate, logout from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.shortcuts import render, redirect # Create your views here. from users.forms.login_form import LoginForm from users.forms.register_form import Re...
Tatyana-Petkova/MeasureHashimoto
users/views.py
views.py
py
3,595
python
en
code
1
github-code
18
[ { "api_name": "users.forms.register_form.RegisterForm", "line_number": 16, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 18, "usage_type": "call" }, { "api_name": "users.forms.register_form.RegisterForm", "line_number": 20, "usage_type": ...
4003156124
import collections import functools import itertools import threading import warnings import numpy as np from tensorflow.python.autograph.core import ag_ctx from tensorflow.python.autograph.impl import api as autograph from tensorflow.python.distribute import distribute_lib from tensorflow.python.eager import context...
tensorflow/tensorflow
tensorflow/python/keras/engine/base_layer_v1.py
base_layer_v1.py
py
97,169
python
en
code
178,918
github-code
18
[ { "api_name": "tensorflow.python.keras.engine.base_layer.Layer", "line_number": 54, "usage_type": "attribute" }, { "api_name": "tensorflow.python.keras.engine.base_layer", "line_number": 54, "usage_type": "name" }, { "api_name": "itertools.chain", "line_number": 124, "usa...
75036065321
from langchain.document_loaders import YoutubeLoader from langchain.tools import Tool from langchain.agents import initialize_agent from langchain.agents import AgentType from langchain import PromptTemplate from langchain.chains import LLMChain from main import llm from langchain.embeddings.openai import OpenAIEmbeddi...
DebparnoB/Youtube-Video-Summarizer
youtube_summarizer.py
youtube_summarizer.py
py
2,764
python
en
code
0
github-code
18
[ { "api_name": "langchain.embeddings.openai.OpenAIEmbeddings", "line_number": 14, "usage_type": "call" }, { "api_name": "langchain.PromptTemplate", "line_number": 20, "usage_type": "call" }, { "api_name": "langchain.chains.LLMChain", "line_number": 37, "usage_type": "call"...
28108759840
#!/usr/bin/env python3 import pwn host = "dctf1-chall-hotel-rop.westeurope.azurecontainer.io" port = 7480 target = "hotel_rop" def exploit(remote): if remote: pr = pwn.connect(host, port) else: pr = pwn.process(target) try: elf = pwn.ELF(target) rop = pwn.ROP(elf) ...
onealmond/hacking-lab
dctf-2021/hotel-rop/exploit.py
exploit.py
py
1,684
python
en
code
72
github-code
18
[ { "api_name": "pwn.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "pwn.process", "line_number": 13, "usage_type": "call" }, { "api_name": "pwn.ELF", "line_number": 16, "usage_type": "call" }, { "api_name": "pwn.ROP", "line_number": 17, ...
74782725161
import re import networkx as nx from functools import cache INPUT_FILE = "2022/inputs/day16.txt" @cache def dummy_flow_optimizer( graph: nx.Graph, # graph with flow attribute set on the nodes position: str, # current positions total: int, # current total steps_left: int, ): """ Dummy recur...
danieltsoukup/adventofcode
2022/code/archive/day16_part1.py
day16_part1.py
py
5,423
python
en
code
0
github-code
18
[ { "api_name": "networkx.Graph", "line_number": 10, "usage_type": "attribute" }, { "api_name": "functools.cache", "line_number": 8, "usage_type": "name" }, { "api_name": "networkx.DiGraph", "line_number": 42, "usage_type": "attribute" }, { "api_name": "networkx.DiG...
34935049275
import pygame from pygame.math import Vector2 from Player import * from math import sin from math import cos from random import randint class CirclePattern(): """Lasers Fire inwards in a circular pattern""" def __init__(this, screen, laser, size, speed, radius, center, timeToLive = 1800): ### Universal...
taliyos/Retalion
Patterns.py
Patterns.py
py
6,912
python
en
code
2
github-code
18
[ { "api_name": "math.cos", "line_number": 37, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 38, "usage_type": "call" }, { "api_name": "pygame.math.Vector2", "line_number": 39, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 9...
74760308521
import numpy as np import torch from kuka import KukaCamEnv1, KukaCamEnv2, KukaCamEnv3 from agent import WBAgent, base1, base2, base3, ReplayBufferFast import csv import pickle import argparse from rich.progress import Progress, BarColumn, TimeElapsedColumn, TimeRemainingColumn def collect_demo(env, log_dir...
IRMVLab/BCLearning
learn.py
learn.py
py
7,534
python
en
code
4
github-code
18
[ { "api_name": "agent.base1", "line_number": 13, "usage_type": "name" }, { "api_name": "agent.base2", "line_number": 15, "usage_type": "name" }, { "api_name": "agent.base3", "line_number": 17, "usage_type": "name" }, { "api_name": "agent.ReplayBufferFast", "lin...
28914890968
#! /usr/bin/env python3 # coding: utf-8 from __future__ import annotations from unittest.mock import patch from flask import testing import pendulum from psycopg2.extensions import connection from gargbot_3000.health import queries from gargbot_3000.health.polar import PolarService, PolarUser from tests import conft...
eirki/gargbot_3000
tests/health/test_polar.py
test_polar.py
py
8,885
python
en
code
0
github-code
18
[ { "api_name": "psycopg2.extensions.connection", "line_number": 23, "usage_type": "name" }, { "api_name": "gargbot_3000.health.polar.PolarService.persist_token", "line_number": 25, "usage_type": "call" }, { "api_name": "gargbot_3000.health.polar.PolarService", "line_number": 2...
36228288123
from __future__ import print_function from googleapiclient.discovery import build from google.oauth2 import service_account from dotenv import load_dotenv import robin_stocks.robinhood as rs import time import os load_dotenv() SCOPES = ['https://www.googleapis.com/auth/spreadsheets'] SERVICE_ACCOUNT_FILE =...
leonidascaldwell/RobinhoodApp
CopyPositionsToGSheet.py
CopyPositionsToGSheet.py
py
3,114
python
en
code
0
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "google.oauth2.service_account.Credentials.from_service_account_file", "line_number": 15, "usage_type": ...
7722385195
from __future__ import annotations from typing import Final, Iterable import math import random from itertools import islice from pathlib import Path from traceback import format_exc # == PROBLEM == # Given a list of sequence statements, generate those sequences # ======== SETTINGS ======== # # Length of the seque...
Kodipher/utility-scripts
scripts/sequence_generator.py
sequence_generator.py
py
5,456
python
en
code
1
github-code
18
[ { "api_name": "typing.Final", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Final", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Final", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Final", "line_numbe...
38029894270
import matplotlib.pyplot as plt; import pandas as pd import numpy as np from sklearn import preprocessing from sklearn.cluster import KMeans from kneed import DataGenerator, KneeLocator from sklearn.neighbors import KNeighborsRegressor from sklearn.metrics import accuracy_score from sklearn import metrics from sklearn....
AhmedSayedMansour/Machine-Learning-papers
NSL-KDD dataset/Dataset1-V2.py
Dataset1-V2.py
py
22,429
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.normalize", "line_number": 32, "usage_type": "call" }, { "api_name": "sklea...
21281276297
# -*- coding: utf-8 -*- """ Spyder Editor Este é um arquivo de script temporário. """ ''' Uma bola é lançada ao ar. Suponha que sua altura h(t), em metros, t segundos após o lançamento, seja: h(t)=−t2+4t a) Faça o gráfico da altura em função do tempo. Não se esqueça de indicar o significado de cada eix...
barbara-barbosa/Bases-computacionais
tarefa5barbara.py
tarefa5barbara.py
py
834
python
pt
code
0
github-code
18
[ { "api_name": "numpy.arange", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 26, "usage_type": "name" }, { "api_name": "matplotlib.py...
33959017648
import json dict_data={"name":"zhangsan","age":18} str_data="this is a str" # 序列化为json串 print(json.dumps(dict_data)) print(json.dumps(str_data)) # json串反序列化 loads = json.loads(json.dumps(dict_data)) print(loads) def student2dict(std): return { 'name': std.name, 'age': std.age, } class Stu(...
you071012/python
machinelearn/learn/base/json_demo.py
json_demo.py
py
632
python
zh
code
0
github-code
18
[ { "api_name": "json.dumps", "line_number": 7, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 8, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 11, ...
6215522416
''' Author: Nolan McCarthy Contact: nolanrmccarthy@gmail.com Version: 200312 This is a class definition and function definition file for parsing AE signals as developed by the Daly Lab ''' from scipy import signal import numpy as np import matplotlib.pyplot as plt import pandas from scipy.stats import linregress na...
nolanlad/SAX
ae_measure2.py
ae_measure2.py
py
5,789
python
en
code
1
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.isnan", "line_numbe...
5903719230
#!/usr/bin/env python # coding: utf-8 import sqlite3 import datetime import matplotlib.pyplot as plt import matplotlib.dates as mdates DB_NAME = "/home/pi/DB/sense_hat_weather.db" #DB_NAME = "/home/nobuo/Workspese/raspi_sensor/sense_hat_weather.db" TABLE_NAME = "temperature" def get_db_data(start, end): """ 指定した...
NobuoTsukamoto/raspi_sensor
amedas.py
amedas.py
py
5,261
python
ja
code
0
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 30, "usage_type": "call" }, { "api_name": "matplotlib.dates.AutoDateLocator", "line_number": 62, "usage_type": "call" }, { "api_name": "matplotlib.dates", "line_number": 62, "usage_type": "name" }, { "api_name": "mat...
17551642406
from detect import load_img, convert_gray_img, nomalize_img, draw_rectangle, save_img from typing import List import numpy as np import pytesseract pytesseract.pytesseract.tesseract_cmd = r"/usr/bin/tesseract" class Receipt(): def __init__(self): print('OcrReceipt is generated') sel...
MyRefrigerator/server
backup/ocr_backup.py
ocr_backup.py
py
3,637
python
en
code
0
github-code
18
[ { "api_name": "pytesseract.pytesseract", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pytesseract.image_to_data", "line_number": 62, "usage_type": "call" }, { "api_name": "pytesseract.Output", "line_number": 62, "usage_type": "attribute" }, { "api...
23736885759
import pygame from PyEvolv.assets.font import FONT from PyEvolv.assets.icons import LOGO_PATH import numpy as np class StartingScreen: def __init__(self, height, width, bg_color, primary_color, secondary_color): self.height = height self.width = width self.bg_color = bg_color self....
peer-rh/PyEvolv
PyEvolv/screens/start_screen.py
start_screen.py
py
3,659
python
en
code
0
github-code
18
[ { "api_name": "PyEvolv.assets.font.FONT", "line_number": 15, "usage_type": "name" }, { "api_name": "pygame.Surface", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pygame.MOUSEBUTTONDOWN", "line_number": 29, "usage_type": "attribute" }, { "api_name...
8607198731
#call this file to run the game from board import Board from utils import other_color import argparse #bots from bots.randombot.randombot import * from bots.bot_fouad import fouad_bot from simpbot import simpbot from bots.date_bot.date_bot import date_bot from bots.odd_bot.odd_bot import odd_bot from bots.forward_bot...
alrijleh/chess
game.py
game.py
py
2,782
python
en
code
0
github-code
18
[ { "api_name": "simpbot.simpbot", "line_number": 16, "usage_type": "name" }, { "api_name": "bots.bot_fouad.fouad_bot", "line_number": 17, "usage_type": "name" }, { "api_name": "bots.date_bot.date_bot.date_bot", "line_number": 19, "usage_type": "name" }, { "api_name...
15703214215
#!/usr/bin/env python3 import warnings import tensorflow as tf import matplotlib.pyplot as plt from topo_defect_net import load_data import os import json from topo_defect_net import interp_predict import argparse import matplotlib.style as style style.use("fivethirtyeight") os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" t...
brianfakhoury/Experimental-Defect-LSTM-With-Signal-Processing
analyze_model.py
analyze_model.py
py
5,361
python
en
code
2
github-code
18
[ { "api_name": "matplotlib.style.use", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 12, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "tensorflow.comp...
32499924079
"""transformer (attention). encoder: [Self-Attention, Feed-forward] x n decoder: [Self-Attention, Source-Target-Attention, Feed-forward] x n """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy # Dependency imports from six.moves import xrange ...
renqianluo/dense_t2t
transformer_dense_new.py
transformer_dense_new.py
py
12,202
python
en
code
0
github-code
18
[ { "api_name": "tensor2tensor.utils.t2t_model.T2TModel", "line_number": 31, "usage_type": "attribute" }, { "api_name": "tensor2tensor.utils.t2t_model", "line_number": 31, "usage_type": "name" }, { "api_name": "copy.copy", "line_number": 36, "usage_type": "call" }, { ...
6208560695
import asyncio from store import RedisStore async def go(): store = RedisStore() value = await store.get('x') print(value) await store.set('s', 123) value = await store.get('s') print(value) def main(): "The main entrance" loop = asyncio.get_event_loop() try: loop.run...
lcgong/alchemy
busiserv/cache/main.py
main.py
py
564
python
en
code
1
github-code
18
[ { "api_name": "store.RedisStore", "line_number": 7, "usage_type": "call" }, { "api_name": "store.get", "line_number": 8, "usage_type": "call" }, { "api_name": "store.set", "line_number": 11, "usage_type": "call" }, { "api_name": "store.get", "line_number": 13,...
25785226609
from os import getenv import spacy import tweepy from src.models import DB, User, Tweet TWITTER_CONSUMER_KEY = getenv('TWITTER_CONSUMER_KEY') TWITTER_CONSUMER_SECRET = getenv('TWITTER_CONSUMER_SECRET') TWITTER_ACCESS_TOKEN = getenv('TWITTER_ACCESS_TOKEN') TWITTER_ACCESS_TOKEN_SECRET = getenv('TWITTER_ACCES...
alex000kim/twitoff-app
src/twitter.py
twitter.py
py
2,062
python
en
code
0
github-code
18
[ { "api_name": "os.getenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 11, "u...
13340678846
from distutils import dist from turtle import color import numpy as np import matplotlib.pyplot as plt path1 = "/home/adi99/Documents/DRDO-project/milestone-2/Data/Overtake/data/overtake-10-obstacle-default.txt" path2 = "/home/adi99/Documents/DRDO-project/milestone-2/Data/Overtake/data/overtake-10-obstacle-default.txt...
ADI201998/MPC_Acado
plot_obs.py
plot_obs.py
py
1,507
python
en
code
0
github-code
18
[ { "api_name": "numpy.loadtxt", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_nu...
71470917481
import io import os # Imports the Google Cloud client library from google.cloud import vision # Instantiates a client client = vision.ImageAnnotatorClient() # The name of the image file to annotate file_name = os.path.abspath('wakeupcat.jpg') # Loads the image into memory with io.open(file_name, 'rb') as image_file...
dkick/imgscan
py/django/imgscan/tests/imgscan.py
imgscan.py
py
807
python
en
code
0
github-code
18
[ { "api_name": "google.cloud.vision.ImageAnnotatorClient", "line_number": 8, "usage_type": "call" }, { "api_name": "google.cloud.vision", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_na...
36449053732
""" words = ["wrt","wrf","er","ett","rftt"] w =>r =>t w =>r =>f e =>r e =>t =>t r =>f =>t =>t w e r r r t f t f ...
ajinkyaaa/Leetcode_DSA
Tests/alienDic.py
alienDic.py
py
2,167
python
en
code
0
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 56, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 57, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 61, "usage_type": "call" } ]
39728742249
import json import pygal from country_code import get_country_code from pygal.style import CleanStyle as RBS # Список заполяется данными filename = '.\\data\\gdp_json.json' with open(filename) as f: gdp_data = json.load(f) # Построение словаря с данными численности населения cc_gdps = {} for gdp_dict in gdp_data...
nag78/Python_learn
python_work/world_gdp.py
world_gdp.py
py
746
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "country_code.get_country_code", "line_number": 18, "usage_type": "call" }, { "api_name": "pygal.style.CleanStyle", "line_number": 22, "usage_type": "call" }, { "api_name": "pygal....
25332532062
# code loaned from https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc_crossval.html from scipy import interp from sklearn.metrics import roc_curve, auc from sklearn.model_selection import StratifiedKFold from tqdm import tqdm_notebook as tqdm import numpy as np from matplotlib import pyplot as plt ...
novinsh/signaling_heroes
utils/roc_auc.py
roc_auc.py
py
1,868
python
en
code
1
github-code
18
[ { "api_name": "sklearn.model_selection.StratifiedKFold", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 15, "usage_type": "call" }, { "api_name": "tqdm.tqdm_notebook", "line_number": 18, "usage_type": "call" }, { "api_nam...
73519594601
from bs4 import BeautifulSoup def get_text_of_html(doc): """ This function is for extracting text content from an HTML string. Input: HTML style string. Output: Extracted text content string. """ soup = BeautifulSoup(doc, features='lxml') for script in soup(['script', 'style']): ...
coooola-lzh/similarity-search
original_data_doc2vec/get_text_of_html.py
get_text_of_html.py
py
528
python
en
code
0
github-code
18
[ { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" } ]
33506086303
# -*- coding: utf-8 -*- """ Created on Wed Aug 16 12:54:18 2023 @author: 91913 """ from pytube import YouTube url = "https://youtu.be/FQTQD3WHlCk?t=1" sample_video = YouTube(url) print("Video title:", sample_video.title) print("Thumbnail URL:", sample_video.thumbnail_url) video_stream = sample_video.streams.get_hi...
Pki03/youtube_video_downloader
prjt2_ytube_downlaoader.py
prjt2_ytube_downlaoader.py
py
522
python
en
code
0
github-code
18
[ { "api_name": "pytube.YouTube", "line_number": 11, "usage_type": "call" } ]
19727855023
#Instructions below import psycopg2 from psycopg2 import OperationalError from psycopg2.errorcodes import UNIQUE_VIOLATION from psycopg2 import errors from dotenv import dotenv_values #load env vars (like db name, user etc.. for program) def get_env_db_info_dict(): config = dotenv_values(".env") return confi...
Evyatar-Kraus/DI_Bootcamp
week_6/day_5/ex_py.py
ex_py.py
py
5,899
python
en
code
0
github-code
18
[ { "api_name": "dotenv.dotenv_values", "line_number": 12, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 18, "usage_type": "call" }, { "api_name": "psycopg2.OperationalError", "line_number": 26, "usage_type": "name" }, { "api_name": "psyco...
74658862121
from rest_framework import viewsets from rest_framework.views import APIView from rest_framework.response import Response from backend.recordmanagement import models, serializers from backend.static import error_codes from backend.api.errors import CustomError class RecordDocumentTagViewSet(viewsets.ModelViewSet): ...
jehob/rlc_app
backend/recordmanagement/views/record_document_tag.py
record_document_tag.py
py
1,653
python
en
code
7
github-code
18
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 10, "usage_type": "name" }, { "api_name": "backend.recordmanagement.models.RecordDocumentTag.objects.all", "line_numbe...
23872806084
from flask import current_app from travelbudget.database import db_session from travelbudget.models import Account, Expense, MoneyExchange, Trip from travelbudget.utilities import summary import flask import datetime DAILY_CURRENCY_ID = 1 CASH_ACCOUNT_ID = 1 CASH_CATEGORY_ID = 4 USER_ID = 1 exchanges_bp = flask.Bluepr...
nateoaks/travelbudget
src/travelbudget/exchanges.py
exchanges.py
py
3,422
python
en
code
0
github-code
18
[ { "api_name": "flask.Blueprint", "line_number": 12, "usage_type": "call" }, { "api_name": "travelbudget.models.MoneyExchange.query.get", "line_number": 18, "usage_type": "call" }, { "api_name": "travelbudget.models.MoneyExchange.query", "line_number": 18, "usage_type": "a...
22248180583
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 5 14:18:24 2018 @author: ninabg """ import numpy as np import sympy as sy import time import pickle import matplotlib.pyplot as plt from vitber1_analytiskF import analytical_solution from vitber1_funksjoner import chebyshev,Lagrange,rho,K,Newton_...
Camilbk/Blomsterbarna
vitber1_oppg5.py
vitber1_oppg5.py
py
1,963
python
en
code
0
github-code
18
[ { "api_name": "numpy.pi", "line_number": 24, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.polynomial.legendre.leggauss", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.p...
13669033691
from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton from flows.callbacks import Callbacks from flows.main_menu import main_menu from models.User import User from planfix.planfix import create_payment_media_task user_dict = {} bot_dict = {} first_message = "Готовы ли оплатить правовую консультацию? (о...
AntonyHatchet/tg-bot
flows/other/other_media.py
other_media.py
py
3,220
python
ru
code
0
github-code
18
[ { "api_name": "telebot.types.InlineKeyboardMarkup", "line_number": 17, "usage_type": "call" }, { "api_name": "telebot.types.InlineKeyboardButton", "line_number": 20, "usage_type": "call" }, { "api_name": "flows.callbacks.Callbacks.other_media_yes", "line_number": 21, "usa...
9170608389
from datetime import datetime from flask import Flask, jsonify from flask_cors import CORS app = Flask(__name__) CORS(app) @app.route('/msg', methods=['GET']) def message(): response = jsonify({ 'message': 'hello', 'time': datetime.now().strftime('%Y/%m/%d %H:%M:%S') }) return response if...
wararaki718/scrapbox
sample_js/sample_react_axios/sample_server/sample.py
sample.py
py
367
python
en
code
1
github-code
18
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "...
13037819642
import os import pickle import sys BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(BASE_DIR) import numpy as np import pandas as pd from scipy import stats from sklearn.cluster import KMeans as _KMeans from sklearn.preprocessing import StandardScaler, MinMaxScaler from Abstract...
yizhaocs/python-jupyter-notebook
auto-turning-clustering/GMeans.py
GMeans.py
py
6,625
python
en
code
0
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path.append", "line...
5144638889
from django import forms from core.models import STANDARD_CHAR_SIZE, ToDo, CHOICES class ToDoForm(forms.ModelForm): title = forms.CharField( max_length=STANDARD_CHAR_SIZE, required=False, widget=forms.TextInput(attrs={ 'class': 'form-control', 'name': 'title', 'pla...
gauravdaunde/whattodo
core/forms.py
forms.py
py
741
python
en
code
0
github-code
18
[ { "api_name": "django.forms.ModelForm", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 7, "usage_type": "call" }, { "api_name": "django.f...
22324662734
import sys import os sys.path.append(os.getcwd()) import threading import time import glob import numpy as np from utils.file_io import * from argparse import ArgumentParser import speechmetrics as sm MAX_THREAD = 3 root = os.getcwd() MUSDB_TEST = "data/musdb18hq/test" def sdr(references, estimates): # compute S...
haoheliu/2021-ISMIR-MSS-Challenge-CWS-PResUNet
evaluator/eval.py
eval.py
py
5,653
python
en
code
110
github-code
18
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 3, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 1...
35837380013
#coding=utf-8 import configparser def write_ini(path='config.ini', node='proxy', child='proxy', content=None): """写入ini文件""" config=configparser.ConfigParser() config.read(path, encoding='utf-8') try: # config.add_section("session") #增加节点 config.set(node, child, content) except con...
mjwlyzq/search_train
read_write_ini.py
read_write_ini.py
py
893
python
en
code
0
github-code
18
[ { "api_name": "configparser.ConfigParser", "line_number": 6, "usage_type": "call" }, { "api_name": "configparser.DuplicateSectionError", "line_number": 12, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser", "line_number": 20, "usage_type": "call" },...
41363780745
# coding:utf-8 # 第38课 数据库 日志系统 import peewee from peewee import * db = SqliteDatabase("test.db") class Price(peewee.Model): timestamp = peewee.DateTimeField(primary_key = True) BTCUSD = peewee.FloatField() class Meta: database = db def test_peewee(): Price.create_table() price = Price(timestamp = "...
zwdnet/PythonPractice
Investment/database.py
database.py
py
441
python
en
code
439
github-code
18
[ { "api_name": "peewee.Model", "line_number": 12, "usage_type": "attribute" }, { "api_name": "peewee.DateTimeField", "line_number": 13, "usage_type": "call" }, { "api_name": "peewee.FloatField", "line_number": 14, "usage_type": "call" } ]
70805881639
import streamlit as st from apps import home,employee, equipment, payroll, projects, expanceReport, consumable, projectviewer, search, rtc from streamlit_option_menu import option_menu import otsDBConnector as otdb menu=["Home","Project Dashboard","Project Management","Employee database","Equipment database","Con...
deepayannandy/OTProject
mainApp.py
mainApp.py
py
1,887
python
en
code
0
github-code
18
[ { "api_name": "streamlit.sidebar", "line_number": 16, "usage_type": "attribute" }, { "api_name": "streamlit_option_menu.option_menu", "line_number": 17, "usage_type": "call" }, { "api_name": "streamlit.markdown", "line_number": 35, "usage_type": "call" }, { "api_n...
17941487895
import os # import bot.database as database from datetime import datetime from dotenv import load_dotenv from discord.utils import find from discord.ext import commands from bot.cogs.quotes import Quote from discord.ext.commands.errors import CommandNotFound, MissingRequiredArgument load_dotenv() TIME_NOW = datetime...
JoaoMWatson/pensa-bot
bot/PensaBot.py
PensaBot.py
py
2,280
python
en
code
2
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" }, { "api_name": "os.getenv"...
75107784360
import time import datetime import math from django.core.management import BaseCommand from django.db import transaction from django.db.models import Q from chemical.models import * from decodify.helpers import remaining_time class Command(BaseCommand): help = "Add chemical category - files natural.txt, popular...
EugeneBilenko/partial
chemical/management/commands/MassAssignCategory.py
MassAssignCategory.py
py
1,402
python
en
code
0
github-code
18
[ { "api_name": "django.core.management.BaseCommand", "line_number": 13, "usage_type": "name" }, { "api_name": "django.db.transaction.atomic", "line_number": 29, "usage_type": "call" }, { "api_name": "django.db.transaction", "line_number": 29, "usage_type": "name" }, { ...
73881734120
import json, re from django.views.decorators.debug import sensitive_post_parameters from django.utils.decorators import method_decorator from django.db import transaction from django.db import models from django.conf import settings from django.http import HttpResponse, JsonResponse from django.contrib.auth import get_...
AlimardanAhmadov/agatos
employee/views.py
views.py
py
14,001
python
en
code
0
github-code
18
[ { "api_name": "django.utils.decorators.method_decorator", "line_number": 28, "usage_type": "call" }, { "api_name": "django.views.decorators.debug.sensitive_post_parameters", "line_number": 29, "usage_type": "call" }, { "api_name": "django.contrib.auth.get_user_model", "line_n...
43187918070
import json from flask import make_response, request from flask_restx import Namespace, Resource from cnaas_nms.api.generic import empty_result from cnaas_nms.app_settings import api_settings from cnaas_nms.db.device import Device, DeviceType from cnaas_nms.db.helper import json_dumper from cnaas_nms.db.session impor...
SUNET/cnaas-nms
src/cnaas_nms/api/settings.py
settings.py
py
3,212
python
en
code
66
github-code
18
[ { "api_name": "cnaas_nms.db.settings.get_settings_root", "line_number": 16, "usage_type": "call" }, { "api_name": "flask_restx.Namespace", "line_number": 19, "usage_type": "call" }, { "api_name": "cnaas_nms.version.__api_version__", "line_number": 19, "usage_type": "argum...
6412901088
from os import get_inheritable from django.shortcuts import render from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status import requests import json # Create your views here. class All_Issues(APIView): def get(self,request,repo, repo_name): ...
mabhutidlodlo/Bitcast
github_issues/views.py
views.py
py
1,388
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.views.APIView", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 21, "usage_type": "call" }, { "api_name": "rest_framework.r...
9981288385
# -*- coding: utf-8 -*- from collections import OrderedDict class LRU_Cache(object): def __init__(self, capacity): # Initialize class variables self.capacity = capacity self.cache = OrderedDict() assert capacity > 0, 'Size should be greater than 0' def get(s...
akarr24/Udacity-Data-Strucutres-and-Algorithms-
Project 2/problem_1.py
problem_1.py
py
2,241
python
en
code
0
github-code
18
[ { "api_name": "collections.OrderedDict", "line_number": 8, "usage_type": "call" } ]
41910614700
import logging from django.core.management.base import BaseCommand from public_data.models import CouvertureSol, UsageSol logging.basicConfig(level=logging.INFO) class Command(BaseCommand): help = "This will reevaluate parent fields of all instances of Couverture and Usage" def handle(self, *args, **optio...
MTES-MCT/sparte
public_data/management/commands/set_parent.py
set_parent.py
py
625
python
en
code
5
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 10, "usage_type": "name" }, { "api_n...
24305355472
from controllers.create_app_route import app_route from flask import request, jsonify from flask_jwt_extended import jwt_required, get_jwt_identity from helper import current_user from models import Department, Employee from models.database import db import flask import sqlalchemy.exc @app_route.route('/emp...
ska034/first_api_project
controllers/employee/delete_employee.py
delete_employee.py
py
1,343
python
en
code
0
github-code
18
[ { "api_name": "flask_jwt_extended.get_jwt_identity", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "name" }, { "api_name...
3317940427
# -*- coding: utf-8 -*- """ Created on Tue Mar 27 18:22:43 2018 @author: PavitrakumarPC """ import keras import numpy as np import cv2 import os import pandas as pd import matplotlib.pyplot as plt from keras.layers import Conv2D, Dense, Input, Dropout, Flatten, Activation, MaxPooling2D, AveragePooling2D,...
pavitrakumar78/Street-View-House-Numbers-SVHN-Detection-and-Classification-using-CNN
train_digit_classification.py
train_digit_classification.py
py
9,055
python
en
code
59
github-code
18
[ { "api_name": "keras.backend.set_image_dim_ordering", "line_number": 25, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 25, "usage_type": "name" }, { "api_name": "numpy.array_split", "line_number": 28, "usage_type": "call" }, { "api_name": "...
39024524465
import torch from torch import nn import numpy as np import torchvision class ResNetEmo(nn.Module): def __init__(self, num_classes=8, version=18): super().__init__() if version == 18: resnet = torchvision.models.resnet18(pretrained=True) modules = list(resnet.children())[:...
HKUST-NISL/ABAW5
models/res.py
res.py
py
924
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torchvision.models.resnet18", "line_number": 12, "usage_type": "call" }, { "api_name": "torchvision.m...
17460276486
from aiogram import F, types, Bot from aiogram.dispatcher.fsm.context import FSMContext from aiogram.types import Message from config import CONFIG from crud import CRUDUsers, CRUDBots, CRUDChats from keyboards.inline.users.formMain import MyCallback from loader import dp from states.users.mainState import UserStates ...
Vladvlad9/FeedbackBot
handlers/users/FormMain.py
FormMain.py
py
10,389
python
ru
code
0
github-code
18
[ { "api_name": "aiogram.types.CallbackQuery", "line_number": 13, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 13, "usage_type": "name" }, { "api_name": "keyboards.inline.users.formMain.MyCallback", "line_number": 13, "usage_type": "name" }, ...
6218922577
import io import json import xlrd from common.exceptions import ValidationError from common.log import logger from conf import dataapi_settings from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_noop from openpyxl import load_workbook from ...collectors.utils.language imp...
Tencent/bk-base
src/api/datahub/access/collectors/file_collector/access.py
access.py
py
7,460
python
en
code
85
github-code
18
[ { "api_name": "base_collector.BaseAccess", "line_number": 27, "usage_type": "name" }, { "api_name": "serializers.FileResourceSerializer", "line_number": 34, "usage_type": "name" }, { "api_name": "base_collector.BaseAccessTask.create", "line_number": 39, "usage_type": "cal...
73920646759
from django.http import Http404 from django.utils.translation import gettext_lazy as _ from django.views.generic import DetailView, ListView from videos.models import Playlist, Video class BaseDetailView(DetailView): model = Video queryset = Video.objects.all() context_object_name = 'video' pk_url_kwa...
Zadigo/myyoutube
videos/_views/feed.py
feed.py
py
2,615
python
en
code
1
github-code
18
[ { "api_name": "django.views.generic.DetailView", "line_number": 7, "usage_type": "name" }, { "api_name": "videos.models.Video", "line_number": 8, "usage_type": "name" }, { "api_name": "videos.models.Video.objects.all", "line_number": 9, "usage_type": "call" }, { "...
5881846751
import requests def get_weather_desc_and_temp(): api_key = "f37a6547370d6887a661561d1d126c5d" city = "Orlando" url = "http://api.openweathermap.org/data/2.5/weather?q="+city+"&appid="+api_key+"&units=imperial" request = requests.get(url) json = requests.json() print(json) description = j...
jaredg-ai/pratical-python
open_weather.py
open_weather.py
py
1,133
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.json", "line_number": 9, "usage_type": "call" } ]
214490186
import numpy as np import xarray as xr import matplotlib.pylab as plt import yaml from os.path import join import os from glob import glob import platform import pandas as pd def get_config(): with open("config.yml", 'r') as stream: base_url = yaml.load(stream) return base_url def seasonal_ds(fname,...
OSI-SAF-tools/validations_gridded
postprocess/aggregate.py
aggregate.py
py
2,365
python
en
code
1
github-code
18
[ { "api_name": "yaml.load", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.ExcelWriter", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 40, "usage_type": "call" }, { "api_name": "pandas.Series", "li...
40096744841
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jun 6 14:54:32 2019 @author: smrak """ import satio import plot1d import plot2d import numpy as np from datetime import datetime import matplotlib.pyplot as plt fn = '/home/smrak/Documents/LWS2019/28may17/swarm/SW_EXTD_EFIA_LP_HM_20170528T000000_2017...
aldebaran1/satutils
swarm_cdf.py
swarm_cdf.py
py
944
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "call" }, { "api_name": "satio.readSWARMcdf", "line_number": 19, "usage_type": "call" }, { "api_name": "satio.hpf", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.int64", "lin...
15028156099
from django.shortcuts import render, redirect, get_object_or_404 from bootcamp.feeds.views import feeds from django.contrib.auth.models import User from bootcamp.feeds.models import Feed from bootcamp.feeds.views import FEEDS_NUM_PAGES from django.core.paginator import Paginator from django.contrib.auth.decorators impo...
oussa/bootcamp-ihealth
bootcamp/ihealth/views.py
views.py
py
5,241
python
en
code
0
github-code
18
[ { "api_name": "bootcamp.feeds.views.feeds", "line_number": 22, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 24, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 74, "usage_type": "call" }, { "api_na...
39492102854
import urllib, json, pymongo, os from dateutil.parser import parse DIVVY_URL = "http://divvybikes.com/stations/json" def query(): raw_str = urllib.urlopen(DIVVY_URL).read() data = json.loads(raw_str) client = pymongo.connection.Connection() client['divvy']['hits'].save(data) log_me(parse(data['exe...
gabegaster/divvy_scraper
divvy_scraper.py
divvy_scraper.py
py
541
python
en
code
0
github-code
18
[ { "api_name": "urllib.urlopen", "line_number": 7, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 8, "usage_type": "call" }, { "api_name": "pymongo.connection.Connection", "line_number": 9, "usage_type": "call" }, { "api_name": "pymongo.connecti...
38583638743
import cv2 as cv; # Resizing function def rescaleFrame(frame, scale): #Images, Videos and Live Video width = int(frame.shape[1] * scale); height = int(frame.shape[0] * scale); dimensions = (width, height); return cv.resize(frame, dimensions, interpolation = cv.INTER_AREA); def changeRes(width, ...
rajibhasan01/image_processing
rescale.py
rescale.py
py
989
python
en
code
1
github-code
18
[ { "api_name": "cv2.resize", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_numb...
75424638440
import numpy as np import cv2 def makecounter(path): # カーネルを定義 kernel = np.ones((5,5), np.uint8) kernel[0,0] = kernel[0,4] = kernel[4,0] = kernel[4,4] = 0 # gray = cv2.imread(path, cv2MREAD_GRAYSCALE) img = cv2.imread(path, cv2.IMREAD_UNCHANGED) # if img.shape[2] == 4: # mask = img[:,:,3] == 0 # i...
Tsr-rina/tryon_app_c
src/django_app/senga.py
senga.py
py
816
python
en
code
0
github-code
18
[ { "api_name": "numpy.ones", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.IMREAD_UNCHANGED", "line...
14665993424
from flask import Flask, render_template, request import csv app = Flask(__name__) @app.route('/') def home_page(): return render_template('index.html') def write_csv(data): with open('email-database.csv', mode='a', newline='') as database: email = data["email"] csv_writer = csv.writer(data...
gandhirutul/teaser-website
main.py
main.py
py
660
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 9, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 15, "usage_type": "call" }, { "api_name": "csv.QUOTE_MINIMAL", "l...
14098021439
import sqlite3 import werkzeug from flask import Flask, request, Response, render_template from jinja2 import Environment, PackageLoader from markupsafe import escape from flask import make_response from flask import session from flask import Flask, redirect # a if condition else b from models.form import LoginForm...
stoull/Vault
app.py
app.py
py
14,057
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 21, "usage_type": "call" }, { "api_name": "jinja2.Environment", "line_number": 23, "usage_type": "call" }, { "api_name": "jinja2.PackageLoader", "line_number": 23, "usage_type": "call" }, { "api_name": "models.authorizat...
34786666184
import asyncio from logging.config import fileConfig from sqlalchemy import engine_from_config, pool from sqlalchemy.ext.asyncio import AsyncEngine from alembic import context from app import models from app.settings import settings def get_database_url() -> str: return settings.sqlalchemy_database_url config...
hutanmihai/FMI
Anul II/Semestrul II/MDS/ProiectMDS/calorie-tracker-backend/alembic/env.py
env.py
py
1,646
python
en
code
1
github-code
18
[ { "api_name": "app.settings.settings.sqlalchemy_database_url", "line_number": 13, "usage_type": "attribute" }, { "api_name": "app.settings.settings", "line_number": 13, "usage_type": "name" }, { "api_name": "alembic.context.config", "line_number": 16, "usage_type": "attri...
71682617960
import socket import requests import tkinter as tk from tkinter import ttk from concurrent.futures import ThreadPoolExecutor import threading def check_port(port): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(1) try: s.connect(('localhost', port)) s.close()...
TheMime3/Tools-and-Programs
Port Scanner.py
Port Scanner.py
py
4,402
python
en
code
0
github-code
18
[ { "api_name": "socket.socket", "line_number": 9, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 9, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 9, "usage_type": "attribute" }, { "api_name": "socket.error",...
988997678
import pyaudio import wave CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 16000 RECORD_SECONDS = 2 WAVE_OUTPUT_FILENAME = "Oldboy.wav" p = pyaudio.PyAudio() stream = p.open(format=FORMAT, channels=CHANNELS, rate=RATE, input=True, ...
116Gegui/Demon
audio.py
audio.py
py
5,209
python
en
code
0
github-code
18
[ { "api_name": "pyaudio.paInt16", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pyaudio.PyAudio", "line_number": 11, "usage_type": "call" }, { "api_name": "wave.open", "line_number": 33, "usage_type": "call" }, { "api_name": "json.dumps", "line_...
8379081275
from django.shortcuts import render, get_object_or_404 from django.contrib import messages from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.core.exceptions import ObjectDoesNotExist from apps.tracker.forms import TrackerForm, RecordForm from .models import Tracker fr...
manerMoniar/EyeTracking_AS
eyetracking/apps/tracker/views.py
views.py
py
2,476
python
en
code
0
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 13, "usage_type": "call" }, { "api_name": "apps.tracker.forms.TrackerForm", "line_number": 19, "usage_type": "call" }, { "api_name": "django.contrib.messages.success", "line_number": 23, "usage_type": "call" }, {...