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
112066565
import datetime import cv2 from PIL import Image from django.http import JsonResponse from django.shortcuts import render from django.views.generic import TemplateView from image_input.models import Entry, WEEKDAY_MAP from recognition.decoder import dict_decode from recognition.main import predict, predict_ru from re...
null
image_input/views.py
views.py
py
4,019
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.views.generic.TemplateView", "line_number": 18, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 24, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 27, "usage_type": "call" }, { "api_name...
501282386
import torch.nn.functional as F import rlkit.misc.hyperparameter as hyp from rlkit.launchers.experiments.disentanglement.disentangled_encoder_distance_launcher import ( use_disentangled_encoder_distance ) from rlkit.launchers.launcher_util import run_experiment if __name__ == "__main__": variant = dict( ...
null
experiments/vitchyr/disentanglement/pointmass/state_based_disentangled_encoder_distance.py
state_based_disentangled_encoder_distance.py
py
4,254
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.functional.tanh", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.nn.functional", "line_number": 22, "usage_type": "name" }, { "api_name": "rlkit.misc.hyperparameter.DeterministicHyperparameterSweeper", "line_number": 103, "usa...
651876450
#!/usr/bin/env python import sys import os from openpyxl import Workbook from openpyxl import load_workbook from openpyxl.worksheet.table import Table def removeSpaces(line): return "_".join(line.split(" ")) def padZero(i): return ("00" + str(i))[-3:] if len(sys.argv) != 3: print("Usage: python start.py ...
null
makeMetadata.py
makeMetadata.py
py
5,232
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 20...
220761909
import unittest import pytest from datetime import timedelta from Money import * from Exceptions import * from Parkomat import * class ParkomatTesty(unittest.TestCase): """ Klasa testowa """ def test_niepoprawna_godzina(self): """ test zmiany czasu na błedną godzinę :return: ...
null
TestyParkomat.py
TestyParkomat.py
py
4,313
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 42, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 45, "usage_type": "call" }, { "api_name": "datetime....
324459293
import cv2 import argparse import glob import os ap = argparse.ArgumentParser() ap.add_argument('-d', '--dataset', required = True, \ help = 'Path to the input image') args = vars(ap.parse_args()) dataset= args["dataset"] print('처리중...') verbose=True imagePath=os.path.join('D:\Emotion3\resultss') face_c...
null
face.py
face.py
py
1,286
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.CascadeClassifie...
337398179
from time import sleep from random import randint from pprint import pprint from praw import Reddit from praw.models import MoreComments from tweepy import OAuthHandler, API import secrets # gitignored file which has all the credential keys # Reddit instance reddit = Reddit(client_id=secrets.reddit_id, ...
null
src/reddit-bot.py
reddit-bot.py
py
3,259
python
en
code
null
code-starcoder2
83
[ { "api_name": "praw.Reddit", "line_number": 12, "usage_type": "call" }, { "api_name": "secrets.reddit_id", "line_number": 12, "usage_type": "attribute" }, { "api_name": "secrets.reddit_secret", "line_number": 13, "usage_type": "attribute" }, { "api_name": "secrets...
71447065
from typing import List import numpy import PIL.Image import torch import torchvision def rand(min: float, max: float) -> float: return numpy.random.rand() * (max - min) + min class Compose(object): """ 复合多种变换操作 """ def __init__(self, transforms): self.transforms = transforms def...
null
dataset/transform.py
transform.py
py
13,966
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.rand", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "PIL.Image.Image", "line_number": 59, "usage_type": "attribute" }, { "api_name": "PIL.Image", ...
107846984
import numpy as np from scipy.stats import multivariate_normal import matplotlib.pyplot as plt size = 1000 count = 501 var = 3000 e = 0.97 move = 30 pos = 100 m = np.ones((size, size)) plt.ion() plt.imshow(m, cmap='hot', interpolation='nearest') plt.draw() def update(): global pos, size, var, e, move, m a = ...
null
scripts/map_display_test.py
map_display_test.py
py
756
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.ones", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.ion", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.pyplot....
510021118
import gensim from get_post import get_posts from diploma.porter_2 import Porter STOP_LIST = [ 'еще', 'него', 'сказать' 'а', 'ж', 'нее', 'со', 'без', 'же', 'ней', 'совсем', 'более', 'жизнь', 'нельзя', 'так', 'больше', 'за', 'нет', 'такой', 'будет', 'зачем', 'ни', 'там', 'будто', 'здесь',...
null
diploma/runner.py
runner.py
py
4,540
python
en
code
null
code-starcoder2
83
[ { "api_name": "diploma.porter_2.Porter.stem", "line_number": 60, "usage_type": "call" }, { "api_name": "diploma.porter_2.Porter", "line_number": 60, "usage_type": "name" }, { "api_name": "gensim.parsing.preprocessing.preprocess_string", "line_number": 68, "usage_type": "c...
388386942
# Add project path to sys import sys import pathlib my_current_path = pathlib.Path(__file__).parent.absolute() my_root_path = my_current_path.parent sys.path.insert(0, str(my_root_path)) # Import my lib # from others.utilities import checkClassProportions import others.utilities as my_util from sklearn.model_selecti...
null
Scripts/testrun_2.py
testrun_2.py
py
2,644
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path.insert", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_n...
127446757
import cv2 import os import numpy as np import utils config = utils.load_json(os.path.join('lib', 'config.json')) # Choose video and output folder videolist = os.listdir(config['sourceFolder']) tmp = utils.select('Choose the video you want to extract: ', videolist, defaultChoose=0) videopath = os.path.join(...
null
extract_image.py
extract_image.py
py
2,387
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.load_json", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number"...
490318129
"""Support for SleepIQ sensors.""" from homeassistant.components.binary_sensor import ( DEVICE_CLASS_OCCUPANCY, BinarySensorEntity, ) from . import SleepIQSensor from .const import DOMAIN, IS_IN_BED, SENSOR_TYPES, SIDES def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Sl...
null
homeassistant/components/sleepiq/binary_sensor.py
binary_sensor.py
py
1,415
python
en
code
null
code-starcoder2
83
[ { "api_name": "const.DOMAIN", "line_number": 16, "usage_type": "name" }, { "api_name": "const.SIDES", "line_number": 21, "usage_type": "name" }, { "api_name": "homeassistant.components.binary_sensor.BinarySensorEntity", "line_number": 27, "usage_type": "name" }, { ...
69286866
import logging from elasticsearch import Elasticsearch from elasticsearch import helpers logger = logging.getLogger('perf-collector') handler = logging.StreamHandler() logger.addHandler(handler) class ElasticsearchAPI: """ Each query will have its own index based on query name. index_name = query.name ...
null
Elasticsearch_API.py
Elasticsearch_API.py
py
2,582
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 8, "usage_type": "call" }, { "api_name": "elasticsearch.Elasticsearch", "line_number": 26, "usage_type": "call" }, { "api_name": "ela...
213442525
#** Priscilla Nunez #** SI 364 F18 #** 9/15/18 ################################# ## List below here, in a comment/comments, the people you worked with on this assignment AND any resources you used to find code (50 point deduction for not doing so). If none, write "None". #*** HW1 numbers 1 to 4 are my own solutions ...
null
SI364F18_HW1.py
SI364F18_HW1.py
py
7,551
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 22, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 43, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 44, "usage_type": "call" }, { "api_name": "flask.request.method", "line_...
409822189
import collections import re SIDE_SIZE = 1000 # Puzzle 2 f = open('./input.txt', 'r') input_lines = f.readlines() f.close() class Rect(): def __init__(self, in_str): re_match = re.match(r'#(\d+) @ (\d+),(\d+): (\d+)x(\d+)', in_str) self.id = int(re_match.group(1)) self.left = int(re_matc...
null
Day 3/puzzle2.py
puzzle2.py
py
1,303
python
en
code
null
code-starcoder2
83
[ { "api_name": "re.match", "line_number": 14, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 33, "usage_type": "call" } ]
643234978
import cv2 import numpy as np img = cv2.imread("dataset/examples/apertura.png", 0) cv2.imshow('Paradigma', img) cv2.waitKey(0) kernel = np.ones((5, 5), np.uint8) opening = cv2.morphologyEx(img, cv2.MORPH_OPEN, kernel) cv2.imshow('Paradigma', opening) cv2.waitKey(0) cv2.destroyAllWindows()
null
tip_01_04_c.py
tip_01_04_c.py
py
294
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 9, ...
97262884
import csv import requests from bs4 import BeautifulSoup headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36"} #url = "https://finance.naver.com/sise/sise_market_sum.nhn?&page=" #https://finance.naver.com/sise/sise_market_s...
null
nadocode/12_csv_stock_samsung.py
12_csv_stock_samsung.py
py
1,499
python
en
code
null
code-starcoder2
83
[ { "api_name": "csv.writer", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 22, "usage_type": "call" } ]
20161886
import os import subprocess from datetime import datetime def execute(dir, cmd_string): cmds = command_string.split("&") for i in range(len(cmds)): atomic_cmd = f"cd {dir} & {cmds[i].strip()}" log(atomic_cmd) cmd = atomic_cmd.split(" ") log(subprocess.call(cmd, shell=True)) ...
null
Startup/osu_git.py
osu_git.py
py
684
python
en
code
null
code-starcoder2
83
[ { "api_name": "subprocess.call", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "name" }, { "api_name": "os.path.expan...
374015572
#!/usr/bin/env python3 import numpy as np from stdParams import * import os import sys import glob from pathlib import Path import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns sns.set() mpl.style.use('matplotlibrc') plt.rc('text.latex', preamble=r''' \usepackage{dejavu} \renewcommand*\famil...
null
code/ESN_code/plotting/plot_T_conv.py
plot_T_conv.py
py
3,209
python
en
code
null
code-starcoder2
83
[ { "api_name": "seaborn.set", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.style.use", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 13, "usage_type": "attribute" }, { "api_name": "matplotlib.pyp...
632792944
# -*- coding: utf-8 -*- from datetime import date, datetime from odoo import models, fields, api, tools, exceptions, _ import logging from odoo.modules import get_module_resource import base64 from odoo.addons.base.models.res_partner import WARNING_MESSAGE, WARNING_HELP _logger = logging.getLogger(__name__) class P...
null
addons/berp_usuarios/res_partner.py
res_partner.py
py
8,358
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 13, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.datetim...
231843080
import os import pygame GAME_FOLDER = os.path.dirname(__file__) IMG_FOLDER = os.path.join(GAME_FOLDER, '..', "images") SND_FOLDER = os.path.join(GAME_FOLDER, '..', "sounds") file_cache = {} def load_img(name, scale=1): """ Load image and return image object""" fullname = os.path.join(IMG_FOLDER, name) t...
null
Assignment2/utils/load_assets.py
load_assets.py
py
1,610
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5...
518136132
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Create the RenderWindow, Renderer and both Actors # ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteractor() iren.SetR...
null
Filters/Modeling/Testing/Python/TestImageMarchingCubes.py
TestImageMarchingCubes.py
py
1,758
python
en
code
null
code-starcoder2
83
[ { "api_name": "vtk.util.misc.vtkGetDataRoot", "line_number": 5, "usage_type": "call" }, { "api_name": "vtk.vtkRenderer", "line_number": 9, "usage_type": "call" }, { "api_name": "vtk.vtkRenderWindow", "line_number": 10, "usage_type": "call" }, { "api_name": "vtk.vt...
76952359
""" 1. Подсчитать, сколько было выделено памяти под переменные в ранее разработанных программах в рамках первых трех уроков. Проанализировать результат и определить программы с наиболее эффективным использованием памяти. Примечание: Для анализа возьмите любые 1-3 ваших программы или несколько вариантов кода для одной и...
null
Lesson_6/1.py
1.py
py
2,293
python
en
code
null
code-starcoder2
83
[ { "api_name": "memory_profiler.profile", "line_number": 14, "usage_type": "name" }, { "api_name": "memory_profiler.profile", "line_number": 20, "usage_type": "name" }, { "api_name": "sys.getsizeof", "line_number": 33, "usage_type": "call" }, { "api_name": "random....
181147968
import time import smtplib import os import math import datetime from multiprocessing import Process import warnings import sys import csv import psycopg2.extras import logging from search import GoogleSearch from crawler import Crawler, scheduleJobs from database import RedirectDB from typosquatting import Typosquatt...
null
main.py
main.py
py
8,492
python
en
code
null
code-starcoder2
83
[ { "api_name": "database.RedirectDB", "line_number": 31, "usage_type": "call" }, { "api_name": "smtplib.SMTP", "line_number": 49, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 60, "usage_type": "call" }, { "api_name": "math.floor", "line_nu...
238444997
import io import time import pickle import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from power_data_handler import PowerDataHandler, MergePowerHandler from prediction_graph import FFTpredictionGraph from IPython.core.debugger import Pdb debug_here = Pdb().set_trace fifteen_minute_sampling = ...
null
power_experiments/power_train_exp.py
power_train_exp.py
py
16,780
python
en
code
null
code-starcoder2
83
[ { "api_name": "IPython.core.debugger.Pdb", "line_number": 10, "usage_type": "call" }, { "api_name": "power_data_handler.PowerDataHandler", "line_number": 54, "usage_type": "call" }, { "api_name": "power_data_handler.PowerDataHandler", "line_number": 60, "usage_type": "cal...
433260176
import logging import sys from pathlib import Path from datetime import datetime from Pegasus.api import * logging.basicConfig(level=logging.DEBUG) PEGASUS_LOCATION = "/usr/bin/pegasus-keg" # --- Work Dir Setup ----------------------------------------------------------- RUN_ID = "black-diamond-5.0api-" + datetime....
null
test/core/001-black-diamond-vanilla-condor-5.0API/black-diamond-setup.py
black-diamond-setup.py
py
5,162
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.d...
135454080
#https://python-twitter.readthedocs.io/en/latest/twitter.html#module-twitter.api import twitter import configparser from os import path config = configparser.ConfigParser() config.read('config.ini') if not path.exists('counter.txt'): newfile = open('counter.txt', 'w+') newfile.write(str(0)) newfile.close...
null
twitter/script.py
script.py
py
994
python
en
code
null
code-starcoder2
83
[ { "api_name": "configparser.ConfigParser", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "name" }, { "api_name": "twitter.Api", "li...
133417081
import logging from GlobalVariable import * from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0 from selenium.webdriver.support import expected_conditions as EC # available since 2.26.0 cla...
null
src/LocalDriver.py
LocalDriver.py
py
2,387
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 14, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.F...
540153000
from typing import Union from loguru import logger from pyrogram import Client, filters from pyrogram.errors import ( ChannelPrivate, InviteHashInvalid, PeerIdInvalid, RPCError, UsernameInvalid, UsernameNotOccupied, ) from pyrogram.types import Chat, ChatPreview, Message, User from app.utils i...
null
app/plugins/resolve.py
resolve.py
py
4,816
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyrogram.Client", "line_number": 32, "usage_type": "name" }, { "api_name": "pyrogram.types.Message", "line_number": 32, "usage_type": "name" }, { "api_name": "app.utils.get_args", "line_number": 37, "usage_type": "call" }, { "api_name": "pyrogram.ty...
535326244
import numpy.matlib import numpy as np import sys from copy import deepcopy import matplotlib.pyplot as plt import scipy import random import logging from random import randint import csv import pandas as pd import math from scipy.spatial.distance import pdist, squareform def dist(X,Y): distance = ((X[0] - Y[0]...
null
hashtags__clusters_grouping.py
hashtags__clusters_grouping.py
py
3,915
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 24, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 25, "usage_type": "call" }, { "api_name": ...
108090933
import numpy as np import hashlib import pandas as pd from sklearn.preprocessing import OneHotEncoder from sklearn.externals import joblib #processes the origin date column and expresses it in number of days def processBusinessDates(dates, current_timestamp) : age = [] for i in range(len(dates)) : #i...
null
un_transforms.py
un_transforms.py
py
7,897
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.Timestamp", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.Timestamp.timestamp", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.Timestamp", "line_number": 14, "usage_type": "attribute" }, { "api_name": "num...
334737713
import sys import os import re import asyncio from urllib.parse import quote, urlparse if __name__ == '__main__': sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) from applib.tools_lib import pcformat sys.path.append(os.path.abspath(os.path.dirname(__file__))) from applib.to...
null
applib/sku_lib.py
sku_lib.py
py
6,202
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number...
532289363
import os import sqlite3 class Data_Access: def __init__(self, db_file = "signups.db"): database_already_exists = os.path.exists(db_file) self.db = sqlite3.connect(db_file) if not database_already_exists: self.setup_default() self.table_name = "accounts" def...
null
data_access.py
data_access.py
py
1,761
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.exists", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" } ]
651201928
import time from slack.element_slack.messages import Messages from slack.workspace.workspaces import Workspaces from slack.element_slack.channels_files import ChannelsFiles from slack.element_slack.users import Users import json class WorkspacesSlackArchive(Workspaces): def __init__(self, path_dir, name_workspac...
null
slack/workspace/workspace_slackarchive.py
workspace_slackarchive.py
py
2,524
python
en
code
null
code-starcoder2
83
[ { "api_name": "slack.workspace.workspaces.Workspaces", "line_number": 9, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 20, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 33, "usage_type": "call" }, { "api_name": "slack.elem...
68377521
import collections, copy, importlib, io, logging, sys, threading, time, traceback, datetime from enum import IntEnum from contextlib import contextmanager from typing import List, NamedTuple import ruxit.api.data, ruxit.api.exceptions, ruxit.api.selectors, ruxit.config_utils import ruxit.utils._logging.engine_logging ...
null
venv/Lib/site-packages/ruxit/plugin_state_machine.py
plugin_state_machine.py
py
30,144
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.namedtuple", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 19, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 21, "usage_type": "call" }, { "api_name": "...
184775513
from py2neo import Graph, Node, Relationship, NodeMatcher from datetime import datetime import uuid graph = Graph("http://localhost:7474", username="neo4j", password="neo4j1") matcher = NodeMatcher(graph) class Person: def __init__(self, username): self.username = username def find(self): us...
null
tutor/models.py
models.py
py
16,529
python
en
code
null
code-starcoder2
83
[ { "api_name": "py2neo.Graph", "line_number": 5, "usage_type": "call" }, { "api_name": "py2neo.NodeMatcher", "line_number": 6, "usage_type": "call" }, { "api_name": "py2neo.Node", "line_number": 19, "usage_type": "call" }, { "api_name": "py2neo.Node", "line_num...
18052221
from tkinter import ttk import requests from tkinter import messagebox import time from ttkthemes import ThemedTk def print_weather(weather): try: city = weather['name'] country = weather['sys']['country'] temp = weather['main']['temp'] press = weather['main']['pressure...
null
wether.py
wether.py
py
2,083
python
en
code
null
code-starcoder2
83
[ { "api_name": "tkinter.messagebox.showerror", "line_number": 26, "usage_type": "call" }, { "api_name": "tkinter.messagebox", "line_number": 26, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 34, "usage_type": "call" }, { "api_name": "ttktheme...
32365158
print("hello.. This is Equipments working and non working hours calculation tool") #filepath = input("Enter file path: ") import pyexcel as pe from pyexcel.ext import xlsx sheet = pe.get_sheet(file_name="/home/bharathi/EquipmentDetails/April-may2016.xlsx") sheet.delete_rows([0]) matrix = list() for row in sheet: ra...
null
main.py
main.py
py
1,989
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyexcel.get_sheet", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "attribute" }, { "api_name": "da...
589815133
import mimetypes import cloudfiles from cloudfiles.errors import NoSuchObject, ResponseError from flask import current_app from werkzeug.utils import cached_property from .base import Storage, StorageFile, reraise __all__ = ('CloudFilesStorage',) class CloudFilesStorage(Storage): def __init__(self, ...
null
flask_storage/cloudfiles.py
cloudfiles.py
py
3,921
python
en
code
null
code-starcoder2
83
[ { "api_name": "base.Storage", "line_number": 14, "usage_type": "name" }, { "api_name": "flask.current_app.config.get", "line_number": 23, "usage_type": "call" }, { "api_name": "flask.current_app.config", "line_number": 23, "usage_type": "attribute" }, { "api_name"...
295755953
import nose import pandas as pd import pandas.util.testing as tm import pandas_datareader.data as web from pandas_datareader._utils import RemoteDataError class TestGoogleOptions(tm.TestCase): @classmethod def setUpClass(cls): super(TestGoogleOptions, cls).setUpClass() # goog has monthlies ...
null
pandas_datareader/tests/test_google_options.py
test_google_options.py
py
1,572
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.util.testing.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pandas.util.testing", "line_number": 9, "usage_type": "name" }, { "api_name": "pandas_datareader.data.Options", "line_number": 15, "usage_type": "call" }, { ...
230057024
#Hoeffding Inequality import numpy as np import matplotlib.pyplot as plt ncoins = 10 nflips = 1000 iterations = 100000 flip_lambda = lambda ncoins, p, nflips: np.random.binomial(ncoins, .5, size=nflips) flips = flip_lambda(ncoins, .5, nflips) # print(flips) v_1, v_rand, v_min = [np.zeros(iterations), np.zeros(iteratio...
null
scikit-learn-master/hw2_redo.py
hw2_redo.py
py
1,809
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.binomial", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random.randin...
96067222
from kivy.uix.widget import Widget from kivy.graphics import * from utils import * class Arena(object): def __init__(self, naubino, mode, game): with game.back.canvas: self.layer = Widget() with self.layer.canvas: Color(0, 0, 0, 0.05) ...
null
src/naubivy/naubivy_arena.py
naubivy_arena.py
py
371
python
en
code
null
code-starcoder2
83
[ { "api_name": "kivy.uix.widget.Widget", "line_number": 9, "usage_type": "call" } ]
314610322
import csv import cv2 import numpy as np import sklearn from sklearn.model_selection import train_test_split from keras.models import Sequential from keras.layers.core import Dense, Flatten, Lambda from keras.layers.convolutional import Conv2D, Cropping2D from keras.layers.normalization import BatchNormalization DATA...
null
model.py
model.py
py
4,794
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.backend.tf.image.resize_images", "line_number": 27, "usage_type": "call" }, { "api_name": "keras.backend.tf.image", "line_number": 27, "usage_type": "attribute" }, { "api_name": "keras.backend.tf", "line_number": 27, "usage_type": "name" }, { ...
445911266
import numpy from gym import spaces from .base import BaseOddsEnv class BasePercentageOddsEnv(BaseOddsEnv): """Base class for sports betting environments with non fixed bet size. Creates an OpenAI Gym environment that supports betting a non fixed amount on a single outcome for a single game. The mai...
null
oddsgym/envs/base_percentage.py
base_percentage.py
py
2,230
python
en
code
null
code-starcoder2
83
[ { "api_name": "base.BaseOddsEnv", "line_number": 6, "usage_type": "name" }, { "api_name": "gym.spaces.Box", "line_number": 49, "usage_type": "call" }, { "api_name": "gym.spaces", "line_number": 49, "usage_type": "name" }, { "api_name": "numpy.array", "line_num...
421029736
from styx_msgs.msg import TrafficLight import tensorflow as tf import numpy as np import datetime class TLClassifier(object): def __init__(self, is_site): # load classifier if is_site: PATH_TO_GRAPH = r'models/site/ssd_mobilenet_frozen_inference_graph.pb' else: PATH_...
null
ros/src/tl_detector/light_classification/tl_classifier.py
tl_classifier.py
py
3,071
python
en
code
null
code-starcoder2
83
[ { "api_name": "tensorflow.Graph", "line_number": 14, "usage_type": "call" }, { "api_name": "tensorflow.GraphDef", "line_number": 18, "usage_type": "call" }, { "api_name": "tensorflow.gfile.GFile", "line_number": 19, "usage_type": "call" }, { "api_name": "tensorflo...
425309605
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Jul 11 12:17:54 2017 @author: A """ import tensorflow as tf # Version 1.0 or 0.12 import numpy as np import matplotlib.pyplot as plt import os plt.close('all') inSeq=20 outSeq=20 batchSize = 50 ioputDim=2 hiddenDim =30 numIterLearning = ...
null
Scripts/Codes/TensorflowGPUPredictFinal.py
TensorflowGPUPredictFinal.py
py
10,474
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.close", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 15, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", ...
362277632
from bs4 import BeautifulSoup import httplib, re from collections import defaultdict import webbrowser from PyQt4 import QtGui from PyQt4.QtCore import QString, QTimer import main_window import settings_diag import os, glob, pickle class MainApp(QtGui.QMainWindow, main_window.Ui_MainWindow): """ MainApp Class that...
null
search.py
search.py
py
7,053
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt4.QtGui.QMainWindow", "line_number": 11, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui", "line_number": 11, "usage_type": "name" }, { "api_name": "main_window.Ui_MainWindow", "line_number": 11, "usage_type": "attribute" }, { "api_name"...
435953086
import torch from torch import nn from models.blocks.conv_bn_relu import conv_bn_relu from models.operator.cross_correlation.func import xcorr_depthwise class SiamFCXCorr(nn.Module): def __init__(self, input_dim: int, hidden_dim: int): super(SiamFCXCorr, self).__init__() # feature adjustment ...
null
models/TransT/neck/xcorr.py
xcorr.py
py
867
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "models.blocks.conv_bn_relu.conv_bn_relu", "line_number": 12, "usage_type": "call" }, { "api_name": "m...
223413372
from sklearn.model_selection import StratifiedKFold from sklearn.pipeline import Pipeline from sklearn.dummy import DummyClassifier from pandas import DataFrame import numpy as np from sklearn.datasets import load_digits import sys from autoclf import auto_utils as au from autoclf.classification import eval_utils as ...
null
examples/digits_train.py
digits_train.py
py
2,048
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 21, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_na...
599474942
import collections from palo_alto_firewall_analyzer.core import BadEntry, register_policy_validator def find_local_similar_names(devicegroup_objects, device_group, object_type1, object_type2): """Finds objects in a single devicegroup which have names which conflict with each other. For example, Address object...
null
palo_alto_firewall_analyzer/validators/similar_addresses_and_groups.py
similar_addresses_and_groups.py
py
6,527
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" }, { "api_name": "palo_alto_firewall_analyzer.core.BadEntry", "line_number": 33, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 51, "usage_type": "call" }, ...
234623302
from nltk.corpus import wordnet as wn import string import random import sys import json letters = string.ascii_lowercase adjs = { letter : [] for letter in letters } nouns = { letter : [] for letter in letters } for synset in list(wn.all_synsets('a')): for lemma in synset.lemma_names(): if lemma and le...
null
create_wordlists.py
create_wordlists.py
py
677
python
en
code
null
code-starcoder2
83
[ { "api_name": "string.ascii_lowercase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "nltk.corpus.wordnet.all_synsets", "line_number": 12, "usage_type": "call" }, { "api_name": "nltk.corpus.wordnet", "line_number": 12, "usage_type": "name" }, { "ap...
623433852
import json import time import requests from requests.auth import HTTPBasicAuth WORKFLOW_ID = "43746ca1-b01b-4d4d-a184-d036c540797c" body = { "parameters": [ {"value": {"string": {"value": "22"}}, "type": "string", "name": "Source", "scope": "local" }, {"value":...
null
core/req_vro.py
req_vro.py
py
1,740
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.post", "line_number": 31, "usage_type": "call" }, { "api_name": "requests.auth.HTTPBasicAuth", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 33, "usage_type": "call" }, { "api_name": "requests.auth....
309284178
from typing import List, Optional from fastapi import Depends, FastAPI, HTTPException, status, WebSocket, Cookie, Query, WebSocketDisconnect from fastapi.responses import HTMLResponse from starlette.middleware.cors import CORSMiddleware from pydantic import ValidationError from sqlalchemy.orm import Session from . i...
null
backend/api/main.py
main.py
py
3,574
python
en
code
null
code-starcoder2
83
[ { "api_name": "database.engine", "line_number": 14, "usage_type": "name" }, { "api_name": "fastapi.FastAPI", "line_number": 16, "usage_type": "call" }, { "api_name": "starlette.middleware.cors.CORSMiddleware", "line_number": 19, "usage_type": "argument" }, { "api_...
455515315
from flask import Flask, request, redirect, url_for, render_template, json from lxml import html import json import requests locations_url = "http://www.heinz-entsorgung.de/fileadmin/templates/php/abfuhrkalender/index.php" def getlocation(regionid=False,cityid=False): if not regionid: return(json.dumps({"K...
null
backend-flask/backend.py
backend.py
py
1,744
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.dumps", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 14, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "line...
185022230
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: /home/putzw/Documents/Projects/Source/jinjamator-oss/jinjamator/plugins/content/fsm/fsm.py # Compiled at: 2020-04-06 16:53:41 # Size of source mod 2**32: 2006 byt...
null
pycfiles/jinjamator-0.5.3-py3-none-any/fsm.cpython-37.py
fsm.cpython-37.py
py
2,113
python
en
code
null
code-starcoder2
83
[ { "api_name": "clitable.CliTable", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.path.abspath", ...
587323390
import datetime from flask import Flask from linebot.models import (BoxComponent, BubbleContainer, ButtonComponent, FlexSendMessage, TextComponent) from .. import db from ..models import User app = Flask(__name__, instance_relative_config=True) app.config.from_pyfile('config.py') def fo...
null
app/chatbot/follow.py
follow.py
py
1,529
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "linebot.models.BubbleContainer", "line_number": 15, "usage_type": "call" }, { "api_name": "linebot.models.BoxComponent", "line_number": 16, "usage_type": "call" }, { "api_name":...
512023561
from bs4 import BeautifulSoup from socket import timeout from tqdm import tqdm from urllib.request import Request, urlopen from decimal import Decimal from re import sub import numpy as np import psycopg2 import urllib.request import time import sys import random import traceback import json class Project(): def __i...
null
kick/update_price.py
update_price.py
py
2,144
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.mean", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.std", "line_number": 22, "usage_type": "call" }, { "api_name": "urllib.request.request.build_opener", "line_number": 28, "usage_type": "call" }, { "api_name": "urllib.reque...
250900016
import flask import flask_socketio from flask import Flask from flask import session from flask import render_template from flask_socketio import SocketIO, send, emit from subprocess import call app = Flask(__name__, template_folder='template') app.secret_key = "secret" host_addr = "192.168.137.1" port_nu...
null
main.py
main.py
py
2,823
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_socketio.SocketIO", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 19, "usage_type": "name" }, { "api_name": "flask.request.args....
279624568
from bs4 import BeautifulSoup import requests import json import re import sqlite3 cache_dict = {} DBNAME = 'final_streaming.sqlite' final_cache_hulu = "final_cache_hulu.json" page_numbers = list(range(0, 2701, 50)) list_url_base = 'https://reelgood.com/source/hulu?offset=' item_url_base = 'https://reelgood.com' # to...
null
final_code_hulu.py
final_code_hulu.py
py
4,082
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 22, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 29, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 39, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_numb...
378615129
#coding=utf-8 import os import sys import re import requests import chardet import time import subprocess from extract_re import extract_re,extract,extract_all,extract_div class after_proc: def __init__(self,title,time,content,url): self.title = title self.time = time self.content = content...
null
jianshu_spider/spider.py
spider.py
py
6,498
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "extract_re.extract", "line_number": 23, "usage_type": "call" }, { "api_name": "extract_re.extract_all", "line_number": 24, "usage_type": "call" }, { "api_name": "requests.get",...
652333736
import numpy as np import matplotlib.pyplot as plt fo = open('ko_barrier.log', 'w') def log_nd(nd, name='null'): global fo log = '' for l in nd: log += str(l.tolist()) log += '\n' fo.write('%s = [\n%s]\n' % (name, log)) #paras nperiod = 8 nday_aperiod = 5 S0 = 48970 para = dict( ...
null
ko_barrier.py
ko_barrier.py
py
2,762
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.arange", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random.randn", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 36, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "l...
261226312
from Bio import Entrez, SeqIO from Bio.SeqUtils import GC import pandas as pd import sys import re import time # remember to input email for Entrez Entrez.email = "test@outlook.com" #TODO CHANGE EMAIL! def search_term(gene, organism_list): """ combine gene symbol and search organism e.g iles AND Coxiell...
null
Bioinformatics_create_a_script_to_retrieve_sequences_of_bacterial_homologs_of_a_given_gene_or_protein/solution.py
solution.py
py
6,724
python
en
code
null
code-starcoder2
83
[ { "api_name": "Bio.Entrez.email", "line_number": 9, "usage_type": "attribute" }, { "api_name": "Bio.Entrez", "line_number": 9, "usage_type": "name" }, { "api_name": "Bio.Entrez.esearch", "line_number": 29, "usage_type": "call" }, { "api_name": "Bio.Entrez", "l...
627561625
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
null
azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/tracked_resource_modification_details.py
tracked_resource_modification_details.py
py
1,862
python
en
code
null
code-starcoder2
83
[ { "api_name": "msrest.serialization.Model", "line_number": 15, "usage_type": "name" } ]
23843435
import numpy as np import scipy.sparse as sp import torch import itertools, heapq def default_device() -> torch.device: return torch.device('cuda' if torch.cuda.is_available() else 'cpu') def normalize(mx): """Row-normalize sparse matrix.""" """https://github.com/HazyResearch/hgcn/blob/a526385744da25fc...
null
utils/helper.py
helper.py
py
2,140
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.device", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.device", ...
526088287
from aiogram.types import Message from tgbot.keyboards.default.customer.personal_profile import personal_profile_kb from tgbot.services.repository import Repo async def personal_profile(m: Message, repo: Repo): user_data = await repo.get_customer(userid=m.chat.id) user_orders = await repo.get_customer_orders...
null
tgbot/handlers/customer/personal_profile.py
personal_profile.py
py
943
python
en
code
null
code-starcoder2
83
[ { "api_name": "aiogram.types.Message", "line_number": 7, "usage_type": "name" }, { "api_name": "tgbot.services.repository.Repo", "line_number": 7, "usage_type": "name" }, { "api_name": "tgbot.keyboards.default.customer.personal_profile.personal_profile_kb", "line_number": 25,...
114692273
import torch import torch.nn as nn import torchvision import torchvision.transforms as transforms import matplotlib.pyplot as plt import numpy as np from imgnet import Net def imshow(img): img = img / 2 + 0.5 npimg = img.numpy() plt.imshow(np.transpose(npimg, (1, 2, 0))) plt.show() classes = ('plane',...
null
testnetwork.py
testnetwork.py
py
1,133
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.imshow", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.transpose", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib...
138680408
import numpy as np import cv2 from skimage.feature import local_binary_pattern import skimage from scipy.stats import itemfreq from sklearn.preprocessing import normalize def hogFeature(patches): winSize = (20,20) blockSize = (10,10) blockStride = (5,5) cellSize = (10,10) nbins =...
null
featureExtraction.py
featureExtraction.py
py
1,929
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.HOGDescriptor", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.getGaborKernel", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 34, "usage_type": "attribute" }, { "api_name": "cv2.CV_32F", "...
46150723
# -*- coding: utf-8 -*- import tornadoredis import tornado.web import tornado.websocket import tornado.ioloop import tornado.httpclient c = tornadoredis.Client() c.connect() class MainHandler(tornado.web.RequestHandler): def get(self): self.set_header('Content-Type', 'text/plain') self.write('Wh...
null
renga/tornadoapp.py
tornadoapp.py
py
1,350
python
en
code
null
code-starcoder2
83
[ { "api_name": "tornadoredis.Client", "line_number": 9, "usage_type": "call" }, { "api_name": "tornado.web.web", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tornado.web", "line_number": 13, "usage_type": "name" }, { "api_name": "tornado.web.webso...
562402714
"""Library to access the Smart Device Management API.""" from typing import List import aiohttp from .auth import AbstractAuth from .device import Device from .structure import Structure STRUCTURES = "structures" DEVICES = "devices" NAME = "name" class GoogleNestAPI: """Class to communicate with the Google Nes...
null
google_nest_sdm/google_nest_api.py
google_nest_api.py
py
2,376
python
en
code
null
code-starcoder2
83
[ { "api_name": "auth.AbstractAuth", "line_number": 18, "usage_type": "name" }, { "api_name": "structure.Structure.MakeStructure", "line_number": 35, "usage_type": "call" }, { "api_name": "structure.Structure", "line_number": 35, "usage_type": "name" }, { "api_name"...
628092750
#!/usr/bin/env python # -*- coding: UTF-8 -*- """================================================= @Project -> File :PycharmProjects -> user @IDE :PyCharm @Author :Mr. toiler @Date :1/10/2020 3:15 PM @Desc : ==================================================""" from web.dao.db import DB from web.dto.user impor...
null
web/dao/user.py
user.py
py
2,857
python
en
code
null
code-starcoder2
83
[ { "api_name": "web.dao.db.DB", "line_number": 27, "usage_type": "name" }, { "api_name": "web.dto.user.UserDto", "line_number": 39, "usage_type": "call" }, { "api_name": "web.dto.user.UserDto", "line_number": 48, "usage_type": "call" }, { "api_name": "web.dto.user....
168525097
# -*- coding:utf-8 -*- # Author:D.Gray from gevent import monkey from urllib import request import time,gevent monkey.patch_all() def f(url): print("所爬网页:",url) rest = request.urlopen(url) data = rest.read() print("%s bytes from url:%s"%(len(data),url)) urls = [ "https://www.python.org/downloads/"...
null
Python_Study/第四模块学习/Day04/协程/爬虫.py
爬虫.py
py
801
python
en
code
null
code-starcoder2
83
[ { "api_name": "gevent.monkey.patch_all", "line_number": 6, "usage_type": "call" }, { "api_name": "gevent.monkey", "line_number": 6, "usage_type": "name" }, { "api_name": "urllib.request.urlopen", "line_number": 10, "usage_type": "call" }, { "api_name": "urllib.req...
523981689
import os, sys, os.path as op sys.path.insert(0, op.join(os.getenv('CITY_PATH'), 'src/learning/labelme')) import random import unittest import logging import parser #from parser import BaseParser, FrameParser, PairParser class TestBaseParser (unittest.TestCase): def setUp(self): self.parser = parser.Bas...
null
test/learning/labelme/test_parser.py
test_parser.py
py
4,411
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.insert", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 2, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
534266453
#!/usr/bin/python3 import requests import json import configparser config = configparser.ConfigParser() config.read('../../cht.conf') projectKey = config.get('device-key', 'projectKey') deviceId = config.get('device-key', 'deviceId') apiURL = 'http://iot.cht.com.tw/iot/v1/device/' + deviceId + '/heartbeat' header...
null
iot/01_rest/07_get_device_heartbeat.py
07_get_device_heartbeat.py
py
494
python
en
code
null
code-starcoder2
83
[ { "api_name": "configparser.ConfigParser", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" } ]
194679041
#!/bin/env python # coding: utf-8 import json from flask import Flask, render_template from sqlalchemy import select from line_util import online from get_zabbix_tri import ZabbixTools app = Flask(__name__) class GetTriggers(online): def main(self): conn = self.engine.connect() s = select([self....
null
Python/games_online/online_front/front.py
front.py
py
994
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "line_util.online", "line_number": 11, "usage_type": "name" }, { "api_name": "sqlalchemy.select", "line_number": 14, "usage_type": "call" }, { "api_name": "get_zabbix_tri.ZabbixTo...
177911479
# K_Pst channel K_Pst.mod Hay2011 # exec(open('K_Pst_Chan_(Hay2011).py').read()) import numpy as np import pickle import pandas as pd import moose SOMA_A = 3.14e-8 F = 96485.3329 R = 8.314 celsius = 32 dt = 0.05e-3 ENa = 0.050 EK = -0.085 Eh = -0.045 ECa = 0.128 Em = -0.090 Vmin = -0.100 Vmax = 0.100 Vdivs = 3000 v ...
null
Kinetics/K_Pst_Chan_(Hay2011).py
K_Pst_Chan_(Hay2011).py
py
1,386
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.linspace", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 27, "usage_type": "call" }, { "api_name": "moose.HHChannel", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.exp", "line_n...
191602749
import socket import netifaces as nif def getMac(): print(mac_for_ip()) return mac_for_ip() def getIp(): print(socket.gethostbyname(socket.gethostname())) return str(socket.gethostbyname(socket.gethostname())) if __name__ == '__main__': networkLog += 'IP:\t' + getIp() networkLog = 'MAC:\t...
null
ITTTTTTTTTTT/network_info.py
network_info.py
py
850
python
en
code
null
code-starcoder2
83
[ { "api_name": "socket.gethostbyname", "line_number": 12, "usage_type": "call" }, { "api_name": "socket.gethostname", "line_number": 12, "usage_type": "call" }, { "api_name": "socket.gethostbyname", "line_number": 13, "usage_type": "call" }, { "api_name": "socket.g...
505494127
import math import time import matplotlib.pyplot as plt import numpy as np import gym from neuronpp.utils.network_status_graph import NetworkStatusGraph from matplotlib.animation import FuncAnimation from agents.cart_agent import CartAgent plt.close('all') env = gym.make('CartPole-v0') n_episodes = 100 env_vis =...
null
cart_pole_run.py
cart_pole_run.py
py
1,855
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.close", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "gym.make", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot....
597839554
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render from django.http import HttpResponse # Create your views here. def home(request): #return HttpResponse("Hello World") return render(request, 'home.html', {'name':'Siddharth'}) def add(request): var1 = req...
null
libman/calc/views.py
views.py
py
462
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.shortcuts.render", "line_number": 10, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" } ]
622673582
from app import db from app.cameracontrol.forms import UpdateForm, ConnectForm, RoiForm from app.cameracontrol import bp from app.cameracontrol.models import workers, Camera import os from flask import render_template, flash, redirect, url_for, session @bp.route('/add_camera', methods=['GET', 'POST']) def add_camera...
null
app/cameracontrol/handlers.py
handlers.py
py
6,194
python
en
code
null
code-starcoder2
83
[ { "api_name": "app.cameracontrol.forms.ConnectForm", "line_number": 14, "usage_type": "call" }, { "api_name": "app.cameracontrol.models.Camera", "line_number": 19, "usage_type": "call" }, { "api_name": "app.db.session.add", "line_number": 21, "usage_type": "call" }, {...
280140653
def frequent_words(name , n , k): ################################ Importing required packages ################################ #import sys #module = ["pandas" , "efficient_apriori" , "time"] #for modulename in module: #if modulename not in sys.modules: f = open("output_o...
null
DMML/Asignment_1_frequent_item_set/Code/Efficient_appriori.py
Efficient_appriori.py
py
3,766
python
en
code
null
code-starcoder2
83
[ { "api_name": "warnings.filterwarnings", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "time.clock", ...
472919311
import pygame, sys, time, socket, pickle pygame.init() class onlineGame(object): def __init__(self, connectionExists): print("Game made") self.screen_W = 600 self.screen_H = 600 self.screen = pygame.display.set_mode((self.screen_W, self.screen_H), 0, 32) self....
null
Network Tests/clientexample.py
clientexample.py
py
4,376
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.font.Sy...
415765549
# pandas 数据集读取,dataframe形式的 # 文件读取 import codecs import psutil import numpy as np import torch from sklearn.model_selection import train_test_split from torch.utils.data import Dataset, DataLoader from transformers import BertForSequenceClassification, AdamW, get_linear_schedule_with_warmup # pip install trans...
null
bert_tx_cls.py
bert_tx_cls.py
py
5,233
python
en
code
null
code-starcoder2
83
[ { "api_name": "codecs.open", "line_number": 17, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 25, "usage_type": "call" }, { "api_name": "tran...
494485198
""" DRS Registration resource package. Copyright (c) 2018 Qualcomm Technologies, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: * Redistribut...
null
app/api/v1/resources/regdetails.py
regdetails.py
py
11,163
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask_restful.Resource", "line_number": 42, "usage_type": "name" }, { "api_name": "app.api.v1.schema.regdetails.RegistrationDetailsSchema", "line_number": 49, "usage_type": "call" }, { "api_name": "app.api.v1.models.regdetails.RegDetails.exists", "line_number":...
391135089
'''批量测试登录功能,获取图片验证码,登录后将结果截图保存''' from PIL import Image import matplotlib.pyplot as plt from selenium import webdriver from selenium.webdriver.common.keys import Keys import time import datetime url='https://pwd.apicloud.com/signin' driver = webdriver.Chrome() curr_url=driver.current_url def wait(): driver.implici...
null
Apicloud/practice/apicloud_login.py
apicloud_login.py
py
3,260
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.Image...
560802784
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 17 17:00:08 2017 @author: raulsanchez nohup python 1_model_selection.py > log.txt 2>err.txt & """ import xgboost as xgb import os import json import pandas as pd import numpy as np import torch from sklearn import pipeline, metrics, grid_searc...
null
1_model_selection.py
1_model_selection.py
py
5,761
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.exists", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_number": 39, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 40, "usage_type": "call" }, { "api_name": "xgboost.XGBRegressor", "line...
272632016
import os from tqdm import tqdm import json import torch import random from pathlib import Path from torch.utils.data import Dataset import torch.nn.functional as F from torch.distributions import Categorical from config import my_config class myDataset(Dataset): def __init__(self, config, split="test"): # data...
null
utils/sample_not_pad.py
sample_not_pad.py
py
6,349
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.utils.data.Dataset", "line_number": 12, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 22, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 27, "usage_type": "call" }, { "api_name": "os.listdir", "line_...
121820311
import logging formatter = logging.Formatter('%(clineno)d: %(message)s') fileHandler = logging.FileHandler('misc/output/test06.log', 'w') fileHandler.setFormatter(formatter) logger01 = logging.getLogger('test') logger01.addHandler(fileHandler) logger01.setLevel(logging.DEBUG)
null
test/config06.py
config06.py
py
281
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.Formatter", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.FileHandler", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", ...
142720208
# -*- coding: utf-8 -*- """ Created on Wed Apr 3 11:57:22 2019 @author: Sven van Koutrik """ import numpy as np import matplotlib.pyplot as plt from itertools import chain from scipy.optimize import brentq import kartlapsim.utils.constants as constants class Lapsim: def __init__(self, kartobj=None,trackobj=Non...
null
kartlapsim/lapsim.py
lapsim.py
py
6,232
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.gradient", "line_number": ...
311386978
# coding=utf-8 import random from slugify import slugify from sqlalchemy.orm import load_only from datetime import datetime, timedelta from database import db_session from flask import request, jsonify, json from models import * import json_model # - Fonction Flask - # """ Cette route est utilise par tous les clien...
null
controllers/client_controller.py
client_controller.py
py
11,148
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.jsonify", "line_number": 23, "usage_type": "call" }, { "api_name": "json_model.meteoJsontoString", "line_number": 23, "usage_type": "attribute" }, { "api_name": "flask.jsonify", "line_number": 37, "usage_type": "call" }, { "api_name": "slugify...
7643105
#Cliente TCP import socket import rsa # Endereco IP do Servidor SERVER = '127.0.0.1' # Porta que o Servidor esta escutando PORT = 5002 tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM) dest = (SERVER, PORT) tcp.connect(dest) print ('Para sair use CTRL+X\n') msg = input().encode('utf-8') while msg != '\x18': ...
null
client_tcp_2.py
client_tcp_2.py
py
720
python
en
code
null
code-starcoder2
83
[ { "api_name": "socket.socket", "line_number": 9, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 9, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rsa.PublicKey...
150022166
#!/usr/bin/env python import pika connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost')) channel = connection.channel() channel.queue_declare(queue='hello') inboxAll = ['hello'] print ("current inbox options are: ",inboxAll) inboxToSend = input("To which inbox do you want to send?") mess...
null
send.py
send.py
py
579
python
en
code
null
code-starcoder2
83
[ { "api_name": "pika.BlockingConnection", "line_number": 4, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 4, "usage_type": "call" } ]
32218343
#!/usr/bin/python from __future__ import absolute_import from __future__ import division from __future__ import print_function """ Authors: Dario Cazzani """ import sys sys.path.append('../') from config import set_config from helpers.misc import check_tf_version, extend_options from helpers.graph import get_variab...
null
generative-adversarial-autoencoder/train_mnist_FC.py
train_mnist_FC.py
py
10,874
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "line_number": 26, "usage_type": "call" }...
331872232
# patches core python lib - sockets - to be non-blocking. from gevent import monkey monkey.patch_all() import sys import signal import logging import gevent import traceback from datetime import datetime from odfuzz.arguments import ArgParser from odfuzz.fuzzer import Manager from odfuzz.statistics import Stats, Sta...
null
odfuzz/odfuzz.py
odfuzz.py
py
3,301
python
en
code
null
code-starcoder2
83
[ { "api_name": "gevent.monkey.patch_all", "line_number": 3, "usage_type": "call" }, { "api_name": "gevent.monkey", "line_number": 3, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 23, "usage_type": "attribute" }, { "api_name": "odfuzz.arguments.Ar...
365297652
bl_info = { "name": "Export Kokko Engine mesh", "description": "Export meshes to custom file format to be used by Kokko Engine", "author": "Aleksi Grön", "version": (1, 0, 1), "blender": (2, 80, 0), "location": "File > Export", "category": "Import-Export" } import bpy from bpy.props import ...
null
scripts/kokko_mesh_exporter/__init__.py
__init__.py
py
2,385
python
en
code
null
code-starcoder2
83
[ { "api_name": "bpy.types", "line_number": 15, "usage_type": "attribute" }, { "api_name": "bpy_extras.io_utils.ExportHelper", "line_number": 15, "usage_type": "name" }, { "api_name": "bpy.props.StringProperty", "line_number": 21, "usage_type": "call" }, { "api_name...
525281980
from sqlwrapper import gensql, dbget,dbput import datetime import json def HOTEL_AR_POST_INSERT_ARTransfer(request): From_account = request.json['From_account'] Invoice_no = request.json['Invoice_no'] To_aacount = request.json['To_aacount'] sql = json.loads(dbget("select open_amount from \ ...
null
HOTEL_AR_POST_INSERT_ARTransfer.py
HOTEL_AR_POST_INSERT_ARTransfer.py
py
1,452
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlwrapper.dbget", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlwrapper.dbput", "line_number": 17, "usage_type": "call" }, { "api_name": "sqlwrapper.dbput", "...
225812204
import discord from discord.ext import commands class CoreCog(commands.Cog): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_ready(self): """Prints message to terminal when bot is ready""" # Uses client.user to output name and id of bot print(...
null
cogs/corecog.py
corecog.py
py
1,799
python
en
code
null
code-starcoder2
83
[ { "api_name": "discord.ext.commands.Cog", "line_number": 5, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 5, "usage_type": "name" }, { "api_name": "discord.ext.commands.Cog.listener", "line_number": 9, "usage_type": "call" }, { ...
241189366
import io import os import json from io import BytesIO import boto3 from docx import Document class WordExtractor: def __init__(self, uri, log): self.log = log self.uri = uri self.word_uri = self.uri.lstrip('s3://') self.extractor_version = '1.0' def extract(self): se...
null
extractor/GdalExtractor/Word.py
Word.py
py
1,842
python
en
code
null
code-starcoder2
83
[ { "api_name": "boto3.client", "line_number": 30, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 32, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 32, "usage_type": "attribute" }, { "api_name": "boto3.session.Config", ...
146595354
from django.db import transaction from skills import models def serialize(): return ({ "name": skill.name, "slug": skill.slug, "cascade": [c.slug for c in skill.cascade], "weapon": skill.weapon, "characteristic": skill.upp_characteristic, "lede": skill.lede, ...
null
skills/persist.py
persist.py
py
1,062
python
en
code
null
code-starcoder2
83
[ { "api_name": "skills.models.Skill.objects.all", "line_number": 15, "usage_type": "call" }, { "api_name": "skills.models.Skill", "line_number": 15, "usage_type": "attribute" }, { "api_name": "skills.models", "line_number": 15, "usage_type": "name" }, { "api_name":...
156667423
import os from datetime import datetime try: from StringIO import StringIO except ImportError: from io import StringIO from fabric.api import local, task, lcd from pytz.reference import LocalTimezone def generate_package_date(): """ Reads the system date and time, including the timezone and returns ...
null
fabfile.py
fabfile.py
py
3,573
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "name" }, { "api_name": "pytz.reference.LocalTimezone", "line_number": 20, "usage_type": "call" }, { "api_name": "...
196445176
# -*- coding: utf-8 -*- from __future__ import unicode_literals import nltk.stem.porter as pt import nltk.stem.lancaster as lc import nltk.stem.snowball as sb words = ['table', 'probably', 'wolves', 'playing', 'is', 'dog', 'the', 'beaches', 'grounded', 'dreamt', 'envision'] pt_stemmer = pt.PorterStemm...
null
docs/02.AI_ML/code-1805/Day06all/stm.py
stm.py
py
604
python
en
code
null
code-starcoder2
83
[ { "api_name": "nltk.stem.porter.PorterStemmer", "line_number": 9, "usage_type": "call" }, { "api_name": "nltk.stem.porter", "line_number": 9, "usage_type": "name" }, { "api_name": "nltk.stem.lancaster.LancasterStemmer", "line_number": 10, "usage_type": "call" }, { ...