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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
15543207703 | from tkinter import*
from tkinter import ttk
from PIL import ImageTk,Image
def Main_program():
Display_root()
project_title()
Display_frame1()
Display_label1()
Display_entry1()
Display_label2()
Display_entry2()
Display_image_frame()
Display_other()
Display_sm_treview()
Display_button1()
Display_button2()
... | Ridwanullahi-code/Tkinter_Pharmacy_management_system | Tkinter_pharmarcy_system.py | Tkinter_pharmarcy_system.py | py | 9,921 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"li... |
70831449961 | #In this module we will build methods with which to
'''
Im going to assign 6 new columns ( Neu, Neg, Pos, bigramMatch%, unigramMatch%, perc_HashT_Match) Neu, neg and pos will give us the sentiment in the description, while bigramMatch% is the percentage of bigrams that match those produced by the fake news articles, d... | joegaspari/Misinformation_tiktok | Code/post_anlysis.py | post_anlysis.py | py | 5,752 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "nltk.sentiment.SentimentIntensityAnalyzer",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.merge",
"line_number": 45,
"usage_type": "call"
},
{
"api_name"... |
37109123409 | import os
import tempfile
from collections.abc import Generator
from homework09.task01 import merge_sorted_files
def create_temp_files(with_content=[]):
"""Parametrized decorator that creates several temporary files with given content.
:param with_content: list of byte strings (contain only digits), 1 string... | catpasternak/epam-hw | tests/homework09/test_task01.py | test_task01.py | py | 1,448 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tempfile.mkstemp",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.write",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.close",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number"... |
11067599251 | import logging
import threading
class ClientHandler(threading.Thread):
def __init__(self, socketclient):
threading.Thread.__init__(self)
self.socket_to_client = socketclient
def run(self):
#CATCH LOGIN client_to_server messge after login from client-side... | dominicho97/advanced-tkinter-gui | server/admin_clienthandler.py | admin_clienthandler.py | py | 1,710 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "threading.Thread",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "lo... |
7570182300 | from django.urls import path
from . import views
app_name = 'quote'
urlpatterns = [
path('create/', views.QuoteCreateView.as_view(), name='create-quote'),
path('all/', views.QuoteListView.as_view(), name='list-quotes'),
path('detail/<str:pk>', views.QuoteDetailView.as_view(), name='detail-quotes'),
pat... | hanifeh/CRM | quote/urls.py | urls.py | py | 459 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
19249293258 | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 24 14:47:05 2020
@author: Balázs Vinkovics
"""
import pickle
import numpy as np
import tensorflow as tf
from tensorflow import keras
import xlwt
from xlwt import Workbook
import os
#Importing dataset
dataset = pickle.load(open("/content/drive/MyDrive/Szakdolgozat/Data/d... | BalazsVinkovics/Szakdolgozat_2020 | Race_prediction.py | Race_prediction.py | py | 9,001 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pickle.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models.load_mode... |
36977950844 | import numpy as np
from typing import Callable
from scipy.integrate import quad
w_legendre = lambda x: 1.0
w_chebyshev = lambda x: 1.0 / np.sqrt(1.0 - x**2.0)
def polinomios_ortogonales_chebyshev(
n: int
) -> np.array:
def _chebyshev(
i: int
) -> np.array:
if i == 0:
... | Blitzman/physics | metodos_numericos/practicas/aproximacion.py | aproximacion.py | py | 2,673 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.sqrt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.polysub",
"line_number": ... |
42115226764 | from collections import Counter
x = int(input())
show_sizes = list(map(int, input().split()))
n = int(input())
size_vs_price = []
for i in range(n):
sublist = list(map(int, input().split()))
size_vs_price.append(sublist)
show_sizes_dict = Counter(show_sizes)
total = 0
for size, price in size_vs_price:
if... | MdSohel0706/dailywork | MCS_0058_Sohel_Core_Python/_50_HACKERRANK_PROBLEMS/_08_collections_counter.py | _08_collections_counter.py | py | 477 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 10,
"usage_type": "call"
}
] |
36239760975 | """squash
Revision ID: c41960c217ac
Revises:
Create Date: 2023-07-06 03:46:54.476229
"""
import litestar
import sqlalchemy as sa
from alembic import op
__all__ = ["downgrade", "upgrade"]
# revision identifiers, used by Alembic.
revision = "c41960c217ac"
down_revision = None
branch_labels = None
depends_on = None
... | litestar-org/litestar-pg-redis-docker | alembic/versions/c41960c217ac_squash.py | c41960c217ac_squash.py | py | 2,017 | python | en | code | 126 | github-code | 18 | [
{
"api_name": "alembic.op.create_table",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Strin... |
38941922463 | #!/usr/bin/python3
"""
Function parses the title of all hot articles
and prints a sorted count of given keywords.
"""
import requests
def count_words(subreddit, word_list, after='', word_count={}):
header = {
'User-Agent': 'linux:0x16.api.advanced:v1.0.0 (by /u/bdov_)'
}
url = "https://www.reddit.... | Cathyrt/alx-system_engineering-devops | 0x16-api_advanced/100-count.py | 100-count.py | py | 1,009 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
}
] |
28047196500 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Interpolation of Amplitude and Phase using the interpolant derived by Zhigang Xu.
For details see - https://doi.org/10.1007/s10236-017-1122-8
TODO:
* Add a wrapper class
* Add type and error check
* Add case for missing value
Author: khan
"""
import numpy ... | jamal919/pycaz | pycaz/tide/interpolate.py | interpolate.py | py | 12,067 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "numpy.pi",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "numpy.meshgrid",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_numb... |
18680226455 | import requests
from bs4 import BeautifulSoup
import re
import zhuyin_freq as zf
HTML_PARSER = "html.parser"
ROOT_URL = 'https://tw.news.yahoo.com'
LIST_URL = 'https://tw.news.yahoo.com/technology'
SPACE_RE = re.compile(r'\s+')
MAX_ARTICLES = 50
def get_news_lists():
req = requests.get(ROOT_URL)
if req.statu... | msn9110/pypinyin-demo | crawl-news.py | crawl-news.py | py | 2,485 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "re.compile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.codes",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"l... |
29087734235 | import pathlib
import os
import subprocess
import pandas as pd
from pandas_profiling import ProfileReport
from .pmlb import (
fetch_data, get_updated_datasets, last_commit_message
)
from .dataset_lists import dataset_names
def make_profiling(dataset, write_dir, dat_dir='datasets/'):
print(f'Processing {datas... | EpistasisLab/pmlb | pmlb/profiling.py | profiling.py | py | 1,588 | python | en | code | 757 | github-code | 18 | [
{
"api_name": "pmlb.fetch_data",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas_profiling.ProfileReport",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas_p... |
72984079081 | #!/bin/python3 -u
import discord
import os
from dotenv import load_dotenv
from discord.ext import commands
from datetime import datetime
import re
import mysql.connector
from datetime import datetime
load_dotenv()
intents = discord.Intents.all()
client = commands.Bot(command_prefix='!', intents=intents)
mydb = mysql.... | DrewCording/BulkBot | welcome.py | welcome.py | py | 2,218 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.Intents.all",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "discord.e... |
72200037801 | """
This module contains base classes and useful functions for the retina module.
"""
import litus
import theano
import theano.tensor as T
import numpy as np
import matplotlib.pylab as plt
from theano.tensor.nnet.conv3d2d import conv3d
from theano.tensor.signal.conv import conv2d
import uuid
dtensor5 = T.TensorTy... | jahuth/retina | retina_base.py | retina_base.py | py | 10,975 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "theano.tensor.TensorType",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "theano.tensor",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "theano.tensor.nnet.conv3d2d.conv3d",
"line_number": 21,
"usage_type": "call"
},
{
"api_nam... |
23442424992 | from typing import List
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
import funix
@funix.funix(
widgets={
"a": "sheet",
"b": ["sheet", "slider[0,1,0.1]"]
}
)
# A simple matplotlib function
def table_plot(
a: List[int]=[5,17,29],
... | TexteaInc/funix-doc | examples/slider_table_plot.py | slider_table_plot.py | py | 437 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
11437119078 | import json
import os
import urllib.request
import boto3
import datetime
LINE_CHANNEL_ACCESS_TOKEN = os.environ['LINE_CHANNEL_ACCESS_TOKEN']
REQUEST_URL = 'https://api.line.me/v2/bot/message/reply'
REQUEST_METHOD = 'POST'
REQUEST_HEADERS = {
'Authorization': 'Bearer ' + LINE_CHANNEL_ACCESS_TOKEN,
'C... | kbr1009/My_SmartLock_System | src/lambda/iotcore_line_func.py | iotcore_line_func.py | py | 2,129 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "boto3.resource",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.Request",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "urllib.r... |
37903063462 | #!/usr/bin/env python3
# Some code snippets from Nicholas Renotte
import cv2 # OpenCV - computer vision libraries
import numpy as np # NumPy - fancy math
import os # Operating System IF (for... | JPValente/ml_scripts | 2-CaptureSigns.py | 2-CaptureSigns.py | py | 7,782 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "mediapipe.solutions",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.pat... |
34451621208 | import matplotlib.pyplot as plt
import numpy as np
from astropy.io import fits
import image_chi as ic
from scipy.ndimage import rotate
from scipy.ndimage import gaussian_filter
def correctReddening(value, band):
"""
Correct for reddening in the observed data. R_v = 3.1
A_lam / A_v = a(x) + b(x) / R_v = shi... | Snakej07/Protoplanetary-Disk-Code | total_intensity_image.py | total_intensity_image.py | py | 2,838 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.log10",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits.open",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 63,
"usage_type": "name"
},
{
"api_name": "astropy.io.fits.open... |
31399862028 | import argparse
import coloredlogs
import github
import logging
import traceback
import sys
def main():
"""Main task if executed standalone."""
parser = argparse.ArgumentParser(description='Fetch master build artifacts.')
parser.add_argument(
'--github-api-token',
type=str,
help='Github API tok... | clapre/connectedhomeip | scripts/helpers/post_comment.py | post_comment.py | py | 2,248 | python | en | code | null | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "colored... |
37067586951 | """A module for instantiating supervised models for learning.
This module exists to help separate out the pieces of the modeling process that
occur in the `run_model.py` file. Its sole focus is on supervised models, and
it can be used to run the gammit of them.
"""
import multiprocessing
import os
from sklearn.line... | sallamander/forest-fires | code/modeling/supervised_models.py | supervised_models.py | py | 1,778 | python | en | code | 42 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.cpu_count",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 36,
"usage_type": "call"
},
{
... |
40584896450 | import logging
from django.conf import settings
from geodata.models import Country, Region
from iati.parser.exceptions import (
FieldValidationError, ParserError, RequiredFieldError
)
from iati.parser.iati_parser import IatiParser
from iati_codelists import models as codelist_models
from iati_organisation.models ... | EwoutGoet/iati_data | OIPA/iati_organisation/parser/organisation_2_02.py | organisation_2_02.py | py | 40,147 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "iati.parser.iati_parser.IatiParser",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "iati_codelists.models.Language",
"line_number": 66,
"usage_type": "attribute"
},
... |
41843380674 | import torch
import random
from torch import nn
import numpy as np
import torchvision
import torchvision.transforms as transforms
import torch.nn.functional as F
from torch.autograd import Function
from torch.utils.data import Dataset, DataLoader
import torch.nn.functional as F
from tqdm import tqdm_notebook
# Siamese
... | Mohamed-Sanim/Online-motion-recognition | SPDSiamese/Siamese.py | Siamese.py | py | 8,046 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.relu",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.nn.funct... |
28982367008 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 17 17:24:43 2020
Search in Spring Nature using API by keywords for NIS lab reserch projects.
@author oudeng, Graduate School of Human Sciences, Waseda University
Python program for searching info from Springer Nature via API by XML.
Results include... | oudeng/API_XML_SpringNature | API_XML_SpringNature.py | API_XML_SpringNature.py | py | 4,110 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 79,
"usage_type": "call"
}
] |
18388563203 | from bench.utils import ProcessOps
from bench.settings import KUBELET, ETCD, CONTROLLER_MANAGER, API_SERVER, SCHEDULER, KUBEPROXY
class CISRule:
def __init__(self):
self.status = False
self.output = []
self.recommendation = ""
self.log = []
self.permission = None
se... | OWASP/KubeLight | bench/rule.py | rule.py | py | 932 | python | en | code | 93 | github-code | 18 | [
{
"api_name": "bench.utils.ProcessOps",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bench.settings.KUBELET",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "bench.utils.ProcessOps",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "... |
2419197969 | from whisper_jax import FlaxWhisperPipline
import jax.numpy as jnp
import time
from jax.experimental.compilation_cache import compilation_cache as cc
import os
import jax
start_time = time.time()
# environment variable
os.environ["XLA_FLAGS"] = "--xla_gpu_strict_conv_algorithm_picker=false"
# change from GPU to CPU
... | ThePlasmak/whisper-jax-diarization | whisper-jax-diarization.py | whisper-jax-diarization.py | py | 1,748 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "jax.config.update",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "jax.config",
"line_num... |
32121551203 | from fastapi import APIRouter, Depends, Request, status, HTTPException
from fastapi.responses import JSONResponse
from fastapi.encoders import jsonable_encoder
from sqlalchemy.orm import Session
from fastapi.security import HTTPBearer
from db import get_db
import crud
import models as mod
addition_router = APIRouter(... | olympusss/plant | routers/addition.py | addition.py | py | 1,494 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fastapi.Depends",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fastapi.security.HTTPBearer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fastapi... |
14201755821 |
#!/usr/bin/env python3
# coding: utf-8
"""
@author: Ping Qiu qiuping1@genomics.cn
@last modified by: Ping Qiu
@file: test_data_helper.py
@time: 2021/03/16
"""
import sys
sys.path.append('/data/workspace/st/stereopy-release')
from stereo.utils.data_helper import select_group
import pandas as pd
from anndata import... | pratapstat/stereopy | tests/test_data_helper.py | test_data_helper.py | py | 920 | python | en | code | null | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"l... |
29766262693 | from typing import List
'''
小镇里有 n 个人,按从 1 到 n 的顺序编号。传言称,这些人中有一个暗地里是小镇法官。
如果小镇法官真的存在,那么:
小镇法官不会信任任何人。
每个人(除了小镇法官)都信任这位小镇法官。
只有一个人同时满足属性 1 和属性 2 。
给你一个数组 trust ,其中 trust[i] = [ai, bi] 表示编号为 ai 的人信任编号为 bi 的人。
如果小镇法官存在并且可以确定他的身份,请返回该法官的编号;否则,返回 -1 。
示例 1:
输入:n = 2, trust = [[1,2]]
输出:2
示例 2:
输入:n = 3, trust = [[1... | tyutltf/Leecode | every_question/997-找到小镇的法官.py | 997-找到小镇的法官.py | py | 1,966 | python | zh | code | 1 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 41,
"usage_type": "name"
}
] |
34844581707 | """added post column
Revision ID: 0de5184abe4b
Revises: c866b38e819f
Create Date: 2021-05-01 12:14:47.337995
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0de5184abe4b'
down_revision = 'c866b38e819f'
branch_labels = None
depends_on = None
def upgrade():
... | w-mbugua/bloggr | migrations/versions/0de5184abe4b_added_post_column.py | 0de5184abe4b_added_post_column.py | py | 647 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Text",
... |
8846915314 | import networkx as nx
import matplotlib.pyplot as plt
import os
def plot_dist(edge_list_path):
G=nx.read_weighted_edgelist(edge_list_path, nodetype=str)
fig, ax = plt.subplots()
ax.hist([d for n, d in G.degree()], bins=20, color='skyblue', edgecolor='black')
ax.set_xlabel('Degree', fontsize=15)... | yazid-hoblos/seminar | filtering/degree_distribution.py | degree_distribution.py | py | 618 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "networkx.read_weighted_edgelist",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_nam... |
31510531318 | from __future__ import print_function, unicode_literals
from PyInquirer import style_from_dict, Token, prompt
import json
def initialize_project():
style = style_from_dict({
Token.QuestionMark: '#E91E63 bold',
Token.Selected: '#673AB7 bold',
Token.Instruction: '', # default
Toke... | biwin/Qwe | init.py | init.py | py | 1,479 | python | hi | code | 0 | github-code | 18 | [
{
"api_name": "PyInquirer.style_from_dict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PyInquirer.Token.QuestionMark",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "PyInquirer.Token",
"line_number": 10,
"usage_type": "name"
},
{
"api... |
36442013998 | import time
from datetime import datetime, timedelta
import backtrader as bt
from ccxtbt import CCXTFeed
def main():
class TestStrategy(bt.Strategy):
def __init__(self):
self.next_runs = 0
def next(self, dt=None):
dt = dt or self.datas[0].datetime.datetime(0)
... | phonegapX/bt-ccxt-store-cn | samples/backtesting.py | backtesting.py | py | 1,300 | python | en | code | 54 | github-code | 18 | [
{
"api_name": "backtrader.Strategy",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "backtrader.Cerebro",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ccxtbt.CCXTFeed",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "backtrader... |
6730375065 | import os, glob, math
import numpy as np
from PIL import Image, ImageOps
from astropy.io import fits
from matplotlib import cm
import matplotlib.pyplot as plt
from matplotlib.offsetbox import OffsetImage, AnnotationBbox
# ms9201 xaxis = 6.34 kpc
# vv0316 xaxis = 24.2 kpc
#from astropy.cosmology import FlatLambdaCDM
i... | toshikisaito1005/myUtils | proj_archived/prep_Yamashita_aca_merger/figure_scatter_mom0.py | figure_scatter_mom0.py | py | 6,154 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.loadtxt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.c_",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_num... |
25165515173 | import asyncio
import re
from typing import List, Generator, Any, Union, Dict
from urllib.robotparser import RobotFileParser
from selectolax.parser import HTMLParser
from loaders.response_loader import ResponseLoader, ResponseInformation
class Crawler:
"""
Asynchronous web crawler.
seed (str): The star... | Curtidor/ScrapeFlow | scraping/crawler.py | crawler.py | py | 7,297 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "asyncio.AbstractEventLoop",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "urllib.robotpa... |
36239190695 | from __future__ import absolute_import
from opentracing.ext import tags as ext_tags
import re
from ._current_span import current_span_func
from ._singleton import singleton
from .. import utils
try:
import redis
except ImportError:
redis = None
# regex to match an ipv4 address
IPV4_RE = re.compile(r'^\d{1,... | uber-common/opentracing-python-instrumentation | opentracing_instrumentation/client_hooks/strict_redis.py | strict_redis.py | py | 3,282 | python | en | code | 164 | github-code | 18 | [
{
"api_name": "re.compile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "opentracing.ext.tags.PEER_HOST_IPV4",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "opentracing.ext.tags",
"line_number": 40,
"usage_type": "name"
},
{
"api_name... |
31145888205 | from flask import Blueprint, render_template
from flask_login import current_user
main = Blueprint('main', __name__)
@main.route('/')
def index():
"""Загрузка начальной страницы"""
try:
current_user.id
return render_template('index-login.html')
except:
return render_template('ind... | notyourkokoro/projects | project/main/routes.py | routes.py | py | 572 | python | ru | code | 1 | github-code | 18 | [
{
"api_name": "flask.Blueprint",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask_login.current_user.id",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask_login.current_user",
"line_number": 12,
"usage_type": "name"
},
{
"api_name... |
23603512876 | '''Creates an Employee with an Address'''
# Imports
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Base, Employee, Address
engine = create_engine('sqlite:///employees.db')
Base.metadata.bind = engine
DBSession = sessionmaker(bind = engine)
session = DBSession(... | paulfoley/Udacity_Nanodegree-Full_Stack | Employees/employees.py | employees.py | py | 1,072 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "database_setup.Base.metadata",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "database_setup.Base",
"line_number": 9,
"usage_type": "name"
},
{
"api_n... |
27404068782 | #! /usr/bin/env python
# !-*-coding:utf-8 -*-
# ! @Time : 16:27
# ! @Author :smile丶
# ! @File :.py
import requests
import re
from fake_useragent import UserAgent
headers = {
"user-agent" : UserAgent().chrome
}
url = "https://www.qiushibaike.com/hot/"
resp = requests.get(url,headers=headers)
resp.encoding=... | sjsmi1e/python_crawl | 爬虫/糗事百科爬取.py | 糗事百科爬取.py | py | 660 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "fake_useragent.UserAgent",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_n... |
32478428289 | #! /usr/bin/env python
"""
Some practicing on the APIC Rest API
"""
from __future__ import print_function, unicode_literals
import requests
import json
from cisco_sandboxes import apicdc
AUTH_DATA = {
"aaaUser": {
"attributes": {
"name": apicdc['username'],
"pwd": apicdc['pas... | jpmondet/devnet_training | cisco_devnet/aci_rest_api.py | aci_rest_api.py | py | 1,116 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "cisco_sandboxes.apicdc",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "cisco_sandboxes.apicdc",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "cisco_sandboxes.apicdc",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "... |
10923856243 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
# VMware vRealize Log Insight Exporter
# Copyright © 2017 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. ... | feitianyiren/loginsight-export | setup.py | setup.py | py | 2,157 | python | en | code | null | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 42,
"usage_type": "call"
}
] |
121055654 | import re
import copy
from collections import defaultdict
from typing import Any, Generator, Iterable, TypeVar
from protobuf_to_pydantic import msg_to_pydantic_model
from google.protobuf.json_format import MessageToDict, ParseDict
from google.protobuf.message import Message
from pydantic import BaseModel
from .utils ... | supermistral/e-commerce | backend/gateway/src/builder/loader.py | loader.py | py | 3,285 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.TypeVar",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utils.import_classes",
... |
36194501893 | import logging
from statistics import mean
import numpy as np
from datetime import datetime
class RateMeter():
def __init__(self):
self.rate = []
# self.rate2 = []
self.current_iteration = 0
self.current_epoch = 0
def append(self, rate):
self.current_iteration += 1
... | metu-kamisli/LLICTI | loggers/rate.py | rate.py | py | 7,363 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"... |
3173509021 | from __future__ import division
import os
from glob import glob
import tensorflow as tf
import numpy as np
import ops
import scipy
import torch
import lpips
from image_utils import load_image, save_batch_images
class multi_res_ae(object):
def __init__(self,
session, # TensorFlow sess... | MahlaAb/AdaptiveResolution-Autoencoder | multi_res_ae.py | multi_res_ae.py | py | 43,385 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tensorflow.placeholder",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": ... |
32940909060 |
from logging import basicConfig, getLogger, INFO
from time import sleep
from boto3 import client
from constants import Constants
from describe_ledger import describe_ledger
logger = getLogger(__name__)
basicConfig(level=INFO)
qldb_client = client('qldb')
LEDGER_DELETION_POLL_PERIOD_SEC = 20
def delete_ledger(led... | anadi2311/MCG_QLDB | src/delete_ledger.py | delete_ledger.py | py | 2,488 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "boto3.client",
... |
4645780912 | import ssl
import mechanize
from bs4 import BeautifulSoup
br = mechanize.Browser()
tin = raw_input('Enter tin number:')
br.open('http://mahavat.gov.in/Tin_Search/Tinsearch.jsp')
br.select_form('f1')
br.form['tin'] = tin
req = br.submit()
url = 'http://mahavat.gov.in/Tin_Search/Tin_display?tinnumber='+tin
r = br.open... | Akriti31/Web-Scraping | sample.py | sample.py | py | 488 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "mechanize.Browser",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
}
] |
3173500951 | import numpy as np
from scipy.misc import imread, imresize, imsave
#----------------------------------------------------------------------------
# Linear interpolations
def lerp(a, b, t): return a + (b - a) * t
#----------------------------------------------------------------------------
# Loads images, normali... | MahlaAb/AdaptiveResolution-Autoencoder | image_utils.py | image_utils.py | py | 2,990 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "scipy.misc.imread",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "scipy.misc.imread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.float32"... |
29377813151 | import argparse
from confluent_kafka import Consumer
from confluent_kafka.serialization import SerializationContext, MessageField
from confluent_kafka.schema_registry.json_schema import JSONDeserializer
API_KEY = 'INA5FB7VZYKJVALB'
ENDPOINT_SCHEMA_URL = 'https://psrc-ko92v.us-east-2.aws.confluent.cloud'
API_SECRET_... | WamanBirajdar/Confluent-Kafka-Project-2 | consumer.py | consumer.py | py | 3,719 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "confluent_kafka.schema_registry.json_schema.JSONDeserializer",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "confluent_kafka.Consumer",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "confluent_kafka.serialization.SerializationContext",
"... |
72140703080 | from django.urls import path, include
from django.contrib import admin
from .views import contactView, successView, SearchResultsView, TagSearchView
from . import views
urlpatterns = [
path('', views.home, name='home'),
path('about/', views.about, name='about'),
path('profile/', views.profile, name='profil... | guyett92/monetizico | main_app/urls.py | urls.py | py | 1,954 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.home",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "views.about",
"lin... |
11905232971 | """
This module contains the code that perform prediction on a given image or images
"""
import cv2
import argparse
import numpy as np
from pathlib import Path
import torch
import torch.nn as nn
import torch.nn.functional as F
import utils.utils as utils
from utils.img_utils import alpha_overlay, normalize
from... | r3krut/KITTI_ROAD_SEGMENTATION | prediction.py | prediction.py | py | 7,592 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "torch.nn.ModuleList",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line... |
37413472610 | import pandas as pd
import matplotlib.pyplot as plt
import mpld3
import seaborn as sns
from sklearn.cluster import KMeans
pd.set_option('display.max_columns', 500)
pd.set_option('display.max_rows', 500)
pd.set_option('display.width', 1000)
data = pd.read_csv("all_restaurants_compiled_full.csv")
## total number of ... | ttaylorok/us_foods | plot_and_analyze.py | plot_and_analyze.py | py | 6,046 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.set_option",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
31485920420 | import xml.etree.ElementTree as ET
import xml.dom.minidom
import numpy as np
import os
def add_attributes(xml_element, data):
'''
Adds attributed to the XML element from a dictionary.
'''
for key, val in data.items():
if isinstance(val, str):
new_val = val
elif isinstance(va... | HarvardAgileRoboticsLab/gym-kuka-mujoco | gym_kuka_mujoco/utils/gen_hole.py | gen_hole.py | py | 7,792 | python | en | code | 33 | github-code | 18 | [
{
"api_name": "numpy.sqrt",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"line_number": 28... |
21850458868 | # -*- coding: utf-8 -*-
#!/usr/bin/python
__author__ = "Fireclaw the Fox"
__license__ = """
Simplified BSD (BSD 2-Clause) License.
See License.txt or http://opensource.org/licenses/BSD-2-Clause for more info
"""
# Panda3D imoprts
from direct.actor.Actor import Actor
from direct.fsm.FSM import FSM # 在播放器脚本中使用 FSM 类
f... | tjnu1430130310/panda3d-tutorial-code | game/player.py | player.py | py | 8,784 | python | zh | code | 0 | github-code | 18 | [
{
"api_name": "direct.fsm.FSM.FSM",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "direct.fsm.FSM.FSM.__init__",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "direct.fsm.FSM.FSM",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "dir... |
74711401960 | from sqlalchemy import Table, Column, Integer, String, Boolean, Date, CheckConstraint, ForeignKey
from config.db import meta, engine
# Tabla de eventos
# Esta tabla lleva registro de los eventos y los atributos activos (vea la tabla config).
# Los campos obedecen a los requerimientos provistos por las necesidades de e... | jdpalmad/events-api | models/event.py | event.py | py | 1,040 | python | es | code | 1 | github-code | 18 | [
{
"api_name": "sqlalchemy.Table",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "config.db.meta",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Intege... |
43338138430 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Library for getting a list of planes within a certain point radius
#
import requests
from geographiclib.geodesic import Geodesic
from math import radians, sin, cos, acos
from .city import cities
API = "https://opensky-network.org/api/"
class OpenskyApiException(Excep... | ZILosoft/openskyapi | openskyapi/core.py | core.py | py | 4,401 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "math.radians",
"line_number": 43,
"usage_type": "argument"
},
{
"api_name": "math.acos",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 45,... |
3866977488 | import csv
from operator import index
from unicodedata import name
import numpy as np
import pandas as pd
import pickle
import sklearn
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.preprocessing import scale
class DatasetName():
def __init__(self, df_name):
self.df_name = df_name
... | NetTatsu/BigData_SongDev | similarity.py | similarity.py | py | 5,724 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pickle.load",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "pandas.merge",
"line_number... |
25578669579 | # https://atcoder.jp/contests/abc114/tasks/abc114_c
# 7,5,3がそれぞれ1回以上現れる数
# 3進数を自分で作ってしまうのは?→3,5,7の順にiterateするのは十分間に合う
# 10進数で10**9は3進数だけ考慮するなら10**4.5ぐらいですむ
from itertools import product
N = int(input())
number = ['0'] * 9
nums = ['0', '3', '5', '7']
arg = [nums] * 9
ans = 0
for iters in product(*arg): # 頭がわるいので
... | masakiaota/kyoupuro | practice/C_ABC/abc114_c.py | abc114_c.py | py | 687 | python | ja | code | 1 | github-code | 18 | [
{
"api_name": "itertools.product",
"line_number": 16,
"usage_type": "call"
}
] |
4101419067 | import sys
sys.stdin = open('5427.txt')
import collections
def bfs():
global fire
deq = collections.deque()
a, b = start
deq.append((a, b, 0))
sv = -1
while deq:
row, col, time = deq.popleft()
if time != sv:
for _ in range(len(fire)):
fr, fc... | HwnagYoungJun/algorithm | 2020/4월/0423/5427_불_백준.py | 5427_불_백준.py | py | 1,825 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.stdin",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 54,
"usage_type": "call"
}
] |
11281470302 | import twitter
from time import time as time_now
CONSUMER_KEY = 'OmSLZHzlAonPshptklKq40PXu'
CONSUMER_SECRET ='FDDapXwQavn1hJjXVNfftqEPqmnh6ppOSyTt4ljfSGOH8IsFt9'
OAUTH_TOKEN = '1144962054475804672-1eRvXn1iWcEdOCZyq5mzhIn6L7echV'
OAUTH_TOKEN_SECRET = 'dapCBtw9xEbM5wHoPu0nuUB51CBho04ouac7a6IJ1AAer'
auth = twitter.oauth... | Ippanjin/Project-Little-Birdy | scripts/retweets_tracker.py | retweets_tracker.py | py | 5,858 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "twitter.oauth.OAuth",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "twitter.oauth",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "twitter.Twitter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.time",
... |
32136028854 | from setuptools import setup, find_packages
readme = open('README.txt', 'rb').read()
setup(name = 'OWSLib',
version = '0.3.2beta',
description = 'OGC Web Service utility library',
long_description = readme,
license = 'BSD',
keywords = 'gis ogc ows wfs wms sos ... | okfn/owslib | setup.py | setup.py | py | 1,034 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 16,
"usage_type": "call"
}
] |
2447448349 | import numpy as np
import torch
import torch.nn as nn
import math
from torch.nn import functional as F
import models
from models import register
import time
def make_coord(shape, ranges=None, flatten=True):
""" Make coordinates at grid centers.
follow the coord system as:
+
+
+ + + ... | gaochao-s/ope-sr | models/OPE_linearUp.py | OPE_linearUp.py | py | 9,450 | python | en | code | 111 | github-code | 18 | [
{
"api_name": "torch.arange",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch.stack",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "torch.meshgrid",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "torch.ones",
"line_number... |
73284105959 | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.4
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# %%
fro... | anthonyjclark/cs152fa21 | lectures/l17-Momentum.py | l17-Momentum.py | py | 3,298 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "jupyterthemes.jtplot.style",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "jupyterthemes.jtplot",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "torch.zeros_like",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "fast... |
16048881977 | import keras
import numpy as np
import math
from keras.layers import Dense
from keras.layers import Input
from keras.layers import Conv2D
from keras.layers import add
from keras.layers import Activation
from keras.layers import GlobalAveragePooling2D
from keras.models import Model
from keras.datasets import c... | sherdencooper/tricks-in-deeplearning | cosine_batch.py | cosine_batch.py | py | 6,181 | python | en | code | 18 | github-code | 18 | [
{
"api_name": "tensorflow.ConfigProto",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tensorflow.Session",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "keras.callbacks.Callback",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "ke... |
35023488304 | import os
from unittest import TestCase
from mock import patch, PropertyMock
from collections import namedtuple
from pyccata.core.configuration import Configuration
from pyccata.core.interface import ReportingInterface
from pyccata.core.interface import ManagerInterface
from pyccata.core.exceptions import InvalidMo... | mproffitt/pyccata | tests/test_pyccata/managers/test_report.py | test_report.py | py | 5,782 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
... |
38406787311 | # -*- coding: utf-8 -*-
# @Author: Zeyuan Shang
# @Date: 2016-04-11 22:58:12
# @Last Modified by: Zeyuan Shang
# @Last Modified time: 2016-04-11 22:58:18
from datetime import datetime
if __name__ == "__main__":
T = int(input())
pattern = '%a %d %b %Y %H:%M:%S %z'
for _ in range(T):
s = datetime... | zeyuanxy/hacker-rank | contest/pythonist/python-time-delta/python-time-delta.py | python-time-delta.py | py | 466 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name"... |
4820251622 | """
1231. Divide Chocolate
You have one chocolate bar that consists of some chunks. Each chunk has its own sweetness given by the array sweetness.
You want to share the chocolate with you k friends so you start cutting the chocolate bar into k + 1 pieces using k cuts, each piece consists of some consecutive chunks.
B... | tkwang0530/LeetCode | 1231.py | 1231.py | py | 2,564 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "unittest.main",
"line_number": 83,
"usage_type": "call"
}
] |
9718316678 | from django import forms
class SettingForm(forms.Form):
size = forms.fields.ChoiceField(
choices = (
('4', '4×4'),
('5', '5×5'),
('6', '6×6'),
('7', '7×7'),
('8', '8×8'),
),
required=True,
widget=forms.widgets.Select
)
time = forms.IntegerFi... | kf53495/flash64 | memory64/forms.py | forms.py | py | 579 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.forms.Form",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.fields.ChoiceField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "djan... |
9206014342 | import re
import pickle
import numpy as np
import pandas as pd
from nltk.stem import WordNetLemmatizer
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics import confusion_mat... | sbasakatila/Moodest | main.py | main.py | py | 8,104 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "nltk.stem.WordNetLemmatizer",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line... |
11188132773 | from time import time
import math
import numpy as np
import pandas as pd
from pandas import DataFrame
from sklearn import preprocessing
from sklearn.linear_model import LogisticRegression
from sklearn.cross_validation import train_test_split
from numpy import loadtxt, where
from pylab import scatter, show, leg... | aakashbhatia/Prediction_of_Heart_Disease | logistic regression/Logistic_Regression_Usinglib_Also_Self.py | Logistic_Regression_Usinglib_Also_Self.py | py | 3,483 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "time.time",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pa... |
18434290682 | import matplotlib.pyplot as plt
import tensorflow as tf
import pandas as pd
import numpy as np
# 设置数据
(train_image, train_label),(test_image, test_label) = tf.keras.datasets.fashion_mnist.load_data()
train_label_onehot = tf.keras.utils.to_categorical(train_label)
test_label_onehot = tf.keras.utils.to_categorical(test_... | bravetodo/library | tensorflow/_15dropout.py | _15dropout.py | py | 1,817 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tensorflow.keras.datasets.fashion_mnist.load_data",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.utils.to_categorical",
"line_number": 8,
"usage_ty... |
12176976770 | """empty message
Revision ID: 47e94ae22418
Revises: 1e3e84a18f07
Create Date: 2019-08-10 07:51:50.274272
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '47e94ae22418'
down_revision = '1e3e84a18f07'
branch_labels = None... | verse7/COC2019-API | migrations/versions/47e94ae22418_.py | 47e94ae22418_.py | py | 1,708 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
22149957918 | # description : This file contains the Rent class and a decorator. The rent class calculates
# both the mean rental price for each year and the percent increase for each city
# and creates a plot for both the mean rental price and percent increase.
import numpy as np
import csv
import matpl... | AmberWow123/Projects | Python programming labs/B2_plot_windows/rent.py | rent.py | py | 3,990 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "numpy.loadtxt",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
71427496680 | import gc
import os
import numpy as np
import pandas as pd
import lightgbm as lgb
from sklearn.metrics import roc_auc_score
train_features_path = '../input/baseline-features/train_features.csv'
test_features_path = '../input/baseline-features/test_features.csv'
train = pd.read_csv(train_features_path)
test ... | aorursy/new-nb-3 | jakubczakon_training-and-validation-schema.py | jakubczakon_training-and-validation-schema.py | py | 4,188 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
36609673800 |
# coding: utf-8
# In[ ]:
#Speech to text using Python using Microphone
#python -m speech_recognition
#pip install pyaudio
#pip install SpeechRecognition
import speech_recognition as sr
r = sr.Recognizer()
mic = sr.Microphone()
with mic as source:
r.adjust_for_ambient_noise(source,duration=0.5)# Elimin... | amitpimparkar/Github | Speech to text using Python using Microphone.py | Speech to text using Python using Microphone.py | py | 404 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 18,
"usage_type": "call"
}
] |
29869537000 |
##
## Main calling program for finding a regex pattern in
## the GridFS version of NCBI chromosome data
## Arguments: Taxon (numeric) version of species,
## chromosome to search,
## pattern to search, and verbose (debugging) options.
import sys, argparse
import Build_chromosome_list, Find_regex
class cls_overal... | mosterho/Bioinformatics | Find_regex_pattern_gridfs/Main_program_regex_chromosome_find.py | Main_program_regex_chromosome_find.py | py | 3,067 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"l... |
44901994234 | import pandas as pd
import numpy as np
import torch
import joblib
from sklearn import preprocessing
from sklearn import model_selection
from transformers import AdamW, BertForTokenClassification
from transformers import get_linear_schedule_with_warmup
import config
import dataset
import engine
from model import Ent... | YuTian8328/NER-Finnish-BERT | train.py | train.py | py | 2,920 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 21,
"usage_type": "name"
},
{
"api_name... |
39793719029 | import json
import SimpleITK as sitk
import cv2 as cv
import numpy as np
from scipy import ndimage
from skimage import measure
from pipeline.constants import DirectoryStructure as ds, FileNames as fn
from pipeline.logger import log
def auto_canny(image: np.ndarray, sigma: float = 0.01) -> np.ndarray:
v = np.med... | recoh/pipeline | pipeline/anomaly.py | anomaly.py | py | 3,296 | python | en | code | 13 | github-code | 18 | [
{
"api_name": "numpy.ndarray",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.median",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.Canny",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "SimpleITK.ReadImage",
"... |
24114989642 | import pytest
from books.models import BookRating
@pytest.fixture
@pytest.mark.django_db
def book_fixture(db) -> BookRating:
book_rating = BookRating(
book_id=1342, rating=4, review="fixture"
)
book_rating.save()
return book_rating
| DiogoSantosSilva/desafio | test/conftest.py | conftest.py | py | 258 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "books.models.BookRating",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "books.model... |
74169869481 | # -*- coding: UTF-8 -*-
from annoy import AnnoyIndex
import pickle as pkl
ann_save_path = "./annoy"
id2word_path = "./id2word"
word2id_path = "./word2id"
id2word = None
word2id = None
annoy_index = None
# 构建索引,只需构建一次
def build_index(tree_num = 100):
global id2word, word2id
# 自定义的读取word2vec的函数
items_vec = load_gen... | zedom1/Repo-for-gist | annoy_build.py | annoy_build.py | py | 1,270 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "annoy.AnnoyIndex",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_numb... |
34977984263 | from django.test import TestCase
from ..models import Inventory, Item, Survivor
# Create your tests here.
class ItemTestCase(TestCase):
def setUp(self):
Item.objects.create(name='Água', points=4)
Item.objects.create(name='Alimentação', points=1)
def test_return_str_method(self):
it... | fandrefh/zssn | apps/general/tests/tests_models.py | tests_models.py | py | 1,464 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.Item.objects.create",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Item.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name"... |
34727962310 | ''' vocabulary module '''
from plone.app.vocabularies.catalog import KeywordsVocabulary as KV
from zope.interface import alsoProvides
from zope.interface import implementer
from zope.schema.interfaces import IVocabularyFactory
from zope.schema.vocabulary import SimpleTerm
from zope.schema.vocabulary import SimpleVocabu... | eea/energy.content | src/energy/content/vocabulary.py | vocabulary.py | py | 1,300 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "plone.app.vocabularies.catalog.KeywordsVocabulary",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "zope.interface.implementer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "zope.schema.interfaces.IVocabularyFactory",
"line_number": 10,
... |
74195123560 | # pylint: disable=no-member,invalid-name,import-error,no-name-in-module,too-few-public-methods
"""
Contains adversarial generator that uses DeepFool method.
(https://arxiv.org/abs/1511.04599)
"""
import torch
import torch.autograd.functional as agf
import torch.linalg as la
from adversarial_generator import Adversar... | jakipatryk/adversarial-generator | models/deep_fool.py | deep_fool.py | py | 3,558 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "adversarial_generator.AdversarialGenerator",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "model.Model",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name... |
73660675561 | from collections import defaultdict
class BallroomBayesNet():
def __init__(self, m, n, debug = True):
self.width = m
self.height = n
#dictionaries to store CPTs
self.l_CPT = defaultdict(dict)
self.c_CPT = defaultdict(dict)
self.m1_CPT = defaultdict(dict)
sel... | zackroder/CS_372 | project3/BallRoomBayesNet.py | BallRoomBayesNet.py | py | 8,617 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 11,
"usage_type": "call"
},
{
"api_name":... |
28431541008 | import re
import xml.etree.ElementTree as ET
from impacket.ldap import ldap, ldapasn1
from impacket.smbconnection import SessionError
from impacket.smb3structs import FILE_READ_DATA, FILE_WRITE_DATA
from lib.adscan.accesscontrol import parse_accesscontrol, parse_sd, process_sid
class GPO:
name_to_sid = {
... | hegusung/netscan | scripts/lib/adscan/gpo.py | gpo.py | py | 11,051 | python | en | code | 22 | github-code | 18 | [
{
"api_name": "impacket.ldap.ldapasn1.SearchResultEntry",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "impacket.ldap.ldapasn1",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "lib.adscan.accesscontrol.parse_sd",
"line_number": 42,
"usage_type":... |
35186289725 | import time, datetime, json
from gpiozero import PWMOutputDevice, DigitalInputDevice
# Set the to be loaded slots.
# Has to be full paths or else it won't start on boot!
play1 = "/home/pi/Desktop/whos_afraid/slot_1.json"
# Set the debug level
# 0 = no debug messages, 1 = PIR sensor, 2 = inverter messages, 3 = both... | kleurbleur/whos_afraid | pir_player.py | pir_player.py | py | 3,304 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "gpiozero.DigitalInputDevice",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "gpiozero.PWMOutputDevice",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "gpiozero.PWMOutputDevice",
"line_number": 19,
"usage_type": "call"
},
{
"api... |
6217795396 | from flask import Flask, request, jsonify, render_template
import os
from flask_cors import CORS, cross_origin # for multiple ip eroror
from com_in_ai_utils.utils import decodeImage
from predict import dogcat
import cv2
import time
os.putenv('LANG', 'en_US.UTF-8')
os.putenv('LC_ALL', 'en_US.UTF-8')
PEOPLE_FOLDER = os.... | manishhnnegi/Vehicles-Registration-Number-Plate-Detection-And-Recognition | app.py | app.py | py | 1,288 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.putenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.putenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"... |
17010301524 | #! /usr/bin/env python
from __future__ import print_function, division
try:
import tkinter as tk
except ImportError:
import Tkinter as tk # python2
import numpy as np
import time
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
from mpl_toolkits.axes_grid1 import make_axes_locatable
from scip... | soi/master_thesis | animation_lstm_mdn.py | animation_lstm_mdn.py | py | 19,025 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "Tkinter.Frame",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "Tkinter.Tk",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "Tkinter.Frame",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "Tkinter.Button",
"lin... |
8383826433 | #!/usr/bin/env python3
import numpy as np
import pandas as pd
from sklearn.datasets import load_boston
from sklearn.metrics import mean_squared_error, f1_score, accuracy_score, roc_curve, roc_auc_score
from sklearn.model_selection import train_test_split
from matplotlib import pyplot as plt
# загрузим датасет Boston ... | terentev-mn/sf_ml | m3_5.py | m3_5.py | py | 3,445 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "sklearn.datasets.load_boston",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.newaxis",
... |
35553560971 | from django.shortcuts import render, redirect
from django.http import HttpResponse
import sys
sys.path.append("..")
sys.path.append("..")
import database.database as db
def index (request):
if request.method == 'GET':
results = db.db_grab_unconfirmed()
context = {}
i = 0
while i<5 ... | jbrusegaard/Senior-Design | breachSpider/breachSpider/frontend/interface/views.py | views.py | py | 1,270 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
33249027117 | import openai
import lib.test_base as test_base
class BigFive(test_base.TestBase):
ID = 'big5'
REVERSED_INDICES = [6, 16, 26, 36, 46, 2, 12, 22, 32, 8, 18, 28, 38, 4, 14, 24, 29, 34, 39, 44, 49, 10, 20, 30]
DEFAULT_PROMPT = "Lets roleplay and imagine you could answer the following questions with a numbe... | pskl/interlink | lib/bigfive.py | bigfive.py | py | 1,645 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "lib.test_base.TestBase",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "lib.test_base",
"line_number": 4,
"usage_type": "name"
}
] |
4820154782 | """
1048. Longest String Chain
You are given an array of words where each word consists of lowercase English letters.
word_A is a predecessor of word_B if and only if we can insert exactly one letter anywhere in word_A without changing the order of the other characters to make it equal to word_B.
- For example, "abc"... | tkwang0530/LeetCode | 1048.py | 1048.py | py | 3,729 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 80,
"usage_type": "attribute"
},
{
"api_name": "unittest.m... |
74658849641 | from datetime import datetime
import pytz
from django.forms.models import model_to_dict
from django.http import QueryDict
from rest_framework import viewsets, filters, status
from rest_framework.authtoken.models import Token
from rest_framework.authtoken.serializers import AuthTokenSerializer
from rest_framework.permi... | jehob/rlc_app | backend/api/views/user.py | user.py | py | 10,642 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "serializers.UserProfileSerializer",
"line_number": 27,
"usage_type": "n... |
5832931785 | import numpy as np
import pandas as pd
from .apps import *
from rest_framework.views import APIView
from rest_framework.response import Response
from django.shortcuts import render, redirect
from django.http import request, response
class Prediction(APIView):
def post(self, request):
#data = request.dat... | rabhi1611/ML-Drug-Predictor-Django | monitor/views.py | views.py | py | 1,383 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.http.request.GET.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.http.request.GET",
"line_number": 15,
"usage_type": "attribute"
},
{
... |
72606863401 | import requests, re
from bs4 import BeautifulSoup as soup
from fastapi import APIRouter, Query
from fastapi.responses import JSONResponse
from fastapi.encoders import jsonable_encoder
from typing import Optional
from lib.otakudesu import Otakudesu
from api.models.otakudesusch import OtakudesuSchema
AUTHOR = "Sandy Say... | bocchidev/arzxhapi | api/endpoints/otakudesu.py | otakudesu.py | py | 4,623 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 142,
"usage_type": "name"
},
{
"api_name": "fastapi.Query",
"line_number": 142,
"usage_type": "call"
},
{
"api_name": "fastapi.responses.J... |
40801261299 | import pytest
from click.testing import CliRunner
from cicdctl import cli
allowed_networks_outputs = [
('list', [], ''),
('add', ['--cidr', 'my-ip'], ''),
('add', ['--cidr', '67.180.81.198/32'], ''),
('remove', ['--cidr', 'my-ip'], ''),
('remove', ['--cidr', '67.180.81.198/32'], ''),
]
@pytest.ma... | cicdenv/cicdenv | tests/commands/test_whitelist.py | test_whitelist.py | py | 585 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "cicdctl.cli",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 14,
"usage_type": "attribute"
}
] |
9465744605 | #!/usr/bin/python3
from datetime import date
import sys
# special occasion lol
start_date = date(2019, 6, 3)
def get_since(start):
return (date.today() - start).days
def leaf_years_since(start):
today = date.today()
start = start.year
res = 0
while(start <= today.year):
if start % 4 == ... | toxdes/python-scripts | days.py | days.py | py | 939 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.date",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.date.today",
... |
35241835704 | from utils.ResponseTypes import SuccessResponse
from fastapi import APIRouter,Request,BackgroundTasks
from Services.RecommendationService import RecommendationService
model_controller = APIRouter(prefix='/model')
recommendationService =RecommendationService()
@model_controller.get("/recommend")
async def get_similari... | hungtqsk66/ML-Server | Controllers/Model_Controller.py | Model_Controller.py | py | 693 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "Services.RecommendationService.RecommendationService",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "utils.ResponseTypes.SuccessResponse",
"line_number": 10,
"usage_type... |
24994293985 | import os
import pm4py
class InputOCELPreprocessor:
session_path: str
def __init__(self, session_path, file_name, file):
file_path = os.path.join(session_path, file_name)
file.save(file_path)
self.sessionPath = session_path
self.ocel = pm4py.read_ocel(file_path)
self.... | beneknopp/OCPS | backend/input_ocel_processing/preprocessor.py | preprocessor.py | py | 7,034 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pm4py.read_ocel",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
33871482283 | # coding=utf-8
import data_loader
from PIL import Image
import numpy as np
import os
def convert():
"""用于把MNIST的数据转为图片文件"""
images_dir = 'images/'
if not os.path.exists(images_dir):
os.mkdir(images_dir)
num_images = 10
images = data_loader.load_images(data_loader.test_images_path, num_imag... | controny/mnist-recognition | convert_to_images.py | convert_to_images.py | py | 737 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "data_loader.load_images",
"l... |
26169009085 | import pandas as pd
from matplotlib import pyplot as plt
data = pd.read_csv('countries.csv')
print(data)
# Compare population growth between US and China
us = data[data.country == 'United States']
print(us)
china = data[data.country == 'China']
print(china)
pop = plt.figure(1)
plt.plot(us.year, us.population / 10**... | MGrant96/BackToPython | DataAnalysisCsDojo/realdata_for_visualisation.py | realdata_for_visualisation.py | py | 1,084 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "matplotlib.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.