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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74611006504 | # coding: utf-8
from __future__ import print_function
import json
from math import log10
import numpy as np
def fit(x, y):
x_mean = np.mean(x)
y_mean = np.mean(y)
cov = np.sum((x - x_mean) * (y - y_mean))
var = np.sum((x - x_mean)**2)
a = cov / var
b = y_mean - a * x_mean
return lambda x1... | andreas-schmidt/tapetool | json2ds.py | json2ds.py | py | 1,133 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.mean",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 13,
... |
23682916986 | import re
import pandas as pd
from bs4 import BeautifulSoup
df = pd.DataFrame.from_csv("realtor.csv", sep="|", encoding="ISO-8859-1")
print(df.head)
print ("done")
dftemp = df
for i, (idx, ser) in enumerate(dftemp.iterrows()):
html = ser["metaHTML"]
bs = BeautifulSoup(html)
for li in bs.fi... | jhmuller/real_estate | realtor2.py | realtor2.py | py | 1,198 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.DataFrame.from_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.B... |
13395835031 | """
@author: gjorando
"""
import os
import importlib
from pypandoc import convert_file
from setuptools import setup, find_packages
def read(*tree):
"""
Read a file from the setup.py location.
"""
full_path = os.path.join(os.path.dirname(__file__), *tree)
with open(full_path, encoding='utf-8') as... | gjorando/style-transfer | setup.py | setup.py | py | 2,277 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
... |
16009855981 | #!/usr/bin/python3
import numpy as np
from matplotlib import pyplot as plt
lx = []
ly = []
with open("HailStoneNum.txt", "r") as f:
for line in f:
ls = line.split(",")
lx.append(int(ls[0]))
ly.append(int(ls[1]))
x = np.array(lx)
y = np.array(ly)
plt.plot(x,y)
plt.savefig("HailStone.jpg"... | Ukuer/rasp-pi | DSA/HailStone/HailStoneCount.py | HailStoneCount.py | py | 322 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
26361613449 | from bme590_assignment02.ECG_Class import ECG_Class
from flask import Flask, jsonify, request
import numpy as np
app = Flask(__name__)
count_requests = 0 # Global variable
@app.route('/heart_rate/summary', methods=['POST'])
def get_data_for_summary():
"""
Summary endpoint: Accepts user data and returns ins... | juliaross20/cloud_ecg | api_codes.py | api_codes.py | py | 6,928 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "flask.jsonify",
... |
13289609625 | # -*- coding: utf-8 -*-
"""
Created on Sat Jan 2 00:48:47 2021
@author: baris
"""
import pandas as pd
import math
import numpy as np
import xlsxwriter
xlxs_file = pd.read_excel("example.xlsx")
# All columns have separeted into a list on their own.
parsed_store = xlxs_file["store"].tolist()
parsed_x = xlxs_file[... | barissoyer/FunProjects | X-Yl_Location based/xy_locations.py | xy_locations.py | py | 1,579 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_excel",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.argsort",
"line_num... |
20496563572 | from typing import List
from instructor import patch
from pydantic import BaseModel, Field
import openai
patch()
class Property(BaseModel):
key: str
value: str
resolved_absolute_value: str
class Entity(BaseModel):
id: int = Field(
...,
description="Unique identifier for the entity,... | realsrisri/jxnl-instructor | examples/reference-citation/run.py | run.py | py | 5,705 | python | en | code | null | github-code | 36 | [
{
"api_name": "instructor.patch",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pydantic.Field"... |
16198615974 | # Climate App
# Now that you have completed your initial analysis, design a Flask api based on the queries that you have just developed.
# - Use FLASK to create your routes.
#################################################
# Import Flask & jsonify & the kitchen sink...
################################################... | JREwan/python-challenge | Homework11_SurfsUp/app.py | app.py | py | 5,386 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.automap.automap_base",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 29,
"usage_type": "call"
},
{
... |
73694485864 | import requests
from bs4 import BeautifulSoup
from bs4.element import ResultSet
import json
from telprefix.path import JSON_DATA_PATH
def getHTMLText(result: ResultSet | None) -> str:
if result is not None:
result = result.text.strip()
return result
# URL Artikel
# Sumber: https://www.pinhome.id
URL ... | manoedinata/telprefix | telprefix/scrap.py | scrap.py | py | 2,569 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "bs4.element.ResultSet",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup... |
10070249997 | from django.shortcuts import render
from.models import friends
# Create your views here.
def showindex(request):
id=request.GET.get("update_id")
if id==None:
res=friends.objects.all()
return render(request,"index.html",{"res":res})
else:
id1=friends.objects.filter(entry=id).update()... | prasadnaidu1/django | sisco1/app1/views.py | views.py | py | 993 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "models.friends.objects.all",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.friends.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "models.friends",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dj... |
42629364234 | #!/usr/bin/env python
# coding=utf-8
import torch
import torchvision.models as models
#resnet169 = models.densenet169(pretrained=True).cuda()
inception_v3 = models.inception_v3(pretrained=True).cuda()
dummy_input = torch.randn(1, 3, 224, 224, device='cuda')
input_names = ['data']
output_names = ['outputs']
torch.onnx... | YixinSong-e/onnx-tvm | torchmodel/torch_model.py | torch_model.py | py | 528 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torchvision.models.inception_v3",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torchvision.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.randn",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.onn... |
21536939801 | import cv2
import numpy as np
import os
import random
import torch
from tqdm import tqdm
def draw(prediction,dependency):
img=np.full((256,256,3),220,dtype=np.uint8)
for i,c in enumerate(prediction):
if c==0 or c>9:
if i not in dependency:
cv2.rectangle(img,(10+i%9*26, 10+i//... | RalphHan/CASR | empirical/sudoku2.py | sudoku2.py | py | 2,295 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.full",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.rectangle",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_num... |
7615554968 | # -*- coding: utf-8 -*-
import codecs
import sys
import re
import h5py
import numpy as np
import tflearn
from tflearn.data_utils import to_categorical, pad_sequences
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.embedding_ops import embedding
from tflearn.layers.recurrent ... | kimwansu/autospacing_tf | bi_lstm.py | bi_lstm.py | py | 9,163 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tflearn.layers.core.input_data",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tflearn.layers.embedding_ops.embedding",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "tflearn.layers.core.dropout",
"line_number": 31,
"usage_type": "cal... |
71696562344 | # @keras-rl
'''
Script for custom or modified noise processes
'''
from __future__ import division
import numpy as np
#makes an instance of a noise process and returns it
#defined by configuration nc
#size is the number of parameters the noise is applied to
#so far just one-dimensional vector (only action noi... | Frawak/squig-rl | source/noiseProcesses.py | noiseProcesses.py | py | 6,718 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.random.normal",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 85,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal... |
174132737 | from datetime import datetime, timezone, timedelta
from django.db.models import Q, Sum
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from django.conf import settings
from django.template.loader import render_to_string
from elasticsearch.helpers import bulk
from api.inde... | batpad/go-api | api/management/commands/index_and_notify.py | index_and_notify.py | py | 31,984 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.timedelta",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "notification... |
24537790919 | from pathlib import Path
N, S = int(Path("day17.txt").read_text()), 50000000
l, pos, after2017, afterzero = [0], 0, 0, 0
for v in range(1, S+1):
pos = (pos + N) % v + 1
if v == 2017: after2017 = l[pos]
elif v > 2017:
if pos == 1:
afterzero = v
continue
l.insert(pos, v)
print(after2017, afterzero... | AlexBlandin/Advent-of-Code | 2017/day17.py | day17.py | py | 322 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 3,
"usage_type": "call"
}
] |
35376158594 | # fit to time dependent function of chance of having activity of any length during a single labeling window
# infer k_on parameter based on single window for 4SU (though here it is the 2nd window)
# based on different window lengths
# window_lengths = [15, 30, 45, 60, 120, 180]
# fit based on (hidden) presence of activ... | resharp/scBurstSim | analysis/infer_parameters_example.py | infer_parameters_example.py | py | 7,414 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "os.name",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 58,... |
9503023051 | import os
import os.path as osp
import time
import yaml
import warnings
import torch
import torch.optim as optim
from utils import get_world_size, get_rank
from builder import build_train_dataloader, build_val_dataloader,build_model
from utils import Logger,CosineDecayLR
from torch import distributed as dist
from to... | CxyZyr/face-recognition | runner.py | runner.py | py | 13,847 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.backends",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.backends",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "utils.get_rank",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "utils.get_worl... |
32115859766 | from __future__ import annotations
from typing import Iterable, Iterator, List, Literal, Optional, Type
import frictionless as fl
import marshmallow as mm
from dimcat import DimcatConfig, get_class
from dimcat.data.base import Data
from dimcat.data.packages.base import Package, PackageSpecs
from dimcat.data.resources... | DCMLab/dimcat | src/dimcat/data/catalogs/base.py | base.py | py | 11,590 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "dimcat.data.base.Data",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "dimcat.data.base.Data.PickleSchema",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "dimcat.data.base.Data",
"line_number": 32,
"usage_type": "name"
},
{
... |
36445673009 | """remove subscriber
Revision ID: f71f10afe911
Revises: 514826a76b2b
Create Date: 2020-03-15 02:09:24.586462
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f71f10afe911'
down_revision = '514826a76b2b'
branch_labels = None
depends_on = None
def upgrade():
... | mhelmetag/mammoth | alembic/versions/f71f10afe911_remove_subscriber.py | f71f10afe911_remove_subscriber.py | py | 1,071 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "alembic.op.drop_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "alembic.op.create_table",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "alembic.op",... |
4179808886 | '''
constants used throughout project
'''
import numpy as np
from astropy.cosmology import FlatLambdaCDM
RERUN_ANALYSIS = False
## set cosmology to Planck 2018 Paper I Table 6
cosmo = FlatLambdaCDM(H0=67.32, Om0=0.3158, Ob0=0.03324)
boss_h = 0.676 ## h that BOSS uses.
h = 0.6732 ## planck 2018 h
eta_star = cosmo.c... | kpardo/mg_bao | mg_bao/constants.py | constants.py | py | 593 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "astropy.cosmology.FlatLambdaCDM",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 18,
"usage_type": "attribute"
}
] |
72294810025 | import streamlit as st
import pandas as pd
import numpy as np
# Wedding budget planner for the region of Southern France
st.title("Wedding Budget Planner for the Region of Southern France")
# Filter to allow the user to narrow down their options
st.subheader("Filter")
number_of_guests = st.slider("Number of guests"... | karlotimmerman/budget_heroku | hello.py | hello.py | py | 1,545 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "streamlit.title",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.subheader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.slider",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.selectb... |
6751661466 | # -*- coding: utf-8 -*-
from PyQt5.QtWidgets import QWidget, QTreeWidgetItem, QMenu
from PyQt5.QtCore import pyqtSlot, QPoint
from selfcheck.controllers.selfcheckcontroller import SelfCheckController
from selfcheck.modules.editselfcheckitemmodule import EditSelfCheckItemModule
from selfcheck.views.selfcheckitemlist i... | zxcvbnmz0x/gmpsystem | selfcheck/modules/selfcheckitemlistmodule.py | selfcheckitemlistmodule.py | py | 3,415 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "selfcheck.views.selfcheckitemlist.Ui_Form",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "selfcheck.controllers.selfcheckcontroller.SelfCheckController",
"line_numbe... |
2723494159 | #!/usr/bin/python3
"""tracking the iss using
api.open-notify.org/astros.json | Alta3 Research"""
# notice we no longer need to import urllib.request or json
import requests
## Define URL
MAJORTOM = 'http://api.open-notify.org/astros.json'
def main():
"""runtime code"""
## Call the webservice
groundct... | chadkellum/mycode | iss/requests-ride_iss.py | requests-ride_iss.py | py | 1,295 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
}
] |
32179513329 | import sys
from PyQt5 import QtWidgets
def Pencere():
app = QtWidgets.QApplication(sys.argv)
okay = QtWidgets.QPushButton("Tamam")
cancel = QtWidgets.QPushButton("İptal")
h_box = QtWidgets.QHBoxLayout()
h_box.addStretch()
h_box.addWidget(okay)
h_box.addWidget(cancel)
... | mustafamuratcoskun/Sifirdan-Ileri-Seviyeye-Python-Programlama | PyQt5 - Arayüz Geliştirme/Videolarda Kullanılan Kodlar/horizontal ve vertical layout.py | horizontal ve vertical layout.py | py | 643 | python | en | code | 1,816 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidge... |
27868546226 | """Module for I/O related data parsing"""
__author__ = "Copyright (c) 2016, Mac Xu <shinyxxn@hotmail.com>"
__copyright__ = "Licensed under GPLv2 or later."
import datetime
import pprint
import re
from app.modules.lepd.LepDClient import LepDClient
class IOProfiler:
def __init__(self, server, config='release'... | linuxep/lepv | app/modules/profilers/io/IOProfiler.py | IOProfiler.py | py | 5,872 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "app.modules.lepd.LepDClient.LepDClient",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "attribute"
},
{
... |
7537206122 | from django.test import TestCase, tag
from djangoplicity.newsletters.models import NewsletterType, Newsletter
from webb.tests import utils
@tag('newsletters')
class TestNewsletters(TestCase):
fixtures = [
'test/common',
'test/media',
'test/announcements',
'test/releases',
... | esawebb/esawebb | webb/tests/newsletters.py | newsletters.py | py | 1,838 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "webb.tests.utils.get_staff_client",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "webb.tests.utils",
"line_number": 19,
"usage_type": "name"
},
{
"api_name":... |
17885393929 | from django.shortcuts import render
from django.views import View
from django.http.response import JsonResponse
from django.template.loader import render_to_string
from .models import Topic
from .forms import TopicForm
class BbsView(View):
def get(self, request, *args, **kwargs):
topics =... | inatai/super_tsp | posting/views.py | views.py | py | 1,026 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.views.View",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "models.Topic.objects.all",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.Topic.objects",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "... |
32473831452 | from config import bot, chat_id
from plugins.error import Error
import requests
from bs4 import BeautifulSoup
import time
from telebot import types
from plugins.error import in_chat
#________________________________________________________________________________________________________________
#Скриншот сайтов
#_____... | evilcatsystem/telegram-bot | plugins/screenshot.py | screenshot.py | py | 1,624 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "config.bot.delete_message",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "config.bot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "telebot.types.InlineKeyboardMarkup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name"... |
17417433393 | from rest_framework.serializers import ModelSerializer
from tintoreria.empleados.models import Empleado
class EmpleadoSerializer(ModelSerializer):
def to_internal_value(self, data):
obj = super(EmpleadoSerializer, self).to_internal_value(data)
instance_id = data.get('id', None)
if instance... | marco2v0/Tintoreria | site/tintoreria/empleados/serializers.py | serializers.py | py | 587 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "tintoreria.empleados.models.Empleado",
"line_number": 14,
"usage_type": "name"
}
] |
2892146403 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import phonenumber_field.modelfields
class Migration(migrations.Migration):
dependencies = [
('auth', '0006_require_contenttypes_0002'),
]
operations = [
... | abarto/learn_drf_with_images | learn_drf_with_images/user_profiles/migrations/0001_initial.py | 0001_initial.py | py | 1,052 | python | en | code | 21 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 16,
"usage_type": "call"
},
... |
28797419371 | import yfinance as yf
from matplotlib import pyplot as plt
def load_ticker(symbol):
ticker = yf.Ticker(symbol)
hist = ticker.history(start="2020-03-01", end="2020-12-02")
hist = hist.reset_index()
for i in ['Open', 'High', 'Close', 'Low']:
hist[i] = hist[i].astype('float64')
return his... | Eric-Wonbin-Sang/CS110Manager | 2020F_final_project_submissions/mcdonaldjillian/CSfinalproject.py | CSfinalproject.py | py | 1,422 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "yfinance.Ticker",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.legend",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "matplotlib.... |
34211305302 | from flask import Flask, send_from_directory
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS
from .models import *
db = SQLAlchemy()
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(BASE_DIR, 'data.db')
def model_exists(model_class):
... | wickes1/fullstack-react-flask-overview-backend | app/__init__.py | __init__.py | py | 1,680 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.send_fro... |
41037129028 | import matplotlib.pyplot as plt
import cv2
import os
import random
BASE_PATH = "testImages"
CATEGORIES = ["flybuss", "neptuntaxi", "trondertaxi"]
IMG_SIZE = 60
for category in CATEGORIES:
path = os.path.join(BASE_PATH, category)
for img in os.listdir(path):
img_array = cv2.imread(os.path.join(path, im... | JoakimAa/Bachelor2021 | ML/Cnn/viewtest.py | viewtest.py | py | 474 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": ... |
25317597548 | #!/user/bin/python
import configparser
import requests
import json
import time
#read config file for API key
config = configparser.ConfigParser()
config.sections()
config.read('../TwitterScrape/credentials.ini')
api = config.get("keys", 'urlapi')
#Set headers and data for api usage
headers = {
'Content-Type': 'appli... | monkeytail2002/TwitterURLChecker | Test Scripts/testrequest.py | testrequest.py | py | 1,010 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"l... |
19631354561 | from __future__ import unicode_literals
from zope.component.interfaces import ObjectEvent, IObjectEvent
from zope.interface import Attribute, implements
class IGSJoinSiteEvent(IObjectEvent):
""" An event issued after someone has joined a site."""
siteInfo = Attribute('The site that is being joined')
membe... | groupserver/gs.site.member.base | gs/site/member/base/event.py | event.py | py | 1,050 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "zope.component.interfaces.IObjectEvent",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "zope.interface.Attribute",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "zope.interface.Attribute",
"line_number": 9,
"usage_type": "call"
},
{
... |
5179170859 | #coding:utf-8
from django.shortcuts import render_to_response, get_object_or_404
from activity.dao import activityDao
from django.template.context import RequestContext
from collection.dao import collectionDao, select_collection_byReq,\
update_rightTime_byReq, update_wrongTime_byReq
from django.http.response impor... | WarmerHu/subject | collection/views.py | views.py | py | 3,516 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "activity.dao.activityDao",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render_to_response",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.template.context.RequestContext",
"line_number": 20,
"usage_type": "c... |
5163641580 | import yaml
import sys
import xarray as xr
import time
import glob
def subset_vars(argv):
if(len(argv)!=7):
print("USAGE: wrf-subset-vars.py <in nc path> <in nc file> <out nc path> <out nc file> <var list path> <var list file>\n")
sys.exit(1)
innc_path = argv[1]
innc_file = argv[2]
... | LEAF-BoiseState/py-wrf-postproc | wrf-subset-vars.py | wrf-subset-vars.py | py | 1,265 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "sys.exit",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "yaml.full_load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "xarray.open_dataset",
"line_number": 36,
"usage_type": "call"
}
] |
36426081739 | from PIL import Image
import math
def invert(img):
rgb_img = img.convert('RGB')
width, height = rgb_img.size
img2 = Image.new('RGB', (width, height))
for y in range(height):
for x in range(width):
r, g, b = rgb_img.getpixel((x, y))
r = 255 - r
g = 255 - g
b = 255 - b
# print(f'(x:{x},y:{y} = ({r... | koyachi/sketches | 2021-02-11-pythonista-image/image_processor.py | image_processor.py | py | 3,591 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "PIL.Image.new",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PIL.Image.new",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 25... |
15807183248 | # --------------------------------------------------------
# PYTHON PROGRAM
# Here is where we are going to define our set of...
# - Imports
# - Global Variables
# - Functions
# ...to achieve the functionality required.
# When executing > python 'this_file'.py in a terminal,
# the Python interpreter will load... | segunar/BIG_data_sample_code | Spark/Workspace/2_Spark_Streaming/2_Stateless_Transformations/02_word_count.py | 02_word_count.py | py | 15,508 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pyspark.streaming.StreamingContext",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "pyspark.streaming",
"line_number": 111,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 145,
"usage_type": "call"
},
{
"api_name"... |
10663976037 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 4 15:43:55 2015
Plot coodinate time series for radio sources.
@author: Neo
"""
import numpy as np
import matplotlib.pyplot as plt
from fun import ADepoA, ADepoS
cos = np.cos
dat_dir = '../data/opa/'
res_dir = '../plot/timeseries/'
t0 = 2000.0
def tsplot(soun, pmra, p... | Niu-Liu/thesis-materials | sou-selection/progs/TimeseriesPlot.py | TimeseriesPlot.py | py | 1,827 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.cos",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.loadtxt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "fun.ADepoA",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "fun.ADepoS",
"line_number... |
25047209667 | from rest_framework import status
from rest_framework.generics import get_object_or_404
from rest_framework.views import APIView
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from .models import Profile, Subject, Lesson, Screenshot
from .permissions import EditingF... | vnkrtv/screenshots-loader | backend/app/api/views.py | views.py | py | 5,190 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "models.Profile.objects.all",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.Profile.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
... |
3685311565 | # coding: utf-8
import collections
import os
try:
import StringIO
except:
from io import StringIO
import sys
import tarfile
import tempfile
import urllib
import numpy as np
from PIL import Image, ImageDraw
import collections
import tensorflow as tf
import random
if tf.__version__ < '1.5.0':
raise Impor... | MatthieuBlais/tensorflow-clothing-detection | background.py | background.py | py | 3,761 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "tensorflow.__version__",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.new",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "numpy.array",
... |
35132573715 | import itertools
from abc import ABCMeta
import numpy as np
import tensorflow as tf
import gin.tf
from datasets.raw_dataset import RawDataset
from datasets import dataset_utils
from layers.embeddings_layers import ObjectType
class SamplingDataset(RawDataset, metaclass=ABCMeta):
pass
@gin.configurable(blacklist... | Dawidsoni/relation-embeddings | src/datasets/sampling_datasets.py | sampling_datasets.py | py | 9,287 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datasets.raw_dataset.RawDataset",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "abc.ABCMeta",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "datasets.raw_dataset.RawDataset",
"line_number": 17,
"usage_type": "name"
},
{
"api_n... |
72644950504 | import os
import subprocess
from itertools import chain
from pathlib import Path
import pytest
from netCDF4 import Dataset
from pkg_resources import resource_filename
from compliance_checker.cf import util
from compliance_checker.suite import CheckSuite
def glob_down(pth, suffix, lvls):
"""globs down up to (lvl... | ioos/compliance-checker | compliance_checker/tests/conftest.py | conftest.py | py | 2,919 | python | en | code | 92 | github-code | 36 | [
{
"api_name": "itertools.chain",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pkg_resources.resource_f... |
72432170665 | import numpy as np
import cv2
STAGE_FIRST_FRAME = 0
STAGE_SECOND_FRAME = 1
STAGE_DEFAULT_FRAME = 2
kMinNumFeature = 1500
orb = cv2.ORB_create()
lk_params = dict(winSize = (21, 21),
#maxLevel = 3,
criteria = (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 30, 0.01))
############## Edit this porti... | aswinsbabu/visual-odometry | test_folder/odometry/sift_odometry.py | sift_odometry.py | py | 5,990 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "cv2.ORB_create",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.TERM_CRITERIA_EPS",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.TERM_CRITERIA_COUNT",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": ... |
21671571550 | import os
import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
import numpy as np
class Basset(nn.Module):
"""
This model is also known to do well in transcription factor binding.
This model is "sha... | wukevin/rnagps | rnagps/models/basset_family.py | basset_family.py | py | 6,034 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "torch.backends",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.backends",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",... |
36059095725 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import torch as torch
# In[2]:
import torch.nn as nn
import pandas as pd
from torch.autograd import Variable
from sklearn.model_selection import train_test_split
from torch.utils.data import DataLoader, TensorDataset
# In[3]:
df = pd.read_csv("yoochoose-clicks.d... | fahadkh2019/Capstone_Project | LSTM Modeling-updated.py | LSTM Modeling-updated.py | py | 4,722 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.from_numpy",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "torch.from_numpy",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "torch.from_numpy",
... |
71873731623 | import pygame
from Helper.global_variables import *
from Helper.text_helper import drawTextcenter, drawText
pygame.init()
def update_display(win, height, color_height, numswaps, algorithm, number_of_elements, speed, time, running):
win.fill(BLACK)
# call show method to display the list items
s... | andreidumitrescu95/Python-Sorting-Algorithm-Visualizer | Display/display.py | display.py | py | 2,692 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.draw.line",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.line",
"... |
36375251491 | from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from moderation.moderator import GenericModerator
from moderation.tests.apps.test_app1.models import UserProfile,\
ModelWithModeratedFields
from moderation.tests.utils.testsettingsmanager import SettingsTestCase
from moderatio... | arowla/django-moderation | src/moderation/tests/acceptance/exclude.py | exclude.py | py | 4,091 | python | en | code | null | github-code | 36 | [
{
"api_name": "moderation.tests.utils.testsettingsmanager.SettingsTestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "moderation.moderator.GenericModerator",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "moderation.tests.utils.setup_moderation",
"... |
28356972055 |
import logging
import sys
from kodi_interface import KodiObj
LOGGING = logging.getLogger(__name__)
def get_input(prompt: str = "> ", choices: list = [], required = False) -> str:
ret_val = input(prompt)
if choices:
while not ret_val in choices:
print(f'Invalid selection. Valid entr... | JavaWiz1/kodi-cli | kodi_help_tester.py | kodi_help_tester.py | py | 2,077 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.ERROR... |
36830593270 | #!/usr/bin/python3
# 涉及对象的定义过程,不能交互式执行,需要放入.py代码文件中执行。
# 导入LCD数字,滑块,部件,Box布局,Q程序,网格布局
from PySide2.QtWidgets import QLCDNumber, QSlider, QWidget, QVBoxLayout, QApplication, QGridLayout
# 导入Qt库
from PySide2.QtCore import Qt
class MyLCDNumber(QWidget): # 创建LCD数字显示器类
def __init__(self, parent=None): ... | oca-john/Python3-xi | Pyside2/1.pyside2.4.widget.def.py | 1.pyside2.4.widget.def.py | py | 2,141 | python | zh | code | 0 | github-code | 36 | [
{
"api_name": "PySide2.QtWidgets.QWidget",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PySide2.QtWidgets.QLCDNumber",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QSlider",
"line_number": 14,
"usage_type": "call"
},
{
"a... |
32442603242 | import sqlite3
conn = sqlite3.connect('bancodedados.db')
cursor = conn.cursor()
#variaveis gerais
usuario_logado = ""
#cria tabelas
def modularTable():#Victor
clear()
tabela = int(input('\nBem vindo ao sistema Meditech\nPrimeiramente adicione os modulos com que deseja trabalhar\n\n1 - funcionarios\n2 - Veicul... | victorhnogueira/esof_sistema_gerencimento_hospitalar | setup.py | setup.py | py | 21,575 | python | pt | code | 1 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 2,
"usage_type": "call"
}
] |
32559830813 | import jwt
from functools import wraps
from app import request, jsonify, app
from app.use_db.tools import quarry
def token_required(f):
@wraps(f)
def _verify(*args, **kwargs):
auth_headers = request.headers.get('Authorization', '').split()
invalid_msg = {
'message': 'Invalid token... | Baral-Chief-of-Compliance/ice_tracing_software | prototype/v1/backend/authorization/decorator_for_authorization.py | decorator_for_authorization.py | py | 1,506 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "app.request.headers.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app.request.headers",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "app.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "app.json... |
11490438190 | import base64
import io
from PIL import Image
from pyzbar.pyzbar import decode
from requests_ntlm import HttpNtlmAuth
import requests
def get_js(sc, shop):
username = r'WebService'
password = 'web2018'
auth = HttpNtlmAuth(username, password)
strParam = shop + '/' + sc
list_url = r"https://ts.offp... | otitarenko/djangoqr | qrapp/decoder.py | decoder.py | py | 2,047 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests_ntlm.HttpNtlmAuth",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pyzbar.pyzbar.decode",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "PIL.Imag... |
20422548222 | import argparse
import collections
import getpass
import hashlib
import json
import os
import pickle
import requests
import time
import uuid
import urllib.parse
from datetime import datetime, timedelta
from email_validator import validate_email, EmailNotValidError
from pandas import DataFrame, to_datetime
from pytz im... | tedchou12/webull | webull/webull.py | webull.py | py | 63,799 | python | en | code | 576 | github-code | 36 | [
{
"api_name": "requests.session",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 76,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line... |
37055431378 | import asyncio
import ciberedev
# creating our client instance
client = ciberedev.Client()
async def main():
# starting our client with a context manager
async with client:
# taking our screenshot
screnshot = await client.take_screenshot("www.google.com")
# printing the screenshots u... | cibere/ciberedev.py | examples/take_screenshot.py | take_screenshot.py | py | 572 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "ciberedev.Client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "asyncio.run",
"line_number": 24,
"usage_type": "call"
}
] |
74062234985 | import pytest
from fauxcaml.semantics.check import Checker
from fauxcaml.semantics.typ import *
from fauxcaml.semantics.unifier_set import UnificationError
def test_concrete_atom_unification():
checker = Checker()
checker.unify(Int, Int)
def test_concrete_poly_unification():
checker = Checker()
che... | eignnx/fauxcaml | fauxcaml/tests/test_unification.py | test_unification.py | py | 2,419 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "fauxcaml.semantics.check.Checker",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "fauxcaml.semantics.check.Checker",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "fauxcaml.semantics.check.Checker",
"line_number": 19,
"usage_type": "cal... |
483706012 | import hashlib
import json
import os
import struct
import sys
import textwrap
from fnmatch import fnmatch
from pathlib import Path
from typing import Dict, List, Union
import cryptography
from cryptography.fernet import Fernet
if sys.version_info < (3, 8):
TypedDict = dict
else:
from typing import TypedDict
... | dihi/datavault | dihi_datavault/__init__.py | __init__.py | py | 14,958 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.version_info",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "hashlib.md5",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"li... |
39924477846 | from rest_framework import serializers
from core.models import Match
class MatchSerializer(serializers.ModelSerializer):
"""
The `season` field is read only for the external API, because we force it to
use the currently active season inside the MatchViewSet.perform_create()
method.
This means th... | dannymilsom/poolbot-server | src/api/serializers/match.py | match.py | py | 805 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "core.models.Match",
"line_number": 18,
"usage_type": "name"
}
... |
36740712303 | # coding=UTF-8
# Importamos las librerías
import sys
import os
import math
import csv
import numpy as np
from itertools import groupby
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
from matplotlib import cm
# Función que permite reiniciar el programa
def reiniciar():
pyth... | DNC87/EM-Dataset-Generator | generador_datos/main.py | main.py | py | 4,438 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "sys.executable",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.execl",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "math.sqrt",
"line_numb... |
9355826258 | import requests
import re
def check_link(url_parent, url_child):
pattern = r"href=\"(.*)\""
res = requests.get(url_parent)
if res.status_code == 200:
all_inclusions = re.findall(pattern, res.text)
else:
print("No")
return
for link in all_inclusions:
res = requests.ge... | ArtemevIvanAlekseevich/Python_course | module 3/3.3-step_6-check_link.py | 3.3-step_6-check_link.py | py | 625 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 15... |
35599138078 | from pandas import Series
from matplotlib import pyplot
from statsmodels.tsa.ar_model import AR
from sklearn.metrics import mean_squared_error
series = Series.from_csv('daily-minimum-temperatures.csv', header=0)
# split dataset
X = series.values
train, test = X[1:len(X)-7], X[len(X)-7:]
# train autoregression
model = A... | yangwohenmai/TimeSeriesForecasting | AR自回归模型/自回归模型.py | 自回归模型.py | py | 828 | python | en | code | 183 | github-code | 36 | [
{
"api_name": "pandas.Series.from_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "statsmodels.tsa.ar_model.AR",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklear... |
70295398824 | import torch
from torch import nn
from torch.utils.tensorboard import SummaryWriter
from models.convnet import ConvNet
from utils.data_loader import load_cifar10, create_dataloaders
from utils.train import train
device = 'cuda' if torch.cuda.is_available() else 'cpu'
writer = SummaryWriter('runs/exercise-2_1')
train_... | simogiovannini/DLA-lab1 | 2_1.py | 2_1.py | py | 1,300 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.tensorboard.SummaryWriter",
"line_number": 9,
"usage_type": "call"
},
{
"api_na... |
19033902872 | """Module contains functionality for parsing HTML page of a particular vulnerability."""
import re
import urllib.request
from lxml import etree
from cve_connector.vendor_cve.implementation.parsers.general_and_format_parsers\
.html_parser import HtmlParser
from cve_connector.vendor_cve.implementation.parsers.vendor... | CSIRT-MU/CRUSOE | crusoe_observe/cve-connector/cve_connector/vendor_cve/implementation/parsers/vendor_parsers/cisco_parsers/cisco_vulnerability_parser.py | cisco_vulnerability_parser.py | py | 13,807 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "cve_connector.vendor_cve.implementation.parsers.general_and_format_parsers.html_parser.HtmlParser",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "cve_connector.vendor_cve.implementation.utilities.utility_functions.get_current_date",
"line_number": 40,
"usage_ty... |
44310786559 | import serial, time, syslog, string
def scoredisp(score):
# initializes the serial port
port = '/dev/ttyACM0'
ard = serial.Serial(port,9600)
# writes the inputted score to the serial port
ard.write(str(score).encode('ascii'))
| RamboTheGreat/Minigame-Race | test.py | test.py | py | 237 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "serial.Serial",
"line_number": 7,
"usage_type": "call"
}
] |
73708087464 | """Covariance-free Partial Least Squares"""
# Author: Artur Jordao <arturjlcorreia[at]gmail.com>
# Artur Jordao
import numpy as np
from scipy import linalg
from sklearn.utils import check_array
from sklearn.utils.validation import FLOAT_DTYPES
from sklearn.base import BaseEstimator
from sklearn.pr... | arturjordao/IncrementalDimensionalityReduction | Code/CIPLS.py | CIPLS.py | py | 4,113 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sklearn.preprocessing.normalize",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.newaxis",
"line_number": 48,
"usage_type": "attribute"
},
{
"api... |
36322979415 | #! /usr/bin/env python
import sys
import pygame
import os
import argparse
import logging
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
from subprocess import Popen
from pygame.locals import *
logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)... | hreck/PyBooth | pyBooth.py | pyBooth.py | py | 7,007 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pygame.USEREVENT",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "pygame.R... |
718080167 | from re import S
import re
from django.db.models.signals import pre_init
from django.shortcuts import render
from .models import *
from .serializers import *
from django.shortcuts import render
from rest_framework import viewsets, mixins, generics
from rest_framework.views import APIView
from rest_framework.decorators ... | haydencordeiro/FoodDeliveryDjango | food/views.py | views.py | py | 20,986 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "rest_framework.views.APIView",
"line_number": 73,
"usage_type": "name"
},
{
"api_name": "rest_framewor... |
35305572933 | from flask import Flask, jsonify, request
from flask_cors import CORS
import database
app = Flask(__name__)
app.config["ERROR_404_HELP"] = False
# allow all for simplicity
CORS(app)
@app.route("/")
def landing():
return """
Hello, this is the News Article Searcher of Koen Douterloigne! <br>
Plea... | tobneok/isentia_test | server/app.py | app.py | py | 851 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.values",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
34124762528 | """
this program is a simulation of the inner planets of our solar system (namely the sun, Mercury,
Venus, Earth and Mars). The planets are objects of the class Planet which enables this class (solarSystemAnimation)
to animate them. The information of the planets can be found in the file PropertiesPlanets.
"""
i... | Platiniom64/OrbitalMotionSimulation | OrbitalMotion.py | OrbitalMotion.py | py | 11,622 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "PlanetClass.Planet",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_nu... |
19743419969 | from os import sep
from subprocess import call
import click
path_ini_alembic_file = 'app_config/config_files/alembic.ini'.replace('/', sep)
@click.group('db')
def db():
...
@db.command()
@click.option('-m', 'message', default='migração via CLI',
help='Mensagem para identificar a migrations do al... | isaquefel/ensaio_app | app_rotinas/cli/migrations_management.py | migrations_management.py | py | 760 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.sep",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "click.group",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "click.option",
"line_number"... |
17078297023 | from django.shortcuts import render
from django.core.mail import send_mail
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.conf import settings
from .forms import Contact_us_form, SupportForm
import urllib
import json
def contact_us(request):
if request.method ... | Pavlo-Olshansky/E-market | get_in_touch/views.py | views.py | py | 3,028 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "forms.Contact_us_form",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.GOOGLE_RECAPTCHA_SECRET_KEY",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 23,
"usage_type": "name... |
39763274152 | from django.conf.urls import url
from django.urls import path
from . import views
urlpatterns = [
url(r'^$', views.assignments, name='assignments'),
url(r'^addnewassignments/$', views.addnewassignments, name='addnewassignments'),
# url(r'^deleteassignments/$', views.deleteassignments, name='deleteassignment... | hafeezurrahmansaleh/Daily-Lab-Assistance | assignments/urls.py | urls.py | py | 744 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.ur... |
11538172081 | #!/usr/bin/python3
""" a module that queries API """
from requests import get
def top_ten(subreddit):
""" A function that queries the Reddit API
Args:
subreddit (str): the name of the subreddit
Returns:
str: print valid titles
"""
load = {'limit': 10}
headers = ... | Rashnotech/alx-system_engineering-devops | 0x16-api_advanced/1-top_ten.py | 1-top_ten.py | py | 737 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
}
] |
22140484347 | from django.core.exceptions import ValidationError
from django.http import HttpResponse
from django.http.response import HttpResponseForbidden, JsonResponse
from django.shortcuts import redirect, get_object_or_404
from django.template import loader
from django.views.decorators.csrf import csrf_exempt
from .models impo... | njsh4261/url_shortener | backend/url_shortener/views.py | views.py | py | 2,785 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.http.response.HttpResponseForbidden",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.template.loader.get_template",
"line_number": 17,
"usage_type"... |
74838938664 |
# environment
import sys, os
import argparse
import json
from board import Tiles, Board
from player import Player
import shape
def pprint(thing):
sys.stdout.write(thing + '\n')
sys.stdout.flush()
if __name__ == '__main__':
parser = argparse.ArgumentParser()
player = []
parser.add_argument("--... | FineArtz/Game3_Blokus | environment.py | environment.py | py | 3,602 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "sys.stdout.write",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.flush",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"l... |
73488163624 |
class Animal:
is_alive: bool = True
def breeze(self):
print("I'm breezing")
class Mammal(Animal):
leg_amount: int
kid_food_type: str = 'Milk'
def voice(self):
raise NotImplementedError
def do_bad_things(self):
raise NotImplementedError
class Cat(Mammal):
def ... | VladPetrov19/Lessons | venv/lesson_14.py | lesson_14.py | py | 2,024 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 68,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 114,
"usage_type": "name"
},
{
"api_name": "datacl... |
16583267084 | from datetime import datetime, date
from email.mime.text import MIMEText
from flask import Flask
import os
import schedule
import smtplib
import time
# import threading
from mailjet_rest import Client
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
from config import *
startupTs = dateti... | wjewell3/email | main.py | main.py | py | 6,000 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.Flask",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.date.tod... |
74833825384 | import sqlite3
import argparse
import logging
# Optional argument to use a listed database file. otherwise use vics.sqlite
# argparse with usage
# If no vics.sqlite3 then create it, and make the 'all' table.
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--file", dest="db_file", help="Optional. Path to... | fine-fiddle/vics | vics.py | vics.py | py | 1,888 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",... |
74863821545 | import json
import unittest
from api.tests.base import BaseTestCase
class TestSimulationsService(BaseTestCase):
""" Tests for the Simulation Service """
def test_simulations(self):
""" Ensure the /ping route behaves correctly. """
response = self.client.get("/simulations/ping")
data ... | door2door-io/mi-code-challenge | backend/api/tests/test_simulations.py | test_simulations.py | py | 555 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "api.tests.base.BaseTestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "unittest.main",
"line_number": 20,
"usage_type": "call"
}
] |
24797529159 | #coding=utf-8
"""
PGCNet batch data generator
two different type input :point cloud and multi-view image
__author__ = Cush shen
"""
import numpy as np
from tqdm import tqdm
import h5py
import time
import tensorflow as tf
image_color_gray = 158
image_color_white = 255
def getDataFiles(list_filenam... | conzyou/PGVNet | train_utils.py | train_utils.py | py | 19,697 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "h5py.File",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tensorflow.train.get_or_create_global_step",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "tensorflow.train",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_na... |
37986564283 | import sys
import scipy
from scipy import io
from scipy.io import wavfile
def getVolume(sound):
value = 0
for sample in sound:
value += abs(sample)
print(value)
def main():
file = sys.argv[1]
print(file)
sampling_rate, sound = scipy.io.wavfile.read(file)
getVolume(sound)
if __nam... | emilymacq/Project-Clear-Lungs | ARCHIVE/Python files/TestTemplate.py | TestTemplate.py | py | 349 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "scipy.io.wavfile.read",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_number": 15,
"usage_type": "attribute"
}
] |
822226274 | #!/usr/bin/env python
# coding: utf-8
# import all packages
from nilearn.connectome import ConnectivityMeasure
from nilearn.input_data import NiftiLabelsMasker
from load_confounds import Scrubbing
from nilearn import datasets
from os.path import join
import nibabel as nib
import numpy as np
import shutil
import os
... | PSY6983-2021/clandry_project | codes/data_prep.py | data_prep.py | py | 2,355 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nilearn.connectome.ConnectivityMeasure",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "nilearn.datasets.fetch_atlas_schaefer_2018",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "nilearn.datasets",
"line_number": 27,
"usage_type": "na... |
30793302432 | import cv2
import numpy as np
cap = cv2.VideoCapture(0)
# size = (600, 200, 3) # Указываем желаемый размер окна (высоту, ширину, число каналов)
while True:
ret, frame = cap.read() # ret - успешность захвата кадра. Если кадр был успешно захвачен, ret будет равен True. В противном случае, если что-то пошло не так и... | SeVaSe/Open_CV_test_vision | cameras&videocapture.py | cameras&videocapture.py | py | 1,671 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
"line_n... |
35842604532 | from django.urls import path
from CafeStar import views
app_name = 'CafeStar'
urlpatterns = [
path('', views.homePage, name='home_page'),
path('homePage', views.homePage, name='home_page'),
path('drinkDetail', views.drinkDetail, name='drink_detail'),
path('drinks', views.drinks, name='drinks'),
pa... | zhengx-2000/CafeStar | CafeStar/urls.py | urls.py | py | 843 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "CafeStar.views.homePage",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "CafeStar.views",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.urls... |
13784383950 | import pynmea2, serial, os, time, sys, glob, datetime
def logfilename():
now = datetime.datetime.now()
return 'datalog.nmea'
#return '/home/pi/Desktop/PiCameraApp/Source/datalog.nmea'
'''
return 'NMEA_%0.4d-%0.2d-%0.2d_%0.2d-%0.2d-%0.2d.nmea' % \
(now.year, now.month, now.day,
... | Keshavkant/RpiGeotaggedImages | GeoLogger.py | GeoLogger.py | py | 2,636 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr.write",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.stder... |
37393448771 | # Dependencies
import json
# Get influencer criteria from config.json file
config_file = open('config.json')
config = json.load(config_file)
influencer = config['influencer']
def is_influencer(tweet):
""" Determines if an user who tweeted a tweet is an influencer """
rts = tweet['retweet_count']
fav = tweet['... | janielMartell/twitter-influencer-scraper | utils.py | utils.py | py | 860 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
}
] |
25422749814 | from util import get_history_identifier, get_user_identifier, calculate_num_tokens, calculate_num_tokens_by_prompt, say_ts, check_availability
from typing import List, Dict
class GPT_4_CommandExecutor():
"""GPT-4を使って会話をするコマンドの実行クラス"""
MAX_TOKEN_SIZE = 8192 # トークンの最大サイズ
COMPLETION_MAX_TOKEN_SIZE = 2048 #... | sifue/chatgpt-slackbot | opt/gpt_4.py | gpt_4.py | py | 4,222 | python | ja | code | 54 | github-code | 36 | [
{
"api_name": "typing.Dict",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "util.get_history_identifier",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "util.get_user_ide... |
39060336799 | from obspy import read
from numpy import genfromtxt,sin,cos,deg2rad,array,c_
from matplotlib import pyplot as plt
n=read(u'/Users/dmelgar/kestrel/BRIC/BRIC.BK/BYN.00.D/BRIC.BK.BYN.00.D.2016.232')
e=read(u'/Users/dmelgar/kestrel/BRIC/BRIC.BK/BYE.00.D/BRIC.BK.BYE.00.D.2016.232')
z=read(u'/Users/dmelgar/kestrel/BRIC/BRIC... | Ogweno/mylife | kestrel/plot_data.py | plot_data.py | py | 1,542 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "obspy.read",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "obspy.read",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "obspy.read",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 1... |
5501591657 | ### IMPORT THE REQUIRED LIBRARIES
# To read the dataset in .mat format
import scipy.io as sio
# For matrix operations
import numpy as np
# Keras functions to create and compile the model
from keras.layers import Input, Conv2D, Lambda, Reshape, Multiply, Add, Subtract
from keras.activations import relu
from keras.opt... | hansinahuja/ISTA-Net | ista_net.py | ista_net.py | py | 11,288 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_numbe... |
9786188527 | import cv2
import numpy as np
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.interpolation import map_coordinates
def threshold_normalize(data,transform):
threshold = 254
maxVal = 255
ret, thresh = cv2.threshold(np.uint8(data), threshold, maxVal, cv2.THRESH_BINARY)
if transform:
copy = th... | sheldon-benard/DigitClassification | 551-project/preprocessing.py | preprocessing.py | py | 1,107 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.threshold",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_BINARY",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
... |
74752046504 | from lxml import etree
import unittest
from unittest.mock import MagicMock, patch
from lib.parsers.parseOCLC import readFromClassify, loadEditions, extractAndAppendEditions
from lib.dataModel import WorkRecord
from lib.outputManager import OutputManager
class TestOCLCParse(unittest.TestCase):
@patch.object(Outpu... | NYPL/sfr-ingest-pipeline | lambda/sfr-oclc-classify/tests/test_parseOCLC.py | test_parseOCLC.py | py | 1,821 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "unittest.mock.MagicMock",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lxml.etree.Element",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lxm... |
74506400423 | from rest_framework import serializers
from onbici.bike.serializers import BikeSerializer
from onbici.bike.models import Bike
from onbici.station.models import Station
from .models import Slot
class SlotSerializer(serializers.ModelSerializer):
bike = BikeSerializer(required=False)
class Meta:
model =... | jubelltols/React_DRF_MySql | DRF/src/onbici/slot/serializers.py | serializers.py | py | 2,029 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "onbici.bike.serializers.BikeSerializer",
"line_number": 9,
"usag... |
16528708499 | from pywebio.input import *
from pywebio.output import *
from pywebio import start_server
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
import io
def data_gen(num=100):
"""
Generates random samples for plotting
"""
a = np.random.normal(size=num)
return a
def plot_raw(a):... | tirthajyoti/PyWebIO | apps/matplotlib_demo.py | matplotlib_demo.py | py | 1,955 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "numpy.random.normal",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.close",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplot... |
74588531623 | # coding=utf-8
__author__ = "Arnaud KOPP"
__copyright__ = "© 2015-2016 KOPP Arnaud All Rights Reserved"
__credits__ = ["KOPP Arnaud"]
__license__ = "GNU GPL V3.0"
__maintainer__ = "Arnaud KOPP"
__email__ = "kopp.arnaud@gmail.com"
__status__ = "Production"
from collections import OrderedDict
import logging
import panda... | ArnaudKOPP/BioREST | BioREST/Fasta.py | Fasta.py | py | 8,602 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "pylab.title",... |
40983404414 | """new fileds are added user
Revision ID: 7758fd2f291e
Revises: 5444eea98e3f
Create Date: 2019-05-03 01:12:53.120773
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7758fd2f291e'
down_revision = '5444eea98e3f'
branch_labels = None
depends_on = None
def upgra... | ShashwatMishra/Mini-Facebook | Mini Facebook/migrations/versions/7758fd2f291e_new_fileds_are_added_user.py | 7758fd2f291e_new_fileds_are_added_user.py | py | 911 | python | en | code | 1 | github-code | 36 | [
{
"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.String"... |
34564583000 | import logging
import os
from datetime import date
from pathlib import Path
from ._version import get_versions
from .watchdog import Watchdog
# Environment variables and if they are required
ENVIRONMENT_VARS = {
"TZ": False,
"INFLUXDB_HOST": False,
"INFLUXDB_PORT": False,
"INFLUXDB_DATABASE": False,
... | afonsoc12/intrusion-monitor | intrusion_monitor/__init__.py | __init__.py | py | 5,669 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "_version.get_versions",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "logging.error",
"... |
26090415788 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from collections import defaultdict
from basic.bupt_2017_11_28.type_deco import prt
import joblib
from sklearn import preprocessing
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from basic.bupt_2017... | Mr-cpc/idea_wirkspace | learnp/basic/bupt_2018_1_19/mxpoontheline.py | mxpoontheline.py | py | 1,897 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "basic.bupt_2018_1_19.unionfind.UF",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "basic.bupt_2018_1_19.unionfind.UF",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 48,
"usage_type": "call"
}... |
29291642217 | import numpy as np
import statsmodels.api as sm
import pandas as pd
alpha = 0.05
df = pd.read_excel("4_6.xlsx", header=None)
y = df.values # 提取数据矩阵
y = y.flatten()
a = np.array(range(1, 8))
x = np.tile(a, (1, 10)).flatten()
d = {'x': x, 'y': y} # 构造字典
model = sm.formula.ols("y~C(x)", d).fit() # 构建模型
anovat = sm.sta... | BattleforAzeroth/MMHomework | 4.6.py | 4.6.py | py | 565 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_excel",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.tile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "statsmodels.api.formula.ols",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.