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
3527241237
# -*- coding: utf-8 -*- import pytest import requests from jsonschema import validate url_parts = ["", "/8094", "/search?query=Brewing", "/autocomplete?query=dog"] @pytest.mark.parametrize("params", url_parts) def test_status_code(base_url, params): """Проверка кода состояния HTTP""" target = ...
Eliseev-Max/API_testing
open_brewery_db/test_open_brewery.py
test_open_brewery.py
py
3,271
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 12, "usage_type": "attribute" }, { "api_name": "requests.get", ...
9788724565
from app import app from flask import render_template, redirect, url_for, current_app from app import db from app.models import Car from app.forms import AddForm, SearchForm import sqlalchemy as sa import sys @app.route('/init') def initialize_db(): connection_uri = app.config['SQLALCHEMY_DATABASE_URI'] engin...
NormanBenedict/hwk2
hw2-cse-321/app/routes.py
routes.py
py
2,798
python
en
code
0
github-code
1
[ { "api_name": "app.app.config", "line_number": 12, "usage_type": "attribute" }, { "api_name": "app.app", "line_number": 12, "usage_type": "name" }, { "api_name": "sqlalchemy.create_engine", "line_number": 13, "usage_type": "call" }, { "api_name": "sqlalchemy.inspe...
72301275554
#!/usr/bin/python3 from lxml import html import requests import hashlib import base64 import re session = "7uvlvl1ci3tho8pdl2pgrp7ag0" # NOT GETTING THE RIGHT CHALLENGE def process(data): print("="*35 + " Input " + "="*35) print(data) # can_decode = True # i = 0 # while can_decode: # i += 1 # try: # temp = ...
0xchase/ctfs
ring0/coding/7-littlelf/solve.py
solve.py
py
1,345
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 50, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "line_number": 57, "usage_type": "call" }, { "api_name": "lxml.html", "line_number": 57, "usage_type": "name" }, { "api_name": "requests.get", "line_...
21173035808
from typing import Dict, List from app.utils import preprocessor_slot_description_to_value import torch from transformers import AutoTokenizer from app.model.pretrained_models import get_pretrained_model, get_tokenizer class FlanT5Sacc: def __init__(self, size: str, device) -> None: self.name = f"flan-t...
janpawlowskiof/template-based-response-generation-in-tod
app/rankers/flan_t5_ranker.py
flan_t5_ranker.py
py
2,949
python
en
code
0
github-code
1
[ { "api_name": "app.model.pretrained_models.get_pretrained_model", "line_number": 15, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 16, "usage_type": "name" }, { "api_name": "app.model.pretrained_models.get_tokenizer", "line_number": 16, ...
72921016995
import os from fabric.api import cd, run, env, task, get from fabric.contrib.files import exists from ..repositories import get_repo_name from fabric.context_managers import prefix @task def pip_download_cache(keep_dir=None): """Downloads pip packages into deployment pip dir. """ if not exists(env.deplo...
botswana-harvard/edc-fabric
edc_fabric/fabfile/pip/tasks.py
tasks.py
py
3,218
python
en
code
0
github-code
1
[ { "api_name": "fabric.contrib.files.exists", "line_number": 14, "usage_type": "call" }, { "api_name": "fabric.api.env.deployment_pip_dir", "line_number": 14, "usage_type": "attribute" }, { "api_name": "fabric.api.env", "line_number": 14, "usage_type": "name" }, { ...
4489182542
import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from tensorflow.keras.utils import to_categorical from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.applications import ResNet101 from tensorflow.keras.models import Model from tensorflow....
Taerimmm/ML
Lotte/06_1_ResNet101.py
06_1_ResNet101.py
py
2,392
python
en
code
3
github-code
1
[ { "api_name": "numpy.load", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.keras.utils.to_categorical", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.loa...
21447706332
import torch import torchvision import torchvision.transforms as transforms DATA_PATH = './data' def get_transform(): transform = transforms.Compose( [transforms.ToTensor(), transforms.Normalize((0.5,), (0.5,))]) return transform def get_dataset(transform, download=True): train_set = to...
nmd-2000/torchserve-demo
model/utils.py
utils.py
py
809
python
en
code
0
github-code
1
[ { "api_name": "torchvision.transforms.Compose", "line_number": 8, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 8, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 9, "usage_type": "call" }, { ...
30473794377
from django import forms from django.contrib.contenttypes.models import ContentType from django.db import transaction from .fields import TaxiField, TaxiSingleField from .models import TermTaxonomy, TermTaxonomyItem class TaxiModelMixin(forms.ModelForm): """ Mixin used on model forms where a TaxiField is set...
nibon/django-taxi
django_taxi/mixins.py
mixins.py
py
3,745
python
en
code
0
github-code
1
[ { "api_name": "django.forms.ModelForm", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 9, "usage_type": "name" }, { "api_name": "fields.TaxiField", "line_number": 21, "usage_type": "name" }, { "api_name": "fields.TaxiSi...
6003789556
#!/usr/bin/env python # -*- coding: utf-8 -*- def docclass_test(): cl = fisherclassifier(getwords) cl.setdb('test1.db') sampletrain(cl) cl2 = naivebayes(getwords) cl2.setdb('test1.db') cl2.classify('quick money') if __name__ == '__main__': import nose nose.main()
cametan001/document_filtering
docclass_test.py
docclass_test.py
py
300
python
en
code
1
github-code
1
[ { "api_name": "nose.main", "line_number": 14, "usage_type": "call" } ]
71904121953
import serial import time import numpy as np class DummyHead(): def __init__(self, port): """Will work in deg in this class""" self.ino = serial.Serial('/dev/cu.usbmodem'+str(port), 115200, timeout=1) time.sleep(2) self.theta = 0 #need big range here self.max_left ...
zacharyyamaoka/DE3-Audio
dummy_head.py
dummy_head.py
py
2,099
python
en
code
0
github-code
1
[ { "api_name": "serial.Serial", "line_number": 9, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.deg2rad", "line_number": 43, "usage_type": "call" } ]
71904125153
#Imports from torch.utils.data import Dataset import pandas as pd import numpy as np import librosa import torch class AudioLocationDataset(Dataset): def __init__(self, root="./../data_clip/", csv="./data_clip_label/label.csv", transform=None, use_subset=None, num_bin = 2): self.root = root self...
zacharyyamaoka/DE3-Audio
nn_utils/nn_util.py
nn_util.py
py
6,075
python
en
code
0
github-code
1
[ { "api_name": "torch.utils.data.Dataset", "line_number": 11, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "librosa.core.load", "line_number": 35, "usage_type": "call" }, { "api_name": "librosa.co...
17447453062
from typing import Callable, Dict from starlette import status from starlette.middleware.base import BaseHTTPMiddleware from starlette.requests import Request from starlette.responses import RedirectResponse, Response from starlette.types import ASGIApp, Receive, Scope, Send class LegacyRedirectMiddleware(BaseHTTPMi...
florimondmanca/www
server/web/legacy.py
legacy.py
py
2,045
python
en
code
31
github-code
1
[ { "api_name": "starlette.middleware.base.BaseHTTPMiddleware", "line_number": 10, "usage_type": "name" }, { "api_name": "starlette.types.ASGIApp", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 15, "usage_type": "name" }, { "...
24602385004
from pydoc import text from flask import Flask, jsonify import socket import flask import netifaces import subprocess from flask.globals import request from uuid import getnode as get_mac from threading import Thread import os, sys, json, struct, socket, fcntl, time import subprocess from os import listdir from os.path...
khayalghosh/data
app.py
app.py
py
8,797
python
en
code
0
github-code
1
[ { "api_name": "sys.modules", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 22, "usage_type": "attribute" }, { "api_name": "flask.Flask", "l...
20613432599
import maya.cmds as cmds from math import * psphere = cmds.sphere(r=5) pcube = cmds.polyCube() pcone = cmds.polyCone() closestToSurface = cmds.createNode("closestPointOnSurface") cmds.connectAttr(closestToSurface+'.position', pcube[0]+'.translate') cmds.connectAttr(pcone[0]+'.translate', closestToSurface+'.inPosition'...
ameliacode/BestTextbookforTechnicalArtists
Chapter 2. Procedure/object_movement.py
object_movement.py
py
401
python
en
code
0
github-code
1
[ { "api_name": "maya.cmds.sphere", "line_number": 4, "usage_type": "call" }, { "api_name": "maya.cmds", "line_number": 4, "usage_type": "name" }, { "api_name": "maya.cmds.polyCube", "line_number": 5, "usage_type": "call" }, { "api_name": "maya.cmds", "line_numb...
8007887981
# App de Medição de Indice de Descarte # Imports import pickle import numpy as np import pandas as pd import logging, io, os, sys from sklearn.ensemble import GradientBoostingClassifier from flask import Flask, render_template, flash, request, jsonify # pip install flask_httpauth from flask_httpauth import HTTPBasic...
machadodecastro/animal_death_risk_prediction
app/app.py
app.py
py
3,775
python
pt
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 17, "usage_type": "call" }, { "api_name": "flask_httpauth.HTTPBasicAuth", "line_number": 21, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 73, "usage_type": "call" }, { "api_name": "logging.exceptio...
22735484746
import cv2 import sys import os # 解析gpfpd消息 def parse_gpfpd(gpfpdfile): with open(gpfpdfile, 'r') as f: dic1 = [] dic1.append(-1) dic2 = [] dic2.append([0,0,0,0,-0.202,0,0,0,0,0,0,0,0,0,0,0]) for line in f.readlines(): line = line.strip('\n') ...
guoxxiong/Lane-Image-Stitching-Based-on-Integrated-Inertial-Navigation
rotate.py
rotate.py
py
2,299
python
en
code
1
github-code
1
[ { "api_name": "os.path.exists", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_number": 36, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 37, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number...
15621341184
import urllib from bs4 import BeautifulSoup import re import csv url = "http://stats.footballpredictions.net/england/premier/1995-1996/results.html" htmlfile = urllib.urlopen(url) soup = BeautifulSoup(htmlfile) #home team names hometeam = soup.find_all("td", class_="hometeam") ht = [] for element in hometeam: ht.ap...
dviera/replications
Lee/get_data.py
get_data.py
py
1,233
python
en
code
0
github-code
1
[ { "api_name": "urllib.urlopen", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 29, "usage_type": "call" }, { "api_name": "re.UNICODE", "line_number":...
69827179554
import pandas as pd from tqdm import tqdm labels = ["Prevention", "Treatment", "Diagnosis", "Mechanism", "Case Report", "Transmission", "Forecasting", "General"] df1 = pd.read_csv("org_proc.csv") df2 = pd.read_csv("covid_dataset_shuffled.csv") df2 = df2.sample(frac=1).reset_index(drop=True) print(len(df2)) print(df1["p...
ujeong1/SBP22_DiscourseNet_experiment
creator/matched_csv.py
matched_csv.py
py
955
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_...
36571798337
from flask import jsonify, request from flask_restful import Resource from Model import db, VistorChainsTotal, VistorLevel, Vistor, States from Model import VisitorChainTotalSchema, VistorLevelSchema, VisitorSchema, QuerySchema, StatesSchema, Names from webargs import fields, validate from webargs.flaskparser import...
donc310/WidgetApi
resources/Query.py
Query.py
py
9,773
python
en
code
0
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "attribute" }, { "api_name": "Model.VisitorChainTotalSchema", "line_number": 17, "usage_type": "name" }, { "api_na...
43518145068
from optimize import snopta, SNOPT_options import numpy as np from scipy.spatial import Delaunay import scipy.io as io import os import inspect from dogs import Utils from dogs import interpolation from dogs ...
kimukook/SDOGS
dogs/adaptive_snopt_min.py
adaptive_snopt_min.py
py
18,534
python
en
code
0
github-code
1
[ { "api_name": "numpy.zeros", "line_number": 60, "usage_type": "call" }, { "api_name": "numpy.int32", "line_number": 63, "usage_type": "attribute" }, { "api_name": "scipy.spatial.Delaunay", "line_number": 66, "usage_type": "call" }, { "api_name": "numpy.ones", ...
41034040354
from __future__ import annotations from typing import Any from typing import Optional from . import ext from .._typing import _OnConflictConstraintT from .._typing import _OnConflictIndexElementsT from .._typing import _OnConflictIndexWhereT from .._typing import _OnConflictSetT from .._typing import _OnConflictWhere...
sqlalchemy/sqlalchemy
lib/sqlalchemy/dialects/postgresql/dml.py
dml.py
py
10,965
python
en
code
8,024
github-code
1
[ { "api_name": "sql._typing._DMLTableArgument", "line_number": 31, "usage_type": "name" }, { "api_name": "sql.dml.Insert", "line_number": 51, "usage_type": "name" }, { "api_name": "sql.expression.alias", "line_number": 91, "usage_type": "call" }, { "api_name": "uti...
4327026652
import ipaddress import re import glob def Return_IP_adr(str): if re.match("^ ip address ([0-9.]+) ([0-9.]+)$", str): r = re.match("^ ip address ([0-9.]+) ([0-9.]+)$", str) return ipaddress.IPv4Network((r.group(1), r.group(2)),strict = False) else: return "None" list_files = glob.glo...
shpinatashan/p4ne
Lab1.6/Lab.py
Lab.py
py
827
python
en
code
0
github-code
1
[ { "api_name": "re.match", "line_number": 6, "usage_type": "call" }, { "api_name": "re.match", "line_number": 7, "usage_type": "call" }, { "api_name": "ipaddress.IPv4Network", "line_number": 8, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 1...
27429545506
#REQUIREMENTS # ffmpeg # vosk # youtube-dl ## import vosk import os import sys import getopt from traceback import print_exc from subprocess import Popen, PIPE import shlex import json from vosk import Model, KaldiRecognizer, SetLogLevel def main(*argv): try: #argv = argv[0] argv = sys.argv[1:] ...
giraycoskun/vosk-ASR-app
app/commandline_tool.py
commandline_tool.py
py
3,878
python
en
code
0
github-code
1
[ { "api_name": "sys.argv", "line_number": 22, "usage_type": "attribute" }, { "api_name": "getopt.getopt", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "line_number...
33559442185
from django.contrib.auth.models import User from django.db import models from django.db.models import Index class EquipmentType(models.Model): """ Тип оборудования """ name = models.CharField(max_length=255, verbose_name='Type name') serial_number_mask = models.CharField(max_length=50, verbose...
KotelnikovKP/equipment
backend/models.py
models.py
py
2,379
python
en
code
0
github-code
1
[ { "api_name": "django.db.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 10, "usage_type": "call" }, { "api_name": ...
20485270061
import requests from bs4 import BeautifulSoup import pandas as pd def extract(page): url = f'https://in.indeed.com/jobs?q=python+developer&l=India&start={page}' res = requests.get(url) # return res.status_code soup = BeautifulSoup(res.content, 'html.parser') return soup job_list = [...
ashish-ash303/Indeed-Scraping
indeed.py
indeed.py
py
1,067
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 45, "usage_type": "call" } ]
18286950948
#!/usr/bin/python # -*- coding: utf-8 -*- import sqlite3 import random import datetime import os current_file_path = os.path.realpath(__file__) current_directory_path = os.path.dirname(current_file_path) resources_directory_path = os.path.join(current_directory_path, '..', 'resources') db_directory_path = os.path.joi...
PlytonRexus/vigilant-carnival
src/main.py
main.py
py
50,771
python
en
code
0
github-code
1
[ { "api_name": "os.path.realpath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
751666782
import argparse import re import os import pickle '''--------------------Parsing argumnts--------------------''' parser = argparse.ArgumentParser(description="Этот код создаёт модель, обученную на текстах песен") parser.add_argument( '--input_dir', type=str, help="Путь к папке с песнями" ) pars...
DommeUse/Text-Generator
train.py
train.py
py
1,508
python
ru
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 25, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 31, "usage_type": "call" }, { "api_name": "pickle.dump", "line_numb...
2299118867
import os import xml.etree.ElementTree as ET import json def append_barcode(results, barcode): result = {} result["attrib"] = barcode.attrib Values = get_elements(barcode, "Value") for Value in Values: result["text"] = Value.text result["value_attrib"] = Value.attrib resu...
xulihang/Barcode-Reading-Performance-Test
utils/create_ground_truth_from_xml.py
create_ground_truth_from_xml.py
py
1,176
python
en
code
11
github-code
1
[ { "api_name": "os.listdir", "line_number": 21, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.parse", "line_number": 24, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 24, "usage_type": "name" }, { "api_name": "os.path....
21237918702
import os import queue import json from jsonschema import validate import collections class TestCase(): """Attributes of a single test. Args: test_data (dict): data for a single test, parsed from JSON test declaration. """ __test__ = False #: Ignored by Pytest ...
MaxenceCaronLasne/unitbench
unitbench/testdeclaration.py
testdeclaration.py
py
4,307
python
en
code
1
github-code
1
[ { "api_name": "queue.Queue", "line_number": 85, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 86, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 129, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "li...
1093253833
import sys import os sys.path.insert(0, os.getcwd() + '/../keggimporter') import logging import logging.handlers from Config import * from Importer import * config = Config() config.loadConfiguration() conf = config.getConfigurations() logFile = conf.get( 'log', 'info' ) log = logging.getLogger('') log.setLevel(lo...
alexanderfranca/keggimporter
bin/execute-importer.py
execute-importer.py
py
1,573
python
en
code
0
github-code
1
[ { "api_name": "sys.path.insert", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 3, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_nu...
7946558670
import warnings import argparse import mlflow from mlflow.tracking.client import MlflowClient warnings.filterwarnings("ignore", category=FutureWarning) from custom_preproc_classes.config.core import config def parse_bool(to_production: str): if to_production == "T": return True elif to_production ==...
afanzott/Data_Science_Best_Practice
register_mlflow_model.py
register_mlflow_model.py
py
1,955
python
en
code
0
github-code
1
[ { "api_name": "warnings.filterwarnings", "line_number": 6, "usage_type": "call" }, { "api_name": "mlflow.set_tracking_uri", "line_number": 32, "usage_type": "call" }, { "api_name": "mlflow.register_model", "line_number": 33, "usage_type": "call" }, { "api_name": "...
72551570275
from enum import IntEnum, auto from typing import Tuple, Sequence from unsserv.common.utils import parse_node from unsserv.common.structs import Node from unsserv.common.rpc.structs import Message from unsserv.common.rpc.protocol import AProtocol, ITranscoder, Command, Data, Handler from unsserv.extreme.searching.stru...
aratz-lasa/py-unsserv
unsserv/extreme/searching/protocol.py
protocol.py
py
3,158
python
en
code
5
github-code
1
[ { "api_name": "enum.IntEnum", "line_number": 18, "usage_type": "name" }, { "api_name": "enum.auto", "line_number": 19, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 20, "usage_type": "call" }, { "api_name": "unsserv.common.rpc.protocol.ITransco...
8620148120
from django.core.management.base import BaseCommand from home2_app.models import Client class Command(BaseCommand): help = "edit client name " def add_arguments(self, parser): parser.add_argument('name', type=str, help="Client_name") parser.add_argument('new_name', type=str, help="New_Client...
vit21513/django_homework
home_project/home2_app/management/commands/edit_client_name.py
edit_client_name.py
py
698
python
en
code
0
github-code
1
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 5, "usage_type": "name" }, { "api_name": "home2_app.models.Client.objects.filter", "line_number": 15, "usage_type": "call" }, { "api_name": "home2_app.models.Client.objects", "line_number": 15, "usage...
15345500601
#!/usr/bin/env python # coding: utf-8 # In[1]: print("Hello World!") # In[2]: import librosa import numpy as np import matplotlib.pyplot as plt import IPython.display as ipd import librosa.display from IPython.display import Audio from scipy import stats # In[3]: y, sr = librosa.load("yours.mp3") # In[4]: ...
kirtisubs06/AI-Music-Research-Code
MusicAIJupyterNotebook.py
MusicAIJupyterNotebook.py
py
13,649
python
en
code
1
github-code
1
[ { "api_name": "librosa.load", "line_number": 25, "usage_type": "call" }, { "api_name": "IPython.display.Audio", "line_number": 40, "usage_type": "call" }, { "api_name": "librosa.onset.onset_strength", "line_number": 53, "usage_type": "call" }, { "api_name": "libro...
75257613153
# goal # 실패율이 높은 스테이지부터 내림차순으로 스테이지의 번호가 담겨있는 배열을 return 하도록 solution 함수 # description # 실패율 - 스테이지에 도달했으나 아직 클리어하지 못한 플레이어의 수 / 스테이지에 도달한 플레이어 수 # 전체 스테이지의 개수 N, 게임을 이용하는 사용자가 현재 멈춰있는 스테이지의 번호가 담긴 배열 stages가 매개변수 # condition # 스테이지의 개수 N은 1 이상 500 이하의 자연수이다. # stages의 길이는 1 이상 200,000 이하이다. # stages에는 1 이상 N + 1 이하의...
jum0/ProblemSolvingPython
Programmers/42889.py
42889.py
py
1,713
python
ko
code
0
github-code
1
[ { "api_name": "collections.Counter", "line_number": 23, "usage_type": "call" } ]
74633942113
""" Django command to wait for DB to be available """ import time # Shows error but the psycopg2 is successfully installed on docker from psycopg2 import OperationalError as Psycopg2Error from django.db.utils import OperationalError from django.core.management.base import BaseCommand class Command(BaseCommand): ...
Uchiha-Itachi0/django-recipe-api
app/core/management/commands/wait_for_db.py
wait_for_db.py
py
898
python
en
code
0
github-code
1
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 13, "usage_type": "name" }, { "api_name": "psycopg2.OperationalError", "line_number": 29, "usage_type": "name" }, { "api_name": "django.db.utils.OperationalError", "line_number": 29, "usage_type": "na...
11420247228
""" A script that compares image histograms quantitively. The user must specify either a single image or a directory (jpg/png). """ # system tools import os import argparse import sys # image and data tools import cv2 import numpy as np import glob import pandas as pd # plotting tools import matplotlib.pyplot as plt...
sarah-hvid/Vis_assignment1
src/hist_comparison.py
hist_comparison.py
py
5,910
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.calcHist", "line_number": 43, "usage_type": "call" }, { "api_name": "cv2.normalize", "line_number": 44, "usage_type": "call" }, { "api_name": "cv2.NORM_MINMAX", ...
17381459463
import pyautogui as pag from collections import namedtuple,Counter import random """ https://asyncfor.com/posts/doc-pyautogui.html screenWidth, screenHeight = pyautogui.size() currentMouseX, currentMouseY = pyautogui.position() pyautogui.moveTo(100, 150) pyautogui.click() # 鼠标向下移动10像素 pyautogui.moveRel(None, 10) pyau...
dkluffy/Gamescripts
liverbot/devicebind.py
devicebind.py
py
1,283
python
en
code
1
github-code
1
[ { "api_name": "collections.namedtuple", "line_number": 28, "usage_type": "call" }, { "api_name": "pyautogui.FAILSAFE", "line_number": 35, "usage_type": "attribute" }, { "api_name": "pyautogui.moveTo", "line_number": 37, "usage_type": "attribute" }, { "api_name": "...
42472504231
import json from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST from django.contrib.auth.mixins import LoginRequiredMixin from django.views import View from django.views.generic import FormView from django.views.generic import ...
ivn-svn/pionergallery
pionergallery/pioner_gallery/views.py
views.py
py
13,406
python
en
code
0
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_number": 39, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 39, "usage_type": "call" }, { "api_name": "django.views.generic.Tem...
34666592380
""" Useful functions for processing SMBL Data """ import requests import sys import re import libsbml import xmltodict import json def delete_doubles(arr): """ :param arr: list() :return: Given list, without duplicated entries """ arr2 = [] for element in arr: if not arr2.__contains__(...
JosuaCarl/Script_Assisted_Modeling
helper_functions.py
helper_functions.py
py
9,195
python
en
code
1
github-code
1
[ { "api_name": "re.search", "line_number": 48, "usage_type": "call" }, { "api_name": "re.search", "line_number": 58, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 83, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 87, ...
44186623516
import tensorflow as tf import pickle from metrics import PSNRMean, SSIMMean from losses import ltm_loss import utils from models.tone_curve_net import ToneCurveNetConv from models.residual_net import LTMNetResConv import os os.environ['TFHUB_MODEL_LOAD_FORMAT'] = 'COMPRESSED' def vgg_layers(layer_names): """ Cre...
Atakhan2000/ltmnet
train.py
train.py
py
3,206
python
en
code
0
github-code
1
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.applications.VGG19", "line_number": 15, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 15, "usage_type": "attribute" }, { "api_name...
30151381555
import numpy as np import cv2 import matplotlib.pyplot as plt def getScoreImg(): nums = cv2.imread("numbers.png") ret, nums = cv2.threshold(nums,127,255,cv2.THRESH_BINARY_INV) nums = cv2.cvtColor(nums, cv2.COLOR_BGR2GRAY) top = np.zeros((1,530)) nums = np.concatenate((top,top,top,top, nums, top,top...
fancent/CSC420
Project/digitRecognition/numberSlicing.py
numberSlicing.py
py
2,270
python
en
code
0
github-code
1
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.threshold", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.THRESH_BINARY_INV", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "...
28462169332
import pygame import Config import tile_map import light_handling win = pygame.display.set_mode(Config.WINDOW_SIZE) clock = pygame.time.Clock() map = tile_map.Tile_map() light = light_handling.light_handling(map.walls, map.points) flag = True while flag: clock.tick(Config.FPS) for event in pygame.event.get(...
XT60/Dynamic-lights-2D
Loop.py
Loop.py
py
672
python
en
code
10
github-code
1
[ { "api_name": "pygame.display.set_mode", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 7, "usage_type": "attribute" }, { "api_name": "Config.WINDOW_SIZE", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pyga...
10110647533
import hashlib import imp import tarfile from typing import Iterable import warnings import zipfile from pathlib import Path import shutil from urllib.parse import urlparse from urllib.request import Request, urlopen import warnings import openmc.data _BLOCK_SIZE = 16384 def state_download_size(download_size, uncom...
openmc-data-storage/openmc_data
src/openmc_data/utils.py
utils.py
py
6,546
python
en
code
null
github-code
1
[ { "api_name": "warnings.warn", "line_number": 25, "usage_type": "call" }, { "api_name": "warnings.catch_warnings", "line_number": 33, "usage_type": "call" }, { "api_name": "warnings.simplefilter", "line_number": 34, "usage_type": "call" }, { "api_name": "openmc.da...
20085148878
""" Test the rendering mechanism to see if inquirer works """ from unittest.mock import Mock, create_autospec, patch import inquirer from pytest import fixture from hacenada import render, session @fixture def renderer(): rr = render.InquirerRender() return rr def test_inquirer_type(renderer): """ ...
corydodt/Hacenada
src/hacenada/test/test_render.py
test_render.py
py
1,612
python
en
code
1
github-code
1
[ { "api_name": "hacenada.render.InquirerRender", "line_number": 14, "usage_type": "call" }, { "api_name": "hacenada.render", "line_number": 14, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 12, "usage_type": "name" }, { "api_name": "inquire...
73205778914
import sys from collections import deque n, w, L = map(int, input().split()) weight = deque(map(int, sys.stdin.readline().split())) # 트럭 무게 리스트 (=> 대기) bridge = deque() # 다리 위 for i in range(w-1): # w-1만큼 0으로 채우고 bridge.append(0...
eunjng5474/Study
week04/B_13335.py
B_13335.py
py
1,902
python
ko
code
2
github-code
1
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.stdin.readline", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "collections.deque", ...
44190566884
from flask import Flask from flask import redirect from flask import render_template from flask import url_for from flask.ext.script import Manager from flask.ext.sqlalchemy import SQLAlchemy from getpass import getuser from json ...
dark-ritual/cs373-idb
app/app.py
app.py
py
24,898
python
en
code
0
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 24, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "getpass.getuser",...
3617920960
from re import X import torch import torch.nn as nn from torchvision.transforms import functional as F from PIL import Image from models.MIMOUNet import build_net from models.unet import DeblurUNet from models.face_model.face_gan import FaceGAN from skimage.metrics import peak_signal_noise_ratio import cv2 import os...
ckirchhoff2021/ImageSynthesis
MMU-DDP/gen2.py
gen2.py
py
4,212
python
en
code
2
github-code
1
[ { "api_name": "models.face_model.face_gan.FaceGAN", "line_number": 35, "usage_type": "call" }, { "api_name": "models.unet.DeblurUNet", "line_number": 42, "usage_type": "call" }, { "api_name": "models.MIMOUNet.build_net", "line_number": 44, "usage_type": "call" }, { ...
34121568699
import time import PySimpleGUI as sg from classes.logger import Logger from classes.microscope_mover import MicroscopeMover, mover from classes.scanner import Scanner from classes.solis import Automatization from gui.helpers import disable_element, enable_element, get_load_path, str_to_int from gui.scanner_gui import...
LZP-2020-1-0200/Solis-XY
scanner.py
scanner.py
py
4,903
python
en
code
0
github-code
1
[ { "api_name": "classes.logger.Logger", "line_number": 14, "usage_type": "call" }, { "api_name": "classes.scanner.Scanner", "line_number": 27, "usage_type": "name" }, { "api_name": "classes.microscope_mover.MicroscopeMover", "line_number": 27, "usage_type": "name" }, {...
27781889678
# -*- coding: utf-8 -*- """ Created on Mon Jan 28 20:19:55 2019 @author: mjkiqce3 """ import numpy as np import multiprocessing from multiprocessing import Pool def computeerr(n,regressor,cc,inputtest): for i in range(n): # We can parallelise here datause=cc[:,:,i] X=datause[:,0:10] ...
clementetienam/Machine-Learning-for-Model-Reduction-to-Fustion-Simulation-data_2
Clement_Codes/clementpara.py
clementpara.py
py
899
python
en
code
1
github-code
1
[ { "api_name": "numpy.reshape", "line_number": 16, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line_number": 27, "usage_type": "call" }, { "api_name": "multiprocessing.cpu_count", "line_number": 27, "usage_type": "call" } ]
19874279600
import cv2 import numpy as np #Fill the screen with digits def fill_digits_motion(num_array , coor_array , indexes , tos): cap=cv2.VideoCapture(0) if cap.isOpened() : ret,frame = cap.read() else: ret = False ret,frame1 = cap.read() ret,frame2 = cap.read() diff = ...
YashIndane/AR-Sudoku-Solver
python_files/motion_digits2.py
motion_digits2.py
py
1,761
python
en
code
26
github-code
1
[ { "api_name": "cv2.VideoCapture", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.absdiff", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 27, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "li...
72243973154
from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import urlfetch from django.utils import simplejson as json base = 'https://github.com/login/oauth/access_token' client_id = '?client_id=' redirect_url = '&redirect_uri=https://githubanywhere.appspot.com/call...
abraham/github-anywhere
appengine/main.py
main.py
py
2,176
python
en
code
40
github-code
1
[ { "api_name": "google.appengine.ext.webapp.RequestHandler", "line_number": 11, "usage_type": "attribute" }, { "api_name": "google.appengine.ext.webapp", "line_number": 11, "usage_type": "name" }, { "api_name": "google.appengine.ext.webapp.RequestHandler", "line_number": 16, ...
4644928169
import base64 import glob import os import os.path as op import posixpath as pp from urllib.parse import urlencode, urljoin import pandas as pd import requests class EncodeClient: BASE_URL = "http://www.encodeproject.org/" # 2020-05-15 compatible with ENCODE Metadata at: METADATA_URL = "https://www.enc...
open2c/bioframe
bioframe/sandbox/clients.py
clients.py
py
5,776
python
en
code
127
github-code
1
[ { "api_name": "os.path.join", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_number": 36, "usage_type": "name" }, { "api_name": "os.path.isdir", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, ...
74473377953
from django import forms from .models import * class StockCreateForm(forms.ModelForm): class Meta: model=Stock fields=['category','item_name','quantity'] #prevent saving form with blank details def clean_category(self): category=self.cleaned_data.get('category') if not category: raise forms.ValidationErr...
graham218/Django-simple-stock-mgmt
stock_management_system/stockmgmt/forms.py
forms.py
py
3,448
python
en
code
1
github-code
1
[ { "api_name": "django.forms.ModelForm", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 4, "usage_type": "name" }, { "api_name": "django.forms.ValidationError", "line_number": 12, "usage_type": "call" }, { "api_name": "d...
74826946272
from setuptools import setup, find_packages with open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name='mycroft-ekylibre-utils', version='0.9', packages=find_packages(), url='http://github.com/ekylibre', author='Ekylibre', author_email='rdechazelles@ekylibre.co...
ekylibre/mycroft-ekylibre-utils
setup.py
setup.py
py
732
python
en
code
0
github-code
1
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 9, "usage_type": "call" } ]
29461251296
from __future__ import division import numpy import matplotlib.cm as cm import matplotlib.pyplot as plt #import imp import os,sys import numpy as np #importlibutil #from scipy.optimize import minimize from scipy.optimize import basinhopping import random import math micron=1e-6 sys.path.append("/opt/...
jobayer07/integrated_photonics_design_optimization
optimize_polarization_rotator_step2.py
optimize_polarization_rotator_step2.py
py
3,159
python
en
code
0
github-code
1
[ { "api_name": "sys.path.append", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
72361816355
import json import re def is_empty_line(line): pattern = r'^\s*$' # 匹配只包含空白字符的行 return re.match(pattern, line) is not None def is_digit_line(line): pattern = r'^\s*\d+\s*$' # 匹配只包含空白字符的行 return re.match(pattern, line) is not None if __name__ == '__main__': items = [] with open('./openssl...
zhougy0717/utools_errno
util/parse_openssl_tls_errno.py
parse_openssl_tls_errno.py
py
1,081
python
en
code
0
github-code
1
[ { "api_name": "re.match", "line_number": 7, "usage_type": "call" }, { "api_name": "re.match", "line_number": 12, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 38, "usage_type": "call" } ]
72185227553
from flask import Flask;from flask_ipban import IpBan;from flask_limiter import Limiter;from flask_limiter.util import get_remote_address from blueprint.main import main from socket import gethostname from os import getcwd, path from yaml import safe_load import logging, secrets def loadConfig(): PATH = (g...
JawadPy/flask-tokyo
app.py
app.py
py
1,348
python
en
code
0
github-code
1
[ { "api_name": "os.getcwd", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "name" }, { "api_name": "yaml.safe_load", "line_number": 1...
73088426594
import asyncio import logging import signal import session log = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) class MyClientSession(session.ClientSession): async def on_connected(self): self.update_sock.subscribe('test.topic') self.client_state = session.ClientSessionStat...
hippysurfer/pyqtzmq
test_client.py
test_client.py
py
1,856
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "session.ClientS...
22386365690
import random import torch import cv2 import json import os from typing import List, Tuple import asset from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler from asset.utils import dmsg,getIfAugmentData import imgaug.augmenters as iaa import numpy as np from tqdm import tqdm import random as rand from ...
AIS-Bonn/Local_Freq_Transformer_Net
lfdtn/dataloaders.py
dataloaders.py
py
22,110
python
en
code
14
github-code
1
[ { "api_name": "torch.utils.data.Dataset", "line_number": 17, "usage_type": "name" }, { "api_name": "torchvision.datasets.MNIST", "line_number": 37, "usage_type": "call" }, { "api_name": "torchvision.datasets", "line_number": 37, "usage_type": "name" }, { "api_name...
72861968355
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import os import sys import re import codecs import chardet def convert(filename, target_encoding="UTF-8"): try: content = codecs.open(filename, 'r').read() source_encoding = chardet.detect(content)['encoding'] if content is not '' and source_...
xin0111/PythonTools
change_encoding.py
change_encoding.py
py
1,319
python
en
code
1
github-code
1
[ { "api_name": "codecs.open", "line_number": 11, "usage_type": "call" }, { "api_name": "chardet.detect", "line_number": 12, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 16, "usage_type": "call" }, { "api_name": "codecs.open", "line_number...
6044731535
""" Michael Neilson <github: nichael-meilson> 2022-06-30 """ import pytest from httpx import AsyncClient from fastapi import FastAPI from starlette.status import ( HTTP_201_CREATED, HTTP_404_NOT_FOUND, HTTP_422_UNPROCESSABLE_ENTITY, HTTP_200_OK, ) from app.models.articles import CreateArticle, Article...
nichael-meilson/camel2
src/tests/test_articles.py
test_articles.py
py
4,126
python
en
code
0
github-code
1
[ { "api_name": "pytest.mark", "line_number": 19, "usage_type": "attribute" }, { "api_name": "app.models.articles.CreateArticle", "line_number": 24, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 22, "usage_type": "attribute" }, { "api_name":...
23207730387
import dgl import unittest import backend as F from dgl.dataloading import AsyncTransferer @unittest.skipIf(F._default_context_str == 'cpu', reason="CPU transfer not allowed") def test_async_transferer_to_other(): cpu_ones = F.ones([100,75,25], dtype=F.int32, ctx=F.cpu()) tran = AsyncTransfer...
taotianli/gin_model.py
tests/compute/_test_async_transferer.py
_test_async_transferer.py
py
975
python
en
code
5
github-code
1
[ { "api_name": "backend.ones", "line_number": 10, "usage_type": "call" }, { "api_name": "backend.int32", "line_number": 10, "usage_type": "attribute" }, { "api_name": "backend.cpu", "line_number": 10, "usage_type": "call" }, { "api_name": "dgl.dataloading.AsyncTran...
30478138727
#!/usr/bin/env python from __future__ import division __author__ = "Sam Way" __copyright__ = "Copyright 2014, The Clauset Lab" __license__ = "BSD" __maintainer__ = "Sam Way" __email__ = "samfway@gmail.com" __status__ = "Development" import warnings from numpy import array, asarray, unique, bincount, min, floor, zero...
samfway/biotm
misc/util.py
util.py
py
2,307
python
en
code
0
github-code
1
[ { "api_name": "numpy.asarray", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.bincount", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.min", "line_numbe...
10880342788
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render from django.http import HttpResponse from django.template import loader from django.template.loader import get_template from polls.models import Food_Place_ID_Yelp,Food_Place_ID_Zomato, Recipe, User_Detail from django....
aquddus95/API-Integration
API-Integration/finalproject/polls/views.py
views.py
py
8,599
python
en
code
1
github-code
1
[ { "api_name": "django.template.loader.get_template", "line_number": 22, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 23, "usage_type": "call" }, { "api_name": "polls.models.Food_Place_ID_Yelp.objects.filter", "line_number": 33, "usage_t...
7695455337
from .interpretpicklist import Interpretpicklist from . import dateutils from datetime import datetime from . import xmlutilities from synthesis.exceptions import DataFormatError#, SoftwareCompatibilityError from . import logger #from sys import version from . import dbobjects from .writer import Writer from zope.inter...
211tbc/synthesis
src/svcpointxml5writer.py
svcpointxml5writer.py
py
26,257
python
en
code
0
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetim...
1914061684
""" NOTE: You will have to install the Haskell program find-clumpiness on your machine before running this script. For more info, see: https://github.com/GregorySchwartz/find-clumpiness Also, this script calls the find-clumpiness program using the terminal via linux commands. The commands may not work if y...
DrexelSystemsImmunologyLab/Pediatric_gut_homeostatsis_paper
Supplemental/preprocessing/get_clumpiness_by_POD.py
get_clumpiness_by_POD.py
py
27,497
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_pickle", "line_number": 61, "usage_type": "call" }, { "api_name": "pandas.read_pickle", "line_number": 62, "usage_type": "call" }, { "api_name": "pandas.read_pickle", "line_number": 70, "usage_type": "call" }, { "api_name": "pandas.read_...
8500981124
#!/usr/bin/env python # coding: utf-8 # # COEN 140 Final Project - Music Genre Classifer # In[241]: import os import json import numpy as np import scipy import pandas as pd import librosa as lb import warnings from sklearn.model_selection import train_test_split from sklearn.discriminant_analysis import LinearDis...
amiller5233/COEN140-genre-classifier
final_project.py
final_project.py
py
10,097
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path.join", "l...
15918005232
from .MetadataEnhancer import MetadataEnhancer from utils import _try_for_key class VariableEnhancer(MetadataEnhancer): def __init__(self, metadata: dict, enrichment_table: dict): super().__init__(metadata, enrichment_table) def enhance_metadata(self): """ enhance_metadata implementation for...
odissei-data/metadata-enhancer
src/enhancers/VariableEnhancer.py
VariableEnhancer.py
py
1,895
python
en
code
0
github-code
1
[ { "api_name": "MetadataEnhancer.MetadataEnhancer", "line_number": 5, "usage_type": "name" }, { "api_name": "utils._try_for_key", "line_number": 21, "usage_type": "call" } ]
25772535003
#!/usr/bin/python from __future__ import print_function import atexit from bcc import BPF import os from datetime import datetime # load BPF program b= BPF(src_file="kwtracer.c") b.attach_kprobe(event="iov_iter_copy_from_user_atomic",fn_name="trace_do_user_space_write") b.attach_kprobe(event="submit_bio", fn_name="t...
BoKyoungHan/kworker_tracer
kwtracer.py
kwtracer.py
py
884
python
en
code
0
github-code
1
[ { "api_name": "bcc.BPF", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime.today", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "name" }, { "api_name": "os.system", "li...
32774847100
# -*- coding: utf-8 -*- """ Created on Sun Nov 25 12:08:01 2018 @author: Jim """ import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import linear_model """ read file """ csvfile = "Concrete_Data.csv" data = pd.read_csv(csvfile) (row,column)=data.shape X_train=data['Age...
startearjimmy/4.Machine-learning
MLHW3/HW3_1.py
HW3_1.py
py
1,090
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 28, "usage_type": "call" }, { "api_name": "skl...
4703069650
import requests import json from dotenv import load_dotenv import os import ipdb import traceback from datetime import datetime import pandas as pd import matplotlib.pyplot as plt load_dotenv() notion_token = os.environ.get("NOTION_TOKEN") database_id = os.environ.get("NOTION_DB_ID") headers = { "Authorization": ...
Retro-Devils-Media/coleco
main.py
main.py
py
3,544
python
en
code
0
github-code
1
[ { "api_name": "dotenv.load_dotenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.environ.get", ...
2673451372
# This file is executed on every boot (including wake-boot from deepsleep) import esp esp.osdebug(None) #import webrepl # webrepl.start() from lib.wifiManager.wifiManager import WifiManager wifiM = WifiManager() if wifiM.connect(): print("********WIFI is Connected**********") else: wifiM.createAP() print...
juanpc13/uPython-WebServer
boot.py
boot.py
py
360
python
en
code
0
github-code
1
[ { "api_name": "esp.osdebug", "line_number": 3, "usage_type": "call" }, { "api_name": "lib.wifiManager.wifiManager.WifiManager", "line_number": 9, "usage_type": "call" } ]
41054306636
import boto3 from botocore.exceptions import ClientError import pytest from framework_from_conformance_pack import ConformancePack @pytest.mark.parametrize( "in_name, error_code", [("test-name", None), ("garbage", None), ("test-name", "TestException")], ) def test_get_conformance_pack(make_stubber, monkeypat...
awsdocs/aws-doc-sdk-examples
python/example_code/auditmanager/test/test_framework_from_conformance_pack.py
test_framework_from_conformance_pack.py
py
3,065
python
en
code
8,378
github-code
1
[ { "api_name": "boto3.client", "line_number": 13, "usage_type": "call" }, { "api_name": "framework_from_conformance_pack.ConformancePack", "line_number": 15, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 27, "usage_type": "call" }, { "api_na...
25504175395
import logging import sys from telemetry.value import histogram from telemetry.value import histogram_util from telemetry.value import scalar from metrics import Metric _HISTOGRAMS = [ { 'name': 'V8.MemoryExternalFragmentationTotal', 'units': 'percent', 'display_name': 'V8_MemoryExternalFragment...
hanpfei/chromium-net
tools/perf/metrics/memory.py
memory.py
py
10,223
python
en
code
289
github-code
1
[ { "api_name": "telemetry.value.histogram_util.RENDERER_HISTOGRAM", "line_number": 15, "usage_type": "attribute" }, { "api_name": "telemetry.value.histogram_util", "line_number": 15, "usage_type": "name" }, { "api_name": "telemetry.value.histogram_util.RENDERER_HISTOGRAM", "li...
21358137398
import neo4j.exceptions from reporting import user_watcher def test_watch_users(mocker): runner = user_watcher.app.test_cli_runner() mocker.patch( "reporting.user_watcher._is_shutdown", side_effect=[False, False, True, True], ) bootstrap_mock = mocker.patch("reporting.user_watcher._bo...
paypay/seizu
tests/unit/reporting/user_watcher_test.py
user_watcher_test.py
py
707
python
en
code
6
github-code
1
[ { "api_name": "reporting.user_watcher.app.test_cli_runner", "line_number": 7, "usage_type": "call" }, { "api_name": "reporting.user_watcher.app", "line_number": 7, "usage_type": "attribute" }, { "api_name": "reporting.user_watcher", "line_number": 7, "usage_type": "name" ...
71420523233
from django.urls import path from . import views app_name = 'blog' urlpatterns = [ path('', views.MainListView.as_view(), name='index'), path('about/', views.AboutUsView.as_view(), name='about'), path('feedback/', views.FeedBackFormView.as_view(), name='feedback'), path('feedback/success/', views.Feed...
axkiss/FirstBlog
blog_app/urls.py
urls.py
py
829
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
28537185288
# -*- coding: utf-8 -*- import sys sys.dont_write_bytecode = True import os import torch from core.config import Config from core import Test PATH = "/.../.../...-bgl_time-tcniniNet-2-5-Feb-27-2023-18-07-28" VAR_DICT = { "test_epoch": 5, "device_ids": "0", "inner_train_iter": 100, "n_gpu": 1, "test...
Aquariuaa/FSLog
Fine_Tuning_Test.py
Fine_Tuning_Test.py
py
852
python
en
code
0
github-code
1
[ { "api_name": "sys.dont_write_bytecode", "line_number": 3, "usage_type": "attribute" }, { "api_name": "core.Test", "line_number": 25, "usage_type": "call" }, { "api_name": "core.config.Config", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.join...
32232435595
#!/usr/bin/env python # coding: utf-8 # # Raster data analysis # # Raster data represent a matrix of cells (or pixels) organized into rows and columns (or a grid). Grid cells can represent data that changes **continuously** across a landscape (surface) such as elevation, air temperature, or . reflectance data from sa...
owel-lab/programming-for-sds-site
book/_build/jupyter_execute/demos/09a-demo.py
09a-demo.py
py
12,182
python
en
code
0
github-code
1
[ { "api_name": "rasterio.open", "line_number": 73, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 159, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 159, "usage_type": "name" }, { "api_name": "matplotl...
14573968338
# import library and abbreviate pyplot for easier use import matplotlib.pyplot as plt # list of data we'll be plotting inputValues = [1, 2, 3, 4, 5] squares = [1, 4, 9, 16, 25] # using a built-in style # note: this needs to go BEFORE running subplots() and plot() plt.style.use('dark_background') # fig...
jamesastephenson/python-2022
matplotlib 1 (8-13-22)/mpl_squares.py
mpl_squares.py
py
1,027
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 10, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_na...
17956866528
from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait from urllib.parse import quote import sys from pyquery import PyQu...
jtyao/jtyao_python
match.py
match.py
py
4,416
python
en
code
0
github-code
1
[ { "api_name": "config.get_webdriver", "line_number": 35, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.wait.WebDriverWait", "line_number": 36, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.expected_conditions.presence_of_element_located", ...
6307151716
import torch import numpy as np import torch.nn as nn from itertools import product, permutations try: from clarity.enhancer.compressor import CompressorTorch from clarity.enhancer.nalr import NALRTorch LIB_CLARITY = True except ModuleNotFoundError: print("There's no clarity library") LIB_CLARITY =...
ooshyun/Speech-Enhancement-Pytorch
src/loss.py
loss.py
py
4,227
python
en
code
9
github-code
1
[ { "api_name": "torch.sum", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.log10", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.mean", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.nn.Parameter", "line_numbe...
25723956292
''' Comparing single layer MLP with deep MLP (using TensorFlow) ''' import numpy as np import pickle from math import sqrt from scipy.optimize import minimize # Do not change this def initializeWeights(n_in,n_out): """ # initializeWeights return the random weights for Neural Network given the # number of ...
neeradsomanchi/HandWrittenDigitsClassification
facennScript.py
facennScript.py
py
6,487
python
en
code
0
github-code
1
[ { "api_name": "math.sqrt", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_n...
29341417351
import numpy as np import cv2 from matplotlib import pyplot as plt I = cv2.imread('/home/kanish/Desktop/image.png', cv2.IMREAD_GRAYSCALE) _, It = cv2.threshold(I, 0., 255, cv2.THRESH_OTSU) It = cv2.bitwise_not(It) _, labels = cv2.connectedComponents(I) result = np.zeros((I.shape[0], I.shape[1], 3), np.uint8) for i ...
kanishmathew777/image_processing
backend/image_processing_backend/pathfinder/join.py
join.py
py
591
python
en
code
0
github-code
1
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 5, "usage_type": "attribute" }, { "api_name": "cv2.threshold", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.THRESH_OTSU", ...
41028200186
from fastapi import status, FastAPI, Request from fastapi.exceptions import RequestValidationError import os from common.enum import MessageEnum from common.constant import const import logging from .response_wrapper import resp_err import traceback logger = logging.getLogger(const.LOGGER_API) def biz_exception(app...
awslabs/stable-diffusion-aws-extension
middleware_api/lambda/inference/common/exception_handler.py
exception_handler.py
py
1,722
python
en
code
111
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "common.constant.const.LOGGER_API", "line_number": 11, "usage_type": "attribute" }, { "api_name": "common.constant.const", "line_number": 11, "usage_type": "name" }, { "api...
25043375529
import cv2 import numpy as np import os import time import pickle from face_detection import RetinaFace path = '../data/29--Students_Schoolkids/' # model = 'resnet50' model = 'mobilenet0.25' scale = '1' name = 'retinaFace' count = 0 CONFIDENCE = 0.1 if __name__ == "__main__": for fn in os.listdir(path): fi...
thisKK/Real-time-multi-face-recognition-base-on-Retinaface
faceDetection/WRILD_FACE.py
WRILD_FACE.py
py
1,545
python
en
code
1
github-code
1
[ { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, ...
33195953151
import unittest from mock import ANY, Mock, patch from captainhook import pre_commit class TestMain(unittest.TestCase): def setUp(self): self.get_files_patch = patch('captainhook.pre_commit.get_files') get_files = self.get_files_patch.start() get_files.return_value = ['file_one'] ...
alexcouper/captainhook
test/test_pre_commit.py
test_pre_commit.py
py
2,423
python
en
code
54
github-code
1
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "mock.patch", "line_number": 11, "usage_type": "call" }, { "api_name": "mock.patch", "line_number": 15, "usage_type": "call" }, { "api_name": "mock.Mock", "line_num...
16165826774
# coding: utf-8 from mock import mock from django.contrib.auth.models import User from django.conf import settings from rest_framework import status class AuthHelperMixin(object): def setUp(self): super(AuthHelperMixin, self).setUp() self.requests_patcher = mock.patch('sw_rest_auth.permissions.r...
telminov/sw-django-rest-auth
sw_rest_auth/tests/helpers.py
helpers.py
py
3,698
python
en
code
3
github-code
1
[ { "api_name": "mock.mock.patch", "line_number": 13, "usage_type": "call" }, { "api_name": "mock.mock", "line_number": 13, "usage_type": "name" }, { "api_name": "django.conf.settings.AUTH_SERVICE_CHECK_PERM_URL", "line_number": 23, "usage_type": "attribute" }, { "a...
29851347028
from time import sleep from selenium import webdriver from selenium.webdriver.chrome.options import Options import argparse from msedge.selenium_tools import Edge, EdgeOptions import pandas as pd import platform import datetime import pandas as pd import multiprocessing as mp from functools import partial import sys fr...
alexZajac/airlines_performance
explanations_professors/tweeter_data.py
tweeter_data.py
py
11,622
python
en
code
1
github-code
1
[ { "api_name": "time.sleep", "line_number": 118, "usage_type": "call" }, { "api_name": "platform.system", "line_number": 132, "usage_type": "call" }, { "api_name": "platform.system", "line_number": 135, "usage_type": "call" }, { "api_name": "platform.system", "...
41012383162
import json import time import pymongo import threading from .TwitchWebsocket.TwitchWebsocket import TwitchWebsocket from .FlushPrint import ptf ws = None statsDict = {} statsLock = None statsThread = None colRewards = None # True if user is a mod or the broadcaster def CheckPrivMod(tags): return (tags["mod"] ==...
ThomasCulotta/PureBot
Utilities/TwitchUtils.py
TwitchUtils.py
py
4,299
python
en
code
0
github-code
1
[ { "api_name": "json.dumps", "line_number": 37, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 41, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 50, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 60, ...
32411124306
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns class DataVisualization(object): def __init__(self, data_frame) : self.data_frame = data_frame def view_histogram_by_column(self, column, title): try: sns.set(style='whitegrid') f, ax = plt.subplots(1,1, figsize=(...
jaznamezahidalgo/Libreria-EDA
Visualization.py
Visualization.py
py
1,526
python
es
code
0
github-code
1
[ { "api_name": "seaborn.set", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "seaborn.hist...
8682854808
import numpy as np import matplotlib.pyplot as plt def f(x, y): return x - y def euler_method(f, x0, y0, h, num_steps): x_values = [x0] y_values = [y0] for _ in range(num_steps): x_next = x_values[-1] + h y_next = y_values[-1] + h * f(x_values[-1], y_values[-1]) ...
danielkatz19/ODE-s-Runge-Kutta
Correct_Math 312_Group Delta/Commented Code/example_code 2_commented .py
example_code 2_commented .py
py
711
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 28, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 28, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 29, "usage_type": "call" }, { "api_name": "mat...
13008619672
# -*- coding: utf-8 -*- import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule from web_news.misc.spiderredis import SpiderRedis from web_news.items import SpiderItem from scrapy.loader import ItemLoader class BjdSpider(SpiderRedis): name = 'bjd' al...
qiangber/web_news
web_news/spiders/bjd.py
bjd.py
py
1,814
python
en
code
0
github-code
1
[ { "api_name": "web_news.misc.spiderredis.SpiderRedis", "line_number": 9, "usage_type": "name" }, { "api_name": "scrapy.spiders.Rule", "line_number": 16, "usage_type": "call" }, { "api_name": "scrapy.linkextractors.LinkExtractor", "line_number": 16, "usage_type": "call" ...
22123114317
import unittest from typing import List ''' build on top of leetcode 84 cite from https://leetcode.com/problems/maximal-rectangle/discuss/122456/Easiest-solution-build-on-top-of-leetcode84 ''' class Solution: def maximalRectangle(self, matrix: List[List[str]]) -> int: if(len(matrix) == 0 or len(matrix[0]) ...
AllieChen02/LeetcodeExercise
Stack/P85MaximalRectangle/Maximal Rectangle.py
Maximal Rectangle.py
py
1,302
python
en
code
0
github-code
1
[ { "api_name": "typing.List", "line_number": 9, "usage_type": "name" } ]
36972627167
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division import browser import argparse import sys from mutagen import File from mutagen.mp3 import HeaderNotFoundError import os DEFAULT_FOLDER = './' def update_progress(progress, total): percent = int(progress / total * 100) sys.stdout.w...
alexandre-p/music-audit
lib/tags_clean_up.py
tags_clean_up.py
py
2,007
python
en
code
0
github-code
1
[ { "api_name": "sys.stdout.write", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.stdout.flush", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.stdout", "l...
599630674
from __future__ import print_function import pysb.bng import numpy import sympy import re import ctypes import csv import scipy.interpolate import sys from pysundials import cvode # Thee set of functions set up the system for annealing runs # and provide the runner function as input to annealing def spinner(i): ...
pysb/pysb
pysb/deprecated/varsens_sundials.py
varsens_sundials.py
py
20,542
python
en
code
152
github-code
1
[ { "api_name": "sys.stdout.flush", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pysb.bng.bng.generate_equations", "line_number": 26, "usage_type": "call" }, { "api_name": "pysb...
14284120751
# yourapp/views.py from django.shortcuts import render, redirect from django.http import HttpResponse from .scripts import main as script from .scripts import validate from .scripts.visualization import visualize import os import pandas as pd data_processed = False image_directory = os.path.join(os.getcwd(), 'yourapp...
SartajBhuvaji/Data-Science-Research-FlaskApp
djangoapp/yourapp/views.py
views.py
py
5,774
python
en
code
0
github-code
1
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 12, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "...
29028858099
from datetime import datetime from classes.field import Field class Birthday(Field): @Field.value.setter def value(self, value=None): if value and type(value) == str: value = value.replace('.', '-') try: value = datetime.strptime(value, '%d-%m-%Y').date() ...
IrinaShushkevych/classes_bot_helper
classes/birthday.py
birthday.py
py
653
python
en
code
0
github-code
1
[ { "api_name": "classes.field.Field", "line_number": 4, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "name" }, { "api_name": "class...
36170445031
import logging from typing import List from volatility3.framework import constants, exceptions, renderers, interfaces from volatility3.framework.configuration import requirements from volatility3.framework.objects import utility from volatility3.plugins.windows import pslist vollog = logging.getLogger(__name__) cla...
volatilityfoundation/volatility3
volatility3/framework/plugins/windows/cmdline.py
cmdline.py
py
3,700
python
en
code
1,879
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "volatility3.framework.interfaces.plugins", "line_number": 12, "usage_type": "attribute" }, { "api_name": "volatility3.framework.interfaces", "line_number": 12, "usage_type": "name"...
690977689
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('behavior_subjects', '0007_auto_20151119_1117'), ] operations = [ migrations.AddField( model_name='session', ...
c-wilson/behavior_monitor
behavior_subjects/migrations/0008_session_exh_inh_delay.py
0008_session_exh_inh_delay.py
py
460
python
en
code
0
github-code
1
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...