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
418302126
import openpyxl as px from bitarray import bitarray import operator """Special character removed Words containing digit removed if total frequency of a token is greater than 0.5 times no. of document then it is considered stop word nothing is done in stemming bitarray was used for query query of an...
null
dand_hindi_q1.py
dand_hindi_q1.py
py
5,882
python
en
code
null
code-starcoder2
76
[ { "api_name": "bitarray.bitarray", "line_number": 98, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 149, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 158, "usage_type": "call" } ]
378005987
import os from celery import Celery os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') app = Celery('mysite') app.config_from_object('django.conf:settings') app.autodiscover_tasks() app.conf.task_routes = { 'basics.tasks.queue_test': {'queue': 'slow'}, '*': {'queue': 'celery'}, }
null
mysite/mysite/celery.py
celery.py
py
308
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.setdefault", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "celery.Celery", "line_number": 7, "usage_type": "call" } ]
506066048
from django.forms import ModelForm, ValidationError from user_panel.models.training import Training class TrainingForm(ModelForm): def clean(self): cleaned_data = super().clean() start = cleaned_data.get('start') end = cleaned_data.get('end') if start != None and end != None: ...
null
dialexi/user_panel/forms/training.py
training.py
py
1,856
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "name" }, { "api_name": "django.forms.ValidationError", "line_number": 12, "usage_type": "call" }, { "api_name": "user_panel.models.training.Training", "line_number": 16, "usage_type": "name" } ]
284334867
import sys #from PyQt4.QtWidgets import * #from PyQt4.QtCore import * import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtWidgets, QtGui import numpy as np import cv2 import math import os class ControlWindow(QtWidgets.QWidget): def __init__(self): QtWidgets.QWidget.__init__(self) self.cap =...
null
ratapps/whitebox.py
whitebox.py
py
18,013
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyqtgraph.Qt.QtWidgets.QWidget", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pyqtgraph.Qt.QtWidgets", "line_number": 12, "usage_type": "name" }, { "api_name": "pyqtgraph.Qt.QtWidgets.QWidget.__init__", "line_number": 14, "usage_type": "ca...
155217850
import numpy as np import cv2 import pdb from keras.models import Model from keras import layers from keras.layers import Activation from keras.layers import Dense from keras.layers import Input,Dropout from keras.layers import BatchNormalization from keras.layers import Conv2D,Flatten from keras.layers imp...
null
Code_Alpha/model.py
model.py
py
5,498
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.layers.BatchNormalization", "line_number": 39, "usage_type": "call" }, { "api_name": "keras.layers.Activation", "line_number": 40, "usage_type": "call" }, { "api_name": "keras.layers.Conv2D", "line_number": 41, "usage_type": "call" }, { "api_n...
561188898
from lxml import html import json import requests # get all product page links page = requests.get("https://greenz.ca/shop") tree = html.fromstring(page.content) product_urls = [] next_button = True while next_button: for product in tree.xpath('//li[contains(@class, "type-product")]'): product...
null
scraping/greenz/scrape.py
scrape.py
py
851
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "line_number": 7, "usage_type": "call" }, { "api_name": "lxml.html", "line_number": 7, "usage_type": "name" }, { "api_name": "requests.get", "line_num...
566371043
""" :mod:`expensum.cli.app` - Application entry point =========================================================== This module contains all the entry points for the CLI application. .. module:: expensum.cli.app :synopsis: CLI application entry point .. moduleauthor:: Lucas van Dijk <info@return1.net> """ from __...
null
expensum/cli/app.py
app.py
py
2,938
python
en
code
null
code-starcoder2
76
[ { "api_name": "expensum.models.Base.metadata.create_all", "line_number": 26, "usage_type": "call" }, { "api_name": "expensum.models.Base", "line_number": 26, "usage_type": "attribute" }, { "api_name": "expensum.models", "line_number": 26, "usage_type": "name" }, { ...
459849255
import cv2 import numpy as np def mouse_callback(event, x, y, flags, param): "Função para definir as ações ao detectar eventos do mouse na imagem." if event == cv2.EVENT_LBUTTONDOWN: global image, image_to_show, limite global was_pressed, pressed # Restaura a imagem original image_to_show = np.copy(image...
null
src/req4.py
req4.py
py
3,322
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.EVENT_LBUTTONDOWN", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.copy", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 25, "usage_type": "attribute" }, { "api_name": "numpy.float32...
589013634
import nltk # Load NLTK import time from service.TextMiningService import TextMiningService from service.sklearnService import SkLearnService from service.propertyService import PropertyService # nltk.download() nltk.download('punkt') nltk.download('stopwords') nltk.download('wordnet') from db.postgresl import Prope...
null
python_textmining_master/python_modules/service/update_property_size_textmining.py
update_property_size_textmining.py
py
1,390
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.download", "line_number": 8, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 9, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 10, "usage_type": "call" }, { "api_name": "db.postgresl.PropertyDAO", ...
461599341
#!/usr/bin/python3 """ Function that queries the Reddit API and returns the number of subscribers (not active users, total subscribers) for a given subreddit """ from requests import get def number_of_subscribers(subreddit): """ Suscribers by subreddit """ headers = {"user-agent": "kyeeh"} url = "...
null
0x16-api_advanced/0-subs.py
0-subs.py
py
571
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" } ]
4315148
#! estimateAreaofCircleAndAlsoPi.py # Are you familiar with the dartboard estimation of the area of a circle? ''' Consider a dartboard with a circle of radius r inscribed in a square with side 2r. Now let's say you start throwing a alrge number of darts at it. Some of these will hit the board within the circle (e.g. N)...
null
Python Refresher/Python Math/5 Sets, Probability, Cartesian Products, Law of Large Numbers, Estimating Area of a Circle/estimateAreaofCircleAndAlsoPi.py
estimateAreaofCircleAndAlsoPi.py
py
1,671
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.uniform", "line_number": 23, "usage_type": "call" }, { "api_name": "sympy.pi", "line_number": 32, "usage_type": "name" }, { "api_name": "sympy.pi.evalf", "line_number": 54, "usage_type": "call" }, { "api_name": "sympy.pi", "line_number": ...
575900368
import numpy as np import glob from scipy import misc from skimage.transform import resize from sklearn.utils import shuffle import matplotlib.pyplot as plt class DatasetProcessing(object): #Initaliser method def __init__(self, typeOfImg, numofimgs, pathtoimgs): self.pathToImgs = pathtoimgs se...
null
Testing/DataPreProcessing/DataPreProcessing.py
DataPreProcessing.py
py
3,758
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 26, "usage_type": "call" }, { "api_name": "scipy.misc.imread", "line_numbe...
163569531
""" Class to handle stat collection """ import os import numpy as np import scipy.io import ConfigParser from utils import get_unique_file_name import logging log = logging.getLogger("global_log") class StatManager: def __init__(self, configFile, name="", resultsFile=None): self.parseConfigurationFile(co...
null
pyhawkes/utils/stat_manager.py
stat_manager.py
py
10,847
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.ceil", "line_number": 60, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 63, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
334205890
#!/usr/bin/python # -*- coding: utf-8 -*- import inspect from functools import wraps def carry(func, additional_args = (), kwargs = (), force_defaults = False): """ @carry or @carry(force_defaults = True) Decorator which enables function arguments carrying. If there i...
null
a_carrying.py
a_carrying.py
py
5,208
python
en
code
null
code-starcoder2
76
[ { "api_name": "functools.wraps", "line_number": 55, "usage_type": "call" }, { "api_name": "inspect.getargspec", "line_number": 70, "usage_type": "call" } ]
466557678
"""Learn embedding weights with LBANN.""" import argparse import os.path import lbann import lbann.contrib.launcher import lbann.contrib.args import dataset from utils import make_iterable, str_list import utils.snap # ---------------------------------- # Options # ---------------------------------- # Command-line ...
null
applications/graph/main.py
main.py
py
4,886
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "lbann.contrib.args.add_scheduler_arguments", "line_number": 19, "usage_type": "call" }, { "api_name": "lbann.contrib", "line_number": 19, "usage_type": "attribute" }, { ...
154800229
import keras import numpy as np from tensorflow.python.keras.callbacks import Callback from validators.lfw import read_pairs_file, create_pairs, read_images class ValidateOnLfw(Callback): def __init__(self, pairs_path, lfw_path, classes_count): self.pairs = pairs_path self.lfw_path = lfw_path ...
null
metric_learning/callbacks.py
callbacks.py
py
2,396
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.python.keras.callbacks.Callback", "line_number": 8, "usage_type": "name" }, { "api_name": "validators.lfw.read_pairs_file", "line_number": 16, "usage_type": "call" }, { "api_name": "validators.lfw.create_pairs", "line_number": 17, "usage_type": "...
16763442
""" Authors: sfatima@i2cinc.com Purpose: This file contains a database connection class that allows to group database connection parameters for python """ from pyspark import SQLContext class SparkProperties: def __init__(self, url, properties=None, spark=None, sc=None): self.sql_context = SQLContext(s...
null
AICommons/aicommons/sparkProperties/SparkProperties.py
SparkProperties.py
py
432
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyspark.SQLContext", "line_number": 14, "usage_type": "call" } ]
222066521
import matplotlib.pyplot as plt import base64 from io import BytesIO def get_graph(): buffer=BytesIO() plt.savefig(buffer, format="png") buffer.seek(0) image_png=buffer.getvalue() graph=base64.b64encode(image_png) graph=graph.decode("utf-8") buffer.close() return graph def get_plot(cd...
null
statistic/utils.py
utils.py
py
1,435
python
en
code
null
code-starcoder2
76
[ { "api_name": "io.BytesIO", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.savefig", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "base64.b64encode"...
322789581
import os import shutil import sys from utils.porterStemming import PorterStemmer # ----------------------------- # CONFIGURE SPARK ENVIRONMENT # ----------------------------- try: os.environ['SPARK_HOME'] = "/Users/admin/spark-1.6.0/" sys.path.append("/Users/admin/spark-1.6.0/python/lib/py4j-0.9-src.zip") #...
null
SparkLearn/invert_index.py
invert_index.py
py
4,057
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.path.append", "...
626789689
import json import threading import time import subprocess from Queue import Queue class Player(object): def __init__(self, sounder): self.sounder = sounder with open('chords.js') as file: self.chords = json.load(file) def chord(self, k): c = self.chords[k] # print...
null
giantguitar/player.py
player.py
py
1,728
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "json.load", "line_number": 32, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 34, "usage_type": "call" }, { "api_name": "Queue.Queue", "line_number": ...
275294332
# What is the fast way to apply bcs from block import block_bc, block_assemble from dolfin import * from xii.linalg.convert import convert from xii.linalg.convert import numpy_to_petsc from scipy.sparse import csr_matrix from block import block_mat, block_vec from block.block_bc import block_rhs_bc from petsc4py impo...
null
xii/linalg/bc_apply.py
bc_apply.py
py
10,627
python
en
code
null
code-starcoder2
76
[ { "api_name": "block.block_mat", "line_number": 25, "usage_type": "argument" }, { "api_name": "block.block_mat", "line_number": 26, "usage_type": "call" }, { "api_name": "block.block_vec", "line_number": 32, "usage_type": "argument" }, { "api_name": "block.block_v...
16602252
from django.contrib import admin from django.forms import BaseInlineFormSet from shop.models import Item, Section, Article, Order, OderedItem @admin.register(Item) class ItemAdmin(admin.ModelAdmin): list_display = ['name', 'section'] list_filter = ['section'] @admin.register(Section) class SectionAdmin(admi...
null
project/shop/admin.py
admin.py
py
856
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 8, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 7, "usage_type": "call" }, { ...
9318721
import scipy as sp from .ZCache import zkey import scipy.integrate as integrate import scipy.stats as stats import scipy.optimize as optimize import numpy as np import random import math from cachetools import cached, TTLCache, keys # cache = TTLCache(maxsize=100, ttl=300) class Greedy: def __init__(self, move_...
null
strategies/Greedy.py
Greedy.py
py
2,503
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.uniform", "line_number": 27, "usage_type": "call" }, { "api_name": "scipy.optimize.minimize", "line_number": 42, "usage_type": "call" }, { "api_name": "scipy.optimize", "line_number": 42, "usage_type": "name" }, { "api_name": "scipy.integrate...
63228405
from django import template #导入模板模块 register=template.Library() #取出注册库,固定写法 @register.filter(name='coderstatus')#注册过滤器的名字为coderstatus def coder_status(value,arg): if value=='morehair': return "{}是菜鸟程序员".format(arg) if value=="middlehair": return "{}是工程师级程序员".format(arg) if value=='fewhair': ...
null
书籍源码/第十六章部署样例/myproject-linux/myapp/templatetags/test_filter.py
test_filter.py
py
448
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.template.Library", "line_number": 2, "usage_type": "call" }, { "api_name": "django.template", "line_number": 2, "usage_type": "name" } ]
231992901
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ~ Author: Pavel Ivanov import os import sys sys.path.append(os.path.abspath(os.path.dirname(__file__)+'/../')) import json import unittest import flask_server class FlaskTestCase(unittest.TestCase): app = None def __init__(self, *args, **kwargs): "...
null
tests/flask_session_test.py
flask_session_test.py
py
4,097
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number...
247949631
from django.db import models from django.utils import translation from django.urls import reverse from django.core.validators import FileExtensionValidator import datetime from ckeditor.fields import RichTextField from hk.templatetags import custom_tags selected_language = translation.get_language() class All_Navba...
null
hk/models.py
models.py
py
21,693
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.utils.translation.get_language", "line_number": 10, "usage_type": "call" }, { "api_name": "django.utils.translation", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.models.Model", "line_number": 13, "usage_type": "attribute" },...
51968718
""" Library Features: Name: lib_generic_utils_land Author(s): Fabio Delogu (fabio.delogu@cimafoundation.org) Date: '20190312' Version: '1.0.0' """ ####################################################################################### # Library import logging import numpy as np from src.co...
null
src/common/utils/lib_utils_apps_land.py
lib_utils_apps_land.py
py
2,056
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "src.common.default.lib_default_args.sLoggerName", "line_number": 18, "usage_type": "argument" }, { "api_name": "numpy.where", "line_number": 26, "usage_type": "call" }, { ...
228664881
""" Created by Vilde N. Strom, July 2017. Simula Research Laboratory """ import os import shutil import datetime now=datetime.datetime.now() time = now.strftime("%d.%m-%H.%M") Date='Data-'+time #name of output folder #Assigning variable names to important folders root=os.getcwd() #path to In_Silico_Heart_Models ma...
null
mat2fem.py
mat2fem.py
py
7,384
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 15, "usage_type": "call" }, { "api_name": "os.getenv", ...
89899466
''' Created on Aug 16, 2010 @author: turturica ''' from django.db.models.signals import post_save, pre_delete from labinventory.event.models import Reservation from labinventory.asset.models_common import StaticBag, StaticSystem, \ StaticLicense, StaticAddress, StaticCredential, Port, Asset from labinvent...
null
labinventory/notifications/core.py
core.py
py
7,594
python
en
code
null
code-starcoder2
76
[ { "api_name": "labinventory.asset.conf.AUTOREFRESH_USERNAME", "line_number": 33, "usage_type": "attribute" }, { "api_name": "labinventory.asset.conf", "line_number": 33, "usage_type": "name" }, { "api_name": "labinventory.asset.models_common.Asset", "line_number": 37, "us...
454413432
"""Test all the isotherm model functions.""" import ast import os import numpy import pytest import pygaps.calculations.models_isotherm as models from pygaps.utilities.exceptions import ParameterError MODEL_DATA_PATH = os.path.join(os.path.dirname(__file__), 'isotherm_model_data') MODELS_TESTED = { 'Henry': py...
null
tests/calculations/test_models_isotherm.py
test_models_isotherm.py
py
3,224
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.mark", "line_num...
313000957
#判断字符串是否是整数、浮点数、复数 '''def isNum(str): print(isinstance(str,(int,float,complex)))''' #判断是否是质数 '''def isPrime(i): l=[] for x in range(2,i): if i%x==0: l.append(x) if len(l)==0: print(True) else: print(False) isPrime(24)''' #编写函数计算传入的数字、字母、空格和其他字符的个数 '''def counts(st...
null
test1.py
test1.py
py
5,774
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 169, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 187, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 188, "usage_type": "call" } ]
182330313
import os import json from django.conf import settings def _get_secrets(file_name): with open(os.path.join(settings.BASE_DIR, file_name)) as f: return json.loads(f.read()) def get_secret(setting, file_name): secrets = _get_secrets(file_name) try: return secrets[setting] except KeyError...
null
_game_chats/settings/__init__.py
__init__.py
py
438
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.conf.settings.BASE_DIR", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.conf...
148811707
from flask import Flask, render_template from flask_debugtoolbar import DebugToolbarExtension from jinja2 import StrictUndefined import os app = Flask(__name__) app.jinja_env.undefined = StrictUndefined app.secret_key = os.environ["SECRET_KEY"] @app.route('/', methods=['GET']) def view_index(): return render_t...
null
server.py
server.py
py
439
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "jinja2.StrictUndefined", "line_number": 8, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.render_template...
274476303
from datetime import datetime from queue import Queue import serial import sys import time import traceback from concord.concord_commands import RX_COMMANDS, \ build_cmd_equipment_list, EQPT_LIST_REQ_TYPES, \ build_dynamic_data_refresh, build_keypress, \ build_cmd_alarm_trouble from concord.concord_helper...
null
Concord4.indigoPlugin/Contents/Server Plugin/concord/concord.py
concord.py
py
20,648
python
en
code
null
code-starcoder2
76
[ { "api_name": "serial.EIGHTBITS", "line_number": 18, "usage_type": "attribute" }, { "api_name": "serial.STOPBITS_ONE", "line_number": 19, "usage_type": "attribute" }, { "api_name": "serial.PARITY_ODD", "line_number": 20, "usage_type": "attribute" }, { "api_name": ...
533970561
#!/usr/bin/env python3 #Bibliotecas importadas from ev3dev.ev3 import * from time import sleep import time import datetime from simple_pid import PID import paho.mqtt.client as mqtt #Sensores do outro brick sensor_ultra_server = 0 sensor_cor_server = 0 def on_message(client, userdata, message): global sensor_cor...
null
kk.py
kk.py
py
8,379
python
en
code
null
code-starcoder2
76
[ { "api_name": "paho.mqtt.client.Client", "line_number": 28, "usage_type": "call" }, { "api_name": "paho.mqtt.client", "line_number": 28, "usage_type": "name" }, { "api_name": "simple_pid.PID", "line_number": 59, "usage_type": "call" }, { "api_name": "simple_pid.PI...
27548238
import logging import torch from ....extensions import nms from ..utils.bbox_helper import filter_by_size from ..utils.box_sampler import sample from ..utils.matcher import match logger = logging.getLogger('global') def proposal_targets(proposals, gt_bboxes, gt_attris, image_info, cfg, ignore_regions=None): T ...
null
unn/models/heads/attribute_head/attribute.py
attribute.py
py
2,235
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "utils.bbox_helper.filter_by_size", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.cat", "line_number": 32, "usage_type": "call" }, { "api_name": "utils.ma...
372217349
import json import boto3 from datetime import datetime connection = boto3.client('emr', region_name='us-east-2') clusters = connection.list_clusters(ClusterStates=['RUNNING','WAITING'])['Clusters'] def lambda_handler(event, context): if len(clusters) > 0: cluster_ids = [] for cluster in cluste...
null
TerminateEMRCluster/lambda_function.py
lambda_function.py
py
555
python
en
code
null
code-starcoder2
76
[ { "api_name": "boto3.client", "line_number": 6, "usage_type": "call" } ]
100198178
import sys import collections def findFrequentEntries(pairs): # Your code here. Writes to standard out. # Format for output lines: "Name: 1230 1240 1245" occur = collections.defaultdict(list) for l in pairs: occur[l[0]].append(int(l[1])) badge = {} for k,v in occur.items(): occur[k]=...
null
random solutions/in.py
in.py
py
1,426
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 50, "usage_type": "attribute" } ]
290527064
""" Functions for simplifying the creation of a local dask cluster. """ import os import dask from aiohttp import ClientConnectionError from datacube.utils.dask import start_local_dask from datacube.utils.rio import configure_s3_access def create_local_dask_cluster( spare_mem="3Gb", aws_unsigned=True, d...
null
Tools/deafrica_tools/dask.py
dask.py
py
3,404
python
en
code
null
code-starcoder2
76
[ { "api_name": "dask.config.set", "line_number": 54, "usage_type": "call" }, { "api_name": "dask.config", "line_number": 54, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 56, "usage_type": "call" }, { "api_name": "os.environ", "lin...
475712623
# -*- coding: utf-8 -*- from django.http import HttpResponseForbidden from django.core.cache import cache from django.utils.deprecation import MiddlewareMixin from .models import IPAddress, BannedUser from . import settings from .util import set_cookie, get_ip def forbid(request, context=None): """ Forbids a...
null
pybb/contrib/ban/middleware.py
middleware.py
py
2,057
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.http.HttpResponseForbidden", "line_number": 24, "usage_type": "call" }, { "api_name": "django.utils.deprecation.MiddlewareMixin", "line_number": 27, "usage_type": "name" }, { "api_name": "util.get_ip", "line_number": 43, "usage_type": "call" }, {...
537023327
#!/usr/bin/env python3 from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from model import Base, Category, Item, User engine = create_engine('sqlite:///catalog.db') Base.metadata.bind = engine DBSession = sessionmaker(bind=engine) session = DBSession() user1 = User(username='user 1', emai...
null
vagrant/catalog/lotsofitem.py
lotsofitem.py
py
4,629
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.create_engine", "line_number": 7, "usage_type": "call" }, { "api_name": "model.Base.metadata", "line_number": 8, "usage_type": "attribute" }, { "api_name": "model.Base", "line_number": 8, "usage_type": "name" }, { "api_name": "sqlalchemy....
525603150
# -*- coding: utf-8 -*- #!/usr/bin/env python3 ''' Created on Wed Nov 14 21:24:45 CST 2018 @Mail: minnglee@163.com @Author: Ming Li ''' import sys,os,logging,click def LoadFiles(files): ''' 11 1415000 1480000 65000 11 4055000 4065000 10000 11 4480000 4495000 15000 ''' Dict = {} for line in...
null
Selection/GetOverlap.py
GetOverlap.py
py
1,379
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "logging.DEBUG", ...
653682571
import cv2 import math class Overlay: def __init__(self, joystickInput, angle, color, inverted): self.joystickInput = joystickInput self.angle = angle self.color = color self.inverted = inverted def run(self, input, frame): height, width, channels = frame.shape ...
null
Python/Utils/Overlay.py
Overlay.py
py
784
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.tan", "line_number": 19, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 19, "usage_type": "attribute" }, { "api_name": "math.pow", "line_number": 20, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 20, ...
200758831
from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField, IntegerField, SelectField from wtforms.validators import ValidationError, DataRequired, Optional, Email, EqualTo, Length from app.models import User, Course, Hole # Contains forms that app uses # ...
null
app/forms.py
forms.py
py
3,631
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask_wtf.FlaskForm", "line_number": 9, "usage_type": "name" }, { "api_name": "wtforms.StringField", "line_number": 10, "usage_type": "call" }, { "api_name": "wtforms.validators.DataRequired", "line_number": 10, "usage_type": "call" }, { "api_name":...
177434040
"""Instantiates the Airbnb application.""" from flask import Flask, render_template, redirect, request from flask.helpers import url_for app = Flask(__name__) @app.route('/', methods=['POST', 'GET']) async def index(): """Homepage view.""" if request.method == 'POST': latitude = request.form['latitu...
null
src/main.py
main.py
py
984
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.request.form...
560251224
import numpy as np from scipy import io from random import randint import h5py import logging import pdb import os data_directory = "./tripletExps/data/" cifarTripletData = io.loadmat('cifarTripletData') allCombsTrain = cifarTripletData['allCombsTrain'] trainsetDataByLabel = cifarTripletData['trainsetDataBy...
null
generateTripletData.py
generateTripletData.py
py
2,422
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.io.loadmat", "line_number": 10, "usage_type": "call" }, { "api_name": "scipy.io", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.reshape", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_num...
318360540
#### this code mixes the background tracks and signal tracks per bunch crossing #### run: python3 makeEnergyRatioFromTextFile.py <bxNumberWanted> import os import sys import time import pprint import math from ROOT import * from collections import OrderedDict import argparse ### global variables m2mm = 1000 ...
null
makeEnergyRatioFromTextFile.py
makeEnergyRatioFromTextFile.py
py
12,770
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.sqrt", "line_number": 54, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 69, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 133, "usage_type": "call" }, { "api_name": "time.time", "line_nu...
445334888
import torch from torch import nn import torch.nn.functional as F import matplotlib.pyplot as plt from hyper_params import params class SmallVGG(nn.Module): def __init__(self, num_classes, in_channel, c1, c2, c3): super().__init__() # Initialize our layers. Following the VGG architecture, we use ...
null
models/SmallVGG.py
SmallVGG.py
py
2,868
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
254297447
import timeit from random import randint, shuffle import matplotlib.pyplot as plt def desenhaGrafico(x, y, xl="Entradas", yl="Saidas", name="out"): fig = plt.figure(figsize=(10, 8)) ax = fig.add_subplot(111) ax.plot(x, y, label="Melhor Tempo") ax.legend(bbox_to_anchor=(1, 1), bbox_transform=p...
null
Radix/radix_sort.py
radix_sort.py
py
1,169
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.gcf", "line_number": 10, "usage_type": "call" }, { "api_name": "matplo...
19016516
from rest_framework import serializers from musics import models as musics_models import os from django.utils.translation import ugettext_lazy as _ import json from location import models as location_models from musics import converter import logging log = logging.getLogger(__name__) VALID_MUSIC_FORMAT = ('wav', 'aif...
null
zonia-backend-master/musics/base/validators.py
validators.py
py
6,971
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 15, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 15, "usage_type": "name" ...
253517774
#!/bin/env python # Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract # DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government # retains certain rights in this software. # External dependencies import PIL.Im...
null
agent/slycat-pbs-agent.py
slycat-pbs-agent.py
py
17,393
python
en
code
null
code-starcoder2
76
[ { "api_name": "agent.Agent", "line_number": 30, "usage_type": "attribute" }, { "api_name": "agent.Agent.__init__", "line_number": 38, "usage_type": "call" }, { "api_name": "agent.Agent", "line_number": 38, "usage_type": "attribute" }, { "api_name": "random.randint...
639083355
# coding: utf-8 from django import template from django.template.defaultfilters import stringfilter from sepomex.models import Sepomex register = template.Library() @register.filter @stringfilter def municipio(value): return_value = '' if value != '': edo, asenta = value.split('-') m = Sepomex...
null
demasys/sepomex/templatetags/sepomex_filters.py
sepomex_filters.py
py
898
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.template.Library", "line_number": 6, "usage_type": "call" }, { "api_name": "django.template", "line_number": 6, "usage_type": "name" }, { "api_name": "sepomex.models.Sepomex.objects.filter", "line_number": 14, "usage_type": "call" }, { "api_n...
479977684
from modules.base_load import BaseLoad import modules.util as mu import my_config as mc import pandas as pd import os import numpy as np import pickle import json import sys import shutil import category_encoders as ce from sklearn.model_selection import train_test_split from imblearn.over_sampling import RandomOverS...
null
modules/base_sk_proc.py
base_sk_proc.py
py
24,623
python
en
code
null
code-starcoder2
76
[ { "api_name": "my_config.return_base_path", "line_number": 56, "usage_type": "call" }, { "api_name": "modules.util.create_folder", "line_number": 59, "usage_type": "call" }, { "api_name": "modules.util", "line_number": 59, "usage_type": "name" }, { "api_name": "mo...
84527046
import sys from PyQt5.QtWidgets import QApplication,QMainWindow,QAction,QLabel,QPushButton,QHBoxLayout,QVBoxLayout,QWidget,QGridLayout,QLineEdit,QMessageBox from PyQt5.QtCore import Qt from login_jukuan import JoinQuantClient from trade_day import T_date from buy_sell import shipanyiData import datetime,time import eas...
null
pyqt5_work/shiopane_work/GUI_/tonghuashun.py
tonghuashun.py
py
7,466
python
en
code
null
code-starcoder2
76
[ { "api_name": "trade_day.T_date", "line_number": 11, "usage_type": "name" }, { "api_name": "login_jukuan.JoinQuantClient", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 46, "usage_type": "call" }, { "api_name": "d...
140232403
from django.shortcuts import render from django.views import View # Create your views here. from django.http import HttpResponse def hello(request): return HttpResponse("hello fucking world!") def base(request, username): return render(request, "base.html", {"username": username}) def main(request): fo...
null
RIP/mysite/myapp/views.py
views.py
py
3,663
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.http.HttpResponse", "line_number": 8, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 18, "usage_type": "call" }, { "api_name"...
80189767
#%% import os try: os.chdir(os.path.join(os.getcwd(), "Kaggle/credit card")) print(os.getcwd()) except: pass #%% import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import warnings warnings.filterwarnings('ignore') from sklearn.model_selection import train_test_split from s...
null
Kaggle/credit card/credit_card.py
credit_card.py
py
4,245
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 4, ...
300233547
import carla import erdos import math from pylot.simulation.utils import get_vehicle_handle, get_world class CarlaCollisionLoggerOperator(erdos.Operator): def __init__(self, vehicle_id_stream, can_bus_stream, flags): can_bus_stream.add_callback(self.on_can_bus_update) self._vehicle_id_stream = ve...
null
pylot/loggers/carla_collision_logger_operator.py
carla_collision_logger_operator.py
py
2,142
python
en
code
null
code-starcoder2
76
[ { "api_name": "erdos.Operator", "line_number": 8, "usage_type": "attribute" }, { "api_name": "erdos.utils.setup_csv_logging", "line_number": 13, "usage_type": "call" }, { "api_name": "erdos.utils", "line_number": 13, "usage_type": "attribute" }, { "api_name": "mat...
441262714
#!/bin/env python # # Copyright (c) 2015, BlueData Software, Inc. # # The main cloudera deployment script import socket, sys, time, os import logging, traceback from subprocess import Popen, PIPE, STDOUT from cm_api.api_client import ApiResource, ApiException from cm_api.endpoints.services import ApiService from cm_a...
null
CSFB/cdh5161-cm-setup/deploy_sqoop_client.py
deploy_sqoop_client.py
py
4,636
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 20, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.stdout...
65991575
# coding:utf-8 # Created by yang import uuid import datetime import tornado.ioloop import tornado.options import tornado.web import os.path import tornado.websocket import logging from tornado.options import define, options define("port", default=8883, help="run on the given port", type=int) class Application(tornad...
null
chatdemo.py
chatdemo.py
py
2,576
python
en
code
null
code-starcoder2
76
[ { "api_name": "tornado.options.define", "line_number": 14, "usage_type": "call" }, { "api_name": "tornado.ioloop.web", "line_number": 16, "usage_type": "attribute" }, { "api_name": "tornado.ioloop", "line_number": 16, "usage_type": "name" }, { "api_name": "os.path...
480764702
#! /usr/bin/python import numpy as np import matplotlib.pyplot as plt import datetime from matplotlib import colors from matplotlib.colors import LogNorm from mpl_toolkits.axes_grid1 import make_axes_locatable import matplotlib.cm as cm import matplotlib as mpl import sys import os import matplotlib.gridspec as gridspe...
null
scripts/f01-rivnum_glob.py
f01-rivnum_glob.py
py
3,261
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.makedirs", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.int32", "line_number": 36, "usage_type": "attribute" }, { "api_name": "re.split", "line_numb...
19443023
import numpy as np from sklearn.datasets import load_breast_cancer from sklearn.linear_model import LogisticRegression as LR from sklearn.metrics import accuracy_score from sklearn.model_selection import StratifiedKFold from sklearn.preprocessing import StandardScaler import matplotlib.pyplot as plt from logistic_regr...
null
test_binary.py
test_binary.py
py
1,653
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sklearn.datasets.load_breast_cancer", "line_number": 12, "usage_type": "call" }, { "api_name"...
248268615
import praw import sqlite3 from time import sleep import tearbotuser USERNAME = tearbotuser.username PASSWORD = tearbotuser.password USERAGENT = '/r/No_Cry_Challenge stat-collecting agent Version 1 by /u/Triplanetary and /u/po_toter. \ Powered by love... and tears.' r = praw.Reddit(USERAGENT) r.login(USE...
null
tearbot.py
tearbot.py
py
2,876
python
en
code
null
code-starcoder2
76
[ { "api_name": "tearbotuser.username", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tearbotuser.password", "line_number": 7, "usage_type": "attribute" }, { "api_name": "praw.Reddit", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlite3...
113806875
import copy import logging from collections import OrderedDict from copy import deepcopy from io import BytesIO import struct from typing import Dict from soulstruct.core import SoulstructError from soulstruct.params import enums from soulstruct.params.fields import GAME_PARAM_INFO from soulstruct.params.paramdef impo...
null
soulstruct/params/core.py
core.py
py
19,659
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "soulstruct.params.paramdef.ParamDefBND", "line_number": 28, "usage_type": "call" }, { "api_name": "soulstruct.params.paramdef.ParamDefBND", "line_number": 32, "usage_type": "call"...
592395679
import sys sys.path.append('/home/jovyan/work') from nw_func import * from gen import * from news import clients_kw import argparse from sqlalchemy import create_engine engine = create_engine('postgresql://{}:{}@{}:5439/zgda'.format(cred.aws['user'],cred.aws['password'],cred.aws['server'])) conn = engine.connect() par...
null
nw/engagement.py
engagement.py
py
9,285
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "sqlalchemy.create_engine", "line_number": 8, "usage_type": "call" }, { "api_name": "argparse.Argument...
619918202
import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches from pickle import dump, load sentiments = open("Sentiments.txt", 'r') data = load(sentiments) #Creates lists with the correct sentiment data positive_sentiments = [] negative_sentiments = [] x = np.linspace(0, 31, len(data)) for...
null
web_scraper/sentiment_grapher.py
sentiment_grapher.py
py
733
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplo...
562716400
# By Shatha Jaradat # KTH - Royal Institute of Technology # 2018 # Some parts of the code that are related to finetunning models was taken from the following link: # Then customised according to my needs #https://gist.github.com/panovr/2977d9f26866b05583b0c40d88a315bf import torch import torch.nn as nn import torch....
null
Models/DynamicConnections/MultiClass_DynamicPruning.py
MultiClass_DynamicPruning.py
py
15,646
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 23, "usage_type": "name" }, { "api_name": "torch.FloatTensor", "line_number": 27, "usage_type": "call" }, { "api_name": "Models.Constants_Inst...
197750536
import csv import cv2 import os import time import sys from PySide2.QtCore import * from PySide2.QtGui import * from datetime import datetime threshold = 67 # percentage """ Responsible for interfacing with web cam and the logic envolving the camera The class is a QThead that runs in the background and emit...
null
camera.py
camera.py
py
7,890
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.CascadeClassifier", "line_number": 52, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 55, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 60, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRA...
501639592
# -*- coding: utf-8 -*- # Copyright European Organization for Nuclear Research (CERN) since 2012 # # 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-...
null
lib/rucio/common/schema/lsst.py
lsst.py
py
15,909
python
en
code
null
code-starcoder2
76
[ { "api_name": "jsonschema.validate", "line_number": 421, "usage_type": "call" }, { "api_name": "jsonschema.ValidationError", "line_number": 422, "usage_type": "name" }, { "api_name": "rucio.common.exception.InvalidObject", "line_number": 423, "usage_type": "call" } ]
596639555
import pygame as pg import sys import ConnectFour as c4 SIZE = width, height = 640, 480 SCREEN = pg.display.set_mode(SIZE) BLUE = (0, 0, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) YELLOW = (255, 255, 0) brd = None def updateBoard(brd): for x in range(0, 6): for y in range(0, 7): pg.draw.rect(...
null
ConnectFourGUI.py
ConnectFourGUI.py
py
1,265
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.display.set_mode", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.draw.rect", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.dra...
127048416
import logging from django.core.exceptions import ObjectDoesNotExist, EmptyResultSet from django.core.mail import send_mail from django.utils import timezone from telebot import types from bot import bot from bot.controllers.user import can_subscribe from bot.models import StaticMessage, LEARNING_DESC, User, Pricing,...
null
bot/controllers/bot.py
bot.py
py
23,992
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "bot.utils.pagination.stat_pagination", "line_number": 35, "usage_type": "call" }, { "api_name": "bot.utils.pagination.order_pagination", "line_number": 37, "usage_type": "call" ...
273090322
""" Implement Flatten Arrays. Given an array that may contain nested arrays, produce a single resultant array. """ from collections import Iterable def flatten_returns_list(input_array, output_array=None): if output_array is None: output_array = [] for element in input_array: if isinstance(ele...
null
Backup/data-structures-algorithms/arrays/flatten.py
flatten.py
py
809
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Iterable", "line_number": 13, "usage_type": "argument" }, { "api_name": "collections.Iterable", "line_number": 26, "usage_type": "argument" } ]
630771377
#!/usr/bin/python3.5 import os import cv2 import numpy as np import pickle import glob from copy import deepcopy import math from time import time cvnn = True if cvnn: from keras.models import load_model dstPers = np.float32([[500, 720], [780, 720], [780, 50], [500, 50]]) CALCAM_FILENAME = "cam_cal.pkl" M = Minv =...
null
procVideoCNN.py
procVideoCNN.py
py
25,857
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.float32", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.float32", "line_n...
572201166
from keras.models import Sequential from keras.layers import Dense, Dropout from keras.optimizers import Adagrad from sklearn.model_selection import KFold import keras.backend as K import numpy as np import argparse, os, time def f1score(y_true, y_pred): y_pred_pos = K.round(K.clip(y_pred, 0, 1)) y_pre...
null
codes/holdout/DFN3-relu-lr001.py
DFN3-relu-lr001.py
py
4,158
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.backend.round", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 11, "usage_type": "name" }, { "api_name": "keras.backend.clip", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.backend.ro...
640332918
#!/usr/bin/python # -*- coding: utf-8 -*- import data from bs4 import BeautifulSoup if __name__ == "__main__": with open('../OtherDatas/LandSection-20140502.xml', encoding="utf-8") as f: dataxml = f.read() soup = BeautifulSoup(dataxml, "html.parser") print('file loaded') with data.storage() as...
null
LandName/load.py
load.py
py
1,182
python
en
code
null
code-starcoder2
76
[ { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "data.storage", "line_number": 12, "usage_type": "call" } ]
354566748
import os import logging import pickle import datetime from array import array from struct import pack from sklearn.neural_network import MLPClassifier from utils import extract_feature # Setup Logging formatter = logging.Formatter("\n\n%(asctime)s\n%(message)s") def setup_logger(name, log_file, level=logging.INFO): ...
null
external_programs/classify.py
classify.py
py
2,675
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.Formatter", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.getLo...
346279695
#!/usr/bin/env python # coding: utf-8 # In[1]: import os import seaborn as sns color=sns.color_palette() sns.set_style('darkgrid') import pandas as pd get_ipython().run_line_magic('matplotlib', 'inline') import matplotlib.pyplot as plt import numpy as np import warnings def ignore_warn(*args, **kwargs): pass w...
null
Final Exam Lab-Principles-of-Machine-Learning-Python Edition (CLASSIFICATION).py
Final Exam Lab-Principles-of-Machine-Learning-Python Edition (CLASSIFICATION).py
py
10,771
python
en
code
null
code-starcoder2
76
[ { "api_name": "seaborn.color_palette", "line_number": 9, "usage_type": "call" }, { "api_name": "seaborn.set_style", "line_number": 10, "usage_type": "call" }, { "api_name": "warnings.warn", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pandas.read...
519286068
#!/usr/bin/python # coding=utf-8 """ Copyright 2012 Telefonica Investigación y Desarrollo, S.A.U This file is part of Billing_PoC. Billing_PoC is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either ve...
null
invoicer/pdf/invoice.py
invoice.py
py
2,010
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date.today", "line_number": 42, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 42, "usage_type": "name" }, { "api_name": "xhtml2pdf.pisa.showLogging", "line_number": 53, "usage_type": "call" }, { "api_name": "xhtml2pd...
600155030
import urllib.request from numpy.core.fromnumeric import searchsorted import pandas as pd from datetime import datetime,timedelta import requests import xmltodict import openpyxl url_base = 'http://openapi.data.go.kr/openapi/service/rest/Covid19/getCovid19SidoInfStateJson?serviceKey=' url_serviceKey = 'XK5R2J%2B6nCIWN...
null
xml_corona_practice.py
xml_corona_practice.py
py
4,340
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.today", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "xmltodict.pars...
334251326
from PIL import Image from PIL import ImageFilter im = Image.open('Preston.jpg') im.show() print(im.format, im.size, im.mode) # thumbnail size = (128, 128) im.thumbnail(size) im.show() im.save('Preston thumbnail.jpg', 'JPEG') # rotating rotated = im.rotate(45) rotated.save('Preston rotated.jpg', 'JPEG') rotated...
null
Class9/hwexample.py
hwexample.py
py
686
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 3, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 3, "usage_type": "name" }, { "api_name": "PIL.Image.FLIP_TOP_BOTTOM", "line_number": 25, "usage_type": "attribute" }, { "api_name": "PIL.Image", ...
34126680
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import time import pickle from sklearn.naive_bayes import GaussianNB from sklearn.metrics import accuracy_score import dataframe_image as dfi def table(val, model = 0): pkl_filename = "Decision_Tree.pkl" ...
null
ML-IDS/output.py
output.py
py
1,877
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 39, "usage_type": "call" }, { "api_name": "pandas.read_pickle", "line_number": 40, "usage_type": "call" }, { "api_name": "dataframe_image.export", ...
33327642
#!/usr/bin/env python # # Copyright 2007 Google 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 applicable law o...
null
dashboard/main.py
main.py
py
3,355
python
en
code
null
code-starcoder2
76
[ { "api_name": "webapp2.RequestHandler", "line_number": 32, "usage_type": "attribute" }, { "api_name": "google.appengine.api.memcache.get", "line_number": 34, "usage_type": "call" }, { "api_name": "google.appengine.api.memcache", "line_number": 34, "usage_type": "name" }...
343467410
#%% import requests import json block = 7 address = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY' sidecar_url = 'http://127.0.0.1:8080/' def get_latest_block(sidecar: str): block_data = {} url = sidecar + 'block/' response = requests.get(url) if response.ok: block_data = json.loads(response.text) return ...
null
reconcile2.py
reconcile2.py
py
3,370
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "json.loads", "line_number": ...
634193387
""" ======================================================================================================================== ======================= Classification applications on the handwritten digits data ===================================== =======================================================================...
null
Week6/COMP450_WEEK-6_TASK-3.py
COMP450_WEEK-6_TASK-3.py
py
6,758
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sklearn.datasets.load_digits", "line_number": 27, "usage_type": "call" }, { "api_name": "skle...
375498849
import sys from apgl.util.Util import Util from apgl.util.Sampling import Sampling from exp.sandbox.recommendation.SoftImpute import SoftImpute import numpy import unittest import logging import scipy.sparse import numpy.linalg import numpy.testing as nptst class SoftImputeTest(unittest.TestCase): def setUp(...
null
exp/sandbox/recommendation/test/SoftImputeTest.py
SoftImputeTest.py
py
2,345
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 15, "usage_type": "attribute" }, { "api_name": "logging.IN...
80226293
import pymysql import cv2 import numpy as np import paramiko from datetime import datetime from imutils.perspective import four_point_transform from scipy.stats import gaussian_kde import imutils class connect(): def __init__(self, ip, port, username, password, database): self.ip = ip self.port = p...
null
germination/yyGermination.py
yyGermination.py
py
14,776
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymysql.connect", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.imencode", "line_number": 64, "usage_type": "call" }, { "api_name": "numpy.fromstring", "line_number": 98, "usage_type": "call" }, { "api_name": "numpy.uint8", "line...
171790376
import requests #token requested through developer.webex website - 12 hours #create room access_token = '*****' url = 'https://webexapis.com/v1/rooms' headers = { 'Authorization': 'Bearer {}'.format(access_token), 'Content-Type': 'application/json' } params={'title': 'netacad_devasc_skills_JB'} res = requests...
null
6_webex/netacad_webex_.py
netacad_webex_.py
py
1,467
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.post", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 19, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 25, "usage_type": "call" }, { "api_name": "requests.post", "line_n...
278067237
from flask import Flask, render_template, request, session, redirect, url_for, current_app from . import front_bp from ..models import News, Product, Case, Solution, Category, NewsClass app = Flask(__name__) @front_bp.route('/', methods=['GET', 'POST']) def index(): # solution_list = [] # filters = [Solution...
null
app/front/views.py
views.py
py
6,343
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "models.Product.status", "line_number": 22, "usage_type": "attribute" }, { "api_name": "models.Product", "line_number": 22, "usage_type": "name" }, { "api_name": "models.Product.q...
22876578
from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from django.shortcuts import render, redirect, render_to_response from wish_list.forms import EmailUserCreationForm, CategoryForm, LocationForm, CategoryPhotoForm from wish_list.models import Member, Category, Locatio...
null
wish_list/views.py
views.py
py
3,258
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 9, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 15, "usage_type": "call" }, { "api_name": "wish_list.models.Member.objects.get", "line_number": 16, "usage_type": "call" }, { ...
413292571
#!/usr/bin/env python3 """Takes in a combined 2d and 3d hotspot file (grch37) and updates the transcript ids to their respective grch38 ids. It does so by following a 2 step process: 1. Parse the file ../../data/grch38_ensembl95/export/ensembl_biomart_canonical_transcripts_per_hgnc.txt to get a map of hugo symbol X...
null
scripts/hotspots/update_hotspots_to_grch38.py
update_hotspots_to_grch38.py
py
9,647
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.Session", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.adapters.Retry", "line_number": 33, "usage_type": "call" }, { "api_name": "requests.adapters.HTTPAdapter", "line_number": 36, "usage_type": "call" }, { "api_name":...
563450224
import zipfile import shutil import tempfile import requests from os import path #--- Globals ---------------------------------------------- VENDORS = [ # Analytics "wakatime/vim-wakatime", # Syntax "vim-ruby/vim-ruby", "kchmck/vim-coffee-script", "cakebaker/scss-syntax.vim", "tpope/vim-...
null
update_vendors.py
update_vendors.py
py
2,392
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 56, "usage_type": "call" }, { "api_name": "os.path", "line_number": 56, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 56, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
613118205
#!/usr/bin/env python3 ## # Objective: Helper class for EBS, ENI, and ASG managers import botocore import pprint from awsretry import AWSRetry pp = pprint.PrettyPrinter(indent=4) class CasEC2Manager: _session = None _client = None _resource = None _pp = None def __init__(self, session, client,...
null
core-components/packer/cassandra/scripts/cas_ec2_mgr.py
cas_ec2_mgr.py
py
4,513
python
en
code
null
code-starcoder2
76
[ { "api_name": "pprint.PrettyPrinter", "line_number": 10, "usage_type": "call" }, { "api_name": "pprint.PrettyPrinter", "line_number": 23, "usage_type": "call" }, { "api_name": "botocore.exceptions", "line_number": 31, "usage_type": "attribute" }, { "api_name": "aw...
273938214
import wx app = wx.App() # 构建应用对象 win = wx.Frame( # 构建窗体对象 None, title="simple editor", size=(410, 335)) bkg = wx.Panel(win) # 构建窗体面板对象 # 定义“open”按钮的单击事件响应函数 def openFile(evt): dlg = wx.FileDialog( win, "Open", "", "", "All files...
null
wxPython/testwx2.py
testwx2.py
py
2,007
python
en
code
null
code-starcoder2
76
[ { "api_name": "wx.App", "line_number": 3, "usage_type": "call" }, { "api_name": "wx.Frame", "line_number": 4, "usage_type": "call" }, { "api_name": "wx.Panel", "line_number": 8, "usage_type": "call" }, { "api_name": "wx.FileDialog", "line_number": 12, "usa...
110961008
from itertools import product def compute(): peter = [0.0] * 37 colin = [0.0] * 37 for a, b, c, d, e, f, g, h, i in product(range(1,5), repeat = 9): peter[a + b + c + d + e + f + g + h + i] += 4 ** (-9) for a, b, c, d, e, f in product(range(1,7), repeat = 6): colin[a + b + c + d + e + ...
null
Python/205.py
205.py
py
472
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.product", "line_number": 7, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 9, "usage_type": "call" } ]
247124758
# coding=utf-8 # Copyright 2015 Foursquare Labs Inc. All Rights Reserved. from __future__ import ( absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement, ) from collections import defaultdict from itertools import chain import os import re from pants.bac...
null
src/python/fsqio/pants/spindle/tasks/spindle_gen.py
spindle_gen.py
py
9,907
python
en
code
null
code-starcoder2
76
[ { "api_name": "pants.backend.jvm.tasks.nailgun_task.NailgunTask", "line_number": 33, "usage_type": "name" }, { "api_name": "fsqio.pants.spindle.tasks.spindle_task.SpindleTask", "line_number": 33, "usage_type": "name" }, { "api_name": "pants.option.custom_types.target_option", ...
618317183
import sqlite3 import os import logging from configmodule import config from helper.singleton import Singleton class Database(object): __metaclass__ = Singleton def __init__(self): self.log = logging.getLogger('drw.' + self.__module__ + '.' + self.__class__.__name__) self.db_filename = c...
null
src/helper/Database.py
Database.py
py
2,084
python
en
code
null
code-starcoder2
76
[ { "api_name": "helper.singleton.Singleton", "line_number": 9, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "configmodule.config.get", "line_number": 14, "usage_type": "call" }, { "api_name": "c...
145059450
from django.shortcuts import render from django.http import HttpResponseRedirect from second.models import Post, Comment from .forms import PostForm, CommentForm def list(request): context = { 'items' : Post.objects.all() } return render(request, 'second/list.html', context) def create(request): if requ...
null
second/views.py
views.py
py
1,178
python
en
code
null
code-starcoder2
76
[ { "api_name": "second.models.Post.objects.all", "line_number": 9, "usage_type": "call" }, { "api_name": "second.models.Post.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "second.models.Post", "line_number": 9, "usage_type": "name" }, { "ap...
259153658
import logging import os import unittest from app import app as sviewer import app as ourapp from config import basedir from testcontent import factories dbpath = os.path.join(basedir, 'testcontent', 'db', 'test.db') # pragma: no cover if not os.path.exists(os.path.dirname(dbpath)): # pragma: no cover os.makedir...
null
testcontent/parse_test.py
parse_test.py
py
2,551
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "config.basedir", "line_number": 9, "usage_type": "argument" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_...
94579745
import torch import torch.nn as nn from gcmc import GCMCLayer from decoder import BilinearDecoder from utils import activation_map class GCMC(nn.Module): def __init__(self, n_layers, edge_types, user_feats_dim, item_feats_dim, hidde...
null
model.py
model.py
py
3,536
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.ModuleList", "line_number": 45, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
287882760
import requests from bs4 import BeautifulSoup from urllib.parse import urlparse import sys from getpass import getpass def login(id, pw): url = 'https://los.rubiya.kr/?login' data = {'id': id, 'pw': pw} res = requests.post(url, data=data) if res.status_code != 200: print('Please check server ...
null
main.py
main.py
py
6,348
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.post", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 32, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 33, "usage_type": "call" }, { "api_name": "requests.get", "line...
256795333
import os import zmq import yaml name = 'zmq_document_forwarder' filenames = [ os.path.join('/etc', name + '.yml'), os.path.join(os.path.expanduser('~'), '.config', name, 'connection.yml'), ] config = {} for filename in filenames: if os.path.isfile(filename): print('found config file at', fil...
null
examples/forwarder_device.py
forwarder_device.py
py
1,179
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, ...