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
172844830
import torch from torch import nn class Generator(torch.nn.Module): def __init__(self, channels): super().__init__() # Filters [1024, 512, 256] # Input_dim = 100 # Output_dim = C (number of channels) self.main_module = nn.Sequential( # Z latent vector 100 ...
null
models/networks.py
networks.py
py
3,132
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn.Sequential", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.nn.ConvTranspose2d", ...
450447939
import json import numpy import numpy.random from datetime import datetime from datetime import timedelta import next.utils as utils from next.apps.AppDashboard import AppDashboard import cPickle as pickle # import next.database_client.DatabaseAPIHTTP as db # import next.logging_client.LoggerHTTP as ell import seaborn ...
null
apps/PoolBasedBinaryClassification/dashboard/Dashboard.py
Dashboard.py
py
7,703
python
en
code
null
code-starcoder2
76
[ { "api_name": "next.apps.AppDashboard.AppDashboard", "line_number": 20, "usage_type": "name" }, { "api_name": "next.apps.AppDashboard.AppDashboard.__init__", "line_number": 23, "usage_type": "call" }, { "api_name": "next.apps.AppDashboard.AppDashboard", "line_number": 23, ...
209738284
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import seaborn as sns sns.set() rent_income = 10 move_cost = 2 discount = 0.9 MAX_CAR_GARAGE = 20 MAX_CAR_MOVE = 5 lambda_rent = [3, 4] lambda_return = [3, 2] accurate = 1e-6 Tp = np.zeros((2, 21, 21)) R = np.zeros((2, 21)) ...
null
jackCarRental.py
jackCarRental.py
py
4,681
python
en
code
null
code-starcoder2
76
[ { "api_name": "seaborn.set", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 22,...
491620154
import sqlite3 as lite import os import chardet import json import sqlite3 as lite from util_kb import get_cand_info_by_mention, get_text_info_for_entity from basic_ops_sqlite import test_select_by_cursor from util_tb import get_table_content, is_measure_col from constants import base_dir, cache_dir, lite_db_na...
null
utils/util_cache.py
util_cache.py
py
9,039
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "constants.cache_dir", "line_number": 14, "usage_type": "argument" }, { "api_name": "constants.lite_db_name", "line_number": 14, "usage_type": "argument" }, { "api_name": "os.pa...
382404909
import collections from . import piece from . import power from . import circle __author__ = 'Hugo' class SpadeError(Exception): pass class TownRequiredError(Exception): pass Cost = collections.namedtuple("Cost", ["workers", "coins", "power", "vp"]) class AbstractPlayer(object): def __init__(self, ...
null
src/player.py
player.py
py
4,992
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 17, "usage_type": "call" } ]
494292264
from __future__ import absolute_import from __future__ import division from __future__ import print_function from datetime import datetime import os import random import sys import threading import numpy as np import tensorflow as tf from PIL import Image def imgshow(image): """Show the image from array Args:...
null
code/1.0/TFRecord/img2tfrecord1.py
img2tfrecord1.py
py
5,491
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.fromarray", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.asarray", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image.fromarray", ...
214741353
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2017 Kaede Hoshikawa # # 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 ...
null
Python/lab14/venv/Lib/site-packages/sketchbook/finders.py
finders.py
py
6,590
python
en
code
null
code-starcoder2
76
[ { "api_name": "abc.ABC", "line_number": 33, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 46, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 48, "usage_type": "name" }, { "api_name": "asyncio.Lock", "line_num...
559631870
import os import cv2 from tensorflow.keras.preprocessing.image import img_to_array from tensorflow.keras.preprocessing.image import load_img from tensorflow.keras.applications.resnet50 import preprocess_input import numpy as np import pandas as pd import json from pandas import json_normalize import time def get_data(...
null
src/data_preparation.py
data_preparation.py
py
5,963
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 20, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 24, "usage_type": "call" }, { "api_name": "tensorflow.keras.preprocessing.image.load_img", "line_number": 30, "usage_type": "call" }, { "api_name": "t...
48406596
''' This file reads in ASC files which contain topographic data for small areas. It reads them in and merges them to produce one topographic file for a large Northern region. This file is then masked to contain only grid cells in either the Northern region area or the Leeds-at-centre area. This is thenn plotted and sav...
null
CreateSpatialPlots/PlotTopographyRaster.py
PlotTopographyRaster.py
py
5,427
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 24, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.path.insert", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 30, ...
243427427
#!/usr/bin/python # encoding: utf-8 import math import numpy import scipy import scipy.signal import matplotlib.pyplot as plt ''' Do best matching of bits from the `to_cmp` buffer to the one in `orig` buffer If it's close to 50%, it means that result is basically random ''' def match_bits(orig, to_cmp): n...
null
bit_matcher.py
bit_matcher.py
py
1,481
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 42, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot", ...
361204321
# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be use...
null
python/proton/xmlutils.py
xmlutils.py
py
1,920
python
en
code
null
code-starcoder2
76
[ { "api_name": "xml.etree", "line_number": 47, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 48, "usage_type": "call" }, { "api_name": "xml.etree", "line_number": 48, "usage_type": "argument" }, { "api_name": "xml.etree.El...
212911301
import cv2 import numpy as np from matplotlib import pyplot as plt # def shed(image): # 사진 사이즈 조정 def Resizing(img): width = 500 ratio = width / img.shape[1] # width * 사진 너비 = 비율 height = int(ratio * img.shape[0]) # 비율 * 사진 높이 # 비율 유지한 채로 이미지 Resize resize = cv2.resize(img, dsize=(width, height),...
null
Algorithm/Py_Server/shed.py
shed.py
py
1,751
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.resize", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_nu...
121666408
import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.lines as lines import matplotlib.text as text import argparse import sys from matplotlib.backends.backend_pdf import PdfPages from emma.processing.dsp import butter_filter class SampleLineBuilder(): def __init__(self, fs, axis, ...
null
draw_arch_figure.py
draw_arch_figure.py
py
4,127
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.font_manager.FontProperties", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.font_manager", "line_number": 17, "usage_type": "attribute" }, { "api_name": "matplotlib.lines.Line2D", "line_number": 30, "usage_type": "call" }...
214734809
import pytest from copy import deepcopy from requests_mock import ANY from requests.utils import quote from app.va.identifier import IdentifierType from app.va.mpi import ( MpiClient, MpiNonRetryableException, MpiRetryableException, IdentifierNotFound, IncorrectNumberOfIdentifiersException, Mul...
null
tests/app/va/mpi/test_mpi_client.py
test_mpi_client.py
py
10,232
python
en
code
null
code-starcoder2
76
[ { "api_name": "copy.deepcopy", "line_number": 97, "usage_type": "call" }, { "api_name": "tests.app.factories.recipient_idenfier.sample_recipient_identifier", "line_number": 123, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 120, "usage_type": "att...
574476715
""" Network of IF cells - Sustained Activity Cortical network consisting of N=500 EX and IN cells, with 80-20% proportion, and random connectivity The excitatory cells also include a proportion of LTS cells calculate the nb of spikes for each cell -> "numspikes_cx05_LTS500b.dat" calculate spiketimes -> "spiketi...
null
demo_cx-lts/demo_cx05_N=500b_LTS.py
demo_cx05_N=500b_LTS.py
py
13,219
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 45, "usage_type": "attribute" }, { "api_name": "math.sqrt", "line_number": 65, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 65, "usage_type": "name" }, { "api_name": "math.sqrt", "line_number": 66, ...
251512813
# Import from csv demo import sqlite3 # Connect to db, create cursor sqlCon = sqlite3.connect('new.db') cursor = sqlCon.cursor() try: # Insert data cursor.execute("INSERT INTO populations VALUES('New York City', 'NY', 8200000)") cursor.execute("INSERT INTO populations VALUES('San Francisco', 'CA', 80000...
null
sqle.py
sqle.py
py
499
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlite3.OperationalError", "line_number": 17, "usage_type": "attribute" } ]
596180263
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import datetime import json import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.finance as mpf from matplotlib import ticker import matplotlib.dates as mdates from gekkoWrapper import getAvailableDataset, runBacktest, getC...
null
evolution_bayes.py
evolution_bayes.py
py
8,171
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.asarray", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number"...
620079387
from collections import deque import numpy as np # visualise acceleration, gyro, and estimated orientation class DataBuffer(deque): def __init__(self, time_window=1.5): super().__init__([]) self.time_window = time_window def append(self, data): super().append(data) self.truncat...
null
client/src/DataBuffer.py
DataBuffer.py
py
744
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "name" } ]
272304737
from joblib import Parallel, delayed from itertools import zip_longest from datetime import datetime from tqdm import tqdm import requests import json import time import sys SIX = ['phylum', 'class', 'order', 'family', 'genus', 'species'] kingdom=['Eukaryota'] number_of_lines = 25 if len(sys.argv) < 4 else int(sys.arg...
null
BOLD_lineage.py
BOLD_lineage.py
py
2,833
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "json.decoder", "line_number": 33, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 42, "usage_type": "call" }, { "api_name": "requests.get", "line...
483832732
# -*- coding: utf-8 -*- import unittest import os # noqa: F401 import json # noqa: F401 import time from datetime import datetime from distutils.dir_util import copy_tree import requests import inspect import shutil from os import environ try: from ConfigParser import ConfigParser # py2 except: from configp...
null
test/DifferentialExpressionUtils_server_test.py
DifferentialExpressionUtils_server_test.py
py
14,711
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 31, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 31, "usage_type": "name" }, { "api_name": "os.environ.get", ...
392204305
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # Created by thomas on 2015/9/14 # """ description """ from __future__ import unicode_literals import logging import requests import json import unittest import csv import cPickle as pickle from ad_auto_test.users_info import login from ad_auto_test.settings import a...
null
ad_info.py
ad_info.py
py
23,807
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 35, "usage_type": "call" }, { "api_name": "ad_auto_test.settings.ad_url_format.format", "line_number": 56, "usage_type": "call" }, { "api_name": "ad_auto_test.settings.ad_url_format", "line_number": 56, "usage_type": "name...
5147370
from flask import render_template, redirect, url_for, request, abort from models.Usuario import Usuario from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() @app.route("/upload", methods=["GET", "POST"]) def upload_file(): if request.method == "POST": if not "file" in request.files: retu...
null
backend_V2/src/controllers/uploadController.py
uploadController.py
py
2,019
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 10, "usage_type": "name" }, { "api_name": "fl...
127833111
#!/usr/bin/python3 # _*_ coding: UTF-8 _*_ # Note: 文件工具类 import os import datetime from common.edgeconf import EdgeConf class FileUtil: """ 文件工具类 __count_sequence_number:计数下标编号,默认从0开始,累加至999循环 """ __count_sequence_number = 0 @staticmethod def __generate_count_sequence() -> str: ...
null
source/main/core/common/fileutil.py
fileutil.py
py
1,293
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.edgeconf.EdgeConf.get_product_id", "line_number": 36, "usage_type": "call" }, { "api_name": "common.edgeconf.EdgeConf", "line_number": 36, "usage_type": "name" }, { "api_name": "common.edgeconf.EdgeConf.get_edge_id", "line_number": 36, "usage_type": ...
53393995
# Copyright 2016 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
null
validator/tests/unit3/test_scheduler/tests.py
tests.py
py
15,488
python
en
code
null
code-starcoder2
76
[ { "api_name": "hashlib.sha512", "line_number": 34, "usage_type": "call" }, { "api_name": "sawtooth_validator.protobuf.transaction_pb2.TransactionHeader", "line_number": 36, "usage_type": "call" }, { "api_name": "sawtooth_validator.protobuf.transaction_pb2", "line_number": 36,...
279290506
import requests, os, os.path, random from bs4 import BeautifulSoup def get_soup(url): """ 获取网站的soup对象 """ # my_headers = [ # 'Mozilla/5.0 (Windows NT 5.2) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30', # 'Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 F...
null
python/复习/妹子图图片下载.py
妹子图图片下载.py
py
4,200
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 71, "usage_type": "call" }, { "api_name": "os.path.join", "line_...
449441510
import MySQLdb # open connection db = MySQLdb.connect( host="localhost", user='Adm-User', passwd='222', db='services_db', charset="utf8", use_unicode=True ) cursr = db.cursor() cursr.execute('INSERT INTO User (name, age) VALUES (%s, %s);', ('Рылёва', int(20))) db.commit() cursr.execute('SEL...
null
Lab7/services/services/lab5/handle_db.py
handle_db.py
py
574
python
en
code
null
code-starcoder2
76
[ { "api_name": "MySQLdb.connect", "line_number": 5, "usage_type": "call" } ]
385014200
# -*- coding: utf-8 -*- # # File: Contact.py # # Copyright (c) 2012 by CommunesPlone.org # Generator: ArchGenXML Version 2.6 # http://plone.org/products/archgenxml # # GNU General Public License (GPL) # __author__ = """CommunesPlone.org <support@communesplone.be>""" __docformat__ = 'plaintext' from AccessC...
null
src/Products/directory/content/Contact.py
Contact.py
py
6,018
python
en
code
null
code-starcoder2
76
[ { "api_name": "Products.Archetypes.atapi.ImageWidget", "line_number": 144, "usage_type": "call" }, { "api_name": "Products.CMFDynamicViewFTI.browserdefault.BrowserDefaultMixin", "line_number": 168, "usage_type": "name" }, { "api_name": "AccessControl.ClassSecurityInfo", "line...
154103404
# -*- coding: utf-8 -*- """ wrapper for optunity optimisation NOTE ALSO commented out call_log in: C:/Users/s/Anaconda3/Lib/site-packages/optunity/api.py LINE 266 call_dict = dict()######f.call_log.to_dict() BECAUSE call_log fails sometimes with incorrect key don't need the lo...
null
analysis/optimise.py
optimise.py
py
7,784
python
en
code
null
code-starcoder2
76
[ { "api_name": "analysis.runs.Runs", "line_number": 33, "usage_type": "call" }, { "api_name": "time.time", "line_number": 102, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 122, "usage_type": "call" }, { "api_name": "time.time", "line_num...
396823500
from selenium import webdriver import time from selenium.webdriver.common.by import By from selenium.webdriver.common.alert import Alert class AlertHand: def AlertHandles(self): driver=webdriver.Firefox() driver.get("https://learn.letskodeit.com/p/practice") driver.find_element(By.ID,'na...
null
Advance/switchTo/AlertHandles.py
AlertHandles.py
py
768
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.ID", "line_number": 13, "usage_type": "attribute" }, { ...
9498057
"""Recursively walk through PATH and print all files Implementation of os.walk stdlib function """ import os import argparse def walk(path): path = path if os.path.isabs(path) else os.path.abspath(path) files = [] if os.path.isdir(path): for item in os.listdir(path): items = walk(o...
null
walk.py
walk.py
py
753
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.isabs", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_...
343765912
import sqlite3 conn = sqlite3.connect('Prof31.db') c = conn.cursor() class prof3(): def __init__(self): pass def __del__(self): print('destructor') def create_table(self): c.execute("""CREATE TABLE IF NOT EXISTS question3_1 (Question, Val1, Val2, Val3, Val4)""") c.execut...
null
Skipanalinu_leikur/Prof3.py
Prof3.py
py
2,051
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 2, "usage_type": "call" } ]
292161607
from datetime import datetime from flask import jsonify from flask_restful import Resource, request, marshal_with from app.Database.postsControll import get_all_posts from app.Database.addObject import add_object_to_bd from app.REST.constants import request_post_parser, resource_post_fields from app import api from a...
null
app/REST/get_all_postsAPI.py
get_all_postsAPI.py
py
1,066
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask_restful.Resource", "line_number": 13, "usage_type": "name" }, { "api_name": "app.Database.postsControll.get_all_posts", "line_number": 15, "usage_type": "call" }, { "api_name": "flask_restful.request.args", "line_number": 15, "usage_type": "attribute"...
157839138
import scrapy class ExtractUrls(scrapy.Spider): name = "extract" def start_requests(self): urls = ['http://www.geeksforgeeks.org',] for url in urls: yield scrapy.Request(url = url , callback = self.parse) def parse(self,response): title = response.css('title::...
null
extract_urls.py
extract_urls.py
py
673
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 2, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 8, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 20, "usage_type": "call" } ]
537882458
import os import collections import bob.io.base import bob.io.image import bob.io.video import bob.bio.video import pkg_resources from bob.bio.video.test.dummy.database import DummyBioFile from bob.bio.face.test.test_annotators import _assert_bob_ip_facedetect class FailSucessAnnotator(bob.bio.base.annotator.Annotato...
null
bob/bio/video/test/test_annotators.py
test_annotators.py
py
3,421
python
en
code
null
code-starcoder2
76
[ { "api_name": "bob.io.base.bio", "line_number": 12, "usage_type": "attribute" }, { "api_name": "bob.io.base", "line_number": 12, "usage_type": "name" }, { "api_name": "pkg_resources.resource_filename", "line_number": 33, "usage_type": "call" }, { "api_name": "bob....
537207764
#!/usr/bin/env python3 import threading, os, sys, time, signal, argparse, logging, json try: basestring except NameError: basestring = str os.chdir(os.path.dirname(os.path.realpath(__file__))) log = logging.getLogger('tyggbot') import pymysql from kvidata import KVIData from tyggbot import TyggBot def lo...
null
main.py
main.py
py
1,504
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_nu...
494087758
from django.shortcuts import render_to_response from django.http import Http404 from django.contrib.auth.decorators import login_required from pgweb.util.decorators import ssl_required from pgweb.util.contexts import NavContext from pgweb.util.helpers import simple_form from models import ProfessionalService from for...
null
pgweb/profserv/views.py
views.py
py
2,009
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render_to_response", "line_number": 25, "usage_type": "call" }, { "api_name": "pgweb.util.contexts.NavContext", "line_number": 30, "usage_type": "call" }, { "api_name": "django.http.Http404", "line_number": 36, "usage_type": "name" }, {...
556035193
from django.conf.urls import include, url from django.contrib import admin from graphene_django.views import GraphQLView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^accounts/login/', admin.site.login), url(r'^graphql/', GraphQLView.as_view(graphiql=True)), url( r'^taskmanager/', ...
null
talks/graphql-is-comming/example/testproject/urls.py
urls.py
py
389
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": ...
223700680
from logger import * import time import json import schedule import threading from configparser import ConfigParser from queue import Queue from grow_cycle import GrowCycle from data_acquisition.sensor_data import SensorData from data_acquisition.camera_capture import CameraCapture from infrastructure.state import Stat...
null
main.py
main.py
py
14,118
python
en
code
null
code-starcoder2
76
[ { "api_name": "infrastructure.state.State", "line_number": 32, "usage_type": "call" }, { "api_name": "data_acquisition.sensor_data.SensorData", "line_number": 34, "usage_type": "call" }, { "api_name": "data_acquisition.camera_capture.CameraCapture", "line_number": 35, "us...
271784098
from django_tables2 import SingleTableView, RequestConfig from defcdb.models import ( Site, Area, Finds, DC_chronological_system, ResearchEvent, DC_researchevent_institution) from defcdb.models import Interpretation from .filters import ( SiteListFilter, AreaListFilter, FindsListFilter, ResearchEventListFil...
null
browsing/views.py
views.py
py
21,482
python
en
code
null
code-starcoder2
76
[ { "api_name": "django_tables2.SingleTableView", "line_number": 46, "usage_type": "name" }, { "api_name": "django_tables2.RequestConfig", "line_number": 60, "usage_type": "call" }, { "api_name": "defcdb.models.Site", "line_number": 71, "usage_type": "name" }, { "ap...
283073354
#!/usr/bin/python3 import argparse import etElementsVersion class Resistor: pass def main(): parser = argparse.ArgumentParser(description="etElements Resistor") parser.add_argument('-v', dest='voltage', help='Resistor Voltage', type=float) parser.add_argument('-r', dest='value', help='Resistor Valu...
null
resistor.py
resistor.py
py
1,147
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "etElementsVersion.includeversion", "line_number": 17, "usage_type": "call" } ]
451778285
#!/usr/bin/env python3 import datetime import pylxd import requests import time from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) def log(s): now = datetime.datetime.utcnow() print("{} - {}".format(now, s)) def crea...
null
contrib_testing/remote-test.py
remote-test.py
py
1,392
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.packages.urllib3.exceptions.InsecureRequestWarning", "line_number": 11, "usage_type": "argument" }, { "api_name": "requests.packages", "line_number":...
345352004
import pandas as pd import numpy as np from sklearn import model_selection from sklearn import svm from sklearn import preprocessing from sklearn.metrics import confusion_matrix from sklearn.metrics import accuracy_score import matplotlib.pyplot as plt from conf_matrix import func_confusion_matrix import seaborn as sns...
null
Assignments/Final Assignment/WineQualityML/svm.py
svm.py
py
4,220
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 30, "usage_type": "call" }, { "api_name": "sklearn.model_selection", "line_number": 30, "usage_type": "name" }, { "...
209488309
import pytest from tictactoe import Game, GameConfig, Grid, Referee class TestGame: """Tests tictactoe.referee.Game class methods.""" def test_game_initiation(self): """Tests game initiation with example config.""" config = GameConfig('config_example.json') game = Game(config) ...
null
tictactoe/tests/test_game.py
test_game.py
py
1,246
python
en
code
null
code-starcoder2
76
[ { "api_name": "tictactoe.GameConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "tictactoe.Game", "line_number": 12, "usage_type": "call" }, { "api_name": "tictactoe.Grid", "line_number": 15, "usage_type": "argument" }, { "api_name": "tictactoe.Refe...
402403460
import sys import os import argparse from checkpy import downloader from checkpy import tester import shutil import time import pkg_resources def main(): parser = argparse.ArgumentParser( description = """ checkPy: a python testing framework for education. You are running Python version {}.{}.{} and checkp...
null
checkpy/__main__.py
__main__.py
py
2,034
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.version_info", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pkg_resources.get_distribution", "line_number": 17, "usage_type": "call" }, { "api_...
270997568
#!/usr/bin/env python """ Usage: images.py --pin <pin> --user <user> --password <password> [--start-page N] Options: --pin <pin> Pet Portal Account Pin --user <user> Pet Portal User Name --password <password> Pet Portal Password --start-page <N> Start Downloads on page N ...
null
bin/images.py
images.py
py
3,895
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.sub", "line_number": 58, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 68, "usage_type": "call" }, { "api_name": "re.match", "line_number": 121, "usage_type": "call" }, { "api_name": "re.DOTALL", "line_number": 121, ...
423857801
from __future__ import absolute_import from __future__ import division from __future__ import print_function import _init_paths import os import cv2 import torch import numpy as np from PIL import Image, ImageDraw, ImageFont import math from opts import opts from detectors.detector_factory import detector_factory fr...
null
src/demo_zjn.py
demo_zjn.py
py
9,747
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.cuda.set_device", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 26, "usage_type": "attribute" }, { "api_name": "detectors.detector_factory.detector_factory", "line_number": 30, "usage_type": "name" }, { ...
86997076
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> """ oXo-oXo-oXo-oXo-oXo-oXo-oXo """ RasterPath = r'H:\PHD_Thesis\Thesis code\all methods at present\soil heat flux\Ma_SEBAL\output\tiff//G0_2009154_albers_5km_heihesub.tif' ShapefilePath = r'C:\Python33\boundary//heihe_upmiddownstream' OutFolder = r'C:\Python33\outpu...
null
ipynotebooks/LiNaNa/LINANA_batch2.py
LINANA_batch2.py
py
3,502
python
en
code
null
code-starcoder2
76
[ { "api_name": "osgeo.osr.CoordinateTransformation", "line_number": 35, "usage_type": "call" }, { "api_name": "osgeo.osr", "line_number": 35, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 36, "usage_type": "call" }, { "api_name": "osgeo.gdal.O...
251816709
import PySimpleGUI as sg if __name__=='codigos.nuevo_juego': from codigos import configuracion, jugar import json from tkinter import * def ventana(): '''Creación de la ventana de nuevo juego''' try: try: with open("archivos/config.json","r") as archivo: config= json.l...
null
TrabajoFinal/codigos/nuevo_juego.py
nuevo_juego.py
py
2,574
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "PySimpleGUI.Image", "line_number": 16, "usage_type": "call" }, { "api_name": "PySimpleGUI.Image", "line_number": 21, "usage_type": "call" }, { "api_name": "PySimpleGUI.Image", ...
497544876
from jira import JIRA import jira_model import configparser import logging logger = logging.getLogger("jiraLogger") def load_users(): j_config = configparser.ConfigParser() j_config.read('config.ini') username = j_config['jira_config']['username'] secret_token = j_config['jira_config']['secret_token'...
null
get_jira_users.py
get_jira_users.py
py
1,137
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 10, "usage_type": "call" }, { "api_name": "jira.JIRA", "line_number": 17, "usage_type": "call" }, { "api_name": "jira.search_user...
391315882
""" Plot eigen-basis of global LIS subspace in Elliptic inverse problem. Shiwei Lan @ CalTech, 2018 """ import os,pickle import dolfin as df import numpy as np import matplotlib as mp import matplotlib.pyplot as plt from Elliptic_dili import Elliptic import sys sys.path.append( "../" ) from util import matplot4dolfin...
null
RANS/dimension-reduced-geom-infmcmc/elliptic_dili/plot_eigf_LIS.py
plot_eigf_LIS.py
py
1,989
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "util.matplot4dolfin", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random.seed",...
539478419
import logging from django.shortcuts import render, get_object_or_404 from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from django.urls import reverse from django.contrib import messages from django.utils.translation import ugettext_lazy as _ from .models import Ind...
null
apps/accounts/identifier_views.py
identifier_views.py
py
3,801
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 19, "usage_type": "call" }, { "api_name": "django.shortcuts.get_object_or_404", "line_number": 23, "usage_type": "call" }...
427315824
import requests import bs4 import time start_time = time.time() from bs4 import BeautifulSoup r_2 = requests.get('http://www.nemweb.com.au/REPORTS/ARCHIVE/Dispatch_SCADA/') soup = bs4.BeautifulSoup(r_2.text, 'html.parser') links = soup.find_all('a') links_list = [] # create empty list for link in links: links...
null
Carbon_Intensity/Scripts/ArchiveNEMWEBscraper.py
ArchiveNEMWEBscraper.py
py
2,391
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 4, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "time.time", "line_number":...
220203278
""" heritago URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
null
heritago/heritago/urls.py
urls.py
py
1,800
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 22, "usage_type": "call" }, { "api_name": "heritages.views.UserDetail", "line_number": 23, "usage_type": "attribute" }, { "api_name": "heritages.views", "line_number": 23, "usage_type": "name" }, { ...
460278653
from shutil import copyfile import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt from network import NetworkBench from image_handler import ImageHandler import os import numpy as np import time from correspondence_data_loader import CorrespondenceDataLoader, CorrespondenceDataLoad...
null
src/dont_care/segmentation_nn.py
segmentation_nn.py
py
15,585
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "network.NetworkBench", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_n...
272166489
import requests def add_class(name, methods, classes=''): methods = '\n'.join(methods) classes = '\n'.join(classes) x = f'''{classes}\nclass {name}:\n\tdef __init__(self,items):\n\t\tif items:\n\t\t\tself.items=items\n\t\telse:\n\t\t\tself.items=dict()\n\t{methods}''' return x def new_method(name, o...
null
Classify_API.py
Classify_API.py
py
3,978
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 93, "usage_type": "call" } ]
65283246
import json import logging import click import pysolr as pysolr from models.dataset import MultiomicsDataset logger = logging.getLogger('multiomics.pipelines') def print_help(ctx): click.echo(ctx.get_help()) ctx.exit() def pysolr_push(json_object, solr_server): solr = pysolr.Solr(solr_server, timeout...
null
pipelines.py
pipelines.py
py
1,163
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "click.echo", "line_number": 13, "usage_type": "call" }, { "api_name": "pysolr.Solr", "line_number": 18, "usage_type": "call" }, { "api_name": "models.dataset.MultiomicsData...
565122920
import os import log import numpy as np from model import Model from sklearn.neural_network import MLPClassifier from sklearn.model_selection import GridSearchCV from sklearn.metrics import accuracy_score, confusion_matrix, classification_report, roc_curve, auc from joblib import dump, load class MyMLPClassifier(Mode...
null
src/model/mlp_classifier.py
mlp_classifier.py
py
2,154
python
en
code
null
code-starcoder2
76
[ { "api_name": "model.Model", "line_number": 11, "usage_type": "name" }, { "api_name": "sklearn.neural_network.MLPClassifier", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 36, "usage_type": "call" }, { "api_name": "os.pa...
640676300
# -*- coding: utf-8 -*- """ Created on Sat Mar 14 16:03:09 2020 @author: pc """ import numpy as np import pandas as pd import matplotlib.pyplot as plt import datetime import matplotlib.ticker as ticker #%% read data inflation = pd.read_csv('inflation(1).csv') oggdp = pd.read_csv('fredgraph.csv') ...
null
business cycle/results of cycle/cycle.py
cycle.py
py
3,866
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.d...
382058
"""Stock Context Controller""" __docformat__ = "numpy" import argparse import logging import os from datetime import datetime, timedelta from typing import List import financedatabase import yfinance as yf from prompt_toolkit.completion import NestedCompleter from openbb_terminal import feature_flags as obbff from o...
null
openbb_terminal/stocks/stocks_controller.py
stocks_controller.py
py
24,713
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 33, "usage_type": "call" }, { "api_name": "openbb_terminal.parent_classes.StockBaseController", "line_number": 36, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 69, "usage_type": "call" }, { ...
628307166
from openerp import models from openerp.report import report_sxw import datetime from datetime import date, datetime, timedelta import dateutil.parser import time import calendar from ..utility.utils import hour_float_to_time as hftt class report_employee_individual_detail_attendance(report_sxw.rml_parse): _name =...
null
report/emp_individual_detail_attendance_template.py
emp_individual_detail_attendance_template.py
py
18,108
python
en
code
null
code-starcoder2
76
[ { "api_name": "openerp.report.report_sxw.rml_parse", "line_number": 10, "usage_type": "attribute" }, { "api_name": "openerp.report.report_sxw", "line_number": 10, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 31, "usage_type": "call" ...
366636129
"""XML-RPC methods of Gstudio Pingback""" from urllib2 import urlopen from urllib2 import URLError from urllib2 import HTTPError from urlparse import urlsplit from django.contrib import comments from django.utils.html import strip_tags from django.contrib.sites.models import Site from django.core.urlresolvers import r...
null
gstudio/xmlrpc/pingback.py
pingback.py
py
4,645
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.utils.html.strip_tags", "line_number": 32, "usage_type": "call" }, { "api_name": "django.contrib.sites.models.Site.objects.get_current", "line_number": 65, "usage_type": "call" }, { "api_name": "django.contrib.sites.models.Site.objects", "line_number": 6...
395509576
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from alumni_app.forms import (notice_form,events_form,display_alumni_form,placement_companies_form,submit_achievements_form, grant_achievements_form,bca_students_form,bba_students_form,bed_studen...
null
alumni_portal/alumni_app/views.py
views.py
py
12,791
python
en
code
null
code-starcoder2
76
[ { "api_name": "alumni_app.models.slideshow_model.objects.all", "line_number": 21, "usage_type": "call" }, { "api_name": "alumni_app.models.slideshow_model.objects", "line_number": 21, "usage_type": "attribute" }, { "api_name": "alumni_app.models.slideshow_model", "line_number...
527148165
''' Jake Bush bush2jr@mail.uc.edu Assignment 8 IS 4010 Spring 2020 Project shows abilitly to modify a PyDev project in Eclipse to process an existing spreadsheet @author :Bush2jr ''' ''' Created on Mar 20, 2020 Assignment 08 Donor Code Adapted from https://openpyxl.readthedocs.io/en/stable/charts/pie.html...
null
Assignment08/Src/Assignment08.py
Assignment08.py
py
1,252
python
en
code
null
code-starcoder2
76
[ { "api_name": "openpyxl.load_workbook", "line_number": 27, "usage_type": "call" }, { "api_name": "openpyxl.chart.PieChart", "line_number": 30, "usage_type": "call" }, { "api_name": "openpyxl.chart.Reference", "line_number": 31, "usage_type": "call" }, { "api_name"...
278081743
# Wrapper for SVM Handling from sklearn import svm from sklearn.model_selection import GridSearchCV import numpy as np # Possible Open Items: # - make class for easy kernel switching class SVMHandler: def __init__(self, kernel='linear'): if kernel == 'ncc': self.kernel = kernel ...
null
src/SVMHandler.py
SVMHandler.py
py
1,324
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.mean", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 31, ...
192280366
import logging import sys class Model_Logger(object): def __init__(self): self.logger = self.setup_logger() self.log_dict = {} def setup_logger(self): logger = logging.getLogger("base") logger.setLevel(logging.INFO) handler = logging.StreamHandler(sys.stdout) ...
null
old_stuff/code/mlcv_exp_04/src/loggers/model_logger.py
model_logger.py
py
807
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.stdout"...
548676112
# _*_ coding:utf-8 _*_ """ Create on 2017/6/30 下午2:17 @author: han """ import time import pika def on_message(channel, method_frame, header_frame, body): time.sleep(3) channel.basic_ack(delivery_tag=method_frame.delivery_tag) print(body) parameters = pika.URLParameters('ampq://guest:guest@localhost:5...
null
celery_mq/c_s_pika/amqp_consumer.py
amqp_consumer.py
py
899
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 12, "usage_type": "call" }, { "api_name": "pika.URLParameters", "line_number": 17, "usage_type": "call" }, { "api_name": "pika.BlockingConnection", "line_number": 18, "usage_type": "call" } ]
180315041
"""app模块,包含app工厂功能""" import json from flask import Flask, render_template, jsonify, send_from_directory from App import commands from App.extensions import bcrypt, cache, cors, db, migrate, debug_toolbar, apispec # 此处从urls导入是为了restful能正常加载到url设置 from App.urls import blueprint # 导入日志配置 from App.settings import dictCon...
null
App/appFactory.py
appFactory.py
py
5,367
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.send_from_directory", "line_number": 41, "usage_type": "call" }, { "api_name": "App.extensions.bcrypt.init_app", "line_number": 46, "usage_type": "call" }, { "api_name": "...
399095853
""" MIT License Copyright (c) 2016 Emotly Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, pu...
null
emotly/utils.py
utils.py
py
9,438
python
en
code
null
code-starcoder2
76
[ { "api_name": "bcrypt.gensalt", "line_number": 47, "usage_type": "call" }, { "api_name": "emotly.app.config", "line_number": 47, "usage_type": "attribute" }, { "api_name": "emotly.app", "line_number": 47, "usage_type": "name" }, { "api_name": "bcrypt.hashpw", ...
238849913
# %load q04_decision_classifier_plot/build.py # default imports from sklearn.model_selection import RandomizedSearchCV from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score import matplotlib.pyplot as plt import pandas as pd impor...
null
q04_decision_classifier_plot/build.py
build.py
py
1,137
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.switch_backend", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "nu...
336526579
import os import shutil import GetData import tensorflow as tf from model import Model import pickle from numpy import newaxis from utils import Diff from preprocess import get_random_wav,spec_to_batch from preprocess import to_spectrogram, get_magnitude from config import ModelConfig,TrainConfig,CONFIG_...
null
train.py
train.py
py
3,975
python
en
code
null
code-starcoder2
76
[ { "api_name": "GetData.getDSDFilelist", "line_number": 23, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 31, "usage_type": "call" }, { "api_name": "model.Model", "line_number": 34, "usage_type": "call" }, { "api_name": "model.loss", "line...
260175087
# 计算密集型,多进程效率高 from threading import Thread from multiprocessing import Process import time def work(): res=2 for i in range(100000000): res*=i if __name__ == '__main__': start = time.time() l = [] for i in range(4): # p = Thread(target=work) #耗时13.705921411514282 p = Pro...
null
course/进程和线程/线程/GIL测试.py
GIL测试.py
py
531
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 14, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 18, "usage_type": "call" }, { "api_name": "time.time", "line_number": 25, "usage_type": "call" } ]
553714355
from typing import Iterator, List, Set, Tuple from parallelpipe import stage from gfw_pixetl import get_module_logger from gfw_pixetl.layers import VectorSrcLayer from gfw_pixetl.pipes import Pipe from gfw_pixetl.settings.globals import GLOBALS from gfw_pixetl.tiles import Tile, VectorSrcTile LOGGER = get_module_log...
null
gfw_pixetl/pipes/vector_pipe.py
vector_pipe.py
py
2,609
python
en
code
null
code-starcoder2
76
[ { "api_name": "gfw_pixetl.get_module_logger", "line_number": 11, "usage_type": "call" }, { "api_name": "gfw_pixetl.pipes.Pipe", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 17, "usage_type": "name" }, { "api_name": "typin...
159400296
import os import glob import logging from file_lib import AmiPath from bs4 import BeautifulSoup from collections import Counter import nltk, unicodedata import xml.etree.ElementTree as ET import re NFKD = "NFKD" """tags b i em strong table fig """ TAGS = { "\n": "", "</sup>": "", "</sub>": "", "<...
null
physchem/python/text_lib.py
text_lib.py
py
25,794
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_number": 36, "usage_type": "attribute" }, { "api_name": "os.path.normpath", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path.join", "lin...
205347574
import json def _deflate(obj, type_info): """ Recursively deflate an object :param obj: the object to be deflated :param type_info: info describing the nature of the object (not strictly the type in the python sense). :return: a deflated object """ assert (obj is None) \ or (ty...
null
network_cjl/Serializer.py
Serializer.py
py
8,802
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.dumps", "line_number": 217, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 229, "usage_type": "call" } ]
214961947
from apyori import apriori from collections import defaultdict itensCompras = list() itensComprasDict = defaultdict(list) with open("amostra.csv", "r") as f: for line in f: content = f.readline().replace("\n", "").split("\t") if(content[0] != ""): itensComprasDict[content[0]].append(con...
null
gustavo.py
gustavo.py
py
963
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" }, { "api_name": "apyori.apriori", "line_number": 14, "usage_type": "call" } ]
271944550
import grpc import argparse import threading import time import xchange.protos.exchange_pb2_grpc as exchange_grpc import xchange.protos.competitor_registry_pb2 as comp_reg import xchange.protos.data_feed_pb2 as data_feed import xchange.protos.order_book_pb2 as order_book import xchange.protos.competitor_pb2 as compet...
null
example_bot_case1.py
example_bot_case1.py
py
6,705
python
en
code
null
code-starcoder2
76
[ { "api_name": "xchange.competitor_bot.CompetitorBot", "line_number": 23, "usage_type": "name" }, { "api_name": "xchange.competitor_bot.CompetitorBot.__init__", "line_number": 25, "usage_type": "call" }, { "api_name": "xchange.competitor_bot.CompetitorBot", "line_number": 25, ...
262386696
#!/usr/local/bin/python #coding=utf-8 import logging import logging.handlers import sys reload(sys) sys.setdefaultencoding('utf8') #设置系统编码格式 from wechat_sender import * # log 文件日志 LOGFILE = "/home/ubuntu/python_workspace/xiakeliao/xkl/xkl.log" # 实例化Handler handler = logging.handlers.RotatingFileHandler(filename=LOGFIL...
null
XklProject/test/weixin/linux/log.py
log.py
py
1,121
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.setdefaultencoding", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.handlers.RotatingFileHandler", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.handlers", "line_number": 12, "usage_type": "attribute" }, { "...
195634919
# http://villemin.gerard.free.fr/aMaths/Probabil/Poisson.htm # https://www.tutorialspoint.com/python_data_science/python_poisson_distribution.htm # Import des librairies import numpy as np import matplotlib.pyplot as plt from scipy.stats import poisson """ CAS NUMERO 1 Sur ce trajet ferroviaire, nous avons const...
null
04. Lois de probabilités/cas reels d'utilisation/3. Poisson pour prédire le nombre d'accidents de trains.py
3. Poisson pour prédire le nombre d'accidents de trains.py
py
1,244
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.stats.poisson.pmf", "line_number": 22, "usage_type": "call" }, { "api_name": "scipy.stats.poisson", "line_number": 22, "usage_type": "name" }, { "api_name": "scipy.stats.poisson.pmf", "line_number": 38, "usage_type": "call" }, { "api_name": "s...
501833925
import os import xlrd import numpy as np import pandas as pd from nelson_siegel_svensson.calibrate import calibrate_nss_ols dataloc = '/media/souvik/ZCYC' os.chdir(dataloc) filenames = os.listdir(dataloc) # Defining function for making array of maturity and yield from excel def get_array(ws): t = np.array([ws.cel...
null
PRA/VAR_Project/Scraping to R/Excel_Reader_model.py
Excel_Reader_model.py
py
2,069
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 7, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 14, ...
217675359
import matplotlib.pyplot as plt import numpy as np from talib.abstract import * f = open("data/bitmex_XBTUSD_mins1.txt") price = [] price2 = [] price3 = [] price4 = [] bucket_counter = [] volumes = [] time = [] while True: line = f.readline() if line == "": break data = line.replace("\n","").split("...
null
iris_new/irisOrganizeData12.py
irisOrganizeData12.py
py
2,467
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.diff", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 3...
95890009
import requests, sys # Now we import our reusable components from solutions, just in case you don't have your own from DNAC import get_token, api_root_url username = "devnetuser" password = "Cisco123!" api_endpoint = "/network-device" url = api_root_url + api_endpoint headers = { # Define headers here 'conte...
null
Devnet Express/devnet/code/soluciones/18-DNAC-get-network-config.py
18-DNAC-get-network-config.py
py
1,764
python
en
code
null
code-starcoder2
76
[ { "api_name": "DNAC.api_root_url", "line_number": 9, "usage_type": "name" }, { "api_name": "DNAC.get_token", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.exit", "line_num...
543985627
""" config.py Loads a configuration yaml file 'config.yml' in this directory, executes logic on its content and makes its contents available to other modules by importing this module as e.g.: 'import building_age.config as cfg' # show the model currently selected print(cfg.model) """ import ...
null
cat_species_classifier/config.py
config.py
py
2,098
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "call" }, { "api_name": "yaml.SafeLoader.add_constructor", "line_number": 49, "usage_type": "call" }, { "api_name": "yaml.SafeLoader", "line_number": 49, "usage_type": "attribute" }, { "api_name": "pat...
481578918
from __future__ import print_function from builtins import input import json from icalendar import Calendar, Event, vText from icalendar.cal import Component from dateutil import parser as du_parser from dateutil.tz import tzlocal, tzutc import pytz import datetime import getpass import requests import re import sys ...
null
transform.py
transform.py
py
6,248
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.Session", "line_number": 30, "usage_type": "call" }, { "api_name": "re.search", "line_number": 36, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 52, "usage_type": "call" }, { "api_name": "builtins.input", "line_numb...
179480068
"""Custom urls.py for django-registration.""" from django.conf import settings from django.conf.urls import include, url, patterns from django.views.generic import TemplateView from registration.backends.default.views import ( ActivationView, ) from account.forms import EmailRegistrationForm from account.views imp...
null
backends/default/urls.py
urls.py
py
1,480
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 14, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 17, "usage_type": "call" }, { "api_name": "django.views.generic.TemplateView.as_view", "line_number": 18, "usage_type": "call" }, ...
192102711
import numpy as np from numpy import linalg as LA import matplotlib.pyplot as plt import matplotlib.cm as cm from scipy.stats import multivariate_normal from sklearn import svm, linear_model from util import tomML as ml import time # vars c_data_full = np.array([]) # full user data c_datas = [] #...
null
audissey/server/classifier.py
classifier.py
py
23,456
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.random.shuffle", "...
458696237
import os import savu.plugins.utils as pu from savu.data.plugin_list import CitationInformation from scripts.config_generator.content import Content from webservice.apps.process_list import const def find_files_recursive(path, pred): for dirpath, dirnames, filenames in os.walk(path, followlinks=False): ...
null
api/webservice/apps/process_list/utils.py
utils.py
py
3,259
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.walk", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "savu.data.plugin_list.CitationInfor...
254313617
import sys import os import requests from PIL import Image API_URL = 'https://dapi.kakao.com/v2/vision/face/detect' MYAPP_KEY = 'cf2e6be05d472f52d98fe597730f279a' class mosaicer: def __init__(self): self.headers = {'Authorization': 'KakaoAK {}'.format(MYAPP_KEY)} def detect_face(self,filepath): ...
null
mosaicer.py
mosaicer.py
py
1,320
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 28, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number":...
575483041
""" Data normalizer """ __author__ = 'Andreas Kaufmann, Jona Braun, Sarah Morillo' __email__ = "ankaufmann@student.ethz.ch, jonbraun@student.ethz.ch, sleonardo@student.ethz.ch" import pandas as pd from sklearn.preprocessing import StandardScaler, MinMaxScaler, RobustScaler from logcreator.logcreator import Logcreato...
null
source/normalizer.py
normalizer.py
py
1,940
python
en
code
null
code-starcoder2
76
[ { "api_name": "logcreator.logcreator.Logcreator.info", "line_number": 18, "usage_type": "call" }, { "api_name": "logcreator.logcreator.Logcreator", "line_number": 18, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 31, "usage_type": "call" }, ...
449584201
#!/usr/bin/env python3 """Fetches container images from registry and sends them for analysis""" import os import sys import logging import requests __version__ = '0.1' __author__ = 'Akash Parekh <aparekh@redhat.com' IMAGE_REGISTRY = "https://registry.upshift.redhat.com:8443/oapi/v1/projects" API_URL = "http://user-a...
null
app.py
app.py
py
3,264
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.getenv", ...
241145392
from collections import deque, namedtuple import numpy as np import random Experience = namedtuple('Experience', 'state0, action, reward, state1, terminal') def sample_batch_indexes(low, high, size): if high - low >= size: try: r = range(low, high) except NameError: r = ra...
null
memory.py
memory.py
py
2,170
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 6, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random.random_integers", "line_number": 16, "usage_type": "call" }, { "api_name": "nump...
317683680
"""library URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based...
null
library/urls.py
urls.py
py
1,701
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 23, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 23, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 23, "usage_type": "name" }, { "api_name": "...
172447541
import pickle import pandas as pd import numpy as np from sklearn.compose import ColumnTransformer, make_column_selector from sklearn.impute import SimpleImputer from sklearn.pipeline import Pipeline from sklearn.preprocessing import OneHotEncoder, StandardScaler numeric_selector = make_column_selector(dtype_include...
null
tests/fixtures/transform_fit_custom_no_hook.py
transform_fit_custom_no_hook.py
py
2,511
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.compose.make_column_selector", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.number", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sklearn.compose.make_column_selector", "line_number": 12, "usage_type": "call" }...
230671257
# TileCutter translation module import logging, codecs, json, os, re import config config = config.Config() config.save() # Translator is an object which contains a list of all the available translations # as well as storing the currently active translation # translation is an object containing all the information r...
null
translator/translator.py
translator.py
py
9,564
python
en
code
null
code-starcoder2
76
[ { "api_name": "config.Config", "line_number": 5, "usage_type": "call" }, { "api_name": "config.save", "line_number": 6, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_numbe...
150700228
from config import * import json import os import shelve as sh def delete_all(chat_id): with sh.open(shelve_name) as storage: keys = list(storage.keys()) todel = [key for key in keys if str(chat_id) in key] for key in todel: del storage[key] # ------------------SCHEDULE-------...
null
modules/navigation.py
navigation.py
py
8,075
python
en
code
null
code-starcoder2
76
[ { "api_name": "shelve.open", "line_number": 8, "usage_type": "call" }, { "api_name": "shelve.open", "line_number": 17, "usage_type": "call" }, { "api_name": "shelve.open", "line_number": 25, "usage_type": "call" }, { "api_name": "shelve.open", "line_number": 2...
268802632
# 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, software # distributed under t...
null
vitrage/api/controllers/v1/resource.py
resource.py
py
3,561
python
en
code
null
code-starcoder2
76
[ { "api_name": "oslo_log.log.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "oslo_log.log", "line_number": 24, "usage_type": "name" }, { "api_name": "vitrage.api.controllers.rest.RootRestController", "line_number": 29, "usage_type": "name" }, { ...
495541333
import matplotlib.image as mpimg from skimage.feature import hog import numpy as np import cv2 def get_hog_features(img, orient, pix_per_cell, cell_per_block, vis=False, feature_vec=True): # this function is based on the one from the lesson # Call with two outputs if vis==True if vis == True: f...
null
vehicle_features.py
vehicle_features.py
py
9,081
python
en
code
null
code-starcoder2
76
[ { "api_name": "skimage.feature.hog", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_num...
35442701
# Copyright 2020 Google LLC. 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/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
null
tfx/examples/penguin/penguin_pipeline_kubeflow.py
penguin_pipeline_kubeflow.py
py
17,845
python
en
code
null
code-starcoder2
76
[ { "api_name": "absl.flags.DEFINE_bool", "line_number": 26, "usage_type": "call" }, { "api_name": "absl.flags", "line_number": 26, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
316381575
from django.conf.urls import include, url from webms import views app_name = "webms" urlpatterns = [ url(r'^$', views.InviteList.as_view(), name="index"), url(r'^$', views.InviteList.as_view(), name="invites"), url(r'^invites/(?P<pk>[0-9]+)/upd_status/$', views.InviteUpdateStatus.as_view(), name="invite_u...
null
apps/webms/urls.py
urls.py
py
412
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "webms.views.InviteList.as_view", "line_number": 6, "usage_type": "call" }, { "api_name": "webms.views.InviteList", "line_number": 6, "usage_type": "attribute" }, { "api_...
504009063
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Colour Rendering Index ====================== Defines *colour rendering index* computation objects: - :class:`CRI_Specification` - :func:`colour_rendering_index` See Also -------- `Colour Rendering Index IPython Notebook <http://nbviewer.ipython.org/github/colou...
null
colour/quality/cri.py
cri.py
py
7,375
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 50, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 58, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 67, "usage_type": "call" }, { "api_name": "...
58926626
""" Testing of callbacks in non-Python Tabs snippets. """ from pathlib import Path import dash.testing.wait as wait from .helpers import load_jl_app, load_r_app HERE = Path(__file__).parent def test_r_tabs_card(dashr): r_app = load_r_app((HERE.parent / "tabs" / "card.R"), "card") dashr.start_server(r_app) ...
null
docs/components_page/components/__tests__/test_tabs.py
test_tabs.py
py
806
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "helpers.load_r_app", "line_number": 14, "usage_type": "call" }, { "api_name": "helpers.load_jl_app", "line_number": 20, "usage_type": "call" }, { "api_name": "dash.testing.wait...