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
7579242086
import argparse import os.path import warnings from shutil import copyfile import cv2 import numpy as np import imagetopdfandtxt.helper_utils as helper_utils import scipy.ndimage # see https://stackoverflow.com/a/57965160 # Delta defines the degree steps to be checked. # Limit defines the maximum skew. def get_rotatio...
Jerey/image-to-pdf-and-txt
imagetopdfandtxt/picture_rotator.py
picture_rotator.py
py
4,076
python
en
code
6
github-code
21
[ { "api_name": "scipy.ndimage.ndimage.rotate", "line_number": 15, "usage_type": "call" }, { "api_name": "scipy.ndimage.ndimage", "line_number": 15, "usage_type": "attribute" }, { "api_name": "scipy.ndimage", "line_number": 15, "usage_type": "name" }, { "api_name": ...
28875821621
#!/usr/bin/env python3 import numpy as np import matplotlib # Force matplotlib to not use any Xwindows backend. matplotlib.use('Agg') import matplotlib.pyplot as plt import os, errno, sys import math import json #from scipy.optimize import curve_fit from scipy import optimize from scipy.interpolate import interp1d, spl...
Bombur/DiagMC_BEC_Polaron
Execution/data_ana_fig4.py
data_ana_fig4.py
py
12,292
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 5, "usage_type": "call" }, { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 24, "usage_type": "attribute" }, { "api_name": "numpy.abs", "line_number": 2...
27557718937
import time from selenium import webdriver # 进入浏览器设置 options = webdriver.ChromeOptions() # 设置中文 options.add_argument('lang=zh_CN.UTF-8') # 更换头部 options.add_argument('user-agent="Mozilla/5.0 (iPod; U; CPU iPhone OS 2_1 like Mac OS X; ja-jp) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5F137 Safar...
kttxiaoqiang/python
spider/30_selenium_请求头.py
30_selenium_请求头.py
py
761
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 4, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 4, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "call" }, { "api_n...
17118038756
import numpy as np from sklearn.metrics import confusion_matrix, classification_report from augmentation import DataGenerator from resnet101V2.model import get_model # parameters train = True weight_path = r'resnet101V2/resnet101_v2_fine.h5' num_classes = 7 size = (512, 512) batch_size = 16 epochs = 300 augment = Tru...
Vargha-Kh/Deep-Learning-Practices
Texture Classifiers/confusion_matrix.py
confusion_matrix.py
py
1,724
python
en
code
1
github-code
21
[ { "api_name": "resnet101V2.model.get_model", "line_number": 16, "usage_type": "call" }, { "api_name": "augmentation.DataGenerator", "line_number": 24, "usage_type": "call" }, { "api_name": "augmentation.DataGenerator", "line_number": 30, "usage_type": "call" }, { ...
72084805813
import requests from random import choice from csv import DictReader from bs4 import BeautifulSoup URL = 'http://quotes.toscrape.com/' def read_quotes(filename): with open (filename, "r") as file: csv_reader = DictReader(file) return list(csv_reader) def start_playing(function): quote = choic...
Zielzor/Guess-the-Quote-game
main_withfile.py
main_withfile.py
py
1,958
python
en
code
0
github-code
21
[ { "api_name": "csv.DictReader", "line_number": 10, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "li...
18703312071
# Convert dataset to dataframe import pandas as pd # Read dataset iris = pd.read_csv('Iris.csv') print(iris.head()) # Remove Property ID # labels = name of columns # axis = 1 for columns, 0 for index # inplace = if False, will make copy of data and make modification, if True, will do modification original data and re...
rezandry/dicoding-beginner-machine-learning
sklearn_decision_tree.py
sklearn_decision_tree.py
py
1,264
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.tree.DecisionTreeClassifier", "line_number": 24, "usage_type": "call" }, { "api_name": "sklearn.tree.export_graphviz", "line_number": 35, "usage_type": "call" } ]
72767328052
import json import os import discord import time import requests import inspect from utils.lang.lang import Lang from utils.references import References from cogs.errors import * from utils.bot_logging import get_logging logging_error = get_logging(__name__, "error") logging_info = get_logging(__name__, "info") loggin...
Dams4K/FrenchMCPlayHDBridgers
utils/bot_data.py
bot_data.py
py
20,433
python
en
code
0
github-code
21
[ { "api_name": "utils.bot_logging.get_logging", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.bot_logging.get_logging", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.bot_logging.get_logging", "line_number": 14, "usage_type": "call" }, ...
20755007526
import networkx as nx import ezdxf # 创建示例拓扑结构图 G = nx.Graph() G.add_edges_from([(1, 2), (1, 3), (2, 3), (3, 4), (4, 5), (4, 6)]) # 创建DXF图 doc = ezdxf.new() msp = doc.modelspace() # 绘制拓扑结构图 node_positions = nx.spring_layout(G) # 选择一种布局算法 scale_factor = 1.0 # 不进行缩放 for node, pos in node_positions.items(): msp.ad...
Demonwuwen/zwpycad
topologyToCAD.py
topologyToCAD.py
py
994
python
en
code
0
github-code
21
[ { "api_name": "networkx.Graph", "line_number": 5, "usage_type": "call" }, { "api_name": "ezdxf.new", "line_number": 9, "usage_type": "call" }, { "api_name": "networkx.spring_layout", "line_number": 13, "usage_type": "call" } ]
27707452226
# -*- coding: utf-8 -*- # # File: testUtils.py # # GNU General Public License (GPL) # from AccessControl import Unauthorized from collective.contact.plonegroup.utils import get_plone_group from imio.helpers.content import richtextval from os import path from plone.app.controlpanel.events import ConfigurationChangedEve...
IMIO/Products.PloneMeeting
src/Products/PloneMeeting/tests/testUtils.py
testUtils.py
py
17,250
python
en
code
1
github-code
21
[ { "api_name": "Products.PloneMeeting.tests.PloneMeetingTestCase.PloneMeetingTestCase", "line_number": 33, "usage_type": "name" }, { "api_name": "Products.PloneMeeting.utils.validate_item_assembly_value", "line_number": 39, "usage_type": "call" }, { "api_name": "Products.PloneMeet...
6461689831
from __future__ import print_function import cv2 as cv import numpy as np max_value = 255 max_value_H = 360//2 low_H = 0 low_S = 0 low_V = 0 high_H = max_value_H high_S = max_value high_V = max_value low_H_name = 'Low H' low_S_name = 'Low S' low_V_name = 'Low V' high_H_name = 'High H' high_S_name = 'High S' high_V_nam...
roboime/HRR-Intel
tutorial-opencv/5-mask.py
5-mask.py
py
2,762
python
en
code
0
github-code
21
[ { "api_name": "numpy.ones", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cv2.setTrackbarPos", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.setTrackbarPos", ...
21811478031
# encoding: utf-8 """ __author__:cjhcw """ from flask import Blueprint from flask import jsonify, request import jwt from database import users_db import utility users = Blueprint("user", __name__, url_prefix='/api/user') @users.route('/register', methods=['POST']) def register(): """ 注册用户 :parameter ...
1215999705/Music_share
mongo/route/users.py
users.py
py
3,755
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 26, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 26, "usage_type": "name" }, { "api_name": "database.users_d...
12851604514
import os import pyarrow import adbc_driver_postgresql.dbapi uri = os.environ["ADBC_POSTGRESQL_TEST_URI"] conn = adbc_driver_postgresql.dbapi.connect(uri) #: We'll create an example table to test. with conn.cursor() as cur: cur.execute("DROP TABLE IF EXISTS example") cur.execute("CREATE TABLE example (ints ...
apache/arrow-adbc
docs/source/python/recipe/postgresql_get_table_schema.py
postgresql_get_table_schema.py
py
508
python
en
code
263
github-code
21
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "adbc_driver_postgresql.dbapi.dbapi.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "adbc_driver_postgresql.dbapi.dbapi", "line_number": 8, "usage_type": "attribute"...
17072343549
import discord, os from bs4 import BeautifulSoup as soup from discord.ext import commands from discord import Embed from pygicord import Paginator class recourses(commands.Cog): def __init__(self, client): self.client = client @commands.command(name="OSRecourses", description="OS support and recommend...
Cinnamon1212/CyberSecDiscordBot
lib/cogs/recourses.py
recourses.py
py
23,081
python
en
code
8
github-code
21
[ { "api_name": "discord.ext.commands.Cog", "line_number": 7, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 7, "usage_type": "name" }, { "api_name": "discord.Embed", "line_number": 14, "usage_type": "call" }, { "api_name": "discor...
27014763863
from decouple import config from dotenv import load_dotenv import telebot import os, sys sys.path.append(os.path.dirname(os.path.realpath(__file__))) path2root = os.path.join(os.path.dirname(__file__), "..") sys.path.append(path2root) def markdown_text(text): """Compatibiliza un texto cualquiera con MarkdownV2 sa...
moregain909/inea_produccion
telegram/telegram_helpers.py
telegram_helpers.py
py
2,989
python
es
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number...
13343341814
# coding:utf-8 import os import time from concurrent.futures import as_completed from concurrent.futures.thread import ThreadPoolExecutor import requests def do_req(n): print(f'This is task {n}') time.sleep(0.1) url = 'http://163.com' headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; W...
Crescent617/code-practice
py/http/crawler/enhance_effeciency.py
enhance_effeciency.py
py
1,336
python
en
code
0
github-code
21
[ { "api_name": "time.sleep", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.RequestException", "line_number": 22, "usage_type": "attribute" }, { "api_name": "time.time", ...
37332199773
from django.urls import path, include from rest_framework import routers from .views import HumanViewSet, UserViewSet, CreateHumanViewSet router = routers.DefaultRouter() router.register('humans', HumanViewSet) router.register('createhumans', CreateHumanViewSet) router.register('users', UserViewSet) urlpatterns = [ ...
kanybekov66/task_from_apex_group
apexgroup/innsaver/urls.py
urls.py
py
356
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 5, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 5, "usage_type": "name" }, { "api_name": "views.HumanViewSet", "line_number": 6, "usage_type": "argument" }, { "a...
70880216374
# -*- coding: utf-8 -*- """ Created on Tue May 22 10:48:05 2018 @author: Joris """ import torch.nn as nn from collections import defaultdict import pickle import operator import scipy.spatial.distance as sd word2embs_W1 = pickle.load(open('SG/word2embed_W1.pickle','rb')) word2embs_W2 = pickle.load(open('SG/word2embe...
jorism1993/ULL-Practicals
3/SkipGram/evaluate.py
evaluate.py
py
1,511
python
en
code
0
github-code
21
[ { "api_name": "pickle.load", "line_number": 14, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 15, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.defaultdict", "li...
26262586067
from __future__ import annotations from model_bakery import seq from model_bakery.recipe import Recipe, related, foreign_key from . import tag_anchor_recipe, user_recipe from ..models import GraphAnchor, OrderedAnchorTable, Graph, GraphDescription GRAPH_ANCHOR_NAME = "graph anchor" GRAPH_DESCRIPTION_TITLE = "Graph ...
Reed-CompBio/GrapheryV2-Django
graphery/backend/baker_recipes/graph_recipe.py
graph_recipe.py
py
1,142
python
en
code
0
github-code
21
[ { "api_name": "model_bakery.recipe.Recipe", "line_number": 23, "usage_type": "call" }, { "api_name": "models.GraphAnchor", "line_number": 24, "usage_type": "argument" }, { "api_name": "model_bakery.seq", "line_number": 25, "usage_type": "call" }, { "api_name": "mo...
6324741762
import os import json import argparse from typing import Set def load_targets(fpath: str) -> Set[str]: targets = [] with open(fpath) as fin: for line in fin: target = json.loads(line)['text1'] targets.append(target) return set(targets) def main(args: argparse.Namespace) -...
jagol/MTL-SD
scripts/compute_train_test_target_overlap.py
compute_train_test_target_overlap.py
py
1,788
python
en
code
0
github-code
21
[ { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "typing.Set", "line_number": 7, "usage_type": "name" }, { "api_name": "argparse.Namespace", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.join", "line...
26804817437
""" URL configuration for mohirbitiruvchi project. The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, na...
ShaxbozI/Mb.uz
mohirbitiruvchi/urls.py
urls.py
py
1,910
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 28, "usage_type": "call" }, { "api_name": "django.urls.include", "line_number": 28, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 29, "usage_type": "call" }, { "api_name": "django.contrib....
21694132161
from django.http import HttpResponseForbidden from comments.models import Comment def is_comment_owner(func): def decorated(review,*args,**kwargs): target_comment = Comment.objects.get(pk=kwargs['pk']) if target_comment.writer == review.user: return func(review,*args,**kwargs) ...
JururuK/Class_Web
comments/decorators.py
decorators.py
py
393
python
en
code
0
github-code
21
[ { "api_name": "comments.models.Comment.objects.get", "line_number": 8, "usage_type": "call" }, { "api_name": "comments.models.Comment.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "comments.models.Comment", "line_number": 8, "usage_type": "name" ...
25986530113
import argparse import matplotlib.pyplot as plt def restore_model_accuracy_and_loss(file_path): loss = list() acc = list() val_loss = list() val_acc = list() with open(file_path, 'r') as file: lines = file.readlines() for idx in range(1, len(lines), 2): target = lines[idx].split() loss.append...
AliOsm/shakkelha
helpers/restore_model_accuracy_and_loss.py
restore_model_accuracy_and_loss.py
py
1,590
python
en
code
72
github-code
21
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.tight_layout", "line_number": 44, "usage_type": "call" }, { "api_nam...
19267649862
from django.conf import settings from . import contract_config import json import os from web3 import Web3 from web3.middleware import geth_poa_middleware # Contract data contract_address = contract_config.config["contract_address"] public_key = contract_config.config["public_key"] private_key = contract_config.confi...
NavrajBIT/khelmanchbackend
backend/khelmanch/api/contractcalls.py
contractcalls.py
py
3,268
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.conf.settings.BASE_DIR", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.c...
73376687412
import unittest import numpy as np import matplotlib.pyplot as plt import PySeismoSoil.helper_generic as hlp import PySeismoSoil.helper_signal_processing as sig import os from os.path import join as _join f_dir = _join(os.path.dirname(os.path.realpath(__file__)), 'files') class Test_Helper_Signal_Processing(unitt...
jsh9/PySeismoSoil
tests/test_helper_signal_processing.py
test_helper_signal_processing.py
py
2,273
python
en
code
43
github-code
21
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "lin...
42826099582
from datetime import datetime import re from PIL import Image, ImageDraw import calendar from cwt.utils.DrawUtils import Text, Font class EPaperCalendar: def __init__(self): pass def draw(self, target_canvas, font_color="#000000"): current_date = datetime.today().strftime('%m月%d日') + self.to...
SteveZhengMe/single-weather-calendar-quote
cwt/modules/CalendarClass.py
CalendarClass.py
py
1,591
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.today", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.Imag...
26134972465
from colour import Color from utils.animation_maker import * import numpy as np from time import time song = 1 in_file = f'./Songs/Song0{song}.wav' c1, c2 = Color('#fceaa8'), Color('#00e5ff') #c1, c2 = Color('#000000'), Color('#00fffb') c3, c4 = Color('#000000'), Color('#000000') gradient_mode = 'hsl' n_points = 100 a...
pabloqb2000/py-led_audio_visualizer
music_to_numpy.py
music_to_numpy.py
py
638
python
en
code
1
github-code
21
[ { "api_name": "colour.Color", "line_number": 8, "usage_type": "call" }, { "api_name": "colour.Color", "line_number": 10, "usage_type": "call" }, { "api_name": "time.time", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.save", "line_number": 22...
7994639962
from pathlib import Path import urllib import pandas as pd where_csv = Path(".") canvas_csv = where_csv / "Canvas_classlist_041_filenames.csv" out_csv = where_csv / "Canvas_classlist_042_urls.csv" df = pd.read_csv(canvas_csv, dtype="object") baseurl = "https://amcweb.math.ubc.ca/~cbm/bmeg220/" def make_url(r): ...
plomgrading/plom
contrib/onlinedist_042_write_urls.py
onlinedist_042_write_urls.py
py
884
python
en
code
10
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.isnull", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib.parse.quote_plus", ...
24234613899
#!/usr/bin/env python from __future__ import print_function import os from pipes import quote import re import signal import sys from tornado.ioloop import IOLoop try: from ipykernel.kernelbase import Kernel except ImportError: from IPython.kernel.zmq.kernelbase import Kernel from pexpect import replwr...
minrk/clingkernel
clingkernel.py
clingkernel.py
py
6,637
python
en
code
126
github-code
21
[ { "api_name": "sys.version_info", "line_number": 31, "usage_type": "attribute" }, { "api_name": "pexpect.replwrap.REPLWrapper", "line_number": 33, "usage_type": "attribute" }, { "api_name": "pexpect.replwrap", "line_number": 33, "usage_type": "name" }, { "api_name...
33569521838
import os from PyPDF2 import PdfMerger # Set the directory path where your PDF files are located pdf_directory = "./individual_pdf" # Get a list of all PDF files in the directory pdf_files = [file for file in os.listdir(pdf_directory) if file.endswith('.pdf')] # Sort the PDF files to merge them in a specific order i...
rajverma328/NPTEL_web_scrapper
merge_pdf.py
merge_pdf.py
py
727
python
en
code
0
github-code
21
[ { "api_name": "os.listdir", "line_number": 8, "usage_type": "call" }, { "api_name": "PyPDF2.PdfMerger", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
34319770823
import re from youtube_transcript_api import YouTubeTranscriptApi class YouTubeTranscriptAnalyzer: def __init__(self, video_url): self.youtube_id = self.extract_youtube_id(video_url) self.transcript = self.get_text_timed() @staticmethod def extract_youtube_id(video_url): if "yout...
advaitpaliwal/NotesAI
test/youtube.py
youtube.py
py
1,318
python
en
code
1
github-code
21
[ { "api_name": "re.search", "line_number": 15, "usage_type": "call" }, { "api_name": "youtube_transcript_api.YouTubeTranscriptApi.get_transcript", "line_number": 20, "usage_type": "call" }, { "api_name": "youtube_transcript_api.YouTubeTranscriptApi", "line_number": 20, "us...
30570330636
""" A Simple file server for uploading and downloading files """ import json import mimetypes import os import shutil import urllib.parse from argparse import ArgumentParser from collections import defaultdict from pathlib import Path from boltons.iterutils import first from flask import Flask, request, send_from_dire...
allegroai/clearml-server
fileserver/fileserver.py
fileserver.py
py
5,853
python
en
code
334
github-code
21
[ { "api_name": "config.config.logger", "line_number": 21, "usage_type": "call" }, { "api_name": "config.config", "line_number": 21, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 24, "usage_type": "call" }, { "api_name": "flask_cors.CORS", ...
1553184793
import numpy as np import os import pickle import json import pandas as pd import matplotlib.pyplot as plt os.chdir('/home/mathilde.lapoix/PycharmProjects/SCAPE/') import utils.import_data as load # %% Initialise def fix_lustre_name(df): return df.replace('iss01', 'iss02', regex=True) def fix_lustre_name_Exp...
wyartlab/Carbo-Tano_Lapoix_2023
SCAPE/script/humanReadableOutput.py
humanReadableOutput.py
py
8,764
python
en
code
0
github-code
21
[ { "api_name": "os.chdir", "line_number": 8, "usage_type": "call" }, { "api_name": "utils.import_data.load_summary_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "utils.import_data", "line_number": 24, "usage_type": "name" }, { "api_name": "pickle.l...
12140742423
from django.test import TestCase, Client from django.urls import reverse from base.views import * class Testviews(TestCase): def test_HomePage_view(self): clinet = Client() response = clinet.get(reverse('homepage')) self.assertEqual(response.status_code,200) self...
Yazeedalshehri/MyStore
MyStore/Tests/test_views.py
test_views.py
py
612
python
en
code
1
github-code
21
[ { "api_name": "django.test.TestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "django.test.Client", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 13, "usage_type": "call" }, { "api_name": "django.tes...
7497307383
import os import sys import time from datetime import datetime from watchdog.observers import Observer from watchdog.events import PatternMatchingEventHandler, FileSystemEventHandler from Collector import Collector class EventLogger: """ # Logging Output into Console """ def __init__ (self, ignored_event=None...
lazyKT/DataCollector
main.py
main.py
py
2,325
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.strftime", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 25, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 25, "usage_type": "call" }, { "api_name": "wa...
18777854836
import os import speech_recognition as sr def Listen(): r= sr.Recognizer() with sr.Microphone(0) as source: # Microphone(0) means the deafault mic print('Listening....') r.pause_threshold = 1 audio = r.listen(source,0 ,2) # Giving mic as source , then #Timeout as 0...
rohanCoderMan/mark
hotword_detection.pyw
hotword_detection.pyw
pyw
811
python
en
code
2
github-code
21
[ { "api_name": "speech_recognition.Recognizer", "line_number": 7, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 8, "usage_type": "call" }, { "api_name": "os.startfile", "line_number": 27, "usage_type": "call" } ]
9177766516
from django.shortcuts import render from django.http import HttpResponse # Create your views here. def index(requset): return render(requset, 'menus/index.html') def detail(request, menu): context = dict() if menu == 'chicken': context["name"] = '코딩에 빠진 닭 ' context["description"] = '지금까지 ...
choiyun9yu/Django
costaurant/menus/views.py
views.py
py
561
python
en
code
0
github-code
21
[ { "api_name": "django.shortcuts.render", "line_number": 6, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" } ]
1019518382
from PyQt4.QtGui import QDialog from PyQt4.QtCore import pyqtSignature from PyQt4.QtGui import QTreeWidgetItem, QMessageBox from PyQt4.QtCore import QStringList,QString from Common import * import os, sys import xml.etree.ElementTree as ET class CanIfGeneral(): def __init__(self): self.DevErrorDetection=Fa...
parai/gainos-tk
tool/gainos-studio/config/gainos_tk_canif_cfg.py
gainos_tk_canif_cfg.py
py
23,592
python
en
code
29
github-code
21
[ { "api_name": "xml.etree.ElementTree.Element", "line_number": 19, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 19, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.Element", "line_number": 49, "usage_type": "call" }, { ...
29375757952
""" Tic Tac Toe Player """ from functools import reduce X = "X" O = "O" EMPTY = None def initial_state(): """ Returns starting state of the board. """ return [[EMPTY, EMPTY, EMPTY], [EMPTY, EMPTY, EMPTY], [EMPTY, EMPTY, EMPTY]] def player(board): """ Returns player ...
2jacobtan/CS50ai
0b tictactoe/tictactoe.py
tictactoe.py
py
4,153
python
en
code
0
github-code
21
[ { "api_name": "functools.reduce", "line_number": 153, "usage_type": "call" } ]
5966218644
# https://school.programmers.co.kr/learn/courses/30/lessons/132265 from collections import Counter def solution(topping): answer = 0 count = Counter(topping) check = set() for top in topping: count[top] -= 1 check.add(top) if count[top] == 0: count...
kylew1004/algorithm
Programmers/Level2/롤케이크_자르기.py
롤케이크_자르기.py
py
415
python
en
code
0
github-code
21
[ { "api_name": "collections.Counter", "line_number": 8, "usage_type": "call" } ]
18268358074
#!pip install pandas requests BeautifulSoup4 import pandas as pd import requests from bs4 import BeautifulSoup as bs def scraper(url): article_paragraph = [] response = requests.get(url) soup = bs(response.content, 'html.parser') article_div = soup.findAll("article") for j in range...
xiaoyu163/algoGroupProject
scraper.py
scraper.py
py
845
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 25, "usage_type": "call" } ]
33897871223
import datetime from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union import attr from dateutil.parser import isoparse from ..models.seller_freight_class import SellerFreightClass from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.amount import Amount from ..models.contact imp...
milyord/sp-api
sp/fulfillment_inbound_v0/models/partnered_ltl_data_output.py
partnered_ltl_data_output.py
py
9,790
python
en
code
1
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.TypeVar", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 51, "usage_type": "attribute" }, { "api_name": "typing.List", ...
3146216240
import bpy import os from typing import List, Tuple, Optional from inspect import stack from logging import getLogger from utils import to_radians_xyz, to_vector_rgb root_logger_name = os.path.splitext(os.path.basename(stack()[-2].filename))[0] module_logger_name = f'{root_logger_name}.editor.scene' module_logger = g...
vshige/blender_model_processing_tool
scripts/editor/scene.py
scene.py
py
4,612
python
en
code
0
github-code
21
[ { "api_name": "os.path.splitext", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_number": 9, "usage_type": "call" }, { "api_name": "inspect.stack", "line...
73984954294
from flask_wtf import FlaskForm from wtforms import IntegerField, SelectField, TextAreaField, FloatField from wtforms.validators import DataRequired, ValidationError def len_check(form, field): if len(field.data) > 254: raise ValidationError(f"{field} must be less than 255 characters") class ProductForm(F...
XU1204/Emarty-EtsyClone
app/forms/product_form.py
product_form.py
py
864
python
en
code
0
github-code
21
[ { "api_name": "wtforms.validators.ValidationError", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_wtf.FlaskForm", "line_number": 9, "usage_type": "name" }, { "api_name": "wtforms.TextAreaField", "line_number": 10, "usage_type": "call" }, { "api_na...
33330214143
import os import pandas as pd from torch.autograd import Variable from sklearn import metrics from sklearn.model_selection import KFold from cnn_model import * from model import * from torch_geometric.nn import GCNConv import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from to...
Jrunchang/MetalPrognosis
scripts/train1.py
train1.py
py
12,508
python
en
code
5
github-code
21
[ { "api_name": "torch.nn.CrossEntropyLoss", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 27, "usage_type": "name" }, { "api_name": "torch.optim.Adam", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.optim", ...
4551378264
import cereal.messaging as messaging from cereal import car from opendbc.can.packer import CANPacker from selfdrive.car import apply_std_steer_torque_limits from selfdrive.car.volkswagen import volkswagencan from selfdrive.car.volkswagen.values import DBC_FILES, CANBUS, MQB_LDW_MESSAGES, BUTTON_STATES, CarControllerPar...
blueopenpilot/openpilot
selfdrive/car/volkswagen/carcontroller.py
carcontroller.py
py
9,803
python
en
code
4
github-code
21
[ { "api_name": "cereal.car.CarControl", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cereal.car", "line_number": 9, "usage_type": "name" }, { "api_name": "cereal.car.CarState", "line_number": 10, "usage_type": "attribute" }, { "api_name": "cereal.c...
74488610931
# -*- coding: utf-8 -*- """ Created on Sun Sep 25 15:06:43 2022 @author: basti """ import pygame from fonctions import * from classes import * from settings import * from mode_histoire import * from multi import Multi from solo import Solo import os import random m = random.choice(random_liste) pygame.mixer.init...
BastienChicot/jeu_combat
scripts/justi_fight.py
justi_fight.py
py
2,918
python
en
code
0
github-code
21
[ { "api_name": "random.choice", "line_number": 20, "usage_type": "call" }, { "api_name": "pygame.mixer.init", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pygame.init", "...
25815847003
from flask import Flask, render_template, request, send_file from werkzeug.utils import secure_filename # from pandas import DataFrame, read_csv import pandas from addgeocodes import add_geocodes import datetime app = Flask(__name__) @app.route("/") def index(): return render_template("index.html") @app.route("/...
tritseratops/10_real_world_apps_python_udemy
33Geocoder/app.py
app.py
py
1,854
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.requ...
18407264123
import argparse import sys from vmbpy import * def print_preamble(): print('///////////////////////////////////') print('/// VmbPy List Features Example ///') print('///////////////////////////////////\n') def abort(reason: str, return_code: int = 1): print(reason + '\n') sys.exit(return_code)...
alliedvision/VmbPy
Examples/list_features.py
list_features.py
py
6,015
python
en
code
4
github-code
21
[ { "api_name": "sys.exit", "line_number": 16, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "argparse.Namespace", "line_number": 19, "usage_type": "attribute" } ]
73642009973
import time from data_loader import COCOTextImageDataLoader, TextImageDataLoader from utils.visualization import Visualizer from model import create_model from options import TrainOptions def get_instance(module, name, opt, *args): return getattr(module, opt[name]['type'])(*args, **opt[name]['args']) def main(o...
Hhhhhhao/I2T2I
train.py
train.py
py
4,444
python
en
code
0
github-code
21
[ { "api_name": "data_loader.COCOTextImageDataLoader", "line_number": 15, "usage_type": "call" }, { "api_name": "data_loader.TextImageDataLoader", "line_number": 24, "usage_type": "call" }, { "api_name": "data_loader.dataset", "line_number": 33, "usage_type": "attribute" ...
38055083302
#_*_coding:utf-8_*_ import pygame #import win32api class Config(object): def __init__(self): self.SCREEN_WIDTH = 1366 self.SCREEN_HEIGHT = 768 self.CENTER_X = int(self.SCREEN_WIDTH / 2) self.CENTER_Y = int(self.SCREEN_HEIGHT / 2) self.BORDER_X_LEFT = 100 self.BORDER_X...
Reskip/Scrolling-Dashboard
src/diagram/config.py
config.py
py
1,809
python
en
code
0
github-code
21
[ { "api_name": "pygame.HWSURFACE", "line_number": 47, "usage_type": "attribute" }, { "api_name": "pygame.DOUBLEBUF", "line_number": 47, "usage_type": "attribute" } ]
14787202171
from wtforms.validators import InputRequired, Email, ValidationError from eat.models.user import User class EmailExists(object): def __init__(self, should_exist=True, message=None): self._email_should_exist = should_exist self._message = message def __call__(self, form, field): exists...
Lunchable/eat
src/eat/forms/__init__.py
__init__.py
py
608
python
en
code
0
github-code
21
[ { "api_name": "eat.models.user.User.objects", "line_number": 11, "usage_type": "call" }, { "api_name": "eat.models.user.User", "line_number": 11, "usage_type": "name" }, { "api_name": "wtforms.validators.ValidationError", "line_number": 13, "usage_type": "call" }, { ...
24092089628
# Import the functions we need from flask from flask import Flask from flask import render_template from flask import jsonify # Import the functions we need from SQL Alchemy import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine from s...
riebs123/data-oriented-jobs
app.py
app.py
py
11,954
python
en
code
0
github-code
21
[ { "api_name": "config.username", "line_number": 21, "usage_type": "name" }, { "api_name": "config.password", "line_number": 21, "usage_type": "name" }, { "api_name": "config.db", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.create_engine", ...
28502546291
# 572. Subtree of Another Tree # Easy # Given the roots of two binary trees root and subRoot, return true if # there is a subtree of root with the same structure and node values of # subRoot and false otherwise. # A subtree of a binary tree tree is a tree that consists of a node in # tree and all of this node's desc...
DmitryVlaznev/leetcode
572-subtree-of-another-tree.py
572-subtree-of-another-tree.py
py
1,648
python
en
code
2
github-code
21
[ { "api_name": "typing.Optional", "line_number": 33, "usage_type": "name" }, { "api_name": "utils.TreeNode", "line_number": 33, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 41, "usage_type": "call" } ]
6964523370
import warnings from typing import List, Optional, Tuple, Union import torch import torch.nn.functional as F from torch import Tensor def _fspecial_gauss_1d(size: int, sigma: float) -> Tensor: r"""Create 1-D gauss kernel Args: size (int): the size of gauss kernel sigma (float): sigma of norma...
VainF/pytorch-msssim
pytorch_msssim/ssim.py
ssim.py
py
11,841
python
en
code
864
github-code
21
[ { "api_name": "torch.arange", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.float", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.exp", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_numb...
23191353800
from libcloud.common.base import BaseDriver from urllib.parse import urlparse from ..common.azure import AzureGenericOAuth2Connection from .azure_blobs import AzureBlobsOAuth2StorageDriver class AzureResourceManagementStorageDriver(BaseDriver): connectionCls = AzureGenericOAuth2Connection name = 'Azure Stora...
JoelLinn/debian-cloud-images
src/debian_cloud_images/utils/libcloud/storage/azure_arm.py
azure_arm.py
py
2,465
python
en
code
1
github-code
21
[ { "api_name": "libcloud.common.base.BaseDriver", "line_number": 8, "usage_type": "name" }, { "api_name": "common.azure.AzureGenericOAuth2Connection", "line_number": 9, "usage_type": "name" }, { "api_name": "urllib.parse.urlparse", "line_number": 45, "usage_type": "call" ...
23128657970
import torch from torch import nn from torch.utils.data import Dataset from torchvision import datasets class FlaresDataset(Dataset): def __init__(self, df, feature_names): self.dataframe = df[feature_names] self.labels = df["is_flare"] def __len__(self): return len(self.dataframe) ...
snad-space/flare-classifier
src/flare_classifier/mlp_model.py
mlp_model.py
py
1,497
python
en
code
0
github-code
21
[ { "api_name": "torch.utils.data.Dataset", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.tensor", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.float32", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.tensor"...
17310863244
import unittest import logging import shgpy from shgpy.fformfit import ( least_squares_fit, least_squares_fit_with_bounds, basinhopping_fit, basinhopping_fit_with_bounds, basinhopping_fit_jac, basinhopping_fit_jac_with_bounds, dual_annealing_fit_with_bounds, gen_cost_func, ) import shg...
bfichera/shgpy
tests/test_fformfit.py
test_fformfit.py
py
7,388
python
en
code
2
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 26, "usage_type": "attribute" }, { "api_name": "shgpy.load_fform", "line_number": 29, "usage_type": "call" }, { "api_name": "shgpy.load_...
22679067592
from django.forms import ModelForm from .widgets import DateSelectorWidget, TimeSelectorWidget from .models import * class AircraftForm(ModelForm): class Meta: model = Aircraft fields = '__all__' class PeopleForm(ModelForm): class Meta: model = People fields = '__all__' cl...
kulu88/logbook
logbook/logo/forms.py
forms.py
py
1,374
python
en
code
0
github-code
21
[ { "api_name": "django.forms.ModelForm", "line_number": 7, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 13, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 19, "usage_type": "name" }, { "api_name": "d...
13065521381
# -*- coding: utf-8 -*- """The app module, containing the app factory function.""" import logging import sys from flask import Flask, render_template from challenge import models, views from challenge.extensions import ( csrf_protect, db, flask_static_digest, login_manager, migrate, ) def create...
cloudsmith-io/technical-challenge-ui
challenge/app.py
app.py
py
2,046
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 23, "usage_type": "call" }, { "api_name": "challenge.extensions.csrf_protect.init_app", "line_number": 39, "usage_type": "call" }, { "api_name": "challenge.extensions.csrf_protect", "line_number": 39, "usage_type": "name" }, ...
42659384135
import numpy as np import os import multiprocessing import copy from . import solve from . import choice_formatter from . import util from . import parse_ompl from . import matio try: import pygeokey except ImportError as e: util.warn("[WARNING] CANNOT IMPORT pygeokey. This node is incapable of geometric based...
xinyazhang/PuzzleTunnelDiscovery
src/GP/pipeline/geometrik.py
geometrik.py
py
11,938
python
en
code
72
github-code
21
[ { "api_name": "copy.deepcopy", "line_number": 42, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 46, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 53, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_...
27564231333
from typing import Annotated, Callable from ...utils.function_calling.parser import parse_function_call_from_function from .base import FunctionCall class FunctionCallsMetaClass(type): """Metaclass for FunctionCalls class. This metaclass is used to parse all functions in the FunctionCalls class into Func...
c0sogi/openai-functioncalling-requestor
app/models/function_calling/functions.py
functions.py
py
4,313
python
en
code
0
github-code
21
[ { "api_name": "base.FunctionCall", "line_number": 12, "usage_type": "name" }, { "api_name": "utils.function_calling.parser.parse_function_call_from_function", "line_number": 19, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 22, "usage_type": "nam...
2485156987
import json from logging import LoggerAdapter, basicConfig, getLogger DEFAULT_LOG_LEVEL = 'INFO' LOG_FORMAT = dict( timestamp='%(asctime)s', level='%(levelname)s', module='%(name)s', version='%(version)s', user_id='%(user_id)s', request_id='%(request_id)s', trace_id='%(trace_id)s', mes...
avilay/context-logger
context_logger.py
context_logger.py
py
1,334
python
en
code
0
github-code
21
[ { "api_name": "logging.LoggerAdapter", "line_number": 18, "usage_type": "name" }, { "api_name": "logging.basicConfig", "line_number": 24, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.getLogge...
74367407412
import argparse import arxiv import openai import os import tiktoken from summarizer import * from arxiv_scrape import * # Set your OpenAI API key openai.api_key = "YOUR_OPENAI_API_KEY" def generate_summary(text): # Use OpenAI API to generate a summary response = openai.Completion.create( engine="tex...
user074/AgentLab
main.py
main.py
py
2,335
python
en
code
0
github-code
21
[ { "api_name": "openai.api_key", "line_number": 9, "usage_type": "attribute" }, { "api_name": "openai.Completion.create", "line_number": 15, "usage_type": "call" }, { "api_name": "openai.Completion", "line_number": 15, "usage_type": "attribute" }, { "api_name": "ar...
24022792448
"""Ubermelon shopping application Flask server. Provides web interface for browsing melons, seeing detail about a melon, and put melons in a shopping cart. Authors: Joel Burton, Christian Fernandez, Meggie Mahnken. """ from flask import Flask, render_template, redirect, flash, session import jinja2 import melons ...
manishapme/hb_shopping_site
shoppingsite.py
shoppingsite.py
py
3,818
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 16, "usage_type": "call" }, { "api_name": "jinja2.StrictUndefined", "line_number": 27, "usage_type": "attribute" }, { "api_name": "flask.render_template", "line_number": 34, "usage_type": "call" }, { "api_name": "melons....
26912433489
import glob import faiss import torch from torchvision import io from torch.utils.data import Dataset, DataLoader class ImageDataset(Dataset): def __init__(self, transforms_path, file_path_wildcard): self.transforms = torch.jit.load(transforms_path) self.files = glob.glob(file_path_wildcard) ...
MrParosk/visual-search-system
nearest-neighbor-index-creation/main.py
main.py
py
1,213
python
en
code
0
github-code
21
[ { "api_name": "torch.utils.data.Dataset", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.jit.load", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.jit", "line_number": 11, "usage_type": "attribute" }, { "api_name": "glob.glob", ...
1940485608
# -*- coding: utf-8 -*- import os import math import requests import numpy as np import pandas as pd from prophet import Prophet import matplotlib.pyplot as plt from scipy.interpolate import interp1d from datetime import datetime, timedelta from functions import logger def empty_arrays(parameters, start, end, no_dat...
eawag-surface-waters-research/alplakes-simulations
src/river.py
river.py
py
14,807
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.strptime", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.ti...
528243765
import logging import os import subprocess import sys import time from concurrent.futures.thread import ThreadPoolExecutor from threading import Thread import requests from requests import RequestException from requests.compat import urljoin USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/201001...
izag/bonga
session.py
session.py
py
4,313
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 28, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 29, "usage_type": "attribute" }, { "api_name": "logging.Formatter", "line_number": 30, "usage_type": "call" }, { "api_name": "concurrent.fut...
72308435253
from __future__ import print_function import os import boto3 import traceback import click import subprocess import logging import click_log import sys from botocore.exceptions import WaiterError from pprint import pformat logger = logging.getLogger(__name__) click_log.basic_config(logger) DEFAULT_COLOR = "blue" OTH...
asgorobets/ecs-deployer
deploy.py
deploy.py
py
18,180
python
en
code
8
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "click_log.basic_config", "line_number": 15, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 21, "usage_type": "call" }, { "api_name": "boto3.client", ...
15616346167
import pandas as pd from pytorch_lightning import LightningDataModule from torch.utils.data import DataLoader from typing import Optional import spacy from datasets import Dataset from transformers import LongformerTokenizer class CNNDailyMailDataset(Dataset): def __init__(self, dataframe: pd.Dat...
SecilOzkSen/LongDocSummarizer
dataset_loader.py
dataset_loader.py
py
4,396
python
en
code
0
github-code
21
[ { "api_name": "datasets.Dataset", "line_number": 10, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 12, "usage_type": "attribute" }, { "api_name": "transformers.LongformerTokenizer", "line_number": 13, "usage_type": "name" }, { "api_name"...
74477258931
''' This module has ready to use sqlite query functions. ''' from datetime import datetime import sqlite3 # connect to database conn = sqlite3.connect('notes.db') # create a cursor c = conn.cursor() def create_table(): ''' create notes table in database. ''' c.execute(""" CREATE TABLE IF N...
Fareed-Ahmad7/Kitaab
kitaab/src/database.py
database.py
py
3,453
python
en
code
15
github-code
21
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.today", "line_number": 81, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 81, "usage_type": "name" }, { "api_name": "datetime.dat...
13197807425
from common.random_arr import random_arr from common.check_sort import checkSort import time def insertion_sort(a, N): for i in range(2, N+1): a[0] = a[i] j = i while j-1 != 0 and a[j-1] > a[0]: a[j] = a[j-1] j -= 1 a[j] = a[0] return a N = 1000 a ...
Eui9179/python-study
Algorithm_lecture/2/insertion_sort.py
insertion_sort.py
py
510
python
en
code
0
github-code
21
[ { "api_name": "common.random_arr.random_arr", "line_number": 18, "usage_type": "call" }, { "api_name": "time.time", "line_number": 20, "usage_type": "call" }, { "api_name": "time.time", "line_number": 22, "usage_type": "call" }, { "api_name": "common.check_sort.ch...
70561057334
from fastapi import FastAPI from database import engine from restaurant import router, models app = FastAPI() models.BaseModel.metadata.create_all(bind=engine) app.include_router(router.router, prefix="/api", tags=["Restaurants"]) @app.get( "/", name="Info", description="Basic info about **Restaurants...
turtlean/restaurant-api
api/main.py
main.py
py
533
python
en
code
0
github-code
21
[ { "api_name": "fastapi.FastAPI", "line_number": 6, "usage_type": "call" }, { "api_name": "restaurant.models.BaseModel.metadata.create_all", "line_number": 8, "usage_type": "call" }, { "api_name": "restaurant.models.BaseModel", "line_number": 8, "usage_type": "attribute" ...
39904937122
import json from urllib.parse import urljoin import logging from notification_provider import provider from utils.config_reader import AbsConfigReader from utils.helper import get_request_controller class PushDeerNotificationProvider(provider.NotificationProvider): def __init__(self, name: str, config_reader: A...
opennaslab/kubespider
kubespider/notification_provider/pushdeer_notification_provider/provider.py
provider.py
py
2,297
python
en
code
1,636
github-code
21
[ { "api_name": "notification_provider.provider.NotificationProvider", "line_number": 10, "usage_type": "attribute" }, { "api_name": "notification_provider.provider", "line_number": 10, "usage_type": "name" }, { "api_name": "utils.config_reader.AbsConfigReader", "line_number": ...
24295550553
"""General helpers + utilities Adapted from `mammoth`. .. codeauthor:: Raymond Ehlers <raymond.ehlers@cern.ch>, LBL/UCB """ from __future__ import annotations import logging from datetime import datetime from typing import Optional import rich import rich.progress from rich.console import Console from rich.logging...
jdmulligan/bayesian-inference
src/bayesian_inference/helpers.py
helpers.py
py
3,507
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "rich.console.Console", "line_number": 23, "usage_type": "call" }, { "api_name": "rich.logging.RichHandler", "line_number": 27, "usage_type": "name" }, { "api_name": "loggi...
30889792340
import matplotlib.image as mpimg import os from PIL import Image import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D dirListing = os.listdir('./dataset') # Access the directory editFiles = [] for item in dirListing: if ".jpg" in item: editFiles.append('./dataset' +'/'+...
ArhantJain/Classifier-Analysis
Codes/linear_classfier.py
linear_classfier.py
py
1,974
python
en
code
0
github-code
21
[ { "api_name": "os.listdir", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number":...
42633797032
import collections import shlex import subprocess import pyrelight from pyrelight import PyrelightError PyrelightSubprocessResult = collections.namedtuple( "PyrelightSubprocessResult", ["returncode", "output"] ) def quote_cmdline(cmdline): return " ".join(map(shlex.quote, cmdline)) def run(cmdline, check...
radian-software/pyrelight
pyrelight/util.py
util.py
py
1,272
python
en
code
0
github-code
21
[ { "api_name": "collections.namedtuple", "line_number": 9, "usage_type": "call" }, { "api_name": "shlex.quote", "line_number": 15, "usage_type": "attribute" }, { "api_name": "subprocess.run", "line_number": 20, "usage_type": "call" }, { "api_name": "subprocess.PIPE...
70459750773
import dataPrep import os import time import sys import threading import numpy import requests import json SERVER_URL = 'http://localhost:8502/v1/models/spm' def main(): if not SERVER_URL: print('please specify server host:port') return video_fname = "/data/dataset/jackson-town-square.mp4" ...
bg43179/Distributed-NoScope
specializedNN/testClient_rest.py
testClient_rest.py
py
1,631
python
en
code
0
github-code
21
[ { "api_name": "dataPrep.get_data_for_test", "line_number": 24, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 49, "usage_type": "call" } ]
31868430481
from __future__ import print_function import sys import unittest import datetime as dt import SimpleITK as sitk import numpy as np sizeX = 4 sizeY = 5 sizeZ = 3 newSimpleITKPixelValueInt32 = -3000 newNumPyElementValueInt32 = 200 class TestNumpySimpleITKMemoryviewInterface(unittest.TestCase): """ This tests ...
hyunjaeKang/SimpleITKDataBridge
sitkGetArrayViewFromImageTest.py
sitkGetArrayViewFromImageTest.py
py
10,311
python
en
code
0
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "SimpleITK.Image", "line_number": 25, "usage_type": "call" }, { "api_name": "SimpleITK.GetArrayFromImage", "line_number": 26, "usage_type": "call" }, { "api_name": "Si...
27037147273
from gensim.models.fasttext import FastText from hangul_utils import split_syllables, join_jamos import numpy as np import pickle with open('./konovel_preprocessed.pkl', 'rb') as f: texts = pickle.load(f) # 자모 분해 예시 jamo = split_syllables('안녕하세요') word = join_jamos(jamo) print(jamo) print(word) result = [] tmp = ...
dobbytk/NLP_study
Multicampus/NLP/day30/FastText_jamo.py
FastText_jamo.py
py
914
python
en
code
0
github-code
21
[ { "api_name": "pickle.load", "line_number": 7, "usage_type": "call" }, { "api_name": "hangul_utils.split_syllables", "line_number": 10, "usage_type": "call" }, { "api_name": "hangul_utils.join_jamos", "line_number": 11, "usage_type": "call" }, { "api_name": "hangu...
11095104545
""" Script to convert openpose output into bbox """ import json import numpy as np def read_json(json_path): with open(json_path) as f: data = json.load(f) kps = [] for people in data['people']: kp = np.array(people['pose_keypoints']).reshape(-1, 3) kps.append(kp) return kps ...
fredericgo/learning_from_video
hmr/src/util/openpose.py
openpose.py
py
2,180
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 65, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 66...
11379765547
"""doctor all fees Revision ID: 1db73cdab656 Revises: 472f2568b3dd Create Date: 2022-11-30 17:33:42.539505 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '1db73cdab656' down_revision = '472f2568b3dd' branch_labels = None depends_on = None def upgrade(): ...
Arif-Badhon/echamber_backend
src/alembic/versions/1db73cdab656_doctor_all_fees.py
1db73cdab656_doctor_all_fees.py
py
1,494
python
en
code
0
github-code
21
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.Float",...
17516271644
import logging import cv2 import mediapipe as mp import math from src.utils import Utils class Process: def __init__(self, static_image_mode=False, max_num_hands=2): # 参数 self.mp_drawing = mp.solutions.drawing_utils # 初始化medialpipe的画图函数 self.mp_drawing_styles = mp.solutions.drawing_style...
ligb888/hand-gesture
src/process.py
process.py
py
11,808
python
en
code
2
github-code
21
[ { "api_name": "mediapipe.solutions", "line_number": 12, "usage_type": "attribute" }, { "api_name": "mediapipe.solutions", "line_number": 13, "usage_type": "attribute" }, { "api_name": "mediapipe.solutions", "line_number": 14, "usage_type": "attribute" }, { "api_na...
3938397113
# # commonUtils.py # import socket import sys import pymongo from commonConfig import * def connectMongo(): if socket.gethostname() == 'system76-pc': # Home server myclient = pymongo.MongoClient("mongodb://10.0.0.20:27017") else: # Assume work server myclient = pymongo.Mong...
GaryVermeulen/Simpleton
commonUtils.py
commonUtils.py
py
6,572
python
en
code
0
github-code
21
[ { "api_name": "socket.gethostname", "line_number": 15, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 17, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 20, "usage_type": "call" } ]
6155330941
import requests from bs4 import BeautifulSoup LIMIT = 50 def JOB_LINK(id): return f"http://www.saramin.co.kr/zf_user/jobs/relay/view?isMypage=no&rec_idx={id}" def get_last_pages(url): result = requests.get(url) soup = BeautifulSoup(result.text, 'html.parser') pagination = soup.find("div", {"class":...
nomad-learn/python-basic
scrapper.py
scrapper.py
py
1,957
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 50, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
18298666303
#!/usr/bin/env python3 import os import sys import time import logging import subprocess as sp import multiprocessing as mp import pickle import traceback import itertools import shutil import re import math import matplotlib.pyplot as plt import matplotlib.cm as cm import pandas as pd from QAUtil import * from QAR...
putintostyle/intern
fs_autotune/QAJobRunner.py
QAJobRunner.py
py
26,936
python
en
code
0
github-code
21
[ { "api_name": "sys.stdout", "line_number": 30, "usage_type": "attribute" }, { "api_name": "tqdm.tqdm", "line_number": 51, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 57, "usage_type": "call" }, { "api_name": "logging.getLogger", ...
21812777301
import itertools class valStruct: def __init__(self, value, valueL, valueR, operator): self.value = value self.valueL = valueL self.operator = operator self.valueR = valueR def __repr__(self): if self.operator == None: return str(self.value) return...
121601571/samplek8s
src/calc24.py
calc24.py
py
3,152
python
en
code
0
github-code
21
[ { "api_name": "itertools.combinations", "line_number": 64, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 68, "usage_type": "call" } ]
28822715642
import json from allauth.socialaccount.adapter import DefaultSocialAccountAdapter from django.conf import settings class RichAdapter(DefaultSocialAccountAdapter): def populate_user(self, request, sociallogin, data): """ Hook that c...
deniskolokol/flickthru
flickthru/apps/core/adapter.py
adapter.py
py
1,163
python
en
code
0
github-code
21
[ { "api_name": "allauth.socialaccount.adapter.DefaultSocialAccountAdapter", "line_number": 7, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 29, "usage_type": "call" } ]
41859738600
import logging import configargparse import github3 from pr_publisher import const from pr_publisher.entry import PublishEntry from pr_publisher.publishers.slack import SlackPublisher from pr_publisher.publishers.table import TablePublisher class Main: PUBLISHERS = {"table": TablePublisher, "slack": SlackPubli...
pglass/pr-publisher
pr_publisher/main.py
main.py
py
6,039
python
en
code
0
github-code
21
[ { "api_name": "pr_publisher.publishers.table.TablePublisher", "line_number": 14, "usage_type": "name" }, { "api_name": "pr_publisher.publishers.slack.SlackPublisher", "line_number": 14, "usage_type": "name" }, { "api_name": "logging.basicConfig", "line_number": 19, "usage...
3114818564
''' Created on Aug. 1, 2020 @author: zollen ''' import os from pathlib import Path import pandas as pd import numpy as np import tensorflow as tf from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt BATCH_SIZE = 20 EPOCHS = 30 STEPS_PER_EPOCH = 1 SEED = 0 label_column = [ 'survived' ...
zollen/Python-ML
titanic/titanic_ml.py
titanic_ml.py
py
5,220
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 29, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 29, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 33, "usage_type": "call" }, { "api_n...
70619769334
# train.py import io import time import torch import h5py import numpy as np import pandas as pd # using tensorflow for padding and other utils import tensorflow as tf from sklearn import metrics import config import dataset import engine import lstm def load_vectors(fname): fin = io.open(fname, "r", encoding...
LakshyaMalhotra/toy-projects-nlp
imdb-sentiment-analysis/good-old-nlp/train.py
train.py
py
5,361
python
en
code
0
github-code
21
[ { "api_name": "io.open", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 39, "usage_type": "call" }, { "api_name": "tensorflow.keras.preprocessing.text.Tokenizer", "line_number": 59, "usage_type": "call" }, { "api_name": "ten...
29471707643
## referenced Harvard CS205 Course Material Lecture C3 ## https://harvard-iacs.github.io/2021-CS205/lectures/C3/ from pyspark import SparkConf,SparkContext from pyspark.streaming import StreamingContext from pyspark.sql import Row,SQLContext import sys, os, requests, time, math import datetime as dt import yfinance as...
YutingYao/YutingDB
GeoBigData/SPARK/Spark_Kafka_RDD_Humidity/03 - LSTM.py
03 - LSTM.py
py
6,489
python
en
code
4
github-code
21
[ { "api_name": "tensorflow.compat.v1.logging.set_verbosity", "line_number": 15, "usage_type": "call" }, { "api_name": "tensorflow.compat", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 25, "usage_type": "call" }, { "api_...
30126192711
import os from Cryptodome.Protocol.KDF import scrypt from Cryptodome.Random import get_random_bytes SCRYPT_SALT_LEN = 16 SCRYPT_DERIVED_KEY_LEN = 16 SCRYPT_N = 2**20 SCRYPT_R = 8 SCRYPT_P = 1 class Key: """ A class to represent an encryption key. """ def __init__(self, key, salt=None, salt_len=SCRYP...
tjdistler/dev
file_utils/crypto/utils.py
utils.py
py
1,231
python
en
code
0
github-code
21
[ { "api_name": "Cryptodome.Random.get_random_bytes", "line_number": 21, "usage_type": "call" }, { "api_name": "Cryptodome.Protocol.KDF.scrypt", "line_number": 29, "usage_type": "call" }, { "api_name": "os.system", "line_number": 38, "usage_type": "call" }, { "api_n...
72236131892
from os.path import splitext import matplotlib.pyplot as plt def plot_history(outpath, legend=[], plots=[]): fig_path = ''.join(splitext(outpath)[:-1] + ('.png',)) for i in range(len(plots)): plt.subplot() plt.xlabel('Epoch') plt.ylabel(legend[i]) plt.plot(range(len(plots[i])), ...
chengui/torch-nmt
nmt/util/plot.py
plot.py
py
357
python
en
code
1
github-code
21
[ { "api_name": "os.path.splitext", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib....
33300871538
# coding: utf-8 import uuid from odoo import api, fields, models, _ from odoo.http import request from odoo.addons.payment.models.payment_acquirer import ValidationError from yandex_checkout import Configuration, Payment from werkzeug import urls import logging _logger = logging.getLogger(__name__) class YandexAcqu...
ERP-SWISS/Yandex-Checkout
payment_yandex/models/payment.py
payment.py
py
3,503
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 14, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 14, "usage_type": "name" }, { "api_name": "odoo.fields.Sele...
26215443901
import requests headers = {'user-agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36'} url = 'https://www.shanbay.com/api/v1/vocabtest/category/?_=1588432774826' res = requests.get(url,headers=headers) res = res.json()['data'] for i in r...
oldfatdog/Crawler
07 爬取知乎文章/爬取扇贝单词.py
爬取扇贝单词.py
py
2,176
python
zh
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" } ]
8051253788
""" Vergleich der Radar Momente von RADOLAN und deren ZEITLICH VERSCHIEBUNG """ import h5py import numpy as np import glob import wradlib import datetime as dt from osgeo import osr import matplotlib.pyplot as plt from satlib import read_rado t1, t2 = "20170307024500", "20170307025000" x, y, z, bz = read_rado(t1...
vecoveco/gpm
pcc__RadoRado.py
pcc__RadoRado.py
py
4,874
python
en
code
13
github-code
21
[ { "api_name": "satlib.read_rado", "line_number": 19, "usage_type": "call" }, { "api_name": "satlib.read_rado", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib...
21499569937
import inspect import warnings import autograd.numpy as np from scipy.optimize import minimize import surpyval from ..parametric.fitters import bounds_convert, fix_idx_and_function from .regression import Regression class ParameterSubstitutionFitter: def __init__( self, kind, name, ...
derrynknife/SurPyval
surpyval/regression/parameter_substitution.py
parameter_substitution.py
py
10,711
python
en
code
40
github-code
21
[ { "api_name": "autograd.numpy.array", "line_number": 57, "usage_type": "call" }, { "api_name": "autograd.numpy", "line_number": 57, "usage_type": "name" }, { "api_name": "autograd.numpy.isscalar", "line_number": 58, "usage_type": "call" }, { "api_name": "autograd....
18604430361
import requests from flask import Flask, session, render_template import threading class UrlFuzzer(threading.Thread): def __init__(self, website): threading.Thread.__init__(self) self.website = website self.count = 0 self.results = [] self.current = "" def run(self): ...
omkar2810/website_scanner
fuzzer.py
fuzzer.py
py
757
python
en
code
0
github-code
21
[ { "api_name": "threading.Thread", "line_number": 6, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 9, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 9, "usage_type": "attribute" }, { "api_name": "re...
34700209623
#!/usr/bin/env python3 import os import sys import numpy import shutil import tempfile import subprocess from casacore.tables import table def smart_int(value): for i in range(len(value)): try: return int(value[i:], 10) except ValueError: pass raise ValueError("Cannot...
lwa-project/ovro_data_recorder
utils/show_ms_info.py
show_ms_info.py
py
5,080
python
en
code
3
github-code
21
[ { "api_name": "os.path.isdir", "line_number": 56, "usage_type": "call" }, { "api_name": "os.path", "line_number": 56, "usage_type": "attribute" }, { "api_name": "tempfile.mkdtemp", "line_number": 59, "usage_type": "call" }, { "api_name": "subprocess.check_call", ...
10148087354
# -*- coding: utf-8 -*- """ Created on Thu Feb 21 09:42:13 2019 @author: jamontol """ from scipy.optimize import minimize import numpy as np # Define the likelihood function where params is a list of initial parameter estimates def regressLL(params): import scipy.stats as stats # Resave the initial paramet...
jamontol/Forecasting-Residential
Regression_MLE.py
Regression_MLE.py
py
1,167
python
en
code
1
github-code
21
[ { "api_name": "numpy.sum", "line_number": 27, "usage_type": "call" }, { "api_name": "scipy.stats.norm.logpdf", "line_number": 27, "usage_type": "call" }, { "api_name": "scipy.stats.norm", "line_number": 27, "usage_type": "attribute" }, { "api_name": "scipy.stats",...