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
7007455362
import uproot import os import pandas as pd import numpy as np import awkward from tqdm import tqdm def extract_scalar_data(events, branches, entrystop=None, progressbar=False): data = {} data["event"] = events.array("event", entrystop=entrystop) for br in tqdm(branches, disable=not progressbar): ...
guitargeek/geeksw
geeksw/nanoaod/nanoaod_to_parquet.py
nanoaod_to_parquet.py
py
4,687
python
en
code
2
github-code
97
[ { "api_name": "tqdm.tqdm", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 17, "usage_type": "call" }, { "api_name": "awkward.JaggedArray", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.zeros", "lin...
70835864959
# 取消任务 import schedule i = 0 def some_task(): global i i += 1 print(i) if i == 10: schedule.cancel_job(job) print('cancel job') exit(0) job = schedule.every().second.do(some_task) while True: schedule.run_pending()
csstrong/python
python3学习笔记/定时任务/5-5.schedule测试5.py
5-5.schedule测试5.py
py
273
python
en
code
0
github-code
97
[ { "api_name": "schedule.cancel_job", "line_number": 13, "usage_type": "call" }, { "api_name": "schedule.every", "line_number": 18, "usage_type": "call" }, { "api_name": "schedule.run_pending", "line_number": 20, "usage_type": "call" } ]
8484494010
from django.db import transaction from django.utils.translation import ugettext, ugettext_lazy as _ from django import forms from gf.gas.forms.order.plan import AddPlannedOrderForm from gf.gas.forms.order.base import AddOrderForm from gf.gas.models import GAS, GASSupplierOrder, GASSupplierSolidalPact import logging...
befair/gasistafelice
gasistafelice/gf/gas/forms/order/intergas.py
intergas.py
py
6,402
python
en
code
11
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "gf.gas.forms.order.base.AddOrderForm", "line_number": 17, "usage_type": "name" }, { "api_name": "django.forms.BooleanField", "line_number": 24, "usage_type": "call" }, { "...
20935078308
from rich.console import Console from gallow import gallow_frames from ending import game_over from the_word import word c = Console() def make_gallow(wrong_guesses): c.print(gallow_frames[wrong_guesses], style="white") def enter_word(): return input("Enter Word: ").upper() def display_guesses(word, gue...
vetlemt/hangman
main.py
main.py
py
2,007
python
en
code
0
github-code
97
[ { "api_name": "rich.console.Console", "line_number": 7, "usage_type": "call" }, { "api_name": "gallow.gallow_frames", "line_number": 11, "usage_type": "name" }, { "api_name": "the_word.word", "line_number": 20, "usage_type": "name" }, { "api_name": "the_word.word"...
43313196343
from typing import Any import database import models import repos.queries def one_of(**params) -> models.Question | None: """ Get models.Question object from database by "specifiers" params Arguments: **params: specifiers, if it needs to perform data filtering """ specifiers = " ".join(p...
rmksrv/the_ultimate_flask_course_projects
question_answer/repos/question.py
question.py
py
5,355
python
en
code
0
github-code
97
[ { "api_name": "models.Question", "line_number": 17, "usage_type": "attribute" }, { "api_name": "repos.queries.queries.select_query", "line_number": 20, "usage_type": "call" }, { "api_name": "repos.queries.queries", "line_number": 20, "usage_type": "attribute" }, { ...
35449013581
import pprint from typing import Dict from pydantic import BaseModel, Field from kubernetes import client class InputSchema(BaseModel): namespace: str = Field( title='Namespace', description='Kubernetes namespace') pod_name: str = Field( title='Pod', description='Name of the po...
unskript/Awesome-CloudOps-Automation
Kubernetes/legos/k8s_get_pod_status/k8s_get_pod_status.py
k8s_get_pod_status.py
py
1,607
python
en
code
258
github-code
97
[ { "api_name": "pydantic.BaseModel", "line_number": 7, "usage_type": "name" }, { "api_name": "pydantic.Field", "line_number": 8, "usage_type": "call" }, { "api_name": "pydantic.Field", "line_number": 11, "usage_type": "call" }, { "api_name": "pprint.pprint", "l...
5360303761
from functools import wraps from pycompss.util.context import CONTEXT from pycompss.api.commons.constants import INTERNAL_LABELS from pycompss.api.commons.constants import LABELS from pycompss.api.commons.constants import LEGACY_LABELS from pycompss.api.commons.decorator import CORE_ELEMENT_KEY from pycompss.api.commo...
bsc-wdc/compss
compss/programming_model/bindings/python/src/pycompss/api/decaf.py
decaf.py
py
7,206
python
en
code
39
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "pycompss.api.commons.constants.LABELS.df_script", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pycompss.api.commons.constants.LABELS", "line_number": 24, "usage_...
30182916252
import argparse import os import copy import logging import torch from torch.distributed.distributed_c10d import _get_default_group from torch.distributed.utils import _sync_module_states from torchvision.models import resnet18 from pippy.IR import Pipe from pippy import split_into_equal_size from easydist import e...
alibaba/easydist
examples/torch/pipeline_parallelism/resnet.py
resnet.py
py
4,863
python
en
code
51
github-code
97
[ { "api_name": "torch.distributed.utils._sync_module_states", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.distributed.distributed_c10d._get_default_group", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 30, "usag...
23567576786
import sys from time import sleep from common.db_utils import ( ConnFactory, ) from common.orm.repository import PoktInfoRepository from common.utils import get_last_block_height from rewards_calc import run_rewards, record_rewards, SERVICE_CLASS SAVE_STATE = True if __name__ == "__main__": mode = str(sys.a...
thunderhead-labs/chain_service
run_rewards.py
run_rewards.py
py
2,012
python
en
code
0
github-code
97
[ { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 23, "usage_type": "attribute" }, { "api_name": "rewards_calc.run_rewards", "line_number": 25, "usage_type": "call" }, { "api_name": "common.db_utils....
23842462557
import numpy as np from sklearn.metrics import confusion_matrix, precision_recall_fscore_support, \ accuracy_score def zip_data(data, target): return {study: (data[study], target[study]) for study in data} def unzip_data(data): return {study: data[study][0] for study in data}, \ {study: data[...
arthurmensch/cogspaces
cogspaces/utils.py
utils.py
py
3,538
python
en
code
33
github-code
97
[ { "api_name": "sklearn.metrics.accuracy_score", "line_number": 25, "usage_type": "call" }, { "api_name": "sklearn.metrics.precision_recall_fscore_support", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 35, "usa...
29186048028
# basic import argparse import os,datetime # data input import pandas as pd import numpy as np import scipy.sparse import pickle # metric and loss function import tensorflow as tf import tensorflow.keras.backend as K from tensorflow.keras.metrics import categorical_accuracy, binary_accuracy, top_k_categorical_accuracy...
angelahahaa/xmtc
tools/model_func.py
model_func.py
py
15,458
python
en
code
0
github-code
97
[ { "api_name": "numpy.load", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_number": 36, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number"...
32218581863
import cv2 import numpy as np face_classifier = cv2.CascadeClassifier("haar_face.xml") def face_extractor(img): gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) face = face_classifier.detectMultiScale(gray,1.3,5) if len(face) == 0: return None for(x,y,w,h) in face: ...
BhagatTushar/Codsoft_AI_Task
FaceDetection/dataset.py
dataset.py
py
1,303
python
en
code
0
github-code
97
[ { "api_name": "cv2.CascadeClassifier", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapt...
41947101367
import sys import cv2 from PyQt5 import uic, QtGui from PyQt5.QtCore import QTimer from PyQt5.QtGui import QImage from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog import NS, BDview from BDview import Ui_MainWindow class MyProject(QMainWindow): def __init__(self): super().__init__() ...
Dinislamg1/QTT
GoVideo.py
GoVideo.py
py
2,697
python
en
code
0
github-code
97
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 11, "usage_type": "name" }, { "api_name": "PyQt5.uic.loadUi", "line_number": 14, "usage_type": "call" }, { "api_name": "PyQt5.uic", "line_number": 14, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.Q...
1663608923
#!/usr/bin/python3 # -*- coding:utf-8 -*- import requests from flask import Flask, request, jsonify, make_response from flask_restx import Api, Resource, fields from werkzeug.middleware.proxy_fix import ProxyFix app = Flask(__name__) app.wsgi_app = ProxyFix(app.wsgi_app) api = Api(app, version='1.0', title='RPA机器人API' ...
yuanhai11/spider
incomeTaxFiling/QG-tax/TaskSchedule/BeforeSchedule/xsapi.py
xsapi.py
py
2,456
python
en
code
4
github-code
97
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "werkzeug.middleware.proxy_fix.ProxyFix", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_restx.Api", "line_number": 9, "usage_type": "call" }, { "api_name": "flask...
73922750720
import os os.environ['http_proxy'] = 'http://192.41.170.23:3128' os.environ['https_proxy'] = 'http://192.41.170.23:3128' import torchtext import torch from torch import nn import math import numpy as np import torch.optim as optim # device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') device = 'cud...
sitiporn/bert-
bert.py
bert.py
py
1,889
python
en
code
0
github-code
97
[ { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "transformers.BertTokenizer.from_pretrained", "line_number": 27, "usage_type": "call" }, { "api_name...
38275765157
# -*- mode: python -*- import utils from build import build_app Import('env') target = 'reconstructPar' sources = Split(""" reconstructPar.cpp """) caelus_inc = [ 'lagrangian/basic/lnInclude', 'parallel/reconstruct/reconstruct/lnInclude', 'regionModels/regionModel/lnInclude', 'dynamicMesh/dynamicMesh/lnInclude' ] ...
egelja/caelus-cml
src/applications/utilities/parallelProcessing/reconstructPar/SConscript
SConscript
717
python
en
code
2
github-code
97
[ { "api_name": "utils.ostype", "line_number": 28, "usage_type": "call" }, { "api_name": "build.build_app", "line_number": 35, "usage_type": "call" } ]
74298255039
from my_utils.tests import test_and_solve import re from collections import deque DAY_NR = 17 FMT1 = re.compile("x=(\d+), y=(\d+)..(\d+)") FMT2 = re.compile("y=(\d+), x=(\d+)..(\d+)") def parse_line(line): match = FMT1.match(line) if match: x1_start, x0_start, x0_end = match.groups() x1_end ...
JamesOwers/aoc2018
day_17.py
day_17.py
py
6,575
python
en
code
0
github-code
97
[ { "api_name": "re.compile", "line_number": 7, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 93, "usage_type": "call" }, { "api_name": "my_utils.tests.test_and_solve",...
5130187748
import json import os import subprocess from datetime import datetime import requests from hachoir.metadata import extractMetadata from hachoir.parser import createParser from telethon.tl.types import DocumentAttributeVideo from userbot import LOGS, HELPER from userbot.events import register TEMP_DOWNLOAD_DIRECTORY ...
shivamkchoudhary/Maximus
userbot/modules/download.py
download.py
py
13,491
python
en
code
6
github-code
97
[ { "api_name": "os.environ.get", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "userbot.LOGS.info", "line_number": 19, "usage_type": "call" }, { "api_name": "userbot.LOGS", "...
21372848913
import streamlit as st from fpdf import FPDF import time class PDF(FPDF): def header(self): today = time.strftime("%d/%m/%Y") # First row self.set_font('Arial', '', 8) self.cell(63, 10, 'Envio:', 1, 0, 'C') self.set_font('Arial', 'B', 15) self.cell(63, 10, 'Remito "X"', 1, 0, 'C') self.s...
imjuangarcia/hg-product-list
steps/step4.py
step4.py
py
3,158
python
en
code
0
github-code
97
[ { "api_name": "fpdf.FPDF", "line_number": 5, "usage_type": "name" }, { "api_name": "time.strftime", "line_number": 7, "usage_type": "call" }, { "api_name": "streamlit.session_state", "line_number": 33, "usage_type": "attribute" }, { "api_name": "streamlit.session_...
11887050
from game_data import rooms from lib.models.game_state import GameState from lib.models.player import Player class Commands(object): def __init__(self, game_state: GameState): self.game_state = game_state # The register_command decorator was nicer, but it's harder to do inside a class # w...
fado/PyMUD
lib/command.py
command.py
py
4,750
python
en
code
2
github-code
97
[ { "api_name": "lib.models.game_state.GameState", "line_number": 8, "usage_type": "name" }, { "api_name": "lib.models.player.Player", "line_number": 30, "usage_type": "name" }, { "api_name": "lib.models.player.Player", "line_number": 34, "usage_type": "name" }, { "...
869276136
# Exer-11-Managing-a-context-using-the-with-statement import csv import pathlib some_source = [[2,3,5], [7,11,13], [17,19,23]] target_path = pathlib.Path('code/test.csv') with target_path.open('w', newline='') as target_file: writer = csv.writer(target_file) writer.writerow(['column', 'data', 'headings']) ...
nihathalici/Modern-Python-Cookbook
CHPT-02-Statements-and-Syntax/Exer-11-Managing-a-context-using-the-with-statement.py
Exer-11-Managing-a-context-using-the-with-statement.py
py
843
python
en
code
2
github-code
97
[ { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 9, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 21...
11049694072
from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import InputRequired, Length, Regexp, Email LETTERS_REGEXP = r'^[A-Za-ząćęłńóśźżĄĆĘŁŃÓŚŹŻ]+$' PH_NUM_MESS = 'Number should look like YYXXXXXXXXX,' \ ' where YYYY is the dialing code e.g. 0048 for Poland, and X’s are ...
WSokoll/HotelBD
app/forms/employee.py
employee.py
py
975
python
en
code
0
github-code
97
[ { "api_name": "flask_wtf.FlaskForm", "line_number": 12, "usage_type": "name" }, { "api_name": "wtforms.StringField", "line_number": 13, "usage_type": "call" }, { "api_name": "wtforms.validators.InputRequired", "line_number": 13, "usage_type": "call" }, { "api_name...
2702422366
import math from django.db import models from django.contrib.auth.models import AbstractUser from django.contrib.auth.models import UserManager from django.db.models.expressions import RawSQL from decimal import Decimal from .utils import get_unical_name class LocationManager(UserManager): def get_nearby(self, la...
shhamil/dating_chat
dating_chat/models.py
models.py
py
1,875
python
en
code
0
github-code
97
[ { "api_name": "django.contrib.auth.models.UserManager", "line_number": 10, "usage_type": "name" }, { "api_name": "decimal.Decimal", "line_number": 13, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 14, "usage_type": "call" }, { "api_name":...
35669765788
import os import random import shutil import sys sys.path.append(os.path.abspath(os.path.join(__file__, "../dfmlmd", ".."))) import torch import torch.nn as nn from tool import dataset_classnum,construct_model_pool from tensorboardX import SummaryWriter from tool import set_maml, get_model, data2supportquery, bias...
Egg-Hu/PURER-Plus
method/purer.py
purer.py
py
25,036
python
en
code
3
github-code
97
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number...
38610804605
import itertools as it import math import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from sklearn.feature_selection import SelectFromModel from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import ( PolynomialFeatures, StandardScaler, ) fro...
mpjuers/AlgaeStats
Analysis/MiscScripts/lasso2.py
lasso2.py
py
6,635
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LogisticRegression", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 44, "usage_type": "call" }, { "api_name": "s...
74777915840
from django.conf import settings from django.conf.urls import url from django.conf.urls.static import static from . import views urlpatterns = [ url('^$', views.index, name='index'), url(r'^profile/(\d+)', views.profile, name='profile'), url(r'^business/', views.business, name='business'), url(r'^post/...
GabrielSpear/NeighbourhoodWatch
hood/urls.py
urls.py
py
713
python
en
code
0
github-code
97
[ { "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...
33486252390
#!/usr/bin/python3 # -*-coding:utf-8 -*- #Reference:********************************************** # @Time : 2019/10/3 2:28 下午 # @Author : baozhiqiang # @File : 763best.py # @User : bao # @Software: PyCharm ''' 思路: 1 统计每个元素出现的次数。 2 然后遍历数组,每到一个元素,除了执行正常的-1,还要统计当前是否 所有的元素...
15779235038/algorithm
all_algorithm/greedy/algorithm763/763best.py
763best.py
py
1,530
python
en
code
0
github-code
97
[ { "api_name": "collections.defaultdict", "line_number": 31, "usage_type": "call" } ]
33322272728
from django.db import models from django.contrib.auth.models import User # Create your models here. class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) profile_pic = models.ImageField( null=True, editable=True, default="blank-profile-picture.webp" ) gend...
gcivil-nyu-org/NYU-Marketplace
users/models.py
models.py
py
788
python
en
code
2
github-code
97
[ { "api_name": "django.db.models.Model", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.OneToOneField", "line_number": 8, "usage_type": "call" }, { "api_name...
24312362509
from __future__ import print_function from numpy import array as Vector from collections import namedtuple from .vector_ops import * from .kpclasses import Bead,chainDeepCopy from .writer import * from .reader import * from .config import EPSILON,VERBOSE from knot_pull.finder import find_frame def too_far(p1 ,p2 ,p3...
dzarmola/knot_pull
knot_pull/bipuller.py
bipuller.py
py
36,736
python
en
code
7
github-code
97
[ { "api_name": "kpclasses.Bead", "line_number": 171, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 171, "usage_type": "call" }, { "api_name": "kpclasses.Bead", "line_number": 188, "usage_type": "call" }, { "api_name": "numpy.array", "line_...
16702239534
import os import socket import zlib from threading import Thread, Condition from random import choices from typing import Tuple from protocol import apply_protocol, handle_switch, handle_fin, finish_con, req_switch from protocol import calculate_checksum def handle_syn(client_addr: Tuple[str, int], sock...
xkokin/Python_Messenger
server.py
server.py
py
13,548
python
en
code
0
github-code
97
[ { "api_name": "typing.Tuple", "line_number": 13, "usage_type": "name" }, { "api_name": "random.choices", "line_number": 16, "usage_type": "call" }, { "api_name": "protocol.apply_protocol", "line_number": 21, "usage_type": "call" }, { "api_name": "socket.timeout", ...
13178934057
from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker import json import os CONFIG_PATH = "config.json" # is defined a second time in main.py if os.environ.get("DATABASE_URL") == None: with open(CONFIG_PATH) as fp: config = jso...
dominikpegler/react-psiz-collect
backend/database.py
database.py
py
645
python
en
code
0
github-code
97
[ { "api_name": "os.environ.get", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ.get", "line_num...
10202416741
from setuptools import setup exec(open("perceiver/version.py").read()) with open("README.md", "r", encoding="utf8") as fh: long_description = fh.read() setup( name="perceiver", version="0.1.2", description="Implement of Perceiver, General Perception with Iterative Attention in TensorFlow", packag...
Rishit-dagli/Perceiver
setup.py
setup.py
py
1,711
python
en
code
85
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" } ]
74911487679
# -*- coding: utf-8 -*- """ Created on Tue Mar 14 09:00:09 2023 @author: Urmi """ # -*- coding: utf-8 -*- """ Created on Mon May 16 14:45:49 2022 @author: Urmi """ #Input files: #dataset: Data_0 to Data_7 in folder "Dataset", based on the output of Kmeans.py #stratified random sampling is d one on th...
ZJUEarthData/Sulide
linear and ensemble tree SCSS models/SCSS_predict.py
SCSS_predict.py
py
15,539
python
en
code
0
github-code
97
[ { "api_name": "numpy.random.seed", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 29, "usage_type": "attribute" }, { "api_name": "sklearn.preprocessing.PolynomialFeatures", "line_number": 45, "usage_type": "call" }, { "api_...
17967187781
import logging import os import sys import uuid from . import containerize from . import deploy from . import docker_config as docker_config_module from . import machine_config from . import preprocess from . import validate from tensorflow_cloud.utils import google_api_client logger = logging.getLogger(__name__) d...
tensorflow/cloud
src/python/tensorflow_cloud/core/run.py
run.py
py
14,383
python
en
code
360
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 19, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 19, "usage_type": "attribute" }, { "api_name": "uuid.uuid4", "li...
18148004243
# com8 ペリフェラルコード import ujson import bluetooth import random import struct import time import binascii from BLE_advertising import advertising_payload import get import info import json from micropython import const # BLEイベントの定数 _IRQ_CENTRAL_CONNECT = const(1) _IRQ_CENTRAL_DISCONNECT = const(2) _IRQ_GATTS_INDICATE_D...
Fel615/IoTDojo_fri2nd
BLE/senser_dev/senddistance_peripheral.py
senddistance_peripheral.py
py
6,053
python
en
code
0
github-code
97
[ { "api_name": "micropython.const", "line_number": 17, "usage_type": "call" }, { "api_name": "micropython.const", "line_number": 18, "usage_type": "call" }, { "api_name": "micropython.const", "line_number": 19, "usage_type": "call" }, { "api_name": "micropython.con...
4000589461
import disnake import requests from random import choice from io import BytesIO from disnake.ext import commands from resources.check import check_it from resources.db import Database from PIL import Image, ImageDraw, ImageOps class Booket(commands.Cog): def __init__(self, bot): self.bot = bot @chec...
D3NKYT0/ashley_home
commands/member/booket.py
booket.py
py
8,681
python
pt
code
2
github-code
97
[ { "api_name": "disnake.ext.commands.Cog", "line_number": 12, "usage_type": "attribute" }, { "api_name": "disnake.ext.commands", "line_number": 12, "usage_type": "name" }, { "api_name": "disnake.Member", "line_number": 20, "usage_type": "attribute" }, { "api_name":...
74841241597
# -*- coding: utf-8 -*- """ Created on Thu Feb 11 09:40:34 2021 @author: Grant """ import random import math import numpy import statistics def chunks(l, n): n = max(1, n) return (l[i:i+n] for i in range(0, len(l), n)) n = 15 m = 10 x = [1, 3, 5, 11, 15, 21, 18, 19, 5, 8, 23, 35, 9, 16, ...
YukunGrantZhang/Big-Data-Algorithms
Indyk's Algorithm.py
Indyk's Algorithm.py
py
932
python
en
code
0
github-code
97
[ { "api_name": "random.uniform", "line_number": 28, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 28, "usage_type": "attribute" }, { "api_name": "random.uniform", "line_number": 29, "usage_type": "call" }, { "api_name": "math.sin", "line_numbe...
38244784461
"""Command-line (script) interface to instapy""" import argparse import sys import numpy as np from PIL import Image import instapy from . import get_filter, io def run_filter( file: str, out_file: str = None, implementation: str = "python", filter: str = "color2gray", scale: int = 1, ) -> None...
annica1910/Programming-in-a-high-level-language
assignment3/instapy/cli.py
cli.py
py
1,804
python
en
code
0
github-code
97
[ { "api_name": "numpy.resize", "line_number": 26, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 42, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 44, "usage_type": "call" } ]
5002923814
from django import forms from ELLIMS import settings from .models import * class SampleForm(forms.ModelForm): #setup the datepicker input and display date formates received = forms.DateField( widget=forms.DateInput(format=settings.DATE_INPUT_FORMATS[0]), input_formats=(settings.DATE_INPUT_FORMATS[0...
matt-quantblack/lims
eldashboard/forms.py
forms.py
py
1,770
python
en
code
1
github-code
97
[ { "api_name": "django.forms.ModelForm", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "django.forms.DateField", "line_number": 9, "usage_type": "call" }, { "api_name": "django.f...
7009997413
import asyncio from fivem.bot import FiveMBot import logging import config formatter = logging.Formatter( fmt="[%(asctime)s] %(levelname)s [%(name)s.%(funcName)s:%(lineno)d] %(message)s" ) logger = logging.getLogger() logger.setLevel(logging.INFO) file_handler = logging.FileHandler("bot.log") file_handler.setFor...
jaymart95/FiveM-Analtyics
src/launcher.py
launcher.py
py
726
python
en
code
0
github-code
97
[ { "api_name": "logging.Formatter", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.FileHand...
74300267197
from os import environ from typing import List, Optional import mysql.connector from mysql.connector import MySQLConnection def get_db_connection() -> MySQLConnection: """ Инициализация соединения с базой данных (параметры берутся из переменных окружения + см. файл .env) """ return mysql.connector.co...
itlat-mysql/mysql-basics-python
dao.py
dao.py
py
6,955
python
ru
code
0
github-code
97
[ { "api_name": "mysql.connector.connector.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 12, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 12, "usage_type": "name" }, { "...
41453523973
import torch from src.VAE import * from src.filter_bank import * class ISVAE(nn.Module): def __init__(self, x_dim, z_dim, number_f, filter_w, psd, version): super(ISVAE, self).__init__() self.number_f = number_f self.filter_w = filter_w self.x_dim = x_dim self.z_dim = z_di...
Oscarm96/ISVAE-git
src/ISVAE.py
ISVAE.py
py
1,525
python
en
code
0
github-code
97
[ { "api_name": "torch.cat", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.arange", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.exp", "line_number": 33, "usage_type": "call" } ]
35582878783
import os from itertools import product import numpy as np import numpy.testing as npt import pytest from pymatgen.core.composition import Composition from smol.cofe.space.domain import SiteSpace from smol.moca import SampleContainer from smol.moca.sublattice import Sublattice from smol.moca.trace import Trace from t...
CederGroupHub/smol
tests/test_moca/test_container.py
test_container.py
py
15,795
python
en
code
48
github-code
97
[ { "api_name": "smol.moca.trace.Trace", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_...
2342782767
import random import pytest import pandas as pd @pytest.fixture() def data(): entries = [] for art_no in range(1, 26): for date_of_day in pd.date_range('2018-01-01', '2020-01-01', freq='w'): entry = { 'art_no': art_no, 'art_name': f"article {art_no}", ...
greyxray/demand-prediction
tests/conftest.py
conftest.py
py
1,425
python
en
code
0
github-code
97
[ { "api_name": "pandas.date_range", "line_number": 10, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 24, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 25, "usage_type": "call" }, { "api_name": "random.uniform", ...
882465156
from flask_app import app from flask import render_template, redirect, request, session,flash from flask_app.models.customer import Customer from flask_app.models.user import User @app.route ('/new/customer') def new_customer(): if 'users_id' not in session: return redirect ('/logout') ...
EdSenecal/Customer-Corral
CustomerCorral/flask_app/controllers/customers.py
customers.py
py
2,660
python
en
code
0
github-code
97
[ { "api_name": "flask.session", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.redirect", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 14, "usage_type": "name" }, { "api_name": "flask.render_template", ...
74892231998
import copy import pandas as pd import logging from . import DataCache class MonetaryTimeSeries(object): """ A super abstract class to make concrete CurrencyConverts and MarketIndexes that efficiently and transparently work with DataCache class, in multi-threading context, with lazy data loading. ...
avibrazil/investor
investor/monetary_time_series.py
monetary_time_series.py
py
9,454
python
en
code
2
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.merge_asof", "line_number": 260, "usage_type": "call" }, { "api_name": "pandas.merge_asof", "line_number": 266, "usage_type": "call" } ]
23023868692
from django.template import Context, loader from game.models import Game from django.shortcuts import render_to_response mobile_uas = [ 'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac', 'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno', 'ipaq','java','jigs','kddi','keji','le...
mhangman/Gralab
homepage/views.py
views.py
py
1,573
python
en
code
0
github-code
97
[ { "api_name": "game.models.Game.objects.filter", "line_number": 35, "usage_type": "call" }, { "api_name": "game.models.Game.objects", "line_number": 35, "usage_type": "attribute" }, { "api_name": "game.models.Game", "line_number": 35, "usage_type": "name" }, { "ap...
24428495197
from collections import deque def BFS(): while location: x,y = location.popleft() for i in range(4): pre_x = x + dx[i] pre_y = y + dy[i] if 0 <= pre_x < M and 0 <= pre_y < N and maze[pre_y][pre_x] == 1: maze[pre_y][pre_x] = maze[y][x] + 1 ...
yooonwodyd/justcode
백준/Silver/2178. 미로 탐색/미로 탐색.py
미로 탐색.py
py
578
python
en
code
0
github-code
97
[ { "api_name": "collections.deque", "line_number": 23, "usage_type": "call" } ]
5050900002
#Author:Guan Jiajun import pymysql conn = pymysql.connect(host = '127.0.0.1',user ='root',password = 'root',port = 3306, charset = 'utf8mb4',cursorclass = pymysql.cursors.DictCursor) cursor = conn.cursor() try: sql1 = "CREATE DATABASE bigz_order" cursor.execute(sql1) sql2 = "USE bigz_order" curs...
jamespotato/Mysql-project
Guanjiajun/original.py
original.py
py
5,854
python
en
code
0
github-code
97
[ { "api_name": "pymysql.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 7, "usage_type": "attribute" } ]
185133849
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Date : 2020/7/31 # @Author : zhangranghan import os, sys import time from copy import copy from string import Template import pytest from config.conf import set_run_env_and_system_type from tool.DingDingMsg import DingDingMsg """ pytest 命令中加入 '-n 数字'可实现分布式执行测试...
wenyan808/auto-test
run.py
run.py
py
5,374
python
zh
code
0
github-code
97
[ { "api_name": "config.conf.set_run_env_and_system_type", "line_number": 69, "usage_type": "call" }, { "api_name": "copy.copy", "line_number": 70, "usage_type": "call" }, { "api_name": "pytest.main", "line_number": 72, "usage_type": "call" }, { "api_name": "config....
37805224929
# arrays import numpy as np import pandas as pd # plotting import matplotlib as mpl from matplotlib import pyplot as plt from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable import cartopy.crs as ccrs import cartopy.feature as cfeature import cmocean # from pandas.plotting import register_matplotlib_co...
javitausia/CalValWaves
calval/calval.py
calval.py
py
34,616
python
en
code
6
github-code
97
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 70, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 70, "usage_type": "name" }, { "api_name": "cartopy.crs.PlateCarree", "line_number": 71, "usage_type": "call" }, { "api_name": "...
42311488714
#!/usr/bin/python3 from daemon import DaemonContext from lockfile import FileLock import time import logging from mqtt2serial import main class MqttApp(object): def __init__(self): self.pidfile_path = '/var/run/mqtt2seriald.pid' self.pidfile_timeout = 10 def run(self): logging.basicCon...
sengels/mqtt2serial
mqtt2seriald.py
mqtt2seriald.py
py
901
python
en
code
0
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.info", ...
71411899518
from pyspark.ml import Pipeline from pyspark.ml.classification import RandomForestClassifier as RF from pyspark.ml.feature import StringIndexer, VectorIndexer, VectorAssembler, SQLTransformer from pyspark.ml.evaluation import MulticlassClassificationEvaluator, BinaryClassificationEvaluator from pyspark.ml.tuning import...
tryouge/Data-Cleaning-Library-Pyspark
getOutliers.py
getOutliers.py
py
1,839
python
en
code
8
github-code
97
[ { "api_name": "pyspark.ml.feature.StringIndexer", "line_number": 24, "usage_type": "call" }, { "api_name": "pyspark.ml.feature.OneHotEncoder", "line_number": 25, "usage_type": "call" }, { "api_name": "pyspark.ml.feature.VectorAssembler", "line_number": 29, "usage_type": "...
43569400045
#!/usr/bin/python #-*- coding: utf-8 -*- from flask import request, jsonify import base, api @base.web_app.app.route('/api/transceiver/<key>/', methods=['GET', 'PUT']) @base.web_app.auth.login_required def transceiver_mgr_CURD(key): if request.method == 'GET': resp = api.transceiver.get(key) ...
bonald/vim_cfg
osp_sai_2.1.8/system/apps/web/urls/transceiver.py
transceiver.py
py
455
python
en
code
0
github-code
97
[ { "api_name": "flask.request.method", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 10, "usage_type": "name" }, { "api_name": "api.transceiver.get", "line_number": 11, "usage_type": "call" }, { "api_name": "api.trans...
6100392706
# 수열정렬 n = int(input()) arr = list(map(int, input().split())) visited = [0] * n; list = sorted(arr) for i in range(n): x = list.index(arr[i]) print(x + visited[x], end=" ") visited[x] += 1 #회전하는 큐 from collections import deque N, M = map(int, input().split()) queue = deque() arr = deque(list(map(int, input...
gunhee27/programming_python
202212/1205-1211.py
1205-1211.py
py
5,402
python
en
code
0
github-code
97
[ { "api_name": "collections.deque", "line_number": 14, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 121, "usage_type": "attribute" }, { "api_name": "sys.setrecursionl...
8974122392
""" Configuration for running OPRE OPS in cloud.gov. """ import os import json import cfenv # Import all common settings relevant to both local & cloud: from opre_ops.settings.common import * # Import helper to generate a random string for our local secret key: from opre_ops.settings.helpers.random_string import gener...
18F/OPRE-OPS
opre_ops/opre_ops/settings/cloudgov.py
cloudgov.py
py
1,607
python
en
code
null
github-code
97
[ { "api_name": "cfenv.AppEnv", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 18, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 19, "usage_type": "call" }, { "api_name": "opre_ops.settings.helpers.random_st...
30939963029
import os import numpy as np from matplotlib import pyplot as plt from scipy.stats import gamma import matplotlib matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 from matplotlib import pyplot as plt disttype = 'general-gaussian' model = 'consistency-cifar-1530-0.50.pth' k = '1530'...
llylly/DSRS
ablation/param_fitting.py
param_fitting.py
py
3,151
python
en
code
7
github-code
97
[ { "api_name": "matplotlib.rcParams", "line_number": 9, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 57, "usage_type": "call" }, { "api_name": "os.path...
25519717903
import pygame,random from pygame.locals import * pygame.init() noir=(0,0,0) blanc=(0xFF, 0xFF, 0xFF) bleuClair = (18,158,158) font = pygame.font.SysFont('Calibri', 25, True, False) text_attaque = font.render("attaque",True,noir) text_potion = font.render("potion",True,noir) text_fuite = font.render("fuite",True,noir) ...
pacs-men/-PacsMen-
Jeu/Jeu Pac s Men/combat/new combat.py
new combat.py
py
1,754
python
fr
code
5
github-code
97
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.font.SysFont", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.image.load", ...
10841149126
from copy import copy import numpy as np import os import pickle as pkl import networkx as nx import scipy.sparse as sp from scipy.sparse.linalg.eigen.arpack import eigsh from sklearn import preprocessing import sys def parse_index_file(filename): """Parse index file.""" index = [] for line in open(filena...
fulifeng/GraphAT
my_utils.py
my_utils.py
py
16,789
python
en
code
21
github-code
97
[ { "api_name": "numpy.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.bool", "line_number": 24, "usage_type": "attribute" }, { "api_name": "numpy.savez", "line_numbe...
15516476775
""" Defines 'types' that various fields can be """ from typing import Tuple, Union # Literal only available in python 3.8 + so try import otherwise use extensions try: from typing import Literal except ImportError: from typing_extensions import Literal from typing_extensions import Annotated import pydantic ...
SiEPIC/SiEPIC-Tools
klayout_dot_config/python/SiEPIC/tidy3d/tidy3d/components/types.py
types.py
py
5,135
python
en
code
149
github-code
97
[ { "api_name": "typing_extensions.Annotated", "line_number": 27, "usage_type": "name" }, { "api_name": "pydantic.Field", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number": 31, "usage_type": "attribute" }, { "api_name": "numpy.n...
70735299839
import json from random import shuffle, randrange from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect # Create your views here. from django.shortcuts import render_to_resp...
cypreess/PyrateDice
game_server/game_server/board/views.py
views.py
py
3,391
python
en
code
0
github-code
97
[ { "api_name": "django.http.HttpResponse", "line_number": 20, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 18, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 26, "usage_type": "call"...
4486780060
from sklearn.decomposition import PCA import pandas as pd import numpy as np import matplotlib.pyplot as plt import os plot = False df_fname = r"E:\nanopores\2023_02_20\ch1\pore2\data3\f1.pkl" root = os.path.dirname(df_fname) name,ext = os.path.splitext(os.path.basename(df_fname)) df = pd.read_pickle(df_fname) dfIn...
maxearle/filter
tool_scripts/pca.py
pca.py
py
983
python
en
code
0
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.splitext", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_num...
27086451915
from keras.layers import Conv2D from keras.layers import Input from keras.layers import MaxPooling2D, UpSampling2D from keras.models import Model from keras.datasets.mnist import load_data from numpy import reshape import matplotlib.pyplot as plt from keras.callbacks import ModelCheckpoint import numpy as np (xtrain0,...
psorus/anogen
not_so_weird/cae/train.py
train.py
py
2,421
python
en
code
0
github-code
97
[ { "api_name": "keras.datasets.mnist.load_data", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.where"...
18457698560
from torch.utils.data import Dataset, DataLoader from torchvision import transforms import torch import matplotlib.pyplot as plt import numpy as np from PIL import Image import os from os.path import join from os import listdir import pandas as pd from mask_functions import read_dicom, mask2rle, rle2mask from collecti...
PRCinguhou/kaggle-siim-dataset
LoadData.py
LoadData.py
py
2,521
python
en
code
0
github-code
97
[ { "api_name": "torchvision.transforms.Compose", "line_number": 17, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 17, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToPILImage", "line_number": 18, "usage_type": "call" }, ...
42453219515
import json import logging import os import re from typing import Any, Dict, List, Optional, Tuple, Union from neural_compressor.ux.utils.exceptions import InternalException from neural_compressor.ux.utils.json_serializer import JsonSerializer from neural_compressor.ux.utils.logger import log from neural_compressor.ux...
mlcommons/inference_results_v2.1
closed/Inspur/code/code_br/code/resnet50/modelProcess/inference_calibration/neural-compressor/neural_compressor/ux/utils/workload/workloads_list.py
workloads_list.py
py
12,763
python
en
code
19
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 13, "usage_type": "attribute" }, { "api_name": "neural_compressor.ux.utils.json_serializer.JsonSerializer", "line_number": 16, "usage_type": "name"...
37979970064
import os from dotenv import load_dotenv #from datetime import date from app import APP_ENV # web_app/routes/pokemon_routess.py from flask import Blueprint, jsonify, request, render_template, redirect, flash pokemon_routes = Blueprint("pokemon_routes", __name__) @pokemon_routess.route("/api/pokemons") @pok...
stacyche/final-project
app/pokemon.py
pokemon.py
py
1,041
python
en
code
0
github-code
97
[ { "api_name": "flask.Blueprint", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 27, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 35, "usage_type": "call" } ]
35636818614
from auth.login import Login # Criar uma instância da classe Login login = Login() # Verificar se a sessão já existe em um arquivo session_file = 'session.pkl' try: session = login.load_session(session_file) print("Sessão carregada do arquivo.") except FileNotFoundError: # Obter uma nova sessão status...
raianb-dev/botflix
Backend/session.py
session.py
py
532
python
pt
code
0
github-code
97
[ { "api_name": "auth.login.Login", "line_number": 4, "usage_type": "call" } ]
5826152541
# -*- coding: utf-8 -*- """ Created on Wed Feb 20 15:29:19 2019 @author: Ham Task from HackerRank Given a string , which is the company name in lowercase letters, your task is to find the top three most common characters in the string. Print the three most common characters along with their occurrence coun...
Hamng/hamnguyen-sources
python/most_common_3.py
most_common_3.py
py
1,898
python
en
code
0
github-code
97
[ { "api_name": "collections.Counter", "line_number": 58, "usage_type": "call" } ]
33938965933
import pandas as pd import numpy as np from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import train_test_split from sklearn.model_selection import StratifiedKFold import matplotlib.pyplot as plt import timeit import modeldata as md starting_time = timeit.default_timer() df = pd.read_cs...
OngMinXian/zb4171-kazoo
machine_learning/xgboost_10fcv_modelSelection.py
xgboost_10fcv_modelSelection.py
py
2,380
python
en
code
0
github-code
97
[ { "api_name": "timeit.default_timer", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "sklearn.model_se...
40451622764
import logging import pytest from mindarmour.utils.logger import LogUtil @pytest.mark.level0 @pytest.mark.platform_arm_ascend_training @pytest.mark.platform_x86_ascend_training @pytest.mark.env_card @pytest.mark.component_mindarmour def test_logger(): logger = LogUtil.get_instance() tag = 'Test' msg = 'i...
mindspore-ai/mindarmour
tests/ut/python/utils/test_log_util.py
test_log_util.py
py
1,307
python
en
code
88
github-code
97
[ { "api_name": "mindarmour.utils.logger.LogUtil.get_instance", "line_number": 13, "usage_type": "call" }, { "api_name": "mindarmour.utils.logger.LogUtil", "line_number": 13, "usage_type": "name" }, { "api_name": "logging.DEBUG", "line_number": 22, "usage_type": "attribute"...
45081648069
import os import sys import numpy as np import pandas as pd from datetime import date from collections import OrderedDict from dateutil.relativedelta import * import matplotlib.pyplot as plt from IPython.core.pylabtools import figsize from IPython.core.display import display, HTML from IPython.display import Latex sy...
NelisW/RetirementPlanning
persfin/utilityfuns.py
utilityfuns.py
py
8,566
python
en
code
1
github-code
97
[ { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "IPython.core.pylabtools.figsize", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 32, "usage_type": "call" }, { "api_name...
18874323073
from os import uname import sys import time import requests from rich.console import Console from rich.table import Table from rich.text import Text from argparse import ArgumentParser, RawTextHelpFormatter from collections import OrderedDict from rdflib import ConjunctiveGraph, Namespace, URIRef from rdflib.namespace ...
edamontology/edamverify
src/text2edam.py
text2edam.py
py
4,872
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "rdflib.ConjunctiveGraph", "line_number": 24, "usage_type": "call" }, { "api_name": "rdflib.Namespace", "line_number": 30, "usage_type": "call" }, { "api_name": "rdflib.Namespac...
12257985578
import numpy as np import matplotlib.pyplot as plt import pickle import random as rd import compute_grad_num as num_grad import pandas as pd # Set random seed to get reproducable results np.random.seed(400) "Loads the CIFAR-10 data" # returns: # X = image pixel data (d x N) # Y = one-hot class representation for each...
niklasembretsen/DL-DD2424-
Assignments/assignment2.py
assignment2.py
py
15,930
python
en
code
0
github-code
97
[ { "api_name": "numpy.random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.mean", "line_...
23229901166
from sklearn import datasets import numpy as np import collections from sklearn.svm import SVC from sklearn.neighbors import KNeighborsClassifier from sklearn.tree import DecisionTreeClassifier irirs = datasets.load_iris() irirs_data = irirs.data irirs_label = irirs.target size = len(irirs_data) random_irirs_data =...
yhaha520/Tim-209
irirs_classification.py
irirs_classification.py
py
2,225
python
en
code
1
github-code
97
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.empty", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.empty", ...
72948937919
import discord from discord.ext import commands from sys import platform import os import subprocess import time import threading #import psutil """ def find_a(exe: str, return_arr): found = false; while not found: if return_arr[1] < 0: return for process in psutil....
joeKody/wjw-discord-bot
commands/run.py
run.py
py
8,632
python
en
code
0
github-code
97
[ { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 28, "usage_type": "call" }, { "api_name": "discord.Embed", "line_number"...
12823515034
#!/usr/bin/env python3 import sys import colorsys from colorz import colorz WALLPAPER = sys.argv[1] def normalize(hexv, minv=128, maxv=256): hexv = hexv[1] r, g, b = (hexv[0] / 256.0, hexv[1] / 256.0, hexv[2] / 256.0,) h, s, v = colorsys.rgb_to_hsv(r, g, b) minv = minv / 256.0 maxv = maxv / 256....
justbuchanan/dotfiles
common/i3/home/.config/i3/themegen.py
themegen.py
py
1,330
python
en
code
12
github-code
97
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "colorsys.rgb_to_hsv", "line_number": 13, "usage_type": "call" }, { "api_name": "colorsys.hsv_to_rgb", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.argv", "...
34336773980
import asyncio import gc import os from joblib import Parallel, delayed import pandas as pd from prefect import flow, task from prefect_ray.task_runners import RayTaskRunner import numpy as np from numpy import array, float32 # to eval strings as arrays from sklearn.metrics import log_loss import ray from sklearn.mo...
ejmockler/case-control-genomics
src/metamodel.py
metamodel.py
py
9,043
python
en
code
0
github-code
97
[ { "api_name": "pandas.Series", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.divide", "line_number": 37, "usage_type": "call" }, { "api_name": "sklearn.model_selection.StratifiedKFold", "line_number": 51, "usage_type": "call" }, { "api_name": "co...
72078885759
#!/usr/bin/python # -*- coding: utf8 -*- import json import boto3 import time import os TABLE_NAME = os.getenv('dynamodb_table') WEBSITE_BUCKET = os.getenv('bucket') def update_json_file_to_s3(): client = boto3.client('dynamodb') response = client.scan( TableName = TABLE_NAME, Select = 'SPE...
finishy1995/aws-services-list
lambda/transmitter.py
transmitter.py
py
1,561
python
en
code
4
github-code
97
[ { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 14, "usage_type": "call" }, { "api_name": "time.time", "line_number": 45, ...
34843723272
''' Script: Image to sketch. Author@ mujeebishaque ''' import argparse import cv2, os class SketchImage(): @staticmethod def sketch(image_path, destination): if not image_path or len(image_path) < 6: raise Exception("Check the image path provided.") if not destin...
mujeebishaque/image-to-sketch
image_to_sketch.py
image_to_sketch.py
py
1,944
python
en
code
0
github-code
97
[ { "api_name": "os.sep", "line_number": 18, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 21, "usage_type": "attribute" }, { "api_name": "cv2.bitwise_not", ...
7045994956
import json import glob import os from dashify.visualization.data_model.grid_search_result import GridSearchResult from dashify.visualization.data_model.experiment import Experiment from typing import Dict, List class LocalDataLoader: """ Static class that loads the experiments of a given grid search from dis...
dashifyML/dashifyML
src/dashify/visualization/data_import/data_loaders.py
data_loaders.py
py
3,053
python
en
code
4
github-code
97
[ { "api_name": "dashify.visualization.data_model.grid_search_result.GridSearchResult", "line_number": 22, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }...
43270820809
from model.detection import detection from model.detection.lossFuntion import loss_region import cv2 import os import tensorflow as tf from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint import tensorflow.keras.backend as K import numpy as np enco_path = "data/image/resized" original_file_list = os....
sungbeom90/taxocrproject
main.py
main.py
py
1,917
python
en
code
0
github-code
97
[ { "api_name": "os.listdir", "line_number": 12, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 25, "usage_type": "call" }, { "api_name": "tensorflow.image.convert_image_dtype...
31494420418
import requests import json BASE_URL = 'localhost:9091/' print("\n") #일반 get request response = requests.get(BASE_URL + 'userList/v1.0') data = response.json() print("1. 유저리스트 조회 : ", data['check']) #일반 post request에 params 세팅 후 전송 params = {'key1' : 'value1', 'key2' : 'value2'} response = requests.post(BA...
chakangost/python_applications
http_request/http_request_sample.py
http_request_sample.py
py
1,305
python
ko
code
2
github-code
97
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.put", "line_number": 26, "usage_type": "call" }, { "api_name": "json.dumps", "line_number"...
16334890476
import torch from torch import nn from d2l import torch as d2l class BatchNorm(nn.Module): def __init__(self, num_features, num_dims): """ num_features: nums of outputs for fc nums of output channels for convolution num_dims: 2 for fc, 4 for conv ...
xuhuasheng/Dive2DeepLearning-pytorch
convolutional-modern/batch-norm.py
batch-norm.py
py
3,512
python
en
code
0
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Parameter", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
21480855022
import random import pygame SCREEN_SIZE = [1000, 800] WHITE = (255, 255, 255) CELL_RADIUS = 20 SNAKE_COLOR = (0, 0, 0) FOOD_COLOR = (100, 100, 100) FOOD_RADIUS = 20 UPDATE = pygame.USEREVENT + 1 Food = pygame.USEREVENT + 2 LIGHT_GREY = (100, 100, 100) MSG_POSITION = (300, 500) def init_game(): pygame.init(...
JimmyHongjichuan/snark
snake.py
snake.py
py
5,574
python
en
code
0
github-code
97
[ { "api_name": "pygame.USEREVENT", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pygame.USEREVENT", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 23, "usage_type": "call" }, { "api_name": "pygame.displa...
72119526718
import numpy as np import matplotlib.pyplot as plt from data.pca import perform_pca def read_data(file_path): ''' read file path and return the dataset input(s): file_path (string): path of txt file output(s): dataset (ndarray): the dataset ''' dataset = [] # Open the file in re...
stysh98/fingerprint1
data/analyze_dataset.py
analyze_dataset.py
py
5,471
python
en
code
0
github-code
97
[ { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 34, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.hist", "li...
8548403029
import numpy as np from neuron import h,gui import signal import pickle from matplotlib import pyplot as plt from glob import glob import pandas as pd import sys from extra_function import load_ASC,SIGSEGV_signal_arises from read_spine_properties import get_spine_xyz,get_n_spinese, get_spine_part signal.signal(signal.S...
moriafrid/analysis_groger_cells
calculate_synaptic_loc.py
calculate_synaptic_loc.py
py
8,723
python
en
code
0
github-code
97
[ { "api_name": "signal.signal", "line_number": 11, "usage_type": "call" }, { "api_name": "extra_function.SIGSEGV_signal_arises", "line_number": 11, "usage_type": "argument" }, { "api_name": "signal.SIGSEGV", "line_number": 11, "usage_type": "attribute" }, { "api_na...
9223609084
import torch import resnet_pytorch import imbalanced_dataset import numpy as np import utils import argparse from itertools import chain import os try: from apex import amp except ImportError: amp = None import train import initialise_model def main(args): dset_name = args.dset_name train_dir = os.pa...
kostas1515/improved_baselines
classification/per_shot_acc.py
per_shot_acc.py
py
9,030
python
en
code
3
github-code
97
[ { "api_name": "apex.amp", "line_number": 13, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": ...
21589001131
from django.urls import path from . import views urlpatterns = [ path('v1/',views.view1), path('add/',views.add), path('hm/',views.home,name='home' ), path('ab/',views.about,name='about'), path('co/',views.contact,name='contact'), path('as/',views.allStudent), path('em/',views.allEmployee),...
akshay1079/class_project
third/urls.py
urls.py
py
323
python
en
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
35625041802
''' Created on Aug 8, 2016 Processing datasets. @author: Xiangnan He (xiangnanhe@gmail.com) Modified on Nov 10, 2017, by Lianhai Miao ''' import scipy.sparse as sp import numpy as np import torch from torch.utils.data import TensorDataset, DataLoader from collections import defaultdict import math class Data_load...
ccnu-mathits/DA-GR
dataset.py
dataset.py
py
13,166
python
en
code
0
github-code
97
[ { "api_name": "torch.randint", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 87, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 87, "usage_type": "attribute" }, { "api_name": "numpy.random.ran...
37343002310
#!/usr/bin/env python2 from rest_framework import serializers from domain.achievement.models.Action import Action from custom_fields.ChoicesField import ChoicesField class ActionSerializer(serializers.ModelSerializer): action_verb = ChoicesField(choices=Action.ACTION_VERBS) class Meta: model = Acti...
pseudobabble/ufunction
application/api/serializers/ActionSerializer.py
ActionSerializer.py
py
560
python
en
code
0
github-code
97
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 9, "usage_type": "name" }, { "api_name": "custom_fields.ChoicesField.ChoicesField", "line_number": 10, "us...
35876000010
import os import random import discord from discord.ext import commands from dotenv import load_dotenv from datetime import timedelta, datetime load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') date = None bot = commands.Bot(command_prefix='-') # display a message in console to tell admins that the bot is online @...
potato-potato-potato-potato/discord-bot-go-club--also-fuck-alex
DiscordBot.py
DiscordBot.py
py
1,933
python
en
code
0
github-code
97
[ { "api_name": "dotenv.load_dotenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 12, "usage_type": "call" }, { "api_name": "discord.ext.commands.Bot", "line_number": 15, "usage_type": "call" }, { "api_name": "discord.ext.com...
31135496437
try: from commands.creation.creation_commands import CreationCommand from dna.dna import Dna from dna.dna_sequence import DnaSequence except ImportError: print("Need to fix the installation") raise ''' New Command. command: new <seq> [@<seq_name>] if name is not provided a default name is set to be:...
railadonnebaum/DNA-Analyzer-project
commands/creation/new_command.py
new_command.py
py
886
python
en
code
5
github-code
97
[ { "api_name": "commands.creation.creation_commands.CreationCommand", "line_number": 15, "usage_type": "name" }, { "api_name": "dna.dna_sequence.DnaSequence", "line_number": 21, "usage_type": "call" }, { "api_name": "dna.dna.Dna", "line_number": 22, "usage_type": "call" ...
40505180659
import pyodbc class PhoneBook: def __init__(self, dbname, tname): self.dbname = dbname self.tname = tname self.connString = 'Driver={SQL Server};Server=DESKTOP-DH4N9T0\SQLEXPRESS01;Database='+dbname+';Trusted_Connection=yes;' conn = pyodbc.connect(self.connString) cursor = ...
preston-inapp/inapp-camp2-assignments
Python-Phonebook-DB.py
Python-Phonebook-DB.py
py
2,236
python
en
code
0
github-code
97
[ { "api_name": "pyodbc.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "pyodbc.connect", "line_number": 53, "usage_type": "call" } ]
8860168610
import torch import numpy as np import torch.nn as nn import torch.optim as optim import time import os import shutil from datetime import datetime from tqdm import tqdm from load_data import load_data_imagefolder, load_hdf_data, load_split_data, load_fwa_data, load_split_data_random from sklearn.metrics import confusi...
TechieBoy/deepfake-detection
trainer.py
trainer.py
py
11,767
python
en
code
0
github-code
97
[ { "api_name": "torch.backends", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "hp.hp.save_folder", ...
37547418015
from twisted.python.runtime import platform from twisted.internet.test.reactormixins import ReactorBuilder from twisted.internet.protocol import Protocol if not platform.isWindows(): from twisted.internet._posixstdio import StandardIO class StdioFilesTests(ReactorBuilder): """ L{StandardIO} supports read...
nlloyd/SubliminalCollaborator
libs/twisted/internet/test/test_stdio.py
test_stdio.py
py
6,178
python
en
code
213
github-code
97
[ { "api_name": "twisted.python.runtime.platform.isWindows", "line_number": 4, "usage_type": "call" }, { "api_name": "twisted.python.runtime.platform", "line_number": 4, "usage_type": "name" }, { "api_name": "twisted.internet.test.reactormixins.ReactorBuilder", "line_number": 9...
27097136546
"""Run the code with self-healing.""" import subprocess import time from pathlib import Path import fire from prompt_templates.information_retrieval import find_file_with_error_template from prompt_templates.code_generation import fix_code_template from utils.llm import send_templated_message_to_llm, query_llm from...
Josh-Joseph/gen-code-from-requirements-doc
src/run_with_self_healing.py
run_with_self_healing.py
py
3,651
python
en
code
1
github-code
97
[ { "api_name": "time.time", "line_number": 24, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 25, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 27, "usage_type": "attribute" }, { "api_name": "subprocess.PIPE", ...
34574696326
from bs4 import BeautifulSoup import fileinput import html2text import json import logging import markdown import random import requests import shutil import sys # Load json in memory def get_challenge_updates(file_path: str, update_field: str) -> list: # open with utf 8 encoding with open(file_path, 'r') as...
Vivallo04/Vivallo04
scripts/main.py
main.py
py
6,232
python
en
code
1
github-code
97
[ { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 31, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 35, "usage_type": "call" }, { "api_name": "random.choice", "line_numbe...
45380837894
import networkx as nx COUNT_MISSING_DATES = False PRINT_TOP_N = 10 def normalize_dict(dct): # makes all the values in range [0,1] lowest_val = 9999999.0 highest_val = 0.0 for key, value in dct.items(): if value < lowest_val: lowest_val = value if value > highest_val: ...
sidav/GraphInfluenceAnalysis
analyze_books.py
analyze_books.py
py
6,160
python
en
code
0
github-code
97
[ { "api_name": "sys.stdout.write", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 30, "usage_type": "attribute" }, { "api_name": "sys.stdout.write", "line_number": 32, "usage_type": "call" }, { "api_name": "sys.stdout", "l...
70620405759
import argparse import os import cv2 as cv import numpy as np import pytesseract as ocr from pytesseract.pytesseract import run_tesseract WHITE = 0 BLACK = 1 def load_image(path): """ loads the pixel matrix that represents the image stored in `path` :param path: the file path to the image :return: t...
lnarita/mc920a
03/lab03.py
lab03.py
py
7,773
python
en
code
0
github-code
97
[ { "api_name": "cv2.imread", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.normalize", "line_number":...
36800891952
"""Wrapper around sqlite3 Connection with utilities for updating and easy querying.""" import os import sqlite3 import pandas as pd from database.tables import cards, images, prices class ETGDatabase: """Wrapper around sqlite db connection with updating/querying utilities""" all_table_names = ("Cards", "I...
Squeemos/Eigen-the-Gathering
database/db.py
db.py
py
3,691
python
en
code
0
github-code
97
[ { "api_name": "database.tables", "line_number": 18, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 21, "usage_type": "call" }, { "api_name": "database.tables", "line_number": 25, "usage_type": "name" }, { "api_name": "database.tables", "lin...