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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
15064078323 | #!/usr/bin/python
# Project: Soar <http://soar.googlecode.com>
# Author: Jonathan Voigt <voigtjr@gmail.com>
from __future__ import print_function
import os
import sys
import subprocess
import re
import fnmatch
from SCons.Node.Alias import default_ans
import time
# Add the current directory to the path so we can from... | SoarGroup/Soar | SConstruct | SConstruct | 14,845 | python | en | code | 291 | github-code | 21 | [
{
"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",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"li... | |
43771005295 | # -*- coding: utf-8 -*-
import os
import sys
sys.path.append(os.path.join(sys.path[0],'../..'))
import probfeat
import torch
import torch.nn as nn
# import matplotlib.pyplot as plt
import numpy as np
import argparse
import importlib
import pandas as pd
import time
import os.path as op
import utils
import json
from skl... | saurabhintel0/deep-ensembles | code/eval_ensemble.py | eval_ensemble.py | py | 10,353 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
12415122339 | import asyncio
import logging
import os
import socket
import sys
import threading
import typing
from os import getenv
import uvicorn
from asgiref.typing import ASGIApplication
from fastapi import FastAPI
from uvicorn.config import Config
from uvicorn.server import Server
from resources.FRPClient import FRPClient
from ... | nnstd/frp-operator | apiserver.py | apiserver.py | py | 2,797 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "resources.FRPClientEndpoint.FRPClientEndpointModel",
"line_number": 22,
"usage_type": "name"
},
{
... |
19453873262 | #贪吃蛇
import pygame as pg
from random import randint
#启动pygame
pg.init()
#设置画板单位
side = 30
#设置画板宽高
w = 17
h = 15
disp = pg.display.set_mode((w * side, h * side))
#设置运行状态
game_running = 0
#设置方向键对应的方向单位坐标
dirs = [pg.K_RIGHT, pg.K_DOWN, pg.K_LEFT, pg.K_UP]
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
#设置初始蛇的坐标
... | yinglyu/pygame-skulpt | snake.py | snake.py | py | 3,647 | python | zh | code | 6 | github-code | 21 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_RIGHT... |
16377947033 | from django.db import models
from django.contrib.auth.models import AbstractUser
from phonenumber_field.modelfields import PhoneNumberField
from django.contrib.auth import get_user_model
from .managers import UserManager
from django.db.models.signals import post_save
from django.dispatch import receiver
# Create your ... | khalid-basha/manage_system | school_system/models.py | models.py | py | 2,131 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.db.models.PositiveSmallIntegerField",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 19,
"usage_type": "n... |
35789043611 | import cv2
import numpy as np
img1 = cv2.imread("C:\picture.png")
lower_red = np.array([0,120,70])
upper_red = np.array([10,255,255])
lower_blue= np.array([78,158,124])
upper_blue = np.array([138,255,255])
hsv=cv2.cvtColor(img1, cv2.COLOR_BGR2HSV)
mask=cv2.inRange(hsv, lower_red, upper_red)
cv2.imshow ("image"... | ChaimaITAA/Robotic_Arm | colordetectionn.py | colordetectionn.py | py | 394 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 6,
... |
32850164641 | import json
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponseForbidden
from django.views.decorators.http import require_POST
from django.utils.translation import ugettext as _
from corehq.apps.users.forms import MultipleSelection... | gmimano/commcaretest | corehq/apps/groups/views.py | views.py | py | 4,642 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "corehq.apps.users.decorators.require_permission",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "corehq.apps.users.models.Permissions.edit_commcare_users",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "corehq.apps.users.models.Permission... |
36494396491 | # -*- coding: utf-8 -*-
import logging
import os
import sqlalchemy
from flask import current_app
from flask import flash
from flask import url_for
from flask_babel import gettext
from mycodo.config_translations import TRANSLATIONS
from mycodo.databases.models import DeviceMeasurements
from mycodo.databases.models imp... | roniap/Mycodo | mycodo/mycodo_flask/utils/utils_output.py | utils_output.py | py | 21,611 | python | en | code | null | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "mycodo.config_translations.TRANSLATIONS",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "mycodo.config_translations.TRANSLATIONS",
"line_number": 38,
"usage_type": "nam... |
35815201087 | import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
def get_column_names():
# Get the column names from the UCI website
column_names = ["Elevation",
"Aspect",
"Slope", "Horizontal_Distance_To_Hydrology",... | kmotyka00/OpenX-Interview | data_preprocessing/data.py | data.py | py | 1,954 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 53,
"usage_type": "call"
}... |
17312800133 | from django.urls import path
from rest_framework import routers
from apps.contacts.api.web.views.contacts_views import CreateFrecuentContacts, MakeOrBreakFrecuentContact, \
DeleteFrecuentContact, ListFrecuentsContacts, UpdateFrecuentContact, ReactivateFrecuentContact, \
DetailFrecuentContact, ListFrecuentCont... | ManuelCL-jml/Polipay-Backup | apps/contacts/api/web/urls.py | urls.py | py | 2,192 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.routers.SimpleRouter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "apps.contacts.api.web.views.contacts_views.CreateFrecuentContacts",
"line_number":... |
41100698781 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
fig = plt.figure()
ax = plt.subplot()
data = []
for i in range (-5, 6):
data.append(i)
ax.spines["top"].set_color("none")
ax.spines["right"].set_color("none")
ax.yaxis.set_ticks_position("left")
ax.xaxis.set_ticks_position("bo... | EliotGeller/Matplotlib | Spines.py | Spines.py | py | 502 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "mat... |
72774948854 | """
[BFS]
너비 우선 탐색 (가까운 노드부터 탐색하는 알고리즘)
1. 탐색 시작 노드를 큐에 삽입하고 방문 처리를 함
2. 큐에서 노드를 꺼내 해당 노드의 인접 노드 중에서 방문하지 않은 모든 노드를 큐에 삽입하고 방문 처리함
3. 2번 과정을 더이상 수행할 수 없는 때까지 반복함
"""
from collections import deque
def dfs(graph, v, visited):
visited[v] = True
print(v, end=" ")
for i in graph[v]:
if not visit... | JangAyeon/Algorithm | 23-1/Algorithm/DFSBFS.py | DFSBFS.py | py | 1,027 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 22,
"usage_type": "call"
}
] |
16244851307 | #!/usr/bin/env python3
'''route to the dashboard for registered users'''
from flask import Blueprint, render_template
from flask_login import login_required, current_user
from models.user_model import User
dashboard_bp = Blueprint('dashboard', __name__)
@dashboard_bp.route('/dashboard')
@login_required
def user_dash... | LordEnk/LordEnk.github.io | backend/routes/dashboard_route.py | dashboard_route.py | py | 556 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.user_model.User.query.filter_by",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.user_model.User.query",
"line_number": 13,
"usage_type": "attribute"
},
... |
32011740234 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Author: Alex Nguyen
Gettysburg College
Reference:
https://www.youtube.com/watch?v=m3rK3gx0tZo
https://docs.opencv.org/2.4/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html
https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/sh... | rxng8/Virtual-Tryon-Project | shape_context_notebook.py | shape_context_notebook.py | py | 15,365 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "cv2.cvtColor",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "numpy.asarray",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
... |
18593541241 | from lxml import html
from copy import deepcopy
import requests
import urllib.request
import httplib2
import string
import json
import os
import random
from splinter import Browser
import pyperclip
#Helper functions
def noPunctuation(str):
trans = str.maketrans('','',string.punctuation)
return str.translate(trans)... | benjaminjenkins1/RockScraper | sidebar/sidebar.py | sidebar.py | py | 2,473 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "string.punctuation",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "httplib2.Http",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstri... |
41699309863 | #Import modules
import os
import pandas as pd
import numpy as np
from pandas import DatetimeIndex
import dask
import scipy
import time
import glob
import torch
import torch.nn as nn
from live_plotter import live_plotter
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
from functools impo... | mChataign/smileCompletion | Code/pytorchFwdModel.py | pytorchFwdModel.py | py | 6,612 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "pytorchModel.pytorchModel",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "pytorchModel.Functional_encoder",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 53,
"usage_type": "call"
},
{
"api_n... |
24049845952 | import boto3
from util import sudocoins_logger
from boto3.dynamodb.conditions import Key
from datetime import datetime
log = sudocoins_logger.get()
dynamodb = boto3.resource('dynamodb')
def lambda_handler(event, context):
timestamp = str(datetime.utcnow().isoformat())
log.info("timestamp")
news = dynamo... | mobile1st/sudocoins-svc | src/art/lists/get_news.py | get_news.py | py | 621 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "util.sudocoins_logger.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "util.sudocoins_logger",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "boto3.resource",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.... |
31264189058 | # %%
# third-party imports
import sys
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import math
from sklearn import preprocessing
sys.path.insert(
1,
r"C:\Users\soube\OneDrive\Desktop\Hammudi\Bachelorarbeit\Repository\AP-rent-determination\preprocessing\preprocessing_functions.py",
)
... | Mountiko/AP-rent-determination | preprocessing/preprocessing_students_data.py | preprocessing_students_data.py | py | 19,375 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.insert",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
... |
37841744865 | # coding: utf-8
import sys
from setuptools import setup, find_packages
NAME = "app"
VERSION = "1.0.0"
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = ["connexion"]
setup(
name=NAME,
version=VERSION,
... | RichardBlackEye/ComputacaoemNuvem2ML | setup.py | setup.py | py | 923 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "setuptools.setup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 26,
"usage_type": "call"
}
] |
41697039417 | import numpy as np
import torch
import torch.nn as nn
from torch.nn import functional as F
import torch.optim as optim
from toolkit.pytorch_transformers.models import Model
from torch.autograd import Variable
from common_blocks.architectures.classification import Densenet
from common_blocks.utils.misc import get_list_... | minerva-ml/open-solution-ship-detection | common_blocks/models.py | models.py | py | 14,571 | python | en | code | 56 | github-code | 21 | [
{
"api_name": "architectures.encoders.ResNetEncoders",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "architectures.encoders",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "architectures.encoders.SeResNetEncoders",
"line_number": 19,
"usage_typ... |
17838649319 | from predict import initialize, predict_image, predict_url
from object_detection import ObjectDetection
import tensorflow.compat.v1 as tf
import random
from datetime import datetime
FLAGS = tf.app.flags.FLAGS
import glob
import numpy as np
import cv2
import os
import time
def main():
if "train" not ... | WeixuanJiang/CustomVision-ObjectDetection | predict_on_image.py | predict_on_image.py | py | 2,087 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.compat.v1.app",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.mkdir"... |
22089524500 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import scvelo as scv
import scanpy as sc
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
sc.set_figure_params(scanpy=True, dpi=200)
colors = [
"#440154FF",
"#450558FF",
"#46085CFF",
"#470D60FF",
"#471063FF",
"#481467FF",
... | zhenzuo2/Human-Developmental-Retina-Atlas | figures/figure2/Find_AC_NRPC.py | Find_AC_NRPC.py | py | 3,648 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "scanpy.set_figure_params",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scvelo.read",
"line_number": 121,
"usage_type": "call"
},
{
"api_name": "scvelo.read",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "scanpy.pp.normaliz... |
72947113972 | import csv
import os
import time
from datetime import datetime
from dotenv import load_dotenv
import discord
from discord.ext import commands
from halo import Halo
load_dotenv()
me = int(os.getenv('OWNER_ID'))
class DataScrapeCog(commands.Cog, name='datascrape command'):
def __init__(self, bot:commands.bot):
... | littlejohny2/discordbot | cogs/datascrape.py | datascrape.py | py | 2,945 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "discord.ex... |
37536147326 | # -*- coding: utf-8 -*-
import click
import numpy as np
import torch
import torch.nn.functional as F
from dotenv import find_dotenv, load_dotenv
import logging
import os
from pathlib import Path
def npz_to_tensors(path: str) -> dict:
npz_object = np.load(path)
images = npz_object['images']
labels = npz_o... | Tolsager/mlops_mnist | src/data/make_dataset.py | make_dataset.py | py | 2,846 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.float32",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.tensor",
"line_n... |
71789781813 | import mido
import random
import collections
import parameters
import pprint
from byte_mapping import byte_mapping
def read_patches(name, count):
ms = []
with mido.open_input() as inport:
for msg in inport:
print(msg.type)
if (msg.type == 'sysex'):
ms.append(ms... | Chris-Nicholls/summit-patches | summit.py | summit.py | py | 8,063 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "mido.open_input",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mido.write_syx_file",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "mido.read_syx_file",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "collections.Co... |
73030910453 | import plac
import sputnik
from ..download import download
from .. import about
@plac.annotations(
force=("Force overwrite", "flag", "f", bool),
data_path=("Path to download model", "option", "d", str)
)
def main(data_size='all', force=False, data_path=None):
if force:
sputnik.purge(about.__title... | LiuFang816/SALSTM_py_data | python/explosion_spaCy/spaCy-master/spacy/en/download.py | download.py | py | 694 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "sputnik.purge",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "download.download",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "download.download",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "plac.annotations",
... |
19698006997 | import os, sys
import numpy as np
import sklearn
import sklearn.svm, sklearn.metrics
# -- [HOW TO] -- #
#
# * evaluate__accuracy( trainer= ( function, trainer ), Data= ( np.array, Data ), \
# labels = ( np.array, labels ) )
#
# -- -------- -- #
# ==========================================... | wfw-pgr/nkML | evaluate__accuracy.py | evaluate__accuracy.py | py | 5,439 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.exit",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "nkML.split__train_test.split__train_test",... |
13479571656 | from django import template
from django.shortcuts import render
from django.http import HttpResponse
import random
#from django.template import loader
from datetime import datetime
# Create your views here.
def index(request):
#template = loader.get_template('index.html')
now = datetime.now()
context ={"cur... | khb3025/Django | project/basicjango/first/views.py | views.py | py | 1,265 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "djang... |
18771611343 | import cv2
from cv2 import aruco
# import matplotlib.pyplot as plt
# import matplotlib as mpl
def find_markers(img):
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
aruco_dict = aruco.Dictionary_get(aruco.DICT_6X6_50)
parameters = aruco.DetectorParameters_create()
corners, ids, rejectedImgPoints = aruco... | NickMateus11/4OI6A-B_McMaster_ECE_Capstone_Project | src/arUco.py | arUco.py | py | 2,126 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.cvtColor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.aruco.Dictionary_get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.aruco"... |
8649154623 | from django.core.management.base import BaseCommand, CommandError
from persiantools.jdatetime import JalaliDate
from watch.models import WatchCode, User, AcceleratorData, Config, Contact
class Command(BaseCommand):
help = 'Seed basic/essential data in database.'
def add_arguments(self, parser):
pars... | Dory9413/Design-and-implementation-of-intelligent-fall-detection-system | backend/watch/management/commands/seed.py | seed.py | py | 2,705 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "watch.models.Config.objects.all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "watch.models.Config.objects",
"line_number": 17,
"usage_type": "at... |
70309682934 | """Bokeh Posterior predictive plot."""
import numpy as np
from bokeh.models.annotations import Legend
from bokeh.models.glyphs import Scatter
from bokeh.models import ColumnDataSource
from ....stats.density_utils import get_bins, histogram, kde
from ...kdeplot import plot_kde
from ...plot_utils import _scale_fig_size... | arviz-devs/arviz | arviz/plots/backends/bokeh/ppcplot.py | ppcplot.py | py | 13,268 | python | en | code | 1,461 | github-code | 21 | [
{
"api_name": "plot_utils.vectorized_to_hex",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "plot_utils._scale_fig_size",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "numpy.atleast_2d",
"line_number": 68,
"usage_type": "call"
},
{
"api_name... |
17838872589 | import numpy as np
import pylab as pl
import scipy.interpolate as interpolate
x = np.linspace(0, 2 * np.pi, 10)
y = np.sin(x)
pl.plot(x, y, 'o', label='the original data')
x_new = np.linspace(0, 2 * np.pi, 100)
y_linear = interpolate.interp1d(x, y)
pl.plot(x_new, y_linear(x_new), label="linear interpolate")... | weiyinfu/learnScipy | 插值/51-B样条插值.py | 51-B样条插值.py | py | 466 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.linspace",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pylab.plot",
"line_number": 7... |
70870883573 | import csv
import requests
import os
with open('datacsvdatongrawfinal.csv', 'r',encoding="utf-8") as f:
reader = csv.reader(f)
for row in reader:
id = row[0]
url = row[2]
if url == "None":
continue
response=requests.get(url)
f = open('E:\datong\{0}{1}'.format... | Newmanzhang/DATONG_TOURISM | 游客感知识别软件/1数据采集模块及大同元数据/downDatongPic.py | downDatongPic.py | py | 390 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "csv.reader",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
}
] |
30628342995 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 25 19:36:00 2018
@author: yzzhao2
"""
import numpy as np
import os
from PIL import Image
import torch
import torch.nn as nn
import torchvision as tv
from torchvision import transforms
import network
# read a txt expect EOF
def text_readlines(filename):
... | zhaoyuzhi/Legacy-Photo-Editing-with-Learned-Noise-Prior | evaluation/accuracy_VGG16.py | accuracy_VGG16.py | py | 4,475 | python | en | code | 13 | github-code | 21 | [
{
"api_name": "os.walk",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "torchvi... |
19451842227 | import os
import subprocess
import json
import sys
if sys.version_info.major < 3:
sys.stderr.write('Sorry, Python 3.x required by this example.\n')
sys.exit(1)
import bitcoin
import bitcoin.rpc
from bitcoin import SelectParams
from bitcoin.core import b2x, lx, b2lx, COIN, COutPoint, CMutableTxOut, CMutableTxI... | a20041060/bitcoin_lab | p2sh.py | p2sh.py | py | 4,401 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.version_info",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr.write",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"l... |
25277639792 | # -*- coding: utf-8 -*-
"""
@Time : 2021/9/24 0:32
@Author : Zhi QIN
@File : simplify_onnx.py
@Software: PyCharm
@Brief :
"""
import onnx
from onnxsim import simplify
onnx_model = onnx.load(f=r'D:\PythonCode\BiSeNet\results\ONNX\model.onnx')
model_simp, check = simplify(onnx_model)
assert check, "Simplified ONN... | JarvisQZ/BiSeNetv1 | bins/simplify_onnx.py | simplify_onnx.py | py | 464 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "onnx.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "onnxsim.simplify",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "onnx.save",
"line_number": 19,
"usage_type": "call"
}
] |
10772605733 | import numpy as np
from channels import BinarySymmetricChannel
def test_binary_symmetric_channel_return_type() -> None:
np.random.seed(0)
data = np.zeros(shape=10)
channel = BinarySymmetricChannel(crossover_probability=0.0)
transformed_data = channel.transform(data)
assert transformed_data.dtype =... | SupurCalvinHiggins/ml-eec-decoder | channels/test/test_binary_symmetric_channel.py | test_binary_symmetric_channel.py | py | 831 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.random.seed",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "channels.BinarySymmetric... |
23110320321 | from argparse import ArgumentParser
from common.util import load_hyperparams, merge_dict
import numpy as np
import os
from rl.survey_of_methods.multi_armed_bandit.model_setup import Agent
from rl.survey_of_methods.multi_armed_bandit.util import train
import tensorflow as tf
def run(constant_overwrites):
config_pa... | markmo/dltemplate | src/rl/survey_of_methods/multi_armed_bandit/__init__.py | __init__.py | py | 1,509 | python | en | code | 57 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "common.util.merge_dict",
... |
26893350625 | from gpiozero import Button
import time
import math
wind_interval=5
wind_count=0
radius_cm=9.0
ADJUSTMENT=1.18
CM_IN_A_KM=100000
SECS_IN_A_HOUR=3600
def spin():
global wind_count
wind_count=wind_count+1
def calculate_speed(time_sec):
global wind_count
circunference_cm=(2*math.pi)*radius_cm
... | elenam1998/TFG_ELENA_GIERM | API_REST_PRUEBA_linux/anemometer.py | anemometer.py | py | 751 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "math.pi",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "gpiozero.Button",
"line_number": 32,
"usage_type": "call"
}
] |
39696787787 | #Name: Sergey Vershinin
#Date: 10/25/2018
#This program name top three Contributing factors for the primary vehichle of a collision:
import pandas as pd
import folium
inFile = input("Enter CSV file name: ") #NYPD_Motor_Vehicle_Collisions.csv
collisions = pd.read_csv(inFile) #convert csv in pandas
#print(collision... | sergey-vershinin/CSC-127 | curent_one.py | curent_one.py | py | 647 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "folium.Map",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "folium.Marker",
"line_number": 23,
"usage_type": "call"
}
] |
31099190013 | from urllib.request import urlopen
from bs4 import BeautifulSoup
import io
import sys
#ABCの回数
times="085"
#問題
problem="d"
# 1. Get a html.
with urlopen("https://atcoder.jp/contests/abc{0}/tasks/abc{0}_{1}".format(times, problem)) as res:
html = res.read().decode("utf-8")
# 2. Load a html by BeautifulSoup.
soup = B... | katonyonko/ABC085 | ABC085_D.py | ABC085_D.py | py | 1,082 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",... |
14363034734 | ### 配置实验环境
from _common import *
from transformers import TextStreamer
class chatglm2_f:
# 指定device
device_ids = [2,3]
#
### 导入Model, Tokenizer
CKPT_FAPTH = '/DATA/zqfang/modelscope/modelscope/examples/pytorch/fang/runs/chatglm2/v0-20230901-221444/v0-20230901-230126/output_best/pytorch_model.bin'
... | nidimajiabie/yunnanLLM | chatglm2/chatglm2_infer.py | chatglm2_infer.py | py | 2,217 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "transformers.TextStreamer",
"line_number": 40,
"usage_type": "call"
}
] |
32086339311 | import os
from opencc import OpenCC
import threading
import queue
# Unzip EPUB
def get_file_paths(root_path, file_types):
file_paths = []
for root, dirs, files in os.walk(root_path):
for file in files:
try:
if file.split('.')[-1] in file_types:
file_path... | mk2016a/LightNovels | novels/tools/translate_txt.py | translate_txt.py | py | 2,259 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.walk",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.walk",
"line_number": 21,
... |
13371810081 | r"""
Unified Metric
==============
Unified Metric is a multitask metric that performs word-level and segment-level
evaluation in a multitask manner. It can also be used with and without reference
translations.
Inspired on [UniTE](https://arxiv.org/pdf/2204.13346.pdf)
"""
from collections import O... | Unbabel/COMET | comet/models/multitask/unified_metric.py | unified_metric.py | py | 31,613 | python | en | code | 324 | github-code | 21 | [
{
"api_name": "comet.models.base.CometModel",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 81,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 90,
"usage_type": "name"
},
{
"api_name": "typing.Optiona... |
39812801931 | """
This module contains an URL construction and fetching function.
"""
from urllib.parse import quote_plus
from urllib.request import Request, urlopen
from gt import tk
USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0'
def fetch_response(source_lang, target_lang, text,
... | siikamiika/gt | gt/network.py | network.py | py | 2,956 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "urllib.parse.quote_plus",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "urllib.parse.quote_plus",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "gt.tk.calc_tk",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "gt.tk",... |
37224085808 | # LIME 실습
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(2021)
# 1. Data
# 1.1 Data Load
from sklearn.datasets import fetch_20newsgroups
# 2개의 카테고리에서만 진행
categories = ["alt.atheism", "soc.religion.christian"]
newsgroups_train = fetch_20newsgroups(subset="train", categories=catego... | badjiyoon/da_study | KimJiYoon/Part4/CH13/CH13_02.py | CH13_02.py | py | 1,621 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.seed",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sklearn.datasets.fetch_20newsgroups",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": ... |
14003578097 | from . import root_command, Command, BlockingExecuteCommand
import logging
LOGGER = logging.getLogger(__name__)
def get_scheduler_command(*args, **kwargs):
bot = kwargs.get('instance')
if len(bot.commands) == 0:
return "No commands added"
return ["Command: {}".format(c) for c in bot.commands]
d... | jlyheden/stockbot | stockbot/command/scheduler.py | scheduler.py | py | 2,990 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
}
] |
73765933493 | import time
from typing import Callable, List, Optional
import pandas as pd
from abc import *
from voice_synthesis import load_voice_model, text_to_speech
# 회전 보정 계수
MULTIPLIER_LR = 0.0060
# 감속 계수
MULTIPLIER_BACK = 0.8
@abstractmethod
def connect_to_your_robot():
return True
class PaceMakerCar:
"""
페... | yuna-102/pacemaker-iot-project | pacemaker.py | pacemaker.py | py | 1,373 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.Callable",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional... |
33835616634 |
from itertools import permutations
def check(users, banned_id):
for i in range(len(banned_id)):
if len(users[i]) != len(banned_id[i]):
return False
for j in range(len(users[i])):
if banned_id[i][j] != "*":
if banned_id[i][j] != users[i][j]:
... | mrsuit0114/algorithmprac | programmers/202304/level3/불량사용자.py | 불량사용자.py | py | 1,690 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "itertools.permutations",
"line_number": 16,
"usage_type": "call"
}
] |
22643858096 | from keras.models import load_model
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import numpy as np
from ..data.sets import prepare_data_lstm
from ..data.load import load_csv
df = load_csv()
dataset, sc, X_train, X_test, y_train, y_test = prepare_data_lstm(df, 1, 0.2)
model = load_model(fi... | oem/bitcoin-prediction | src/visualization/01-mae-1.py | 01-mae-1.py | py | 1,196 | python | en | code | 10 | github-code | 21 | [
{
"api_name": "matplotlib.use",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "data.load.load_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "data.sets.prepare_data_lstm",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "keras.mod... |
45677929975 | """Functions for performing Scalar Feature Attention Updates"""
from typing import Optional
import torch
import torch.nn.functional as F # noqa
from einops import rearrange, repeat # noqa
from einops.layers.torch import Rearrange # noqa
from torch import nn, einsum, Tensor
from protein_learning.common.rigid... | MattMcPartlon/AttnPacker | protein_learning/networks/attention/node_attention.py | node_attention.py | py | 12,173 | python | en | code | 50 | github-code | 21 | [
{
"api_name": "torch.finfo",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line... |
39077216048 | # Main and helper function
import time
from PIL import Image
import numpy as np
from RRT import RRT
import tqdm
from PRM import PRM
import time
import torch
from torch.autograd import Variable
import numpy as np
from FCN import FCNs
from FCN import VGGNet
import cv2
from matplotlib import pyplot as plt
from torchvisi... | Crayon-new/region_guided_RRT | main.py | main.py | py | 2,695 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PIL.Image.open",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "PIL.Image.ANTIALIAS",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"li... |
38055661652 | # %%
# Python標準モジュール
from IPython.display import HTML
from pyvis.network import Network
import networkx as nx
from sklearn.metrics import recall_score
from sklearn.metrics import precision_score
from sklearn.metrics import accuracy_score
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import cla... | okumaRyo/Reserch_yamada | stats_ml_2.py | stats_ml_2.py | py | 14,168 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
72472262452 | import numpy as np
from pynwb import NWBFile
from rec_to_nwb.processing.exceptions.missing_data_exception import MissingDataException
from rec_to_nwb.processing.nwb.components.position.time.valid.fl_pos_valid_time_builder import FlPosValidTimeBuilder
from rec_to_nwb.processing.tools.beartype.beartype import beartype
f... | NovelaNeuro/rec_to_nwb | rec_to_nwb/processing/nwb/components/position/time/valid/fl_pos_valid_time_manager.py | fl_pos_valid_time_manager.py | py | 3,793 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "rec_to_nwb.processing.tools.get_times_period_multiplier.get_times_period_multiplier",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pynwb.NWBFile",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "rec_to_nwb.processing.tools.beartype.beartype.b... |
73027809653 | """ Define the routes that show all the posts.
This includes:
- /feed
- /cluster
- /table
- /favorites
"""
import os
import posixpath
import json
from flask import request, render_template, redirect, Blueprint, current_app, make_response
from sqlalchemy import case, desc
from ..proxies import db_session, curr... | LiuFang816/SALSTM_py_data | python/airbnb_knowledge-repo/knowledge-repo-master/knowledge_repo/app/routes/index.py | index.py | py | 9,010 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "flask.Blueprint",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.current_app.url_map.iter_rules",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "flask.current_app.url_map",
"line_number": 35,
"usage_type": "attribute"
},
{
... |
38445480309 | import os
import json
import sys
import gc
import math
import datetime as dt
import numpy as np
import pandas as pd
from m5_utils import *
from m5_prepare_store import *
from model_config import *
from config import *
from TimeBasedCV import TimeBasedCV
import gc, time, pickle, psutil, random
from sklearn import prep... | dmiekoar/m5_forecasting_accuracy | src/3_train.py | 3_train.py | py | 6,312 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "pandas.set_option",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "warnings.filter... |
18185123918 | #!/usr/bin/python3
'''
Created on 19.10.2022
Aggregator
@author: Dad
'''
import paho.mqtt.client as paho
import json
import logging
import re
from threading import Condition
from datetime import datetime
from InfoCollect import djson, ComPath, Version
import signal
import sys
App = "aggregator"
FORMAT = '%(asctime... | tommiport5/InfoCollect | python/aggregator.py | aggregator.py | py | 3,026 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "InfoCollect.ComPath",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "logging.basicConfig",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.INF... |
44110437386 | import extract_wikibase_item
import urllib
import urllib.request
import json
def json_response_from_api(entity_id):
if entity_id.strip() == "":
raise
if entity_id.strip() == None:
raise
if entity_id[0] != "Q":
raise
url = "https://www.wikidata.org/wiki/Special:EntityData/" + ent... | matkoniecz/osm_wiki_tag_api | extract_wikidata_data_item.py | extract_wikidata_data_item.py | py | 445 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 16,
"usage_type": "call"
}
] |
15378743931 | import retornos_simples as rs
import quitar_repetidos as qr
import remove_dying_returns
import pandas as pd
def main(prices_df, minimum_repeated, last_days_months_df):
print('Prices: ', prices_df.count().sum())
prices_df, repetidos_info = qr.delete_repeated_in_df(prices_df, minimun_required=minimum_repeat... | laygr/The-Long-Horizon-Portfolios | dbs_construction/build_funds_monthly_returns.py | build_funds_monthly_returns.py | py | 2,166 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "quitar_repetidos.delete_repeated_in_df",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "remove_dying_returns.do",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 39,
"usage_type": "call"
},
{
... |
25539328545 | # CameraStream uses udp 1180-1190
# important files:
# cams.py
# socketManager.py
import absl
import socket
import cv2
import sys
import os
import time
import numpy as np
import threading as thred
import camera
import socketManager
PACKETS = 8
SIZE = int((480 * 270 * 3) / PACKETS)
camFrames = []
... | TASRobotics/RaidZero-FRC-2020 | jetson/main.py | main.py | py | 2,840 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "time.sleep",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "socketManager.sendData",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "numpy.fromstring",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
... |
37753911072 | from pymongo import MongoClient
client = MongoClient('localhost', 27017)
db = client.blog
collection = db.users
user1 = {
"name": "masoud",
"age": 25
}
collection.insert_one(user1)
# print(collection.find_one())
user2 = {
"name": "kimiya",
"age": 25}
id_user2 = collection.insert_one(user2).inserted_i... | khodetitus/Education | course/Mongo DB/15_pymongo.py | 15_pymongo.py | py | 383 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 3,
"usage_type": "call"
}
] |
40172667440 | from schematics.models import Model
from schematics.types import StringType, PolyModelType, ListType
from ._arg import CMDArg, CMDClsArgBase, CMDObjectArgBase, CMDArrayArgBase
from utils import exceptions
class CMDArgGroup(Model):
# properties as tags
name = StringType(required=True)
# properties as nod... | Azure/aaz-dev-tools | src/aaz_dev/command/model/configuration/_arg_group.py | _arg_group.py | py | 2,202 | python | en | code | 17 | github-code | 21 | [
{
"api_name": "schematics.models.Model",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "schematics.types.StringType",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "schematics.types.ListType",
"line_number": 13,
"usage_type": "call"
},
{
"api_... |
23465472959 | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 10 17:07:27 2019
@author: lx198
"""
from requests import get,put,post,delete
INFORMATION_DICT={"MESSAGE":
{
"SMS":{
"tels":"15987738298",
"content":"test3"
},
"EMAIL":{
"receiver":"6... | ynyxlx/HTWL_InfoDistrSYS | test/client.py | client.py | py | 1,148 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.dumps",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 46,
"usage_type": "call"
}
] |
74301039411 | import matplotlib.pyplot as plt
from PIL import Image
import numpy as np
from skimage.exposure import equalize_hist
def equalization(src: np.ndarray) -> np.ndarray:
size = src.shape
tmp = np.asarray([np.size(src[src <= x]) for x in range(256)])
trans_map = (255 * tmp) // (size[0] * size[1])
return tr... | Dalitrox/Metody_i_algorytmy_grafiki_komputerowej | lab3/zad6.py | zad6.py | py | 1,205 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.ndarray",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.asarray",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.size",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.Axes",
... |
37224002418 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_breast_cancer
np.random.seed(2021)
# 1. Data
# 1.1 Data Load
cancer = load_breast_cancer()
print(cancer['feature_names'])
# 정답
# malignant
# bengin
print(cancer['target_names'])
data, target = cancer["data"], canc... | badjiyoon/da_study | KimJiYoon/Part4/CH03/CH03_2.py | CH03_2.py | py | 6,487 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.seed",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sklearn.datasets.load_breast_cancer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
27855340536 | #!/usr/bin/env python
""" Stub for exploits """
from __future__ import print_function
import logging
import socket
import struct
log = logging.getLogger(__name__)
log.addHandler(logging.StreamHandler())
# change to see more stuff
# log.setLevel(logging.INFO)
log.setLevel(logging.DEBUG)
HOST = '127.0.0.1'
PORT = 12... | lorenzog/exploitdev | exploit.py | exploit.py | py | 1,516 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "socket.sock... |
10516840531 | # chat/consumers.py
import json,codecs,pickle,collections
from asgiref.sync import async_to_sync
from channels.generic.websocket import WebsocketConsumer
import logging
logger = logging.getLogger("mylogger")
from .game import Game
from .models import *
from django_currentuser.middleware import get_current_user, get_cur... | brucker3/CS5551 | mysite/checkers/consumers.py | consumers.py | py | 5,484 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "channels.generic.websocket.WebsocketConsumer",
"line_number": 16,
"usage_type": "name"
},
{
... |
70046903414 | import json
import spotipy
import spotipy.util as util
from spotipy.oauth2 import SpotifyClientCredentials
# from config import CLIENT_ID, CLIENT_SECRET, USERNAME
# import sys
# sys.path.append(".")
# import config
from . import config
def get_data():
cid = config.CLIENT_ID
csecret = config.CLIENT_SECRET
r... | ChicoState/SmartMirror | MainPyQtGUI/test_path/api/spotifyLogIn.py | spotifyLogIn.py | py | 1,409 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "spotipy.oauth2.SpotifyClientCredentials",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "spotipy.Spotify",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "spotipy.util.prompt_for_user_token",
"line_number": 24,
"usage_type": "call"
},... |
70131433974 | # -*- coding: utf-8 -*-
import scrapy
from scrapyPro.boleScrapy.boleScrapy.items import FirstscrapyItem
class BoleSpider(scrapy.Spider):
name = 'bole'
start_urls = ['http://blog.jobbole.com/all-posts/']
def parse(self, response):
divList=response.css('.post.floated-thumb')
for div in divLi... | zmyymz/Python | boleScrapy/boleScrapy/spiders/bole.py | bole.py | py | 1,775 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "scrapy.Spider",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "scrapy.http.Request",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scrapy.http",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "scrapy.http.Re... |
4626302833 | import pytest
import requests
class TestContact:
def get_token(self):
r = requests.get(
'https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=wwe653983e4c732493&corpsecret=T72_Vgw9TaNS-FLDU2gJlw6AteerMXsuMval9kGNZbc')
token = r.json()['access_token']
return token
def creat... | ceshiren/HogwartsSDET16 | test_requests/test_contact.py | test_contact.py | py | 2,904 | python | en | code | 15 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numbe... |
42986197701 | import os
from typer.testing import CliRunner
from flowutils.main import app
from flowutils.utils import load_config
runner = CliRunner()
def test_init(configure_env, config_path: str):
with runner.isolated_filesystem():
os.makedirs("./CustomProjects/Project1")
result = runner.invoke(
... | dstalzjohn/flowutils | tests/test_main.py | test_main.py | py | 960 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typer.testing.CliRunner",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flowutils.main.app",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "flowutils.u... |
39411139377 | import email, smtplib, ssl, sys, os
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import time
class Gmail_server:
def __init__(self,user,pwd):
while True:
try:
self.server = sm... | SHBnik/gmail_composer | gmail_server.py | gmail_server.py | py | 2,258 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "smtplib.SMTP",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "email.mime.multipart.MIMEMultipart",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "email.mime... |
209667062 | from django.shortcuts import render, HttpResponse
from .models import restaurantes
from django.http import JsonResponse
from django.core import serializers
from .forms import NameForm, Usuario
# Create your views here.
def index(request):
return render(request,'index.html',{})
def login(request):
return rend... | Medfac9/UGR_Desarrollo_de_Aplicaciones_para_Internet | P8/dai/restaurantes/views.py | views.py | py | 6,322 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.render",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "forms.Usuario",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.... |
43393219006 | import json
import base64
import gzip
import urllib3
import os
# Read all the environment variables
webhook_url = os.environ['SLACK_WEBHOOK_URL']
# Decoding data and printing needed logs
def lambda_handler(event, context):
decoded_event = json.loads(gzip.decompress(base64.b64decode(event['awslogs']['data'])))
... | rbessembe/Python | AWS-Lambda/alert-to-slack.py | alert-to-slack.py | py | 804 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "gzip.decompress",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"lin... |
7846749315 | import numpy as np
import csv
from ripser import ripser
from persim import plot_diagrams
import matplotlib.pyplot as plt
def deepmap(fn, mylist):
"""
Finds the deepest nested values that aren't lists in
order to apply the mapping function to them
"""
if (len(mylist) == 0):
return mylist
elif (type(myli... | AndrewWD1/tda | anthony_iso.py | anthony_iso.py | py | 1,190 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
18589648811 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module defines the `Quantity` object, which represents a number with some
associated units. `Quantity` objects support operations like ordinary numbers,
but will deal with unit conversions internally.
"""
# STDLIB
import numbers
import operator
i... | astropy/astropy | astropy/units/quantity.py | quantity.py | py | 85,364 | python | en | code | 4,015 | github-code | 21 | [
{
"api_name": "numpy.arcsin",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "numpy.arccos",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "numpy.arccosh",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "numpy.arctanh"... |
19819568002 | from asyncio import as_completed
from concurrent.futures import process
from operator import truediv
import cv2
import mediapipe as mp
import threading
import queue
import concurrent.futures
import threading
import time
forceBreak = False
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawin... | adamas0014/MediapipeMocap | main.py | main.py | py | 8,926 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "mediapipe.solutions",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_na... |
74027806451 | import urllib
from flask import current_app, render_template, request
from flask.views import View
from sqlalchemy import asc, desc
import auth
# Keys map to values in list.html for the sortColumn class element val attribute.
SORT_MAP = {
"hits": "hits",
"name": "name",
"owner": "owner",
"dateCreated... | Nextdoor/gogo | src/base_list_view.py | base_list_view.py | py | 3,931 | python | en | code | 10 | github-code | 21 | [
{
"api_name": "flask.views.View",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "flask.request.args.get",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "flask... |
30055050196 | # -*- coding: utf-8 -*-
"""
@author: Fuego
"""
import SubBot
from datetime import datetime
import time
import traceback
import threading
if __name__ == "__main__":
print('script working')
bot = SubBot.SubBot()
bot.start()
while True:
try:
time.sleep(1)
bot.scheduled_check()
except Exception as e:... | Tequila24/SubBot | vkbot.py | vkbot.py | py | 435 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "SubBot.SubBot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
24266990645 | from sqlalchemy import create_engine
from db.config import DATABASE_URI
from db.members import Member
from sqlalchemy.orm import sessionmaker
from contextlib import contextmanager
engine = create_engine(DATABASE_URI)
Session = sessionmaker(bind=engine)
@contextmanager
def session_scope():
session = Session()
... | a5hik/members | app/service.py | service.py | py | 880 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "db.config.DATABASE_URI",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 9,
"usage_type": "call"
},
{
"api_... |
31386654176 | # -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.init as init
from pytorch_pretrained_bert.modeling import BertEmbeddings, BertEncoder, BertLayer, BertModel, BertOnlyMLMHead
class SPGCN_Dynamic(nn.Module):
def __init__(self, config, voc_dim, emb_dim=768, dropout_rate=0.2, num_adj=1, la... | ParishadBehnam/MG-BERT | model.py | model.py | py | 6,873 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pytorch_pretrained_bert.modeling.BertLayer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name... |
70382534454 | import json
from secrets import compare_digest
from django.urls import reverse_lazy
from django.views.generic import (
CreateView,
DetailView,
UpdateView,
ListView,
DeleteView,
View,
)
from django.contrib.auth.mixins import LoginRequiredMixin
from rules.contrib.views import AutoPermissionRequire... | gldecurtins/objector | inventory/views.py | views.py | py | 9,708 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.contrib.auth.mixins.LoginRequiredMixin",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "django.views.generic.ListView",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "models.Location",
"line_number": 26,
"usage_type": "name"
}... |
28428254045 | """Message types handler"""
import re
from enum import IntEnum, unique
from typing import List, Union
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
__all__ = [
"MessageParser",
"SendFormating",
"Types"
]
@unique
class Types(IntEnum):
"""A Class representing message... | iamarch/Protector | Protector/utils/string_handler.py | string_handler.py | py | 4,999 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "enum.IntEnum",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "enum.unique",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 56,
"usage_type": "name"
},
{
"api_name": "pyrogram.types.InlineKeyboardBut... |
39733589585 | from datetime import datetime, timedelta
from typing import List, Union
import pytz
from app.core.utils import check_user
from app.internal.repository import AnswerRepository
from app.internal.schemes import (
AnswerInRequest,
AnswerModel,
CreateAnswerCommand,
DeleteAnswerCommand,
GetAnswerCommand... | mirea-ninja/online-quest-backend | app/internal/service/answer.py | answer.py | py | 4,442 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "base.BaseService",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "app.internal.schemes.AnswerModel",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "app.internal.schemes.CreateAnswerCommand",
"line_number": 36,
"usage_type": "name"
},... |
39676050395 | from django.db import transaction, reset_queries
from django.contrib.auth.models import User
from datetime import datetime
from time import mktime
from blacklist.backend import BaseBackend
from blacklist import models
from blacklist.common.config import Config
from blacklist.common.encryption import Encrypt... | r3boot/blacklist | django-blacklist/blacklist/backend/peering.py | peering.py | py | 3,128 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "blacklist.backend.BaseBackend",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "blacklist.backend.BaseBackend.__init__",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "blacklist.backend.BaseBackend",
"line_number": 16,
"usage_type": "na... |
33854737152 | """volctl tray icon"""
from math import floor
from gi.repository import Gtk, Gdk
from volctl.lib_pulseaudio import (
PA_VOLUME_MUTED, PA_VOLUME_NORM,
pa_threaded_mainloop_lock, pa_threaded_mainloop_unlock
)
class TrayIcon():
"""Volume control tray icon."""
def __init__(self, app):
self._app... | pythonthings/volctl | volctl/tray.py | tray.py | py | 5,221 | python | en | code | null | github-code | 21 | [
{
"api_name": "gi.repository.Gtk.StatusIcon",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "gi.repository.Gtk.Menu",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": ... |
11011803227 | from Screenshot import Screenshot
from selenium import webdriver
import sys
import os
import time
import traceback
from selenium.webdriver.common.by import By
from selenium.webdriver import Chrome, Firefox, ActionChains
from selenium.webdriver.chrome.options import Options as OptionsChrome
from selenium.webdri... | TrinhCanvas/new_project | main.py | main.py | py | 18,223 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.chrome.service.Service",
"line_number": 34,
"usage... |
30564880520 | from django.shortcuts import render
# Create your views here.
from django.http import Http404
from django.http import HttpResponse
#from django.template import loader
from django.shortcuts import render
from .models import *
import json
import requests
from mongoengine import *
def index(request):
query = req... | chiragadm/resumesdepot | search/views.py | views.py | py | 1,653 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.shortcuts.render",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.http.Http404",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "j... |
18341012196 | from abc import ABC, abstractmethod
from datetime import datetime
class IInviteService(ABC):
"""
Service used to determine who invited a user to a server.
"""
@abstractmethod
def on_invite_created(self,
server_id: int,
inviter_id: int,
invite_code: str,
create_time: datetime,
expire_time: datetime) -> N... | zkWildfire/FamilyTreeDiscordBot | src/bot/services/invite/invite_service.py | invite_service.py | py | 1,175 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "abc.ABC",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"... |
31456508095 | import ormar
from db import metadata, database
import datetime
from typing import Optional
class User(ormar.Model):
class Meta:
tablename = "users"
metadata = metadata
database = database
user_id: str = ormar.String(primary_key=True, max_length=150)
class Project(ormar.Model):
cl... | tarleproton/cockroach | models.py | models.py | py | 2,017 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "ormar.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "db.metadata",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "db.database",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "ormar.String",
"line_numbe... |
27277722121 | import logging
import analyze
def get_timing_cost(request):
try:
timing_cost = int(request["timingsMaster"]["system"]["timingcost"])
if timing_cost > 300:
analyze.return_list.append({
'title': 'Timingcost',
'body': f'Your timingcost is {timing_cost}. You... | DennieDev/Optimization-Website | analyze/get_timing_cost.py | get_timing_cost.py | py | 462 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "analyze.return_list.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "analyze.return_list",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 15,
"usage_type": "call"
}
] |
2823341092 | # -*- coding: UTF-8 -*-
import os
# from sqlalchemy import false, true
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import environment as Env
import tensorflow.compat.v1 as tf
from tensorflow.keras import layers, models
tf.disable_v2_behavior()
import numpy as np
import matplotlib.pyplot as plt
class DeepQNetwork:
d... | Sinyu104/Relay-Selection-based-on-DQN | dqn.py | dqn.py | py | 16,471 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1.disable_v2_behavior",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1",
"line_number": 9,
"usage_type": "name"
},
{
"api_na... |
24090755389 | from flask import Flask, render_template, request, redirect
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
from flask_login import LoginManager, UserMixin, login_user, login_required, logout_user, current_user
app = Flask(__name__)
login_manager = LoginManager()
login_manager.init_app(app)
db... | DiegoS89/catalogo-libro-nube | app.py | app.py | py | 13,769 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_login.LoginManager",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_... |
19771925327 | """Estimate the confidence interval of a Bernoulli dist. parameter.
It is a conservative interval i.e. it overestimates the confidence
interval bounds.
Useful to find confidence intervals for machine learning models
accuracy.
"""
import scipy.stats
import numpy as np
def bernoulli_confidence_interval(
accuracy:... | FelSiq/statistics-related | confidence_intervals/bernoulli_interval_approx.py | bernoulli_interval_approx.py | py | 803 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "scipy.stats.stats.norm.isf",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.stats.stats",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "scipy.stats",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.s... |
4973643533 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from flask import Flask,render_template,request,redirect,url_for
from werkzeug.utils import secure_filename
import os,time
import base_func
app = Flask(__name__)
@app.route('/upload', methods=['POST', 'GET'])
def upload():
if request.method == 'POST':
base_func.b... | wlane/flask-web-test | test/upload.py | upload.py | py | 1,117 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "base_func.base",
... |
18410763982 | from datetime import datetime
from typing import Dict
import pytest
from django.urls import reverse
from rest_framework import status
from rest_framework.response import Response
from goals.models import Board
from goals.serializers import BoardParticipantSerializer, BoardSerializer
from tests.factories import BoardP... | Knyazev-Timur/Desck_tg_bot | tests/board_test/test_board.py | test_board.py | py | 3,002 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.reverse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "datetime.... |
24580671553 | import json
import pandas as pd
import gensim
from nlp.dataset import TextDataset
from nlp.preprocess.text.tokenize import NGramTokenizer
from util.model import load_embedding_index
NGRAM = 1
def load_word_embeddings(path: str) -> dict:
return load_embedding_index(path)
def load_labelled_data_as_dataset(pat... | charliemorning/mlws | tasks/ccf/datagrand2021/data_helper.py | data_helper.py | py | 2,402 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "util.model.load_embedding_index",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "nlp.dataset.TextDataset",
"line_number": 25,
"usage_type": "call"
},
{
"api_name"... |
30249144544 | from baby import takeCommand
import pywhatkit as kit
from say import speak
import time
from say import takeCommand
import datetime
def send():
speak("to whome you will like to dend meaasge")
query =takeCommand().lower()
if 'dad'in query:
contact='enter yous no'
elif "mom" in query:
cont... | abhivishwakarma98/ai_baby | whatappp.py | whatappp.py | py | 757 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "say.speak",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "say.takeCommand",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "say.speak",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "say.takeCommand",
"line_number... |
42399393037 | import pandas as pd
from sklearn.model_selection import train_test_split
class TrainValTestSplit:
@staticmethod
def train_val_test_split(market, size):
"""
Get train, validation, test sample indices - time, assetCode, market index in original market df
@return: train, validation, test... | DmitryPukhov/marketnewslstm | marketnewslstm/TrainValTestSplit.py | TrainValTestSplit.py | py | 933 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "pandas.datetime",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 21,
"usage_type": "cal... |
37585040770 | from django.db import models
from django.db import models
from phonenumber_field.modelfields import PhoneNumberField
class SoftDeleteManager(models.Manager):
def get_queryset(self):
return super().get_queryset().filter(is_deleted = False)
class SoftDeleteEmployee(models.Model):
... | RAZERZONE1000/Backend_Python_Developer_Assignment | Backend_Python_Developer_Assignment/employees/models.py | models.py | py | 1,087 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.db.models.Manager",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.Model",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.