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
41325207
""" PERFORMANCE ANALYSIS: Evaluate the system performance, according to settings in 'config.yaml' Results are stored in 'result.csv' and can be visualized running the Matlab script 'result.m' """ from core.simulation.simulation import Simulation as Simulation from core.simulation.model.config import load_configuration...
null
exp/simulation/performance_analysis.py
performance_analysis.py
py
2,246
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 14, "usage_type": "attribute" }, { "api_name": "core.utils.logutils.ConsoleHandler", "line_number": 14, "usage_type": "call" }, { "api_name...
366747823
from django.conf.urls import url from sample_app import views #for template tagging app_name = 'sample_app' urlpatterns = [ url(r'^$', views.index, name='index'), url(r'formpage/', views.form_name_view, name='form_name'), ]
null
sample_project/sample_app/urls.py
urls.py
py
235
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "sample_app.views.index", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sample_app.views", "line_number": 8, "usage_type": "name" }, { "api_name": "django...
19742931
from lxml import etree # 写入csv文件 import csv # 电影名称、电影类型、电影评分、上映场次 # 获取网页内容 def get_content(): path = 'www1/北京影讯,北京电影院-在线选座购票-购电影票.html' htmlfile = open(path, 'r', encoding='utf-8') htmlhandle = htmlfile.read() return htmlhandle # 解析数据并写入文件 def get_information(cont): item = {} cont = etree.HTML...
null
测试/题目三/ans0101.py
ans0101.py
py
1,233
python
en
code
null
code-starcoder2
76
[ { "api_name": "lxml.etree.HTML", "line_number": 16, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 16, "usage_type": "name" }, { "api_name": "csv.writer", "line_number": 20, "usage_type": "call" } ]
613551772
import json import numpy as np import os from PIL import Image import tarfile import re from keras.layers import Embedding from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.utils.data_utils import get_file EMBEDDING_DIM = 50 tokenizer = Tokenizer() def ...
null
prepare.py
prepare.py
py
10,964
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.preprocessing.text.Tokenizer", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 21, "usage_type": "call" }, { "api_name": "keras.preprocessing.sequence.pad_sequences", "line_number": 33, "usage_type": "call" }, ...
165456308
from django import forms from .models import Persona, ObraSocial class PersonaForm(forms.ModelForm): class Meta: model = Persona fields = ['dni', 'nombre', 'apellido', 'fecha_nac', 'telefono'] labels = { 'dni': 'Ingrese el DNI', 'nombre': 'Ingrese el/los nombres ', ...
null
apps/modelsGeneral/forms.py
forms.py
py
2,613
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 4, "usage_type": "name" }, { "api_name": "models.Persona", "line_number": 6, "usage_type": "name" }, { "api_name": "django.forms.Tex...
256958275
from PyQt5 import QtCore, QtGui, QtWidgets, uic from Model import * from typing import List, Callable from Database import * class ListWidget(QtWidgets.QWidget): class Mediator: def load(self) -> List[Model]: return [] def edit_available(self) -> bool: return True ...
null
bullshit/UI/ListWidget.py
ListWidget.py
py
3,680
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 7, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets...
428285147
""" SimpleTwitter Feature Extractors: 1. Word Counts * Split on whitespace * No stop words * unigrams only Final Classifier: Naive Bayes """ from sklearn.pipeline import Pipeline # Feature Extractors from sklearn.feature_extraction.text import CountVectorizer f1 = CountVectorizer( input=u'content', ...
null
foodbornenyc/pipelines/simple_naivebayes.py
simple_naivebayes.py
py
1,055
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.naive_bayes.MultinomialNB", "line_number": 41, "usage_type": "call" }, { "api_name": "sklearn.pipeline.Pipeline", "line_number": 48, "usage_t...
61640179
from setuptools import setup from Cython.Build import cythonize from distutils.extension import Extension import numpy as np #compilation mode for debuging #extensions = [ #Extension("differentiable_renderer_cython", ["DEODR/differentiable_renderer_cython.pyx"] #,extra_compile_args=["-Zi", "/Od"] #,extra_l...
null
setup.py
setup.py
py
760
python
en
code
null
code-starcoder2
76
[ { "api_name": "Cython.Build.cythonize", "line_number": 17, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.get_include", "line_number": 28, "usage_type": "call" } ]
457994625
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np import os.path as osp import os from resnet import build_model from skimage.io import imread, imsave DATASET_PATH = '/home/jorge/Documents/cos4...
null
resnet_predict.py
resnet_predict.py
py
2,857
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arange", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 33, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_n...
107663802
# Data Loading & Setting Library from glob import glob import warnings import pickle import matplotlib import matplotlib.pyplot as plt import matplotlib.font_manager as fm import pandas as pd import numpy as np import re import os from konlpy.tag import Okt from sklearn.feature_selection import SelectKBest, f_classif ...
null
dacon/2_climate/dc_climate_4.py
dc_climate_4.py
py
14,160
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 27, "usage_type": "attribute" }, { "api_name": "warnings.simplefilter", "line_number": 30, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 31, "usage_type": "call" }, { "api_name": "matplot...
223301261
#!/usr/bin/env python # -*- coding: utf-8 -*- """ cal_WAVE_NEW_E2DS_spirou.py [night_directory] [HCfitsfilename] [FPfitsfilename] Wavelength calibration incorporating the FP lines Following C. Lovis's method for Espresso Created on 2018-06-08 at 16:00 @author: mhobson """ from __future__ import division import numpy...
null
old_code/INTROOT/misc/cal_WAVE_NEW_E2DS_spirou.py
cal_WAVE_NEW_E2DS_spirou.py
py
58,870
python
en
code
null
code-starcoder2
76
[ { "api_name": "astropy.constants.c.to", "line_number": 32, "usage_type": "call" }, { "api_name": "astropy.constants.c", "line_number": 32, "usage_type": "attribute" }, { "api_name": "astropy.constants", "line_number": 32, "usage_type": "name" }, { "api_name": "ast...
353892067
import sys from PyQt5.QtWidgets import QMainWindow,QApplication,QDialog,QFileDialog,QMessageBox from monitor import Ui_MainWindow import subprocess import re import time class parent_MainWindow(QMainWindow,Ui_MainWindow): def __init__(self): QMainWindow.__init__(self) self.main_ui=Ui_MainWindow() self.setupUi(...
null
Android_monitor_log/monitor_dut_log.py
monitor_dut_log.py
py
3,591
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 9, "usage_type": "name" }, { "api_name": "monitor.Ui_MainWindow", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QMainWindow.__init__", "line_number": 11, "usage_type": "call" }, { ...
277523217
from __future__ import division ## to get the data import cPickle import gzip ## to visualize data import matplotlib.cm as cm import matplotlib.pyplot as plt import theano import theano.tensor as T import numpy as np filename = "/Users/ducprogram/Dropbox/Programming/DigitRecognizer" filename += "/neural-networks-a...
null
get_data.py
get_data.py
py
1,916
python
en
code
null
code-starcoder2
76
[ { "api_name": "gzip.open", "line_number": 38, "usage_type": "call" }, { "api_name": "cPickle.load", "line_number": 40, "usage_type": "call" }, { "api_name": "theano.shared", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number...
314778512
import tensorflow as tf import numpy as np from tools.preprocessing import preprocess_images from tools.kfold import KFold_cross_validation_split from tools.extraction_and_metrics import extract_features, compute_confusion_matrix from .network import Net import torchvision.models as models import torch import os im...
null
src/frameworks/detrac_torch/feature_extractor.py
feature_extractor.py
py
2,501
python
en
code
null
code-starcoder2
76
[ { "api_name": "tools.preprocessing.preprocess_images", "line_number": 44, "usage_type": "call" }, { "api_name": "tools.kfold.KFold_cross_validation_split", "line_number": 53, "usage_type": "call" }, { "api_name": "network.Net", "line_number": 64, "usage_type": "call" },...
314254496
#!/home/cimatori/installed/anaconda/bin/python """ Compute and compare pdfs in different time intervals and at different scales """ import numpy as np import numexpr as ne import matplotlib.pyplot as ppl from MyLib import Statistics,hist2plot from NIOZhst import load_chain # Load paramters import ConfigPdfs reload(C...
null
LIS132/Layering/dens_incr_pdf.py
dens_incr_pdf.py
py
2,479
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.close", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 18, "usage_type": "name" }, { "api_name": "NIOZhst.load_chain", "line_number": 25, "usage_type": "call" }, { "api_name": "socket.g...
428199193
# !/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2020/05/22 14:21:36 # @File : asyncio使用requests.py # @Link : https://www.cnblogs.com/BenLam/ # @Version : 1.0 import os import asyncio import multiprocessing import random import time import requests from concurrent.futures import ProcessPoolExecuto...
null
Python/协程/asyncio使用requests.py
asyncio使用requests.py
py
2,415
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 19, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 24, "usage_type": "call" }, { "api_name": "asyncio.Queue", "line_number": ...
520571497
import numpy as np import pandas as pd import random import math from sklearn.feature_extraction import DictVectorizer as DVec import matplotlib.pyplot as ploty import time import sys file_name = sys.argv[1] start_time = time.clock() dataset = pd.read_csv(file_name) dataset.columns =["Patient_ID","Local_tumor_recurren...
null
ml/es14btech11017/3B.py
3B.py
py
2,605
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "time.clock", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "random.sample", "line_nu...
202897127
from gensim.models.word2vec import Word2Vec from gensim.models.keyedvectors import KeyedVectors from gensim.parsing.porter import PorterStemmer from nltk.corpus import stopwords import numpy as np import pickle from sklearn.cluster import MiniBatchKMeans import operator from os import system from vaderSentiment.vaderSe...
null
Creighton/MASA.py
MASA.py
py
25,814
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.isfile", "line_number": 122, "usage_type": "call" }, { "api_name": "os.path", "line_number": 122, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 128, "usage_type": "call" }, { "api_name": "os.path.isfile", "line...
650023850
from collections import OrderedDict from typing import Sequence, Any import numpy as np import tensorflow as tf import sys, traceback import pdb import optparse from dyPred import Model from utils import glorot_init def graph_to_adj_mat(graph, max_n_vertices, num_edge_types, tie_fwd_bkwd=True): bwd_edge_offset =...
null
DyPred/main.py
main.py
py
12,130
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 28, "usage_type": "attribute" }, { "api_name": "dyPred.Model", "line...
262423198
import itertools import os import json import argparse import re platform_map = { "linux-aarch64": ["aarch64_linux"], "linux-ppc64le": ["ppc64le_linux"], "linux-arm": ["arm_linux"], "linux-s390x": ["s390x_linux"], "linux-x64": ["x86-64_linux"], "macosx-x64": ["x86-64_mac", "aarch64_mac"], "...
null
disabledTestParser/generateDisabledTestListJson.py
generateDisabledTestListJson.py
py
5,349
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.search", "line_number": 35, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 70, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 85, "usage_type": "call" }, { "api_name": "os.path.dirname", ...
279129513
""" SALTS XBMC Addon Copyright (C) 2014 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
null
scrapers/hdmovie14_scraper.py
hdmovie14_scraper.py
py
7,887
python
en
code
null
code-starcoder2
76
[ { "api_name": "scraper.Scraper", "line_number": 34, "usage_type": "attribute" }, { "api_name": "scraper.DEFAULT_TIMEOUT", "line_number": 37, "usage_type": "attribute" }, { "api_name": "salts_lib.kodi.get_setting", "line_number": 39, "usage_type": "call" }, { "api_...
175759900
import pandas as pd import matplotlib.pyplot as plt import numpy as np import logging from sklearn.decomposition import PCA def log(): logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s') logger = logging.getLogger('KDD2009') return log...
null
kdd2009_modified.py
kdd2009_modified.py
py
16,505
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_tab...
237387082
import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator NameFiles = [ "SingleJulySingleNode.dat", "SingleJulyTwoNodes.dat", "SingleJulyFourNodes.dat"] NFiles = len(NameFiles) NRep = np.zeros((NFiles), dtype = int) NConf = np.zeros((NFiles), dtype = int) NTmp = -1 * np.ones((NFile...
null
MultipleNodesPlot/ShowData.py
ShowData.py
py
4,615
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 39,...
141378986
bl_info = { "name": "PLANEX", "description": "Display the stroke points intersect with the plane across the 3d cursor", "author": "V Ven", "version": (0, 0, 3), "blender": (2, 80, 0), "category": "Learnbgame", } import bpy import blf from mathutils import ( Quaternion, ...
null
All_In_One/addons/PLANEX/__init__.py
__init__.py
py
3,744
python
en
code
null
code-starcoder2
76
[ { "api_name": "bpy.context", "line_number": 39, "usage_type": "attribute" }, { "api_name": "mathutils.Vector", "line_number": 42, "usage_type": "call" }, { "api_name": "bpy_extras.view3d_utils.location_3d_to_region_2d", "line_number": 63, "usage_type": "call" }, { ...
529413236
import json import os from algoliasearch import algoliasearch client = algoliasearch.Client("7EK9KHJW8M", os.environ["ALGOLIA_API_KEY"]) index = client.init_index("schema") p = json.load(open("_data/plotschema.json")) schema = [] skippable_keys = [ "src", "_deprecated", "impliedEdits", "uid", "ed...
null
update_ref_search.py
update_ref_search.py
py
3,452
python
en
code
null
code-starcoder2
76
[ { "api_name": "algoliasearch.algoliasearch.Client", "line_number": 5, "usage_type": "call" }, { "api_name": "algoliasearch.algoliasearch", "line_number": 5, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_n...
268108056
import requests from bs4 import BeautifulSoup from collections import OrderedDict fname_out = 'output.txt' def getinfo(url): sep = '\t' html = requests.get(url).text soup = BeautifulSoup(html, 'lxml') title = soup.select('div.title > h1')[0].text.strip() loc = soup.find('span', {'class': 'location'}).text.st...
null
olx/olx.py
olx.py
py
2,299
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": "collections.OrderedDict", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.get",...
371740446
from config import env from collections import OrderedDict EXCHANGE_INFO = OrderedDict() EXCHANGE_INFO['binance'] = 'Binance' EXCHANGE_INFO['poloniex'] = 'Poloniex' EXCHANGE_INFO['okex'] = 'OKEx' EXCHANGE_INFO['huobipro'] = 'Huobi' EXCHANGE_INFO['bitfinex'] = 'Bitfinex' EXCHANGE_INFO['bitstamp'] = 'Bitstamp' EXCHANGE_...
null
config/common.py
common.py
py
4,555
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.OrderedDict", "line_number": 4, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 29, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 48, "usage_type": "call" }, { "api_name":...
103328237
# -*- coding: utf-8 -*- """ Created on Sun Feb 17 20:29:46 2019 @author: Formateur IT """ import numpy as np import matplotlib.pyplot as plt import pandas as pd X = pd.read_csv('credit_bank.csv').values from scipy.cluster.hierarchy import linkage, dendrogram fusions = linkage(X, method='comple...
null
hiérarchie.py
hiérarchie.py
py
1,296
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "scipy.cluster.hierarchy.linkage", "line_number": 19, "usage_type": "call" }, { "api_name": "scipy.cluster.hierarchy.dendrogram", "line_number": 21, "usage_type": "call" }, { ...
248788133
#!/usr/bin/python -u # + from SeqDataset import * #import pandas as pd import numpy as np import argparse import random import math import time #import matplotlib.pyplot as plt from torch.utils.data import DataLoader from torch.utils.data.sampler import SubsetRandomSampler from torch.nn.functional import softmax, relu...
null
scripts/torchtext_cnn_supervised_learning.py
torchtext_cnn_supervised_learning.py
py
10,655
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 32, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 40, "usage_type": "call" }, { "api_name": "random.getstate", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.random.seed...
349262818
from tqdm import tqdm class evaluater(nn.Module): def __init__(self): pass def evaluate(self, dev, matric_best, slot_temp, early_stop=None): # Set to not-training mode to disable dropout self.encoder.train(False) self.decoder.train(False) print("STARTING EVALUATION") ...
null
test/test_util.py
test_util.py
py
6,388
python
en
code
null
code-starcoder2
76
[ { "api_name": "tqdm.tqdm", "line_number": 14, "usage_type": "call" } ]
201987002
# -*- coding: utf-8 -*- """ Created on Wed Mar 13 10:55:21 2019 @author: bsoni """ import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State import datetime import plotly.graph_objs as go import pandas as pd import numpy as np from datetime i...
null
DashBoards/AllDashBoardsMerged/CancellationApps/CA2.py
CA2.py
py
21,752
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.concat", "...
193852476
import cv2 import numpy as np #import utilitis as utlis curveList = [] avgVal = 10 def getHist(img,minPer=0.1,disp=False,region=1): if region == 1: histVal = np.sum(img, axis=0) else: histVal = np.sum(img[img.shape[0] // region:, :], axis=0) # print(histValues) maxVal = np.max(histVal) minVal...
null
Python/WIP/main.py
main.py
py
6,795
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sum", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 18, ...
580472352
from django import forms from .models import Notes class NoteForm(forms.ModelForm): description = forms.CharField(widget=forms.Textarea(attrs={'rows': 5, 'placeholder': 'What is on your mind?'}), max_length=4000, help_text='The max length of the text is ...
null
notes/forms.py
forms.py
py
449
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 6, "usage_type": "call" }, { "api_name": "django.f...
646009412
import contextlib import datetime import io import json import math import os import re import requests import time from dcicutils.env_utils import EnvUtils, full_env_name, is_stg_or_prd_env from dcicutils.ff_utils import authorized_request from dcicutils.lang_utils import disjoined_list, conjoined_list from dcicutils...
null
dcicutils/ff_mocks.py
ff_mocks.py
py
36,918
python
en
code
null
code-starcoder2
76
[ { "api_name": "dcicutils.misc_utils.environ_bool", "line_number": 35, "usage_type": "call" }, { "api_name": "dcicutils.qa_utils.MockBotoElasticBeanstalkClient", "line_number": 39, "usage_type": "name" }, { "api_name": "dcicutils.qa_utils.make_mock_beanstalk", "line_number": 4...
123739395
#!/usr/bin/env python3 """ My first Flask app """ # Importera relevanta moduler from flask import Flask, render_template, request, session from person import Person from data import Data import functions as func app = Flask(__name__) person = Person("John", "Cena", 24, "Sweden") data = Data('static/img/earthporn.j...
null
flask/app.py
app.py
py
1,500
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "person.Person", "line_number": 15, "usage_type": "call" }, { "api_name": "data.Data", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.render_template", "line...
575033465
from Bio import SeqIO, Seq import os import io import sys import time import argparse if __name__ == '__main__': parser = argparse.ArgumentParser(description = "Split reference assembly.") split_params = parser.add_argument_group('Split parameters.') split_params.add_argument('-a', '--assembly', requ...
null
ref_splitter.py
ref_splitter.py
py
1,974
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "Bio.SeqIO.parse", "line_number": 29, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_number": 29, "usage_type": "name" } ]
608350754
# -*- coding: utf-8 -*- """ spider.tender_hangzhou.py ~~~~~~~~~~~~~~ :copyright:... """ import datetime import logging import re from copy import deepcopy from bs4 import BeautifulSoup from .spider import Spider class TenderHangzhou(object): def __init__(self): self.logger = logging.getLogge...
null
spider/tender_hangzhou.py
tender_hangzhou.py
py
1,602
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "spider.Spider", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.dateti...
93733600
#! /usr/bin/env python import numpy as np from setuptools import setup, Extension, find_packages descr = """Convolutional dictionary learning for noisy signals""" DISTNAME = 'alphacsc' DESCRIPTION = descr MAINTAINER = 'Mainak Jas' MAINTAINER_EMAIL = 'mainakjas@gmail.com' LICENSE = 'BSD (3-clause)' DOWNLOAD_URL = 'ht...
null
setup.py
setup.py
py
2,603
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.Extension", "line_number": 26, "usage_type": "call" }, { "api_name": "setuptools.Extension", "line_number": 29, "usage_type": "call" }, { "api_name": "setuptools.Extension", "line_number": 36, "usage_type": "call" }, { "api_name": "Cython...
258597930
import requests from bs4 import BeautifulSoup import json def getGeoCode(address): if ("/" in address[0:int(len(address)/2)]): address = deleteslashes(address) address += " Singapore" requesteddata = requests.get('https://maps.googleapis.com/maps/api/geocode/json?address={}&key=AIzaSyCZFz2PlrkMfum...
null
results/geocoding.py
geocoding.py
py
1,130
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 12, "usage_type": "call" } ]
276503982
#!/usr/bin/env/python3 import re from collections import defaultdict m = open("locust.fsa_nt.out", "r") f = open("./database/nucl_all.accession2taxid", "r") w = open("./database/taxid_50557.txt", "r") h = open("locust.fsa_nt", "r") n = open("locust_insect.fasta", "w") p = open("locust10_insect.fasta", "w") query_dict =...
null
filterAc.py
filterAc.py
py
1,628
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" } ]
104232830
import os from datetime import date import dash import dash_core_components as dcc import dash_html_components as html import plotly.express as px import pandas as pd import json import numpy as np import datetime # Make daily map # --------- GEOJSON ---------- # uk_counties = json.load(open('../data/Geojson/Ceremonial...
null
utils/daily_map.py
daily_map.py
py
10,314
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 10...
239043285
import torch import torch.nn as nn import torch.nn.functional as F class QNetwork(nn.Module): def __init__(self, state_size, action_size, hidden_size1, hidden_size2, seed=1): """Initialize parameters and build model. Params ====== state_size (int): Dimension of each state ...
null
20Agents/model.py
model.py
py
943
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.manual_seed", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn.Sequential", ...
527419680
import ast import _ast from dataclasses import dataclass import re import yaml from jinja2 import Template, Environment, DictLoader from hy.compiler import hy_compile, hy_parse from coconut.convenience import parse, setup from . import blocks, expressions, utils class transpiler: tmpls = { 'types': {},...
null
transPYler/core.py
core.py
py
4,520
python
en
code
null
code-starcoder2
76
[ { "api_name": "_ast.Assign", "line_number": 33, "usage_type": "attribute" }, { "api_name": "_ast.AnnAssign", "line_number": 34, "usage_type": "attribute" }, { "api_name": "_ast.Expr", "line_number": 35, "usage_type": "attribute" }, { "api_name": "_ast.AugAssign", ...
314306441
import numpy as np import functions as rr from constants import const import h5py import time def linkage(par): st = time.time() C = const() f_red = h5py.File("spatial_reduced.hdf5", 'r') f_link = h5py.File("responses.hdf5", 'r') """gather the calibration data""" n_cal_tot = len(C['set_id...
null
fip_collab/2016_06_10_polycrystal_FIP/get_linkage.py
get_linkage.py
py
4,337
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 10, "usage_type": "call" }, { "api_name": "constants.const", "line_number": 12, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 14, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 15...
471711357
import os import sys import pandas as pd from sklearn.externals import joblib import umap import logging from datetime import datetime from doppler import cols_conv_feats, skip_hash, filename_without_extension import doppler.mosaic_utils_stories as mosaic_utils logger = logging.getLogger(__file__) DATA_DIR = os.path...
null
doppler/mosaics_stories.py
mosaics_stories.py
py
7,585
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 12, "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": "os.path.dirname", "li...
440453199
# # WRITE TO DISK # tmp = ar5.ds.to_dataset('pre') # tmp.to_netcdf( out_fn.replace('.tif', '.nc') ) import xarray as xr import numpy as np import rasterio, os class WriteDataset( object ): def __init__( self, fn, variable, lat='lat', lon='lon', northup=False ): self.fn = fn self.variable = variable self.lat = ...
null
snap_scripts/epscor_sc/write_lowres_dataset_layer_todisk.py
write_lowres_dataset_layer_todisk.py
py
2,208
python
en
code
null
code-starcoder2
76
[ { "api_name": "xarray.open_dataset", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.flipud", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.flipud", "line...
479131719
# -*- encoding: utf-8 -*- ############################################################################## # # Part of Odoo. # Copyright (C) 2021 Allegro IT (<http://www.allegro.lv/>) # E-mail: <info@allegro.lv> # Address: <Vienibas gatve 109 LV-1058 Riga Latvia> # ...
null
l10n_lv_partner_title/models/res_partner.py
res_partner.py
py
3,462
python
en
code
null
code-starcoder2
76
[ { "api_name": "odoo.models.Model", "line_number": 28, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 28, "usage_type": "name" }, { "api_name": "xml.dom.minidom.parseString", "line_number": 34, "usage_type": "call" }, { "api_name": "odoo.a...
640645242
# Source code modified from scipy.stats._distn_infrastructure.py # # Copyright (c) 2001, 2002 Enthought, Inc. # All rights reserved. # # Copyright (c) 2003-2019 SciPy Developers. # All rights reserved. import numpy as onp import scipy.stats as osp_stats from scipy._lib._util import getargspec_no_self from scipy.stats....
null
numpyro/distributions/distribution.py
distribution.py
py
5,638
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.stats.rv_continuous", "line_number": 21, "usage_type": "attribute" }, { "api_name": "scipy.stats", "line_number": 21, "usage_type": "name" }, { "api_name": "jax.random._is_prng_key", "line_number": 27, "usage_type": "call" }, { "api_name": "ja...
509336066
# -*- coding: utf-8 -*- from django.utils import timezone from django.contrib import admin from django.core.urlresolvers import reverse from django import forms from django.conf.urls import url from django.core.urlresolvers import reverse from django.contrib.admin.utils import quote from django.core.exceptions import ...
null
apps/events/admin.py
admin.py
py
7,014
python
en
code
null
code-starcoder2
76
[ { "api_name": "core.abs.admin.BaseCategoryInline", "line_number": 26, "usage_type": "name" }, { "api_name": "apps.events.models.EventType", "line_number": 28, "usage_type": "name" }, { "api_name": "core.abs.admin.BaseCategoryAdmin", "line_number": 30, "usage_type": "name"...
613667853
import os import pytest from selenium import webdriver from heracles.pages.general_page import GeneralPage # recomment to use chrome driver # chromedriver should be in root directory of repository #browser = webdriver.Chrome(executable_path=os.getcwd() + '/chromedriver') browser = webdriver.PhantomJS(executable_path...
null
test_money_formatter/test_money_formatter.py
test_money_formatter.py
py
1,821
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.PhantomJS", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "os.getcwd", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest.fixt...
509252692
import folium import pandas data = pandas.read_csv("Volcanoes.txt") lat = list(data["LAT"]) lon = list(data["LON"]) name = list(data["NAME"]) elev = list(data["ELEV"]) type_of = list(data["TYPE"]) circle_icon = False words = """<h4>Volcano information:</h4> <a href="https://www.google.com/search?q=%%22%...
null
Map/map1.py
map1.py
py
2,732
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "folium.Map", "line_number": 52, "usage_type": "call" }, { "api_name": "folium.FeatureGroup", "line_number": 54, "usage_type": "call" }, { "api_name": "folium.IFrame", "li...
508891011
''' Analysis of maximum profit as a function of multiplierIR or gamma ''' import numpy as np import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import time import copy import pickle from multiprocessing import Pool from config import * from profit_optimization_core import * def dist_from_delta...
null
profit_vs_multiplierIR.py
profit_vs_multiplierIR.py
py
6,804
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.unravel_index", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 45, "usage_type": "call" }, { "api_name": "time.time", "line_num...
109535096
from flask import Blueprint, render_template from flask import request, flash, redirect, url_for import boto3 import os import collections from datetime import datetime, timedelta from operator import itemgetter from app import db from ..models.configuration import HttpRequestCount from ..settings import BUCKET_NAME ...
null
app/controllers/manager.py
manager.py
py
5,598
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 14, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 18, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 19...
445865458
import requests import json # url = "http://fanyi.baidu.com/extendtrans" url = "http://fanyi.baidu.com/basetrans" query_str = input("请输入要翻译的中文:") data = {"query":query_str, "from":"zh", "to": "en"} headers = {"User-Agent":"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) Appl...
null
06_try_json.py
06_try_json.py
py
724
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.post", "line_number": 15, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 21, "usage_type": "call" } ]
95673082
import numpy as np import matplotlib as mpl mpl.use('tkagg') import matplotlib.pyplot as plt from func import * #Point of intersection n1=np.array([4,3]) n2=np.array([3,4]) c=np.array([12,12]) n=np.vstack((n1,n2)) point_inter=np.matmul(np.linalg.inv(n),c) plt.plot(point_inter[0],point_inter[1],'o') #plotting Li...
null
Computing/StraightLines/Ex3.py
Ex3.py
py
522
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
346103445
import errno from flask import abort from flask import current_app from flask import g, jsonify from flask import redirect from flask import render_template from flask import request from info import constants from info import db from info.models import News, Category, User from info.modules.user import user_blu from...
null
info/modules/user/views.py
views.py
py
11,478
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.g.user", "line_number": 27, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 27, "usage_type": "name" }, { "api_name": "flask.redirect", "line_number": 30, "usage_type": "call" }, { "api_name": "flask.render_template", ...
589023668
import os from celery import Celery from dagster_graphql.client.mutations import execute_execute_plan_mutation from dagster import ExecutionTargetHandle from dagster.core.instance import InstanceRef from dagster.core.serdes import serialize_dagster_namedtuple from .config import CeleryConfig DEFAULT_BROKER = 'pyamq...
null
python_modules/dagster-celery/dagster_celery/tasks.py
tasks.py
py
1,327
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "dagster.core.instance.InstanceRef.from_dict", "line_number": 20, "usage_type": "call" }, { "api_name": "dagster.core.instance.InstanceRef", "line_number": 20, "usage_type": "name" }, ...
28418569
import sys, pygame, random, time from threading import Timer from ww import * from pygame.locals import * pygame.init() ww=Stage(20, 20, 24) def setup(): ''' Initializes the setup of the game, adding your player, monsters, walls, sticky boxes and normal boxes across the stage. ''' ww.set_player(Ke...
null
wwgame.py
wwgame.py
py
3,403
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 8, "usage_type": "call" }, { "api_name": "ww.set_player", "line_number": 16, "usage_type": "call" }, { "api_name": "ww.add_actor", "line_number": 17, "usage_type": "call" }, { "api_name": "ww.add_actor", "line_number...
411262790
# -*- coding: utf-8 -*- """A demonstration of Comet streaming functionality using Sijax.""" import os import sys import flask from shelljob import proc path = os.path.join('.', os.path.dirname(__file__), '../') sys.path.append(path) from flask import Flask, g, render_template import flask_sijax app = Flask(__name...
null
sijaxExample/comet.py
comet.py
py
2,744
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path.append", "line...
332927134
# uncompyle6 version 3.7.4 # Python bytecode 3.5 (3351) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: /home/ale/progr/github/wasp-general/wasp_general/network/clients/file.py # Compiled at: 2018-03-02 16:08:04 # Size of source mod 2**32: 3929 bytes from wasp_gener...
null
pycfiles/wasp-general-0.0.3.3.tar/file.cpython-35.py
file.cpython-35.py
py
3,516
python
en
code
null
code-starcoder2
76
[ { "api_name": "wasp_general.network.clients.base.WBasicNetworkClientProto", "line_number": 20, "usage_type": "name" }, { "api_name": "wasp_general.network.clients.base.WBasicNetworkClientProto.__init__", "line_number": 23, "usage_type": "call" }, { "api_name": "wasp_general.netwo...
301728411
from logzero import logger from managers.DatabaseManager import DatabaseManager from managers.ExchangeManager import ExchangeManager class BalanceManager: """Class to handle dealing with index balances.""" em = ExchangeManager() def rebalance_coins(self, coins_above_threshold, coins_below_thre...
null
managers/BalanceManager.py
BalanceManager.py
py
5,997
python
en
code
null
code-starcoder2
76
[ { "api_name": "managers.ExchangeManager.ExchangeManager", "line_number": 9, "usage_type": "call" }, { "api_name": "logzero.logger.debug", "line_number": 26, "usage_type": "call" }, { "api_name": "logzero.logger", "line_number": 26, "usage_type": "name" }, { "api_n...
56718470
# -*- coding: utf-8 -*- import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer def sklearn_tfidf(): tag_list = ['iphone guuci huawei watch huawei', 'huawei watch iphone watch iphone guuci', 's...
null
TFIDF.py
TFIDF.py
py
4,017
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.TfidfTransformer", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 22, "usage_...
503982801
#!/usr/bin/python from cortex import app import cortex.lib.user from flask import Flask, request, session, redirect, url_for, flash, g, abort, make_response, render_template, jsonify import os import MySQLdb as mysql ################################################################################ @app.route('/about...
null
views.py
views.py
py
3,493
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "cortex.app.route", "line_number": 11, "usage_type": "call" }, { "api_name": "cortex.app", "line_number": 11, "usage_type": "name" }, { "api_name": "flask.render_templa...
477850560
#!/usr/bin/env python3 import yaml from jinja2 import Template var_file = open('variables.yml') var_data = var_file.read() my_vars = yaml.full_load(var_data) template_file = open('template.j2') template_data = template_file.read() template = Template(template_data) for device in my_vars: print("Creating config for...
null
lessons/template-generation-device/stage2/build-configs.py
build-configs.py
py
474
python
en
code
null
code-starcoder2
76
[ { "api_name": "yaml.full_load", "line_number": 8, "usage_type": "call" }, { "api_name": "jinja2.Template", "line_number": 12, "usage_type": "call" } ]
447824132
import base_task import jax import jax.numpy as jnp class SinusoidTask(base_task.BaseTask): def __init__(self, x_range, amplitude, phase): self._x_range = x_range self._amplitude = amplitude self._phase = phase super().__init__() def sample_data(self, key, num_datapoints): ...
null
sinusoidal_task.py
sinusoidal_task.py
py
654
python
en
code
null
code-starcoder2
76
[ { "api_name": "base_task.BaseTask", "line_number": 6, "usage_type": "attribute" }, { "api_name": "jax.random.uniform", "line_number": 14, "usage_type": "call" }, { "api_name": "jax.random", "line_number": 14, "usage_type": "attribute" }, { "api_name": "jax.numpy.s...
462960420
# Written by Seonwoo Min, Seoul National University (mswzeus@gmail.com) # Some parts of the code were referenced from or inspired by below # - Tristan Bepler's code (https://github.com/tbepler/protein-sequence-embedding-iclr2019) """ Biological sequence encoding functions """ import numpy as np from utils import get_...
null
alphabets.py
alphabets.py
py
2,371
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.frombuffer", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.uint8", "line...
280566295
from __future__ import print_function import glob import shutil from itertools import chain import os import random import zipfile import click import matplotlib.pyplot as plt import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from lin...
null
main.py
main.py
py
11,640
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.__version__", "line_number": 42, "usage_type": "attribute" }, { "api_name": "random.seed", "line_number": 46, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 47, "usage_type": "attribute" }, { "api_name": "numpy.random.seed"...
85615637
import pandas as pd import streamlit as st import numpy as np import matplotlib.pyplot as plt import plotly.offline as pyo import plotly.graph_objects as go import plotly.express as px # Set notebook mode to work in offline pyo.init_notebook_mode() #data_url = "https://drive.google.com/file/d/1jJOFfcLoRmY8Vs...
null
Top_rest.py
Top_rest.py
py
3,423
python
en
code
null
code-starcoder2
76
[ { "api_name": "plotly.offline.init_notebook_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "plotly.offline", "line_number": 9, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas...
167739843
# coding:utf8 import scrapy import re from bs4 import BeautifulSoup import sys reload(sys) sys.setdefaultencoding('utf8') class ss_spider(scrapy.Spider): name = "sh" allowed_domins = ["sh17.cn"] start_urls = ['http://www.sh17.cn/product/category-1/', 'http://www.sh17.cn/product/categ...
null
sh17/sh17/spiders/sh1.py
sh1.py
py
3,595
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.setdefaultencoding", "line_number": 11, "usage_type": "call" }, { "api_name": "scrapy.Spider", "line_number": 14, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 48, "usage_type": "call" }, { "api_name": "scrapy.Reque...
145093872
import gc import os import random import numpy as np import pandas as pd import wandb from more_itertools import chunked from scipy.spatial.distance import cdist from sklearn.neighbors import NearestNeighbors from code_search import prepare_data from code_search import shared from code_search import train_model from ...
null
code_search/evaluate_model.py
evaluate_model.py
py
4,969
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 18, "usage_type": "attribute" }, { "api_name": "random.seed", "line_number": 19, "usage_type": "call" }, { "api_name": "code_search.build_cod...
647448108
import os import torch import torch.utils.data as data import pandas as pd import cv2 import numpy as np from ast import literal_eval from sklearn.model_selection import train_test_split from functools import partial MIX_CLASSES = ('__background__', 'person') # for making bounding boxes pretty COLORS = ((255, 0, 0, 1...
null
detector_back/worker/detector/detector/train/dataset/mix_dataset.py
mix_dataset.py
py
3,829
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 33, "usage_type": "attribute" }, { "api_name": "ast.literal_eval", "lin...
118505889
# 导入numpy工具包 import numpy as np # 使用listdir模块,用于访问本地文件 from os import listdir from sklearn.neural_network import MLPClassifier def img2vector(fileName): """ 将加载的32*32的图片矩阵展开成一列向量 """ retMat = np.zeros([1024], int) # 定义返回的矩阵,大小为1*1024 fr = open(fileName) # 打开包含32*32大小的数字文件 lines = fr.readlines() # 读取文件的所有行 for i...
null
sklearn-examples/mlp_DBRHD.py
mlp_DBRHD.py
py
2,820
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 2...
525065867
from django.core.management.base import BaseCommand, CommandError from django.core.management import call_command from django.db import connection from datetime import datetime, timedelta from django.db import IntegrityError, transaction from plans.backup.remote import Table from plans.backup.models import ImportModel...
null
plans/backup/management/commands/populate.py
populate.py
py
6,173
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.today", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 16, "usage_type": "call" }, { "api_name": "django.c...
251242868
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('dictionary', '0009_word_lang'), ] operations = [ migrations.RemoveField( model_name='word', name='tr...
null
mysite/dictionary/migrations/0010_auto_20150516_1020.py
0010_auto_20150516_1020.py
py
758
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.RemoveField", "line_number": 14, "usage_type": "call" }, ...
648039094
from django.shortcuts import render from django.http import HttpResponse from dashboard.models import Feedback # Create your views here. def index(request): return render(request, 'dashboard/index.html') def contact(request): if request.POST: name = request.POST['name'] email = request.POST['em...
null
dashboard/views.py
views.py
py
601
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 6, "usage_type": "call" }, { "api_name": "dashboard.models.Feedback", "line_number": 14, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 17, "usage_type": "call" }, { "api_nam...
45291718
import json import time import grpc from kafka import KafkaProducer, KafkaConsumer, TopicPartition from concurrent import futures from proto import WorkProtocol from proto import WorkProtocolService_pb2 from proto import WorkProtocolService_pb2_grpc def start_rpc_server(addr, port): print("Started gRPC Server... ...
null
collector/network.py
network.py
py
1,410
python
en
code
null
code-starcoder2
76
[ { "api_name": "proto.WorkProtocol", "line_number": 13, "usage_type": "call" }, { "api_name": "grpc.server", "line_number": 14, "usage_type": "call" }, { "api_name": "concurrent.futures.ThreadPoolExecutor", "line_number": 14, "usage_type": "call" }, { "api_name": "...
29854758
try: from packaging import version except ImportError: from pip._vendor.packaging import version import chainer import chainer.functions as F chainer_version = version.parse(chainer.__version__) if chainer_version < version.parse('3.0.0a1'): """Chainer's PR #2426 changed the behavior of matmul Simu...
null
chainerrl/misc/chainer_compat.py
chainer_compat.py
py
733
python
en
code
null
code-starcoder2
76
[ { "api_name": "pip._vendor.packaging.version.parse", "line_number": 10, "usage_type": "call" }, { "api_name": "pip._vendor.packaging.version", "line_number": 10, "usage_type": "name" }, { "api_name": "chainer.__version__", "line_number": 10, "usage_type": "attribute" },...
189998321
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jun 22 13:53:13 2017 @author: danifili """ import matplotlib.pyplot as plt # import cv2 import numpy as np #import scipy.cluster.vq as kmeans # from sklearn.cluster import KMeans class Plot(object): @staticmethod def plot(image, displacem...
null
backend/src/motion_analysis/Plot.py
Plot.py
py
9,374
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.imshow", "line_number": 56, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 56, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.quiver", "line_number": 65, "usage_type": "call" }, { "api_name": "m...
551209684
import json import sys import os from urllib.parse import urlparse from shutil import copyfile def main(bep_path): raw_data = "" with open(bep_path) as f: raw_data = f.read() decoder = json.JSONDecoder() pos = 0 while pos < len(raw_data): json_dict, size = decoder.raw_decode(raw_data[pos:]) if "...
null
.buildkite/failed_testlogs.py
failed_testlogs.py
py
1,004
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.JSONDecoder", "line_number": 11, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
5294827
from google.cloud import bigquery def query_stackoverflow(): client = bigquery.Client() query_job = client.query(""" SELECT * FROM ( SELECT outputs[OFFSET(0)].output_satoshis AS sat, outputs[OFFSET(0)].output_pubkey_base58 as key FROM `bigquery-public-data.bitcoin_blockchain.tr...
null
modules/testbitcoinbigquery.py
testbitcoinbigquery.py
py
596
python
en
code
null
code-starcoder2
76
[ { "api_name": "google.cloud.bigquery.Client", "line_number": 5, "usage_type": "call" }, { "api_name": "google.cloud.bigquery", "line_number": 5, "usage_type": "name" } ]
401265604
import pandas as pd import numpy as np import matplotlib.pyplot as plt import ast import pandas import numpy from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes from mpl_toolkits.axes_grid1.inset_locator import mark_inset from matplotlib.ticker import (MultipleLocator, FormatStrFormatter, ...
null
scripts/plotting/iter_vqe_plots/lih_iters.py
lih_iters.py
py
5,212
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
70047417
import requests import re import os from bs4 import BeautifulSoup def get_links(pages): base_url = 'http://desk.zol.com.cn' links = list() for page in pages: html = requests.get(page) soup = BeautifulSoup(html.text,'lxml') for li in soup('li',class_='photo-list-padding'): ...
null
zol.py
zol.py
py
1,758
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "re.findall", "line_nu...
464437500
import psutil from flask import Blueprint from flask import render_template from app.tasks.tasks import say_hi from app.tasks.tasks import long_task from app import socketio import time from threading import Lock from flask import jsonify import eventlet eventlet.monkey_patch() blue_hello = Blueprint('hello', __name__...
null
app/api/views.py
views.py
py
3,472
python
en
code
null
code-starcoder2
76
[ { "api_name": "eventlet.monkey_patch", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.Blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "threading.Lock", "line_number": 15, "usage_type": "call" }, { "api_name": "app.tasks.tasks....
209471337
# -*- coding: utf-8 -*- from __future__ import division, print_function __all__ = ["CeleriteFlowMatrix"] import tensorflow as tf from .ops import to_dense, get_matrices, factor, solve, matmul class CeleriteFlowMatrix(object): def __init__(self, a_real, c_real, a_comp, b_comp, c_comp, d_comp, x, diag, ...
null
celeriteflow/celeriteflow.py
celeriteflow.py
py
1,163
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.name_scope", "line_number": 15, "usage_type": "call" }, { "api_name": "ops.get_matrices", "line_number": 16, "usage_type": "call" }, { "api_name": "ops.factor", "line_number": 19, "usage_type": "call" }, { "api_name": "tensorflow.reduce_s...
481057032
# -*- coding: utf-8 -*- # gthnk (c) 2014-2017 Ian Dennis Miller import re import io import datetime import sys from collections import defaultdict from gthnk import models def split_filename_list(filename_str): """ """ return([x.strip() for x in filename_str.split(',')]) class JournalBuffer(object): ...
null
gthnk/adaptors/journal_buffer.py
journal_buffer.py
py
3,876
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 26, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 28, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 30, "usage_type": "call" }, { "api_name": ...
168835525
"""Helper functions for the NAPALM base.""" # std libs import os import sys # third party libs import jinja2 import textfsm # local modules import napalm_base.exceptions def load_template(cls, template_name, template_source=None, template_path=None, **template_vars): try: if isinstance(template_source...
null
napalm_base/helpers.py
helpers.py
py
5,540
python
en
code
null
code-starcoder2
76
[ { "api_name": "jinja2.Template", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "l...
590300978
import numpy as np from sklearn import datasets from sklearn.preprocessing import scale from sklearn import svm from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt digits = datasets.load_digits() # 数据归一化 data = scale(digits.data) X_train, X_test, y_train, y_test, images_train, images_t...
null
Pattern-Recognition-Lab/lab1-svm.py
lab1-svm.py
py
1,910
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.datasets.load_digits", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 8, "usage_type": "name" }, { "api_name": "sklearn.preprocessing.scale", "line_number": 10, "usage_type": "call" }, { "api_name"...
429143219
#!/usr/bin/python import argparse import sys import yaml from PIL import Image class TileBuilder(object): def __init__(self): self.tiles = {} def ConvertImage(self, data): origin = data.get('origin', (0, 0)) width = int(data['width']) * 8 height = int(data['height']) * 8 ...
null
resources/mktiles.py
mktiles.py
py
4,384
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 18, "usage_type": "name" }, { "api_name": "yaml.load", "line_number": 113, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "li...
144155445
import os from collections import defaultdict from fabric.api import * # noqa from fabric.colors import (blue, cyan, green, magenta, red, white, # noqa yellow) from fabric.contrib.files import exists # noqa def update_content_versions(pth): pth = os.path.join(pth, 'content') to_...
null
bin/fabric/utils/versioning.py
versioning.py
py
3,828
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.isdir", ...
369337449
#!/usr/bin/env python # coding: utf-8 import io from django.http import HttpResponse from django.db.models import Count from django.shortcuts import render from django.utils.translation import gettext as _ from api.models import * from urllib.request import Request from PIL import Image #-----------------------...
null
front/.~c9_invoke_8aysu5.py
.~c9_invoke_8aysu5.py
py
25,253
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.http.HttpResponse", "line_number": 113, "usage_type": "call" }, { "api_name": "urllib.request.Request", "line_number": 133, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_number": 134, "usage_type": "call" }, { "api_name": "urllib....
72962958
# -*- coding: utf-8 -*- # # Copyright (C) 2019 CERN. # # inspirehep is free software; you can redistribute it and/or modify it under # the terms of the MIT License; see LICENSE file for more details. import structlog from invenio_db import db from sqlalchemy.exc import OperationalError from inspirehep.records.api im...
null
backend/inspirehep/records/tasks.py
tasks.py
py
1,509
python
en
code
null
code-starcoder2
76
[ { "api_name": "structlog.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "invenio_db.db.session.begin_nested", "line_number": 29, "usage_type": "call" }, { "api_name": "invenio_db.db.session", "line_number": 29, "usage_type": "attribute" }, { ...
78986933
import sqlite3 from flask import Flask, render_template, request, session, redirect, url_for, flash import os app = Flask(__name__) app.secret_key = """b'(\x9a^\xde\xf8tZm_/&?X\xeb\x00\xda'""" UPLOAD_FOLDER = "./static/images/" ALLOWED_EXTENSIONS = {"png", "jpg", "jpeg", "jfif"} app.config["UPLOAD_FOLDER"] = UPLOAD_FO...
null
main.py
main.py
py
17,773
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 32, "usage_type": "call" }, { "api_name": "flask.session.get", "line_number": 51, "usage_type": "call" }, { "api_name": "flask.session", "lin...
583994720
from django.shortcuts import render, HttpResponse from mimetypes import MimeTypes import os import json import requests def index(request): cl_platform = str(request.user_agent.os.family) cl_ver = str(request.user_agent.os.version_string) query_s = cl_platform + ' ' + cl_ver query = {'query': query_s...
null
main/views.py
views.py
py
1,426
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.post", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 23, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "lin...
372710267
#!/usr/bin/env python # coding: utf-8 # In[1]: import nltk from nltk import sent_tokenize, word_tokenize, pos_tag, ne_chunk from nltk import ngrams # In[2]: datafile = "Development_data/set1/a1.txt" datafile2 = "Development_data/set1/a2.txt" questionfile = "Development_data/set1/a1q.txt" data = open(datafile, "...
null
Documents/CMU/NLP (Spring 2020)/project/answering-NER.py
answering-NER.py
py
2,598
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.sent_tokenize", "line_number": 28, "usage_type": "call" }, { "api_name": "nltk.sent_tokenize", "line_number": 31, "usage_type": "call" }, { "api_name": "nltk.word_tokenize", "line_number": 39, "usage_type": "call" }, { "api_name": "nltk.ngrams"...
576337512
#!/usr/bin/python3.2 ''' Python-Digital-Rain v1.0 ======================== Simple project that tries to simulate the digital rain effect on screen (terminal). Environment: ------------ OS: Linux (required) Python: v3.2 (required) Modules: curses, random, time (all standard modules) Usage: ------ Launches...
null
python练习/第九章/python-digital-rain-v1.py
python-digital-rain-v1.py
py
7,398
python
en
code
null
code-starcoder2
76
[ { "api_name": "curses.initscr", "line_number": 38, "usage_type": "call" }, { "api_name": "curses.curs_set", "line_number": 39, "usage_type": "call" }, { "api_name": "curses.start_color", "line_number": 40, "usage_type": "call" }, { "api_name": "curses.init_pair", ...
453027339
#!/usr/bin/env python # -- coding: utf-8 -- """ Copyright (c) 2019. All rights reserved. Created by C. L. Wang on 2019/5/17 """ import os import sys import json import re import fnmatch import numpy as np import pandas as pd import matplotlib.pyplot as plt from PIL import Image from datetime import datetime from skim...
null
preprocess/csv2coco_processor.py
csv2coco_processor.py
py
13,065
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.path", "line_num...
333929334
import paramiko import time import re import getpass #Define global regexes ip_regex=re.compile(r'[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') subnet_regex=re.compile(r'[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.') mac_regex=re.compile(r'[0-9a-f]{4}\.[0-9a-f]{4}\.[0-9a-f]{4}') int_regex=re.compile(r'Fa{1}\d/\S*\...
null
cisco_ip_trace.py
cisco_ip_trace.py
py
9,277
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 7, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 8, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 10, ...
24645426
#!/usr/bin/env python # encoding: utf-8 ''' @author: DeltaF @software: pycharm @file: 9.6饼图:电影语种统计.py @desc: ''' import C8处理与分析.pandas_def as pdef import matplotlib.pyplot as plt plt.rcParams['font.sans-serif'] = ['Arial Unicode MS'] # 获取统计数据 data = pdef.language_tj() # print(data) # 对数据进行排序 data = data.sort_values('...
null
Coder_Old/data-analysis/09-Python-Matplotlib/9.6饼图:电影语种统计.py
9.6饼图:电影语种统计.py
py
710
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 12, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 12, "usage_type": "name" }, { "api_name": "C8处理与分析.pandas_def.language_tj", "line_number": 14, "usage_type": "call" }, { "...
103083276
import xlrd #import jieba_fast as jieba #import jieba import re import pandas as pd import jieba_fast as jieba jieba.initialize() #0正常 1贷款 2信用卡 3广告 4其他 def preProcess(flag = 'train'): with open(flag + '.csv', 'w', encoding='utf-8') as w: if flag == 'test': fix = '' ...
null
process.py
process.py
py
3,129
python
en
code
null
code-starcoder2
76
[ { "api_name": "jieba_fast.initialize", "line_number": 8, "usage_type": "call" }, { "api_name": "xlrd.open_workbook", "line_number": 28, "usage_type": "call" }, { "api_name": "jieba_fast.cut", "line_number": 40, "usage_type": "call" }, { "api_name": "re.findall", ...
81721036
from io import open class Histograma(): def lectura_de_archivo(self): archivo = open("archivo_ejercicio4.txt") lista = archivo.read() lista=list(lista.replace(" ", "")) return lista def crear_histograma(self): lista = self.lectura_de_archivo() print ("Sus datos...
null
alumnos/58018-Valentin-Faraz/clase01/ejercicio4.py
ejercicio4.py
py
485
python
en
code
null
code-starcoder2
76
[ { "api_name": "io.open", "line_number": 6, "usage_type": "call" } ]