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
37616127622
import time import os from richxerox import * from tinydb import TinyDB, where HOME_DIR = 'static/db' # Create directory if it doesn't exist os.system("mkdir %s" % HOME_DIR) db = TinyDB('%s/db.json' % HOME_DIR) currently_found_in_clipboard = paste(format='text') while True: time.sleep(0.1) # one tenth of a second...
pantacuzino/personalkb
script.py
script.py
py
807
python
en
code
0
github-code
6
[ { "api_name": "os.system", "line_number": 9, "usage_type": "call" }, { "api_name": "tinydb.TinyDB", "line_number": 10, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 13, "usage_type": "call" }, { "api_name": "time.time", "line_number": 17, ...
30609616360
import numpy as np import os import Tools.FilesTool as FilesTool import imblearn.over_sampling as over_sampling class DataSetTool: # 08版的度量补偿 # Mij in Target = (Mij in Target * Mean(Mj in Source)) / Mean(Mj) in Target @staticmethod def metric_compensation(source, target): # 遍历每一个度量...
ylxieyu/HYDRA
DataSetTool.py
DataSetTool.py
py
3,100
python
en
code
5
github-code
6
[ { "api_name": "numpy.mean", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 30, ...
71520783227
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import math from detectron2.detectron2.layers import FrozenBatchNorm2d, ShapeSpec, get_norm _NORM = 'BN' class Conv2d_BN(nn.Module): """Convolution with BN module.""" def __init__( self, in_ch, ...
LiaoYun0x0/BiFormer
models/dila_prm.py
dila_prm.py
py
4,008
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
71087023548
""" Tests for the server. Before running them, the server database should be restarted. Run as: python server/tests/test_all.py (don't use py.test as it does not pass env variables easily) """ import os import shutil from pathlib import Path from typing import List import pytest from requests.exceptions import HTTPE...
molecule-one/mlinpl-23-workshops
server/tests/test_all.py
test_all.py
py
4,995
python
en
code
1
github-code
6
[ { "api_name": "rich.console.Console", "line_number": 25, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 27, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 27, "usage_type": "attribute" }, { "api_name": "src.server_wrappe...
30137635
#!/usr/bin/python # -*- coding: utf-8 -*- import requests import json url = "http://localhost:6332" headers = {'content-type': 'application/json'} def get_result(payload): response = requests.post( url, data=json.dumps(payload), headers=headers).json() return json.dumps(response) def get_all_address(...
taozywu/token_light
rpc.py
rpc.py
py
1,701
python
en
code
0
github-code
6
[ { "api_name": "requests.post", "line_number": 10, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 12, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 2...
29456781892
from six.moves.urllib import parse import tarfile from lxml import etree from atrope import exception SPECS = { 'http://www.vmware.com/interfaces/specifications/vmdk.html': 'vmdk', 'https://people.gnome.org/~markmc/qcow-image-format.html': 'qcow', } def _get_tarfile(ova): if not tarfile.is_tarfile(ova)...
alvarolopez/atrope
atrope/ovf.py
ovf.py
py
1,986
python
en
code
2
github-code
6
[ { "api_name": "tarfile.is_tarfile", "line_number": 15, "usage_type": "call" }, { "api_name": "atrope.exception.CannotOpenFile", "line_number": 16, "usage_type": "call" }, { "api_name": "atrope.exception", "line_number": 16, "usage_type": "name" }, { "api_name": "t...
37188371889
import os import csv import math import numpy as np import nltk from nltk.corpus import stopwords import collections import string import re from sklearn.model_selection import KFold from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM from keras.layers.embeddings import Emb...
arinjayakhare1/Real-Time-Tweet-Classifier-using-RLAN
test/old codes/testWithThreads/initTrainer/old Programs/initTrainer.py
initTrainer.py
py
6,270
python
en
code
0
github-code
6
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 19, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 19, "usage_type": "name" }, { "api_name": "time.time", "line_number": 24, "usage_type": "call" }, { "api_name": "csv.reade...
73730902266
import tensorflow as tf import numpy as np import seaborn as sns import matplotlib.pyplot as plt from scipy.interpolate import griddata import pandas as pd from NS_model_tf import Sampler, Navier_Stokes2D if __name__ == '__main__': def U_gamma_1(x): num = x.shape[0] return np.tile(np.arr...
PredictiveIntelligenceLab/GradientPathologiesPINNs
Lid-driven Cavity/NS.py
NS.py
py
6,568
python
en
code
134
github-code
6
[ { "api_name": "numpy.tile", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 2...
859362304
from __future__ import division from vistrails.core.modules.vistrails_module import Module from ..common import get_numpy from ..read.read_numpy import NumPyArray class WriteNumPy(Module): """Writes a list as a Numpy file. NumPy can use one of two schemes: either 'plain' binary arrays, i.e. just the bi...
VisTrails/VisTrails
vistrails/packages/tabledata/write/write_numpy.py
write_numpy.py
py
4,325
python
en
code
100
github-code
6
[ { "api_name": "vistrails.core.modules.vistrails_module.Module", "line_number": 9, "usage_type": "name" }, { "api_name": "read.read_numpy.NumPyArray.FORMATS", "line_number": 21, "usage_type": "attribute" }, { "api_name": "read.read_numpy.NumPyArray", "line_number": 21, "us...
73928012028
import collections import random import unittest import mock from cardboard import card as c, events, zone as z from cardboard.tests.util import GameTestCase from cardboard.util import ANY ENTER, LEAVE = events.ENTERED_ZONE, events.LEFT_ZONE class ZoneTest(GameTestCase): card = mock.Mock(spec=c.Card) de...
Julian/cardboard
cardboard/tests/test_zone.py
test_zone.py
py
8,874
python
en
code
7
github-code
6
[ { "api_name": "cardboard.events.ENTERED_ZONE", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cardboard.events", "line_number": 12, "usage_type": "name" }, { "api_name": "cardboard.events.LEFT_ZONE", "line_number": 12, "usage_type": "attribute" }, { ...
5118772924
from flask import current_app, Blueprint,request, jsonify from vpnresolve import VPNResolve import json import logging logger = logging.getLogger( "ucn_logger" ) ios_api = Blueprint('ios_api', __name__) @ios_api.route("/viz/ios/log", methods=['POST']) def log(): vpnres = VPNResolve(current_app.config["CIDR"], {...
ucn-eu/ucnviz
ucnserver/ios.py
ios.py
py
1,522
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "vpnresolve.VPNResolve", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.current_a...
22919129693
from io import TextIOWrapper import os import argparse files = [ 'Accurect-Pointer.txt', 'Endonasal-RII.txt', 'HeadBand-Reference.txt', 'Navigation-Pointer.txt', 'Registration-Pointer.txt' ] def readFromOriginalFormat(file: TextIOWrapper): lines = file.readlines() for i, line in enumerate(...
odeaxcsh/ParsissCamera
Scripts/CovertToolPatternFilesFormat.py
CovertToolPatternFilesFormat.py
py
1,486
python
en
code
0
github-code
6
[ { "api_name": "io.TextIOWrapper", "line_number": 13, "usage_type": "name" }, { "api_name": "io.TextIOWrapper", "line_number": 26, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path.exi...
33387732761
import numpy as np from sklearn.tree import DecisionTreeClassifier from .sampler import FeatureSampler, ObjectSampler class Bagger: def __init__(self, base_estimator, object_sampler, feature_sampler, n_estimators=10, **params): """ n_estimators : int number of base estimators ...
TotalChest/MLprograms
RandomForest/random_forest.py
random_forest.py
py
3,665
python
en
code
0
github-code
6
[ { "api_name": "numpy.mean", "line_number": 71, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 71, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 79, "usage_type": "call" }, { "api_name": "sklearn.tree.DecisionTreeClassifi...
35544157808
import calendar from datetime import datetime class Util: DATE_FORMAT = '%Y-%m-%d' def get_month_start_date(datetime): return datetime.date().replace(day=1) def get_month_end_date(datetime): year = datetime.year month = datetime.month monthrange = calendar.monthrange(year...
bluepostit/di-python-2019
daily-exercises/week9/visitors/calendar.py
calendar.py
py
3,141
python
en
code
1
github-code
6
[ { "api_name": "datetime.datetime.date", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.datetime.year", "line_number": 12, "usage_type": "attribute" }, { "api_name": "da...
38760633775
import netCDF4 import numpy as np import numexpr as ne import math import os import sys import re import tempfile from collections import OrderedDict from pprint import pformat from scipy.interpolate import griddata from geophys_utils._crs_utils import transform_coords, get_utm_wkt, get_reprojected_bounds, get_spatial_...
GeoscienceAustralia/geophys_utils
geophys_utils/_netcdf_point_utils.py
_netcdf_point_utils.py
py
66,225
python
en
code
22
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 28, "usage_type": "attribute" }, { "api_name": "geophys_utils._netcdf_utils.NetCDFUtils", "line_number": 52, "usage_type": "name" }, { "api_n...
21112708622
from .plugin import Plugin import js2py # 插件名称 name = '测试插件' # 描述信息 description = """ 仅供测试 """ # 作者 author = 'kksanyu' # 是否启用该插件 enable = True # 演示js代码 jsAddFunc = """ function add(a, b) { return a + b; } """ class Demo(Plugin): def run(self, options): print('运行Demo::run', options.telephone) ...
superdashu/who_are_you
plugins/demo.py
demo.py
py
623
python
en
code
5
github-code
6
[ { "api_name": "plugin.Plugin", "line_number": 22, "usage_type": "name" }, { "api_name": "js2py.eval_js", "line_number": 28, "usage_type": "call" } ]
26221879462
from pyarrow._fs import ( # noqa FileSelector, FileType, FileInfo, FileSystem, LocalFileSystem, SubTreeFileSystem, _MockFileSystem, _normalize_path, FileSystemHandler, PyFileSystem, ) # For backward compatibility. FileStats = FileInfo _not_imported = [] try: from pyarrow....
ejnunn/PPE-Object-Detection
env/lib/python3.7/site-packages/pyarrow/fs.py
fs.py
py
6,213
python
en
code
7
github-code
6
[ { "api_name": "pyarrow._fs.FileInfo", "line_number": 15, "usage_type": "name" }, { "api_name": "pyarrow._s3fs.initialize_s3", "line_number": 30, "usage_type": "call" }, { "api_name": "pyarrow._fs.FileSystem", "line_number": 46, "usage_type": "argument" }, { "api_n...
21835433544
"""Labels app urls""" from django.urls import path from task_manager.labels.views import ( LabelsView, LabelUpdateView, LabelCreateView, LabelDeleteView, ) app_name = 'labels' urlpatterns = [ path('', LabelsView.as_view(), name='index'), path('<int:pk>/update/', LabelUpdateView.as_view(), nam...
GunGalla/python-project-52
task_manager/labels/urls.py
urls.py
py
476
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 14, "usage_type": "call" }, { "api_name": "task_manager.labels.views.LabelsView.as_view", "line_number": 14, "usage_type": "call" }, { "api_name": "task_manager.labels.views.LabelsView", "line_number": 14, "usage_type": "na...
75336194426
import requests import collections import secrets import json import sqlite3 import scrape from bs4 import BeautifulSoup API_KEY = secrets.API_KEY headers = { "Authorization": "Bearer %s" % API_KEY } BASEURL = 'https://api.yelp.com/v3/businesses/search' CACHE_DICT = {} CACHE_FILENAME = 'search_cache.json' DB_NAM...
kedongh/507_final_proj
yelp.py
yelp.py
py
8,122
python
en
code
0
github-code
6
[ { "api_name": "secrets.API_KEY", "line_number": 10, "usage_type": "attribute" }, { "api_name": "scrape.get_info_from_url", "line_number": 72, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 96, "usage_type": "call" }, { "api_name": "json.dumps",...
32727491090
import sqlite3 posts = [ { 'author': 'Dova Kin', 'title': 'First Post', 'content': 'First post.', 'date_posted': '20200301' }, { 'author': 'Angi\'s Cabin', 'title': 'Second Post', 'content': 'Second post.', 'date_posted': '20200302' }, ...
majorgear/flask_blog
utils/populate_db.py
populate_db.py
py
1,163
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 38, "usage_type": "call" } ]
28669919345
import json import unittest from ..base import AsyncAPITestCase from yiyun.models import (User, Team, TeamMember, TeamMemberGroup, Sport, Activity, ActivityMember, TeamOrder) from yiyun.service.order import OrderService class UserOrderTestCase(AsyncAPITestCase): ...
haoweiking/image_tesseract_private
PaiDuiGuanJia/yiyun/tests/rest/order.py
order.py
py
3,424
python
en
code
0
github-code
6
[ { "api_name": "base.AsyncAPITestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "yiyun.models.Sport", "line_number": 13, "usage_type": "name" }, { "api_name": "yiyun.models.User", "line_number": 13, "usage_type": "name" }, { "api_name": "yiyun.mode...
23135790413
# -*- coding: utf-8 -*- """ Created on Tue Apr 9 21:16:51 2019 @author: eikivi """ from sqlalchemy import Column, Integer, String from sqlalchemy import create_engine from sqlalchemy import or_ engine = create_engine('sqlite:///sales.db', echo = False) from sqlalchemy.ext.declarative import declarative_base Base = ...
baadam3/ICS0019_Advanced_python_solutions
Examples/Database_code/SQLAlchemyFilter7.py
SQLAlchemyFilter7.py
py
1,137
python
en
code
0
github-code
6
[ { "api_name": "sqlalchemy.create_engine", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 19, "usage_type": "call" }, {...
73696099389
import os import subprocess from datetime import timedelta from . import dispersion_file_utils as dfu from .dispersiongrid import BSDispersionGrid, BSDispersionPlot, create_color_plot class PolygonGenerator(object): """Generates polygon kmls from a NETCDF file representing smoke dispersion time series. P...
pnwairfire/blueskykml
blueskykml/polygon_generator.py
polygon_generator.py
py
7,736
python
en
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 94, "usage_type": "call" }, { "api_name": "os.path", "line_number": 94, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 95, "usage_type": "call" }, { "api_name": "dispersiongrid.BSDispersionGr...
13202825418
import datetime menu = """ [d] Depositar [s] Sacar [e] Extrato [q] Sair => """ saldo = 0 limite = 500 extrato = [] numero_saques = 0 total_saque_diario = 0 LIMITE_SAQUES = 3 while True: opcao = input(menu) if opcao == 'd': valor = input('Valor do depósito (número inteiro e posi...
ElPablitoBR/btc-c-d-desafio1
desafio.py
desafio.py
py
2,754
python
pt
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 27, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 44, "usage_type": "call" }, { "api_name": "da...
32660332596
""" Implements the baseclasses for all Component types in Lumen. The base classes implement the core validation logic and the ability to dynamically resolve Source and Variable references. """ from __future__ import annotations import warnings from functools import partial from typing import ( Any, ClassVar, Dic...
holoviz/lumen
lumen/base.py
base.py
py
22,041
python
en
code
149
github-code
6
[ { "api_name": "param.Parameterized", "line_number": 34, "usage_type": "attribute" }, { "api_name": "typing.ClassVar", "line_number": 46, "usage_type": "name" }, { "api_name": "typing.ClassVar", "line_number": 50, "usage_type": "name" }, { "api_name": "typing.List"...
73000139069
import configparser from wireguard_keys import * PUB_KEY = '...' # здесь должен быть указан public key if __name__ == "__main__": try: with open('curr_ip.txt', 'r') as f: IP_N = int(f.readline()) except FileNotFoundError: IP_N = int(input('не найден последний IP, введите его вручную: ')) #n...
if13/utils
wireguard config generator/wireguard_export_lan.py
wireguard_export_lan.py
py
1,671
python
ru
code
0
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 22, "usage_type": "call" } ]
73019294587
#!/bin/python3 import sys import csv from pysam import VariantFile import subprocess vcf_in = VariantFile(sys.argv[1]) multiVcf = VariantFile(sys.argv[2]) new_header = vcf_in.header # new_header.generic.add("Multi allelic variants added from Pisces.") vcf_out = VariantFile(sys.argv[3], 'w', header=new_header) for re...
clinical-genomics-uppsala/pomfrey
src/variantCalling/multiallelicAdd.py
multiallelicAdd.py
py
612
python
en
code
0
github-code
6
[ { "api_name": "pysam.VariantFile", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pysam.VariantFile", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.argv", "line_n...
35694932356
# pylint: disable=E1111 from faker import Faker from src.infra.entities import Pet as PetModel from src.infra.config.db_config import DBConnectionHandler from src.infra.entities.pet import AnimalTypes from .pet_repository import PetRepository faker = Faker() pet_repository = PetRepository() db_connection_handle = DB...
YuryTinos/backend-python
src/infra/repo/pet_repository_test.py
pet_repository_test.py
py
1,976
python
en
code
0
github-code
6
[ { "api_name": "faker.Faker", "line_number": 10, "usage_type": "call" }, { "api_name": "pet_repository.PetRepository", "line_number": 11, "usage_type": "call" }, { "api_name": "src.infra.config.db_config.DBConnectionHandler", "line_number": 12, "usage_type": "call" }, ...
41244789670
from datetime import date ano_atual = date.today().year nascimento = int(input('Digite seu ano de nascimento: ')) idade = ano_atual - nascimento if idade == 18: print('Se alistar') elif idade < 18: saldo = 18 - idade print('ainda faltam {} anos(s) para se alistar'.format(saldo)) ano = ano_atual + sa...
andrematos90/Python
CursoEmVideo/Módulo 2/Desafio 039B.py
Desafio 039B.py
py
570
python
pt
code
0
github-code
6
[ { "api_name": "datetime.date.today", "line_number": 3, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 3, "usage_type": "name" } ]
41373317914
from django.db import models from django.db.models.signals import post_save from django.contrib.auth.models import AbstractUser class User(AbstractUser): username = models.CharField(max_length=100) email = models.EmailField(unique=True) fecha_nacimiento = models.CharField(max_length=10, blank=True, null=...
isabellaaguilar/ProyectoFinal-Turisteo-Cultural
backend_api/api/models.py
models.py
py
2,026
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 8, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "...
8665123714
# -*- coding: utf-8 -*- import os import boto3 import settings from jsonschema import validate, ValidationError from cognito_trigger_base import CognitoTriggerBase from user_util import UserUtil from private_chain_util import PrivateChainUtil class CustomMessage(CognitoTriggerBase): def get_schema(self): ...
AlisProject/serverless-application
src/handlers/cognito_trigger/custommessage/custom_message.py
custom_message.py
py
5,666
python
ja
code
54
github-code
6
[ { "api_name": "cognito_trigger_base.CognitoTriggerBase", "line_number": 11, "usage_type": "name" }, { "api_name": "settings.parameters", "line_number": 16, "usage_type": "attribute" }, { "api_name": "user_util.UserUtil.check_try_to_register_as_line_user", "line_number": 22, ...
37617555944
from django.shortcuts import render from django.http import HttpResponse from django.shortcuts import HttpResponse from .models import Product from math import ceil # Create your views here. def index(request): #products = Product.objects.all() #n = len(products) allProds = [] catprods = Pr...
a22616/Django-project-2
shopcart/shop/views.py
views.py
py
1,244
python
en
code
0
github-code
6
[ { "api_name": "models.Product.objects.values", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Product.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.Product", "line_number": 12, "usage_type": "name" }, { "api_name...
37516858475
import os import tarfile import time import shutil from scipy.io import loadmat import csv DEVKIT_FILE_NAME = "ILSVRC2012_devkit_t12.tar.gz" TRAIN_FILE_NAME = "ILSVRC2012_img_train.tar" VAL_FILE_NAME = "ILSVRC2012_img_val.tar" TEST_FILE_NAME = "ILSVRC2012_img_test_v10102019.tar" def untar(file, target_dir="", is_show...
lizhouyu/ImageNet-Parser
imagenet.py
imagenet.py
py
5,306
python
en
code
0
github-code
6
[ { "api_name": "tarfile.open", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number"...
15917640785
from django.urls import path from . import views app_name = 'main' urlpatterns = [ path('category_list/', views.category_list, name='category_list'), path('delete_category/<int:category_id>/', views.delete_category, name='delete_category'), path('update_category/<int:category_id>/', views.update_c...
elumes446/Store-Management-System
Store Managment System/main/urls.py
urls.py
py
1,173
python
en
code
0
github-code
6
[ { "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", ...
8384182801
from __future__ import absolute_import import sys from optparse import OptionParser import sumolib # noqa from functools import reduce def parse_args(): USAGE = "Usage: " + sys.argv[0] + " <netfile> [options]" optParser = OptionParser() optParser.add_option("-o", "--outfile", help="name of output file")...
ngctnnnn/DRL_Traffic-Signal-Control
sumo-rl/sumo/tools/generateBidiDistricts.py
generateBidiDistricts.py
py
3,730
python
en
code
17
github-code
6
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "optparse.OptionParser", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 21, "usage_type": "call" }, { "api_name": "sumolib.geomhelper.polyL...
7748783174
import cv2 from cvzone.HandTrackingModule import HandDetector import numpy as np import pyfirmata cap = cv2.VideoCapture(0) cap.set(3, 1280) cap.set(4, 720) if not cap.isOpened(): print("Camera couldn't access") exit() detector = HandDetector(detectionCon=0.7) port = "COM7" board = pyfirmata.Arduino(port) ...
rizkydermawan1992/virtualdragdrop
drag and drop.py
drag and drop.py
py
1,936
python
en
code
5
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "cvzone.HandTrackingModule.HandDetector", "line_number": 15, "usage_type": "call" }, { "api_name": "pyfirmata.Arduino", "line_number": 18, "usage_type": "call" }, { "api_name...
2795680906
#PCA => Principal componet analysis using HSI import math import numpy as np import matplotlib.pyplot as plt from sklearn.decomposition import PCA from sklearn.decomposition import KernelPCA class princiapalComponentAnalysis: def __init__(self): pass def __str__(self): pass def pca_c...
davidruizhidalgo/unsupervisedRemoteSensing
package/PCA.py
PCA.py
py
6,139
python
es
code
13
github-code
6
[ { "api_name": "sklearn.decomposition.PCA", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 33, "usage_type": "call" }, { "api_name": "sklearn.decomposition.PCA", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy...
24128542933
import matplotlib.pyplot as plt from sklearn.cluster import KMeans import numpy as np import pickle with open("/home/ekin/Desktop/workspace/RotatetObjectDetectionReview/test_data/gt_area.pickle", 'rb') as handle: gt_area = pickle.load(handle) np.sort(gt_area) ''' plt.hist(gt_area, bins='auto', edgecolor='black') ...
ikoc/RotatetObjectDetectionReview
src/kMeansOfArea.py
kMeansOfArea.py
py
1,058
python
en
code
0
github-code
6
[ { "api_name": "pickle.load", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.sort", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 20, "usage_type": "call" }, { "api_name": "sklearn.cluster.KMeans", "line_n...
19797979191
import functools from typing import Callable, Union from aiohttp import web from .exceptions import AuthRequiredException, ForbiddenException, AuthException def login_required(func): """ If not authenticated user tries to reach to a `login_required` end-point returns UNAUTHORIZED response. """ ...
mgurdal/aegis
aegis/decorators.py
decorators.py
py
1,714
python
en
code
13
github-code
6
[ { "api_name": "aiohttp.web.Request", "line_number": 16, "usage_type": "attribute" }, { "api_name": "aiohttp.web", "line_number": 16, "usage_type": "name" }, { "api_name": "exceptions.AuthRequiredException.make_response", "line_number": 20, "usage_type": "call" }, { ...
3814572161
import pandas as pd from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.linear_model import LogisticRegression from sklearn.metrics import accuracy_score import numpy as np df = pd.read_csv('mail_data.csv') # Data Preprocessing df['Ca...
bhar1gitr/ML_Spam-Ham_Detector
pandassss.py
pandassss.py
py
1,653
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 18, "usage_type"...
30114979232
import itertools import pandas as pd import math from pathlib import Path def composite_SD(means, SDs, ncounts): '''Calculate combined standard deviation via ANOVA (ANalysis Of VAriance) See: http://www.burtonsys.com/climate/composite_standard_deviations.html Inputs are: means, the array of...
superyang713/Synthetic_Data_Generation
utils.py
utils.py
py
2,363
python
en
code
0
github-code
6
[ { "api_name": "math.sqrt", "line_number": 40, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 51, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 52, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 5...
27099720616
import xlwt import numpy as np import os import os.path import colour from ..configuration.base_configuration import Filter from ..configuration.base_configuration import TimeOfDayFilter from ..core.status import Status from plots import MatplotlibPlotter from power_deviation_matrix import PowerDeviationMatrixSheet...
PCWG/PCWG
pcwg/reporting/reporting.py
reporting.py
py
47,780
python
en
code
23
github-code
6
[ { "api_name": "os.path.exists", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 33, "usage_type": "call" }, { "api_name": "plots.MatplotlibPlotter", ...
14706890571
#!/usr/bin/env python # coding: utf-8 import requests import pymongo import pandas as pd from splinter import Browser from bs4 import BeautifulSoup import time # #### Open chrome driver # open chrome driver browser def init_browser(): executable_path = {'executable_path': 'chromedriver'} return Browser(...
lisaweinst/web-scraping-challenge
scrape_mars.py
scrape_mars.py
py
6,535
python
en
code
0
github-code
6
[ { "api_name": "splinter.Browser", "line_number": 21, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 31, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 34, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_...
19795243462
import csv from collections import defaultdict, OrderedDict import itertools import json class clicknode: node_count = itertools.count() group_count = itertools.count() group_map = {} def __init__(self, **nodedict): group = nodedict['REGION_VIEW_ID'] if group not in clicknode.group_map: clicknode.group_ma...
arbazkhan002/Clix
clickparser.py
clickparser.py
py
5,102
python
en
code
0
github-code
6
[ { "api_name": "itertools.count", "line_number": 6, "usage_type": "call" }, { "api_name": "itertools.count", "line_number": 7, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 24, "usage_type": "call" }, { "api_name": "collections.OrderedDict", ...
72165174909
# -*- coding:utf-8 -*- # ! usr/bin/env python3 """ Created on 28/12/2020 9:16 @Author: XINZHI YAO """ import os import argparse def pubtator_split(pubtator_file: str, num_per_file: int, save_path: str): if not os.path.exists(save_path): os.mkdir(save_path) split_...
YaoXinZhi/BioNLP-Toolkit
Split_PubTator_File.py
Split_PubTator_File.py
py
1,971
python
en
code
2
github-code
6
[ { "api_name": "os.path.exists", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.basename", "line_num...
3940897296
import numpy as np import torch from torchvision import models import torch.nn as nn # from resnet import resnet34 # import resnet from torch.nn import functional as F class ConvBnRelu(nn.Module): def __init__(self, in_planes, out_planes, ksize, stride, pad, dilation=1, groups=1, has_bn=True, norm...
Winterspringkle/EIANet
models/master.py
master.py
py
5,598
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.BatchNorm2d", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", ...
11194307443
from typing import Tuple, Optional import albumentations as A import cv2 import numpy as np import torch import torchvision from torch.utils.data import Dataset import os from PIL import Image from tqdm import tqdm import pandas as pd import pywt import logging from utils.image_utils import random_crop_with_transforms...
AlexeySrus/WPNet
research_pipelines/supersampling_with_wavelets/dataloader.py
dataloader.py
py
4,411
python
en
code
0
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 19, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_...
1447221561
from django.shortcuts import render from .forms import ProductCreationForm from .models import Product from django.contrib import messages import random # Create your views here. def create(request): if request.method == 'POST': form = ProductCreationForm(request.POST, request.FILES) if form.is_v...
Thorium0/IntelRobotics-webserver
products/views.py
views.py
py
1,284
python
en
code
0
github-code
6
[ { "api_name": "forms.ProductCreationForm", "line_number": 11, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 18, "usage_type": "call" }, { "api_name": "models.Product.objects.get", "line_number": 20, "usage_type": "call" }, { "api_name": "m...
71971270909
import tempfile import os import posixpath import stat import logging import collections from kubeflow.fairing import utils as fairing_utils from kubeflow.fairing.preprocessors.base import BasePreProcessor from kubeflow.fairing.builders.append.append import AppendBuilder from kubeflow.fairing.deployers.job.job import ...
kubeflow/fairing
kubeflow/fairing/frameworks/lightgbm.py
lightgbm.py
py
14,637
python
en
code
336
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "posixpath.join", "line_number": 37, "usage_type": "call" }, { "api_name": "kubeflow.fairing.constants.constants.DEFAULT_DEST_PREFIX", "line_number": 37, "usage_type": "attribute" ...
15191647327
import matplotlib.pyplot as plot from pymongo import MongoClient import numpy as np from sys import argv import random from constants import CONNECTION_STRING, DATABASE_NAME, CLUSTER_COLLECTION_NAME, GENRE_K_DICT from q2 import get_k_g, main as q2_main, client as client2 from q3 import main as q3_main, client as clien...
GautamGadipudi/bd-assignment-8
q5.py
q5.py
py
2,250
python
en
code
0
github-code
6
[ { "api_name": "pymongo.MongoClient", "line_number": 11, "usage_type": "call" }, { "api_name": "constants.CONNECTION_STRING", "line_number": 11, "usage_type": "argument" }, { "api_name": "constants.DATABASE_NAME", "line_number": 12, "usage_type": "argument" }, { "a...
11314663313
from django.contrib.auth import get_user_model from django.db import models User = get_user_model() class Group(models.Model): title = models.CharField('название группы', max_length=200) slug = models.SlugField('слаг', unique=True) description = models.TextField('описание') class Meta: verbo...
zzstop/hw05_final
posts/models.py
models.py
py
2,692
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 4, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "api_...
35846798880
import sys import cv2 as cv __doc__ = """Wrapper to create new classifiers from OpenCV or other libraries. """ class NormalBayes(object): """Wraps a trained OpenCV Normal Bayes Classifier. More info: http://docs.opencv.org/modules/ml/doc/normal_bayes_classifier.html """ def __init__(self): ...
mmikulic/ProjektRasUzo
src/classifier.py
classifier.py
py
4,064
python
en
code
0
github-code
6
[ { "api_name": "cv2.NormalBayesClassifier", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.KNearest", "line_number": 35, "usage_type": "call" }, { "api_name": "cv2.RTrees", "line_number": 76, "usage_type": "call" }, { "api_name": "cv2.TERM_CRITERIA_M...
21354510025
# # @lc app=leetcode.cn id=337 lang=python3 # # [337] 打家劫舍 III # from util import TreeNode # @lc code=start from functools import lru_cache class Solution: def rob(self, root: TreeNode) -> int: nums = [] @lru_cache(None) def dfs(node: TreeNode, can: bool) -> int: if ...
Alex-Beng/ojs
FuckLeetcode/337.打家劫舍-iii.py
337.打家劫舍-iii.py
py
811
python
en
code
0
github-code
6
[ { "api_name": "util.TreeNode", "line_number": 10, "usage_type": "name" }, { "api_name": "util.TreeNode", "line_number": 13, "usage_type": "name" }, { "api_name": "functools.lru_cache", "line_number": 12, "usage_type": "call" } ]
43702400504
from django.conf.urls import include, url from . import views from rest_framework.urlpatterns import format_suffix_patterns urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^yolog/$', views.yolo_index, name='yolo_index'), url(r'^result/$', views.result, name='result'), url(r'^list/$', views.Restauran...
hassanabidpk/searchrestaurant
django/searchrestaurant/search/urls.py
urls.py
py
781
python
en
code
129
github-code
6
[ { "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...
36060788445
from utils.parse_json import parse_json from utils.save_json import save_json import logging def put_command(sala: str, nivel: int, chave: str): data = parse_json('src/json/comandos.json') data[sala][0]['outputs'][nivel]['status'] = chave save_json('src/json/comandos.json', data) def get_command(sala: s...
AntonioAldisio/FSE-2022-2-Trabalho-1
src/utils/troca_comando.py
troca_comando.py
py
1,900
python
en
code
0
github-code
6
[ { "api_name": "utils.parse_json.parse_json", "line_number": 7, "usage_type": "call" }, { "api_name": "utils.save_json.save_json", "line_number": 9, "usage_type": "call" }, { "api_name": "utils.parse_json.parse_json", "line_number": 13, "usage_type": "call" }, { "a...
30011949474
from flask import Blueprint, request, abort from epmanage.lib.auth import AuthController, AuthException auth_component = Blueprint('auth_component', __name__) @auth_component.route('/', methods=['POST']) def auth_do(): """Perform authentication""" try: return AuthController.get_token_agent(request.j...
PokeSec/EPManage
epmanage/auth/auth.py
auth.py
py
642
python
en
code
1
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 5, "usage_type": "call" }, { "api_name": "epmanage.lib.auth.AuthController.get_token_agent", "line_number": 12, "usage_type": "call" }, { "api_name": "epmanage.lib.auth.AuthController", "line_number": 12, "usage_type": "name...
9928969059
import numpy as np import matplotlib.pyplot as plt import cPickle def plot_statistics(statistics, legends, title="", ylabel="", xlim=None, ylim=None, writeto="default.jpeg"): plt.figure(num=None, figsize=(10, 6), dpi=80, facecolor='w', edgecolor='k') plt.xlabel("Number of epochs") plt.ylabel(ylabel) p...
adbrebs/dogs_vs_cats
results/utilities.py
utilities.py
py
3,026
python
en
code
5
github-code
6
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 8, "usage_type": "call" }, { "api_name": "matp...
8772037717
import requests,re,threading,os, sys,random,copy,random,json,httpx,hashlib from loguru import logger from wmi import WMI from urllib.request import urlopen from time import sleep from colorama import init, Fore, Style from urllib.parse import urlencode from typing import Union, List __version__ = "2-5" H...
basautomaticaly/work
main2-5.py
main2-5.py
py
46,695
python
en
code
0
github-code
6
[ { "api_name": "wmi.WMI", "line_number": 12, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 89, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 89, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 267...
17953957335
import numpy as np from collections import Counter def euclideanDistance(x, y): return np.sqrt(np.sum((x-y)**2)) class KNN: def __init__(self, k=3): self.k = k def fit(self, X_train, y_train): self.X_train = X_train self.y_train = y_train def predict(self, X): pre...
Helyousfi/Machine-learning
KNN.py
KNN.py
py
1,573
python
en
code
0
github-code
6
[ { "api_name": "numpy.sqrt", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.argsort", "line_number": 21, "usage_type": "call" }, { "api_name": "collections.Counter", "line_numb...
29799264733
# -*- coding: utf-8 -*- # https://blog.csdn.net/Tifficial/article/details/78116862 import os import time import tkinter.messagebox from tkinter import * from tkinter.filedialog import * from PIL import Image, ImageTk import pygame class create_UI(): def __init__(self): pass def create_button(self,...
anna160278/tkinter-examples
examples/aaa/tst.py
tst.py
py
2,443
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 41, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 41, "usage_type": "name" }, { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 42, "usage_type": "call" }, { "api_name": "PIL.ImageTk", "li...
20649229622
import pyswarms as ps from pyswarms.utils.functions import single_obj as fx from pyswarms.utils.plotters.plotters import plot_contour, plot_surface from pyswarms.utils.plotters.formatters import Mesher, Designer # Run optimizer options = {'c1': 0.5, 'c2': 0.3, 'w': 0.9} optimizer = ps.single.GlobalBestPSO(n_particles=...
igorpustovoy/inteligencja_obliczeniowa
lab04/zad3/3.py
3.py
py
960
python
en
code
0
github-code
6
[ { "api_name": "pyswarms.single.GlobalBestPSO", "line_number": 8, "usage_type": "call" }, { "api_name": "pyswarms.single", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pyswarms.utils.functions.single_obj.sphere", "line_number": 10, "usage_type": "attribute...
12680443626
import os import warnings import pandas as pd from sklearn.preprocessing import StandardScaler from torch.utils.data import Dataset from utils.timefeatures import time_features warnings.filterwarnings('ignore') class MyDataset(Dataset): def __init__(self, root_path, data_path, data, flag, seq_len, label_len, p...
ForestsKing/TSF-Library
data_provider/data_loader.py
data_loader.py
py
4,041
python
en
code
4
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", "line_number": 13, "usage_type": "name" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 35, "usage_type": "call" }, { ...
2872612166
from flask import Flask, render_template, redirect, url_for, request from flask_bootstrap import Bootstrap from flask_sqlalchemy import SQLAlchemy from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, FloatField from wtforms.validators import DataRequired import requests db = SQLAlchemy() app =...
mgardner1011/UdemyProjects
movie_ranking_site/main.py
main.py
py
3,878
python
en
code
0
github-code
6
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_bootstrap.Bootstrap", "line_number": 12, "usage_type": "call" }, { "api_name": "flas...
33480868557
from django.shortcuts import render from .models import Hardware, Software, Employees from rest_framework import generics from .serializers import HardwareSerializer, SoftwareSerializer, EmployeesSerializer from django.db.models.query import Q # Create your views here. class CreateHardware(generics.CreateAPIView): ...
vuedatavivek/productsample
crm_project/organization/views.py
views.py
py
1,292
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.generics.CreateAPIView", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 8, "usage_type": "name" }, { "api_name": "models.Hardware.objects.all", "line_number": 9, "usage_type": "call" }...
18846943134
import logging from concurrent import futures from threading import Timer from functools import partial import cloud.blockstore.public.sdk.python.protos as protos from .error_codes import EResult from .error import ClientError, _handle_errors, client_error_from_response from .grpc_client import GrpcClient from .http...
ydb-platform/nbs
cloud/blockstore/public/sdk/python/client/discovery.py
discovery.py
py
13,730
python
en
code
32
github-code
6
[ { "api_name": "concurrent.futures.Future", "line_number": 25, "usage_type": "call" }, { "api_name": "concurrent.futures", "line_number": 25, "usage_type": "name" }, { "api_name": "error.ClientError", "line_number": 84, "usage_type": "call" }, { "api_name": "error_...
41345912194
import json from functools import wraps import requests from service_now_api_sdk.settings import ( SERVICENOW_API_PASSWORD, SERVICENOW_API_TOKEN, SERVICENOW_API_USER, SERVICENOW_URL, ) def headers_replace(f): @wraps(f) def decorated_function(*args, **kwargs): headers ...
people-analytics-tech/service-now-api-sdk
service_now_api_sdk/sdk/servicenow/helpers/client.py
client.py
py
3,159
python
en
code
1
github-code
6
[ { "api_name": "service_now_api_sdk.settings.SERVICENOW_API_TOKEN", "line_number": 22, "usage_type": "name" }, { "api_name": "service_now_api_sdk.settings.SERVICENOW_API_TOKEN", "line_number": 23, "usage_type": "name" }, { "api_name": "functools.wraps", "line_number": 15, ...
41061708200
from PySide6.QtWidgets import ( QWidget, QToolBar, QLabel, QLineEdit, QTextEdit, QVBoxLayout, QHBoxLayout, ) import core.terminal_commands as tc class WidgetGitUtils(QWidget): """ A custom QWidget that provides a user interface for Git utilities. This widget contains a toolba...
sanyokkua/dev_common_tools_py
ui/widgets/widget_git_utils.py
widget_git_utils.py
py
4,017
python
en
code
1
github-code
6
[ { "api_name": "PySide6.QtWidgets.QWidget", "line_number": 14, "usage_type": "name" }, { "api_name": "PySide6.QtWidgets.QToolBar", "line_number": 31, "usage_type": "call" }, { "api_name": "PySide6.QtWidgets.QLabel", "line_number": 40, "usage_type": "call" }, { "api...
457933717
''' rest_framework reverse 补丁 ''' from rest_framework import relations original_reverse = relations.reverse def hack_reverse(alias, **kwargs): namespace = kwargs['request'].resolver_match.namespace if bool(namespace): name = "%s:%s" % (namespace, alias) return original_reverse(name, **kwargs) ...
dowhilefalse/Donation-Platform
api/__init__.py
__init__.py
py
771
python
en
code
3
github-code
6
[ { "api_name": "rest_framework.relations.reverse", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.relations", "line_number": 7, "usage_type": "name" }, { "api_name": "rest_framework.relations.reverse", "line_number": 15, "usage_type": "attribu...
3836899158
from benchmark_task_manager import * import itertools iteration = 1 TM = [0,2] toggle = itertools.cycle(TM) while True: t1 = time.time() z = next(toggle) eval('TaskManager{0}()._schedule()'.format(z)) groupid = z elapsed = time.time() - t1 with open("tm_dump", "w") as fid: fid.write("{0}...
fosterseth/awx-junk-drawer
serve_TM_data.py
serve_TM_data.py
py
405
python
en
code
0
github-code
6
[ { "api_name": "itertools.cycle", "line_number": 5, "usage_type": "call" } ]
36201897714
from PIL import Image from picamera.array import PiRGBArray from picamera import PiCamera from botocore.exceptions import ClientError from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient from time import sleep, time import sys from uuid import uuid4 import os import RPi.GPIO as GPIO import json import boto3 ...
scriptkiddyisme/mysmartbin
Raspberry Pi/smartbin.py
smartbin.py
py
8,967
python
en
code
0
github-code
6
[ { "api_name": "RPi.GPIO.setmode", "line_number": 22, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 22, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "line_number": 22, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setup", "lin...
72162560509
import sqlite3 as lite import sys # -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html class CrawlerPipeline(object): def __init__(self): con = lite.connect('crawler...
yaoxiuh/WebCrawler
crawler/pipelines.py
pipelines.py
py
1,056
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 25, "usage_type": "call" } ]
14716216800
import torch from torch import nn import torch.nn.functional as F from models.Segformer import mit_b0,mit_b1,mit_b2#,mit_b3,mit_b4,mit_b5 class SK(nn.Module): def __init__(self, in_channel, mid_channel, out_channel, fuse, len=32, reduce=16): super(SK, self).__init__() len = max(mid_channel // reduc...
RuipingL/TransKD
train/CSF.py
CSF.py
py
10,763
python
en
code
10
github-code
6
[ { "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.Sequential", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
37366659638
#!/usr/bin/env python3 from pylab import * from numpy import * import matplotlib.cm as cm from common import * idx_vec = range(1, num_k+1) if with_FVD_solution == True : if num_k > 1 : fig, ax = plt.subplots(2, num_k, figsize=(9, 5.5)) else : fig, ax = plt.subplots(1, 2, figsize=(9, 5.5)) ...
zwpku/EigenPDE-NN
plot_scripts/plot_2d_evs_nn_and_FVD.py
plot_2d_evs_nn_and_FVD.py
py
3,318
python
en
code
3
github-code
6
[ { "api_name": "matplotlib.cm.jet", "line_number": 43, "usage_type": "attribute" }, { "api_name": "matplotlib.cm", "line_number": 43, "usage_type": "name" }, { "api_name": "matplotlib.cm.jet", "line_number": 89, "usage_type": "attribute" }, { "api_name": "matplotli...
9988555176
import traceback, re, json, logging from ..file_utilities.filepath import Filepath from ..entitlements.entitlement_manager import Entitlement_Manager from .file_manager import File_Manager from ..client_config import COLLECTIONS_WITH_BAD_LEVEL_IMAGES, UNLOCK_ALL_BUDDIES from .. import shared logger_errors = logging....
colinhartigan/valorant-inventory-manager
server/src/inventory_management/buddy_manager.py
buddy_manager.py
py
6,398
python
en
code
150
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "file_manager.Fi...
71449750907
from multiprocessing import Process, Lock, Queue, Semaphore import time from random import random buffer = Queue(10) empty = Semaphore(2) # 缓存空余数 full = Semaphore(0) # 缓存占用数 lock = Lock() class Consumer(Process): def run(self): global empty, buffer, full, lock while True: full.acqu...
haidongsong/spider_learn
zhang_xiaobo_spider_practice/producer_custom.py
producer_custom.py
py
1,177
python
en
code
0
github-code
6
[ { "api_name": "multiprocessing.Queue", "line_number": 5, "usage_type": "call" }, { "api_name": "multiprocessing.Semaphore", "line_number": 6, "usage_type": "call" }, { "api_name": "multiprocessing.Semaphore", "line_number": 7, "usage_type": "call" }, { "api_name":...
36540773216
# Import libraries from requests import get from json import dumps # Your own local host's url URL = "http://127.0.0.1:5000/" # Names of active pages mine_block = "mine_block" get_chain = "get_chain" is_valid = "is_valid" # Define function for to check if API works and use the API. def check_request_a...
mrn01/Blockchain_Project
blockchain_davidcoin/Module 1 - Create a Blockchain/use_your_own_API.py
use_your_own_API.py
py
795
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 20, "usage_type": "call" } ]
19160774674
import sys, os from turtle import home myPath = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, myPath + '/../') import time import pytest import allure from allure_commons.types import AttachmentType from Tests.test_Base import BaseTest from Locators.Locators import Locators from Config.config import ...
sawrav-sharma/py_new_dd
Tests/test_HomePage.py
test_HomePage.py
py
2,879
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path.insert", "line...
44966506931
# import cv2 # # filename="imgmirror.jpg" # img= cv2.imread('image.jpg') # res= img.copy() # for i in range(img.shape[0]): # for j in range(img.shape[1]): # res[i][img.shape[1]-j-1]= img[i][j] # # cv2.imshow('image', res) # cv2.imwrite(filename,res) # cv2.waitKey(0) # cv2.destroyAllWindows() # import cv2 #...
nicolafeby/Self-driving-car-robot-cnn
testcamex.py
testcamex.py
py
7,221
python
en
code
0
github-code
6
[ { "api_name": "cv2.FONT_HERSHEY_SIMPLEX", "line_number": 41, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 45, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 62, "usage_type": "call" }, { "api_name":...
23873826885
import cv2 import time import numpy as np import supervision as sv#this is a Roboflow open source libray from ultralytics import YOLO from tqdm import tqdm #this is a tool for visualising progress bars in console. Remove for production code as might slow things down COLORS = sv.ColorPalette.default() #Define entry a...
tobieabel/demo-v3-People-Counter
Demo v3.py
Demo v3.py
py
10,021
python
en
code
0
github-code
6
[ { "api_name": "supervision.ColorPalette.default", "line_number": 8, "usage_type": "call" }, { "api_name": "supervision.ColorPalette", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name...
1965038380
# -*- coding: utf-8 -*- import json import requests import os import time import log21 from kafka import KafkaConsumer access_token = os.environ.get("ACCESS_TOKEN") kafka_host = os.environ.get("KAFKA_HOST") kafka_port = os.environ.get("KAFKA_PORT", "9092") kafka_topic = os.environ.get("KAFKA_TOPIC") def dingtalk_robo...
zxzmcode/oTools
python/Alnot/Dingtalk/kafka_to_Dingtalk/dingtalk.py
dingtalk.py
py
1,832
python
en
code
0
github-code
6
[ { "api_name": "os.environ.get", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_nu...
6196779715
#!/usr/bin/python3 # -*- coding: utf-8 -*- # @Time : 2022/9/12 2:08 下午 # @Author : LiangJun # @Filename : test_demo2.py import unittest from ddt import ddt, data test_datas = [ {'id': 1, 'title': '测试用例1'}, {'id': 2, 'title': '测试用例2'}, {'id': 3, 'title': '测试用例3'} ] @ddt class TestDemo(unittest.Te...
lj5092/py14_Test_Open
py14_04day/dome/test_demo2.py
test_demo2.py
py
427
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 19, "usage_type": "attribute" }, { "api_name": "ddt.data", "line_number": 21, "usage_type": "call" }, { "api_name": "ddt.ddt", "line_number": 18, "usage_type": "name" } ]
9003224390
import json from django.http import HttpResponse __author__ = 'diraven' class HttpResponseJson(HttpResponse): def __init__(self, data=None, is_success=False, message=''): response_data = { 'data': data, 'message': message, 'success': is_success } super(H...
diraven/streamchats2
base/classes/HttpResponseJson.py
HttpResponseJson.py
py
411
python
en
code
0
github-code
6
[ { "api_name": "django.http.HttpResponse", "line_number": 6, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 13, "usage_type": "call" } ]
39463845510
import time import picamera import sqlite3 import signal import os import shutil pidDB = sqlite3.connect('/home/pi/System/PID.db') pidCursor = pidDB.cursor() actualPID = os.getpid() print("I'm PID " + str(actualPID)) pidCursor.execute("""UPDATE PID SET value = ? WHERE name = ?""", (actualPID, "camera")) pidDB.commit(...
jeremyalbrecht/Alarm-RPI
camera.py
camera.py
py
1,001
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 11, "usage_type": "call" }, { "api_name": "picamera.PiCamera", "line_number": 21, "usage_type": "call" }, { "api_name": "time.strftime", "line_...
26986909966
# -*- coding: utf-8 -*- import pytest from nameko.testing.utils import get_extension from nameko.testing.waiting import wait_for_call from nameko_grpc.client import Client from nameko_grpc.entrypoint import GrpcServer class TestCloseSocketOnClientExit: @pytest.fixture(params=["server=nameko"]) def server_typ...
nameko/nameko-grpc
test/test_connection.py
test_connection.py
py
1,178
python
en
code
57
github-code
6
[ { "api_name": "pytest.fixture", "line_number": 11, "usage_type": "call" }, { "api_name": "nameko_grpc.client.Client", "line_number": 19, "usage_type": "call" }, { "api_name": "nameko.testing.utils.get_extension", "line_number": 29, "usage_type": "call" }, { "api_n...
72946561467
#! -*- coding=utf-8 -*- import os import sys filepath = os.path.abspath(__file__) sys.path.append(os.path.dirname(os.path.dirname(filepath))) import threading import time from datetime import datetime from multiprocessing import Process from machines.machineVPN import MachineVPN # from machines.machineWujiVPN impor...
cash2one/brush-1
slave/scripts/test/testht.py
testht.py
py
3,824
python
en
code
0
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number...
31534303974
## LESSON 6 Q1: AUDITING - ITERATIVE PARSING/SAX PARSE using ITERPARSE #!/usr/bin/env python # -*- coding: utf-8 -*- """ Your task is to use the iterative parsing to process the map file and find out not only what tags are there, but also how many, to get the feeling on how much of which data you can expect to have i...
rjshanahan/Data_Wrangling_with_MongoDB
Lesson 1_Udacity_MongoDB_CSV+JSON.py
Lesson 1_Udacity_MongoDB_CSV+JSON.py
py
1,349
python
en
code
2
github-code
6
[ { "api_name": "xml.etree.ElementTree.iterparse", "line_number": 21, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 21, "usage_type": "name" }, { "api_name": "pprint.pprint", "line_number": 37, "usage_type": "call" } ]
8411903253
url = "http://dantri.com.vn/" output_file_name = "news.xlsx" #Step 1: Download information on the Dantri website from urllib.request import urlopen from bs4 import BeautifulSoup #1.1: Open a connection conn = urlopen(url) #1.2: read raw_data = conn.read() #byte #1.3: Decode html_content = raw_data.decode('utf-8...
taanh99ams/taanh-lab-c4e15
Lab 2/dan_tri_extract.py
dan_tri_extract.py
py
1,322
python
en
code
0
github-code
6
[ { "api_name": "urllib.request.urlopen", "line_number": 11, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 33, "usage_type": "call" } ]
18523322737
import xlrd import xlwt from featureComp import * from createmat import * def findRank(path2): for i in range(1,39): path3=path2+str(i)+'.xlsx' matchday=xlrd.open_workbook(path3) sheet1=matchday.sheet_by_index(0) #print path3,'\n' for j in range(1,21): team_rank[sheet1.cell(j,2).value.strip()].append...
kushg18/football-match-winner-prediction
main.py
main.py
py
2,107
python
en
code
3
github-code
6
[ { "api_name": "xlrd.open_workbook", "line_number": 10, "usage_type": "call" }, { "api_name": "xlwt.Workbook", "line_number": 24, "usage_type": "call" }, { "api_name": "xlrd.open_workbook", "line_number": 26, "usage_type": "call" }, { "api_name": "xlrd.open_workboo...
75126804667
from mock import Mock import pytest import json from datetime import date, datetime from src.smallquery.functions.run_query import app @pytest.fixture() def run_query_event(): """ Generates Run Query event """ return { 'query': 'select * from unit/test.parquet', 'limit': 10, } ...
nxn128/serverless-query
test/test_run_query.py
test_run_query.py
py
1,290
python
en
code
0
github-code
6
[ { "api_name": "pytest.fixture", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "call" }, { "api_name": "json.dumps", "line...
36618145736
#!/usr/bin/env python3 import copy import json import logging import os import psutil import shutil import sys import tempfile from datetime import datetime # import pysqlite3 from joblib import Parallel, delayed, parallel_backend from tabulate import tabulate from . import utils from .config import Config class P...
beherap/pipelinewise
pipelinewise/cli/pipelinewise.py
pipelinewise.py
py
55,124
python
en
code
0
github-code
6
[ { "api_name": "logging.INFO", "line_number": 24, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 28, "usage_type": "attribute" }, { "api_name": "logging.DEBUG",...
43599317125
from __future__ import division import h5py import numpy as np ''' PARAMETERS ''' #savefig() outFile='all_data.hdf5' def main(): f=h5py.File(outFile,'r') ds = f['data'][:,0:6,:] data = f['interpo'] import_features=['Weight_Index', 'Waist(CM)', 'Hip(CM)', 'Waist_Hip_Ratio','systolic_pressure', 'diastolic_pressure'...
taylorsmith-UKY/diabetes
get_path.py
get_path.py
py
4,368
python
en
code
0
github-code
6
[ { "api_name": "h5py.File", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.count_nonzero", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.isnan", "line_num...
7663203620
import numpy as np import sounddevice as sd from scipy.io.wavfile import write from isort import file from tools import get_device_number # 録音の設定 fs = 48000 # サンプリング周波数 duration = 5 # 録音時間(秒) channels = 7 device_num = get_device_number("Azure Kinect") # マイクロフォンアレイのデバイス番号 # マイクロフォンアレイからの録音 print("録音開始...") audio_dat...
fkfk21/Enjoy_Azure_Kinect
scripts/record_audio.py
record_audio.py
py
1,024
python
ja
code
0
github-code
6
[ { "api_name": "tools.get_device_number", "line_number": 11, "usage_type": "call" }, { "api_name": "sounddevice.rec", "line_number": 15, "usage_type": "call" }, { "api_name": "sounddevice.wait", "line_number": 17, "usage_type": "call" }, { "api_name": "scipy.io.wav...
70204805949
import requests from fake_useragent import UserAgent import re import base64 import sys from fontTools.ttLib import TTFont from lxml import etree import pymysql # Unicode => ASCII => hex from unicode_to_hex import get_hex_back # 继承重写TTFont,直接使用字节串数据,避免在动态字体加密中重复打开关闭woff文件 class MyTTFont(TTFont): """ 主要目的:实现直接...
xiaohao-a/58_ershouche_font
58ershouche.py
58ershouche.py
py
6,376
python
zh
code
0
github-code
6
[ { "api_name": "fontTools.ttLib.TTFont", "line_number": 14, "usage_type": "name" }, { "api_name": "io.BytesIO", "line_number": 23, "usage_type": "call" }, { "api_name": "fontTools.ttLib.sfnt.SFNTReader", "line_number": 27, "usage_type": "call" }, { "api_name": "re....
71315302907
import requests,sys import requests from requests.structures import CaseInsensitiveDict sys.path.insert(1,".") from config import TODIST_API_KEY #Rate Limit: 1 per 2 seconds. headers = CaseInsensitiveDict() headers["Accept"] = "application/json" headers["Authorization"] = "Bearer " + str(TODIST_API_KEY) #This function...
leekycauldron/statusAPI
TodoistApps/createTask.py
createTask.py
py
937
python
en
code
0
github-code
6
[ { "api_name": "sys.path.insert", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "requests.structures.CaseInsensitiveDict", "line_number": 8, "usage_type": "call" }, { "api_name": "co...
32119109971
from rest_framework.routers import DefaultRouter from apps.home.views import FeatureView, HomeView, I18nViewSet, SitemapView router = DefaultRouter() router.register("", HomeView) router.register("sitemap", SitemapView, basename="sitemap") router.register("i18n", I18nViewSet, basename="i18n") router.register("feature...
OVINC-CN/iWikiAPI
apps/home/urls.py
urls.py
py
384
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 5, "usage_type": "call" }, { "api_name": "apps.home.views.HomeView", "line_number": 6, "usage_type": "argument" }, { "api_name": "apps.home.views.SitemapView", "line_number": 7, "usage_type": "argument" ...
73815074426
from user.models import User from rest_framework import exceptions def get_user(username): user = None if "@" in username: try: user = User.objects.get(email=username) except User.DoesNotExist: user = User.objects.create( username=username, ...
Python-Crew/base_drf
auth_user/services.py
services.py
py
815
python
en
code
1
github-code
6
[ { "api_name": "user.models", "line_number": 6, "usage_type": "name" }, { "api_name": "user.models", "line_number": 10, "usage_type": "name" }, { "api_name": "user.models.User.objects.get", "line_number": 10, "usage_type": "call" }, { "api_name": "user.models.User....
31440178142
from django.contrib import admin from django.urls import path,include from . import views urlpatterns = [ path('',views.login,name='loginform'), # path('OTP/',views.otp,name="otp"), path('verifyotp/',views.verifyotp,name='verifyotp'), path('multiform/',views.multiform,name='multiform'), path("payme...
HIRAPARANAYAN/verni-by-s
authentication/urls.py
urls.py
py
490
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 6, "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", ...
14752733594
from flask import Flask,render_template, request, session, redirect, url_for from threading import Thread def createApp(): app = Flask( __name__, template_folder=r"templates", static_folder=r"static" ) return app app = createApp() @app.route("/") def home(): return render_template("./in...
SentientPlatypus/Self-Driving-Car-Simulation
services/main.py
main.py
py
485
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 18, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 25, "usage_type": "call" } ]
30884940545
from zope.event import notify from zope.component import adapts, queryUtility from zope.interface import implements, alsoProvides from getpaid.core.interfaces import ILineItemFactory, IShoppingCart from getpaid.core.item import PayableLineItem, RecurringLineItem from pfg.donationform.interfaces import IDonationFieldSet...
collective/pfg.donationform
pfg/donationform/cart.py
cart.py
py
2,366
python
en
code
0
github-code
6
[ { "api_name": "zope.intid.interfaces.IIntIds", "line_number": 11, "usage_type": "name" }, { "api_name": "zope.intid.interfaces.IIntIds", "line_number": 13, "usage_type": "name" }, { "api_name": "Products.PloneGetPaid.sessions", "line_number": 17, "usage_type": "name" },...
71550269628
from pathlib import Path import typer from meteor import IdentityStage from meteor import Language from meteor import StemmingStage from meteor import meteor_macro_avg def cli( hypotheses_file: Path = typer.Option( ..., "-h", "--hypotheses", help="utf-8 encoded file with system o...
wbwseeker/meteor
meteor/cli.py
cli.py
py
1,909
python
en
code
1
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 23, "usage_type": "name" }, { "api_name": "meteor.Language", "line_number": 34, "usage_type": "name" }, { "api_name": "typer.Option", "line_nu...