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
32907076601
from aiohttp import web import aiohttp import threading import queue import numpy as np import cv2 import jinja2 import aiohttp_jinja2 import os import asyncio import base64 cams_queue = queue.Queue(maxsize=10) monitor_queue = [] face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.x...
nhatuan84/esp32-cam-computer-vision
server.py
server.py
py
3,749
python
en
code
0
github-code
97
[ { "api_name": "queue.Queue", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.cvtColor"...
35888637633
# PACKED-BED REACTOR MODEL # heterogenous # ------------------------- # import packages/modules import math as MATH import numpy as np from scipy.integrate import solve_ivp from timeit import default_timer as timer from scipy import optimize # internal from PyREMOT.docs.modelSetting import MODEL_SETTING from PyREMOT.d...
sinagilassi/rmt-app
PyREMOT/docs/pbHeterReactor.py
pbHeterReactor.py
py
104,332
python
en
code
4
github-code
97
[ { "api_name": "PyREMOT.docs.rmtUtility.rmtUtilityClass.buildReactionList", "line_number": 82, "usage_type": "call" }, { "api_name": "PyREMOT.docs.rmtUtility.rmtUtilityClass", "line_number": 82, "usage_type": "name" }, { "api_name": "PyREMOT.core.constants.PI_CONST", "line_num...
5481603968
from __future__ import annotations from typing import TYPE_CHECKING, Callable, Iterable, Optional, Tuple, Union from collections import Counter, UserDict import math import regex as re from operator import attrgetter import rapidfuzz from .utils import flatmap, MALWARE_NAME_REMAP, FAMILY_NAME_BLACKLIST from .vocab im...
polyswarm/polyunite
polyunite/analysis.py
analysis.py
py
7,262
python
en
code
3
github-code
97
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 23, "usage_type": "name" }, { "api_name": "collections.UserDict", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 36, "usage_type": "name" }, { "api_name": "typing.Unio...
9230761798
import pickle from mypathlib import PathTemplate from multiprocessing import Pool from Patents import Patent _R_FILE = PathTemplate('$pdata/patent/patent_$index.pkl.gz') W_FILE = PathTemplate('$lite/patent/granted.pkl').substitute() def do(index): return {pat.pub_number: pat.is_granted for pubnum, pat in Patent...
WooJoongKim0107/GeneBib_part1
src/Patents/list_granted.py
list_granted.py
py
592
python
en
code
0
github-code
97
[ { "api_name": "mypathlib.PathTemplate", "line_number": 7, "usage_type": "call" }, { "api_name": "mypathlib.PathTemplate", "line_number": 8, "usage_type": "call" }, { "api_name": "Patents.Patent.load", "line_number": 12, "usage_type": "call" }, { "api_name": "Paten...
25042452721
import torch.nn as nn import numpy as np from pcdet.datasets.augmentor.X_transform import X_TRANS import torch class HeightCompression(nn.Module): def __init__(self, model_cfg, voxel_size=None, point_cloud_range=None): super().__init__() self.model_cfg = model_cfg self.num_bev_features = s...
hailanyi/VirConv
pcdet/models/backbones_2d/map_to_bev/height_compression.py
height_compression.py
py
1,114
python
en
code
200
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "pcdet.datasets.augmentor.X_transform.X_TRANS", "line_number": 11, "usage_type": "call" } ]
42174457427
from __future__ import annotations from typing import TYPE_CHECKING, Mapping from src.my_connector import AluConnector if TYPE_CHECKING: from aiohttp import ClientResponse from lcu_driver.connection import Connection async def worker_func(connection: Connection, summoner: ClientResponse) -> None: summo...
Aluerie/HextechButEfficient
scripts/be_management/better_mass_disenchant.py
better_mass_disenchant.py
py
1,779
python
en
code
4
github-code
97
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 7, "usage_type": "name" }, { "api_name": "lcu_driver.connection.Connection", "line_number": 12, "usage_type": "name" }, { "api_name": "aiohttp.ClientResponse", "line_number": 12, "usage_type": "name" }, { "api_n...
40136403139
from flask import Flask, url_for, redirect, session, flash from apscheduler.schedulers.background import BackgroundScheduler from flask import jsonify from flask import request ,render_template import os import datetime from Ml_destination import Creation_Model,Predection_distination ,Training_model_destination,...
achbra20/PFE-ML-windward
Machine_learning.py
Machine_learning.py
py
15,824
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "os.urandom", "line_number": 15, "usage_type": "call" }, { "api_name": "apscheduler.schedulers.background.BackgroundScheduler", "line_number": 22, "usage_type": "call" }, { "api_...
30070708274
# coding=utf-8 from SiteSignupSanity import SiteSignupSanity import logbook import time import os class SiteHomeSearch(SiteSignupSanity): def __init__(self): self.SEARCH = {'AMOUNT': 'סכום', 'AREA': 'אזור', 'CATEGORY': "קטגוריה"} self.FIND_ME_A_GIFT = 'תמצאו לי מתנה' super(SiteHomeSearch, ...
ranhershko/play_with_python
SiteSanityCheck/SiteHomeSearch.py
SiteHomeSearch.py
py
1,451
python
en
code
0
github-code
97
[ { "api_name": "SiteSignupSanity.SiteSignupSanity", "line_number": 8, "usage_type": "name" }, { "api_name": "logbook.Logger", "line_number": 13, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 30, "usage_type": "call" } ]
69945233278
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('campaigns', '0005_auto_20150610_1542'), ] operations = [ migrations.AddField( model_name='campaign', ...
JoshAddington/Show-NYC
kiosk_cms/campaigns/migrations/0006_auto_20150629_1713.py
0006_auto_20150629_1713.py
py
607
python
en
code
1
github-code
97
[ { "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" }, { ...
32927644340
# Author: Olivier Lécluse # License GPL-3 # Using Simple PyQT serial terminal v0.09 from iosoft.blog # # Serial Terminal frame # from PySide2.QtWidgets import QVBoxLayout, QWidget, QTextEdit, QApplication from PySide2.QtCore import Qt, Signal, Slot, QSize from PySide2.QtGui import QFont, QTextCursor, QPainter, QPixmap...
wawachief/DigiQt
src/view/SerialTerminalFrame.py
SerialTerminalFrame.py
py
3,454
python
en
code
5
github-code
97
[ { "api_name": "PySide2.QtWidgets.QTextEdit", "line_number": 22, "usage_type": "name" }, { "api_name": "PySide2.QtWidgets.QTextEdit.__init__", "line_number": 24, "usage_type": "call" }, { "api_name": "PySide2.QtWidgets.QTextEdit", "line_number": 24, "usage_type": "name" ...
18860076873
import csv from collections import OrderedDict import numpy as np from ADFR import molToAtomSetStatic from ADFRcc.adfr import AtomSet, PairwiseScorer, Parameters parameters = Parameters.getParameters() feCoeffVdw = parameters.feCoeffVdw feCoeffHbond = parameters.feCoeffHbond feCoeffEstat = parameters.feCoeffEstat fe...
Ficere/DummyDocking
vina_docking/bin/ADFRsuit/ADFRsuite-1.1dev/CCSBpckgs/ADFR/IElister.py
IElister.py
py
9,203
python
en
code
1
github-code
97
[ { "api_name": "ADFRcc.adfr.Parameters.getParameters", "line_number": 9, "usage_type": "call" }, { "api_name": "ADFRcc.adfr.Parameters", "line_number": 9, "usage_type": "name" }, { "api_name": "ADFRcc.adfr.AtomSet", "line_number": 50, "usage_type": "call" }, { "api...
43078168304
# import notifications.urls from django.conf.urls.static import static from django.contrib import admin from django.urls import path, include, re_path from .settings import DEBUG, MEDIA_ROOT, MEDIA_URL urlpatterns = [ # WEBSITE APPLICATION --------------------------------------------------------------------------...
IkramKhan-DevOps/excapp-elearn
core/urls.py
urls.py
py
960
python
en
code
1
github-code
97
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.include", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "django.contrib....
15107392330
import sys import requests class FacebookMessenger(): def __init__(self, page_access_token): self.page_access_token = page_access_token self.actions = ["mark_seen", "typing_on", "typing_off"] def _simple_request_maker(self, payload): url = "https://graph.facebook.com/v2.6/me/messages?...
Jhonata-Jansen/chatworks
chatworks/facebook.py
facebook.py
py
3,725
python
en
code
0
github-code
97
[ { "api_name": "requests.post", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 17, "usage_type": "call" } ]
25228810501
from datetime import datetime, timedelta PYBITES_BORN = datetime(year=2016, month=12, day=19) def gen_special_pybites_dates(): anniversaries = [] date = PYBITES_BORN while True: date += timedelta(days=100) if date.year == 2020: break anniversaries.append(date) date...
buzonek/PyBitesExcersises
16/test.py
test.py
py
548
python
en
code
0
github-code
97
[ { "api_name": "datetime.datetime", "line_number": 3, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 16, "usage_type": "call" } ]
749291375
# 4부 비선형 자료구조/그래프/그래프 순회 # DFS graph = { 1: [2, 3, 4], 2: [5], 3: [5], 4: [], 5: [6, 7], 6: [], 7: [3], } # 재귀로 표현 def recursive_dfs(v: int, discovered=[]) -> list[int]: discovered.append(v) # 자식 노드가 없는 4, 6의 경우 for 문으로 들어가지 않고 return 하도록 함. for w in graph[v]: if w not...
hyeonsook95/TIL
Book/파이썬 코딩 테스트/non_linear_data_structures.py
non_linear_data_structures.py
py
17,763
python
ko
code
0
github-code
97
[ { "api_name": "itertools.permutations", "line_number": 189, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 222, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 228, "usage_type": "name" }, { "api_name": "collecti...
1758754175
#! /usr/bin/env python """ System memory related functions """ __author__ = 'Carlos Alberto Gomez Gonzalez' __all__ = ['check_enough_memory', 'get_available_memory'] from psutil import virtual_memory def get_available_memory(verbose=True): """ Get the available memory in bytes. Parameters ...
vortex-exoplanet/VIP
vip_hci/config/mem.py
mem.py
py
1,961
python
en
code
67
github-code
97
[ { "api_name": "psutil.virtual_memory", "line_number": 28, "usage_type": "call" } ]
255646739
import sys import discord from discord.ext import commands class Stats(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command() @commands.has_permissions(send_messages=True) @commands.guild_only() async def stats(self, ctx): """List some guild statistics. ...
glanyx/segachan
sweeperbot/cogs/misc/stats.py
stats.py
py
4,913
python
en
code
1
github-code
97
[ { "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": 48, "usage_type": "call" }, { "api_name": "discor...
37484829866
import requests from datetime import datetime # from fake_headers import Headers def request_methods(): # response = requests.get('https://httpbin.org') # response = requests.post('https://httpbin.org/post', data={'first_name': 'Pavlo', 'last_name': 'Myha'}) # response = requests.put('https://httpbin.org...
miha-pavel/hillel_python_base
Request/request.py
request.py
py
4,789
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 36, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 36, "usage_type": "name" }, { "api_name": "requests.get", ...
11193915811
import json def fitnessEval(obj): # { puzzle : [], length : l, width : w } # print(jsonInput) pieces = obj['puzzle'] l = obj['length'] w = obj['width'] #print(pieces, l, w) if len(pieces) == 0 or l == None or l == 0 or w == None or w == 0: return json.dumps({'fitness': 'input error...
RamGopalSrikar/Puzzle-Solving-Using-Genetic-Algorithm
fitnessEval.py
fitnessEval.py
py
1,067
python
en
code
0
github-code
97
[ { "api_name": "json.dumps", "line_number": 12, "usage_type": "call" } ]
13542035601
import sqlite3 from flask import Flask, render_template, request, g app = Flask(__name__) @app.route('/') def index(): if 'db' not in g: g.db = sqlite3.connect('data.db') database = g.db cursor = database.execute("select count(*) from master where TYPE='table' AND name='urls'") for r in ...
xxvw/url-shorter
app.py
app.py
py
639
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.g", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.g.db", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 9, ...
26328307694
"""Config.""" from dataclasses import dataclass import enum from typing import Dict, Callable from hardware_testing.data.csv_report import CSVReport, CSVSection from . import ( test_mount, test_force, test_width, test_probe, ) class TestSection(enum.Enum): """Test Section.""" MOUNT = "MOUNT...
Opentrons/opentrons
hardware-testing/hardware_testing/production_qc/gripper_assembly_qc_ot3/config.py
config.py
py
1,556
python
en
code
363
github-code
97
[ { "api_name": "enum.Enum", "line_number": 16, "usage_type": "attribute" }, { "api_name": "typing.Dict", "line_number": 30, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 30, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", ...
32968962696
import bpy from . import operator class CM_PT_ObjectColorFromMaterial(bpy.types.Panel): bl_label = 'Viewport Display from Nodes' bl_idname = 'CM_PT_ObjectColorFromMaterial' bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = 'material' def draw(self, _context): layout...
semagnum/Material_Color_From_Nodes
panel.py
panel.py
py
1,149
python
en
code
4
github-code
97
[ { "api_name": "bpy.types", "line_number": 6, "usage_type": "attribute" } ]
72298811839
import pandas as pd import sys import matplotlib.pyplot as plt import pathlib from scipy import stats ###################################################################### # Creates a graph comparing the percentage change between two coins. # ###################################################################### de...
TheAp0cryphal/CryptoPricePredictor
percent_change.py
percent_change.py
py
1,914
python
en
code
1
github-code
97
[ { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line...
44480091482
""" Factories for statsd/metrics clients. """ from os import environ from unittest.mock import MagicMock from datadog import DogStatsd from microcosm.api import defaults @defaults( host="localhost", port=8125, tags=[], ) def configure_metrics(graph, configuration="metrics"): """ Create a DataDog...
globality-corp/microcosm-metrics
microcosm_metrics/factories.py
factories.py
py
1,061
python
en
code
1
github-code
97
[ { "api_name": "unittest.mock.MagicMock", "line_number": 22, "usage_type": "name" }, { "api_name": "datadog.DogStatsd", "line_number": 24, "usage_type": "name" }, { "api_name": "os.environ.get", "line_number": 27, "usage_type": "call" }, { "api_name": "os.environ",...
26306897984
# flake8: noqa """OPENTRONS.""" from opentrons import protocol_api import math import threading from time import sleep from opentrons import types metadata = { 'protocolName': 'NEBNext Ultra II Directional RNA Library Prep Kit for Illumina Part 2: RNA Isolation', 'author': 'John C. Lynch <john.lynch@opentron...
Opentrons/Protocols
protocols/00f7b1_part2/00f7b1_part2.ot2.apiv2.py
00f7b1_part2.ot2.apiv2.py
py
16,332
python
en
code
53
github-code
97
[ { "api_name": "time.sleep", "line_number": 42, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 44, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 49, "usage_type": "call" }, { "api_name": "opentrons.protocol_api.Protoco...
38978328591
#################################### #### FILE DECRYPTION (FOR TFS) ##### #################################### import os, time try: from cryptography.fernet import Fernet except: os.system('pip install cryptography') # Windows, on linux 'pip3...' from cryptography.fernet import Fernet print( """ ------ Fil...
takeus-panel/TFS-Decrypt
app.py
app.py
py
927
python
en
code
0
github-code
97
[ { "api_name": "os.system", "line_number": 8, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 18, "usage_type": "call" }, { "api_name": "cryptography.fernet.Fernet", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.splitext", ...
9542339197
import json from pprint import pprint from typing import List import redis as redis from sqlalchemy.ext.asyncio import AsyncSession import fastapi as _fastapi from fastapi.encoders import jsonable_encoder from backend.schemas import analytic as _analytic from backend.services.base import get_redis_client from tgbot.c...
PGAndre/InvestAnalytics_bot
backend/api/analytic.py
analytic.py
py
5,148
python
ru
code
1
github-code
97
[ { "api_name": "fastapi.APIRouter", "line_number": 17, "usage_type": "call" }, { "api_name": "tgbot.config.load_config", "line_number": 19, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlalchemy.ext...
23799019005
"""Proyecto URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-base...
JPGenaro/Integrador_Verduleria
Proyecto/Proyecto/urls.py
urls.py
py
1,540
python
en
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 21, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 21, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 21, "usage_type": "name" }, { "api_name": "...
73186196799
from gluonts.dataset.common import ListDataset, TrainDatasets from gluonts.dataset.multivariate_grouper import MultivariateGrouper from gluonts.evaluation import MultivariateEvaluator from gluonts.dataset.repository.datasets import get_dataset def load_multivariate_dataset(dataset_name: str, dim: int = 1): ds = g...
arangatang/Crayon
examples/Tuning/testing_multivariate/utils.py
utils.py
py
664
python
en
code
1
github-code
97
[ { "api_name": "gluonts.dataset.repository.datasets.get_dataset", "line_number": 8, "usage_type": "call" }, { "api_name": "gluonts.dataset.multivariate_grouper.MultivariateGrouper", "line_number": 9, "usage_type": "call" }, { "api_name": "gluonts.dataset.common.TrainDatasets", ...
30290260741
from twilio.rest import TwilioRestClient from st2actions.runners.pythonrunner import Action class TwilioSendSMSAction(Action): def __init__(self, config): super(TwilioSendSMSAction, self).__init__(config=config) self.client = TwilioRestClient(self.config['account_sid'], ...
StackStorm/st2contrib
packs/twilio/actions/send_sms.py
send_sms.py
py
814
python
en
code
154
github-code
97
[ { "api_name": "st2actions.runners.pythonrunner.Action", "line_number": 6, "usage_type": "name" }, { "api_name": "twilio.rest.TwilioRestClient", "line_number": 9, "usage_type": "call" } ]
74665096959
import os, grpc, codecs, requests import lnt.rpc.rpc_pb2 as ln, lnt.rpc.rpc_pb2_grpc as lnrpc def create_stub(ctx): cfg = ctx.parent.parent.config['LND'] mac_path = os.path.expanduser(cfg['MacaroonPath']) macaroon = codecs.encode(open(mac_path, 'rb').read(), 'hex') os.environ['GRPC_SSL_CIPHER_SUITES...
arshbot/lnt
lnt/commands/utils/utils.py
utils.py
py
3,374
python
en
code
5
github-code
97
[ { "api_name": "os.path.expanduser", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "codecs.encode", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_num...
21179513145
import utils import re import math import copy import collections import itertools import random def initialise(): global ingredients date = utils.loadInputFile("input_21.txt") ingredients = [] allergens = [] for line in date: ingredients.append(line.split(" (contains")[0].split()) ...
djjavo/AdventOfCode2020
sol21.py
sol21.py
py
2,144
python
en
code
1
github-code
97
[ { "api_name": "utils.loadInputFile", "line_number": 13, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 23, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 24, "usage_type": "call" }, { "api_name": "copy.deep...
44924256169
import torch import torch.nn as nn import torch.nn.functional as F class BasicModule(torch.nn.Module): def __init__(self): super(BasicModule,self).__init__() def load(self,path): self.load_state_dict(torch.load(path)) def save(self,path=None): if path is None: name='re...
Mo-Kanya/AVDA
PVDA/FADAnet/FADAmodule.py
FADAmodule.py
py
1,729
python
en
code
1
github-code
97
[ { "api_name": "torch.nn", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.load", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.save", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.save", "line_number": 18...
14673097216
from AmazonCategory import AmazonCategory from AmazonCategoryMetadata import AmazonCategoryMetadata, create_amazon_category_metadata import os import io import requests import json import gzip import pandas as pd import math from pandarallel import pandarallel import ast pandarallel.initialize(progress_bar=True, nb_wo...
abhi74k/gnn-recommender-system
dataset_utils.py
dataset_utils.py
py
9,573
python
en
code
0
github-code
97
[ { "api_name": "pandarallel.pandarallel.initialize", "line_number": 13, "usage_type": "call" }, { "api_name": "pandarallel.pandarallel", "line_number": 13, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 17, "usage_type": "call" }, { "api_nam...
24587885802
''' Make a program which asks the user to input an expression, calculates its factors and prints them It ought to handle invalid input by making use of exception handling ''' from sympy import symbols,factor,sympify from sympy.core.sympify import SympifyError def factorizer(expr): x,y=symbols('x,y') ...
zosopick/mathwithpython1
Excersises/Chapter 4/1. Factor Finder.py
1. Factor Finder.py
py
784
python
en
code
0
github-code
97
[ { "api_name": "sympy.symbols", "line_number": 11, "usage_type": "call" }, { "api_name": "sympy.factor", "line_number": 12, "usage_type": "call" }, { "api_name": "sympy.sympify", "line_number": 20, "usage_type": "call" }, { "api_name": "sympy.core.sympify.SympifyEr...
16334882406
import torch from torch import nn from d2l import torch as d2l # 卷积块:BN-ReLU-Conv def conv_block(input_channels, num_channels): return nn.Sequential( nn.BatchNorm2d(input_channels), nn.ReLU(), nn.Conv2d(input_channels, num_channels, kernel_size=3, padding=1) ) # 稠密层 # 每一层卷积块的输出通道连接 cl...
xuhuasheng/Dive2DeepLearning-pytorch
convolutional-modern/DenseNet.py
DenseNet.py
py
2,443
python
en
code
0
github-code
97
[ { "api_name": "torch.nn.Sequential", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.BatchNorm2d", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
26151582802
import os from typing import Type import discord from data_types import GameId from games.utils import Game, GameDetails, GameInfo, get_game_info from .data import TicTacToeData from .helpers import check_win from .views import TicTacToeView class TicTacToe(Game): """ Game of Tic Tac Toe """ @stat...
ky-42/jubilant-computing-machine
src/games/game_modules/Tic Tac Toe/__init__.py
__init__.py
py
2,819
python
en
code
0
github-code
97
[ { "api_name": "games.utils.Game", "line_number": 14, "usage_type": "name" }, { "api_name": "games.utils.GameDetails", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", ...
20931392972
import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import make_blobs from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score def train_perceptron(descriptor, target, threshold=0.01, learnRate=0.1, iterations=10): weights = np.zeros(len(descriptor[0])) ...
propagating/graduate-work
cs-530-data-mining/hw10/Perceptron.py
Perceptron.py
py
2,848
python
en
code
2
github-code
97
[ { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 23, ...
4595547474
import disnake import random import requests import asyncio from disnake.ext import commands config = { 'token': 'TOKEN', 'prefix': '/', } bot = commands.Bot(command_prefix="/", intents=disnake.Intents.all()) bot.remove_command('help') @bot.event async def on_ready(): print(f'{bot.user} has connected to...
CogguJ/Ambus_bot
ambus.py
ambus.py
py
5,247
python
en
code
0
github-code
97
[ { "api_name": "disnake.ext.commands.Bot", "line_number": 12, "usage_type": "call" }, { "api_name": "disnake.ext.commands", "line_number": 12, "usage_type": "name" }, { "api_name": "disnake.Intents.all", "line_number": 12, "usage_type": "call" }, { "api_name": "dis...
4563434303
# Import Splinter, BeautifulSoup, and Pandas from splinter import Browser from bs4 import BeautifulSoup as soup import pandas as pd from webdriver_manager.chrome import ChromeDriverManager # Set the executable path and initialize Splinter executable_path = {'executable_path': ChromeDriverManager().install()} browser ...
snkty8/Mission-to-Mars
Mission_to_Mars_Challenge.py
Mission_to_Mars_Challenge.py
py
4,449
python
en
code
0
github-code
97
[ { "api_name": "webdriver_manager.chrome.ChromeDriverManager", "line_number": 9, "usage_type": "call" }, { "api_name": "splinter.Browser", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 26, "usage_type": "call" }, { "ap...
38154085697
import requests KIWI_ENDPOINT = "https://tequila-api.kiwi.com/locations/query" HEADER = { "apikey": "V3oakUSbN6-TSWtVnUR20Pt3cI1rF5mD" } class FlightSearch: # This class is responsible for talking to the Flight Search API. def get_iata_code(self, city): params = { "term": city ...
Santhoshnani12/FlightDeals
flight_search.py
flight_search.py
py
497
python
en
code
1
github-code
97
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" } ]
34799903130
from typing import List class Solution: def subsets(self, nums: List[int]) -> List[List[int]]: rslt = [] def run(now, candi): # print(sorted(now), rslt) if sorted(now) not in rslt: rslt.append(sorted(now)) if not candi: return ...
wudangqibujie/jay_template
ST/78. 子集.py
78. 子集.py
py
565
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" } ]
44425702330
from django.shortcuts import render from django.http import HttpResponse # Create your views here. def index(request): return HttpResponse("its okay") def login_view(request): if(request.POST): # имя формы, которое скорее всего надо добавлять в forms.py yourForm= Zalupa(request.POST) ...
kiboulfy/project1
MainApp/views.py
views.py
py
576
python
ru
code
0
github-code
97
[ { "api_name": "django.http.HttpResponse", "line_number": 7, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 17, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" } ]
2082872278
import requests import execjs cookies = { '_horizon_uid': 'd6a5d5ea-b057-4431-8d41-982f8bf12b08', '_horizon_sid': 'e2c9e3b6-2ee8-49e6-a54a-0a15a39ee1b7', } def fun(page): json_data = { 'type': 'trading-type', 'publishStartTime': '', 'publishEndTime': '', 'siteCode': '44', ...
xishandong/crawlProject
进阶篇/js逆向/请求头请求体加密/广东省公共资源交易/guang.py
guang.py
py
1,247
python
en
code
305
github-code
97
[ { "api_name": "execjs.compile", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 36, "usage_type": "call" } ]
29138370421
import json import threading import tkinter as tk from tkinter import messagebox from tkinter import colorchooser from tkinter import font as tkFont from tkcalendar import DateEntry from operator import attrgetter from datetime import datetime, timedelta from plyer import notification import pyttsx3 class Task: de...
khusan0302/task_manager
task_manager.py
task_manager.py
py
18,357
python
en
code
0
github-code
97
[ { "api_name": "pyttsx3.init", "line_number": 32, "usage_type": "call" }, { "api_name": "tkinter.font.Font", "line_number": 36, "usage_type": "call" }, { "api_name": "tkinter.font", "line_number": 36, "usage_type": "name" }, { "api_name": "tkinter.Frame", "line...
42628494538
# pylint: disable=missing-docstring import datetime from src.toolbox.toolbox import get_feriados_byma from src.toolbox.toolbox import hay_mercado from src.toolbox.toolbox import extract_price_size_values from src.toolbox.toolbox import extract_ticker_market_values def test_get_feriados_byma(): actual_return = ge...
UrielPaluch/Toolbox
tests/test_toolbox.py
test_toolbox.py
py
4,347
python
en
code
1
github-code
97
[ { "api_name": "src.toolbox.toolbox.get_feriados_byma", "line_number": 11, "usage_type": "call" }, { "api_name": "src.toolbox.toolbox.hay_mercado", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 23, "usage_type": "call...
25098840499
from pdfminer.high_level import extract_text from pdfminer.layout import LAParams import re from collections import defaultdict import time pdfsep = " " ## Regex Patterns re_subjects = "(?P<subjects>(?:\d+\(\d+\.?\d*\)\n)+)" re_cred = "(?P<cred>\d+)" re_scores = "(?P<scoreList>(?:\s*(?:\d+|[ACD]|\-)\s+(?:\d+|[ACD]|\-...
anshulbansal02/Ipu
percy.py
percy.py
py
2,162
python
en
code
0
github-code
97
[ { "api_name": "time.time", "line_number": 28, "usage_type": "call" }, { "api_name": "pdfminer.high_level.extract_text", "line_number": 31, "usage_type": "call" }, { "api_name": "pdfminer.layout.LAParams", "line_number": 31, "usage_type": "call" }, { "api_name": "c...
39548474095
import math import sys from typing import Iterable, Optional import torch import torch.nn.functional as F from timm.data import Mixup from timm.utils import accuracy, ModelEma from driveit.losses import DistillationLoss import driveit.utils from driveit.driveit import ( DriveitLinear, get_descendant, re...
calvinmccarter/itlumm
driveit/driveit_engine.py
driveit_engine.py
py
6,155
python
en
code
4
github-code
97
[ { "api_name": "torch.nn", "line_number": 23, "usage_type": "attribute" }, { "api_name": "driveit.losses.DistillationLoss", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Iterable", "line_number": 24, "usage_type": "name" }, { "api_name": "torch.o...
27839221511
# -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('LICENSE') as f: license = f.read() setup( name='declarativeautoml', version='0.0.1', description='Declarative AutoML', long_description='description', author='Felix Neutatz', author_email='neutatz@gmail.com'...
BigDaMa/DeclarativeAutoML
setup.py
setup.py
py
1,277
python
en
code
2
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 11, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 40, "usage_type": "call" } ]
72671236799
import numpy as np from sklearn.metrics import normalized_mutual_info_score, adjusted_rand_score import sklearn from munkres import Munkres def get_cluster_labels_from_indices(indices): n_clusters = len(indices) clusterLabels = np.zeros(n_clusters) for i in range(n_clusters): clusterLabels[i] = indi...
jirufengyu/AMVAE
utils/newmetrics.py
newmetrics.py
py
3,075
python
en
code
1
github-code
97
[ { "api_name": "numpy.zeros", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 25, ...
14370399542
from django.test import TestCase, Client from django.urls import reverse class LandingTestCase(TestCase): def setUp(self): self.client = Client() self.url = reverse('landing:index') def test_landing(self): # Do action response = self.client.get(self.url) # Asserts ...
marfyl/django-curriculum-landing
landing/tests.py
tests.py
py
1,326
python
en
code
1
github-code
97
[ { "api_name": "django.test.TestCase", "line_number": 5, "usage_type": "name" }, { "api_name": "django.test.Client", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 9, "usage_type": "call" } ]
5329823376
""" Last Update: Dec 2021 Note: 1) Remember to add +1 on the terms count every semester for students not in internships; 2) Check list of presenters on the website. """ import collections import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set(font_scale=1.3) sns.set_style("whitegrid") prese...
raquelaoki/PythonGoodPractices
speaker_count.py
speaker_count.py
py
2,357
python
en
code
0
github-code
97
[ { "api_name": "seaborn.set", "line_number": 13, "usage_type": "call" }, { "api_name": "seaborn.set_style", "line_number": 14, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 80, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.s...
9616322233
#-*- coding: utf-8 -*- from bs4 import BeautifulSoup import lxml import requests import xlsxwriter class Spider(): # 初始化参数 def __init__(self, urlList): self.urlList = urlList self.num = 0 self.row = 0 self.col = 0 self.wookbook = '' self.wooksheet = '' # 下载...
teamemory/spider
spider.py
spider.py
py
2,301
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 30, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 40, "usage_type": "call" }, { "api_name": "xlsxwriter.Workbook"...
74127051839
from bs4 import BeautifulSoup import collections def store_external_dictionary(site_text, path, machine_id, sub_id): # takes the external urls, and them stores them with the path. list_of_urls = get_external_urls(site_text, "curlie") dict_pairing = {path: list_of_urls} try: f2 = open("d...
Coffee-Toffee/Use-and-Abuse-scraper
Function_Parser_UnA.py
Function_Parser_UnA.py
py
1,934
python
en
code
2
github-code
97
[ { "api_name": "bs4.BeautifulSoup", "line_number": 21, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 22, "usage_type": "call" } ]
43598070029
from http import HTTPStatus import httpx import pytest from fastapi import FastAPI from fastapi.testclient import TestClient from app.common.settings import settings from app.main import app from app.tests.e2e.conftest import create_user_and_login def test_health_check(client: TestClient): url = app.url_path_fo...
JYC11/fastapi-bug-tracker
app/tests/e2e/test_user.py
test_user.py
py
5,146
python
en
code
1
github-code
97
[ { "api_name": "fastapi.testclient.TestClient", "line_number": 13, "usage_type": "name" }, { "api_name": "app.main.app.url_path_for", "line_number": 14, "usage_type": "call" }, { "api_name": "app.main.app", "line_number": 14, "usage_type": "name" }, { "api_name": "...
25515295498
import boto3 import argparse import threading import sys import logging import queue import time q = queue.Queue() logging.basicConfig( level=logging.ERROR, format="%(asctime)s [%(levelname)s] %(funcName)s line %(lineno)d: %(message)s" ) logger = logging.getLogger(__name__) parser = argparse.ArgumentParser()...
dvonessen/tools
s3_tools/s3_change_storage_class.py
s3_change_storage_class.py
py
5,605
python
en
code
1
github-code
97
[ { "api_name": "queue.Queue", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.getLogger",...
42161010195
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- """ featurelib ========== Date time features. """ from pathlib import Path import numpy as np import pandas as pd import re from pandas import DataFrame from dataclasses import dataclass from .core import FtAbstract @dataclass() class DateTimeFt(F...
mengwangk/dl-projects
featurelib/ft_dttime.py
ft_dttime.py
py
2,175
python
en
code
1
github-code
97
[ { "api_name": "core.FtAbstract", "line_number": 23, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 26, "usage_type": "name" }, { "api_name": "pandas.core", "line_number": 39, "usage_type": "attribute" }, { "api_name": "numpy.datetime64", ...
72021167358
''' The RESTful style api server ''' from flask import render_template from flask import Flask, request, redirect, jsonify, send_from_directory, make_response from flask_cors import * from server import app from functools import wraps import pandas as pd import hashlib import random import time import datetime impo...
xiameng552180/PersuasiveSpeech
server/routes/index.py
index.py
py
10,162
python
en
code
1
github-code
97
[ { "api_name": "server.dataprocessing.sentenceCls.SentenceEmbedder", "line_number": 31, "usage_type": "call" }, { "api_name": "sklearn.__version__", "line_number": 34, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 40, "usage_type": "call" }...
32094857955
from appium import webdriver import pytest @pytest.fixture(scope="session") def setup_driver(): desired_caps = { 'platformName': 'Android', 'deviceName': 'Android Emulator', 'app': 'app-debug.apk', "appPackage": "ru.netology.testing.uiautomator" } driver = webdriver.Remote...
T0ster5/Appium
config.py
config.py
py
402
python
en
code
0
github-code
97
[ { "api_name": "appium.webdriver.Remote", "line_number": 14, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 14, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 4, "usage_type": "call" } ]
73278845439
# tests/test_expense.py import json from typer.testing import CliRunner import pytest from tracker import ( DB_READ_ERROR, SUCCESS, __app_name__, __version__, cli, tracker, ) runner = CliRunner() def test_version(): result = runner.invoke(cli.app, ["--version"]...
davidepiu14/cli-expense-tracker
tests/test_expense_tracker.py
test_expense_tracker.py
py
1,831
python
en
code
0
github-code
97
[ { "api_name": "typer.testing.CliRunner", "line_number": 18, "usage_type": "call" }, { "api_name": "tracker.cli.app", "line_number": 21, "usage_type": "attribute" }, { "api_name": "tracker.cli", "line_number": 21, "usage_type": "name" }, { "api_name": "tracker.__ap...
35447926821
import pprint from pydantic import BaseModel, Field from github import GithubException, BadCredentialsException, UnknownObjectException class InputSchema(BaseModel): organization_name: str = Field( description='Name of Github Organization. Eg: "unskript"', title='Organization Name', ) user...
unskript/Awesome-CloudOps-Automation
Github/legos/github_remove_member_from_org/github_remove_member_from_org.py
github_remove_member_from_org.py
py
1,703
python
en
code
258
github-code
97
[ { "api_name": "pydantic.BaseModel", "line_number": 6, "usage_type": "name" }, { "api_name": "pydantic.Field", "line_number": 7, "usage_type": "call" }, { "api_name": "pydantic.Field", "line_number": 11, "usage_type": "call" }, { "api_name": "pprint.pprint", "l...
10091034560
#!/usr/bin/env python # -*- coding:utf-8 -*- # @Time : 2020/11/9 16:47 # @Author : wyb # @Site : # @File : cls_data.py 某联社主页网站sign # @Software: PyCharm import sys import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(BASE_DIR) import requests import time from 新手入...
WYBangin/reverseJsStart
小白上路/cls_data.py
cls_data.py
py
2,079
python
en
code
0
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path.append", "l...
35248132498
from abc import ABC import discord import riotwatcher import APICommands.Command from APICommands.Command import intTryParse, championIdToName, getChampionsJSON, getSummonerNameFromMessage class HighestMastery(APICommands.Command.Command, ABC): commandName = "Highest mastery" keywords = ["highestmastery", "...
s-prechtl/iLeague_Bot
APICommands/HighestMasteryCommand.py
HighestMasteryCommand.py
py
2,544
python
en
code
0
github-code
97
[ { "api_name": "APICommands.Command.Command", "line_number": 10, "usage_type": "attribute" }, { "api_name": "APICommands.Command", "line_number": 10, "usage_type": "name" }, { "api_name": "abc.ABC", "line_number": 10, "usage_type": "name" }, { "api_name": "riotwatc...
9167162174
import aiohttp.server import asyncio import time from concurrent.futures import ProcessPoolExecutor def slow_func(): time.sleep(10) return "test" class HttpProtocol(aiohttp.server.ServerHttpProtocol): def __init__(self, loop, ppexecutor): super(HttpProtocol, self).__init__(loop=loop, debug=True) ...
adaschevici/aios
other_slow.py
other_slow.py
py
1,393
python
en
code
0
github-code
97
[ { "api_name": "time.sleep", "line_number": 7, "usage_type": "call" }, { "api_name": "aiohttp.server.server", "line_number": 10, "usage_type": "attribute" }, { "api_name": "aiohttp.server", "line_number": 10, "usage_type": "name" }, { "api_name": "aiohttp.server.Re...
38611719286
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2016 Massachusetts Institute of Technology """Extract images from a rosbag. """ import sys import os import argparse import cv2 import rosbag from sensor_msgs.msg import Image from cv_bridge import CvBridge def main(): """Extract tip...
jaymenchaca8/camera-data-annotation-application
CameraDataAnnotationInterface/topic_extraction.py
topic_extraction.py
py
1,056
python
en
code
0
github-code
97
[ { "api_name": "sys.argv", "line_number": 22, "usage_type": "attribute" }, { "api_name": "rosbag.Bag", "line_number": 23, "usage_type": "call" }, { "api_name": "cv_bridge.CvBridge", "line_number": 24, "usage_type": "call" } ]
13833860206
import xml.etree.ElementTree as ET import xmltodict import os cwd = os.getcwd() print("cwd {0}".format(cwd)) fName = "export1.xml" filePath = os.path.join(cwd, fName) print("filePath {0}".format(filePath)) #read as string with open(filePath) as xmlFile: dataGPS = xmlFile.read().replace("\n", "") #print("dataGPS {0}"....
Spaceific-Studio/_WORK
projects/XML/xml_reading.py
xml_reading.py
py
4,092
python
en
code
1
github-code
97
[ { "api_name": "os.getcwd", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "xmltodict.parse", "line_number":...
30787571842
import logging import threading from BotThreader import BotThreader from Dataclasses import ModuleStatus class TwitchChat: _bot = None def __init__( self, access_token, client_id, client_secret, *args, **kwargs, ): self.access_token = access_token ...
niddelicious/ailicious
TwitchChat.py
TwitchChat.py
py
1,942
python
en
code
4
github-code
97
[ { "api_name": "Dataclasses.ModuleStatus.IDLE", "line_number": 22, "usage_type": "attribute" }, { "api_name": "Dataclasses.ModuleStatus", "line_number": 22, "usage_type": "name" }, { "api_name": "Dataclasses.ModuleStatus", "line_number": 25, "usage_type": "name" }, { ...
27123797136
import pytest @pytest.fixture() def ca_words(): return ["cat", "car", "cartoon", "carate"] @pytest.fixture() def ta_words(): return ["tabla", "table", "taboo"] @pytest.fixture() def words(ta_words, ca_words): return ta_words + ca_words def test_find(words, trie): for word in words: asser...
EgorBlagov/trie-again
tests/test_trie.py
test_trie.py
py
2,294
python
en
code
1
github-code
97
[ { "api_name": "pytest.fixture", "line_number": 4, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 9, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 14, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", ...
9879880363
#!/usr/bin/python import sys import os import curses class PresenTerm: def __init__(self, screen, dirname='.'): self.screen = screen self.height, self.width = screen.getmaxyx() self.offsety, self.offsetx = -self.height / 2, -self.width / 2 self.cur = 0 self.slides = [] self.dirname = dirname def read...
loleg/ascii-presenterm
presenterm.py
presenterm.py
py
1,637
python
en
code
3
github-code
97
[ { "api_name": "os.listdir", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_numbe...
5932283799
# wx_my_button.py 13Jun2023 crs, From my_button.py import wx def ok_cmd(e): print("ok_cmd") def not_ok_cmd(e): print("not_ok_cmd") def quit_cmd(e): print("quit_cmd") wx.Exit() app = wx.App() frame = wx.Frame(None) frame.Show() panel = wx.Panel(frame) btn_height = 50 ...
raysmith619/Introduction-To-Programming
exercises/graphics/wx_python/wx_my_button.py
wx_my_button.py
py
1,773
python
en
code
3
github-code
97
[ { "api_name": "wx.Exit", "line_number": 15, "usage_type": "call" }, { "api_name": "wx.App", "line_number": 18, "usage_type": "call" }, { "api_name": "wx.Frame", "line_number": 19, "usage_type": "call" }, { "api_name": "wx.Panel", "line_number": 21, "usage_...
2021680237
import time import copy import datetime from django.contrib import admin from django import forms from django.forms.widgets import HiddenInput from django.contrib import messages from django.contrib.admin.util import unquote from django.template.loader import render_to_string from admin_locking.exceptions import Obje...
runekaagaard/django-admin-locking
admin_locking/admin.py
admin.py
py
4,596
python
en
code
2
github-code
97
[ { "api_name": "django.template.loader.render_to_string", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime.fromtimestamp", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 23, "usage_type": "attribute" ...
71076472960
import os import cv2 import glob carpeta = "/home/alvaro.nieva/Documents/nieva_TFM/data/TUM_KITCHEN/cam3" fps = 25 image_list = os.listdir(carpeta) image_list.sort() img_array = [] for filename in image_list: name = carpeta + '/' + filename img = cv2.imread(name) height, width, layers = img.shape size...
Nieva97/amps_TFM
montador_videos.py
montador_videos.py
py
550
python
en
code
0
github-code
97
[ { "api_name": "os.listdir", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.VideoWriter", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.VideoWriter_fourcc", "li...
7636533344
import json import requests import decimal import numpy as np import pandas as pd from tabulate import tabulate from decimal import Decimal import os, sys import os, sys from os.path import dirname, realpath proj_path = dirname(dirname(dirname(realpath(__file__)))) # This is so Django knows where to find stuff. os.e...
totoropy/joebot_at
ticker/strategies/simple.py
simple.py
py
10,152
python
en
code
0
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.realpath", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ.setdefault", "line_number": 16, "usage_type": "call" }, { "api_name": "os.environ", ...
73149385918
from django.urls import path from . import views app_name = "polls" urlpatterns = [ path('list/', views.polls_list, name='list'), path('list/user/', views.list_by_user, name='list_by_user'), path('add/', views.polls_add, name='add'), path('edit/<int:poll_id>/', views.polls_edit, name='edit'), path...
devmahmud/Django-Poll-App
polls/urls.py
urls.py
py
836
python
en
code
253
github-code
97
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
9064339564
import json import os import re import gzip import random import sys import unidecode from collections import Counter, OrderedDict from tqdm import tqdm as tqdm from arango import DocumentInsertError, IndexCreateError from arango.database import StandardDatabase from dataloader_constants import ( DEFAULT_LANGS, ...
BuddhaNexus/buddhanexus
dataloader/tasks_segments_parallels.py
tasks_segments_parallels.py
py
21,330
python
en
code
8
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path", "line_number": 42, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path", "line_num...
19569069408
import os import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from ad import plot, utils class PlotCallback(tf.keras.callbacks.Callback): """Custom callback that plots reconstructions""" def __init__(self, path: str, freq=1, amount=1, data: np.ndarray = None, normalize_fn=None, ...
Luca96/dark-autoencoders
ad/callbacks.py
callbacks.py
py
3,218
python
en
code
0
github-code
97
[ { "api_name": "tensorflow.keras", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 12, "usage_type": "attribute" }, { "api_name": "ad.utils.read_npz", "line_number": 20, "usage_type": "call" }, { "api_name": "ad.utils", ...
42714012326
import settings import threading from common.funcs import S3, QueryHandler from common.custom_error import InvalidBucketRequest, KeyAlreadyExists from models.s3_object import S3Object class ConsoleS3Object(S3): def __init__(self, object_type, image_name, content, acl='private'): self.bucket_name = self....
GraphicalDot/SportsUnityChat
api/v0/utils.py
utils.py
py
1,347
python
en
code
0
github-code
97
[ { "api_name": "common.funcs.S3", "line_number": 9, "usage_type": "name" }, { "api_name": "settings.articles_BUCKETS.get", "line_number": 16, "usage_type": "call" }, { "api_name": "settings.articles_BUCKETS", "line_number": 16, "usage_type": "attribute" }, { "api_n...
27014798334
import math from datetime import datetime, date, timedelta import openpyxl import xlsxwriter from django.contrib.auth import authenticate, login from django.contrib.auth import logout from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User # To be triggered from django.cor...
SSMS-Pilani/SSMS-Grub-Portal
ssms/views.py
views.py
py
75,029
python
en
code
2
github-code
97
[ { "api_name": "ssms.models.Grub.objects.get", "line_number": 25, "usage_type": "call" }, { "api_name": "ssms.models.Grub.objects", "line_number": 25, "usage_type": "attribute" }, { "api_name": "ssms.models.Grub", "line_number": 25, "usage_type": "name" }, { "api_n...
39816941428
from collections import namedtuple import numpy as np import const def data_pad(sents, max_len): return np.array([s + [const.PAD] * (max_len - len(s)) for s in sents]) def label_pad(labels, label_size): def fill_one(args): label, index = args label[index] = 1 return label _label...
ne7ermore/deeping-flow
lstm-cnn-classfication/data_loader.py
data_loader.py
py
2,063
python
en
code
50
github-code
97
[ { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "const.PAD", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_numb...
18656726280
from django.shortcuts import render from .models import Seller from products.choices import price_choices, seller_choices def search(request): queryset_list1 = Seller.objects.all() if 'seller' in request.GET: name = request.GET['seller'] if name: queryset_list1 = queryset_list1.fi...
vignesh-bhat1999/ecommerce_website
sellers/views.py
views.py
py
541
python
en
code
0
github-code
97
[ { "api_name": "models.Seller.objects.all", "line_number": 6, "usage_type": "call" }, { "api_name": "models.Seller.objects", "line_number": 6, "usage_type": "attribute" }, { "api_name": "models.Seller", "line_number": 6, "usage_type": "name" }, { "api_name": "produ...
75006259200
#!/usr/bin/python import sqlite3 import datetime # purges all entries older than a month def main(): conn = sqlite3.connect('../db/summaries.db') c = conn.cursor() oldest = datetime.datetime.now() + datetime.timedelta(-30) # 30 days back c.execute('DELETE * FROM summaries WHERE created_at < ' + oldest...
GustavHenning/newsRef
python/purgeDB.py
purgeDB.py
py
394
python
en
code
0
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" }, { "api_name": "datetime....
21158566161
from backend import app, logger from flask import Blueprint from flask_restplus import Api from stack import api as api_stack from auth import api as api_auth from user import api as api_user from trends import api as api_trends from public import api as api_public blueprint = Blueprint('api', __name__, url_prefix='...
marcuslacerda/ciandt-stack
app/backend/endpoint/__init__.py
__init__.py
py
980
python
en
code
0
github-code
97
[ { "api_name": "flask.Blueprint", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_restplus.Api", "line_number": 22, "usage_type": "call" }, { "api_name": "backend.app.register_blueprint", "line_number": 29, "usage_type": "call" }, { "api_name": "bac...
37752014085
from __future__ import absolute_import, unicode_literals from django.db import models from modelcluster.fields import ParentalKey from wagtail.wagtailcore.fields import StreamField, RichTextField from wagtail.wagtailcore.models import Page from wagtail.wagtailcore import blocks from wagtail.wagtailadmin.edit_handler...
johnfraney/cookiecutter-wagtail-dokku
{{cookiecutter.project_slug}}/home/models.py
models.py
py
2,082
python
en
code
0
github-code
97
[ { "api_name": "wagtail.wagtailcore.models.Page", "line_number": 18, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 19, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 19, "usage_type": "name" }, { "api_...
42092826733
import json VALID_STATUS = ('CREATED', 'BUILDING', 'FETCHING', 'NOT FOUND') def deserialize_msg(msg: dict): ''' parses a dict msg from a redis stream msg: the message from a redis stream in the format dict[bytes, bytes(serialized json)] ''' def decode_value(val): try: ret...
rahungria/recommendation_microservices
services/async_dal/src/util.py
util.py
py
1,219
python
en
code
0
github-code
97
[ { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "json.decoder", "line_number": 16, "usage_type": "attribute" } ]
25284821719
# -*- coding: utf-8 -*- import scrapy from quotesbot.items import BaiduItem import urllib split_sign = '##' # 定义分隔符 class ToScrapeSpiderXPath(scrapy.Spider): name = 'allperson-xpath' start_urls = [] file_object = open('data/txt/painter.txt', 'r', encoding="utf-8").read() wordList = file_obje...
zhouhanghust/Scrapy
quotesbot/spiders/allperson-xpath.py
allperson-xpath.py
py
3,139
python
en
code
0
github-code
97
[ { "api_name": "scrapy.Spider", "line_number": 7, "usage_type": "attribute" }, { "api_name": "urllib.parse.unquote", "line_number": 23, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 23, "usage_type": "attribute" }, { "api_name": "urllib.parse...
31140712317
from sklearn.ensemble import IsolationForest import torch import numpy as np import os if __name__ == "__main__": scores_path = "./iso_forest/scores" if os.path.exists(scores_path) is False: os.makedirs(scores_path) pred_path = "./iso_forest/predictions" if os.path.exists(pred_path) is False:...
mdo6180/CS-747-Final-Project
anomaly_detection.py
anomaly_detection.py
py
1,380
python
en
code
0
github-code
97
[ { "api_name": "os.path.exists", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.exists", "line_numb...
35586381199
#!/usr/bin/env python #import logging #log = logging.getLogger() #log.setLevel('DEBUG') #handler = logging.StreamHandler() #handler.setFormatter(logging.Formatter("%(asctime)s [%(levelname)s] %(name)s: %(message)s")) #log.addHandler(handler) import time from cassandra import ConsistencyLevel from cassandra.cluster im...
byronjl2003/cassandra-practica4
proyecto/app/prueba.py
prueba.py
py
18,591
python
en
code
0
github-code
97
[ { "api_name": "cassandra.cluster.Cluster", "line_number": 31, "usage_type": "call" }, { "api_name": "cassandra.query.SimpleStatement", "line_number": 33, "usage_type": "call" }, { "api_name": "cassandra.ConsistencyLevel.QUORUM", "line_number": 36, "usage_type": "attribute...
31968489872
import streamlit as st from database import add_data def create(): col1, col2 = st.columns(2) with col1: train_no = st.text_input("Train no:") train_name = st.text_input("Name:") train_type = st.text_input("Train Type:") with col2: train_src = st.selectbox("Src", ["Bangalor...
adithya-m08/PES-Assignments
5th Sem/DBMS/Week 10/create.py
create.py
py
683
python
en
code
1
github-code
97
[ { "api_name": "streamlit.columns", "line_number": 6, "usage_type": "call" }, { "api_name": "streamlit.text_input", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.text_input", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.te...
22326518385
import json import boto3 import logging import os from chalice import Chalice from chalicelib.action import Action from chalicelib.lib.helpers import parse_config from chalicelib.lib.reminder import remind_users from chalicelib.lib.slack import ( Slack, slack_payload_extractor, slack_responder, verify...
codelabsab/timereport-slack
app.py
app.py
py
3,618
python
en
code
2
github-code
97
[ { "api_name": "chalice.Chalice", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line...
39152602967
import pandas as pd import numpy as np import re from sklearn.svm import SVC from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder from sklearn.metrics import mean_squared_error from sklearn.metrics import confusi...
s2chandel/Diabetes-Risk-Prediction
diabetes_risk.py
diabetes_risk.py
py
6,799
python
en
code
0
github-code
97
[ { "api_name": "pymysql.__version__", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pandas.read_sql_query", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas...
5619482526
import base64 import json from datetime import datetime, timedelta from typing import Tuple, Optional from functools import lru_cache import urllib3 from .files import get_pool from .openapi import Configuration from .versions import host_remove_version # Get new token REFRESH_TIME_DELTA before it really expires. RE...
nens/threedi-api-client
threedi_api_client/auth.py
auth.py
py
6,908
python
en
code
0
github-code
97
[ { "api_name": "datetime.timedelta", "line_number": 14, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 37, "usage_type": "call" }, { "api_name": "files.get_pool", "line_number": 39, "usage_type": "call" }, { "api_name": "json.loads", "line_n...
25841624823
import glob import os import torch import random from pathlib import Path from torch.utils.data import DataLoader import torch.nn.functional as F import torch.nn as nn import torchvision import shutil import matplotlib matplotlib.use('pdf') import matplotlib.pyplot as plt from torch.autograd import Variable import to...
MarHayat/TreeShapeVAE
python_codes/main.py
main.py
py
12,831
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.use", "line_number": 12, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 30, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 33, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 34,...
10314183504
#!/usr/bin/python3 # -*- coding:utf-8 -*- import matplotlib.pyplot as plt import matplotlib.cm as cm import numpy as np import scipy.signal as dsp import util from PIL import Image # # cargamos datos de MNIST # # # CODEBOOK # # el codebook contiene n variantes # de cada uno de los dígitos del 0 al 9 # # cargamos el co...
nacho-pancho/luisa-apps
watermark/code/detectar.py
detectar.py
py
4,352
python
es
code
0
github-code
97
[ { "api_name": "numpy.loadtxt", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number...
33529195595
import numpy as np import scipy class KalmanFilter(object): def __init__(self): self.H = np.eye(8,8) for i in range(4): self.H[i,4+i] = 1. self.update_ = np.eye(4,8) def get_projection(self,mean,cov): h_m = float(mean[3]) std_pos = [h_m/20,h_m/20,1e-1,h_m/20] mean_pro = np.dot(self.upda...
mdv3101/DeepSort_Yolo
src/kalman_filter.py
kalman_filter.py
py
2,103
python
en
code
7
github-code
97
[ { "api_name": "numpy.eye", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.linalg.multi_dot", "line_number...
34388841540
from jsonschema import validate, exceptions schema = { "title": "Course", "type": "object", "required": ['id', 'name', 'phone', 'url', 'description', 'about', 'start_date', 'hascertification', 'status', 'category', 'slug'], "properties": { "id": {"ty...
alclopes/ocps3taskrest
contrib/jsonTest/jsonSchemaSample.py
jsonSchemaSample.py
py
1,650
python
en
code
1
github-code
97
[ { "api_name": "jsonschema.validate", "line_number": 26, "usage_type": "call" }, { "api_name": "jsonschema.exceptions.ValidationError", "line_number": 35, "usage_type": "attribute" }, { "api_name": "jsonschema.exceptions", "line_number": 35, "usage_type": "name" } ]
27606178740
from models import FC import torchvision import os import torch.utils.data as Data import torch.nn as nn import torch from torchmetrics import Accuracy import matplotlib.pyplot as plt ''' 全连接的深度的影响 ''' #创建图像文件夹 if not(os.path.exists('./Image/')): os.mkdir('./Image/') #导入数据 DOWNLOAD = False if not(os.path.exists(...
Yunena/nndl_homework
Week9/deeptest.py
deeptest.py
py
1,924
python
en
code
2
github-code
97
[ { "api_name": "os.path.exists", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.exists", "line_numbe...
20814673831
import argparse import sqlite3 import sys if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "-t", "--timeout", type=str, metavar="MS", help="Set busytimeout" ) parser.add_argument( "dbpath", type=str, metavar="DBPATH", nargs=1, help="database path" )...
flux-framework/flux-core
t/scripts/sqlite-query.py
sqlite-query.py
py
1,501
python
en
code
146
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlite3.Error", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sys.exit", ...
25097664969
#Importing Libraries import torch import torch.nn as nn # All neural network modules, nn.Linear, nn.Conv2d, BatchNorm, Loss functions import torch.optim as optim # For all Optimization algorithms, SGD, Adam, etc. import torch.nn.functional as F # All functions that don't have any parameters from torch.utils.data im...
arpeggi-15/Pytorch-tutorials
NN example.py
NN example.py
py
2,979
python
en
code
0
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
40218596169
from enum import Enum from infra.file_system_interface import IFileSystem from pypinyin import pinyin import srt MAX_SECONDS_DIFF = 0.8 class Color(Enum): CYAN = '#00ffff' class SubtitleManipulator: def __init__(self, file_system: IFileSystem) -> None: self._file_system = file_system def _to_p...
jbaez/chinese-subs
src/app/core/subtitle_manipulator.py
subtitle_manipulator.py
py
6,496
python
en
code
0
github-code
97
[ { "api_name": "enum.Enum", "line_number": 9, "usage_type": "name" }, { "api_name": "infra.file_system_interface.IFileSystem", "line_number": 14, "usage_type": "name" }, { "api_name": "pypinyin.pinyin", "line_number": 18, "usage_type": "call" }, { "api_name": "srt....
72264076479
from django.contrib.auth import get_user_model from django.core.validators import MinValueValidator, MaxValueValidator from django.db import models User = get_user_model() class Ingredient(models.Model): name = models.CharField( 'Название продукта', max_length=200, ) measurement_point = m...
ShineXo1/foodgram-project-react
backend/recipes/models.py
models.py
py
5,797
python
en
code
0
github-code
97
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 5, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_...