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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
418481546 | import numpy as np
from sklearn.model_selection import train_test_split
from keras import *
import tensorflow as tf
def cnn_encoder(num):
encoder_input = Input(shape=(10, 16), name=f"input_{num}")
x = layers.Conv1D(filters=16, kernel_size=3, activation='relu')(encoder_input)
x = layers.Dropout(0.3)(x)
... | null | src/cnn_lstm.py | cnn_lstm.py | py | 4,498 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "tensorflow.device",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_numbe... |
606099180 | #!/usr/local/bin/python2.7
# encoding: utf-8
'''
Test_Suite_03_OOBE_No_Beaconing
@author: ten
@create_date: Aug 6, 2019
'''
import logging
import pytest
import MobileApps.resources.const.mac.const as smart_const
from MobileApps.libs.flows.mac.smart.flows import flows_oobe
# REQUIRED
pytest.app_info = "SMART"
class... | null | tests/mac/smart/functionality/oobe/test_suite_03_oobe_no_beaconing.py | test_suite_03_oobe_no_beaconing.py | py | 1,635 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytest.app_info",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "MobileApps.libs.flows.mac.smart.flows.flows_oobe.OOBEFlows",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "MobileApps.libs.flows.mac.smart.flows.flows_oobe",
"line_numb... |
348299797 | from cn_v2.exception import *
from email_validator import validate_email, EmailNotValidError
from flask import Blueprint, request, jsonify, current_app
from flask_cors import cross_origin
from coursenotify.manager import get_watcher_manager, get_course_manager
api = Blueprint("api", __name__, url_prefix="/api")
@ap... | null | coursenotify/views/api.py | api.py | py | 4,350 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "coursenotify.mana... |
55542513 | from typing import Union, List, Tuple, Dict
from Coordinates import *
class DistanceToDestinationFinder:
"""
Advent of Code - Day 1: No time for a Taxicab
http://adventofcode.com/2016/day/1
Solves the given problem, parts 1 & 2, in a quite literal implementation
of taxicab geometry, deriving dis... | null | challenges/2016/Day 1 - No Time for a Taxicab/DistanceToDestinationFinder.py | DistanceToDestinationFinder.py | py | 6,835 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": ... |
623890233 | import numpy as np
import torch
from torch_geometric.data import Data
from torch_sparse import SparseTensor
import networkx as nx
from scipy.linalg import orthogonal_procrustes
import pdb
def convert_to_matrix(adj):
temp1 = adj[:,0]
temp2 = adj[:,1]
temp3 = np.concatenate((temp1, temp2))
idx =... | null | utils.py | utils.py | py | 4,286 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.concatenate",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.argwhere",
"line... |
443214881 | import sqlite3
import time
import constants
from models import ProjectModel, SessionModel
def create_db(db_name):
projects_table_sql = '''CREATE TABLE IF NOT EXISTS `projects` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` TEXT NOT NULL);'''
sessions_table_sql = '''CREATE TABLE IF NOT EXISTS `sessions` (
... | null | time_tracker/db.py | db.py | py | 3,911 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "constants.DATABASE_FILE",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "models.P... |
536464614 | import wx
from wx.lib.scrolledpanel import ScrolledPanel
from typing import Iterable, Union, Tuple, Any
class SimpleSizer:
def __init__(self, sizer_dir=wx.VERTICAL):
self.sizer = wx.BoxSizer(sizer_dir)
def add_object(self, obj, space=1, options=wx.ALL):
self.sizer.Add(
obj,
... | null | amulet_map_editor/amulet_wx/simple.py | simple.py | py | 3,898 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "wx.VERTICAL",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "wx.BoxSizer",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "wx.ALL",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "wx.Panel",
"line_number": ... |
31301990 | """
# HCF * LCM = product
import functools
numbers = (list(range(1, 21)))
# i could have just done 21!
mul = lambda x, y: x*y
product = functools.reduce(mul, numbers, 1)
common_factors = []
def isPrime(n):
for i in range(2, n):
if n % i == 0:
return False
return True
p_factors = []
de... | null | Smallest multiple.py | Smallest multiple.py | py | 2,208 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "functools.reduce",
"line_number": 94,
"usage_type": "call"
}
] |
79300706 | #http://pytorch.org/tutorials/beginner/nlp/deep_learning_tutorial.html
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from data_reader import read_textual_data
# STEP 0: define hyperparameters
NUM_EPOCHS = 10
LEARNING... | null | bow.py | bow.py | py | 5,597 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.manual_seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "data_reader.read_textual_data",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name": "... |
285297530 | from google.cloud import language
def map_hashtags(post):
hashtags = []
for word in post.split():
if word[0] == "#":
hashtags.append(word)
document = language.types.Document(
content=post,
type=language.enums.Document.Type.PLAIN_TEXT,
)
client = language.Langua... | null | grpc-server/hashtag/sentiment.py | sentiment.py | py | 968 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "google.cloud.language.types.Document",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "google.cloud.language.types",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "google.cloud.language",
"line_number": 9,
"usage_type": "name"
},
... |
212325442 | from django.shortcuts import render
from django.http import HttpResponseRedirect, Http404
from django.urls import reverse
from django.contrib.auth.decorators import login_required
from .models import Category, Entry
from .forms import CategoryForm, EntryForm
# Create your views here.
def index(request):
# Home ... | null | xlogs/views.py | views.py | py | 3,040 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.Category.objects.filter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "models.Category.objects",
"line_number": 20,
"usage_type": "attribute"
},
{
... |
613970941 | import numpy as np
import h5py
import glob
import time
import torch
try:
import setGPU
except:
pass
def next(a):
if hasattr(a, 'next'):
return a.next()
else:
return a.__next__()
# generator for hdf5 data files
class HDF5generator():
def __init__(self, data_files, batch_size, num_events=Non... | null | loaders/HDF5torch.py | HDF5torch.py | py | 8,030 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.cat",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 85,
... |
41951983 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 19 20:30:58 2016
@author: john
"""
import os
from keras.models import Sequential
from keras.layers.core import Flatten, Dense, Dropout
from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D
from keras.optimizers import SGD
import cv2, numpy as n... | null | ai/run_an.py | run_an.py | py | 4,456 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequential",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "keras.layers.conv... |
416218489 | from flask import Blueprint
from .._query import execute_query, QueryBuilder
from .._validate import extract_integers, extract_strings, require_all
# first argument is the endpoint name
bp = Blueprint("nowcast", __name__)
alias = None
@bp.route("/", methods=("GET", "POST"))
def handle():
require_all("locations"... | null | src/server/endpoints/nowcast.py | nowcast.py | py | 894 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "_validate.require_all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "_validate.extract_strings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "_valid... |
540079803 | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
import json
import subprocess
from time import sleep
from collections import defaultdict
import pytest
import requests
import common
from datadog_checks.couch import CouchDb
@pytest.fixture
def aggre... | null | couch/tests/conftest.py | conftest.py | py | 3,313 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datadog_checks.stubs.aggregator.reset",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datadog_checks.stubs.aggregator",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "datadog_checks.stubs.aggregator",
"line_number": 21,
"usage_type": ... |
269833756 | from django import forms
from django.forms import ModelForm
from .models import MonsterInstance
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Div, Layout, Field, Button, HTML
from crispy_forms.bootstrap import FormActions
class RegisterUserForm(forms.Form):
username = forms.... | null | herders/forms.py | forms.py | py | 3,800 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.forms.Form",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.for... |
95285007 | import pandas as pd
import seaborn as sns
import gui11
import sys, time, os
import time
import threading
import matplotlib.pyplot as plt
import pyqtgraph as pg
start_time1 = time.time()
xl = pd.ExcelFile("file.xlsx")
df = xl.parse("Sheet1", header=None)
print("Data File loaded ...")
print("I am in load")
# print(li... | null | ExcelRead/PlotExcel.py | PlotExcel.py | py | 1,936 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.time",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.ExcelFile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "seaborn.set_style",
"line_num... |
241086556 | # -*- coding: utf-8 -*-
"""
Created on Thu May 21 23:10:57 2020
@author: Devang Mehrotra
"""
import numpy as np
import pandas as pd
dataset = pd.read_csv('data2.csv')
dataset['sex']=dataset['sex'].replace(['female','male','other'],[0,1,2])
dataset['smoking']=dataset['smoking'].replace(['never','quit','yes'],[0,1,... | null | nasscom2.py | nasscom2.py | py | 2,859 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 36,
"usage_type": "call"
... |
348637391 | import json
import requests
import sys
# Import API key and org ID from login.py
try:
import login
(API_KEY, ORG_ID, HUE_USER, HUE_IP) = (login.api_key, login.org_id, login.hue_user, login.hue_ip)
HUE_URL = 'http://'+HUE_IP+'/api/'+HUE_USER+'/'
except ImportError:
API_KEY = input('Enter your Dashboard... | null | merakiLights.py | merakiLights.py | py | 3,532 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "login.api_key",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "login.org_id",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "login.hue_user",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "login.hue_ip",
... |
39857318 | from flask import Flask, render_template, request
from form import WordSearchForm
from dotenv import load_dotenv
import os
from get_total_playtime import get_total_hours
from get_profile import get_profile_info
from game_completion_profile import game_completion_profile
load_dotenv()
test = [{'gamename': 'Fallout: Ne... | null | app.py | app.py | py | 1,823 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "form.WordSearchForm",
"li... |
93184314 | import numpy as np
from keras.models import Sequential
from keras.layers import Dense, LSTM
# 1. 데이터
# LSTM은 예측할 값의 범위가 데이터의 최소/최대값 안에 있어야 잘 예측된다.
a = np.array(range(1,11))
size = 5
# LSTM에 넣기 좋은 연속 데이터 만들기
def split_5(seq, size):
aaa = []
for i in range(len(seq) - size + 1):
subset = seq[i:(i+size)]... | null | keras/keras16_lstm_test.py | keras16_lstm_test.py | py | 1,983 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number":... |
139071964 | from flask import jsonify, Blueprint
from helper import is_isbn_or_key
from yushu_book import YuShuBook
# 蓝图 blueprint 蓝本
web = Blueprint('web', __name__)
@web.route('/book/search/<q>/<page>')
def search(q, page):
"""
q: 普通关键子 isbn
page
"""
print(q+page)
isbn_or_key... | null | fisher/app/web/book.py | book.py | py | 487 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "helper.is_isbn_or_key",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "yushu_book.YuShuBook.search_by_isbn",
"line_number": 20,
"usage_type": "call"
},
{
"api_name... |
565540909 | """Store record details in datastore.
"""
# future imports
from __future__ import absolute_import
# thrid-party imports
from google.appengine.ext import ndb
# Local imports
from app.models import base
class BlogCategory(base.Model):
name = ndb.StringProperty(required=True)
def get_or_create(self, name):
... | null | app/app/models/blog.py | blog.py | py | 2,647 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "app.models.base.Model",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "app.models.base",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.ndb.StringProperty",
"line_number": 15,
"usage_type": "call"
},
{
... |
429328831 | # coding: UTF-8
# ! usr/bin/python #coding=utf-8
import pandas as pd
import tushare as ts
e = ts.get_today_all()
sortdf=e.sort_values(by=['mktcap'],ascending=[True])
print(type(e))
code = sortdf[u'code']
name = sortdf[u'name']
per = sortdf[u'per'] # 市盈率
tt = sortdf[u'turnoverratio'] # 换手率
cc = sortdf[u'changepercen... | null | target/basechosen.py | basechosen.py | py | 731 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tushare.get_today_all",
"line_number": 7,
"usage_type": "call"
}
] |
584873634 | import numpy as np
import matplotlib.pyplot as plt
def __arrange_canvas():
x_range = 5
x_margin = 1
y_range = 1
y_margin = 0.1
plt.xlim(- x_margin - x_range, x_margin + x_range)
plt.ylim(- y_margin - 0, y_margin + y_range)
__arrange_ticks()
def __arrange_ticks():
ax = plt.gca()
x... | null | python/deep_learning_from_zero/sect3/sect3_plot_graphs.py | sect3_plot_graphs.py | py | 2,259 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.xlim",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.ylim",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matpl... |
33972966 | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | null | docs/build.py | build.py | py | 4,410 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
276338286 | from gensim.models.doc2vec import Doc2Vec, TaggedDocument
from gensim.models.word2vec import Word2Vec
import json
import os
import tweet2vec
IN_PATH = 'tweets_tidy'
MODEL_PATH = 'models'
if __name__ == '__main__':
with open('sources.json') as sources_file:
sources = json.load(sources_file)['sources']
... | null | train_models.py | train_models.py | py | 3,182 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"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.isfile",
"line_number... |
465274514 | #what is Git?
import discord
import asyncio
import aiohttp
import lxml.html
import re
from random import randint
from googletrans import Translator
token_file = 'bot.txt'
t = Translator()
session = aiohttp.ClientSession()
client = discord.Client()
LANGUAGES = {
'af': 'afrikaans',
'sq': 'albanian',
'am': '... | null | asyncio/onbroid_mk-2.py | onbroid_mk-2.py | py | 8,298 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "googletrans.Translator",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "discord.Client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.compil... |
343071271 | import datetime, os, pathlib, re
script_dir = "../scx"
date = "".join(str(datetime.date.today()).split('-'))
script_path = pathlib.Path("scripts/pos-search-%s.scx" % date)
init = str(open("%s/initialize-script.txt2" % script_dir).read())
login = str(open("%s/mylogin.txt2" % script_dir).read())
group = str(open("%s/cho... | null | new-pos/collect.py | collect.py | py | 2,041 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.date.today",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "re.match",
"line... |
165298900 | # -*- coding: utf-8 -*-
import json
import random
import requests
url = ''
headers = {'Content-Type': 'application/json'}
data_file = '/tmp/cess_item_data.csv'
def data_load():
with open(data_file, 'r') as items_f:
i = 0
items = []
lines = items_f.readlines()
for line in lines:
... | null | backups/pd_scripts_bak/cess_data_load.py | cess_data_load.py | py | 1,786 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.randint",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "random.choice",
"lin... |
570808051 | from keras.models import model_from_json, Model
import tensorflow as tf
from keras import backend as K
import os
os.environ['KERAS_BACKEND'] = 'tensorflow'
def model_from_json_and_weight(model_json_file, model_weight_file=None):
# load json and create zsl_model
print('Loading model from json:{} ...'.format(m... | null | code/get_feature.py | get_feature.py | py | 3,365 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "keras.models.model_from_json",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.reset_default_graph",
"line_number": 27,
"usage_type": "call"
},
{
"api_na... |
459787081 | from typing import Optional, Union, Dict
class CrudField:
def __init__(self, key: str, value: str, field_type: str = "S"):
self.field_type: str = field_type
self.key: str = key
self.value: str = value
class CrudItem:
def __init__(self, pk: str, sk: Union[int, str, float, None], body... | null | src/zinc_cli/infrastructure/services/contact_api/lambda/util_src/crud_item.py | crud_item.py | py | 1,052 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Union",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line... |
604058101 | #!/usr/bin/python3
import sqlite3
import time
import os
# Establish sqlite3 database connection to 'makerSpace.db'
dbc = sqlite3.connect('makerspace.db')
# To debug program debug > 0
debug = 0
# Short Delay
delay1 = 2
# Long Delay
delay2 = 5
# Did they sign a waiver? waiverSign == 1
waiverSign = 0
while True:
###... | null | SMSDatabase/waiverEntry03.py | waiverEntry03.py | py | 3,287 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 4... |
49899998 | import numpy as np
from nltk import word_tokenize
from nltk.corpus import stopwords
from collections import Counter
from nltk.corpus import wordnet as wn
import lev
try:
stopwords = stopwords.words('english')
except:
stopwords = set(['i', 'me', 'my', 'myself', 'we', 'our', 'ours', 'ourselves', 'you', 'your', '... | null | utils.py | utils.py | py | 9,550 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "nltk.corpus.stopwords",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": ... |
531294940 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on
Finished on
@author: Wang Yuntao
"""
import numpy as np
from skimage import io, util
from skimage import filters
import matplotlib.pyplot as plt
"""
function:
image_info_show(image_file_path) 图像信息显示
... | null | image_preprocess.py | image_preprocess.py | py | 2,599 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "skimage.io.imread",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "skimage.io",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
442757895 | import contextlib
import sys
import pathlib
import tempfile
import numpy as np
import h5py
import pytest
import sxs
# see test_utilities.py for explanation
shortest_h_com_file = "SXS:BBH:0156v1/Lev5/rhOverM_Asymptotic_GeometricUnits_CoM.h5"
def test_backwards_compatibility():
path = sxs.sxs_directory("cache") / ... | null | tests/test_waveforms.py | test_waveforms.py | py | 8,605 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sxs.sxs_directory",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sxs.utilities.sxs_path_to_system_path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sxs.utilities",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_na... |
425163002 | from django.shortcuts import render
from . import test_api
# Create your views here.
def Recommend(request):
name=test_api.name
image=test_api.image
energy=test_api.energy
protien=test_api.protien
fat=test_api.fat
category=test_api.category
ingredients=test_api.ingredients
return render... | null | Dietopedia/Dish_Recomendation/views.py | views.py | py | 410 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
}
] |
145340096 | import torch.cuda
import cv2
from CNN import CNN_model
import torchvision
import numpy as np
def test_CNN(img_path,class_name):
device=torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = CNN_model(3).to(device)
model.load_state_dict(torch.load('./weight/CNN.ckpt'))
with torch.no_grad()... | null | utils/model/Model_test.py | Model_test.py | py | 1,375 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.cuda.device",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.cuda.cuda.is_available",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.cuda.cud... |
254655426 | # Filename: lib/search.py
"""
Created on June 01, 2020
@author: Krishnendu Banerjee
@summary: This file holds the functions to perform different search assets in the local database
"""
import urllib.parse
from flask import request
from .models import ADI_main, ADI_metadata, ADI_offer, ADI_EST_Show, ADI_INGEST_HISTORY,... | null | lib/search.py | search.py | py | 7,952 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.request.form.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "urllib.p... |
562442176 | from __future__ import print_function
import numpy as np
import cv2
from cam_func_lib import *
import math
from extra import *
import cv2.cv as cv
from time import time
def on_mouse(event, x, y, flags, params):
boxes = []
t = time()
if event == cv.CV_EVENT_LBUTTONDOWN:
print
'Start Mouse P... | null | Prototype codes/Prototype codes/extra.py | extra.py | py | 7,555 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.time",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.cv.CV_EVENT_LBUTTONDOWN",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.cv",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "cv2.cv.CV_EVENT_LBU... |
470200857 | # -*- coding: UTF-8 -*-
from django import forms
from django.utils.translation import gettext as _
from workflow.flow.cclock.models import CCLockFlow
from workflow.VobConfig.views import get_branch_choices
class CCLockFlowForm(forms.ModelForm):
def __init__(self,*args,**kwargs):
super(CCLockFlowForm,self)... | null | workflow/flow/cclock - 副本/forms.py | forms.py | py | 4,379 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.forms.widgets.Select",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "dj... |
205668196 | from __future__ import print_function
import numpy
import matplotlib.pyplot as plt
import os
import string
from matplotlib.patches import Rectangle
import matplotlib.patches
import collections as c
import sys
import matplotlib.backend_bases as event_plot
from mpldatacursor import datacursor
from matplotlib.widgets impo... | null | AltAnalyze_release/ExPlot.py | ExPlot.py | py | 21,792 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "string.split",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 174,
"usage_type": "call"
},
{
"api_name": "unique.filepath",
"line_number": 348,
"usage_type": "call"
},
{
"api_name": "unique.filepat... |
79898905 | from datetime import date
from django.shortcuts import get_object_or_404, render
from django.http import Http404
from django.http import HttpResponse
from django.template import RequestContext, loader
from django.contrib.auth.decorators import login_required
from requests.models import Comment, Request
@login_requir... | null | requests/views.py | views.py | py | 1,402 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.models.Request.objects.order_by",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.models.Request.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "requests.models.Request",
"line_number": 13,
"usage_type": ... |
86080783 | import os
from unittest.mock import MagicMock
from django.core.files import File
from django.test import TestCase
from ..models import Worker
class TestWorkers(TestCase):
def test_worker_should_have_define_fields(self):
# Given
first_name = 'Keng'
last_name = 'Mark'
is_available = ... | null | safety/workers/tests/test_models.py | test_models.py | py | 2,053 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "unittest.mock.MagicMock",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.core.files.File",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "mo... |
266731882 | import abc
from typing import Optional
from .const import (ENDIAN, PAGE_REFERENCE_BYTES,
USED_KEY_LENGTH_BYTES, USED_VALUE_LENGTH_BYTES, TreeConf)
class Entry(metaclass=abc.ABCMeta):
__slots__ = []
@abc.abstractmethod
def load(self, data: bytes):
"""Deserialize data into an ... | null | venv/lib/python3.7/site-packages/bplustree/entry.py | entry.py | py | 6,243 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "abc.ABCMeta",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "const... |
367287120 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 31 04:01:49 2018
@author: abhilasha
"""
from PIL import Image, ImageEnhance
def enhance_signature(img):
bw = ImageEnhance.Color(img).enhance(0.0)
bright = ImageEnhance.Brightness(bw).enhance(2.2)
contrast = ImageEnhance.Contrast(bright).enh... | null | Filters and analysis/signprocessing.py | signprocessing.py | py | 1,498 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.ImageEnhance.Color",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.ImageEnhance",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "PIL.ImageEnhance.Brightness",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "P... |
632731115 | import speech_recognition as sr
#Obtain audio from microphone
r = sr.Recognizer()
# devicde_index is the index of the audio input device, if you don’t specify it, the microphone is used as the audio source by default.
# sample_rate sets the number of samples collected per second, if you don’t specify it, it will automa... | null | tutorial/speech_tutorial.py | speech_tutorial.py | py | 1,375 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "speech_recognition.UnknowValueError",
"line_number": 21,
"usage_type": "attribu... |
506570630 | import json
import pandas
import requests
import os
import tempfile
import time
from celery.utils.log import get_task_logger
from datetime import datetime, timedelta
from tasks.utils.database import databases
from tasks.utils.notifiers import EmailNotifier
from tasks.application import app
from tasks import settings
... | null | flashtripdemo/scripture/tasks/baidu_statics_report.py | baidu_statics_report.py | py | 6,736 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "celery.utils.log.get_task_logger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tasks.utils.database.databases",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tasks.utils.database.databases",
"line_number": 33,
"usage_type": "call"
... |
612395495 | #
from riaps.run.comp import Component
import logging
import uuid
import time
import os
import pprint
from datetime import datetime
class Processor(Component):
def __init__(self):
super().__init__()
self.uuid = uuid.uuid4().int
self.pid = os.getpid()
self.logger.info("%s - starting... | null | apps-ncsu/modbus_cpp/Distributed_Voltage_Observer/Processor.py | Processor.py | py | 2,542 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "riaps.run.comp.Component",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "uuid.uuid4",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_n... |
87086433 | import pygame
pygame.init()
background = pygame.display.set_mode((480, 360))
x_pos = 0
y_pos = 0
play = True
draw = False
while play:
for event in pygame.event.get():
if event.type == pygame.QUIT:
play = False
if event.type == pygame.MOUSEBUTTONDOWN:
draw = True
... | null | pygame_mouse3.py | pygame_mouse3.py | py | 791 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.event.get... |
326284263 | import numpy as np
import shapely.geometry as sh
import shapely.affinity as sha
from descartes.patch import PolygonPatch
import matplotlib.pyplot as plt
from scipy.interpolate import griddata
from matplotlib import rc
from utils import *
import material
FONT = {'family': 'Verdana', 'weight': 'normal'}
rc('font', **FONT... | null | Work/asf-reinforcement-master/parse.py | parse.py | py | 8,403 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.rc",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.fromstring",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_nu... |
311870227 | import requests
import datetime
from ..exceptions import URLException
class ComicBookItem():
FIELDS = ["name", "desc", "tag", "cover_image_url", "author",
"source_url", "source_name", "crawl_time", "chapters"]
def __init__(self, name=None, desc=None, tag=None, cover_image_url=None,
... | null | onepiece/site/__init__.py | __init__.py | py | 3,563 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "requests.session",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "excepti... |
99619063 | # -*- coding: utf-8 -*-
from __future__ import print_function
from datetime import datetime, timedelta
import numpy as np
from pandas.compat import lrange
from pandas import (DataFrame, Series, Index, MultiIndex,
RangeIndex)
import pandas as pd
from pandas.util.testing import (assert_series_equ... | null | lib/python2.7/site-packages/pandas/tests/frame/test_alter_axes.py | test_alter_axes.py | py | 24,554 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.util.testing.TestCase",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "pandas.util.testing",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "pandas.tests.frame.common.TestData",
"line_number": 23,
"usage_type": "name"
},
... |
613552521 | from django import forms
from .models import Developer
from dal import autocomplete
class DevForm(forms.ModelForm):
class Meta:
model = Developer
fields = ('name', 'profile_link', 'country', 'city', 'rank_position', 'position', 'skills', 'comment',)
widgets = {
'skills': auto... | null | peopleDB/forms.py | forms.py | py | 458 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "models.Developer",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "dal.autocomple... |
10577785 | import scrapy
from ..items import MonsterItem
import time
from functools import reduce
query = 'bestiary/'
class MonsterSpider(scrapy.Spider):
name = 'monster_spider'
allowed_domains = ['chisaipete.github.io']
start_urls = ['http://chisaipete.github.io/' + query]
def parse(self, response):
... | null | src/scraping/monsters/spiders/monster_spider.py | monster_spider.py | py | 4,144 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrapy.Spider",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "items.MonsterItem",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "functools.reduce"... |
272066030 | # (c) 2013 Massachusetts Institute of Technology. All Rights Reserved
# Code written by: Maksim Imakaev (imakaev@mit.edu)
import matplotlib.pyplot as plt
import numpy as np
from openmmlib import Simulation
import polymerutils
import os
def exampleOpenmm():
"""
An example script which generates an extended po... | null | tests/bondLength.py | bondLength.py | py | 4,462 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "openmmlib.Simulation",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "polymerutils.create_random_walk",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "numpy... |
21261005 | #!/usr/bin/python
__author__ = "Orest Stetsiak"
__email__ = "axeopa@gmail.com"
from datetime import datetime, date, timedelta
class Person(object):
"""docstring for Person"""
def __init__(self, surname, first_name, birth_date, nickname=None):
self.surname = surname
self.first_name = first_na... | null | tutorials/week_03/5_1.py | 5_1.py | py | 1,051 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 28,
"usage_type": "call"
},
{
"api_name"... |
159616422 | """cached_next col for schedule types
Revision: e888f07ab69
Revises: 1250afd87885
Created: 2013-12-10 16:23:26.510616
"""
revision = 'e888f07ab69'
down_revision = '1250afd87885'
from alembic import op
from spire.schema.fields import *
from sqlalchemy import Column, ForeignKey, ForeignKeyConstraint, PrimaryKeyConstra... | null | platoon/migrations/versions/e888f07ab69_cached_next_col_for_.py | e888f07ab69_cached_next_col_for_.py | py | 752 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "alembic.op.add_column",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "alembic.op.add_col... |
609956287 | """
Created on 22/09/2015
@author: Aitor Gomez Goiri <aitor.gomez-goiri@open.ac.uk>
Script to create database.
"""
from argparse import ArgumentParser
from models import PerformanceTestDAO, Test
def main(database_file):
dao = PerformanceTestDAO(database_file)
session = dao.get_session()
for num_containe... | null | ptdockertest/prepare_benchmark.py | prepare_benchmark.py | py | 903 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.PerformanceTestDAO",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Test",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
}
] |
588603273 | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 20 13:17:10 2021
NVAR with time delays for Lorenz forecasting. Don't be efficient for now.
@author: Dan
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
##
## Parameters
##
# time step
dt=0.025
# units of time to warm up NV... | null | LorenzConstLinQuadraticNVARtimedelay-RK23.py | LorenzConstLinQuadraticNVARtimedelay-RK23.py | py | 8,663 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.linspace",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "scipy.integrate.solve_ivp",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.var",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
499595756 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import tempfile
import numpy as np
import tables
from astropy.table import Table
from .. import agasc
def test_multi_agasc():
tempdir = tempfile.mkdtemp()
# Make two custom agasc files from the miniagasc, using 20 stars from
# a... | null | agasc/tests/test_agasc_1.py | test_agasc_1.py | py | 4,494 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tempfile.mkdtemp",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tables.open_file",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "astropy.table.Table",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
44416028 | # -*- coding: utf-8 -*-
"""
"""
from obstools.atacr import StaNoise, DayNoise, TFNoise, EventStream
# from obspy.clients.fdsn import Client
import obspy
import numpy as np
import shutil
import stdb
import os
monthdict = {1: 'JAN', 2: 'FEB', 3: 'MAR', 4: 'APR', 5: 'MAY', 6: 'JUN', 7: 'JUL', 8: 'AUG', 9: 'SEP', 10: '... | null | quake/_atacr_funcs.py | _atacr_funcs.py | py | 9,095 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "stdb.StDbElement",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile",
"li... |
602518871 | from flask import Blueprint, request, jsonify
from views import app, db
#from createDb import db
from models import userModel
from schemas import userSchema
import datetime
# create the user Blueprint
users = Blueprint('users', __name__)
# Get single User
@users.route('/users/<id>', methods=['GET'])
def get_user(id):... | null | views/userView.py | userView.py | py | 1,937 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.userModel.User.query.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.userModel.User",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_nam... |
617365407 | from collections import namedtuple
import inflect
from google.appengine.ext import ndb
from graphene import LazyType
from graphene.core.types import Field
from graphene.core.types.definitions import List
from graphene.core.types.scalars import String, Boolean, Int, Float
from graphene.core.types.custom_scalars import... | null | graphene_gae/ndb/converter.py | converter.py | py | 3,719 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "inflect.engine",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "graphene.core.types.scalars.String",
"line_number": 33,
"usage_type": "argument"
},
{
"api_... |
359057941 | from keras.layers import Input, Dense
from keras.models import Model
if __name__ == '__main__':
x = [
[1,2,3],
[-2,3,4],
]
y = [
[1],
[0]
]
encoding_dim = 2
input_layer = Input(shape=(3,))
encoded = Dense(encoding_dim, activation='relu', kernel_initializer="u... | null | ae.py | ae.py | py | 738 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.layers.Input",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dense",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dense",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "keras.models... |
441618561 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 27 20:57:47 2018
@author: Mebius
"""
import numpy as np
from numpy.random import poisson
import matplotlib.pyplot as plt
from tqdm import tqdm
gamma = 1
alpha = 0.5
epsilon = 0.2
num_episodes = 50000
capacity_per_station = 10 # the capacity at each sta... | null | solution.py | solution.py | py | 20,281 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.ones",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random.poisson",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
... |
371595856 | #!/usr/bin/env python3
"""Upload labnotes."""
import bs4 as bsoup
import requests
import base64
from glob import glob
import re
import os
from datetime import datetime
import subprocess
import shutil
from yaml import load as ymload
from yaml import dump as ymdump
import argparse
from collections import defaultdict
fro... | null | automatic-labnote-updater/automatic-labnote-updater.py | automatic-labnote-updater.py | py | 12,570 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "glob.glob",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number": 26... |
619023471 | # -*- coding: utf-8 -*-
from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
import views
urlpatterns = [
# 管理中心本地审计日志接口
url(r'^show$', views.LocalAuditShow.as_view()),
url(r'^count$', views.LocalAuditCount.as_view()),
url(r'^send_audit$', views.Send... | null | DetectCenter/audit/audit_local_urls.py | audit_local_urls.py | py | 619 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "views.LocalAuditShow.as_view",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "views.LocalAuditShow",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name... |
100784805 | from django.urls import path
from users import views
app_name = 'users'
urlpatterns = [
path('', views.home, name='home'),
path('userlist', views.UserListView.as_view(), name='user_list'),
path('signup/', views.SignUpView.as_view(), name='signup'),
path('<str:username>/edit/', views.SignUpView.as_vie... | null | users/urls.py | urls.py | py | 422 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "users.views.home",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "users.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
... |
362569646 |
import collections
import datetime
import dateutils
class OrderMapper:
def __init__(self, items=None):
self._map = dict()
self._counter = 0
if items:
self.add(items)
def add(self, items):
for k in items:
self._map[k] = self._counter
... | null | findates/holidays.py | holidays.py | py | 17,066 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "datetime.time... |
58113357 | import json
from fastapi import FastAPI, HTTPException, Body, Depends
from model import UserSchema, UserLoginSchema
from auth_handler import signJWT
from auth_bearer import JWTBearer
with open("menu.json", "r") as read_file:
data = json.load(read_file)
app = FastAPI()
users = []
@app.post("/user/signup", tags=["... | null | main.py | main.py | py | 2,817 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "fastapi.FastAPI",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "model.UserSchema",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "fastapi.Body",
"line_num... |
332196576 | import logging
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sea
import numpy as np
import pandas as pd
import matplotlib.gridspec as gridspec
from scipy.stats import t
from moabb.analysis.meta_analysis import collapse_session_scores
from moabb.analysis.meta_analysis import combine_effect... | null | moabb/analysis/plotting.py | plotting.py | py | 19,112 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "seaborn.color_palette",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "seaborn.set",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "moabb.analysis.me... |
472646913 | # -*- coding: utf-8 -*-
__author__ = 'Xiaoyu Wang'
"""
==================================
# Time : 2018/10/11 14:30
# File : estimator.py
# Project : WXY_projects
==================================
"""
import numpy as np
import matplotlib.pyplot as plt
from oct.utils import make_a_star, flatten, find_lo... | null | p2/oct/estimator.py | estimator.py | py | 5,870 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "oct.data.Data",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
624682037 | from collections import defaultdict
def dfs(graph, node):
order ={ k:[] for k in graph.keys()}
# print(order)
step = 0
visited = [node]
stack = [node]
step += 1
order[node].append(step)
while stack:
node = stack[-1]
if node not in visited:
visited.... | null | apsvie4.py | apsvie4.py | py | 1,242 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.defaultdict",
"line_number": 34,
"usage_type": "call"
}
] |
79568933 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
"""Superdes... | null | server/planning/assignments.py | assignments.py | py | 18,323 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "superdesk.Resource.rel",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "superdesk.Reso... |
392600165 | import sys
from datetime import datetime
import pytest
import xarray as xr
import pandas as pd
import mikeio
import fmskill
from fmskill.model import ModelResult
from fmskill.model import XArrayModelResultItem
from fmskill.observation import PointObservation, TrackObservation
from fmskill.comparison import PointComp... | null | tests/test_model_xarray.py | test_model_xarray.py | py | 7,280 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytest.mark.skipif",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.version_info",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pytest.fixt... |
40228033 | # -*- coding: utf-8 -*-
# copyright: (c) 2020 by Jesse Johnson.
# license: Apache 2.0, see LICENSE for more details.
'''Manage releases with VCS.'''
import logging
import sys
from typing import Optional
from proman_versioning import get_release_controller
log = logging.getLogger(__name__)
controller = get_release_c... | null | proman_versioning/cli/release.py | release.py | py | 1,449 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "proman_versioning.get_release_controller",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_na... |
350302199 | import numpy as np
from astropy.table import Table
from astropy.table import Column
import matplotlib.pyplot as plt
from galaxies import Galaxy
import astropy.units as u
import matplotlib as mpl
import plfit_mcstat as plf
import scipy.stats as ss
import seaborn as sns
mpl.rcParams['font.family']='serif'
mpl.rcParams['... | null | chainplot.py | chainplot.py | py | 1,882 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_na... |
201591941 | __author__ = 'ezambrano@iom.int'
import pandas as pd
import numpy as np
#===============================
# SQL PART
#======================
import pymssql
def dfToSQLSequential(df,server='',db='',table='newTable',
usr=[0],pswd=[0], overwrite=False,credentials='.txt',
often... | null | myPythonTools/_sqlCommunicator/loadSequential.py | loadSequential.py | py | 6,754 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "pymssql.connect",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_... |
233524501 | """
OCP SQLAlchemy debug toolbar panel
- Provides named db engine in output to distinguish between cubes and
primary db engine
- Workaround for race condition in debugtoolbar. Multiple queries are
issued on the same connection and cursor, leading to a problem
discovering timings.
https://github.com/Pylons/pyra... | null | src/pyramid_debugtoolbar_ocp/panels/sqla.py | sqla.py | py | 5,067 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "threading.Lock",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pyramid_debugtoolbar.compat.PY3",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.e... |
72155357 | import logging
import treq
from twisted.application import internet
from twisted.internet.task import defer
from twisted.python import usage, log
from urlchecker.fileutils import read_from_ymlfile, readlines_from_textfile
from urlchecker.logging import init_logger, close_logger_handlers
HTTP_OK = 200
def check_res... | null | urlchecker/urlchecker.py | urlchecker.py | py | 1,620 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "twisted.python.log.msg",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "twisted.python.log",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "logging.CRITICAL",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "twist... |
241752321 | #!/usr/bin/env python3
import sys
from http.server import HTTPServer, BaseHTTPRequestHandler
class Redirect(BaseHTTPRequestHandler):
def do_GET(self):
self.path = '/var/www/html/index.html'
file_to_open = open(self.path).read()
self.send_response(302)
self.end_headers()
... | null | maintenance/build/docker-entrypoint.py | docker-entrypoint.py | py | 423 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "http.server.HTTPServer",
"line_number": 16,
"usage_type": "call"
}
] |
368243204 | import sys,os
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
#import seaborn as sns
import scipy.ndimage.filters as scifilt
def main(argv):
"""
Sept 1, 2018: Add Scott's rule smoothing to all curves
Scott's rule bandwidth for scipy.stats.gaussian_kde that qp uses... | null | plotting_scripts/plot_nzsums_scottsrule.py | plot_nzsums_scottsrule.py | py | 3,397 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.use",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number"... |
422890682 | import os
import sys
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
VERSION = os.environ.get('VERSION', '0.121.0')
RELEASE = os.environ.get('RELEASE', '.dev')
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
wi... | null | setup.py | setup.py | py | 2,384 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_num... |
646357736 | import logging
import os
import seria
import yaml
from figgypy.decrypt import (
gpg_decrypt,
kms_decrypt
)
from figgypy.exceptions import FiggypyError
log = logging.getLogger('figgypy')
if len(log.handlers) == 0:
log.addHandler(logging.NullHandler())
class Config(object):
"""Configuration object
... | null | figgypy/config.py | config.py | py | 3,052 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.NullHandler",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.curdir",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
511866265 | from Tkinter import *
import Tkinter as tk
from PIL import Image, ImageTk
from urllib2 import urlopen
import io
from plexapi.myplex import MyPlexAccount
account = MyPlexAccount.signin('MY_USERNAME', 'MY_PASSWORD')
plex = account.resource('MY-SERVERNAME').connect()
root = tk.Tk()
root.resizable(width=False, height=Fa... | null | run.py | run.py | py | 3,857 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "plexapi.myplex.MyPlexAccount.signin",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "plexapi.myplex.MyPlexAccount",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "Tkinter.Tk",
"line_number": 12,
"usage_type": "call"
},
{
"api_nam... |
330456216 | import paho.mqtt.client as mqtt
import time, cv2, os, datetime
from gpiozero import LED, Buzzer, DistanceSensor, Robot
from time import sleep
import numpy as np
ip_address = 'IP 입력'
active=0
client = mqtt.Client()
robot=Robot(left=(27,22), right=(15,14))
led_right=LED(20)
led_left=LED(16)
buzzer=Buzzer(21)
distance = ... | null | Python/RC-Car_control.py | RC-Car_control.py | py | 3,541 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "paho.mqtt.client.Client",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "paho.mqtt.client",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "gpiozero.Robot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "gpiozero.LED",
... |
451331874 | from functools import partial
import logging
import device
import probe
from register import *
log = logging.getLogger()
# CT Type Identifier register to type name mapping
CT_TYPES = [
'SCT01-50A/100A/200A',
'SCT01-400A/800A',
'Rogowski coil 600A-100mV',
'SCT02-50A',
'SCT02-100A',
'SCT02-200A... | null | smappee.py | smappee.py | py | 7,762 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "device.EnergyMeter",
"line_number": 113,
"usage_type": "attribute"
},
{
"api_name": "functools.partial",
"line_number": 258,
"usage_type": "call"
},
{
"api_name": "probe.ad... |
524790007 | import requests
import json
from lxml import etree
import ffmpeg.video
import os
requests.packages.urllib3.disable_warnings()
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3970.5 Safari/537.36',
'Referer': 'https://www.bilibili.com/'
}
... | null | crawler_test/bilibili.py | bilibili.py | py | 3,683 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.packages",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "requests.session",
"line_number": 15,
"usage_type": "call"
},
{
"... |
383526029 | from os import unlink
from utils.launcher import Launcher
from utils.entries import Entries
from utils.loop import CounterLoop
from utils.tempdirs import TempDirs
launcher = None
dirs = TempDirs()
json_file = 'test_startup.json'
def setup_module(module):
global launcher
entries = Entries()
entries.add('l... | null | tests/functional/test_startup.py | test_startup.py | py | 881 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.tempdirs.TempDirs",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "utils.entries.Entries",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.launcher.Launcher",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "... |
351837676 |
#from searchpage.models import Table1
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.db.models import Q
from django.db import connection
from dataimport.models import Cars, Stores
from django.template.response impo... | null | Project/searchpage/views.py | views.py | py | 5,731 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dataimport.models.Cars.objects.all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "dataimport.models.Cars.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "dataimport.models.Cars",
"line_number": 17,
"usage_type": "name"
... |
86891532 | from . import COMMAND
from . import WORD_COMMAND_TYPE_MAPPING
from utils import log_debug
class Parser:
def __init__(self, input_):
self.input = input_
self.command = ''
def has_more_commands(self):
if self.input.read(1):
self.input.seek(-1, 1)
return True
... | null | projects/08/VMtranslator/vmtranslator/parser.py | parser.py | py | 1,763 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.log_debug",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "utils.log_debug",
"line_number": 31,
"usage_type": "call"
}
] |
137112978 | from flask import Flask, request,g, session, redirect, url_for, abort, \
render_template, flash
import db_option
import translators as ts
import os
import time
import json
import requests
import datetime
import traceback
from config_helper import ConfigHelper
NEWS_JSON_PATH = ConfigHelper().get('BASE_PATH') + '/n... | null | flaskr.py | flaskr.py | py | 4,133 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "config_helper.ConfigHelper",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.g.db",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
... |
312420584 | from __future__ import print_function
"""
Peasauce - interactive disassembler
Copyright (C) 2012-2017 Richard Tew
Licensed using the MIT license.
"""
"""
Human68K executable files (.x suffix).
Future work for people more interested in the X68k platform:
o The debug information is something called SCD, an... | null | python/loaderlib/human68k/xfile.py | xfile.py | py | 9,290 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.SEEK_SET",
"line_number": 95,
"usage_type": "attribute"
},
{
"api_name": "os.SEEK_SET",
"line_number": 153,
"usage_type": "attribute"
},
{
"api_name": "os.SEEK_SET",
... |
243953863 | # -*- coding: utf-8 -*-
import scrapy
from ..items import AreaItem
import os
import pymysql
class Area2Spider(scrapy.Spider):
name = "area4"
def start_requests(self):
db = pymysql.connect("127.0.0.1", "root", "123456", "stats", charset="utf8")
cur = db.cursor(cursor=pymysql.cursors.DictCursor... | null | stats/spiders/area4.py | area4.py | py | 1,516 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrapy.Spider",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pymysql.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request... |
563273835 | import os, sys
sys.path.insert(0, os.path.abspath(".."))
import pandas as pd
import numpy as np
from sklearn.metrics import roc_auc_score
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics import confusion_matrix
from util import dsloader
from u... | null | implementation/evaluation/evaluate_gbdt.py | evaluate_gbdt.py | py | 2,777 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.insert",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
12061358 |
import sqlite3
conn = sqlite3.connect('example.db')
c = conn.cursor()
t = ('nikhil',)
c.execute('SELECT * FROM scores WHERE symbol=?', t)
print(c.fetchone())
# Larger example that inserts many records at a time
data = [('hrithik',10),
('vishwanth',30),
('sriram', 53),
]
c.execu... | null | datbase/insert_db.py | insert_db.py | py | 373 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 3,
"usage_type": "call"
}
] |
425654573 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.linux-x86_64/egg/ngen/models.py
# Compiled at: 2017-10-08 17:55:08
"""The models architecture defined here is intended to support a declaritive
and e... | null | pycfiles/ngen-1.0.1-py2.7/models.py | models.py | py | 15,568 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "itertools.count",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "six.with_metaclass",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "abc.ABCMeta",
... |
596256241 | """
USAGE:
python street_view_04.py
python street_view_04.py -i street-views/street-view-04.jpg
"""
import cv2
import logging
import numpy as np
from pyimagesearch.transform import order_points
logging.basicConfig(level=logging.DEBUG)
from pyimagesearch import social_distancing_config as config
from pyimagesearch.de... | null | street_view_04_.py | street_view_04_.py | py | 6,868 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.pat... |
298855282 | # /src/views/CharacterView
from flask import request, json, Response, Blueprint
from ..models.CharacterModel import CharacterModel, CharacterSchema
from ..models.HatModel import HatModel, ColorType
character_api = Blueprint('character_api', __name__)
character_schema = CharacterSchema()
@character_api.route('/', me... | null | src/views/CharacterView.py | CharacterView.py | py | 5,112 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.CharacterModel.CharacterSchema",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 20,
"usage_type": "call"
},
{
"api_na... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.