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
290352937
"""Module for visualizing predictions as heat maps. This module provides tools for creating and visualizing heat maps. The heat map of a given image is created by taking samples from the image, predicting the labels of the samples and assembling the predictions in the heat map. Example ------- Train a neuronal netw...
null
hwdetect/visualization/heat_map.py
heat_map.py
py
11,006
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 67, "usage_type": "call" }, { "api_name": "sampler.RandomGrid", "line_number": 72, "usage_type": "call" }, { "api_name": "interpolation.NearestNeighbour", "line_number": 74, "usage_type": "call" }, { "api_name": "n...
140063126
import os import platform import re from datetime import datetime import constants def nextAccountNumber(): last = max((i for i in constants.acctMap.items() if i[1].isdigit()), key=lambda x: int(x[1])) last = "{:0>6}".format(int(last[1])+1) return last def buildOfficeAllyURL(month, day, year, office=""):...
null
utils.py
utils.py
py
3,089
python
en
code
null
code-starcoder2
83
[ { "api_name": "constants.acctMap.items", "line_number": 9, "usage_type": "call" }, { "api_name": "constants.acctMap", "line_number": 9, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 17, "usage_type": "call" }, { "api_name": "re.compile", ...
627859833
import direct.directbase.DirectStart from direct.gui.OnscreenText import OnscreenText from direct.gui.DirectGui import * from panda3d.core import * #add some text bk_text = "This is my Demo" textObject = OnscreenText(text = bk_text, pos = (0.95,-0.95), scale = 0.07,fg=(1,0.5,0.5,1),align=TextNode.ACenter,mayChange=...
null
testingUserInput.py
testingUserInput.py
py
644
python
en
code
null
code-starcoder2
83
[ { "api_name": "direct.gui.OnscreenText.OnscreenText", "line_number": 8, "usage_type": "call" } ]
120718092
""" Utility functions shared among the mod maker and prior generation code. Compatibility notes: * We have found that Pandas version 0.20 is incompatible with this module. Pandas >= 0.24 works. """ from __future__ import print_function, division import datetime as dt from collections import OrderedDict from date...
null
ginput/common_utils/mod_utils.py
mod_utils.py
py
94,269
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 32, "usage_type": "call" }, { "api_name": "sys.stdout.write", "line_number": 133, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 133, "usage_type": "attribute" }, { "api_name": "sys.stdout.flush", ...
428463715
import numpy as np import matplotlib.pyplot as mp train_x = [0.5,0.6,0.8,1.1,1.4] train_y = [5.0,5.5,6.0,6.8,7.0] #实现梯度下降 times = 1000 lrate = 0.01 w0,w1 = [1],[1]#记录每次梯度下降的参数 for i in range(1,times+1): #每次梯度下降过程需要求出w0与w1的修正值 #球修正值需要推导loss哈市南湖在w0与w1方向的偏岛 d0 = (w0[-1]+w1[-1]*train_x-train_y)*sum() #绘制样本点 ...
null
aid1901/day1/demo3_lr线性回归.py
demo3_lr线性回归.py
py
637
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 18, "usage_type": "call" }, { "api_name": "ma...
435257901
import os import base64 import requests import time from io import BytesIO from PIL import Image class Captcha(): def __init__(self, driver, img_element): self.driver = driver self.img_element = img_element def parse(self): try: img = self.driver.find_element_by_xpath("./...
null
captcha.py
captcha.py
py
2,112
python
en
code
null
code-starcoder2
83
[ { "api_name": "io.BytesIO", "line_number": 20, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 21, "usage_type": "name" }, { "api_name": "base64.b64encode", "line_numb...
150124130
#! -*- coding: utf-8 -*- __author__ = 'Yan.zhe 2021.2.1' # from script_collection.import_share import * from start_the_service.app_instance import * import typing class JointFrameWizardFrameStore(AppStore): """ The frame test, app_type: photo、music、video、alarm、weather、calender、setting、wizard ...
null
jointframe/script_collection/traverse_wizard.py
traverse_wizard.py
py
1,171
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.Optional", "line_number": 16, "usage_type": "attribute" } ]
369694246
import os from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By import re import json uri = "http://www.radiorecord.ru/player/" prefix = "http://air.radiorecord.ru:805/" suffix = "_320" print("Please wait, making Web Scrapping from " + uri) ch...
null
radiorecord_to_json.py
radiorecord_to_json.py
py
1,671
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "o...
303021081
#!/usr/bin/env python # # Author: Thamme Gowda [tg (at) isi (dot) edu] # Created: 2019-11-12 from typing import List, Any, Iterable, Dict, Tuple import collections as coll from nlcodec import log from tqdm import tqdm def make_n_grams(sent: List[Any], n): assert n > 0 return [tuple(sent[i: i + n]) for i in ra...
null
nlcodec/utils.py
utils.py
py
1,325
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Iterable", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.List", "line_number...
219200213
''' 功能: 宿舍代码正确检查 {输入}宿舍代码,网站driver {输出}错误代码,宿舍信息字典,电费信息字典 根据错误代码判断宿舍代码错误类型: err=200:正常,dormDic,elecDic有效 err=201:宿舍代码长度异常,dormDic={},elecDic={} err=202:宿舍区不再服务范围,dormDic={},elecDic={} err=404:电费查询异常,可能打不开网站,也可能是查无此房间,dormDic={},elecDic={} ================================================...
null
H2X/PacooBot/CodeChecker.py
CodeChecker.py
py
4,748
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 146, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 148, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 148, "usage_type": "name" }, ...
558412576
# A perfect power is a classification of positive integers: # # In mathematics, a perfect power is a positive integer that can be expressed as an integer power # of another positive integer. More formally, # n is a perfect power if there exist natural numbers m > 1, and k > 1 such that mk = n. # # Your task is to check...
null
CodersWars/Whats_a_Perfect_Power_anyway.py
Whats_a_Perfect_Power_anyway.py
py
1,326
python
en
code
null
code-starcoder2
83
[ { "api_name": "pip._vendor.msgpack.fallback.xrange", "line_number": 34, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 34, "usage_type": "call" }, { "api_name": "math.log", "line_number": 35, "usage_type": "call" } ]
605219316
from app.dataset import Dataset from app.output import Output from app.segmenter import Segmenter from app.utils import Utils from app.debug import Debug import numpy as np import cv2 dataset = Dataset() dataset.load() segmenter = Segmenter() Output.clear() for item in dataset.items: print(item.file) #i...
null
app/__main__.py
__main__.py
py
1,385
python
en
code
null
code-starcoder2
83
[ { "api_name": "app.dataset.Dataset", "line_number": 9, "usage_type": "call" }, { "api_name": "app.segmenter.Segmenter", "line_number": 12, "usage_type": "call" }, { "api_name": "app.output.Output.clear", "line_number": 14, "usage_type": "call" }, { "api_name": "ap...
328345788
"""PyTorch implementation of a ResNet with 2D CNNs Reference: [1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun Identity Mappings in Deep Residual Networks. arXiv:1603.05027 """ import math import torch import torch.nn as nn import torch.nn.functional as F class ResBlock2D(nn.Module): """A basic residual ...
null
src/layers/ResNet2D.py
ResNet2D.py
py
5,909
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.nn.functional.relu", "line_number": 27, "usage_type": "attribute" }, { "api_name": "torch.nn....
325983612
"""An execution engine for Python processes.""" import copy import inspect import json import os import shlex import shutil from resolwe.flow.execution_engines.base import BaseExecutionEngine from resolwe.flow.models.utils import ( get_collection_of_input_entities, hydrate_input_references, hydrate_input_u...
null
resolwe/flow/execution_engines/python/__init__.py
__init__.py
py
5,492
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2...
617140442
# Q: will the model be able to predict single traits at a time better than all 5 traits at the same time? # train models on each trait # only for face and bg. NOT all import chainer import numpy as np from deepimpression2.model_59 import Deepimpression import deepimpression2.constants as C from chainer.functions impor...
null
training_single_trait_f_bg.py
training_single_trait_f_bg.py
py
6,954
python
en
code
null
code-starcoder2
83
[ { "api_name": "deepimpression2.model_59.Deepimpression", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "dee...
187405588
from datetime import timedelta from django.contrib import admin from django.utils import timezone class LastTestFilter(admin.SimpleListFilter): title = 'last test' parameter_name = 'last' def lookups(self, request, model_admin): return ( ('T', 'Today'), ('W', 'Last 7 days...
null
v6score/filter.py
filter.py
py
3,784
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.admin.SimpleListFilter", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.utils.timezone.now", "line_number": 22, "usage_type": "call" }, ...
198766481
import sys, warnings import tweepy from tw_auth import access_token_key, access_token_secret, consumer_key, consumer_secret warnings.simplefilter ( 'ignore' ) auth = tweepy.OAuthHandler ( consumer_key, consumer_secret ) auth.set_access_token( access_token_key, access_token_secret ) api = tweepy.API ( auth ) tweet = ...
null
tweet_twitter.py
tweet_twitter.py
py
503
python
en
code
null
code-starcoder2
83
[ { "api_name": "warnings.simplefilter", "line_number": 6, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 7, "usage_type": "call" }, { "api_name": "tw_auth.consumer_key", "line_number": 7, "usage_type": "argument" }, { "api_name": "tw_au...
615110955
import numpy as np from sklearn.cluster import KMeans import math import time nodesfile = open("dataset/cal.cnode","r") edgesfile = open("dataset/cal.cedge","r") nodes = [] edges = [] for node in nodesfile: nodes.append(node.split()) for edge in edgesfile: edges.append(edge.split()) newnodes = open("dataset/newc...
null
main_with_kmeans_clustering.py
main_with_kmeans_clustering.py
py
4,034
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 58, "usage_type": "call" }, { "api_name": "sklearn.cluster.KMeans", "line_number": 62, "usage_type": "call" }, { "api_name": "numpy.where", "line_...
107888745
from django.urls import path from ordermanager.views import OrderView, PartnerOrders, BasketView app_name = 'ordermanager' urlpatterns = [ path('partner/orders', PartnerOrders.as_view(), name='partner-orders'), path('order', OrderView.as_view(), name='order'), path('basket', BasketView.as_view(), name='...
null
ordermanager/urls.py
urls.py
py
332
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "ordermanager.views.PartnerOrders.as_view", "line_number": 9, "usage_type": "call" }, { "api_name": "ordermanager.views.PartnerOrders", "line_number": 9, "usage_type": "name" }, ...
568578492
import torch import random import os import csv import itertools import typing import numpy as np def list_dir(root: str, prefix: bool = False) -> typing.List[str]: """List all directories at a given root Args: root (str): Path to directory whose folders need to be listed prefix (bool, optional...
null
_utils.py
_utils.py
py
6,821
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.expanduser", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_...
521377830
import sys import time import traceback from django import db from common import constants, logging_util from daemons.Daemon3 import Daemon class ExampleDaemon3(Daemon): def __init__(self, pidfile): super().__init__(pidfile=pidfile) self._daemon_name = "ExampleDaemon3" self._logger = lo...
null
daemons/example/ExampleDaemon3.py
ExampleDaemon3.py
py
1,666
python
en
code
null
code-starcoder2
83
[ { "api_name": "daemons.Daemon3.Daemon", "line_number": 11, "usage_type": "name" }, { "api_name": "common.logging_util.get_logger", "line_number": 16, "usage_type": "call" }, { "api_name": "common.logging_util", "line_number": 16, "usage_type": "name" }, { "api_nam...
448236936
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Feb 13 12:10:30 2020 @author: parag.patil """ import pdftotext import sys import os pwd=os.getcwd() from pdf2image import convert_from_path import ocrmypdf import PIL def extract_text(pdf_file,output_path): try: ...
null
pdf_to_text_conversion_OCR_eng_PP_20200213.py
pdf_to_text_conversion_OCR_eng_PP_20200213.py
py
2,450
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.getcwd", "line_number": 14, "usage_type": "call" }, { "api_name": "pdf2image.convert_from_path", "line_number": 33, "usage_type": "call" }, { "api_name": "ocrmypdf.ocr", "line_number": 38, "usage_type": "call" }, { "api_name": "pdftotext.PDF", ...
597790394
import os import time from gpiozero import Buzzer buzzer = Buzzer(22) def dot(): buzzer.on() time.sleep(0.1) buzzer.off() time.sleep(0.2) def dash(): buzzer.on() time.sleep(0.3) buzzer.off() time.sleep(0.1) def letterSpace(): time.sleep(0.2) def wordSpace(): time.sleep(0.6) def morseS(): dot() dot() ...
null
buzzer/buzzer.py
buzzer.py
py
632
python
en
code
null
code-starcoder2
83
[ { "api_name": "gpiozero.Buzzer", "line_number": 5, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 9, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 11, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 1...
338873798
import itertools a = [i for i in range(0,100)] b = [i for i in range(0,100)] # result contains all possible combinations. combinations = list(itertools.product(a,b)) OPCODE_ADD = 1 OPCODE_MULTIPLY = 2 OPCODE_HALT = 99 def search_pair(positions, target): combo = 0 while combo < len(combinations): cur ...
null
day2/day2.py
day2.py
py
1,466
python
en
code
null
code-starcoder2
83
[ { "api_name": "itertools.product", "line_number": 6, "usage_type": "call" } ]
191856066
#!/usr/bin/env python #=============================================================================== # WriteFileInvMgr # # Description: # Script to ... # # Print and FileWrite flags defaults can be changed in the main method # # Version: # MM.mm DD/MM/YY # 00.00 01/12/17 First version (combined script...
null
src/WriteFileInvMgr.py
WriteFileInvMgr.py
py
4,187
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.dump", "line_number": 66, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 81, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 81, "usage_type": "name" }, { "api_name": "datetime.date.today...
384401339
import psycopg2 as pg from StockDataWriter.infrastructure.StockDataQuery import PgStockQuery class PostgresStockData: cursor = None conn = None def connect_db(self, host, database, user): """ postgres db에 접속한고 cursor를 할당한다 """ self.conn = pg.connect(host=host, database=da...
null
StockDataWriter/repository/PostgresStockData.py
PostgresStockData.py
py
1,885
python
en
code
null
code-starcoder2
83
[ { "api_name": "psycopg2.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "StockDataWriter.infrastructure.StockDataQuery.PgStockQuery.save_item_code", "line_number": 18, "usage_type": "call" }, { "api_name": "StockDataWriter.infrastructure.StockDataQuery.PgStockQ...
423721455
from torch_geometric.data import DataLoader from ocpmodels.common.registry import registry from ocpmodels.datasets.base import BaseDataset @registry.register_dataset("iso17") class ISO17(BaseDataset): def __init__(self, config, transform=None, pre_transform=None): super(ISO17, self).__init__(config, tran...
null
ocpmodels/datasets/iso17.py
iso17.py
py
1,472
python
en
code
null
code-starcoder2
83
[ { "api_name": "ocpmodels.datasets.base.BaseDataset", "line_number": 8, "usage_type": "name" }, { "api_name": "torch_geometric.data.DataLoader", "line_number": 30, "usage_type": "call" }, { "api_name": "torch_geometric.data.DataLoader", "line_number": 35, "usage_type": "ca...
637050141
#! /usr/bin/env python3 # -*- coding: utf-8 -*- """ The Support Vector Regression test for Features 2. Using StandardScaler instead of MinMaxScaler. Auto adjusting 3 parameters together. Using features 2. Logging y TWICE. Version 2.3.2 Last Modified at """ ### Import modules ### import os dir_sep_symbol = '\\' ...
null
SVR/backup/models/StandardScaler/SVR_v2.3.2.py
SVR_v2.3.2.py
py
16,675
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.name", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.split", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_...
100708399
from collections import deque """ 1. We add indices of array elements in the deque. We can add both the element and its index but its better to add just the index for better space complexity 2. We keep only those indices in the list which are part of the current window size 3. We keep only useful indices i...
null
karumanchi/Queues/sliding_window.py
sliding_window.py
py
1,453
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.deque", "line_number": 19, "usage_type": "call" } ]
346556365
import numpy as np from sklearn import preprocessing, neighbors, svm from sklearn.model_selection import train_test_split import pandas as pd df = pd.read_csv('breast-cancer-wisconsin.data') df.replace('?',-99999,inplace=True) # if we include id label, then we are almost at coin-flipping status # because it is the mo...
null
Kernels/soft_margin_svm_training.py
soft_margin_svm_training.py
py
2,109
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_...
289573296
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.j...
null
src/python/pants/backend/jvm/targets/java_library.py
java_library.py
py
1,523
python
en
code
null
code-starcoder2
83
[ { "api_name": "pants.backend.jvm.targets.exportable_jvm_library.ExportableJvmLibrary", "line_number": 12, "usage_type": "name" }, { "api_name": "pants.backend.jvm.targets.junit_tests.JUnitTests.java_test_globs", "line_number": 25, "usage_type": "attribute" }, { "api_name": "pants...
442259758
# -*- coding: utf-8 -*- """ Created on Fri Oct 25 11:04:34 2019 @author: Shihan Li plot the geographic distribution of average precipitation (1850-1980 AD) """ #import packages import cmocean import numpy as np import matplotlib.pyplot as plt import cartopy.crs as ccrs from cartopy.mpl.ticker import LongitudeFormatter...
null
scripts/f8_prect_ave_1850_1980.py
f8_prect_ave_1850_1980.py
py
4,557
python
en
code
null
code-starcoder2
83
[ { "api_name": "netCDF4.Dataset", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number...
604344337
""" Web runtime based on Selenium. Selenium is a Python library to automate browsers. """ import os import logging from .common import WebRuntime class SeleniumRuntime(WebRuntime): """ Web runtime based on Selenium. """ def _launch(self): # Get url and browser type url =...
null
flexx/webruntime/selenium.py
selenium.py
py
2,160
python
en
code
null
code-starcoder2
83
[ { "api_name": "common.WebRuntime", "line_number": 13, "usage_type": "name" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 33, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 33, "usage_type": "name" }, { "api_name": "selen...
305991789
#! /usr/bin/env python # Copyright 2019 Peter Williams # Licensed under the MIT License """Plot smoothed contours to see how well our algorithm works. This uses `omegaplot`, a plotting package used by Peter Williams and pretty much nobody else. Sorry. """ # note: Python 2.x compat not tested from __future__ import ...
null
bootstrap/check-smoothing.py
check-smoothing.py
py
1,222
python
en
code
null
code-starcoder2
83
[ { "api_name": "omega.makeDisplayPager", "line_number": 22, "usage_type": "call" }, { "api_name": "postprocess.get_events", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.array...
418204519
import os import numpy as np import json import glob import torch import viz import utils from imagenet1000_clsid_to_human import clsid_to_human from explainers import forward from create_explainer import get_explainer from preprocess import get_preprocess, get_normalize_preprocess import copy from collections import ...
null
protected_attack_redo.py
protected_attack_redo.py
py
9,157
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.use", "line_number": 24, "usage_type": "call" }, { "api_name": "torchvision.transforms.Compose", "line_number": 28, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 28, "usage_type": "name" }, { "api_name": "...
184775157
"""Template tags used to sort a queryset. """ from django import template from django.http import Http404 from django.conf import settings register = template.Library() DEFAULT_SORT_UP = getattr(settings, 'DEFAULT_SORT_UP' , '&uarr;') DEFAULT_SORT_DOWN = getattr(settings, 'DEFAULT_SORT_DOWN' , '&darr;') INVALID_FIEL...
null
django_sorting/templatetags/sorting_tags.py
sorting_tags.py
py
6,922
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.template.Library", "line_number": 8, "usage_type": "call" }, { "api_name": "django.template", "line_number": 8, "usage_type": "name" }, { "api_name": "django.conf.settings", "line_number": 10, "usage_type": "argument" }, { "api_name": "django...
467751928
# -*- coding: utf-8 -*- import logging from src.core.util import get_soup from src.exception import InvalidateBoardError logger = logging.getLogger(__name__) class DaumBoard: def __init__(self, board, date): self.date = self.target_date(date) self.board = self.target_board(board) def get_u...
null
src/core/board.py
board.py
py
3,068
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "src.exception.InvalidateBoardError", "line_number": 26, "usage_type": "name" }, { "api_name": "src.core.util.get_soup", "line_number": 33, "usage_type": "call" }, { "api_na...
58251007
from functools import partial import numpy as np import torch from padertorch.contrib.je.modules.augment import ( mel_warping, truncexponential_sampling_fn, log_truncnormal_sampling_fn, log_uniform_sampling_fn, Scale, Mixup, Mask, ) from padertorch.contrib.je.modules.features import MelTransform from padertorc...
null
padertorch/contrib/je/models/tagging.py
tagging.py
py
7,057
python
en
code
null
code-starcoder2
83
[ { "api_name": "padertorch.contrib.je.modules.hybrid.CRNN", "line_number": 18, "usage_type": "name" }, { "api_name": "padertorch.contrib.je.modules.augment.Scale", "line_number": 35, "usage_type": "call" }, { "api_name": "padertorch.contrib.je.modules.augment.log_uniform_sampling_...
499994573
import numpy as np import matplotlib.pyplot as plt from PIL import Image import numpy as np # import plot_matrix import cv2 # # def add_text(dists): # time = 0 # for dist in dists: # time = time + 15 # text = dist, 'km in', time,'mins' # text(0, (.75 *dist), text, fontsize=12) def plot...
null
plot_data.py
plot_data.py
py
2,122
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "matplotlib.pyp...
243074859
import streamlit as st import streamlit.components.v1 as components from PIL import Image def principal(): lgit = """<a href='https://github.com/CartagenaMinas/VentiST' target="_blank">Github</a>""" st.title('CÁLCULO DEL CAUDAL DE AIRE MINA') st.write("") st.write("") col1, col2 = st.columns([2, 2]...
null
menu.py
menu.py
py
2,161
python
en
code
null
code-starcoder2
83
[ { "api_name": "streamlit.title", "line_number": 7, "usage_type": "call" }, { "api_name": "streamlit.write", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.write", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.columns", ...
287406169
#!/usr/bin/env python # -*- coding:utf-8 -*- __author__ = 'MFC' __time__ = '18/6/23 04:24' import requests import json # 测试下Python的兼容性 access_token = "11_4LXEASFtFR4AUJCNWyEcQ2-7cl3qgFmMnc4RU3ZjSWyOjGSj7i0b1Eksj37QF48S4zR12WSeCJWomA7r49z12EhP15_1ZPo2-kUqttZmbwr-zWXHK5s6wdGlFRbshDqTa70z1nKfqAFPpDvFLREiAHAPVI" url = ...
null
dev_draft/wechat_api_test/custom_reply_request.py
custom_reply_request.py
py
1,272
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.dumps", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 37, "usage_type": "call" } ]
383178204
from urllib.request import urlopen from shutil import copyfileobj, copyfile from tempfile import NamedTemporaryFile import os def fetch_file(url, outfile): try: with urlopen(url) as fsrc, NamedTemporaryFile(delete=False) as fdst: copyfileobj(fsrc, fdst) print(fdst.name) cop...
null
moduler/download_file.py
download_file.py
py
456
python
en
code
null
code-starcoder2
83
[ { "api_name": "urllib.request.urlopen", "line_number": 9, "usage_type": "call" }, { "api_name": "tempfile.NamedTemporaryFile", "line_number": 9, "usage_type": "call" }, { "api_name": "shutil.copyfileobj", "line_number": 10, "usage_type": "call" }, { "api_name": "s...
637704243
# import matplotlib.pyplot as plt from datetime import datetime, timedelta, time def str2datetime(this_str): year = int(this_str[:4]) month = int(this_str[4:6]) day = int(this_str[6:8]) hour = int(this_str[9:11]) minute = int(this_str[11:13]) second = int(this_str[13:15]) return datetime(year, month, day, hour...
null
stat_arbi/tmp.py
tmp.py
py
572
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib...
191678748
from pathlib import Path import pytest import numpy as np import pandas as pd import rpy2.robjects as ro from rpy2.robjects.conversion import localconverter from rpy2.robjects import pandas2ri from multiplier import MultiplierProjection def read_rds(test_case_number: int, kind: str): """Reads a test case data ...
null
tests/test_multiplier.py
test_multiplier.py
py
2,179
python
en
code
null
code-starcoder2
83
[ { "api_name": "rpy2.robjects.r", "line_number": 21, "usage_type": "attribute" }, { "api_name": "rpy2.robjects", "line_number": 21, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 23, "usage_type": "call" }, { "api_name": "rpy2.robjects.convers...
215727216
#!/usr/bin/python # -*- coding: utf-8 -*- from django.shortcuts import render, render_to_response from datetime import datetime from base_api.full_views.helper import get_request_param_as_string from base_api.models import * from base_api.form import * from django.http import * from django.contrib.auth import authentic...
null
base_api/full_views/company_views.py
company_views.py
py
4,721
python
en
code
null
code-starcoder2
83
[ { "api_name": "base_api.full_views.helper.get_request_param_as_string", "line_number": 23, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 62, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 108, "usage_type"...
250564316
from solver.SymbolPool import * from solver.Tensor import * from solver.LoopStacker import * import pdb import math from amplpy import AMPL import amplpy import time from solver.SolutionWarp import * from joblib import Parallel, delayed class ModfileBuilder: def __init__(self, sympool, idx_list, level_list, bw_lis...
null
TileLoopGenerator/solver/ModGen.py
ModGen.py
py
17,950
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.ceil", "line_number": 152, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 153, "usage_type": "call" }, { "api_name": "joblib.Parallel", "line_number": 234, "usage_type": "call" }, { "api_name": "joblib.delayed", "line_num...
221459793
#!/usr/bin/env python3 import numpy as np from scipy.io import loadmat def load_data(filename, verbose=True): # Loading the data from the E-Coli Matrix and then extracting data for their respective types. print(f"Loading dataset: {filename}...") data = loadmat(filename) x_train_np = data['xTrain'] ...
null
Mid 1/Problem3_Naive Bayes/problem_utils.py
problem_utils.py
py
2,417
python
en
code
null
code-starcoder2
83
[ { "api_name": "scipy.io.loadmat", "line_number": 9, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.unique", "line...
304022528
import networkx as nx import random import numpy as np import walkers.healthState #import Walker #import Virus import structures.locations as l import matplotlib.pyplot as plt class City(): def __init__(self, nLocations): self.pHome=0.24 self.otherP= (1 - self.pHome) / 4.0 ...
null
City.py
City.py
py
2,461
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.randint", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 25, "usage_type": "attribute" }, { "api_name": "structures.locat...
253821342
# -*- coding: utf-8 -*- """ The ``bot`` module ====================== Use it to init a Tock BOT. :Example: >>> import os >>>> from tock.bot import TockBot >>> TockBot().namespace("my-bot").start_websocket(apikey=os.environ['TOCK_APIKEY']) """ import asyncio import logging from datetime i...
null
tock/bot.py
bot.py
py
4,450
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.Logger", "line_number": 33, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 33, "usage_type": "call" }, { "api_name": "tock.bus.TockBotBus", "line_number": 35, "usage_type": "name" }, { "api_name": "tock.story....
258568137
# -*- coding: utf-8 -*- from hashlib import md5 from random import getrandbits import requests import six from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from requests.exceptions import ConnectionError, ConnectTimeout from config import Config from ..errors import ASServerBusy def generate_ro...
null
python/Flask/RestApiTemplate/api/common/helpers.py
helpers.py
py
3,578
python
en
code
null
code-starcoder2
83
[ { "api_name": "config.Config.EXPIRES_IN", "line_number": 27, "usage_type": "attribute" }, { "api_name": "config.Config", "line_number": 27, "usage_type": "name" }, { "api_name": "hashlib.md5", "line_number": 32, "usage_type": "call" }, { "api_name": "random.getran...
602704683
import cv2 import numpy as np import os import foundation def package_rects_and_weights(rects, weights, scoreThreshold=0.6): result = list() for (rect, score) in zip(rects, weights): if score[0] < scoreThreshold or score[0] > 1.0: continue result.append({ 'score': score...
null
leapvision/scanner.py
scanner.py
py
3,018
python
en
code
null
code-starcoder2
83
[ { "api_name": "foundation.non_max_suppression", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.HOGDescriptor", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.HOGDescriptor_getDefaultPeopleDetector", "line_number": 32, "usage_type": "call" }...
381512108
from collections import deque import numpy as np import pygame import curses from events import * from controllers import * from history import * from views import * from models import * import palette def get_images(square_size, grid_size): SPACE_SIZE = np.array(square_size) W, H = square_size X = pyga...
null
ttt.py
ttt.py
py
3,919
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.Surface", "line_number": 18, "usage_type": "call" }, { "api_name": "pygame.draw.line", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.draw", "line_n...
272917270
#!/usr/bin/env python # @ Params ====================================================================================== load_range = range(30) dt = 0.01 corr_len = 100. avg_intvl = 10 img_slice = ':' two_term = False # sub_bind = False sub_bind = True # @ Main =========================================================...
null
skel/gst/nequip/md/gk/nve/300k/1fs/1-kooi/12x12x3/plot-avg-whole.py
plot-avg-whole.py
py
3,104
python
en
code
null
code-starcoder2
83
[ { "api_name": "ase.units.fs", "line_number": 16, "usage_type": "attribute" }, { "api_name": "ase.units", "line_number": 16, "usage_type": "name" }, { "api_name": "numpy.load", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.load", "line_number"...
481478590
import dapp import datetime import io import textwrap import time import traceback from contextlib import redirect_stdout class Meta(dapp.DiscordPlugin): def __init__(self, bot): super(Meta, self).__init__(bot) self.last_result = None def cleanup_code(self, content): ...
null
plugins/meta.py
meta.py
py
3,834
python
en
code
null
code-starcoder2
83
[ { "api_name": "dapp.DiscordPlugin", "line_number": 12, "usage_type": "attribute" }, { "api_name": "time.perf_counter", "line_number": 25, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 27, "usage_type": "call" }, { "api_name": "dapp.comm...
12974135
import json import unittest2 from google.appengine.ext import testbed from datafeeds.parsers.fms_api.fms_api_event_alliances_parser import FMSAPIEventAlliancesParser class TestFMSAPIEventListParser(unittest2.TestCase): def setUp(self): self.testbed = testbed.Testbed() self.testbed.activate() ...
null
tests/test_fms_api_event_alliances_parser.py
test_fms_api_event_alliances_parser.py
py
1,607
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest2.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "google.appengine.ext.testbed.Testbed", "line_number": 12, "usage_type": "call" }, { "api_name": "google.appengine.ext.testbed", "line_number": 12, "usage_type": "name" }, ...
30784595
""" code related to creating a session """ import typing as t from contextlib import contextmanager from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from utils import get_database_url engine = create_engine(get_database_url(), echo=False, pool_size=10) Session = sessionmaker(bind=engine) ...
null
app/db/session.py
session.py
py
609
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlalchemy.create_engine", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.get_database_url", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.sessionmaker", "line_number": 13, "usage_type": "call" }, { "api_n...
406872957
from django.shortcuts import render from django.views.decorators.csrf import csrf_protect, csrf_exempt # from django.template.context_processors import csrf from hashlib import sha512 import hashlib # Create your views here. def index(request): MERCHANT_KEY = "33y8dMBB" SALT = "HIRqERoClU" PAYU...
null
views.py
views.py
py
3,960
python
en
code
null
code-starcoder2
83
[ { "api_name": "hashlib.sha512", "line_number": 36, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 39, "usage_type": "call" }, { "api_name": "hashlib.sha512", "line_number": 61, "usage_type": "call" }, { "api_name": "django.shortcut...
344787531
import json from django.utils import timezone from django.core.exceptions import ObjectDoesNotExist from django.conf import settings from .models import ProductionTask, MCPriority import atlas.deftcore.api.client as deft _deft_client = deft.Client(settings.DEFT_AUTH_USER, settings.DEFT_AUTH_KEY) # Mapping between ...
null
atlas/prodtask/task_actions.py
task_actions.py
py
8,001
python
en
code
null
code-starcoder2
83
[ { "api_name": "atlas.deftcore.api.client.Client", "line_number": 11, "usage_type": "call" }, { "api_name": "atlas.deftcore.api.client", "line_number": 11, "usage_type": "name" }, { "api_name": "django.conf.settings.DEFT_AUTH_USER", "line_number": 11, "usage_type": "attrib...
134005912
"""The main part of the entigen tool.""" import argparse import re from typing import List, Dict, Optional from .model import Model from .readers.csv import CSVReader from .writers.python import PythonWriter from .writers.info import InfoWriter from .extensible import Extensible # Pattern for parsing argument-defi...
null
entigen/main.py
main.py
py
2,529
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 41, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 41, "usage_type": "name" }, { "api_name": "typing.Dict", ...
440663271
from datetime import datetime, timezone import requests, json, time from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) url = 'https://crst.izmiran.ru/crdt' def obtain_data(station: str, dt_from: datetime, dt_to: datetime, channel:...
null
scripts/data_example.py
data_example.py
py
1,602
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 4, "usage_type": "call" }, { "api_name": "requests.packages.urllib3.exceptions.InsecureRequestWarning", "line_number": 4, "usage_type": "argument" }, { "api_name": "requests.packages", "line_number": 4...
211384546
import csv from sklearn.preprocessing import StandardScaler from prepare_input import prepare_input from prepare_score_rank_data import prepare_score_ranking from train_ann import ann from prepare_data import prepare_data from pandas import DataFrame if __name__ == '__main__': X_columns = ['female ratio', 'tea...
null
main_ann.py
main_ann.py
py
2,071
python
en
code
null
code-starcoder2
83
[ { "api_name": "csv.reader", "line_number": 26, "usage_type": "call" }, { "api_name": "csv.QUOTE_NONE", "line_number": 26, "usage_type": "attribute" }, { "api_name": "csv.reader", "line_number": 31, "usage_type": "call" }, { "api_name": "csv.QUOTE_NONE", "line_...
69941922
''' Cracking The Coding Interview Chapter 8: Recursion/DP/Memoisation Question 8.1: "Triple Step: A child is running up a staircase with n steps and can hop either 1 step, 2 steps, or 3 steps at a time. Implement a method to count how many possible ways the child can run up the stairs." ''' ''' Method1: Recursion ''' d...
null
Interview/Google/tripleSet.py
tripleSet.py
py
1,060
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.defaultdict", "line_number": 26, "usage_type": "call" } ]
282219627
""" * Model : KNeighbors, Gaussian Naive Bayes, * Neural Network model sangat sensitive pada data yg valuenya tidak di scale. * Cross Validation score, menggunakan rata-rata * Cross Validation, menggunakan Startified KFold, variasi dari KFold """ from Models.Classification.ClassifierModel import KNeighborsModel from M...
null
App.py
App.py
py
7,675
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.abspath", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
146338310
import pytest from datetime import date, datetime from analyzers.coverage_stop_areas import AnalyzeCoverageStopAreas import os pytestmark = pytest.mark.usefixtures("spark") path = os.getcwd() + "/tests/fixtures/coverage_stop_areas" date_2017_02_15 = datetime.utcfromtimestamp(1484473662).date() date_2017_02_18 = dateti...
null
tests/coverage_stop_areas_test.py
coverage_stop_areas_test.py
py
3,447
python
en
code
null
code-starcoder2
83
[ { "api_name": "pytest.mark.usefixtures", "line_number": 6, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime.utc...
534135207
import base64 import json import os import requests PROJECT_ID = os.environ['PROJECT_ID'] PUBSUB_VERIFICATION_TOKEN = os.environ['PUBSUB_VERIFICATION_TOKEN'] def tfrecord_caller(data, _): """Background Cloud Function to be triggered by Cloud Storage. This generic function logs relevant data when a file i...
null
cloud_functions/tfrecord_caller/main.py
main.py
py
1,488
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 35, "usage_type": "call" }, { "api_name": "json.dumps", "line_nu...
124852407
from __future__ import print_function __author__ = 'awave' import cv2, sys from helpers import download from matplotlib import pyplot # load the image and convert it to grayscale def open_image(img_name): key = cv2.waitKey(0) esc = 27 if key != esc: image = cv2.imread(img_name) # gray = c...
null
img_test.py
img_test.py
py
1,570
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.waitKey", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "line_...
80054180
from flask import Flask from flask import request from flask import jsonify from flask import send_from_directory from text import sentence_similarity as sentence_similarity_api from speech.analysis import main as analysis_api from speech.emotion import emotion_api from speech.utils import misc import jsonpickle import...
null
web.py
web.py
py
7,018
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 20, "usage_type": "call" }, { "api_name": "redis.ConnectionPool", "line_number": 22, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 29, "usage_type": "attribute" }, { "api_name": "tensorflow_hub.Modul...
359372365
################################################### ### ### ### Complete Experiment on Tasic data ### ### written by Bettina Mieth, Nico Görnitz, ### ### Marina Vidovic and Alex Gutteridge ### ### ### ######################...
null
scripts/experiments/main_wrapper_tasic.py
main_wrapper_tasic.py
py
10,383
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.n...
9629563
# coding: utf-8 #blog/views from django.shortcuts import render from blog.models import Post #from django.views.generic import ListView, DetailView def p_detail_view(request): # v=Nor.objects.all() for the html2 # name = 'Form page' # title = "Test Form" # return render_to_response('test.html', {'name...
null
blog/views.py
views.py
py
948
python
en
code
null
code-starcoder2
83
[ { "api_name": "blog.models.Post.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "blog.models.Post.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "blog.models.Post", "line_number": 14, "usage_type": "name" }, { "api_n...
226358604
""" 实现 mysqldump 、mysqlbackup 、extrabackup 的备份 1、完成对 mysqldump ,mysqlbackup、extrabackup 这三个主流工具的封装 2、以给定实例作为输入,找出所有可用的备份工具 3、备份计划 """ # (c) 2019, LeXing Jiang <neeky@live.com 1721900707@qq.com https://www.sqlpy.com/> # Copyright: (c) 2019, dbm Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu...
null
dbma/backup.py
backup.py
py
28,568
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 33, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 41, "usage_type": "call" }, { "api_name": "subprocess.DEVNULL", "line_number": 44, "usage_type": "attribute" }, { "api_name": "subproces...
214504290
from django.shortcuts import render, redirect from .models import Review from .forms import ReviewForm from django.contrib.auth.decorators import login_required @login_required def list_reviews(request): reviews = Review.objects.all() return render(request, 'reviews/list.html', {'reviews': reviews}) @login_...
null
src/reviews/views.py
views.py
py
1,217
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.Review.objects.all", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Review.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.Review", "line_number": 9, "usage_type": "name" }, { "api_name": "djang...
287842692
import os from setuptools import find_packages, setup from auth_updater import __VERSION__ install_requires = [ #locked 'django>=3.1.1', 'django-celery-beat', 'django-registration', 'celery>=5.0.0rc3', 'gunicorn', 'mysqlclient', 'dnspython', 'passlib', 'requests', 'bcrypt...
null
setup.py
setup.py
py
1,443
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.abspath", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path.join", "line...
500254481
"""Functions to manage os files and Path objects. Intended to be used within a Python 3 environment. Developed by Rodrigo Rivero. https://github.com/rodrigo1392 """ # Flexibility for python 2.x try: import configparser except ImportError: import ConfigParser as configparser try: from pathlib import Path ...
null
pymiscell/filesystem_tools.py
filesystem_tools.py
py
10,920
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 40, "usage_type": "call" }, { "api_name": "ConfigParser.ConfigParser", "line_number": 63, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 77, "usage_type": "call" }, { "api_name": "os.path", ...
27765681
# -*- coding: utf-8 -*- """ Created on Mon Apr 23 14:50:17 2018 @author: Bea """ from sklearn.cluster import KMeans import pandas as pd import numpy as np; np.random.seed(0) import seaborn.apionly as sns import matplotlib.pyplot as plt def ReadingAndColumnSelector (DataIn, sepFile): Data = pd.re...
null
clsuter_MAP.py
clsuter_MAP.py
py
3,103
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.seed", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.DataFrame"...
147134071
# MIT License # # Copyright (c) 2019 Johan Brichau # # 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, mer...
null
src/uPythonDevice/third_party/string.py
string.py
py
1,873
python
en
code
null
code-starcoder2
83
[ { "api_name": "io.StringIO", "line_number": 37, "usage_type": "call" } ]
54681929
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('ProjectShow', '0012_auto_20160806_0857'), ] operations = [ migrations.AlterModelOptions( name='project', ...
null
ProjectShow/migrations/0013_auto_20160806_0902.py
0013_auto_20160806_0902.py
py
670
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterModelOptions", "line_number": 14, "usage_type": "call" ...
588894253
import sys import pickle import logging import datetime from os import path import pandas as pd import numpy as np import xgboost as xgb import seaborn as sns import matplotlib.pyplot as plt from sklearn.svm import SVC from sklearn.impute import SimpleImputer from sklearn.metrics import accuracy_score from sklearn.m...
null
XGBModelV2/XGB_11Feb2020.py
XGB_11Feb2020.py
py
11,690
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 23, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 23, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 23, "usage_type": "attribute" }, { "api_name": "pandas.merge", ...
50254878
# https://github.com/tqdm/tqdm#redirecting-writing import sys import logging from time import sleep import contextlib from tqdm.auto import tqdm class LoggingStreamHandler(logging.StreamHandler): """ tqdm-aware susbstitute for logging's standard stream handler. The default handler writes to stderr, which ...
null
mackelab_toolbox/tqdm.py
tqdm.py
py
1,429
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.StreamHandler", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler.__init__", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 18, "usage_type": "attribute" }, { ...
54227142
import random import copy import os import sys import csv import time import keras import pickle import tensorflow as tf from collections import deque from keras.utils import CustomObjectScope import numpy as np import skimage import gym class NoisyLayer(keras.layers.Layer): def __init__(self, in_shape=(1,2592...
null
Noisy-DQV.py
Noisy-DQV.py
py
19,736
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.layers", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 34, "usage_type": "call" }, { "api_name": "tensorflow.initializers.rando...
383581569
##################################### # CMSSW configuration file - Python # ##################################### import FWCore.ParameterSet.Config as cms import datetime process = cms.Process("USER") ########################### # Basic process controls. # ########################### today = str(datetime.date.today(...
null
RSGraviton/RSAnalyzer/analysis_compoundJetAlgo/rs_compoundJet_cfg.py
rs_compoundJet_cfg.py
py
6,415
python
en
code
null
code-starcoder2
83
[ { "api_name": "FWCore.ParameterSet.Config.Process", "line_number": 8, "usage_type": "call" }, { "api_name": "FWCore.ParameterSet.Config", "line_number": 8, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 13, "usage_type": "call" }, { "a...
270497283
import itertools import os import re import sys import time import requests ACCENT_CHARS = dict(zip('ÂÃÄÀÁÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖŐØŒÙÚÛÜŰÝÞßàáâãäåæçèéêëìíîïðñòóôõöőøœùúûüűýþÿ', itertools.chain('AAAAAA', ['AE'], 'CEEEEIIIIDNOOOOOOO', ['OE'], 'UUUUUY', ['TH', 'ss'], ...
null
utils.py
utils.py
py
3,876
python
en
code
null
code-starcoder2
83
[ { "api_name": "itertools.chain", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 21, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 22, "usage_type": "call" }, { "api_name": "re.sub", "line_number"...
554800548
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sun Jan 21 04:23:44 2018 @author: Traoreabraham """ import numpy as np from multiprocessing import Pool import scipy import sys sys.path.append("..") #sys.path.append("/home/scr/etu/sil821/traorabr/Tensorly/") import tensorly as tl tl.set_backend('numpy'...
null
Toyparametersmeasurement/ParametersmeasurementALTO.py
ParametersmeasurementALTO.py
py
18,924
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tensorly.set_backend", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random.seed"...
343703098
from damselfly.models import cnn1d_complex from damselfly.data import loaders, augmentation from damselfly.utils import train from pathlib import Path import torch.nn as nn import torch import numpy as np #import argparse #parser = argparse.ArgumentParser() #parser.add_argument('--epoch', dest='epoch', action='store...
null
roar/job/deep_filter/220818_train_cnn1d_complex_model_interactive_v1.py
220818_train_cnn1d_complex_model_interactive_v1.py
py
4,172
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path.home", "line_number": 38, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 38, "usage_type": "name" }, { "api_name": "pathlib.Path.home", "line_number": 43, "usage_type": "call" }, { "api_name": "pathlib.Path", "...
80886343
import requests import time import re #删除HTML文档中的标签. #实际功能:将HTMLtext中所有的word删除 def remove(htmltext, word): text = htmltext[:] while text.find(word) != -1: a = text.find(word) text = text[:a]+text[a+len(word):] return text #爬取数据 def catchData(word): #声明请求头,伪装成浏览器 headers = { ...
null
第一节/程序/语文作业预习查词器.py
语文作业预习查词器.py
py
2,026
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "re.search", "line_number": 30, "usage_type": "call" }, { "api_name": "re.DOTALL", "line_number": 31, "usage_type": "attribute" }, { "api_name": "re.search", "line_number": ...
53980940
''' A script will calculate days that fill dividend in this year, if not fill dividend in this year will return -1 ''' import os import json import argparse import numpy as np import pandas as pd import datetime from src.Loader import get_data with open("./config.json") as f: config = json.load(f) def _filter_da...
null
Code/FinMining/fill_div_days.py
fill_div_days.py
py
2,623
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 22, "usage_type": "call" }, { "api_name": "src.Loader.get_data", "line_number": 33, "usage_type": "call" }, { "api_name": "src.Loader.get_data", ...
124146990
import glob import os import pathlib2 import argparse import subprocess as sp __dir__ = pathlib2.Path(__file__).parent def main(path: pathlib2.Path): target_dir = path.parent toc_py = path / 'toc.py' gen_md_py = path / 'generate_readme.py' if toc_py.exists(): print("custom toc.py exists") ...
null
main.py
main.py
py
1,651
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib2.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib2.Path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "subprocess.run", "line_number": 24, "usage_type": "call" }, { "api_name": "subprocess.run", "...
614127568
import time from webbot import Browser from selenium.common.exceptions import NoSuchElementException #%% #open a specific group hangout def open_group_hangout(web, groupName, waitTime1): #get out of any iframes web.driver.switch_to.default_content() #get into conversations iframe iframe_pls=web.dr...
null
Old Files/VirtualVisitas-FirstMultiThreadingUsed/hangout_tools.py
hangout_tools.py
py
5,629
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.sleep", "line_number": 15, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 20, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 36, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 41, ...
619140919
from south.db import db from django.db import models from noc.core.model.fields import PickledField class Migration: def forwards(self): # Model 'Language' db.create_table('main_changesquarantine', ( ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), ...
null
main/migrations/0024_changes_quarantine.py
0024_changes_quarantine.py
py
1,468
python
en
code
null
code-starcoder2
83
[ { "api_name": "south.db.db.create_table", "line_number": 12, "usage_type": "call" }, { "api_name": "south.db.db", "line_number": 12, "usage_type": "name" }, { "api_name": "django.db.models.AutoField", "line_number": 13, "usage_type": "call" }, { "api_name": "djang...
133965056
import xml.etree.ElementTree as ET from broadsoft.requestobjects.datatypes.AccessDevice import AccessDevice class AccessDeviceEndpoint: def __init__(self, device_name='Generic', line_port=None, contact=None, device_level='Group'): self.contact = contact self.device_level = device_level sel...
null
broadsoft/requestobjects/datatypes/AccessDeviceEndpoint.py
AccessDeviceEndpoint.py
py
851
python
en
code
null
code-starcoder2
83
[ { "api_name": "xml.etree.ElementTree.Element", "line_number": 13, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 13, "usage_type": "name" }, { "api_name": "broadsoft.requestobjects.datatypes.AccessDevice.AccessDevice", "line_number": 16, "us...
472190743
import torch import torch.nn as nn import torch.optim as O import torch.nn.functional as F import torchvision from torchvision import datasets, models, transforms import torchvision.transforms as transforms import time import copy import numpy as np import pandas as pd import os from shutil import copyfile import OC...
null
Training_OCR.py
Training_OCR.py
py
10,432
python
en
code
null
code-starcoder2
83
[ { "api_name": "torchvision.transforms.Compose", "line_number": 24, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 24, "usage_type": "name" }, { "api_name": "torchvision.transforms.Resize", "line_number": 24, "usage_type": "call" }, { ...
399510628
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2017/11/16 # @Author : RookieDay # @Site : # @File : neo4j_test # @Github : https://github.com/rookieday # @Software: PyCharm Community Edition # refer http://py2neo.org/2.0/ # by http://python.jobbole.com/84190/ from py2neo import Graph,Node,Relatio...
null
spider_ways/neo4j_test.py
neo4j_test.py
py
1,073
python
en
code
null
code-starcoder2
83
[ { "api_name": "py2neo.Graph", "line_number": 15, "usage_type": "call" }, { "api_name": "py2neo.Node", "line_number": 21, "usage_type": "call" }, { "api_name": "py2neo.Node", "line_number": 22, "usage_type": "call" }, { "api_name": "py2neo.Relationship", "line_...
9436414
from collections import defaultdict from operator import itemgetter, attrgetter, methodcaller from sec30 import * freq = defaultdict(int) for li in lists: for morph in li: freq[morph["surface"]] += 1 ans = sorted(freq.items(), key=lambda t:(t[1],t[0]),reverse=True) for li in ans: print(li[0]+"\t"+st...
null
sec36.py
sec36.py
py
332
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" } ]
478836492
# -*- coding: utf-8 -*- from django.core.urlresolvers import NoReverseMatch, reverse from django.utils.translation import ugettext_lazy as _ from menus.base import NavigationNode from menus.menu_pool import menu_pool from cms.menu_bases import CMSAttachMenu class IconNavigationNode(NavigationNode): def __init...
null
kumo/memberarea/menu.py
menu.py
py
2,001
python
en
code
null
code-starcoder2
83
[ { "api_name": "menus.base.NavigationNode", "line_number": 12, "usage_type": "name" }, { "api_name": "cms.menu_bases.CMSAttachMenu", "line_number": 22, "usage_type": "name" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 25, "usage_type": "call" ...
408438073
from slackbot.bot import respond_to import requests from firebaseint import news_api_key API_KEY = news_api_key() @respond_to('news from (.*)') def news_in(message, source): res = requests.get('https://newsapi.org/v1/articles?source={}&apiKey={}'.format(source, API_KEY)).json() for word in message.body.get('text')...
null
slackbot/plugins/news.py
news.py
py
933
python
en
code
null
code-starcoder2
83
[ { "api_name": "firebaseint.news_api_key", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "slackbot.bot.respond_to", "line_number": 8, "usage_type": "call" }, { "api_name": "requests....
24329900
import os import yaml import time import Logger import Managers from Monitor import Monitor config = None config_filename = 'configuration.yaml' scriptFolder = str(os.path.dirname(os.path.realpath(__file__))) def LoadYAML(): global config with open(os.path.join(scriptFolder, config_filename)) as f: ...
null
main.py
main.py
py
1,770
python
en
code
null
code-starcoder2
83
[ { "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.realpath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "lin...
337901435
# -*- coding: utf-8 -*- import collections import warnings import torch import torch.nn as nn from common.registry import registry class Losses(nn.Module): def __init__(self, loss_list): super().__init__() self.losses = [] self._evaluation_predict = registry.get("config")....
null
modules/losses.py
losses.py
py
3,649
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "common.registry.registry.get", "line_number": 12, "usage_type": "call" }, { "api_name": "common.regis...
648702197
# -*- coding: utf8 -*- from flask import request, session, redirect, url_for, render_template, jsonify, current_app, g import time, random from werkzeug.utils import secure_filename from werkzeug.security import generate_password_hash, check_password_hash from sqlalchemy.orm import sessionmaker from sqlalchemy import d...
null
share/application.py
application.py
py
19,186
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.g.user_name", "line_number": 39, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 39, "usage_type": "name" }, { "api_name": "flask.g.user_email", "line_number": 40, "usage_type": "attribute" }, { "api_name": "flask.g", ...
177159009
import transakcije_io import datetime def napraviTransakciju(sifra, kolicina, smer_transakcije, trenutni_korisnik): transakcije_io.upisiTransakciju(sifra, kolicina, smer_transakcije, trenutni_korisnik) # uzima pocetni i krajnji datum (string formata 'dd.mm.gggg.'), # i opciono kljuc ('magacioner' ili 'sifra') # ...
null
transakcije.py
transakcije.py
py
1,276
python
en
code
null
code-starcoder2
83
[ { "api_name": "transakcije_io.upisiTransakciju", "line_number": 5, "usage_type": "call" }, { "api_name": "transakcije_io.ucitajTransakcije", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 29, "usage_type": "call" },...
644259544
import os import hashlib, uuid SALT = uuid.uuid4().hex basedir = os.path.abspath(os.path.dirname(__file__)) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db') SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository') WTF_CSRF_ENABLED = True SECRET_KEY = 'Alumiboti' POSTS_PER_PAGE = 5
null
config.py
config.py
py
316
python
en
code
null
code-starcoder2
83
[ { "api_name": "uuid.uuid4", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_numb...
126045875
import matplotlib.pyplot as plt import matplotlib.colors as mcolors import numpy as np import netCDF4 as nc from pylab import * import subprocess from subprocess import call d=nc.Dataset('DATA/Geostropic_Adjustment.nc') lons=d.variables['longs_v'][:] # only need this as rho is defined at v points levs=d.variables['ha...
null
ABC_MODEL/MATLAB_FILES_AND_DATA/plt_geost_adj.py
plt_geost_adj.py
py
3,121
python
en
code
null
code-starcoder2
83
[ { "api_name": "netCDF4.Dataset", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.where", "line_numbe...