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
32028536551
from .BlockingMatching import BlockingMatching from Evaluation.Evaluation import valuta_blocking from CorrispBuilder.CorrisBuilder import CorrisBuilder from copy import deepcopy import pandas as pd import networkx as nx class EntityMatching: def __init__(self, sources): self.sources = sources def pr...
allePansera/BI_functions
Blocking/EntityMatching.py
EntityMatching.py
py
6,384
python
en
code
0
github-code
18
[ { "api_name": "pandas.DataFrame", "line_number": 36, "usage_type": "call" }, { "api_name": "BlockingMatching.BlockingMatching", "line_number": 41, "usage_type": "call" }, { "api_name": "CorrispBuilder.CorrisBuilder.CorrisBuilder", "line_number": 46, "usage_type": "call" ...
3686817437
""" Functions that aid weighting the visibility data prior to imaging. There are two classes of functions: - Changing the weight dependent on noise level or sample density or a combination - Tapering the weihght spatially to avoid effects of sharp edges or to emphasize a given scale size in the image """ __a...
NLESC-quantum/rascil
rascil/processing_components/imaging/weighting.py
weighting.py
py
5,022
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "rascil.processing_components.image.operations.image_is_canonical", "line_number": 42, "usage_type": "call" }, { "api_name": "rascil.processing_components.griddata.operations.create_gridda...
36323086412
# -*- coding:utf-8 -*- # --Based on YOLOX made by Megavii Inc.-- import os from pathlib import Path import torch.nn as nn from experiments.ours_exp import Exp as MyExp class Exp(MyExp): def __init__(self): super(Exp, self).__init__() self.memory = True self.heads = 4 self.memory_...
Liyi4578/OFMA
experiments/test_exp.py
test_exp.py
py
601
python
en
code
0
github-code
18
[ { "api_name": "experiments.ours_exp.Exp", "line_number": 11, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 23, "usage_type": "call" } ]
24092756790
from ducttapp.models import db from datetime import datetime from flask_restplus import fields class UserAction(db.Model): def __init__(self, **kwargs): for k, v in kwargs.items(): setattr(self, k, v) __tablename__ = 'user_action' id = db.Column(db.Integer, primary_key=True, autoincre...
anhducc13/flask-app
ducttapp/models/user_action.py
user_action.py
py
884
python
en
code
0
github-code
18
[ { "api_name": "ducttapp.models.db.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "ducttapp.models.db", "line_number": 6, "usage_type": "name" }, { "api_name": "ducttapp.models.db.Column", "line_number": 12, "usage_type": "call" }, { "api_name...
25178147488
import base64 class Module: def __init__(self, mainMenu, params=[]): # metadata info about the module, not modified during runtime self.info = { # name for the module that will appear in module menus 'Name': 'LaunchDaemon', # list of one or more authors for the...
EmpireProject/Empire
lib/modules/python/persistence/osx/launchdaemonexecutable.py
launchdaemonexecutable.py
py
5,824
python
en
code
7,153
github-code
18
[ { "api_name": "base64.b64encode", "line_number": 102, "usage_type": "call" } ]
38629844881
import boto3 import logging from boto3.dynamodb.conditions import Attr, Key dynamodb = boto3.resource('dynamodb') pifTable = dynamodb.Table('PIFs') def save_pif(pif_obj): logging.info('Storing PIF [%s] to DDB', pif_obj.postId) pifTable.put_item( Item={ 'SubmissionId': pif_obj.postId, ...
waab76/PIFBot
utils/dynamo_helper.py
dynamo_helper.py
py
1,896
python
en
code
5
github-code
18
[ { "api_name": "boto3.resource", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 27, "usage_type": "call" }, { "api_name": "boto3.dynamodb.conditions.At...
32362602177
import logging from io import BytesIO from sys import exc_info from traceback import format_exception from lxml import etree from odoo import _, api, fields, models, tools from odoo.exceptions import UserError, ValidationError logger = logging.getLogger(__name__) class ResCompany(models.Model): _inherit = "res...
OCA/intrastat-extrastat
intrastat_base/models/res_company.py
res_company.py
py
2,559
python
en
code
32
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 14, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 14, "usage_type": "name" }, { "api_name": "odoo.fields.Many...
17536820432
import sys from PyQt5.QtWidgets import (QApplication, QMessageBox, QFrame, QVBoxLayout, QToolBar, QTextEdit, QToolButton, QScrollArea) from PyQt5 import QtGui import copydata class App(QFrame): def __init__(self): super().__init__() self.setWindowTitle('Multi...
akabhi5/multiclipboard
main.py
main.py
py
2,274
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QFrame", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QIcon", "line_number": 13, "usage_type": "call" }, { "api_name": "PyQt5.QtGui", "line_number": 13, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.Q...
4820004142
""" 827. Making a Large Island You are given an nxn binary matrix grid. You are allowed to change at most one 0 to be 1. Return the size of the largest island in grid after applying this operation. An island is a 4-directionally connected group of 1 s. Example1: Input: grid = [[1,0],[0,1]] Output: 3 Explanation: Cha...
tkwang0530/LeetCode
0827.py
0827.py
py
3,484
python
en
code
4
github-code
18
[ { "api_name": "typing.List", "line_number": 42, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 95, "usage_type": "attribute" }, { "api_name": "unittest.main", "line_number": 113, "usage_type": "call" } ]
70537699880
from __main__ import app from flask import Flask, request, render_template, Response, jsonify, redirect, url_for from werkzeug.utils import secure_filename import os from math import log import time from mongoengine import connect #Clases registradas import DataBase as dbase from vuelo import Vuelo from avion import A...
Cheveniko/Proyecto-Web-Backend
avion_views.py
avion_views.py
py
2,392
python
en
code
0
github-code
18
[ { "api_name": "app.db", "line_number": 21, "usage_type": "attribute" }, { "api_name": "app.db", "line_number": 22, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 25, "usage_type": "call" }, { "api_name": "bson.json_util.dumps", "line_n...
25974737283
from __future__ import absolute_import, print_function import unittest import os.path import io import numpy as np from numpy.testing import assert_array_equal, \ assert_array_almost_equal, assert_almost_equal from .textimporter import read_csv, \ COLUMNS, UnsupportedCsvFormatException, \ Csv...
Sh4pe/pynance
pynance/textimporter_balance_test.py
textimporter_balance_test.py
py
6,401
python
en
code
2
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path", ...
12583962921
import cv2 as cv """ # Read image and output it as matrix of pixels img = cv.imread('Resources/Photos/cat.jpg') #img = cv.imread('Resources/Photos/cat_large.jpg') # Display image cv.imshow('Cat', img) # Wait for any key to be pressed cv.waitKey(0) """ # Read video # To use camera connected to computer, use 0 as arg...
Emanuele-n/surgical-copilot
tests/test.py
test.py
py
1,113
python
en
code
0
github-code
18
[ { "api_name": "cv2.VideoCapture", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 25, "usage_type": "attribute" }, { "api_name": "cv2.convertScal...
37008554901
import shelve from typing import List, Set, Union from random import choice from ctf.model import Challenge, Team, User def select_winners( challenges: List[Challenge], teams_only: bool, users: List[User] ) -> List[Challenge]: challenges_with_possible_winners = _remove_previous_winners(challenges, teams_only)...
INSRapperswil/csd-ctf-winner
ctf/winner.py
winner.py
py
2,211
python
en
code
1
github-code
18
[ { "api_name": "typing.List", "line_number": 8, "usage_type": "name" }, { "api_name": "ctf.model.Challenge", "line_number": 8, "usage_type": "name" }, { "api_name": "ctf.model.User", "line_number": 8, "usage_type": "name" }, { "api_name": "random.choice", "line...
27387904479
from jmetal.algorithm.multiobjective.nsgaiii import NSGAIII, UniformReferenceDirectionFactory from jmetal.core.quality_indicator import HyperVolume from jmetal.lab.visualization import Plot, InteractivePlot from jmetal.operator import SBXCrossover, PolynomialMutation from jmetal.util.evaluator import * from jmetal.util...
sharwinbobde/MLHD-insights
python-code/src/EA_Main.py
EA_Main.py
py
2,583
python
en
code
0
github-code
18
[ { "api_name": "src.utils.RecSysProblem.RecSysProblem", "line_number": 12, "usage_type": "call" }, { "api_name": "jmetal.algorithm.multiobjective.nsgaiii.NSGAIII", "line_number": 22, "usage_type": "call" }, { "api_name": "jmetal.algorithm.multiobjective.nsgaiii.UniformReferenceDir...
71427573480
import pandas as pd from tqdm.notebook import tqdm df = pd.read_csv('../input/jigsaw-multilingual-toxic-comment-classification/validation.csv') df = df.sample(100, random_state=12) df.head(3) df['lang'].unique() from transformers import MarianMTModel, MarianTokenizer df['content_english'] = '' for i, lang in tqdm(en...
aorursy/new-nb-3
jeabat_translate-the-comments-using-marianmt.py
jeabat_translate-the-comments-using-marianmt.py
py
1,239
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "tqdm.notebook.tqdm", "line_number": 12, "usage_type": "call" }, { "api_name": "transformers.MarianTokenizer.from_pretrained", "line_number": 28, "usage_type": "call" }, { "ap...
21100992594
import logging import os import random import tempfile from pathlib import Path from typing import List, Union import numpy import onnx import torch from onnx_model import OnnxModel from torch_onnx_export_helper import torch_onnx_export from transformers import MT5Config, T5Config from onnxruntime import InferenceSes...
microsoft/onnxruntime
onnxruntime/python/tools/transformers/models/t5/t5_encoder.py
t5_encoder.py
py
5,811
python
en
code
9,700
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 20, "usage_type": "attribute" }, { "api_name": "typing.Union", "line_number": 23, "usage_type": "name" }, { "api_name": "transformers.T5Config", ...
7239452008
#!/bin/python from urllib2 import urlopen from collections import namedtuple from subprocess import check_call, Popen, PIPE import socket import fcntl import struct import platform import getpass import os # Written by: Phantom Raspberry Blower (The PRB) # Date: 01-10-2018 # Description: Script for displaying system...
PhantomRaspberryBlower/repository.prb-entertainment-pack
script.system-info/resources/lib/systeminfo.py
systeminfo.py
py
16,312
python
en
code
7
github-code
18
[ { "api_name": "getpass.getuser", "line_number": 27, "usage_type": "call" }, { "api_name": "socket.gethostname", "line_number": 32, "usage_type": "call" }, { "api_name": "os.geteuid", "line_number": 37, "usage_type": "call" }, { "api_name": "platform.platform", ...
17470767481
import asyncio import websockets from concurrent.futures import ThreadPoolExecutor from enum import Enum from loguru import logger import json from goopy_ibcp.zmq_publisher import ZmqPublisher from goopy_certificate.certificate import Certificate, CertificateError from goopy_ibcp.ibmsg_tick import IBMsgConverterTick f...
Gootopia/goopy_ibcp
goopy_ibcp/clientportal_websockets.py
clientportal_websockets.py
py
8,317
python
en
code
0
github-code
18
[ { "api_name": "enum.Enum", "line_number": 16, "usage_type": "name" }, { "api_name": "goopy_ibcp.zmq_publisher.ZmqPublisher", "line_number": 43, "usage_type": "call" }, { "api_name": "loguru.logger.log", "line_number": 44, "usage_type": "call" }, { "api_name": "log...
557650893
from django.test import TestCase from dfirtrack_main.models import Recommendation class RecommendationModelTestCase(TestCase): """recommendation model tests""" @classmethod def setUpTestData(cls): # create object Recommendation.objects.create(recommendation_name='recommendation_1') ...
dfirtrack/dfirtrack
dfirtrack_main/tests/recommendation/test_recommendation_models.py
test_recommendation_models.py
py
2,314
python
en
code
451
github-code
18
[ { "api_name": "django.test.TestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "dfirtrack_main.models.Recommendation.objects.create", "line_number": 12, "usage_type": "call" }, { "api_name": "dfirtrack_main.models.Recommendation.objects", "line_number": 12, ...
74103285479
import datetime import pymongo client = pymongo.MongoClient("mongodb://localhost:27017/") db = client["amazon"] def add_product_detail(details): new = db["products"] ASIN = details["url"][len(details["url"])-10:len(details["url"])] try: details["date"] = datetime.datetime.utcnow() new.u...
ArticB/amazon_price_tracker
db.py
db.py
py
817
python
en
code
18
github-code
18
[ { "api_name": "pymongo.MongoClient", "line_number": 4, "usage_type": "call" }, { "api_name": "datetime.datetime.utcnow", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "attribute" } ]
15656236123
import geopandas as gpd import numpy as np import json from shapely import geometry from sklearn.cluster import KMeans import math import branca import folium import matplotlib import matplotlib.pyplot as plt import matplotlib.cm as cm from collections import defaultdict from pandas import DataFrame from matplotlib im...
meowoodie/Police-Zone-Redistricting
southfulton/plot.py
plot.py
py
4,565
python
en
code
5
github-code
18
[ { "api_name": "numpy.load", "line_number": 22, "usage_type": "call" }, { "api_name": "geopandas.read_file", "line_number": 23, "usage_type": "call" }, { "api_name": "json.load", "line_number": 31, "usage_type": "call" }, { "api_name": "designinit.beat_with_max_wor...
72998973160
# -*- coding: utf-8 -*- __author__ = 'Robert Zeng' __updated__ = '18.08.2018' # day.month.year import logging """ All objects imported here are exposed as the public API of GoogleScraper """ logging.getLogger(__name__)
robertzengcn/Marketingtool
Marketingtool/__init__.py
__init__.py
py
228
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" } ]
24701990509
#Importing packages import streamlit as st import numpy as np import os import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from keras.applications.inception_v3 import InceptionV3 import cv2 as cv from PIL import Image classes = ['Pepper__bell___healthy', 'Potato___Early_blight', ...
shreyas739/PlantWebApp
WebApp.py
WebApp.py
py
1,679
python
en
code
0
github-code
18
[ { "api_name": "streamlit.title", "line_number": 29, "usage_type": "call" }, { "api_name": "streamlit.file_uploader", "line_number": 32, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 36, "usage_type": "call" }, { "api_name": "PIL.Image", ...
3648797052
import torch import torch.nn as nn import torch.nn.functional as F #计算attention class ScaledDotProductAttention(nn.Module): ''' Scaled Dot-Product Attention ''' def __init__(self, temperature, attn_dropout=0.1): super().__init__() # 其实就是论文中的根号d_k self.temperature = temperature ...
Eason0921/transformer-torchvision
Modules.py
Modules.py
py
1,957
python
zh
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Dropout", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_num...
75128970281
import matplotlib.pyplot as plt import numpy as np fig, ax = plt.subplots(2, 1, figsize=(10, 6), tight_layout=True, facecolor=(.18, .31, .31)) x = np.arange(10) classes = ['plane', 'car', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck'] cmap = plt.get_cmap('tab10') for idx, c in e...
guguguc/programming
python/scripts/matplotlib/color.py
color.py
py
631
python
en
code
1
github-code
18
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
35570666584
from flask import Flask, render_template import csv, os def load_scores(filename): with open(filename, newline='') as csvfile: reader = csv.DictReader(csvfile) players = [] for line in reader: players.append(line) return players def process_scores(players): dict_list = ...
digao666/Plant_Vs_Zombie_Scorebord
app.py
app.py
py
1,471
python
en
code
1
github-code
18
[ { "api_name": "csv.DictReader", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 29, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 33, "usage_type": "call" }, { "api_name": "flask.render_template...
1874120578
"""Autocompletion functionality of epigraphdb entities """ from typing import Any, Callable, List import requests from elasticsearch import Elasticsearch from elasticsearch.helpers import bulk from app.settings import api_key, api_url from app.utils import api_request_headers, batch_by_n from app.utils.logging import...
MRCIEU/epigraphdb_web
backend/app/funcs/elasticsearch/autocomplete.py
autocomplete.py
py
2,077
python
en
code
2
github-code
18
[ { "api_name": "typing.List", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 17, "usage_type": "name" }, { "api_name": "elasticsearch.Elasticsearch", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Callable", ...
10873144436
import os import librosa import argparse import numpy as np from tqdm import tqdm from concurrent.futures import ThreadPoolExecutor, as_completed from scipy.io import wavfile def resample_wave(wav_in, wav_out, sample_rate): wav, _ = librosa.load(wav_in, sr=sample_rate) wav = wav / np.abs(wav).max() * 0.6 ...
PlayVoice/so-vits-svc-5.0
prepare/preprocess_a.py
preprocess_a.py
py
2,201
python
en
code
1,994
github-code
18
[ { "api_name": "librosa.load", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 13, ...
32361485831
#!/usr/bin/python3 import os import os.path import sys import subprocess import argparse import glob from subprocess import call from os.path import expanduser #from fileinput import filename ############################################################################################## ################...
FICS/android_extract
AndroidExtract.py
AndroidExtract.py
py
117,968
python
en
code
3
github-code
18
[ { "api_name": "os.path.expanduser", "line_number": 60, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 137, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 199, "usage_type": "call" }, { "api_name": "subproces...
6878634320
from __future__ import print_function, division import math import numpy as np import torch from torch import nn, Tensor import torch.nn.functional as F from typing import Optional, List from functools import partial from torch.nn.modules.loss import _Loss try: from itertools import ifilterfalse except ImportErr...
pankratozzi/ML_pet_projects
pytorch_keras_CV/pytorch_segmentation/Transformer_Unet_segmentation/dlosses.py
dlosses.py
py
36,671
python
en
code
2
github-code
18
[ { "api_name": "torch.Tensor", "line_number": 47, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 51, "usage_type": "attribute" }, { "api_name": "torch.from_numpy", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.array", ...
6540797215
import argparse import logging from concurrent import futures import grpc import info_pb2 import info_pb2_grpc from transformers import pipeline, set_seed class TextGenerationServiceServicer(info_pb2_grpc.TextGenerationServiceServicer): def __init__(self): set_seed(42) self.generator = pipeline("...
cccntu/my-line-bot
grpc-transformer/server.py
server.py
py
1,262
python
en
code
1
github-code
18
[ { "api_name": "info_pb2_grpc.TextGenerationServiceServicer", "line_number": 11, "usage_type": "attribute" }, { "api_name": "transformers.set_seed", "line_number": 13, "usage_type": "call" }, { "api_name": "transformers.pipeline", "line_number": 14, "usage_type": "call" ...
71831059561
import telegramModule import os import sys import time from datetime import date from datetime import timedelta import sqlite3 import hiworks # 환경설정 파일 읽기. exefilePath = os.path.dirname(sys.argv[0]) dbFile = exefilePath+'/holyday.db' # 텔래그램 아이디를 가지고 오자. notiGroupTelegramId = os.environ.get("TELEGRAM_GROUP_ID_OF_ADM...
hansu35/hiworks_parser_for_me
getVacation.py
getVacation.py
py
4,590
python
ko
code
0
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line...
28428808141
from typing import List class QAPair: def __init__(self, task: str): self.task = task def from_row(self, row): self.gif_name: str = row.gif_name self.question: str = row.question.lower() if self.task in ['action', 'trans']: self.answers: List[str] = [ ...
SunDoge/L-GCN
dataset/qa_pair.py
qa_pair.py
py
489
python
en
code
24
github-code
18
[ { "api_name": "typing.List", "line_number": 14, "usage_type": "name" } ]
15164931833
import collections import os # for testing if configs are valid paths. from tinydb import TinyDB, Query from tinydb.operations import set import consoleprint as console from webconfig import WebConfig class Singleton(type): _instances = {} def __call__(cls, *args, **kwargs): if cls not in cls._insta...
Jorricks/unrar-angel
configer.py
configer.py
py
16,194
python
en
code
0
github-code
18
[ { "api_name": "os.path.expanduser", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
8988344921
import re import time from addressnet.predict import predict import pandas as pd from collections import Counter from dbhepler.mysqlhelper import DBPipeline from apscheduler.schedulers.blocking import BlockingScheduler from excel_re import read_excel import os import glob import setting as setting total_path = glob...
ADGuys/address-net
predict_shh.py
predict_shh.py
py
11,434
python
en
code
0
github-code
18
[ { "api_name": "glob.glob", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pandas.read_excel", "line_num...
20325497702
"""Initial setup Revision ID: 1ad4d4de5fb9 Revises: Create Date: 2020-08-13 11:06:17.871892 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '1ad4d4de5fb9' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
simonhyslop/ridetime
migrations/versions/1ad4d4de5fb9_initial_setup.py
1ad4d4de5fb9_initial_setup.py
py
1,855
python
en
code
0
github-code
18
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
36367880288
from aocd.models import Puzzle import numpy as np from collections import Counter DAY = 3 YEAR = 2021 def main(): puzzle = Puzzle(year=YEAR, day=DAY) puzzle.answer_a = solve_a(puzzle.input_data) puzzle.answer_b = solve_b(puzzle.input_data) def parse_report(raw_input): return np.array([list(row) fo...
MDornacher/AdventOfCodeSolutions
aocs/aoc_2021/day03.py
day03.py
py
2,607
python
en
code
1
github-code
18
[ { "api_name": "aocd.models.Puzzle", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.array", ...
37643919528
import random import shutil from collections import defaultdict from itertools import chain from pathlib import Path from typing import Set, Tuple, List, Dict import Levenshtein from tqdm import tqdm from paraphone.tasks.dictionaries import DictionaryCSV from paraphone.tasks.filters.base import FilteringTaskMixin, Ca...
MarvinLvn/paraphone
paraphone/tasks/filters/simple.py
simple.py
py
7,411
python
en
code
0
github-code
18
[ { "api_name": "paraphone.tasks.filters.base.FilteringTaskMixin", "line_number": 20, "usage_type": "name" }, { "api_name": "paraphone.workspace.Workspace", "line_number": 30, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 31, "usage_type": "call" },...
14579558250
from typing import List from typing import Tuple import chainer import chainer.functions as F import chainer.links as L from chainer import Parameter from chainer import Variable import numpy as np from cnmt.misc.constants import EOS from cnmt.misc.constants import PAD from cnmt.misc.typing import ndarray from cnmt.m...
nakario/cnmt
cnmt/models/decoder.py
decoder.py
py
6,445
python
en
code
0
github-code
18
[ { "api_name": "chainer.Chain", "line_number": 18, "usage_type": "attribute" }, { "api_name": "chainer.links.EmbedID", "line_number": 31, "usage_type": "call" }, { "api_name": "chainer.links", "line_number": 31, "usage_type": "name" }, { "api_name": "chainer.links....
16153845777
from random import randint # Plotly from plotly import offline # recommended starting point import plotly.express as px # in-depth access point import plotly.graph_objects as pgo class Die: """A single die""" def __init__(self, sides:int = 6) -> None: """Initialise a new die""" self.sides =...
Thomt0m/Data_Visualisation_Python
plotly_die_rolling.py
plotly_die_rolling.py
py
2,064
python
en
code
0
github-code
18
[ { "api_name": "random.randint", "line_number": 22, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 27, "usage_type": "call" }, { "api_name": "plotly.graph_objects.Figure", "line_number": 86, "usage_type": "call" }, { "api_name": "plotly.grap...
40320391521
import requests # used for sending requests to the API import json # used for manipulating JSON data import pprint # used for formatting the output of JSON objects received in API responses import os import sys base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) sys.path.insert(0, base_pa...
acronis/acronis-cyber-platform-python-examples
authorization/issue_access_token.py
issue_access_token.py
py
1,085
python
en
code
4
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_nu...
74646082278
import glob import http.server import io import logging import os import pathlib import socketserver import shutil from datetime import datetime from PIL import Image, ImageFont, ImageDraw from pilapse.ip_finder import get_local_ip PATH = '.' logger = logging.getLogger('server') class H(http.server.BaseHTTPRequestHa...
yix/pilapse
pilapse/server.py
server.py
py
2,719
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "http.server.server", "line_number": 17, "usage_type": "attribute" }, { "api_name": "http.server", "line_number": 17, "usage_type": "name" }, { "api_name": "pathlib.Path", ...
41568150710
from selenium import webdriver import time import os #указываем какой и откуда брать файл current_dir = os.path.abspath(os.path.dirname(__file__)) file_name = "test.txt" file_path = os.path.join(current_dir, file_name) try: link = "http://suninjuly.github.io/file_input.html" browser = webdriver.Chrome() ...
axectly/qa
tests/lesson2.2-8.py
lesson2.2-8.py
py
1,050
python
ru
code
0
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
86597275780
import requests from bs4 import BeautifulSoup import csv driving_side_url = 'https://en.wikipedia.org/wiki/Left-_and_right-hand_traffic' html_text = requests.get(driving_side_url).text soup = BeautifulSoup(html_text, 'html.parser') tables = soup.find_all('table') table = tables[1] table_body = table.find('tbody') da...
ajoneshs/anki
geoguessr/driving_side/exploring_wiki.py
exploring_wiki.py
py
922
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 23, "usage_type": "call" } ]
36100548093
import tempfile import io from colorama import Back from flask import Flask from flask import request, render_template, url_for, jsonify, send_file from pytube import YouTube from pytube.exceptions import RegexMatchError, VideoUnavailable import iuliia app = Flask(__name__) @app.route("/", methods=["GET"]) def inde...
Sharker5854/Youtube-downloader-online
app.py
app.py
py
2,181
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.url_for", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.url_for", "...
31148274310
from django.contrib import admin from django.urls import path, include from django.conf import settings from django.conf.urls.static import static from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, TokenVerifyView, ) urlpatterns = [ path('admin/', admin.site.urls), ...
iamenochchirima/ModernMinds
backend/modernminds/urls.py
urls.py
py
941
python
en
code
1
github-code
18
[ { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 12, "usage_type": "name" }, { "api_name": "...
39679391514
"""Contains PyTorch Lightning LightningModule class for multimodal contrastive learning.""" import torch from torch import nn, Tensor from pytorch_lightning import LightningModule from simclr.modules import NT_Xent, LARS class MultimodalLearning(LightningModule): def __init__( self, args, ...
klean2050/VCMR
vcmr/trainers/multimodal_learning.py
multimodal_learning.py
py
4,587
python
en
code
6
github-code
18
[ { "api_name": "pytorch_lightning.LightningModule", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "torch...
29583732738
from typing import List class Solution: def solveNQueens(self, n: int) -> List[List[str]]: board = [['.'] * n for _ in range(n)] self.n = n self.result = [] self.col = [False] * n self.diag, self.codiag = set(), set() self.backtrack(board, 0) return s...
HALF-MAN/lt
python/51. N-Queens.py
51. N-Queens.py
py
1,093
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 3, "usage_type": "name" } ]
39888877779
#!/usr/bin/env python # coding: utf-8 import os import time import argparse import numpy as np import logging import torch from torchvision import models from torchvision import transforms from PIL import Image import tensorrt as trt import engine as eng from onnx import ModelProto import pycuda.driver as cuda impo...
ksriyudthsak/jetson_nano_study
tensorrt_performance_comparision/compare_tensorrt_native.py
compare_tensorrt_native.py
py
10,686
python
en
code
1
github-code
18
[ { "api_name": "tf2onnx.convert.from_keras", "line_number": 28, "usage_type": "call" }, { "api_name": "tf2onnx.convert", "line_number": 28, "usage_type": "attribute" }, { "api_name": "onnx.save", "line_number": 29, "usage_type": "call" }, { "api_name": "torchvision...
34687033792
import requests def handle_no_ban(): print('No bans detected') def handle_ban(body_json): ban_count = len(body_json['bans']) can_appeal = body_json['canAppeal'] ban_info = body_json['bans'] print('Ban count: ' + str(ban_count)) print('Can appeal: ' + str(can_appeal)) print('Ban info:...
superjke/check_ban
main.py
main.py
py
809
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 20, "usage_type": "call" } ]
19652179940
import numpy as np import os import cv2 import time import mediapipe as mp savePath = './face_recognition/FaceDetected' def collate_fn(x): return x[0] cap = cv2.VideoCapture(0) # Ensure video file is opened if not cap.isOpened(): print("Error opening video file") exit() mp_face_mesh = mp.solutions.f...
vinhdv-dgh/RepoFaceAngleOfVinh
index.py
index.py
py
8,837
python
en
code
0
github-code
18
[ { "api_name": "cv2.VideoCapture", "line_number": 12, "usage_type": "call" }, { "api_name": "mediapipe.solutions", "line_number": 21, "usage_type": "attribute" }, { "api_name": "mediapipe.solutions", "line_number": 24, "usage_type": "attribute" }, { "api_name": "cv...
70406614121
import docx file = docx.Document() # 添加段落 file.add_paragraph('Hello World', 'Title') # add_paragraph 方法可以用于写入一段文段,第一个参数接受写入的内容,第二段参数接受样式。返回的是 Paragraph 对象 para_obj1 = file.add_paragraph('This is a second paragraph.') para_obj2 = file.add_paragraph('This is a yet another paragraph.') para_obj1.add_run("This text is ...
RyanLin1995/python
Python_automation/13_PDF和Word文档/02_Word文档/03_写入Word文档.py
03_写入Word文档.py
py
1,309
python
zh
code
0
github-code
18
[ { "api_name": "docx.Document", "line_number": 3, "usage_type": "call" }, { "api_name": "docx.enum", "line_number": 23, "usage_type": "attribute" }, { "api_name": "docx.enum", "line_number": 27, "usage_type": "attribute" } ]
17454167493
import cv2 as cv import numpy as np import matplotlib.pyplot as plt import os from stockfish import Stockfish stockfish = Stockfish(r'C:/Users/15193/OneDrive/PYTHON/ChessDetect/SF/stockfish-11-win/stockfish-11-win/Windows/stockfish_20011801_x64.exe') # FLANN PARAMS # FLANN_INDEX_KDTREE = 0 # index_params ...
RowanH6/ChessDetect
src/chessdet.py
chessdet.py
py
4,842
python
en
code
0
github-code
18
[ { "api_name": "stockfish.Stockfish", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "...
7108080655
import requests from async_helper import Async async def get_homepages(): quora_future = Async.run_in_executor(None, requests.get, 'http://www.quora.com') reddit_future = Async.run_in_executor(None, requests.get, 'http://www.reddit.com') quora_response = await quora_future reddit_response = await redd...
tools4origins/py-simple-async
example.py
example.py
py
607
python
en
code
0
github-code
18
[ { "api_name": "async_helper.Async.run_in_executor", "line_number": 6, "usage_type": "call" }, { "api_name": "async_helper.Async", "line_number": 6, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 6, "usage_type": "attribute" }, { "api_name": "...
11500406635
import argparse import os import sys import kernelci from kernelci import print_color, shell_cmd def add_date_commit(path, msg, fname): with open(os.path.join(path, fname), 'w') as f: f.write(msg) shell_cmd(""" cd {path} git add {fname} git commit --author='"kernelci.org bot" <bot@kernelci.org>' -am ...
kernelci/kernelci-deploy
kernel.py
kernel.py
py
3,063
python
en
code
4
github-code
18
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "kernelci.shell_cmd", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line...
20898053521
#!/usr/bin/python #coding=utf8 import sys import configparser, hashlib, urllib, json def getBTCTicker(): response = urllib.request.urlopen('https://www.okcoin.com/api/ticker.do') #print(response.status) data = response.read().decode('utf-8') jsondata = json.loads(data) return jsondata def getLTCT...
septem776/OKCAuto
OKCAuto/okc.py
okc.py
py
7,812
python
en
code
0
github-code
18
[ { "api_name": "urllib.request.urlopen", "line_number": 8, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 8, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.request.ur...
23618899668
import yfinance as yf import matplotlib.pyplot as plt import numpy as np import pandas as pd from statsmodels.tsa.stattools import adfuller from arch.unitroot import PhillipsPerron from statsmodels.regression.linear_model import OLS import statsmodels.api as sm acoes = ["PETR4.SA", "TIMS3.SA"] start = "2023-01-01" en...
stefaniomarques/masterderivativos
pairsTradingtest.py
pairsTradingtest.py
py
2,021
python
pt
code
0
github-code
18
[ { "api_name": "yfinance.download", "line_number": 15, "usage_type": "call" }, { "api_name": "arch.unitroot.PhillipsPerron", "line_number": 29, "usage_type": "call" }, { "api_name": "arch.unitroot.PhillipsPerron", "line_number": 33, "usage_type": "call" }, { "api_n...
27226109046
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import json import copy # replace path below with a path to aaa_dgalPy sys.path.append('/Users/Mumtaz/Downloads/Carbon-Footprint-DGS') sys.path.append(r'/lib') import lib.dgalPy as dgal import utilization_points dgal.startDebug() def optimizeUtilit...
nikitapatil3/CarbonFootPrintDecisionGuidanceSystem
solution/optPointsUsage.py
optPointsUsage.py
py
920
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
32978854273
from rest_framework import generics, status from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated from booking_manager_api.serializers import BookingScheduleSerializer from intel_api.serializers.accounts_serializers import IntelUserProfileRequestSerializer from intel_api.m...
mutemip/testing-project
booking_manager_api/views/booking_schedule.py
booking_schedule.py
py
9,615
python
en
code
0
github-code
18
[ { "api_name": "intel_api.views.authentication.GetRequestAuthenticationBase", "line_number": 15, "usage_type": "name" }, { "api_name": "rest_framework.views.APIView", "line_number": 15, "usage_type": "name" }, { "api_name": "booking_manager_api.serializers.BookingScheduleSerialize...
3176814951
import os import sys import random import math import re import time import numpy as np import tensorflow as tf import matplotlib import matplotlib.pyplot as plt import matplotlib.patches as patches from tqdm import tqdm # Root directory of the project ROOT_DIR = os.path.abspath("../../") # Import Mask RCNN sys.path....
IceTharu/masters_thesis
code_thinlinc/inference.py
inference.py
py
4,062
python
en
code
0
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.path", "line_num...
2253703796
import logging import os import re import sys import xml import csv import subprocess import nltk sys.path.append("lib") import pymongo from BeautifulSoup import BeautifulSoup logging.basicConfig(level=logging.DEBUG, format="%(levelname)-8s %(message)s") mongo_conn = pymongo.Connection('localhost', 27017) db = mong...
typecode/wikileaks
process.py
process.py
py
4,334
python
en
code
19
github-code
18
[ { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.DEBUG", ...
30492320588
from PyQt6 import QtCore, QtGui, QtWidgets progress_bar_style = """ QSlider::groove:horizontal { background: rgba(0, 0, 0, 0); height: 10px; border-radius: 5px; } QSlider::sub-page:horizontal { background: qlineargradient(spread:pad, x1:0.463054, y1:0.0965909, x2:0.487685, y2:0.813, stop:0 rgba(40, 113, 250, 150), st...
NearlyQ/my_apps
music-player/design.py
design.py
py
12,756
python
en
code
0
github-code
18
[ { "api_name": "PyQt6.QtWidgets.QWidget", "line_number": 129, "usage_type": "call" }, { "api_name": "PyQt6.QtWidgets", "line_number": 129, "usage_type": "name" }, { "api_name": "PyQt6.QtWidgets.QLabel", "line_number": 131, "usage_type": "call" }, { "api_name": "PyQ...
3351942194
from flask import Flask, render_template, request, send_file import openpyxl app = Flask(__name__, static_folder='static', static_url_path='') #main loading code @app.route('/') def entering(): kosha_listdata = open('x.txt', 'r', encoding='utf-8') koshalist = kosha_listdata.readlines() guideList = [] ...
selectadjust/pehelper
app.py
app.py
py
6,112
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 20, "usage_type": "attribute" }, { "api_name": "flask.requ...
27337093071
# Author: Mainak Jas <mainak.jas@telecom-paristech.fr> # Mikolaj Magnuski <mmagnuski@swps.edu.pl> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # # License: BSD (3-clause) from copy import deepcopy from distutils.version import LooseVersion import os.path as op import shutil from unittest import Sk...
soheilbr82/BluegrassWorkingMemory
Python_Engine/Lib/site-packages/mne/io/eeglab/tests/test_eeglab.py
test_eeglab.py
py
16,525
python
en
code
5
github-code
18
[ { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "name" }, { "api_name": "mne.datasets.testing.data_path", "line_number": 27, "usage_type": "call" }, { "api_name": "mne.datasets.test...
2335985681
# Pull in our config. try: from afqueue import queue_config as config except: from afqueue.config_files import queue_config_base as config # Parse our arguments. import argparse, sys parser = argparse.ArgumentParser() parser.add_argument("--remote_ip", required=False) parser.add_argument("--remote_ip_interface...
appfirst/distributed_queue_manager
afqueue/queue_manager.py
queue_manager.py
py
6,795
python
en
code
1
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "afqueue.config_files.queue_config_base.manager_default_port", "line_number": 12, "usage_type": "attribute" }, { "api_name": "afqueue.config_files.queue_config_base", "line_number...
10054609638
from __future__ import print_function from datetime import datetime from flask_restplus import Namespace from pymongo import MongoClient import os import sys import timeit import json import re # download geo_group dictionary import urllib.request from sys import argv import argparse file_path = argv[1] location...
LucaCilibrasi/VariantHunter
backend/apis/create_database.py
create_database.py
py
25,256
python
en
code
1
github-code
18
[ { "api_name": "sys.argv", "line_number": 21, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 22, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 23, "usage_type": "name" }, { "api_name": "flask_restplus.Namespace", "line_numbe...
6285013116
from flask import Flask, render_template, request, make_response, redirect, url_for from flask import jsonify from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.sql import text import re # Mine from controllers import * f...
fdanmon/bd2-lab-demo
app/app.py
app.py
py
9,694
python
en
code
0
github-code
18
[ { "api_name": "re.compile", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 17, "usage_type": "call" }, { "api_name": "sq...
11954785294
from itertools import combinations import math def solution(n): answer = 0 s = [True] * n for i in range(2,int(math.sqrt(n)+1)): if s[i]: for j in range(i+i,n,i): s[j] = False prime = [i for i in range(2,n) if s[i]] result = list(combinations(prime,3)) for r i...
wheejoo/Programmers_code_study
03 탐색/Lv1_세 소수의 합.py
Lv1_세 소수의 합.py
py
396
python
en
code
0
github-code
18
[ { "api_name": "math.sqrt", "line_number": 6, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 11, "usage_type": "call" } ]
2318530102
from fastapi import APIRouter from src.recommend.service import getMovieByNameService, getMoviesByActorsService router = APIRouter() @router.get("/") async def root(): return {"message": "Get all recommendations"} @router.get("/byMovie/") async def getMovieByName(name: str): try: result = await getM...
sbiswas2209/recommendation-engine
src/recommend/controller.py
controller.py
py
722
python
en
code
1
github-code
18
[ { "api_name": "fastapi.APIRouter", "line_number": 5, "usage_type": "call" }, { "api_name": "src.recommend.service.getMovieByNameService", "line_number": 14, "usage_type": "call" }, { "api_name": "src.recommend.service.getMoviesByActorsService", "line_number": 22, "usage_t...
26944807599
import sys from collections import deque input = sys.stdin.readline def bfs(x,y): visited = [[0] * w for _ in range(l)] queue = deque([(x,y)]) visited[x][y] = 1 cnt = 0 while queue: x, y = queue.popleft() for i in range(4): nx = x + dx[i] ny = y ...
SeBin-Kwon/TIL
백준/Gold/2589. 보물섬/보물섬.py
보물섬.py
py
890
python
en
code
6
github-code
18
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
7808344146
import torch import torch.nn as nn class TactileNet(nn.Module): def __init__(self, in_dim, out_dim): super(TactileNet, self).__init__() self.input_size = in_dim self.output_size = out_dim self.n_filters = 512 self.lstm_layer = nn.LSTM(input_size=in_dim, hidden_size=in_dim,...
kracon7/Multi-Step-Recurrent-Q-Learning-for-Robotic-Velcro-Peeling
networks/tactile_net.py
tactile_net.py
py
1,134
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.LSTM", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line_number...
27370941259
import distutils.util import os import subprocess if subprocess.run('nvidia-smi').returncode: raise RuntimeError( 'Cannot communicate with GPU. ' 'Make sure you are using a GPU Colab runtime. ' 'Go to the Runtime menu and select Choose runtime type.') import mujoco import time import itertools imp...
myiKim/RL_studynote
mujocoGym/mujoco_example.py
mujoco_example.py
py
5,195
python
en
code
0
github-code
18
[ { "api_name": "subprocess.run", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.set_printoptions", "line_number": 21, "usage_type": "call" }, { "api_name": "mediapy.VideoWriter", "line_number": 30, "usage_type": "call" }, { "api_name": "mediapy.Vide...
70921928041
from collections import defaultdict d = defaultdict(list) d['a'].append(1) d['a'].append(2) d['a'].append(4) print(d) d = defaultdict(set) d['a'].add(1) d['a'].add(2) d['b'].add(4) print(d) # 注意, py的dict如果key不存在直接append会有异常抛出
chonlon/Small-Test-Projects
python/cookbook/1.6.2.py
1.6.2.py
py
262
python
zh
code
3
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 3, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" } ]
11684642046
import distro, math, numpy from scipy.optimize import fsolve from scipy.stats import tukeylambda def _solver(stats): (lo, hi, q1, q3, sig2) = distro.extractStats(stats, [distro.Stat.Min,distro.Stat.Max, Distro.Stat.Q1, Distro.Stat.Q3, distro.Stat.Sig2]) if abs((q3-q1)/(hi-lo)-0.5)<.05: #lamb>=1 ...
jscheiny/oepd
src/tukey_lambda.py
tukey_lambda.py
py
1,272
python
en
code
0
github-code
18
[ { "api_name": "distro.extractStats", "line_number": 6, "usage_type": "call" }, { "api_name": "distro.Stat", "line_number": 6, "usage_type": "attribute" }, { "api_name": "scipy.stats.tukeylambda.stats", "line_number": 9, "usage_type": "call" }, { "api_name": "scipy...
11311555351
# -*- coding: utf-8 -*- """ Created on Mon Mar 21 14:43:04 2022 """ import numpy as np import matplotlib.pyplot as plt import plot_config from scipy.optimize import curve_fit import os datadir = os.path.join(plot_config.data_root_dir, 'cavity_cooling') SAVE_FIGURE = False colors = plt.get_cmap('tab10') # cooling fr...
v-sivak/tf_quantum_simulator
plot_paper_figures/cavity_cooling.py
cavity_cooling.py
py
1,334
python
en
code
5
github-code
18
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "plot_config.data_root_dir", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.p...
19500975042
from typing import Dict from fsm_components.fsm_component import Edge class MooreEdge(Edge): def __init__(self, obj: any): super().__init__(obj) # if obj does not have key 'input', throw error if 'inputs' not in obj: raise Exception("Moore edge does not have inputs") ...
Arash1381-y/fsm-to-verilog
fsm_components/moore/moore_edge.py
moore_edge.py
py
364
python
en
code
0
github-code
18
[ { "api_name": "fsm_components.fsm_component.Edge", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 13, "usage_type": "name" } ]
18162705423
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created 7 Feb 2018 @author: elonbrange """ #Linear Discriminative Analysis (LDA, Fisher's discriminant analysis) # Binary class discriminant #Importing packages import numpy as np import matplotlib.pyplot as plt from numpy import linalg #Importing dataset data0 = n...
ElonB/HW-Labs
LDA/LDA.py
LDA.py
py
4,257
python
en
code
0
github-code
18
[ { "api_name": "numpy.genfromtxt", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.transpose", "...
72646925160
#!/usr/bin/python3 -u # -*- coding: utf-8 -*- __author__ = "Blurgy"; import os import numpy as np import data import nn_utils as nn import time import plot import click import warnings warnings.filterwarnings('ignore', r'.*output shape of zoom.*') warnings.filterwarnings('error', r'.*divide by zero.*') @clic...
blurgyy/kaggle
mnist/nn/conv/train.py
train.py
py
3,419
python
en
code
0
github-code
18
[ { "api_name": "warnings.filterwarnings", "line_number": 14, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 15, "usage_type": "call" }, { "api_name": "nn_utils.decay_schedule", "line_number": 33, "usage_type": "call" }, { "api_name"...
25465426036
from copy import deepcopy from functools import partial from typing import Callable, Union import hypothesis.extra.numpy as hnp import hypothesis.strategies as st import numpy as np import pytest from hypothesis import assume, given, infer, note, settings from numpy.testing import assert_array_equal import mygrad as ...
rsokl/MyGrad
tests/test_tensor_creation.py
test_tensor_creation.py
py
12,884
python
en
code
181
github-code
18
[ { "api_name": "mygrad.Tensor", "line_number": 38, "usage_type": "argument" }, { "api_name": "numpy.testing.assert_array_equal", "line_number": 40, "usage_type": "call" }, { "api_name": "mygrad.operation_base._NoValue", "line_number": 45, "usage_type": "name" }, { ...
37512203605
import os, sys, re import itertools import pickle as pkl import nltk from nltk.translate.bleu_score import SmoothingFunction ngram = 2 with open('text_for_comparison_with_dumb.pkl', 'rb') as f: text_data = pkl.load(f) models = ['original_text', 'caption_text', 'bert_text', 'bert_adv_text', 'bert_kw_adv_text', 'gpt...
claws-lab/multimodal-robustness
evaluation/self_bleu.py
self_bleu.py
py
1,691
python
en
code
10
github-code
18
[ { "api_name": "pickle.load", "line_number": 10, "usage_type": "call" }, { "api_name": "nltk.translate.bleu_score.sentence_bleu", "line_number": 29, "usage_type": "call" }, { "api_name": "nltk.translate", "line_number": 29, "usage_type": "attribute" }, { "api_name"...
4493639969
#################### import os # Obtain bot token from Discord Developer Site import discord from discord import Embed, TextChannel from discord.ext import commands, tasks from discord.ext.commands import Context from datetime import datetime import requests # PostgreSQL file import tables from tables im...
48nes/leetbot
bot.py
bot.py
py
15,436
python
en
code
3
github-code
18
[ { "api_name": "os.getenv", "line_number": 18, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 19, "usage_type": "call" }, { "api_name": "discord.Intents.default", "line_number": 24, "usage_type": "call" }, { "api_name": "discord.Intents", "li...
38635639233
""" CCC Team 42, Melbourne Thuy Ngoc Ha - 963370 Lan Zhou - 824371 Zijian Wang - 950618 Ivan Chee - 736901 Duer Wang - 824325 """ """ A python file used for making predictions on tweeters that lack food information or homeless information. Using random forest classification model for predicting food. Using ran...
eyeonechi/australian-social-media-analysis
analytics/rf_model.py
rf_model.py
py
16,020
python
en
code
2
github-code
18
[ { "api_name": "httplib2.Http", "line_number": 68, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 70, "usage_type": "call" }, { "api_name": "couch.Couch", "line_number": 76, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": ...
11178287275
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('organizer', '0001_initial'), ] operations = [ migrations.CreateModel( ...
IvanCherepov/Organizer
mysite/organizer/migrations/0002_auto_20151028_0548.py
0002_auto_20151028_0548.py
py
2,172
python
en
code
0
github-code
18
[ { "api_name": "django.db.migrations.Migration", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 16, "usage_type": "call" }, ...
23034335942
from flask import Flask, flash, request, jsonify, render_template, redirect, url_for, g, session, send_from_directory, abort from flask_cors import CORS from flask_api import status from datetime import date, datetime, timedelta from calendar import monthrange from dateutil.parser import parse import pytz import os imp...
JunMA1997/CSYE7220_MidTerm
server/main.py
main.py
py
3,149
python
en
code
0
github-code
18
[ { "api_name": "os.path.exists", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 27, "usage_type": "call" }, { "api_name": "os.environ.get", "line_numb...
5125009789
import sys import torch import torch.nn as nn import torch.optim as optim import util from util import stderr_print from confusion_matrix import ConfusionMatrix from timer import Timer, timestamp class CustomDropout(nn.Module): def __init__(self, unk_value=2, p=0.5): super(CustomDropout, self).__init__(...
byewokko/blanks-tagger
train.py
train.py
py
9,252
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 25, "usage_type": "attribute" }, { "api_name": "torch.nn", "li...
31533729878
""" Point of this script is to submit a ton of batch jobs for the healpixels. After all, why use only one computer when you have several thousand at your fingertips? Note that you should first run with --test command, which will run one healpix iteration after making the dataset. This lets you determine the amount of ...
paulinevielzeuf/wizard
examples/refREDMAPPERSV_unkIM3SHAPE/batch_paircounts.py
batch_paircounts.py
py
8,803
python
en
code
0
github-code
18
[ { "api_name": "wizard.read_config", "line_number": 18, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 53, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 82, "usage_type": "call" }, { "api_name": "wi...
3304703106
__author__ = 'dkoldyaev' import os from django import template from django.template.defaultfilters import stringfilter from PIL import Image from basis.templatetags.image_helper import ImageHelper register = template.Library() @register.filter(name='news_image_fit') @stringfilter def news_image_fit(image_path): ...
dkoldyaev/basis.ru
news/templatetags/news_images.py
news_images.py
py
1,426
python
en
code
0
github-code
18
[ { "api_name": "django.template.Library", "line_number": 11, "usage_type": "call" }, { "api_name": "django.template", "line_number": 11, "usage_type": "name" }, { "api_name": "django.conf.settings.MEDIA_URL", "line_number": 21, "usage_type": "attribute" }, { "api_n...
28335228326
""" This code validates the performance of ResNet after L-OBS prunning """ import torch import torch.backends.cudnn as cudnn import torchvision.datasets as datasets import torchvision.transforms as transforms from models.resnet import resnet18 from utils import validate, adjust_mean_var import numpy as np import ...
csyhhu/L-OBS
PyTorch/ImageNet/validate-ResNet.py
validate-ResNet.py
py
3,446
python
en
code
71
github-code
18
[ { "api_name": "torch.cuda.is_available", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", ...
12897240314
import os import numpy as np np.random.seed(7) import matplotlib.pyplot as plt from tslearn.clustering import TimeSeriesKMeans filepath = '../Demo/ECEMasterProject/models/KM/KM1.h5' km=TimeSeriesKMeans.from_hdf5(filepath) n = 96 data = np.random.uniform(low = -6, high= 3, size=(n,1)) data_class = km.predict(data)...
Natemen96/ECEMasterProject
RL/gen_data_helper/_gen_solarhousingdata.py
_gen_solarhousingdata.py
py
744
python
en
code
2
github-code
18
[ { "api_name": "numpy.random.seed", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 3, "usage_type": "attribute" }, { "api_name": "tslearn.clustering.TimeSeriesKMeans.from_hdf5", "line_number": 11, "usage_type": "call" }, { "a...
14951523381
import enum as _enum import typing as _typing from SystemTestSpy import ( _getLib, ) # Imported for type information from NotepadLib import NotepadLib as _NotepadLib from ChromeLib import ChromeLib as _ChromeLib from AssertsLib import AssertsLib as _AssertsLib import NvdaLib as _NvdaLib from robot.libraries.BuiltIn ...
nvaccess/nvda
tests/system/robot/symbolPronunciationTests.py
symbolPronunciationTests.py
py
22,865
python
en
code
1,802
github-code
18
[ { "api_name": "robot.libraries.BuiltIn.BuiltIn", "line_number": 15, "usage_type": "name" }, { "api_name": "NotepadLib.NotepadLib", "line_number": 16, "usage_type": "name" }, { "api_name": "SystemTestSpy._getLib", "line_number": 16, "usage_type": "call" }, { "api_n...
34986473910
from django.shortcuts import render from django.http.response import JsonResponse from .models import Order,Product,Order_Product,WaterUser import json # Create your views here. def order_list(request): if request.method == 'POST': json_str = ((request.body).decode('utf-8')) submitdata = json.loads(json_str) ...
xiaomazaitu/xinyuanshuiba
water/views.py
views.py
py
3,490
python
en
code
0
github-code
18
[ { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "models.WaterUser.objects.get", "line_number": 14, "usage_type": "call" }, { "api_name": "models.WaterUser.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": ...
73973890281
import time import requests import pickle import yaml import mysql.connector from condition import Condition from notification_method import NOTIFICATION_METHOD from condition_model import Condition_model from user_model import User_model # marketdata_host = '127.0.0.1' marketdata_host = 'sig-gen-api-balancer-10853491...
benWindsorCode/signalGenerator
signal_generator/condition/poller.py
poller.py
py
5,244
python
en
code
0
github-code
18
[ { "api_name": "yaml.load", "line_number": 16, "usage_type": "call" }, { "api_name": "yaml.FullLoader", "line_number": 16, "usage_type": "attribute" }, { "api_name": "condition.Condition", "line_number": 25, "usage_type": "call" }, { "api_name": "requests.get", ...
36559136676
#ND1 Algorithm is very simple #Pick a node choose two neighbours of that node at random and add an edge between them #If the node has only one neighbour add a edge to another random node #With probability p remove all edges from a randomly selected node (delete it) #Add a new node with a single edge to a rando...
JohnC3/merge-model
ND1 and ND2.py
ND1 and ND2.py
py
3,244
python
en
code
0
github-code
18
[ { "api_name": "random.sample", "line_number": 28, "usage_type": "call" }, { "api_name": "networkx.neighbors", "line_number": 31, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 33, "usage_type": "call" }, { "api_name": "random.sample", "l...
7387141083
from __future__ import print_function, division import pickle import torch import torch.nn as nn from maskrcnn_benchmark.layers import ROIAlign import torch.nn.functional as F import torchvision.models as models from torch.nn.utils import weight_norm from utils import obj_edge_vectors,layer_init,get_box_info,get_box_pa...
jqiuqiu/NEGR
model.py
model.py
py
18,724
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.utils.weight_norm", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn.Lin...
38032403867
## Here is the ftp+plot.py code from Lecutre 0 import numpy as np from matplotlib import pyplot as plt ftp = np.loadtxt('ftpcol.txt', dtype=int) print(ftp[0,0]) print(ftp[1,0]) print(ftp[:,0]) print(ftp[:,1]) time_s = ftp[:,0] speed_mph = ftp[:,1] plt.plot(time_s,speed_mph) plt.xlabel("Time (sec)") plt.ylabel("Speed ...
WMU-Electric-Vehicles-Class/Team1-AC-DCs
ftp_plot.py
ftp_plot.py
py
650
python
en
code
1
github-code
18
[ { "api_name": "numpy.loadtxt", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
4431433643
from django.contrib import admin from .models import Packages, CustomPackage @admin.register(Packages) class PackagesAdmin(admin.ModelAdmin): list_display = ('package_name', 'equipment', 'duration', 'sensory_items_included', 'sensory_items_type', 'image_url', ...
davidcalikes/sensical.ie
packages/admin.py
admin.py
py
829
python
en
code
3
github-code
18
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 5, "usage_type": "call" }, { ...
2408376175
''' 신라대학교 202395016 컴퓨터공학부 박수연 ''' import matplotlib.pyplot as plt # as 뒤에 이름은 별명, 내가 쓰고자 할 이름을 간략하게 적음 years = [1950, 1960, 1970, 1980, 1990, 2000, 2010] gdp = [67.0, 87.0, 257.0, 1686.0, 6505, 11865.3, 22103.3] # 국민소득 plt.plot(years, gdp, color='green', marker='o', linestyle='solid') plt.t...
Susucorn/SW_review
0925/03_시각화.PY
03_시각화.PY
py
599
python
ko
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 12, "usage_type": "call" }, { "api_name": "matp...
12735907661
from sklearn.datasets import fetch_20newsgroups from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.naive_bayes import MultinomialNB from sklearn import metrics from . import Benchmark categories = [ 'alt.atheism', 'talk.religion.misc', 'comp.graphics', 'sci.space' ] newsgroups_train = f...
GabrielMajeri/adaptive-profiler
benchmark/ml.py
ml.py
py
1,917
python
en
code
0
github-code
18
[ { "api_name": "sklearn.datasets.fetch_20newsgroups", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.datasets.fetch_20newsgroups", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 18, ...
10464202566
from django.shortcuts import render # import onnx, onnxruntime, pathlib, json # from keras.preprocessing import image # import numpy as np from .forms import Form def index(request): if request.method == 'POST': form = Form(request.POST, request.FILES) if form.is_valid(): form.save() ...
solokhovir/DeepLearning_DZ1
web/views.py
views.py
py
529
python
en
code
0
github-code
18
[ { "api_name": "forms.Form", "line_number": 10, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "forms.Form", "line_number": 16, "usage_type": "call" }, { "api_name": "django.shortcuts.render...
42693367042
import pygame import random # Initialize Pygame pygame.init() # Set up the display SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) pygame.display.set_caption("Snake Game") # Set up the colors BLACK = (0, 0, 0) WHITE = (255, 255, 255) GREEN = (0, 255, 0) # Set u...
Bilalkhan1071/MainRepo
snakeGame.py
snakeGame.py
py
4,190
python
en
code
0
github-code
18
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.display...