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
6507125015
from django.db import models from applications.locations.models import Location class Schedule(models.Model): id = models.BigAutoField( primary_key=True, verbose_name='Id Horario' ) location = models.ForeignKey( Location, verbose_name='Sede', null=False, o...
chpenaf/DotSportsBackend
applications/schedule/models.py
models.py
py
2,611
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.BigAutoField", "line_number": 7, "usage_type": "call" }, { "api_name"...
34416507045
from setuptools import setup, find_packages with open('requirements.txt') as f: reqs = f.read().split() with open('README.md') as f: readme = f.read() setup( name='trackthenews', version='0.1.9.1', description='Monitor RSS feeds for keywords and act on matching results. A special project of the F...
fakebenjay/trackthenews-lefty
setup.py
setup.py
py
1,096
python
en
code
0
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 9, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 32, "usage_type": "call" } ]
2228623411
''' module to load yolov5* model from the ultralytics/yolov5 repo ''' import torch from src.core.logger import logger def load_model(model_repo: str = "ultralytics/yolov5", model_name: str = "yolov5s6"): """ It loads the YOLOv5s model from the PyTorch Hub :return: A model """ try: device =...
TYH71/gradio-ml-skeleton
src/model/yolov5.py
yolov5.py
py
814
python
en
code
0
github-code
6
[ { "api_name": "torch.device", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.hub.load",...
9307549467
from logger import logger from io import StringIO, BytesIO # python3; python2: BytesIO from datetime import datetime import boto3 def s3_client_init(): client = boto3.client('s3') return client def dataframe_to_s3(s3_client, input_datafame, bucket_name, format='parquet'): logger.info(f"Writing {for...
caiolauro/flix-twitter-data-elt
twitter_api/s3_writer.py
s3_writer.py
py
945
python
en
code
0
github-code
6
[ { "api_name": "boto3.client", "line_number": 8, "usage_type": "call" }, { "api_name": "logger.logger.info", "line_number": 12, "usage_type": "call" }, { "api_name": "logger.logger", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime.datetime.now", ...
38957829610
from socketio.namespace import BaseNamespace from socketio.sdjango import namespace from csvapp.pubsub import subscribe, unsubscribe @namespace('/csv') class CSVNamespace(BaseNamespace): def disconnect(self, *args, **kwargs): super(CSVNamespace, self).disconnect(*args, **kwargs) unsubscribe( ...
iamjem/django-csvapp
project/csvapp/sockets.py
sockets.py
py
947
python
en
code
0
github-code
6
[ { "api_name": "socketio.namespace.BaseNamespace", "line_number": 7, "usage_type": "name" }, { "api_name": "csvapp.pubsub.unsubscribe", "line_number": 10, "usage_type": "call" }, { "api_name": "csvapp.pubsub.subscribe", "line_number": 16, "usage_type": "call" }, { ...
26355881815
# this is nima nikrouz's midterm project #=============================================library===================================================== from tabulate import tabulate #=============================================library===================================================== #==============================...
nimankz/8queen-project
midterm1.2.py
midterm1.2.py
py
11,209
python
en
code
0
github-code
6
[ { "api_name": "tabulate.tabulate", "line_number": 144, "usage_type": "call" } ]
1802990089
''' Simple calculator functions Lucas 09.05.2021 ''' import colorama # adds two numbers def add(x, y): return x + y # subtracts two numbers def subtract(x, y): return x - y # multiplies two numbers def multiply(x, y): return x * y # divides two numbers def divide(x, y): return x / y while (Tru...
TheLucas777/Python_HTLAnichstasse
programme/calc_functions.py
calc_functions.py
py
2,893
python
en
code
1
github-code
6
[ { "api_name": "colorama.Fore", "line_number": 33, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "line_number": 41, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "line_number": 51, "usage_type": "attribute" }, { "api_name": "colorama.For...
7552302996
# Covid Resistant Husky 3 - ADA price prediction # import pip to install necessary libraries import math import pip pip.main(['install', 'python-binance', 'pandas', 'scikit-learn', 'matplotlib', 'keras', 'tensorflow', 'plotly', 'mplfinance']) from keras.losses import mean_squared_error from matplot...
aayushi1903/Cryptocurrency-project
main2.py
main2.py
py
10,855
python
en
code
0
github-code
6
[ { "api_name": "pip.main", "line_number": 7, "usage_type": "call" }, { "api_name": "talib.MACD", "line_number": 44, "usage_type": "call" }, { "api_name": "talib.MA", "line_number": 47, "usage_type": "call" }, { "api_name": "talib.MA", "line_number": 48, "us...
23929041781
# Asyncio Python 3.7+ package comparision with Javascript async # by default operates in single thread and CPU core # and schedules tasks as coroutines to run in an event loop import asyncio #import requests incompatible because does not return awaitable tasks # pyenv exec pip install aiohttp import aiohttp from aioht...
simonc312/today-i-learned
Apache Spark/python/AsyncIO.py
AsyncIO.py
py
2,148
python
en
code
0
github-code
6
[ { "api_name": "asyncio.sleep", "line_number": 20, "usage_type": "call" }, { "api_name": "aiohttp.ClientSession", "line_number": 24, "usage_type": "name" }, { "api_name": "asyncio.gather", "line_number": 38, "usage_type": "call" }, { "api_name": "asyncio.gather", ...
13442681959
# -*- coding: utf-8 -*- """Module containing network adapter for socket (asyncore.dispacher).""" import logging import socket import struct import asyncore from collections import deque from .. import connection, server, client from .._utils import lazyproperty _logger = logging.getLogger(__name__) _conne...
Occuliner/ThisHackishMess
extern_modules/pygnetic/network/socket_adapter.py
socket_adapter.py
py
5,296
python
en
code
2
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "struct.Struct", "line_number": 13, "usage_type": "call" }, { "api_name": "asyncore.dispatcher", "line_number": 16, "usage_type": "attribute" }, { "api_name": "asyncore.dis...
39647933037
#!/usr/bin/env python # coding: utf-8 # In[ ]: # Author : Amir Shokri # github link : https://github.com/amirshnll/Wine # dataset link : http://archive.ics.uci.edu/ml/datasets/Wine # email : amirsh.nll@gmail.com # In[8]: import pandas as pd from sklearn.tree import DecisionTreeClassifier from sklearn.model_selec...
semnan-university-ai/Wine
tree3.py
tree3.py
py
1,118
python
en
code
1
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 46, "usage_type": "call" }, { "api_name": "sklearn.tree.DecisionTreeClassifier", "line_number": 52, "usage_type": "call" ...
5412752271
""" Python script to scrape a web page for all email addresses """ from bs4 import BeautifulSoup import requests import requests.exceptions from urllib.parse import urlsplit import re url1 = "http://www.rit.edu/gccis/computingsecurity/people-categories/faculty" url2 = "https://www.rit.edu/its/about/staff" # a set of...
ahadsheriff/security_suite
pentest_suite/beautiful_soup/email_regex/email_regex.py
email_regex.py
py
1,136
python
en
code
1
github-code
6
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 24, "usage_type": "call" }, { "api_name": "re.I", "line_number": 24, "usage_type": "attribute" }, { "api_name": "re.findall", "line_number": 28,...
3045998741
from fastapi import HTTPException, status from app.v1.model.user_model import User as UserModel from app.v1.schema import user_schema from app.v1.service.auth_service import get_password_hash from app.v1.service import registered_developers_service from app.v1.schema.registered_developers_schema import RegisteredDeve...
marianamartineza/kunaisoft-database-CRUD-fastapi
app/v1/service/user_service.py
user_service.py
py
7,752
python
en
code
0
github-code
6
[ { "api_name": "app.v1.schema.user_schema.UserRegister", "line_number": 11, "usage_type": "attribute" }, { "api_name": "app.v1.schema.user_schema", "line_number": 11, "usage_type": "name" }, { "api_name": "app.v1.model.user_model.User.filter", "line_number": 13, "usage_typ...
74473926906
from django.shortcuts import render, redirect from .models import Diary from datetime import datetime import pytz import json diary_dict = {} response ={} def index(request): diary_dict = Diary.objects.all().values() if 'user_login' in request.session: response['user_name'] = request.session['user_logi...
argaghulamahmad/ppw-lab-arga
lab_3/views.py
views.py
py
1,230
python
en
code
0
github-code
6
[ { "api_name": "models.Diary.objects.all", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Diary.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.Diary", "line_number": 10, "usage_type": "name" }, { "api_name": "djang...
7192437436
import datetime import hashlib import json import yaml import flask.json import shutil import subprocess import uuid import zipfile import click import os from flask.cli import AppGroup import requests from sqlalchemy.orm import load_only from sqlalchemy.orm.exc import NoResultFound from sqlalchemy.exc import Integr...
pebble-dev/rebble-appstore-api
appstore/commands.py
commands.py
py
22,680
python
en
code
13
github-code
6
[ { "api_name": "settings.config", "line_number": 29, "usage_type": "name" }, { "api_name": "algoliasearch.algoliasearch.Client", "line_number": 30, "usage_type": "call" }, { "api_name": "algoliasearch.algoliasearch", "line_number": 30, "usage_type": "name" }, { "ap...
74537470908
import numpy as np import cv2 # 단일 채널 생성 및 초기화 m1 = np.full((3, 6), 10, np.uint8) m2 = np.full((3, 6), 50, np.uint8) m_mask = np.zeros(m1.shape, np.uint8) # 마스크 생성 m_mask[:, 3:] = 1 # 관심영역을 지정한 후, 1을 할당 m_add1 = cv2.add(m1, m2) # 행렬 덧셈 m_add2 = cv2.add(m1, m2, mask=m...
binlee52/OpenCV-python
ch05/04.arithmethic_op.py
04.arithmethic_op.py
py
772
python
ko
code
1
github-code
6
[ { "api_name": "numpy.full", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.full", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": ...
43581170385
from django.shortcuts import render from .models import * from django.http import HttpResponse import json from rest_framework import generics from .serializers import * # Create your views here. def dashboard(request): return render(request,"dashboard.html") def department(request): #department_list = Depart...
sanjaymehar/employee_management_system
emp/views.py
views.py
py
12,083
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 10, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 33, "usage_type": "call" }, { "api_name"...
6812515285
import logging from scrim_bot.core.role import Role, RoleIsInvalid logger = logging.getLogger(__name__) class Player: """ Represents a player taking part in inhouse games """ _id: int _name: str roles: list[Role] elo: float summoner_name: str def __init__(self, _id: int, name: ...
isvladu/inhouse-bot-lol
scrim_bot/core/player.py
player.py
py
2,392
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "scrim_bot.core.role.Role", "line_number": 15, "usage_type": "name" }, { "api_name": "scrim_bot.core.role.Role.validateRole", "line_number": 38, "usage_type": "call" }, { "a...
72908437948
from odoo import models, fields, api, _ from odoo.exceptions import ValidationError import logging _logger = logging.getLogger(__name__) class StudentTranscript(models.TransientModel): _name = "student.transcript" _description = "Student Transcript" from_date = fields.Date( 'From Date'...
mrrtmob/odoo_acac
local-addon/pm_general/wizards/student_transcript_wizard.py
student_transcript_wizard.py
py
5,635
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "odoo.models.TransientModel", "line_number": 8, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 8, "usage_type": "name" }, { "api_name": "odoo.field...
31127621657
import numpy as np import sys import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.batchnorm = nn.BatchNorm2d(3, affine=False) self.pad2 = nn.ConstantPad2d(2, 0) sel...
peinrules/Darin
GAME.py
GAME.py
py
4,427
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.BatchNorm2d", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line...
12950721382
import matplotlib.pyplot as plt import numpy as np import scipy.optimize as spy from . import AstroLib_Basic as AL_BF ################################################################################ # CREATE BODY WITH ITS CHARACTERISTICS ################################################################################...
veronicasaz/AstrodynamicsScripts
AstroLib_2BP.py
AstroLib_2BP.py
py
26,889
python
en
code
1
github-code
6
[ { "api_name": "numpy.exp", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 113, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 114, ...
42860322967
# # # Font Lato https://fonts.google.com/specimen/Lato # https://opengameart.org/content/4-chiptunes-adventure # # scanlines less mem ## https://www.reddit.com/r/pygame/comments/6yk6zk/least_memory_intensive_way_to_implement_scanlines/ # Not used: # Audio Voices by MadamVicious (https://freesound.org/people/MadamViciou...
Sprachmensch/wordle_clone
wordle.py
wordle.py
py
22,197
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 84, "usage_type": "call" }, { "api_name": "gamestate_manager.GamestateManager", "line_number": 85, "usage_type": "call" }, { "api_name": "settings.Settings", "line_number": 86, "usage_type": "call" }, { "api_name": "pyga...
21884536797
"""Calculate the expected detection rates for apertif.""" import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm from frbpoppy import CosmicPopulation, Survey, SurveyPopulation, hist from tests.convenience import plot_aa_style, rel_path from alpha_real import EXPECTED, poisson_interval N_DAYS = 1 #...
TRASAL/frbpoppy
tests/rates/apertif_dist.py
apertif_dist.py
py
2,026
python
en
code
26
github-code
6
[ { "api_name": "frbpoppy.CosmicPopulation.complex", "line_number": 13, "usage_type": "call" }, { "api_name": "frbpoppy.CosmicPopulation", "line_number": 13, "usage_type": "name" }, { "api_name": "frbpoppy.Survey", "line_number": 16, "usage_type": "call" }, { "api_n...
12307666054
"""Utility script to be used to cleanup the notebooks before git commit This a mix from @minrk's various gists. """ import time import sys import os import io try: from queue import Empty except: # Python 2 backward compat from Queue import Empty try: from ipyparallel import Client except ImportErr...
ogrisel/parallel_ml_tutorial
ipynbhelper.py
ipynbhelper.py
py
8,087
python
en
code
1,592
github-code
6
[ { "api_name": "Queue.Empty", "line_number": 80, "usage_type": "name" }, { "api_name": "IPython.nbformat.NotebookNode", "line_number": 99, "usage_type": "call" }, { "api_name": "IPython.nbformat", "line_number": 99, "usage_type": "name" }, { "api_name": "IPython.pa...
41061175651
import numpy as np import torch import torch.nn.functional as F import torch.nn as nn import os import cv2 as cv def rgb2gray(rgb): ''' Transforms frame into a grayscale Args: rgb (numpy array) : numpy array grayscaled ''' r, g, b = rgb[:,:,0], rgb[:,:,1], rgb[:,:,2] gray = 0.2989 * ...
ylajaaski/reinforcement_env
src/utils.py
utils.py
py
2,534
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 40, "usage_type": "call" }, { "api_name": "torch.from_numpy", "line_number": 41, "usage_type": "call" }, { "api_name": "torch.nn.functional.interpolate", "line_number": 42, "usage_type": "call" }, { "api_name": "torch.nn...
73732952507
#!/usr/bin/env python import requests import base64 import random import sys def getPicText_bdOcr(pic_binary, type_index = 1): ''' 利用百度 ocr 接口识别文字 pic_binary 是图片文件的二进制数据 type_index 是百度提供的识别类型 0 表示一般识别, 1 表示精准识别 如果成功,则返回识别出的文字字符串 如果出错,则返回错误信息 ''' # 获取 appid 的 coo...
fkxxyz/fkxxyz-wechatRequestHandler
baiduOcr.py
baiduOcr.py
py
2,061
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 31, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 39, "usage_type": "call" }, { "api_name": "requests.post", "lin...
19105871775
from datetime import datetime from blockCountries import blockCountryList def minOfGame(isPlaying,isBreak : bool, startPeriod :datetime, startGame :datetime): ''' :param startPeriod: время начала периода :param startGame: время начала игры :return: minOfGame - минута игры, isBreak - перерыв ''' ...
AlexRechnoy/betBot
flashScoreFuncs.py
flashScoreFuncs.py
py
3,405
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime", "line_number": 4, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "name" }, { "api_name": "blockCountri...
19237958892
import os from war3structs.storage import MPQ from .common import PipeTransformer from ..liquid import Liquid class MapExtractorPipe(PipeTransformer): def gate(self, build, liquid): map_liquids = [] map_path = os.path.join(build['etcdir'], 'temp%s' % liquid.name) # Begin by writing the liquid's content...
sides/war3archiver
war3archiver/transformers/maps.py
maps.py
py
856
python
en
code
0
github-code
6
[ { "api_name": "common.PipeTransformer", "line_number": 7, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "liquid.name", "li...
10420485791
""" .. attribute:: whole_cache Used when specifying the scope for a cache invalidation operation to indicate that the whole cache should be cleared. .. moduleauthor:: Martí Congost <marti.congost@whads.com> """ from typing import Iterable, Union from cocktail.modeling import ( OrderedSet, ListWrappe...
marticongost/cocktail
cocktail/caching/scope.py
scope.py
py
1,282
python
en
code
0
github-code
6
[ { "api_name": "typing.Union", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.Iterable", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.Iterable", "line...
26627014986
from django.db import models from livesettings import config_value_safe, config_choice_values, SettingNotSet def shipping_choices(): try: return config_choice_values('SHIPPING','MODULES') except SettingNotSet: return () class ShippingChoiceCharField(models.CharField): def __init__(self, ...
dokterbob/satchmo
satchmo/apps/shipping/fields.py
fields.py
py
977
python
en
code
30
github-code
6
[ { "api_name": "livesettings.config_choice_values", "line_number": 6, "usage_type": "call" }, { "api_name": "livesettings.SettingNotSet", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 11, "usage_type": "attribute" },...
5648119133
import sys from typing import List, Optional, Tuple import unittest def all_construct(target_string: str, strings: List[str], memo=None) -> List[List[str]]: # Memo. if memo is None: memo = {} if target_string in memo: return memo[target_string] # Base case. if len(target_string) =...
bradtreloar/freeCodeCamp_DP_problems
problems/memoized/all_construct.py
all_construct.py
py
2,426
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 30, "usage_type": "attribute" }, { "api_name": "sys.setrecursionlimit", "line_number": 32, "usage_type": "call" } ]
30138218135
# !/usr/local/python/bin/python # -*- coding: utf-8 -*- # (C) Wu Dong, 2020 # All rights reserved # @Author: 'Wu Dong <wudong@eastwu.cn>' # @Time: '2020-03-19 10:49' """ 演示 pre-request 框架如何使用长度校验,仅针对字符串有效 """ from flask import Flask from pre_request import pre, Rule app = Flask(__name__) app.config["TESTING"] = True ...
Eastwu5788/pre-request
examples/example_filter/example_length.py
example_length.py
py
1,070
python
en
code
55
github-code
6
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "pre_request.Rule", "line_number": 20, "usage_type": "call" }, { "api_name": "pre_request.pre.catch", "line_number": 25, "usage_type": "call" }, { "api_name": "pre_request.pre", ...
36004397978
import collections class VigenereMethod: _cipher = "" def __init__(self, cipherText): self._cipher = cipherText def RunMethod(self): cipher1 = self._cipher letterFreq = [["A", 8.2], ["B", 1.5], ["C", 2.8], ["D", 4.2], ["E", 12.7], ["F", 2.2], [...
dhjaekol/cybersecurity
Assignment1/VigenereMethod.py
VigenereMethod.py
py
3,262
python
en
code
0
github-code
6
[ { "api_name": "collections.Counter", "line_number": 76, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 77, "usage_type": "call" } ]
32249755158
import streamlit as st import altair as altc import pandas as pd import numpy as np import os, urllib from PIL import Image import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.keras.models import Model from tensorflow.keras.layers import Input, BatchNormalization, Activation, Dense, Dro...
ajayjalluri/Drone-Data-Image-Segmentatation
app.py
app.py
py
2,166
python
en
code
0
github-code
6
[ { "api_name": "streamlit.cache", "line_number": 24, "usage_type": "call" }, { "api_name": "u_net.build_unet", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 38, "usage_type": "call" }, { "api_name": "streamlit.sidebar.he...
42197969651
from django.urls import path from .views import ( InvitiHome, InvitoDetailView, InvitoCreateView, InvitoUpdateView, InvitoDeleteView, InvitiUtente, PrenotazioniUtente, InvitoPartecipa, InvitiGenere, InvitoRimuoviPartecipa, InvitiFilterView, GeneriFilterView, About ) ...
lucacasarotti/CineDate
inviti/urls.py
urls.py
py
1,830
python
it
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 21, "usage_type": "call" }, { "api_name": "views.InvitiHome.as_view", "line_number": 21, "usage_type": "call" }, { "api_name": "views.InvitiHome", "line_number": 21, "usage_type": "name" }, { "api_name": "django.url...
40592577580
from collections import Counter import operator st=input() k=int(input()) omap=Counter(st) a=sorted(omap.items(),key=operator.itemgetter(1)) i=0 while k>0 and i<len(a): if a[i][1]<=k: k-=a[i][1] del omap[a[i][0]] else: omap[a[i][0]]-=k k=0 i+=1 print(len(omap)) ans="" for i ...
ku-nal/Codeforces
codeforces/102/C.py
C.py
py
479
python
en
code
3
github-code
6
[ { "api_name": "collections.Counter", "line_number": 6, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 7, "usage_type": "call" } ]
35787180481
from starlette.responses import JSONResponse, FileResponse from starlette.background import BackgroundTasks from fastapi import APIRouter #, Form, File, UploadFile # from model.classification_pylon.predict import main as pylon_predict # from model.covid19_admission.predict_admission import main as covid_predict import ...
mmkanta/fl-webapp-model
api/infer.py
infer.py
py
2,542
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.abspath", ...
6259690746
from enum import Enum import numpy as np from collections import deque import bisect from numpy.core.numeric import array_equal from graphics import GraphWin, Text, Point, Rectangle, Circle, Line, Polygon, update, color_rgb # +-------+ # | 16 17 | # | 18 19 | # +-------+---...
danemo01/CS470
HW4/rubik_lab_assignment_4.py
rubik_lab_assignment_4.py
py
17,458
python
en
code
0
github-code
6
[ { "api_name": "graphics.color_rgb", "line_number": 25, "usage_type": "call" }, { "api_name": "graphics.color_rgb", "line_number": 26, "usage_type": "call" }, { "api_name": "graphics.color_rgb", "line_number": 34, "usage_type": "call" }, { "api_name": "graphics.col...
39242617287
from torch import nn import torch from models.cotnet import CotLayer class ChannelAttention(nn.Module): def __init__(self,in_channels,reduction=16): super(ChannelAttention,self).__init__() self.attention = nn.Sequential( nn.AdaptiveAvgPool2d(1), nn.Conv2d(in_channels,in_ch...
ucaswangls/GAP-CCoT
models/basicblock.py
basicblock.py
py
3,737
python
en
code
9
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
19400375604
from time import sleep import nmap import nvdlib from model.host import Host from model.port import Port from model.cve import * class Scanner: def __init__(self, network=None): self._network = network self._list_content_host = [] self._nmap = nmap.PortScanner() def info_hosts_networ...
jonassantos1000/tcc
model/scanner.py
scanner.py
py
4,245
python
en
code
0
github-code
6
[ { "api_name": "nmap.PortScanner", "line_number": 14, "usage_type": "call" }, { "api_name": "nvdlib.searchCPE", "line_number": 27, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 32, "usage_type": "call" }, { "api_name": "time.sleep", "line_n...
71971104189
import kfserving import os from typing import Dict import torch import importlib import sys PYTORCH_FILE = "model.pt" class PyTorchModel(kfserving.KFModel): def __init__(self, name: str, model_class_name: str, model_dir: str): super().__init__(name) self.name = name self.model_class_name ...
kubeflow/kfserving-lts
python/pytorchserver/pytorchserver/model.py
model.py
py
2,366
python
en
code
10
github-code
6
[ { "api_name": "kfserving.KFModel", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.cud...
26383863194
from typing import Tuple import gym import numpy as np class PreprocessEnv(gym.Wrapper): # environment wrapper def __init__(self, env, if_print=True): self.env = gym.make(env) if isinstance(env, str) else env super().__init__(self.env) self.step = self.step_type (self.env_name, s...
sbl1996/hrl
hrl/elegant/env.py
env.py
py
2,648
python
en
code
0
github-code
6
[ { "api_name": "gym.Wrapper", "line_number": 6, "usage_type": "attribute" }, { "api_name": "gym.make", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_...
4487190452
""" Exam task 2 Binary Tree """ from collections import deque from queue import Queue class BinatyTree: """ Binary tree class with basic functional Version with tree as node with data, left and right children """ def __init__(self, data) -> None: """ Init root with default lef...
sviat-l/FP_Labs
Exam/Binary tree/binary_tree.py
binary_tree.py
py
4,297
python
en
code
0
github-code
6
[ { "api_name": "queue.Queue", "line_number": 94, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 120, "usage_type": "call" } ]
4817221286
import os import threading #Main function picture from main_function_image import open_picture from main_function_image import show_picture from main_function_image import save_picture from main_function_image import to_crop from main_function_image import write_position #Background from picture_operation....
LeGrosLezard/qu-est-ce-qu-il-y-a-dans-une-salle-a-manger-
v2/main.py
main.py
py
10,897
python
en
code
0
github-code
6
[ { "api_name": "main_function_image.open_picture", "line_number": 32, "usage_type": "call" }, { "api_name": "main_function_image.save_picture", "line_number": 33, "usage_type": "call" }, { "api_name": "picture_operation.background.main_background", "line_number": 38, "usag...
42586362539
""" Text Preprocessing """ import logging import re from functools import lru_cache from multiprocessing import Pool from typing import Optional, List import numpy as np import pandas as pd import pymorphy2 from stop_words import get_stop_words wcoll_morph: Optional[pymorphy2.MorphAnalyzer] = None g_chunks: Optional[...
vlade89/agrohack2023
lib/nlp_utils.py
nlp_utils.py
py
2,935
python
en
code
1
github-code
6
[ { "api_name": "typing.Optional", "line_number": 13, "usage_type": "name" }, { "api_name": "pymorphy2.MorphAnalyzer", "line_number": 13, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.L...
16814344104
#!/usr/bin/env python from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup(name='overcooked_ai', version='1.1.0', description='Cooperative multi-agent environment based on Overcooked', long_description=long_description, long_des...
samjia2000/HSP
hsp/envs/overcooked_new/setup.py
setup.py
py
1,135
python
en
code
15
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 17, "usage_type": "call" } ]
25005216625
import io import typing import random import discord import operator import datetime from config import config from discord.ext import commands from util.paginator import Pages from util.converter import CaseInsensitiveRole, PoliticalParty, CaseInsensitiveMember class Misc(commands.Cog, name="Miscellaneous"): ""...
DENE-dev/dene-dev
RQ1-data/exp2/114-jonasbohmann@democraciv-discord-bot-ae9b0558588ef6313477cfd58732ceec738dd706/module/misc.py
misc.py
py
25,789
python
en
code
0
github-code
6
[ { "api_name": "discord.ext.commands.Cog", "line_number": 14, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 14, "usage_type": "name" }, { "api_name": "datetime.datetime.utcnow", "line_number": 26, "usage_type": "call" }, { "api_n...
31299469552
from django.test import TestCase, Client from django.urls import reverse from ecomapp.models import Category, Product, CartItem, Cart, Order, Brand class TestModels(TestCase): def setUp(self): self.category1 = Category.objects.create( name = 'category1', slug = 'category-1' ) self.brand1 = Bran...
hussienalhaj/alhajjj
djangoshop/ecomapp/tests/test_models.py
test_models.py
py
2,992
python
en
code
0
github-code
6
[ { "api_name": "django.test.TestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "ecomapp.models.Category.objects.create", "line_number": 9, "usage_type": "call" }, { "api_name": "ecomapp.models.Category.objects", "line_number": 9, "usage_type": "attribute" ...
38831014944
from keras.callbacks import Callback from keras import backend as K from keras.utils import to_categorical from sklearn.metrics import roc_auc_score import os import matplotlib.pyplot as plt import shutil import numpy as np class PerSubjAucMetricHistory(Callback): """ This callback for testing model on each su...
bkozyrskiy/NN_hyperopt_search
my_callbacks.py
my_callbacks.py
py
3,918
python
en
code
0
github-code
6
[ { "api_name": "keras.callbacks.Callback", "line_number": 10, "usage_type": "name" }, { "api_name": "keras.utils.to_categorical", "line_number": 27, "usage_type": "call" }, { "api_name": "keras.utils.to_categorical", "line_number": 29, "usage_type": "call" }, { "ap...
41382929279
from typing import Callable from dataclasses import dataclass import pandas as pd from hvac import Quantity from hvac.fluids import HumidAir from hvac.climate import ClimateData from hvac.climate.sun.solar_time import time_from_decimal_hour from ..core import ( ExteriorBuildingElement, InteriorBuildingElement, ...
TomLXXVI/HVAC
hvac/cooling_load_calc/building/space.py
space.py
py
37,323
python
en
code
8
github-code
6
[ { "api_name": "hvac.Quantity", "line_number": 22, "usage_type": "name" }, { "api_name": "hvac.Quantity", "line_number": 27, "usage_type": "name" }, { "api_name": "hvac.Quantity", "line_number": 28, "usage_type": "name" }, { "api_name": "hvac.Quantity", "line_n...
10035856253
"""Training script for End-to-end visuomotor controllers.""" import argparse import os from stat import ST_CTIME import shutil import re import json import pprint import tensorflow as tf from data.geeco_gym import pickplace_input_fn from models.e2evmc.estimator import e2evmc_model_fn, goal_e2evmc_model_fn from model...
ogroth/geeco
scripts/train_e2evmc.py
train_e2evmc.py
py
12,436
python
en
code
7
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "models.e2evmc.estimator.e2evmc_model_fn", "line_number": 135, "usage_type": "name" }, { "api_name": "models.e2evmc.estimator.goal_e2evmc_model_fn", "line_number": 136, "usag...
22497784287
from flask_app.config.mysqlconnection import connectToMySQL from flask import flash class Recipe: db = "login_and_registration" # db should = your schema def __init__(self, data): self.id = data['id'] self.names = data['names'] self.descriptions = data['descriptions'] self...
tsu112/login_and_registration
flask_app/models/recipe.py
recipe.py
py
2,869
python
en
code
0
github-code
6
[ { "api_name": "flask_app.config.mysqlconnection.connectToMySQL", "line_number": 22, "usage_type": "call" }, { "api_name": "flask_app.config.mysqlconnection.connectToMySQL", "line_number": 29, "usage_type": "call" }, { "api_name": "flask_app.config.mysqlconnection.connectToMySQL",...
21980018417
import base64 import hashlib import time import requests import tkinter as tk from tkinter import filedialog import json ################## """ 手写文字识别WebAPI接口调用示例接口文档(必看):https://doc.xfyun.cn/rest_api/%E6%89%8B%E5%86%99%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB.html 图片属性:jpg/png/bmp,最短边至少15px,最长边最大4096px,编码后大小不超过4M,识别文字语...
shang-jun123/purchase_management
mepms/ui/ocr_fuction.py
ocr_fuction.py
py
3,697
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 29, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 31, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_n...
31651316167
#! /usr/bin/python from getRoomKitData import send_command, data_to_dict, dict_to_json, start_connect from dotenv import load_dotenv import os load_dotenv() def get_xconfig(session): command = "xConfiguration\r" commandTrimmed = "xConfiguration" data = send_command(session, command) # with open('./cal...
ingenium21/getRoomKitData
getRoomKitConfiguration.py
getRoomKitConfiguration.py
py
590
python
en
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 6, "usage_type": "call" }, { "api_name": "getRoomKitData.send_command", "line_number": 11, "usage_type": "call" }, { "api_name": "getRoomKitData.data_to_dict", "line_number": 14, "usage_type": "call" }, { "api_nam...
14418643616
from django.db.models import fields from django.shortcuts import render from django.views.generic import ListView,DetailView,CreateView,UpdateView,DeleteView,RedirectView from .models import Post from .forms import PostForm,EditForm from django.urls import reverse_lazy # Create your views here. #def home(request...
AniketShukla14/Interlink_platform
ablog/Theblog/views.py
views.py
py
1,272
python
en
code
2
github-code
6
[ { "api_name": "django.views.generic.ListView", "line_number": 13, "usage_type": "name" }, { "api_name": "models.Post", "line_number": 14, "usage_type": "name" }, { "api_name": "django.views.generic.DetailView", "line_number": 19, "usage_type": "name" }, { "api_nam...
26224854603
#!/usr/local/bin/python3.7 import cv2 import numpy as np img = cv2.imread("../test_pic.jpg") kernel = np.ones((2, 2), np.uint8) imgCanny = cv2.Canny(img, 100, 200) imgErosion = cv2.erode(imgCanny, kernel, iterations=1) cv2.imshow("Edge detection", imgCanny) cv2.imshow("Erosion Fix", imgErosion) cv2.waitKey(0)
smoonmare/object_50071
open_cv/chapter-2/chapter_2_5.py
chapter_2_5.py
py
313
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.Canny", "line_number": 8,...
72496080189
"""TestProject URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-b...
Rahmet97/TestProjectBackend
TestProject/urls.py
urls.py
py
2,302
python
en
code
0
github-code
6
[ { "api_name": "drf_yasg.views.get_schema_view", "line_number": 32, "usage_type": "call" }, { "api_name": "drf_yasg.openapi.Info", "line_number": 33, "usage_type": "call" }, { "api_name": "drf_yasg.openapi", "line_number": 33, "usage_type": "name" }, { "api_name": ...
15107122264
import unittest import time from BeautifulReport import BeautifulReport from base.web_driver import browser from config.setting import logging from util.send_email import inser_img,get_time now = time.strftime("%Y-%m-%d %H_%M_%S") class StartEnd(unittest.TestCase): name='' @classmethod def setUpClass(cls...
newcaolaing/web_auto
test_case/model/myunit.py
myunit.py
py
1,237
python
en
code
1
github-code
6
[ { "api_name": "time.strftime", "line_number": 9, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "base.web_driver.browser", "line_number": 15, "usage_type": "call" }, { "api_name": "config.se...
14522883806
#!/usr/bin/env python3 from flask import Flask, Response, request from flask_cors import CORS from PIL import Image from rembg import new_session, remove import io app = Flask(__name__) CORS(app) @app.post('/api/rem-bg') def remBg(): auth = request.headers.get('Authorization', None) if not auth or not auth.s...
EasySnacks/remove-background-api
main.py
main.py
py
1,193
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.headers.get", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request.hea...
33957213827
# -*- coding: utf-8 -*- """ Created on Mon Oct 3 17:53:18 2022 @author: yiann """ import pandas as pd import pytz # eisagwgh tou arxeiou ston kwdika data_file='Solar_1min_2021.txt' df=pd.read_csv(data_file, index_col=[0], usecols=[0,6], sep=',', header=None, parse_dates=True, na_values='"NAN"') df.columns=['...
ikaitsas/Irradiance-QC-UP
oldstuff/prospathw_na_allaksw_timezones.py
prospathw_na_allaksw_timezones.py
py
730
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pytz.timezone", "line_number": 20, "usage_type": "call" }, { "api_name": "pytz.timezone", "line_number": 21, "usage_type": "call" }, { "api_name": "pytz.timezone", "line...
27894174453
import sys import collections #sys.setrecursionlimit(100001) # bfs로 동작하는 코드: 정확성은 맞지만 시간초과 def bfs_find_root(): while queue: root = queue.popleft() for child in tree[root]: if not visited[child]: output[child] = root queue.append(child) ...
SheepEatLion/Algorithms
tree_baekjoon_11725.py
tree_baekjoon_11725.py
py
1,547
python
en
code
0
github-code
6
[ { "api_name": "sys.stdin.readline", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 24, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.stdin.readlin...
32610163975
from mercurial import archival, cmdutil, commands, extensions, filemerge, hg, \ httprepo, localrepo, merge, sshrepo, sshserver, wireproto from mercurial.i18n import _ from mercurial.hgweb import hgweb_mod, protocol, webcommands from mercurial.subrepo import hgsubrepo import overrides import proto def uisetup(ui):...
Anderson-Lab/Learn2Mine-Main
galaxy-dist/eggs/mercurial-2.2.3-py2.7-macosx-10.6-intel-ucs2.egg/hgext/largefiles/uisetup.py
uisetup.py
py
6,985
python
en
code
2
github-code
6
[ { "api_name": "mercurial.extensions.wrapcommand", "line_number": 14, "usage_type": "call" }, { "api_name": "mercurial.extensions", "line_number": 14, "usage_type": "name" }, { "api_name": "mercurial.commands.table", "line_number": 14, "usage_type": "attribute" }, { ...
34829704572
# -*- coding: utf-8 -*- """ animation of global earthquakes locatiopns from 2000-2019 plotted annually """ import numpy as np import matplotlib as plt from mlp_toolkit.basemat import Basemap as Basemap #=================================================== # files and parameters #===...
patrickward110/Astro-199
Astro119/In Class/Wk 3/global earthquakes.py
global earthquakes.py
py
1,406
python
en
code
0
github-code
6
[ { "api_name": "numpy.genfromtxt", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.unique", "li...
18101466174
from functools import cache from tkinter import W from typing import List, Tuple from unittest import TestCase, main class Solution: def searchMatrix(self, matrix: List[List[int]], target: int) -> bool: len_x, len_y = len(matrix[0]), len(matrix) @cache def dfs(x: int, y: int): ...
hirotake111/leetcode_diary
leetcode/search_2d_matrix_II/solution.py
solution.py
py
1,686
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 8, "usage_type": "name" }, { "api_name": "functools.cache", "line_number": 11, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.List", "line_...
8631487904
import codecs import yaml from typing import Optional from alert_autoconf.models import Alerts CLUSTER_NAME_PLACEHOLDER = "{cluster}" def read_from_file(filename: str, cluster_name: Optional[str]) -> Alerts: """ Читает данные из конфиг файла :param filename: имя файла :return: словарь конфигурации...
avito-tech/alert-autoconf
alert_autoconf/config.py
config.py
py
2,092
python
en
code
1
github-code
6
[ { "api_name": "typing.Optional", "line_number": 12, "usage_type": "name" }, { "api_name": "codecs.open", "line_number": 18, "usage_type": "call" }, { "api_name": "alert_autoconf.models.Alerts", "line_number": 19, "usage_type": "call" }, { "api_name": "yaml.load", ...
9021010670
import json import time import datetime import requests urla = input("请输入要查询的hash值:") urlb = "https://apilist.tronscan.org/api/transaction-info?hash=" url = urlb + urla resp = requests.get(url,verify=False) #print(f"当前状态为:{resp}") resp_dict = resp.json() #print(resp_dict.keys()) print( ) pepo = resp_dict[...
dirb-cll/Odin
tronscan_api.py
tronscan_api.py
py
1,270
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 31, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 32, "usage_type": "call" } ]
24793906303
#!/usr/bin/env python3 import argparse, re from sys import exit from os import path def getCombLayerObject(cell): """Return CombLayer object name based on its cell number""" fname = "ObjectRegister.txt" if not path.isfile(fname): fname = path.join("case001", fname); if not path.isfile(fname)...
kbat/mc-tools
mctools/common/CombLayer/getcell.py
getcell.py
py
1,577
python
en
code
38
github-code
6
[ { "api_name": "os.path.isfile", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, ...
35971477802
from Tkinter import * import tkMessageBox import tkFont import ttk import RPi.GPIO as GPIO import time import serial import threading import Queue #Start Serial Communication with Arduino Mega in another thread ser = serial.Serial ("/dev/ttyS0",9600) GPIO.setmode(GPIO.BOARD) GPIO.setup(38, GPIO.OUT) GPIO.setup(37, G...
mschweig/mechatronicPlayground
gui.py
gui.py
py
3,256
python
en
code
0
github-code
6
[ { "api_name": "serial.Serial", "line_number": 12, "usage_type": "call" }, { "api_name": "RPi.GPIO.setmode", "line_number": 15, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 15, "usage_type": "name" }, { "api_name": "RPi.GPIO.BOARD", "line_nu...
73891294909
#!/usr/bin/python3 # -*- coding: UTF-8 -*- # feature: 30天内加速度;创业板,中小板,白马 import re import json import requests import numpy as np import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm import statsmodels.formula.api as smf import statsmodels.graphics.api as smg import time headers = {'Accept...
SoyM/fin
test.py
test.py
py
7,933
python
en
code
0
github-code
6
[ { "api_name": "re.compile", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 39, "usage_type": "call" }, { "api_name": "time.time", "line_number": 40, "usage_type": "call" }, { "api_name": "time.time", "line_number": 60, ...
19528126460
# coding=utf-8 from __future__ import division from design.MainData import MainData from canvas import * from algorithm import * from PyQt5.QtCore import Qt from PyQt5.QtGui import (QIcon, QFont) from PyQt5.QtWidgets import (qApp, QAction, QComboBox, ...
zhaicao/pythonWorkspace
Pyqt5Practice/design/app.py
app.py
py
50,611
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 32, "usage_type": "name" }, { "api_name": "design.MainData.MainData", "line_number": 32, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QMainWindow.__init__", "line_number": 40, "usage_type": "call" }, ...
74926945466
""" Does the work to translate colour/effect names to ANSI codes """ # std libs import numbers import functools as ftl # third-party libs import numpy as np from matplotlib.colors import to_rgb # local libs from recipes.dicts import ManyToOneMap # relative libs from .ansi import parse # source: https://en.wikipe...
astromancer/motley
src/motley/codes.py
codes.py
py
11,577
python
en
code
0
github-code
6
[ { "api_name": "recipes.dicts.ManyToOneMap", "line_number": 193, "usage_type": "name" }, { "api_name": "recipes.dicts.ManyToOneMap", "line_number": 211, "usage_type": "name" }, { "api_name": "functools.singledispatch", "line_number": 250, "usage_type": "attribute" }, {...
15505226126
# Author: Lane Moseley # Description: This file demonstrates the usage of the custom logistic regression # module implemented in the ML library. # Resources Used: # Fish Dataset: # Included with the project, but also available from Kaggle: # https://www.kaggle.com/aungpyaeap/fish-ma...
lanemoseley/ml-library
logisticRegression.py
logisticRegression.py
py
4,735
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 30, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", "line_number": 42, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
74432954107
from . import views from django.conf.urls import url, include urlpatterns = [ url(r'^new$', views.add_new_user), url(r'^new/process$', views.add_new_user_p), url(r'^edit$', views.edit_user), url(r'^edit/process', views.edit_user_p), url(r'^edit/(?P<u_id>\d+)$', views.edit_user_by_id), url(r'^ed...
EmilChoparinov/Message-Posting-Website
apps/user_app/urls.py
urls.py
py
495
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.co...
36187285700
from dataclasses import dataclass import pytest from pydantic import ValidationError, Json, BaseModel from typing import Optional from qwery import Model, Query, JSONB class ExampleModel(Model): class Meta: table_name = "test" a: int b: Optional[str] c: bool def test_compile_select_query():...
uplol/qwery
qwery/test_qwery.py
test_qwery.py
py
3,862
python
en
code
18
github-code
6
[ { "api_name": "qwery.Model", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 13, "usage_type": "name" }, { "api_name": "qwery.Query", "line_number": 18, "usage_type": "call" }, { "api_name": "qwery.Query", "line_number...
27625720407
#!/usr/bin/env python # coding: utf-8 # In[1]: # In[2]: import cv2 import numpy as np import easyocr import matplotlib.pyplot as plt # In[3]: im_1_path = '/Users/abrahamkom/Groupe 3IL 📖/Test/folder/permis4.jpg' im_2_path = '/Users/abrahamkom/Groupe 3IL 📖/Test/folder/PERMIS.jpg' print(im_1_path) # <h1 ...
viannprems99/projet_ocr
old_test.py
old_test.py
py
1,182
python
en
code
0
github-code
6
[ { "api_name": "easyocr.Reader", "line_number": 33, "usage_type": "call" } ]
21888978054
import os import combat.combat_core as com import factory.factory_core as fty import config.config_core as cfg import expedition.expedition_core as exp import fleet_switcher.fleet_switcher_core as fsw import fleet.fleet_core as flt import nav.nav as nav import pvp.pvp_core as pvp import quest.quest_core as qst import r...
XVs32/kcauto_custom
kcauto/startup/kcauto.py
kcauto.py
py
13,568
python
en
code
5
github-code
6
[ { "api_name": "util.kca.kca.hook_chrome", "line_number": 30, "usage_type": "call" }, { "api_name": "util.kca.kca", "line_number": 30, "usage_type": "attribute" }, { "api_name": "util.kca", "line_number": 30, "usage_type": "name" }, { "api_name": "util.kca.kca.star...
43394887837
#!/usr/bin/env python3 """ zbdump.py """ import logging import subprocess import sys import time import asyncio from typing import Any, Optional, Union from scapy.all import Dot15d4FCS # type: ignore import scapy.all as sp import datetime as dt _LOGGER = logging.getLogger(__name__) logging.basicConfig(level=loggi...
antonio-boiano/IoTScent
core/zbdump.py
zbdump.py
py
10,906
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 21, "usage_type": "attribute" }, { "api_name": "subprocess.c...
73733786108
# views.py import os from flask import Flask, request, render_template, flash, redirect, url_for, get_flashed_messages, session, abort from .forms import LoginForm, RegistrationForm, ShoppingListForm, additemsForm from . import app from app.modals import User @app.route('/', methods= ['GET', 'POST']) def index(): ...
Basemera/trailapp
app/views.py
views.py
py
4,234
python
en
code
0
github-code
6
[ { "api_name": "flask.request.method", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.session", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.redirect"...
42649106860
""" Crawls through the 'source' source and looks for labels starting with 'rancon'. If such a label is found on a service, then it will register the service in the 'backend'. If the backend supports tag all services will be tagged 'rancon'. depending on the backend the registration behavior can be influenced by tags s...
flypenguin/python-rancon
rancon/__init__.py
__init__.py
py
5,424
python
en
code
0
github-code
6
[ { "api_name": "asyncio.set_event_loop_policy", "line_number": 31, "usage_type": "call" }, { "api_name": "uvloop.EventLoopPolicy", "line_number": 31, "usage_type": "call" }, { "api_name": "sanic.Sanic", "line_number": 32, "usage_type": "call" }, { "api_name": "sani...
10251169117
import argparse import os import pandas as pd import json from pandas.core.frame import DataFrame from fol.foq_v2 import (concate_n_chains, copy_query, negation_sink, binary_formula_iterator, concate_iu_chains, decompose_D...
HKUST-KnowComp/EFO-1-QA-benchmark
append_new_normal_form.py
append_new_normal_form.py
py
2,720
python
en
code
17
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "fol.foq_v2.decompose_D", "line_number": 29, "usage_type": "name" }, { "api_name": "fol.foq_v2.parse_formula", "line_number": 31, "usage_type": "call" }, { "api_name"...
13703412898
# pybutton # create at 2015/5/28 # autor: qianqians from tools import argv_instance, tuple_rbg from pyelement import pyelement class pybutton(pyelement): def __init__(self, text, cname, layout, praframe): # when normal self.normaltext = text self.type = "button" super(pybutton, self).__init__(cname, layout,...
theDarkForce/plask
plask/pybutton.py
pybutton.py
py
2,060
python
en
code
2
github-code
6
[ { "api_name": "pyelement.pyelement", "line_number": 7, "usage_type": "name" }, { "api_name": "tools.tuple_rbg", "line_number": 59, "usage_type": "call" }, { "api_name": "tools.tuple_rbg", "line_number": 60, "usage_type": "call" }, { "api_name": "tools.tuple_rbg", ...
8022084480
import jieba from flask import Flask,render_template,request from peewee import fn from wordcloud import WordCloud from src.database import User,Weibo from src.save import save_user,save_weibo from src.spider import getuser, getresponse,getweibo from flask_paginate import get_page_parameter, Pagination app = Fl...
zuoqian26/weibo_monitor-2.0
app.py
app.py
py
4,736
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "src.database.User.select", "line_number": 14, "usage_type": "call" }, { "api_name": "src.database.User", "line_number": 14, "usage_type": "name" }, { "api_name": "src.database.We...
34867843324
import unittest from hamcrest import assert_that, instance_of, equal_to, raises, calling from app.exiftool.s3.object import Object from app.exiftool.s3.object_iterator import ObjectIterator from tests.config import Config as TestConfig class TestS3ObjectIterator(unittest.TestCase): def setUp(self) -> None: ...
zpieslak/exiftool-aws-lamdba
tests/s3/test_object_iterator.py
test_object_iterator.py
py
1,358
python
en
code
2
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tests.config.Config", "line_number": 10, "usage_type": "call" }, { "api_name": "app.exiftool.s3.object_iterator.ObjectIterator", "line_number": 16, "usage_type": "call" }, ...
73401806269
import torch from colorama import Fore as F def train_step(model, loss_fn, acc_fn, optimizer, dataloader, epochs): """ Trains a model for a binary classification task, calculating both loss and accuracy Args: model: the model that will be trained loss_fn: loss function, should be BCEWithLog...
PopeCorn/myr
code/functions.py
functions.py
py
2,782
python
en
code
0
github-code
6
[ { "api_name": "torch.sigmoid", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.float32", "line_number": 25, "usage_type": "attribute" }, { "api_name": "colorama.Fore.BLUE", "line_number": 35, "usage_type": "attribute" }, { "api_name": "colorama.For...
72612835709
import pytest from tast5_1 import Task5 import logging @pytest.mark.parametrize('filename, content', [ ('1.txt', 'a\n'), ('2.txt', 'b\n'), ('3.txt', 'c\n'), ('4.txt', 'd\n'), ...
fedepacher/Wazuh-Test
Task_5/test_case_51.py
test_case_51.py
py
591
python
en
code
0
github-code
6
[ { "api_name": "tast5_1.Task5", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 5, "usage_type": "call" }, { "api_name": "pytest.mark", "...
13914688192
import oneflow as flow from .recurrent import rnn def _FullyConnected(input_blob, weight_blob, bias_blob): output_blob = flow.matmul(input_blob, weight_blob) if bias_blob: output_blob = flow.nn.bias_add(output_blob, bias_blob) return output_blob class SimpleRNNCell: def __init__(self, ...
Oneflow-Inc/oneflow_nlp_model
nlp_ops/rnn/simple_rnn.py
simple_rnn.py
py
5,227
python
en
code
0
github-code
6
[ { "api_name": "oneflow.matmul", "line_number": 7, "usage_type": "call" }, { "api_name": "oneflow.nn.bias_add", "line_number": 9, "usage_type": "call" }, { "api_name": "oneflow.nn", "line_number": 9, "usage_type": "attribute" }, { "api_name": "oneflow.math", "l...
8320607344
import urllib.request import http.cookiejar import urllib.parse from bs4 import BeautifulSoup import os from People import People import queue import io import gzip import time def config_init(): """initial configuration""" cookie = http.cookiejar.CookieJar() cookie_support = urllib.request.HTTPCookieProces...
zhibzeng/PythonCode
zhihuCrawler.py
zhihuCrawler.py
py
4,001
python
en
code
0
github-code
6
[ { "api_name": "http.cookiejar.cookiejar.CookieJar", "line_number": 13, "usage_type": "call" }, { "api_name": "http.cookiejar.cookiejar", "line_number": 13, "usage_type": "attribute" }, { "api_name": "http.cookiejar", "line_number": 13, "usage_type": "name" }, { "a...
72318397308
import sys sys.path.append("../SimpleNN") """SingleNN potential.""" from fp_calculator import set_sym, calculate_fp from NN import MultiLayerNet import torch from torch.autograd import grad from Batch import batch_pad import time import numpy as np import pickle from ase.data import chemical_symbols, atomic_numbers f...
lmj1029123/SGCMC_Acrolein_AgPd
ML_Models/SNN.py
SNN.py
py
17,775
python
en
code
2
github-code
6
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "ase.calculators.calculator.Calculator", "line_number": 20, "usage_type": "name" }, { "api_name": "ase...
24512155771
import asyncio from django.core.cache import cache from apps.integration.models import KotakNeoApi as KotakNeoApiModel from apps.integration.utils import divide_and_list, get_option_ltp from apps.integration.utils.broker.dummy import DummyApi from apps.integration.utils.broker.kotak_neo import KotakNeoApi from apps.t...
finbyz/trading_child
apps/trade/strategies/__init__.py
__init__.py
py
8,566
python
en
code
0
github-code
6
[ { "api_name": "apps.trade.models.DeployedOptionStrategy", "line_number": 13, "usage_type": "name" }, { "api_name": "django.core.cache.cache.get", "line_number": 33, "usage_type": "call" }, { "api_name": "django.core.cache.cache", "line_number": 33, "usage_type": "name" ...
42136460155
import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Rectangle simlen = 10000 pX = pY = np.ones(6) pX = pY = pX/6 pZ = np.array([ 1/36, 2/36, 3/36, 4/36, 5/36, 6/36, 5/36, 4/36, 3/36, 2/36, 1/36 ]) possible = np.arange(1,7) possible_Z = np.arange(2, 13) X= np.random.choice(possible, simle...
gadepall/digital-communication
ncert/12/13/1/10/codes/die_sim.py
die_sim.py
py
2,541
python
en
code
7
github-code
6
[ { "api_name": "numpy.ones", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 1...
24547935454
#!/usr/bin/env python3 import sqlalchemy as sa import sqlalchemy.exc import sys from contextlib import contextmanager from pathlib import Path import click import csv sys.path.append('tm_navigator') from tm_navigator.models import * engine = sa.create_engine('postgresql+psycopg2://postgres@localhost/tm_navigator') sa...
aplavin/tm_navigator
db_manage.py
db_manage.py
py
10,341
python
en
code
1
github-code
6
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sqlalchemy.create_engine", "line_number": 13, "usage_type": "call" }, { "api_name": "sqlalchemy.orm...
30367879511
from numpy import linspace, sin from enable.api import ColorTrait, marker_trait from chaco.api import ArrayPlotData, Plot from enable.api import ComponentEditor from traits.api import HasTraits, Instance, Int from traitsui.api import Group, Item, View class ScatterPlotTraits(HasTraits): plot = Instance(Plot) ...
enthought/chaco
examples/tutorials/scipy2008/traits_example.py
traits_example.py
py
1,759
python
en
code
286
github-code
6
[ { "api_name": "traits.api.HasTraits", "line_number": 10, "usage_type": "name" }, { "api_name": "traits.api.Instance", "line_number": 12, "usage_type": "call" }, { "api_name": "chaco.api.Plot", "line_number": 12, "usage_type": "argument" }, { "api_name": "enable.ap...
43066420004
import tflearn as tl import numpy as np import os,glob,cv2 import sys,argparse from read_image import read_valid_image import tensorflow as tf from tflearn.layers.conv import conv_2d, max_pool_2d from tflearn.layers.core import input_data , dropout, fully_connected # from tflearn.layers.estimator import regression im...
Eniyanilavan/DogCatIdentification-tensorflow-python
predict1.py
predict1.py
py
2,021
python
en
code
0
github-code
6
[ { "api_name": "read_image.read_valid_image", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.real...
40110954603
import os import random from urllib.parse import quote from typing import List, Optional from dataclasses import dataclass, field from enum import Enum from jinja2 import Template SEAT_NUMBER_MAX_LENGTH = 3 # ascii characters are prohibited :D ru_alphabet_lower = 'абвгдеёжзиклмопрстуфхцчшщэюя' names = ['Сергій', 'І...
Tehtehteh/loner-bot
src/bot/models/train_order.py
train_order.py
py
2,648
python
en
code
1
github-code
6
[ { "api_name": "enum.Enum", "line_number": 19, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 28, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 55, "usage_type": "name" }, { "api_name": "dataclasses.field", "...
30418545772
from ete3 import Tree , TreeStyle , NodeStyle , faces , AttrFace import csv #t = Tree("(A:1,(B:1,(E:1,D:1):0.5):0.5);" ) #t.render("mytree.png", w=183, units="mm") t = Tree("(0);" ) all_orgs = [] with open('testlineage.csv') as csvfile: reader = csv.DictReader(csvfile) for org in reader: all_orgs.ap...
cgnitash/ded
dedli/pylin.py
pylin.py
py
2,243
python
en
code
0
github-code
6
[ { "api_name": "ete3.Tree", "line_number": 8, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 12, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 16, "usage_type": "call" }, { "api_name": "ete3.NodeStyle", "line_num...
34852034193
from pyspark.context import SparkContext import itertools import collections from collections import Counter import time from operator import add import os import sys def gencomb(freqitem,lenfreqitem): cand= [] for x in range(0,lenfreqitem-1): first = freqitem[x] firstelem = sorted(first) ...
malika-seth/Spark-Data-Mining
HW2_SON_Frequent_Itemsets/malika_seth_task2.py
malika_seth_task2.py
py
7,640
python
en
code
0
github-code
6
[ { "api_name": "collections.Counter", "line_number": 30, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 92, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 94, "usage_type": "call" }, { "api_name": "co...
14448481028
from transformers.tokenization_utils import PreTrainedTokenizer from transformers.utils.dummy_pt_objects import PreTrainedModel from transformers.data.processors.utils import InputExample, InputFeatures from .prompts import TemplateGenerator, VerbalizerGenerator from openprompt import PromptDataLoader, PromptForClassi...
jiachenwestlake/PDA
openprompt/lm_bff_trainer.py
lm_bff_trainer.py
py
8,021
python
en
code
3
github-code
6
[ { "api_name": "typing.List", "line_number": 21, "usage_type": "name" }, { "api_name": "transformers.data.processors.utils.InputExample", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 22, "usage_type": "name" }, { "api_name"...
72255301308
from __future__ import annotations import asyncio import datetime import re from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple import discord from dateutil.parser import parse from discord.ext import commands, menus from discord.ext.commands import Paginator as CommandPaginator from ..helpers import ...
LeoCx1000/fish
src/utils/discord_/paginator.py
paginator.py
py
13,193
python
en
code
0
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 16, "usage_type": "name" }, { "api_name": "discord.ButtonStyle", "line_number": 19, "usage_type": "attribute" }, { "api_name": "discord.ButtonStyle", "line_number": 20, "usage_type": "attribute" }, { "api_name":...
40744293644
import chess import math def scoreCalcBasic(board: chess.Board): currentScore = 0 for i in range(1,7): if i == 1: currentScore += len(board.pieces(i, chess.COLORS[0])) if i == 2: currentScore += 3*len(board.pieces(i, chess.COLORS[0])) if i =...
azkung/AI_Chess_5.5
python/bots/bot_basic.py
bot_basic.py
py
3,043
python
en
code
0
github-code
6
[ { "api_name": "chess.Board", "line_number": 5, "usage_type": "attribute" }, { "api_name": "chess.COLORS", "line_number": 10, "usage_type": "attribute" }, { "api_name": "chess.COLORS", "line_number": 12, "usage_type": "attribute" }, { "api_name": "chess.COLORS", ...
22624757619
from __future__ import division from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import chainer from chainer import functions as F import numpy as np...
pfnet-research/capg
clipped_gaussian.py
clipped_gaussian.py
py
3,811
python
en
code
28
github-code
6
[ { "api_name": "future.standard_library.install_aliases", "line_number": 7, "usage_type": "call" }, { "api_name": "future.standard_library", "line_number": 7, "usage_type": "name" }, { "api_name": "chainer.Variable", "line_number": 17, "usage_type": "attribute" }, { ...