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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
139705668 | #! /usr/bin/env python
"""Wrapper script for booting up freeview with lyman results."""
import os
import sys
from pathlib import Path
from textwrap import dedent
import argparse
import lyman
def main(arglist):
args = parse_args(arglist)
project = lyman.gather_project_info()
data_dir = Path(project["data... | null | scripts/view_ffx_results.py | view_ffx_results.py | py | 2,614 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "lyman.gather_project_info",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.system",
"... |
588809367 | import os
import cv2
import numpy as np
from keras.models import load_model
"""
分类函数
"""
def Classfication(image):
rois_file = open('../resource/rois/rois.txt', 'r');
while True:
line = rois_file.readline()
if line != '':
line = line.strip('\n')
info = line.split(' ')
... | null | keras/classification.py | classification.py | py | 1,779 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32",
"... |
547739407 | import cv2
import serial # import the module
import time
from PIL import Image
from numpy import array
import numpy as np
import csv
# with open('Input_image.csv', newline='') as csvfile:
# data = list(csv.reader(csvfile))
im = cv2.imread("unnamed.jpg",cv2.IMREAD_GRAYSCALE)
arr = array(im)
# arr
arr_r ... | null | uart.py | uart.py | py | 2,200 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "serial.Serial",
... |
54409235 | # -*- coding: utf-8 -*-
import yaml
import unittest
import logging
import json
from unittest.mock import MagicMock, patch
from flask import Response as BaseResponse
from flask.testing import FlaskClient
from werkzeug.utils import cached_property
from vantage6.common.globals import APPNAME
from vantage6.server.globals... | null | tests/test_resources.py | test_resources.py | py | 14,004 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.Response",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "werkzeug.utils.cached_pro... |
588252882 | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import os
import re
import types
from functools import partial
import numpy as np
import tensorflow as tf
import tflearn
from tflearn import variables, utils, data_flow
from tflearn.config import init_training_mode
from tflearn.ut... | null | models/tf_train/trainer.py | trainer.py | py | 33,205 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.summary",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.summary",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.train",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": ... |
150702990 | # -*- coding: utf-8 -*-
import scrapy
import sys
from datetime import datetime
import re
#import pymongo
import MySQLdb
import urllib.request
import urllib.error
##connection
#client = pymongo.MongoClient()
#db = client.test
#collection = db.my_first_collection
IMAGES_STORE = '../images/'
conn = MySQLdb.connect(
... | null | spider/test_hanabi.py | test_hanabi.py | py | 4,400 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "MySQLdb.connect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scrapy.Spider",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
... |
206304805 | """Tests for SpeedTest integration."""
from collections.abc import Awaitable
from datetime import timedelta
from typing import Callable
from unittest.mock import MagicMock
from aiohttp import ClientWebSocketResponse
import speedtest
from homeassistant.components.speedtestdotnet.const import (
CONF_MANUAL,
CO... | null | tests/components/speedtestdotnet/test_init.py | test_init.py | py | 4,515 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "homeassistant.core.HomeAssistant",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "tests.common.MockConfigEntry",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "homeassistant.components.speedtestdotnet.const.DOMAIN",
"line_number": 31,
... |
40482591 | import cv2
import numpy as np
from os import listdir
from os.path import isdir, isfile, join
import bluetooth_client
import RPi.GPIO as GPIO
import mqtt_pub as mqtt
import python_timer
import button_mqtt
import time
# 얼굴 인식용 haar/cascade 로딩
face_classifier = cv2.CascadeClassifier('haarcascade_frontalface_default.xml'... | null | Facial-Recognition1/facialrecognition.py | facialrecognition.py | py | 5,135 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"l... |
236553902 | #!/usr/bin/env python
"""Plot hydrological signatures.
Plots includes daily, monthly and annual hydrograph as well as
regime curve (monthly mean) and flow duration curve.
"""
import matplotlib.pyplot as plt
import pandas as pd
from matplotlib.colors import BoundaryNorm, ListedColormap
from hydrodata import helpers, ... | null | hydrodata/plot.py | plot.py | py | 7,189 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.plotting.register_matplotlib_converters",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "pandas.plotting",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "pandas.Grouper",
"line_number": 61,
"usage_type": "call"
},
{
... |
86344855 | from datetime import datetime, timedelta
from cal_setup import get_calendar_service
import pytz
def create_event(title, host, start_time, end_time, time_zone):
service = get_calendar_service()
event_start_naive = datetime(start_time.year, start_time.month, start_time.day)
event_end_naive = datetime(end_time.... | null | create_event.py | create_event.py | py | 1,209 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cal_setup.get_calendar_service",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytz.... |
367761332 | import numpy as np
from qtpy.QtCore import QEvent, Qt, QThread, Signal, QMutex, QTime
from qtpy.QtWidgets import QMessageBox
from astropy import units as u
from .annotation import LineIDMarker, LineIDMarkerProxy
from .linelist import LineList, WAVELENGTH_COLUMN, \
REDSHIFTED_WAVELENGTH_COLUMN, \
MARKER_COLUM... | null | specviz/plugins/line_labels/line_labels_plotter.py | line_labels_plotter.py | py | 24,694 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "qtpy.QtCore.QEvent.Enter",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "qtpy.QtCore.QEvent",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "linelist.WAVELENGTH_COLUMN",
"line_number": 90,
"usage_type": "name"
},
{
"api_n... |
152687802 | from datetime import datetime
from matplotlib import pyplot
from matplotlib.dates import DateFormatter, WeekdayLocator, DayLocator, MONDAY
from matplotlib import finance
def plot_ohlc(quotes):
mondays = WeekdayLocator(MONDAY) # major ticks on the mondays
alldays = DayLocator() # minor ticks on the days
... | null | scripts/finance_plot_demo.py | finance_plot_demo.py | py | 1,272 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.dates.WeekdayLocator",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.dates.MONDAY",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "matplotlib.dates.DayLocator",
"line_number": 9,
"usage_type": "call"
},
{
... |
491665871 | from fluxo_caixa.models.categorias import Categorias
from fluxo_caixa.models.a_receber import ContasReceber
from django.http.request import HttpRequest
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_http_methods
from django.http.response import HttpResponseRedirect... | null | fluxo_caixa/views/a_receber.py | a_receber.py | py | 864 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.http.request.HttpRequest",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "fluxo_caixa.models.a_receber.ContasReceber",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "fluxo_caixa.models.categorias.Categorias.objects.get",
"line_numbe... |
495032778 | from typing import Any, Iterator
from typing_extensions import ParamSpec
from typing import TypeVar, Callable
import datetime
T = TypeVar("T")
P = ParamSpec("P")
_cache = {}
def flatten(items: Any) -> Iterator:
"""
A function to "completely" flatten a list. For example, itertools.chain() would flatten it once... | null | utils/utils.py | utils.py | py | 2,059 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.TypeVar",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "typing_extensions.ParamSpec",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "typing.Any",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Iterator",... |
277860441 | from __future__ import unicode_literals
from datetime import datetime as dt
import os
import yaml
import tzlocal
from parsely import parsely, models
def load_config(config_file):
try:
with open(config_file, 'r') as yaml_file:
return yaml.load(yaml_file)
except IOError:
return None... | null | parsely_slackbot/slackbot.py | slackbot.py | py | 9,087 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "yaml.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"li... |
426487391 | import collections
import logging
import os
import numpy as np
import scipy.misc
import torch
import torch.utils.data
import torchvision
import loader.utils
class CityscapesLoader(torch.utils.data.Dataset):
def __init__(self, root, split, imgWidth, imgHeight, imgNorm=True, isTransform=False):
self.logg... | null | loader/cityscapes_loader.py | cityscapes_loader.py | py | 5,503 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.utils",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
552136782 | from gensim.models.word2vec import Word2Vec
import MeCab
# 絵文字管理ライブラリ
import emoji
import re
# ファイル取得に利用
import csv
import numpy as np
import pandas as pd
import glob
from config import config
# Wikipediaモデル読み込み
model_path = config.word2vec_config.MODELPATH
model = Word2Vec.load(model_path)
def main():
# ニューステキ... | null | word_movers_distance.py | word_movers_distance.py | py | 3,437 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "config.config.word2vec_config",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "config.config",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "gensim.models.word2vec.Word2Vec.load",
"line_number": 16,
"usage_type": "call"
},
{
... |
384039886 | import cv2
import numpy as np
import torch
from segmentation_models_pytorch.encoders import get_preprocessing_fn
from src.python.utils.augs import get_transforms
class BaseImagePreprocessor:
def __init__(self, cfg, mode='train', device='cpu'):
self.width = cfg['data']['width']
self.height = cfg['... | null | src/python/preprocessors/image_preprocessors.py | image_preprocessors.py | py | 3,211 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "src.python.utils.augs.get_transforms",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.fl... |
571797357 | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from . import views
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^comment/new/$', views.CommentAddView.as_view(), name='comment_add'),
url(r'^comment/reply/$', views.CommentReplyView.as_view()... | null | app/urls.py | urls.py | py | 486 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.co... |
420818601 | # %%
from training.dataset_tool import create_dataset
import os
import numpy as np
import PIL
# %%
image_path = '/home/kunato/dataset/fashion_video/crop'
data_dir = create_dataset(image_path, resolution=512)
training_images = []
for fname in os.listdir(data_dir):
if fname.endswith('.jpg'):
training_images.a... | null | DiffAugment-stylegan2/preprocess.py | preprocess.py | py | 612 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "training.dataset_tool.create_dataset",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image.... |
148440067 | from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML
from django import forms
from django.utils.translation import gettext_lazy as _
from django_select2.forms import Select2Widget
from ephios.core.forms.events import BaseEventPluginFormMixin
from ephios.extra.widgets import CustomDateInput
f... | null | ephios/plugins/eventautoqualification/forms.py | forms.py | py | 2,217 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ephios.core.forms.events.BaseEventPluginFormMixin",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelForm",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 12,
"usage_type": "name"
},... |
315373279 | # -*- coding:UTF-8 -*-
from Data.data import *
from Common.EDACommon import *
from scipy.stats import pearsonr
import seaborn as sns
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from sklearn.ensemble import ExtraTreesClassifier
print("orig shape:", train_data.shape, "\n")
# 特征值编号
featureList = train_... | null | EDA/EDA1.py | EDA1.py | py | 6,601 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "scipy.stats.pearsonr",
"line_number": 90,
"usage_type": "call"
},
{
"a... |
527182264 | #!/usr/bin/env python
""" MultiQC BSF plugin functions
We can add any custom Python functions here and call them
using the setuptools plugin hooks.
"""
from __future__ import print_function
from pkg_resources import get_distribution
import logging
from multiqc.utils import report, util_functions, config
... | null | bsf_reports/bsf_reports.py | bsf_reports.py | py | 1,948 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "multiqc.utils.config.bsf_reports_version",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "multiqc.utils.config",
"line_number": 18,
"usage_type": "name"
},
{
... |
494446331 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: parser_v10
Project Name: segOCT
Author : Kang ZHOU
Date: 2018/11/16
-------------------------------------------------
Change Activity:
2018/11/16:
----------------------... | null | Projects/Ultrasound_classification/tool/parser_v10.py | parser_v10.py | py | 4,126 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "socket.gethostname",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "tb.colour",
... |
19560320 | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 20 01:30:05 2020
@author: rishi
"""
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
import keras
from keras.models import Model
from keras.layers import Input,Embedding,Dot,Add,Flatte... | null | code_keras.py | code_keras.py | py | 3,095 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.utils.shuffle",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "keras.layers.Input",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "keras.layers... |
255780613 | import pickle
import os
import numpy
import pandas as pd
import pystan
import torch
from explicit.adapt_util import full_adapt
from explicit.general_util import logsumexp_torch
from explicit.leapfrog_ult_util import HMC_alt_ult
from explicit.leapfrog_ult_util import leapfrog_ult as leapfrog
from torch.autograd import V... | null | explicit_experiments/newtestleapfrog_adapted_ep_logit.py | newtestleapfrog_adapted_ep_logit.py | py | 3,750 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random.bi... |
343706610 | import numpy as np
import cv2
import matplotlib.image as mpimg
from skimage.feature import hog
class ExtractSettings():
''' Container for feature extraction parameters '''
def __init__(self):
# Color Space: applies for bin_spatial and hog features only
self.cspace = 'YUV' # HSV with all gives... | null | feature_extraction.py | feature_extraction.py | py | 7,607 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.cvtColor",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2HSV",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2LUV",
... |
208093626 | import os
from urllib.parse import urlparse
import requests
import logging
from utils.file_utils import ensure_dir_exists
from image_sampler import sample_random
from image_labeler import classify_images
logger = logging.getLogger('app')
def download(url, out_file_dir, out_file_name):
out_file_dir_path = os.pat... | null | image_matcher.py | image_matcher.py | py | 1,720 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "utils.file_utils.ensure_d... |
468422600 | from Cerina import tbot, OWNER_ID, BOT_ID
from Cerina.modules.sql.elevated_sql import *
from Cerina.events import register
from . import get_user,SUDO_USERS
import subprocess, io, sys, os, asyncio, traceback
from telethon import events
@tbot.on(events.NewMessage(pattern="^[!/?.]addsudo ?(.*)"))
async def ss(event):
... | null | Cerina/modules/_devs.py | _devs.py | py | 3,242 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "Cerina.OWNER_ID",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "Cerina.tbot.get_entity",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "Cerina.tbot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "Cerina.OWNER_ID",
... |
312291167 | import time
import cv2
import pytorch_msssim
import torch
import torchvision
import matplotlib.pyplot as plt
from PIL import Image
from pandas import np
from torch.utils.data import Dataset, DataLoader
def Myloader(path):
return Image.open(path).convert('RGB')
def init_process(Xpath, ypath, len):
data = []
... | null | NewCNNwithBN.py | NewCNNwithBN.py | py | 4,860 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PIL.Image.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "torchvision.transfo... |
208461709 | from django.forms import ModelForm
from django.shortcuts import (
get_object_or_404,
render,
redirect,
)
from django.http import (
HttpResponseRedirect,
HttpResponse,
)
from django.template import Context, Template
from django.core.urlresolvers import reverse
from donations.models import DonationFo... | null | donations/views.py | views.py | py | 1,184 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "donations.models.DonationForm",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "donations.models.DonationForm",
"line_number": 30,
"usage_type": "call"
},
{
... |
251195010 | from flask import Flask, request
import telebot
import os
app = Flask(__name__)
TOKEN = os.environ.get('TOKEN')
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(commands=['start'])
def start(message):
bot.reply_to(message, 'PROG.Kyiv.UA')
@bot.message_handler(commands=['help'])
def help(message):
res = '/... | null | tgbot.py | tgbot.py | py | 1,593 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "telebot.TeleBot",
"line_n... |
467422067 | import pandas as pd
import os
import cv2
import numpy as np
import re
from collections import Counter
from ffpyplayer.player import MediaPlayer
#Tokenize and remove stop words
from nltk.tokenize import sent_tokenize, word_tokenize
from nltk.corpus import stopwords
#Google speech to text
import wave
from typing imp... | null | demo.py | demo.py | py | 4,646 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "boto3.client",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_num... |
422100258 | # -*-coding: UTF-8 -*-
import numpy as np
from genplate_advanced import *
import os
import pandas as pd
import pickle
import cv2
import time
import csv
index = {"0": 0, "1": 1, "2": 2, "3": 3, "4": 4, "5": 5,
"6": 6, "7": 7, "8": 8, "9": 9, "A": 10, "B": 11, "C": 12, "D": 13, "E": 14, "F": 15, "G":... | null | create_train_data.py | create_train_data.py | py | 2,704 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.random",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "genplate_advanced.generate",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "cv2.... |
25455770 | import requests
from bs4 import BeautifulSoup
import csv
URL = 'https://www.worldometers.info/coronavirus/'
page = requests.get(URL)
print(page)
soup = BeautifulSoup(page.content, 'html.parser')
data = []
header_data = []
country_data = {}
table = soup.find('table', attrs={'id':'main_table_countries_today'})
table_... | null | corona-countries/src/main/java/com/example/coronacountries/service/scrape.py | scrape.py | py | 1,893 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_MINIMAL",
"lin... |
334150911 | from openerp import models, api
from datetime import datetime
import time
from openerp import _
from openerp.addons.report_xlsx.report.report_xlsx import ReportXlsx
from openerp.tools import float_is_zero
from dateutil.relativedelta import relativedelta
import logging
_logger = logging.getLogger(__name__)
class AgedPr... | null | product_ageing_report/report/report_ageing_products.py | report_ageing_products.py | py | 6,798 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "openerp.addons.report_xlsx.report.report_xlsx.ReportXlsx",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 39,
"usage_type": "... |
626682645 | import logging
from simio.app.builder import AppBuilder
from simio_app.config import get_config
logging.basicConfig(level=logging.INFO)
def main():
builder = AppBuilder(get_config())
app = builder.build_app()
app.run()
if __name__ == "__main__":
main()
| null | run.py | run.py | py | 275 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "simio.app.builder.AppBuilder",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "simi... |
76943519 | import tensorflow as tf
import numpy as np
import cyclegan as model
import records
import utils
import os.path
def main():
# check params
# setup params
PATH_TO_REC = "../data/"
PATH_TO_CKPT = "./checkpoints"
SOURCE = "rainy"
TARGET = "sunny"
EPOCHS = 100
BATCH_SIZE = 1
learning_r... | null | src/train.py | train.py | py | 8,010 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "tensorflow.placeholder",
... |
379761440 | import xlrd
from xlrd.biffh import XLRDError
from pandas import *
def get_all_sheets(file_name):
"""
:param file_name:
:return:
All sheet names list
"""
try:
excel_obj = xlrd.open_workbook(file_name)
excel_sheets = excel_obj.sheet_names()
return excel_sheets
except ... | null | pytest_practical/data_providers/excel_util.py | excel_util.py | py | 7,241 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "xlrd.open_w... |
535284773 | # encoding: utf-8
"""
Copyright (c) 2017, Ernesto Ruge
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditi... | null | webapp/paper_search/PaperSeachApi.py | PaperSeachApi.py | py | 10,113 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.request.form.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "flask.re... |
403462116 | import json
async def test_basic_type(test_cli):
req_data = json.dumps({'field_1': '90'})
res = await test_cli.post('/stage/one/basic_type', data=req_data)
assert res.status == 200
res_data = await res.json()
assert res_data['data']['result'] is True
await test_cli.close()
| null | tests/stage/one/test_s2_basic_type.py | test_s2_basic_type.py | py | 300 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.dumps",
"line_number": 5,
"usage_type": "call"
}
] |
501139449 | import unittest
from testcase.api.login.login_all_api import LoginApi
from utils.config import NewConfig
from testcase.api.main_page.experience.post_experience import PostExperience
from testcase.api.common.finish_rid import finish_rid
from testcase.api.studyCenter.getTaskInfo_step4 import GetTaskInfo2
from testcase.ap... | null | tmp/test_7_finish_next_all_task/test_03_start_learning_3.py | test_03_start_learning_3.py | py | 2,032 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "utils.config.NewConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "testcase.api.login.login_all_api.LoginApi",
"line_number": 17,
"usage_type": "call"
},
... |
573356195 | import asyncio
import platform
from bleak import BleakClient
from bleak import BleakScanner
async def run():
devices = await BleakScanner.discover()
#print ("Select the Device Number: \n")
for d in devices:
print(d)
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
print ("Select th... | null | consulv1.py | consulv1.py | py | 738 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bleak.BleakScanner.discover",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bleak.BleakScanner",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": ... |
75164131 | import sys
import datetime
from pandas import read_csv
def umbrella(months=None, days=None, lookback=None, verbose=0):
'''Fetches daily top 1 million domains by DNS activity
from Cisco's Umbrella.
Returns a list of unique domains and subdomains combined from
the selected days/months.
... | null | umbrella.py | umbrella.py | py | 2,514 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.date.today",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "datetime.date.today",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
51848639 | """ A backwards-compatibility shim for the new protocol API.
This should not be imported directly; it is used to provide backwards
compatible singletons in opentrons/__init__.py.
"""
import importlib.util
from typing import List, TYPE_CHECKING
from opentrons.config.pipette_config import config_models
from opentrons.... | null | api/src/opentrons/protocol_api/legacy_wrapper/api.py | api.py | py | 11,159 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "importlib.util.util.decode_source",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "importlib.util.util",
"line_number": 21,
"usage_type": "attribute"
},
{
"a... |
560134873 | import argparse
import collections
import re
def load_data(filepath):
with open(filepath, 'r') as text:
return text.read()
def get_most_frequent_words(text):
words = re.findall(r'\w+', text.lower())
c = collections.Counter(words)
top_10_word = 10
return c.most_common(top_10_word)
if __... | null | lang_frequency.py | lang_frequency.py | py | 562 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.findall",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
}
] |
382219225 | from netapp.netapp_object import NetAppObject
class Volume64BitUpgradeCheckInfo(NetAppObject):
"""
Information returned when upgrade-64bit-mode in
aggr-add is "check".
Upgrade check results such as "used-space",
"available-space", "capacity", and "grow-space"
are only updated after the space
... | null | generated-libraries/python/netapp/volume/volume_64bit_upgrade_check_info.py | volume_64bit_upgrade_check_info.py | py | 3,965 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "netapp.netapp_object.NetAppObject",
"line_number": 3,
"usage_type": "name"
}
] |
551796859 | import Tkinter as tk
import ttk as ttk
import serial.tools.list_ports
import serial.serialutil
class _PortSettingsFrame(tk.LabelFrame):
_XPADDING = 5
_YPADDING = 5
def __init__(self, parent, *args, **kwargs):
tk.LabelFrame.__init__(self, parent, *args, **kwargs)
self._parent = parent
... | null | tkterminal/settings.py | settings.py | py | 8,799 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "Tkinter.LabelFrame",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "Tkinter.LabelFrame.__init__",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "Tkinter.LabelFrame",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_na... |
232493265 | #! python3
# main.py - EPS/Revenueを取得するスクリプト
import re
import pandas as pd
import time
import chromedriver_binary
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def KMB_Convert(moji):
"""K/M/B(単位)を数値に変換する
:param moji:EPSやRevenueの数値(文字)
:return: EPSやRevenueの数値(数値)
... | null | main.py | main.py | py | 7,740 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.findall",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "selen... |
622620511 | import requests
import json
import time
from queue import deque
__auth = {
}
##
class Status:
ACCEPTED = 202
UNAUTHORIZED = 401
OVER_THE_LIMIT = 413
KEY_NOT_FOUND = 0
def get_domains_from_api():
global __auth
tenant_id = str(__auth["tenant_id"])
token = str(__auth["token"])
... | null | main.py | main.py | py | 5,496 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.request",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number"... |
207199329 | # reduce
# 返回计算结果
# 使用reduce需要导入包
from functools import reduce
num_1 = [1, 4, 3, 2]
# csz为初始值
def reduce_test(func, array, csz=None):
if csz is None:
ret = array.pop(0)
else:
ret = csz
for i in num_1:
ret = func(ret, i)
return ret
print(reduce_test(lambda x, y: x * y, num_1)... | null | python/chapter-V-5/ch5-V-04.py | ch5-V-04.py | py | 402 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "functools.reduce",
"line_number": 22,
"usage_type": "call"
}
] |
188801813 | # -*- coding:utf-8 -*-
import cv2
import numpy as np
from scipy.spatial import distance
from keras.engine import Model
from keras.layers import Input
from keras.preprocessing import image
from keras_vggface.vggface import VGGFace
from keras.applications.vgg19 import preprocess_input
class Recognizor:
"""Feature... | null | main.py | main.py | py | 2,151 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "keras_vggface.vggface.VGGFace",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.engine.Model",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.image.load_img",
"line_number": 31,
"usage_type": "call"
},
{
... |
581879571 | import numpy as np
import pandas as pd
from sklearn.preprocessing import MultiLabelBinarizer
from collections import defaultdict
# Load data set
train = pd.read_csv('/Users/dgy/Desktop/we_data/train.csv')
valid = pd.read_csv('/Users/dgy/Desktop/we_data/validation.csv')
test = pd.read_csv('/Users/dgy/Desktop/we_data/t... | null | data preprocessing/prepro_1.py | prepro_1.py | py | 4,699 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.M... |
584590063 | import numpy as np
import matplotlib.pyplot as plt
import time
from matplotlib import rc, rcParams
rc('text', usetex=True)
rc('font', **{'family': 'serif', 'serif': ['Random']})
path_file = "/Users/kristoffervarslott/Documents/MENA/Master_MENA/1.Master/FYS-MENA4111/MoS2-Analysis/Analytic_Data/"
# plt.style.use('classi... | null | Python_MoS2/Lattice_parameters.py | Lattice_parameters.py | py | 2,058 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.rc",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 26... |
155302134 | #%%
import cv2
import numpy as np
from skimage.morphology import erosion, dilation, opening, closing, disk
from imutils.contours import sort_contours, label_contour
from imutils import grab_contours
# https://stackoverflow.com/questions/45310331/detecting-vertical-lines-using-hough-transforms-in-opencv/45312187
# usa... | null | experiments/digits_get.py | digits_get.py | py | 2,197 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.threshold",
"... |
372616833 | from django.http import HttpResponse
from django.shortcuts import render
from django.http import Http404
from rest_framework import serializers
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.decorators import api_view
from django.db.models import Q
import urll... | null | commerce/ecomm/views.py | views.py | py | 3,302 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 25,
"usage_type": "name"
},
{
"api_nam... |
311214088 | from sympy.unify.rewrite import rewriterule
from sympy import sin, cos, Basic, Symbol
from sympy.abc import x, y, z
from sympy.core.compatibility import next
p, q = Symbol('p'), Symbol('q')
def test_simple():
rl = rewriterule(Basic(p, 1), Basic(p, 2), variables=(p,))
assert list(rl(Basic(3, 1))) == [Basic(3, ... | null | sympy/unify/tests/test_rewrite.py | test_rewrite.py | py | 1,159 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sympy.Symbol",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sympy.unify.rewrite.rewriterule",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sympy.Basic",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sympy.Basic",
... |
535697661 | import json
import os
import zipfile
import numpy as np
import pandas as pd
import pytest
from io import StringIO
from openclsim import server
def run_and_compare_completion_time(config_file, expected_result_file, tmp_path=""):
with open(config_file) as f:
config = json.load(f)
result = server.sim... | null | tests/test_server.py | test_server.py | py | 8,327 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "openclsim.server.simulate_from_json",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "openclsim.server",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "json.d... |
541095299 | # pylint: disable=no-self-use
import re
import pytest
from . import AbstractViewsTests
@pytest.fixture(scope="function")
@pytest.mark.usefixtures("dbsession", "transact")
def interface_test_data(dbsession, transact):
del transact
from c2cgeoportal_commons.models.main import Interface, Theme, OGCServer, La... | null | admin/tests/test_interface.py | test_interface.py | py | 4,732 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "c2cgeoportal_commons.models.main.Theme",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "c2cgeoportal_commons.models.main.OGCServer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "c2cgeoportal_commons.models.main.LayerWMS",
"line_number": ... |
527026243 | import cv2
import numpy as np
import time
from datetime import datetime
now = datetime.now()
now = now.strftime("%Y-%m-%d %H-%M")
"""
A TENER EN CUENTA:
- NO PONER PUNTOS
- NO COLOCAR BARRAS
Nombres válidos:
2019-10-20 18:45 contaminacion pelets
2019-11-05 08:30 contaminacion polvillo
"""
def get_elapsed_seconds... | null | grabar_rejilla.py | grabar_rejilla.py | py | 2,371 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.now",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter",
... |
467122999 | from pathlib import Path
# AxonDeepSeg imports
import AxonDeepSeg.ads_utils as ads
from AxonDeepSeg.visualization.merge_masks import merge_masks
from config import axon_suffix, myelin_suffix, axonmyelin_suffix
from ivadomed import inference as imed_inference
def axon_segmentation(
path_acquisitio... | null | AxonDeepSeg/apply_model.py | apply_model.py | py | 3,103 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ivadomed.inference.segment_volume",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "ivadomed.inference",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "config.axon_suffix",
"line_number": 50,
"usage_type": "argument"
},
{
"api_n... |
206867151 | #!/usr/bin/python
import sys
import json
import shlex
from subprocess import Popen, PIPE
def _execute(cmd):
p = Popen(shlex.split(cmd), stdout=PIPE, stderr=PIPE)
out, err = p.communicate()
return out, err, p.returncode
def _build_cmd(source_path, name, version, force, exposed_ports):
good_mounts = [... | null | src/actors/containerization/migrate-machine/create_container/create_container.py | create_container.py | py | 1,626 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "subprocess.Popen",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "shlex.split",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_numbe... |
5218620 | from flask import Flask,render_template,request,redirect,url_for
from db import connect_db, post_db
app = Flask(__name__)
'''
DBについて
データベース名:original-line
テーブル名:data
項目名:
name | char(20)
text | char(800)
'''
#メイン画面,投稿も一つの画面で実装
@app.route("/")
def index():
texts = connect_db()
texts = texts[-20:]
retu... | null | app.py | app.py | py | 869 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "db.connect_db",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.request.method",... |
502367899 | """
A simple database migration manager. A module can request to initialize something in the database with the @init_for
and @init decorators.
"""
import static_config
import hashlib
import plugins
import util.db as db
from typing import Callable
with db.connection() as conn:
with conn.cursor() as cur:
cu... | null | util/db/initialization.py | initialization.py | py | 3,151 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "util.db.connection",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "util.db",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "util.db.connection",
"... |
248155623 | import argparse
from tempfile import NamedTemporaryFile
import pytest
from datarobot_drum.drum.args_parser import CMRunnerArgsRegistry
class TestMulticlassLabelsParser(object):
@pytest.fixture
def parser(self):
test_parser = argparse.ArgumentParser()
subparsers = test_parser.add_subparsers(de... | null | tests/drum/test_args_parser.py | test_args_parser.py | py | 2,066 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datarobot_drum.drum.args_parser.CMRunnerArgsRegistry._reg_arg_multiclass_labels",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datarobot_drum.drum.args_parser.CMRunnerA... |
260319920 | # All print statements for debugging purposes only
# This file should probably be renamed
import requests
import lbot
INITIAL_ID = 263969345
LONG_POLLING_TIMEOUT = 60
ADDRESS = 'https://api.telegram.org/bot234875332:AAEtMhP4y8s4MhD68iCbznBTdRqYbo8rroI/'
MAX_UPDATES = 10
BOT_USERNAME = 'KleinLuisBot'
NEW_MEMBER_MESSAG... | null | server.py | server.py | py | 3,433 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "lbot.getLuisWord",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 114,
"usage_type": "attribute"
}
] |
565942217 | import random,time,queue
from multiprocessing.managers import BaseManager
from multiprocessing import freeze_support
task_queue = queue.Queue()
result_queue = queue.Queue()
class QueueManager(BaseManager):
pass
def get_task_queue():
return task_queue
def get_result_queue():
return result_queue
def tes... | null | page/python/Thread&Process/distrbuted/one.py | one.py | py | 1,039 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "queue.Queue",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "multiprocessing.managers.BaseManager",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "random.rand... |
163085130 | # Import Module
import os
import numpy as np
import pandas as pd
from tqdm import tqdm
import argparse
import torch
from torchvision import transforms, datasets
# Argparse Setting
parser = argparse.ArgumentParser(description='Argparse')
parser.add_argument('--data', type=str, help='data select; CIFAR10 / FashionMNIST... | null | Image_save.py | Image_save.py | py | 3,490 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 18,
"usage_type": "name"
},
{
"api... |
494576127 | import os
import shutil
import datetime
from logging import Logger
import torch
from torch.utils.tensorboard import SummaryWriter
from MCQ.utils import RotateItems
from MCQ import Consts
class Saver(SummaryWriter):
def __init__(self, config, saveDir: str, autoManage: bool = True, rotateItems: int = 25, reserve: ... | null | src/MCQ/utils/Saver.py | Saver.py | py | 2,733 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.utils.tensorboard.SummaryWriter",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "MCQ.Consts.NewestDir",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "MCQ.Consts",
"line_number": 14,
"usage_type": "name"
},
{
"api_na... |
403299048 | # 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: F:\GitCode\trangevi-azurecli\azure\cli\command_modules\ml\service\_batchutilities.py
# Compiled at: 2017-05-26 14:46:36
"""
batch_cli_util.py - Defines utilities... | null | pycfiles/azure_cli_ml-0.1.0a27.post3-py2.py3-none-any/_batchutilities.py | _batchutilities.py | py | 22,155 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.splitext",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 76,
"usage_type": "attribute"
},
{
"api_name": "_util.get_json",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
... |
204112250 | import numpy
import tensorflow as tf
import network
import Fisher
import linalg
d = 1
X = tf.placeholder(tf.float32, [None, d])
Y = tf.placeholder(tf.float32, [None, 1])
[YY], theta = network.affine_net([X], [d, d+25, d+25, 1], "NET", False)
cost = tf.reduce_mean(tf.square(YY - Y))
F = Fisher.linear_Fisher([YY], th... | null | Fisher_numerics.py | Fisher_numerics.py | py | 2,373 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.placeholder",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "t... |
56596824 | from __future__ import division, print_function
from Bio.SubsMat import MatrixInfo
from Bio import SeqIO
"""
Top three match:
Index=324 Name=Z286A_HUMAN Score=3021
START POS in Z286A_HUMAN: 1 START POS in Z286B_HUMAN: 1 LENGTH: 527
METDLAEMPEKGALSSQDSPHFQEKSTEEGEVAALRLTARSQETVT-----FKDVAMDFT..
METDLAEMPEKGVLSSQDSPH... | null | 2/problem2/local_alignment.py | local_alignment.py | py | 9,930 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "Bio.SubsMat.MatrixInfo.blosum50",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "Bio.SubsMat.MatrixInfo",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "Bio.SeqIO.parse",
"line_number": 232,
"usage_type": "call"
},
{
"api_... |
369445766 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Blueprint, jsonify, request
from momeet.views.base import BaseView
from momeet.models.user import (
get_user,
get_user_list_limit,
get_user_info,
EduExperience,
WorkExperience,
UserInfoProcess,
UserDetail
)
from momeet.forms.use... | null | momeet/views/api/user_info.py | user_info.py | py | 9,279 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "momeet.views.base.BaseView",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "momeet.models.user.get_user",
"line_number": 33,
"usage_type": "call"
},
{
"api_name":... |
218229836 | import subprocess
import requests
from django.http import JsonResponse
from django.shortcuts import render
from lxml import etree
URL_TEMPLATE = 'https://www.fpds.gov/ezsearch/FEEDS/ATOM?FEEDNAME=PUBLIC&q=PIID:{piid}'
def get_fpds(request, contract_no):
data = {'soup': contract_no}
url = URL_TEMPLATE.format... | null | server/fpds/views.py | views.py | py | 959 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "subprocess.check_output",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lxml.etree.fromstring",
"line_number": 22,
"usage_type": "call"
},
{
"api_name":... |
425110567 | from keras.layers.recurrent import SimpleRNN
import numpy as np
from keras.models import Sequential
from keras.layers import LSTM
from keras.layers import Dense
import random
from matplotlib import pyplot as plt
from tensorflow.python.ops.gen_batch_ops import batch
inputSize = 50
#generates a set of seeded random int... | null | numberPrediction.py | numberPrediction.py | py | 2,035 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.randint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numbe... |
13929734 | import asyncio
from datetime import datetime
from app.Renderer import Render
from app import log, cli_parser
"""
Entry Point of the Crawler App
"""
if __name__ == '__main__':
# read input params from console
cli_dict_values = cli_parser()
# print the above params for debug purposes
print('Starting Gra... | null | app/Main.py | Main.py | py | 1,186 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "app.cli_parser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app.Crawler.Crawler",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.da... |
151536159 | """Converts celeb_A images to TFRecords file format with Example protos."""
from datetime import datetime
import os
import sys
import random
import threading
import tensorflow as tf
import numpy as np
tf.app.flags.DEFINE_string('directory', './data/celebA_data',
'Image directory')
tf.app.... | null | process_celebA.py | process_celebA.py | py | 7,018 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.app.flags.DEFINE_string",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorflow.app",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.app.flags.DEFINE_string",
"line_number": 15,
"usage_type": "call"
},
... |
585085698 | # -*- coding: utf-8 -*-
"""This module provides Threaded and Tornado-compatible backends
fo the executor class.
"""
from __future__ import print_function
import threading
import time
import json
import uuid
from ws4py.client import WebSocketBaseClient
from ws4py.client.threadedclient import WebSocketClient as Threade... | null | rosbridge_pyclient/executor.py | executor.py | py | 15,228 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "wsaccel.patch_ws4py",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "ws4py.configure_logger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
22936769 | import logging
from typing import Optional
from urllib.error import HTTPError, URLError
from urllib.request import urlopen
from core.static.patterns import WIRESHARK_MANUF_FILE
def get_oui_info(manufs: dict, mac: str) -> Optional[str]:
"""
This function takes a dictionary object containing OUI manufacturer's... | null | core/lib/manuf_file.py | manuf_file.py | py | 3,168 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Optional",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "logging.debug",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_nu... |
425235452 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 1 12:07:43 2019
@author: juangabriel
"""
# Regresión Lineal Simple
# Cómo importar las librerías
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importar el data set
dataset = pd.read_csv('Salary_Data.csv')
# Todas menos... | null | datasets/Part 2 - Regression/Section 4 - Simple Linear Regression/simple_linear_regression.py | simple_linear_regression.py | py | 2,312 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 43,
"usage_type": "call"
... |
637461225 | #!/usr/local/bin/python3
import wsgiref.simple_server as wg
import urllib.request as url
import urllib.parse as urlp
import json
apicode = "b0d45b8cc18faf92d77e9825fd5aae74"
def MyWebApp(environ, start_response):
print("In Web App")
if environ['REQUEST_METHOD'] == "GET" :
response = """
... | null | codes/python/weatherserver.py | weatherserver.py | py | 4,496 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib.parse.parse_qs",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "urllib.requ... |
129254394 | from flask import Flask, redirect, render_template, request, flash
from models import db, connect_db, Pet
from flask_debugtoolbar import DebugToolbarExtension
from forms import AddPetForm
app = Flask(__name__)
app.config["SECRET_KEY"] = "thesecretkeysecret"
app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False
app.config... | null | app.py | app.py | py | 1,152 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_debugtoolbar.DebugToolbarExtension",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.connect_db",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": ... |
613603735 | from flask import Flask, render_template, redirect, url_for, request
from manager import *
from event import *
app = Flask(__name__)
manager_instance = Manager()
@app.route('/')
def index():
return render_template('index.html')
@app.route('/add', methods=["POST"])
def add():
name = request.form['name']
... | null | srinidhi/PycharmProjects/mini-webpage/main_new.py | main_new.py | py | 2,088 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "flask.reques... |
361751004 | from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.forms import fields
from .models import Treballadors, Tramit, Document, Peticio
class CustomUserCreationForm(UserCreationForm):
class Meta(UserCreationForm):
model = Treballadors
fields = ('... | null | permivac/tramitador/forms.py | forms.py | py | 2,015 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.Treballadors",
"line_number": 9,
"usage_type":... |
465693802 | # def compute_line_ratio(x: tuple, y: tuple):
# if (y[0] - x[0] != 0):
# k = float(y[1] - x[1]) / float(y[0] - x[0])
# b = x[1] - k * x[0]
# else:
# k = 100000000
# b = y[0]
# return (round(k, 2), round(b, 2)) if b != 0 else (k, 0)
#
# def compute_distance_node_to_line(node: ... | null | escher/wild_dogs.py | wild_dogs.py | py | 2,717 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "math.hypot",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 56,
"usage_type": "call"
}
] |
268787487 | # libraries
import cv2
from concurrent.futures import ThreadPoolExecutor
from threading import Thread
from datetime import datetime
from facial_detectors import detect_face, recog_face, Recogniser
from checking import CountsPerSec, putIterationsPerSec
import configs
# setup reading frames for threading
class VideoGet... | null | past_testing/camera_threadv2.py | camera_threadv2.py | py | 3,660 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "facial_detectors.detect_face",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "facial... |
611201337 | # polynomial evaluation
eq = "x**3 + x**2 + x + 1"
x = 1
ans = eval(eq)
print (ans)
# lambda function
x = lambda x,y:x+y
print(x(10,20))
# reduce function
# The reduce() function applies a function of two arguments cumulatively on a list of objects in succession from left to right to reduce it to one value. Say you ... | null | note/script.py | script.py | py | 1,315 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "functools.reduce",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "operator.itemgetter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "collections.Cou... |
338361542 | '''DrOpt controller.
This is the DrOpt project control script.
It encapsulates the procedure for creating and running a DrOpt project
by standardizing the required model file and the config file.
Usage:
Run the following command under the directory storing your DrOpt
project (which typically includes 'model.py' a... | null | src/dropt/cmd/droptctl.py | droptctl.py | py | 3,386 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.sleep",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "importlib.util.util.spec... |
445833030 | #!/usr/bin/env
# -*- coding: utf-8 -*-
"""Set all projects to private commenting
"""
from website import app, models, settings
import logging
logger = logging.getLogger(__name__)
settings.SEARCH_ENGINE = None
def main():
app.init_app()
for node in models.Node.find():
node.comment_level = 'private'
... | null | scripts/migrate_comment_level.py | migrate_comment_level.py | py | 446 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "website.settings.SEARCH_ENGINE",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "website.settings",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": ... |
92167364 | #!/usr/bin/env python
"""
plc_status_request.py
Will continually ask the PLC for its status...
"""
import roof_control_functions as rcf
import settings_and_error_codes as set_err_codes
import time
import logging
import mmap
import os
import struct
import ctypes
import subprocess
OPEN_ROOF_CHARACHTER = b'o'
CLOSE_RO... | null | plcd.py | plcd.py | py | 30,664 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "logging.FileHandler",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "settings_and_... |
456123507 | import glob
from pydub import AudioSegment
list_of_files = glob.glob('*.wav') # create the list of file
fileoutCount = 1
def match_target_amplitude(sound, target_dBFS):
change_in_dBFS = target_dBFS - sound.dBFS
return sound.apply_gain(change_in_dBFS)
for file_name in list_of_files:
sound = AudioSe... | null | sounds/change_volume_in_multiple.py | change_volume_in_multiple.py | py | 541 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "glob.glob",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pydub.AudioSegment.from_file",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pydub.AudioSegment",
"line_number": 12,
"usage_type": "name"
}
] |
33755343 | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.patheffects as PathEffects
from sklearn.manifold import TSNE
def scatter(x, colors,n):
# We choose a color palette with seaborn.
palette = np.array(sns.color_palette("hls", n))
# We create a scatt... | null | homework_2/code/cluster/tsne_song.py | tsne_song.py | py | 2,446 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "seaborn.color_palette",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
614411289 | #!/usr/bin/env python
import glob
import numpy as np
from scipy.interpolate import interp2d
from scipy.interpolate import griddata
import matplotlib.pylab as plt
from matplotlib import cm
import sys
if len(sys.argv) > 1:
threshold = int(sys.argv[1])
else:
threshold = 4
dataL = []
dlist = ["0.02","0.05","0.10","0.1... | null | pInterp.py | pInterp.py | py | 4,248 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_numbe... |
250796406 | import unittest
from selenium import webdriver
from time import sleep
class AddRemoveElements_Reto(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome(executable_path = './chromedriver')
driver = self.driver
driver.get('https://the-internet.herokuapp.com/')
driver.... | null | test_add_remove.py | test_add_remove.py | py | 1,059 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "time... |
120799040 | import pandas as p
import math
import numpy as np
from sklearn.model_selection import train_test_split
file = p.read_csv('lorawan_antwerp_2019_dataset.csv') # doi 10.5281/zenodo.1212478
columns = file.columns
x = file[columns[0:72]]
x = -abs(x)
# x = x.join(file[columns[69]]) # LoRa spreading factor
y = file[column... | null | dataset_creation.py | dataset_creation.py | py | 1,208 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 17,
"usage_type": "call... |
592681810 | import imageio
import argparse
import torchvision.transforms as transforms
from PIL import Image
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument("InFile", help="image input file name", type=str)
parser.add_argument("OutFile", help="Raw image out file name", type=str)
parser.add_argument("Res... | null | ImageConverter/ImageToByteArray.py | ImageToByteArray.py | py | 1,249 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "torchvision.transform... |
39486201 | from django.urls import path
from . import views
app_name = "series"
urlpatterns = [
path('', views.home1, name="home1"),
path('details/<int:id>/', views.detail, name="detail"),
path('addseries/', views.add_series, name= "add_series"),
path('editseries/<int:id>/', views.edit_series, name= "edit_series"),
pa... | null | series/urls.py | urls.py | py | 712 | python | en | code | null | code-starcoder2 | 83 | [
{
"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",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
172895796 | # coding: utf-8
import os
import pytest
from decimal import Decimal
from invoice.models import Invoice, InvoiceItem, Address, BankAccount
@pytest.fixture
def invoice(scrope="session"):
contractor, created = Address.objects.get_or_create(
name='Simon Luijk',
street=u'Rydsvägen 242',
town=u... | null | tests/conftest.py | conftest.py | py | 1,998 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "invoice.models.Address.objects.get_or_create",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "invoice.models.Address.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "invoice.models.Address",
"line_number": 11,
"usage_type"... |
439565389 | from django import forms
from .models import Person,Employee,SmallBranch
from django.utils.translation import ugettext_lazy as _
class DateInput(forms.DateInput):
input_type = 'date'
class Employee(forms.ModelForm):
class Meta:
model = Employee
fields = ('grade','date_register','manager')#'__a... | null | personnel/forms.py | forms.py | py | 1,095 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.DateInput",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelForm",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "dja... |
348033566 | from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
from django.conf import settings
from django.views.static import serve
from rest_framework import routers
from points.views import *
from rest_framework.authtoken import views
router = routers.DefaultRouter()
route... | null | fixterlandapi/fixterlandapi/urls.py | urls.py | py | 972 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
"line_number": 21,
"usage_type": "call"
},
{
"api_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.