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
70734487714
import sys import pygame from pygame.locals import KMOD_CTRL from pygame.locals import KMOD_SHIFT from pygame.locals import K_ESCAPE from pygame.locals import K_F1 from pygame.locals import K_SLASH from pygame.locals import K_TAB from pygame.locals import K_h from pygame.locals import K_i from pygame.locals import K_...
bounverif/starter-carla-0913
client/app/input_control.py
input_control.py
py
4,044
python
en
code
1
github-code
1
[ { "api_name": "pygame.quit", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 23, "usage_type": "call" }, { "api_name": "pygame.mouse.get_pos", "line_number": 54, "usage_type": "call" }, { "api_name": "pygame.mouse", "line_nu...
16813683773
#!/usr/bin/env python from random import randint from typing import Union import tcod.color from pyrl.components import Equipment, Inventory, Level, Player, Stairs from pyrl.components.equippable import Equippable, Slot from pyrl.components.item import Item from pyrl.components.visual import RenderOrder from pyrl.com...
abesto/pyrl
pyrl/mapgen.py
mapgen.py
py
9,324
python
en
code
15
github-code
1
[ { "api_name": "resources.map.Map", "line_number": 24, "usage_type": "name" }, { "api_name": "resources.map.Rect", "line_number": 24, "usage_type": "name" }, { "api_name": "resources.map.Map", "line_number": 32, "usage_type": "name" }, { "api_name": "resources.map....
28567208455
#!/usr/bin/env python3 # -*- coding: utf-8 -*- "Interval detection: finding flat sections in the signal" import numpy as np from utils import initdefaults from signalfilter import PrecisionAlg, CppPrecisionAlg from .splitting import SplitDetector, PyMultiGradeSplitDetector from .merging import PyMulti...
depixusgenome/trackanalysis
src/eventdetection/detection.py
detection.py
py
2,828
python
en
code
0
github-code
1
[ { "api_name": "signalfilter.PrecisionAlg", "line_number": 12, "usage_type": "name" }, { "api_name": "splitting.SplitDetector", "line_number": 27, "usage_type": "name" }, { "api_name": "splitting.PyMultiGradeSplitDetector", "line_number": 27, "usage_type": "call" }, { ...
37412146341
from django.shortcuts import render # Create your views here. # start game fonk def start_game(request): if request.method == 'POST': name = request.POST.get('name') image = request.FILES.get('image') puzzle = generate_puzzle(image) request.session['name'] = name request.se...
melihamutlu/proje-1-deneme-repo-
myproject/myapp/views.py
views.py
py
6,281
python
en
code
1
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 16, "usage_type": "call" }, { "api_name": "models.Player.objects.get_or_create", "line_number": 31, "usage_type": "call" }, { "api_name": "models.Player.objects", "line_number": 31, "usage_type": "attribute" }, {...
73582809634
import pytest from src.kbt.helpers import divide_by_lines, numbers def test_divide_by_lines_error(): data = [1, 2, 3, 4, 5, 6, 7, 8] with pytest.raises(Exception) as e: divide_by_lines(data, None) assert "Error trying to divide the data in None" in str(e) def test_divide_by_lines_error(): da...
miguelitogemio96/kata_bank_tool
test/test_helpers.py
test_helpers.py
py
1,052
python
en
code
0
github-code
1
[ { "api_name": "pytest.raises", "line_number": 7, "usage_type": "call" }, { "api_name": "src.kbt.helpers.divide_by_lines", "line_number": 8, "usage_type": "call" }, { "api_name": "src.kbt.helpers.divide_by_lines", "line_number": 16, "usage_type": "call" }, { "api_n...
22697300099
import altair as alt import math import pandas as pd import streamlit as st from PIL import Image """ # Which German Business Sector are you? Take this personality quiz to find out which part of the Volkswirtschaft is your spirit animal. This uses clustering from the ifo Business Climate Survey taken by thousands of...
merveogretmek/ifoHack-2023
ifoHack2023-ForecastFanatics/website/Quiz.py
Quiz.py
py
7,372
python
en
code
0
github-code
1
[ { "api_name": "streamlit.title", "line_number": 17, "usage_type": "call" }, { "api_name": "streamlit.radio", "line_number": 18, "usage_type": "call" }, { "api_name": "streamlit.text", "line_number": 25, "usage_type": "call" }, { "api_name": "streamlit.text", "...
13988952340
# -*- coding: UTF-8 -*- import json from xf import text_tovoice from xf import voice_totext from xf import text_tovoice_totext import time def test1(): print("---start---") start = time.time() voiceResultStr = text_tovoice.init('百度传来了喜讯', "E:/jianguocloud/learn/Python...
lanceNice/base_utils
xf/test.py
test.py
py
1,199
python
en
code
1
github-code
1
[ { "api_name": "time.time", "line_number": 11, "usage_type": "call" }, { "api_name": "xf.text_tovoice.init", "line_number": 12, "usage_type": "call" }, { "api_name": "xf.text_tovoice", "line_number": 12, "usage_type": "name" }, { "api_name": "json.loads", "line...
70431741475
# -*- coding: utf-8 -*- """ Created on Wed Jan 5 21:46:21 2022 @author: Cumali Atalan """ #%% #gerekli kütüphaneler import edilir. import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from collections import Counter from tensorflow import keras from keras.mo...
cumaliatalan/Yapay-Sinir-Aglari
CNN/CNN.py
CNN.py
py
4,564
python
tr
code
0
github-code
1
[ { "api_name": "warnings.filterwarnings", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 33, "usage_type": "call" }, { "api_name": "keras.preprocessing.image.ImageDataGenerator", "line_number": 68, "usage_type": "call" }, { ...
7688472178
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from pytorch_transformers.modeling_bert import BertPooler, BertSelfAttention, BertConfig from layers.attention import Attention, NoQueryAttention from layers.squeeze_embedding import SqueezeEmbedding class GNN(nn.Module): def _...
wwz58/bert-gcn
models/bert_albert_gcn.py
bert_albert_gcn.py
py
8,282
python
en
code
7
github-code
1
[ { "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.Parameter", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line...
6033659494
import typing as t """ Tags: Adjacency matrix The algorithm finds all shortest path pairs. The graph needs to be represented as an adjacency matrix. Example graph definition: A B C D A 0 8 INF 1 B INF 0 1 INF C 4 INF 0 INF D INF 2 9 0 The diagonal ^ is 0s because the node's ...
EvgeniiTitov/coding-practice
coding_practice/data_structures/graphs/apsp/floyd_warshall_implementstion_1.py
floyd_warshall_implementstion_1.py
py
2,013
python
en
code
1
github-code
1
[ { "api_name": "typing.Any", "line_number": 32, "usage_type": "attribute" } ]
14617850309
import random from math import sqrt from scipy.interpolate import lagrange from main_folder.smpc_addition.network_nodes.RandPoly import RandPoly class SmpcAdditionNode: def __init__(self) -> None: pass def generate_functions(self, record): all_functions = [] for feature in...
mswartz2/Secure-Multiparty-Computation-Main-Code
main_folder/smpc_addition/network_nodes/SmpcAdditionNode.py
SmpcAdditionNode.py
py
2,734
python
en
code
0
github-code
1
[ { "api_name": "main_folder.smpc_addition.network_nodes.RandPoly.RandPoly", "line_number": 14, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 22, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 23, "usage_type": "call" }, ...
39285481089
import cv2 as cv import sys #loads the using weights and correspding configuration rule def load_model(model_weights="",model_config=""): if model_weights == "" and model_config == "": print("Model config and weights not found!"); sys.exit(0); net = cv.dnn.readNet(model_weights,model_config); return net; de...
PrateekMunjal/Face-detection-webcam-opencv
model.py
model.py
py
495
python
en
code
1
github-code
1
[ { "api_name": "sys.exit", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.dnn.readNet", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 11, "usage_type": "attribute" } ]
2418374637
import logging from odoo import api, models, _ from odoo.tools import ormcache from odoo.tools.config import config, to_list _logger = logging.getLogger(__name__) WEB_BASE_URL_FREEZE = 'web.base.url.freeze' class IrConfigParameter(models.Model): _inherit = 'ir.config_parameter' @api.model @ormcache() ...
decgroupe/odoo-addons-dec
base_url_freeze_filtering/models/ir_config_parameter.py
ir_config_parameter.py
py
889
python
en
code
2
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 11, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 11, "usage_type": "name" }, { "api_name": "odoo.tools.config...
32343761147
#!/usr/bin/env python3 """ trivial strategy """ import archon.config as config import traceback from datetime import datetime #import archon.broker as broker from archon.brokersrv.brokerservice import BrokerService import archon.exchange.exchanges as exc import archon.exchange.bitmex.bitmex as mex import archon.exc...
economicnetwork/marketmaker
simple_maker.py
simple_maker.py
py
7,904
python
en
code
7
github-code
1
[ { "api_name": "strat.Strategy", "line_number": 36, "usage_type": "name" }, { "api_name": "archon.custom_logger.setup_logger", "line_number": 39, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 40, "usage_type": "call" }, { "api_name": "ar...
13810826097
from selenium import webdriver from selenium.webdriver.common.alert import Alert from random import choice, randint import win32com.client as comclt import win32gui import win32con import time def handle_upload_file_dialog(file_path): sleep = 1 windowsShell = comclt.Dispatch("WScript.Shell") time.sleep(sle...
thespacemanatee/SingHealth-App
__tests__/python test/Staff/CreateThenDeleteNewTenant.py
CreateThenDeleteNewTenant.py
py
2,074
python
en
code
1
github-code
1
[ { "api_name": "win32com.client.Dispatch", "line_number": 11, "usage_type": "call" }, { "api_name": "win32com.client", "line_number": 11, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 12, "usage_type": "call" }, { "api_name": "time.sleep", ...
70271092515
from __future__ import absolute_import from pymongo import MongoClient from pymongo.database import Database from pymongo.collection import Collection import six class_to_class_name = { str: 'unicode', six.text_type: 'unicode', bool: 'bool', list: 'list', tuple: 'list', int: 'in...
brainvisa/axon
python/fedji/mongodb_backend.py
mongodb_backend.py
py
2,113
python
en
code
0
github-code
1
[ { "api_name": "six.text_type", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pymongo.MongoClient", "line_number": 18, "usage_type": "name" }, { "api_name": "pymongo.database.Database", "line_number": 24, "usage_type": "name" }, { "api_name": "pymon...
8513594705
""" Utilities module. """ import datetime as dt import pkg_resources import barbante def local_import(name): """ Returns the module *name*. Attributes: name - the name of the module to be imported. Exception: TypeError - if *name* is not a string. ImportErr...
hypermindr/barbante
barbante/utils/__init__.py
__init__.py
py
3,449
python
en
code
10
github-code
1
[ { "api_name": "barbante.__name__", "line_number": 34, "usage_type": "attribute" }, { "api_name": "pkg_resources.resource_stream", "line_number": 37, "usage_type": "call" }, { "api_name": "barbante.__name__", "line_number": 40, "usage_type": "attribute" }, { "api_n...
28718464379
# -*- coding: utf-8 -*- """Model Examples.""" import numpy as np import sympy from sympy import symbols from causing.model import Model from causing.simulate import SimulationParams, simulate data_path = __file__.split("causing")[0] def example(): """model example""" X1, X2, Y1, Y2, Y3 = symbols(["X1", "X...
ZJfang-code/Causing
causing/examples/models.py
models.py
py
6,543
python
en
code
null
github-code
1
[ { "api_name": "sympy.symbols", "line_number": 17, "usage_type": "call" }, { "api_name": "causing.model.Model", "line_number": 23, "usage_type": "call" }, { "api_name": "causing.simulate.simulate", "line_number": 31, "usage_type": "call" }, { "api_name": "causing.s...
73545450914
import discord import asyncio import crawl_rss as cr from tokens import Token client = discord.Client() token = Token.discord_token async def my_background_task(): await client.wait_until_ready() channel = client.get_channel(Token.discord_channel) await channel.send(cr.messageFormat()) while not cli...
klsw725/YWAM-CMSE-contemplation-bot
discord_bot.py
discord_bot.py
py
670
python
en
code
0
github-code
1
[ { "api_name": "discord.Client", "line_number": 6, "usage_type": "call" }, { "api_name": "tokens.Token.discord_token", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tokens.Token", "line_number": 8, "usage_type": "name" }, { "api_name": "tokens.Token...
16401486914
import requests from twilio.rest import Client from decouple import config STOCK_NAME = "TSLA" COMPANY_NAME = "Tesla Inc" FUNCTION = "TIME_SERIES_DAILY" MY_API = config("MY_API", default="") NEW_API = config("NEW_API", default="") TWILIO_SID = config("TWILIO_SID", default="") TWILIO_TOKEN = config("TWILIO_TOKEN", def...
isik-dev/Stock-Price-Monitor
main.py
main.py
py
2,001
python
en
code
0
github-code
1
[ { "api_name": "decouple.config", "line_number": 9, "usage_type": "call" }, { "api_name": "decouple.config", "line_number": 10, "usage_type": "call" }, { "api_name": "decouple.config", "line_number": 11, "usage_type": "call" }, { "api_name": "decouple.config", ...
72920658275
from django.db import models from django.utils.html import mark_safe from edc_base.model_mixins import BaseUuidModel from edc_base.sites.site_model_mixin import SiteModelMixin from edc_base.utils import get_utcnow from edc_consent.field_mixins import VerificationFieldsMixin from edc_identifier.model_mixins import NonUn...
botswana-harvard/edc-odk
edc_odk/models/consent_copies.py
consent_copies.py
py
1,675
python
en
code
0
github-code
1
[ { "api_name": "edc_consent.field_mixins.VerificationFieldsMixin", "line_number": 10, "usage_type": "name" }, { "api_name": "edc_identifier.model_mixins.NonUniqueSubjectIdentifierModelMixin", "line_number": 10, "usage_type": "name" }, { "api_name": "edc_base.sites.site_model_mixin...
11817995914
from bokeh.plotting import figure from bokeh.io import curdoc from bokeh.models import GeoJSONDataSource, ColorBar from bokeh.models import DatetimeTickFormatter, PrintfTickFormatter, NumeralTickFormatter, NumeralTickFormatter from bokeh.models import HoverTool, WheelZoomTool from bokeh.models import LogColorMapper, Li...
annakuchko/map-app
app/plotting.py
plotting.py
py
2,128
python
en
code
0
github-code
1
[ { "api_name": "app.constants.MAP_PALLETE", "line_number": 16, "usage_type": "attribute" }, { "api_name": "app.constants", "line_number": 16, "usage_type": "name" }, { "api_name": "app.config.MAP_BREEZE", "line_number": 16, "usage_type": "attribute" }, { "api_name"...
29932380680
import json import re from collections import Counter, defaultdict from pathlib import Path from typing import Union import arabic_reshaper import demoji import seaborn as sns from hazm import Normalizer, sent_tokenize, word_tokenize from loguru import logger from src.data import DATA_DIR from wordcloud import WordClo...
mohammad-chegini/telegram_statistics
src/chat_statistics/stats.py
stats.py
py
4,142
python
en
code
0
github-code
1
[ { "api_name": "typing.Union", "line_number": 19, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "name" }, { "api_name": "loguru.logger.info", "line_number": 25, "usage_type": "call" }, { "api_name": "loguru.logger", "lin...
17775025297
import sys sys.path.insert(0, './src') # import os # os.getcwd() # os.chdir('../') from importlib import reload import numpy as np np.set_printoptions(suppress=True) import pickle from envs import merge reload(merge) from envs.merge import EnvMerge import os import time import json import matplotlib.pypl...
saArbabi/DriverActionEstimators
src/data/data_collection.py
data_collection.py
py
7,095
python
en
code
4
github-code
1
[ { "api_name": "sys.path.insert", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "numpy.set_printoptions", "line_number": 8, "usage_type": "call" }, { "api_name": "importlib.reload", ...
71112251874
from AIPUBuilder.Optimizer.utils import * from AIPUBuilder.Optimizer.framework import * from AIPUBuilder.Optimizer.ops.rnn import * from AIPUBuilder.Optimizer.ops.conv import clear_lower_bits_for_bias from AIPUBuilder.Optimizer.logger import * import torch.nn as nn split_weights_name = ['wx_gk', 'wh_gk', 'wx_ck', 'wh...
Arm-China/Compass_Optimizer
AIPUBuilder/Optimizer/ops/gruv3.py
gruv3.py
py
28,357
python
en
code
18
github-code
1
[ { "api_name": "torch.nn.flip", "line_number": 34, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 34, "usage_type": "name" }, { "api_name": "torch.nn.cat", "line_number": 43, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 43,...
11313645218
from django.shortcuts import render from django.http import HttpResponse from property.choice import price_choices, bedroom_choices, county_choices from property.models import Property from accounts.models import Owner def index(request): propertys = Property.objects.order_by('-list_date') context = { ...
paulndalila/ComfortHomes
pages/views.py
views.py
py
867
python
en
code
1
github-code
1
[ { "api_name": "property.models.Property.objects.order_by", "line_number": 9, "usage_type": "call" }, { "api_name": "property.models.Property.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "property.models.Property", "line_number": 9, "usage_type": ...
41592148020
from rest_framework.views import APIView from dj_rest_auth.views import AllowAny from django.http import FileResponse, HttpRequest, HttpResponse, JsonResponse from rest_framework.decorators import api_view from rest_framework.request import Request from tempfile import NamedTemporaryFile from docxtpl import DocxTemplat...
joshUAC7/rubrica
core/views.py
views.py
py
2,945
python
en
code
0
github-code
1
[ { "api_name": "rest_framework.views.APIView", "line_number": 17, "usage_type": "name" }, { "api_name": "dj_rest_auth.views.AllowAny", "line_number": 18, "usage_type": "name" }, { "api_name": "drfauth.models.Document.objects.get", "line_number": 20, "usage_type": "call" ...
31868037338
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt df = pd.read_csv (r'Seed Yield.csv') print (df) sns.set_theme(style="whitegrid") # Draw a nested barplot by cultivar and irrigation g = sns.catplot( data=df, kind="bar", x="Cultivar", y="Seed Yield", hue="Irrigation", ci="sd", palette...
Aria-Dolatabadian/Grouped-bar-plots
Code.py
Code.py
py
457
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "seaborn.set_theme", "line_number": 6, "usage_type": "call" }, { "api_name": "seaborn.catplot", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show...
15432766798
import json from os import PathLike from pathlib import Path from typing import Any, Dict, List, MutableMapping, Union import yaml STRUCTURE = { "Dataset": [ "dataset_name", "dataset_config", "dataset_revision", "labelcolumn", "textcolumn", ], "Training": [ ...
BramVanroy/transformers-finetuner
transformers_finetuner/generate_readme.py
generate_readme.py
py
4,972
python
en
code
0
github-code
1
[ { "api_name": "typing.MutableMapping", "line_number": 44, "usage_type": "argument" }, { "api_name": "typing.Dict", "line_number": 51, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 51, "usage_type": "name" }, { "api_name": "typing.Union", "...
72402872993
import os import random import torch import torchvision.transforms as T from PIL import Image from torch.utils import data def rreplace(s, old, new, occurrence): li = s.rsplit(old, occurrence) return new.join(li) class ImageAttr(data.Dataset): """Dataset class for the ImageAttr dataset.""" def __in...
hologerry/Attr2Font
dataloader.py
dataloader.py
py
9,937
python
en
code
219
github-code
1
[ { "api_name": "torch.utils.data.Dataset", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 15, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 43, "usage_type": "call" }, { "api_name": "random....
30417780326
from typing import Optional from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() persons = [{"id": 1, "ad": "Seyma", "soyad": "Sarigil", "meslek": "Gelistirici", "memleket": "Hatay"}, {"id": 2, "ad": "Alp", "soyad": "Kara", "meslek": "Müzisyen", "memleket": "İstanbul"}] class Person...
seymasa/PersonApi
main.py
main.py
py
1,248
python
en
code
1
github-code
1
[ { "api_name": "fastapi.FastAPI", "line_number": 6, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 12, "usage_type": "name" } ]
70309881313
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer from rest_framework_simplejwt.views import TokenObtainPairView from rest_framework import exceptions class StaffTokenObtainPairSerializer(TokenObtainPairSerializer): def validate(self, attrs): data = super().validate(attrs) ...
Dayroot/Ciclo3_Backend
bookstoreApp/views/staffViews/staffTokenObtainPairView.py
staffTokenObtainPairView.py
py
935
python
en
code
0
github-code
1
[ { "api_name": "rest_framework_simplejwt.serializers.TokenObtainPairSerializer", "line_number": 6, "usage_type": "name" }, { "api_name": "rest_framework.exceptions.AuthenticationFailed", "line_number": 17, "usage_type": "call" }, { "api_name": "rest_framework.exceptions", "lin...
22905237190
## set up logging import logging, os logging.basicConfig(level=os.environ.get("LOGLEVEL","INFO")) log = logging.getLogger("glam_command_line") import argparse, glob, json, subprocess, sys import glam_data_processing.legacy as glam from datetime import datetime # create temporary directory for shenanigans TEMP_DIR = o...
fdfoneill/glam_data_processing
glam_data_processing/generate_new_stats.py
generate_new_stats.py
py
7,853
python
en
code
1
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 3, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 3, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "logging.getLogger", ...
74495158433
from aiogram import types from aiogram.dispatcher import FSMContext from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton from data.config import admins from keyboards.default.menu_keyboards import menu from keyboards.inline.callback_datas import report_data from loader import dp, db, bot from states.me...
arsavit/av_by_B4L
handlers/users/reports.py
reports.py
py
2,583
python
ru
code
0
github-code
1
[ { "api_name": "aiogram.types.CallbackQuery", "line_number": 13, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 13, "usage_type": "name" }, { "api_name": "aiogram.dispatcher.FSMContext", "line_number": 13, "usage_type": "name" }, { "api_...
31409330642
from time import time import glob from sys import argv import cv2 import pickle import shutil from sklearn.cluster import KMeans from sklearn.linear_model import LogisticRegression from sklearn.metrics import f1_score, confusion_matrix from sklearn import preprocessing, svm import numpy as np ## Inputs k1 = 50 rele...
DavidLebrisse/RecoImgSSII
recoimg5.py
recoimg5.py
py
5,238
python
en
code
0
github-code
1
[ { "api_name": "glob.glob", "line_number": 89, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 93, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 97, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 101, ...
35823720174
# geocoding from zope import interface, component from getpaid.core.interfaces import IStoreSettings, IShippableLineItem, IOrder, IOriginRouter from getpaid.core.payment import ContactInformation import interfaces class OriginRouter( object ): " warehouse aware origin router " component.adapts( ...
collective/getpaid.warehouse
src/getpaid/warehouse/router.py
router.py
py
1,956
python
en
code
0
github-code
1
[ { "api_name": "zope.component.adapts", "line_number": 16, "usage_type": "call" }, { "api_name": "getpaid.core.interfaces.IOrder", "line_number": 16, "usage_type": "argument" }, { "api_name": "zope.component", "line_number": 16, "usage_type": "name" }, { "api_name"...
2687030494
from torchvision.datasets import CIFAR10, CIFAR100, MNIST, SVHN, FashionMNIST from data.MVTecDataset import getMVTecDataset from data.AdaptiveExposureDataset import getAdaptiveExposureDataset import os import torch import numpy as np import torchvision.transforms as transforms from torch.utils.data import Dataset from ...
Mohammadjafari80/ExposureExperiment
data/data_utils.py
data_utils.py
py
9,035
python
en
code
0
github-code
1
[ { "api_name": "data.constants.CIFAR10_PATH", "line_number": 19, "usage_type": "name" }, { "api_name": "data.constants.CIFAR100_PATH", "line_number": 20, "usage_type": "name" }, { "api_name": "data.constants.MNIST_PATH", "line_number": 21, "usage_type": "name" }, { ...
32918049245
import logging import time import dataset import discord from discord import Member from discord.ext import commands from cogs.commands import settings from utils import database, embeds # Enabling logs log = logging.getLogger(__name__) class MutesHandler(commands.Cog): """Handles actions such as mute evasion....
richtan/chiya
cogs/listeners/mutes_handle.py
mutes_handle.py
py
3,224
python
en
code
null
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "discord.ext.commands.Cog", "line_number": 16, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 16, "usage_type": "name" }, { "api_name": "...
25411278935
import logging import psutil import signal from devil.android import device_errors from devil.android import device_utils def _KillWebServers(): for s in [signal.SIGTERM, signal.SIGINT, signal.SIGQUIT, signal.SIGKILL]: signalled = [] for server in ['lighttpd', 'webpagereplay']: for p in psutil.proces...
hanpfei/chromium-net
build/android/pylib/utils/test_environment.py
test_environment.py
py
1,425
python
en
code
289
github-code
1
[ { "api_name": "signal.SIGTERM", "line_number": 10, "usage_type": "attribute" }, { "api_name": "signal.SIGINT", "line_number": 10, "usage_type": "attribute" }, { "api_name": "signal.SIGQUIT", "line_number": 10, "usage_type": "attribute" }, { "api_name": "signal.SIG...
10671644338
# -*- coding: utf-8 -*- """HTTP Endpoint for Netflix session management""" from __future__ import absolute_import, division, unicode_literals import json import BaseHTTPServer from SocketServer import TCPServer import resources.lib.common as common from .nfsession import NetflixSession class NetflixHttpRequestHand...
Toysoft/plugin.video.netflix
resources/lib/services/nfsession/http_server.py
http_server.py
py
1,755
python
en
code
4
github-code
1
[ { "api_name": "BaseHTTPServer.BaseHTTPRequestHandler", "line_number": 14, "usage_type": "attribute" }, { "api_name": "resources.lib.common.debug", "line_number": 23, "usage_type": "call" }, { "api_name": "resources.lib.common", "line_number": 23, "usage_type": "name" },...
31900586339
# -*- coding: utf-8 -*- """ @File : balancedString.py @Author : wenhao @Time : 2023/2/13 9:26 @LC : 1234 """ from math import inf from collections import Counter class Solution: ''' 思路: 同向双指针: ''' def balancedString(self, s: str) -> int: cnt, m = Counter(s), len(s) if ...
callmewenhao/leetcode
基础算法精讲/双指针/balancedString.py
balancedString.py
py
662
python
en
code
0
github-code
1
[ { "api_name": "collections.Counter", "line_number": 19, "usage_type": "call" }, { "api_name": "math.inf", "line_number": 22, "usage_type": "name" } ]
27287177163
""" Imagelab is the core class in CleanVision for finding all types of issues in an image dataset. The methods in this module should suffice for most use-cases, but advanced users can get extra flexibility via the code in other CleanVision modules. """ from __future__ import annotations import random from typing impor...
cleanlab/cleanvision
src/cleanvision/imagelab.py
imagelab.py
py
27,188
python
en
code
725
github-code
1
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 42, "usage_type": "name" }, { "api_name": "typing.TypeVar", "line_number": 47, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 120, "usage_type": "name" }, { "api_name": "typing.Optional"...
32738239065
from ..binary import BinaryReader, BinaryWriter from ..binary.types import Int8, Int16, Int32, UInt8, UInt16, UInt32 class HKHeader: """Represents Havok file header """ # fmt:off magic0: UInt32 = 0x57E0E057 # 0x00 # Always 0x57E0E057 magic1: UInt32 = 0x10C0C010 # 0x04 # Always 0x10C0C010 ...
krenyy/botw_havok
botw_havok/container/header.py
header.py
py
5,236
python
en
code
4
github-code
1
[ { "api_name": "binary.types.UInt32", "line_number": 10, "usage_type": "name" }, { "api_name": "binary.types.UInt32", "line_number": 11, "usage_type": "name" }, { "api_name": "binary.types.Int32", "line_number": 12, "usage_type": "name" }, { "api_name": "binary.typ...
38682966906
import cv2 import argparse ap = argparse.ArgumentParser() ap.add_argument('-i' ,'--image' ,required=True ,help = 'path to the input image') args = vars(ap.parse_args()) image = cv2.imread(args['image']) gray = cv2.cvtColor(image ,cv2.COLOR_BGR2GRAY) blurred = cv2.GaussianBlur(gray ,(5 ,5) ,0) #last argument in blurri...
suhaneshivam/Computer_vision
Image_operations/Center_of_shape/center_of_shape.py
center_of_shape.py
py
994
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", ...
12828462305
# pygame python第三方游戏库 .pyd 动态模块(可以导入,但是看不到源码) .py 静态模块 import pygame # 官方推荐这样导入 from pygame.locals import * import sys import time import random # 定义常量记录数据 (常量特点: 字母全大写 一旦定义,不要修改记录的值) WINDOW_H = 768 WINDOW_W = 512 class Bullet: # 子弹类 def __init__(self, img_path, x, y, window): self.img...
OreoCookiesYeah/base2
hm_07_敌机移动.py
hm_07_敌机移动.py
py
5,393
python
zh
code
0
github-code
1
[ { "api_name": "pygame.image.load", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 33, "usage_type": "call" }, { "api_name": "pygame.image", ...
41507098196
import matplotlib.pyplot as plt import plotly.graph_objs as go from plotly.offline import plot from plotly.subplots import make_subplots def plot_clandlestics(df): fig = go.Figure(data=[go.Candlestick(x=df['date'], open=df['open'], high=df...
luistiagos/stockssignals
plots.py
plots.py
py
2,488
python
en
code
0
github-code
1
[ { "api_name": "plotly.graph_objs.Figure", "line_number": 8, "usage_type": "call" }, { "api_name": "plotly.graph_objs", "line_number": 8, "usage_type": "name" }, { "api_name": "plotly.graph_objs.Candlestick", "line_number": 8, "usage_type": "call" }, { "api_name": ...
4206675975
"""SmartDevice URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.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...
skyu0221/IoT
backend-server/SmartDevice/urls.py
urls.py
py
1,950
python
en
code
0
github-code
1
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 22, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 22, "usage_type": "name" }, { "api_name": "sensors.views.UserViewSet", "line_number": 23, "usage_type": "attribute" },...
17656393605
from keras.preprocessing.image import ImageDataGenerator from keras.applications.inception_v3 import InceptionV3 from keras import backend as K K.set_image_dim_ordering('th') import numpy as np import os #Здесь делаем аугментацию. # Для этого в Keras предусмотрены так называемые ImageDataGenerator. # Они будут брать ...
ValeryShestakovv/keras_incepnionV3_binary_classification
bottleneck_features.py
bottleneck_features.py
py
3,937
python
ru
code
0
github-code
1
[ { "api_name": "keras.backend.set_image_dim_ordering", "line_number": 4, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 4, "usage_type": "name" }, { "api_name": "keras.applications.inception_v3.InceptionV3", "line_number": 19, "usage_type": "call" ...
46357130631
import numpy as np import matplotlib.pyplot as plt from control.matlab import * m1 = 0.8 m2 = 0.2 k1 = 100 c1 = 1 c2 = 0.3 Ks = 100 M = np.matrix([[m1, 0],[0, m2]]) C= np.matrix([[c1+c2, -c2],[-c2, c2]]) F = np.matrix([[Ks],[0]]) iM = np.linalg.inv(M) Bp = np.concatenate([np.zeros((2,1)), iM*F]) Cp = [0,1,0,0] Dp ...
RyoheiTK/robust-control
sample/robust_4_1.py
robust_4_1.py
py
1,065
python
en
code
0
github-code
1
[ { "api_name": "numpy.matrix", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.linalg.inv", "line_n...
41035339624
import importlib import itertools import random from sqlalchemy import and_ from sqlalchemy import Boolean from sqlalchemy import case from sqlalchemy import cast from sqlalchemy import Column from sqlalchemy import column from sqlalchemy import dialects from sqlalchemy import exists from sqlalchemy import extract fro...
sqlalchemy/sqlalchemy
test/sql/test_compare.py
test_compare.py
py
66,864
python
en
code
8,024
github-code
1
[ { "api_name": "sqlalchemy.MetaData", "line_number": 86, "usage_type": "call" }, { "api_name": "sqlalchemy.MetaData", "line_number": 87, "usage_type": "call" }, { "api_name": "sqlalchemy.Table", "line_number": 89, "usage_type": "call" }, { "api_name": "sqlalchemy.C...
19906847432
import numpy as np from keras.models import Sequential from keras.layers import Dense, Activation from keras.layers import LSTM import string import keras # DONE: fill out the function below that transforms the input series # and window-size into a set of input/output pairs for use with our RNN model def window_tran...
vincentmhhon/aind2-rnn
my_answers.py
my_answers.py
py
2,304
python
en
code
0
github-code
1
[ { "api_name": "numpy.asarray", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 27, "usage_type": "call" }, { "api_name": "keras.models.Sequential", ...
15926540509
from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render from .models import Swell, Tide, SurfSession, SurfSpot from datetime import datetime, timedelta, timezone from .forms import AddSessionForm, AddSurfSpot, SessionMatchesConditions, SessionMatchesTimeAndPlace # adding a ses...
kremerica/surfiq
surfinfo/views.py
views.py
py
8,550
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "forms.AddSessionForm", "line_number": 19, "usage_type": "call" }, { "api_name": "models.SurfSession.from_surfline", "line_number": 35, "usage_type": "call" }, { "api...
18636425161
import datetime as dt from datetime import timedelta from airflow import DAG from airflow.operators.bash_operator import BashOperator from airflow.operators.python_operator import PythonOperator def greet(r_date): print('Writing in file') with open('./greet.txt', 'a+', encoding='utf8') as f: now = dt.d...
madhur09/apache_airflow
airflow_home/dags/simple_dag.py
simple_dag.py
py
1,403
python
en
code
0
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "call" }, { "api_name": "dateti...
34009029856
import random import time import queue import hashlib from threading import * from treelib import Node, Tree from datetime import timedelta import threading lock = Lock() # Global LOCK (use to mutual exclusion) n = 3 # Network cardinality (number of processes in the network) growth_speed = 0.1 # regulates the growth...
czanacch/blockchain_algorithms
PaLa/PaLa4.py
PaLa4.py
py
12,007
python
en
code
1
github-code
1
[ { "api_name": "queue.Queue", "line_number": 22, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 23, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 24, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": ...
11481603432
import sys,re,difflib,time,datetime import numpy as np from array import array np.set_printoptions(threshold=sys.maxsize) import matplotlib.pyplot as plt import networkx as nx def show_graph_with_labels(adjacency_matrix, mylabels): rows, cols = np.where(adjacency_matrix != 0) edges = zip(rows.tolist(), cols.to...
FabienCharmet/MDPRA
showgraph.py
showgraph.py
py
680
python
en
code
0
github-code
1
[ { "api_name": "numpy.set_printoptions", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.where", "line_number": 9, "usage_type": "call" }, { "api_name": "networkx.Graph", ...
33422209146
from google.cloud import aiplatform import numpy as np endpoint_name = "text-classification_endpoint" endpoint = aiplatform.Endpoint.list(filter=f'display_name="{endpoint_name}"')[0] text = "I love going to the movies!" result = endpoint.predict(instances=[{'content': text}]) prediction = result.predictions[0] names =...
MeTaNoV/model-training
test/scripts/inference/text_classification_inference.py
text_classification_inference.py
py
499
python
en
code
0
github-code
1
[ { "api_name": "google.cloud.aiplatform.Endpoint.list", "line_number": 5, "usage_type": "call" }, { "api_name": "google.cloud.aiplatform.Endpoint", "line_number": 5, "usage_type": "attribute" }, { "api_name": "google.cloud.aiplatform", "line_number": 5, "usage_type": "name...
36866813408
import fnmatch import os import PyPDF2 import openpyxl from PyPDF2 import PdfReader from openpyxl.styles import Border, Side, Font, Alignment from openpyxl.worksheet.worksheet import Worksheet excel_path = os.getcwd() listOfFiles = os.listdir('.') pdf_files = [f for f in listOfFiles if f.endswith('.pdf')] pdf_files....
alekspetrov3009/MACROS
Заполнение служебной записки/zap.py
zap.py
py
5,583
python
ru
code
0
github-code
1
[ { "api_name": "os.getcwd", "line_number": 10, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 21, ...
348772121
# -*- coding: utf-8 -*- """ Created on Thu Jun 21 15:42:31 2018 @author: Ashish Chouhan """ #The optimal values of m and b can be actually calculated with way less effort than doing a linear regression. #this is just to demonstrate gradient descent import numpy as np from matplotlib import pyplot as plt # y = mx +...
achouhan93/Machine_Learning
Linear Regression/GradientDescent_With Plot Feature.py
GradientDescent_With Plot Feature.py
py
2,566
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 51, "usage_type": "call" }, { "api_name": "numpy.array", ...
31278878919
import os import cv2 def count_frames(path, override=False): # grab a pointer to the video file and initialize the total # number of frames read video = cv2.VideoCapture(path) total = 0 # if the override flag is passed in, revert to the manual # method of counting frames if override: total = count_frames_manua...
DimasVeliz/ExtractingFrames
resolvingFrames.py
resolvingFrames.py
py
2,869
python
en
code
0
github-code
1
[ { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.__version__", "line_number": 21, "usage_type": "attribute" }, { "api_name": "cv2.CAP_PROP_FRAME_COUNT", "line_number": 22, "usage_type": "attribute" }, { "api_name": "cv...
14807809950
from typing import cast, TYPE_CHECKING from sqlalchemy import select from sqlalchemy.ext.asyncio import AsyncSession from starlette.requests import HTTPConnection from starlite import ( AbstractAuthenticationMiddleware, AuthenticationResult, NotAuthorizedException, ) from database.model import User from s...
ppkpp/starlite_reactjs
security/auth_middleware.py
auth_middleware.py
py
1,368
python
en
code
0
github-code
1
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 15, "usage_type": "name" }, { "api_name": "starlite.AbstractAuthenticationMiddleware", "line_number": 21, "usage_type": "name" }, { "api_name": "starlette.requests.HTTPConnection", "line_number": 22, "usage_type": "name...
4576712455
import base64 import xml.etree.ElementTree as ET import gimme_aws_creds.common as commondef from . import errors class DefaultResolver(object): """ The Aws Client Class performs post request on AWS sign-in page to fetch friendly names/alias for account and IAM roles """ def __init__(self, ...
Nike-Inc/gimme-aws-creds
gimme_aws_creds/default.py
default.py
py
2,029
python
en
code
884
github-code
1
[ { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 20, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 20, "usage_type": "name" }, { "api_name": "base64.b64decode", "line_number": 20, "usage_type": "call" }, { "api_name"...
28684901336
import os import pandas as pd from django.shortcuts import render from django.http import HttpResponseRedirect source_dates = pd.read_csv("us-covid-dates.csv") titles = { "ct": { "title": "CASE RATE REPORTED BY STATE | TOTAL", "subtitle": "TOTAL NUMBER OF CASES | AS OF THE DATE INDICATED" }, ...
andrey-yakovenko/va-project
mysite/polls/views.py
views.py
py
2,703
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 82, "usage_type": "call" }, { "api_name": "os.pat...
43073961333
# -*- coding: utf-8 -*- '''mid 此文件为数据管理程序主界面 用于对历史数据进行检查核对 功能: 1.展示本地数据KLine图形 2.下载远程数据到本地 窗口布局: 1.数据展示主窗口 左侧为本地数据列表 右侧为KLine 左下侧为本地数据操作命令按钮 2.数据下载管理子窗口 左侧为代码表 右侧为待下载代码 程序结构: 为了能够方便的被各种窗体调用嵌入,各个窗体都定义为layout ''' from matplotlib.backends.backend_qt4agg import F...
UpSea/midProjects
histdataUI/Layouts/dataVisualizerLayout.py
dataVisualizerLayout.py
py
15,734
python
en
code
1
github-code
1
[ { "api_name": "sys.version", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "os.path.join", "lin...
2003100509
from tests import unittest from awscli.customizations.s3.utils import find_bucket_key, find_chunksize from awscli.customizations.s3.constants import MAX_SINGLE_UPLOAD_SIZE class FindBucketKey(unittest.TestCase): """ This test ensures the find_bucket_key function works when unicode is used. """ de...
gthiruva/aws-cli
tests/unit/customizations/s3/test_utils.py
test_utils.py
py
1,705
python
en
code
null
github-code
1
[ { "api_name": "tests.unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "tests.unittest", "line_number": 7, "usage_type": "name" }, { "api_name": "awscli.customizations.s3.utils.find_bucket_key", "line_number": 14, "usage_type": "call" }, ...
21451999572
import paho.mqtt.client as mqtt import sqlite3 from datetime import datetime, timedelta # Name of DB file. db_file = "connected_devices.db" # Exceptions classes. class ConnectionToMqttBrokerException(Exception): def __init__(self): pass def __str__(self): message = "MQTT Manager could not connect t...
kosmolub01/Smart-home
Smart_home/app/mqtt_manager.py
mqtt_manager.py
py
9,827
python
en
code
0
github-code
1
[ { "api_name": "sqlite3.connect", "line_number": 59, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 65, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 65, "usage_type": "name" }, { "api_name": "sqlite3.conne...
3476128370
# -*- coding: utf-8 -*- """ Trains and tests a Rolling Bayesian Ridge Regression model on data @author: Nick """ import warnings import numpy as np import pandas as pd from sklearn.pipeline import Pipeline from sklearn.feature_selection import VarianceThreshold from sklearn.preprocessing import MinMaxScal...
N-ickMorris/Time-Series
elect_rolling_bayes.py
elect_rolling_bayes.py
py
2,128
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.arange", "line...
15922680536
import numpy as np import torch from torch.utils.data import Dataset, DataLoader, ConcatDataset import mat73 class MatCovData(Dataset): def __init__(self, snr=10, mode='train', norm=None): super(MatCovData, self).__init__() if mode == 'train': file_path = '/home/External/xr/SDOAnet/doa...
FurryMushroom/DOA_Estimation_machine_learning
dataset.py
dataset.py
py
2,993
python
en
code
1
github-code
1
[ { "api_name": "torch.utils.data.Dataset", "line_number": 7, "usage_type": "name" }, { "api_name": "mat73.loadmat", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.transpose", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.sin", ...
11711168032
import pandas as pd import pickle import datetime import sys from nltk.metrics import edit_distance from siuba import * from siuba.dply.vector import row_number needs_to_be_matched = pickle.load(open("../data/manual_cleaning/needs_to_by_joined_wip.p", "rb")) new_songs = pickle.load(open("../data/data2.p", "rb")) # Re...
bakera81/itunesutils
python/search_for_matches.py
search_for_matches.py
py
7,409
python
en
code
0
github-code
1
[ { "api_name": "pickle.load", "line_number": 9, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 10, "usage_type": "call" }, { "api_name": "nltk.metrics.edit_distance", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.qcut", "...
31595782614
from matplotlib import pyplot from matplotlib.patches import Rectangle import imageIO.png import numpy as np import math class Queue: def __init__(self): self.items = [] def isEmpty(self): return self.items == [] def enqueue(self, item): self.items.insert(0,item) def dequeu...
iessje/QR-code-detection
QRCodeDetection.py
QRCodeDetection.py
py
13,915
python
en
code
0
github-code
1
[ { "api_name": "imageIO.png.png.Reader", "line_number": 34, "usage_type": "call" }, { "api_name": "imageIO.png.png", "line_number": 34, "usage_type": "attribute" }, { "api_name": "imageIO.png", "line_number": 34, "usage_type": "name" }, { "api_name": "imageIO.png.p...
71555251875
import math from src.VAR import Var from src.VAR_distance import Var_distance from scipy.spatial import distance class Grangercalculator_distance: def __init__(self, df, lag): self.df = df self.lag = lag def GC_calculator(self, bi_pairs, W, tau): distances = [] tau_exp = mat...
SanderBos1/Thesis
src/GC_calculation_distance.py
GC_calculation_distance.py
py
1,884
python
en
code
0
github-code
1
[ { "api_name": "math.exp", "line_number": 16, "usage_type": "call" }, { "api_name": "src.VAR_distance.Var_distance", "line_number": 22, "usage_type": "call" }, { "api_name": "src.VAR.Var", "line_number": 38, "usage_type": "call" }, { "api_name": "scipy.spatial.dist...
72505330915
# -------------------------------------------------------------------- # shell.py: Shell command execution tools, including ShellRecipe. # # Author: Lain Musgrove (lain.proliant@gmail.com) # Date: Thursday, January 2 2020 # # Distributed under terms of the MIT license. # ------------------------------------------------...
lainproliant/panifex
panifex/shell.py
shell.py
py
13,661
python
en
code
1
github-code
1
[ { "api_name": "typing.Callable", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 27, "usage_type": "name" }, { "api_name": "asyncio.StreamReader", "line_number": 27, "usage_type": "attribute" }, { "api_name": "util.get_logge...
74229130912
from typing import Optional # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def insertIntoBST(self, root: Optional[TreeNode], val: int) -> Optional[TreeNode]: ...
TimHung000/leetcode
0701_insertIntoABinarySearchTree/main.py
main.py
py
1,158
python
en
code
0
github-code
1
[ { "api_name": "typing.Optional", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 31, "usage_type": "name" } ]
24231412484
import sys from PyQt5 import QtWidgets from PyQt5.QtCore import QThread import pyqtgraph as pg import numpy as np from MainWindow import Ui_MainWindow #from GraphClass import MultiLine # Supposed to improve perforamnce, but with latest pyqtgraph updates maybe not needed anymore from WorkerClass import AcquireData from...
nelsongt/mfiaDLTS2
mfiaMain.py
mfiaMain.py
py
6,880
python
en
code
3
github-code
1
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 13, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 13, "usage_type": "name" }, { "api_name": "MainWindow.Ui_MainWindow", "line_number": 13, "usage_type": "name" }, { "api_nam...
75207759392
''' 通过解析xml文件,批量修改xml文件里的标签名称,比如把标签zero改成num ''' import os.path import glob import xml.etree.ElementTree as ET path = r'数据集\Annotations' #存储标签的路径,修改为自己的Annotations标签路径 sum3 = 0 for xml_file in glob.glob(path + '/*.xml'): ####### 返回解析树 tree = ET.parse(xml_file) ##########获取根节点 root = tree.getr...
cccccccyyyyyyyyy/shiny-waddle
xcyxmlchange.py
xcyxmlchange.py
py
1,283
python
zh
code
0
github-code
1
[ { "api_name": "glob.glob", "line_number": 10, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.parse", "line_number": 12, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 12, "usage_type": "name" } ]
71728267235
#!/usr/bin/env python # coding: utf-8 # import import os import numpy as np import tensorflow as tf from models import simple_CNN from keras.callbacks import EarlyStopping, ModelCheckpoint, CSVLogger, TensorBoard import matplotlib.pyplot as plt init = tf.global_variables_initializer() config = tf.ConfigPr...
menhai/ANALYSIS-OF-STABILOMETRIC-DATA
train.py
train.py
py
2,129
python
en
code
0
github-code
1
[ { "api_name": "tensorflow.global_variables_initializer", "line_number": 11, "usage_type": "call" }, { "api_name": "tensorflow.ConfigProto", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.Session", "line_number": 15, "usage_type": "call" }, { ...
22704557894
import tqdm import pickle import torch from torch.utils.data import DataLoader import sentencepiece as spm from custom_dataset import CustomDataset from models.rnn.model import Encoder, NMTDecoder, StylizedNMT from loss import ce_loss # os.environ['CUDA_LAUNCH_BLOCKING'] = "1" torch.cuda.empty_cache() torch.autogr...
TrellixVulnTeam/kcc_7NVH
models/rnn/test.py
test.py
py
4,423
python
en
code
0
github-code
1
[ { "api_name": "torch.cuda.empty_cache", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.autograd.set_detect_anomaly", "line_number": 16, "usage_type": "call" }, { "api_name...
35341136686
from django.urls import path from . import views app_name = 'blog' urlpatterns = [ path('', views.blog_list, name='blog-list'), path('article/<int:id>/', views.blog_detail, name='blog-detail'), path('add-article/', views.add_article, name='add-article'), path('confirm-add-article/', views.con...
javadsalman/k111-blog-project
blog/urls.py
urls.py
py
736
python
en
code
0
github-code
1
[ { "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", ...
72199681314
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from googlecloudsdk.api_lib.compute import base_classes from googlecloudsdk.calliope import arg_parsers from googlecloudsdk.calliope import base from googlecloudsdk.command_lib.compute import flags as compute...
aidanby/JARVIS-MUSIC
google-cloud-sdk/lib/surface/compute/networks/subnets/create.py
create.py
py
8,803
python
en
code
5
github-code
1
[ { "api_name": "googlecloudsdk.command_lib.compute.networks.subnets.flags.SubnetworkArgument", "line_number": 16, "usage_type": "call" }, { "api_name": "googlecloudsdk.command_lib.compute.networks.subnets.flags", "line_number": 16, "usage_type": "name" }, { "api_name": "googleclou...
13857010706
from bs4 import BeautifulSoup import requests import urllib.parse import json from discord.ext import commands class CodInGame(commands.Cog): def __init__(self,config, bot: commands.Bot): self.bot = bot self.config = config @commands.command() async def gofish(self, ctx): u...
JeppeLovstad/Discord-Meme-Delivery-Bot
BotModules/codingame.py
codingame.py
py
1,196
python
en
code
0
github-code
1
[ { "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.ext.commands.Bot", "line_number": 8, "usage_type": "attribute" }, { "api...
8039560044
import time import telebot from telebot import types import base bot = telebot.TeleBot('5194270771:AAF2zvg8MEBgCjOusmaIyX6u4yF7X_CtmCw') #bot = telebot.TeleBot('5188999206:AAFDzoHQCE6_YTsAxTA8hlhJD4M2tPXyVh4') #dev bd = base.Base("localhost") @bot.message_handler(commands=['start']) def start(message): print(m...
UzorStudio/exchenge
tgBot.py
tgBot.py
py
2,051
python
en
code
0
github-code
1
[ { "api_name": "telebot.TeleBot", "line_number": 8, "usage_type": "call" }, { "api_name": "base.Base", "line_number": 10, "usage_type": "call" }, { "api_name": "telebot.types.ReplyKeyboardMarkup", "line_number": 19, "usage_type": "call" }, { "api_name": "telebot.ty...
36565638138
""" Created on Tue Oct 23 03:00:14 2018 @author: Rahul """ import numpy as np import pandas as pd import math import random import datetime from logging import info from .constant import STOCK_LIST WILLIAM_K_UL = -80 WILLIAM_K_LL = -20 A = [ {'sector' : 'Mining', 'stock' : 'ABIRLANUVO'}, {'sector' : 'Computers', 'st...
rahulspsec/StockScreenerSite
StockScreenerSite/stockscreener/StockScreenerUtility/StockScreener.py
StockScreener.py
py
14,224
python
en
code
0
github-code
1
[ { "api_name": "pandas.DataFrame", "line_number": 27, "usage_type": "call" }, { "api_name": "constant.STOCK_LIST", "line_number": 32, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 33, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
23808835097
import pandas as pd from scipy.sparse.construct import rand from sklearn.linear_model import Ridge from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import train_test_split #import matplotlib.pyplot as plt from sklearn import metrics import os from sklearn import tree from sklearn.externals im...
sandeep7/Food_delivery_time
train.py
train.py
py
4,660
python
en
code
0
github-code
1
[ { "api_name": "pandas.get_dummies", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.get_dummies", "line_number": 33, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 35, "usage_type": "call" }, { "api_name...
11647920658
import pyttsx3 #pip install pyttsx3 import speech_recognition as sr #pip install speechRecognition import datetime import wikipedia #pip install wikipedia import webbrowser import os import smtplib import sys import random import urllib.request import json engine = pyttsx3.init('sapi5') voices = engine.ge...
BishalKumarSingh/Desktop_Assistant
Jarvis.py
Jarvis.py
py
4,633
python
en
code
0
github-code
1
[ { "api_name": "pyttsx3.init", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 25, "usage_type": "attribute" }, { "api_name": "speech_reco...
8556855206
__author__ = 'Marcelo Ferreira da Costa Gomes' import sys import logging import pandas as pd import numpy as np import random from .episem import lastepiweek, epiweek2date module_logger = logging.getLogger('update_system.delay_table') def extract_quantile(dforig=pd.DataFrame, filtertype='srag'): if filtertype n...
FluVigilanciaBR/seasonality
methods/data_filter/delay_table.py
delay_table.py
py
9,005
python
en
code
1
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 21, "usage_type": "call" }, { "api_name": "episem.laste...
8499870149
import random import matplotlib.pyplot as plt import numpy as np class bandit: def __init__(self, arm_num): self.arms = [] for _ in range(arm_num): arm = {'mean': random.gauss(0, 1), 'std': 1} self.arms.append(arm) def reset(self, random_walk_std): for i in ran...
Ja1r0/RL-an-introduction-exercise
Capter 2/Figure 2-4.py
Figure 2-4.py
py
4,156
python
en
code
0
github-code
1
[ { "api_name": "random.gauss", "line_number": 10, "usage_type": "call" }, { "api_name": "random.gauss", "line_number": 15, "usage_type": "call" }, { "api_name": "random.gauss", "line_number": 20, "usage_type": "call" }, { "api_name": "random.uniform", "line_num...
8904685658
#!/usr/bin/python #-*- coding: utf-8 -*- import json class Metadata: def __init__(self): self._meta = None def set(self, pAttribute, pValue): d = {pAttribute : pValue} s = json.dumps(d) if self._meta is None: self._meta = {} self._meta[pAttribute] = pValue ...
CogComp/NLP-Multipackage-Demo
backend/texas/core/Metadata.py
Metadata.py
py
1,365
python
en
code
1
github-code
1
[ { "api_name": "json.dumps", "line_number": 12, "usage_type": "call" } ]
72112054114
import argparse import sys from pathlib import Path from tokenizer import JackTokenizer from compilation_engine import CompilationEngine JACK = '.jack' XML = '.xml' VM = '.vm' def compile(file_name, analyze): vm_name = file_name.parent.joinpath(file_name.stem + VM) xml_name = file_name.parent.joinpath(file_n...
akaps/nand2tetris
projects/project_10/JackCompiler.py
JackCompiler.py
py
1,477
python
en
code
0
github-code
1
[ { "api_name": "tokenizer.JackTokenizer", "line_number": 16, "usage_type": "call" }, { "api_name": "compilation_engine.CompilationEngine", "line_number": 17, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { ...
7922606907
import matplotlib.pyplot as plt def show_graphics(result_list1, list1_tag, result_list2, list2_tag, common_tag): fig, axes = plt.subplots(2, sharex=True, figsize=(10, 5)) fig.suptitle('Resultados') axes[0].set_ylabel(list1_tag, fontsize=12) axes[0].plot(result_lis...
JulianSalinas/carrots-finder
tec/ic/ia/pc2/model/graph_utils.py
graph_utils.py
py
468
python
fa
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 19, "usage_type": "call" }, { "api_name": "mat...
25103319583
import logging from egtsdebugger.egts import * import socket class RnisConnector: """Provide functional for connecting to RNIS""" def __init__(self, host, port, num, dispatcher, file, **kwargs): self.host = host self.port = port self.num = 0 self.max = num self.did = di...
SatisSoft/egts-debugger
rnis_connector.py
rnis_connector.py
py
4,475
python
en
code
1
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 22, "usage_type": "call" }, { "api_name": "socket.socket", ...
2524005655
import matplotlib.pyplot as plt import matplotlib.image as mpimg import matplotlib._png as png import numpy as np import cv2 np.seterr(divide='ignore', invalid='ignore') def region_of_interest(img, vertices): # Define a blank matrix that matches the image height/width. mask = np.zeros_like(img) # Retriev...
ghazalsaf/mobNavigation
road_detect2.py
road_detect2.py
py
4,234
python
en
code
0
github-code
1
[ { "api_name": "numpy.seterr", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.fillPoly", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "lin...
4850877077
""" Cli functions to setup scout """ import logging import datetime import yaml import pymongo import click # Adapter stuff from scout.adapter.mongo import MongoAdapter from scout.adapter.client import get_connection from pymongo.errors import (ConnectionFailure, ServerSelectionTimeoutError) # Import the resources t...
gitter-badger/scout
scout/commands/setup/setup_scout.py
setup_scout.py
py
13,127
python
en
code
null
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 50, "usage_type": "call" }, { "api_name": "scout.build.build_institute", "line_number": 75, "usage_type": "call" }, { "api_name": "scout.utils.link.link_genes", "line_number": 105, "usage_type": "call" }, { "api_na...
8819603725
import torch import torch.nn as nn from Networks.Transformer_Encoder import TransformerEncoderLayer, TransformerEncoder from Networks.Transformer_decoder import TransformerDecoderLayer, TransformerDecoder from Networks.FiLM import Model as Model_Film from Networks.Informer import Model from Networks.wavenet impor...
YXING-CC/Dark-Light
Networks/Generators.py
Generators.py
py
8,766
python
en
code
0
github-code
1
[ { "api_name": "torch.device", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn.Module"...
11411241005
"""Test logging utils.""" import logging import re import pytest import youtube_monitor_action.__main__ @pytest.fixture() def _setup_logger(mocker, tmp_path): logger = logging.getLogger("test_logger") mocker.patch.object(youtube_monitor_action.__main__, "_MODULE_LOGGER", logger) youtube_monitor_action._...
mshafer1/youtube_monitor_action
tests/test_loggin_utils.py
test_loggin_utils.py
py
2,117
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "youtube_monitor_action.__main__.__main__", "line_number": 13, "usage_type": "attribute" }, { "api_name": "youtube_monitor_action.__main__", "line_number": 13, "usage_type": "name"...
16295874822
# Databricks notebook source from pyspark.sql.functions import col, count, isnull, when # COMMAND ---------- def remove_duplicates(table): """ Removes duplicate rows from table Parameters: ---------- table : Pyspark Dataframe(pyspark.sql.dataframe.DataFrame) Name of the dataframe Ret...
SoumyaAkunoori/GitActionsDemo
databricks/databricks/tpc_ds/de_workload/enriched/rdbms/sales/historical/Data_Cleaning_utils.py
Data_Cleaning_utils.py
py
2,484
python
en
code
0
github-code
1
[ { "api_name": "pyspark.sql.functions.when", "line_number": 45, "usage_type": "call" }, { "api_name": "pyspark.sql.functions.isnull", "line_number": 45, "usage_type": "call" }, { "api_name": "pyspark.sql.functions.count", "line_number": 54, "usage_type": "call" }, { ...
28123538513
from mythril.laser.ethereum.state.annotation import ( StateAnnotation, MergeableStateAnnotation, ) from copy import copy from typing import Dict, List, Set import logging import json from collections import namedtuple log = logging.getLogger(__name__) class MutationAnnotation(StateAnnotation): """Muta...
rjx18/mythril
mythril/laser/plugin/plugins/plugin_annotations.py
plugin_annotations.py
py
9,835
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "mythril.laser.ethereum.state.annotation.StateAnnotation", "line_number": 17, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 79, "usage_type": "call" }, { ...
1392454468
import torch import torchtext from src.models.conversational.checkpoint import Checkpoint from src.models.conversational.emotion_dialogue_dataset import UTTERANCE_FIELD_NAME, RESPONSE_FIELD_NAME, \ EMOTION_FIELD_NAME from src.models.conversational.emotion_model import EmotionSeq2seq, EmotionTopKDecoder from src.mo...
Neronuser/EmoCourseChat
src/models/conversational/emotion_trainer.py
emotion_trainer.py
py
6,845
python
en
code
1
github-code
1
[ { "api_name": "src.models.conversational.trainer.Trainer", "line_number": 13, "usage_type": "name" }, { "api_name": "src.models.conversational.evaluator.EmotionEvaluator", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 66, ...
74588081952
import os import sys import openai import requests from uni_kie.models.model import LargeLanguageModel from uni_kie.prompts.prompts import STOP_KEY class GPT3_Davinci(LargeLanguageModel): def __init__(self): super().__init__() # openai.api_key = os.getenv("OPENAI_TOKEN") # we are subtra...
ivo-1/bachelor-thesis
uni_kie/models/gpt.py
gpt.py
py
3,238
python
en
code
0
github-code
1
[ { "api_name": "uni_kie.models.model.LargeLanguageModel", "line_number": 11, "usage_type": "name" }, { "api_name": "uni_kie.prompts.prompts.STOP_KEY", "line_number": 26, "usage_type": "name" }, { "api_name": "openai.Completion.create", "line_number": 32, "usage_type": "cal...
25588409878
from django.shortcuts import render from django.views.generic import ListView from acheve_mgt.models import Student, MyClass, ScoreShip, Course from django.contrib.auth.decorators import login_required from django.http import JsonResponse # Create your views here. @login_required def person(request, pk): user = r...
liuqiao1995/stu_mgt
apps/acheve_mgt/views.py
views.py
py
6,981
python
en
code
0
github-code
1
[ { "api_name": "acheve_mgt.models.MyClass.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "acheve_mgt.models.MyClass.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "acheve_mgt.models.MyClass", "line_number": 12, "usage_type":...
41935303161
from django import forms class FirebaseUploadWidget(forms.TextInput): template_name = 'base/widgets/firebase-upload-widget.html' class Media: js = ( 'https://www.gstatic.com/firebasejs/7.8.1/firebase-app.js', 'https://www.gstatic.com/firebasejs/7.8.1/firebase-storage.js', ...
Benbb96/benbb96-website
base/widgets.py
widgets.py
py
719
python
en
code
1
github-code
1
[ { "api_name": "django.forms.TextInput", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 4, "usage_type": "name" } ]
10255627866
import torch.nn as nn import torch from .linear_net import LinearNet class LPDiscriminator(nn.Module): def __init__(self, light_num, lp_dim, ndf): super(LPDiscriminator,self).__init__() self.linear = LinearNet(light_num, lp_dim) # 256 x 256 self.layer1 = nn.Sequential(nn.Conv2d(l...
xuxmin/NeuralTexture_gan
core/models/lp_discriminator.py
lp_discriminator.py
py
1,978
python
en
code
1
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "linear_net.LinearNet", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn.Sequential"...