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
534321194
# importing pyhton packages import os import sys import math import pysam import collections import numpy as np from scipy import stats import matplotlib.pyplot as plt from collections import defaultdict # global variables readthrough_abs_reads = 30 # no of reads in isr combining all lengths min_reads_in_1_length_...
null
main_codes/downstream_analysis/downstream_analysis_relaxed.py
downstream_analysis_relaxed.py
py
27,503
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.exists", "line_nu...
200816883
import pandas as pd import numpy as np import utils from model import LinearRegressionUsingGD, LinearRegressionUsingNE if __name__ == '__main__': print('Loading Data...') df = pd.read_csv('data/house_prices.csv') X = df[['size', 'number of bedrooms']] y = df['price'] print('Plotting Data...') ...
null
Exercise 1/multivariate_linear_regression.py
multivariate_linear_regression.py
py
2,105
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "utils.scatter_plot", "line_number": 14, "usage_type": "call" }, { "api_name": "utils.hist_plot", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.ones", "l...
647977307
# Copyright (c) The Johns Hopkins University/Applied Physics Laboratory # All Rights Reserved. # # 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/licen...
null
glance/common/signature_utils.py
signature_utils.py
py
10,063
python
en
code
null
code-starcoder2
76
[ { "api_name": "oslo_log.log.getLogger", "line_number": 33, "usage_type": "call" }, { "api_name": "oslo_log.log", "line_number": 33, "usage_type": "name" }, { "api_name": "glance.i18n._", "line_number": 34, "usage_type": "attribute" }, { "api_name": "glance.i18n", ...
139169191
import requests import json import uuid import threading import time class ServerManager: def __init__(self): self.slock = threading.Lock() self.queue = {} self.qlock = threading.Lock() def send_records(self, records, tuple_key): self.qlock.acquire() if tuple_key not...
null
client/test.py
test.py
py
8,482
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Lock", "line_number": 11, "usage_type": "call" }, { "api_name": "threading.Lock", "line_number": 13, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.post", "l...
173208488
# Module 1 - Create a Blockchain """ To be installed: Flask==0.12.2: pip install Flask==0.12.2 - Use Anaconda Prompt Postman HTTP Client: https://www.getpostman.com/ """ # Import libraries import datetime import hashlib # To hash blocks import json # To encode blocks before hashing from flask import F...
null
blockchain.py
blockchain.py
py
6,249
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 45, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 45, "usage_type": "attribute" }, { "api_name": "hashlib.sha256", "line_number": 73, "usage_type": "call" }, { "api_name": "json.dump...
348257429
""" MIFARE DESFire EV1 protocol implementation This implementation is based on the following publicly available sources: * Mifare Desfire communication example https://ridrix.wordpress.com/2009/09/19/mifare-desfire-communication-example/ * Desfire EV1 Communication Examples from sotechcllc/RFDoorLock https://githu...
null
mifare/cmac.py
cmac.py
py
5,460
python
en
code
null
code-starcoder2
76
[ { "api_name": "Crypto.Util.number.bytes_to_long", "line_number": 58, "usage_type": "call" }, { "api_name": "Crypto.Util.number.long_to_bytes", "line_number": 59, "usage_type": "call" }, { "api_name": "Crypto.Util.py3compat.bord", "line_number": 76, "usage_type": "call" ...
104085895
import logging import time import os from argparse import ArgumentParser import baseline from torch.nn.parallel import DistributedDataParallel from torch.utils.data import DataLoader from eight_mile.utils import str2bool, write_json, Average, get_num_gpus_multiworker from baseline.pytorch.embeddings import * import bas...
null
api-examples/pretrain_tlm_pytorch.py
pretrain_tlm_pytorch.py
py
15,972
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 37, "usage_type": "call" }, { "api_name": "eight_mile.utils.str2bool", "line_number": 71, "usage_type": "name" }, { "api_name": "e...
150339982
from dateutil.relativedelta import relativedelta from dateutil.parser import parse as ParseDate from rest_framework.response import Response from rest_framework.authentication import TokenAuthentication from rest_framework.permissions import IsAuthenticated # from rest_framework.renderers import JSONRenderer from rest_...
null
app/mitaba/tracker/views.py
views.py
py
10,265
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 22, "usage_type": "call" }, { "api_name": "rest_framework_bulk.ListBulkCreateUpdateDestroyAPIView", "line_number": 30, "usage_type": "name" }, { "api_name": "rest_framework.authentication.TokenAuthentication", "line_number": 31, ...
77416649
import argparse import concurrent.futures import logging import os from PIL import Image from glob import glob from tqdm import tqdm from utils import init_logging, get_arguments logger = logging.getLogger(__name__) def get_script_arguments(): parser = argparse.ArgumentParser(description='Detect the faces on ma...
null
processing/resize_images_mt.py
resize_images_mt.py
py
2,581
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "utils.get_arguments", "line_number": 20, "usage_type": "call" }, { "api_name": "PIL.Ima...
136223673
from django.http import HttpResponse from user import ResultUtil from . import utils # from config import baseUrl import config import os import pymysql # 文件上传 def uploadfile_anti_electricity_theft(request): if request.method == "POST": # 请求方法为POST时,进行处理 myFile = request.FILES.get("myfile", None) # 获取上传...
null
andti_electricity_theft/views.py
views.py
py
5,531
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.http.HttpResponse", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "config.baseUrl", ...
541201204
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 20 15:56:01 2020 @author: lds """ import torch import torch.nn as nn from .Layers import Concat_Separable_Conv2d, Separable_Conv2d, Conv2d, Squeeze from functools import partial class GoogLeNetv3(nn.Module): def __init__(self, num_classes, mod...
null
models/GoogLeNetv3.py
GoogLeNetv3.py
py
6,846
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
333707384
from django.core.exceptions import ObjectDoesNotExist from extras.plugins import PluginTemplateExtension from .utilities import get_rack_power_utilization class DevicePDUStatus(PluginTemplateExtension): model = "dcim.device" def left_page(self): device = self.context["object"] try: ...
null
axians_netbox_pdu/template_content.py
template_content.py
py
2,010
python
en
code
null
code-starcoder2
76
[ { "api_name": "extras.plugins.PluginTemplateExtension", "line_number": 8, "usage_type": "name" }, { "api_name": "django.core.exceptions.ObjectDoesNotExist", "line_number": 18, "usage_type": "name" }, { "api_name": "extras.plugins.PluginTemplateExtension", "line_number": 22, ...
327818263
#!/usr/bin/env python-devops # -*- coding: utf-8 -*- # @File : check-consul-health-02.py # @Author: Anthony.waa # @Date : 2019/3/13 0013 # @Desc : PyCharm from absl import flags from absl import app import consul import requests import urllib import json headers = { 'Connection': 'close' } FLAGS = flags.FLAGS ...
null
python/20190719/python-consul/check-consul-health-02.py
check-consul-health-02.py
py
3,236
python
en
code
null
code-starcoder2
76
[ { "api_name": "absl.flags.FLAGS", "line_number": 18, "usage_type": "attribute" }, { "api_name": "absl.flags", "line_number": 18, "usage_type": "name" }, { "api_name": "absl.flags.DEFINE_string", "line_number": 20, "usage_type": "call" }, { "api_name": "absl.flags"...
584484168
import numpy as np import cv2 as cv ## Webcam capture and setting def nothing(x): pass # To adjust HSV values and find Pixel Metric cap = cv.VideoCapture(0) camWidth = cap.get(3) camHeight = cap.get(4) cap.set(10,50) fps = cap.get(cv.CAP_PROP_FPS) camWidth = int(camWidth) camHeight = int(camHeight) midWidth = ...
null
Main Application/ImgCalibration.py
ImgCalibration.py
py
2,774
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_FPS", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cv2.namedWindow", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.createTrac...
151121948
from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.utils.validation import check_X_y, check_array, check_is_fitted from sklearn.utils.multiclass import check_classification_targets from sklearn.utils.multiclass import unique_labels from sklearn.metrics.pairwise import manhattan_distances import numpy ...
null
method.py
method.py
py
1,072
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.base.BaseEstimator", "line_number": 9, "usage_type": "name" }, { "api_name": "sklearn.base.ClassifierMixin", "line_number": 9, "usage_type": "name" }, { "api_name": "sklearn.utils.validation.check_X_y", "line_number": 15, "usage_type": "call" }, ...
96995652
# -*- coding:utf-8 -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED STOP_RENDERING = runtime.STOP_RENDERING __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 10 _modified_time = 1466012407.534062 _enable_loop = True _template_filename = 'C:/Data/chf_postgresql/homepage/styles...
null
homepage/styles/.cached_templates/index.cssm.py
index.cssm.py
py
1,114
python
en
code
null
code-starcoder2
76
[ { "api_name": "mako.runtime.UNDEFINED", "line_number": 3, "usage_type": "attribute" }, { "api_name": "mako.runtime", "line_number": 3, "usage_type": "name" }, { "api_name": "mako.runtime.STOP_RENDERING", "line_number": 4, "usage_type": "attribute" }, { "api_name":...
184734591
import csv import sqlite3 conn=sqlite3.connect('stations.sqlite') with open('init.sql') as f: conn.executescript(f.read()) with open ('content.csv', 'r',encoding="utf-8-sig") as f:#去除開頭碼(\uxxxx)! reader = csv.reader(f) columns = next(reader) cur = conn.cursor() for data in reader: data=[f"'{...
null
init_db.py
init_db.py
py
823
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 7, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 14, "usage_type": "call" } ]
144801924
from flask import Flask, render_template, jsonify, request from random import randint from helpers import * import requests app = Flask(__name__) BASE_API_URL = 'http://numbersapi.com/' @app.route("/") def homepage(): """Show homepage.""" return render_template("index.html") @app.route("/api/get-lucky-num"...
null
lucky-nums/app.py
app.py
py
735
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request.json", "line_number": 18, "usage_type": "attribute" }, { "api_name": "flask.reques...
101851889
#!/usr/bin/env python from setuptools import setup classifiers = ["Development Status :: 4 - Beta", "Environment :: Plugins", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Topic :: Software Development :: Testing"] ...
null
setup.py
setup.py
py
954
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 10, "usage_type": "call" } ]
190691507
# coding: utf-8 from sqlalchemy import CHAR, Column, DateTime, Float, String, Table, Text, text from sqlalchemy.dialects.mysql import BIGINT, INTEGER, LONGTEXT, TINYINT from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() metadata = Base.metadata t_active_tasks = Table( 'active_tasks...
null
sandbox/test_sql/models_mod_akrr_v2.py
models_mod_akrr_v2.py
py
8,965
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlalchemy.Table", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 12, "usage_type": "call" }, { "api...
391117673
import boto3 import pytest import sure # noqa # pylint: disable=unused-import from botocore.client import ClientError from moto import mock_s3control @mock_s3control def test_create_access_point(): client = boto3.client("s3control", region_name="eu-west-1") resp = client.create_access_point( Account...
null
tests/test_s3control/test_s3control_access_points.py
test_s3control_access_points.py
py
3,980
python
en
code
null
code-starcoder2
76
[ { "api_name": "boto3.client", "line_number": 11, "usage_type": "call" }, { "api_name": "moto.mock_s3control", "line_number": 9, "usage_type": "name" }, { "api_name": "boto3.client", "line_number": 22, "usage_type": "call" }, { "api_name": "pytest.raises", "lin...
608790470
""" Really mocky and pure unit tests of the grader.py file """ import json import subprocess from unittest.mock import MagicMock, Mock, patch, mock_open from unittest import TestCase from constants import TESTS_FOLDER_NAME, GRADER_COMPILE_FAILURE, PYTHON_TIMEOUT_SECONDS, PYTHON_FILE_EXTENSION, PYTHON_RUN_COMMAND from ...
null
deadline_/challenges/tests/test_grader.py
test_grader.py
py
22,882
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.mock.Mock", "line_number": 17, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 27, "usage_type": "name" }, { "api_name": "challenges.grader.BaseGrader.FILE_EXTENSION", "line_number": 29, "usage_type": "attribute" }, { ...
225640577
""" This file contains methods for calculating the probability of a tuplewise ranking and the information provided by a tuple query. Relevant references describing in detail these procedures and the requisite assumptions are found in Sections 3.1 and 3.2. """ import numpy as np from random import shuffle...
null
body_metrics.py
body_metrics.py
py
9,141
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.choice", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 22, "usage_type": "attribute" }, { "api_name": "math.factorial", "line_number": 79, "usage_type": "call" }, { "api_name": "numpy.zeros", ...
409034442
from staffapp import views from django.conf.urls import url app_name='staffapp' urlpatterns=[ url(r'^$', views.staff, name="staff"), url(r'^addstaff/$', views.addstaff, name="addstaff"), url(r'^appotiment/$', views.appotiment, name="appotiment"), url(r'^staffview/$', views.staffview, name="staffview")...
null
staffapp/urls.py
urls.py
py
627
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "staffapp.views.staff", "line_number": 7, "usage_type": "attribute" }, { "api_name": "staffapp.views", "line_number": 7, "usage_type": "name" }, { "api_name": "django.con...
607714698
import re import os.path import collections from datetime import datetime import urllib.request URL_PATH = 'https://s3.amazonaws.com/tcmg476/http_access_log' LOCAL_FILE = 'local_copy.txt' FILE_REQS="file_reqs.txt" if not os.path.exists(LOCAL_FILE): print("Downloading file: ") urllib.request.urlret...
null
project-no-3.py
project-no-3.py
py
4,359
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.path.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 11, "usage_type": "name" }, { "api_name": "urllib.request.request....
99471631
from requests import get url1='https://www.amazon.in/s?k=motherboard&qid=1573042660&ref=sr_pg_1' #url2='https://www.amazon.in/s?k=motherboard&page=2&qid=1573042752&ref=sr_pg_2' #url1='https://www.amazon.in/ASUS-EX-A320M-Gaming-AMD-Motherboard/dp/B0771L77V7/ref=sr_1_3?keywords=motherboard&qid=1573042791&sr=8-3' respons...
null
amazonpricelist.py
amazonpricelist.py
py
561
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 8, "usage_type": "call" } ]
438017999
import argparse import logging import os from datetime import datetime import sys from time import sleep def tail(f, lines=20): total_lines_wanted = lines BLOCK_SIZE = 1024 f.seek(0, 2) block_end_byte = f.tell() lines_to_go = total_lines_wanted block_number = -1 blocks = [] # blocks of siz...
null
bf-arb-pylab/scripts/file-polling.py
file-polling.py
py
1,705
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 37, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 37, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 38, "usage_type": "call" }, { "api_name": "argpars...
222348656
import requests channel_id = "UCqPqH09CdRfQKxhB2aJhDVA" key = "ENTER YT API KEY" def getData(): try: url = f"https://www.googleapis.com/youtube/v3/channels?part=statistics&id={channel_id}&key={key}" rawData = requests.get(url).json() data = rawData['items'][0]['statistics']['subscriberCoun...
null
utils/API.py
API.py
py
387
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" } ]
537501873
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # bitFlyer / Coincheck がこの数値%以上となったら bitFlyer BTC売り、Coincheck BTC買い SellbitFlyer_BuyCC_Percentage = 1 # bitFlyer / Coincheck がこの数値%以下となったら bitFlyer BTC買い、Coincheck BTC売り BuybitFlyer_SellCC_Percentage = -1 # 1回に取引するBTCの最大枚数 Max_BTC_Trade_Amount = 0.1 # 1トレード後に開ける間隔 [秒] ...
null
btcCC-BF.py
btcCC-BF.py
py
7,375
python
en
code
null
code-starcoder2
76
[ { "api_name": "pybitflyer.API", "line_number": 59, "usage_type": "call" }, { "api_name": "time.time", "line_number": 104, "usage_type": "call" }, { "api_name": "hmac.new", "line_number": 106, "usage_type": "call" }, { "api_name": "hashlib.sha256", "line_number...
22209023
# Third Party Stuff from rest_framework.routers import DefaultRouter from rest_framework_nested import routers # milife-back Stuff from milife_back.base.api.routers import SingletonRouter from milife_back.users.api import CurrentUserViewSet, UsersViewSet, UserCountViewSet, CoachesViewSet from milife_back.users.auth.ap...
null
milife_back/api_urls.py
api_urls.py
py
4,328
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 20, "usage_type": "call" }, { "api_name": "milife_back.base.api.routers.SingletonRouter", "line_number": 21, "usage_type": "call" }, { "api_name": "rest_framework_bulk.routes.BulkRouter", "line_number": 22, ...
486162270
import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib import style from mpl_toolkits.mplot3d import Axes3D style.use('ggplot') fig = plt.figure() # ax1 = fig.add_subplot() # ax2 = fig.add_subplot() # ax3 = fig.add_subplot() # ax4 = fig.add_subplot() df_poro = pd.read_table(filepath_...
null
plots_206.py
plots_206.py
py
2,806
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.style.use", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotli...
527188326
import subprocess import re import datetime import telegram import config def get_contacts(): today = datetime.datetime.today() tomorrow = today + datetime.timedelta(days=1) output = subprocess.check_output([ "gcalcli", "agenda", today.strftime("%m/%d/%Y"), tomorrow.strftim...
null
utils.py
utils.py
py
805
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.today", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 10, "usage_type": "call" }, { "api_name": "subpr...
343069625
from django.contrib import admin from django.urls import path from django.conf.urls import url, include from Login import views urlpatterns = [ url(r'^main', views.mainpage, name='Main Page'), url('^search/sname.html', views.name, name='Search by name'), url(r'^search/scourse.html', views.course,...
null
urls.py
urls.py
py
720
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "Login.views.mainpage", "line_number": 8, "usage_type": "attribute" }, { "api_name": "Login.views", "line_number": 8, "usage_type": "name" }, { "api_name": "django.conf.u...
79763400
from time import sleep import threading from serial import SerialException, Serial from datetime import datetime import pytz from Utils.Logger import print class SerialThread(threading.Thread): def __init__(self, _buadrates, _dataqueue, _timequeue): threading.Thread.__init__(self) self.dataQueue =...
null
Structure/SerialThread.py
SerialThread.py
py
1,455
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Thread", "line_number": 9, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 11, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 11, "usage_type": "attribute" }, { "api_name": "...
45785962
import matplotlib.pyplot as plt import pylab import numpy as np def makeData(): X = np.arange(-40, 25, 0.1) Y = np.arange(-30, 15, 0.1) X, Y = np.meshgrid(X, Y) Z = X**4 + 20.*(X**3) + 2*(X**2)*(Y**2) + 36*(X**2)*Y + 312*(X**2)+ 20*X*(Y**2) + 360*X*Y + 2121*X + Y**4+ 36*(Y**3)+ 537*(Y**2) + 3...
null
linur.py
linur.py
py
1,180
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arange", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_number": 8, "usage_type": "call" }, { "api_name": "pylab.figure", "line_number...
291620944
from dataclasses import dataclass, field from typing import Dict, List, Optional from datetime import datetime from sqlalchemy.sql.sqltypes import Enum from .main import ArticleContainer, ContentType @dataclass class YoutubeVideoCategory: etag: str id: str title: str assignable: bool @classmetho...
null
k11/models/youtube.py
youtube.py
py
5,506
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 25, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 9, "usage_type": "name" }, { "api_name": "sqlalchemy.sql.sqltypes.Enum", "line_number": 29, "usage_type": "name" }, { "api_name": "datetim...
572865580
import django_tables2 as tables from django.urls import reverse from django.contrib.admin.utils import quote from django.utils.html import format_html from booking.models import ( Quote, QuoteService, QuotePaxVariant, Booking, BookingService, BookingPax) from booking.constants import QUOTESERVICE_TYPES, BOOKIN...
null
booking/tables.py
tables.py
py
3,090
python
en
code
null
code-starcoder2
76
[ { "api_name": "django_tables2.Table", "line_number": 12, "usage_type": "attribute" }, { "api_name": "booking.models.Quote", "line_number": 14, "usage_type": "name" }, { "api_name": "django.utils.html.format_html", "line_number": 19, "usage_type": "call" }, { "api_...
137991701
''' Opacus experiments for all the models ''' import time import torch from torch import nn, optim import data from experimental.privacy_utils import autograd_grad_sample from experimental.privacy_utils.privacy_engine import EfficientPrivacyEngine from pytorch import get_data, model_dict import utils def main(args)...
null
fast_torch_dp.py
fast_torch_dp.py
py
3,254
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.backends", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pytorch.model_dict.copy", "line_number": 21, "usage_type": "call" }, { "api_name": "pytorch.model_dict", "line_number": 21, "usage_type": "name" }, { "api_name": "pytorc...
19445612
from typing import List import math import copy import random TRIALS = 10 def find_two_missing(arr: List[int], N: int) -> List[int]: # print(f"Array of len {len(arr)} is {arr}") all_sum = sum(range(1, N+1)) all_quad_sum = sum(i**2 for i in range(1, N+1)) real_sum = sum(arr) real_quad_sum = sum(...
null
chapter_17/p17_19.py
p17_19.py
py
1,147
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "math.sqrt", "line_number": 21, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 28, "usage_type": "call" }, { "api_name": "random.randint", "line_numbe...
405866176
""" gui_handler class """ import sys from PyQt5 import QtWidgets from PyQt5.QtWidgets import QMessageBox if __name__ == '__main__': print("INFO: gui_handler class import as '__main__'") import gui from createeut import create_eut_handler else: print("INFO: gui_handler class import as '__module__'")...
null
taff_v1/gui/gui_handler.py
gui_handler.py
py
4,512
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 32, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 32, "usage_type": "name" }, { "api_name": "gui.gui.Ui_Form", "line_number": 53, "usage_type": "call" }, { "api_name": "gui.gui"...
385998670
#!/usr/bin/env python from numpy import array import argparse from argparse import RawTextHelpFormatter import ml_lib.parse as ml_parse import ml_lib.evaluation as ml_eval import ml_lib.machine_learning as ml def interface(): args = argparse.ArgumentParser( formatter_class=RawTextHelpFormatter, des...
null
machine_learning.py
machine_learning.py
py
2,898
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": "name" }, { "api_name": "ml_lib.machine_learning.get_test_sets", "line_number": 37, "usage_type": "call" }...
538362097
import sys sys.path.append('.') import pudb as db import Leetcode.utils as ut from solution import Solution tests = [ [ [ ['o','a','a','n'],['e','t','a','e'],['i','h','k','r'],['i','f','l','v'] ], ['oath','pea','eat','rain'], ['oath', 'eat'], ], [ [["a"]], ["a"], ...
null
Leetcode/word_search_ii/test.py
test.py
py
767
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": "solution.Solution", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.argv", "line_nu...
229860543
from sqlalchemy.orm import Session from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, ForeignKey, UniqueConstraint, event, DDL, Sequence from sqlalchemy.types import String, Integer, Float from chembl_release_utils.orm import create_engine_base from chembl_release_utils.settings impo...
null
keyword_pipeline.py
keyword_pipeline.py
py
6,106
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.DEBU...
495979101
from utils import sanitize class DataverseFile(object): def __init__(self, dataset, name, file_id=None): self.dataset = dataset self.name = sanitize(name) self.id = file_id self.download_url = 'http://{0}/api/access/datafile/{1}'.format( dataset.connection.host, self.i...
null
dataverse/file.py
file.py
py
673
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.sanitize", "line_number": 7, "usage_type": "call" } ]
79481298
""" Adapted from SentEval/examples/bow.py https://github.com/facebookresearch/SentEval/blob/master/examples/bow.py """ import sys import io import numpy as np import argparse import logging from tools.Blogger import Blogger logger = Blogger() # Set PATHs PATH_TO_SENTEVAL = "./SentEval" PATH_TO_DATA = "./SentEval/data...
null
lib/examples/run-senteval.py
run-senteval.py
py
4,030
python
en
code
null
code-starcoder2
76
[ { "api_name": "tools.Blogger.Blogger", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path.insert", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "io.open", "li...
356221111
#!/usr/bin/python3 #https://github.com/FooSoft/anki-connect from urllib.parse import urlencode import requests import json import random import re import io from wand.color import Color from wand.image import Image from wand.image import Font import subprocess anki_address = '192.168.0.115' TAG_RE = re.compile(r'<[^>...
null
refresh.py
refresh.py
py
3,147
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 33, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 33, "usage_type": "call" }, { "api_name": "random.choice", "line_number":...
29807227
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2015 jaidev <jaidev@newton> # # Distributed under terms of the MIT license. """ Ambiguity functions. """ import numpy as np from tftb.utils import init_default_args def narrow_band(signal, lag=None, n_fbins=None): """Narrow band amb...
null
tftb/processing/ambiguity.py
ambiguity.py
py
1,772
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arange", "line_number": 36, "usage_type": "call" }, { "api_name": "tftb.utils.init_default_args", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.arange", ...
215590463
from click.testing import CliRunner from mock import MagicMock, patch import bentoml from bentoml.cli import create_bentoml_cli from bentoml.utils.usage_stats import _get_bento_service_event_properties from bentoml.yatai.proto.deployment_pb2 import ( DeleteDeploymentResponse, Deployment, ) from bentoml.yatai.s...
null
tests/utils/test_usage_stats.py
test_usage_stats.py
py
6,523
python
en
code
null
code-starcoder2
76
[ { "api_name": "bentoml.yatai.proto.deployment_pb2.Deployment", "line_number": 24, "usage_type": "call" }, { "api_name": "bentoml.yatai.proto.deployment_pb2.DeleteDeploymentResponse", "line_number": 33, "usage_type": "call" }, { "api_name": "bentoml.yatai.status.Status.ABORTED", ...
330223467
import pygame, os import game_module as gm import random os.environ['SDL_VIDEO_CENTERED'] = '1' # centrowanie okna pygame.init() ## ustawienia ekranu i gry screen = pygame.display.set_mode(gm.SIZESCREEN) pygame.display.set_caption('Prosta gra platformowa...') clock = pygame.time.Clock() # klasa gracza cl...
null
Gra Platformowa/gra.py
gra.py
py
11,321
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.display", ...
482424615
import cv2 import numpy as np import config HSV_MAX = config.HSV_MAX YCRCB_MIN_1 = config.YCRCB_MIN_1 YCRCB_MAX_1 = config.YCRCB_MAX_1 YCRCB_MIN_2 = config.YCRCB_MIN_2 YCRCB_MAX_2 = config.YCRCB_MAX_2 def _segment_otsu(image_grayscale, img_BGR): threshold_value, threshold_image = cv2.threshold(image_grayscale, 0...
null
integration/skin_tone_estimator.py
skin_tone_estimator.py
py
1,733
python
en
code
null
code-starcoder2
76
[ { "api_name": "config.HSV_MAX", "line_number": 5, "usage_type": "attribute" }, { "api_name": "config.YCRCB_MIN_1", "line_number": 6, "usage_type": "attribute" }, { "api_name": "config.YCRCB_MAX_1", "line_number": 7, "usage_type": "attribute" }, { "api_name": "conf...
351223634
import requests import json import argparse import datetime import re # used for processing command line switches def command_line_processor(): parser = argparse.ArgumentParser(description="Parse log file to forward data to Phantom. Can be run from the terminal or cron tab using the -a flag to provide an api key."...
null
scripts/log_forwarder.py
log_forwarder.py
py
5,751
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 49, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 84, "usage_type": "call" }, { "api_name": "datetime.d...
300636907
import numpy as np from scipy.spatial.distance import cdist from pymoo.cython.decomposition import PenaltyBasedBoundaryIntersection, Tchebicheff from pymoo.algorithms.genetic_algorithm import GeneticAlgorithm from pymoo.docs import parse_doc_string from pymoo.operators.crossover.simulated_binary_crossover import Simul...
null
pymoo/algorithms/moead.py
moead.py
py
5,630
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymoo.algorithms.genetic_algorithm.GeneticAlgorithm", "line_number": 19, "usage_type": "name" }, { "api_name": "pymoo.operators.default_operators.set_if_none", "line_number": 31, "usage_type": "call" }, { "api_name": "pymoo.operators.default_operators.set_if_none",...
224360549
#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # # This file is a part of Human Resource System of BQD Jinan Branch. # # File: HRSLib\apps\addr_book\search_tool.py # Description: app of addr_book search tool. # Author: Yu Zhao 赵宇 <zyzy5730@1...
null
HRSLib/apps/addr_book/search_tool.py
search_tool.py
py
2,856
python
en
code
null
code-starcoder2
76
[ { "api_name": "wx.Panel", "line_number": 19, "usage_type": "attribute" }, { "api_name": "wx.Panel.__init__", "line_number": 21, "usage_type": "call" }, { "api_name": "wx.Panel", "line_number": 21, "usage_type": "attribute" }, { "api_name": "wx.BoxSizer", "line...
567580544
from socket import * from threading import Thread import datetime as dt serverPort = 8888 TCP_IP = "127.0.0.1" serverSocket = socket(AF_INET,SOCK_STREAM) serverSocket.bind((TCP_IP,serverPort)) serverSocket.listen(5) print ("Running and Listening for Knocks") buffer_size = 1024 threads = [] class ClientThread(Thread)...
null
HTTPServer/MultiThreaded.py
MultiThreaded.py
py
2,419
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Thread", "line_number": 15, "usage_type": "name" }, { "api_name": "threading.Thread.__init__", "line_number": 18, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 18, "usage_type": "name" }, { "api_name": "datetime....
510264855
# Python Script for Parsing the hauyi dataset import os import nltk from sklearn.feature_extraction.text import CountVectorizer from sklearn import metrics import numpy as np import bow import classifiers from sklearn.model_selection import train_test_split DEBUG = False '''Simple class to store metadata information...
null
detecting-fake-reviews/src/yelp.py
yelp.py
py
6,842
python
en
code
null
code-starcoder2
76
[ { "api_name": "bow.bag_of_words", "line_number": 151, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 153, "usage_type": "call" }, { "api_name": "classifiers.logistic_regression", "line_number": 155, "usage_type": "call" ...
73570633
import numpy as np import matplotlib.pyplot as plt import glob from collections import defaultdict import matplotlib.ticker as ticker # read the file for the number of edges edges = defaultdict(list) i = 0 with open('../output.txt','r') as f: for line in f: if i % 9 == 0: filename = line.split(...
null
HW2/MST/src/running_time_analysis.py
running_time_analysis.py
py
1,367
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 34, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplo...
525514604
# -*- coding: utf-8 -*- # @Author :180732677 # @Email : yinbao.bai@hytera.com # @Time :2020/6/19 16:54 # @ProjectName : mysite # @FileName :sparepart.py # @Software :PyCharm from django.core.paginator import Paginator from django.http import HttpResponse,JsonResponse,FileResponse from django.ut...
null
myapp/sparepart.py
sparepart.py
py
16,426
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymysql.connect", "line_number": 21, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 33, "usage_type": "call" }, { "api_name": "openpyxl.compat.range", "line_number": 44, "usage_type": "call" }, { "api_name": "openpyxl...
228122279
import json import torch import os import torchvision from torchvision import transforms from PIL import Image import matplotlib.pyplot as plt import torch.nn as nn from model import densenet121 import numpy as np def main(): device = torch.device("cuda" if torch.cuda.is_available() else "cpu") data_transfo...
null
2017_CVPR_DenseNet/code/predict.py
predict.py
py
2,327
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.device", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torchvision.tran...
639266898
from django.test import TestCase from .models import Lesson, Reference # Create your tests here. class LessonModelTests(TestCase): def test_add_multiple_references(self): ''' Ensure that lesson can contain multiple references ''' L1 = Lesson(lesson_name = 'Lesson1') L1.save() L2 = Lesson(...
null
app/tests.py
tests.py
py
834
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "models.Lesson", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Lesson", "line_number": 15, "usage_type": "call" }, { "api_name": "models.Lesson", "...
516584852
# $HeadURL: $ ''' EmailAction ''' from DIRAC import S_ERROR, S_OK, gConfig from DIRAC.ResourceStatusSystem.PolicySystem.Actions.BaseAction import BaseAction from DIRAC.ResourceStatusSystem.Utilities.InfoGetter import InfoGetter __RCSID__ = '$Id: $' c...
null
ResourceStatusSystem/PolicySystem/Actions/EmailAction.py
EmailAction.py
py
4,066
python
en
code
null
code-starcoder2
76
[ { "api_name": "DIRAC.ResourceStatusSystem.PolicySystem.Actions.BaseAction.BaseAction", "line_number": 12, "usage_type": "name" }, { "api_name": "DIRAC.S_ERROR", "line_number": 34, "usage_type": "call" }, { "api_name": "DIRAC.S_ERROR", "line_number": 38, "usage_type": "cal...
488489394
import gmail import smtplib import time import sqlite3 import datetime LOGIN = "abbrbot" PASSWORD = "ilgiausiasslaptazodis" BOT_EMAIL_ADDRESS = "abbrbot@gmail.com" PATH_TO_SQLITE_DATABASE = "abbreviations.db" DATABASE_CONNECTION = None DATABASE_CURSOR = None TIME_TO_SLEEP = 3 # TODO # Sensitive info from .gitignor...
null
AbbrBot.py
AbbrBot.py
py
6,286
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 32, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 38, "usage_type": "call" }, { "api_name": "gmail.login", "line_number": 44, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "l...
512738277
from absl import flags import re import numpy as np import os import csv # import tensorflow as tf import sentencepiece as spm from data_utils import SEP_ID, CLS_ID from prepro_utils import preprocess_text, encode_ids FLAGS = flags.FLAGS SEG_ID_A = 0 SEG_ID_CLS = 2 SEG_ID_SEP = 3 SEG_ID_PAD = 4 class InputExa...
null
ner_utils.py
ner_utils.py
py
5,703
python
en
code
null
code-starcoder2
76
[ { "api_name": "absl.flags.FLAGS", "line_number": 16, "usage_type": "attribute" }, { "api_name": "absl.flags", "line_number": 16, "usage_type": "name" }, { "api_name": "data_utils.SEP_ID", "line_number": 101, "usage_type": "argument" }, { "api_name": "data_utils.CL...
496800760
import numpy as np import matplotlib.pyplot as plt x = [1,2,3,4] y= [1,2,3,4] xx, yy = np.meshgrid(x,y) z = np.arange(0,16) z = z.reshape(xx.shape) print(xx) print(yy) print(z) plt.contourf(xx,yy,z , 8) C = plt.contour(xx , yy ,z, 8, colors = 'black', linewidth = 0.5) plt.clabel(C, inline = True, fontsize = 10) p...
null
codenote/matplot/plt_contourf.py
plt_contourf.py
py
331
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.meshgrid", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.contourf", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
108330741
import requests import json from time import sleep url = "https://api.domination.earth/users/earth_lands/?latitude=24.909377&longitude=121.286854&tracking_id=0&placement_id=0" header = { "Accept": "application/json", "Authorization": "Token f021a316cc607130385fc74ed49410d57a6d3f54", "User-Agent": "Mozilla/5.0 (Linux; ...
null
surronding.py
surronding.py
py
1,606
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 21, "usage_type": "call" } ]
48430422
# Please cite the following paper when using the code import os import glob import csv import pandas as pd import numpy as np import Names import Data from imblearn.over_sampling import RandomOverSampler from sklearn.model_selection import StratifiedKFold from sklearn.model_selection import LeaveOneOut class DataPr...
null
gwu/accepted/flairs_2020/arc/code/python/DataPreprocessing.py
DataPreprocessing.py
py
19,391
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.glob", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path", "line_number": 40, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_...
422356870
import pytest from tibs import parser, type_inference from tibs.ast_node import ( EMPTY_TENSOR_TYPE_AST_NODE, PrintStatementASTNode, ComparisonExpressionASTNode, ExpressionASTNode, TensorTypeASTNode, VectorExpressionASTNode, FunctionDefinitionASTNode, ForLoopASTNode, WhileLoopASTNod...
null
static_autodiff/tibs/tests/test_front_end_function_call.py
test_front_end_function_call.py
py
10,517
python
en
code
null
code-starcoder2
76
[ { "api_name": "tibs.ast_node.FunctionCallExpressionASTNode", "line_number": 51, "usage_type": "call" }, { "api_name": "tibs.ast_node.FunctionDefinitionASTNode", "line_number": 53, "usage_type": "call" }, { "api_name": "tibs.ast_node.TensorTypeASTNode", "line_number": 56, ...
525068664
#!/usr/bin/python # coding=UTF-8 import os from lib.inifile_operator import IniFileOperator from lib.mysql_operator import MysqlOperator import lib.common_functions as common import lib.utility as utility class NotifgwProcess(object): @utility.trace_func def __init__(self, rootpath, name, category_id, common...
null
model/notifgw_process.py
notifgw_process.py
py
3,265
python
en
code
null
code-starcoder2
76
[ { "api_name": "lib.utility.trace_func", "line_number": 12, "usage_type": "attribute" }, { "api_name": "lib.utility", "line_number": 12, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "l...
113033412
from django.urls import path from . import views app_name = 'comments' urlpatterns = [ # comment/ path('add/<int:post_id>/', views.comment_add_view, name='add_comment'), path('delete/<int:comment_id>/', views.comment_delete_view, name='delete_comment'), path('log/', views.comment_log_view, name='comme...
null
social_media_project/comments/urls.py
urls.py
py
337
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" } ]
474415482
""" Database module See http://flask.pocoo.org/docs/0.12/patterns/sqlalchemy/ """ from .cala import app from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base engine = create_engine('sqlite:///%s' % app.config['DATABASE']...
null
cala/database.py
database.py
py
2,008
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.create_engine", "line_number": 14, "usage_type": "call" }, { "api_name": "cala.app.config", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cala.app", "line_number": 14, "usage_type": "name" }, { "api_name": "sqlalchemy.orm...
1046262
from __future__ import print_function import argparse from typing import Optional from typing import Sequence from pre_commit_hooks.util import run_gradle_task from pre_commit_hooks.util import run_gradle_wrapper_task def main(argv=None): # type: (Optional[Sequence[str]]) -> int parser = argparse.ArgumentParse...
null
pre_commit_hooks/gradle_build.py
gradle_build.py
py
878
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "pre_commit_hooks.util.run_gradle_wrapper_task", "line_number": 24, "usage_type": "call" }, { "api_name": "pre_commit_hooks.util.run_gradle_task", "line_number": 26, "usage_t...
68884172
# Example-53.py #!/usr/bin/env python3 import sys import libvirt from xml.dom import minidom domName = 'CentOS7' conn = None try: conn = libvirt.open("qemu:///system") except libvirt.libvirtError as e: print(repr(e), file=sys.stderr) exit(1) dom = None try: dom = conn.lookupByName(domName) except lib...
null
en-US/extras/Domains-Example-53.py
Domains-Example-53.py
py
549
python
en
code
null
code-starcoder2
76
[ { "api_name": "libvirt.open", "line_number": 11, "usage_type": "call" }, { "api_name": "libvirt.libvirtError", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 13, "usage_type": "attribute" }, { "api_name": "libvirt.libvir...
129980007
import math import numpy as np import json import ast import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import DataLoader, Dataset from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import Config from AlexNet import AlexNet from Datase...
null
CategoricalBaseLine/WeightedLoss/Train.py
Train.py
py
7,234
python
en
code
null
code-starcoder2
76
[ { "api_name": "Dataset.DataPrefetcher", "line_number": 21, "usage_type": "call" }, { "api_name": "Utils.MeanManager", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.double", "line_number": 37, "usage_type": "attribute" }, { "api_name": "Config.che...
370385986
""" Policy Gradient, Reinforcement Learning. The MountainCar Example """ import gym from ppo3 import PPO # env = gym.make('MountainCar-v0') # env = gym.make('CartPole-v0') env = gym.make('Pendulum-v0') # env = gym.make('BipedalWalker-v2') env.seed(1) # reproducible, general Policy gradient has high variance env ...
null
contents/12_Proximal_Policy_Optimization/MountainCar.py
MountainCar.py
py
1,390
python
en
code
null
code-starcoder2
76
[ { "api_name": "gym.make", "line_number": 12, "usage_type": "call" }, { "api_name": "ppo3.PPO", "line_number": 27, "usage_type": "call" } ]
44586677
import numpy as np from scipy.linalg import eigh from ...utils import knn, l21_norm, matrix_norm class UDFS(object): """ Performs the Unsupervised Discriminative Feature Selection algorithm. Parameters ---------- p : int Number of features to select. c : int, o...
null
ITMO_FS/filters/sparse/UDFS.py
UDFS.py
py
4,626
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 82, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number": 89, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 89, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number": 90, ...
578434984
from openpyxl import load_workbook wb = load_workbook("sample.xlsx") ws = wb.active #ws.insert_rows(8) #8 번째 줄 비움 #ws.insert_rows(8,5) # 8에 5줄 추가 ws.insert_cols(2) #2 열 비우기 #ws.insert_cols(2,5) #2 열로부터 5칸 비우기. wb.save("sample_insert_cols.xlsx")
null
rpa_basic/1_excel/7_insert.py
7_insert.py
py
288
python
en
code
null
code-starcoder2
76
[ { "api_name": "openpyxl.load_workbook", "line_number": 2, "usage_type": "call" } ]
98099380
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.contrib.auth.models import django.utils.timezone from django.conf import settings import django.core.validators class Migration(migrations.Migration): dependencies = [ ('auth', '0006_re...
null
tarea3/tarea3/pfinalapi/migrations/0001_initial.py
0001_initial.py
py
9,383
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 18, "usage_type": "call" }, ...
252081691
from datetime import datetime from odoo import api, fields, models from odoo.exceptions import ValidationError, RedirectWarning class HrPayslipEmployees(models.TransientModel): _inherit = 'hr.payslip.employees' account_analytic_account_id = fields.Many2one('account.analytic.account', 'Centro de costo') ...
null
l10n_cl_hr_payroll/wizard/hr_payslip_employees.py
hr_payslip_employees.py
py
3,023
python
en
code
null
code-starcoder2
76
[ { "api_name": "odoo.models.TransientModel", "line_number": 6, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 6, "usage_type": "name" }, { "api_name": "odoo.fields.Many2one", "line_number": 9, "usage_type": "call" }, { "api_name": "odoo.fi...
474226685
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 import torch try: # This works in PyTorch 1.7+ from torch.fft import irfft, rfft except ModuleNotFoundError: # This works in PyTorch 1.6 def rfft(input, n=None): if n is not None: m = input.size(-1)...
null
pyro/ops/fft.py
fft.py
py
848
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.functional.pad", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.view_as_complex", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.rff...
173803673
# Работа с datetime import datetime, locale locale.setlocale(locale.LC_ALL, "russian") today = datetime.date.today() today.strftime('%A %d %B %Y') day_delta = datetime.timedelta(days=1) month_delta = datetime.timedelta(days=30) yestreday = today - day_delta month_ago = today - month_delta print("Сегодня: {}".format...
null
task_datetime.py
task_datetime.py
py
1,067
python
en
code
null
code-starcoder2
76
[ { "api_name": "locale.setlocale", "line_number": 4, "usage_type": "call" }, { "api_name": "locale.LC_ALL", "line_number": 4, "usage_type": "attribute" }, { "api_name": "datetime.date.today", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.date", ...
362996561
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed May 24 23:09:33 2017 @author: meiyi """ from scipy.sparse import hstack,coo_matrix from sklearn.preprocessing import MinMaxScaler train_w2v_q1 = np.load(path_feature+'train_q1_w2v_google.pkl') train_w2v_q1 = pd.DataFrame(train_w2v_q1,columns=['q1_' +...
null
untitled0.py
untitled0.py
py
3,434
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.model_selection.train_test_split", "line_number": 47, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 48, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 58, ...
136036942
import numpy as np import cv2 import math def p4(labels_in, database_in): database_out = {} labels = [] #find labels for x in range(len(labels_in)): for y in range(len(labels_in[0])): if labels_in[x][y] != 0 and labels_in[x][y] not in labels: newObject = {} newObject['object_labe...
null
hw1/p4.py
p4.py
py
4,105
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.atan2", "line_number": 49, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 50, "usage_type": "attribute" }, { "api_name": "math.fabs", "line_number": 52, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 52, ...
224202066
# -*- coding: utf-8 -*- """ Created on Sun Nov 1 23:39:14 2020 @author: Henock """ import numpy as np import cv2 frame = cv2.imread('ct.png') # Convert BGR to HSV hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) # define range of red color in HSV lower_red = np.array([0, 78, 100]) upper_red = np.array([341, 255, 255])...
null
DOC-test.py
DOC-test.py
py
853
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.array", "lin...
540687376
from ras.core.reporting.ReportParameters import ReportParameters from reportlab.lib.units import inch from reportlab.lib import colors from reportlab.lib.enums import TA_RIGHT, TA_CENTER class ReportDataClassCard: def __init__(self, name: str, index_name: str='', ...
null
ravisual_data_parameters.py
ravisual_data_parameters.py
py
30,155
python
en
code
null
code-starcoder2
76
[ { "api_name": "reportlab.lib.enums.TA_RIGHT", "line_number": 24, "usage_type": "name" }, { "api_name": "ras.core.reporting.ReportParameters.ReportParameters.REFERENCE_TEXT_PERFORMANCE", "line_number": 125, "usage_type": "attribute" }, { "api_name": "ras.core.reporting.ReportParam...
629061657
#!/usr/bin/env python # coding: utf-8 # In[8]: get_ipython().system('pip install numpy') get_ipython().system('pip install pandas') get_ipython().system('pip install sklearn') from html.parser import HTMLParser import re, html import matplotlib.pyplot as plt import pandas as pd # Declaring global list variables f...
null
assignment1_Personal.py
assignment1_Personal.py
py
19,610
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 26, "usage_type": "call" }, { "api_name": "html.escape", "line_number": 32, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 45, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 49, "us...
97703787
""" ------------ C9300 DBGSYS ------------ """ # Python # ------ import logging import sys from collections import namedtuple # Apollo # ------ import apollo.libs.lib as aplib # BU Specific # ----------- import apollo.scripts.entsw.libs.cat.steps_catalyst as steps_catalyst from .. import steps_nyquist from .. import...
null
cat3/C9300/area_sequences/dbgsys.py
dbgsys.py
py
4,714
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.modules", "line_number": 28, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 29, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 30, "usage_type": "attribute" }, { "api_name": "logging.StreamH...
496014723
from flask import Flask, render_template, request, jsonify, redirect from dotenv import load_dotenv import os, random app = Flask(__name__) # print(os.environ['SECRET']) @app.route('/') def hello(): return 'hello from app' @app.route('/greeting') def greeting(): return render_template('index.html', name='Sarah...
null
app.py
app.py
py
1,096
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 23, "usage_type": "attribute" }, { "api_name": "flask.requ...
648919258
import string import csv from datetime import datetime, timedelta from random import randint import random def write_to_csv(item_list, file_name): with open(f'data/{file_name}.csv', mode='w') as csv_file: writer = csv.DictWriter( csv_file, fieldnames=item_list[0].keys(), quotechar='"', quoting=...
null
getting_started/toy_shop/generate_data.py
generate_data.py
py
3,525
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.DictWriter", "line_number": 9, "usage_type": "call" }, { "api_name": "csv.QUOTE_NONNUMERIC", "line_number": 10, "usage_type": "attribute" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.da...
432635160
#!/usr/bin/env python import os import sys import imp import json import ssl from datetime import date import requests import urllib2 import xmlrpclib from pprint import pprint __author__ = "John Dey" __version__ = "2.0.1" __date__ = "April 3, 2019" __email__ = "jfdey@fredhutch.org" """Versioin 1.x create HTML outpu...
null
easy_annotate.py
easy_annotate.py
py
8,638
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.basename", "line_number": 51, "usage_type": "call" }, { "api_name": "os.path", "line_number": 51, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_number": 52, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
119012325
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
null
plugins/modules/ipblock.py
ipblock.py
py
9,758
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.search", "line_number": 118, "usage_type": "call" }, { "api_name": "ionoscloud.IPBlocksApi", "line_number": 142, "usage_type": "call" }, { "api_name": "ionoscloud.models.IpBlockProperties", "line_number": 164, "usage_type": "call" }, { "api_name"...
128813198
from __future__ import division, print_function import numpy as np from scipy.stats import norm class SIR_agent_based_model: """ functions: normal_alpha_syn_growth_region: growth of normal alpha-syn in regions normal_alpha_syn_growth_edge: mobility patterns of normal alpha-syn in edges ...
null
PD_models.py
PD_models.py
py
18,283
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.int", "line_number": 38, "usage_type": "attribute" }, { "api_name": "numpy.empty", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.int", "line_number":...
131618716
from importlib import import_module ########### # METHODS # ########### SHA = 'SHA' _hash_methods = [SHA] ######### # MODES # ######### _cipher_modes = [] for method in _hash_methods: method_name = '.'.join(('Crypter', 'Hash', method)) modes = getattr(import_module(method_name), '_modes') _cipher_modes...
null
crypter/Hash/__init__.py
__init__.py
py
334
python
en
code
null
code-starcoder2
76
[ { "api_name": "importlib.import_module", "line_number": 18, "usage_type": "call" } ]
590118108
# uncompyle6 version 3.7.4 # Python bytecode 2.5 (62131) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.linux-i686/egg/simplesite/controllers/comment.py # Compiled at: 2008-11-08 10:05:38 import logging from pylons import request, response, session, tmp...
null
pycfiles/SimpleSite-0.3.0-py2.5/comment.py
comment.py
py
4,096
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "formencode.Schema", "line_number": 19, "usage_type": "attribute" }, { "api_name": "formencode.validators.String", "line_number": 22, "usage_type": "call" }, { "api_name": ...
373672614
from django.urls import include, path, reverse_lazy from django.contrib.auth import views as auth_views from .views import RegisterView, verify app_name = 'accounts' urlpatterns = [ path('login/', auth_views.LoginView.as_view(), name='login'), path('logout/', auth_views.LogoutView.as_view(), name='logout'), ...
null
Proga/homework08-elevennote/src/accounts/urls.py
urls.py
py
497
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.auth.views.LoginView.as_view", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.auth.views.LoginView", "line_number": 8, "usage_type": "attribu...
296578729
import read import pandas as pd import collections if __name__ == "__main__": data = read.load_data() s = "" for headline in data['headline']: s += str(headline).lower() s += " " headlines_split = s.split() c = collections.Counter(headlines_split) top_100 = c.most_common(100) print (top_100)
null
count.py
count.py
py
305
python
en
code
null
code-starcoder2
76
[ { "api_name": "read.load_data", "line_number": 6, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 12, "usage_type": "call" } ]
154498047
from SPARQLWrapper import SPARQLWrapper, JSON sparql = SPARQLWrapper("http://agrold.southgreen.fr/sparql") sparql.setQuery(""" PREFIX uri:<http://www.southgreen.fr/agrold/resource/Zm00001d042213> PREFIX agrold:<http://www.southgreen.fr/agrold/vocabulary/> SELECT ?property ?hasValue ?isValueOf WHERE { { uri:...
null
agrold-ver2/demo.py
demo.py
py
713
python
en
code
null
code-starcoder2
76
[ { "api_name": "SPARQLWrapper.SPARQLWrapper", "line_number": 3, "usage_type": "call" }, { "api_name": "SPARQLWrapper.JSON", "line_number": 14, "usage_type": "argument" } ]
372244264
#用机器学习算法预测用户的性别 import numpy as np import pandas as pd import sklearn as sk from matplotlib import pyplot as plt from pymongo import MongoClient from hupu.analisys.config import enviroment from sklearn.linear_model import LogisticRegressionCV,LinearRegression, LogisticRegression from sklearn.ensemble import RandomFore...
null
src/tasks/hupu/job/gender/1.0/predictGenderInc_v2_lstm.py
predictGenderInc_v2_lstm.py
py
14,100
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymongo.MongoClient", "line_number": 38, "usage_type": "call" }, { "api_name": "hupu.analisys.config.enviroment.MONGO_IP", "line_number": 38, "usage_type": "attribute" }, { "api_name": "hupu.analisys.config.enviroment", "line_number": 38, "usage_type": "nam...
250934522
import random import numpy as np import os import cv2 import fitz from tqdm import tqdm from scipy.ndimage import filters from reportlab.lib.styles import getSampleStyleSheet from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont pdfmetrics.registerFont(TTFont('song','C:\\Users\\junbo\\De...
null
machine learning/Ocr/pdfgen.py
pdfgen.py
py
4,323
python
en
code
null
code-starcoder2
76
[ { "api_name": "reportlab.pdfbase.pdfmetrics.registerFont", "line_number": 11, "usage_type": "call" }, { "api_name": "reportlab.pdfbase.pdfmetrics", "line_number": 11, "usage_type": "name" }, { "api_name": "reportlab.pdfbase.ttfonts.TTFont", "line_number": 11, "usage_type"...
353983084
import numpy as np import cv2 from getColourChannels import getColourChannels def rgb2grays(input_image): new_image=np.array(input_image) c = getColourChannels(new_image) new_image = np.empty((input_image.shape[0],input_image.shape[1],4), dtype=np.float32) # converts an RGB into grayscale by us...
null
lab1/colourspace/rgbConversions.py
rgbConversions.py
py
1,833
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "getColourChannels.getColourChannels", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.float3...
260131319
#! /usr/bin/env python # coding=utf-8 #################################################### # Author : longbin # Created date: 2018-04-15 13:54:34 #################################################### import os import json if os.path.dirname(__file__): cur_dir = os.path.dirname(__file__) + '/' else: cur_di...
null
toolkit/bin/lk/dbinit.py
dbinit.py
py
2,107
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
165694466
import json import unittest from datetime import datetime from cartolafc.models import Liga from cartolafc.util import json_default class ApiAttemptsTest(unittest.TestCase): with open('tests/testdata/liga.json', 'rb') as f: LIGA = f.read().decode('utf8') def test_json_default_datetime(self): ...
null
tests/test_utils.py
test_utils.py
py
759
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "call" }, { "api_name": "cartolafc.util.json_default", "line_number": 23, "usage_type": "call" }, { "api_name": "c...