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
324002368
#from lstm import * from sklearn import svm from preprocessor import * from get_features import * from chunk import * from matplotlib import pyplot as plt import numpy as np import pickle import operator import _thread import myo import socket import select import sys import time from scipy.spatial.distance import euc...
null
learner/myo_armband/dtw_classifier.py
dtw_classifier.py
py
24,258
python
en
code
null
code-starcoder2
76
[ { "api_name": "myo.DeviceListener", "line_number": 21, "usage_type": "attribute" }, { "api_name": "socket.socket", "line_number": 64, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 69, "usage_type": "attribute" }, { "api_name": "_thread.start_new...
78496529
import numpy as np from scipy.sparse import lil_matrix from scipy import stats from joblib import Parallel, delayed from joblib import load, dump import tempfile import shutil import os import warnings from ..processing import knee warnings.filterwarnings("ignore") def wgr_BOLD_event_vector(N, matrix, thr, k, tempora...
null
rsHRF/sFIR/smooth_fir.py
smooth_fir.py
py
6,797
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 12, "usage_type": "call" }, { "api_name": "scipy.sparse.lil_matrix", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.newaxis", "line_number": 20, "usage_type": "attribute" }, { "api_name": "nu...
582819127
import discord from discord.ext import commands from resources import constants class Ayuda(commands.Cog): def __init__(self, client): self.client = client @commands.command(aliases=['a']) async def ayuda(self, ctx): helpEmbed=discord.Embed(title="Malibu Roleplay — Comunidad AdcitionGamer", url="h...
null
discord-bot/cogs/help.py
help.py
py
1,471
python
en
code
null
code-starcoder2
76
[ { "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.Embed", "line_number": 12, "usage_type": "call" }, { "api_name": "discor...
626121391
import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib as mpl # 防止中文乱码 mpl.rcParams['font.sans-serif'] = ['SimHei'] mpl.rcParams['axes.unicode_minus'] = False from sklearn.model_selection import train_test_split # 1. 加载数据(数据一般存在于磁盘或者数据库) data = pd.read_csv(r"D:\人工智能\波士顿房价数据.csv") # ...
null
项目实战-波士顿房价拟合/解析式回归分析.py
解析式回归分析.py
py
1,516
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.rcParams", "line_number": 7, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "sklea...
488959755
import os import deployer import shutil import config import hashlib import sys def method_one(): print('------ METHOD on') def move_version_dir_to_deployed_dirs(current_deployed_version_dir_path, current_version_dir_path): if not os.path.exists(current_deployed_version_dir_path): os.makedirs(current...
null
deploy_version.py
deploy_version.py
py
11,053
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 14, "usage_type": "call" }, { "api_name": "shutil.move", "line_numbe...
75528179
import sys import os sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import pymysql import base.setting class OperationDB: def __init__(self): self.host = base.setting.db_host self.port = base.setting.db_port self.user = base.setting.db_user self.p...
null
util/operation_db.py
operation_db.py
py
3,574
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number...
402493086
import json from lux.extensions.rest import RestRouter from lux.extensions.rest.backends import token class Authorization(token.Authorization): def get(self, request): '''List all authorizations for the authenticated user ''' user = request.cache.user if not user.is_authenticated...
null
lux/extensions/auth/views.py
views.py
py
997
python
en
code
null
code-starcoder2
76
[ { "api_name": "lux.extensions.rest.backends.token.Authorization", "line_number": 7, "usage_type": "attribute" }, { "api_name": "lux.extensions.rest.backends.token", "line_number": 7, "usage_type": "name" }, { "api_name": "lux.extensions.rest.backends.token.Http401", "line_num...
293689446
""" ================================= Scatter plots with custom symbols ================================= .. redirect-from:: /gallery/lines_bars_and_markers/scatter_symbol .. redirect-from:: /gallery/lines_bars_and_markers/scatter_piecharts """ # %% # Using TeX symbols # ----------------- # An easy way to customize s...
null
galleries/examples/lines_bars_and_markers/scatter_custom_symbol.py
scatter_custom_symbol.py
py
1,342
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 20, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random.rand", ...
38230862
import request_conditions from sklearn.externals import joblib def predict(models): predictions = {} input_features = request_conditions.main() for classifier in models: clf = joblib.load(classifier) pred = clf.predict(input_features) predictions[classifier] = pred return pred...
null
lib/predict.py
predict.py
py
784
python
en
code
null
code-starcoder2
76
[ { "api_name": "request_conditions.main", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.externals.joblib.load", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.externals.joblib", "line_number": 9, "usage_type": "name" } ]
120190876
""" Wraps functionality of the alternative WaveRNN model. """ import os import sys import zipfile import logging import pickle from collections import namedtuple from typing import Mapping # import tensorflow as tf import numpy as np import tacorn.fileutils as fu # import tacorn.constants as constants from tacorn.expe...
null
tacorn/wavernn_alt_wrapper.py
wavernn_alt_wrapper.py
py
5,936
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 22, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "tacorn.exper...
71353269
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import tensorflow as tf from tensorflow import keras import datetime from PIL import Image import Model_util from Loss import getL1SSIM, getL1, getSSIM # Creates and returns model based on specified parameters. def create_model(dim, activation="relu", loss="L1SSIM"): ...
null
DN.py
DN.py
py
5,106
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.Input", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 12, "usage_type": "name" }, { "api_name": "tensorflow.ker...
292158537
## Joseph Rice # 12/29/2017 import datetime from time import sleep from visual import * from visual.graph import * from random import * """isocalendar(...)""" """Return a 3-tuple containing ISO year, week number, and weekday.""" now = datetime.datet...
null
Diffusion.py
Diffusion.py
py
6,453
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.today", "line_number": 41, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 41, "usage_type": "attribute" }, { "api_name": "datetime.date", "line_number": 53, "usage_type": "call" }, { "api_name": "time.sle...
70682180
from django.shortcuts import render from django.http import HttpResponse, Http404 from subscribe.forms import SubscribeForm from blogs.models import Title, Detail, TagForBlog def index(request): titles = Title.objects.order_by('-pub_date')[:10] context_dict = {'titles': titles} return render(request, 'b...
null
tourepedia/blogs/views.py
views.py
py
1,621
python
en
code
null
code-starcoder2
76
[ { "api_name": "blogs.models.Title.objects.order_by", "line_number": 10, "usage_type": "call" }, { "api_name": "blogs.models.Title.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "blogs.models.Title", "line_number": 10, "usage_type": "name" }, {...
247848903
from setuptools import setup with open("README.rst") as f: readme = f.read() setup( name="oommfc", version="0.5.4.2", description="A Python-based OOMMF calculator.", long_description=readme, author="Computational Modelling Group", author_email="fangohr@soton.ac.uk", url="https://github...
null
setup.py
setup.py
py
835
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" } ]
618692478
''' Author: Puffrora Date: 2021-11-21 23:38:26 LastModifiedBy: Puffrora LastEditTime: 2021-11-21 23:41:27 ''' from typing import List """ dp[i][0] i-th day, dosen't have stock dp[i][1] i-th day, has stock """ class Solution: def maxProfit(self, prices: List[int], fee: int) -> int: dp = [[0 for _ in rang...
null
Leetcode/leetcode714 买卖股票的最佳时机含手续费.py
leetcode714 买卖股票的最佳时机含手续费.py
py
596
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 16, "usage_type": "name" } ]
304308569
from bs4 import BeautifulSoup import re import operator import pandas as pd import numpy as np from flask import jsonify import json from tabulate import tabulate import sys from stop_words import get_stop_words import requests def seed_price(page): page = requests.get("http://164.100.222.56/amb/1/mandishowtoday.asp...
null
Python/scrap.py
scrap.py
py
1,131
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.array", "line_number"...
28416623
# import pandas, numpy import pandas as pd import numpy as np import datetime as dt from datetime import datetime # Create the required data frames by reading in the files sdf=pd.read_excel("C:\\Users\\kevin.scaria\\Documents\\Training\\Takeaway Assignments\\R & Python\\SaleData.xlsx") diadf=pd.read_csv('C:\\Users\\ke...
null
1541_batch3_python.py
1541_batch3_python.py
py
10,105
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_excel", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
201094573
import numpy as np import math, copy, sys, os import matplotlib.pyplot as plt import scipy.io.wavfile as wf from scipy.io.wavfile import write from scipy.signal import get_window from scipy import signal import low_pass as crossover import stft as DFT INT16_FAC = (2**15)-1 INT32_FAC = (2**31)-1 INT64_FAC = (2**63)-1...
null
src/main.py
main.py
py
11,919
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.signal.get_window", "line_number": 26, "usage_type": "call" }, { "api_name": "scipy.io.wavfile.read", "line_number": 50, "usage_type": "call" }, { "api_name": "scipy.io.wavfile", "line_number": 50, "usage_type": "name" }, { "api_name": "scipy....
328945136
import os import json import bson from flask import Blueprint, render_template, request, send_from_directory, jsonify from flask_restful import Resource, Api from werkzeug import secure_filename from api_test import app from api_test import models from api_test.models import Project from api_test import db API_VERSIO...
null
api_test/views/api_v1/project.py
project.py
py
2,369
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 16, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 17, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 20, "usage_type": "name" }, { "api_name": "flask_restfu...
109820360
from django.contrib import admin from parties.models import PartySeries, Party, Competition, CompetitionPlacing class CompetitionPlacingInline(admin.TabularInline): model = CompetitionPlacing raw_id_fields = ['production'] admin.site.register(PartySeries) admin.site.register(Party, raw_id_fields=['invitations', ...
null
parties/admin.py
admin.py
py
428
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "parties.models.CompetitionPlacing", "line_number": 7, "usage_type": "name" }...
357078972
#https://docs.djangoproject.com/en/dev/howto/custom-management-commands/#howto-custom-management-commands from django.core.management.base import NoArgsCommand from server.models import StaticData import openexchangelib.types as oel_types from server import data_management as dm class Command(NoArgsCommand): help...
null
DjangoWebServer/server/management/commands/gennonchained.py
gennonchained.py
py
2,932
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.management.base.NoArgsCommand", "line_number": 8, "usage_type": "name" }, { "api_name": "server.models.StaticData", "line_number": 15, "usage_type": "call" }, { "api_name": "server.data_management.save_static_data", "line_number": 16, "usage_typ...
18285637
from textblob import TextBlob import pandas as pd import re def getSentimentPolarity(x): testimonial=TextBlob(x['text']) s=testimonial.sentiment.polarity return s def getSentimentSubjectivity(x): testimonial=TextBlob(x['text']) s=testimonial.sentiment.subjectivity return s def cleanTe...
null
GenerateSentiment.py
GenerateSentiment.py
py
1,198
python
en
code
null
code-starcoder2
76
[ { "api_name": "textblob.TextBlob", "line_number": 5, "usage_type": "call" }, { "api_name": "textblob.TextBlob", "line_number": 9, "usage_type": "call" }, { "api_name": "re.split", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "li...
373641322
# -*- coding: utf-8 -*- # Copyright (c) 2014, 2015 Metaswitch Networks # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licen...
null
calico/felix/futils.py
futils.py
py
17,462
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 48, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 51, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 52, "usage_type": "call" }, { "api_name": "gevent.loc...
463735182
__author__ = "Bryse Flowers" # External Includes import subprocess # Shell out to festival or googleTTS import time # Pause in between each speach import os # Getting absolute path and directory from urllib.request import urlopen # Checking Inter...
null
src/speak.py
speak.py
py
4,171
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.data.data.load", "line_number": 27, "usage_type": "call" }, { "api_name": "nltk.data.data", "line_number": 27, "usage_type": "attribute" }, { "api_name": "nltk.data", "line_number": 27, "usage_type": "name" }, { "api_name": "plugin.Plugin", ...
587371877
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import rospy import numpy as np from scipy import ndimage from cv_bridge import CvBridge, CvBridgeError from sensor_msgs.msg import Image from robot_interaction_experiment.msg import Vision_Features from robot_interaction_experiment.msg...
null
catkin_ws/src/robot_interaction_experiment/scripts/Not_used/imageToObjects_online_BIG_TEST.py
imageToObjects_online_BIG_TEST.py
py
26,337
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.isfinite", "line_number": 122, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 124, "usage_type": "call" }, { "api_name": "cv_bridge.CvBridge", "line_number": 132, "usage_type": "call" }, { "api_name": "cv_bridge.CvBridgeEr...
523835134
import pandas as pd import numpy as np import pytest from mltoolz.preprocessing import split_dataframe @pytest.mark.parametrize("lookback, expected_train", [ (None, pd.DataFrame(np.arange(500), columns=['test'])), (100, pd.DataFrame(np.arange(400), columns=['test'])) ]) def test_split_dataframe(look...
null
tests/test_preprocessing.py
test_preprocessing.py
py
765
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 14, "usage_type": "call" }, { "api_name": "mltoolz.preprocessing.split_dataframe", "line_number": 15, "usage_type": "call" }, { "api_name": "p...
643323189
import pygame import time import random pygame.font.init() win=pygame.display.set_mode((1300,600)) fps=10 clock=pygame.time.Clock() def draw_win(arr): i=100 b=[] win.fill((255,255,255)) for a in arr: i+=15 pygame.draw.rect(win,(0,0,0),(i,10,10,20*a)) pygame.display.update...
null
b.py
b.py
py
2,623
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.font.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mode", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display...
204157085
# Copyright (c) 2016 b<>com # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
null
watcher_dashboard/content/audit_templates/tests.py
tests.py
py
5,438
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.urlresolvers.reverse", "line_number": 23, "usage_type": "call" }, { "api_name": "django.core.urlresolvers", "line_number": 23, "usage_type": "name" }, { "api_name": "django.core.urlresolvers.reverse", "line_number": 25, "usage_type": "call" },...
68691315
from PySide2.QtCore import Qt, Signal from PySide2.QtWidgets import ( QLabel, QGroupBox, QHBoxLayout, QSlider, QCheckBox, ) QGroupBoxStyleSheet = """ QGroupBox { border: 1px solid gray; border-radius: 2px; font-size: 9pt; } """ class IndexSlider(QSlider): """ Simplest p...
null
src/wezel/widgets/sliders.py
sliders.py
py
6,697
python
en
code
null
code-starcoder2
76
[ { "api_name": "PySide2.QtWidgets.QSlider", "line_number": 19, "usage_type": "name" }, { "api_name": "PySide2.QtCore.Qt.Horizontal", "line_number": 25, "usage_type": "attribute" }, { "api_name": "PySide2.QtCore.Qt", "line_number": 25, "usage_type": "name" }, { "api...
621676723
import cricpy.analytics as ca import re, time import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) path = os.path.join(BASE_DIR, 'scripts', 'player_data') players = ['dhawan', 'rohit', 'kl_rahul', 'kohli', 'iyer', 'pandey', 'jadeja', 'shaw', 'gill', 'shami', 'chahal', 'kuldeep', ...
null
scripts/scrap_players.py
scrap_players.py
py
4,612
python
en
code
null
code-starcoder2
76
[ { "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.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
614393238
import cv2 import numpy as np import os #--> Functions <---------------------------------------------------------------------------------------------------------- def dibujar_cnt (mask, color): global f_OK cnt,_ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) for c in cnt: ar...
null
detector_colores.py
detector_colores.py
py
2,613
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.findContours", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.RETR_EXTERNAL", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.CHAIN_APPROX_SIMPLE", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2...
105403811
# Use scikit-learn to grid search the batch size and epochs import numpy from sklearn.grid_search import GridSearchCV from keras.models import Sequential from keras.layers import Dense from keras.wrappers.scikit_learn import KerasClassifier from keras.optimizers import SGD seed = 7 numpy.random.seed(seed) # Load the d...
null
stage2/ketat_test.py
ketat_test.py
py
4,051
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.loadtxt", "line_number": 13, "usage_type": "call" }, { "api_name": "keras.models.Sequen...
534180115
from deap import * import matplotlib.pyplot as plt #from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import import numpy as np from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter import random from scipy.optimize import minimize from plot import * import array import...
null
nsga_2.py
nsga_2.py
py
4,930
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.uniform", "line_number": 33, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 34, "usage_type": "call" }, { "api_name": "deap.creator.create", "line_number": 43, "usage_type": "call" }, { "api_name": "deap.creator", ...
191832583
#!/usr/bin/env python # _*_coding:utf-8_*_ """ @Time : 2019/10/1 0:09 @Author: yanqiang @File: 03_birnn.py """ from keras.layers import * import jieba import multiprocessing import pandas as pd from gensim.models import Word2Vec import numpy as np import keras.backend as K from keras.callbacks import Callback, Mod...
null
03_birnn.py
03_birnn.py
py
5,377
python
en
code
null
code-starcoder2
76
[ { "api_name": "jieba.cut", "line_number": 32, "usage_type": "call" }, { "api_name": "gensim.models.Word2Vec", "line_number": 44, "usage_type": "call" }, { "api_name": "multiprocessing.cpu_count", "line_number": 44, "usage_type": "call" }, { "api_name": "pandas.rea...
536925574
import os import cv2 from libs.label_name_dict.label_dict import LABEl_NAME_MAP from libs.configs import cfgs import numpy as np import cv2 import imutils import json import base64 import os import glob # boxes = np.array([[233.5084 , 185.24924 , 45.020805, 141.2165 , -68.94732 ], # [281.85828 , 201.040...
null
utils/rotate.py
rotate.py
py
9,179
python
en
code
null
code-starcoder2
76
[ { "api_name": "libs.configs.cfgs.TEST_PATH", "line_number": 24, "usage_type": "attribute" }, { "api_name": "libs.configs.cfgs", "line_number": 24, "usage_type": "name" }, { "api_name": "cv2.imwrite", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.im...
582372096
# COMPUTEX Code Generator import random import string import webbrowser import requests from selenium import webdriver from selenium.webdriver.common.keys import Keys def create_code(): try: word_gen = lambda i: ''.join(random.choices( string.ascii_uppercase + string.ascii_lowerca...
null
COMPUTEX bruteforce/code_gen.py
code_gen.py
py
1,640
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.choices", "line_number": 12, "usage_type": "call" }, { "api_name": "string.ascii_uppercase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "string.ascii_lowercase", "line_number": 14, "usage_type": "attribute" }, { "api_name":...
167397095
from django.shortcuts import render, redirect from django.http import JsonResponse from .models import * import json import datetime from django.contrib.auth.forms import UserCreationForm, PasswordChangeForm from django.contrib.auth import authenticate, login, logout from .forms import CreateUserForm, CustomerForm, Cha...
null
store/views.py
views.py
py
13,713
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.views.PasswordChangeView", "line_number": 18, "usage_type": "name" }, { "api_name": "django.contrib.auth.forms.PasswordChangeForm", "line_number": 19, "usage_type": "name" }, { "api_name": "django.urls.reverse_lazy", "line_number": 20, "...
450574498
"""Hover task.""" import math from pathlib import Path import numpy as np from gym import spaces from geometry_msgs.msg import Vector3, Point, Quaternion, Pose, Twist, Wrench from .quadrocopter_task import QuadrocopterTask from .emulator import Emulator from ..task import Task class Hover(Task): """Simple task w...
null
tasks/emulator/hover.py
hover.py
py
2,512
python
en
code
null
code-starcoder2
76
[ { "api_name": "task.Task", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 20, "usage_type": "call" }, { "api_name": "emulator.Emulator", "line_numbe...
253593618
#!/usr/bin/env python3 # File: member.py """ Applies to records of members of 'the club' which is further defined in another module (rbc.py). Many methods of Membership class are essentially independant of Membership but pertain to each record. Hence makes sense to separate them out. A many need to store data so thos...
null
member.py
member.py
py
35,508
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.DictReader", "line_number": 107, "usage_type": "call" }, { "api_name": "sys_globals.SEPARATOR", "line_number": 159, "usage_type": "attribute" }, { "api_name": "csv.DictReader", "line_number": 575, "usage_type": "call" }, { "api_name": "helpers.a...
483672647
import time import os, re import csv import ipdb import pickle import numpy as np from sklearn.metrics import confusion_matrix import matplotlib.pyplot as plt import torch import torch.optim as optim from torch import nn from torch.autograd import Variable import torchvision import torchvision.mode...
null
Scripts/train.py
train.py
py
20,386
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.cuda.is_available", "line_number": 81, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 81, "usage_type": "attribute" }, { "api_name": "torchvision.models.__dict__", "line_number": 110, "usage_type": "attribute" }, { "api_nam...
143301274
import cmath import numpy as np import scipy.io as sio from scipy.stats.mstats import mode eeg = sio.loadmat('data/eeg') #print (eeg.keys()) # keys are 'x_te', 'x_train', 'y_te', 'y_train' X_train = eeg['x_train'] Y_train = eeg['y_train'] X_test = eeg['x_te'] Y_test = eeg['y_te'] N = 64 f, n =np.a...
null
Motor Imagery/kNN.py
kNN.py
py
3,136
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.io.loadmat", "line_number": 6, "usage_type": "call" }, { "api_name": "scipy.io", "line_number": 6, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.blackman", "line_numbe...
30561906
# Problems: # After setting input/output, on/off doesn't work (Don't rebuild database???) # led1 seems to be broken # Comment and organize code # DMA pulses (getting started docs) # Build tcpdump parser # Organize multiple folders # Expand help menu from artiq.experiment import * import os from tabulate import tabulat...
null
old/src/main.py
main.py
py
9,982
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.system", "line_number": 19, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 49, "usage_type": "call" }, { "api_name": "os.system", "line_number": 86, "usage_type": "call" }, { "api_name": "os.system", "line_number": 88, ...
287480035
from calc_influxdb_fields_correlation import column_list_loader, field_to_dataframe from datetime import datetime from scipy import stats from collections import OrderedDict from math import isnan import pandas as pd import time def df_merger(target_field, one_column_name, query_time): other_field = field_to_dataf...
null
calc_influxdb_fields_correlation2_standard.py
calc_influxdb_fields_correlation2_standard.py
py
3,993
python
en
code
null
code-starcoder2
76
[ { "api_name": "calc_influxdb_fields_correlation.field_to_dataframe", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.merge", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 15, "usage_type": "call" }, { ...
191716053
import json from unittest.mock import Mock import pytest from jinja2 import Environment from tornado.testing import AsyncTestCase, gen_test from tornado.web import Application, HTTPError from tornado.httpserver import HTTPRequest from traitlets.config import Config from ..clone import BookstoreCloneHandler, Bookst...
null
bookstore/tests/test_clone.py
test_clone.py
py
5,711
python
en
code
null
code-starcoder2
76
[ { "api_name": "tornado.testing.AsyncTestCase", "line_number": 17, "usage_type": "name" }, { "api_name": "unittest.mock.Mock", "line_number": 20, "usage_type": "call" }, { "api_name": "tornado.web.Application", "line_number": 21, "usage_type": "name" }, { "api_name...
636356229
__author__ = "Tim Pose" __credits__ = ["Peter Detzner"] __maintainer__ = "Tim Pose" __status__ = "Development" import logging from http import HTTPStatus """ Bork """ BORK_DEFAULT_URL = "http://bork:50019" BORK_DEFAULT_SCHEMAS_DIR_PATH = "./models/schemas/" BORK_DEFAULT_ROOTSCHEMA_NAME = "RootSchema.json" """ Orion...
null
src/utils/Constants.py
Constants.py
py
4,799
python
en
code
null
code-starcoder2
76
[ { "api_name": "http.HTTPStatus.OK", "line_number": 83, "usage_type": "attribute" }, { "api_name": "http.HTTPStatus", "line_number": 83, "usage_type": "name" }, { "api_name": "http.HTTPStatus.CREATED", "line_number": 84, "usage_type": "attribute" }, { "api_name": "...
226841525
from django import template register = template.Library() @register.assignment_tag(takes_context=True) def set_var(context, str_value): valstr = str_value start = str_value.find("{{") if start != -1: start += 2 end = str_value.find("}}") if start != -1 and end != -1 and start < len(str_va...
null
spe_preferences/templatetags/var_tags.py
var_tags.py
py
834
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.template.Library", "line_number": 3, "usage_type": "call" }, { "api_name": "django.template", "line_number": 3, "usage_type": "name" } ]
519517912
__author__ = 'mizumoto' from flask.ext.script import Manager, Server from app import app manager = Manager(app) # Turn on debugger by default and reloader manager.add_command("runserver", Server( use_debugger=True, use_reloader=True, host='localhost', port=8888) ) if __name__ == "__main__": man...
null
manage.py
manage.py
py
330
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.ext.script.Manager", "line_number": 6, "usage_type": "call" }, { "api_name": "app.app", "line_number": 6, "usage_type": "argument" }, { "api_name": "flask.ext.script.Server", "line_number": 9, "usage_type": "call" } ]
201904907
#!/usr/bin/env python # vim:ts=4:sts=4:sw=4:et # # Author: Hari Sekhon # Date: 2019-10-07 10:23:31 +0100 (Mon, 07 Oct 2019) # # https://github.com/HariSekhon/DevOps-Python-tools # # License: see accompanying Hari Sekhon LICENSE file # # If you're using my code you're welcome to connect with me on LinkedIn and opt...
null
validate_toml.py
validate_toml.py
py
4,042
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_number": 39, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path.dirname", "line...
239913983
# import plotly import plotly.express as px import pandas as pd import numpy as np from io import StringIO from flask import Flask, render_template, request import logging logging.basicConfig(level=logging.DEBUG) import cell_automata as ca def create_unique_bar_graph(randomText, seperator): ...
null
main.py
main.py
py
6,526
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.random.randn", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.rando...
84117289
import re from dataclasses import dataclass from spacy.tokens.span import Span @dataclass class RegExConfig: label: str pattern: str minimum_length: int maximum_length: int class RegExMatcher(object): def __init__(self, name: str, config: RegExConfig): self.name = name self.con...
null
convenient_ai/nlp/spacy/custom/RegExMatcher.py
RegExMatcher.py
py
2,193
python
en
code
null
code-starcoder2
76
[ { "api_name": "dataclasses.dataclass", "line_number": 7, "usage_type": "name" }, { "api_name": "re.finditer", "line_number": 22, "usage_type": "call" }, { "api_name": "spacy.tokens.span.Span", "line_number": 41, "usage_type": "call" } ]
82628979
from __future__ import print_function from imutils.object_detection import non_max_suppression from imutils import paths import argparse import imutils import numpy as np import cv2 import pyrebase import time #ap = argparse.ArgumentParser() #ap.add_argument("-i","--images", required=True, help="/home/pi/Desktop/cante...
null
10.009 Digital World 1D Project/1D DW Old Codes/hogcrowdcontrol_final_final.py
hogcrowdcontrol_final_final.py
py
3,212
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyrebase.initialize_app", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.HOGDescriptor", "line_number": 38, "usage_type": "call" }, { "api_name": "cv2.HOGDescriptor_getDefaultPeopleDetector", "line_number": 39, "usage_type": "call" }, { ...
303605058
import gevent from gevent import monkey monkey.patch_all() import json import logging import os import secrets import signal import sys import urllib.parse from datetime import datetime from functools import wraps import redis import requests from flask import Flask, Response, request from gevent.pywsgi import WSGIH...
null
app.py
app.py
py
13,012
python
en
code
null
code-starcoder2
76
[ { "api_name": "gevent.monkey.patch_all", "line_number": 4, "usage_type": "call" }, { "api_name": "gevent.monkey", "line_number": 4, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.CRITICA...
572586045
import xlrd import openpyxl path = 'E:/ToSql.xlsx' tableName = 'Table_1' Sql = '' if path.endswith('.xls'): data = xlrd.open_workbook(path) table = data.sheets()[0] #获取工作表 titleList = table.row_values(0) #获取标题列 sqlTemplate = "INSERT dbo.%s ( %s ) VALUES ( %s ) \n"% (tableName, ...
null
Excal To Sql.py
Excal To Sql.py
py
769
python
en
code
null
code-starcoder2
76
[ { "api_name": "xlrd.open_workbook", "line_number": 10, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 28, "usage_type": "call" } ]
381496325
from django.shortcuts import render, HttpResponse, redirect from rest_framework.decorators import api_view from rest_framework.response import Response from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from ...
null
administration/views.py
views.py
py
5,821
python
en
code
null
code-starcoder2
76
[ { "api_name": "products.models.Category.objects.all", "line_number": 28, "usage_type": "call" }, { "api_name": "products.models.Category.objects", "line_number": 28, "usage_type": "attribute" }, { "api_name": "products.models.Category", "line_number": 28, "usage_type": "n...
39456109
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Mar 18 02:31:06 2018 @author: srv_twry """ """ Initial setup. """ # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset_size = 10000 dataset = pd.read_csv('dataset/dataset....
null
classifier/classifier_ann.py
classifier_ann.py
py
3,154
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 30, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 37, "usage_type": "call" }, { "api_name": "nltk.stem.porter.PorterStemmer",...
78127111
import torch from torch.utils.data import Dataset, DataLoader from torch import nn import torch.nn.functional as F import torch.optim as optim from skimage import io from skimage.transform import resize import numpy as np import matplotlib.pyplot as plt from MyDataSet import MyDataset from DeepLearningEffectivenessExpl...
null
Model1.py
Model1.py
py
6,857
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 19, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
181409782
import csv import numpy as np from sklearn.linear_model import LogisticRegression import pandas as pd from sklearn.externals import joblib def LoadData(file): data = [] i = 0 with open(file, encoding='utf-8') as csv_file: csv_reader = csv.reader(csv_file) for row in csv_reader: data.append(row...
null
house-location/old/preprocess.py
preprocess.py
py
5,245
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.reader", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 32...
621055008
import random import time from selenium.webdriver.common.by import By from app.passion_applets.object_page.applets.common import CommonPage from conf.decorator import teststep, teststeps class WordChoiceGame(CommonPage): @teststep def wait_check_word_choice_page(self): """词汇选择页面检查点""" locat...
null
app/passion_applets/object_page/applets/games/word_choice.py
word_choice.py
py
6,264
python
en
code
null
code-starcoder2
76
[ { "api_name": "app.passion_applets.object_page.applets.common.CommonPage", "line_number": 10, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR", "line_number": 15, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", ...
100238440
import numpy as np from sklearn.decomposition import PCA from pyspark.sql.types import * import numpy as np import sklearn.cluster from nltk.metrics import distance import Pycluster as PC import pandas as pd from pyspark.sql import SparkSession from pyspark.sql.functions import col from pyspark.ml.fpm import FPGrowth f...
null
Clustering/Constructor_Team.py
Constructor_Team.py
py
4,690
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 19, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 19, "usage_type"...
425193048
"""Program stats server.""" import functools import io import json import os import sys import webbrowser from six.moves import socketserver from six.moves import SimpleHTTPServer as http_server _STATIC_DIR = 'frontend' _PROFILE_HTML = '%s/profile.html' % _STATIC_DIR class StatsServer(socketserver.ThreadingMixIn, s...
null
vprof/stats_server.py
stats_server.py
py
3,760
python
en
code
null
code-starcoder2
76
[ { "api_name": "six.moves.socketserver.ThreadingMixIn", "line_number": 16, "usage_type": "attribute" }, { "api_name": "six.moves.socketserver", "line_number": 16, "usage_type": "name" }, { "api_name": "six.moves.socketserver.TCPServer", "line_number": 16, "usage_type": "at...
7819521
#!/usr/bin/env python from __future__ import print_function import chainer import chainer.functions as F import chainer.links as L import numpy as np import six from chainer import Variable, optimizers class MLP(chainer.Chain): """Multi-layer perceptron for Classifier. Args: n_in (int): Dimension ...
null
nfp/nn.py
nn.py
py
4,097
python
en
code
null
code-starcoder2
76
[ { "api_name": "chainer.Chain", "line_number": 13, "usage_type": "attribute" }, { "api_name": "chainer.links.Linear", "line_number": 24, "usage_type": "call" }, { "api_name": "chainer.links", "line_number": 24, "usage_type": "name" }, { "api_name": "chainer.links.L...
643367806
import numpy as np from numba import njit @njit(nogil=True, fastmath=True) def logsumexp(a): a_max = np.max(a) out = np.log(np.sum(np.exp(a - a_max))) out += a_max return out @njit(parallel=True, error_model='numpy') def normalize_to_probability(distribution): '''Ensure the distribution integrat...
null
replay_trajectory_classification/core.py
core.py
py
6,488
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.max", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 8, "usa...
282702110
import datetime import re from booking_engine import BookingEngine class Bimanairlines(BookingEngine): def __init__(self): super().__init__(6, 3, 3) self.site_name = "BIMAN-AIRLINES" def make_url(self): domain = "https://www.biman-airlines.com" headers = { 'Host'...
null
Scraper for booking engine/biman_airlines.py
biman_airlines.py
py
2,127
python
en
code
null
code-starcoder2
76
[ { "api_name": "booking_engine.BookingEngine", "line_number": 6, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 32, "usage_type": "call" } ]
259156646
import urllib3 import urllib import re import csv import sys import requests from bs4 import BeautifulSoup import os from xlwt import * def getHtml(url): r = requests.get(url) s = r.status_code if(s==404): print("404") return r.content if __name__ == '__main__': url = "http://120.78.162.102/ranklistnew.php" csv...
null
spider.py
spider.py
py
810
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 19, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 22, "usage_type": "call" } ]
159639758
""" Type annotations for license-manager service client. [Open documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_license_manager/client.html) Usage:: ```python import boto3 from mypy_boto3_license_manager import LicenseManagerClient client: LicenseManagerClient = boto3.client("licen...
null
typings/mypy_boto3_license_manager/client.pyi
client.pyi
pyi
40,767
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 94, "usage_type": "attribute" }, { "api_name": "typing.Dict", "line_number": 104, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 104, "usage_type": "name" }, { "api_name": "typing.Dict", "lin...
167585287
from django.db import models from wagtail.wagtailadmin.edit_handlers import FieldPanel, PageChooserPanel, InlinePanel from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel from wagtail.wagtailimages.edit_handlers import ImageChooserPanel from wagtail.wagtailsnippets.models import register_snippet fro...
null
demo/snippets.py
snippets.py
py
4,763
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 18, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 18, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 19, "usage_type": "call" }, { "api_name"...
449796867
import datetime import matplotlib.pyplot as plt import matplotlib.patches as mpatches from shapely.geometry import Point, Polygon, LineString from sklearn.metrics import roc_auc_score, roc_curve from . import curvature, centerlines def get_current_timestamp_as_string(format='%Y-%m-%dT%H-%M-%S') -> str: return date...
null
app/src/utils.py
utils.py
py
2,305
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "attribute" }, { "api_name": "shapely.geometry.Polygon", "line_number": 23, "usage_type": "name" }, { "api_name": "s...
375700374
#!/usr/bin/env python3 ############################################################################# # Filename : Softlight.py # Description : Control RGBLED with Potentiometer # Author : www.freenove.com # modification: 2019/12/27 ######################################################################## import...
null
ColorfulSoftlight.py
ColorfulSoftlight.py
py
2,464
python
en
code
null
code-starcoder2
76
[ { "api_name": "smbus.SMBus", "line_number": 15, "usage_type": "call" }, { "api_name": "RPi.GPIO.setmode", "line_number": 33, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 33, "usage_type": "name" }, { "api_name": "RPi.GPIO.BOARD", "line_numb...
574561842
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created by master on 2017/4/18 from yinhang.HtmlDownLoader import HtmlDownloader from bs4 import BeautifulSoup class Save(object): @staticmethod def save(url, index, ws): download = HtmlDownloader() resp = download.download(url) soup =...
null
yinhang/Save2Excel.py
Save2Excel.py
py
940
python
en
code
null
code-starcoder2
76
[ { "api_name": "yinhang.HtmlDownLoader.HtmlDownloader", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 22, "usage_type": "call" } ]
341689989
import logging import sys import os from functools import lru_cache def _configLogger(name, filename=None, loglevel=logging.INFO): # define a Handler which writes INFO messages or higher to the sys.stdout logger = logging.getLogger(name) logger.setLevel(loglevel) console = logging.StreamHandler(sys.st...
null
utils/logger.py
logger.py
py
2,474
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.INFO", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.stdout", ...
25881543
from urllib.request import urlopen from bs4 import BeautifulSoup if __name__ == "__main__": # 크롤링을 하려는 URL targetUrl = "http://aqicn.org/city/seoul/kr/" # 웹페이지를 읽어온다. html = urlopen(targetUrl).read() # beautifulsoup 으로 파싱 soupData = BeautifulSoup(html, 'html.parser') # 지역 정보를 읽어 오고. titleData = soupData.find('...
null
o2.py
o2.py
py
425
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.urlopen", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" } ]
62047485
#-*- coding:utf-8 _*- """ @author:charlesXu @file: Data_util.py @desc: 数据工具类 @time: 2019/03/22 """ import jieba import collections import codecs import os import numpy as np import random import json from Generate_resource_data import get_knowledge UNK = u'_UNK' O = u'_O' PAD = u'_PAD' splitter = '|&|' splitter_slot_...
null
Chatbot_Model/Intent_Detection_Slot_Filling/Data_util.py
Data_util.py
py
22,120
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path", "line_number": 46, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path", "line_number...
457830731
#!/usr/bin/python # -*- coding: utf-8 -*- import datetime import sys import uuid from PyQt5.QtWidgets import QDialog, QApplication, \ QTableWidget, QVBoxLayout, QLineEdit, QTextEdit, QPushButton, QComboBox, QHBoxLayout, QLabel, \ QTableWidgetItem, QWidget, QCheckBox, QMessageBox import data_sets import libpg ...
null
msg_sms.py
msg_sms.py
py
8,888
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 19, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QTableWidget", "line_number": 26, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QVBoxLayout", "line_number": 34, "usage_type": "call" }, { "...
195483633
from datetime import date ano = date.today().year nasc = int(input('Qual o ano do seu nascimento: ')) idade = ano - nasc print(' O atleta tem {} anos'.format(idade)) if idade<=9: print('Classificação infantil') elif idade<=14: print('Infantil') elif idade <=19: print('JUNIOR') else: print('master')
null
CURSO EM VÍDEO/Python Intermediário/C.E.V. Mundo 2/SOLUÇÃO.py
SOLUÇÃO.py
py
317
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date.today", "line_number": 2, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 2, "usage_type": "name" } ]
22846055
# -*- coding: utf-8 -*- import os import urllib import json from bs4 import BeautifulSoup class Base: URL = '' FILE = '' # ページを読み込む def load(self): res = urllib.request.urlopen(self.URL) data = res.read() res.close() return data # ファイルを書き込む def write(self, ...
null
resources/data/cp/jcba/scrape.py
scrape.py
py
3,173
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.urlopen", "line_number": 17, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", ...
19712340
from apscheduler.executors.pool import ProcessPoolExecutor, ThreadPoolExecutor from apscheduler.schedulers.background import BlockingScheduler from apscheduler.jobstores.redis import RedisJobStore REDIS = { 'host': '127.0.0.1', 'port': '6379', 'db': 0, 'password': '' } jobstores = { 'redis': Redi...
null
wypt-scheduler/main.py
main.py
py
886
python
en
code
null
code-starcoder2
76
[ { "api_name": "apscheduler.jobstores.redis.RedisJobStore", "line_number": 14, "usage_type": "call" }, { "api_name": "apscheduler.executors.pool.ThreadPoolExecutor", "line_number": 18, "usage_type": "call" }, { "api_name": "apscheduler.executors.pool.ProcessPoolExecutor", "lin...
611487087
#Team preQL - Joseph Lee, Eric "Morty" Lau, and Yevgeniy Gorbachev #SoftDev1 pd1 #K18 -- Average #2019-10-10 import sqlite3 #enable control of an sqlite database import csv #facilitate CSV I/O DB_FILE="discobandit.db" db = sqlite3.connect(DB_FILE) #open if file exists, otherwise create c = db.cursor() ...
null
fall/18_db-nmcrnch/db_builder.py
db_builder.py
py
1,026
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 19, "usage_type": "call" } ]
459502265
import json import glob """ Grabs the name of each pattern in our set of PNG patters, maps it to its filepath, and spits it to JSON. """ patterns = {} for f in glob.glob("converted-pngs/*.png"): root = f.split(".")[0].split("/")[1] patterns[root] = f"/assets/patterns/{f}" with open("./patterns.json", "w") ...
null
assets/patterns/create-patterns.py
create-patterns.py
py
356
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.glob", "line_number": 12, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 17, "usage_type": "call" } ]
23252652
"""Functions and classes for use in dashboard.models """ import os import operator import json import time import logging from uuid import uuid4 from datetime import datetime from sqlalchemy.orm.collections import MappedCollection, collection import flask_apscheduler from dashboard import scheduler logger = logging...
null
dashboard/models/utils.py
utils.py
py
2,713
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.collections.MappedCollection", "line_number": 20, "usage_type": "name" }, { "api_name": "operator.attrgetter", "line_number": 24, "usage_type": "call" }, { ...
56574117
# -*- coding: utf-8 -*- """ Created on Mon Sep 16 19:24:16 2019 @author: Julia """ import googlemaps import time import pyrebase import random import os config ={ "apiKey": "AIzaSyAMpfbvKqf5vK-dzz5H2Osu6CJ5d1ionA0", "authDomain": "misproject-65629.firebaseapp.com", "databaseURL": "https:/...
null
GMA_all.py
GMA_all.py
py
2,627
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyrebase.initialize_app", "line_number": 21, "usage_type": "call" }, { "api_name": "googlemaps.Client", "line_number": 24, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 36, "usage_type": "call" }, { "api_name": "random.sample", ...
341368741
from rest_framework import serializers from .models import Campaign, Message, MessageStats from contacts.models import ContactList class DynamicFieldsModelSerializer(serializers.ModelSerializer): def __init__(self, *args, **kwargs): """ Allow to specify `fields` attribute while instantia...
null
api/campaigns/serializers.py
serializers.py
py
2,477
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 7, "usage_type": "name" }, { "api_name": "rest_framework.serializers.HyperlinkedRelatedField", "line_number": ...
481416340
#GitHub: koopaduo2 #Reddit: koopaduo #Optical Engineer #Custom Raspberry Pi laser image acquisition and beam profiling GUI #The code has been developed and tested on Raspberry Pi 4B & Raspbian + arducam & raspi HQ cameras #Version: v1.1 #This software is made available via MIT license #GitHub project link: htt...
null
beam_gui.py
beam_gui.py
py
25,764
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 26, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 38, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets", "line_number": 38, "usage_type": "name" }, { "api_name": "PyQt5...
280526558
from django import forms from django.conf import settings from crispy_forms.helper import FormHelper from crispy_forms.layout import ButtonHolder, Div, Field, HTML, Fieldset, Layout, Submit from .models import Contact class ContactForm(forms.ModelForm): message = forms.CharField(required=True, widget=forms.Texta...
null
zaran/contact/forms.py
forms.py
py
1,653
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 9, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 10, "usage_type": "call" }, { "api_name": "django....
615519530
__version__="0.1" from kivy.app import App from kivy.clock import Clock from kivy.core.text import LabelBase from setting import KIVY_FONTS from time import strftime class ClockApp(App): def update_time(self, nap): self.root.ids.time.text = strftime('[b]%H[/b]:%M:%S') sw_started = False sw_seconds = 0 def up...
null
clockapp/main.py
main.py
py
1,303
python
en
code
null
code-starcoder2
76
[ { "api_name": "kivy.app.App", "line_number": 9, "usage_type": "name" }, { "api_name": "time.strftime", "line_number": 11, "usage_type": "call" }, { "api_name": "kivy.clock.Clock.schedule_interval", "line_number": 24, "usage_type": "call" }, { "api_name": "kivy.clo...
153708091
# coding: utf-8 from __future__ import absolute_import from flask import json from swagger_server.models.id import Id # noqa: E501 from swagger_server.test import BaseTestCase class TestAdminsController(BaseTestCase): """AdminsController integration test stubs""" def test_dump_db(self): """Te...
null
swagger_server/test/test_admins_controller.py
test_admins_controller.py
py
1,119
python
en
code
null
code-starcoder2
76
[ { "api_name": "swagger_server.test.BaseTestCase", "line_number": 11, "usage_type": "name" }, { "api_name": "swagger_server.models.id.Id", "line_number": 30, "usage_type": "call" }, { "api_name": "flask.json.dumps", "line_number": 34, "usage_type": "call" }, { "api...
73482301
# !/usr/bin/env python import os import glob import progressbar import numpy as np import os.path as osp import scipy.io as sio GROUND_TRUTH = 'groundTruth' FOLDER = 'data/Lab5Images' def main(): bar = progressbar.ProgressBar() files = glob.glob(FOLDER + '/*.mat') for file in bar(files): data = ...
null
Lab6-Superpixels/src/process.py
process.py
py
735
python
en
code
null
code-starcoder2
76
[ { "api_name": "progressbar.ProgressBar", "line_number": 15, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 16, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 19, "usage_type": "call" }, { "api_name": "scipy.io", "li...
458520049
#!/usr/local/bin/python3.8 import time import cgi fileIn = open('datafile1.dat', 'r') clientDT=['Name','Address','Balance'] clientDL=[] line = fileIn.readline() while line != '': clientRec=line.split('_') if len(clientDL) == 0: if clientRec[2] == 'D': clientDL.append(dict(zip(clientDT, ...
null
cgisb/sbsort.py
sbsort.py
py
2,754
python
en
code
null
code-starcoder2
76
[ { "api_name": "cgi.FieldStorage", "line_number": 59, "usage_type": "call" }, { "api_name": "time.ctime", "line_number": 104, "usage_type": "call" }, { "api_name": "time.time", "line_number": 104, "usage_type": "call" } ]
23669581
import cv2 import numpy as np cap = cv2.VideoCapture(0) cap.set(3,320) cap.set(4,240) #cap.set(15,0.1) def track(): _,video = cap.read() video = cv2.flip(video, 0) hsv = cv2.cvtColor(video, cv2.COLOR_BGR2HSV) #data = np.array([0,0,0]) lower = np.array([0,97,0]) upper = np.array([255,38,255]) colors = (0,140,25...
null
balltrack2.py
balltrack2.py
py
905
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.flip", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_n...
185097505
#! /usr/bin/env python3 # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope tha...
null
shuffle_bam.py
shuffle_bam.py
py
2,331
python
en
code
null
code-starcoder2
76
[ { "api_name": "signal.signal", "line_number": 22, "usage_type": "call" }, { "api_name": "signal.SIGPIPE", "line_number": 22, "usage_type": "argument" }, { "api_name": "signal.SIG_DFL", "line_number": 22, "usage_type": "argument" }, { "api_name": "argparse.Argument...
151828117
import astor import ast from tree_walk import * from trace import * def func(a, b): if a >= 3: a += 3 func(4, 2) if a <= 7: b -= 3 func(4, 2) if b != 0: func(4, 2) return Fals...
null
Downloads/randoop-4.1.2/demo/cw3/backup.py
backup.py
py
1,716
python
en
code
null
code-starcoder2
76
[ { "api_name": "astor.code_to_ast", "line_number": 19, "usage_type": "call" }, { "api_name": "ast.If", "line_number": 32, "usage_type": "attribute" }, { "api_name": "astor.to_source", "line_number": 61, "usage_type": "call" } ]
523665618
import json from pystac import STACError from pystac.collection import Collection from pystac.stac_io import STAC_IO from pystac.item import Item from pystac.item_collection import ItemCollection class SingleFileSTAC(ItemCollection): """Provides a set of Collections and Items as a single file catalog. The single...
null
pystac/extensions/single_file_stac.py
single_file_stac.py
py
5,631
python
en
code
null
code-starcoder2
76
[ { "api_name": "pystac.item_collection.ItemCollection", "line_number": 10, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 80, "usage_type": "call" }, { "api_name": "pystac.stac_io.STAC_IO.read_text", "line_number": 80, "usage_type": "call" }, { ...
39720784
from logging import exception import os from datetime import datetime from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.primitives import serialization, hashes, hmac, padding from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC from cryptography.hazmat.pr...
null
server/security_module.py
security_module.py
py
21,976
python
en
code
null
code-starcoder2
76
[ { "api_name": "base64.b64encode", "line_number": 71, "usage_type": "call" }, { "api_name": "base64.b64decode", "line_number": 76, "usage_type": "call" }, { "api_name": "cryptography.hazmat.primitives.ciphers.modes", "line_number": 124, "usage_type": "name" }, { "a...
317965052
from django.shortcuts import render,redirect from django.http import HttpResponse from django.views.generic import ListView, DetailView, CreateView from django.contrib import messages from .models import Post from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm, CommentForm, PostForm from django.contr...
null
insta/views.py
views.py
py
3,129
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Post.objects.all", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 13, "usage_type": "name" }, { "api_name": "forms.Po...
390695563
"""IOC_project_1 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class...
null
zhl-project/IOC_project_1/urls.py
urls.py
py
1,261
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 23, "usage_type": "call" }, { "api_name": "Threat_Search.views.html_index", "line_number": 23, "usage_type": "attribute" }, { "api_name": "Threat_Search.views", "line_number": 23, "usage_type": "name" }, { "api_name...
498450748
from dorna import Dorna import json import time import sys import signal import os robot = None rest_joint = [0,110,-90,30,-90] def try_connect(): global robot robot = Dorna() result = json.loads(robot.connect(port_name='/dev/cu.usbmodem1424401')) if (result["connection"] == 2) : print("Connected successfully ...
null
dorna/sample_code/connect_and_home.py
connect_and_home.py
py
1,350
python
en
code
null
code-starcoder2
76
[ { "api_name": "dorna.Dorna", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 25, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 38,...
132484709
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from collections import deque import sys import getopt def dfs_search_recursive(graph, root, visit_fn): search_queue = deque() search_queue += graph[root] searched = [] while search_queue: item = search_queue.popleft() #debu...
null
search/dfs.py
dfs.py
py
1,660
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 9, "usage_type": "call" } ]
51004428
import discord from discord.ext import commands import os client = commands.Bot(command_prefix=commands.when_mentioned_or('ur '), description="ShanerBot is too cool for any discord server.") for filename in os.listdir("./cogs"): # loads all cogs if filename.endswith(".py"): client.load_extension(f"...
null
bot.py
bot.py
py
578
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.Bot", "line_number": 5, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 5, "usage_type": "name" }, { "api_name": "discord.ext.commands.when_mentioned_or", "line_number": 5, "usage_type": "call" }, { ...
42483708
#!/usr/bin/python3 # -*- coding: UTF-8 -*- """ Copyright (C) 2019. Huawei Technologies Co., Ltd. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the Apache License Version 2.0.You may not use this file except in compliance with the License. This program ...
null
python/level1_single_api/9_amct/amct_caffe/mobilenetV2/src/datasets.py
datasets.py
py
6,250
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.realpath", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_nu...
170481774
import cv2 from feature_extractor import FeatureExtractor import numpy as np import warnings class ColorFeatureExtractor(FeatureExtractor): def __init__(self, n=10, chanel_h=10, chanel_s=10, chanel_v=10): self._chanel_h = chanel_h self._chanel_s = chanel_s self._chanel_v = chanel_v ...
null
src/color_feature_extractor.py
color_feature_extractor.py
py
3,709
python
en
code
null
code-starcoder2
76
[ { "api_name": "feature_extractor.FeatureExtractor", "line_number": 7, "usage_type": "name" }, { "api_name": "warnings.warn", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 42, "usage_type": "call" }, { "api_name": "cv2.COLO...
509706454
import json from django.contrib.auth.decorators import login_required from django.core.mail import send_mail from django.http import JsonResponse, HttpResponseRedirect from django.shortcuts import render, redirect from Products.models import Product from Orders.models import Order from django.template.loader import re...
null
BestStore/Orders/views.py
views.py
py
3,051
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 23, "usage_type": "call" }, { "api_name": "Orders.models.Order.objects.filter", "line_number": 23, "usage_type": "call" }, { ...