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
433628226
import os import pickle import numpy as np from PIL import Image import torch from torch.utils.data import Dataset from torchvision import transforms import h5py import json from transforms import Scale from torch.utils.data import DataLoader transform = transforms.Compose([ transforms.ToTensor(), ]) ...
null
dataset.py
dataset.py
py
4,110
python
en
code
null
code-starcoder2
83
[ { "api_name": "torchvision.transforms.Compose", "line_number": 15, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 15, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 17, "usage_type": "call" }, { ...
354672268
#!/usr/bin/python3 import sys import re import string import ipdb """ Parse a bookmarks.html file by the provided tags Group and structurize them together by common tags (order is important atm) param arg: bookmark.html file returns: BOOKMARKS.md file """ def add_to_nested_list_at_index(nested_list, index_list,...
null
Admin/Scripts/Utility/parse_bookmarks.py
parse_bookmarks.py
py
3,811
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 70, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 73, "usage_type": "attribute" }, { "api_name": "re.search", "line_number": 86, "usage_type": "call" }, { "api_name": "ipdb.set_trace", "line_numb...
482599548
import json import os import requests def main(): # url = "https://www.goodreads.com/search.xml?key={}&q=Ender%27s+Game".format(os.getenv('GOODREADS_KEY')) url = "https://www.goodreads.com/owned_books/{}?format=xml".format(os.getenv('USER_ID')) print (url) params = { 'key': os.getenv('GOODREAD...
null
get_shelves.py
get_shelves.py
py
525
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.getenv", "line_number": 7, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, ...
49355515
import argparse from datetime import datetime def valid_date(value): try: return datetime.strptime(value, "%Y-%m-%d") except ValueError: msg = "\033[91mERROR:\033[0m Fecha en formato no valido: '{0}'.".format(value) raise argparse.ArgumentTypeError(msg) def str2bool(value): if v...
null
utilities/validation.py
validation.py
py
584
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.strptime", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "argparse.ArgumentTypeError", "line_number": 11, "usage_type": "call" }, { "api_name": ...
586786480
import bs4 def scrape(site): soup = bs4.BeautifulSoup(site, 'html.parser') html_header_list = soup.select('span.deck-price-paper') for item in html_header_list: if item.text != '\n': print(item.text.strip('\n')) if __name__ == "__main__": with open('.\scraped_page.html') as f: ...
null
days/46-48-beautifulsoup4/pauper_meta/scrape_data.py
scrape_data.py
py
360
python
en
code
null
code-starcoder2
83
[ { "api_name": "bs4.BeautifulSoup", "line_number": 4, "usage_type": "call" } ]
52877629
import os import pickle import click import pandas as pd @click.command("predict") @click.option("--input-data-dir") @click.option("--input-model-dir") @click.option("--input-scaler-dir") @click.option("--output-preds-dir") def predict(input_data_dir: str, input_model_dir: str, input_scaler_dir: str, output_preds_di...
null
airflow_ml_dags/images/airflow-predict/predict.py
predict.py
py
950
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 14, "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.join", "line_nu...
63022187
import requests from bs4 import BeautifulSoup # Load the webpage url r = requests.get("https://mp.weixin.qq.com/s/tzFKo2e3FM-TEpPjGuhPaQ") # Use beautifulSoup to parse the webpage bs = BeautifulSoup(r.text,'lxml') # Index number for output image name i=1 # The assumption is to find all img tags in the webpage # Of ...
null
yasige/jpg_dowload.py
jpg_dowload.py
py
1,358
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 34, "usage_type": "call" } ]
216479846
import sys import os pathToLib = os.path.join(os.path.dirname(__file__), "../kickoff/") # NOQA sys.path.append(pathToLib) # NOQA import json import ConfigParser import StringIO import urllib2 from collections import OrderedDict from config import SUPPORTED_AURORA_LOCALES from config import SUPPORTED_NIGHTLY_LOCALES ...
null
scripts/sync-and-check-l10n.py
sync-and-check-l10n.py
py
2,894
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path.append", "line_nu...
213734778
# importing necessary packages import nltk import io import sys import os import pandas as pd from nltk.corpus import stopwords...
null
FaqFinder/QuestionSearch.py
QuestionSearch.py
py
6,551
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_excel", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.ExcelWriter", "line_number": 29, "usage_type": "call" }, { "api_name": "sklearn.metrics.pairwise.cosine_similarity", "line_number": 48, "usage_type": "call" }, { "a...
49949751
# Imports import pygame import math import random # Initialize game engine pygame.init() # Window SIZE = (800, 600) TITLE = "My Awesome Picture" screen = pygame.display.set_mode(SIZE) pygame.display.set_caption(TITLE) # Timer clock = pygame.time.Clock() refresh_rate = 60 # Colors RED = (255...
null
night_scene.py
night_scene.py
py
5,431
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pygame.display...
266085282
import logging from typing import List from fastapi import APIRouter, HTTPException from pydantic import conint from starlette.status import ( HTTP_201_CREATED, HTTP_500_INTERNAL_SERVER_ERROR, HTTP_404_NOT_FOUND, HTTP_200_OK ) from niched.database.mongo import conn from niched.database.user_utils import check_use...
null
niched/api/routers/user.py
user.py
py
2,637
python
en
code
null
code-starcoder2
83
[ { "api_name": "fastapi.APIRouter", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "niched.database.mongo.conn.get_users_collection", "line_number": 22, "usage_type": "call" }, { ...
419765086
import torch from torch.utils.data import Dataset, DataLoader from torchvision import transforms from utils.get_audio_VF import GetAudio class LibriSpeech300_train(Dataset): def __init__(self, epoch_len=100): super().__init__() self.epoch_len = epoch_len self.data_path = "/workspace/db/au...
null
dataloader/dataloader.py
dataloader.py
py
2,023
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.utils.data.Dataset", "line_number": 8, "usage_type": "name" }, { "api_name": "utils.get_audio_VF.GetAudio", "line_number": 13, "usage_type": "call" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 14, "usage_type": "call" }, { ...
336247255
import json from datetime import date, datetime, timedelta from dateutil.relativedelta import relativedelta from babel.dates import format_date from odoo import models,fields,api,_ from odoo.release import version from odoo.tools import DEFAULT_SERVER_DATE_FORMAT as DF from odoo.exceptions import ValidationError,UserE...
null
rd_tool/models/dashboard_graph.py
dashboard_graph.py
py
7,726
python
en
code
null
code-starcoder2
83
[ { "api_name": "odoo.models.AbstractModel", "line_number": 12, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 12, "usage_type": "name" }, { "api_name": "odoo.fields.Selection", "line_number": 16, "usage_type": "call" }, { "api_name": "odoo...
454395869
from django.conf.urls import patterns, include, url from .views import DBView, Files, Books from django.views.decorators.cache import cache_page urlpatterns = patterns( '', url(r'^$', DBView.as_view(), name="main"), url(r'^films/', include('db.films.urls', namespace='films')), url(r'^books$', Books.as_...
null
src/db/urls.py
urls.py
py
660
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.patterns", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "views.DBView.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "view...
198518688
# Sierpiński Carpet import numpy as np from PIL import Image import imageio w, h = 729, 729 # easy powers of three carpet_color = [157, 130, 232] # default-grey = [235, 238, 242] carpet = np.asarray([[carpet_color for i in range(w)] for j in range(h)], dtype=np.uint8) carpet_files = [] image_initial = Image.froma...
null
scripts/carpet.py
carpet.py
py
1,407
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.asarray", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PIL.Image.fromarray", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "lin...
38186946
import numpy as np import pandas as pd import multiprocessing import os import sys from functools import reduce from sklearn.feature_extraction.text import CountVectorizer from sklearn.preprocessing import OneHotEncoder # Turning off the pandas chained assignment warning pd.options.mode.chained_assignment = None c...
null
python/tools/preprocessing.py
preprocessing.py
py
7,129
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.options", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pandas.read_parquet", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.read_parquet", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.re...
102342820
import os import random import numpy as np from python_speech_features import mfcc import scipy.io.wavfile as wav from imutils import paths from sklearn.preprocessing import OneHotEncoder from sklearn.preprocessing import LabelEncoder from keras.utils import to_categorical class Audio: #trainsfer the labels to one-ho...
null
Audio.py
Audio.py
py
5,365
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.OneHotEncoder", "line_number": 22, "usage_type": "call" }, { ...
123106043
import sys import re import os import requests import pandas as pd from collections import defaultdict from openpyxl import Workbook # path = sys.argv[1] path = 'C:\\Users\\jbwang\\Desktop\\tq\\target\\demo' with open(os.path.join(path, 'folders.txt')) as fg: groupvs_list = [i.strip() for i in fg] wi...
null
codefile/kegg.py
kegg.py
py
4,751
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_nu...
226961083
# -*- coding: UTF-8 -*- #!/usr/bin/python """ Convert parsing result to conll format for TWEET @Author Yi Zhu Upated 01/30/2017 """ #************************************************************ # Imported Libraries #************************************************************ import argparse #***********************...
null
scripts/tweet_conll_converter.py
tweet_conll_converter.py
py
2,544
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 65, "usage_type": "call" } ]
386401855
from PyQt5.QtGui import QColor from PyQt5.QtWidgets import QMdiSubWindow, QWidget, QFormLayout, QHBoxLayout, \ QLabel, QLineEdit, QComboBox, QRadioButton, QPushButton, QButtonGroup, \ QSpacerItem, QSizePolicy from db.msql_db import MysqlDB class InsertDvd(QMdiSubWindow): def __init__(self): supe...
null
model/insert_dvd.py
insert_dvd.py
py
5,753
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt5.QtWidgets.QMdiSubWindow", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QFormLayout", "line_number": 13, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 16, "usage_type": "call" }, { "a...
89317862
#pip install opencv-python==3.4.3.18 #pip install azureml.core #pip install onnxruntime from __future__ import print_function import cv2 as cv import cv2 as cv2 import numpy as np import argparse from azureml.core.model import Model import onnxruntime from object_detection import ObjectDetection from PIL import Image, ...
null
ONNXObjectDetection/cascade_classifier/objectDetection.py
objectDetection.py
py
3,205
python
en
code
null
code-starcoder2
83
[ { "api_name": "azureml.core.model.Model.get_model_path", "line_number": 27, "usage_type": "call" }, { "api_name": "azureml.core.model.Model", "line_number": 27, "usage_type": "name" }, { "api_name": "onnxruntime.InferenceSession", "line_number": 28, "usage_type": "call" ...
141441774
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 2018.11.9 @author: wrj """ ''' 双分支 + 特征map32 + 交叉熵损失函数 + 参数共享 + 上支路差值求绝对值 ''' import numpy as np import math import time import model_d_map32_diff_res_pro as model import read_data import tensorflow as tf import os from datetime import da...
null
train_nature_map32_diff_res_pro.py
train_nature_map32_diff_res_pro.py
py
16,244
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "...
76498103
#!/usr/bin/python3 import requests import json import sys import pandas as pd import time import random from sqlalchemy import * import sqlalchemy import sqlalchemy.schema import io from IPython.display import * from pandas.io.json import * from sqlalchemy.types import * # https://stackoverflow.com/questions/24518944/...
null
sreality/scraping_data/sreality_a.py
sreality_a.py
py
18,222
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 36, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 41, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 52, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 9...
267728712
import math, numpy import matplotlib.pyplot as plt data = numpy.loadtxt("testSet.txt") split_data = numpy.split(data, [2], axis=1) data_x = split_data[0] data_y = split_data[1] data_x = numpy.insert(data_x, 0, 1, axis=1) theta = numpy.zeros((3,1)) alpha = 0.001 def sigmoid(data_x, theta): theta_x = nump...
null
mlia_logistic1.py
mlia_logistic1.py
py
2,194
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.loadtxt", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.split", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.insert", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": ...
393612860
""" Here I keep all settings about adaptation. How we adapt, what to adapt and what to do. """ import os from django.conf import settings STATIC_CMS_ROOT = os.path.join(settings.BASE_DIR, 'adaptation', 'plugins', '{package}', 'static') TEMPLATES_ROOT = os.path.join(STATIC_CMS_ROOT, 'tpl') JS_SCRIPT = os.path.join(s...
null
adaptation/settings.py
settings.py
py
3,508
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.conf.settings.BASE_DIR", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.c...
83260386
#!/usr/bin/env python # -*- coding: UTF-8 -*- import os,sys,re,time,urllib.parse,ntpath,zipfile,gzip,subprocess from urllib.request import Request, urlopen, urlretrieve help = ''' Entre com um emulador suportado: Windows : Snes9K Snes9x zsnesw Kega_F...
null
libs/default/GamesRetro.py
GamesRetro.py
py
15,488
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.getcwd", "line_number": 31, "usage_type": "call" }, { "api_name": "urllib.request.Request", "line_number": 135, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 143, "usage_type": "call" }, { "api_name": "time.sleep"...
182399014
from __future__ import print_function, division import os import torch import pandas as pd from skimage import io, transform import numpy as np import matplotlib.pyplot as plt from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils, VOCDetection class FaceLandmarksDataset(Dataset): ...
null
pytorch_blitz/prepare_dataset.py
prepare_dataset.py
py
1,637
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.utils.data.Dataset", "line_number": 11, "usage_type": "name" }, { "api_name": "pandas.read_json", "line_number": 22, "usage_type": "call" }, { "api_name": "skimage.transform", "line_number": 24, "usage_type": "name" }, { "api_name": "os.path.j...
128326369
from wikidataStuff.WikidataStuff import WikidataStuff as WDS import pywikibot import importer_utils as utils from os import path MAPPING_DIR = "mappings" PROPS = utils.load_json(path.join(MAPPING_DIR, "props_general.json")) class Uploader(object): TEST_ITEM = "Q4115189" def make_labels(self): label...
null
importer/Uploader.py
Uploader.py
py
11,968
python
en
code
null
code-starcoder2
83
[ { "api_name": "importer_utils.load_json", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "name" }, { "api_name": "pywikibot.Site", "line...
97556783
# -*- coding: utf-8 -*- import itertools from django import forms from django.forms import models as model_forms from django.db.models import get_model from django.utils.datastructures import SortedDict from models import get_parent_field from django.utils.encoding import smart_str def create_internal_m2m_form_facto...
null
synergy/contrib/records/forms.py
forms.py
py
12,415
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.forms.ModelForm", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 14, "usage_type": "name" }, { "api_name": "django.forms.widgets.HiddenInput", "line_number": 22, "usage_type": "call" }, { "api_nam...
78109702
import matplotlib.pyplot as plt import numpy as np import math def sigmoid(x): return 1 / (1+math.exp(-x)) x = np.linspace(-5,5,100) y = np.zeros_like(x) for i in range(len(x)): y[i] = sigmoid(x[i]) plt.figure(figsize=(10,5)) plt.plot(x,y) plt.ylabel('g(z)') plt.xlabel('z') plt.savefig('Logistic_function.pn...
null
notes/scripts/logistic.py
logistic.py
py
335
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.exp", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", ...
540808985
import datetime from pyiem.observation import Observation import pytz import os import sys import mesonet import psycopg2 IEM = psycopg2.connect("host=iemdb dbname=iem user=mesonet") icursor = IEM.cursor() now = datetime.datetime.now() fp = "/mesonet/ARCHIVE/data/%s/text/ot/ot0007.dat" % (now.strftime("%Y/%m/%d"),) ...
null
scripts/ingestors/parse0007.py
parse0007.py
py
1,111
python
en
code
null
code-starcoder2
83
[ { "api_name": "psycopg2.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path....
359960742
"""Unit tests for //compilers/clsmith/cl_launcher.py.""" import pytest import sys from absl import app from absl import flags from compilers.clsmith import cl_launcher from gpu.cldrive import driver from gpu.cldrive import env FLAGS = flags.FLAGS # A bare-bones CLSmith program. CLSMITH_EXAMPLE_SRC = """ // -g 1,1,1...
null
compilers/clsmith/cl_launcher_test.py
cl_launcher_test.py
py
2,952
python
en
code
null
code-starcoder2
83
[ { "api_name": "absl.flags.FLAGS", "line_number": 12, "usage_type": "attribute" }, { "api_name": "absl.flags", "line_number": 12, "usage_type": "name" }, { "api_name": "gpu.cldrive.env.OclgrindOpenCLEnvironment", "line_number": 77, "usage_type": "call" }, { "api_na...
461735855
import os from PIL import Image import numpy as np import cv2 path = "./pix2pix/inputs/" dirs = os.listdir(path) def black_remove(src): src = np.array(src) # src = ~src gray = cv2.cvtColor(src, cv2.COLOR_GRAY2BGR) # bg_index = np.where(np.less(gray, 255)) # gray[bg_index] = 0 return gray f...
null
util/image_prep.py
image_prep.py
py
692
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.COLOR_GRAY2BGR", "line_num...
285479424
import nltk from nltk.corpus import stopwords import glob import math from string import punctuation from collections import Counter def cleaningTXTFile(text, f): with open(f) as file: text = file.read() text = text.split(' ') stop_words = set(stopwords.words('english')) text ...
null
optimized.py
optimized.py
py
3,325
python
en
code
null
code-starcoder2
83
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 15, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 15, "usage_type": "name" }, { "api_name": "glob.glob", "line_number": 21, "usage_type": "call" }, { "api_name": "glob.glob...
46883849
__author__ = 'Max' import ArtieEditorGUI.aestartgui as GUI import wx def run_artie_editor(parent): """ Runs ArtieEditor :rtype: void :return: void """ app = wx.App() GUI.ArtieEditorStartScreen(parent) app.MainLoop() if __name__ == '__main__': run_artie_editor(None)
null
ArtieEditor/aemain.py
aemain.py
py
305
python
en
code
null
code-starcoder2
83
[ { "api_name": "wx.App", "line_number": 13, "usage_type": "call" }, { "api_name": "ArtieEditorGUI.aestartgui.ArtieEditorStartScreen", "line_number": 14, "usage_type": "call" }, { "api_name": "ArtieEditorGUI.aestartgui", "line_number": 14, "usage_type": "name" } ]
545358857
import os import pandas as pd import requests from flask import Flask, json, Response from Resources.Trainer_utilities import model_trainer app = Flask(__name__) app.config["DEBUG"] = True @app.route('/training-cp/<model>', methods=['POST']) def train_models(model): db_api = os.environ['TRAIN_DB_API'] r = r...
null
Assignment 1/Trainer/.ipynb_checkpoints/Forest_Trainer-checkpoint.py
Forest_Trainer-checkpoint.py
py
900
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_dict", ...
472350959
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Xiang Wang @ 2016-05-30 09:40:39 from testmodels.models import * from django.utils.crypto import get_random_string from django.db.models import Q from django.contrib.auth.models import * import random, time user = User.objects.first() def main(): Text.objects.bul...
null
test.py
test.py
py
1,728
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.utils.crypto.get_random_string", "line_number": 16, "usage_type": "call" }, { "api_name": "django.db.models.Q", "line_number": 22, "usage_type": "call" }, { "api_name": "django.db.models.Q", "line_number": 24, "usage_type": "call" }, { "api_n...
134971510
""" Common DBus utilities. """ __all__ = ['DBusProperties', 'DBusProxy'] from dbus import Interface from dbus.exceptions import DBusException class DBusProperties(object): """ Dbus property map abstraction. Properties of the object can be accessed as attributes. """ def __init__(self, dbus_objec...
null
udiskie/common.py
common.py
py
2,421
python
en
code
null
code-starcoder2
83
[ { "api_name": "dbus.Interface", "line_number": 18, "usage_type": "call" }, { "api_name": "dbus.exceptions.DBusException", "line_number": 35, "usage_type": "name" }, { "api_name": "dbus.Interface", "line_number": 38, "usage_type": "call" } ]
616853859
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
null
mapstory/apps/initiatives/migrations/0001_initial.py
0001_initial.py
py
2,808
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 11, "usage_type": "call...
397708190
import collections from pykka.exceptions import ActorDeadError __all__ = [ 'ActorProxy', ] class ActorProxy(object): """ An :class:`ActorProxy` wraps an :class:`ActorRef <pykka.ActorRef>` instance. The proxy allows the referenced actor to be used through regular method calls and field access. ...
null
pykka/proxy.py
proxy.py
py
7,454
python
en
code
null
code-starcoder2
83
[ { "api_name": "pykka.exceptions.ActorDeadError", "line_number": 98, "usage_type": "call" }, { "api_name": "collections.Callable", "line_number": 132, "usage_type": "attribute" } ]
167385820
#!/usr/bin/env python3 # coding: utf-8 import numpy as np from keras.datasets import boston_housing from keras import models from keras import layers from keras import optimizers import matplotlib.pyplot as plt from keras.utils.np_utils import to_categorical def vectorize_sequences(sequences, dimension=10000): #...
null
2019Fall/SWE248P/m3/house_prices/run.py
run.py
py
4,655
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.zeros", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 30, "usage_type": "call" }, { "api_name": "keras.models", "line_number": 30, "usage_type": "name" }, { "api_name": "keras.layers.Dense",...
553980301
#!/usr/bin/python # -*- coding: utf-8 -*- import _thread from django.core.mail import EmailMultiAlternatives from DjangoKMS import settings __author__ = "xuzhao" __email__ = "contact@xuzhao.xin" __file__ = "email.py" __description__ = "" __created_time__ = "2018/9/1 23:33" def send_email(mail_to, title, content): ...
null
apps/utils/email.py
email.py
py
653
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.mail.EmailMultiAlternatives", "line_number": 24, "usage_type": "call" }, { "api_name": "DjangoKMS.settings.DEFAULT_FROM_EMAIL", "line_number": 24, "usage_type": "attribute" }, { "api_name": "DjangoKMS.settings", "line_number": 24, "usage_type": ...
318485118
from .getter import app from .setter import Setter from .pool import ProxyPool from .detector import Detector from .settings import SETTER_CYCLE, DETECTOR_CYCLE from .settings import FLASK_HOST, FLASK_PORT from .settings import SETTER_ENABLE, DETECTOR_ENABLE, FLASK_ENABLE import time from multiprocessing import Process...
null
proxypool/scheduler.py
scheduler.py
py
1,226
python
en
code
null
code-starcoder2
83
[ { "api_name": "settings.SETTER_CYCLE", "line_number": 14, "usage_type": "name" }, { "api_name": "setter.Setter", "line_number": 15, "usage_type": "call" }, { "api_name": "setter.run", "line_number": 18, "usage_type": "call" }, { "api_name": "time.sleep", "line...
85410574
import glob import logging import warnings import pytest import os from _pytest.outcomes import Failed from .broker_pact import BrokerPact, BrokerPacts, PactBrokerConfig from .result import log, PytestResult def pytest_addoption(parser): group = parser.getgroup("pact specific options (pactman)") group.addop...
null
pactman/verifier/pytest_plugin.py
pytest_plugin.py
py
6,443
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ.get", "line_number": 49, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 49, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 60, "usage_type": "call" }, { "api_name": "logging.basicConfig"...
48575997
from setuptools import setup, find_packages import os import sys # Version BASE_DIR = os.path.dirname(os.path.realpath(__file__)) VERSION_FILE = os.path.join(BASE_DIR, 'pynetdicom3', '_version.py') with open(VERSION_FILE) as fp: exec(fp.read()) setup( name = "pynetdicom3", packages = find_packages(), ...
null
setup.py
setup.py
py
1,233
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
243172886
import datetime import json import sys import discord import emoji import mysql from discord.ext import commands from gssp_experiments.client_tools import ClientTools from gssp_experiments.database import cnx, cursor from gssp_experiments.database.database_tools import DatabaseTools, insert_users, insert_s...
null
bot.py
bot.py
py
7,596
python
en
code
null
code-starcoder2
83
[ { "api_name": "discord.ext.commands.Bot", "line_number": 16, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 16, "usage_type": "name" }, { "api_name": "gssp_experiments.settings.config.config", "line_number": 16, "usage_type": "name" }, { ...
579620085
import sys, pickle #, cPickle print(sys.executable) import sklearn.preprocessing as pre, scipy, numpy as np, matplotlib.pyplot as plt, glob, pyemma as py, sys, os import pandas as pd, seaborn as sns, argparse from sklearn.model_selection import train_test_split #os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" #os.environ...
null
SRV_runs/run_SRV_permute.py
run_SRV_permute.py
py
4,566
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.executable", "line_number": 2, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.path", "line...
36336290
#!/usr/bin/python3 # -*- coding: utf-8 -*- # (c) Copyright 2007-2012 by Joseph Reagle # Licensed under the GPLv3, see <http://www.gnu.org/licenses/gpl-3.0.html> '''Build a PDF (article or book) based on markdown source using pandoc. ''' import codecs from glob import glob import locale import logging import md2bib i...
null
bd.py
bd.py
py
11,555
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 25, "usage_type": "name" }, { "api_name": "logging.basicConfig", "line_number": 29, "usage_type": "call" }, { "api_name": "logging.critical", "line_number": 30, "usage_type": "attribute" }, { "api_name": "logging.info", ...
196340836
# -*- coding: utf-8 -*- """ Created on Fri Feb 19 14:28:36 2021 @author: GeonHo """ import requests import pandas as pd import numpy as np import re from bs4 import BeautifulSoup import time import copy from html_table_parser import parser_functions as parser from io import BytesIO from zipfile import...
null
crawling_dart_module.py
crawling_dart_module.py
py
19,719
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.DataFrame", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "time.time", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.get", "line_numb...
219457192
from zipfile import ZipFile import tempfile import logging import os.path as op import os import sys from pbcore.io import FastqRecord from pbcommand.testkit import PbIntegrationBase import pbtestdata from test_file_utils import (make_mock_laa_inputs, make_fastq_inputs) log = logging.ge...
null
tests/unit/test_tasks_laa.py
test_tasks_laa.py
py
2,803
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "pbtestdata.get_file", "line_number": 18, "usage_type": "call" }, { "api_name": "pbcommand.testkit.PbIntegrationBase", "line_number": 21, "usage_type": "name" }, { "api_nam...
418386429
import pyglet from pyglet.image.codecs.png import PNGImageDecoder #Farben definieren und in Variablen ablegen BACKGROUND_COLOR = (0.9, 0.9, 0.9, 1) DRAWING_COLOR_1 = (1, 0, 0) DRAWING_COLOR_2 = (0,0.5,0.5) #Fenster und seine Eigenschaften definieren window = pyglet.window.Window(width=400,height=400,resizable=True,ca...
null
aufgabe_3/Utils/loadPNGImage.py
loadPNGImage.py
py
1,204
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyglet.window.Window", "line_number": 10, "usage_type": "call" }, { "api_name": "pyglet.window", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pyglet.image.load", "line_number": 13, "usage_type": "call" }, { "api_name": "pyglet.imag...
595299138
from django.contrib import admin #from django.contrib.admin import ModelAdmin, register from .models import ( Doador, Operador, Entregador, Endereco, Telefone, Email, PessoaFisica, PessoaJuridica, Pessoa, Cobranca, ) #admin.site.register(Pessoa) @admin.register(Pessoa) c...
null
apv/apps/admin.py
admin.py
py
2,083
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 21, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 21, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 20, "usage_type": "call" }, ...
496343997
''' Created on Mar 31, 2010 @author: Drew Roos ''' from django.shortcuts import get_object_or_404 from django.http import HttpResponse from rapidsms.utils import render_to_response from circumcision.apps.circumcision.models import Registration, SentNotif from circumcision.apps.circumcision.app import split_contact_ti...
null
circumcision/apps/circumcision/views.py
views.py
py
7,540
python
en
code
null
code-starcoder2
83
[ { "api_name": "circumcision.apps.circumcision.models.Registration.objects.get", "line_number": 34, "usage_type": "call" }, { "api_name": "circumcision.apps.circumcision.models.Registration.objects", "line_number": 34, "usage_type": "attribute" }, { "api_name": "circumcision.apps....
281193660
#!/usr/local/bin/python3 ''' # 3.x script to download EventLogFiles, original by @atorman (https://github.com/atorman/elfPy) # Refactored from Python 2.7.9 by richard.krieg@gmail.com using 2to3 # Modified by @krieg to use command-line args in lieu of interactive prompts ''' import argparse import base64 import getpass...
null
elf.py
elf.py
py
5,014
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "urllib.request.parse.urlencode", "line_number": 33, "usage_type": "call" }, { "api_name": "urllib.request.parse", "line_number": 33, "usage_type": "attribute" }, { "...
107334322
""" Given a list of numbers, return whether any two sums to k. For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17. Bonus: Can you do this in one pass? """ from utils import get_input_array def check_if_pair_sums(array, sum): table = {} for num in array: if table.get(num): ...
null
problems/dcp0001.py
dcp0001.py
py
685
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.get_input_array", "line_number": 19, "usage_type": "call" } ]
519856106
import torch import torch.nn as nn import torch.nn.functional as F """ Architecture based on InfoGAN paper. """ class Generator(nn.Module): def __init__(self, z_dim, channel_dim, c_dim=0): super().__init__() self.latent_dim = z_dim + c_dim self.z_dim = z_dim self.model = nn.Sequent...
null
models/rope_model.py
rope_model.py
py
2,732
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
215206016
import collections import json import sqlite3 global para global assetcash global c c = sqlite3.connect('../dubi/sl.db').cursor() def init(): global para global assetcash global c para=collections.OrderedDict() single={'prcadj': 1, 'posadj': 1,'lvg':0.1} assetcash=dict() ...
null
project/gubi_llp/dubi/para.py
para.py
py
3,568
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 26, "usage_type": "call" }, { "api_name": "json.d...
314083183
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase from inventory.models import * import test_utils as test_utils class SimpleTest(TestCase): def tes...
null
jerseytrade/inventory/tests/test_models.py
test_models.py
py
1,186
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.test.TestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "django.test.TestCase", "line_number": 19, "usage_type": "name" }, { "api_name": "test_utils.create_brand", "line_number": 27, "usage_type": "call" }, { "api_name": "tes...
32401787
__author__ = "Travis Williams" # University of South Carolina # Jason Hattrick-Simpers group # Starting Date: June, 2016 import matplotlib.pyplot as plt import numpy as np from scripts.figure_plotters import ternary def plt_ternary_save(data, tertitle='', labelNames=('Species A','Species B','Species C'), scale=1...
null
scripts/figure_plotters/plotTernary_small.py
plotTernary_small.py
py
6,018
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 72, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 72, "usage_type": "name" }, { "api_name": "scripts.figure_plotters.ternary.figure", "line_number": 76, "usage_type": "call" }, { ...
93265884
""" This is homework 8 of SSW810 author: Mingyao Xiong """ import datetime, os from prettytable import PrettyTable def date_arithmetic(): """ This method is an example of using datetime.""" three_days_after_20000227 = datetime.datetime(2000, 2, 27) + datetime.timedelta(days=3) three_days_after_20170227 = ...
null
HW08_Mingyao_Xiong.py
HW08_Mingyao_Xiong.py
py
3,161
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.timed...
427770267
import xml.etree.ElementTree as ET import lxml.etree as LE import pymysql import sys import re """ WORKING conn = pymysql.connect(host='localhost', port=3306, user='root', passwd='1234', db='book_manager', charset='utf8mb4', autocommit=True) str = "select * from books" cur=conn.cursor() cur.execute(str) for i in range...
null
python/integrate_simple.py
integrate_simple.py
py
2,308
python
en
code
null
code-starcoder2
83
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 36, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 36, "usage_type": "name" }, { "api_name": "lxml.etree.parse", "line_number": 38, "usage_type": "call" }, { "api_name": "lx...
8504690
import requests from bs4 import BeautifulSoup import time import progressbar def scrape_insolvency_court(): """ Returns all selectable regions and courts from homepage www.insolvenzbekanntmachungen.de in a dictionary. :return (dict): keys - regions value - courts """ URL = 'h...
null
Insolvency Scraper/helpers.py
helpers.py
py
18,388
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.Session", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 33, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup...
540788827
#!/usr/bin/env python """ Copyright 2015 Brocade Communications Systems, 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 required by appl...
null
pynos/utilities.py
utilities.py
py
3,831
python
en
code
null
code-starcoder2
83
[ { "api_name": "xml.etree.ElementTree.Element", "line_number": 48, "usage_type": "attribute" }, { "api_name": "xml.etree.ElementTree", "line_number": 48, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 51, "usage_type": "call" }, ...
335188516
from utils import _Template, Field from typing import List class TaskTemplate(_Template): LEVELS = ["task"] OPTIONAL: List[str] = [] # Task level fields LABEL_TASK_BOUNDARIES = Field( name="label_task_boundaries", types=[bool], reqs=None ) LEARNER_CONFIGURATION = Field( nam...
null
experiments/config_templates/task_template.py
task_template.py
py
1,056
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils._Template", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 9, "usage_type": "name" }, { "api_name": "utils.Field", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.Field", "line_number"...
223848176
# -*- coding: utf-8 -*- """ Created on Fri Jun 10 12:21:10 2016 Clean wind data and output csv @author: mhong """ import pandas as pd import numpy as np option = 8 # 1. 股权激励 if option == 1: filename = '../../wind_data/source_data/20160721Patch/guquanjili.xlsx' df = pd.read_excel(filename) df_new = df.cop...
null
event/wind_data_cleaner.py
wind_data_cleaner.py
py
7,731
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_excel", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 33, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.arange", ...
472078364
from scholarly import scholarly import urllib.request, json import jellyfish import pandas as pd import sys class ImpactFactor: def __init__(self, file_name): self.df = pd.read_csv(file_name, delimiter=";") self.df["impact-factor"] = self.df["Cites / Doc. (2years)"] def stats(self, journal): ...
null
utils/impact_factor.py
impact_factor.py
py
1,075
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "jellyfish.jaro_winkler_similarity", "line_number": 16, "usage_type": "call" }, { "api_name": "jellyfish.jaro_winkler_similarity", "line_number": 27, "usage_type": "call" } ]
207172017
# Copyright (c) 2014 Scopely, Inc. # Copyright (c) 2015 Mitch Garnaat # Copyright (c) 2019 Christophe Morio # Copyright (c) 2020 Jerome Guibert # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # #...
null
skew/resources/aws/cloudsearch.py
cloudsearch.py
py
1,145
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "skew.resources.aws.AWSResource", "line_number": 24, "usage_type": "name" } ]
405894464
import numpy as np import matplotlib.pyplot as plt import seaborn as sns from .manta48 import spotsv def heatmap48(values=None, title=None, vert=False, figsize=(14, 4), ax=None, skip_ch=None, **kwargs): if values is None: values = np.arange(48) values = np.asfarray(values) if value...
null
multispot_utils/heatmap.py
heatmap.py
py
1,622
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.arange", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.asfarray", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 28, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", ...
509702765
import glob import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from PIL import Image import time from scipy.stats import norm SSD_GRAPH_FILE = 'frozen_models/frozen_sim_mobile/frozen_inference_graph.pb' tl = {'1': 'Green', '2': 'Red', '3': 'Yellow' , '4' : 'OFF' } class inference(): def ...
null
tf_model/infer2.py
infer2.py
py
3,923
python
en
code
null
code-starcoder2
83
[ { "api_name": "tensorflow.Graph", "line_number": 39, "usage_type": "call" }, { "api_name": "tensorflow.GraphDef", "line_number": 41, "usage_type": "call" }, { "api_name": "tensorflow.gfile.GFile", "line_number": 42, "usage_type": "call" }, { "api_name": "tensorflo...
526155722
from urllib.request import urlopen from bs4 import BeautifulSoup import mysql.connector def checkNoneTypePrice(arg): if(arg is not None): return arg.getText().replace("R$", "").strip() else: return None def checkNoneTypeLink(arg): if(arg is not None): return arg else: r...
null
PcxOlxScraping.py
PcxOlxScraping.py
py
2,537
python
en
code
null
code-starcoder2
83
[ { "api_name": "mysql.connector.connector", "line_number": 52, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 52, "usage_type": "name" }, { "api_name": "urllib.request.urlopen", "line_number": 57, "usage_type": "call" }, { "api_name": ...
24570417
from SQL_Server_Connector import SQL_Server_Connection from Queries import Queries from Indexes import Indexes from Functions import * from API_BBG import * from datetime import datetime import sys import pandas as pd import numpy as np # Main ################## Rotinas para cuidar de precos ausentes ###############...
null
Check_Prices_Repeat.py
Check_Prices_Repeat.py
py
3,948
python
en
code
null
code-starcoder2
83
[ { "api_name": "Queries.Queries", "line_number": 18, "usage_type": "name" }, { "api_name": "SQL_Server_Connector.SQL_Server_Connection", "line_number": 19, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 22, "usage_type": "attribute" }, { "api_name...
230143944
import webapp2 import jinja2 import os jinja_environment = jinja2.Environment(autoescape=True, loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'templates'))) class StartPage(webapp2.RequestHandler): def get(self): template = jinja_environment.get_template('start_page.html') ...
null
polygonlabs.py
polygonlabs.py
py
444
python
en
code
null
code-starcoder2
83
[ { "api_name": "jinja2.Environment", "line_number": 5, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "l...
520302678
import os from slack import WebClient class Slack: def __init__(self, event_type, event_user, event_text, event_ts, event_channel, event_event_ts, event_reaction=None): # Create a SlackClient for your bot to use for Web API requests slack_bot_token = os.environ["SLACK_BOT_TOKEN"] ...
null
lib/slack/slack.py
slack.py
py
1,445
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "slack.WebClient", "line_number": 10, "usage_type": "call" } ]
290978366
import os import glob import sys import tensorflow as tf from tqdm import tqdm_notebook as tqdm import logging from scipy import misc import numpy as np from tensorflow.contrib.keras.python import keras from tensorflow.contrib.keras.python.keras import layers, models from tensorflow import image from utils import sc...
null
code/aux_function.py
aux_function.py
py
8,373
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.separable_conv2d.SeparableConv2DKeras", "line_number": 23, "usage_type": "call" }, { "api_name": "tensorflow.contrib.keras.python.keras.layers.BatchNormalization", "line_number": 26, "usage_type": "call" }, { "api_name": "tensorflow.contrib.keras.python.keras...
632383064
#!/usr/bin/env python from sploitego.maltego.message import IPv4Address, UIMessage from sploitego.framework import configure from common.reversegeo import getlocbymac __author__ = 'Nadeem Douba' __copyright__ = 'Copyright 2012, Sploitego Project' __credits__ = ['Nadeem Douba'] __license__ = 'GPL' __version__ = '0.1...
null
src/sploitego/transforms/findlocbymac.py
findlocbymac.py
py
1,011
python
en
code
null
code-starcoder2
83
[ { "api_name": "sploitego.maltego.message.UIMessage", "line_number": 32, "usage_type": "call" }, { "api_name": "common.reversegeo.getlocbymac", "line_number": 34, "usage_type": "call" }, { "api_name": "sploitego.framework.configure", "line_number": 24, "usage_type": "call"...
422561979
import collections import motor import tornado import tornado.web import pymongo import wrds import multiprocessing import multiprocessing.pool import numpy as np import time from aBlackFireCapitalClass.ClassStocksMarketData.ClassStocksMarketDataInfos import StocksMarketDataInfos # from bBlackFireCapitalData.Countrie...
null
zBlackFireCapitalImportantFunctions/SetClobalsEnvironment.py
SetClobalsEnvironment.py
py
11,277
python
en
code
null
code-starcoder2
83
[ { "api_name": "multiprocessing.Process", "line_number": 35, "usage_type": "attribute" }, { "api_name": "multiprocessing.pool", "line_number": 46, "usage_type": "attribute" }, { "api_name": "collections.namedtuple", "line_number": 50, "usage_type": "call" }, { "api...
111533048
""" Canonical structures """ import os import sys import json import pickle import numpy as np import bcr_models as igm try: FileNotFoundError except NameError: FileNotFoundError = IOError class CsDatabase(object): """ Database interface for canonical structures. """ def get(self, ig_ch...
null
bcr_models/canonical_structures.py
canonical_structures.py
py
4,958
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 76, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 88, "usage_type": "call" }, { "api_name": "os.path", "line_number": 88, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_numbe...
63385965
import sys, os sys.path.extend([os.path.join(root, name) for root, dirs, _ in os.walk("../") for name in dirs]) from module import Model import tensorflow as tf import tensorflow_tools as tf_tools from block import cnn_block class CNN(Model): def __init__(self, scope_name, channel_min, width, height, channel_rate...
null
TF_Build/TF_Build/unet/cnn_rgb.py
cnn_rgb.py
py
6,619
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.extend", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 2, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
588438925
# Copyright (c) 2018 UAVCAN Consortium # This software is distributed under the terms of the MIT License. # Author: Pavel Kirienko <pavel@uavcan.org> import os import typing import logging from . import _serializable from . import _expression from . import _error from . import _dsdl_definition from . import _parser fr...
null
pydsdl/_data_type_builder.py
_data_type_builder.py
py
17,142
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 41, "usage_type": "call" }, { "api_name": "typing.Iterable", "line_number": 48, "usage_type": "attribute" }, { "api_name": "typing.Callable", "line_number": 49, "usage_type": "attribute" }, { "api_name": "typing.Op...
326034138
''' 87. 単語の類似度 85で得た単語の意味ベクトルを読み込み,"United States"と"U.S."のコサイン類似度を計算せよ. ただし,"U.S."は内部的に"U.S"と表現されていることに注意せよ. ''' import pickle import scipy.io as sio from numpy.linalg import norm from scipy import sparse def load(file_name): with open(f"./pickles/{file_name}.pkl", 'rb') as f_in: data = pickle.load(f_in) ...
null
kiyuna/chapter09/knock87.py
knock87.py
py
796
python
en
code
null
code-starcoder2
83
[ { "api_name": "pickle.load", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 19, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 24, "usage_type": "call" }, { "api_name": "scipy.io", "line_n...
42955053
############################################################################## # Institute for the Design of Advanced Energy Systems Process Systems # Engineering Framework (IDAES PSE Framework) Copyright (c) 2018-2019, by the # software owners: The Regents of the University of California, through # Lawrence Berkeley N...
null
idaes/dmf/util.py
util.py
py
8,169
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 31, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 56, "usage_type": "call" }, { "api_name": "re.match", "line_number": 82, "usage_type": "call" }, { "api_name": "tempfile.mkdtemp",...
493368223
#-*-coding:utf-8-*- __author__ = 'AeenPython' """ 由于淘宝的清单页的加密暂时无法破解,换个方式使用,直接抓取所有商品的列表 清单加密方式已经破解,接续尝试 """ import asyncio import json import os import random import re import time from datetime import datetime import pandas as pd from pyppeteer import errors from pyppeteer import launch from retrying import retry c...
null
Pyppete/taobao_store_classdown.py
taobao_store_classdown.py
py
11,832
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyppeteer.launch", "line_number": 38, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 85, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 134, "usage_type": "call" }, { "api_name": "json.loads", "line_number...
558634418
from __future__ import absolute_import import logging import os import re import shutil import subprocess import sys from io import open from typing import (Dict, List, Text, MutableMapping, Any) from .errors import WorkflowException from .job import ContainerCommandLineJob from .pathmapper import PathMapper, ensure...
null
cwltool/singularity.py
singularity.py
py
8,056
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "job.ContainerCommandLineJob", "line_number": 22, "usage_type": "name" }, { "api_name": "re.search", "line_number": 29, "usage_type": "call" }, { "api_name": "re.sub", ...
555781287
from FT.weighted_tracts import load_ft, nodes_labels_mega, nodes_by_index_mega import matplotlib.pyplot as plt from FT.all_subj import all_subj_names from dipy.tracking import utils import numpy as np from dipy.tracking.streamline import values_from_volume import nibabel as nib import os index_to_text_file = r'C:\User...
null
non_norm_hist.py
non_norm_hist.py
py
2,465
python
en
code
null
code-starcoder2
83
[ { "api_name": "FT.all_subj.all_subj_names", "line_number": 11, "usage_type": "name" }, { "api_name": "FT.weighted_tracts.load_ft", "line_number": 17, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 18, "usage_type": "call" }, { "api_name": "os.p...
356006672
import speech_recognition as sr r = sr.Recognizer() file = sr.AudioFile('test2.wav') with file as source: r.adjust_for_ambient_noise(source) audio = r.record(source) result = r.recognize_google(audio, language='fr') print(result)
null
voice_to_text.py
voice_to_text.py
py
238
python
en
code
null
code-starcoder2
83
[ { "api_name": "speech_recognition.Recognizer", "line_number": 3, "usage_type": "call" }, { "api_name": "speech_recognition.AudioFile", "line_number": 5, "usage_type": "call" } ]
524095328
import json import os import argparse import abeja from abeja.datasets import APIClient from abejacli.config import ( ABEJA_PLATFORM_USER_ID, ABEJA_PLATFORM_TOKEN ) if __name__ == '__main__': parser = argparse.ArgumentParser(description='Annotation Data Importer: Text Classification') parser.add_argument...
null
scripts/text_classification.py
text_classification.py
py
2,582
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "abejacli.config.ABEJA_PLATFORM_USER_ID", "line_number": 21, "usage_type": "name" }, { "api_name": "abejacli.config.ABEJA_PLATFORM_TOKEN", "line_number": 22, "usage_type": "n...
604620417
import vk_api from pymongo import MongoClient client = MongoClient('localhost', 27017) collection = client.test.coll2 def get_pool(vk_session, comm_id, wall, dbname="test", collname="coll"): global collection collection = client.get_database(dbname).get_collection(collname) get_pool_comments(vk_session, ...
null
api_funcs.py
api_funcs.py
py
5,597
python
en
code
null
code-starcoder2
83
[ { "api_name": "pymongo.MongoClient", "line_number": 4, "usage_type": "call" }, { "api_name": "vk_api.VkRequestsPool", "line_number": 25, "usage_type": "call" }, { "api_name": "vk_api.VkRequestsPool", "line_number": 60, "usage_type": "call" }, { "api_name": "vk_api...
599842981
from sklearn.ensemble import RandomForestClassifier import math class Domain: def __init__(self, name, label=None): self.name = name.strip() self.length = len(name) if label: self.label = label.strip() else: self.label = None self.entropy = Domain.cal...
null
test.py
test.py
py
1,754
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.log2", "line_number": 29, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 57, "usage_type": "call" } ]
415726096
import numpy as np import matplotlib.pyplot as plt incomes = np.random.normal(27000, 15000, 10000) # center of 27000, std 15000, 10000 data points np.mean(incomes) np.median(incomes) plt.hist(incomes, 50) # create a histogram broken into 50 buckets plt.show() incomes = np.append(incomes, [1000000000])
null
basic_stats.py
basic_stats.py
py
314
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.normal", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.mean", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.median", "lin...
243377501
import time import urllib import httplib2 import simplejson import datetime from twitter.utils import OAuthSettings from twitter.models import TwitterToken, Notification from freshbooks.models import UserProfile import simpleoauth import settings uri = 'http://api.twitter.com/1/statuses/update.json' def get_status(...
null
twitter/api.py
api.py
py
1,447
python
en
code
null
code-starcoder2
83
[ { "api_name": "twitter.models.TwitterToken.objects.get", "line_number": 28, "usage_type": "call" }, { "api_name": "twitter.models.TwitterToken.objects", "line_number": 28, "usage_type": "attribute" }, { "api_name": "twitter.models.TwitterToken", "line_number": 28, "usage_...
237623300
#import rospy import rclpy from heartbeat_profiler_msgs.msg import HeartbeatProfiling from std_msgs.msg import String import datetime from zoro_utils import time as zorotime class FunctionProfiler: def __init__(self, node, func_name): # Internal data self.node = node self.runtime_accumulate...
null
spin_camera/src/octopus-dependency/src/heartbeat_sender/heartbeat_sender/heartbeat_profiler.py
heartbeat_profiler.py
py
2,688
python
en
code
null
code-starcoder2
83
[ { "api_name": "heartbeat_profiler_msgs.msg.HeartbeatProfiling", "line_number": 27, "usage_type": "argument" }, { "api_name": "zoro_utils.time.Time.now", "line_number": 47, "usage_type": "call" }, { "api_name": "zoro_utils.time.Time", "line_number": 47, "usage_type": "attr...
219162453
import xlrd from xlutils.copy import copy class ExcelUtil(): def __init__(self,excel_path = '',index = None): if excel_path == '': excel_path = 'D:\workspace\python\config\case_data.xls' if index == None: index = 0 self.excel_path = excel_path self.index = ind...
null
util/excel_util.py
excel_util.py
py
1,376
python
en
code
null
code-starcoder2
83
[ { "api_name": "xlrd.open_workbook", "line_number": 11, "usage_type": "call" }, { "api_name": "xlrd.open_workbook", "line_number": 44, "usage_type": "call" }, { "api_name": "xlutils.copy.copy", "line_number": 45, "usage_type": "call" } ]
424757544
# -*- coding: utf-8 -*- """ Created on Wed Apr 1 22:05:02 2020 @author: einar """ import ast from collections import Counter from scipy.sparse import csr_matrix import numpy as np def clean_url(x): x = x.replace('http://','').replace('https://','').replace('www.','') string = x.split('/') return string[...
null
EinarTest/FinalEinar/functions.py
functions.py
py
847
python
en
code
null
code-starcoder2
83
[ { "api_name": "ast.literal_eval", "line_number": 22, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 26, "usage_type": "call" }, { "api_name": "scipy.sparse.csr_matrix", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.in...
578848044
# coding: utf-8 from itertools import zip_longest from logging import getLogger from math import degrees from random import randrange import bpy import mathutils from .icr2model.flavor import * from .icr2model.flavor.flavor import * from .icr2model.flavor.value.unit import to_papy_degree from .icr2model.flavor.value.v...
null
io_scene_3do/export_3do.py
export_3do.py
py
25,101
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "bpy.data", "line_number": 74, "usage_type": "attribute" }, { "api_name": "random.randrange", "line_number": 145, "usage_type": "call" }, { "api_name": "random.randrange", ...
34337631
import sqlite3 conn = sqlite3.connect("services/chinook.db") try: pass crs = conn.cursor() cmd1 = "select CustomerId, FirstName, LastName from customers" crs.execute(cmd1) for customer_row in crs: # print(customer_row) cust_id = customer_row[0] num_track...
null
In Class Code/2-16-19/in_class_190226/preparation/rest_example/basic_report.py
basic_report.py
py
1,474
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.connect", "line_number": 5, "usage_type": "call" } ]
183915148
from PIL import Image import PIL import sys, os import shutil from pathlib import Path def copyAndCompress(fromDirectory, compressDirectory): shutil.rmtree(compressDirectory) print(fromDirectory) shutil.copytree(fromDirectory, compressDirectory) print(compressDirectory) print(os) print(os.c...
null
carouselImageCompressor.py
carouselImageCompressor.py
py
1,002
python
en
code
null
code-starcoder2
83
[ { "api_name": "shutil.rmtree", "line_number": 9, "usage_type": "call" }, { "api_name": "shutil.copytree", "line_number": 12, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 1...
107744066
from flask import Flask, Blueprint, redirect, url_for, request, session, render_template, flash, g, current_app import uuid import msal import json config = current_app.config auth = Blueprint('auth', __name__, url_prefix=config.get('AUTH_ENDPOINTS_PREFIX'), static_folder='static') msal_instance = msal.ConfidentialC...
null
auth_endpoints.py
auth_endpoints.py
py
5,183
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.current_app.config", "line_number": 6, "usage_type": "attribute" }, { "api_name": "flask.current_app", "line_number": 6, "usage_type": "name" }, { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "msal.Con...
444395460
import os from Bio import SeqIO from Bio.Seq import Seq from Bio.Alphabet import IUPAC from Bio.SeqRecord import SeqRecord from Bio.Alphabet import generic_dna from Bio import SeqFeature as SF from Bio.SeqFeature import FeatureLocation from Bio.SeqFeature import SeqFeature def export_dna_record(gene_seq, gene_id, gen...
null
MetaCHIP_Temp/prodigal_parser.py
prodigal_parser.py
py
5,554
python
en
code
null
code-starcoder2
83
[ { "api_name": "Bio.Seq.Seq", "line_number": 13, "usage_type": "call" }, { "api_name": "Bio.Alphabet.IUPAC.unambiguous_dna", "line_number": 13, "usage_type": "attribute" }, { "api_name": "Bio.Alphabet.IUPAC", "line_number": 13, "usage_type": "name" }, { "api_name":...
352572929
# This file is part of Checkbox. # # Copyright 2013 Canonical Ltd. # Written by: # Zygmunt Krynicki <zygmunt.krynicki@canonical.com> # Daniel Manrique <roadmr@ubuntu.com> # # Checkbox is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3, # as publi...
null
python3/dist-packages/plainbox/impl/transport.py
transport.py
py
10,443
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 43, "usage_type": "call" }, { "api_name": "plainbox.abc.ISessionStateTransport", "line_number": 57, "usage_type": "name" }, { "api_name": "plainbox.i18n.gettext", "line_number": 98, "usage_type": "call" }, { "api_n...
69862015
import os from django.db import models from django.http import HttpResponse from django.shortcuts import render from gunicorn.http.wsgi import FileWrapper from pyconbalkan.conference.models import Conference, CountDown, MissionStatement from pyconbalkan.settings import BASE_DIR from pyconbalkan.speaker.models import ...
null
pyconbalkan/core/views.py
views.py
py
2,309
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.Person", "line_number": 16, "usage_type": "call" }, { "api_name": "pyconbalkan.conference.models.CountDown.objects.filter", "line_number": 30, "usage_type": "call" }, { "api_name": "pyconbalkan.conference.models.CountDown.objects", "line_number": 30, ...