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
425850101
import numpy as np from sklearn.linear_model import LinearRegression import pickle # num_tuples = 36244344 data=np.loadtxt('ranges.txt') # for i in range(num_tuples): # X.append(i) # X = np.array(X) # X=X.reshape(-1,1) n = data.size X = [] for i in range(n): X.append([]) X[i].append(data[i]**0.5) X[i].append(d...
null
index_scan/vu_model_1/quadratic.py
quadratic.py
py
604
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.loadtxt", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 24, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearR...
160940927
r"""Test `lmp.config.BaseConfig.__iter__`. Usage: python -m unittest test.lmp.config.test_iter """ # built-in modules from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import inspect import unittest from typing i...
null
test/lmp/config/test_iter.py
test_iter.py
py
4,026
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 27, "usage_type": "attribute" }, { "api_name": "inspect.signature", "line_number": 35, "usage_type": "call" }, { "api_name": "lmp.config.BaseConfig.__iter__", "line_number": 35, "usage_type": "attribute" }, { "api_...
455501056
import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LogisticRegression from sklearn.decomposition import PCA import utils df_wine = utils.read_csv('wine.data', ...
null
ml_05_02_LDA.py
ml_05_02_LDA.py
py
3,291
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 23, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train...
631273001
from django.conf import settings from django.http import Http404 from django.shortcuts import get_object_or_404 from nepal.mail.models import MailAlias def get_alias_or_404(request, alias_id): alias = get_object_or_404(MailAlias, pk=alias_id) if alias.domain.profile == request.user: return alias ...
null
nepal/mail/shortcuts.py
shortcuts.py
py
712
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 7, "usage_type": "call" }, { "api_name": "nepal.mail.models.MailAlias", "line_number": 7, "usage_type": "argument" }, { "api_name": "django.http.Http404", "line_number": 12, "usage_type": "call" }, { ...
8253301
import numpy as np from gym.envs.mujoco.ant_v3 import AntEnv class Ant(AntEnv): def __init__(self, get_reward=None, *args, **kwargs): kwargs['exclude_current_positions_from_observation'] = False super().__init__(*args, **kwargs) if self._exclude_current_positions_from_observation == True:...
null
envs/ant.py
ant.py
py
1,358
python
en
code
null
code-starcoder2
76
[ { "api_name": "gym.envs.mujoco.ant_v3.AntEnv", "line_number": 5, "usage_type": "name" }, { "api_name": "numpy.testing.assert_almost_equal", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.testing", "line_number": 43, "usage_type": "attribute" } ]
319709123
#!/usr/bin/python3 # (c) Bernhard Tittelbach, 2019 ### this file replaces ssh-status-json.sh ### meant to be run via .ssh/authorized_keys as forced command= import json import sys import os import shutil env_ssh_original_command_ = "SSH_ORIGINAL_COMMAND" spaceapi_status_dst_filepath_="/dev/shm/www/spaceapi.json" spa...
null
scripts/ssh-status-json.py
ssh-status-json.py
py
1,575
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
54947714
import os import itertools from rpy2.robjects.packages import importr class HarryPotterTextRDA(object): def __init__(self, book_dir="data/temp", to_text=False): self.book_dir = book_dir self.book_name = [ "philosophers_stone", "chamber_of_secrets", "prisoner_of...
null
harry-old.py
harry-old.py
py
2,988
python
en
code
null
code-starcoder2
76
[ { "api_name": "rpy2.robjects.packages.importr", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.join...
96695863
import discord import aiohttp import re import traceback from bs4 import BeautifulSoup as b_soup from datetime import datetime from random import choice from io import BytesIO from urllib.parse import quote_plus from discord.ext import commands from .utils import checks, time class Misc: def __init__(self, bot):...
null
cogs/command_misc.py
command_misc.py
py
5,921
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.choice", "line_number": 28, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 43, "usage_type": "call" }, { "api_name": "discord.Embed", "line_number": 46, "usage_type": "call" }, { "api_name": "discord.ext.commands.co...
276071996
from __future__ import print_function import googleapiclient.discovery import pickle import os.path import sys import json from google.oauth2 import service_account from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Requ...
null
add_delegate.py
add_delegate.py
py
2,038
python
en
code
null
code-starcoder2
76
[ { "api_name": "google.oauth2.service_account.Credentials.from_service_account_file", "line_number": 19, "usage_type": "call" }, { "api_name": "google.oauth2.service_account.Credentials", "line_number": 19, "usage_type": "attribute" }, { "api_name": "google.oauth2.service_account"...
387982521
import requests import urllib.parse from bs4 import BeautifulSoup from db import * find_card_with_id_query = 'select card_number from cards where card_number = {CARD_NUMBER}'.format(CARD_NUMBER='1') def get_soup_for_card_info(card_url, card_name): url = 'https://' + urllib.parse.quote(card_url.format(CARD_NAME=car...
null
scrapper_for_product_details.py
scrapper_for_product_details.py
py
4,643
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.parse.parse.quote", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.parse.parse", "line_number": 11, "usage_type": "attribute" }, { "api_name": "urllib.parse", "line_number": 11, "usage_type": "name" }, { "api_name": "request...
45935797
from __future__ import unicode_literals from collections import OrderedDict import importlib import logging import os import sys import unittest def getTests(targets): # If a string was passed in, put it into a list. if type(targets) != list: targets = [targets] # Make sure there are no duplicate...
null
green/loader.py
loader.py
py
4,387
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.OrderedDict", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 26, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 29, "usage_type": "call" }, { "api_name": "unittest.TestLoad...
611902143
# -------------------------------------------------------- # DaSiamRPN # Licensed under The MIT License # Written by Qiang Wang (wangqiang2015 at ia.ac.cn) # -------------------------------------------------------- import torch.nn as nn import torch.nn.functional as F import torch import numpy as np class SiamRPN(nn....
null
code/net.py
net.py
py
5,200
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
380129970
from typing import Any, Dict from azure.storage.blob import BlobClient, BlobServiceClient from ..config import local_config from .base import Source class AzureBlobStorage(Source): """ A class for pulling data from the Azure Blob Storage (do not confuse with Azure Data Lake Gen1 and Azure Data Lake Gen2...
null
viadot/sources/azure_blob_storage.py
azure_blob_storage.py
py
3,085
python
en
code
null
code-starcoder2
76
[ { "api_name": "base.Source", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 22, "usage_type": "name" }, { "api_name": "config.local_config.get", "line...
453684984
import re import json from collections import Counter file = open("all_reviews_texts_318352.txt", encoding='UTF8') reg = [] massiv = [] massivCat2 = [] goda = [] for line in file: res = re.search(r'\d\d.\d\d.\d{4}', line) if res: reg.append(res.group()[6:]) pik = json.loads(line) if...
null
week1.py
week1.py
py
1,069
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.search", "line_number": 10, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.Counter", "l...
153155237
import random import matplotlib.pyplot as plt from matplotlib import style style.use('fivethirtyeight') fig = plt.figure() def create_plots(): xs = [i+1 for i in range(10)] ys = [random.randrange(1, 11, 1) for _ in range(10)] return xs, ys if __name__ == "__main__": ax1 = plt.subplot2grid((6,...
null
p5_subplots.py
p5_subplots.py
py
784
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.style.use", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 5, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotli...
41222607
# -*- coding: utf-8 -*- import logging import Artus.Utility.logger as logger log = logging.getLogger(__name__) import array import fcntl import re import termios def flattenList(listOfLists): """ flatten 2D list return [1, 2, 3, 4, ...] for input [[1, 2], [3, 4, ...], ...] """ return [item for subList in list...
null
Utility/python/tools.py
tools.py
py
1,887
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "re.search", "line_number": 27, "usage_type": "call" }, { "api_name": "array.array", "line_number": 64, "usage_type": "call" }, { "api_name": "fcntl.ioctl", "line_number...
639231642
from mmcv.cnn import build_conv_layer, build_norm_layer from mmcv.runner import load_checkpoint, force_fp32 from torch import nn as nn import torch from mmdet.models import BACKBONES @BACKBONES.register_module() class SECONDMASK(nn.Module): """Backbone network for SECOND/PointPillars/PartA2/MVXNet. Args: ...
null
mmdet3d/models/backbones/second_mask.py
second_mask.py
py
6,081
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "mmcv.cnn.build_conv_layer", "line_number": 40, "usage_type": "call" }, { "api_name": "mmcv.cnn.buil...
469944025
#Q2 import pylab as g import pandasql as s import pandas as p position_d = p.read_excel(r"C:\Users\Hp\Documents\Data Science Project\data\Football Data New Excel Format.xlsx","Position") wage_d = p.read_excel(r"C:\Users\Hp\Documents\Data Science Project\data\Football Data New Excel Format.xlsx","Wage") df = p.concat(...
null
Analysis/Post Visualization/Position/Q2.py
Q2.py
py
636
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_excel", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 9, "usage_type": "call" }, { "api_name": "pandasql.sqldf", "...
546869069
import argparse import sys from .._main import ( categorize_urls, find_files, find_urls, is_allowed, print_to_screen, read_config, ) try: from importlib import metadata except ImportError: # Python 3.7 and earlier pass def check(argv=None): # Parse command line arguments. ...
null
src/deadlink/_cli/check.py
check.py
py
4,368
python
en
code
null
code-starcoder2
76
[ { "api_name": "_main.find_files", "line_number": 26, "usage_type": "call" }, { "api_name": "_main.read_config", "line_number": 28, "usage_type": "call" }, { "api_name": "_main.is_allowed", "line_number": 40, "usage_type": "call" }, { "api_name": "_main.find_urls",...
433427436
''' SI 618: HW 2 Uniqname: gracfu ''' import urllib2, re, json, time, pydot, itertools from collections import OrderedDict from bs4 import BeautifulSoup #step 1: fetch IMDB top 100 and save in 'step1.html' url = urllib2.urlopen('http://www.imdb.com/search/title?at=0&sort=num_votes&count=100') movie = unicode(url.read(...
null
imdb_costars.py
imdb_costars.py
py
1,839
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib2.urlopen", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 17, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "line_number": 33, "usage_type": "call" }, { "api_name": "time.sleep", "l...
303913227
import random import argparse import json import os import torch from torch import optim import torch.nn as nn from torch.nn.utils import clip_grad_norm_ import params from utils import init_model, save_models, \ build_vocab_music, load_data, get_data_loader, Vocabulary from model import Encoder, KnowledgeEncoder, ...
null
train.py
train.py
py
9,645
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.backends", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.backends", "line_number": 24, "usage_type": "attribute" }, { "api_name": "argpa...
320344868
# coding: utf-8 # Create your views here. from django.http import HttpResponse from blog.models import Post,Tag,Category from django.shortcuts import render,get_object_or_404 import markdown ''' def index(request): return render(request,'static/index.html',context={ 'title':'我的博客首页', 'welcome':'...
null
Django_ch/myblog/blog/views.py
views.py
py
983
python
en
code
null
code-starcoder2
76
[ { "api_name": "blog.models.Post.objects.all", "line_number": 23, "usage_type": "call" }, { "api_name": "blog.models.Post.objects", "line_number": 23, "usage_type": "attribute" }, { "api_name": "blog.models.Post", "line_number": 23, "usage_type": "name" }, { "api_n...
566089895
# Matej Badin | UHP | 2019 | # -------------------------------------------------------------------- | # Packages needed : numpy, re, os, pandas, Camelot, OpenCV | # pdfminer.six -- requirement already for Camelot | # ----------------------...
null
CRZ_klasifikacia_zmluv/03_extract_tables.py
03_extract_tables.py
py
4,061
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getcwd", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 35, "usage_type": "call" }, { "api_name": "pdfminer.pdfparser.PDFParser", ...
371941526
#!/usr/bin/env python from setuptools import setup, Extension liboio = Extension('oio-streams', sources=[], libraries=['oio-streams']) setup(name='pyostreams', version = '0.0.3', description = 'Python interface to ciostreams .', author = 'Angelo Frangione', author_e...
null
pypi_install_script/pyostreams-0.0.3.tar/setup.py
setup.py
py
494
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.Extension", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 11, "usage_type": "call" } ]
357557741
import os import json import time import logging from hpbandster.core.result import logged_results_to_HBS_result from autoPyTorch.pipeline.base.pipeline_node import PipelineNode class SaveResults(PipelineNode): def fit(self, result_dir, fit_duration, test_score, fit_result, autonet, task_id): if (task_id...
null
autoPyTorch/utils/benchmarking/benchmark_pipeline/save_results.py
save_results.py
py
1,115
python
en
code
null
code-starcoder2
76
[ { "api_name": "autoPyTorch.pipeline.base.pipeline_node.PipelineNode", "line_number": 9, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "...
162965801
from common import * from matplotlib.lines import Line2D import matplotlib.ticker as ticker import os from matplotlib import container from common import * from collections import OrderedDict import pandas from matplotlib.markers import MarkerStyle import traceback series = ["loadvslat-kthmorning-cx5/RSS" , "loadvsla...
null
loadvslat/plotvslat.py
plotvslat.py
py
6,393
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 41, "usage_type": "call" }, { "api_name": "os.path", "line_number": 41, "usage_type": "attribute" }, { "api_name": "os.sep", "line_number": 41, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line...
55875103
from android import activity from able.android.jni import PythonBluetooth from able.dispatcher import BluetoothDispatcherBase from jnius import autoclass Activity = autoclass('android.app.Activity') BLE = autoclass('org.able.BLE') BluetoothGattDescriptor = autoclass( 'android.bluetooth.BluetoothGattDescriptor') ...
null
able/android/dispatcher.py
dispatcher.py
py
1,535
python
en
code
null
code-starcoder2
76
[ { "api_name": "jnius.autoclass", "line_number": 7, "usage_type": "call" }, { "api_name": "jnius.autoclass", "line_number": 8, "usage_type": "call" }, { "api_name": "jnius.autoclass", "line_number": 10, "usage_type": "call" }, { "api_name": "able.dispatcher.Bluetoo...
412871986
""" Create database example with Peewee ORM, sqlite and Python """ import logging import customer_model as cm logging.basicConfig(level=logging.INFO) LOGGER = logging.getLogger(__name__) LOGGER.info('Creating a database using the customer model') cm.database.create_tables([cm.Customer]) cm.database.close()
null
students/Shirin_A/lesson03/assignment/src/create_database.py
create_database.py
py
316
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "customer_model.d...
243499487
import warnings import sys import numpy as np import pandas as pd from pandas import Series from statsmodels.tsa.arima_model import ARIMA from sklearn.metrics import mean_squared_error def mean_absolute_percentage_error(y_true, y_pred): rng = len(y_true) diff = [] for i in range(0,rng): diff.append(y_true[i] - ...
null
System_Evaluation_Part/Arima-Evaluate.py
Arima-Evaluate.py
py
1,899
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.abs", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 17, "usage_type": "call" }, { "api_name": "statsmodels.tsa.arima_model.ARIMA", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.read_cs...
535027771
""" 0420011 Отчетность об операциях с денежными средствами некредитных финансовых организаций. Раздел 1. Операции, совершенные с использованием банковских счетов некредитной финансовой организации 1.1. Виды и суммы операций, совершенных по банковским счетам некредитной финансовой организации Обороты http://www.cbr.ru/...
null
module/forms_maker/sr_0420001_ods_r1_p1_p1_oboroty.py
sr_0420001_ods_r1_p1_p1_oboroty.py
py
7,989
python
en
code
null
code-starcoder2
76
[ { "api_name": "openpyxl.utils.column_index_from_string", "line_number": 26, "usage_type": "call" }, { "api_name": "module.functions.razdel_name_row", "line_number": 58, "usage_type": "call" }, { "api_name": "openpyxl.utils.column_index_from_string", "line_number": 59, "us...
64040877
from helpers.base_helper import TrainTestHelper, transform_train, transform_test from utils import get_channels_axis,save_roc_pr_curve_data, show_roc_pr_curve_data from models.ae_backbone import CAE_backbone, AE_backbone from keras2pytorch_dataset import trainset_pytorch import torch.utils.data as data import torch im...
null
helpers/rdae_helper.py
rdae_helper.py
py
5,710
python
en
code
null
code-starcoder2
76
[ { "api_name": "helpers.base_helper.TrainTestHelper", "line_number": 16, "usage_type": "name" }, { "api_name": "models.ae_backbone.CAE_backbone", "line_number": 25, "usage_type": "call" }, { "api_name": "models.ae_backbone.AE_backbone", "line_number": 29, "usage_type": "ca...
273266927
from PIL import Image import os from resizeimage import resizeimage for filename in os.listdir(f"{os.path.dirname(__file__)}/../assets/items_female"): if filename.endswith(".jpg"): im = Image.open(f"{os.path.dirname(__file__)}/../assets/items_female/{filename}") if im.size[1] != 470: r...
null
_src/female_img_resizer.py
female_img_resizer.py
py
538
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_numbe...
487852188
# -*- encoding:utf-8 -*- # Copyright (c) Alibaba, Inc. and its affiliates. import json import logging import os import tensorflow as tf from tensorflow.python.lib.io import file_io from easy_rec.python.main import _train_and_evaluate_impl from easy_rec.python.utils import config_util from easy_rec.python.utils import...
null
easy_rec/python/train_eval.py
train_eval.py
py
4,873
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.__version__", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tensorflow.compat", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 18, "usage_type": "call" }, { "api_name":...
588560226
import os, sys import numpy as np from skimage import io,transform img_folder_path = sys.argv[1] target_img = sys.argv[2] if(img_folder_path[0] == '/'): img_folder_path = img_folder_path[1:len(img_folder_path)] # read image & construct X for image_no in range(0,415): img = io.imread(img_folder_path + '/' + str(ima...
null
hw6/pca.py
pca.py
py
1,096
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "skimage.io.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "skimage.io", "line_nu...
142366334
from django.db import DatabaseError from user_office.models import ICO_Info from blockchain.ico.contracts import CrowdsaleContract from ico_portal.utils.service_object import ServiceObject, service_call class SyncICOInfo(ServiceObject): def get_total_supply(self, context): try: total_supply =...
null
blockchain/ico/services/sync_ico_info.py
sync_ico_info.py
py
1,043
python
en
code
null
code-starcoder2
76
[ { "api_name": "ico_portal.utils.service_object.ServiceObject", "line_number": 8, "usage_type": "name" }, { "api_name": "blockchain.ico.contracts.CrowdsaleContract", "line_number": 11, "usage_type": "call" }, { "api_name": "user_office.models.ICO_Info", "line_number": 18, ...
291919786
from sklearn import linear_model import os import random FEATURESMAP = { 1: ['weight0', 'height0', 'waistline0', 'checkinCount1'], 2: ['weight1', 'height0', 'waistline1', 'checkinCount2'], 3: ['weight2', 'height0', 'waistline2', 'checkinCount3'], 4: ['weight3', 'height0', 'waistline3', 'checkinCount4'...
null
git/NeuralNet_predict_weight/min_max_t1/t1/predict_oneStep3.py
predict_oneStep3.py
py
9,164
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.uniform", "line_number": 169, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LogisticRegression", "line_number": 321, "usage_type": "call" }, { "api_name": "sklearn.linear_model", "line_number": 321, "usage_type": "name" } ]
531643697
import numpy as np import random def est_entropy(probs): res = 0 nbz = 0 for prob in probs: if prob == 0: nbz += 1 else: res = res - prob * np.log2(prob) return res, nbz def count_value(listvalue, value): return np.sum(np.array(listvalue) == value) def get_probs(x): minrange = int(np.min(x)) ...
null
range_coding.py
range_coding.py
py
17,153
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.log2", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 18, ...
501615788
#! /usr/bin/env python # # Copyright (C) 2016 Basho Technologies, Inc. # # 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 require...
null
riak_mesos/config.py
config.py
py
9,205
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 27, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 51, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 97, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 131, ...
431316177
# 멀티 프로세싱을 통한 웹 스크래핑 1 import requests from bs4 import BeautifulSoup as bs import time from multiprocessing import Pool def get_link(): url = 'https://beomi.github.io/beomi.github.io_old/' data = requests.get(url).text soup = bs(data, 'html.parser') print(soup) my_title = soup.select('h3 > ...
null
pypro2/net/multi_scrap1.py
multi_scrap1.py
py
881
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
126262760
# -*- coding: utf-8 -*- # ============================================================================= # Step 1 Import Libraries. # ============================================================================= import numpy as np import matplotlib.pyplot as plt from keras.models import Model, Sequential, load_model f...
null
imageClassifierUseCNN.py
imageClassifierUseCNN.py
py
4,933
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.models.Sequential", "line_number": 25, "usage_type": "call" }, { "api_name": "keras.layers.Convolution2D", "line_number": 28, "usage_type": "call" }, { "api_name": "keras.layers.Activation", "line_number": 29, "usage_type": "call" }, { "api_na...
539751250
#The aim is to put any size of glasses on any size of frontal face image. The code has already been developing, #and for future, I want to help people choose their glasses by just looking a front facing camera at the end of the work. import cv2 import numpy as np face_cascade = cv2.CascadeClassifier('Haarcas...
null
Put a glass on a face.py
Put a glass on a face.py
py
3,103
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.CascadeClassifier", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imread", ...
558364945
from PIL import Image import cv2 import numpy as np class ChineseCharacter: def __init__(self, font: str, value: str, image: Image.Image, source: Image.Image =None, location: list =None): self.font = font self.value = value if value != '' and value != '.' and value != '\\' and value != '\/' else ...
null
Character.py
Character.py
py
1,301
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.Image", "line_number": 8, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_number": 8, "usage_type": "name" }, { "api_name": "PIL.Image.Image", "line_number": 16, "usage_type": "attribute" }, { "api_name": "PIL.Image", "li...
30846261
from django.conf import settings from django.contrib.auth.models import User from django.core.mail import send_mail from django.utils import timezone from apps.core.models import ServiceMap, UserProfile, EmailAuthToken, ResetPWToken from apps.core.forms import UserForm, UserProfileForm from secrets import token_hex fro...
null
apps/core/backends.py
backends.py
py
10,031
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects.filter", "line_number": 31, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 31, "usage_type...
430465777
import os import errno import uuid as _uuid import logging class AgentID: """An identifier for an agent or a topic.""" def __init__(self, name, is_topic=False): self.name = name if is_topic: self.is_topic = True else: self.is_topic = False class Performative:...
null
src/main/python/fjagepy/org_arl_fjage/__init__.py
__init__.py
py
3,282
python
en
code
null
code-starcoder2
76
[ { "api_name": "uuid.uuid4", "line_number": 48, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 73, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 74, "usage_type": "attribute" }, { "api_name": "os.path.exists", ...
291369013
# Copyright (c) OpenMMLab. All rights reserved. from mmcv.transforms.processing import TestTimeAug from mmengine.dataset.sampler import DefaultSampler from mmengine.visualization.vis_backend import LocalVisBackend from mmdet3d.datasets.semantickitti_dataset import SemanticKittiDataset from mmdet3d.datasets.transforms....
null
mmdet3d/configs/_base_/datasets/semantickitti.py
semantickitti.py
py
8,373
python
en
code
null
code-starcoder2
76
[ { "api_name": "mmdet3d.datasets.transforms.loading.LoadPointsFromFile", "line_number": 87, "usage_type": "name" }, { "api_name": "mmdet3d.datasets.transforms.loading.LoadAnnotations3D", "line_number": 93, "usage_type": "name" }, { "api_name": "mmdet3d.datasets.transforms.loading....
517236678
from django.urls import path from store.views import ( GroupListView, ProductDetailView, GroupDetailView, CartView, AddToCartView, DeleteFromCartView, ChangeQTYView, MakeOrderView, ProductSearchView, ProductListView, EmailView, ) urlpatterns = [ path('', GroupListView.a...
null
store/urls.py
urls.py
py
1,111
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 18, "usage_type": "call" }, { "api_name": "store.views.GroupListView.as_view", "line_number": 18, "usage_type": "call" }, { "api_name": "store.views.GroupListView", "line_number": 18, "usage_type": "name" }, { "api_...
441732611
#!/usr/bin/env python # -*- coding: utf-8 -*- import collections import logging import matplotlib.pyplot as plt def defaultPlotStruct(subplot_size, title=None, figsize=None, subplot_space=0.03, borderwidth=1, xlabel=None, xticklabel_positions=None, xticklabel_values=None, ...
null
mestrado/plotModels.py
plotModels.py
py
12,285
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.debug", "line_number": 70, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 73, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 73, "usage_type": "name" }, { "api_name": "collection...
458288094
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('catalog', '0003_auto_20150525_1419'), ] operations = [ migrations.CreateModel( name='Order', fields=...
null
catalog/migrations/0004_auto_20150525_2211.py
0004_auto_20150525_2211.py
py
1,084
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
348549713
from collections import OrderedDict from pprint import pprint from collections import defaultdict print('############################### 5.1234') from zoo import hours as info #import zoo info() print('############################### 5.56') plain = dict ( a = 1, b = 2, c =...
null
ex5.py
ex5.py
py
668
python
en
code
null
code-starcoder2
76
[ { "api_name": "zoo.hours", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 19, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 24, "usage_type": "call" }, { "api_name": "collections.defaultdic...
246616154
# Disable warnings import warnings warnings.filterwarnings("ignore") import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import itertools from sklearn.model_selection import train_test_split from sklearn.impute import SimpleImputer from sklearn.preprocessing import MinMaxScal...
null
explore.py
explore.py
py
7,731
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 44, "usage_type": "call" }, { "api_name": "sklearn.prep...
444838679
def bookSearch(book,page): import requests from bs4 import BeautifulSoup import time import random d = {} for i in range(page): url = 'https://search.books.com.tw/search/query/cat/all/key/{}/sort/1/page/{}/v/0/'.format(book,i) res = requests.get(url) soup = BeautifulSoup(...
null
博客來書籍搜尋.py
博客來書籍搜尋.py
py
1,415
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 11, "usage_type": "call" }, { "api_name": "random.randint", "line_n...
269136302
from django.http import HttpResponseRedirect from django.conf import settings from re import compile from django.contrib import auth from django.contrib.auth.middleware import RemoteUserMiddleware from django.contrib.auth.backends import RemoteUserBackend from django.contrib.auth import load_backend, BACKEND_SESSION_KE...
null
files/project/middleware.py
middleware.py
py
1,565
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.middleware.RemoteUserMiddleware", "line_number": 9, "usage_type": "name" }, { "api_name": "django.contrib.auth.load_backend", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.auth.BACKEND_SESSION_KEY", "line_number": ...
96642081
import sys import os.path sys.path.append(os.path.dirname(sys.path[0])) import json from data_retrieval.get_speedlimits import SpeedLimitDataRetrieval class MockResponse: def __init__(self): self.json_data = json.dumps({}) self.status_code = 400 def good_speedlimit_response(self): ...
null
routemodel/tests/test_speedlimit_data_retrieval.py
test_speedlimit_data_retrieval.py
py
1,265
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.path.dirname", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path.path", "l...
584630010
import logging import pytest from logger import sum_even_numbers def test_sum_numbers_function_works(caplog): assert sum_even_numbers([2, 9, 4, 11, 6]) == 12 def test_sum_numbers_logging(caplog): caplog.set_level(logging.INFO, logger="app") sum_even_numbers(list(range(1, 11))) assert len(caplog.re...
null
125_algorithms/_examples/_algorithms_challenges/pybites/intermediate/315/test_logger.py
test_logger.py
py
1,116
python
en
code
null
code-starcoder2
76
[ { "api_name": "logger.sum_even_numbers", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logger.sum_even_numbers", "line_number": 14, "usage_type": "call" }, { "api_name": "logg...
464937976
from sinesp_client import SinespClient from flask import Flask, jsonify, request import os, json app = Flask(__name__) @app.route('/', methods=['GET']) def video(): if request.args.get('placa'): placa = request.args.get('placa') sc = SinespClient() resultado = sc.search(placa) re...
null
app.py
app.py
py
506
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.request...
374014832
import re from datetime import datetime from typing import Dict, Generator, Optional from urllib.parse import quote from torrent_domains import abstract from torrent_domains.abstract import Domain, SearchParameter def parse_row(item: str, i: int, parse_tracker: bool) -> Dict: torrent = {} # name try: ...
null
torrent_domains/btdb.py
btdb.py
py
3,037
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.finditer", "line_number": 15, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 15, "usage_type": "call" }, { "api_name": "torrent_domains.abstract.log_missing_keys", "line_number": 18, "usage_type": "call" }, { "api_name": "torr...
310949787
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ########## Collect count files ########## # Author: Huitian (Yolanda) Diao # Apr 30, 2019 # Dependencies: # - HTseq-count output count files ########## Import ########## import os import csv import glob from astropy.io import ascii ########## Self defined functions ####...
null
codes_locol/z_old/2_1_collect_count_files.py
2_1_collect_count_files.py
py
5,499
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.reader", "line_number": 22, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 23, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 41, ...
244006145
from __future__ import print_function import json from string import Template import requests from frinx_rest import odl_url_base, odl_headers, odl_credentials, parse_response odl_url_cli_mount = odl_url_base + "/config/network-topology:network-topology/topology/cli/node/" odl_url_cli_oper = odl_url_base + "/operat...
null
microservices/netinfra_utils/workers/cli_worker.py
cli_worker.py
py
11,835
python
en
code
null
code-starcoder2
76
[ { "api_name": "frinx_rest.odl_url_base", "line_number": 10, "usage_type": "name" }, { "api_name": "frinx_rest.odl_url_base", "line_number": 11, "usage_type": "name" }, { "api_name": "frinx_rest.odl_url_base", "line_number": 12, "usage_type": "name" }, { "api_name"...
26707363
import pygame from game.base_monster import BaseMonster class LargeMonster(BaseMonster): monster_id = "large" def __init__(self, monster_path, image_dictionary, monster_type_dict, all_monster_sprites, screen_offset, collision_grid, splat_loader, ui_manager, *groups): image = image_di...
null
game/large_monster.py
large_monster.py
py
797
python
en
code
null
code-starcoder2
76
[ { "api_name": "game.base_monster.BaseMonster", "line_number": 5, "usage_type": "name" }, { "api_name": "pygame.Color", "line_number": 14, "usage_type": "call" } ]
575109379
#! /usr/bin/env python from obspy import read import numpy as np from glob import glob from obspy.core import Trace, Stream, Stats import matplotlib.pyplot as plt from obspy.signal.filter import bandpass, highpass, lowpass from scipy.signal import fftconvolve, hanning from problem_setup import * from scipy.signal impo...
null
SYNTHETIC/MULTIPLE/proc.py
proc.py
py
11,832
python
en
code
null
code-starcoder2
76
[ { "api_name": "obspy.core.Stream", "line_number": 19, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 24, "usage_type": "call" }, { "api_name": "obspy.read", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.random.uniform", "li...
197743814
import numpy as np import tensorflow as tf from keras import backend, losses from keras.utils.generic_utils import register_keras_serializable from keras.utils.losses_utils import ReductionV2 as Reduction @register_keras_serializable(package='SegMe') class SobelEdgeLoss(losses.LossFunctionWrapper): """ Proposed i...
null
segme/loss/sobel_edge.py
sobel_edge.py
py
2,272
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.losses.LossFunctionWrapper", "line_number": 9, "usage_type": "attribute" }, { "api_name": "keras.losses", "line_number": 9, "usage_type": "name" }, { "api_name": "keras.utils.losses_utils.ReductionV2.AUTO", "line_number": 18, "usage_type": "attribute"...
566338668
from flask import redirect, render_template, request, url_for, Blueprint, flash from project.users.models import User, TeamUsers from project.teams.models import Team from project.users.views import ensure_correct_user from project.teams.forms import TeamForm from flask_login import current_user, login_required from pr...
null
project/teams/views.py
views.py
py
5,067
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 17, "usage_type": "name" }, { "api_name": "project.teams....
369960636
import os import csv import sys import json import matplotlib.pyplot as plt import pandas as pd import csv class TweetFilter: """ tweetsDirectory: contains previously collected (unfiltered) tweets expandedDirectory: contains results of expanded URLs that match known fake news domains domainJson: he...
null
postExpandUrl/FakeTweet.py
FakeTweet.py
py
7,814
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.platform", "line_number": 31, "usage_type": "attribute" }, { "api_name": "sys.argv.append", "line_number": 32, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 32, "usage_type": "attribute" }, { "api_name": "sys.argv.append", ...
65176461
from django.conf.urls import url, include from rest_framework.routers import DefaultRouter from apps._messages.views import MessagesViewSet, AboutPatientViewSet, MessagesMetaView router = DefaultRouter() router.register('about', AboutPatientViewSet) router.register('', MessagesViewSet) urlpatterns = [ url('meta...
null
lifeline-backend-master/apps/_messages/urls.py
urls.py
py
430
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "apps._messages.views.AboutPatientViewSet", "line_number": 7, "usage_type": "argument" }, { "api_name": "apps._messages.views.MessagesViewSet", "line_number": 8, ...
353720106
import datetime import logging date = datetime.datetime.now() class Logger: def __init__(self, path,logName='__name__'): self._logger = logging.getLogger(logName) handler = logging.FileHandler(path + "\\"+date.strftime('%Y%m%d%H%M%S%f') + '.log', mode='w') formatter = logging.Formatter( ...
null
Utils/logger.py
logger.py
py
824
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 5, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.F...
288163773
#vajab veel natuke tuunimist, igaks juhuks varvid veel uhe korra ule vaadata, eelisjarjekorras pall #aared praegu ainult valged import numpy as np import cv2 print(cv2.__version__) cap = cv2.VideoCapture(0) img = np.zeros((480, 640, 3), np.uint8) # tuhi must pilt , selle peale joonistatakse kontuurid kernel = np.one...
null
backup2.py
backup2.py
py
5,833
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.__version__", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.uint8", "li...
378367546
import numpy as np from sklearn.neighbors import KNeighborsClassifier from sklearn.metrics import confusion_matrix,classification_report,accuracy_score import pickle #same results for same model, makes it deterministic np.random.seed(1234) #reading data input = np.load("../datasets_nav_strategic/Coopnav_50ti...
null
KNearest/knearest_train_nav.py
knearest_train_nav.py
py
848
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.load", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.asarray", "lin...
308100158
""" Extract the location """ import nltk from nltk.corpus import stopwords import pymongo import re import distance try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET # Used for title standardization stand_title = ["Others", "Introduction and Background", "Material...
null
3_location_extract.py
3_location_extract.py
py
6,803
python
en
code
null
code-starcoder2
76
[ { "api_name": "xml.etree.ElementTree.ElementTree", "line_number": 30, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 30, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.ElementTree", "line_number": 61, "usage_type": "call" }, ...
117326964
#!/usr/bin/env python3 import argparse import copy import datetime import json import numpy as np from collections import OrderedDict from pprint import pprint from pymongo import MongoClient from gdash.config import config from gdash.queryexecutor import QueryExecutor from gdash.logtools import set_logger from gdash...
null
gdash/pingstats.py
pingstats.py
py
6,984
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymongo.MongoClient", "line_number": 52, "usage_type": "call" }, { "api_name": "gdash.mongo_tools.get_mongo_uri", "line_number": 52, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 105, "usage_type": "call" }, { "api_...
557332180
# Copyright 2017 Catalyst IT Limited # # 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...
null
qinling/utils/etcd_util.py
etcd_util.py
py
1,748
python
en
code
null
code-starcoder2
76
[ { "api_name": "oslo_config.cfg.CONF", "line_number": 19, "usage_type": "attribute" }, { "api_name": "oslo_config.cfg", "line_number": 19, "usage_type": "name" }, { "api_name": "etcd3gw.client", "line_number": 28, "usage_type": "call" }, { "api_name": "oslo_utils.u...
472251537
from elegy import types import typing as tp import jax.numpy as jnp from elegy import utils from elegy.losses.loss import Loss, Reduction def mean_percentage_absolute_error( y_true: jnp.ndarray, y_pred: jnp.ndarray ) -> jnp.ndarray: """ Computes the mean absolute percentage error (MAPE) between labels and...
null
elegy/losses/mean_absolute_percentage_error.py
mean_absolute_percentage_error.py
py
5,915
python
en
code
null
code-starcoder2
76
[ { "api_name": "jax.numpy.ndarray", "line_number": 9, "usage_type": "attribute" }, { "api_name": "jax.numpy", "line_number": 9, "usage_type": "name" }, { "api_name": "jax.numpy.abs", "line_number": 40, "usage_type": "call" }, { "api_name": "jax.numpy", "line_nu...
59995532
# assembler_word.py r'''The defining word for all assembler words. Use this to write functions in assembler. ''' import itertools from ucc.database import assembler, ast, crud from ucclib.built_in import declaration class assembler_word(declaration.word): def parse_file(self, parser, debug = 0): inst...
null
ucclib/built_in/assembler_word.py
assembler_word.py
py
5,089
python
en
code
null
code-starcoder2
76
[ { "api_name": "ucclib.built_in.declaration.word", "line_number": 15, "usage_type": "attribute" }, { "api_name": "ucclib.built_in.declaration", "line_number": 15, "usage_type": "name" }, { "api_name": "ucc.database.assembler.block", "line_number": 20, "usage_type": "call" ...
171293463
import theano from theano import tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import numpy as np from theano.tensor.nnet.conv import conv2d from theano.tensor.signal.downsample import max_pool_2d import load_cifar # from ionmf.factorization.onmf import onmf import roc_auc as auc imp...
null
cnnet_separated_cifar.py
cnnet_separated_cifar.py
py
8,277
python
en
code
null
code-starcoder2
76
[ { "api_name": "theano.sandbox.rng_mrg.MRG_RandomStreams", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 18, "usage_type": "call" }, { "api_name": "theano.config", "line_number": 18, "usage_type": "attribute" }, { "api_nam...
458593131
# -*- coding: utf-8 -*- from Acquisition import aq_parent from brasil.gov.agenda.interfaces import IAgendaDiaria from five import grok from Products.CMFCore.utils import getToolByName from zope.component import getMultiAdapter grok.templatedir('templates') class AgendaDiariaView (grok.View): ''' Visao padrao da ...
null
src/brasil/gov/agenda/browser/agendadiaria.py
agendadiaria.py
py
3,652
python
en
code
null
code-starcoder2
76
[ { "api_name": "five.grok.templatedir", "line_number": 8, "usage_type": "call" }, { "api_name": "five.grok", "line_number": 8, "usage_type": "name" }, { "api_name": "five.grok.View", "line_number": 11, "usage_type": "attribute" }, { "api_name": "five.grok", "li...
63371501
import logging from sklearn.feature_extraction.text import CountVectorizer from opendeep.log.logger import config_root_logger from datasets.util import FileParser from opendeep.data.memory_matrix import MemoryMatrix from opendeep.models.multi_layer.generative_stochastic_network import GSN log = logging.getLogger(__n...
null
test_gsn_bow.py
test_gsn_bow.py
py
2,527
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "opendeep.log.logger.config_root_logger", "line_number": 16, "usage_type": "call" }, { "api_name": "datasets.util.FileParser", "line_number": 19, "usage_type": "call" }, { ...
415294446
from django.contrib.auth import authenticate from django.core.checks import messages from django.shortcuts import render, render_to_response from django.http import Http404, HttpResponseRedirect, HttpResponse from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.contrib import messages from Sc...
null
Homepage/views.py
views.py
py
23,357
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.StudentProfile", "line_number": 40, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 63, "usage_type": "call" }, { "api_name": "models.StudentProfile", "line_number": 94, "usage_type": "call" }, { "api_name": "d...
609557972
############################################################# ## ASSIGNMENT 2 CODE SKELETON ## RELEASED: 1/17/2018 ## DUE: 1/24/2018 ## DESCRIPTION: In this assignment, you will explore the ## text classification problem of identifying complex words. ## We have provided the following skeleton for your code, ## with sev...
null
HW2/hw2.py
hw2.py
py
26,564
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 30, "usage_type": "call" }, { "api_name": "nltk.stem.WordNetLemmatizer", "line_number": 40, "usage_type": "call" }, { "api_name": "nltk.stem", "line_number": 40, "usage_type": "attribute" }, { "api_name": "nl...
608978210
""" Tests for salt.modules.zfs on Solaris """ import pytest import salt.loader import salt.modules.zfs as zfs import salt.utils.zfs from tests.support.mock import MagicMock, patch from tests.support.zfs import ZFSMockData @pytest.fixture def utils_patch(): return ZFSMockData().get_patched_utils() @pytest.fixt...
null
tests/pytests/unit/modules/test_zfs_solaris10.py
test_zfs_solaris10.py
py
1,698
python
en
code
null
code-starcoder2
76
[ { "api_name": "tests.support.zfs.ZFSMockData", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 14, "usage_type": "attribute" }, { "api_name": "salt.loader.loader.utils", "line_number": 21, "usage_type": "call" }, { "api_na...
285553881
from json import loads as json2py from json import dumps as py2json class ArffJsonDocument(object): def __init__(self, jsonObject): rawData = jsonObject[1] self.data = [] if type(rawData) is list: self.storageType = ArffJsonDocument.dense self.data...
null
src/classification/arff_json/ArffJsonDocument.py
ArffJsonDocument.py
py
1,711
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.dumps", "line_number": 50, "usage_type": "call" } ]
528460044
# coding=UTF-8 from MyModel import Model from time import time import numpy as np from sklearn import metrics from sklearn.model_selection import cross_val_score, KFold from sklearn.model_selection import GridSearchCV, RandomizedSearchCV class Evaluator(Model): def __init__(self, X, y): super(Evaluator, s...
null
CCF_sentiment_analysis/Evaluate.py
Evaluate.py
py
3,099
python
en
code
null
code-starcoder2
76
[ { "api_name": "MyModel.Model", "line_number": 10, "usage_type": "name" }, { "api_name": "sklearn.model_selection.KFold", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.model_selection.cross_val_score", "line_number": 19, "usage_type": "call" }, { ...
255062875
""" Cgroups read engine to read the cgroups data periodically """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import glob import logging import os import threading import time from treadmill import appenv from tr...
null
lib/python/treadmill/metrics/engine.py
engine.py
py
4,711
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "glob.glob", "line...
46937231
#!/usr/bin/env python # -*- coding: utf-8 -*- # 测试说明 会建立新的数据库连接。。 import web urls = ("/.*", "hello") app = web.application(urls, globals()) def getconfig(): """ 通过配置文件获取配置""" import os, ConfigParser config = ConfigParser.ConfigParser() config.read(os.path.dirname(os.path.abspath(__file__))+'/config.c...
null
notes/nginx/webpy.py
webpy.py
py
1,445
python
en
code
null
code-starcoder2
76
[ { "api_name": "web.application", "line_number": 7, "usage_type": "call" }, { "api_name": "ConfigParser.ConfigParser", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", ...
337977245
import cdsapi def download(year, month): c = cdsapi.Client() c.retrieve( 'reanalysis-era5-single-levels-monthly-means', { 'format':'netcdf', 'product_type':'reanalysis-monthly-means-of-daily-means', 'variable':[ '10m_u_component_of_wind', ...
null
ERA-I_downloads/ERA5_monthly.py
ERA5_monthly.py
py
1,278
python
en
code
null
code-starcoder2
76
[ { "api_name": "cdsapi.Client", "line_number": 4, "usage_type": "call" } ]
537392954
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ PyTTa Object Oriented Python in Technical Acoustics __init__ @Autores: - Matheus Lazarin Alberto, mtslazarin@gmail.com @Última modificação: 16/10/18 EM EDIÇÃO!!! TENTANDO REMOVER CRIAÇÃO DO SWEEP DO FRFMEASURE E CRIAR ...
null
OOPyTTa.py
OOPyTTa.py
py
6,837
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.size", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number...
535649423
from scrapy import Spider, Item, Field, Selector, Request class Channel(Item): title = Field() video_url = Field() page_url = Field() img_url = Field() class TVSpider(Spider): name, start_urls = 'ip_spider', ['http://iranproud.com/livetv'] def parse_channel(self, response): hxs = Se...
null
TVSpider.py
TVSpider.py
py
1,036
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Item", "line_number": 4, "usage_type": "name" }, { "api_name": "scrapy.Field", "line_number": 5, "usage_type": "call" }, { "api_name": "scrapy.Field", "line_number": 6, "usage_type": "call" }, { "api_name": "scrapy.Field", "line_number": ...
355491707
from datetime import datetime from datetime import timedelta from django.test import TestCase from django.contrib.auth.models import User from django.db import IntegrityError from django.core.exceptions import ValidationError from devilry.project.develop.testhelpers.corebuilder import SubjectBuilder, PeriodBuilder fr...
null
devilry/apps/core/tests/test_period.py
test_period.py
py
9,635
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 17, "usage_type": "name" }, { "api_name": "devilry.project.develop.testhelpers.corebuilder.SubjectBuilder.quickadd_ducku_duck1010", "line_number": 19, "usage_type": "call" }, { "api_name": "devilry.project.develop.testhelpers.c...
582400954
from django.conf.urls import url from . import views app_name = 'stockart' urlpatterns = [ url(r'^$', views.index, name='index'), url(r'recargar/', views.recargar, name='recargar'), url(r'busart/', views.busart, name='busart'), url(r'report/', views.report, name='report'), ]
null
principal/Proyectofinal/stockart/urls.py
urls.py
py
303
python
en
code
null
code-starcoder2
76
[ { "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.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
632854111
# Copyright (C) 2020-2021 Intel Corporation # # SPDX-License-Identifier: MIT from functools import partial from glob import glob from typing import Iterable import inspect import logging as log import os import os.path as osp from datumaro.components.cli_plugin import CliPlugin, plugin_types from datumaro.util.os_uti...
null
datumaro/components/environment.py
environment.py
py
7,953
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Iterable", "line_number": 46, "usage_type": "name" }, { "api_name": "datumaro.components.cli_plugin.CliPlugin._get_name", "line_number": 50, "usage_type": "call" }, { "api_name": "datumaro.components.cli_plugin.CliPlugin", "line_number": 50, "usage_t...
256013204
#imports import socket,select,logging from ev3.ev3dev import NoSuchMotorError,Motor,NoSuchSensorError,LegoSensor from ev3.lego import TouchSensor,InfraredSensor,ColorSensor import os #Main class class Brick(): def __init__(self): #everything for the interal logger self._logger = logging.getLogger('B...
null
brick/main.py
main.py
py
15,099
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 12, "usage_type": "call" }, { "api_name": "logging....
338637359
import pandas as pd import numpy as np from sklearn.model_selection import KFold from sklearn.preprocessing import LabelEncoder import gc import os from datetime import datetime t1=datetime.now() ad_feature=pd.read_csv("../data/adFeature.csv") user_feature=pd.read_csv("../data/userFeature.csv") train=pd...
null
qk/one_hot_statis_feature_5_fold.py
one_hot_statis_feature_5_fold.py
py
2,424
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv...
350917253
from PIL import Image image = Image.open("hw0_data/westbrook.jpg") pixel = image.load() width, heigh = image.size result = Image.new("RGB", (width, heigh)) for i in range(width): for j in range(heigh): r, g, b = pixel[i, j] result.putpixel((i, j), (r // 2, g // 2, b // 2)) result.save("Q2.jpg", "...
null
0_load_data/Q2.py
Q2.py
py
326
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 3, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 3, "usage_type": "name" }, { "api_name": "PIL.Image.new", "line_number": 7, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 7,...
321871422
# constants import enum ''' The order of political parties in Constants.PARTIES tuple is predefined and cannot be changed Constants.PARTIES[0] = 'PiS' Constants.PARTIES[1] = 'KO' Constants.PARTIES[2] = 'SLD' Constants.PARTIES[3] = 'PSL' Constants.PARTIES[4] = 'Konf' Constants.PARTIES[5] = 'BS' Constants.PARTIES[6] =...
null
Constants.py
Constants.py
py
3,836
python
en
code
null
code-starcoder2
76
[ { "api_name": "enum.Enum", "line_number": 71, "usage_type": "attribute" } ]
348786890
import news.db import news.preprocess from bs4 import BeautifulSoup from tqdm import tqdm if __name__ == '__main__': dset = news.db.read.AllRecords(db_name='ftv.db') res = [] for i, n in enumerate(tqdm(dset)): try: # if '120940/5544528' in n.url: if n.company == '民視': ...
null
test_parsing.py
test_parsing.py
py
1,475
python
en
code
null
code-starcoder2
76
[ { "api_name": "news.db.db.read.AllRecords", "line_number": 7, "usage_type": "call" }, { "api_name": "news.db.db", "line_number": 7, "usage_type": "attribute" }, { "api_name": "news.db", "line_number": 7, "usage_type": "name" }, { "api_name": "tqdm.tqdm", "line...
48675266
from selenium import webdriver import math import time def calc(x): return str(math.log(abs(12*math.sin(int(x))))) try: browser = webdriver.Chrome() browser.get("http://suninjuly.github.io/alert_accept.html") # Нажимаем на кнопку button = browser.find_element_by_tag_name("button") button.cl...
null
section_2/lesson3_step4.py
lesson3_step4.py
py
922
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.log", "line_number": 7, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "l...
256407901
import pygame#import pygame from time import sleep#import the time module pygame.init()#start pygame screen = pygame.display.set_mode((700, 400))#make the window movie = pygame.movie.Movie("filename.mpg")#setting the file to play pygame.mixer.quit()#stops the mixer from playing random audio movie.play()#play the movie...
null
video_player.py
video_player.py
py
634
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 4, "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.movie.Mov...
124991463
# -*- coding: utf-8 -*- """ Created on Thu Aug 9 13:01:55 2018 @author: eiahsid """ import nltk,os,sys import re import pickle from nltk.tokenize import word_tokenize from nltk.corpus import stopwords sys.path.append('...') from backend.issuetype_classify import TypeClassificationUtils as utils from config import pa...
null
backend/issuetype_classify/predict.py
predict.py
py
2,032
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "config.path_init.base_dir", "line_number": 17, "usage_type": "attribute" }, { "api_name": "config.p...
591032126
from typing import List import regex _RE_PUNC = regex.compile(r"^\p{p}$") _EM_DASH = "-" # note for grading TA: # I couldn't import regex module, but I have activated conda and installed regex using pip The # terminal gives me this when I tried to install regex again using pip: regex in # /opt/anaconda3/lib/python3....
null
cosi114_hw0_rachel_peng/hw0.py
hw0.py
py
2,321
python
en
code
null
code-starcoder2
76
[ { "api_name": "regex.compile", "line_number": 5, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 21, "usage_type": "name" } ]
50792177
from flask_restful import Resource from sqlalchemy import and_ from sqlalchemy.exc import SQLAlchemyError from webargs.flaskparser import use_kwargs from webargs import fields from models.ResponseCodes import ResponseCodes from models.ResponseCodes import ResponseDescriptions from api.models.models import db_session, T...
null
foundations/api/resources/Graph/transaction_size.py
transaction_size.py
py
4,418
python
en
code
null
code-starcoder2
76
[ { "api_name": "api.models.models.TransactionSize", "line_number": 11, "usage_type": "name" }, { "api_name": "flask_restful.Resource", "line_number": 24, "usage_type": "name" }, { "api_name": "webargs.fields.Date", "line_number": 25, "usage_type": "call" }, { "api_...
239838624
from flask import Blueprint, jsonify, abort from marshmallow_jsonschema import JSONSchema from emannotationschemas.errors import UnknownAnnotationTypeException from emannotationschemas import get_schema, get_types bp = Blueprint("schema", __name__, url_prefix="/schema") @bp.route("") def get_schemas(): return js...
null
annotationengine/schemas.py
schemas.py
py
622
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 11, "usage_type": "call" }, { "api_name": "emannotationschemas.get_types", "line_number": 11, "usage_type": "call" }, { "api_name": "emannotati...
410860004
import os import unittest from e2e_tests.connector_facade import E2EConnectorFacade from infoblox_client.objects import ARecord, DNSZone, AAAARecord class TestObjectsE2E(unittest.TestCase): def setUp(self): opts = { 'host': os.environ['WAPI_HOST'], 'username': os.environ['WAPI_USE...
null
e2e_tests/test_objects.py
test_objects.py
py
2,676
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ", ...