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
150515568
# Copyright 2013 FOODit Ltd. All Rights Reserved. import endpoints from protorpc import messages from protorpc import message_types from protorpc import remote from google.appengine.api import search from google.appengine.ext import ndb import yaml import math package = 'StreetSearchPkg' def distance(a, b): l...
null
streetsearch.py
streetsearch.py
py
11,210
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.radians", "line_number": 18, "usage_type": "attribute" }, { "api_name": "math.radians", "line_number": 19, "usage_type": "attribute" }, { "api_name": "math.sin", "line_number": 23, "usage_type": "call" }, { "api_name": "math.cos", "line_num...
513888394
# -*- coding: utf-8 -*- """ Created on Wed Mar 11 13:45:21 2020 Analyzes the kinematics of real fish data from VR experiments Includes code for: - getting speed and orientation from position (getSpeed, getOri) - smoothing and finding jumps/anomalies in data (cleanData) - identifying burst-glide information ...
null
get_kinematics_adult.py
get_kinematics_adult.py
py
28,194
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.subtract", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 32, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", ...
316663020
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import xgboost as xgb import datetime import operator from sklearn.cross_validation import train_test_split from collections import Counter from nltk.corpus import stopwords import matplotlib.pyplot as plt from pylab import plot, show, subplot, sp...
null
scripts/mo/char_features.py
char_features.py
py
7,588
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.seed", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 32, "usage_type": "attribute" }, { "api_name": "sklearn.cross_validation.train_test_split", "line_number": 37, "usage_type": "call" }, { "api...
430830887
# -*- coding: utf-8 -*- """The app module, containing the app factory function.""" import os from flask import Flask, render_template from webapp import public, user, post from webapp.assets import assets from webapp.extensions import ( bcrypt, cache, csrf_protect, db, debug_toolbar, login_manager, migrate, ...
null
webapp/app.py
app.py
py
1,995
python
en
code
null
code-starcoder2
83
[ { "api_name": "webapp.settings.ProdConfig", "line_number": 17, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 22, "usage_type": "call" }, { "api_name": "webapp.assets.assets.init_app", "line_number": 32, "usage_type": "call" }, { "api_name": "...
222914311
""" :copyright: (c) 2014 Building Energy Inc """ from django.test import TestCase from seed import decorators from seed.utils.cache import make_key, get_cache, get_lock, increment_cache, clear_cache class TestException(Exception): pass class TestDecorators(TestCase): """Tests for locking tasks and reportin...
null
seed/tests/test_decorators.py
test_decorators.py
py
3,123
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.test.TestCase", "line_number": 14, "usage_type": "name" }, { "api_name": "seed.utils.cache.clear_cache", "line_number": 22, "usage_type": "call" }, { "api_name": "seed.utils.cache.make_key", "line_number": 30, "usage_type": "call" }, { "api_n...
396073239
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' @Author:AkulaKirov @Blog: akulak.top @License: MPL 2.0 @Version 1.0 ''' import requests import json import hashlib import random url = 'http://www.xszongping.com/Health/EpidemicHealthRecord/postHealth' checkTokenT = 'http://www.xszongping.com/School/U...
null
UltimateLanGouMode.py
UltimateLanGouMode.py
py
3,988
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.post", "line_number": 34, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 35, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 49, "usage_type": "call" }, { "api_name": "requests.post", "line_num...
399272754
# -*- coding: UTF-8 -*- #使用训练样本和测试样本 import random from sklearn.model_selection import train_test_split from sklearn import preprocessing import numpy as np from sklearn import datasets boston = datasets.load_boston() x ,y = boston.data, boston.target x_MinMax = preprocessing.MinMaxScaler() y_MinMax = preprocessing....
null
python/Learn/Course/PythonDeepStudy/Chapter5/test5.5.py
test5.5.py
py
613
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.datasets.load_boston", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 9, "usage_type": "name" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 12, "usage_type": "call" }, { "ap...
536906341
import math import wx from wx.lib.masked import NumCtrl class ShearInputPopup(wx.Frame): def __init__(self, parent): self.parent = parent wx.PopupWindow.__init__(self, parent, style=wx.CLOSE_BOX ) self.rbox = wx.RadioBox(self,label = 'Shear Axis', pos = (50,10), choices = ['X-axis', 'Y-axis...
null
shear.py
shear.py
py
2,873
python
en
code
null
code-starcoder2
83
[ { "api_name": "wx.Frame", "line_number": 5, "usage_type": "attribute" }, { "api_name": "wx.PopupWindow.__init__", "line_number": 8, "usage_type": "call" }, { "api_name": "wx.PopupWindow", "line_number": 8, "usage_type": "attribute" }, { "api_name": "wx.CLOSE_BOX",...
143731296
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import sklearn import numpy as np import joblib import random import sys import numpy def distribution(dataset): feaValue = numpy.zeros(9) flag = dataset[0].strip().split()[10] #对当前数据集进行特征提取 for i in range(1,len(dataset)):...
null
Web/src/main/webapp/pythonFile/modelPrediction.py
modelPrediction.py
py
2,856
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.zeros", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 36, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.isnan", "line_number"...
581683646
import discord from discord.ext import commands import time import datetime import schedule import config @config.bot.event async def sprint_end(ctx, time_end): toc = time.time() while True: tic = time.time() if tic - toc >= (time_end * 60): break schedule.clear("timer") a...
null
sprint_time.py
sprint_time.py
py
874
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.time", "line_number": 10, "usage_type": "call" }, { "api_name": "time.time", "line_number": 13, "usage_type": "call" }, { "api_name": "schedule.clear", "line_number": 17, "usage_type": "call" }, { "api_name": "config.bot", "line_number": 8,...
255100769
import os import sys from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QApplication, QDialog, QPushButton, QFileDialog, \ QMessageBox, QProgressDialog from ui.View import RepositoryView from config import myconfig from form import Ui_Form from mythreads import WorkThread, BuildThread, PushThread class mywi...
null
main.py
main.py
py
5,836
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 13, "usage_type": "name" }, { "api_name": "form.Ui_Form", "line_number": 13, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.Qt.WindowMinimizeButtonHint", "line_number": 16, "usage_type": "attribute" }, { ...
125064980
import torch from torch import nn import torch.nn.functional as F from torch.autograd import Variable from math import sqrt from layers import * class DenseNet(nn.Module): """ Densely Connected Convolutional Neural Network [1]. Connects each layer to every other layer in a feed-forward fashion. This...
null
model.py
model.py
py
5,739
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 84, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
481324941
""" Adapters to run Pascal VOC mAP and COCO mAP on this platform Author: Josh McGrath """ from .ingestion import ingest_file import os from chainercv.evaluations import eval_detection_voc, eval_detection_coco import numpy as np from tqdm import tqdm import yaml import pandas as pd import click def get_identifiers(dir)...
null
cosmos/ingestion/ingest/process/detection/src/evaluate/evaluate_libs.py
evaluate_libs.py
py
2,878
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_num...
81824033
import sys import lifegame import os import curses data = lifegame.load('inputdata.txt') cur_board = lifegame.set_board(data) time = 1000 time_intergration = 0 lifegame.stdscr = curses.initscr() curses.curs_set(0) curses.start_color() curses.init_pair(1, 3, 0) while(True): lifegame.printBoard(cur_board) n...
null
main.py
main.py
py
508
python
en
code
null
code-starcoder2
83
[ { "api_name": "lifegame.load", "line_number": 7, "usage_type": "call" }, { "api_name": "lifegame.set_board", "line_number": 8, "usage_type": "call" }, { "api_name": "lifegame.stdscr", "line_number": 13, "usage_type": "attribute" }, { "api_name": "curses.initscr", ...
504693324
from PyQt5.QtWidgets import (QApplication, QComboBox, QDialog, QDialogButtonBox, QFormLayout, QFileDialog, QGridLayout, QGroupBox, QHBoxLayout, QInputDialog, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QSpinBox, QTextEdit, QVBoxLayout, QToolTip, QWidget) from PyQt5.QtGui import QIcon from ...
null
GUI_dev/sginals_and_slots.py
sginals_and_slots.py
py
1,619
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 12, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QFileDialog.Options", "line_number": 15, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QFileDialog", "line_number": 15, "usage_type": "name" }, ...
518746579
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap from xlrd import open_workbook, cellname import os # Creating Node class to fill them with data from class Node(): def __init__(self, ID, name, lng, lat, distance): self.id = ID self.name = st...
null
calc.py
calc.py
py
8,116
python
en
code
null
code-starcoder2
83
[ { "api_name": "xlrd.open_workbook", "line_number": 43, "usage_type": "call" }, { "api_name": "mpl_toolkits.basemap.Basemap", "line_number": 57, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.savefig", "line_number": 98, "usage_type": "call" }, { "api_nam...
490592499
import pandas as pd from sklearn.metrics.pairwise import cosine_distances import numpy as np import difflib import ast dataset = pd.read_csv('/dataset.csv', index_col=0) dataset = dataset.loc[dataset['popularity']>15] vectors = [] for x in list(dataset['vector']): l = ast.literal_eval(x) vectors.append(l) vec...
null
Semantic/Similar_Based_On_Genre.py
Similar_Based_On_Genre.py
py
1,338
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.metrics.pairwise....
412304140
import paramiko import time from PyLinux.settings import EMAIL_HOST_USER from .models import Monitor from RemoteLinux.models import NewLinux from django.http import HttpResponse from django.core.mail import send_mail # 导入django发送邮件模块 def monitor_send_email(): # 测试 # localtime = time.strftime("...
null
monitor/crontab.py
crontab.py
py
5,143
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.Monitor.objects.all", "line_number": 25, "usage_type": "call" }, { "api_name": "models.Monitor.objects", "line_number": 25, "usage_type": "attribute" }, { "api_name": "models.Monitor", "line_number": 25, "usage_type": "name" }, { "api_name": ...
407894649
# Copyright (c) 2011-2020 Eric Froemling # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
null
assets/src/ba_data/python/ba/_meta.py
_meta.py
py
15,361
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 33, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 47, "usage_type": "name" }, { "api_name": "dataclasses.field", "line_number": 47, "usage_type": "call" }, { "api_name": "dataclasses.datacl...
83888054
import collections #Time complexity: O(m*n) #Space complexity: O(m*n) #Works on leetcode: yes #Approach: We use a queue to perform BFS and start from the source cell. While queue is not empty, we pop from it and see #if the neighbouring cells are within bound and of original color, we add those cells to the queue. c...
null
Problem1.py
Problem1.py
py
1,643
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.deque", "line_number": 11, "usage_type": "call" } ]
207664813
import spider.tencent import http.client class HttpClientFetcher: __URL_PREFIX = "http://" + spider.tencent.HOSTNAME __PREFIX_LENGTH = len(__URL_PREFIX) __HEADERS = {"Connection": "keep-alive", "Cookie": "wblang=zh_CN"} def __init__(self): self.__connectWeiboHost() def __connectWeiboHost(self): self.__conne...
null
extras/weibo-spider/spider/tencent/fetcher.py
fetcher.py
py
1,025
python
en
code
null
code-starcoder2
83
[ { "api_name": "spider.tencent.tencent", "line_number": 5, "usage_type": "attribute" }, { "api_name": "spider.tencent", "line_number": 5, "usage_type": "name" }, { "api_name": "http.client.client.HTTPConnection", "line_number": 13, "usage_type": "call" }, { "api_na...
169258861
import os import sys import re from collections import namedtuple def identity(value): return value def round_2digits(value): if value: return round(float(value), 2) else: return 0.00 def round_lat_long(value): return round(float(value), 6) def to_lower(value): if value: ...
null
data_sources/taxi.py
taxi.py
py
4,709
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.namedtuple", "line_number": 24, "usage_type": "call" }, { "api_name": "re.search", "line_number": 74, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 140, "usage_type": "attribute" } ]
123588504
# Python Version 3.5.2 # File: minesweeper.py from tkinter import * from tkinter import messagebox import random from collections import deque class Minesweeper: def __init__(self, master): # import images self.tile_plain = PhotoImage(file = "images/tile_plain.gif") self.tile_clicked = P...
null
minesweeper.py
minesweeper.py
py
8,030
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.randint", "line_number": 50, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 204, "usage_type": "call" }, { "api_name": "tkinter.messagebox.showinfo", "line_number": 215, "usage_type": "call" }, { "api_name": "tkinte...
50259380
import unittest import nne import torchvision import torch import numpy as np class OnnxTests(unittest.TestCase): def __init__(self, *args, **kwargs): super(OnnxTests, self).__init__(*args, **kwargs) def test_onnx(self): input_shape = (1, 3, 64, 64) onnx_file = 'resnet.onnx' mo...
null
test/test_onnx.py
test_onnx.py
py
798
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torchvision.models.resnet34", "line_number": 14, "usage_type": "call" }, { "api_name": "torchvision.models", "line_number": 14, "usage_type": "attribute" }, { "api_nam...
496617439
from pydoc import locate from django.db import models from ltilaunch.models import LTIToolConsumer class LTIUserMatcher: lti_user_model = "ltilaunch.models.LTIUser" def _scope_to_consumer_group(self, lti_consumer: LTIToolConsumer): all_users = locate(self.lti_user_mo...
null
ltilaunch/usermatch.py
usermatch.py
py
2,798
python
en
code
null
code-starcoder2
83
[ { "api_name": "ltilaunch.models.LTIToolConsumer", "line_number": 11, "usage_type": "name" }, { "api_name": "pydoc.locate", "line_number": 12, "usage_type": "call" }, { "api_name": "ltilaunch.models.LTIToolConsumer.objects.filter", "line_number": 15, "usage_type": "call" ...
437859762
''' Developer: Derek Bringewatt Email: dev.dbbring@gmail.com Date: 3/16/2018 Version: 1.0 Purpose: Enter the tickers that appear on your scans in a text file. This program will grab those tickers, and parse the Yahoo Finace for standard company information. After that, it will grab the daily data on each stock in the ...
null
Stock-Strategy-Test/strategy-tester_ver_1_0.py
strategy-tester_ver_1_0.py
py
14,157
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.date.today", "line_number": 41, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 41, "usage_type": "name" }, { "api_name": "urllib3.PoolManager", "line_number": 64, "usage_type": "call" }, { "api_name": "certifi.where",...
398536696
"""Support for Bosch Thermostat Sensor.""" from bosch_thermostat_client.const import RECORDINGS, SENSOR, SENSORS, REGULAR from bosch_thermostat_client.const.easycontrol import ENERGY from homeassistant.helpers.dispatcher import async_dispatcher_send from ..const import CIRCUITS, DOMAIN, GATEWAY, SIGNAL_BOSCH, UUID fr...
null
custom_components/bosch/sensor/__init__.py
__init__.py
py
3,505
python
en
code
null
code-starcoder2
83
[ { "api_name": "const.UUID", "line_number": 16, "usage_type": "name" }, { "api_name": "const.DOMAIN", "line_number": 17, "usage_type": "name" }, { "api_name": "bosch_thermostat_client.const.SENSORS", "line_number": 18, "usage_type": "argument" }, { "api_name": "bos...
421017778
import numpy as np; import matplotlib.pyplot as plt; import math; ''' Calculate the cost function result for the theta J=(h-y)'*(h-y)/(2*m); ''' def costFunction(X, y, theta): # calculate hypothesis values through vector multiplication h = np.matmul(X, theta); # difference between theoretical result and...
null
1-Univariate_Linear_Regression/mlAlgorithms.py
mlAlgorithms.py
py
5,285
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.matmul", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.matmul", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number"...
106886290
# -*- coding: utf-8 -*- """Constants.""" import logging import os import pathlib import sys import dotenv from . import __package__ as PACKAGE_ROOT DEFAULT_PATH = os.getcwd() AX_ENV = os.environ.get("AX_ENV", "").strip() or DEFAULT_PATH def load_dotenv(ax_env=AX_ENV, reenv=False, verbose=False): """Pass.""" ...
null
axonius_api_client/constants.py
constants.py
py
8,975
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.getcwd", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_n...
622363262
# --*-- coding=utf-8 --*-- import io from conf.config import SAVEFILE def savefile(res): with io.open(SAVEFILE, mode='a+', encoding='utf-8') as savefile: if isinstance(res, basestring): savefile.write(res.encode('utf-8') + u"\n") savefile.flush() elif isinstance(res, list...
null
core/baisc.py
baisc.py
py
604
python
en
code
null
code-starcoder2
83
[ { "api_name": "io.open", "line_number": 9, "usage_type": "call" }, { "api_name": "conf.config.SAVEFILE", "line_number": 9, "usage_type": "argument" } ]
583329793
from selenium import webdriver import time import math import os link = "http://suninjuly.github.io/file_input.html" browser = webdriver.Chrome("C:/chromedriver/chromedriver.exe") try: browser.get(link) input1 = browser.find_element_by_name("firstname") input1.send_keys("kate") input2 = browser.find_...
null
u2_l2.2_chapter8.py
u2_l2.2_chapter8.py
py
1,051
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", ...
545411799
import os from typing import Any from cowait.network import get_local_connstr from .definition import TaskDefinition from .components import TaskManager, RpcComponent, rpc CURRENT_TASK = None class Task(TaskDefinition): def __init__( self, **inputs, ): """ Creates a new insta...
null
cowait/tasks/task.py
task.py
py
3,529
python
en
code
null
code-starcoder2
83
[ { "api_name": "definition.TaskDefinition", "line_number": 11, "usage_type": "name" }, { "api_name": "components.TaskManager", "line_number": 25, "usage_type": "call" }, { "api_name": "components.RpcComponent", "line_number": 26, "usage_type": "call" }, { "api_name...
361648740
import pyaudio import wave # import numpy as np def record_start(): CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 2 RATE = 44100 RECORD_SECONDS = 4 WAVE_OUTPUT_FILENAME = "output.wav" p = pyaudio.PyAudio() stream = p.open(format = FORMAT, channels = CHANNELS, ...
null
record.py
record.py
py
1,023
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyaudio.paInt16", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pyaudio.PyAudio", "line_number": 13, "usage_type": "call" }, { "api_name": "wave.open", "line_number": 37, "usage_type": "call" } ]
504128760
# topics = ["栈"] from typing import List class Solution: def reverseParentheses(self, s: str) -> str: """ Stack time O(n), space O(n), n 为字符串的长度 """ n = len(s) stack: List[int] = [] pair = [0] * n # pair 记录对应的左右括号的索引 for i in range(n): ...
null
algorithms/[1190]反转每对括号间的子串/solution.py
solution.py
py
958
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 28, "usage_type": "name" } ]
198009214
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
null
src/zope/app/publication/ftp.py
ftp.py
py
1,810
python
en
code
null
code-starcoder2
83
[ { "api_name": "zope.app.publication.zopepublication.ZopePublication", "line_number": 23, "usage_type": "name" }, { "api_name": "zope.component.component.queryMultiAdapter", "line_number": 28, "usage_type": "call" }, { "api_name": "zope.component.component", "line_number": 28,...
169901177
import requests from io import BytesIO from PIL import Image r= requests.get("https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260") image=Image.open(BytesIO(r.content)) print("status code :",r.status_code) print(image.size,image.mode,image.form...
null
section_7/pil.py
pil.py
py
440
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 7, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 7, "usage_type": "name" }, { "api_name": "io.BytesIO", "line_number": 7,...
47734614
# Copyright (c) 2016 Catalyst IT Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
null
distil/service/api/v2/measurements.py
measurements.py
py
2,073
python
en
code
null
code-starcoder2
83
[ { "api_name": "oslo_log.log.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "oslo_log.log", "line_number": 24, "usage_type": "name" }, { "api_name": "distil.db.api.resource_get_by_ids", "line_number": 33, "usage_type": "call" }, { "api_name": ...
370194611
import soundfile as sf import numpy as np import sys def main(): print("conv.py - convolution based reverberation") x, srx = sf.read('anechoic1.wav') h, srh = sf.read('Concertgebouw-m.wav') print (x.shape) print (h.shape) if srx != srh: sys.exit('sr must be the same in both files')...
null
02_convolution/code/conv.py
conv.py
py
743
python
en
code
null
code-starcoder2
83
[ { "api_name": "soundfile.read", "line_number": 7, "usage_type": "call" }, { "api_name": "soundfile.read", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number...
233055663
#!/usr/bin/env python3 import pygame black = (0, 0, 0) white = (255, 255, 255) class Player(pygame.sprite.Sprite): def __init__(self, x, y): super().__init__() self.image = pygame.Surface([15, 15]) self.image.fill(black) self.rect = self.image.get_rect() self.rect.x = x self.rect.y = y self.change_...
null
Sprites/move_sprite_keyboard_smooth.py
move_sprite_keyboard_smooth.py
py
1,592
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.sprite", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.Surface", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 30, "usage_type": "call" }, { "api_name": "pygame.display.set_mode"...
388206884
#!/usr/bin/python3 from sys import argv, stderr import re from os.path import basename, splitext, exists from sqlite3 import connect from os import remove from shutil import move import logging import locale from time import strftime from glob import glob for db in glob("*.db"): move(db, "/home/andreas") locale....
null
tokenise.py
tokenise.py
py
1,926
python
en
code
null
code-starcoder2
83
[ { "api_name": "glob.glob", "line_number": 14, "usage_type": "call" }, { "api_name": "shutil.move", "line_number": 15, "usage_type": "call" }, { "api_name": "locale.setlocale", "line_number": 17, "usage_type": "call" }, { "api_name": "locale.LC_ALL", "line_numb...
534745643
import http.server import socketserver PORT = 8000 def append_data(data): f = open('data.txt', 'a') array = data[2:-2].split("],[") for a in array: f.write(a+"\n") f.close() def change_properties(): with open("properties.js", "r+") as f: read_data = f.read().split('\n') lastTarget = int(rea...
null
p5_memory/server.py
server.py
py
1,191
python
en
code
null
code-starcoder2
83
[ { "api_name": "http.server.server", "line_number": 26, "usage_type": "attribute" }, { "api_name": "http.server", "line_number": 26, "usage_type": "name" }, { "api_name": "socketserver.TCPServer", "line_number": 41, "usage_type": "call" } ]
544635983
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import abc import unittest from logging import Logger from shadow_inject.binder import Binder class AbstractCar(object): __metaclass__ = abc.ABCMeta class Printer(object): def __init__(self, logger)...
null
shadow_inject/tests/test_logger_injection.py
test_logger_injection.py
py
767
python
en
code
null
code-starcoder2
83
[ { "api_name": "abc.ABCMeta", "line_number": 13, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 25, "usage_type": "attribute" }, { "api_name": "shadow_inject.binder.Binder", "line_number": 29, "usage_type": "call" }, { "api_name": "l...
212648804
from PIL import Image, ImageEnhance, ImageDraw, ImageFont font = ImageFont.truetype("MONACO.TTF", size=250) fillcolor = '#FF0000' im = Image.open("./yeskirai.jpg") draw=ImageDraw.Draw(im) draw.text((450, 0), chr(52), font=font, fill=fillcolor) # im.show() im.save("kirai.jpg")
null
0000.py
0000.py
py
280
python
en
code
null
code-starcoder2
83
[ { "api_name": "PIL.ImageFont.truetype", "line_number": 3, "usage_type": "call" }, { "api_name": "PIL.ImageFont", "line_number": 3, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 6, "usage_type": "call" }, { "api_name": "PIL.Image", "lin...
547232053
""" This file demonstrates two different styles of tests (one doctest and one unittest). These will both pass when you run "manage.py test". Replace these with more appropriate tests for your application. """ import urllib from django.http import HttpRequest from django.test import TestCase from django.test.client im...
null
DjangoProject/HvZ/tests.py
tests.py
py
2,195
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.test.TestCase", "line_number": 19, "usage_type": "name" }, { "api_name": "HvZ.views.views.anonymous_info", "line_number": 22, "usage_type": "call" }, { "api_name": "HvZ.views.views", "line_number": 22, "usage_type": "attribute" }, { "api_name...
163707785
import xml.etree.ElementTree as ET import pickle import os from os import listdir, getcwd from os.path import join, split from glob import glob #TO EDIT xml_dirs = ['/Users/sunyitao/Documents/XRVision/PSA/extracted_images/xml/060VIDEO/', #needs to end with slashes '/Users/sunyitao/Documents/XRVision/PSA/ext...
null
yolo_xml_to_txt.py
yolo_xml_to_txt.py
py
3,438
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path.split", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 41, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.parse",...
42087792
import itertools as it import numpy as np from environment import config class SplendorStateEncoder: def __init__(self): self.COLORS = ['green', 'white', 'blue', 'black', 'red'] self.pick_tokens = {cnt : list(it.combinations(self.COLORS.copy(),cnt)) for cnt in [3,2,1]} self.pick_tokens['dou...
null
splendor_ai/splendor_state_encoder.py
splendor_state_encoder.py
py
6,068
python
en
code
null
code-starcoder2
83
[ { "api_name": "itertools.combinations", "line_number": 8, "usage_type": "call" }, { "api_name": "environment.config.MAXIMUM_RESERVATIONS", "line_number": 14, "usage_type": "attribute" }, { "api_name": "environment.config", "line_number": 14, "usage_type": "name" }, { ...
613135611
""" Collection of tasks specific for automating MD simulations. Look at the "MD Workflow.pdf" file for an overview of how an MD Workflow works. This new version works with updated config files that uses fw_env for settings. """ from __future__ import division __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2...
null
firechute/relaxation/test_wt.py
test_wt.py
py
5,436
python
en
code
null
code-starcoder2
83
[ { "api_name": "pymacy.utils.log_utils.get_logger", "line_number": 49, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 49, "usage_type": "attribute" }, { "api_name": "fireworks.FireTaskBase", "line_number": 53, "usage_type": "name" }, { "api_n...
115636340
from __future__ import print_function import csv, multiprocessing, cv2, os import numpy as np import urllib #import urllib.request #import urllib2 import time, random import requests import http.client requests.packages.urllib3.disable_warnings() def url_to_image(url): #proxy_addr = getproxy() #proxy = {'http...
null
download_train.py
download_train.py
py
3,987
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.packages", "line_number": 10, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "ap...
645807166
import os, sys path = os.path.dirname(os.path.realpath('__file__')) os.chdir(path) sys.path.append(os.path.dirname(path)) import matplotlib.pyplot as plt import numpy as np from marketsim import MarketSim # create a new market simulation real market data market = MarketSim(fin='data/input_dummy.csv', fout='data/out...
null
main.py
main.py
py
1,373
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 2, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 2, "usage_type": "call" }, { "api_name": "os.chdir", "line_numbe...
125797022
import pygame as pg, sys, random from pygame.locals import * pg.init() pg.display.set_caption('Block collision game by Azez Nassar') fr = pg.time.Clock() sq = 50 speed = 10 score = 0 done = False game_width = 800 game_height = 600 player_pos = [game_width / 2, game_height - 1.2 * sq] player_color = (0, 153, 76) score...
null
app.py
app.py
py
3,156
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_caption", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.time.C...
375664651
from django.contrib import admin from django.urls import path, include from django.conf import settings from django.conf.urls.static import static from blog import views from blog.models import SiteSettings from django_filters.views import FilterView if settings.SITE_ONLINE: urlpatterns = [ path('master-panel...
null
myblog/urls.py
urls.py
py
1,127
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.settings.SITE_ONLINE", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 10, "usage_type": "name" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_n...
359549312
import os import requests import json import sys import argparse from argparse import RawTextHelpFormatter ################################ EDIT ############################### tau_url = 'https://tautulli.domain.ltd' plex_url = 'https://plex.domain.ltd:32400' tau_api_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' plex_tok...
null
debug_stats_monitoring/scripts/plex_health_stats_operations.py
plex_health_stats_operations.py
py
4,120
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 62, "usage_type": "call" }, { "api_name": "argparse.RawTextHel...
278827742
#Graphviz - Christian Lück (Maintainer) from graphviz import Digraph class Nodo: #constructor def __init__(self, orden, hoja): self.orden = orden self.hoja = hoja self.cuenta = 0 self.siguiente = None self.claves = [] self.hijos = [] self.padre = None ...
null
storage/team08/ArbolB+.py
ArbolB+.py
py
6,527
python
en
code
null
code-starcoder2
83
[ { "api_name": "graphviz.Digraph", "line_number": 173, "usage_type": "call" } ]
214198572
### xenotation # http://hyperstition.abstractdynamics.org/archives/003538.html # http://hyperstition.abstractdynamics.org/archives/005047.html # the below from stack overflow import random def primesbelow(N): # http://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python/3035188#303...
null
xenotation.py
xenotation.py
py
4,977
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.randrange", "line_number": 43, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 61, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 184, "usage_type": "call" } ]
639184819
from django.shortcuts import render from django.http import HttpResponse from . import utils import json # from app.utils import getDataDanhSach # Create your views here. def api_codeAnalysis(request): count = utils.codeAnalysis() print(count) danhsach = utils.getDataDanhSach() # print(danhsach) te...
null
analysis/apis.py
apis.py
py
1,233
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 20, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 28, "usage_type": "call" }, { "api_name": "django.http.HttpRespon...
553369226
from setuptools import setup import codecs import os import re here = os.path.abspath(os.path.dirname(__file__)) def read(*parts): with codecs.open(os.path.join(here, *parts), 'r') as fp: return fp.read() # https://packaging.python.org/guides/single-sourcing-package-version/ def find_version(*file_paths)...
null
setup.py
setup.py
py
1,472
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "codecs.open", "line_num...
156014856
import datetime class Person: def setPerson(self,name,age): self.name=name self.age=age def printPerson(self): print(self.name,self.age) class Bank(Person): bank_name="sdk" def createAccount(self,acno,balance): self.accountno=acno self.balance=3000 def deposit(s...
null
luminarprojects/objectorientedprograming/bank.py
bank.py
py
1,033
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.date.today", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 27, "usage_type": "attribute" } ]
374452502
"""Testing utilities for the MNE BIDS converter.""" # Authors: Chris Holdgraf <choldgraf@berkeley.edu> # Mainak Jas <mainak.jas@telecom-paristech.fr> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # # License: BSD (3-clause) import os.path as op import pytest from datetime import datetime from sci...
null
mne_bids/tests/test_utils.py
test_utils.py
py
8,754
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 23, "usage_type": "call" }, { "api_name": "mne.__file__", "line_number"...
532103404
import time import pandas as pd import numpy as np import json CITY_DATA = { 'chicago': 'chicago.csv', 'new york city': 'new_york_city.csv', 'washington': 'washington.csv' } Possible_cities = [ "new york city", "chicago", "washington" ] Possible_months = [ "january", "february", "ma...
null
bikeshare_2.py.py
bikeshare_2.py.py
py
7,619
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 68, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 70, "usage_type": "call" }, { "api_name": "time.time", "line_number": 90, "usage_type": "call" }, { "api_name": "time.time", "line_nu...
540892072
# -*- coding:utf-8 -*- # # Copyright @ 2016 OPS Inc. # # Author: jinlong.yang # import logging LOG = logging.getLogger(__name__) class DashboardBlls(object): def summary_infos(self): data_info = [] en_list = ['Users', 'Hosts', 'Switchs', 'Plant Rooms'] ch_list = ['用户数', '服务器数', '交换机数', ...
null
lopez/webapps/license/blls/license.py
license.py
py
675
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" } ]
54370412
import logging from os import path DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = ':memory:' ROOT_URLCONF = 'tardis.urls' DEBUG = True STATIC_DOC_ROOT = path.join(path.abspath(path.dirname(__file__)), 'tardis_portal/site_media') # LDAP configuration LDAP_ENABLE = False FILE_STORE_PATH = path...
null
branches/mrtardis/tardis/test_settings.py
test_settings.py
py
1,482
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number"...
282052318
from __future__ import print_function import argparse import numpy as np import network_wrapper from carla.client import make_carla_client from carla.sensor import Camera from carla.settings import CarlaSettings from carla.tcp import TCPConnectionError def run(host, port, online_training): n_episodes = args.ep...
null
intelligent_client.py
intelligent_client.py
py
5,284
python
en
code
null
code-starcoder2
83
[ { "api_name": "carla.client.make_carla_client", "line_number": 20, "usage_type": "call" }, { "api_name": "carla.settings.CarlaSettings", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 30, "usage_type": "call" }, { "a...
465474371
# Thammasat University, DSI # DSI 207 Optimization # Exercise 1 "Linear Optimization: Show how to plot a feasible region" # @author Roland Petrasch # @date 23. Mar. 2020 # @version 1.0 import matplotlib.pyplot as plt from matplotlib.collections import LineCollection import numpy as np xmax=110 increment=10 x = np.a...
null
DSI/src/dsi207/4_LinearProgramming/FeasibleRegionExample.py
FeasibleRegionExample.py
py
984
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.arange", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.maximum", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.minimum", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots",...
593037289
""" sentry.models.user ~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import warnings from django.contrib.auth.models import AbstractBaseUser, UserManager from django.db import mode...
null
src/sentry/models/user.py
user.py
py
3,600
python
en
code
null
code-starcoder2
83
[ { "api_name": "sentry.db.models.BaseManager", "line_number": 20, "usage_type": "name" }, { "api_name": "sentry.db.models.Model", "line_number": 24, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.AbstractBaseUser", "line_number": 24, "usage_type": "name"...
51254511
import numpy as np import time import argparse from tqdm import tqdm from keras.datasets import mnist, cifar10 from keras.models import load_model, Model from sa import fetch_dsa, fetch_lsa, get_sc from utils import * # using to extract SA score of different layers CLIP_MIN = -0.5 CLIP_MAX = 0.5 if __name__ == "__...
null
run_output_sa_test_update.py
run_output_sa_test_update.py
py
2,772
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "keras.datasets.cifar10.load_data", "line_number": 82, "usage_type": "call" }, { "api_name": "keras.datasets.cifar10", "line_number": 82, "usage_type": "name" }, { "a...
532180619
from docker.utils import create_host_config from common_fixtures import * # NOQA import websocket as ws from test_container import assert_execute, assert_stats, assert_ip_inject CONTAINER_APPEAR_TIMEOUT_MSG = 'Timed out waiting for container ' \ 'to appear. Name: [%s].' NATIVE_TEST_IMA...
null
tests/v3_validation/cattlevalidationtest/core/test_native_docker.py
test_native_docker.py
py
16,437
python
en
code
null
code-starcoder2
83
[ { "api_name": "docker.utils.create_host_config", "line_number": 61, "usage_type": "call" }, { "api_name": "docker.utils.create_host_config", "line_number": 74, "usage_type": "call" }, { "api_name": "docker.utils.create_host_config", "line_number": 96, "usage_type": "call"...
71804529
import deform import re from pyramid.i18n import get_locale_name from pyramid.httpexceptions import HTTPFound, HTTPBadRequest, HTTPNotFound from pyramid.httpexceptions import HTTPUnauthorized from pyramid.renderers import render_to_response from pyramid.security import remember from pyramid.view import view_config fro...
null
eduiddashboard/views/portal.py
portal.py
py
12,422
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 34, "usage_type": "call" }, { "api_name": "eduiddashboard.session.get_session_user", "line_number": 44, "usage_type": "call" }, { "api_name": "eduiddashboard.utils.get_available_tabs", "line_number": 48, "usage_type": "cal...
405206181
# -*- coding: UTF-8 -*- import sys, os import html2text import tornado.escape import config from whoosh.index import create_in, open_dir from whoosh.fields import * from whoosh.qparser import QueryParser from jieba.analyse import ChineseAnalyzer # sys.path.append('/opt/torlite/yunsuan') from torli...
null
script_gen_whoosh_database.py
script_gen_whoosh_database.py
py
2,889
python
en
code
null
code-starcoder2
83
[ { "api_name": "torlite.model.mpost.MPost", "line_number": 23, "usage_type": "call" }, { "api_name": "html2text.html2text", "line_number": 28, "usage_type": "call" }, { "api_name": "tornado.escape.escape.xhtml_unescape", "line_number": 28, "usage_type": "call" }, { ...
366943764
#!/usr/bin/python from flask import Flask, request import os import sys OUTFILENAME = 'output' TOKEN = '2Ff40CE7GILrWayppkW6Ybs5TgIaCh1m' # # REST SERVICE HANDLER # app = Flask(__name__) @app.route('/pinterest', methods=['POST']) def index(): url = request.form['url'] token = request.form['token'] if...
null
pint_svc.py
pint_svc.py
py
660
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 19, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 19, "usage_type": "name" }, { "api_name": "flask.request.form"...
329064937
from asgiref.sync import async_to_sync from channels.generic.websocket import WebsocketConsumer from knox.auth import TokenAuthentication from rest_framework import exceptions, HTTP_HEADER_ENCODING class NotificationConsumer(WebsocketConsumer): def connect(self): self.token = self.scope['url_route']['kwa...
null
halemate/consumers.py
consumers.py
py
1,084
python
en
code
null
code-starcoder2
83
[ { "api_name": "channels.generic.websocket.WebsocketConsumer", "line_number": 7, "usage_type": "name" }, { "api_name": "knox.auth.TokenAuthentication", "line_number": 12, "usage_type": "call" }, { "api_name": "rest_framework.HTTP_HEADER_ENCODING", "line_number": 13, "usage...
523486803
#!/usr/bin/env python # -*- coding: utf-8 -*- """ tools for getting questions and tournaments from db.chgk.info """ import json from urllib.request import urlopen, HTTPError from bs4 import BeautifulSoup def neat(text): """ texts of questions from db.chgk.info contain many unnecessary newline symbols. Thi...
null
xml_tools.py
xml_tools.py
py
5,756
python
en
code
null
code-starcoder2
83
[ { "api_name": "bs4.BeautifulSoup", "line_number": 33, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 44, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 45, "usage_type": "call" }, { "api_name": "urllib.req...
442760271
from mxnet import nd, gluon, init, autograd, gpu from mxnet.gluon import nn import mxnet from mxnet.gluon.data.vision import datasets, transforms import matplotlib.pyplot as plt from time import time import pickle import numpy as np import string batch_size = 256 def acc(output, label): Accuracy = (output.argmax...
null
Workshop_Nvidia_DLI/ImageBased/Blood_Cell_Classification/mxnet_BloodCell_3D.py
mxnet_BloodCell_3D.py
py
3,278
python
en
code
null
code-starcoder2
83
[ { "api_name": "mxnet.gluon.data.vision.transforms.Compose", "line_number": 20, "usage_type": "call" }, { "api_name": "mxnet.gluon.data.vision.transforms", "line_number": 20, "usage_type": "name" }, { "api_name": "mxnet.gluon.data.vision.transforms.ToTensor", "line_number": 21...
525253580
import requests import time url = "https://api.map.baidu.com/locapi/v2" header = { "key": "xLbL8WZK0RmwA98VThCPB0xSRSS27ulK", "src": "aaa", "prod": "aaa", "ver": "1.0", "trace": "0" } data = { "accesstype": 1, "macs": 1, "ctime": str(int(time.time()*1000)), } response = requests.post(u...
null
yl_python_code/MY_spider/APITest/baiduAPI/test.py
test.py
py
391
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 18, "usage_type": "call" } ]
94758070
r"""Test loss function of LSTM language model. Test target: - :py:meth:`lmp.model.LSTMModel.loss_fn`. """ import torch from lmp.model import LSTMModel def test_input_shape_and_dtype( lstm_model: LSTMModel, batch_prev_tkids: torch.Tensor, batch_next_tkids: torch.Tensor, ): r"""Input tensors must be ...
null
test/lmp/model/_lstm/test_loss_fn.py
test_loss_fn.py
py
1,806
python
en
code
null
code-starcoder2
83
[ { "api_name": "lmp.model.LSTMModel", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.Tensor", "line_number": 15, "usage_type": "attribute" }, { "api_name": "lmp.model.LST...
560138465
# -*- coding: utf-8 -*- # # * Copyright (c) 2009-2015. Authors: see NOTICE file. # * # * Licensed under the Apache License, Version 2.0 (the "License"); # * you may not use this file except in compliance with the License. # * You may obtain a copy of the License at # * # * http://www.apache.org/licenses/LICENSE-2...
null
download.py
download.py
py
2,320
python
en
code
null
code-starcoder2
83
[ { "api_name": "shapely.wkt.wkt.loads", "line_number": 43, "usage_type": "call" }, { "api_name": "shapely.wkt.wkt", "line_number": 43, "usage_type": "attribute" }, { "api_name": "shapely.wkt", "line_number": 43, "usage_type": "name" }, { "api_name": "shapely.wkt.wk...
66750759
# -*- coding: utf-8 -*- # Copyright 2017, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. # pylint: disable=invalid-name """ One-pulse single-qubit gate. """ from qiskit.circuit import CompositeGate from qiskit.cir...
null
qiskit/extensions/standard/u2.py
u2.py
py
1,801
python
en
code
null
code-starcoder2
83
[ { "api_name": "qiskit.circuit.Gate", "line_number": 23, "usage_type": "name" }, { "api_name": "qiskit.dagcircuit.DAGCircuit", "line_number": 31, "usage_type": "call" }, { "api_name": "qiskit.circuit.QuantumRegister", "line_number": 32, "usage_type": "call" }, { "a...
613336130
import cv2 as cv import numpy as np from multiprocessing import Queue, Process from pyzbar import pyzbar CAM_ID = 0 CAM_WIDTH = 352 #480 CAM_HEIGHT = 288 #320 signal = 'N' data = "" ### blue, red 영역의 from ~ to 값의 범위 lower_blue = np.array([90, 171, 149]) upper_blue = np.array([120,255,255]) lower_re...
null
코드/프로젝트/import_detect.py
import_detect.py
py
4,479
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
615832184
from django.conf.urls.defaults import patterns, include, url urlpatterns = patterns('', url(r'^$', 'chat.views.chat', name='chat'), url(r'prueba', 'chat.views.prueba'), url(r'conversation', 'chat.views.conversation'), url(r'messages', 'chat.views.messages'), )
null
urls.py
urls.py
py
277
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.defaults.patterns", "line_number": 3, "usage_type": "call" }, { "api_name": "django.conf.urls.defaults.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.defaults.url", "line_number": 6, "usage_type": "call" }...
268873453
import pandas as pd import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import numpy as np from sklearn.decomposition import PCA from scipy import signal class PCAImpl(object): def __init__(self, title_prefix, X, random_seed): self.X = X self.title_prefix = title_prefix ...
null
Assignment3/UnSupervisedLearning/PCAImpl.py
PCAImpl.py
py
2,181
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sklearn.decompositi...
511613895
# -*- coding: utf-8 -*- # # @Author yxiao@aliyun.com # import os import io import sys import xlwt import xlrd import csv from pymongo import * from collections import Counter client = MongoClient('localhost', 27017) db_excel = client.ctrip_comment collection_names = db_excel.collection_names() for collection_name in...
null
spiders/batch_mongodb_to_excel_ctrip_comment.py
batch_mongodb_to_excel_ctrip_comment.py
py
1,617
python
en
code
null
code-starcoder2
83
[ { "api_name": "xlwt.Workbook", "line_number": 23, "usage_type": "call" } ]
27635029
from tkinter import * from tkinter import messagebox from tkinter import * import cv2 from PIL import Image, ImageTk import cv2 import time import webbrowser # 註冊網站 url = 'https://www.google.com.tw/?hl=zh-TW' root = Tk() root.title("Take a shot") def take_shot(): cap = cv2.VideoCapture(0, cv2.CAP_DSH...
null
footprint/take_a_shot.py
take_a_shot.py
py
1,683
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.VideoCapture", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.CAP_DSHOW", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cv2.waitKey", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.flip", "line_...
381964430
import matplotlib.pyplot as plt import argparse import numpy parser = argparse.ArgumentParser(description='Parse log file.') parser.add_argument('log', metavar='N', type=str, nargs='+', help='File to parse.') args = parser.parse_args() file_name = str(args.log).replace("[\'","").replace("\']","") ...
null
src/LogPlotter/plot.py
plot.py
py
2,196
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 41, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 41, "usage_type": "name" }, { "api_name": "mat...
25324606
import numpy as np import cv2 from math import sin, cos, atan2, degrees, pi, tan, radians, sqrt def p3(labels_in): # retrun [database_out, overlays_out] """ Each object contains at least the following attributes. "object_label", the index label of the object "x_position" of the center "y_position...
null
HW1/assignment1/HW1_jchoi100/p3.py
p3.py
py
3,338
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.atan2", "line_number": 58, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 59, "usage_type": "name" }, { "api_name": "math.sin", "line_number": 61, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 61, "us...
571096282
import json, os, sys sys.path.append('..') from collections import Counter import re from lib import utils def vg_iid_2_vqa_iid(iid, opt): return iid + opt['vgenome']['base_image_id'] def vqa_iid_2_vg_iid(iid, opt): if iid < opt['vgenome']['base_image_id']: raise ValueError return iid - opt['vgenome']['base...
null
vqa/datasets/vgenome.py
vgenome.py
py
1,573
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "lib.utils.xprocess", "line_number": 27, "usage_type": "call" }, { "api_name": "lib.utils", "line_...
298776681
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Feb 25 01:11:03 2018 @author: mohanacharya """ # RNN for predicting Google Stock Prices # importing the libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt # import only the training set dataset_train = pd.read_csv('Goo...
null
RecurrentNeuralNetwork.py
RecurrentNeuralNetwork.py
py
3,319
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy....
537978020
import sys import re import collections # time crunch functions def crunch_time(days, hours, data): days[data[0]] += 1 hours[data[1]] += 1 def output_time(days, hours, out_file): out_file.write("Time frequencies:\n") for k,v in days.items(): out_file.write(k + ": " + str(v) + "\n") out_file.write("\n\...
null
tools/crunch2.py
crunch2.py
py
4,594
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 94, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 95, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 97, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 98...
338950631
import os os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'APP_NAME.settings') import django import csv django.setup() from videos.models import MODEL_NAMES from taggit.models import Tag def populate(): print("In the populator now....") try: with open('FILE.csv') as csvfile: csvreader = csv.reader(csvfile, de...
null
populate.py
populate.py
py
1,990
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ.setdefault", "line_number": 2, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "django.setup", "line_number": 5, "usage_type": "call" }, { "api_name": "csv.reader", "lin...
295309621
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('User', '0016_user_is_delete'), ] operations = [ migrations.AlterField( model_name='friends', name='f...
null
fateMeet/User/migrations/0017_auto_20170407_1500.py
0017_auto_20170407_1500.py
py
644
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.AlterField", "line_number": 14, "usage_type": "call" }, {...
167856111
from django.db import models class Category (models.Model): name = models.CharField(max_length = 100) order = models.IntegerField(blank = False, null = False, default=1e5) def __unicode__(self): return self.name class Meta: ordering = ('order',) class Link (models.Model): category...
null
ajax/models.py
models.py
py
2,160
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.Model", "line_number": 3, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 3, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 4, "usage_type": "call" }, { "api_name": "...
589160577
from psycopg2 import connect, OperationalError from psycopg2.errors import DuplicateDatabase CREATE_DB = "CREATE DATABASE GYM_buddy;" CREATE_TRAININGS_TABLE = """CREATE TABLE trainings( id serial PRIMARY KEY, training_name varchar(255) UNIQUE )""" CREATE_EXERCISES_TABLE = """CREATE TABLE exercises( ...
null
db_creation.py
db_creation.py
py
3,509
python
en
code
null
code-starcoder2
83
[ { "api_name": "psycopg2.connect", "line_number": 65, "usage_type": "call" }, { "api_name": "psycopg2.errors.DuplicateDatabase", "line_number": 71, "usage_type": "name" }, { "api_name": "psycopg2.OperationalError", "line_number": 74, "usage_type": "name" }, { "api_...
404401054
# MCTS from __future__ import division import chess # import chess.engine # import chess.svg # import chess.pgn import time import datetime import random import ast from copy import deepcopy from anytree import NodeMixin, RenderTree class MCTSEPT2Node(NodeMixin): def __init__(self, state, key, parent=None, chil...
null
MCTS_EPT_2_Node.py
MCTS_EPT_2_Node.py
py
1,272
python
en
code
null
code-starcoder2
83
[ { "api_name": "anytree.NodeMixin", "line_number": 16, "usage_type": "name" } ]
405975897
from selenium import webdriver import pandas as pd import selenium.common.exceptions from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import json def main(): get_url_of...
null
scraping_art_metadata/metadata_scraper.py
metadata_scraper.py
py
2,305
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "json.load", "line_number": 20, "usage_type": "call" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 23, "usage_type": "call" }, { "api_name": "selenium.w...
1230949
# django imports from django.conf.urls import url, patterns, include # restframework imports from rest_framework import routers # local imports from . import views router = routers.DefaultRouter() router.register(r'users', views.UserViewSet) router.register(r'organization_profiles', views.OrganizationProfileViewSet) ...
null
developme/apps/core/urls.py
urls.py
py
692
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 9, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 9, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 17, "usage_type": "call" }, { ...
73488702
############################################################# ########### GUI FRONT PANEL ################################ import sys import numpy as np import pyqtgraph as pg from pyqtgraph.Qt import QtGui, QtCore from pyqtgraph.Point import Point from itertools import chain import bs_machine_bsvml import configpars...
null
mso_main_01.py
mso_main_01.py
py
36,509
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyqtgraph.Qt.QtCore.QTimer", "line_number": 13, "usage_type": "call" }, { "api_name": "pyqtgraph.Qt.QtCore", "line_number": 13, "usage_type": "name" }, { "api_name": "configparser.ConfigParser", "line_number": 14, "usage_type": "call" }, { "api_name...
335572423
# from django.shortcuts import render # Create your views here. from django.http import HttpResponse, JsonResponse from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from rest_framework.parsers import JSONParser from .models import Enterprise, Cod...
null
enterpriseapi/views.py
views.py
py
4,077
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.http.JsonResponse", "line_number": 16, "usage_type": "call" }, { "api_name": "rest_framework.status.HTTP_404_NOT_FOUND", "line_number": 16, "usage_type": "attribute" }, { "api_name": "rest_framework.status", "line_number": 16, "usage_type": "name" ...
257029461
# encoding:utf-8 # !/usr/bin/env python # jhScriptUI.py # author : SeokWon Choi import sys reload(sys) sys.setdefaultencoding('utf-8') from PySide2 import QtCore, QtGui, QtWidgets import maya.cmds as cmds import maya.mel as mel import platform import json import os import re if platform.system() == "Windows": SCR...
null
jhScriptBase/jhScriptUI.py
jhScriptUI.py
py
9,339
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.setdefaultencoding", "line_number": 8, "usage_type": "call" }, { "api_name": "platform.system", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "...
457546226
''' The size_hint: None, None instruction has been removed from the StickMan because it will inherit from DraggableWidget in the Python Code. ''' import kivy kivy.require('1.10.1') from kivy.uix.relativelayout import RelativeLayout from kivy.graphics import Line ''' The comicwidgets.py file contains the new DraggableWi...
null
pythontutorials/KivyInteractiveApps/ch3/comicwidgets.py
comicwidgets.py
py
3,571
python
en
code
null
code-starcoder2
83
[ { "api_name": "kivy.require", "line_number": 6, "usage_type": "call" }, { "api_name": "kivy.uix.relativelayout.RelativeLayout", "line_number": 16, "usage_type": "name" }, { "api_name": "kivy.graphics.Line", "line_number": 42, "usage_type": "call" } ]
575748345
from pathlib import Path path = input("Enter the path to the series' files: ") serie = input("Enter the series' name: ") season = input(f"Enter the season from {serie}: ") extension = input("Enter the file extension (e.g: mp4): ") chapter = 1 for file in Path(path).iterdir(): if file.is_file(): new_name =...
null
SeriesFormatter.py
SeriesFormatter.py
py
509
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "call" } ]
327499718
import json from requests import Session from bs4 import BeautifulSoup # list_blogs is a bit fragile, we should setup and use the real tumblr API to get the list of blogs # instead of scraping a page that is subject to change. TUMBLR_CONSUMER_KEY='GLSU29VxzEXfyPGAagvDOxxeWu0beozavFWgK8q6X15oUDzPDP' TUMBLR_SECRET_KEY=...
null
unitumble/tumblr_api.py
tumblr_api.py
py
7,549
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.Session", "line_number": 64, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 66, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 93, "usage_type": "call" }, { "api_name": "bs4.BeautifulSou...
628520536
import numpy as np import matplotlib.pyplot as plt import math import random football_group =np.array([[189, 85]]); wwe_group =np.array([[220, 120]]); def avg(arr): sum = 0 for i in range(len(arr)): sum = sum + arr[i]; return (sum/(len(arr))); temp_f_dist = []; temp_w_dist = []; football_height ...
null
4-2/CSE 4204 (Neural Networks and Fuzzy Systems)/Lab 1/nearest_neighbour-classification-with-rogue-pattern.py
nearest_neighbour-classification-with-rogue-pattern.py
py
2,462
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 30, "usage_type": "call" }, { "api_name": "random.randint", "line_numbe...