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
43732887683
from collections import deque import sys input = sys.stdin.readline R = [] for _ in range(int(input())): REV = False ERR = False F = input().strip() N = input() L = list(input().replace( "[", "").replace("]", "").strip().split(",")) if L == [""]: L = [] D = deque(L) ...
pokycookie/BAEKJOON
5430.py
5430.py
py
927
python
en
code
0
github-code
1
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 18, "usage_type": "call" } ]
1498550659
#!/usr/bin/env python3 # dpw@plaza.localdomain # 2023-09-19 19:17:00 import json import sys from dataclasses import dataclass from pathlib import Path from rich import inspect, print class TrieNode: def __init__(self, char): self.char = char self.is_end = False self.children = {} de...
darrylwest/python-play
algorithms/trie.py
trie.py
py
2,205
python
en
code
0
github-code
1
[ { "api_name": "dataclasses.dataclass", "line_number": 23, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 71, "usage_type": "call" }, { "api_name": "json.load", "line_number": 80, "usage_type": "call" }, { "api_name": "sys.argv", "line_num...
6445310024
from PyQt5 import QtWidgets, QtGui, uic from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QFileDialog, QTableWidgetItem from PyQt5.QtSql import QSqlTableModel from datetime import datetime from . import utils class ImportDialog(QtWidgets.QDialog): def __init__(self, parent): super(ImportDialog, self...
willnode/Arsipin
src/importDialog.py
importDialog.py
py
4,887
python
en
code
0
github-code
1
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.uic.loadUi", "line_number": 12, "usage_type": "call" }, { "api_name": "PyQt5.uic...
1538930426
import logging import numpy as np __author__ = 'frank.ma' logger = logging.getLogger(__name__) class RdmBivariate(object): @staticmethod def __check_rho(rho: float): if abs(rho) >= 1.0: raise ValueError('rho (%.4f) should be smaller than 1' % rho) @staticmethod def draw_std(rho...
frankma/Finance
src/Utils/Sequence/RdmBivariate.py
RdmBivariate.py
py
1,032
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random.random", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.random.r...
34185397192
# FastApi einbinden für REST-Services from fastapi import FastAPI, APIRouter from fastapi.responses import JSONResponse from fastapi.staticfiles import StaticFiles # JSON Serialisierung import orjson # Pangas zur Daten-Anaylse import pandas as pd # GeoPandas für geometrische Funktionen import geopandas # Für geometrisc...
veberle/MCS_Praktikum_Aufgaben
src/challenges/challenge4.py
challenge4.py
py
2,364
python
de
code
0
github-code
1
[ { "api_name": "fastapi.responses.JSONResponse", "line_number": 18, "usage_type": "name" }, { "api_name": "orjson.dumps", "line_number": 25, "usage_type": "call" }, { "api_name": "fastapi.APIRouter", "line_number": 28, "usage_type": "call" }, { "api_name": "fastapi...
34694646391
import asyncio import xml.etree.ElementTree as ET from os import listdir, path import json import requests import pynetbox import json from multiprocessing.dummy import Pool from netaddr import IPAddress import logging import os import filecmp import re import sys import shutil import time from netmik...
AlexandrePoix/Projet_Netbox
Script_Netbox.py
Script_Netbox.py
py
39,789
python
en
code
0
github-code
1
[ { "api_name": "urllib3.disable_warnings", "line_number": 26, "usage_type": "call" }, { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 47, "usage_type": "call" }, { "api_name": "logging.INFO",...
28905884657
import csv from datetime import datetime, date from dateutil import parser import os import pytz from app import db from app.utils.editdiff import EditDiff, ChangedValue, ChangedRow import logging from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.inspection import inspect from sqlalchemy.orm import cl...
COVID19Tracking/covid-publishing-api
app/models/data.py
data.py
py
17,043
python
en
code
9
github-code
1
[ { "api_name": "sqlalchemy.inspection.inspect", "line_number": 29, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.hybrid.hybrid_property", "line_number": 30, "usage_type": "argument" }, { "api_name": "app.db.Model", "line_number": 36, "usage_type": "attribute" }, ...
43047803864
# !/usr/bin/env python # coding: utf-8 import json import elasticsearch from elasticsearch.exceptions import NotFoundError import uuid from wildzh.utils.config import ConfigLoader __author__ = 'zhouhenglc' class ExamEs(object): def __init__(self, es_conf): cl = ConfigLoader(es_conf) host = cl.g...
meisanggou/wildzh
wildzh/classes/exam_es.py
exam_es.py
py
5,345
python
en
code
0
github-code
1
[ { "api_name": "wildzh.utils.config.ConfigLoader", "line_number": 16, "usage_type": "call" }, { "api_name": "elasticsearch.Elasticsearch", "line_number": 31, "usage_type": "call" }, { "api_name": "elasticsearch.exceptions.NotFoundError", "line_number": 75, "usage_type": "n...
653126704
from flask import Blueprint from flask import render_template,request,redirect,url_for from models import product as pd from .forms import ProductForm from app import db products = Blueprint('products', __name__, template_folder='templates') @products.route('/', methods=['GET','POST']) def index(): if request.me...
SVLozovskoy/flask-crm
products/blueprint.py
blueprint.py
py
1,279
python
en
code
1
github-code
1
[ { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 10, "usage_type": "name" }, { "api_name": "flask.request....
16414347802
#!/usr/bin/python from optparse import OptionParser import logging from time import sleep import random import sys from formats import formats from messages import messages parser = OptionParser() parser.add_option("-m","--mode", dest="mode") parser.add_option("-f", "--format", dest="format", help...
tobinmori/fauxprox
foxprox.py
foxprox.py
py
2,928
python
en
code
1
github-code
1
[ { "api_name": "optparse.OptionParser", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 43, "usage_type": "call" }, { "api_name": "formats.formats", "line_number": 43, "usage_type": "name" }, { "api_name": "logging.get...
23998377870
from enum import Enum from singleton import Singleton from datetime import datetime Circuitstate = Enum("Circuitstate", ["CLOSED", "OPEN", 'HALFOPEN']) class CircuitOpenException(Exception): pass class Circuitbreaker(Singleton): """Circuitbreaker is singleton because if multiple functions are decorated ...
kousiknandy/cktbkr
circuitbreaker.py
circuitbreaker.py
py
2,676
python
en
code
0
github-code
1
[ { "api_name": "enum.Enum", "line_number": 5, "usage_type": "call" }, { "api_name": "singleton.Singleton", "line_number": 11, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime"...
34885760215
import os import imageio import atexit import math from multiprocessing import Process, Queue from gym.spaces import Box from gym import utils from gym.utils import seeding import numpy as np import mujoco_py class PushObjectEnv(utils.EzPickle): def __init__(self, frame_skip, max_timestep=3000, log_dir='', seed=...
keven425/robot-learn
rl/environment/push_object.py
push_object.py
py
15,646
python
en
code
0
github-code
1
[ { "api_name": "gym.utils.EzPickle", "line_number": 13, "usage_type": "attribute" }, { "api_name": "gym.utils", "line_number": 13, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
25047222226
# -*-coding:utf-8 -*- import os import test import functools from unittest.loader import TestLoader from baseCase.case import BaseTest class BaseLoader(TestLoader): def loadTestsFromTestCase(self, testCaseClass): def isTestMethod(arr, testClass=testCaseClass): return arr[:4].lower().startswit...
xiaoyaojushi/appium_auto_test
baseCase/baseSuite.py
baseSuite.py
py
1,328
python
en
code
0
github-code
1
[ { "api_name": "unittest.loader.TestLoader", "line_number": 10, "usage_type": "name" }, { "api_name": "functools.cmp_to_key", "line_number": 17, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.di...
26714078036
import os import numpy as np import keras from keras.engine.topology import Layer from keras.models import Model from keras.layers import Input, Flatten, Dense, Lambda, Reshape, Concatenate from keras.layers import Activation, LeakyReLU, ELU from keras.layers import Conv2D, Conv2DTranspose, UpSampling2D, BatchNormaliz...
tatsy/keras-generative
models/cvaegan.py
cvaegan.py
py
12,613
python
en
code
123
github-code
1
[ { "api_name": "keras.backend.shape", "line_number": 19, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 19, "usage_type": "name" }, { "api_name": "keras.backend.shape", "line_number": 20, "usage_type": "call" }, { "api_name": "keras.backend",...
43200983306
from faker import Faker from git_class.models_new.database import create_db, Session from git_class.models_new.car import Car from git_class.models_new.info_car import InfoCar def create_database(load_fake_data=True): create_db() if load_fake_data: _load_fake_data(Session()) def _load_fake_data(sess...
Mil6734/git_class
Python2/dz38/create_base.py
create_base.py
py
801
python
en
code
0
github-code
1
[ { "api_name": "git_class.models_new.database.create_db", "line_number": 8, "usage_type": "call" }, { "api_name": "git_class.models_new.database.Session", "line_number": 10, "usage_type": "call" }, { "api_name": "git_class.models_new.car.Car", "line_number": 17, "usage_typ...
3740386075
import os import torch import torch.nn.functional as F import glob import imageio import numpy as np from utils.data_utils import get_image_to_tensor, get_mask_to_tensor class DVRDataset(torch.utils.data.Dataset): def __init__(self, args, mode, list_...
xingyi-li/SymmNeRF
code/datasets/dvr_dataset.py
dvr_dataset.py
py
8,219
python
en
code
14
github-code
1
[ { "api_name": "torch.utils", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.tensor", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.long", "line_number": 31, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_n...
25846744127
# -*- coding: utf-8 -*- from contextlib import contextmanager try: from typing import Type except ImportError: # Python 2.x pass import redis import datetime from bitmapist4 import events as ev class Bitmapist(object): """ Core bitmapist object """ # Should hourly be tracked as default? ...
Doist/bitmapist4
bitmapist4/core.py
core.py
py
8,248
python
en
code
21
github-code
1
[ { "api_name": "redis.StrictRedis", "line_number": 27, "usage_type": "call" }, { "api_name": "redis.StrictRedis", "line_number": 33, "usage_type": "attribute" }, { "api_name": "redis.StrictRedis.from_url", "line_number": 36, "usage_type": "call" }, { "api_name": "r...
10813165237
import flask from flask import Flask,request , jsonify from xyz import AddTwo as ad app = Flask(__name__) @ app.route('/') def test(): return jsonify({"status":"ok"}) @ app.route('/parsename',methods=['GET']) def test_name(): var_name = request.args.get("name") return jsonify({"Entered name = ": var...
SaketJNU/software_engineering
rcdu_2750_practicals/rcdu_2750_flask.py
rcdu_2750_flask.py
py
795
python
en
code
15
github-code
1
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.request.args", ...
45121110514
# -*- coding: utf-8 -*- import sys import os import json import argparse def print_rank_0(*args, **kwargs): rank = int(os.getenv("RANK", "0")) if rank == 0: print(*args, **kwargs) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("module_name", type=str) ...
Oneflow-Inc/OneAutoTest
eager/AI_Writer/compare_speed_with_pytorch.py
compare_speed_with_pytorch.py
py
1,978
python
en
code
5
github-code
1
[ { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "json.load", "line_number": 23, "usage_type": "call" }, { "api_name": "sys.path.append", "lin...
19578680978
import os from flask import Blueprint, request, make_response from werkzeug.utils import secure_filename from uploadFileTask import handle_file from ..models import db,Products import pandas as pd #from uploadFileTask import handle_file from multiprocessing.pool import ThreadPool as Pool upload_products = Blueprint('u...
saxenakartik007/ACME
product_importer/routes/uploadProducts.py
uploadProducts.py
py
2,808
python
en
code
0
github-code
1
[ { "api_name": "flask.Blueprint", "line_number": 10, "usage_type": "call" }, { "api_name": "multiprocessing.pool.ThreadPool", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request.files", "line_number": 19, "usage_type": "attribute" }, { "api_name...
1155231342
import pygame class Ship: def __init__(self, screen): self.character = pygame.image.load('hw_images/ship_0009.png') self.character_rect = self.character.get_rect() self.screen_rect = screen.get_rect() self.character_rect.center = self.screen_rect.center self.ship_speed = 1.0...
m251434/alien_invasion
homework/AI_1/rocket.py
rocket.py
py
2,184
python
en
code
0
github-code
1
[ { "api_name": "pygame.image.load", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 35, "usage_type": "call" }, { "api_name": "pygame.display.set_mode...
9628500098
from django.conf.urls import include, url from django.views.generic import RedirectView from . import views person = [ url(r'^$', views.PersonList.as_view(), name='person-list'), url(r'^new/$', views.PersonCreate.as_view(), name='person-create'), url(r'^(?P<pk>[^/]+)/$', views.PersonDetail.as_view(), name...
abertal/alpha
webapp/urls.py
urls.py
py
4,421
python
en
code
5
github-code
1
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
4566060055
from datetime import datetime, timedelta from unittest.mock import AsyncMock from framework.clients.cache_client import CacheClientAsync from framework.di.service_collection import ServiceCollection from clients.azure_gateway_client import AzureGatewayClient from clients.email_gateway_client import EmailGatewayClient...
danleonard-nj/kube-tools-api
services/kube-tools/tests/test_gateway_clients.py
test_gateway_clients.py
py
4,621
python
en
code
0
github-code
1
[ { "api_name": "tests.buildup.ApplicationBase", "line_number": 13, "usage_type": "name" }, { "api_name": "framework.di.service_collection.ServiceCollection", "line_number": 14, "usage_type": "name" }, { "api_name": "unittest.mock.AsyncMock", "line_number": 15, "usage_type"...
28852512367
import tensorflow as tf import matplotlib.pyplot as plt cifar10=tf.keras.datasets.cifar10 (x_train,y_train),(x_test,y_test)=cifar10.load_data() plt.imshow(x_train[0]) #绘制图片 plt.show() print("x_train[0]:\n",x_train[0]) print(y_train) print(x_test.shape)
1414003104/OldSheep_TensorFLow2.0_note
13,卷积神经网络/CIfar10数据集.py
CIfar10数据集.py
py
282
python
en
code
1
github-code
1
[ { "api_name": "tensorflow.keras", "line_number": 4, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplot...
11211086355
from conans import ConanFile, CMake, tools from conans.errors import ConanInvalidConfiguration import glob import os import shutil required_conan_version = ">=1.32.0" class VulkanValidationLayersConan(ConanFile): name = "vulkan-validationlayers" description = "Khronos official Vulkan validation layers for Wi...
SpaceIm/conan-vulkan-validationlayers
conanfile.py
conanfile.py
py
5,098
python
en
code
0
github-code
1
[ { "api_name": "conans.ConanFile", "line_number": 10, "usage_type": "name" }, { "api_name": "conans.tools.check_min_cppstd", "line_number": 48, "usage_type": "call" }, { "api_name": "conans.tools", "line_number": 48, "usage_type": "name" }, { "api_name": "conans.to...
17316210746
""" Flask: Using templates """ from asyncore import read from re import M from turtle import title from setup_db import select_students, select_courses import sqlite3 from sqlite3 import Error from flask import Flask, render_template, request, redirect, url_for, g app = Flask(__name__) DATABASE = './database.db' d...
m92kasem/VueJS-Flask-Full-Stack
assignment-6/app.py
app.py
py
6,247
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.g", "line_number": 19, "usage_type": "argument" }, { "api_name": "flask.g._database", "line_number": 21, "usage_type": "attribute" }, { "api_name": "flask.g", "line_nu...
7417220562
#!/usr/bin/env python3 from pydantic import BaseModel from pydantic.schema import schema from typing import Any class dumClass(BaseModel): A : str = 'Hello' B : str = None C: bool = False def __init__(self, **data: Any): print("dumClass was called") super().__init__(**data) pr...
GLYCAM-Web/gems
gemsModules/deprecated/Examples/Sample_Pydantic_Usage.py
Sample_Pydantic_Usage.py
py
956
python
en
code
1
github-code
1
[ { "api_name": "pydantic.BaseModel", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 12, "usage_type": "name" } ]
23985904341
import hashlib import math import os import re import tkinter import tkinter as tk from tkinter import messagebox, filedialog import threading import pymysql import tkinter as tk from tkinter import ttk import pandas as pd from tkinter import filedialog from openpyxl import Workbook from tkinter import simpledialog fro...
yahayaha001/mysql-table
app.py
app.py
py
42,009
python
en
code
0
github-code
1
[ { "api_name": "pymysql.connect", "line_number": 34, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 41, "usage_type": "attribute" }, { "api_name": "tkinter.Tk", "line_number": 51, "usage_type": "call" }, { "api_name": "tkinter.ttk.Style", ...
26443318875
from django.shortcuts import render, redirect from django.http import JsonResponse from django.contrib.auth import get_user_model, login, logout from django.contrib import messages from . import forms, models # Create your views here. User = get_user_model() def signup_view(request): if request.GET.get('va...
jhonas-palad/permit-application-web
system_auth/views.py
views.py
py
2,659
python
en
code
1
github-code
1
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 9, "usage_type": "call" }, { "api_name": "django.http.JsonResponse", "line_number": 39, "usage_type": "call" }, { "api_name": "django.contrib.messages.success", "line_number": 47, "usage_type": "call" },...
74914202912
import os import tempfile print(tempfile.gettempdir()) print(tempfile.gettempprefix()) with tempfile.TemporaryFile("w+") as tfp: tfp.write("Some temp data") tfp.seek(0) print(tfp.read()) with tempfile.TemporaryDirectory() as tdp: filepath = os.path.join(tdp, "tempfile.txt") print(filepath) ...
cfleschhut/python-standard-library-essential-training-linkedin
files_and_directories/02_temporary_files_and_directories.py
02_temporary_files_and_directories.py
py
449
python
en
code
0
github-code
1
[ { "api_name": "tempfile.gettempdir", "line_number": 4, "usage_type": "call" }, { "api_name": "tempfile.gettempprefix", "line_number": 5, "usage_type": "call" }, { "api_name": "tempfile.TemporaryFile", "line_number": 7, "usage_type": "call" }, { "api_name": "tempfi...
24673403788
# This code is modified from https://github.com/haoheliu/DCASE_2022_Task_5 # This code is modified from DCASE 2022 challenge https://github.com/c4dm/dcase-few-shot-bioacoustic import torch import torch.nn as nn import numpy as np import torch.nn.functional as F from src.models.meta_learning import BaseModel from to...
wty0511/MSc_Individual_Project
src/models/TriNet.py
TriNet.py
py
17,765
python
en
code
0
github-code
1
[ { "api_name": "src.models.meta_learning.BaseModel", "line_number": 26, "usage_type": "name" }, { "api_name": "torch.nn.CrossEntropyLoss", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 35, "usage_type": "name" }, { "api_name": ...
38785947998
import cv2 import tensorflow as tf import numpy as np import mnist import mnist_m import svhn import synthdigits class DataInput(object): def __init__(self, model_params, mnist_type, phase, is_train): self.batch_size = model_params["batch_size"] max_data_num = model_params["max_data_num"] ...
hanzhaoml/MDAN
mnist/mnist_data_input.py
mnist_data_input.py
py
2,986
python
en
code
102
github-code
1
[ { "api_name": "mnist.Mnist", "line_number": 18, "usage_type": "call" }, { "api_name": "mnist_m.MnistM", "line_number": 20, "usage_type": "call" }, { "api_name": "svhn.Svhn", "line_number": 22, "usage_type": "call" }, { "api_name": "synthdigits.SynthDigits", "l...
37129892634
from ..dateparser import DateSearchStatus, AbstractDateParser from .time_parser import TimeParser from .after_minutes_parser import AfterMinutesParser from .after_hours_parser import AfterHoursParser from .relative_day_parser import RelativeDayParser from .day_month_parser import DayMonthParser from .week_day_parser im...
zolateater/reminder-bot
src/bot/dateparser/searcher.py
searcher.py
py
2,341
python
ru
code
0
github-code
1
[ { "api_name": "time_parser.TimeParser", "line_number": 17, "usage_type": "call" }, { "api_name": "after_hours_parser.AfterHoursParser", "line_number": 18, "usage_type": "call" }, { "api_name": "after_minutes_parser.AfterMinutesParser", "line_number": 19, "usage_type": "ca...
15189448225
from Orange.misc.utils.embedder_utils import EmbedderCache from Orange.util import dummy_callback from orangecontrib.imageanalytics.utils.embedder_utils import ImageLoader class LocalEmbedder: embedder = None def __init__(self, model, model_settings): self.embedder = model_settings["model"]() ...
biolab/orange3-imageanalytics
orangecontrib/imageanalytics/local_embedder.py
local_embedder.py
py
1,463
python
en
code
32
github-code
1
[ { "api_name": "orangecontrib.imageanalytics.utils.embedder_utils.ImageLoader", "line_number": 15, "usage_type": "call" }, { "api_name": "Orange.misc.utils.embedder_utils.EmbedderCache", "line_number": 16, "usage_type": "call" }, { "api_name": "Orange.util.dummy_callback", "li...
23462163944
#!/usr/bin/python3 """Networking with Python. Similar to the "2-post_email.py" task but with `requests`. """ import sys import requests if __name__ == "__main__": if len(sys.argv) < 3: sys.exit(1) email = requests.post( sys.argv[1], data={"email": sys.argv[2]}, ti...
brian-ikiara/alx-higher_level_programming
0x11-python-network_1/6-post_email.py
6-post_email.py
py
382
python
en
code
0
github-code
1
[ { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 16...
27463864604
import os import argparse from os.path import join import cv2 import dlib from PIL import Image as pil_image from tqdm import tqdm import numpy as np from pathlib import Path from dataset import image_paths, _find_images def get_boundingbox(face, width, height, scale=1.3, minsize=None): x1 = face.lef...
Aayushi0008/Deepfake-Detection
src/process_frames.py
process_frames.py
py
4,282
python
en
code
1
github-code
1
[ { "api_name": "cv2.VideoCapture", "line_number": 36, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_FPS", "line_number": 39, "usage_type": "attribute" }, { "api_name": "cv2.CAP_PROP_FRAME_COUNT", "line_number": 40, "usage_type": "attribute" }, { "api_name": "...
18203106433
import logging from ..conversions.types import decode_dict from . import messages from .. import settings logger = logging.getLogger(__name__) READS_QUEUES = ("os2ds_representations",) WRITES_QUEUES = ( "os2ds_handles", "os2ds_matches", "os2ds_checkups", "os2ds_conversions",) PROMETHEUS_DESCRIPTION = ...
os2datascanner/os2datascanner
src/os2datascanner/engine2/pipeline/matcher.py
matcher.py
py
3,213
python
en
code
8
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "conversions.types.decode_dict", "line_number": 20, "usage_type": "call" }, { "api_name": "run_stage._compatibility_main", "line_number": 83, "usage_type": "call" } ]
37583544991
import pygame import itertools screen_size = (1920, 1080) # pastel pink LOW_COLOR = (255,209,220) # deep blue MED_COLOR = (7, 42, 108) # red PARTY_COLOR = (255, 0, 0) color_map = { 'LOW': LOW_COLOR, 'MED': MED_COLOR, 'PARTY': PARTY_COLOR } class VibeLight: def __init__(self): self.is_on = Fa...
shivenk78/Spotify-Mood-Detector
vibe_light.py
vibe_light.py
py
556
python
en
code
0
github-code
1
[ { "api_name": "pygame.init", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 26, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pygame.displa...
25952493404
from flask import Flask, render_template,request, redirect, session app = Flask(__name__) app.secret_key = 'what sup?' # our index route will handle rendering our form @app.route('/') def index(): return render_template("index.html") @app.route('/process', methods=['POST']) def submit_survey(): print("Got Post...
THEWENDI/Dojo-Survey
server.py
server.py
py
907
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 2, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.request...
6208541600
# -*- coding: utf-8 -*- """ usage: $ baseline_taskAB.py gold_file system_file taskName - gold_file and system_file are tab-separated, UTF-8 encoded files - taskName is the name of the task (A|B) """ import argparse, sys from sklearn.metrics import precision_recall_fscore_support as score from sklearn.metri...
msang/haspeede
2020/eval_taskAB.py
eval_taskAB.py
py
1,742
python
en
code
10
github-code
1
[ { "api_name": "sklearn.metrics.precision_recall_fscore_support", "line_number": 36, "usage_type": "call" }, { "api_name": "sklearn.metrics.precision_recall_fscore_support", "line_number": 42, "usage_type": "call" }, { "api_name": "sklearn.metrics.confusion_matrix", "line_numb...
36579701554
#!/usr/bin/env python # coding: utf-8 # - Edge weight is inferred by GNNExplainer and node importance is given by five Ebay annotators. Not every annotator has annotated each node. # - Seed is the txn to explain. # - id is the community id. import math from tqdm.auto import tqdm import random import pandas as pd imp...
eBay/xFraud
xfraud/supplement/07Learning_hybrid/ours_learn-grid-A.py
ours_learn-grid-A.py
py
7,760
python
en
code
56
github-code
1
[ { "api_name": "warnings.filterwarnings", "line_number": 22, "usage_type": "call" }, { "api_name": "optparse.OptionParser", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 39, "usage_type": "call" }, { "api_name": "pandas....
19205793084
# Code from Chapter 3 of Machine Learning: An Algorithmic Perspective (2nd Edition) # by Stephen Marsland (http://stephenmonika.net) # You are free to use, change, or redistribute the code in any way you wish for # non-commercial purposes, but please maintain the name of the original author. # This code comes with no...
hiryou/ml-ludus
ludus/book_practice/ml_algo_pers/Ch3/pima_bare_ann.py
pima_bare_ann.py
py
3,774
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 32, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 32, "usage_type": "name" }, { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 33, "usage_type": "call" }, { "api_n...
43753374625
#!/usr/bin/env python # -*- coding: utf-8 -*- import cv2 import torch import rospy import numpy as np from std_msgs.msg import Header from sensor_msgs.msg import Image from yolov5_ros_msgs.msg import BoundingBox, BoundingBoxes from yolo_new.msg import Flag,Serial_RT IsMoving = 0 SingleSortOK = 1 class Yolo_Dect: ...
Anxy02/Refuse-Classification-Machine
src/yolov5_ros/scripts/yolo_v5.py
yolo_v5.py
py
8,438
python
en
code
1
github-code
1
[ { "api_name": "rospy.get_param", "line_number": 21, "usage_type": "call" }, { "api_name": "rospy.get_param", "line_number": 23, "usage_type": "call" }, { "api_name": "rospy.get_param", "line_number": 24, "usage_type": "call" }, { "api_name": "rospy.get_param", ...
2819023333
import pygame import random import math import pygetwindow as gw pygame.init() # Configuración de la pantalla screen_info = pygame.display.Info() screen_width = screen_info.current_w screen_height = screen_info.current_h # Obtener todas las ventanas abiertas windows = gw.getWindowsWithTitle('') target_windows = [win...
SicerBrito/Scripts
Etica/bb/f.py
f.py
py
1,917
python
en
code
13
github-code
1
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display.Info", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygetwindow.getWindo...
23983252086
import pygame from MENU.Application import Application from CORE.main_junction import core #this class file served to activate the game with the selected paramters previously class Play(Application): def __init__(self, game): Application.__init__(self, game) self.player_parameters = [["PLAYER1","S...
SlyLeoX/Cyber-Puck
Cyberpuck_ReleaseDirectory/MENU/Play.py
Play.py
py
866
python
en
code
1
github-code
1
[ { "api_name": "MENU.Application.Application", "line_number": 7, "usage_type": "name" }, { "api_name": "MENU.Application.Application.__init__", "line_number": 9, "usage_type": "call" }, { "api_name": "MENU.Application.Application", "line_number": 9, "usage_type": "name" ...
40826778374
import datetime import glob import os import subprocess import numpy as np import pandas as pd import pose import poses import rosbag # Forward errors so we can recover failures # even when running commands through multiprocessing # pooling def full_traceback(func): import functools import traceback @fu...
InnovativeDigitalSolution/NASA_astrobee
tools/graph_bag/scripts/utilities.py
utilities.py
py
7,299
python
en
code
0
github-code
1
[ { "api_name": "traceback.format_exc", "line_number": 25, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 20, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.join", "li...
41035568274
import typing from sqlalchemy import and_ from sqlalchemy import Boolean from sqlalchemy import cast from sqlalchemy import column from sqlalchemy import DateTime from sqlalchemy import false from sqlalchemy import Float from sqlalchemy import func from sqlalchemy import Integer from sqlalchemy import or_ from sqlalch...
sqlalchemy/sqlalchemy
test/typing/plain_files/sql/sql_operations.py
sql_operations.py
py
4,144
python
en
code
8,024
github-code
1
[ { "api_name": "sqlalchemy.column", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 23, "usage_type": "argument" }, { "api_name": "sqlalchemy.column", "line_number": 25, "usage_type": "call" }, { "api_name": "sqlalchemy...
30094361627
#### with lru caching method ######### from functools import lru_cache @lru_cache(maxsize=16) def fib(n): if n<=2 : return 1 return fib(n-1) + fib(n-2) print(fib(50)) ######################### with memoization technique ######### def fib(n,memo): if (n in memo): ...
HemantJaiman/Dynamic_programming
fibonacci.py
fibonacci.py
py
474
python
en
code
1
github-code
1
[ { "api_name": "functools.lru_cache", "line_number": 6, "usage_type": "call" } ]
27487883436
import sys from cx_Freeze import setup, Executable # Dependencies are automatically detected, but it might need # fine tuning. buildOptions = dict( packages = [], excludes = [], include_files = ['icon','toc'], ) name = 'example' if sys.platform == 'win32': name = name + '.exe' base = None if sys.platform == ...
lugandong/PyQt5Fastboot
setup_cxfreeze.py
setup_cxfreeze.py
py
638
python
en
code
0
github-code
1
[ { "api_name": "sys.platform", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.platform", "line_number": 18, "usage_type": "attribute" }, { "api_name": "cx_Freeze.Executable", "line_number": 22, "usage_type": "call" }, { "api_name": "cx_Freeze.se...
31983782662
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from pytorch3d.ops import knn_points, ball_query from .logger import logger def index_points(points, idx): """ Input: points: input points data, [B, N, C] idx: sample index data, [B, S, [K]] Return: ...
lixiny/POEM
lib/utils/points_utils.py
points_utils.py
py
1,345
python
en
code
51
github-code
1
[ { "api_name": "torch.gather", "line_number": 19, "usage_type": "call" }, { "api_name": "pytorch3d.ops.ball_query", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.sum", "line_number": 25, "usage_type": "call" }, { "api_name": "logger.logger.warning...
73865842594
import asyncio from supybot import callbacks, httpserver, log from .helpers import github # Import files that will hook themself up when imported from .events import ( # noqa commit_comment, discussion, issue, pull_request, push, tag, ) from .patches import gidgethub # noqa from .protocols ...
OpenTTD/DorpsGek
plugins/GitHub/plugin.py
plugin.py
py
1,760
python
en
code
1
github-code
1
[ { "api_name": "supybot.httpserver.SupyHTTPServerCallback", "line_number": 21, "usage_type": "attribute" }, { "api_name": "supybot.httpserver", "line_number": 21, "usage_type": "name" }, { "api_name": "asyncio.run", "line_number": 36, "usage_type": "call" }, { "api...
20165490930
import pytest import for_mocking """ 1. Реализовать программу на Python. Программа может содержать любое количество методов и классов (>0), но обязательно должна иметь класс main. 2. Имитировать: a. Метод созданного класса (метод не должен являться генератором). b. Параметр внутри метода класса. c. Класс....
iwouldnote/travis_codecod_test
test_mocking.py
test_mocking.py
py
2,227
python
ru
code
0
github-code
1
[ { "api_name": "for_mocking.Main", "line_number": 19, "usage_type": "call" }, { "api_name": "for_mocking.Main", "line_number": 27, "usage_type": "call" }, { "api_name": "for_mocking.Main", "line_number": 35, "usage_type": "attribute" }, { "api_name": "for_mocking.M...
35915131671
# Mathematics > Probability > Sherlock and Probability # Help Sherlock in finding the probability. # # https://www.hackerrank.com/challenges/sherlock-and-probability/problem # https://www.hackerrank.com/contests/infinitum-jul14/challenges/sherlock-and-probability # challenge id: 2534 # from fractions import Fraction ...
rene-d/hackerrank
mathematics/probability/sherlock-and-probability.py
sherlock-and-probability.py
py
738
python
en
code
72
github-code
1
[ { "api_name": "fractions.Fraction", "line_number": 25, "usage_type": "call" } ]
17811262113
#!/usr/bin/env python3 import numpy as np import h5py import argparse import matplotlib import matplotlib.pyplot as plt import csv import glob import os def get_dataset_keys(f): keys = [] f.visit(lambda key : keys.append(key) if isinstance(f[key], h5py.Dataset) else None) return keys def plot(time, dat...
MichaelSt98/milupHPC
postprocessing/PlotMinMaxMean.py
PlotMinMaxMean.py
py
3,358
python
en
code
6
github-code
1
[ { "api_name": "h5py.Dataset", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.system", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
24477230064
#!/usr/bin/env python # -*- coding: utf-8 -*- # from django.conf.urls import patterns, url from .views import PromoDetail, PromoList, ChannelPromoList urlpatterns = patterns( '', url( r'^$', PromoList.as_view(), name='list_promos' ), url( r'^channel/(?P<channel__long_s...
opps/opps-promos
opps/promos/urls.py
urls.py
py
646
python
en
code
5
github-code
1
[ { "api_name": "django.conf.urls.patterns", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "views.PromoList.as_view", "line_number": 13, "usage_type": "call" }, { "api_name": ...
41292812898
import decimal import io from nose.tools import assert_equal import utcdatetime from os.path import join as pjoin from snipe import WatchListSnipesParser, parse_datetime def test_get_snipes(): with io.open(pjoin('sample_data', 'watch_list.html')) as f: parser = WatchListSnipesParser(f.read()) asser...
fawkesley/ebay-sniper
test_parser.py
test_parser.py
py
1,241
python
en
code
0
github-code
1
[ { "api_name": "io.open", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "snipe.WatchListSnipesParser", "line_number": 13, "usage_type": "call" }, { "api_name": "nose.tools.assert_eq...
73380743073
import numpy as np import pandas as pd from sklearn.metrics import log_loss from sklearn.model_selection import StratifiedKFold, StratifiedShuffleSplit from keras.callbacks import ModelCheckpoint, Callback, EarlyStopping from data_loader import get_data, generator def cross_validation(model, X_train, X_train_angle, Y...
hzxsnczpku/nishiyami
train.py
train.py
py
1,980
python
en
code
0
github-code
1
[ { "api_name": "sklearn.model_selection.StratifiedKFold", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.metrics.log_loss", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 45, "usage_type": "call" }, { "api_na...
15758517730
from django.urls import path, include from website.views import home, blog, perfil, login, acessar, cadastrar urlpatterns = [ path('', home), path('blog', blog), path('login', login), path('acessar', acessar), path('perfil', perfil), path('cadastrar', cadastrar), ]
isadoraperes/projeto-demoday
website/urls.py
urls.py
py
291
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "website.views.home", "line_number": 5, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "website.views.b...
1990468444
from msilib.schema import Error import matplotlib.pyplot as plt import numpy as np import boto3 import os def draw_chart(result, user_id, practice_id, gender): w_min_jitter = 1.599 w_max_jitter = 2.310 w_min_shimmer = 7.393 w_max_shimmer = 12.221 m_min_jitter = 2.159 m_max_jitter = 3.023 m...
Sookpeech/django-analysis
sookpeech_analysis/analysis/make_chart.py
make_chart.py
py
5,246
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.xlabel", "line_number": 28, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 28, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ylabel", "line_number": 29, "usage_type": "call" }, { "api_name": "m...
73428873635
#!/usr/bin/env python import time import openstack NODE_COUNT = 43 def get_connection(): # openstack.enable_logging(debug=True) conn = openstack.connect() return conn def main(): conn = get_connection() for i in range(NODE_COUNT): name = "euclid-ral_compute_%d" % i conn.delete_server...
astrodb/euclid-saas
delete_servers_euclid.py
delete_servers_euclid.py
py
500
python
en
code
2
github-code
1
[ { "api_name": "openstack.connect", "line_number": 7, "usage_type": "call" } ]
11720956852
# -*- coding: utf-8 -*- """ Preppin' Data 2020: Week 9 - C&BS Co: Political Monitoring https://preppindata.blogspot.com/2020/02/2020-week-9.html - Input data - Remove the Average Record for the polls - Clean up your Dates - Remove any Null Poll Results - Form a Rank (modified competition) of the candidates pe...
kelly-gilbert/preppin-data-challenge
2020/preppin-data-2020-09/preppin-data-2020-09.py
preppin-data-2020-09.py
py
9,113
python
en
code
19
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 47, "usage_type": "call" }, { "api_name": "pandas.DateOffset", ...
11196016804
import sys import pygame import random from src import hero from src import enemy class Controller: def __init__(self, width=640, height=480): """ Initializes and sets up the game args: self.width (int) Width (left to right) of the screen self.height (int) Height (top t...
brianskim27/cs110
ch-11-lab-brianskim27/src/controller.py
controller.py
py
4,941
python
en
code
0
github-code
1
[ { "api_name": "pygame.init", "line_number": 25, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 28, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pygame.Surfac...
23938708203
# A very simple Flask Hello World app for you to get started with... import logging, sys from flask import Flask, request from CrapBot import Bot crap_bot = Bot() app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello from Flask!' @app.route('/bot', methods=['POST', 'GET']) def bot(): update...
Markcial/CrapBot
flask_app.py
flask_app.py
py
588
python
en
code
1
github-code
1
[ { "api_name": "CrapBot.Bot", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.json", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.request", "li...
74219528992
from lyse import * import matplotlib.pyplot as plt import numpy as np from scipy.optimize import curve_fit import scipy.constants as constants import AnalysisSettings import SrConstants from Subroutines.FitFunctions import gauss from scipy import stats camera = AnalysisSettings.Camera pixelSize = SrConstants.pixelSiz...
Loki27182/userlib
analysislib/SrII/old_stuff/AnalysisMultishot.py
AnalysisMultishot.py
py
5,763
python
en
code
0
github-code
1
[ { "api_name": "AnalysisSettings.Camera", "line_number": 12, "usage_type": "attribute" }, { "api_name": "SrConstants.pixelSizeDict", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 48, "usage_type": "call" }, { "api_name"...
35076946414
""" Harvester scripts Currently only supports AVR atdf files """ # Python 3 compatibility for Python 2 from __future__ import print_function import argparse import textwrap from xml.etree import ElementTree from pymcuprog.deviceinfo.memorynames import MemoryNames from pymcuprog.deviceinfo.deviceinfokeys import Devic...
SpenceKonde/megaTinyCore
megaavr/tools/libs/pymcuprog/deviceinfo/harvest.py
harvest.py
py
12,647
python
en
code
471
github-code
1
[ { "api_name": "pymcuprog.deviceinfo.memorynames.MemoryNames.FLASH", "line_number": 25, "usage_type": "attribute" }, { "api_name": "pymcuprog.deviceinfo.memorynames.MemoryNames", "line_number": 25, "usage_type": "name" }, { "api_name": "pymcuprog.deviceinfo.memorynames.MemoryNames...
32150920427
from django.db.models import F from django.contrib.auth.models import User from lunchclub.models import AccessToken class TokenBackend(object): def authenticate(self, token=None): try: token = AccessToken.objects.get(token=token) except AccessToken.DoesNotExist: return None...
Mortal/django-lunchclub
lunchclub/auth.py
auth.py
py
523
python
en
code
0
github-code
1
[ { "api_name": "lunchclub.models.AccessToken.objects.get", "line_number": 9, "usage_type": "call" }, { "api_name": "lunchclub.models.AccessToken.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "lunchclub.models.AccessToken", "line_number": 9, "usage_...
42614393833
import pandas as pd import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation # Global variables csv_file = 'RealtimePlot.csv' # Replace with the path to your CSV file update_interval = 1000 # Update plot every 1000 milliseconds (1 second) fig, ax = plt.subplots() ax2 = ax.twinx() # Function t...
wendycahya/Yaskawa-Communication
IntegratedSystem/Realtime-Video.py
Realtime-Video.py
py
1,139
python
en
code
3
github-code
1
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib...
28015752990
# @time : 2020/7/12 16:35 # @author : HerbLee # @file : finance.py from sanic import Blueprint from sanic.response import text from models.funddb import FundDb, CurrentFund fund = Blueprint("fund", url_prefix="/fund") @fund.route("/get_data") async def get_v2_data(request): return text("it is finance") ...
HerbLee/dawning
api/finance/fund.py
fund.py
py
931
python
en
code
0
github-code
1
[ { "api_name": "sanic.Blueprint", "line_number": 9, "usage_type": "call" }, { "api_name": "sanic.response.text", "line_number": 14, "usage_type": "call" }, { "api_name": "models.funddb.FundDb.filter", "line_number": 22, "usage_type": "call" }, { "api_name": "models...
17127249082
import numpy as np import pandas as pd import seaborn as sns; sns.set() import matplotlib.pyplot as plt from multiprocessing import Pool from functools import partial from sklearn.model_selection import KFold from MatrixFactorization import FactorizeMatrix, GetRepresentationError, CreateLatentVariables from FeatureSi...
psturmfels/cfAD
CrossValidation.py
CrossValidation.py
py
6,649
python
en
code
1
github-code
1
[ { "api_name": "seaborn.set", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.random.uniform", ...
22525745523
''' print out cmds for training and inference ''' import argparse import os from DPR.dpr.utils.tasks import task_map, train_cluster_map, test_cluster_map import random import textwrap from tqdm import tqdm def wrap(cmd): ''' wrap cmd ''' bs = ' \\\n\t ' return bs.join(textwrap.wrap(cmd,break_lon...
microsoft/LMOps
uprise/get_cmds.py
get_cmds.py
py
14,669
python
en
code
2,623
github-code
1
[ { "api_name": "textwrap.wrap", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_numb...
42113373089
import os import PIL import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.axes_grid1 import ImageGrid imgs = [] directory = "output/grids" # for filename in os.listdir(directory): # print(filename) # image = PIL.Image.open(os.path.join(directory, filename)) # imgs.append(np.array(image)) f...
benjaminlyons/lear
display_grid.py
display_grid.py
py
664
python
en
code
0
github-code
1
[ { "api_name": "PIL.Image.open", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", ...
32434624148
import logging import os import signal import watchdog.events import watchdog.observers.polling import watchdog_gevent # https://github.com/Bogdanp/dramatiq/blob/master/dramatiq/__main__.py def setup_file_watcher(path, callback, use_polling=False): """Sets up a background thread that watches for source changes a...
geyang/ml_logger
scratch/old/vis_server_gevent_deprecated/file_watcher.py
file_watcher.py
py
1,341
python
en
code
176
github-code
1
[ { "api_name": "watchdog.events.observers", "line_number": 17, "usage_type": "attribute" }, { "api_name": "watchdog.events", "line_number": 17, "usage_type": "name" }, { "api_name": "watchdog_gevent.Observer", "line_number": 19, "usage_type": "attribute" }, { "api_...
2014274942
from datetime import datetime from tqdm.auto import tqdm import torch import torch.nn as nn from torch.nn.utils import clip_grad_norm_ from sklearn import metrics import numpy as np from model import VLPForTokenClassification, model_config_factory from dataset import dataset_factory from training.utils import get_toke...
filipbasara0/visual-language-processing
training/train_token_cls.py
train_token_cls.py
py
13,267
python
en
code
0
github-code
1
[ { "api_name": "warnings.filterwarnings", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 54, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 54, "usage_type": "name" }, { "api_name": "train...
4947865207
import time import unittest import os from selenium import webdriver from selenium.webdriver.common.keys import Keys class ITTroubleshooterSearchTest(unittest.TestCase): def setUp(self): caps = {'browserName': os.getenv('firefox', 'firefox')} self.browser = webdriver.Remote( command...
kumargaurav522/selenium
test2.py
test2.py
py
1,003
python
en
code
0
github-code
1
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver.Remote", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.web...
74736245474
from flask import Blueprint,flash,url_for,redirect,render_template,request from flask_login import login_required from ksk.models import Pizza from ksk import db from ksk.pizza.utils import save_img_for_pizza from ksk.pizza.forms import PizzaForm pizzas = Blueprint('pizzas',__name__) ########## Pizza Upload #########...
ZiG-Z/KSK-Bakery
ksk/pizza/routes.py
routes.py
py
1,280
python
en
code
0
github-code
1
[ { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "ksk.pizza.forms.PizzaForm", "line_number": 14, "usage_type": "call" }, { "api_name": "ksk.models.Pizza", "line_number": 16, "usage_type": "call" }, { "api_name": "ksk.pizza.u...
3168586227
import os import csv import glob import json import torch import warnings import itertools import torchaudio import numpy as np from pathlib import Path from tqdm import tqdm from PIL import Image as PILImage from itertools import cycle, islice, chain from einops import rearrange, repeat import multiprocessing as mp i...
zhaoyanpeng/vipant
cvap/data/image_text.py
image_text.py
py
6,470
python
en
code
19
github-code
1
[ { "api_name": "audio_text.AudioTextDatasetSrc", "line_number": 29, "usage_type": "name" }, { "api_name": "image.make_clip_image_transform", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 39, "usage_type": "call" }, { "api_nam...
70388329635
# Libraries import streamlit as st import pandas as pd import plotly.express as px import plotly.graph_objects as go import plotly.subplots as sp # Global Variables theme_plotly = None # None or streamlit week_days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] # Layout...
Kaizen-Step/The_Whales_of_Near
pages/2_🌌_Transaction.py
2_🌌_Transaction.py
py
15,724
python
en
code
1
github-code
1
[ { "api_name": "streamlit.set_page_config", "line_number": 14, "usage_type": "call" }, { "api_name": "streamlit.title", "line_number": 16, "usage_type": "call" }, { "api_name": "streamlit.markdown", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.r...
33881074633
from euclide import solve_chinese_remainders from utils import timeit @timeit def get_data(): with open('input.txt') as input_file: timestamp = int(input_file.readline()) buses = input_file.readline().strip().split(',') return timestamp, buses def get_time(timestamp, bus): time = timesta...
bdaene/advent-of-code
2020/day13/solve.py
solve.py
py
1,351
python
en
code
1
github-code
1
[ { "api_name": "utils.timeit", "line_number": 5, "usage_type": "name" }, { "api_name": "utils.timeit", "line_number": 20, "usage_type": "name" }, { "api_name": "euclide.solve_chinese_remainders", "line_number": 44, "usage_type": "call" }, { "api_name": "utils.timei...
33578016636
import numpy as np import os, random import cv2 import colorsys from PIL import Image, ImageDraw, ImageFont from pipeline.bbox import Box def get_colors_for_classes(num_classes): if (hasattr(get_colors_for_classes, "colors") and len(get_colors_for_classes.colors) == num_classes): return get_colors...
11mhg/utils
draw/draw.py
draw.py
py
2,604
python
en
code
0
github-code
1
[ { "api_name": "colorsys.hsv_to_rgb", "line_number": 15, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 19, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 20, "usage_type": "call" }, { "api_name": "random.seed", "lin...
31257724932
""" Create a chart showing movie recommendation frequencies and save as an Altair JSON for displaying on a webpage """ import pandas as pd import altair as alt from sql_tables import connect_to_db, read_tables from sql_tables import HOST, PORT, USERNAME, PASSWORD, DB def create_frequency_chart(engine, ...
soil55/flannflix
frequency_chart.py
frequency_chart.py
py
3,101
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 27, "usage_type": "call" }, { "api_name": "sql_tables.read_tables", "line_number": 29, "usage_type": "call" }, { "api_name": "altair.Chart", "line_number": 53, "usage_type": "call" }, { "api_name": "altair.Color", ...
2313246928
from API_request import get_price import telebot url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest' parameters = { 'start': '1', 'limit': '5000', 'convert': 'USD' } headers = { 'Accepts': 'application/json', 'X-CMC_PRO_API_KEY': 'CMC api-key', } bot = teleb...
axyzz/exrbot
main.py
main.py
py
765
python
en
code
0
github-code
1
[ { "api_name": "telebot.TeleBot", "line_number": 16, "usage_type": "call" }, { "api_name": "API_request.get_price", "line_number": 26, "usage_type": "call" } ]
74584190434
#-*- coding:utf-8 -*- from torch.utils.tensorboard import SummaryWriter from network import Generator, Discriminator from toolbox import Train_Handler, parse from dataset import Real_Data_Generator from torch.utils.data import DataLoader import torchvision.transforms as T import torch.optim as optim import numpy as np...
galaxygliese/Simple-Implementation-of-StyleGAN2-PyTorch
train.py
train.py
py
3,100
python
en
code
1
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "toolbox.parse", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.random"...
29637290452
import re import types from docutils import nodes from sphinx.util.docutils import SphinxDirective from . import xnodes class UserRepository: def __init__(self): self._data = None self._env = None self._fullnames = None def clear(self): self._data = None self._fullname...
h2oai/datatable
docs/_ext/xcontributors.py
xcontributors.py
py
15,129
python
en
code
1,763
github-code
1
[ { "api_name": "types.SimpleNamespace", "line_number": 24, "usage_type": "call" }, { "api_name": "sphinx.util.docutils.SphinxDirective", "line_number": 173, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 186, "usage_type": "call" }, { "api_name"...
72490710755
from collections import deque class Solution: def validUtf8( data: 'list[int]') -> bool: start = 0 #data a deque for easy poping so that we can go through the list of nums effeciently data = deque(data) try: while data: #& means only the overlapping w...
lucasrouchy/validUTF
validUTF.py
validUTF.py
py
2,379
python
en
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 8, "usage_type": "call" } ]
71942633953
# kdc server from http.server import BaseHTTPRequestHandler, HTTPServer import json CLIENT_KEY="CLIENT_KEY" TGS_KEY="TGS_KEY" SERVER_KEY="SERVER_KEY" CT_SK="CT_SK" CS_SK="CS_SK" DATA_SERVER='http://localhost:8002' class MyHandler(BaseHTTPRequestHandler): def SendRep(self, data): self.send_response(200)...
WangWeiPengHappy/simple_kerberos
source/kdc.py
kdc.py
py
2,319
python
en
code
0
github-code
1
[ { "api_name": "http.server.BaseHTTPRequestHandler", "line_number": 15, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 21, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 66, "usage_type": "call" }, { "api_name": "http.server....
19031021092
import pandas as pd from sklearn.datasets import make_classification from sklearn.ensemble import RandomForestClassifier as RFC from src.icll import ICLL X, y = make_classification(n_samples=500, n_features=5, n_informative=3) X = pd.DataFrame(X) icll = ICLL(model_l1=RFC(), model_l2=RFC()) icll.fit(X, y) probs = ic...
vcerqueira/blog
posts/class_imbalance_icll.py
class_imbalance_icll.py
py
2,808
python
en
code
15
github-code
1
[ { "api_name": "sklearn.datasets.make_classification", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 8, "usage_type": "call" }, { "api_name": "src.icll.ICLL", "line_number": 10, "usage_type": "call" }, { "api_name": "skl...
9378055793
import os import json import time import requests from math import floor import vlc def download(): print('We need to download data from the web...one moment') URL = "http://91.132.145.114/json/stations" response = requests.get(URL) if response.status_code == 200: open("stations", "wb").write(r...
maccu71/projects
stacje.py
stacje.py
py
2,542
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.getmtime", "line...
72556059235
#!/usr/bin/python3 """A Base class""" import json import turtle import csv class Base: """A Base class""" __nb_objects = 0 def __init__(self, id=None): """constructor for Base class Args: id (int): an id attribute. Defaults to None. """ if id is not None: ...
Martin-do/alx-higher_level_programming
0x0C-python-almost_a_circle/models/base.py
base.py
py
5,721
python
en
code
0
github-code
1
[ { "api_name": "json.dumps", "line_number": 37, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 65, "usage_type": "call" }, { "api_name": "csv.DictWriter", "line_number": 112, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_numb...
30171935940
from objects.anyPage import anyPage from objects.customParser import parser from os.path import dirname, abspath from configparser import ConfigParser import json class configurator: def __init__(self,value): configParser = ConfigParser() self._configPath = dirname(dirname(abspath(__file__))) + "/config/config....
giantpanda9/codesamples-python3-gevent-site-parser
objects/customCrawlerConfigurator.py
customCrawlerConfigurator.py
py
2,833
python
en
code
0
github-code
1
[ { "api_name": "configparser.ConfigParser", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "json.loads",...
72780642275
import os import smtpd import sys import asyncore import email from email.header import decode_header ######################################################################## # # # IF YOU CHANGE THIS FILE, YOU HAVE TO REBUILD THE DOCKER CONTAINER # THE CURRENT manual_run.py will not detect changes # # ###############...
bjcoleman/katacoda-scenarios
git-keeper-tutorial/assets/mysmtpd.py
mysmtpd.py
py
2,486
python
en
code
0
github-code
1
[ { "api_name": "smtpd.DebuggingServer", "line_number": 19, "usage_type": "attribute" }, { "api_name": "smtpd.DebuggingServer.__init__", "line_number": 37, "usage_type": "call" }, { "api_name": "smtpd.DebuggingServer", "line_number": 37, "usage_type": "attribute" }, { ...
988817178
# -*- coding: utf-8 -*- """ Created on Mon Sep 27 17:18:39 2021 @author: Dell """ import pandas as pd from sklearn.utils import shuffle from sklearn.ensemble import RandomForestRegressor from sklearn.model_selection import cross_val_score, cross_validate, cross_val_predict from sklearn.model_selection import GridSea...
Slbalderrama/Phd_Thesis_Repository
Electrification_Path/Plot_Scenarios.py
Plot_Scenarios.py
py
3,532
python
en
code
1
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
22025020858
import networkx as nx from random import randint from math import exp import numpy as np from typing import List, Dict, FrozenSet, Iterator, Tuple from pydantic import BaseModel from .graph_utils import ( list_subsets_of_given_size, pairs_of_sets, ) class SubtreeData(BaseModel): agg_root: int agg_size...
sowiks2711/color-coding-subtree-isomorphism
color_coding/time_optimised_alg.py
time_optimised_alg.py
py
8,360
python
en
code
0
github-code
1
[ { "api_name": "pydantic.BaseModel", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 24, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 25, "usage_type": "name" }, { "api_name": "networkx.Graph", "line...
17145656675
import json import flask from flask import request from datetime import datetime import psycopg2 from flask import make_response from werkzeug import exceptions import waitress app = flask.Flask(__name__) def query(sql, *args): with psycopg2.connect("dbname=nosp_walk user=postgres") as conn: with conn....
Nosp27/nosp-walk
backend/app_init.py
app_init.py
py
2,329
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 29, "usage_type": "call" }, { "api_name": "flask.request.data", "lin...
33577989736
import os, sys import torch import torchvision as tv import cv2 import numpy as np from matplotlib import pyplot as plt from dataset import coco_labels def box_cxcywh_to_xyxy(box): """ Convert bounding box from center-size to xyxy format. :param box: bounding box in center-size format :return: bound...
11mhg/theia-detr
utils.py
utils.py
py
2,045
python
en
code
0
github-code
1
[ { "api_name": "torch.stack", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.max", "line_number": 42, "usage_type": "call" }, { "api_name": "torch.min", "line_number": 43, "usage_type": "call" }, { "api_name": "torch.min", "line_number": 69, ...
31267879602
from rest_framework.fields import IntegerField from rest_framework.serializers import ModelSerializer, Serializer from post.models import Post, PostLike class PostCreateSerializer(ModelSerializer): class Meta: model = Post fields = ( 'id', 'text', 'author_id', ...
RomanDemianenko/starnavi
post/api/serialzers.py
serialzers.py
py
754
python
en
code
0
github-code
1
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 7, "usage_type": "name" }, { "api_name": "post.models.Post", "line_number": 9, "usage_type": "name" }, { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 20, "usage_type": "...
25645483609
# coding = utf-8 import os import torch from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler, TensorDataset, Dataset) class InputExample(object): """A single training/test example for simple sequence classification.""" def __init__(self, guid, _input, _output = None): """Constru...
BruceQ74/Basic_NLG
data_utils.py
data_utils.py
py
6,353
python
en
code
0
github-code
1
[ { "api_name": "torch.utils.data.Dataset", "line_number": 20, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_number": 39, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
30188716160
import datetime from util.util import CGreeks, CSingleOptHolding from util.COption import COption import pandas as pd class COptHolding(object): """期权持仓类""" def __init__(self, str_logfile_path=None): """ 初始化持仓数据及持仓汇总希腊字母 class attributes: holdings: {'code': CSingleOptHolding} ...
rafs/OptVolTrading
util/COptHolding.py
COptHolding.py
py
18,040
python
en
code
8
github-code
1
[ { "api_name": "util.util.CGreeks", "line_number": 36, "usage_type": "call" }, { "api_name": "util.COption.COption", "line_number": 91, "usage_type": "call" }, { "api_name": "util.util.CSingleOptHolding", "line_number": 92, "usage_type": "call" }, { "api_name": "da...
38566374238
import torch import cv2 import numpy as np import math from sklearn.metrics import f1_score from torch.autograd import Variable from matplotlib.image import imread # function for colorizing a label image: def label_img_to_color(img: torch.Tensor): # label_to_color = { # 0: [128, 64,128], # 1: [24...
ZombaSY/Pore-Net-release
models/utils.py
utils.py
py
27,246
python
en
code
0
github-code
1
[ { "api_name": "torch.Tensor", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.where", "line_number": 50, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 50, "usage_type": "call" }, { "api_name": "cv2.applyColorMap", "l...
5065913081
"""Transforms for preprocessing images during data loading""" import PIL import torch import copy import numpy as np def img_pad(img, mode='warp', size=224): """ Pads a given image. Crops and/or pads a image given the boundries of the box needed img: the image to be coropped and/or padded bbox: th...
DongxuGuo1997/TransNet
src/transform/transforms.py
transforms.py
py
6,739
python
en
code
6
github-code
1
[ { "api_name": "PIL.Image", "line_number": 28, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_number": 38, "usage_type": "attribute" }, { "api_name": "PIL.Image.new", "line_number": 39, "usage_type": "call" }, { "api_name": "PIL.Image", "line_num...
42894401315
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Nov 16 17:57:13 2019 @author: jcunanan """ ####################################### # Problem Description #Bob the Adventurer is one step away from solving the mystery of an ancient Mayan tomb. #He just approched the secret chamber where the secre...
j-cunanan/Fun-Algorithm-Problems
Destroy_all_statues.py
Destroy_all_statues.py
py
3,311
python
en
code
0
github-code
1
[ { "api_name": "sympy.Point2D", "line_number": 73, "usage_type": "call" }, { "api_name": "sympy.Point2D", "line_number": 76, "usage_type": "call" }, { "api_name": "sympy.Point2D", "line_number": 79, "usage_type": "call" }, { "api_name": "sympy.Point2D", "line_n...