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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2505498450 |
import psycopg2
hostname = 'localhost'
database = 'demo'
username = 'postgres'
pwd = '12345'
port_id = 5432
conn = None
cur = None
conn = psycopg2.connect(host= hostname,
port = port_id,
dbname = database,
user = username,
password = pwd)
cur = conn.cursor()
create_script = ''' CREATE TABLE T_emp... | ELFAHIM96/Python-and-PostgreSQL | Postgre2python.py | Postgre2python.py | py | 722 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "psycopg2.connect",
"line_number": 14,
"usage_type": "call"
}
] |
34855863470 | from abc import abstractmethod
from .base_autoencoder import BaseAutoencoder
import tensorflow as tf
import numpy as np
import time
from .utils import compute_mmd
class BaseInfoVariationalAutoencoder(BaseAutoencoder):
def __init__(self, input_dims, latent_dim, hidden_dim=1024, alpha=0.1):
super(BaseInfoVariation... | KienMN/Autoencoder-Experiments | autoencoders/info_vae.py | info_vae.py | py | 4,251 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "base_autoencoder.BaseAutoencoder",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": ... |
3476101470 | # -*- coding: utf-8 -*-
"""
Trains and tests a Rolling Bayesian Ridge Regression model on data
@author: Nick
"""
import warnings
import numpy as np
import pandas as pd
from sklearn.pipeline import Pipeline
from sklearn.feature_selection import VarianceThreshold
from sklearn.preprocessing import MinMaxScal... | N-ickMorris/Time-Series | crime_rolling_lasso.py | crime_rolling_lasso.py | py | 2,646 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line... |
8699137278 | # -*- coding: utf-8 -*-
import json
import pymongo
import re
import scrapy
from scrapy import Request, FormRequest
import logging
import redis
from sqlalchemy import create_engine
import pandas as pd
from sandbox.items import SXRItem,XZCFItem
from sandbox.utility import get_header
# get
class WebGetSpider(scrapy.Spid... | Rockyzsu/image_recognise | xinyong_shenzhen/sandbox/sandbox/spiders/website.py | website.py | py | 7,699 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "scrap... |
6022783824 | import time
import multiprocessing
from functools import partial
from app import App
CPU_COUNT = 4 # multiprocessing.cpu_count()
TEST_TIME = 60 * 1
def run_application(index: int, test_time: int) -> int:
print("Starting application:", index)
app = App()
app.start()
# queue_sizes = []
for i in ... | EvgeniiTitov/naive-events-processing | run_app_multicore.py | run_app_multicore.py | py | 889 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "app.App",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "app.start",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "app.stop",
"line_number": 22,
"u... |
28147315416 | import os
import sys
import json
import unittest
sys.path.append("../get_job/")
import jobs
class TestDB(unittest.TestCase):
def setUp(self):
self.job_db = jobs.JobDB()
self.job_db.dbFile = "data_test.json"
def test_readData(self):
""" Test loading data """
self.job_db.readDat... | SV3A/Jobbi | tests/jobs_tests.py | jobs_tests.py | py | 2,972 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "jobs.JobDB",
"l... |
11404152952 | import pandas as pd
from tqdm import tqdm
from gensim.models import Doc2Vec
from sklearn import utils
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from gensim.models.doc2vec import TaggedDocument
import matplotlib.pyplot as plt
import nltk
import multiprocessi... | kschutter/SarcasmDetection | src/logisticReg.py | logisticReg.py | py | 2,982 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tqdm.tqdm.pandas",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "multiprocessing.cpu_count",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplo... |
70365065314 | from flask import Flask, jsonify, request
from flask_cors import CORS
from note import models as note_model
app = Flask(__name__)
app.config['JSON_AS_ASCII'] = False
CORS(app, supports_credentials=True)
@app.before_request
def __db_connect():
note_model.db.connect()
@app.teardown_request
def _db_close(exc):
... | HyperionD/api | api.py | api.py | py | 2,625 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "note.models.db.connect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "note.models.db",
... |
36921040940 | import requests, os, json, time, argparse, threading, urllib
from bs4 import BeautifulSoup
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def create_job(result):
from pandas.io.json import json_normalize
try:
address = result['jobLocation']['address']['addressLocali... | sdf94/jobsearchtool | jobsearch/jobsearch/glassdoor.py | glassdoor.py | py | 3,299 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pandas.io.json.json_normalize",
"line_number": 10,
"usage_type": "call"
},
{
"api_... |
13043003078 | from iotile.core.utilities.paths import settings_directory
import sqlite3
import os.path
import sys
import os
class SQLiteKVStore:
"""A simple string - string persistent map backed by sqlite for concurrent access
The KeyValueStore can be made to respect python virtual environments if desired
"""
Def... | iotile/coretools | iotilecore/iotile/core/utilities/kvstore_sqlite.py | kvstore_sqlite.py | py | 2,544 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "iotile.core.utilities.paths.settings_directory",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.prefix",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "sys.base_prefix",
"line_number": 24,
"usage_type": "attribute"
},
{
... |
37919203191 | from django.utils import timezone
import math
from rest_framework.response import Response
from typing import List
from discordoauth2.models import User
from ranked.models import EloHistory, GameMode, Match, PlayerElo
from .elo_constants import N, K, R, B, C, D, A
def validate_post_match_req_body(body: dict, players_... | SecondRobotics/SecondWebsite | ranked/api/lib.py | lib.py | py | 6,502 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "rest_framework.response.Response",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 23,
"usage_type": "ca... |
11735587857 | import pyrebase
import matplotlib.pyplot as plt
firebaseConfig = {"apiKey": "AIzaSyCfuQ46q09FozGesUxT3ZakA_7XhGrnrUM",
"authDomain": "fir-course-56a13.firebaseapp.com",
"projectId": "fir-course-56a13",
"storageBucket": "fir-course-56a13.appspot.com",
"messagingSenderId": "447378702514",
"appId": "1:44737870... | ifran-rahman/Python-Firebase | pythonProject/main.py | main.py | py | 2,608 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyrebase.initialize_app",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 92,
"usage_type": "name"
},
{
"api_name": "mat... |
30335073768 | from django.shortcuts import render
from django.template import loader
from django.http import HttpResponse
import psycopg2
# Create your views here.
def init(request):
try:
conn = psycopg2.connect(
database = 'djangotraining',
host = 'localhost',
user = 'djangouser',
passwo... | RickBadKan/42-mini-piscina | list05/ex02/views.py | views.py | py | 2,598 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "psycopg2.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "psy... |
29966016525 |
import types
import pickle
import os
import numpy as np
import pathlib
import pdb
import scipy.io as sio
import copy
from do_mpc.tools import load_pickle, save_pickle
import types
import logging
from inspect import signature
from typing import Union
class DataHandler:
"""Post-processing data created from a sampl... | do-mpc/do-mpc | do_mpc/sampling/_datahandler.py | _datahandler.py | py | 14,004 | python | en | code | 729 | github-code | 1 | [
{
"api_name": "copy.copy",
"line_number": 153,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 173,
"usage_type": "name"
},
{
"api_name": "types.FunctionType",
"line_number": 173,
"usage_type": "attribute"
},
{
"api_name": "types.BuiltinFuncti... |
18638555644 | # reference -https://towardsdatascience.com/machine-learning-nlp-text-classification-using-scikit-learn-python-and-nltk-c52b92a7c73a
from sklearn.feature_extraction.text import CountVectorizer,TfidfTransformer
count_vect = CountVectorizer(lowercase = False, ngram_range = (1,2), max_df=0.95)
tfidf_transformer = TfidfTra... | devanshi16/hackerRank-NLP | byte-the-correct-apple.py | byte-the-correct-apple.py | py | 1,728 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.TfidfTransformer",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sklearn.naive_bayes.MultinomialNB",
"line_numb... |
3553966386 | from __future__ import print_function
import pyaudio
from ibm_watson import SpeechToTextV1
from ibm_watson.websocket import RecognizeCallback, AudioSource
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from threading import Thread
import configparser
import time
import json
import requests
from requests... | omboido/telefone_sem_fio | dic.py | dic.py | py | 5,238 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "ibm_cloud_sdk_core.authenticators.IAMAuthenticator",
"line_number": 36,
"usage_type": "call"
},
... |
7898200713 | from django.shortcuts import render
from .models import Product, OrderProduct, Department
from django.http import HttpResponse
from django.template import loader
import heapq
from operator import itemgetter
# server functions
def ticket_promedio():
order_products = OrderProduct.objects.all()
orders = {}
f... | PaulaGonzalez01/SalesHistory | sales_history/views.py | views.py | py | 2,968 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.OrderProduct.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.OrderProduct.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "models.OrderProduct",
"line_number": 11,
"usage_type": "name"
},
{
... |
39409212934 | import cv2
import face_recognition
import put_chinese_text
import time
VIDEO_DIR = 'hamilton_clip.mp4'
resize_ratio = 0.5
input_video = cv2.VideoCapture(VIDEO_DIR) # 读取视频文件
length = int(input_video.get(cv2.CAP_PROP_FRAME_COUNT)) #视频帧数
fourcc = cv2.VideoWriter_fourcc(*'mp4v') # 视频编码器
output_video = cv2.VideoWrit... | Mikoto10032/FaceRecognition | face_recognition_in_video_file.py | face_recognition_in_video_file.py | py | 3,094 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_COUNT",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "... |
8306566749 | import sys, os, pickle
DIR = os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
sys.path.append(DIR)
from Dataset.mnist import load_mnist
from functions import *
from PIL import Image
def img_show(img):
pil_img = Image.fromarray(np.uint8(img))
pil_img.show()
def get_data():
(x_tr... | PresentJay/Deep-Learning-from-Scratch | [03]신경망/03_MNIST/01_inference-with-forward-propagation.py | 01_inference-with-forward-propagation.py | py | 1,815 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line... |
70572585953 | from django.forms import ModelForm
from django.utils.translation import gettext_lazy as _
from . import models
class LivreForm(ModelForm):
class Meta:
model = models.Livre
fields = ('titre', 'auteur', 'date_parution', 'nombre_pages','resume')
labels = {
'titre' : _('Titre'),
... | arnauldAlbert/django-model | modele/bibliotheque/forms.py | forms.py | py | 751 | python | fr | code | 0 | github-code | 1 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.gettext_lazy",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.gettext_lazy",
"line_number": 11,
"usage_type": "cal... |
7425876986 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import logging
from ..json_struct_patch import JsonStructPatch
def test_properties_diff():
local = {'rsyslog': {'facility': 2}}
template = { "rsyslog": {
"properties": {
"facility": {
"index": ... | t0ffel/validate-es-documents | src/json_diff/test/test_template.py | test_template.py | py | 2,732 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json_struct_patch.JsonStructPatch",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json_struct_patch.JsonStructPatch",
"line_number": 31,
"usage_type": "call"
},
{
... |
11726393436 | import side_by_side
import convolution
import numpy as np
from PIL import Image
from sys import argv
import math
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
def canny_img(im_init):
def gaussiano(im):
gaussian = np.ones((5,5), dtype=np.float);
gaussian[:,:] = [
... | gciruelos/imagenes-practicas | practica7/ejclase.py | ejclase.py | py | 6,141 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.ones",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "convolution.convolution",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
17422411853 | from pathlib import Path
from typing import Any, Dict, List, Union
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import yaml
from torch import Tensor
from torchmetrics import Dice, JaccardIndex
from transformers import EvalPrediction
class ComputeMetrics(object):
def __ini... | GerasimovIV/kvasir-seg | src/metrics.py | metrics.py | py | 2,666 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Union",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number":... |
19818986748 | import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
img = cv.imread("imagens/hospital2.jpg")
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
corners = cv.goodFeaturesToTrack(gray, 10, 0.05, 0.25)
for item in corners:
x, y = item[0]
cv.circle(img, (x, y), 4, (0, 0, 255), -1)
fig = plt.figure... | vitormnoel/opencv | visao-comp/extracao-goodcorners.py | extracao-goodcorners.py | py | 363 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.goodFeaturesToTrack"... |
26850595638 | import logging
from celery import shared_task
logger = logging.getLogger('error')
@shared_task
def error_logger(err, exc_info=None):
if exc_info:
exc_type, exc_obj, exc_tb = exc_info
logger.error(f'{exc_tb.tb_frame.f_code.co_filename} {exc_tb.tb_lineno} {str(err)}')
else:
logger.error... | praneshsaminathan/Django-Multi-Tenant | multiten/tasks.py | tasks.py | py | 336 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "celery.shared_task",
"line_number": 7,
"usage_type": "name"
}
] |
15429008868 | import discord
from discord.ext import commands, tasks
import requests
import json
import html
import random
# Commands for Trivia game
class triviaCommands(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def trivia(self, ctx):
mention = ctx.author.mention... | brandenphan/Pami-Bot | Commands/trivia.py | trivia.py | py | 5,230 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.... |
39285707049 | from PIL import Image, ImageEnhance, ImageOps
import PIL.ImageDraw as ImageDraw
import numpy as np
import random
class RandAugmentPolicy(object):
"""Randomly choose one of the best 25 Sub-policies on CIFAR10.
Example:
>>> policy = RandAugmentPolicy()
>>> transformed = policy(image)
Example as a Py... | PrateekMunjal/TorchAL | al_utils/autoaugment.py | autoaugment.py | py | 8,697 | python | en | code | 56 | github-code | 1 | [
{
"api_name": "numpy.random.choice",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",... |
8404044280 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Класс управления картой 2GIS.
"""
import jinja2
from . import double_gis_util
from ic.utils import extfunc
__version__ = (0, 1, 1, 1)
# Шаблон результирующего HTML документа
HTML_TEMPLATE = '''<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
... | XHermitOne/defis3 | analitic/analitic/double_gis/double_gis_map.py | double_gis_map.py | py | 5,543 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "jinja2.Template",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "jinja2.Template",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "ic.utils.extfunc.save_file_text",
"line_number": 155,
"usage_type": "call"
},
{
"api_name": "ic.u... |
40214308408 | import requests
import json
import unicodedata
from bs4 import BeautifulSoup
import os
from dotenv import load_dotenv
import time
def find_env_file(folder):
for filename in os.listdir(folder):
if filename.endswith(".env"):
return os.path.join(folder, filename)
return None
def normalize_t... | kdambrowski/Scraping_quotes_from_page | settings.py | settings.py | py | 2,140 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "unicodedata.normalize",
"lin... |
71720555874 | import pandas as pd
import streamlit as st
from st_aggrid import AgGrid, GridOptionsBuilder
from st_aggrid.shared import GridUpdateMode
STREAMLIT_AGGRID_URL = "https://github.com/PablocFonseca/streamlit-aggrid"
st.set_page_config(
layout="centered", page_icon="🖱️" , page_title="Interactive table app"
)
st.title("... | carywoods/app1 | app1_v3.py | app1_v3.py | py | 1,462 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.wr... |
30171139606 | from functools import partial, wraps
from usage_model import Redis
def init_redis(func=None, *, redis: Redis = None):
if func is None:
return partial(init_redis, redis=redis)
@wraps(func)
async def wrapper(*args, **kwargs):
if not redis.is_connected:
await redis.connect()
... | ruicore/python | 02-usecase/redis/__init__.py | __init__.py | py | 511 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "usage_model.Redis",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "functools.partial",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 10,
"usage_type": "call"
}
] |
23549497570 | import os
import re
import shutil
import subprocess
import sys
import toml
MD_ANCHOR_LINKS = r"\[(.+)\]\(#.+\)"
def slugify(s):
"""
From: http://blog.dolphm.com/slugify-a-string-in-python/
Simplifies ugly strings into something URL-friendly.
>>> print slugify("[Some] _ Article's Title--")
some... | getzola/themes | generate_docs.py | generate_docs.py | py | 6,271 | python | en | code | 53 | github-code | 1 | [
{
"api_name": "re.sub",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,
"usag... |
30243853001 | import collections
import datetime
import os
import random
import shutil
import sys
import time
import numpy as np
import torch
from PIL import Image
class AverageMeter(object):
'''
Taken from:
https://github.com/keras-team/keras
'''
"""Computes and stores the average and curren... | akwasigroch/Pretext-Invariant-Representations | utils.py | utils.py | py | 11,632 | python | en | code | 89 | github-code | 1 | [
{
"api_name": "sys.stdout",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.isatty",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 75,
"usage_type": "attribute"
},
{
"api_name": "sys.modules",
"... |
75065182433 | __all__ = [
"calc",
]
import copy
import json
import logging
from pathlib import Path
import pickle as pk
from typing import NoReturn, Optional, Tuple
import numpy as np
import torch
from torch import Tensor
from torch.utils.data import DataLoader
from . import _config as config
from . import dirs
from . import... | ZaydH/target_identification | fig01_cifar_vs_mnist/poison/influence_func.py | influence_func.py | py | 12,090 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "typing.Optional... |
32259577603 | import copy
import threading
import socketserver
import json
from typing import List
from mcsu_data import *
_BUFFER_SIZE = 1024
_CLIENTS_MAX = 8
class State:
def __init__(self):
self.userdata = DataGame(0, [])
self.uid_free = []
self.uid = 0
self.lock = threading.Semaphore()
... | JacobLondon/mcsu2 | mcsu_server.py | mcsu_server.py | py | 6,444 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "threading.Semaphore",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "socketserver.ThreadingTCPServer",
"line_number": 77,
"usage_type": "attribute"
},
{
"api_name":... |
27214350964 | import numpy as np
import time
import uuid
from models.Basic import Basic
from gurobipy import *
class FairIR(Basic):
"""Fair paper matcher via iterative relaxation.
"""
def __init__(self, loads, loads_lb, coverages, weights, thresh=0.0):
"""Initialize.
Args:
loads - a list... | iesl/fair-matching | src/models/FairIR.py | FairIR.py | py | 12,878 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "models.Basic.Basic",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "numpy.size",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.size",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number... |
71187185633 | import gym
class GymSpec:
def __init__(self, name, env_id):
self.name = name
self.env_id = env_id
GYM_ENVS = [
GymSpec('gym_CartPole-v0', 'CartPole-v0'),
GymSpec('gym_CartPolev-1', 'CartPole-v1'),
]
def gym_env_by_name(name):
for cfg in GYM_ENVS:
if cfg.name == name:
... | Garytoner/Asynchronous-Reinforcement-Learning | Asynchronous_Reinforcement_Learning/envs/gym/gym_utils.py | gym_utils.py | py | 518 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "gym.make",
"line_number": 24,
"usage_type": "call"
}
] |
69890623394 | import requests
from django.shortcuts import redirect, render
from animal.models import Siliao,Zhongzhu,Peizhong,Renjian,Fenmian,Caijing,Xingweiy
from django.http import JsonResponse
from django.db.models import Q
from django.http import HttpResponse, HttpResponseRedirect
from animal.models import Site_Info, User
from ... | yurooc/Breed-pigs-Management-system | animalManage/views.py | views.py | py | 9,322 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.shortcuts.render",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
24887452366 | import os
import json
import aloe
from werkzeug.datastructures import MultiDict
from nose.tools import assert_equals
import flask_login
import sqlalchemy
from app import app
from app.database import db
from app.models.university import University, UniversityPending
from ..steps import fieldname_with_language
f... | jamesfowkes/golden-futures-site | aloe-test/features/university-features/university_steps.py | university_steps.py | py | 7,482 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "werkzeug.datastructures.MultiDict",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "app.models.university.University.is_translatable",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "app.models.university.University",
"line_number": 31,
... |
34498271094 | """add geographic name table
Revision ID: 4d1ddc1ec574
Revises: 36d2a94e6894
Create Date: 2020-11-09 13:45:37.277092
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4d1ddc1ec574'
down_revision = '36d2a94e6894'
branch_labels = None
depends_on = None
def upgra... | ThreeSixtyGiving/360insights | migrations/versions/4d1ddc1ec574_add_geographic_name_table.py | 4d1ddc1ec574_add_geographic_name_table.py | py | 1,135 | python | en | code | 0 | github-code | 1 | [
{
"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.Strin... |
25224482568 | import logging
# import gevent
import asyncio
from typing import Optional
from xbox.sg.crypto import PKCS7Padding
from xbox.sg.utils.events import Event
from xbox.auxiliary import packer
from xbox.auxiliary.packet import aux_header_struct, AUX_PACKET_MAGIC
from xbox.auxiliary.crypto import AuxiliaryStreamCrypto
from x... | OpenXbox/xbox-smartglass-core-python | xbox/auxiliary/relay.py | relay.py | py | 4,650 | python | en | code | 71 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "asyncio.StreamReader",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "typing.Op... |
69905287713 | """
Entry point for the DB Load dispatcher based on scheduler events.
"""
import json
import queue
import uuid
from concurrent import futures
from typing import Any, Callable, Dict, List
from google.cloud import pubsub_v1
from common import settings as CFG
from common.data_representation.config import ConfigExceptio... | JarosBaumBolles/platform | dispatcher/db_load_meters_data_dispatcher.py | db_load_meters_data_dispatcher.py | py | 20,905 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dispatcher.base_dispatcher.BaseDispatcher",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "common.settings.ENVIRONMENT_TIME_ZONE",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "common.settings",
"line_number": 30,
"usage_type": "... |
12624694803 | from flask import Blueprint
from flask_restful import Api
from .resources import PersonResource, PersonIdResource, PostUserResource, PostAccountResource, GetAccountResource, GetAccountIdResource
bp = Blueprint("restapi", __name__, url_prefix="/api")
api = Api(bp)
def init_app(app):
api.add_resource(PersonResour... | danielfernandow/Ies-Bank | bank/blueprints/restapi/__init__.py | __init__.py | py | 678 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "resources.PersonResource",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "resource... |
37756167576 | class employee:
no_of_emp=0
percent=1.04
def __init__(self,first,last,pay):
self.fname=first
self.lname=last
self.pay=pay
self.mail=self.fname+self.lname+'@veoneer.com'
employee.no_of_emp+=1
def raise_amount(self):
self.pay=int(self.pay*self.percent)
d... | subhash-regati/practice_project | practice1.py | practice1.py | py | 2,310 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.date",
"line_number": 74,
"usage_type": "call"
}
] |
29727773984 | """
Various utility functions, probably mostly for plotting.
"""
from collections import OrderedDict
import pandas as pd
from .pymcGrowth import GrowthModel
def reformatData(dfd, alldoses, alldrugs, drug, params):
"""
Sample nsamples number of points from sampling results,
Reformat dataframe so that colum... | meyer-lab/ps-growth-model | grmodel/utils.py | utils.py | py | 2,238 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "collections.OrderedDict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pand... |
3945339864 | #!/usr/bin/python
import web
import smbus
import math
urls = (
'/', 'index'
)
import time
#Hard iron offsets
x_offset = -618.954
y_offset = 733.05
# Power management registers
power_mgmt_1 = 0x6b
power_mgmt_2 = 0x6c
gyro_scale = 131.0
accel_scale = 16384.0
address = 0x68 # This is the address value read via... | brewerdaniel/Minerva | arduino/Orientation/server.py | server.py | py | 4,542 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "smbus.SMBus",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "math.atan2",
"line_number": 75,
... |
20255659902 | import numpy as np
from PIL import Image
from progress.bar import Bar
# (parameter), point
def ikeda(u):
def a(p):
x, y = p
t = 6.0/((x**2)+(y**2)+1)
c = np.cos(t)
s = np.sin(t)
return (1+u*((x*c)-(y*s)), u*((x*s)+(y*c)))
return a
# size, range, point
def toidx(size, R,... | OneAndZero24/ikeda | ikeda.py | ikeda.py | py | 1,572 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.cos",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.round",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.round",
"line_number": 23,
... |
11053554578 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from environments.mc_model.mc_environment import MonteCarloEnv
from collections import defaultdict
import pickle
def heatmap_Q(Q_tab, file_path=None, skip_T=False):
"""
generates a heatmap based on Q_tab
Paramete... | KodAgge/Reinforcement-Learning-for-Market-Making | code/utils/mc_model/plotting.py | plotting.py | py | 8,201 | python | en | code | 85 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "numpy.unravel_index",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas... |
37441104113 | from random import randint
from time import sleep
import colorama
from colorama import Fore, Style
from multiprocessing import Process
print(Fore.BLUE + Style.BRIGHT)
game_open = """
------------------------------------------------------------------------
---------------------------------------------------------------... | PrairieWaltz/AviGame | avigame.py | avigame.py | py | 3,779 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "colorama.Fore.BLUE",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "colorama.Style.BRIGHT",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "coloram... |
39366146128 | import json, os
from PyQtX import QtWebKitWidgets, QtCore, QtWidgets, QtWebKit
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, view):
super(MainWindow, self).__init__()
self.installEventFilter(self)
self.view = view
self.setCentralWidget(view)
def eventFilter(self, object, event):
if event.... | kpj/WebWrapper | python/gui.py | gui.py | py | 2,402 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "PyQtX.QtWidgets.QMainWindow",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "PyQtX.QtWidgets",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PyQtX.QtCore.QEvent",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name"... |
28672285057 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import platform
import sys
import typing
import numpy as np
import pandas as pd
import tensorflow as tf
sys.path.append(".")
import delay
import delay.agents
import delay.core
tf.disable_eager_execution()
keras = tf.keras
if typing.TYPE_CHECKING:
from typ... | kmdict/FollowTheProphet | examples/delay_tencent2017.py | delay_tencent2017.py | py | 4,611 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.disable_eager_execution",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tens... |
14778728267 | import sqlalchemy
from sqlalchemy.orm import sessionmaker
import json
from models import create_tables, Publisher, Book, Shop, Stock, Sale
if __name__ == '__main__':
DSN = 'postgresql://postgres:postgres@localhost:5432/netology_db'
engine = sqlalchemy.create_engine(DSN)
create_tables(engine)
Session... | Stelihon/SQL6 | main.py | main.py | py | 1,254 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.create_tables",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 13,
"usage_type": "call"
},
{
"api_name... |
30003130370 | #!/usr/bin/env python3
import os, sys, logging, subprocess, json, traceback
def main():
s = Setup()
s.interpret_arguments(sys.argv)
s.ensure_java_maven_exists()
s.ensure_conda_exists()
s.recreate_conda_environment()
s.install_via_pip('clingo==5.5.0.post3 jpype1==1.2.1')
s.reclone_hexlite('v1.4.0')
s.build_hex... | hexhex/hexlite-owlapi-plugin | setup_and_test_within_conda.py | setup_and_test_within_conda.py | py | 6,303 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.environ.copy",
"line_numbe... |
36043600775 | import numpy as np
np.random.seed(1)
from keras.layers import Dense
from keras.models import Sequential
import matplotlib.pyplot as plt
X = np.linspace(-1,1,200)
Y = X*0.3 +2 +np.random.normal(0,0.05,(200,))
X_train = X[:160]
X_test = X[160:]
Y_train = Y[:160]
Y_test = Y[160:]
model = Sequential(
[
Dense... | ByronGe/machine-Learning | keras/classifier_exampleTest.py | classifier_exampleTest.py | py | 895 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.random.seed",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",... |
44011211302 | import numpy as np
import matplotlib.pyplot as plt
import sys
# Define the van Leer flux limiter function
def vanLeerFunc(X):
return (X + np.abs(X)) / (1 + X)
# Define required constants
A = 4e3
R = 8.314
NA = 6.022e23
VmMolar = 1.65e-5 # m^3 mol^-1, molar volume of monomer
rmMolar = (3/4*np.pi) * po... | renjygit/FYP | Nucleation and Growth.py | Nucleation and Growth.py | py | 10,150 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.abs",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_numbe... |
21029279523 | from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("prices/", views.get_price, name="get_price"),
path("home/", views.trending_tickers_view, name="trending_tickers"),
path("new_stock/", views.new_user_stock, name="new_stock"),
]
| AirFryedCoffee/mystocksite | stocks/urls.py | urls.py | py | 309 | python | en | code | 1 | github-code | 1 | [
{
"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",
... |
22630967569 | """ Collection of general utilities """
import contextlib
import json
import logging
import os
from pathlib import Path
import shutil
import subprocess
from typing import Union
import yaml
from datalad.distribution.dataset import require_dataset
from datalad.support.exceptions import NoDatasetFound
class ConfigErro... | cbbs-md/data-pipeline | src/data_pipeline/utils.py | utils.py | py | 10,755 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "yaml.dump",
"line_number... |
28838376515 | from flask import Flask, jsonify, request
weather_data = {
'San Francisco': {'temperature': 14, 'weather': 'Cloudy'},
'New York': {'temperature': 20, 'weather': 'Sunny'},
'Los Angeles': {'temperature': 24, 'weather': 'Sunny'},
'Seattle': {'temperature': 10, 'weather': 'Rainy'},
'Austin': {'temperat... | 9802HEMENSAN/GPT-3.0 | sprint-2/pytest/pytest-whether-2/app.py | app.py | py | 2,081 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
... |
44755585332 | from django.contrib import admin
from django.urls import path
from .views import *
urlpatterns = [
path('',MaincourseListView.as_view(),name='main-course-list'),
path('explore/',courseListView.as_view(),name='course-list'),
path('create/',courseCreateView.as_view(),name='course-create'),
# path('',cour... | Floran-Github/CoderHifi-Code | backend/course/urls.py | urls.py | py | 2,548 | python | en | code | 1 | github-code | 1 | [
{
"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",
... |
24535880130 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 12 15:10:04 2021
@author: davidfordjour
"""
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
def Read_Two_Column_File(file_name):
"""Reading in the data for time and date."""
with open(file_name, 'r') as data:
x ... | davidfordjour/jog-times | jogtracker.py | jogtracker.py | py | 1,357 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "mat... |
31904766774 | from pyxavi.config import Config
from pyxavi.logger import Logger
from janitor.lib.system_info import SystemInfo
from janitor.lib.system_info_templater import SystemInfoTemplater
from janitor.lib.publisher import Publisher
from janitor.lib.mastodon_helper import MastodonHelper
from janitor.objects.queue_item import Que... | XaviArnaus/janitor | listen.py | listen.py | py | 5,150 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "janitor.objects.message.MessageType.NONE",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_n... |
25290296184 | from dataclasses import dataclass
import cv2
import math
import numpy as np
import base64
import struct
from numpy import int16, int8, uint16, uint8, uint32, int32
def drawHor(frame, theta, phi):
widAngle = 65
heiAngle = widAngle*3.0/4.0
height, width, channels = frame.shape
pm = (width/2, height/2)
... | ksklorz/ITproj | src/cam/hud.py | hud.py | py | 2,095 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "math.cos",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 17,
"usa... |
14005775602 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 12 15:42:52 2018
@author: liuyang
"""
from datetime import datetime
import numpy as np
import pandas as pd
import MYSQLPD as sql
import math
def DatetoDigit(date):
digitdate=date.year*10000+date.month*100+date.day
return digitdate
#读取交易日期列表
... | SamLiuYang/MFM | SFData.py | SFData.py | py | 3,509 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "MYSQLPD.toDF",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pandas.merge",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "MYSQLPD.toDF",
"line_nu... |
41287150445 | from django.db import models, transaction
from django.dispatch import receiver
from django.db.models.signals import post_delete
from api.espo_api_client import EspoClientMixin
from django.conf import settings
from petuni_main.celery import app
CRM_DO_NOTHING = 0
CRM_SOFT_DELETE = 1
CRM_TRUE_DELETE = 2
class CRMSign... | sdmitrievlolx/code_samples | crm/models.py | models.py | py | 5,118 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "api.espo_api_client.EspoClientMixin",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.db.models.Model",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 14,
"usage_type": "name"
},
{
"... |
26308582150 | from flask.views import MethodView
from flask_jwt_extended import jwt_required
from flask_smorest import Blueprint, abort
from db import db
from Models import NoteModel, CategoryModel
from schemas import NoteSchema, NoteQuerySchema, CategorySchema
from sqlalchemy.exc import IntegrityError
blp = Blueprint("note", __na... | NATASHKAS/backlab1 | resources/NOTES.py | NOTES.py | py | 1,775 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask_smorest.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.views.MethodView",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "Models.NoteModel.query.filter_by",
"line_number": 22,
"usage_type": "call"
},
{
"a... |
24049590178 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__authors__ = 'Bruno Adelé <bruno@adele.im>'
__copyright__ = 'Copyright (C) 2013 Bruno Adelé'
__description__ = """A metar domolib"""
__license__ = 'GPL'
__version__ = '0.0.1'
# Require metar
# pip install git+https://github.com/tomp/python-metar.git
import re
try:
... | badele/domolib | domolib/plugins/weather/dlmetar/__init__.py | __init__.py | py | 2,849 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "urllib.urlopen",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "metar.Metar.Metar",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "metar.Metar",
"line_nu... |
12168411543 | #imports csv functions
import csv
import datetime
from os import read
#Dictionary for storing products
prod_dict = {
}
#Dictionary for storing requests
req_dict = {
}
#Dictionary for the receipt
receipt_dict = {
}
number_of_items = 0
subtotal = 0
current_date_and_time = datetime.datetime.now()
# Format the cur... | Elijah3502/CSE110 | Programming with functinos/Week3/03Prove.py | 03Prove.py | py | 2,087 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "csv.reader",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "csv.reader",
... |
4565998185 |
import json
from math import e
import stat
from typing import Dict
from data.google.google_email_repository import GooleCalendarEventRepository
from services.google_auth_service import GoogleAuthService
from framework.logger import get_logger
from googleapiclient.discovery import build
from google.oauth2.credentials ... | danleonard-nj/kube-tools-api | services/kube-tools/services/calendar_service.py | calendar_service.py | py | 5,734 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "framework.logger.get_logger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "framework.serialization.Serializable",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 36,
"usage_type": "name"
},
{
"api_... |
70735133154 | import os
import pandas as pd
from joblib import Parallel, delayed
from util import get_interfaces_path, iter_cdd
NUM_WORKERS = 20
def get_counts(sfam_id):
path = os.path.join(get_interfaces_path(dataset_name), "by_superfamily",
str(int(sfam_id)), "{}_bsa.h5".format(int(sfam_id)))
store = pd.HDFStore(... | bouralab/Prop3D | Prop3D/visualize/plot_ppi_types.py | plot_ppi_types.py | py | 1,264 | python | en | code | 16 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "util.get_interfaces_path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.HDFStore",
... |
9204198406 | from django.conf.urls.defaults import *
from django.contrib.auth.models import User
from django.views.generic.simple import direct_to_template
from board.feeds import LatestPosts
from board.rpc import rpc_post, rpc_lookup, rpc_preview, rpc_ban
from board.views import *
feeds = {'latest': LatestPosts}
js_info_dict = ... | bawaaaaah/django-torrent-tracker | board/urls.py | urls.py | py | 2,676 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "board.feeds.LatestPosts",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.views.generic.simple.direct_to_template",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "board.rpc.rpc_post",
"line_number": 47,
"usage_type": "name"
},
... |
14314103404 | import numpy as np
import pandas as pd
import tensorflow as tf
import json
from keras.models import Model, Sequential
from keras.layers import Input, Activation, Dense
from keras.optimizers import SGD
from keras.utils.np_utils import to_categorical
from flask import Flask, render_template, jsonify
app = Flask(__name__... | qualityassurancetools/JSTbackprop | dota2.py | dota2.py | py | 2,924 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"li... |
22743479426 | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('monitoramento.urls')),
path('users/', include('users.urls')),
path('clientes/', include(... | joaaovitorrodrigues/trackerreine | TrackerReine/urls.py | urls.py | py | 724 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dja... |
16953372863 | from classifiers.decision_tree import DecisionTree
from collections import Counter
from utils.utility import pick_result
from random import randrange
import numpy
__author__ = 'Simon & Oskar'
class RandomForest:
def __init__(self, max_depth = None, min_samples_leaf = 1, n_estimators = 10, sample_size = 200, max... | lazi3b0y/RandomActsOfPizza | classifiers/random_forest.py | random_forest.py | py | 3,293 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.unique",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_num... |
38948168626 | from copy import copy
import itertools
from typing import List, Union
import pytest # type: ignore[import]
from testlib import on_time
from cmk.base.plugins.agent_based import job
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
clusterize,
Result,
State as state,
Metric,
type_defs,
... | superbjorn09/checkmk | tests/unit/cmk/base/plugins/agent_based/test_job.py | test_job.py | py | 17,925 | python | en | code | null | github-code | 1 | [
{
"api_name": "cmk.base.plugins.agent_based.job.Section",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "cmk.base.plugins.agent_based.job",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "cmk.base.plugins.agent_based.job.Section",
"line_number": 55,
... |
41206628067 | # Library and Modules used
import os
import cv2
import numpy as np
import customtkinter as ctk
from tkinter import *
from rembg import remove
from pathlib import Path
from threading import Thread
from datetime import datetime
from deepface import DeepFace
from PIL import Image ,ImageTk
from tkinter import ttk, filedia... | Raghvendra5448/Image_Sorter | image_sorter.py | image_sorter.py | py | 37,326 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"li... |
26987174906 | # Enter your code here. Read input from STDIN. Print output to STDOUT
if __name__ == '__main__':
n = int(input())
#print(n)
input_string = input()
numbers = list(map(int, input_string.split()))
#mean
numbersum = sum(numbers)
# print (numbersum)
mean = numbersum/n
print (mean)
#mea... | Seppel1985/HackerRank | 10_Days_of_Statistics/s10-basic-statistics.py | s10-basic-statistics.py | py | 773 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 27,
"usage_type": "call"
}
] |
5281842157 |
import shutil
import gc
import copy
import numpy
import random
import cv2
from PIL import Image, ImageDraw
import os
from functools import partial
from scipy.ndimage.filters import gaussian_filter
import time
import pickle
import re
from sklearn import preprocessing
import scipy.io as sio
from Att_BiLSTM_training impo... | mikecheninoulu/SMG | online recognition/SMG/THDutils.py | THDutils.py | py | 28,848 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "time.time",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 5... |
32939752267 | # coding=utf-8
from glob import glob
import re
from time import time
import requests
import os
# from xml.dom import minidom
from lxml import etree
import base64
import traceback
import html2text as ht #
from selenium.webdriver.chrome.options import Options
import time
from selenium import webdriver
from selenium.web... | DuanShaoCheng/csdn_jianshu_to_makedown | csdn_jianshu_to_makedown.py | csdn_jianshu_to_makedown.py | py | 8,178 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 64,
"usage_type": "name"
},
{
"api... |
15235514484 | import win32serviceutil
import win32service
import win32event
import servicemanager
import configparser
import os
import inspect
from multiprocessing import Process, Pipe
from db.sqlitemanager import SQLiteManager
from proc.node_client_process import NodeClientProcess
import utils.script_manager as sm
import utils.logg... | bensoer/vessel | node.py | node.py | py | 4,918 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "win32serviceutil.ServiceFramework",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "win32serviceutil.ServiceFramework.__init__",
"line_number": 52,
"usage_t... |
22123154667 | import unittest
from typing import List
class Solution:
def letterCombinations(self, digits: str) -> List[str]:
if digits is None or len(digits) == 0:
return []
res = [""]
alph = ["", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"]
def combine(res, str):
... | AllieChen02/LeetcodeExercise | String/P17LetterCombinationsOfAPhoneNumber/LetterCombinationsOfAPhoneNumber.py | LetterCombinationsOfAPhoneNumber.py | py | 842 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "unittest.main",
"line_number": 27,
"usage_type": "call"
}
] |
23319819904 | from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404, render
from main.models.models import Devices, Like
@login_required
def add_like(request, device_id):
user=request.user
device = get_object_or_404(Devices, pk... | MarcinzNS/mdvos-priv | mdvos/main/views/like_devices.py | like_devices.py | py | 1,887 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "main.models.models.Devices",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "main.models.models.Like.objects.filter",
"line_number": 14,
"usage_type... |
20382049470 | import time
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306
import Adafruit_LSM303
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
# Raspberry Pi pin configuration:
RST = 24
DC = 23
SPI_PORT = 0
SPI_DEVICE = 0
disp = Adafruit_SSD1306.SSD1306_128_32(rst=RST)
# Note you can change th... | pguiffr62/Engineering_4_Notebook | Python/headless.py | headless.py | py | 1,901 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Adafruit_SSD1306.SSD1306_128_32",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Adafruit_SSD1306.SSD1306_128_64",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "Adafruit_LSM303.LSM303",
"line_number": 21,
"usage_type": "call"
},
{... |
17324810580 | '''
Created on 2012/03/20
@author: hogelog
'''
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import threading
import logging
class HttpControlerHandler(SimpleHTTPRequestHandler):
def do_GET(self):
mapping = self.mapping()
path = self.path
if ... | hogelog/real-lamp | src/controler.py | controler.py | py | 1,977 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "SimpleHTTPServer.SimpleHTTPRequestHandler",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "threading.Thread",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "BaseHTTPServer.HTTPServer",
"line_number": 45,
"usage_type": "name"
},
... |
42042144582 | import sqlite3
name = input("Name of the pdgm project you are working on: ")
db = sqlite3.connect(name + ".sqlite")
cursor = db.cursor()
print("""Please enter source and target of your dependencies.
After each entry you have to confirm the entry. The question can be answered in four ways:
y - yes: Valid entry, co... | grietje/proof-dependency-graph-maker | fill.py | fill.py | py | 1,438 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlite3.connect",
"line_number": 5,
"usage_type": "call"
}
] |
29443696453 | ########################################################################################################
#
# Determinado banco possui os dados de histórico de empréstimo, vistos na tabela abaixo. Com esse dados,
# o banco solicitou que fosse construído um modelo que fornecendo os dados de entrada, indique se dev... | Grinduim/Bosch-2022.2 | Bosch/InnoHub/Treinamento de IA/materiais/Exemplos_1/NAIVE_BAYES_EXAMPLES/TREINO_DE_FUTEBOL.py | TREINO_DE_FUTEBOL.py | py | 2,980 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 25,
"usage_type": "name"
},
{
"api_nam... |
73034299553 | # _*_ coding: utf-8 _*_
import os
from datetime import datetime
from scrapy import Spider, Request
from pyquery import PyQuery as pq
class Itjuzi(Spider):
name = 'itjuzi_spider'
def start_requests(self):
meta = {}
meta['page'] = 0
meta['url'] = 'http://itjuzi.com/company?page=%d'
... | shineforever/ops | vdian_spider/python/itjuzi/itjuzi/spiders/itjuzi_spider.py | itjuzi_spider.py | py | 5,060 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "scrapy.Request",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pyquery.PyQuery",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pyquery.PyQuery",
"l... |
22837266278 | # %% [markdown]
# # Extracting attributes from timedelta columns via a ColumnTransformationPlugin
#
# inspired by Sailu and the following stackoverflow question:
# - https://stackoverflow.com/questions/38355816/pandas-add-timedelta-column-to-datetime-column-vectorized
#
# __Goal:__ extract the number of weeks as float ... | hussien-hussien/bamboolib | plugins/examples/timedelta_extract_attributes.py | timedelta_extract_attributes.py | py | 2,343 | python | en | code | null | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.to_timedelta",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "bamboolib.plu... |
12335503668 | import subprocess
import os
import csv
import sys
from sys import platform as _platform
import traceback
import argparse
import re
# Platform
os_platform = ""
if _platform == "linux" or _platform == "linux2":
os_platform = "linux"
elif _platform == "darwin":
os_platform = "macos"
elif _platform == "win32":
... | ibrahim0x20/AutoVol3 | autovol3.py | autovol3.py | py | 60,175 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.platform",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sys.platform",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sys.platform",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "sys.exit",
"line_number": ... |
8862670450 | import numpy as np
import matplotlib.pyplot as plt
black1 = np.zeros((50,50))
black2 = black1.copy()
white1 = np.ones((50,50))
white2 = white1.copy()
row1 = np.hstack((black1,white1))
row2 = np.hstack((white2, black2))
full = np.vstack((row1,row2))
plt.figure()
plt.imshow(full, cmap='gray')
plt.show() | MatanBuljubasic/OsnoveStrojnogUcenja_LV | LV2/zad4.py | zad4.py | py | 303 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number": 9,... |
19957710129 | import random
import sqlite3
def sql_create():
global db, cursor
db = sqlite3.connect("bot.sqlite3")
cursor = db.cursor()
if db:
print("База данных подключена!")
db.execute("CREATE TABLE IF NOT EXISTS anketa "
"(id INTEGER PRIMARY KEY, "
"name ... | solvur/home-works | database/bot_db.py | bot_db.py | py | 1,134 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 32,
"usage_type": "call"
}
] |
64006031 | import cv2
from pykuwahara import kuwahara
image = cv2.imread('selfie.jpg')
image = (image / 255).astype('float32') # pykuwahara supports float32 as well
lab_image = cv2.cvtColor(image, cv2.COLOR_BGR2Lab)
l, a, b = cv2.split(lab_image)
hsv_image = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)
h, s, v = cv2.split(hsv_im... | yoch/pykuwahara | examples/selfie.py | selfie.py | py | 741 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2Lab",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.split",
"line_num... |
11001989881 | # Support Vector Machine (SVM)
# from https://www.superdatascience.com/machine-learning/
# Part 1 - Data Preprocessing
# Importing the libraries
import os
import glob
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
train_dir = os.path.join(os.path.curdir, "data/train")
validation_dir = os.path.j... | amelco/webcam-eyetracking | svm.py | svm.py | py | 2,928 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
22377442955 | # Testzone para o apêndice
import apendice as ap
import matplotlib.pyplot as plt
#%% Plotando os sharp_test
## Sinal 1
vector1 = ap.sharpe_test_1(combined = combined, tam_p = 0.1, qtde = 200, inverso = True)
plt.hist(vector1.iloc[:,0], bins = 40)
plt.ylabel('Quantas vezes')
plt.xlabel('Sharpe')
plt.title('Para o S... | Insper-Data/Data_Fin_2021.1 | testzone_apendice.py | testzone_apendice.py | py | 1,176 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "apendice.sharpe_test_1",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matpl... |
9417647037 | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 17 05:15:30 2018
@author: LeeMH
"""
from bs4 import BeautifulSoup
from datetime import datetime, timedelta
import requests
import re
from utils.processor_checker import timeit
from gobble.module.crawler import Crawler
class NaverRealtimeCrawler(Crawler):
'''
네이버... | veggieavocado/Gobble-v.1 | gobble/module/naver_rt_crawler.py | naver_rt_crawler.py | py | 2,620 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "gobble.module.crawler.Crawler",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "re.findall",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "utils.processor_checker.timeit",
"line_number": 23,
"usage_type": "name"
},
{
"api_name"... |
36473075239 | from wsgiref.simple_server import make_server
import psutil,datetime
import sqlite3
def interview_scores(environ, start_response):
conn_result=sqlite3.connect("results.sqlite")
cursor_result = conn_result.cursor()
print_results = cursor_result.execute("select * from interview_results")
status = '200 O... | avikrb/PROGRAMS | Python/GUI interview program/check_scores_htlm.py | check_scores_htlm.py | py | 1,286 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "wsgiref.simple_server.make_server",
"line_number": 30,
"usage_type": "call"
}
] |
10085711322 | #!/usr/bin/python3
import os
import argparse
BASE_CMD = 'gtimeout 60 stack exec -- hplus \"{query}\" --stop-refine\
--stop-threshold=10 --cnt=5'
def main():
parser = argparse.ArgumentParser(description='Run a single hoogle+ query')
parser.add_argument('query', help='the signature to be searched'... | TyGuS/hoogle_plus | scripts/run_query.py | run_query.py | py | 442 | python | en | code | 56 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 14,
"usage_type": "call"
}
] |
8529990174 | #!/bin/python3
import os
import pandas
import argparse
import traceback
import numpy as np
from datetime import datetime, timedelta
# lisflood
import lisf1
from lisflood.global_modules.decorators import Cache
from liscal import hydro_model, templates, config, subcatchment, calibration, objective
class ScalingModel(... | ec-jrc/lisflood-calibration | bin/scaling.py | scaling.py | py | 5,307 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "liscal.objective",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "numpy.ones",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
36170474621 | # This file is Copyright 2020 Volatility Foundation and licensed under the Volatility Software License 1.0
# which is available at https://www.volatilityfoundation.org/license/vsl-v1.0
import json
import logging
import ntpath
import os
import re
from typing import List, Dict, Union
from volatility3.framewor... | volatilityfoundation/volatility3 | volatility3/framework/plugins/windows/getsids.py | getsids.py | py | 8,864 | python | en | code | 1,879 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "volatility3.framework.renderers.NotAvailableValue",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "volatility3.framework.renderers",
"line_number": 34,
"usage_type": "n... |
2494095628 | import bson
import ujson
from bson import ObjectId
from .utils import db
def retrieve_info(object_id):
# Retrieve info from DB
mongo = db.MongoDBConnection()
result = list()
with mongo:
database = mongo.connection['mydb']
collection = database['registrations']
if object_id i... | zouhanrui/AWS_Serverless_CRUD_MongoDB | Organizations_pkg/user/read/app.py | app.py | py | 2,040 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "utils.db.MongoDBConnection",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "utils.db",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "bson.ObjectId",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bson.errors",
"... |
552754902 | from flask import Flask, render_template, request, redirect, flash, session, config
from flask_debugtoolbar import DebugToolbarExtension
from surveys import satisfaction_survey as survey
app = Flask(__name__)
app.config['SECRET_KEY'] = "austin"
debug = DebugToolbarExtension(app)
responses = []
currentNum = 0
RESPONS... | austindreosch/springboard | exercises/section2/flask-session/app.py | app.py | py | 3,081 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_debugtoolbar.DebugToolbarExtension",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "surveys.satisfaction_survey.instructions",
"line_number": 21,
"usage_type": "attribute... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.