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
73870578293
from django.urls import path from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenVerifyView ) from .views import BookViewSet, UsernameView from rest_framework.routers import DefaultRouter app_name = 'api' router = DefaultRouter() router.register(r'books', BookViewSet, basename='book') urlp...
NorthOC/book-dashboard
api/urls.py
urls.py
py
503
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 11, "usage_type": "call" }, { "api_name": "views.BookViewSet", "line_number": 12, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 15, "usage_type": "call" }, { "api_n...
15988612579
import cv2 import argparse import numpy as np from scipy.misc import imresize def caps_are_open(caps): """Return true if all caps are open""" return all([c.isOpened() for c in caps]) def join_frames(frames,verbose=False): size = frames[0].shape for i,frame in enumerate(frames): frames[i] = i...
maxkferg/dynamic-worksite-models
src/method/videos/join.py
join.py
py
2,061
python
en
code
0
github-code
21
[ { "api_name": "scipy.misc.imresize", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.hstack", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.hstack", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.vstack", "lin...
71748407732
import requests url = "https://www.icanhazdadjoke.com/search" response = requests.get( url, headers={"Accept": "application/json"}, params={"term": "dog"} ) data = response.json() for result in data["results"]: print(result["joke"], end="\n\n" + "*" * 90 + "\n\n")
BrettMcGregor/udemy-colt-steele
request_parameters.py
request_parameters.py
py
284
python
en
code
1
github-code
21
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" } ]
37404197625
import sys import typing as tp import os from collections import OrderedDict from collections import abc from itertools import chain from io import StringIO from io import BytesIO import datetime from urllib import request import tempfile import numpy as np # min/max fail on object arrays # handle nan in object b...
CrepeGoat/FEHnt
static_frame/core/util.py
util.py
py
35,737
python
en
code
0
github-code
21
[ { "api_name": "numpy.dtype", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 54, "usage_type": "call" }, { "api_name": "sys.version_info", "line_number": 57, "usage_type": "attribute" }, { "api_name": "numpy.int_", "line_...
4770513562
#!/usr/bin/env python3 # YouTube Music Playlist Downloader version = "1.2.3" import os import re import json import time import requests import subprocess from PIL import Image from io import BytesIO from pathlib import Path from yt_dlp import YoutubeDL, postprocessor from urllib.parse import urlparse, parse_qs from m...
onnowhere/youtube_music_playlist_downloader
youtube_music_playlist_downloader.py
youtube_music_playlist_downloader.py
py
40,131
python
en
code
57
github-code
21
[ { "api_name": "yt_dlp.postprocessor.common", "line_number": 27, "usage_type": "attribute" }, { "api_name": "yt_dlp.postprocessor", "line_number": 27, "usage_type": "name" }, { "api_name": "json.dump", "line_number": 38, "usage_type": "call" }, { "api_name": "subpr...
15678377655
from flask.cli import AppGroup from .users import seed_users, undo_users from .flashcards import seed_flashcards, undo_flashcards from .flashcard_sets import seed_flashcard_sets, undo_flashcard_sets from .quizzes import seed_quizzes, undo_quizzes from .questions import seed_questions, undo_questions from .topics import...
Tristanleif1/NREMT-prep-app
app/seeds/__init__.py
__init__.py
py
1,461
python
en
code
0
github-code
21
[ { "api_name": "flask.cli.AppGroup", "line_number": 13, "usage_type": "call" }, { "api_name": "app.models.db.environment", "line_number": 19, "usage_type": "name" }, { "api_name": "users.undo_users", "line_number": 24, "usage_type": "call" }, { "api_name": "topics....
37982773407
__version__ = "0.1.0" import json from logging import config, getLogger from os.path import dirname, join config_path = join(dirname(__file__), "config", "logging.json") logger = getLogger(__name__) with open(config_path) as f: logging_config = json.load(f) config.dictConfig(logging_config) logger.info("ini...
yktakaha4/kunitori-py
src/kunitori/__init__.py
__init__.py
py
334
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "json.load", "line_num...
13453847014
# 搜索引擎关键词提交爬虫:以Baidu和360为例 # 百度关键词接口:http://www.baidu.com/s?wd=keyword # 360关键词接口: http://www.so.com/s?q=keyword import requests url = 'https://www.baidu.com/s' keyword = 'python' try: kv = {'wd': keyword} r = requests.get(url, params=kv) print(r.request.url) # 发给百度的request对应的url链接是什么? r.rais...
Liangkang19/PyCharmFile
SpiderTest/TomSpider/Requests/BaiduSpider.py
BaiduSpider.py
py
514
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" } ]
15490631792
import time import logging from abc import ABCMeta, abstractmethod from threading import Thread from subprocess import check_call, CalledProcessError import cv2 from vsn_client.common.utility import Config class VSNCamera(metaclass=ABCMeta): @abstractmethod def grab_image(self, slow_mode=False): ......
PUTvision/VSNClient
vsn_client/acquisition/camera.py
camera.py
py
2,857
python
en
code
0
github-code
21
[ { "api_name": "abc.ABCMeta", "line_number": 12, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 13, "usage_type": "name" }, { "api_name": "cv2.VideoCapture", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_FRAME_WI...
30625951767
"""Fibo using Generator""" import itertools def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b def fibo(generator, n): for i in range(n): yield next(generator) print(list(fibo(fibonacci(), 10))) def fib(): a, b = 0, 1 while True: yield a a...
kaushikamaravadi/Python_Practice
Transcend/fiboccani_generator.py
fiboccani_generator.py
py
375
python
en
code
0
github-code
21
[ { "api_name": "itertools.islice", "line_number": 25, "usage_type": "call" } ]
10552550286
from flask import (Blueprint, abort, flash, url_for, redirect, render_template, jsonify, request) from flaskr.models.models import Movies from flaskr.auth.auth import requires_auth from .forms import MoviesForm from datetime import datetime, timedelta movie = Blueprint('movies', __name__) # functi...
Ebra01/FSND-CAPSTONE
flaskr/movies/routes.py
routes.py
py
9,763
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "name" }, { "api_name": "datetime....
6264553010
import simplejson, urllib from com.threecrickets.prudence.util import InternalRepresentation def handle_init(conversation): conversation.addMediaTypeByName('text/html') def handle_post(conversation): if not conversation.internal: return 404 id = conversation.locals['com.threecrickets.prudence.disp...
tliron/prudence-java
components/reference/manual-examples/mvc-jinja/component/applications/jinja/libraries/dispatchers/jinja.py
jinja.py
py
1,059
python
en
code
0
github-code
21
[ { "api_name": "simplejson.loads", "line_number": 21, "usage_type": "call" }, { "api_name": "com.threecrickets.prudence.util.InternalRepresentation", "line_number": 22, "usage_type": "call" }, { "api_name": "urllib.quote", "line_number": 26, "usage_type": "call" } ]
26559244731
#!/usr/bin/env python3 """ This script plots the context data from the FIREBIRD-II mission. It accepts sc_id (3 or 4) and campaign number arguments, and looks for the most recent data in the firebird/Datafiles firectory. """ import spacepy.datamodel import numpy as np import matplotlib.pyplot as plt from matplotlib im...
mshumko/mission_tools
mission_tools/firebird/plot_context.py
plot_context.py
py
6,298
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 22, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_na...
4659069724
import torch import sys import os assert len(sys.argv) > 1, "You need to enter a checkpoint path." ckpt_path = sys.argv[1] target_dir = "checkpoints" if not os.path.exists(target_dir): os.mkdir(target_dir) ckpt = torch.load(ckpt_path) if "cfg" in ckpt: old_name = ckpt["cfg"]["model"]._name ...
NJUNLP/pydec
examples/roberta/change_fairseq_architecture.py
change_fairseq_architecture.py
py
784
python
en
code
7
github-code
21
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
13550840424
import math import numpy as np import pytest from numpy.testing import assert_allclose from plotly import graph_objects as go from ross.fluid_flow import fluid_flow as flow from ross.fluid_flow.fluid_flow import fluid_flow_example2 from ross.fluid_flow.fluid_flow_coefficients import ( calculate_oil_film_force, ...
petrobras/ross
ross/tests/test_fluid_flow.py
test_fluid_flow.py
py
11,239
python
en
code
99
github-code
21
[ { "api_name": "numpy.pi", "line_number": 32, "usage_type": "attribute" }, { "api_name": "ross.fluid_flow.fluid_flow.FluidFlow", "line_number": 41, "usage_type": "call" }, { "api_name": "ross.fluid_flow.fluid_flow", "line_number": 41, "usage_type": "name" }, { "api...
11566327813
from __future__ import unicode_literals from _socket import gaierror, error as socket_error from django.core.mail import EmailMultiAlternatives import logging import re from django.conf import settings from celery import chain, chord from celery.exceptions import SoftTimeLimitExceeded from paramiko import A...
gunnery/gunnery
gunnery/backend/tasks.py
tasks.py
py
10,676
python
en
code
755
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "gunnery.celery.app.task", "line_number": 24, "usage_type": "attribute" }, { "api_name": "gunnery.celery.app", "line_number": 24, "usage_type": "name" }, { "api_name": "cor...
9804466753
import asyncio tasks = [] async def handler(): while True: print("Sleeping...") await asyncio.sleep(1) async def dispatch(): _loop = asyncio.get_event_loop() task = loop.create_task(handler()) tasks.append(task) task = loop.create_task(handler()) tasks.append(task) async d...
tinylambda/keep
playground/asyncio_create_task_and_cancel.py
asyncio_create_task_and_cancel.py
py
1,090
python
en
code
1
github-code
21
[ { "api_name": "asyncio.sleep", "line_number": 9, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 13, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 29, "usage_type": "call" }, { "api_name": "asyncio.sl...
18651373546
# -*- coding:utf-8 -*- ''' 账户安全 tools 工具 wraps 外衣 (方法装饰器) current 当前 ''' from functools import wraps from flask import ( g, # global session, request, redirect, url_for, current_app, abort ) def login_required(func): @wraps(func) def decorated_function...
lize240810/HouseSystem
backend/safe.py
safe.py
py
1,286
python
zh
code
0
github-code
21
[ { "api_name": "flask.g", "line_number": 27, "usage_type": "argument" }, { "api_name": "flask.g.login_user", "line_number": 27, "usage_type": "attribute" }, { "api_name": "flask.session", "line_number": 29, "usage_type": "name" }, { "api_name": "flask.redirect", ...
73886033014
import time from selenium import webdriver from selenium.webdriver.common.by import By PAGE_URL = "http://orteil.dashnet.org/experiments/cookie/" # amount of time for the clicker to run, in seconds TIMEOUT = 300 # amount of time between checking for upgrades, in seconds CHECK_INTERVAL = 15 def buy_upgrade(): """...
Akshat511716/100DaysofCode
Day48/main.py
main.py
py
2,065
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.common.by.By.ID", "line_number": 15, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 15, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR", "line_number": 20, ...
32594808320
from .common import CommonCase class TestOpenAPICommonCase(CommonCase): @classmethod def setUpClassVars(cls, *args, **kwargs): super().setUpClassVars(*args, **kwargs) # we don't really care about which menu and profile we use # to read the OpenAPI specs cls.menu = cls.env.ref(...
nguyenductamlhp/servermns
addons/wms/shopfloor/tests/test_openapi.py
test_openapi.py
py
825
python
en
code
0
github-code
21
[ { "api_name": "common.CommonCase", "line_number": 4, "usage_type": "name" } ]
2496013828
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path('booking/', views.ticket, name='booking'), path('schedule/', views.schedule, name='schedule'), path('about/', views.about, name='about'), path('login/', views.login, name='login'), path('t...
gdawg32/SmartFerry
home/urls.py
urls.py
py
599
python
en
code
0
github-code
21
[ { "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", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
1661118520
import typing # from unittest import result class City(typing.NamedTuple): content : str name : str country : str cities = [City('Asia', 'Tokyo', 'JP'), City('Asia', 'Delhi', 'IN'), City('North America', 'Mexico City', 'MX'), City('North America', 'New York', 'US'), City('South America', 'São Paulo', '...
DRAGONINWAVE/for_little_sun
City_and_a_few_instances.py
City_and_a_few_instances.py
py
551
python
en
code
2
github-code
21
[ { "api_name": "typing.NamedTuple", "line_number": 5, "usage_type": "attribute" } ]
19543555093
from vec2 import Vector2 from cellular_automata import CellularAutomata from dataclasses import dataclass class LangtonAnt(CellularAutomata): """ Langton's ant is a two-dimensional universal Turing machine and runs on a square lattice of black and white cells. We arbitrarily identify one square as t...
benstt/automatek
src/langtons_ant.py
langtons_ant.py
py
3,950
python
en
code
0
github-code
21
[ { "api_name": "cellular_automata.CellularAutomata", "line_number": 5, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 20, "usage_type": "name" }, { "api_name": "vec2.Vector2", "line_number": 31, "usage_type": "call" }, { "api_name": "...
27756364499
import telegram.ext Token = 'API Key' updater = telegram.ext.Updater(Token, use_context=True) dispatcher = updater.dispatcher def start(update, context): update.message.reply_text("""Hello! Welcome to Lofi Central! The place where you can enjoy all your favourite lofis, we'll be trying to provide you t...
Utkarsh0uchiha/LofiCentral-Bot
loficentral.py
loficentral.py
py
3,666
python
en
code
3
github-code
21
[ { "api_name": "telegram.ext.ext.Updater", "line_number": 6, "usage_type": "call" }, { "api_name": "telegram.ext.ext", "line_number": 6, "usage_type": "attribute" }, { "api_name": "telegram.ext", "line_number": 6, "usage_type": "name" }, { "api_name": "telegram.ext...
9833411150
from selenium import webdriver from bs4 import BeautifulSoup import time SCROLL_PAUSE_TIME = 5 # 크롬 headless 모드 사용 options = webdriver.ChromeOptions() options.add_argument('headless') options.add_argument('window-size=800x1080') options.add_argument("disable-gpu") options.add_experimental_option("excludeSwitches", ["e...
Seoyun0626/Bookathon4
ipynb/teen_crawling.py
teen_crawling.py
py
3,762
python
ko
code
0
github-code
21
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 15, "usage_type": "call" }, { "api_n...
43013764740
from collections import Counter class Solution(object): def match(self, licensePlateCnt, word): #print(word) wordCnt = Counter(word) #print(wordCnt, licensePlateCnt) for k in licensePlateCnt.keys(): if k in wordCnt and licensePlateCnt[k] <= wordCnt[k]: pas...
SS4G/leetcode_2020
src/py/l0748.py
l0748.py
py
1,041
python
en
code
0
github-code
21
[ { "api_name": "collections.Counter", "line_number": 5, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 20, "usage_type": "call" } ]
1086093271
import os from dotenv import load_dotenv, find_dotenv load_dotenv(find_dotenv()) from pritunl import logger # Authy Client API from authy.api import AuthyApiClient authy_api = AuthyApiClient(os.getenv("AUTHY_API")) from datetime import datetime import time import pymongo import requests import re import phonenumber...
lmvdz/pritunl-authy-azure-plugin
authy-azure-plugin.py
authy-azure-plugin.py
py
8,327
python
en
code
2
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 3, "usage_type": "call" }, { "api_name": "dotenv.find_dotenv", "line_number": 3, "usage_type": "call" }, { "api_name": "authy.api.AuthyApiClient", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getenv...
22290324938
# import json #used for testing import yt_dlp from musicObjects import Track, ydl_opts, youtubeDomain, download from mPrint import mPrint as mp def mPrint(tag, text): mp(tag, 'youtubeParser', text) SOURCE = "youtube" def searchYTurl(query) -> str: """ gets the url of the first song in queue (the one to p...
NotLatif/CuloBot
music/youtubeParser.py
youtubeParser.py
py
4,370
python
en
code
5
github-code
21
[ { "api_name": "mPrint.mPrint", "line_number": 7, "usage_type": "call" }, { "api_name": "yt_dlp.YoutubeDL", "line_number": 15, "usage_type": "call" }, { "api_name": "musicObjects.ydl_opts", "line_number": 15, "usage_type": "argument" }, { "api_name": "musicObjects....
33713977615
from __future__ import print_function import base64 import gzip import json import os import re import boto3 # Imported through Lambda Layer from datadog import datadog_lambda_wrapper, lambda_metric # Pass custom tags as environment variable, ensure comma separated, no trailing comma in envvar! DD_TAGS = os.environ....
stevehouel/datadog-serverless-functions-metrics
lambda_function_lite.py
lambda_function_lite.py
py
2,078
python
en
code
1
github-code
21
[ { "api_name": "os.environ.get", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "datadog.lambda_metric", "line_number": 27, "usage_type": "call" }, { "api_name": "datadog.datadog_...
5932504872
import sys sys.stdin = open('input.txt', 'r') from collections import deque def call(s): visited = [0] * 101 queue = deque() visited[s] = 1 queue.append(s) while queue: result = 0 for _ in range(len(queue)): t = queue.popleft() result = result if result > t el...
GH-Lim/AlgorithmHomeworkshop
workshop/workshop0829/workshop0829.py
workshop0829.py
py
806
python
en
code
0
github-code
21
[ { "api_name": "sys.stdin", "line_number": 2, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 23, "usage_type": "call" } ]
20556932065
# region Packages import re import os import csv import wave import time import json import math import boto3 import openai import struct import whisper import gspread import pyaudio import asyncio import aiofiles import pandas as pd from dotenv import main from datetime import datetime, timedelta from google.oauth2.s...
nikhilnair31/MIA
test1_main.py
test1_main.py
py
32,030
python
en
code
0
github-code
21
[ { "api_name": "dotenv.main.load_dotenv", "line_number": 25, "usage_type": "call" }, { "api_name": "dotenv.main", "line_number": 25, "usage_type": "name" }, { "api_name": "os.getenv", "line_number": 26, "usage_type": "call" }, { "api_name": "os.getenv", "line_n...
72921295732
from sklearn.datasets import fetch_20newsgroups from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.naive_bayes import MultinomialNB from sklearn.naive_bayes import BernoulliNB from sklearn.model_selection import learning_curve import nu...
fedetammaro/Naive-Bayes-Comparison
comparing_naive_bayes.py
comparing_naive_bayes.py
py
12,837
python
en
code
3
github-code
21
[ { "api_name": "itertools.islice", "line_number": 42, "usage_type": "call" }, { "api_name": "reuters_utilities.stream_reuters_documents", "line_number": 89, "usage_type": "call" }, { "api_name": "sklearn.datasets.fetch_20newsgroups", "line_number": 166, "usage_type": "call...
43763422095
'''PyMEOP J.Maxwell 2021 ''' import datetime import time import socket import sys import os import yaml import pytz import logging import json from PyQt5.QtWidgets import QMainWindow, QErrorMessage, QTabWidget, QLabel, QWidget, QLineEdit from PyQt5.QtGui import QIntValidator, QDoubleValidator, QValidator from PyQt5.Q...
jdmax/PyMEOP
app/gui.py
gui.py
py
11,219
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 26, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QErrorMessage", "line_number": 34, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QTabWidget", "line_number": 50, "usage_type": "call" }, { ...
69814521013
import datetime import json import os from bs4 import BeautifulSoup as bs import requests import pandas as pd import certifi import undetected_chromedriver as uc from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.proxy import Proxy, ProxyType from seleniu...
dvitev/novelasligeraswebscrapping
shmtranslations.py
shmtranslations.py
py
14,475
python
es
code
0
github-code
21
[ { "api_name": "googletrans.Translator", "line_number": 53, "usage_type": "call" }, { "api_name": "googletrans.Translator", "line_number": 59, "usage_type": "call" }, { "api_name": "urllib.parse.urlparse", "line_number": 69, "usage_type": "call" }, { "api_name": "p...
42003395446
# coding=utf-8 import pandas as pd import numpy as np from sklearn import metrics from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer import lightgbm as lgb from sklearn.model_selection import train_test_split if __name__ == '__main__': train_da...
creatist/text_classify
code/tfidf_lgb.py
tfidf_lgb.py
py
2,598
python
en
code
5
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name": "...
38593107511
import time import numba import numpy as np import scipy from . import utils SMOOTH_K_TOLERANCE = 1e-5 MIN_K_DIST_SCALE = 1e-3 NPY_INFINITY = np.inf @numba.njit( locals={ "psum": numba.types.float32, "lo": numba.types.float32, "mid": numba.types.float32, "hi": numba.types.float32...
Andrew-Draganov/GiDR-DUN
GDR/optimizer/graph_weights.py
graph_weights.py
py
3,490
python
en
code
9
github-code
21
[ { "api_name": "numpy.inf", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.log2", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.float32", "line_numbe...
43349051892
#coding=utf-8 # # 数据集辅助检查和绘制工具 # # 版本V1.4 2020.6.3 # # 烟雨@烟雨科技 # #如果导入tqm出错,请pip install tqdm # import os,cv2,shutil,argparse,random from xml.etree import ElementTree as ET from tqdm import tqdm #数据集组织结构如下: #--datset_rootdir:Face2017 # --images:原始图片存放目录,后缀务必为.jpg # --Annotations:标注文件存放目录,文件名和原始图片相同,后缀为xml,VO...
imistyrain/MRLabeler
AnnoUtil/AnnoUtil.py
AnnoUtil.py
py
14,403
python
en
code
70
github-code
21
[ { "api_name": "os.path.exists", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path", "line_number": 40, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 41, "usage_type": "call" }, { "api_name": "os.listdir", "line_number...
26123338212
import numpy as np import scipy as sp from numpy import sqrt from sklearn.metrics.pairwise import rbf_kernel from numpy.random import permutation from scipy.stats import gamma def kernelGausiano(X,Y=None, sigma = 1.0): """ Como en un principio los nucleos solo los vamos a usar para calcular el de la distribucion no ...
bacisback/TFG
codigo/MMD.py
MMD.py
py
4,546
python
en
code
1
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 39, ...
24556039393
import numpy as np import sys import tensorflow as tf import os from threading import Thread import cv2 import label_map_utils sys.path.append("..") # Path to frozen detection graph. This is the actual model that is used for the object detection. PATH_TO_CKPT = 'hand_graph.pb' # List of the strings that is used to a...
drewgillson/alphabot
detector_utils.py
detector_utils.py
py
5,312
python
en
code
14
github-code
21
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number...
13721706626
import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.optimize import Bounds, NonlinearConstraint from . import equations, plots, optimization def visualize_molejo( largura, comprimento, altura, molas_largura, molas_comprimento, D_barril ): x, y = equa...
FelipeMAssis/OtimizadorPocketPublic
utils/demo_actions.py
demo_actions.py
py
16,135
python
pt
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 66, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 66, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 68, "usage_type": "call" }, { "api_name": ...
71521142134
#! usr/bin/env python3 # import pandas as pd import datetime as dt import requests import json import sys from bs4 import BeautifulSoup from collections import deque from config import REDDIT_SECRET, REDDIT_ID # Access method 1 : defined in config, access method 2 defined as param # # So PRAW was a great...
gavinmccormack/aceholDetector
aceholReddit.py
aceholReddit.py
py
4,427
python
en
code
1
github-code
21
[ { "api_name": "datetime.datetime.fromtimestamp", "line_number": 45, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 45, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 62, "usage_type": "call" }, { "api_name": "b...
16116019137
__author__ = 'wenychan' # Our tutorial's WSGI server from wsgiref.simple_server import make_server from cgi import parse_qs, escape def application(environ, start_response): # the environment variable CONTENT_LENGTH may be empty or missing try: request_body_size = int(environ.get('CONTENT_LENGTH', 0...
WenyuChang/python-learning
src/Practical_Basic/wsgi_usage.py
wsgi_usage.py
py
2,453
python
en
code
1
github-code
21
[ { "api_name": "cgi.parse_qs", "line_number": 19, "usage_type": "call" }, { "api_name": "cgi.escape", "line_number": 26, "usage_type": "call" }, { "api_name": "cgi.escape", "line_number": 27, "usage_type": "call" }, { "api_name": "cgi.parse_qs", "line_number": ...
7385745091
import pygame import random class Particles: def __init__(self, sizeRange, startPosRange, startVelRange=[0, .1, 0, .1], maxParticles=250, circle=False, speed=0.1, gravity=0, colors=None, startCol=(255,255,255), endCol=(0,0,0)): self.sizeRange = list(sizeRange) self.startPosRange = list(startPosRan...
Magicalbat/Pygame-Projects
Spooktober-Jam-2021/engine/particles.py
particles.py
py
3,809
python
en
code
0
github-code
21
[ { "api_name": "pygame.Color", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.Color", "line_number": 17, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 38, "usage_type": "call" }, { "api_name": "pygame.draw.circle", "lin...
70526147252
from typing import Tuple import torch from torch import nn from torch.autograd import Variable from models.attention_based.helpers.train_darnn.constants import device # Dual-Stage Two-phase Recurrent Neural Network # Cite: Liu, Y., Gong, C., Yang, L., & Chen, Y. (2020). DSTP-RNN: A dual-stage two-phase # attention-ba...
duyanhpham-brs/XAI-Multivariate-Time-Series
models/attention_based/DSTP/__init__.py
__init__.py
py
17,165
python
en
code
10
github-code
21
[ { "api_name": "torch.autograd.Variable", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.autograd", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn.Modu...
24019352112
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('api', '0005_apnsdevice_gcmdevice'), ] operations = [ migrations.AddField( model_name='message', name...
mahendrakalkura/tellecast
api/migrations/0006_auto_20150413_1641.py
0006_auto_20150413_1641.py
py
746
python
en
code
0
github-code
21
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
19700871756
import asyncio import json import aiohttp import glob import logging import uuid from datetime import datetime, timezone from urllib.parse import urlencode, quote_plus import math import copy from firebase_admin import firestore from .. admin.referral import Package from .. audit.audit import Audit from . order impo...
accountsmachine/accounts-svc
accountsmachine/commerce/crypto.py
crypto.py
py
8,198
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 21, "usage_type": "attribute" }, { "api_name": "order.product", "line_number": 37, "usage_type": "name" }, { "api_name": "aiohttp.ClientSess...
40828607888
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Oct 27 00:42:42 2022 @author: dan """ import secrets CHARS ='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' # all of the possible characters otpadkey = [] for i in range(1,501): # The number of keys to generate for j in range(500): # the length of the key...
dgrandall/cryptographyBC
CreatingOTPadsInBulk.py
CreatingOTPadsInBulk.py
py
811
python
en
code
0
github-code
21
[ { "api_name": "secrets.choice", "line_number": 14, "usage_type": "call" } ]
24983453409
from setuptools import setup, find_packages with open("README.md", "r", encoding = "utf-8") as fh: long_description = fh.read() setup( name="EIAOpenData", version="0.1.1", packages=find_packages(), author="Uraz Akgül", author_email="urazdev@gmail.com", description="EIAOpenData is a Python ...
urazakgul/EIAOpenData
setup.py
setup.py
py
898
python
en
code
0
github-code
21
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 9, "usage_type": "call" } ]
42743632247
import time import io import json from pathlib import Path import argparse import pymssql from mysql.connector import connect from kfktest.util import load_setup, count_rows, linfo # CLI 용 파서 parser = argparse.ArgumentParser(description="DB 에서 데이터 셀렉트.", formatter_class=argparse.ArgumentDefaultsHelpFormatter ) p...
haje01/kfktest
kfktest/selector.py
selector.py
py
3,443
python
ko
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 14, "usage_type": "attribute" }, { "api_name": "kfktest.util.load_setup", "line_number": 46, "usage_type": "call" }...
75189558453
import time import argparse from collections import OrderedDict # for type hinting import json import os from typing import Optional, Type, Union # for type hinting from numpy.random import PCG64DXSM, Generator from marco_polo.tools.types import Role, PathString # for type hinting from marco_polo.tools.wrappers im...
act3-ace/marcopolo
marco_polo/optimizers/ARS/manager.py
manager.py
py
8,650
python
en
code
0
github-code
21
[ { "api_name": "argparse.Namespace", "line_number": 28, "usage_type": "attribute" }, { "api_name": "typing.Union", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.Type", "line_number": 29, "usage_type": "name" }, { "api_name": "marco_polo.optimizer...
21408335805
import discord import random from discord.ext import commands class Quote(commands.Cog): def __init__(self, client): self.client = client @commands.command(aliases=["q"]) async def quote(self, ctx): file = open('quotes.txt', 'r') name = [] q = [] for line in fil...
aadougdeen/HomieBot
commands/quote.py
quote.py
py
690
python
en
code
0
github-code
21
[ { "api_name": "discord.ext.commands.Cog", "line_number": 6, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 6, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 25, "usage_type": "call" }, { "api_name": "disco...
25900218854
from abc import ABC, abstractmethod import numpy as np from scipy.linalg import sqrtm from ..utils.math import randcn class SignalGenerator(ABC): """Abstrace base class for all signal generators. Extend this class to create your own signal generators. """ @property @abstractmethod def dim...
morriswmz/doatools.py
doatools/model/signals.py
signals.py
py
3,687
python
en
code
132
github-code
21
[ { "api_name": "abc.ABC", "line_number": 6, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 13, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 18, "usage_type": "name" }, { "api_name": "numpy.isscalar", "li...
2133078854
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sympy as sp from vofotensors.numbers import z from vofotensors.abc import ( alpha1, alpha3, la1, la2, d1, d2, d3, d4, d5, d6, d7, d8, d9, ) alpha1_in_la1 = sp.sympify("4/3") * la1 - sp.sympify("2/3") substitutio...
JulianKarlBauer/vofotensors
vofotensors/substitutions.py
substitutions.py
py
900
python
en
code
4
github-code
21
[ { "api_name": "sympy.sympify", "line_number": 22, "usage_type": "call" }, { "api_name": "vofotensors.abc.la1", "line_number": 22, "usage_type": "name" }, { "api_name": "vofotensors.abc.alpha3", "line_number": 26, "usage_type": "name" }, { "api_name": "vofotensors....
2143483859
"""The restructuredtext linter.""" import os import shutil import sys import restructuredtext_lint from docutils import nodes from docutils.parsers.rst import Directive from docutils.parsers.rst import directives from docutils.parsers.rst.directives import register_directive from docutils.parsers.rst.roles import regis...
mindspore-ai/docs
tools/rst_lint/run.py
run.py
py
5,435
python
en
code
154
github-code
21
[ { "api_name": "docutils.parsers.rst.Directive", "line_number": 17, "usage_type": "name" }, { "api_name": "docutils.nodes.container", "line_number": 29, "usage_type": "call" }, { "api_name": "docutils.nodes", "line_number": 29, "usage_type": "name" }, { "api_name":...
71835966132
import six from iktomi.cms.auth.views import AdminAuth, auth_required from iktomi.cms.item_lock.views import ItemLockView from iktomi.cms.menu import IndexHandler from ikcms.web import h_match from ikcms.web import h_prefix from ikcms.web import h_cases from ikcms.web import h_static_files from ikcms.web import h_app ...
SmartTeleMax/ikcms
ikcms/apps/admin/handler.py
handler.py
py
1,715
python
en
code
0
github-code
21
[ { "api_name": "iktomi.cms.auth.views.AdminAuth", "line_number": 18, "usage_type": "call" }, { "api_name": "ikcms.web.h_domain", "line_number": 26, "usage_type": "call" }, { "api_name": "ikcms.web.h_cases", "line_number": 27, "usage_type": "call" }, { "api_name": "...
24107043330
import json import boto3 # Define the client to interact with AWS Lambda client = boto3.client('lambda') def lambda_handler(event, context): try: ################################################### # Update record into quiz table ################################################### ...
eleonora-ollaik/EvolveU-Project
Quiz/aws/lambda/PutQuiz/lambda_function.py
lambda_function.py
py
4,932
python
en
code
0
github-code
21
[ { "api_name": "boto3.client", "line_number": 5, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 26, "usage_type": "call" }, { "api_name": "json.load", "line_number": 29, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 32, ...
10591431635
import math import numpy as np import utils DAY = 8 def check_visibility(forest :np.ndarray, coord :tuple) -> bool: i, j = coord temp = np.clip(forest - forest[i,j] + 1, 0, 9) top, bottom, left, right = temp[:i, j], temp[i+1:, j], temp[i, :j], temp[i, j+1:] return 0 == math.prod(map(np.sum, [left, ...
piro-97/AdventOfCode
2022/08.py
08.py
py
1,191
python
en
code
0
github-code
21
[ { "api_name": "numpy.ndarray", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.clip", "line_number": 10, "usage_type": "call" }, { "api_name": "math.prod", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number":...
4118893340
import ExportToDamask import numpy as np import matplotlib.pyplot as plt import scipy.stats from MircoCellularAutomaton import * from matplotlib.colors import LinearSegmentedColormap, ListedColormap import os import sys sys.path.insert(1, './out_const/') import const_proc def pltVal(X, Y, Z, title="", filename=None)...
a-vodka/cellular-automaton
runDamask.py
runDamask.py
py
20,242
python
en
code
0
github-code
21
[ { "api_name": "sys.path.insert", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.unique", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.unique", "line_n...
25827739405
from torch import nn import torch import torchvision from matplotlib import pyplot as plt import torch.nn.functional as F device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class Generator(nn.Module): def __init__(self,nz,ngf,nc): super().__init__() self.fwd = nn.Sequential( nn.Conv...
Sumeet2807/GANs
models/MNIST_DCGAN.py
MNIST_DCGAN.py
py
4,082
python
en
code
1
github-code
21
[ { "api_name": "torch.device", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", ...
12857097412
from typing import Iterable, Callable import tensorflow as tf class DatasetGenerator: def __init__(self, batch_size: int, shuffle_buffer_size=None, rank=2): self.batch_size = batch_size self.shuffle_buffer_size = shuffle_buffer_size if r...
as-ideas/headliner
headliner/preprocessing/dataset_generator.py
dataset_generator.py
py
1,591
python
en
code
231
github-code
21
[ { "api_name": "tensorflow.int32", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tensorflow.TensorShape", "line_number": 16, "usage_type": "call" }, { "api_name": "tensorflow.int32", "line_number": 18, "usage_type": "attribute" }, { "api_name": "te...
32621536330
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns # LOADING THE DATASET url = 'https://raw.githubusercontent.com/amankharwal/Website-data/master/Advertising.csv' df = pd.read_csv(url) df.drop('Unnamed: 0',axis=1,inplace=True) print(df.head()) # Let us plot the graph of d...
vsahasrabudhe96/Machine_Learning_Practice
LassoandRidge/LassoRidge.py
LassoRidge.py
py
2,051
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "matplotlib....
40549216412
import threading from pathlib import Path from unittest.mock import MagicMock import agent_plugins.payloads.ransomware.src.ransomware_builder as ransomware_builder import pytest from agent_plugins.payloads.ransomware.src.ransomware_options import RansomwareOptions from monkeytypes import OperatingSystem from common.e...
guardicore/monkey
monkey/tests/unit_tests/agent_plugins/payloads/ransomware/test_integrated_ransomware.py
test_integrated_ransomware.py
py
1,658
python
en
code
6,367
github-code
21
[ { "api_name": "common.types.AgentID", "line_number": 14, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pathlib.Path", ...
29101749254
import pyperclip import qrcode print('Before use, copy what you want to turn into qr-code') print('To start click x\n') inp = input() if inp == 'x': filename = input('Enter filename for this qr\n') clipboard = pyperclip.paste() img = qrcode.make(clipboard) imgpath = r'folder path to save file' im...
mattebur/clipboard-to-qrcode
main.py
main.py
py
391
python
en
code
0
github-code
21
[ { "api_name": "pyperclip.paste", "line_number": 11, "usage_type": "call" }, { "api_name": "qrcode.make", "line_number": 12, "usage_type": "call" } ]
14425152210
#!/usr/bin/python3 import sys import os import argparse #the following import also sets up import path import neumodvb import pychdb import pyrecdb import pydevdb import pystatdb import pyepgdb epilog= """ """ parser = argparse.ArgumentParser(description='Neumodb file generator', ...
deeptho/neumodvb
gui/neumodbstats.py
neumodbstats.py
py
1,433
python
en
code
9
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "argparse.RawDescriptionHelpFormatter", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pychdb.chdb", "line_number": 37, "usage_type": "call" }, { "api...
21195618767
from django.shortcuts import render, get_object_or_404, redirect from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.contrib import messages from django.views.generic import UpdateView from django.v...
cyobero/social
account/views.py
views.py
py
4,027
python
en
code
0
github-code
21
[ { "api_name": "django.views.generic.edit.UpdateView", "line_number": 18, "usage_type": "name" }, { "api_name": "models.UserProfile", "line_number": 20, "usage_type": "name" }, { "api_name": "forms.UpdateProfileForm", "line_number": 21, "usage_type": "name" }, { "a...
5624892614
#!/usr/bin/python # Copyright (C) 2021-2014 Alibaba Group Holding Limited # not stable. do not use it!!!! import sys import os import zipfile script_root = os.path.abspath(os.path.dirname(__file__)) def find_project_name(build_dir): files = os.listdir(build_dir) for f in files: if ...
alibaba/t-game-sdk
TBJGameSDK/toolchain/emscripten/taopublish.py
taopublish.py
py
1,181
python
en
code
6
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.listdir", "line_n...
29723868160
""" Author: Ben CHEN Github: benbenbang Created Date: 2019-12-02 Last Modified by: benbenbang Last Modified: 2019-12-10 """ import os import warnings from timeit import default_timer import lightgbm as lgb import matplotlib.pyplot as plt import numpy as np import seaborn as sns import xgboost as xgb from libs.params ...
benbenbang/ngboost-explore
src/benchmark.py
benchmark.py
py
5,633
python
en
code
2
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 28, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 35, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 36, "usage_type": "attribute" }, { "api_name": "os.path.isfil...
73585585973
import numpy as np import torch import torch.nn as nn import os import torchvision.transforms as transforms from utils.opt import parse_option from torchvision.datasets import mnist from torch.nn import CrossEntropyLoss from torch.optim import SGD from torch.utils.data import DataLoader from trainval import train from...
dongkyuk/LeNet-Pytorch
Pytorch/train.py
train.py
py
2,222
python
en
code
2
github-code
21
[ { "api_name": "utils.opt.parse_option", "line_number": 17, "usage_type": "call" }, { "api_name": "torchvision.datasets.mnist.MNIST", "line_number": 21, "usage_type": "call" }, { "api_name": "torchvision.datasets.mnist", "line_number": 21, "usage_type": "name" }, { ...
8606445662
#!/usr/bin/env python # coding: utf-8 # <h2>About this Project</h2> # # **In this Project, you will create a logistic regression classifier that can "filter" spam email messages.** Having focused on modeling in the previous projects, you will now dive deep into email data and preprocessing. **This project does not ha...
arko-stark/Machine-Learning
learning-with-linear-classifier/gradient-descent-spam-classifier/Build-a-Spam-Email-Classifier-Project3.py
Build-a-Spam-Email-Classifier-Project3.py
py
11,051
python
en
code
0
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 63, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 89, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 89, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
38846481472
from django.test import TestCase from django.contrib.auth.models import User from app3d.models import Model3d, Badge, CustomUser from django.urls import reverse from django.utils import timezone class DetailViewTest(TestCase): def setUp(self): self.user = User.objects.create_user(username='testuser', pass...
amadoucodeur/model3dtest
model3dproject/app3d/tests.py
tests.py
py
3,075
python
fr
code
0
github-code
21
[ { "api_name": "django.test.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.create_user", "line_number": 10, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 10, "usa...
32011654154
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Author: Alex Nguyen Gettysburg College "Finally, the experiments with existing methods reveal that warped clothing is often severely distorted. We could not clearly determine the reason, but can conclude that the estimation of the TPS parameters needs regulariza...
rxng8/Virtual-Tryon-Project
cp-vton.py
cp-vton.py
py
4,830
python
en
code
6
github-code
21
[ { "api_name": "core.dataset.VtonPrep", "line_number": 60, "usage_type": "call" }, { "api_name": "tensorflow.keras.optimizers.Adam", "line_number": 73, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 73, "usage_type": "attribute" }, { "api_...
25805953095
import logging from slixmpp.stanza import StreamFeatures from slixmpp.features.feature_preapproval import stanza from slixmpp.xmlstream import register_stanza_plugin from slixmpp.plugins.base import BasePlugin from typing import ClassVar, Set log = logging.getLogger(__name__) class FeaturePreApproval(BasePlugin): ...
poezio/slixmpp
slixmpp/features/feature_preapproval/preapproval.py
preapproval.py
py
1,054
python
en
code
108
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "slixmpp.plugins.base.BasePlugin", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.ClassVar", "line_number": 17, "usage_type": "name" }, { "api_name": "typ...
37366058806
# import libraries from numpy import array, argmax from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import OneHotEncoder # define input data data = ['cold', 'cold', 'warm', 'cold', 'hot', 'hot', 'warm', 'cold', 'warm', 'hot'] values = array(data) print(values) # integer encode label_encoding ...
eugene-liyai/One-Hot-Encoding-Example
one_hot_encoding/scikit_one_hot_encoding.py
scikit_one_hot_encoding.py
py
759
python
en
code
1
github-code
21
[ { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.OneHotEncoder", "line_number": 17, "usage_type": "call" }, { ...
42382055902
#!/usr/bin/env python # coding=utf-8 import click import os @click.command() @click.argument('inputfile', default="dump.bin", type=click.Path(exists=True)) def cli(inputfile): dic = [ ("boot", 0x40000), ("kernel", 0x280000), ("rootfs", 0x6F0000), ("data", 0x630000), ("confi...
openmiko/openmiko
doc/SXJ02ZM/unpacker.py
unpacker.py
py
777
python
en
code
563
github-code
21
[ { "api_name": "click.format_filename", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.makedirs", "...
18934229821
import os import torch import spacy import pandas as pd from torch.nn.utils.rnn import pad_sequence from torch.utils.data import DataLoader, Dataset, dataset from PIL import Image import torchvision.transforms as transforms spacy_en = spacy.load("en_core_web_sm") class TextPreprocessor: def __init__(self, thresh...
jenilgandhi2111/Image-Captionizer
preprocessing.py
preprocessing.py
py
4,316
python
en
code
0
github-code
21
[ { "api_name": "spacy.load", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", "line_number": 62, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 71, "usage_type": "call" }, { "api_name": "torchvision.trans...
33880972814
import numpy as np import os import nibabel as nib import h5py import pickle import itertools def get_vals_vecs(): subject = os.listdir("./data/train")[0] with open(f"./data/train/{subject}/bvals", "r") as f: vals = np.array(list(map(int, f.readline().split()))) with open(f"./data/train/{subject}...
Snailpong/dwi_angular
preprocess.py
preprocess.py
py
4,148
python
en
code
0
github-code
21
[ { "api_name": "os.listdir", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 19...
18627812012
import torch from torch import nn import torch.nn.functional as funcs class Encoder(nn.Module): """ CNN model to extract state and aleatoric uncertainty over state from images """ def __init__(self, label_dim: int, img_channels: int = 3): super(Encoder, self).__init__() # Side of squ...
ishank-juneja/Online-Model-Selection
src/learned_models/encoder.py
encoder.py
py
2,265
python
en
code
2
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 30, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
72499519412
import cv2 import numpy as np img=cv2.imread('bookpage.jpg') retval1,threshold1=cv2.threshold(img,12,255,cv2.THRESH_BINARY) grayscaled=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)#conversion to grayscale retval2,threshold2=cv2.threshold(grayscaled,10,255,cv2.THRESH_BINARY)#thresholding the grayscaled image gaus...
kilarinikhil/OpenCV
Open-CV/6@thresholding_an_image.py
6@thresholding_an_image.py
py
682
python
en
code
0
github-code
21
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.threshold", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.THRESH_BINARY", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line...
34340166401
""" Window Transformer ------------------ """ from typing import Any, List, Mapping, Optional, Union from darts.dataprocessing.transformers import BaseDataTransformer from darts.logging import get_logger from darts.timeseries import TimeSeries logger = get_logger(__name__) class WindowTransformer(BaseDataTransform...
unit8co/darts
darts/dataprocessing/transformers/window_transformer.py
window_transformer.py
py
9,000
python
en
code
6,665
github-code
21
[ { "api_name": "darts.logging.get_logger", "line_number": 12, "usage_type": "call" }, { "api_name": "darts.dataprocessing.transformers.BaseDataTransformer", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 18, "usage_type": "name" }...
13341563715
from twilio.rest import Client from ConfigManager import ConfigManager class SMSService: def SendMMS(self, message, imageLink): configs = ConfigManager() account_sid = configs.TWILIO_ACCOUNT_SID auth_token = configs.TWILIO_SECRET apiKeySID = configs.TWILIO_APIKEY client = Client(apiKeySID,auth_t...
KeenHausOrg/DetectorSendData
DetectorSendDataSrc/SMSService.py
SMSService.py
py
583
python
en
code
0
github-code
21
[ { "api_name": "ConfigManager.ConfigManager", "line_number": 6, "usage_type": "call" }, { "api_name": "twilio.rest.Client", "line_number": 10, "usage_type": "call" } ]
43735475599
""" Mikkoo Worker Process ===================== Connects to Postgres and processes PgQ batches, publishing the events in the batch to RabbitMQ. """ import asyncio import copy import datetime import json import logging import multiprocessing import os import signal import socket import ssl import sys import time import...
gmr/mikkoo
mikkoo/worker.py
worker.py
py
29,898
python
en
code
11
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 40, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 43, "usage_type": "attribute" }, { "api_name": "mikkoo.state.State", "line_number": 43, "usage_type": "attribute" }, { "api_name":...
40525522894
import numpy as np import cv2 import matplotlib.pyplot as plt import clipboard import graphviz from typing import Set def read_file(path): with open(path) as f: return f.read() class node: def single_visit_node(self): return self.rep.islower() def __init__(self, neighbours, rep): ...
Wellidontcare/advent_of_code2021
12/solution.py
solution.py
py
5,100
python
en
code
1
github-code
21
[ { "api_name": "graphviz.Digraph", "line_number": 47, "usage_type": "call" }, { "api_name": "typing.Set", "line_number": 62, "usage_type": "name" }, { "api_name": "typing.Set", "line_number": 78, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number...
6641419493
import time from federatedml.statistic.intersect.bark_oprf_intersect.bark_oprf_intersect_base import BaRK_OPRF_Intersection from federatedml.util import consts, LOGGER from federatedml.util.data_compress_decompress import zlibcompress,zlibdecompress_dataframe from math import ceil,sqrt import multiprocessing import os...
Seceum/SeceumFL
python/federatedml/statistic/intersect/bark_oprf_intersect/bark_oprf_intersect_guest.py
bark_oprf_intersect_guest.py
py
15,286
python
en
code
15
github-code
21
[ { "api_name": "federatedml.statistic.intersect.bark_oprf_intersect.bark_oprf_intersect_base.BaRK_OPRF_Intersection", "line_number": 21, "usage_type": "name" }, { "api_name": "federatedml.util.consts.GUEST", "line_number": 24, "usage_type": "attribute" }, { "api_name": "federatedm...
73255074294
#!/usr/bin/env python3 import matplotlib.pyplot as plt from mc3g_plot import plot vr = 0.8 # vaccine rate ve = 0.8 # US CDC data p = 1e-2 # prevalence N = 100 # number of participants sens = 0.8 # test sensitivity spec = 0.97 # test specifity runs = 10_000 # number of Monte Carlo...
kohlrabi/mc3g
main.py
main.py
py
388
python
en
code
4
github-code
21
[ { "api_name": "mc3g_plot.plot", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 18, "usage_type": "name" } ]
43200028587
import datetime import logging import os import sys import time from collections import OrderedDict from operator import itemgetter import dateutil import dateutil.parser import dateutil.tz import six if six.PY3 and sys.version_info < (3,3): class _MetaColor(type): def __getattr__(self, item): ...
Nekmo/simple-monitor-alert
simple_monitor_alert/sma.py
sma.py
py
8,642
python
en
code
29
github-code
21
[ { "api_name": "six.PY3", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 14, "usage_type": "attribute" }, { "api_name": "six.with_metaclass", "line_number": 19, "usage_type": "call" }, { "api_name": "terminaltables....
6889381003
import os from tqdm import tqdm import utils.io as io from .constants import ImagenetConstants def main(): const = ImagenetConstants() print('Reading txt file ...') with open(const.is_a_txt,'r',encoding='ISO-8859-1') as f: #ISO-8859-1 lines = f.readlines() print('Parsing is_a relationshi...
BigRedT/vico
data/imagenet/create_wordnet_edges.py
create_wordnet_edges.py
py
620
python
en
code
25
github-code
21
[ { "api_name": "constants.ImagenetConstants", "line_number": 8, "usage_type": "call" }, { "api_name": "utils.io.dump_json_object", "line_number": 20, "usage_type": "call" }, { "api_name": "utils.io", "line_number": 20, "usage_type": "name" } ]
32971889833
from rest_framework import routers from rest_framework.schemas import get_schema_view from rest_framework_swagger.renderers import SwaggerUIRenderer, OpenAPIRenderer from core.views import SolutionView, AppView, AppVersionView, EntityView, EntityMapView, BranchView __all__ = ['router', ] schema_view = get_schema_...
Forked-ONS/domain_schema
core/router.py
router.py
py
954
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.schemas.get_schema_view", "line_number": 12, "usage_type": "call" }, { "api_name": "rest_framework_swagger.renderers.SwaggerUIRenderer", "line_number": 12, "usage_type": "name" }, { "api_name": "rest_framework_swagger.renderers.OpenAPIRenderer", ...
9580010467
# Import necessary packages import numpy as np import cv2 as cv import time "Detection and draw face/eyes on current frame" def detect(img, cascade): rects = cascade.detectMultiScale(img, scaleFactor=1.3, minNeighbors=4, minSize=(30, 30), flags=cv.CASCADE_SCALE_IMAGE) ...
micherbl/Security-camera
security_cam_final/DetectAndDraw.py
DetectAndDraw.py
py
550
python
en
code
0
github-code
21
[ { "api_name": "cv2.CASCADE_SCALE_IMAGE", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.rectangle", "line_number": 19, "usage_type": "call" } ]
22605552674
import h2o from h2o.estimators.aggregator import H2OAggregatorEstimator from h2o_wave import Q, app, data, main, ui from h2o_wave.core import Expando @app("/") async def serve(q: Q) -> None: """ Handle interactions from the browser such as new arrivals and button clicks :param q: Query argument from the H...
h2oai/wave-big-data-visualizer
src/app.py
app.py
py
5,938
python
en
code
6
github-code
21
[ { "api_name": "h2o_wave.Q", "line_number": 8, "usage_type": "name" }, { "api_name": "h2o_wave.app", "line_number": 7, "usage_type": "call" }, { "api_name": "h2o_wave.Q", "line_number": 34, "usage_type": "name" }, { "api_name": "h2o_wave.ui.meta_card", "line_nu...
70600291574
from django.db import models import uuid from users.models import User # Create your models here. class Function(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) name = models.CharField(max_length=50, null=False, blank=False) body = models.TextField(null=False, b...
abdoafage/lambda-function
backend/functions/models.py
models.py
py
863
python
en
code
0
github-code
21
[ { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.UUIDField", "line_number": 9, "usage_type": "call" }, { "api_name": "...
72905135733
import os import colorama from datetime import datetime, date from colorama import Fore, Back, Style import time import ctypes ctypes.windll.kernel32.SetConsoleTitleW("Loyalty Card Validation Checker | Made by Jac Prosser") def process(): os.system("cls") print(Fore.RED + """ _ _ _ ...
JacProsser/college
Assignment 2 - Procedural Programming/LoyaltyChecker.py
LoyaltyChecker.py
py
5,782
python
en
code
0
github-code
21
[ { "api_name": "ctypes.windll.kernel32.SetConsoleTitleW", "line_number": 9, "usage_type": "call" }, { "api_name": "ctypes.windll", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.system", "line_number": 11, "usage_type": "call" }, { "api_name": "co...
23591564015
import os import yara from scanner.extract_info import FileExtract class MalwareExtractor: def __int__(self, root_dir, yara_rules_file): self.root_dir = root_dir self.yara_rules_file = yara_rules_file self.rules = yara.load(self.yara_rules_file) @staticmethod def compile_yara_rules(yara_directory): if os...
malwarai/malware-extractor
scanner/scan.py
scan.py
py
1,998
python
en
code
1
github-code
21
[ { "api_name": "yara.load", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": ...
15088393225
import requests import json import jsonpath url_all_students = 'https://thetestingworldapi.com/api/studentsDetails' url_particular_student = 'https://thetestingworldapi.com/api/studentsDetails/2678942' def test_fetch_all_student_details(): # When response = requests.get(url_all_students) # Then assert...
AlexandraNayanzina/api_automation
tests/test_FetchStudentDataGETReq.py
test_FetchStudentDataGETReq.py
py
973
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "json.loads", "line_number": ...
30597668928
from django.conf.urls import patterns, include, url from django.contrib import admin from . import views urlpatterns = patterns('', # Examples: # url(r'^$', 'cssanews.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^$', views.index, name='index'), url(r'^edit/$', views.edit, name...
xsunfeng/cssanews
news/urls.py
urls.py
py
589
python
en
code
0
github-code
21
[ { "api_name": "django.conf.urls.patterns", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "dja...
8619435672
""" Module with Event Endpoints """ from functools import wraps from typing import Callable, Dict, Tuple from flask import Response from flask import request, jsonify from flask_login import login_required, current_user from flask_restx import Resource from flask_app import db from flask_app.models.event import Event...
Kyrylo-Kotelevets/Flask_Events
flask_app/resources/event.py
event.py
py
6,172
python
en
code
0
github-code
21
[ { "api_name": "flask_restx.Resource", "line_number": 18, "usage_type": "name" }, { "api_name": "flask_app.models.event.EventModel.find_by_id", "line_number": 34, "usage_type": "call" }, { "api_name": "flask_app.models.event.EventModel", "line_number": 34, "usage_type": "n...
33014789946
"""_summary_ Returns: _type_: _description_ """ import os import urllib.parse import psycopg from dotenv import dotenv_values from tqdm import tqdm os.chdir(os.path.dirname(__file__)) if os.path.exists(".env"): config = dotenv_values(".env") elif os.path.exists("../../.env"): config = dotenv_values("../...
Lexika-Project/lexika
site/database.py
database.py
py
14,688
python
en
code
0
github-code
21
[ { "api_name": "os.chdir", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_numb...
30248036353
import unittest import ConfigParser def load_settings(confpath, basepath): '''load settings''' default_key = {'here': basepath} configparser = ConfigParser.ConfigParser(default_key) if not configparser.read(confpath): raise ConfigParser.Error('Could not open %s' % confpath) settings = {} ...
lianemeth/bandrehearsal
bandrehearsal/tests/test_functional.py
test_functional.py
py
810
python
en
code
4
github-code
21
[ { "api_name": "ConfigParser.ConfigParser", "line_number": 9, "usage_type": "call" }, { "api_name": "ConfigParser.Error", "line_number": 11, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "we...
12891211985
from __future__ import print_function import cv2 as cv import argparse from PIL import Image import numpy as np def detectAndDisplay(frame): font = cv.FONT_HERSHEY_SIMPLEX frame_gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY) frame_gray=cv.GaussianBlur(frame_gray, (5,5),3) frame_gray = cv.equalizeHist(fr...
manthanmkulakarni/ManipalHackathonAllFiles
hand.py
hand.py
py
1,978
python
en
code
0
github-code
21
[ { "api_name": "cv2.FONT_HERSHEY_SIMPLEX", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.G...
32876938211
from typing import List class Solution: def calculateTax(self, brackets: List[List[int]], income: int) -> float: tax = .0 i = 0 prev_upper = 0 while(income > 0) and i < len(brackets): dollar = min(brackets[i][0] - prev_upper, income) tax_rate = bracket...
yeardream-high6/coding_test
이부경/LeetCode/2400/2303. Calculate Amount Paid in Taxes.py
2303. Calculate Amount Paid in Taxes.py
py
732
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" } ]
9999908534
from random import randrange from termcolor import colored class Cards: index = -1 deck_num = 52 deck = [] played = [] sorted_hearts = [] sorted_diamonds = [] sorted_clubs = [] sorted_spades = [] ranks = ['A', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K'] suits = ['♥', '♦', '♣', '♠'] def _getRank(self): ...
stpettersens/21
pygame/cards.py
cards.py
py
3,609
python
en
code
2
github-code
21
[ { "api_name": "random.randrange", "line_number": 19, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 22, "usage_type": "call" }, { "api_name": "termcolor.colored", "line_number": 76, "usage_type": "call" }, { "api_name": "termcolor.colored...