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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
605818371 | # -*- coding:utf-8 -*-
import os
import json
import logging
import datetime
from PyPDF2 import PdfFileReader, PdfFileWriter
from wand.image import Image
from multiprocessing import Pool
CUT_PAGE_NUM = 9
TEMP_DIR = './.tmp/'
SOURCE_DIR = './mypdf/'
OUT_DIR = './outfile/'
LOG_DIR_PATH = './.log/'
IMG_SUFFIX = '.jpg'
s... | null | pdf_to_img/Utils/pdf_to_img.py | pdf_to_img.py | py | 7,314 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strftime",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "datetime... |
554408062 | import numpy as np
import matplotlib.pyplot as plt
import copy
import networkx as nx
import os
import json
class Statistics():
def __init__(self, transporters_icnet, transporters_aicnet, cargo_owners):
self.bids_icnet = []
self.bids_aicnet = []
self.transporters_icnet = transporters_icnet... | null | statistics.py | statistics.py | py | 16,048 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "networkx.Graph",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line... |
530649346 | import typing
import pathlib
from typing import Any, Optional, Text, Dict, List, Type
from flashtext import KeywordProcessor
from rasa.nlu.components import Component
from rasa.shared.nlu.constants import TEXT
from rasa.nlu.config import RasaNLUModelConfig
from rasa.shared.nlu.training_data.message import Message
from... | null | rasa_nlu_examples/meta/stopwordremover.py | stopwordremover.py | py | 2,289 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "rasa.nlu.components.Component",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "t... |
130884053 | import requests
import json
import time
# <editor-fold desc="Poe.Ninja Api Endpoints">
poeNinjaEndpoints = {'currency': 'https://poe.ninja/api/Data/GetCurrencyOverview',
'map': 'https://poe.ninja/api/Data/GetMapOverview',
'unique map': 'https://poe.ninja/api/Data/GetUniqueMapO... | null | PoeApiTools/PoeApiTools.py | PoeApiTools.py | py | 11,371 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 179,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numb... |
395010217 | import threading
import asyncio
import time
import socket
import websockets
def thread_loop_task(loop):
# 为子线程设置自己的事件循环
asyncio.set_event_loop(loop)
# 获取主机ip
myName = socket.gethostname()
myIP = socket.gethostbyname(myName)
# webSock服务端任务:接收并显示客户端传递的信息,特定情况下向客户端发送信息
async def webSockServ... | null | video_test/test2.py | test2.py | py | 1,403 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "asyncio.set_event_loop",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "socket.gethostname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "socket.gethostbyname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "asynci... |
417984884 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
from sklearn.metrics import accuracy_score
from scipy.stats import mode
from mpl_toolkits.mplot3d import Axes3D
#from KMeans import KMeans
class KMeans(object):
def __init__(self, n_clusters=8, init='random', n_init=10,
... | null | unsupervised-learning/clustering/ind_kmeans.py | ind_kmeans.py | py | 5,896 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.choice",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.linalg"... |
218258308 | import requests
import views.baseSender as bs
class TelegramSender(bs.BaseSender):
service = "telegram"
def __init__(self):
super().__init__()
self.url = f"https://api.telegram.org/bot{self.token}/"
def sendMessage(self, msg: str, id: str) -> None:
requests.get(self.url + f"send... | null | views/telegram/telegramSender.py | telegramSender.py | py | 868 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "views.baseSender.BaseSender",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "views.baseSender",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests... |
483762190 | # -*- coding: utf-8 -*-
import requests
from scrapy.selector import Selector
def crawl_ips():
# 爬取西刺的免费ip代理
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
}
re = requests.get("http://www.xicid... | null | ArticleSpider/ArticleSpider/tools/crawl_xici_ip.py | crawl_xici_ip.py | py | 491 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scrapy.selector.Selector",
"line_number": 12,
"usage_type": "call"
}
] |
653946533 | #!/usr/bin/env python
import socket;
import multiprocessing;
import string;
import decimal;
def retHostName():
return socket.gethostname();
def retHostIP():
ipaddr='';
try:
s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM);
s.connect(('1.1.1.1',8000));
ipaddr = s.... | null | Reporting scripts/hostlib.py | hostlib.py | py | 1,056 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "socket.gethostname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_DGRAM... |
557266361 | import matplotlib.pyplot as plt
from sklearn import linear_model, datasets
import os
import simplejson
import sys
import numpy as np
from sklearn.datasets import load_svmlight_file
import loss_functions, make_plots
import hsodm_vr
dataset_name='a9a'
#logistic regression:
if dataset_name=='a9a':
X, Y = load_svmli... | null | test.py | test.py | py | 2,421 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.datasets.load_svmlight_file",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "loss_func... |
286886152 | from flask import Flask, render_template, url_for
from flask.ext.script import Manager, Server
app = Flask(__name__)
manager = Manager(app)
@app.route('/')
@app.route('/index')
def site_template():
return render_template('site_template.html')
manager.add_command('runserver', Server(
use_debugger=True,
u... | null | app.py | app.py | py | 388 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.ext.script.Manager",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.ext.sc... |
247282248 | from random import randint
from hyperas import optim
from hyperas.distributions import choice, uniform
from hyperopt import STATUS_OK, tpe, Trials
from keras.callbacks import ModelCheckpoint
from keras.layers import Conv2D, Dropout, BatchNormalization, Flatten, Dense
from keras.models import load_model, Sequential
from... | null | ottawa/ottawaGridSearch.py | ottawaGridSearch.py | py | 3,796 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3... |
145224745 | '''
/**
* Assignment 5 | ICT 4370 | Python Programming
*
* Class for Stocks.
*
* @category Assignment
* @package AssignmentFiveStock
* @author Kyle A. Carter <kyle.carter@du.edu>
* @copyright 2019 Kyle A. Carter
* @license https://opensource.org/licenses/GPL-3.0 GNU General Public License version... | null | five/carterk_assignment5_stock.py | carterk_assignment5_stock.py | py | 4,009 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "uuid.uuid1",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "locale.getdefaultlocale",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "locale.setlocale",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "locale.LC_ALL",
... |
283623352 | """Test the Diagnostics integration."""
from unittest.mock import AsyncMock, Mock
import pytest
from homeassistant.components.websocket_api.const import TYPE_RESULT
from homeassistant.setup import async_setup_component
from . import get_diagnostics_for_config_entry
from tests.common import mock_platform
@pytest.f... | null | tests/components/diagnostics/test_init.py | test_init.py | py | 1,473 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tests.common.mock_platform",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "unittest.mock.Mock",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "unittest.mock.AsyncMock",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": ... |
600887889 | #!/bin/python3
import pytest
from unittest.mock import Mock, patch
from pythfinder import Character
# Mock uuid4 in the collections package
def uuid4_mock():
yield "00000000-0000-0000-0000-000000000000"
yield "00000000-0000-0000-0000-000000000001"
yield "00000000-0000-0000-0000-000000000002"
yield "00... | null | tests/test_add_special.py | test_add_special.py | py | 4,319 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pythfinder.Character.__init__",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "pythfinder.Character",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "unittest.mock.Mock",
"line_number": 26,
"usage_type": "call"
},
{
"api_na... |
453087179 | # -*- coding: UTF-8 -*-
import datetime
def init():
global chatGroups
global vT
global usersDict
global admins
global ADMIN
global previousDay
chatGroups =[
u'亚特兰大租房二手万能总群',
]
v0= u"您好,亚特兰大加群建群小助手为您服务:)\n"
v00=u"每天只能加1个群哦;\n"
v1= u"回复 0 加亚特兰大租房二手万能总群;\n"
v2= u"回复 99 查看【北美加群小助手Jogchat.com... | null | settings.py | settings.py | py | 633 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "attribute"
}
] |
456422220 | """REST thingys to help accomplish:
1. extracting three.js shader library into a file
2. testing
3. ?
"""
import os
import json
import logging
_logger = logging.getLogger(__name__)
from flask import Flask, render_template, request, jsonify, Markup
import sys
THREEPYDIR = os.path.abspath(os.path.join(os.path.spli... | null | pyserver/flask_app.py | flask_app.py | py | 2,964 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"li... |
460749939 | #!/usr/bin/python3
import argparse
import os
import textwrap
import requests
from bs4 import BeautifulSoup
from tabulate import tabulate
# request number of "rows and columns" for command line (?) from kernel
# in PyCharm enable "emulate terminal in output console" in the run configuration for app
_, columns = os.po... | null | dictcc.py | dictcc.py | py | 4,578 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.popen",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "textwrap.wrap",
"line_numb... |
369830847 | from panda3d.core import Point3
from panda3d.core import Vec3
from panda3d.core import CollisionSphere
# from wecs import cefconsole
import wecs
from wecs.core import ProxyType
from wecs.aspects import Aspect
from wecs.aspects import factory
# from wecs.panda3d import debug
from wecs.panda3d.constants import FALLING_... | null | examples/panda3d-character-controller/game.py | game.py | py | 7,459 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "wecs.panda3d",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "wecs.panda3d",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "wecs.mechanics",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "wecs.panda3d"... |
613801405 | import Tkinter as tk
from tkFileDialog import askdirectory
import subprocess
import os
import tweepy # https://github.com/tweepy/tweepy # twitter-python api for getting tweets
import re # reg-ex for cleaning
import time
#########################################################
########################################... | null | GUI Python/TwitterMarkovChainGUI.py | TwitterMarkovChainGUI.py | py | 16,847 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "Tkinter.Frame",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "Tkinter.Frame.__init__",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "Tkinter.Frame",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "Tkinter.... |
617516369 | """Set up default groups and permissions"""
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User, Group, Permission
from wbd.dictionary.models import Entry
advanced_search = Permission.objects.get(codename='search_gloss', content_type__model__exact='gloss')
... | null | wald/wald/dictionary/fixtures/management/commands/permissions.py | permissions.py | py | 1,789 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.auth.models.Permission.objects.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.Permission.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.auth.models.Permission",
"l... |
634819922 | import getopt
import os
import subprocess
import sys
import time
import openpyxl
def main(argv):
tool = ''
bench_dir = ''
max_core = 1
timeout = 0
export_stat = ''
try:
opts, args = getopt.getopt(argv, "hs:d:c:t:o:", ["solver=", "dir=", "core=", "timeout=", "output="])
except geto... | null | eval/scala.py | scala.py | py | 3,856 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "getopt.getopt",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "getopt.GetoptError",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_n... |
362864337 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Author: Erick
import pymysql
import urllib.request
import json
import ssl
db = pymysql.connect(host="rm-wz90e8415u329p00udo.mysql.rds.aliyuncs.com",user="root",passwd="forsource@2014",db="tkk_app",charset='utf8')
cursor = db.cursor()
url = 'https://www.xujc.club/api/u... | null | dorm_update_info/dorm_info_check.py | dorm_info_check.py | py | 1,208 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pymysql.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ssl._create_unverified_context",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.Request",
"line_number": 22,
"usage_type": "call"
},
{
"api... |
440197416 | # -*- coding: utf-8 -*-
from flask_restful import Resource, reqparse
from flask import request
from werkzeug.datastructures import FileStorage
import json
from common import db
from common.models import SearchSP
import time
import os
class Upload(Resource):
def __init__(self):
self.parser = reqparse.Reque... | null | resources/upload.py | upload.py | py | 1,297 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask_restful.Resource",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask_restful.reqparse.RequestParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask_restful.reqparse",
"line_number": 14,
"usage_type": "name"
},
{
... |
364436312 | from pprint import pprint
import sys
import csv
csv_header=("path", "min_valency", "max_valency","samples", "attributes")
from iterxml import multifile_iter_elems
from utils import remove_ns, get_path
def _get_children_from_analysis(path, analysis):
keys = analysis.keys()
for k in keys:
if k.startswith... | null | importtools/xmltools/lib/analyse.py | analyse.py | py | 2,930 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.get_path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.maxint",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "utils.get_path",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "utils.remove_ns",
"... |
652066072 | """
Main program file.
"""
from requests import HTTPError
import movie_service
import movie_ui as ui
def main():
"""
Program flow.
"""
ui.print_header()
search_term = ""
while search_term.lower() != "x":
search_term = input(
"Please enter a search term ('x' exits the app)... | null | apps/10_movie_search/you_try/program.py | program.py | py | 1,060 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "movie_ui.print_header",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "movie_service.search_titles",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "movie_ui.print_movie_info",
"line_number": 26,
"usage_type": "call"
},
{
"api_n... |
93359393 | """k-NN example using the Iris dataset from scikit-learn."""
import argparse
import pytorch_lightning as pl
import torch
from sklearn.datasets import load_iris
import prototorch as pt
if __name__ == "__main__":
# Command-line arguments
parser = argparse.ArgumentParser()
parser = pl.Trainer.add_argparse_... | null | examples/knn_iris.py | knn_iris.py | py | 1,372 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytorch_lightning.Trainer.add_argparse_args",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytorch_lightning.Trainer",
"line_number": 14,
"usage_type": "attribu... |
404159400 | import argparse
import numpy as np
from src.whale_optimization import WhaleOptimization
def parse_cl_args():
parser = argparse.ArgumentParser()
parser.add_argument("-nsols", type=int, default=50, dest='nsols', help='number of solutions per generation')
parser.add_argument("-ngens", type=int, default=30,... | null | woa-master/run.py | run.py | py | 4,066 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_... |
389934450 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 30 18:45:29 2019
@author: LocalAdmin
Measuring pressure using the Keithley DMM2110 Multimeter
hooked up to a Pressure Controller that gives pressure in volts (10V = 1 bar)
"""
# Standard libraries
import pyvisa as visa
import time
import datetime
import numpy as np
im... | null | meas_P_nosource.py | meas_P_nosource.py | py | 3,112 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "instrument_module.time_since",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "multimeter_module.me... |
407713320 | # -*- coding:utf-8 -*-
#/usr/bin/python3
"""
--------------------------------
@Author: Dyson
@Contact: Weaver1990@163.com
@file: data_clean.py
@time: 2018/7/2 9:00
--------------------------------
"""
import sys
import os
import numpy as np
import pandas as pd
import re
import functools
import datetim... | null | gy_data_matching/wheels/data_clean.py | data_clean.py | py | 15,460 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "wheels.wheels.oracle_connecter.wheels.oracle_connecter.oracle_connecter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "wheels.wheels.oracle_connecter.wheels",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "wheels.wheels.oracle_connecter... |
47756001 | import csv
import os
import pickle
import json
from itertools import chain
from shapely.geometry.polygon import Polygon
import threading
import shutil
import requests
# This script makes requests to the open NRW web server in order to download geospatial tile imagery.
"""configuration"""
NUM_THREADS = 4
... | null | Tile_Download.py | Tile_Download.py | py | 5,398 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "shapely.geometry.polygon.Polygon",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pickle.loa... |
27390785 | from sacred import Experiment
from racer.car_racing_env import car_racing_env, get_env, init_env
from racer.utils import setup_sacred_experiment, flatten_parameters, build_parameters
from racer.models.simple_nn import NNAgent, simple_nn
from scipy.optimize import minimize
ex = Experiment(
"scipy_nelder_mead",
... | null | racer/methods/scipy/nelder_mead.py | nelder_mead.py | py | 1,018 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sacred.Experiment",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "racer.car_racing_env.car_racing_env",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "racer.models.simple_nn.simple_nn",
"line_number": 10,
"usage_type": "name"
},
{
... |
54125860 | import statistics
from mathematics.calculus import *
import math
def get_systolic_amplitude(data, no_of_samples, capture_duration):
return max(data)
def get_p2p_interval(data, no_of_samples, capture_duration):
data = data[0:100]
max_1 = data[0]
max_1_index = 0
max_2 = 0
max_2_index = 0
... | null | src/ppg/ppg_features.py | ppg_features.py | py | 2,057 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "statistics.mean",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "statistics.median",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "statistics.mean",
"lin... |
497823139 | """
座右铭:如果现在的生活不是你想要的,那就是你自找的.
@project:yuke
@author:Si_jin_hui
@file:使用类和对象+数据库完成学生信息管理系统.PY
@ide:PyCharm
@time:2018-08-03 14:10:01
"""
import sqlite3
class StudentModel(object):
def __init__(self, db_name, table_name, field_name, field_age, field_score, field_id):
self.db_name = db_name
self.tab... | null | zhengke/8-3/使用类和对象+数据库完成学生信息管理系统.py | 使用类和对象+数据库完成学生信息管理系统.py | py | 5,862 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlite3.connect",
"line_number": 27,
"usage_type": "call"
}
] |
488310256 | from flask import Flask, request, jsonify
from flask_sqlalchemy import SQLAlchemy
from os import environ
from flask_cors import CORS
app = Flask(__name__)
# app.config['SQLALCHEMY_DATABASE_URI'] = environ.get('dbURL')
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+mysqlconnector://root@localhost:3306/spm'
app.config[... | null | spm website/learningmaterial.py | learningmaterial.py | py | 2,762 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.jsonify"... |
485194932 | import findspark
from pyspark import SparkContext
from pyspark.sql.functions import *
from pyspark.sql.types import StringType
from pyspark import StorageLevel
from pyspark import SQLContext
import time
def getColumns(row, indexes):
row = row.split(',')
tmp = [row[i] for i in indexes]
return tmp
findspark... | null | src/db2-q2-spark-rdd-b.py | db2-q2-spark-rdd-b.py | py | 1,329 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "findspark.init",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pyspark.SQLContext",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pyspark.Storag... |
505205805 | import pickle
from collections import Counter
with open('../../data/raw_lexicon.pk', 'rb') as f:
data = pickle.load(f)
new = {}
cutoff = 0.1
for word, entry in data.items():
pol = []
for source in ['german','GermanPC','GermanSentiWS','GermanSentiSpin']:
try:
value = entry[source]
except KeyEr... | null | src/extra/dumb_vote.py | dumb_vote.py | py | 805 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pickle.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 38,
"usage_type": "call"
}
] |
510016602 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 2020-10-29 08:33
import tensorflow as tf
import numpy as np
import os
import argparse
import glob
import re
import librosa
import soundfile as sf
from tensorflow import keras
from tensorflow.keras import layers, losses, metrics, optimizers, models
from config import *
... | null | inference.py | inference.py | py | 1,489 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "librosa.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "librosa.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number... |
470395452 | import torch
import torch.nn as nn
class SELayer(nn.Module):
def __init__(self, channel, reduction=16):
super(SELayer, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.fc = nn.Sequential(
nn.Linear(channel, channel // reduction, bias=False),
nn.ReLU(inp... | null | model/cascade_age.py | cascade_age.py | py | 2,659 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.AdaptiveAvgPool2d",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
... |
596118332 | from django.contrib import messages
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import HttpResponseRedirect
from django.shortcuts import redirect, render
from hotline.perms import permissions
from hotline.reports.models import Invite, Report
from .forms import UserNoti... | null | hotline/notifications/views.py | views.py | py | 2,652 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "models.UserNotificationQuery",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "forms.UserNotificationQueryForm",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.success",
"line_number": 27,
"usage_type": "call"
... |
654367852 |
try:
from . import i18n
from . import connect_core
from . import log
from . import screens
from . import exceptions
from . import command
except ModuleNotFoundError:
import i18n
import connect_core
import log
import screens
import exceptions
import command
def get_post... | null | PyPtt/_api_get_post_index.py | _api_get_post_index.py | py | 3,123 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "command.GoMainMenu",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "command.Enter",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "command.Ctrl_C",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "comman... |
588908355 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 26 10:30:43 2019
@author: Administrator
"""
import requests
import json
import pandas as pd
import os
import pymysql
pd.set_option('display.max_columns', None)
os.chdir("E:\Program Files\Anaconda\kapark")
db = pymysql.connect(host="120.79.98.237",port... | null | pythonscrpip/wx_user_info.py | wx_user_info.py | py | 2,499 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.set_option",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pymysql.connect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"li... |
128144180 | # -*- coding: utf-8 -*-
import logging
import pika
import time
from pika.adapters.tornado_connection import TornadoConnection
pika.log = logging.getLogger(__name__)
class PikaClient(object):
INPUT_QUEUE_NAME = 'in_queue'
def __init__(self, io_loop):
self.io_loop = io_loop
self.received_messa... | null | pika_client.py | pika_client.py | py | 3,600 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pika.log",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pika.PlainCredentials",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionPa... |
497601003 | """
"""
from __future__ import annotations
from typing import Callable, Union
import geoutils as gu
import numpy as np
import rasterio as rio
import rasterio.warp
def get_mask(array: Union[np.ndarray, np.ma.masked_array]) -> np.ndarray:
"""
Return the mask of invalid values, whether array is a ndarray with... | null | xdem/spatial_tools.py | spatial_tools.py | py | 8,829 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Union",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.ma",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.ma",
"line_nu... |
128570644 | # multiprocessing
# 由于Python是跨平台的,自然也应该提供一个跨平台的多进程支持。
# multiprocessing模块就是跨平台版本的多进程模块。
# multiprocessing模块提供了一个Process类来代表一个进程对象,
# 下面的例子演示了启动一个子进程并等待其结束:
import os
from multiprocessing import Process
# 子进程执行的代码
def run_proc(name):
print('Run child process %s (%s)...' % (name, os.getpid()))
if __name__ == '... | null | Thread/MultiProcessingTest.py | MultiProcessingTest.py | py | 2,768 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.getpid",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_num... |
189377922 | import numpy as np
from numba import *
from PIL import Image, ImageFilter
import os
import Utility
# ------ Test image generation ---------
cupNames = ["36", "125", "127", "153", "157", "161", "259", "262", "308", "507", "514", "774", "875"]
coilNames = ["7", "13", "22", "26", "29", "32", "39", "55", "62", "64", "65... | null | src/ImageManipulation.py | ImageManipulation.py | py | 9,208 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PIL.Image.open",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "PIL.Image.new",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number":... |
465231526 | import requests
import json
import hashlib
isbn = '9780062380661'
isbn2 = '9780451474575'
response = requests.get('https://www.googleapis.com/books/v1/volumes?q=isbn:{}'.format(isbn))
ret = json.loads(response.text)
# parse = json.dumps(ret)
# print(type(parse))
print(ret['items'][0]['volumeInfo']['title'])
title =... | null | scripts/api.py | api.py | py | 433 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 18,
"usage_type": "call"
}
] |
344363530 | from collections import deque
def bfs():
queue = deque()
queue.append((n, 0))
visit = set()
answer = []
while queue:
number, cnt = queue.popleft()
if cnt == k:
answer.append(number)
continue
string = list(str(number))
for ... | null | BOJ/BOJ Python/PY1039_교환.py | PY1039_교환.py | py | 909 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
}
] |
585845881 | # -*- coding:utf-8 -*-
import face_recognition
import os
import sqlite3
import pandas as pd
from config import dbpath
class encodefaces(object):
def __init__(self,dir):
self.dbpath=dbpath
self.file_path = dir
def save2sql(self):
conn=sqlite3.connect(self.dbpath)
... | null | encodefaces.py | encodefaces.py | py | 1,115 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "config.dbpath",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number"... |
22986280 | # coding=utf-8
from __future__ import unicode_literals
__loader__ = None
import datetime
import json
import os
import random
import time
import unittest
import sys
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from faker import Generator, Factory
from faker.utils import tex... | null | faker/tests/__init__.py | __init__.py | py | 14,012 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "faker.shims.Count... |
395415387 | from __future__ import division
from numpy import *
import numpy.random
from sklearn.datasets import fetch_mldata
import matplotlib.pyplot as plt
import sklearn.preprocessing
import itertools
mnist = fetch_mldata('MNIST original', data_home='./')
data = mnist['data']
labels = mnist['target']
neg, pos = 0, 8
train_idx... | null | test.py | test.py | py | 5,951 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.datasets.fetch_mldata",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random.RandomState",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name"... |
636849081 | '''
Created on Jan 16, 2017
@author: Alexandre Day
'''
import numpy as np
from matplotlib import pyplot as plt
import matplotlib.patheffects as PathEffects
from .mycolors import COLOR_PALETTE
from .fdc import FDC
import math
def set_nice_font(size = 18, usetex=False):
font = {'family' : 'serif', 'size' : size}... | null | fdc/plotting.py | plotting.py | py | 16,580 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotli... |
246026836 | __author__ = "Jurjen de Jong (jurjendejong@strw.leidenuniv.nl)"
from h5_merger import merge_h5
from glob import glob
from argparse import ArgumentParser, ArgumentTypeError
def str2bool(v):
v = str(v)
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f',... | null | pipeline_scripts/surf/merge_selfcals.py | merge_selfcals.py | py | 1,765 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "glob.glo... |
592150169 | import pygame as pg
class InputState:
STILL_RELEASED, JUST_PRESSED, STILL_PRESSED, JUST_RELEASED = 0, 1, 2, 3
def __init__(self):
# Keyboard state boolean list.
self._current_keys = pg.key.get_pressed()
self._prev_keys = None
# Mouse state boolean list.
self.current_mou... | null | src/input/input_state.py | input_state.py | py | 1,371 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.key.get_pressed",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.key",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.mouse.get_pressed",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.... |
430692513 | import os
import numpy as np
import torch
from PIL import Image
from torch.utils import data
num_classes = 19
ignore_label = 255
palette = [128, 64, 128, 244, 35, 232, 70, 70, 70, 102, 102, 156, 190, 153, 153, 153, 153, 153, 250, 170, 30,
220, 220, 0, 107, 142, 35, 152, 251, 152, 70, 130, 180, 220, 20, 60,... | null | datasets/cityscapes.py | cityscapes.py | py | 4,155 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PIL.Image.fromarray",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "numpy.uint8",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"lin... |
414150231 |
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import h5py
import sys
import numpy as np
from analysis_methods import *
plt.rc('text', usetex=True)
plt.rc('font', family='serif', size=16)
if __name__ == '__main__':
cos_survey = ['halos', 'dwarfs', 'halos', 'halos', 'dwarfs', 'halos']
l... | null | absorption/cos_comparison/absorption_analysis/plot_path_absorption_thresh_winds_difference.py | plot_path_absorption_thresh_winds_difference.py | py | 6,325 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
40664772 | # 2015.02.05 17:20:24 IST
from onep.topology.TopologyClass import TopologyClass
from onep.core.event.EventObject import EventObject
from onep.core.util.OnepConstants import OnepConstants
from onep.core.util.Enum import enum
from onep.topology.Edge import Edge
from onep.topology.Node import Node
from onep.topology.NodeC... | null | onepk_without_pyc/build/lib.linux-x86_64-2.7/onep/topology/TopologyEvent.py | TopologyEvent.py | py | 13,394 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "onep.core.event.EventObject.EventObject",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "onep.core.util.Enum.enum",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 50,
"usage_type": "call"
},
{
... |
337776572 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | null | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/source/git.py | git.py | py | 18,522 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.compile",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "re.M",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "googlecloudsdk.core.exceptions.Error"... |
452098339 | from django.shortcuts import render,HttpResponse, redirect
from time import gmtime, strftime
import datetime
def index(request):
if 'count' in request.session:
request.session['count'] += 1
else:
request.session['count'] = 0
return render(request, 'session_words/index.html')
def add(request):
word = ""
big = 0... | null | django_projects/project3 3/apps/session_words/views.py | views.py | py | 1,043 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "d... |
479824470 | import json
import glob
strain_dict = {}
date_dict ={}
name_dict ={}
accession_list = []
for filename in glob.glob('/Users/liam/Downloads/genome_assemblies/ncbi-genomes-2018-03-14/GCA*.txt'):
accfile = filename.rstrip('_assembly_report.txt \n').replace('/Users/liam/Downloads/genome_assemblies/ncbi-genomes-2018-03... | null | Vibrio/2018-03-15-dataset2bmetainfopanx.py | 2018-03-15-dataset2bmetainfopanx.py | py | 1,610 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "glob.glob",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 40,
"usage_type": "call"
}
] |
314443362 | import json
import requests
import boto3
'''
event = {
"StackId": "arn:aws:cloudformation:us-east-1:459772930601:stack/dumbo11/f1e067a0-9d23-11e5-995d-50d50182dc9a",
"ResponseURL": "https://cloudformation-custom-resource-response-useast1.s3.amazonaws.com/arn%3Aaws%3Acloudformation%3Aus-east-1%3A459772930601%3Asta... | null | populate_nvd_feed_list.py | populate_nvd_feed_list.py | py | 3,472 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_number": 6... |
84116940 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_messages', '0002_remove_message_encrypted'),
]
operations = [
migrations.AddField(
model_name='message',
... | null | django_messages/migrations/0003_message_encrypted.py | 0003_message_encrypted.py | py | 455 | 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.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
164733850 | #
# persist.py
# Part of SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ryan Hileman and Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter3
# License: MIT
#
from collections import defaultdict
from queue import Queue, Empty
import threading
import traceback
impo... | null | lint/persist.py | persist.py | py | 4,872 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "queue.Queue",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sublime.load_settings",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "util.merge_user_settings",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "threading.... |
35957487 | import pytest
import unittest
import rpz_wapi_module
import rpz_wapi_module2
import rpz_wapi_module3
import ConfigParser
import json
import logging
import glob
import commands
account_id = ''
cfw_id = ''
cfw_id1 = ''
cfw_group_id = ''
cfw_group_id1 = ''
cfw_list_id = ''
cfw_list_id1 = ''
cfw_list_data_id = ''
cfw_netwo... | null | rpz_api_automation/h.py | h.py | py | 14,497 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "ConfigParser.SafeConfigParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "... |
409472569 | import sys
from PySide2.QtWidgets import (QApplication, QDialog
, QVBoxLayout, QHBoxLayout, QLabel, QWidget
, QLineEdit, QPushButton
, QListWidget, QListWidgetItem)
from PySide2.QtCore import Slot, Qt
class MyForm(QDialog):
def... | null | python-venv/qt/dialog.py | dialog.py | py | 2,946 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PySide2.QtWidgets.QDialog",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PySide2.QtWidgets.QLineEdit",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QPushButton",
"line_number": 16,
"usage_type": "call"
},
{
... |
66511844 | """Module to perform data cleaning functions on EPA IPM data tables."""
import logging
import pandas as pd
import pudl.constants as pc
from pudl.helpers import simplify_columns
logger = logging.getLogger(__name__)
def load_curves(epaipm_dfs, epaipm_transformed_dfs):
"""
Pull and transform the load curve tab... | null | pudl/transform/epaipm.py | epaipm.py | py | 4,830 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pudl.helpers.simplify_columns",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "pudl.con... |
257013861 | import os
import argparse
import multiprocessing
from implicit.als import AlternatingLeastSquares
from implicit.bpr import BayesianPersonalizedRanking
from implicit.lmf import LogisticMatrixFactorization
import pickle
import mrecsys.factorization
from mrecsys.utils.model_selection import EvalResults
from mrecsys.uti... | null | mrecsys/factorization/trainer.py | trainer.py | py | 3,650 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.chdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.cpu_count",
... |
29138743 | #! python3
"""
Created on Mon Jul 20 15:24:04 2015
@author: Bogdan Istrate
"""
import os, xlrd, csv, sys
fileType = "text" #change to "excel" to only consider excel files
"""""""""""""""""""""
Utility method to check for empty positions which should not be considered 0
and should also not give errors.
... | null | old_scripts/dbGaP_NA_filtering_casecontrol_April21_2017.py | dbGaP_NA_filtering_casecontrol_April21_2017.py | py | 12,702 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_NONE",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"lin... |
648454651 | # coding:utf-8
import os
import sys
import time
import unittest
from common.apirequest import ApiRequest
from common.excelutil import ExcelUtil
from common.fileutil import FileUtil
from common.htmltestrunner import HTMLTestRunner
from conf.global_settings import DATADIR, REPORTDIR
#reload(sys)
#sys.setdefaultencodin... | null | pyapi/runtest.py | runtest.py | py | 3,625 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "common.fileutil.FileUtil.listdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "conf.global_settings.DATADIR",
"line_number": 20,
"usage_type": "argument"
},
... |
313682936 | import spotipy
import spotipy.util as util
scope = 'playlist-modify-public'
CLIENT_ID = ""
ClIENT_SECRET = ""
REDIRECT_URI = ""
counter_artists = 1
counter_tracks = 1
def get_username():
username = input("Your spotify username : ")
return username
def get_playlist_name():
playlist_name = input("\nPl... | null | creator.py | creator.py | py | 2,941 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "spotipy.util.prompt_for_user_token",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "spotipy.util",
"line_number": 80,
"usage_type": "name"
},
{
"api_name": "spotipy.Spotify",
"line_number": 83,
"usage_type": "call"
}
] |
164001133 | """
Topics: | Hash Table |
"""
"""
Unlike the LeetCode solution, this code won't map duplicate
elements in A to the same index in B. This is more consistent
with the usual definition of anagram.
"""
from collections import defaultdict
class Solution:
def anagramMappings(self, A, B):
"""
Time: O... | null | LeetCode/src/760 - Find Anagram Mapping.py | 760 - Find Anagram Mapping.py | py | 794 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.defaultdict",
"line_number": 22,
"usage_type": "call"
}
] |
80818871 | '''
Main allows to run Population Based Training (PBT), where trainings and tests run as separate processes.
Configuration should be specified in the config json file, given as an argument.
When running test it is recommended that args_test.json file is in a training directory,
since arguments are uploaded from the fil... | null | main_PBT.py | main_PBT.py | py | 14,645 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.use",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParse... |
126804346 | import numpy as np
import matplotlib.pyplot as plt
import os
import math
import yaml
import sys
print(str(sys.argv[1]))
file_name = "../dataset/"+str(sys.argv[1])+"/points_on_road.txt"
points = np.loadtxt(file_name, delimiter=',')
radar_x = points[:, 0]
radar_y = points[:, 1]
rtk_x = points[:, 2]
rtk_y = points[:... | null | calib_cam_radar/scripts/check_result.py | check_result.py | py | 1,085 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.loadtxt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numb... |
519948623 | # -*- coding: utf-8 -*-
import argparse
import random
import time
import math
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import matplotlib.ticker as ticker
import seaborn
seaborn.set()
import torch
import torch.nn as nn
from torch import optim
def evaluate(encoder, decoder, sentence, max_length=MAX... | null | evaluate_kd_model.py | evaluate_kd_model.py | py | 1,645 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.switch_backend",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "seaborn.set",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.no... |
448662204 | # -*- coding: UTF-8 -*-
from bs4 import BeautifulSoup
import requests
import sys
reload(sys)
sys.setdefaultencoding('utf8')
def towrite(contentdict):
f.writelines('上课班级:' + contentdict['class_name'] + '\n')
f.writelines('课程名称:' + contentdict['courses_name'] + '\n')
f.writelines('总学时:' + contentdict['class... | null | spider/peclubteacher.py | peclubteacher.py | py | 2,504 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 32,
"usage_type": "call"
}
] |
550619355 | from post import Post
from part import Part
import argparse
import logging
import os
import utility
def checkDependences():
if not os.path.exists('ffmpeg.exe'):
print('ffmpeg.exe required!')
return False
try:
utility.getAria2cClientInstance().tellActive()
except:
print('Fai... | null | bdownload.py | bdownload.py | py | 2,083 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.exists",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "utility.getAria2cClientInstance",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.b... |
373266330 | def data_return(query_sentence_string):
from fuzzywuzzy import fuzz
import sqlite3
#convert query string to list
query_sentence_list = query_sentence_string.split()
#pattern of list to guess from query
schedule_type_predictor = ["class"]
week_day_predictor = ["sunday","monday", "tuesday",... | null | schedule_fetcher.py | schedule_fetcher.py | py | 2,282 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "fuzzywuzzy.fuzz.partial_ratio",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "fuzzywuzzy.fuzz",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 41,
"usage_type": "call"
}
] |
481734442 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | null | LiftTracker/migrations/0001_initial.py | 0001_initial.py | py | 1,378 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 11,
"usage_type": "call... |
101172798 | import numpy as np
import mcubes
def triangulate_and_show_cube(cube, color='b'):
v,t = triangulate_cube(cube)
show_triangulation(v,t, colr=color)
def triangulate_cube(cube):
"""
:param cube: nd.array NxNxN where cube[i,j,k]==0 defines algebraic surface
:return:(list of vertices, list of triangle... | null | General/triangulation.py | triangulation.py | py | 1,959 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mcubes.marching_cubes",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.cross",
"line... |
221746920 | from collections import Counter
import numpy as np
import os
import pathlib
import sys
import torch
import Classifier
import RavenDataLoader
def set_bn_eval(m):
# Freeze batchnorm layers in model
classname = m.__class__.__name__
if classname.find('BatchNorm2d') != -1:
m.eval()
# Train for a spec... | null | train_specific.py | train_specific.py | py | 5,287 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.multiprocessing.freeze_support",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.mul... |
91984955 | from collections import namedtuple, defaultdict, OrderedDict
def drop_initial_data_field(rawdata_string):
"""
:param rawdata_string:String: a BATS raw data line
:return: String: a BATS raw data line without the superfluous first char
>>> drop_initial_data_field('abc')
'bc'
>>> drop_initial_da... | null | models.py | models.py | py | 3,534 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.namedtuple",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "... |
154734085 | import asyncio
import uuid
import boto
import boto.ec2
import boto.utils
import psycopg2
from subprocess import check_call
from .utils import pg_lsn_to_int
from .plugin import subscribe
class Ec2Plugin:
def __init__(self, name, app):
pass
@subscribe
def initialize(self):
self._metadata... | null | zgres/ec2.py | ec2.py | py | 5,846 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "boto.utils.get_instance_metadata",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "boto.utils",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "plugin.subscribe",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "plu... |
335689915 | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 18 08:27:22 2017
@author: Jaywan Chung
"""
import numpy as np
from scipy.interpolate import interp1d
from .measured import Measured
class MatProp:
"""Manage Material Properties (TEPs).
The class is initialized by property name, metric unit, an... | null | libs/pykeri/matprop.py | matprop.py | py | 8,384 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 61,
... |
524491528 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
身份验证,允许三种验证方式:IP白名单、签名、cookie-session。
IP白名单不推荐使用;
具备appId、timestamp和sign三个参数的请求使用签名进行身份验证,建议服务器间访问使用;
其他请求通过账号密码登录后,使用session维护登录状态,并基于session进行身份验证,建议PC访问使用,未登录时访问除/login以外
的接口时将重定向至登录静态页面。
"""
import web
import time
import hashlib
loginPath = '/login'
indexPath = '/st... | null | web/processors/Authenticate.py | Authenticate.py | py | 2,637 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "hashlib.md5",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "web.input",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "web.HTTPError",
"line_number": 44... |
255931953 | import logging
import random
import time
from selenium.webdriver.common.by import By
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.action_chains import ActionChains
from ..offerquestbase import OfferQuestBase
class DragDropQuiz(OfferQuestBase):
def __init__(self, brows... | null | msreward/worker/offerquests/quiz/dragdrop.py | dragdrop.py | py | 1,431 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "offerquestbase.OfferQuestBase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.ID",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.by.By",
"line_number": 14,
"usage_type": ... |
476450047 | ## Author: Jess Sanford
##
##
##
##
## Walls for the maze of Get A Job. They do not move, but can me removed from
## the screen. They are perfect squares
import pygame
import math
from vector import Vector
class Wall:
#radius to apply obstacle avoidance
##circle around perfect square
... | null | wall.py | wall.py | py | 2,018 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "vector.Vector",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "vector.Vector",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "vector.Vector",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "vector.Vector",
"line_n... |
441616678 | import itertools
from Planning.pddl_lib.pddlpy.domain_listener import DomainListener
from Planning.pddl_lib.pddlpy.operators import Operator
from Planning.pddl_lib.pddlpy.pddlLexer import CommonTokenStream
from Planning.pddl_lib.pddlpy.pddlLexer import FileStream
from Planning.pddl_lib.pddlpy.pddlLexer import pddlLexe... | null | Planning/pddl_lib/pddlpy/domain_problem.py | domain_problem.py | py | 3,568 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "Planning.pddl_lib.pddlpy.pddlLexer.FileStream",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "Planning.pddl_lib.pddlpy.pddlLexer.pddlLexer",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "Planning.pddl_lib.pddlpy.pddlLexer.CommonTokenStream",... |
519018222 | import sys
sys.path.append('../ISM/')
from reid14_cordes02 import *
import matplotlib.pyplot as plt
from astropy.io import fits
from astropy import units as u
from astropy.coordinates import SkyCoord
from matplotlib.patches import Circle
comap = fits.open("/home/timothy/Desktop/Tangents_Gamma/Data/Dataset/COGAL_deep... | null | Sct/atlas.py | atlas.py | py | 9,975 | 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": "astropy.io.fits.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
... |
548499924 | #!/usr/bin/env python3
### IMPORTS
from keras import models
from keras import utils
from keras.layers import Dense
from keras.layers import Dropout
import getopt
import multiprocessing
import numpy as np
import os
import random
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import auc
import s... | null | ann/scientificNames-pdffnn-auc.py | scientificNames-pdffnn-auc.py | py | 5,157 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.stderr",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.cpu_count",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "getopt.geto... |
3613719 | import networkx as nx
import matplotlib.pyplot as plt
import os
from funcoesTaxiway import *
G = nx.Graph()
#24 nós
G.add_node('31L-ECHO', label = '31L-ECHO', color = 'black')
G.add_node('31L-KILO-GOLF', label = '31L-KILO-GOLF', color = 'black' )
G.add_node('31L-DELTA', label = '31L-DELTA', color = 'black')
G.add_no... | null | GrafoTaxiways/taxiways.py | taxiways.py | py | 7,607 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "networkx.Graph",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "networkx.get_node_attributes",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "networkx.get_node_attributes",
"line_number": 79,
"usage_type": "call"
},
{
"api_name"... |
466464157 | '''jupyterで実行している'''
#%%
# DataFrameの作成
from pyspark.sql import SparkSession
spark = SparkSession.builder.appName('titanic').config('spark.some.config.option', 'some-value').getOrCreate()
df = spark.read.csv('data/train.csv', header=True, encoding='utf-8', inferSchema=True)
#%%
# データの確認
df.show()
df.printSchema()
#... | null | titanic.py | titanic.py | py | 2,525 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 6,
"usage_type": "... |
63783801 | import time
import json
from selenium import webdriver
import sys
import redis
r = redis.Redis(host='153.92.5.10', port=6379, db=0)
count = 1
with open('data.json', 'r') as json_file:
data = json.loads(json_file.read())
path = '/screenshots'
for row in data:
url = row['link_page']
if not (r.exists('webpage:'... | null | script.py | script.py | py | 1,334 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "redis.Redis",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "selenium.webdr... |
479430116 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy,sys,time
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import LSTM
from keras.callbacks import ModelCheckpoint
from keras.utils import np_utils
import string
# In[2]:
filename = 'da... | null | Generate_by_rnn.py | Generate_by_rnn.py | py | 2,968 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "string.punctuation",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "string.punctuation",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "numpy.reshape",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "keras.u... |
598656235 | #!/usr/bin/env python
"""
Watches the keyboard for the specified sequences of keys and echoes them.
Usage:
echo_keys.py [--keyboard=<DEVICE_NODE>] [--show-scancodes] [<keys>...]
Options:
--keyboard=<DEVICE_NODE> Device node of the keyboard [default: /dev/input/event2]
-s, --show-scancodes Show ... | null | scripts/echo_keys.py | echo_keys.py | py | 2,691 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pykeywatcher.keywatcher.generate_keys",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pykeywatcher.keywatcher",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "evdev.InputDevice",
"line_number": 42,
"usage_type": "call"
},
{
"a... |
444026774 | # -*- coding: utf-8 -*-
"""
Grid Searchin to evaluate For XGBoost Calssifier
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from ScalerAndOneHotEncoder import ScalerAndOneHotEncoder
from sklearn.preprocessing import StandardScaler
from Filter_extreme_earns import filter_extreme_earns
from sk... | null | Capstone Prject 1/Est_xgboost_random.py | Est_xgboost_random.py | py | 3,891 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "warnings.simplefilter",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "dataset_manipulation_funcs.load_filter_dataset",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 54,
"usage... |
281956262 | """ ADOPTION SHELTER PROJECT"""
from _typeshed import FileDescriptor
from flask import Flask, url_for, render_template, redirect, flash, jsonify
from flask_debugtoolbar import DebugToolbarExtensions
from models import db, connect_db, Pet
from forms import AddPetForm, EditPetForm
app = Flask(__name__)
app.config['SECR... | null | app.py | app.py | py | 2,084 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.connect_db",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.db.create_all",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.db",
"li... |
399015281 | '''
输出MUAPTs的时间间隔的图片
'''
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pdb
import scipy.io as sio
import sys
sys.path.append('E:\swt\Spike_Sorting')
from Spike_Sorting import spike_sorting
import scipy.stats as stats
class spike_sorting_intervals(spike_sorting):
de... | null | results/plot_intervals.py | plot_intervals.py | py | 1,845 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "Spike_Sorting.spike_sorting",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.load"... |
297081162 | import pymysql
# 连接mysql,分别为: 地址, 账号, 密码, 表
db = pymysql.connect('localhost', 'root', 'root', 'weiliu_wechat_app_link')
cursor = db.cursor()
cursor.execute("SELECT VERSION()")
data = cursor.fetchone()
print("Database version: %s" % data)
db.close()
| null | python/practice/02_sql/01_mysql_connect.py | 01_mysql_connect.py | py | 279 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pymysql.connect",
"line_number": 4,
"usage_type": "call"
}
] |
276432157 | import os
from pathlib import Path
# Autenticação
secret_key = 'ifpbinfo'
# Conexões com os Bancos de dados.
usuario = 'root' #os.environ.get('DB_USUARIO', 'db_senha')
senha = 'ifpbinfo' #os.environ.get('DB_SENHA', 'db_senha')
# Depuração
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'mysql+mysqlconnector://{... | null | Servico/common/settings.py | settings.py | py | 636 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pathlib.Path.home",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 24,
"usage_type": "name"
}
] |
12517478 | from collections import Counter
class Solution(object):
def findTheDifference(self, s, t):
"""
:type s: str
:type t: str
:rtype: str
"""
c = Counter( t )
for i in s:
c[ i ] -= 1
if not c[ i ]:
del c[ i ]
... | null | 389.py | 389.py | py | 350 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.Counter",
"line_number": 11,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.