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
1533621629
import cv2 import numpy as np def calcular_tamano_objeto(imagen, tamano_real_objeto_ancho, tamano_real_objeto_alto): # Leer la imagen y convertirla a escala de grises img = cv2.imread(imagen) gris = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # Aplicar umbralización para obtener una imagen binaria _, bi...
moises-coronel/Procesamiento_imagenes
tarea#4/tarea4.py
tarea4.py
py
2,953
python
es
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.threshold", "lin...
3655291809
from bs4 import BeautifulSoup as bs import json import logging import os import pandas as pd import re import requests def init_vars(): global headers, session, logger, df headers = { 'Host': 'www.amazon.com', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKi...
MohitGoyal19/Crawlers
Amazon/Books/books_spider.py
books_spider.py
py
11,292
python
en
code
1
github-code
6
[ { "api_name": "requests.Session", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 45, "usage_type": "call" }, { "api_name": "logging.getLogg...
13610831235
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import taggit.managers class Migration(migrations.Migration): dependencies = [ ('learn', '0004_auto_20141215_1723'), ] operations = [ migrations.AlterField( model_name='a...
klebercode/sofia
sofia/apps/learn/migrations/0005_auto_20141215_1730.py
0005_auto_20141215_1730.py
py
889
python
en
code
0
github-code
6
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 15, "usage_type": "call" }, {...
75003681147
import threading from tornado import ioloop, web import websocket import os import json class WebSocketListener: __socket = None def setSocket(self, socket): self.__socket = socket def send(self, message): self.__socket.send(json.dumps(message)) class CollectionListener(WebSocketListener): __collection = N...
djungowski/mpi3
alarm/threadweb.py
threadweb.py
py
1,848
python
en
code
1
github-code
6
[ { "api_name": "json.dumps", "line_number": 14, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 29, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 37, "usage_type": "call" }, { "api_name": "threading....
29184935984
import argparse from mysql import connector import db_admin.db_connect as conn def parse_arg(): parser = argparse.ArgumentParser(description='Films analytics program') parser.add_argument('-N', default=3, type=int, help='Number of max rating films') parser.add_argument('-genres', default='', type=str, hel...
zbokostya/coherent-training
Task3/main.py
main.py
py
1,501
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "db_admin.db_connect.Database", "line_number": 25, "usage_type": "call" }, { "api_name": "db_admin.db_connect", "line_number": 25, "usage_type": "name" }, { "api_name"...
28847426951
#!/usr/bin/env python import random import numpy as np import cv2 from .augmentation import augment_seg, custom_augment_seg from .data_loader import \ get_pairs_from_paths, DATA_LOADER_SEED, class_colors, DataLoaderError random.seed(DATA_LOADER_SEED) def _get_colored_segmentation_image(img, seg, colors, ...
divamgupta/image-segmentation-keras
keras_segmentation/data_utils/visualize_dataset.py
visualize_dataset.py
py
4,062
python
en
code
2,774
github-code
6
[ { "api_name": "random.seed", "line_number": 12, "usage_type": "call" }, { "api_name": "data_loader.DATA_LOADER_SEED", "line_number": 12, "usage_type": "argument" }, { "api_name": "numpy.zeros_like", "line_number": 18, "usage_type": "call" }, { "api_name": "augment...
38515053033
from typing import Dict, Any, List, Tuple, Union, cast import torch from .pipeline import SentimentPipeline, MetricTracker from pytorch_lightning import Trainer, seed_everything from torch.utils.data import DataLoader import numpy as np from transformers.modeling_outputs import SequenceClassifierOutput from torch impor...
crypto-sentiment/crypto_sentiment_notebooks
notebooks/active_learning_utils/train.py
train.py
py
2,530
python
en
code
1
github-code
6
[ { "api_name": "pipeline.SentimentPipeline", "line_number": 11, "usage_type": "name" }, { "api_name": "pipeline.SentimentPipeline", "line_number": 21, "usage_type": "name" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 22, "usage_type": "name" }, { ...
15776437300
from json import loads from requests import get from lib.python.helpers import check_internet from lib.python.youtube.youtube_datastructures import YoutubePlaylist, YoutubeVideo YOUTUBE_API_PLAYLIST_URI = 'https://www.googleapis.com/youtube/v3/{}' class YoutubePlaylistAPI: type = 'playlistItems' def __ini...
zsoman/youtube-downloader
lib/python/youtube/youtube_api.py
youtube_api.py
py
2,572
python
en
code
0
github-code
6
[ { "api_name": "lib.python.helpers.check_internet", "line_number": 22, "usage_type": "call" }, { "api_name": "lib.python.youtube.youtube_datastructures.YoutubeVideo", "line_number": 49, "usage_type": "call" }, { "api_name": "lib.python.youtube.youtube_datastructures.YoutubePlaylis...
32096470883
from tkinter import * from tkinter import ttk from PIL import Image, ImageTk import numpy as np import os from os.path import isfile, join from threading import Thread from userHandler import UserData import mysql.connector conn = mysql.connector.connect(user='root', password='', host='localhost', database=...
Brindha-m/Elite-Chatbot
main.py
main.py
py
9,848
python
en
code
0
github-code
6
[ { "api_name": "mysql.connector.connector.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 11, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 11, "usage_type": "name" }, { "...
39348178196
import argparse import logging import os import re import sys from typing import cast, Dict, List from rebasehelper import VERSION from rebasehelper.options import OPTIONS, traverse_options from rebasehelper.constants import PROGRAM_DESCRIPTION, NEW_ISSUE_LINK, LOGS_DIR, TRACEBACK_LOG, DEBUG_LOG from rebasehelper.appl...
rebase-helper/rebase-helper
rebasehelper/cli.py
cli.py
py
8,310
python
en
code
42
github-code
6
[ { "api_name": "rebasehelper.logger.CustomLogger", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.cast", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "rebase...
24430444264
# -*- coding: utf-8 -*- """Driver for the TSL2561 digital luminosity (light) sensors. Pick one up at http://www.adafruit.com/products/439 Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Code ported from Adafr...
sim0nx/tsl2561
tsl2561/tsl2561.py
tsl2561.py
py
11,223
python
en
code
37
github-code
6
[ { "api_name": "typing.Optional", "line_number": 45, "usage_type": "attribute" }, { "api_name": "Adafruit_GPIO.I2C.get_i2c_device", "line_number": 58, "usage_type": "call" }, { "api_name": "Adafruit_GPIO.I2C", "line_number": 58, "usage_type": "name" }, { "api_name"...
39196978744
import itertools import typing import numpy as np import gym import torch from .common import returns_from class Reinforce(torch.nn.Module): def __init__(self, env): super(Reinforce, self).__init__() self.env = env observation_size = env.observation_space.shape[0] if type(env....
2ar0n/rl_fun
agents/reinforce.py
reinforce.py
py
3,381
python
en
code
0
github-code
6
[ { "api_name": "torch.nn", "line_number": 12, "usage_type": "attribute" }, { "api_name": "gym.spaces", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.nn.Linear", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
30728261570
import fileinput, sys from collections import deque, defaultdict from itertools import permutations, combinations, combinations_with_replacement sys.setrecursionlimit(10000000) dd = defaultdict(lambda: 0) dx = [0, 0, -1, 1] # NSWE dy = [-1, 1, 0, 0] # NSWE ll = [l.strip() for l in fileinput.input()] N = len(ll[0])...
mdaw323/alg
adventofcode2021/3.py
3.py
py
1,363
python
en
code
0
github-code
6
[ { "api_name": "sys.setrecursionlimit", "line_number": 4, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" }, { "api_name": "fileinput.input", "line_number": 10, "usage_type": "call" } ]
26113265335
__authors__ = ["T. Vincent"] __license__ = "MIT" __date__ = "14/06/2018" import re import logging import time from collections import deque import numpy from silx.gui import qt, icons from silx.gui.colors import rgba from silx.gui.colors import Colormap from silx.math.marchingcubes import MarchingCubes from silx.ma...
silx-kit/silx
src/silx/gui/plot3d/ScalarFieldView.py
ScalarFieldView.py
py
53,248
python
en
code
106
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "silx.gui.qt.QObject", "line_number": 27, "usage_type": "attribute" }, { "api_name": "silx.gui.qt", "line_number": 27, "usage_type": "name" }, { "api_name": "silx.gui.qt.Si...
36523129510
# -*- coding: utf-8 -*- __version__ = "3.3" __author__ = "Robert Smayda, Taylor White [taylorchasewhite.com]" import re import sys import fileinput from collections import defaultdict ### NOTES ### By using the system call (syscall) instruction, MARS provides a set of ### OS-like services...
taylorchasewhite/mips
part6/codeGen.py
codeGen.py
py
39,158
python
en
code
2
github-code
6
[ { "api_name": "sys.exit", "line_number": 504, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 686, "usage_type": "call" }, { "api_name": "record.Record", "line_number": 695, "usage_type": "call" } ]
32229932595
import os from datetime import datetime, timedelta import random start_date = datetime(2020, 9, 7) end_date = datetime(2023, 3, 5) incDay = timedelta(days=1) while (start_date <= end_date): coQuantity = random.randint(1, 17) for i in range(coQuantity): os.system(f"touch ./files/C{start_date.strftime('...
Faekrrr/git-giga
main.py
main.py
py
850
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 8, "usage_type": "call" }, { "api_name": "random.randint", ...
70926653628
#!/usr/bin/env python # coding: utf-8 import os import json import time import base64 import urllib3 import socket import datetime import certifi ENDPOINT = "https://logs.logdna.com/logs/ingest" MAX_CONTENT_BYTES = 1e5 MAX_READ = 500000 def short(h=None): if h is None: h = socket.getfqdn() while h.e...
jettero/ldogger
ldogger/dispatch.py
dispatch.py
py
3,359
python
en
code
0
github-code
6
[ { "api_name": "socket.getfqdn", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib3.PoolManager", "line_number": 28, "usage_type": "call" }, { "api_name": "certifi.where", "line_number": 28, "usage_type": "call" }, { "api_name": "os.environ.get", ...
5961321208
# main app file from flask import Flask, render_template, request, jsonify, make_response, redirect from database import ( create_connection, set_question_for_pollid, get_question_for_pollid, set_options_for_pollid, get_options_for_pollid, inc_vote, get_votes, ) from flask_cors import CORS,...
colejagdtiger/HtNPollingApp
app.py
app.py
py
2,195
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 20, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 21, "usage_type": "call" }, { "api_name": "pusher.Pusher", "line_number": 25, "usage_type": "call" }, { "api_name": "os.getenv", "line_numbe...
21999832956
# -*- coding: utf-8 -*- """ Created on Mon Apr 10 09:47:10 2023 @author: rsunn """ import numpy as np import random import matplotlib.pyplot as plt #helper function def argmax_2darray(a): """ Returns the maximum location in a n-d array """ return np.unravel_index(a.argmax(), a.shape) ...
raduniculae123/com3001
modeltest.py
modeltest.py
py
17,483
python
en
code
0
github-code
6
[ { "api_name": "numpy.unravel_index", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.full", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 63, "usage_type": "call" }, { "api_name": "numpy.array", "line_nu...
6119703141
import logging loggers_dict = {} def create_logger(name:str): global loggers_dict if name in loggers_dict: return loggers_dict[name] else: logger = logging.getLogger(name) loggers_dict[name] = logger logger.setLevel(logging.DEBUG) handler = logging.StreamHandler()...
Geliron12/diploma
MMM-GPT-2/source/logging.py
logging.py
py
848
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.DE...
7577860681
from django.core.management.base import BaseCommand from attachments.models import Attachment, get_file_suffix, \ is_img class Command(BaseCommand): help = "update attachment's base info." def handle(self, **options): attachments = Attachment.objects.all() for o in attachments: ...
vicalloy/django-lb-attachments
attachments/management/commands/update_attachments.py
update_attachments.py
py
612
python
en
code
7
github-code
6
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 6, "usage_type": "name" }, { "api_name": "attachments.models", "line_number": 10, "usage_type": "name" }, { "api_name": "attachments.models.Attachment.objects.all", "line_number": 10, "usage_type": "c...
31484721893
import functools import logging import h5py import numpy as np import pandas as pd import torch from dcase_util.data import ProbabilityEncoder from genericpath import exists from scipy.signal import medfilt from torch.utils.data import DataLoader, Dataset from evaluation_measures import ConfusionMatrix, compute_metri...
m-koichi/ConformerSED
src/post_processing.py
post_processing.py
py
17,820
python
en
code
25
github-code
6
[ { "api_name": "scipy.signal.medfilt", "line_number": 28, "usage_type": "call" }, { "api_name": "scipy.signal.medfilt", "line_number": 32, "usage_type": "call" }, { "api_name": "scipy.signal.medfilt", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy....
39607819693
# -*- coding: utf-8 -*- from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0003_auto_load_fixtures'), ] operations = [ migrations.CreateModel( name='Copyright', fields=[ ('id', models.AutoFi...
open-oni/open-oni
core/migrations/0004_copyright_lccndatecopyright.py
0004_copyright_lccndatecopyright.py
py
1,077
python
en
code
43
github-code
6
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
378339191
#! -*- coding: utf-8 -*- # bert做language model任务,小说生成 from __future__ import print_function import glob import numpy as np from tqdm import tqdm import os, json, codecs, re import uniout from bert4keras.bert import build_bert_model from bert4keras.utils import Tokenizer, load_vocab from keras.layers import * from kera...
lixin940207/bert4keras
examples/task_language_model.py
task_language_model.py
py
8,881
python
en
code
0
github-code
6
[ { "api_name": "glob.glob", "line_number": 34, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 39, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 43, "usage_type": "call" }, { "api_name": "bert4keras.utils.load_vocab", "line_n...
20603771420
from sqlalchemy import * from flask import Flask, jsonify, request import urllib #from sqlalchemy.engine.url import URL from sqlalchemy.orm import mapper, scoped_session, sessionmaker import os app=Flask(__name__) engine = create_engine('mysql://'+os.environ['DBmy_USERNAME']+':'+os.environ['DBmy_PASSWORD']...
BhujayKumarBhatta/myflask
srijib-work/curd-api.py
curd-api.py
py
5,268
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sqlalchemy.orm.scoped_session", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlalchemy.o...
4741524681
from io import BytesIO from functools import lru_cache from flask import Blueprint, abort, Response from webargs import fields from webargs.flaskparser import parser from PIL import Image from PIL.ImageColor import getrgb from ..utils.api import freeze_args from ..utils.api import load_data # registers "query_and_jso...
nvarg/smt4-fusion
backend/smt4_fusion/api/images.py
images.py
py
1,710
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 27, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 27, "usage_type": "name" }, { "api_name": "utils.images.crop_largest_ob...
18010641014
# -*- coding: utf-8 -*- """ # Getting single scatterplot with xG for and against @author: @AdPieta """ import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.ticker as ticker import math from PIL import Image # Features team_name = 'Real Madr...
AdPieta/Vizes
Scatterplot.py
Scatterplot.py
py
2,936
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 35, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 39, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number...
70396779387
import functools from typing import Any, Optional import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from chex import Array from matplotlib.axes import Axes from .calc import * from .config import PendulumConfig @jax.jit def disc_th_vel(config: PendulumConfig, th: float, ve...
omron-sinicx/ShinRL
shinrl/envs/pendulum/plot.py
plot.py
py
2,878
python
en
code
42
github-code
6
[ { "api_name": "config.PendulumConfig", "line_number": 16, "usage_type": "name" }, { "api_name": "config.theta_res", "line_number": 18, "usage_type": "attribute" }, { "api_name": "config.vel_max", "line_number": 19, "usage_type": "attribute" }, { "api_name": "confi...
37842405041
from distutils.log import log import re import mysql.connector import requests import time from pathlib import Path from dotenv import dotenv_values from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.by import By from selenium import webdriver env_pat...
ICEI-PUC-Minas-PPLES-TI/plf-es-2022-2-ti6-3150100-pesquisaaplicacoesdesktop
Codigo/fillIssuesAndPullRequests.py
fillIssuesAndPullRequests.py
py
10,319
python
en
code
2
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "dotenv.dotenv_values", "line_number": 14, "usage_type": "call" }, { "api_name": "mysql.connector.connector.connect", "line_number": 23, "usage_type": "call" }, { "api_name": "m...
72104846269
from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from .line import main as main_line app = FastAPI() domain_reg = r"https://george\.com|http://localhost:*" app.add_middleware( CORSMiddleware, allow_origin_regex=domain_reg, allow_credentials=True, allow_methods=["*"], ...
geeeeorge/valorant
api/services/__init__.py
__init__.py
py
379
python
en
code
0
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 6, "usage_type": "call" }, { "api_name": "fastapi.middleware.cors.CORSMiddleware", "line_number": 12, "usage_type": "argument" }, { "api_name": "line.main", "line_number": 19, "usage_type": "call" } ]
5700517642
def get_Page(): import pycurl from io import BytesIO buffer = BytesIO() c = pycurl.Curl() c.setopt(c.URL, 'https://nagios.avantis.pl/nagios/cgi-bin/status.cgi?host=all&servicestatustypes=28') c.setopt(pycurl.USERPWD, '%s:%s' % ("tkedziora", "Kedziora01!@")) c.setopt(pycurl.SSL_VERIFYPEER, 0)...
tkedziora2505/nagios_slack
nagios_slack/nagios_critical_tables.py
nagios_critical_tables.py
py
1,167
python
en
code
0
github-code
6
[ { "api_name": "io.BytesIO", "line_number": 4, "usage_type": "call" }, { "api_name": "pycurl.Curl", "line_number": 5, "usage_type": "call" }, { "api_name": "pycurl.USERPWD", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pycurl.SSL_VERIFYPEER", "...
28031832513
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import torch import torch.utils.data as data from networks import ECO_Lite from dataloader import ( make_datapath_list, get_label_id_dictionary, VideoTransform, VideoDataset ) from prepare import load_pretrained_ECO def show_eco_inference_result(dir_path, outpu...
kargenk/ECO_scene_classifier
inference.py
inference.py
py
2,589
python
ja
code
0
github-code
6
[ { "api_name": "torch.max", "line_number": 23, "usage_type": "call" }, { "api_name": "dataloader.make_datapath_list", "line_number": 31, "usage_type": "call" }, { "api_name": "dataloader.get_label_id_dictionary", "line_number": 35, "usage_type": "call" }, { "api_na...
5964323251
import random from collections import Counter PALOS = [ 'ESPADAS', 'TREBOLES', 'DIAMANTES', 'CORAZONES' ] VALORES = [ 'A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K' ] def crearMazo(): mazo = [] for palo in PALOS: for valor in VALORES: mazo.append(( palo, valor )) ...
joaquinfontela/platzi-estocastica-python
simulaciones/simulacion-barajas.py
simulacion-barajas.py
py
4,410
python
es
code
0
github-code
6
[ { "api_name": "random.sample", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 25, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 51, "usage_type": "call" } ]
880836684
"""Target encoding. Target encoding is a technique used in data science to encode categorical variables. It replaces each categorical value with the mean of the target variable for that value. """ import logging from typing import Any, Dict, List, Union import polars class TargetEncoder: """Target Encoder clas...
jordandelbar/feature-engineering-polars
fe_polars/encoding/target_encoding.py
target_encoding.py
py
5,419
python
en
code
3
github-code
6
[ { "api_name": "typing.Union", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number"...
72033325949
# coding: utf-8 # Imports from __future__ import division import matplotlib.pyplot as plt import numpy as np # Control variables temperature = 0.235 # Reading model results from file times = [] with open("./Results/CrossingTimes-T{:.4f}.csv".format(temperature), 'r') as f: for line in f: time_events = [...
adrian-carro/qrse-abm-social-interaction
CrossingTimeProbDist.py
CrossingTimeProbDist.py
py
970
python
en
code
0
github-code
6
[ { "api_name": "numpy.log", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot",...
20347408929
import tensorflow as tf import network.Punet import numpy as np import util import cv2 import os TF_DATA_TYPE = tf.float32 LEARNING_RATE = 1e-4 N_PREDICTION = 100 N_SAVE = 1000 N_STEP = 150000 def train(file_path, dropout_rate, sigma=25, is_realnoisy=False): print(file_path) tf.reset_default_graph() gt ...
scut-mingqinchen/Self2Self
demo_denoising.py
demo_denoising.py
py
3,518
python
en
code
135
github-code
6
[ { "api_name": "tensorflow.float32", "line_number": 9, "usage_type": "attribute" }, { "api_name": "tensorflow.reset_default_graph", "line_number": 18, "usage_type": "call" }, { "api_name": "util.load_np_image", "line_number": 19, "usage_type": "call" }, { "api_name...
71718728188
import os import sys try: sys.frozen #will pass if running py2exe executable except: pass #not needed, put gdal binaries on PATH else: exedir=sys.prefix+"\\" os.environ["PATH"] += ";"+exedir from osgeo import gdal from osgeo import gdal_array from osgeo.gdalconst import * from osgeo import ogr impor...
SDFIdk/nivprogs
MyModules/GdalMaps.py
GdalMaps.py
py
20,947
python
en
code
0
github-code
6
[ { "api_name": "sys.frozen", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.prefix", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "wx.lib.newevent.NewEvent...
21114680434
import os from dotenv import load_dotenv, dotenv_values # FOR TELEGRAM from telethon.sync import TelegramClient from telethon.tl.types import InputPeerChannel, InputPeerEmpty, PeerUser from telethon.tl.types import InputPeerUser from telethon.tl.functions.channels import InviteToChannelRequest, InviteToChannelRequest,...
Splroak/add_member_telegram
src/BatchProcessor.py
BatchProcessor.py
py
19,012
python
en
code
0
github-code
6
[ { "api_name": "dotenv.dotenv_values", "line_number": 27, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 82, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 88, "usage_type": "call" }, { "api_name": "logging.info", "line_...
43573632955
import argparse import os import geopmpy.agent import geopmpy.hash from experiment import util from experiment import launch_util from experiment import machine from experiment.monitor import monitor from experiment.frequency_sweep import frequency_sweep def launch_configs(output_dir, app_conf_ref, app_conf, default...
geopm/geopm
integration/experiment/energy_efficiency/barrier_frequency_sweep.py
barrier_frequency_sweep.py
py
4,283
python
en
code
79
github-code
6
[ { "api_name": "experiment.launch_util.LaunchConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "experiment.launch_util", "line_number": 16, "usage_type": "name" }, { "api_name": "experiment.util.geopmread", "line_number": 23, "usage_type": "call" }, { ...
38223411256
"""voteherder URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-ba...
FarsetLabs/vote-herder
voteherder/urls.py
urls.py
py
3,382
python
en
code
3
github-code
6
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 45, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 45, "usage_type": "name" }, { "api_name": "views.UserViewSet", "line_number": 46, "usage_type": "argument" }, { ...
12853738810
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.misc import sstruct from fontTools.misc.textTools import safeEval from . import DefaultTable import struct nameRecordFormat = """ > # big endian platformID: H platEncID: H langID: H nameID: H ...
tyao1/qfapp
fonttools/Lib/fontTools/ttLib/tables/_n_a_m_e.py
_n_a_m_e.py
py
5,799
python
en
code
5
github-code
6
[ { "api_name": "fontTools.misc.sstruct.calcsize", "line_number": 18, "usage_type": "call" }, { "api_name": "fontTools.misc.sstruct", "line_number": 18, "usage_type": "name" }, { "api_name": "struct.unpack", "line_number": 24, "usage_type": "call" }, { "api_name": "...
14096545707
#!/usr/bin/env python import sys import os from setuptools import setup, find_packages assert sys.version_info >= (3, 7), 'We only support Python 3.7+' sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana')) # Safely read the version number from the version.py file version = {} with open('asana/version...
Asana/python-asana
setup.py
setup.py
py
1,321
python
en
code
281
github-code
6
[ { "api_name": "sys.version_info", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.path.insert", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "...
74281366907
import torch.nn as nn from simpletrainer.components import LabelSmoothing def test_label_smoothing(): label_smoothing = LabelSmoothing(rate=0.1) class FakeTrainer: def __init__(self, model) -> None: self.model = model class SimpleModel(nn.Module): def __init__(self) -> None:...
Moka-AI/simpletrainer
tests/test_components/test_label_smoothing.py
test_label_smoothing.py
py
578
python
en
code
3
github-code
6
[ { "api_name": "simpletrainer.components.LabelSmoothing", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "...
35117833161
import os import cv2 def get_glimpse(image, wk=False, legend="current image"): """ show a small overview of an image (10% of original size) :param img: image :param wk: true if waitkey active :return: """ if wk is True: wktime = 0 else: wktime = 50 dim = (int(image.sha...
alix-tz/GT_generator
GT_generator/gt_utils.py
gt_utils.py
py
1,043
python
en
code
2
github-code
6
[ { "api_name": "cv2.resize", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cv2.imshow", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_num...
42134719725
import numpy as np import scipy.stats as stats #no. of questions n=10 #probalility of correct p=0.5 #no. of simulation num=1000 # Simulate all exam attempts at once guesses = np.random.choice([True, False], size=(num, n)) num_correct = np.sum(guesses, axis=1) # Calculate the probability of at least 8 correct a...
gadepall/digital-communication
exemplar/12/13/3/85/codes/main.py
main.py
py
523
python
en
code
7
github-code
6
[ { "api_name": "numpy.random.choice", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.sum", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.sum", "line...
72624538747
import math import random import matplotlib.pyplot as plt import matplotlib.animation as animation from stl import mesh from mpl_toolkits import mplot3d import numpy as np import json import argparse import os from circularpotts.hamiltonian import ( hamiltonian, delta_hamiltonian, accept_move_delta, al...
RemieJanssen/CircularPotts
src/circularpotts/main.py
main.py
py
9,026
python
en
code
0
github-code
6
[ { "api_name": "math.cos", "line_number": 26, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 26, "usage_type": "attribute" }, { "api_name": "math.sin", "line_number": 27, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 27, "...
19538275872
# All Rights Reserved 2017 # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
elajkat/network-test
networking_test/db/foo/foo_db.py
foo_db.py
py
3,801
python
en
code
0
github-code
6
[ { "api_name": "oslo_log.log.getLogger", "line_number": 29, "usage_type": "call" }, { "api_name": "oslo_log.log", "line_number": 29, "usage_type": "name" }, { "api_name": "neutron_lib.db.model_base.BASEV2", "line_number": 32, "usage_type": "attribute" }, { "api_nam...
44418438214
import requests import socket import json damin = input("Enter the damin: ") req = requests.get("https://"+damin) print(req.headers,"\n") ip = socket.gethostbyname(damin) print(f"ip Address of {damin} is {ip}","\n") req2 = requests.get("https://ipinfo.io/"+ip+"/json") #print(req2) data = json.loads(req2...
Zero-Day-attack/Ddos_Attack
info.py
info.py
py
393
python
en
code
1
github-code
6
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "socket.gethostbyname", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "json.loads", "line_n...
71895940667
import numpy as np from typing import Tuple, List, Union, Any # dimensions d'une matrice sous forme d'un tuple de listes d'indices de lignes et de colonnes # par exemple, _dims(M) = ([0,1,2,3], [0,1,2,3,4,5,6,7,8]) # Cette précomputation est utilisée pour éviter de recalculer la même liste d'indices # dans les calculs...
flengyel/Operations-Tensorielles-Simpliciales
operations_tensorielles_simpliciales.py
operations_tensorielles_simpliciales.py
py
10,161
python
en
code
0
github-code
6
[ { "api_name": "numpy.ndarray", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 10, "usage_type": "call" }, { "api_name": "typing.Tuple", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.List", "line_nu...
5291349922
import av import math from pyglet.image import ImageData from pyglet.media import StreamingSource from pyglet.media.codecs import AudioFormat, VideoFormat, AudioData from jerboa.media import MediaType, AudioConfig, VideoConfig from jerboa.timeline import FragmentedTimeline from .decoder import SimpleDecoder, Skipping...
pawel-glomski/jerboa
src/jerboa/media/source/source.py
source.py
py
4,343
python
en
code
1
github-code
6
[ { "api_name": "av.VideoFormat", "line_number": 13, "usage_type": "call" }, { "api_name": "av.AudioFormat", "line_number": 14, "usage_type": "call" }, { "api_name": "av.AudioLayout", "line_number": 15, "usage_type": "call" }, { "api_name": "av.stream", "line_nu...
13739160308
from django.conf.urls import patterns, include, url from django.contrib import admin from locations.api import UserResource, LocationResource from tastypie.api import Api admin.autodiscover() api = Api(api_name='v1') api.register(UserResource()) api.register(LocationResource()) urlpatterns = patterns('', # Examp...
Xennis/django_sample_server
server/sample_server/urls.py
urls.py
py
737
python
en
code
1
github-code
6
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "tastypie.api.Api", "line_number": 8, "usage_type": "call" }, { "api_name": "...
30889793305
# -*- coding: utf-8 -*- from collective.blueline.portlets import blueline as bluelineprofile from collective.blueline.testing import INTEGRATION_TESTING from plone.app.portlets.storage import PortletAssignmentMapping from plone.app.testing import setRoles from plone.app.testing import TEST_USER_ID from plone.portlets.i...
collective/collective.blueline
src/collective/blueline/tests/test_portlet.py
test_portlet.py
py
4,246
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 25, "usage_type": "attribute" }, { "api_name": "collective.blueline.testing.INTEGRATION_TESTING", "line_number": 27, "usage_type": "name" }, { "api_name": "plone.app.testing.setRoles", "line_number": 32, "usage_type": "cal...
73816748666
"""This cog provides error handling for King Arthur.""" from discord import Message from discord.ext import commands from discord.ext.commands import Cog from arthur.bot import KingArthur from arthur.utils import generate_error_message class ErrorHandler(Cog): """Error handling for King Arthur.""" def __ini...
python-discord/king-arthur
arthur/exts/error_handler/error_handler.py
error_handler.py
py
2,037
python
en
code
7
github-code
6
[ { "api_name": "discord.ext.commands.Cog", "line_number": 10, "usage_type": "name" }, { "api_name": "arthur.bot.KingArthur", "line_number": 13, "usage_type": "name" }, { "api_name": "discord.Message", "line_number": 16, "usage_type": "name" }, { "api_name": "discor...
28844906532
# Author: Lukas Rauch # Data: 23.05.2022 import open3d as o3d import numpy as np import pyvista as pv import vtk import time def wall_scan(): print("\n=====================================================") print("EXAMPLE: Real World Wall Scan") print("====================================================...
RauchLukas/GBK2022-Paper_E09
examples/example_wall_scan.py
example_wall_scan.py
py
3,869
python
en
code
0
github-code
6
[ { "api_name": "open3d.io.read_point_cloud", "line_number": 21, "usage_type": "call" }, { "api_name": "open3d.io", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "line_number": 30, "usage_type": "call" }, { "api_name": "open3d.utilit...
18843048066
import pytest from clean.entities.token import UserToken from clean.auth.abs import DecodeToken from clean.exceptions import AuthException perms = { 'user': { 'req': 'user' }, 'rule': { 'path': 'scopes.bar', 'op': 'eq', 'value': 'foo' } } class VerifyTokenAuth(DecodeT...
bahnlink/pyclean
tests/clean/auth/test_auth_imp.py
test_auth_imp.py
py
2,136
python
en
code
0
github-code
6
[ { "api_name": "clean.auth.abs.DecodeToken", "line_number": 19, "usage_type": "name" }, { "api_name": "clean.entities.token.UserToken", "line_number": 22, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 37, "usage_type": "call" }, { "api_name"...
26167102884
# AUTHOR: CHALRIE BECKER # DATE: 06/13/2019 import xarray as xr import numpy as np from varlist import var_list import time import glob import matplotlib.pyplot as plt t0 = time.time() # Calculate GDD (Growing Degree Days) def calc_GDD(tmin, tmax): adjusted_tmin = np.where(tmin <= 283.15, 283.15, tmin) ...
charlie-becker/Xarray_subset
subset.py
subset.py
py
3,725
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 18...
39931666214
# -*- coding: utf-8 -*- from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility data_path = '../data' from keras.preprocessing import sequence from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM import pandas import os maxlen = ...
bolan2014/JuliaTaxi
src/regression_rnn.py
regression_rnn.py
py
2,358
python
en
code
0
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line...
72087997309
import json import jupyter_server.base.handlers import tornado import tornado.escape import tornado.httpclient import tornado.httputil import tornado.web from ..config import has_proxy_key from ..config import is_jupyter_server_proxy_enabled from ..config import lab_info_path from ..config import lab_url_key # noin...
dcs4cop/xcube-jl-ext
xcube_jl_ext/handlers/labinfo.py
labinfo.py
py
1,968
python
en
code
0
github-code
6
[ { "api_name": "jupyter_server.base.handlers.base", "line_number": 17, "usage_type": "attribute" }, { "api_name": "jupyter_server.base.handlers", "line_number": 17, "usage_type": "name" }, { "api_name": "config.lab_info_path", "line_number": 21, "usage_type": "name" }, ...
42579070066
import requests from flask import current_app from main.models import Waybill, TrackingInfo import datetime def inbound_query(inbound_num): waybill = Waybill.objects.raw({'w_no': inbound_num}).first() if waybill is not None: res = requests.get( "http://178.79.168.53:6001/api/v1.0/inbound_n...
quinn-lee/novalinks
main/utils/inbounds.py
inbounds.py
py
1,633
python
en
code
0
github-code
6
[ { "api_name": "main.models.Waybill.objects.raw", "line_number": 8, "usage_type": "call" }, { "api_name": "main.models.Waybill.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "main.models.Waybill", "line_number": 8, "usage_type": "name" }, { ...
19569226972
import socket import json HOST = '10.10.10.168' PORT = 8080 try: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sc: sc.connect((HOST, PORT)) print("[+] Connected to host {} : {}".format(HOST, PORT)) print("[+] Sending data through socket") data = { "method" : "get", "doc" : "/etc/issue", ...
naiame-neltheri/WriteUps
HackTheBox/Obscurity/requestHandler.py
requestHandler.py
py
604
python
en
code
0
github-code
6
[ { "api_name": "socket.socket", "line_number": 8, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 8, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 8, "usage_type": "attribute" }, { "api_name": "json.dumps", ...
42217119694
# encoding: utf-8 # ****************************************************** # Author : zzw922cn # Last modified: 2017-12-09 11:00 # Email : zzw922cn@gmail.com # Filename : libri_preprocess.py # Description : Feature preprocessing for LibriSpeech dataset # ***********************************************...
JoeyHeisenberg/model_speech_final
Automatic_Speech_Recognition/speechvalley/feature/libri/libri_preprocess.py
libri_preprocess.py
py
22,108
python
en
code
0
github-code
6
[ { "api_name": "numpy.ones", "line_number": 31, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number...
26703833265
import argparse import asyncio import json import socket from _thread import start_new_thread import config import time import websockets class AngerBroadcaster: def __init__(self, server_port=5556): self.client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.server_host = config.SERVER...
LanyK/TheAngerGames
bombangerman/server/AngerBroadcaster.py
AngerBroadcaster.py
py
5,620
python
en
code
1
github-code
6
[ { "api_name": "socket.socket", "line_number": 14, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 14, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 14, "usage_type": "attribute" }, { "api_name": "config.SERV...
35619025815
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin, PermissionDenied from django.views.generic import ListView, DetailView, CreateView from django.views.generic.edit import UpdateView, DeleteView from django.urls import reverse_lazy, reverse from django.shortcuts import get_object_or_404 fro...
Iassirskyi/learning_blog_python_django
articles/views.py
views.py
py
3,299
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 11, "usage_type": "name" }, { "api_name": "django.views.generic.ListView", "line_number": 11, "usage_type": "name" }, { "api_name": "models.Article", "line_number": 12, "usage_type": "name" },...
15229224008
from flask import Blueprint,request, render_template, session, redirect, url_for, flash from markupsafe import escape from .modules import User from . import db views = Blueprint('views', __name__) @views.route('/', methods=["POST", "GET"]) def index(): email = None if "username" in session: username...
maggie197/super-car-check
website/views.py
views.py
py
871
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.session", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.request.method", ...
1844634050
from lib.rpc_methods import get_prgtx_info, get_best_block from pprint import pprint from collections import OrderedDict """ Sort the set in ascending order by "testHeight" and “ProRegTx hash”. “testHeight” is determined for each individual entry and equals the “last paid height” (or “registered height” if the master...
jhodges10/dash-nexus-mnapi
containers/mn_api/lib/payment_rank.py
payment_rank.py
py
1,855
python
en
code
0
github-code
6
[ { "api_name": "lib.rpc_methods.get_prgtx_info", "line_number": 14, "usage_type": "call" }, { "api_name": "lib.rpc_methods.get_best_block", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 40, "usage_type": "call" } ]
11783422706
import argparse import lstm2 import numpy as np # fix random seed for reproducibility np.random.seed(7) ''' Read config file and set up variables ''' parser = argparse.ArgumentParser(description='Create multi-variate LSTM models') parser.add_argument('config_file', nargs='?', help='config_file to use') parser.add_ar...
thongnbui/MIDS_capstone
code/lstm2_predict.py
lstm2_predict.py
py
1,112
python
en
code
0
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 5, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "lstm2.read_...
8109525618
from __future__ import print_function import os import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data from torch.autograd import Variable import torch.nn.functional as F import skimage.io import numpy as np from...
HongqingThomas/V-slam-based-on-nerf
src/deeppruner_simplify/deeppredict.py
deeppredict.py
py
4,427
python
en
code
1
github-code
6
[ { "api_name": "models.config.config.cost_aggregator_scale", "line_number": 26, "usage_type": "attribute" }, { "api_name": "models.config.config", "line_number": 26, "usage_type": "name" }, { "api_name": "torch.backends", "line_number": 29, "usage_type": "attribute" }, ...
7740826261
import keras from keras.models import Sequential from keras.layers import Dense, Conv2D, MaxPool2D, Flatten, Dropout, Rescaling, RandomFlip, RandomRotation, BatchNormalization, Conv1D, MaxPool1D from keras.preprocessing.image import ImageDataGenerator from keras.optimizers import Adam,RMSprop from keras import layers ...
pragyasresta29/Kaggle3DprintingIssues
src/final_model.py
final_model.py
py
5,223
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.array", "lin...
28355945115
from django.shortcuts import render, get_object_or_404, redirect from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from .models import Post, Donation ,Stock ,Comment , Wishlist, Predictor from django.views.generic import (ListView, DetailView, CreateView,UpdateView, DeleteView) from .forms...
jash6/StockGuru
blog/views.py
views.py
py
12,225
python
en
code
0
github-code
6
[ { "api_name": "models.Post.objects.all", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 17, "usage_type": "name" }, { "api_name": "django.s...
44134237025
from nltk.stem import WordNetLemmatizer import nltk import pyttsx3 import sys import re from urllib.request import urlopen from time import strftime import webbrowser import smtplib import requests import subprocess from bs4 import BeautifulSoup import wikipedia import wolframalpha import ctypes import subprocess impor...
JayanthTunk/Emma-VirtualAssistant-Chatbot
Emma Smart Assistant + Chatbot.py
Emma Smart Assistant + Chatbot.py
py
39,498
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 34, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 35, "usage_type": "call" }, { "api_name": "tkinter.Label", "line_number": 38, "usage_type": "attribute" }, { "api_name": "PIL.Image.op...
7941217811
''' Created by: Errol Jordheim Final Project for Computational Physics PHYS 416 April 17, 2018 View README.txt for details of the program and theoretical background ''' # Import packages for mathematics and plotting import numpy as np import matplotlib.pyplot as plt import mpl_toolkits.mplot3d.axes3d as p3 ...
ejordheim/frisbee_dynamics
execution.py
execution.py
py
7,728
python
en
code
0
github-code
6
[ { "api_name": "initial_cond.initial_cond", "line_number": 28, "usage_type": "call" }, { "api_name": "wind.wind", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.sin", "line_n...
1584158700
import yaml import click import cv2 import torch import ssd import ssd.transforms as T @click.command() @click.argument('im_path', type=click.Path(exists=True, dir_okay=False)) @click.option('-c', '--checkpoint', required=True, type=click.Path(exists=True, dir_okay=False)) @click.option('--traced/--n...
Guillem96/ssd-pytorch
ssd/inference.py
inference.py
py
2,279
python
en
code
0
github-code
6
[ { "api_name": "torch.device", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 23, "usage_type": "attribute" }, { "api_name": "yaml.safe_load",...
22551175355
import os from typing import Optional def delete_dataset_file(path: Optional[str]) -> None: """ Deletes a dataset locally using its path from the database """ if os.path.exists(path): try: os.remove(path) return except Exception as ex: raise OSError(...
ArturZhukovets/Metrics-evaluation
app/services/translations_utils/sync_with_database.py
sync_with_database.py
py
440
python
en
code
0
github-code
6
[ { "api_name": "typing.Optional", "line_number": 5, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.remove", "line_number...
39830538307
import sqlite3 class SaltyDatabase(): def __init__(self): self.match_count = 0 self.con = sqlite3.connect('SaltDatabase.db') self.backup_con = sqlite3.connect('SaltDatabaseBU.db') with self.con: self.con.execute("""CREATE TABLE IF NOT EXISTS SBMA...
xxxFRIARxxx/SaltyBot
SaltyDatabase.py
SaltyDatabase.py
py
9,029
python
en
code
2
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlite3.IntegrityError", "line_number": 50, "usage_type": "attribute" } ]
69899468669
from selenium import webdriver as wb from selenium.webdriver.common.keys import Keys from WebScraping.beautifulsoup import BeautifulSoup as bs import time driver = wb.Chrome() url = ('https://www.youtube.com/results?search_query=mnet') driver.get(url) body = driver.find_element_by_tag_name('body') body.send_keys(Key...
jiseungmin/PythonProJect
WebScraping/Mnet/mnetsearch.py
mnetsearch.py
py
805
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.keys.Keys.PAGE_DOWN", "line_number": 12, "usage_type": "attribute" ...
39048044207
import json import boto3 def lambda_handler(event, context): # Reading 'body' from event body = event.get("body") body_json = json.loads(body) if not body_json: return { "statusCode": 400, "body": json.dumps("Not valid payload") } # Return error mesag...
micha3l999/ucsg_fast_evaluation
update_user_profile/lambda_function.py
lambda_function.py
py
2,485
python
en
code
0
github-code
6
[ { "api_name": "json.loads", "line_number": 9, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 14, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 21, "usage_type": "call" }, { "api_name": "boto3.resource", "line_number": 3...
29002747549
#! /usr/bin/env python import configobj import os import os.path import shlex import shutil import sqlalchemy as sqla # Interface to Gc3libs import gc3libs from gc3libs import Application, Run from gc3libs.cmdline import SessionBasedScript from gc3libs.workflow import SequentialTaskCollection, ParallelTaskCollection...
acg-team/tral
tral/examples/workflow/tandem_repeat_annotation_workflow.py
tandem_repeat_annotation_workflow.py
py
14,486
python
en
code
24
github-code
6
[ { "api_name": "gc3libs.Application", "line_number": 24, "usage_type": "name" }, { "api_name": "gc3libs.log.info", "line_number": 34, "usage_type": "call" }, { "api_name": "gc3libs.log", "line_number": 34, "usage_type": "attribute" }, { "api_name": "gc3libs.quantit...
4897886271
#!/usr/bin/env bash """true" '''\' set -e eval "$(conda shell.bash hook)" conda deactivate conda activate toucan_conda_venv exec python "$0" "$@" exit $? ''""" import datetime import os import re import shutil import sys import textwrap import unicodedata import warnings from typing import List import torch from pydu...
CherokeeLanguage/IMS-Toucan
run_chr_osiyo_tohiju.py
run_chr_osiyo_tohiju.py
py
3,025
python
en
code
3
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 26, "usage_type": "call" }, { "api_name": "InferenceInterfaces.InferenceFastSpeech2.InferenceFastSpeech2", "line_number": 33, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 33, "usage_type": "nam...
72531740349
import json from contextlib import suppress from pathlib import Path from typing import Any, Optional, Union, cast from models_library.basic_regex import MIME_TYPE_RE from models_library.generics import DictModel from models_library.services import PROPERTY_KEY_RE from pydantic import ( AnyUrl, BaseModel, ...
ITISFoundation/osparc-simcore
packages/dask-task-models-library/src/dask_task_models_library/container_tasks/io.py
io.py
py
6,089
python
en
code
35
github-code
6
[ { "api_name": "pydantic.BaseModel", "line_number": 24, "usage_type": "name" }, { "api_name": "pydantic.Extra.forbid", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pydantic.Extra", "line_number": 28, "usage_type": "name" }, { "api_name": "typing.A...
9985515590
from collections.abc import Sequence import discord class Helpers: async def get_members(self, ctx,role_name): role = discord.utils.find( lambda r: r.name == role_name, ctx.guild.roles) users = [] for user in ctx.guild.members: if role in user.roles: ...
joelsewhere/lincoln-loft-bot
components/helpers.py
helpers.py
py
1,385
python
en
code
0
github-code
6
[ { "api_name": "discord.utils.find", "line_number": 7, "usage_type": "call" }, { "api_name": "discord.utils", "line_number": 7, "usage_type": "attribute" }, { "api_name": "collections.abc.Sequence", "line_number": 38, "usage_type": "argument" } ]
43193681216
#!/usr/bin/env python3 import rospy import logging import smach import smach_ros from std_msgs.msg import String, UInt8 from AgentStates.idle import Idle from AgentStates.gcs_connection import GCSConnection from AgentStates.mission_upload import MissionUpload from AgentStates.mission_commanded import MissionCom...
miggilcas/muav_state_machine
scripts/agent_sm_node.py
agent_sm_node.py
py
4,888
python
en
code
0
github-code
6
[ { "api_name": "rospy.init_node", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 28, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 29, "usage_type": "attribute" }, { "api_name": "rospy.get_param",...
24338847141
import io import os import re import string import logging import datetime import numpy as np import tensorflow as tf from tensorflow.keras import layers import argparse import time from typing import List today_date = datetime.date.today().strftime("%b_%d_%Y") start_time = time.time() start_time_fmt = time.strftime("...
TheJacksonLaboratory/wn2vec
scripts/run_w2v.py
run_w2v.py
py
3,548
python
en
code
0
github-code
6
[ { "api_name": "datetime.date.today", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 14, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 15, "usage_type": "call" }, { "api_name": "time.strftime", ...
10721765859
class Solution(object): def criticalConnections(self, n, connections): """ :type n: int :type connections: List[List[int]] :rtype: List[List[int]] """ from collections import defaultdict self.graph = defaultdict(list) for a,b in conne...
milu-buet/Competitive-Programming
Interview/problems/GRaph/6.bridge.py
6.bridge.py
py
1,181
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" } ]
31359717482
""" Functions for working with anatomical images. Includes reading and writing nifti files, interfacing with FSL, and modifying anatomical images where necessary. """ import os import nibabel as ni import numpy as np import nipype.interfaces.fsl as fsl from scipy import ndimage def load_nifti(fname): img = ni.l...
nw-duncan/scalp-distance
scalpdist/anat.py
anat.py
py
2,649
python
en
code
0
github-code
6
[ { "api_name": "nibabel.load", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "nibabel.Nifti1Image", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line...
22371303057
from typing import List def productExceptSelf(nums: List[int]) -> List[int]: if not nums: return False arr = [1] * len(nums) pi = pj = 1 for i in range(len(nums)): j = -1-i arr[i]*=pi; arr[j]*=pj pi *= nums[i]; pj *= nums[j] print(arr) ret...
blunderthunder/GoAlgPy
product_except_self/main.py
main.py
py
435
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 3, "usage_type": "name" } ]
2965487044
import werkzeug from odoo.addons.auth_oauth.controllers.main import OAuthLogin class OAuthLoginGsuite(OAuthLogin): def list_providers(self): res = super(OAuthLoginGsuite, self).list_providers() for provider in res: if provider.get('hd'): params = dict( ...
Tawasta/server-tools
auth_oauth_gsuite/controllers/oauth_login.py
oauth_login.py
py
511
python
en
code
3
github-code
6
[ { "api_name": "odoo.addons.auth_oauth.controllers.main.OAuthLogin", "line_number": 5, "usage_type": "name" }, { "api_name": "werkzeug.url_encode", "line_number": 17, "usage_type": "call" } ]
2080937101
#!/usr/local/bin/python """ In England the currency is made up of pound, L, and pence, p, and there are eight coins in general circulation: 1p, 2p, 5p, 10p, 20p, 50p, L1 (100p) and L2 (200p). It is possible to make L2 in the following way: 1L1 + 150p + 220p + 15p + 12p + 31p How many different ways can L2 be made us...
bhuber/pyler
py/problem31.py
problem31.py
py
2,665
python
en
code
1
github-code
6
[ { "api_name": "ipdb.set_trace", "line_number": 55, "usage_type": "call" }, { "api_name": "ipdb.set_trace", "line_number": 64, "usage_type": "call" } ]
4742146071
import pandas as pd import matplotlib.pyplot as plt import numpy as np import sklearn.linear_model from alpha_vantage.timeseries import TimeSeries api_key = '8FIYTT49ZEZT2GV5' ts = TimeSeries(key=api_key, output_format='pandas') data, meta_data = ts.get_daily_adjusted(symbol='SPY', outputsize = 'full') data...
obawolo/Capstone
linRegNoSTD.py
linRegNoSTD.py
py
655
python
en
code
0
github-code
6
[ { "api_name": "alpha_vantage.timeseries.TimeSeries", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.c_", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.c_", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sklear...
25530570942
import pandas as pd import matplotlib.pyplot as plot import re """Write with python 3.5.1""" def merge_dfs(df1, df2): """merge two dfs""" return pd.merge(df1, df2, how='left', left_on='Country', right_on='Country') def print_line(): """print separate line""" print('-----------------------------------...
SIXSIXSIXX/COMP9321Ass1
ass_1.py
ass_1.py
py
4,312
python
en
code
0
github-code
6
[ { "api_name": "pandas.merge", "line_number": 8, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 73, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 76, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "...
27228431621
import os import sys import argparse import logging import shutil import openai from pathlib import Path from pydub import AudioSegment from pytube import YouTube log_level = os.environ.get('LOG_LEVEL', 'INFO').upper() logging.basicConfig(level=log_level if log_level in { 'INFO', 'DEBUG'} else 'INF...
rightson/youtube-transcript
youtube_audio_transcript.py
youtube_audio_transcript.py
py
5,931
python
en
code
0
github-code
6
[ { "api_name": "os.environ.get", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 12, "usage_type": "call" }, { "api_name": "pathlib.Path", ...
11682639173
from datetime import datetime import serial import time import schedule import csv def saveCSV(data:dict, stamp:str) -> None: try: with open(f'Engine\data\\temperaturas_{stamp}.csv', 'x') as csv_file: fields = list(data.keys()) writer = csv.DictWriter(csv_file,fields) ...
Pukiretsu/Arduino_Sensors
Engine/DHT_Temperatures.py
DHT_Temperatures.py
py
2,370
python
en
code
0
github-code
6
[ { "api_name": "csv.DictWriter", "line_number": 12, "usage_type": "call" }, { "api_name": "csv.DictWriter", "line_number": 20, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime.now", ...
39254566263
import cv2.cv as cv import pyopencl as cl import numpy import Image import statsFunctions as stats TRIALRUNS = 5 print("Loading constants...") constantFile = open('constants.txt','r') c1 = float(constantFile.readline()) c2 = float(constantFile.readline()) constantFile.close() print("Done!") print("") ...
svatasoiu/laser-rangefinder
Laser Rangefinder/usbCamera.py
usbCamera.py
py
10,068
python
en
code
0
github-code
6
[ { "api_name": "cv2.cv.NamedWindow", "line_number": 43, "usage_type": "call" }, { "api_name": "cv2.cv", "line_number": 43, "usage_type": "name" }, { "api_name": "cv2.cv.CV_WINDOW_AUTOSIZE", "line_number": 43, "usage_type": "attribute" }, { "api_name": "cv2.cv.Named...
30883194735
import os from zope.interface import implements from zope.component import adapts from Products.Reflecto.interfaces import IReflectoFile try: from zopyx.txng3.core.interfaces import IIndexableContent from zopyx.txng3.core.content import IndexContentCollector except ImportError: from textindexng.interfaces.i...
collective/Products.Reflecto
Products/Reflecto/catalog.py
catalog.py
py
1,997
python
en
code
2
github-code
6
[ { "api_name": "zope.interface.implements", "line_number": 17, "usage_type": "call" }, { "api_name": "textindexng.interfaces.indexable.IIndexableContent", "line_number": 17, "usage_type": "argument" }, { "api_name": "zope.component.adapts", "line_number": 18, "usage_type":...
29941396222
# -*- coding: utf-8 -*- """ Created on Tue Jun 30 12:23:49 2020 @author: Gaurav """ import pandas as pd import re from nltk.corpus import stopwords from nltk.stem import PorterStemmer from nltk.stem import WordNetLemmatizer from sklearn.model_selection import train_test_split from sklearn.naive_bayes impor...
GauravRajwada/Data-Science
Natural Language Process/Emotions_Text_LSTM.py
Emotions_Text_LSTM.py
py
2,537
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.to_numeric", "line_number": 34, "usage_type": "call" }, { "api_name": "nltk.stem.PorterStemmer", "line_number": 37, "usage_type": "call" }, { "api_name": "nltk.stem.W...
5957531116
# coding:utf-8 from requests import Request, Session from unitest.common.Logger import * import unittest from time import sleep from tomorrow import threads import requests import json from unitest.common.VarConfig import * from unitest.common.ParseExcel import ParseExcel #创建 excel数据文件的解析对象 excelObj = ParseExcel() #将...
qiangzeliang/recode_framework
unitest/case/dhm - 副本.py
dhm - 副本.py
py
7,607
python
en
code
1
github-code
6
[ { "api_name": "unitest.common.ParseExcel.ParseExcel", "line_number": 14, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 20, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 50, "usage_type": "call" }, { "api_nam...
30550748471
from config import * from logpsi import make_logpsi, make_quantum_score from orbitals import sp_orbitals from jax.flatten_util import ravel_pytree def fermiflow(depth, spsize, tpsize, Nf, L, n, dim, K, nk): from ferminet import FermiNet def flow_fn(x, k): model = FermiNet(depth, spsize, tpsize, Nf,...
fermiflow/hydrogen
tests/test_quantum_sr.py
test_quantum_sr.py
py
1,784
python
en
code
9
github-code
6
[ { "api_name": "ferminet.FermiNet", "line_number": 11, "usage_type": "call" }, { "api_name": "jax.flatten_util.random.PRNGKey", "line_number": 19, "usage_type": "call" }, { "api_name": "jax.flatten_util.random", "line_number": 19, "usage_type": "attribute" }, { "ap...
17516463758
import torch from torch import nn from .functions import * class UNetConvBlock(torch.nn.Module): def __init__( self, in_size: int, out_size: int, pad: bool, layer_norm: bool, norm_mode: str, data_dim: int, kernel_size: ...
broadinstitute/CellMincer
cellmincer/models/components/blocks.py
blocks.py
py
5,527
python
en
code
1
github-code
6
[ { "api_name": "torch.nn", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.nn.Sequential", "line_number": 45, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
27535360688
from typing import Dict, Any from fastapi import HTTPException class FinapiResponse: def __init__( self, success: bool | None = None, data: Any = None, message: str = "", status_code: int = 0, ): self.success = success self.data = data self.mess...
Fyleek/finapi
finapi/models/responses/FinapiResponse.py
FinapiResponse.py
py
771
python
en
code
0
github-code
6
[ { "api_name": "typing.Any", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 22,...
12700960302
from collections import deque def marbleEscape(board, red_x, red_y, blue_x, blue_y): Q, history = deque([(red_x, red_y, blue_x, blue_y, 0)]), {(red_x, red_y, blue_x, blue_y)} while Q: red_x, red_y, blue_x, blue_y, tilt_count = Q.popleft() if tilt_count > 10: print(-1); return if board[r...
MinChoi0129/Algorithm_Problems
BOJ_Problems/13460.py
13460.py
py
2,482
python
en
code
2
github-code
6
[ { "api_name": "collections.deque", "line_number": 4, "usage_type": "call" } ]
25754978743
import os import shutil result_dir= r'C:\Users\PC\Desktop\case1_0901\result' #大文件夹 dir_names = os.listdir(result_dir) # 打开大文件夹后的各个小文件夹名dir_names final_file='parameter.txt' for dir in dir_names: #遍历每一个小文件夹 file_path = result_dir+'\\'+dir file_names = os.listdir(file_path) #打开小文件夹后每一个CSV文件的名称 for file in file...
zhengjunhao11/model-updating-framework
program_framework/result_get.py
result_get.py
py
950
python
zh
code
1
github-code
6
[ { "api_name": "os.listdir", "line_number": 4, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "li...