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
20813720
# -*- coding: utf-8 -*- # Copyright 2010-2011 OpenStack Foundation # Copyright (c) 2015 Intel Corporation. # # 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/lice...
null
collectd_ceilometer/tests/meters/test_base.py
test_base.py
py
3,169
python
en
code
null
code-starcoder2
76
[ { "api_name": "collectd_ceilometer.tests.mocking.patch_class", "line_number": 41, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 44, "usage_type": "name" }, { "api_name": "collectd_ceilometer.common.meters.base.Meter", "line_number": 51, "usage_...
506163720
import numpy as np import operator import math import matplotlib.pyplot as plt import matplotlib.patches as patches import seaborn as sns; sns.set_theme() from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm plt.ion() # ----------------------------------------------- # JACK'S CAR RENTAL PARAMETERS NUM...
null
chap04-dynamic_programming/policy_iteration_jacks_car_rental.py
policy_iteration_jacks_car_rental.py
py
12,331
python
en
code
null
code-starcoder2
76
[ { "api_name": "seaborn.set_theme", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.ion", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.zeros"...
381457845
# coding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License...
null
tests/auto/test_auto_estimators.py
test_auto_estimators.py
py
3,490
python
en
code
null
code-starcoder2
76
[ { "api_name": "gluoncv.auto.tasks.ImageClassification.Dataset.from_folders", "line_number": 24, "usage_type": "call" }, { "api_name": "gluoncv.auto.tasks.ImageClassification.Dataset", "line_number": 24, "usage_type": "attribute" }, { "api_name": "gluoncv.auto.tasks.ImageClassific...
613127377
from PIL import Image maxiterations = 50 width, height = 300, 300 leftx, rightx, bottomy = 0.3, 0.31, 0.025 def divergenceTest(complex_number_tuple, MAX_ITERATIONS): ''' check if a point [a, b] is in the mandelbrot set return the number of iterations it took to go past an arbitrary number (say 4...
null
Mandelbrot.py
Mandelbrot.py
py
2,832
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.new", "line_number": 77, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 77, "usage_type": "name" } ]
342720858
import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn import tree from matplotlib import pyplot as plt plt.rcParams.update({'figure.figsize': (12.0, 8.0)}) plt.rcParams.update({'font.size': 14}) path = "https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data" headernames...
null
Random_Forest0.py
Random_Forest0.py
py
1,251
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "...
498156208
import pyvisa import time def get_serial(ser, t=1): time.sleep(t) nbytes = ser.inWaiting() if nbytes > 0: print(">> " + '\n>> '.join(ser.read(nbytes).rstrip().split('\n'))) # port = sys.argv[1] # print('Using port %s for Arduino' % port) # ser = serial.Serial(port) rm = pyvisa.ResourceManager()...
null
scope/power_read/trigger.py
trigger.py
py
1,276
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 6, "usage_type": "call" }, { "api_name": "pyvisa.ResourceManager", "line_number": 16, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 32, "usage_type": "call" }, { "api_name": "time.sleep", "line...
370718525
from ctypes import c_bool import json import logging import multiprocessing import os from queue import Empty from mdf_connect_server.config import CONVERTER_CONF from mdf_connect_server.processor import transform NUM_TRANSFORMERS = 5 GROUPING_RULES = CONVERTER_CONF["grouping_rules"] REPOSITORY_RULES = CONVERTER_CON...
null
mdf_connect_server/processor/converter.py
converter.py
py
6,031
python
en
code
null
code-starcoder2
76
[ { "api_name": "mdf_connect_server.config.CONVERTER_CONF", "line_number": 13, "usage_type": "name" }, { "api_name": "mdf_connect_server.config.CONVERTER_CONF", "line_number": 14, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "c...
521548882
import sys import pandas as pd import matplotlib.pyplot as plt from PyQt5 import uic,QtWidgets from PyQt5.QtGui import QStandardItemModel, QStandardItem from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QTableWidgetItem, QDialog, QHeaderView, QProgressDialog import os from CMlib.show_sampletable import showtabl...
null
start.py
start.py
py
15,749
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getcwd", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "PyQt5.uic.loadUiType", "line_...
509200733
import signal import jsonpickle import sys from pika.credentials import PlainCredentials import pika BROKER_ADDRESS = "localhost" BROKER_PORT = 5672 BROKER_V_HOST = 'gg_host' BROKER_USER = "gg_user" BROKER_PWD = "gg_password" MESSAGE_NAME = "LeaveRoomRequest" ROOM_NAME = "some" ROOM_USER = "some_user_2" PUBLISH_TOP...
null
Source/scripts/game_server/leave_room.py
leave_room.py
py
3,070
python
en
code
null
code-starcoder2
76
[ { "api_name": "pika.credentials.PlainCredentials", "line_number": 38, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 41, "usage_type": "call" }, { "api_name": "pika.BlockingConnection", "line_number": 47, "usage_type": "call" }, { ...
15921979
from multicorn import ForeignDataWrapper from .utils import log_to_postgres from itertools import cycle from datetime import datetime class TestForeignDataWrapper(ForeignDataWrapper): def __init__(self, options, columns): super(TestForeignDataWrapper, self).__init__(options, columns) self.columns...
null
python/multicorn/testfdw.py
testfdw.py
py
1,425
python
en
code
null
code-starcoder2
76
[ { "api_name": "multicorn.ForeignDataWrapper", "line_number": 7, "usage_type": "name" }, { "api_name": "utils.log_to_postgres", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.log_to_postgres", "line_number": 14, "usage_type": "call" }, { "api_name"...
342406842
import json import random import pandas import numpy as np from pathlib import Path from collections import abc from orderedset import OrderedSet from typing import List, Dict, Tuple, Set, Iterable, Union from .commonutils import logger from markkk.pyutils.check_text_encoding import ensure_no_zh_punctuation class QA...
null
package/easylabeltool/qa_class.py
qa_class.py
py
10,198
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Union", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.Iterable", "line_number": 33, "usage_type": "name" }, { "api_name": "markkk.pyutils.check_text_en...
269036020
# Hairdressing Application window class definition # windows.py # 4/05/18 import tkinter as tk import json from functools import partial from datetime import datetime class ApplicationWindow(tk.Frame): def __init__(self, master): super().__init__(master) # Start creating all the widgets # ...
null
windows.py
windows.py
py
11,182
python
en
code
null
code-starcoder2
76
[ { "api_name": "tkinter.Frame", "line_number": 10, "usage_type": "attribute" }, { "api_name": "tkinter.Menu", "line_number": 16, "usage_type": "call" }, { "api_name": "tkinter.Menu", "line_number": 17, "usage_type": "call" }, { "api_name": "tkinter.Menu", "line...
275654994
# coding: utf-8 from keras.layers.core import Dense from keras.layers.core import Masking from keras.layers.core import Activation from keras.layers.core import Dropout from keras.layers import Input from keras.layers import Lambda from keras.layers import Multiply from keras.layers import Maximum from keras.layers im...
null
examples/class_dialog.py
class_dialog.py
py
25,503
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.layers.recurrent.LSTM", "line_number": 73, "usage_type": "call" }, { "api_name": "keras.initializers.glorot_uniform", "line_number": 79, "usage_type": "call" }, { "api_name": "keras.initializers.orthogonal", "line_number": 80, "usage_type": "call" }...
436853370
import os import tensorflow as tf import argparse import numpy as np import cv2 import tensorflow.contrib.layers as layers from tensorflow.contrib.framework import arg_scope import models.resnet.resnet_utils as resnet_utils import train_helper import eval_helper import losses import datasets.reader as reader #import...
null
OLD/models/resnet/ladder.py
ladder.py
py
16,092
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.app", "line_number": 19, "usage_type": "attribute" }, { "api_name": "tensorflow.contrib.layers.variance_scaling_initializer", "line_number": 30, "usage_type": "call" }, { "api_name": "tensorflow.contrib.layers", "line_number": 30, "usage_type": "...
456384900
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import io import time import datetime import calendar import pytz import dateutil import base64 import xlsxwriter from xlsxwriter.workbook import Workbook from xlsxwriter.utility import xl_rowcol_to_cell from pytz impor...
null
hr_incidents/wizard/inhabilities_absenteeism_report.py
inhabilities_absenteeism_report.py
py
17,859
python
en
code
null
code-starcoder2
76
[ { "api_name": "odoo.models.TransientModel", "line_number": 30, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 30, "usage_type": "name" }, { "api_name": "odoo.fields.Many2one", "line_number": 34, "usage_type": "call" }, { "api_name": "odoo...
252560849
from matplotlib import pyplot as plt from traitlets.config.loader import Config import numpy as np from matplotlib.backends.backend_pdf import PdfPages from ctapipe.io import event_source from lstchain.calib.camera.r0 import LSTR0Corrections from ctapipe.coordinates import EngineeringCameraFrame from lstchain.calib....
null
lstchain/visualization/plot_drs4.py
plot_drs4.py
py
6,955
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.backends.backend_pdf.PdfPages", "line_number": 41, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 43, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 43, "usage_type": "name" }, { "a...
129370887
import cv2 import numpy as np img = cv2.imread('naruto.jpg',0) cv2.imwrite('naruto_in.jpg', img) print(img.shape) (row, col) = img.shape size = max(row, col) M = cv2.getRotationMatrix2D((col/2, row/2), 45, 1) dst = img.transpose() dst = cv2.flip(dst, 0) # dst = cv2.warpAffine(img, M, (col, row)) print(row, col) pri...
null
image.py
image.py
py
384
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.getRotationMatrix2D", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.flip", "line_num...
195561540
from itertools import starmap, product def quad_sum(*args): qsum = [i*i for i in args] return(sum(qsum)) def maximize(lists, m): max = 0 for i in starmap(quad_sum, list(product(*lists))): if i % m > max: max = i % m return max
null
w8/9.py
9.py
py
269
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.starmap", "line_number": 9, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 9, "usage_type": "call" } ]
338021540
import json import requests from pprint import pprint import zipfile import io # just see the raw response from the url url = '' r = requests.get(url, stream=True, timeout=10) # add timeout at a later check in # avoid partially reading request streams / make sure it is always closed! #with requests.get('http://ht...
null
second analysis to find dupes.py
second analysis to find dupes.py
py
2,642
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 19, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 32, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_num...
102401693
## Ignore duplicated library import os os.environ['KMP_DUPLICATE_LIB_OK']='True' import glob import pickle ## Measure execution time, becaus Kaggle cloud fluctuates import time start = time.time() ## Importing standard libraries import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot a...
null
model/signoff/model_preload_split.py
model_preload_split.py
py
7,225
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_numbe...
549541319
#!/bin/env python3 ''' ** Chaveat: not suitable for millions of files, it shows slow performance to get object list ChangeLogs - 2021.08.03: - support multiprocessing(spawn) - fixing windows path delimeter (\) - support compatibility of file name between MAC and Windows - 2021.08.02: - adding logger - fixin...
null
s3booster-upload-dir.py
s3booster-upload-dir.py
py
6,040
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.INFO", "line_number": 45, "usage_type": "attribute" }, { "api_name": "os.name", "line_number": 53, "usage_type": "attribute" }, { "api_name": "multiprocessing.set_start_method", "line_number": 54, "usage_type": "call" }, { "api_name": "boto3...
429411620
############################################################################## # # Copyright (c) 2004 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
null
book/trunk/exceptionview/ftests.py
ftests.py
py
1,288
python
en
code
null
code-starcoder2
76
[ { "api_name": "zope.app.tests.functional.BrowserTestCase", "line_number": 23, "usage_type": "name" }, { "api_name": "unittest.TestSuite", "line_number": 35, "usage_type": "call" }, { "api_name": "unittest.makeSuite", "line_number": 36, "usage_type": "call" }, { "a...
82788690
import os import numpy as np import pandas as pd import pendulum as pdl import swifter import torch from torch.utils.data import DataLoader from model import Model, dataset if __name__ == "__main__": if not os.path.exists("result"): os.mkdir("result") sensitive = 0 # control the detector sensitive ...
null
exam3/predict.py
predict.py
py
2,272
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 14, "usage_type": "call" }, { "api_name": "model.dataset", "line_number...
112924229
import torch.nn as nn import torch.nn.functional as F from allennlp.commands.elmo import ElmoEmbedder from utils.data_utils import get_batch, save_params from utils.train_utils import classification_report, f1_score, recall_score import torch import numpy as np import random from timeit import default_timer as timer fr...
null
models/LSTM.py
LSTM.py
py
9,756
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 30, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
393231741
import logging ## ## logging ## # https://docs.python.org/2/howto/logging.html # https://docs.python.org/2/library/logging.config.html # # Level | When it is used # ----- | --------------- # DEBUG | Detailed information, typically of interest only when diagnosing problems. # INFO | Confirmation that thing...
null
corr/__init__.py
__init__.py
py
891
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 20, "usage_type": "attribute" } ]
17545541
from datetime import date, timedelta, datetime import csv import json import os STATISTICS_DIR = '/var/www/html/bzt-usage-stats/' def counts_launches_per_day(filename): """Counts launches per day""" date = None cloud_users_env = ["jenkins", "travis", "bamboo", "teamcity", "docker", "amazon", "google_cloud...
null
site/bzt-usage-stats/aggregate_stat.py
aggregate_stat.py
py
5,615
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date", "line_number": 10, "usage_type": "name" }, { "api_name": "csv.reader", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 22, "usage_type": "name" }, { "api_name": "datetime.date", "line_numb...
630920123
import urllib.request as request import http.cookiejar as cookiejar import re import ssl import os import smtplib from email.mime.text import MIMEText import time user = 'xxxx' # 登陆邮箱 pwd = '' # 邮箱密码 to = [''] # 发送的邮箱 with open('D:\\Python源码\\city.txt', 'r') as f: a = f.re...
null
src/getticketfrom12306/getTicket.py
getTicket.py
py
6,970
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 16, "usage_type": "call" }, { "api_name": "http.cookiejar.LWPCookieJar", "line_number": 23, "usage_type": "call" }, { "api_name": "http.cookiejar", "line_number": 23, "usage_type": "name" }, { "api_name": "urllib.request....
635439925
#!/bin/env python """ This is template for ansible dynamic inventory script. """ import json import argparse host = "host_ip" def get_inventory_data(): return { "93k": { "hosts": ["93k"], "vars": { "ansible_python_interpreter": "/opt/tools/bin/python", ...
null
stage/vm_creation-n-ansible/inventory.py
inventory.py
py
867
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 36, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 38, "usage_type": "call" } ]
643294599
import nibabel as nib import numpy as np import glob import json import random import os import sys import difflib from scipy import stats from numpy import copy from keras.models import model_from_json from keras import backend as K from keras.callbacks import ModelCheckpoint, History from keras.optimizers import Ada...
null
ribbon.train_CNN_unet.n2soft.d00.py
ribbon.train_CNN_unet.n2soft.d00.py
py
16,305
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.glob", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.ceil", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.floor", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random.random_integers", "...
466507191
from django.db import migrations def rebuild_mptt(apps, schema_editor): TenantGroup = apps.get_model('tenancy', 'TenantGroup') for i, tenantgroup in enumerate(TenantGroup.objects.all(), start=1): TenantGroup.objects.filter(pk=tenantgroup.pk).update(tree_id=i) class Migration(migrations.Migration): ...
null
netbox/tenancy/migrations/0008_nested_tenantgroups_rebuild.py
0008_nested_tenantgroups_rebuild.py
py
545
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.migrations.RunPython", "line_number": 17, "usage_type": "call" }, ...
346105122
from adapter import ApiClient, ApiRestClient, SoapClient, WCFClient, WCFClientAdapter from bridge import Foco, HomeSwitch, Computador from decorator import Pudge, CinturonFuerza, CapaMago from composite import Empleado, JefeUnidad, Area from facade import crear_organigrama from flyweight import ImagenFactory def versi...
null
src/estructurales/main.py
main.py
py
1,011
python
en
code
null
code-starcoder2
76
[ { "api_name": "adapter.ApiClient", "line_number": 8, "usage_type": "name" }, { "api_name": "adapter.ApiRestClient", "line_number": 11, "usage_type": "call" }, { "api_name": "adapter.SoapClient", "line_number": 12, "usage_type": "call" }, { "api_name": "adapter.WCF...
96197866
import getopt, sys import logging, coloredlogs from create import log_config, check_name_email, print_help from db_functions import connect_to_db,disconnect_from_db from models import Account def get_options(args, account, email, help_msgs): # If user didn't supply options if len(args) == 0 : logging.warning("Us...
null
scripts/delete.py
delete.py
py
2,128
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.warning", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 14, "usage_type": "call" }, { "api_name": "getopt.getopt", "line_numbe...
623842891
import dataclasses from datetime import datetime from typing import List from unittest import mock from puff import influx from puff.tests import bootstrap class PuffTest(bootstrap.UnitTestCase): @mock.patch('influx.client.Client.write') def test_save(self, writer): service = influx.Puff() it...
null
puff/tests/test_influx.py
test_influx.py
py
1,539
python
en
code
null
code-starcoder2
76
[ { "api_name": "puff.tests.bootstrap.UnitTestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "puff.tests.bootstrap", "line_number": 10, "usage_type": "name" }, { "api_name": "puff.influx.Puff", "line_number": 13, "usage_type": "call" }, { "api_...
108429436
""" write_db.py 写数据库演示 """ import pymysql # 连接数据库 db = pymysql.connect(host='localhost',port=3306, user='root',password='123456', database='stu',charset='utf8') # 生成游标对象 (操作数据库,执行sql语句) cur = db.cursor() # 执行各种对数据库的写操作 try: # 执行增删改等语句 # 一、添加操作 # sql = "insert into cla...
null
write_db.py
write_db.py
py
1,441
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymysql.connect", "line_number": 7, "usage_type": "call" } ]
45863425
import os import sys import numpy as np import cv2 import imgdb import imgdata import nnmpl import pickle from scipy import stats OPIS = """recognizephone.py <mode> <database> <method> <images> mode: create - uczenie na podstawie folderu podanego jako parametr images check - sprawdzenie wybranego zdjęcia podan...
null
statrecognize.py
statrecognize.py
py
4,236
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 25, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 30, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 32...
553929680
import logging from flask import request from flask_restplus import Resource from app.api.bigquery.business_interactions import get_request_status, run_query, ndex from app.api.bigquery.serializers import query_request, query_status_response, query_response, ndex_request, ndex_response from app.api.bigquery.parsers i...
null
app/api/bigquery/endpoints/interactions.py
interactions.py
py
2,923
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "app.api.restplus.api.namespace", "line_number": 16, "usage_type": "call" }, { "api_name": "app.api.restplus.api", "line_number": 16, "usage_type": "name" }, { "api_name": ...
90378294
import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn import preprocessing import os def csv_to_dataframe(filepath): if os.path.exists(filepath): df = pd.read_csv(filepath) else: raise IOError('Please provide valid file path') return df def merge_dataframe(d...
null
build.py
build.py
py
3,551
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.nanmedian", "line...
159962916
# Copyright 2020 Xilinx 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 or agreed to in writing, ...
null
docs-jp/Machine_Learning/Introduction/03-Basic/Module_5/reference_scripts/code/gen_data/create_data.py
create_data.py
py
4,974
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 78, "usage_type": "call" }, { "api_name": "os.path", "line_number": 78, "usage_type": "attribute" }, { "api_name": "os.path.exists", ...
103525539
import unittest import theano import pymc3 as pm import numpy as np import lasagne.updates as updates import lasagne.nonlinearities as to from gelato.layers import DenseLayer, InputLayer from gelato.variational.elbo import sample_elbo from gelato.layers.helper import get_output from .datasets import generate_data from ...
null
gelato/tests/test_magic.py
test_magic.py
py
1,561
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "datasets.generate_data", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.matr...
36343613
# This file will be using the TensorFlow model in the following directory # /home/seniordesign/TensorFlow/CompletedModels/lugnut import turtle import time import numpy as np import os import six.moves.urllib as urllib import sys import tarfile import tensorflow as tf import zipfile import cv2 from collections imp...
null
lugnutDetection.py
lugnutDetection.py
py
5,267
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.Graph", "line_number": 42, "usage_type": "call" }, { "api_name": "tensorflow.compat.v1.GraphDef", "line_number": 44, "usage_type": "call" }, { "api_name": "tensorflow.compat", "line_number": 44, "usage_type": "attribute" }, { "api_name": ...
170337194
from django.shortcuts import render from .models import Bicicleta from django.http import HttpResponseRedirect from django.contrib.auth.decorators import login_required # Create your views here. def index(request): return render(request, 'cadastro/index.html', {}) def editar(request, id): item = Bicicleta.ob...
null
cadastro/views.py
views.py
py
1,401
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Bicicleta.objects.get", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Bicicleta.objects", "line_number": 12, "usage_type": "attribute" }, { ...
180364333
import tensorflow as tf import numpy as np from gym import spaces from typing import Tuple, Union from pathlib import Path from tqdm import tqdm from stable_baselines.common.input import observation_input from stable_baselines.common import tf_util from stable_baselines.common.cmd_util import make_atari_env from stabl...
null
stable_baselines/reconstruction/worldmodel_vae.py
worldmodel_vae.py
py
6,348
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.distributions", "line_number": 14, "usage_type": "attribute" }, { "api_name": "typing.Union", "line_number": 15, "usage_type": "name" }, { "api_name": "gym.spaces.Discrete", "line_number": 15, "usage_type": "attribute" }, { "api_name": "g...
325080532
import chalicelib.utils.helper from chalicelib.core import events, significance, sessions from chalicelib.utils.TimeUTC import TimeUTC from chalicelib.utils import helper, pg_client from chalicelib.utils import dev import json REMOVE_KEYS = ["key", "_key", "startDate", "endDate"] ALLOW_UPDATE_FOR = ["name", "filter"...
null
api/chalicelib/core/funnels.py
funnels.py
py
12,368
python
en
code
null
code-starcoder2
76
[ { "api_name": "chalicelib.core.events.event_type", "line_number": 15, "usage_type": "attribute" }, { "api_name": "chalicelib.core.events", "line_number": 15, "usage_type": "name" }, { "api_name": "chalicelib.core.events.event_type", "line_number": 16, "usage_type": "attri...
329920429
from django.test import TestCase from django.core.exceptions import ValidationError from tests import factories from campaigns.models import Message class MessageTestCase(TestCase): def test_clean_raises_validation_error_on_incorrect_owner(self): user1 = factories.AccountFactory() user2 = factor...
null
api/tests/campaigns/test_models.py
test_models.py
py
895
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "tests.factories.AccountFactory", "line_number": 11, "usage_type": "call" }, { "api_name": "tests.factories", "line_number": 11, "usage_type": "name" }, { "api_name": "te...
13697857
######################################################################################################################## __doc__ = \ """ These are extra functionality for Igor """ __author__ = "Matteo Ferla. [Github](https://github.com/matteoferla)" __email__ = "matteo.ferla@gmail.com" __date__ = "2020 A.D." _...
null
fragmenstein/igor/_igor_utils_mixin.py
_igor_utils_mixin.py
py
3,301
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyrosetta.rosetta.protocols.docking.setup_foldtree", "line_number": 33, "usage_type": "call" }, { "api_name": "pyrosetta.rosetta", "line_number": 33, "usage_type": "attribute" }, { "api_name": "pyrosetta.Vector1", "line_number": 33, "usage_type": "call" }...
258348605
import filecmp import os import re import shutil from pathlib import Path from unittest.mock import patch import pytest from dvc.dvcfile import DVC_FILE, Dvcfile from dvc.exceptions import ( CyclicGraphError, ReproductionError, StagePathAsOutputError, ) from dvc.fs.local import LocalFileSystem from dvc.ma...
null
tests/func/test_repro.py
test_repro.py
py
37,799
python
en
code
null
code-starcoder2
76
[ { "api_name": "tests.basic_env.TestDvc", "line_number": 39, "usage_type": "name" }, { "api_name": "os.unlink", "line_number": 61, "usage_type": "call" }, { "api_name": "dvc.main.main", "line_number": 63, "usage_type": "call" }, { "api_name": "tests.basic_env.TestD...
12414269
from collections import Iterable import numpy as np from a405thermo.constants import constants as c class constants: """ A list of constants relevant to atmospheric science. References - - - - - - Emanuel appendix 2 """ Tc = 273.15 #0 deg C in Kelvin eps = 0.622 p0 = 1.e5 eps = 0.62...
null
a405thermo/thermlib.py
thermlib.py
py
4,984
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Iterable", "line_number": 61, "usage_type": "argument" }, { "api_name": "numpy.atleast_1d", "line_number": 63, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 65, "usage_type": "call" }, { "api_name": "a405thermo.consta...
52320284
from django.shortcuts import render from django.http import HttpResponse from django.core.files.storage import FileSystemStorage from .models import * from .forms import * # Create your views here. def home(request): return render(request, 'home.html') def patient(request): saved = False if request.metho...
null
bbms/pp/views.py
views.py
py
947
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 10, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 23, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 26, "usage_type": "call" }, { "api_name"...
528788319
import numpy as np import matplotlib.pyplot as plt from random import choice import math b = np.random.rand(3) # weights or betas alpha = 0.1 #learning rate n = 100 # training iterations def plot_data(set1, set2): plt.xlabel('sepal length') plt.ylabel('sepal width') x, y = set1.T group_1 = plt.scatte...
null
logistic-regression/logistic-regresion.py
logistic-regresion.py
py
3,061
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.rand", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib...
194999431
""" @file openxc-python\tests\test_vehicle.py OpenXC Test Vehicle Script @author Christopher Peplin github@rhubarbtech.com @date June 25, 2013 @version 0.9.4 @brief OpenXC Test Vehicle Script.""" from nose.tools import eq_, ok_ import unittest import time from openxc.sources import DataSource from openxc.m...
null
tests/test_vehicle.py
test_vehicle.py
py
3,312
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 19, "usage_type": "attribute" }, { "api_name": "openxc.vehicle.Vehicle", "line_number": 33, "usage_type": "call" }, { "api_name": "nose.tools.ok_", "line_number": 43, "usage_type": "call" }, { "api_name": "nose.too...
354458215
""" functions for DEM input and output preparation for use with HAIL-CAESAR John J Armitage """ from osgeo import gdal import numpy as np import rasterio as rio from scipy.interpolate import RegularGridInterpolator def tif2asc(tiffile, ascfile): """ Function to convert a geotiff (.tif) file into an ascii fil...
null
caesarpy/.ipynb_checkpoints/demio-checkpoint.py
demio-checkpoint.py
py
4,780
python
en
code
null
code-starcoder2
76
[ { "api_name": "rasterio.open", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number"...
147695458
""" /*************************************************************************** RuGeocoder A QGIS plugin Geocode your csv files to shp ------------------- begin : 2012-02-20 copyright : (C) 2012 by Nikulin Evgeniy...
null
src/yandex_geocoder.py
yandex_geocoder.py
py
2,422
python
en
code
null
code-starcoder2
76
[ { "api_name": "base_geocoder.BaseGeocoder", "line_number": 30, "usage_type": "name" }, { "api_name": "urllib.quote", "line_number": 35, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "line_number": 39, "usage_type": "call" }, { "api_name": "json.loads", ...
73641788
import S4 from lib.grating import Grating import numpy as np import scipy.interpolate as interp import lib.helpers as h class ZCG(Grating): SPEED_OF_LIGHT = 299792458*10**6 #in um/s si_n = interp.interp1d(*zip(*[[((299792458*10**6)/float(f)),n] for f,n in h.opencsv('../matdat/silicon_n.csv',1)])) si_k = ...
null
canon/old/gratings/zcg.py
zcg.py
py
2,210
python
en
code
null
code-starcoder2
76
[ { "api_name": "lib.grating.Grating", "line_number": 9, "usage_type": "name" }, { "api_name": "scipy.interpolate.interp1d", "line_number": 11, "usage_type": "call" }, { "api_name": "scipy.interpolate", "line_number": 11, "usage_type": "name" }, { "api_name": "lib.h...
418435056
import sys import argparse import os import yaml import json from psycopg2 import connect from psycopg2.extras import RealDictCursor from elasticsearch import Elasticsearch, helpers from datafile import count_from_db, data_from_db, data_to_es def init_es_index(index_name): with open("{}.json".format(index_name...
null
index.py
index.py
py
2,010
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path", "line_...
180019236
#!/usr/bin/env python ''' Program will simulate transactions between random agents. Assumptions: N agents exchange money in pairs All agents start with same amount of money m0 > 0 at given timestep, random agents exchange random (uniform) amount of money ''' ''' Changelog: V1.1 Added num_experiments to run multiple ...
null
PHY480tmp/mod/a1g5/Project4_finance2.1.py
Project4_finance2.1.py
py
4,313
python
en
code
null
code-starcoder2
76
[ { "api_name": "IPython.get_ipython", "line_number": 23, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 33, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 33, "usage_type": "attribute" }, { "api_name": "sys.path.append", ...
443300202
# -*- coding: utf-8 -*- # @Time : 2020/1/7 18:36 # @Author : zhuxuefei from common.get_db_data import init_arangodb def get_group(groupName): """ 查询cmdb数据库根据传入的配置项类型group获取对应记录 :param groupName: :return: """ # 初始化Arangodb数据库对象 conn = init_arangodb("cmdb_db") arangodb = conn.opendb(...
null
test_case/cmdb/test_group.py
test_group.py
py
553
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.get_db_data.init_arangodb", "line_number": 14, "usage_type": "call" } ]
281346013
#!/usr/bin/python3.5 import requests import json import time import datetime import smtplib import logging from logging.handlers import RotatingFileHandler f=open("/home/pi/credentials.conf","r") lines=f.readlines() tuple=lines[0].split() user=tuple[0] passwd=tuple[1] to_address=tuple[2] user_id=tuple[3] f.close() ip...
null
python/moon.py
moon.py
py
3,525
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 24, "usage_type": "attribute" }, { "api_name": "logging.handlers.RotatingFileHandler", "line_number": 25, "usage_type": "call" }, { "api_name...
372292185
import json import delorean from datetime import datetime from django.contrib import messages from django.http import JsonResponse from django.shortcuts import redirect, render from django.urls import reverse from ...decorators import admin_required, login_required from ..scores.models import ScoreBoard from .forms ...
null
hocoapp/apps/events/views.py
views.py
py
1,544
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.datetime.timestamp", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime.datetime", "line_number": 18, "usage_type": "attribute" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "name" }, {...
627776627
# -*- coding: utf-8 -*- # # Update the settings as needed # from tools.common import is_testenv config = {} # Configure session information here config['webapp2_extras.sessions'] = { # Put your secret key in here this should be unique to each application 'secret_key': 'put your secret key in here this should ...
null
scouts/app/settings.py
settings.py
py
1,168
python
en
code
null
code-starcoder2
76
[ { "api_name": "tools.common.is_testenv", "line_number": 30, "usage_type": "call" } ]
298479620
from random import choice, randint from bs4 import BeautifulSoup import requests from collections import namedtuple import datetime from time import sleep, strftime,gmtime import sqlite3 base_url = 'https://www.google' country = '.co.uk' query = '/search?&ie=UTF-8&q=' campaign = 'FX BROKERS' keywords =...
null
monitoring.py
monitoring.py
py
5,154
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.strftime", "line_number": 24, "usage_type": "call" }, { "api_name": "time.gmtime", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.date", "li...
349815631
from unittest import TestCase from allennlp.data.tokenizers import PretrainedTransformerTokenizer from allennlp.data.token_indexers import PretrainedTransformerIndexer from allennlp.data.vocabulary import Vocabulary from acceptability.data.dataset_readers import SuffixReader class TestSuffixReader(TestCase): de...
null
acceptability/tests/data/dataset_readers/test_suffix_reader.py
test_suffix_reader.py
py
3,694
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "allennlp.data.vocabulary.Vocabulary", "line_number": 12, "usage_type": "call" }, { "api_name": "acceptability.data.dataset_readers.SuffixReader", "line_number": 24, "usage_type": ...
92026858
from transformers import * import torch import argparse import math import numpy as np import time import random class HalfPrecisionLayer(torch.nn.Module): def __init__(self, name, layer): super(HalfPrecisionLayer, self).__init__() self._name = name + '_fp16' self._modules[self._name] = la...
null
src/bert_test_pytorch.py
bert_test_pytorch.py
py
12,768
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.Tensor", "line_number": 26, "usage_type": "attribute" }, { "api_name": "torch.float32", "line_number": 26, "usage_type": "attribute" }, { "api_name": "torch.float16", ...
512075352
import telnetlib import time from scpi import SCPI class InterfaceOutOfBoundsError(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) class Keithley2700(SCPI): """ http://www.keithley.com/data?asset=10642 """ def __init__(self...
null
PyExpLabSys/drivers/keithley_2700.py
keithley_2700.py
py
4,489
python
en
code
null
code-starcoder2
76
[ { "api_name": "scpi.SCPI", "line_number": 13, "usage_type": "name" }, { "api_name": "scpi.SCPI.__init__", "line_number": 19, "usage_type": "call" }, { "api_name": "scpi.SCPI", "line_number": 19, "usage_type": "name" }, { "api_name": "scpi.SCPI.__init__", "line...
465725905
import streamlit as st import cv2 from PIL import Image import time from io import BytesIO import numpy as np class smoothingFilters(): def __init__(self,image,K = 3, P= None): self.k = K self.image = image self.P = P self.outputimage = None def trimmedMean(self,array): ...
null
Filter_GUI.py
Filter_GUI.py
py
8,603
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.mean", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.multiply", "line_number": 72, "usage_type": "call" }, { "api_name": "numpy.insert", "line_number...
358647705
import pytest import tasks from tasks import Task def test_count(): count=tasks.count() assert isinstance(count,int) def test_count_num(): new_task = Task('do something') task_id = tasks.add(new_task) count=tasks.count() tasks.delete(task_id) assert count==2 def test_count_delete(): c...
null
code/ch2/tasks_proj/tests/func/test_count.py
test_count.py
py
650
python
en
code
null
code-starcoder2
76
[ { "api_name": "tasks.count", "line_number": 6, "usage_type": "call" }, { "api_name": "tasks.Task", "line_number": 10, "usage_type": "call" }, { "api_name": "tasks.add", "line_number": 11, "usage_type": "call" }, { "api_name": "tasks.count", "line_number": 12, ...
279044769
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import pyttsx3 import speech_recognition as sr import webbrowser import datetime import wikipedia import pyaudio import os from googlesearch import search import subprocess import shutil # from capstone import takeCo...
null
capstone2_main.py
capstone2_main.py
py
10,563
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.isdir", "line_number": 92, "usage_type": "call" }, { "api_name": "os.path", "line_number": 92, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 97, "usage_type": "call" }, { "api_name": "os.path", "line_number...
461271852
# _*_ coding:utf-8 _*_ # company: RuiDa Futures # author: zizle from PyQt5.QtWidgets import QWidget, QTabWidget, QHBoxLayout from PyQt5.QtWebEngineWidgets import QWebEngineView from PyQt5.QtCore import QUrl class WebEngineView(QWebEngineView): def __init__(self,mainwindow,parent=None): super(WebEngineView...
null
frontEnd/windows/diy_brower.py
diy_brower.py
py
1,958
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWebEngineWidgets.QWebEngineView", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 21, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QHBoxLayout", "line_number": 27, "usage_type": "call" },...
81032207
#!/usr/local/lib/python3.5/dist-packages import sys import json repo_dir = "/home/sexy/source/deep-visual-odometry/" sys.path.append(repo_dir+'python/snippets/') sys.path.append(repo_dir+'models/') import formatData from alexNet_5 import run_model, create_model netNum = '5' path = repo_dir + "models/alexNet_"+netNum+"...
null
models/hand_crafted/alexnet_inspired/alexNet_5/separated_datasets.py
separated_datasets.py
py
808
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
178282315
import numpy as np import matplotlib.pyplot as plt from sys import exit from scipy.integrate import simps from norm import norm_array from small_friction import rho as rho_limit q = 0.05 rho = np.loadtxt("data/r.dat", delimiter=';') R = np.loadtxt("data/x.dat") r = np.loadtxt("data/y.dat") dR = R[1] - R[0] dr = r[1]...
null
RT/plot.py
plot.py
py
2,445
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.loadtxt", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.imshow", ...
492140736
import pygame from .actor import Actor from lib.vectors import Vector2 from lib.components.image_components import SpriteComponent from lib.components.colliders import CircleCollider class Fire(Actor): def __init__(self, game): super().__init__(game) self.tag = 'player_fire' self.dir = 0 ...
null
src/lib/actors/fire.py
fire.py
py
1,128
python
en
code
null
code-starcoder2
76
[ { "api_name": "actor.Actor", "line_number": 8, "usage_type": "name" }, { "api_name": "lib.vectors.Vector2", "line_number": 13, "usage_type": "call" }, { "api_name": "lib.components.image_components.SpriteComponent", "line_number": 15, "usage_type": "call" }, { "ap...
387970175
#!/usr/bin/env python # -*- coding: utf-8 -*- import sqlite3 # Cria a conexão e o cursor conn = sqlite3.connect('dados/loteria.db') # define o cursor cur = conn.cursor() # deleta a tabela se ela existir cur.execute('''DROP TABLE IF EXISTS loto''') # cria a tabela cur.execute('CREATE TABLE loto' '(id INTE...
null
oldVersion/createdb.py
createdb.py
py
717
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 6, "usage_type": "call" } ]
456909666
#!/usr/local/bin/python3 """Train the model""" import argparse import logging import os,sys import pdb import tensorflow as tf from tensorflow.python import debug as tf_debug from tqdm import tqdm from src.graph import ModelGraph from src.utils import Params if __name__ == '__main__': parser = argparse.Argumen...
null
train.py
train.py
py
3,329
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "src.utils.Params", "line_number": 24, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 26, "usage_type": "attribute" }, { "api_name": "tensorflow.t...
576165849
######### # IMPORTS ######### from brian2 import * import matplotlib as mpl import matplotlib.pyplot as plt ########### # FUNCTIONS ########### ###### # MAIN ###### start_scope() tau = 10*ms eqs = ''' dv/dt = (1-v)/tau : 1 (unless refractory) ''' G = NeuronGroup(1, eqs, threshold='v>0.8', reset='v = 0', refracto...
null
SNNtest.py
SNNtest.py
py
630
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.rcParams", "line_number": 33, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 34, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 34, "usage_type": "name" }, { "api_name": "m...
159709931
import time import json # return current time in a string format def get_current_time(): minutes = str(time.localtime(time.time()).tm_min) seconds = str(time.localtime(time.time()).tm_sec) hours = str(time.localtime(time.time()).tm_hour) return hours+":"+minutes+":"+seconds+"\n" with open('log.txt','a') as l...
null
Files/main.py
main.py
py
1,347
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.localtime", "line_number": 6, "usage_type": "call" }, { "api_name": "time.time", "line_number": 6, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 7, "usage_type": "call" }, { "api_name": "time.time", "line_number": 7...
42630647
import json from django.http import HttpResponse from django.http import JsonResponse from . import authenticator def Login(request): req_json = json.loads(request.body) auth_token = req_json.get('token', '') auth_env = authenticator.GetAuthEnvironment(auth_token) response = JsonResponse(auth_env) if auth...
null
authentication/apis.py
apis.py
py
547
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "django.http.JsonResponse", "line_number": 13, "usage_type": "call" }, { "api_name": "django.http.JsonResponse", "line_number": 20, "usage_type": "call" } ]
197271872
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 ...
null
plugins/worker/server/__init__.py
__init__.py
py
4,068
python
en
code
null
code-starcoder2
76
[ { "api_name": "girder.utility.model_importer.ModelImporter.model", "line_number": 64, "usage_type": "call" }, { "api_name": "girder.utility.model_importer.ModelImporter", "line_number": 64, "usage_type": "name" }, { "api_name": "celery.Celery", "line_number": 67, "usage_t...
204001496
import struct from pprint import pformat from queue import Queue from socket import AF_INET from socket import SOCK_STREAM from socket import socket from time import sleep from time import time from traceback import print_exc as printExc from typing import Dict from typing import Tuple from .message import MessageToSe...
null
containers/actor/sources/utils/connection/messageSender.py
messageSender.py
py
4,534
python
en
code
null
code-starcoder2
76
[ { "api_name": "types.Component", "line_number": 27, "usage_type": "name" }, { "api_name": "debugLogPrinter.DebugLogPrinter", "line_number": 27, "usage_type": "name" }, { "api_name": "types.ComponentRole", "line_number": 31, "usage_type": "name" }, { "api_name": "t...
152265614
import tensorflow as tf from tensorflow.keras.optimizers import Adam from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense from tensorflow.keras.layers import Reshape from tensorflow.keras.layers import Flatten from tensorflow.keras.layers import Conv2D from tensorflow.keras.layers im...
null
src/old/Experiment09/src/GAN.py
GAN.py
py
4,679
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.keras.models.Sequential", "line_number": 17, "usage_type": "call" }, { "api_name": "tensorflow.keras.layers.Dense", "line_number": 20, "usage_type": "call" }, { "api_name": "tensorflow.keras.layers.LeakyReLU", "line_number": 21, "usage_type": "ca...
323881068
import torch import numpy as np import math def trans_l2_loss(pred_control_points, gt_control_points, confidence=None, confidence_weight=None, device="cpu"): error = torch.sum(torch.abs((pred_control_points[0:2...
null
models/losses.py
losses.py
py
6,303
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.sum", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.abs", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.mean", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.mean", "line_number": 13, ...
148243024
# Andrew Piroli (c)2019-2020 # MIT LICENSE # import datetime as dtime import shutil import multiprocessing as mp import argparse import csv import os import logging import pathlib import threading import cylogging from queue import Empty as QEmptyException from time import sleep from typing import Itera...
null
CiscoYoink.py
CiscoYoink.py
py
11,914
python
en
code
null
code-starcoder2
76
[ { "api_name": "multiprocessing.managers.BaseProxy", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 21, "usage_type": "name" }, { "api_name": "cylogging.cylogger", "line_number": 22, "usage_type": "call" }, { "api_name": ...
189738460
# Copyright (c) 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Collect stats regularly via app engine cron. """ import calendar import datetime import json import logging import numpy import webapp2 from google...
null
appengine/trooper_o_matic/appengine_module/trooper_o_matic/cron.py
cron.py
py
13,260
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.utcnow", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 25, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 32, "usage_type": "call" }, { "api_na...
184182398
import pandas as pd import numpy as np from data import UserItemRatingDataset, SampleGenerator from engine import Engine from transformers import BertConfig from seq2seq_reviews import Seq2Seq, Seq2SeqEmbeddingGenerator from BERT_embedding import BertEmbeddingGenerator def generate_tensors(embedding_generator, review...
null
embedding_testing.py
embedding_testing.py
py
2,114
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_json", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.isna", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.isna", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.isna", "line_numb...
266335279
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/5/18 9:53 AM # @Author : R # @File : TMDB_predict_2.py # @Software: PyCharm # @Software: PyCharm # coding: utf-8 # # Kaggle for TMDB # In[1]: import numpy as np import pandas as pd import warnings from tqdm import tqdm from sklearn.preprocessing...
null
TMDB/TMDB_predict_2.py
TMDB_predict_2.py
py
30,712
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 71, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 79, "usage_type": "attribute" }, { "api_name": "pandas.to_datetime"...
230844945
from saport.knapsack.model import Problem from saport.knapsack.solverfactory import SolverType, SolverFactory from typing import List,Callable import os # manipulate following parameters to customize the benchmarks class KnapsackBenchmark: def __init__(self, problems: List[str], timelimit: int = 60, solver_types...
null
lab06_knapsack-alt/lab06_knapsack-alt/knapsack_benchmark.py
knapsack_benchmark.py
py
3,455
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "saport.knapsack.solverfactory.SolverType", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 10, "usage_type": "name" }, { "api_name": "...
427471858
import requests as req import pandas as pd import count_aas as aas import Bio.SeqIO as SeqIO import os import sys import hydropathy as hp import numpy as np def create_fill_dict(text): """ Create and fill dict from input filepath. """ # add fasta sequences to dict for fasta in fasta_seque...
null
exercises/proteinclass.py
proteinclass.py
py
4,515
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 57, "usage_type": "call" }, { "api_name": "Bio.SeqIO.parse", "line_number": 62, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_number": 62, "usage_type": "name" }, { "api_name": "os.path.join", "line_numbe...
396619675
"""Heroku Log Lights is a visualisation of Heroku router logs for an LED matrix.""" import argparse import asyncio import functools import logging import os import signal import sys try: from rgbmatrix import RGBMatrix except ImportError: RGBMatrix = None from heroku_loglights.io import read_stream, print_log...
null
heroku_loglights/__main__.py
__main__.py
py
2,289
python
en
code
null
code-starcoder2
76
[ { "api_name": "rgbmatrix.RGBMatrix", "line_number": 13, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "logging...
472264237
import requests import logging class Base: def __init__(self): self.logger = logging.getLogger(__name__) @staticmethod def get(**kwargs): url = kwargs.get('url', None) headers = kwargs.get('headers', None) params = kwargs.get('params', None) return requests.get(url...
null
src/external/base.py
base.py
py
871
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.delete", "li...
552657547
from django.contrib import admin from django.contrib.auth import get_user_model from django.contrib.auth.admin import UserAdmin from .models import Category, Comment, Genre, Review, Title User = get_user_model() class YamDBUserAdmin(UserAdmin): model = User add_fieldsets = ( (None, { 'cl...
null
api/admin.py
admin.py
py
1,894
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 7, "usage_type": "call" }, { "api_name": "django.contrib.auth.admin.UserAdmin", "line_number": 10, "usage_type": "name" }, { "api_name": "django.contrib.auth.admin.UserAdmin.fieldsets", "line_number": 21, ...
107033748
from django import forms from .utils import to_satoshi from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ class WithdrawForm(forms.Form): address = forms.CharField(required=True, max_length=40) amount = forms.DecimalField(required=True) def __init_...
null
wallets/forms.py
forms.py
py
1,545
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.Form", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 9, "usage_type": "call" }, { "api_name": "django.forms"...
254225440
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt num_points = 1000 vectors_set = [] for i in range(num_points): x1 = np.random.normal(0.0, 0.55) y1 = x1 * 0.1 + 0.3 + np.random.normal(0.0, 0.03) vectors_set.append([x1, y1]) x_data = [v[0] for v in vectors_...
null
deep_study/linear_fitting.py
linear_fitting.py
py
1,513
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.normal", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.random.normal", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.rando...
358651974
#!/usr/bin/env python3 import argparse import yaml import json from pathlib import Path def main(): parser = argparse.ArgumentParser(description="Creates config_biobb.json and config_biobb.yml files.", formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=999...
null
configs_generator.py
configs_generator.py
py
1,651
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "argparse.RawTextHelpFormatter", "line_number": 11, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 19, "usage_type": "call" }, { "api_name": "...
256529426
import json from argparse import ArgumentTypeError from django.core.management.base import BaseCommand from ...models import UploadEvent def update_upload(upload): d = json.loads(upload.metadata) if "match_start_timestamp" in d: d["match_start"] = d.pop("match_start_timestamp") if "client_id" in d: d["client_h...
null
hsreplaynet/uploads/management/commands/rename_upload_keys.py
rename_upload_keys.py
py
1,522
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 8, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" }, { "api_name": "argparse.ArgumentTypeError", "line_number": 26, "usage_type": "call" }, { "api_name": "django.core.managemen...
144913564
# Learning how to code Python. # This project is going to be used to analyze sentiments of various cloud streaming platforms. # Inspired by the latest Stadia drama. Stadia is good! # Project Site # https://www.geeksforgeeks.org/twitter-sentiment-analysis-using-python/ import re import tweepy from tweepy import OAuth...
null
python-cloud-gaming-sentiment-analysis.py
python-cloud-gaming-sentiment-analysis.py
py
4,750
python
en
code
null
code-starcoder2
76
[ { "api_name": "tweepy.OAuthHandler", "line_number": 30, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 34, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 43, "usage_type": "call" }, { "api_name": "textblob.TextBlob", "line_n...
570745941
# -*- coding: utf-8 -*- ''' 分词,提词的主程序 先词形还原,再词频统计 去掉简单的单词后,生成单词本 ''' import requests,re,threading,traceback,os,sys,time from bs4 import BeautifulSoup from tqdm import tqdm from nltk.stem import WordNetLemmatizer from nltk.corpus import wordnet from nltk import pos_tag lemmatizer = WordNetLemmatizer() Max_lookup_connect...
null
vocabulary/vocabulary.py
vocabulary.py
py
11,280
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.stem.WordNetLemmatizer", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.makedirs", ...
35232681
# !/usr/bin/env python # -- coding: utf-8 -- # @Time : 2020/11/5 10:46 # @Author : liumin # @File : fcos_detect.py import torch import torch.nn as nn from ..backbones.resnet import ResNet from ..heads.fcos_head import ClsCntRegHead from ..necks.fpn import FPN def coords_fmap2orig(feature, stride): ...
null
src/models/tools/fcos_detect.py
fcos_detect.py
py
15,827
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.arange", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.float32", "line_number": 25, "usage_type": "attribute" }, { "api_name": "torch.arange", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.float32", "lin...
309622593
""" Welborn Productions - Template Nodes Provides renderable nodes for templates. -Christopher Welborn 09-03-14 """ import base64 import json import logging import os import sys from django import template from django.utils.safestring import mark_safe from wp_main.utilities import utilities, htmltools, highlig...
null
wp_main/templatetags/wp_nodes.py
wp_nodes.py
py
10,058
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "django.template.Library", "line_number": 18, "usage_type": "call" }, { "api_name": "django.template", "line_number": 18, "usage_type": "name" }, { "api_name": "base64.enco...
125391056
''' Created on Oct 22, 2018 @author: fxua ''' from apps.app import App from apps.generic_app.gaconf import GaConfig from apps.generic_app.gafextor import GaFextor from apps.generic_app.engine_creator import createEngine,loadEngine from modules.basics.conf.generalconf import gGeneralConfig from modules.mlengine_cores.c...
null
py_ml/apps/generic_app/generic_app.py
generic_app.py
py
4,877
python
en
code
null
code-starcoder2
76
[ { "api_name": "apps.app.App", "line_number": 22, "usage_type": "name" }, { "api_name": "apps.generic_app.gaconf.GaConfig", "line_number": 28, "usage_type": "call" }, { "api_name": "apps.generic_app.gafextor.GaFextor", "line_number": 29, "usage_type": "call" }, { "...
263942205
from logging import LogRecord from django.test import TestCase from oscar.test.decorators import dataProvider from oscar.core.logging.formatters import PciFormatter class PciFormatterTests(TestCase): def setUp(self): self.formatter = PciFormatter() def test_a_basic_string_is_unchanged(self): ...
null
oscar/core/logging/tests.py
tests.py
py
1,530
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "oscar.core.logging.formatters.PciFormatter", "line_number": 12, "usage_type": "call" }, { "api_name": "oscar.test.decorators.dataProvider", "line_number": 25, "usage_type": "cal...
351696997
import pygame from pygame.locals import * # from sys import exit from data.backgrounds import Backgound as Back # Class for controling all the menu on the game class Settings(object): def __init__(self, screen, soundSate, musicState): self.screen = screen self.background = Back(screen) sel...
null
data/menus/settings/__init__.py
__init__.py
py
4,977
python
en
code
null
code-starcoder2
76
[ { "api_name": "data.backgrounds.Backgound", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.image.load", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame...
499444993
import pymel.core as pm import maya.mel as mel from tik_autorigger import extraProcedures as extra from tik_autorigger import contIcons as icon import Qt from Qt import QtWidgets, QtCore, QtGui from maya import OpenMayaUI as omui if Qt.__binding__ == "PySide": from shiboken import wrapInstance from Qt.QtCore ...
null
ikBuilder.py
ikBuilder.py
py
10,192
python
en
code
null
code-starcoder2
76
[ { "api_name": "Qt.__binding__", "line_number": 10, "usage_type": "attribute" }, { "api_name": "Qt.__binding__.startswith", "line_number": 13, "usage_type": "call" }, { "api_name": "Qt.__binding__", "line_number": 13, "usage_type": "attribute" }, { "api_name": "may...