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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
324822817 | import os
import numpy as np
import pytest
from sklearn.base import clone
from tensorflow.python.keras.testing_utils import get_test_data
from scikeras.wrappers import KerasClassifier, KerasRegressor
from .mlp_models import dynamic_classifier, dynamic_regressor
# Defaults
INPUT_DIM = 5
HIDDEN_DIM = 5
TRAIN_SAMPLE... | null | tests/test_parameters.py | test_parameters.py | py | 7,366 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.python.keras.testing_utils.get_test_data",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.allclose",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "scikeras.wrappers.KerasRegressor",
"line_number": 58,
"usage_type": "a... |
107846496 | """
Bugs tests
- Columns aren't case-insensitive.
For debug information use:
pytest-3 --log-cli-level debug
"""
import os
import sys
import logging
# Look for the 'utils' module from where the script is running
prev_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if prev_dir not in sys.path:
s... | null | tests/test_bom/test_bugs.py | test_bugs.py | py | 2,433 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_num... |
397308189 | import glob
import random
import os
import numpy as np
import torch
from torch.utils.data import Dataset
from PIL import Image
import torchvision.transforms as transforms
# Normalization parameters for pre-trained PyTorch models
mean = np.array([0.5, 0.5, 0.5])
std = np.array([0.5, 0.5, 0.5])
def denormalize(tensor... | null | src/dataset/datasets.py | datasets.py | py | 1,504 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.clamp",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.Dataset",
"l... |
116200954 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 30 20:33:58 2019
@author: Bohan
"""
import requests,json,hashlib,os,time
from pathlib import Path
from time import time, perf_counter
from fake_useragent import UserAgent
from xml.etree import ElementTree
#引入requests。
session = requests.session()
headers = {
'User-Agent... | null | phytozomedownloaderV1.1(Chinese_English).py | phytozomedownloaderV1.1(Chinese_English).py | py | 12,291 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.session",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.utils.dict_from_cookiejar",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "requests.utils",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name"... |
403453705 | import cv2
import numpy as np
from skimage import measure
def regiao_int(imagem,img,pix):
# Binarizacao da imagem
ret, thresh = cv2.threshold(imagem, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
# Rotula as regiões conectadas da matriz(imagem)
labels = measure.label(thresh, neighbors=4, background=255... | null | proj_mosca/mosca/m_contornos.py | m_contornos.py | py | 1,608 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.threshold",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_BINARY",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.THRESH_OTSU",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "skimage.measur... |
38741978 | import os
import io
from straceParserLib.StraceParser import StraceParser
class Stana:
def __init__(self, *args, **kwargs):
self.__enabledPlugins = {}
self.__file = None
self.__options = None
pass
def enablePlugin(self, pluginName, pluginOptions=None):
"""Enable plugi... | null | Stana.py | Stana.py | py | 4,187 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.isfile",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "straceParserLib.StraceParser.StraceParser",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": ... |
390781211 | #!/usr/bin/env python
"""High-level planner that manages A* paths and environment obstacles."""
import rospy
from nav_msgs.msg import OccupancyGrid
from nav_msgs.msg import MapMetaData
import numpy as np
import matplotlib.pyplot as plt
import tf
from std_msgs.msg import Float32MultiArray
from astar import AStar, DetOc... | null | scripts/navigator.py | navigator.py | py | 9,701 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rospy.init_node",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tf.TransformListener",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "rospy.Subscriber",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "nav_msgs.msg.Oc... |
287205978 | #!/usr/bin/env python
import gnupg
gpg = gnupg.GPG(gnupghome='/root/.gnupg')
publickey = open('Sylar.pub','rb')
key_data = publickey.read()
publickey.close()
import_result = gpg.import_keys(key_data)
public_keys = gpg.list_keys()
pgpfile = open('/etc/rc.local','rb')
pgpdata = pgpfile.read()
pgpfile.close()
encrypte... | null | gpg文件加密、解密/encry.py | encry.py | py | 386 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "gnupg.GPG",
"line_number": 4,
"usage_type": "call"
}
] |
517201907 | from scipy.io.wavfile import read as wavread
from scipy.io.wavfile import write as wavwrite
import numpy as np
import os.path
# Calculations to determine length of kernel at running_mean for a given cut-off frequency.
def calcH(n, f, fs): # calculates transfer function
w = 2 * np.pi * f / fs
h = 1.0 / n * np.... | null | generateWavs.py | generateWavs.py | py | 3,310 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.pi",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": ... |
398257788 | '''
Created on Jun 6, 2016
@author: airingzhang
'''
import numpy as np
import glob as glob
import sys
import os
from deepnet import deepnet_pb2
from google.protobuf import text_format
class FeatureParser (object):
'''
This file is used for audio project with Prof. Chen to parse the concatenated Features.
... | null | deepnet/examples/DeepEAR/LOSO_2_Multimodal_ITF/features_parser.py | features_parser.py | py | 9,789 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "deepnet.deepnet_pb2.Dataset",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "deepnet.deepnet_pb2",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path"... |
9390248 | import requests
import json
import time
import calendar
import logging
with open('config.json') as fp:
CONFIG = json.load(fp)
client_id = str(CONFIG['client_id'])
USERLIST_API = "http://tmi.twitch.tv/group/user/{}/chatters"
def get_current_users(ch, user_type='all'):
url = USERLIST_API.format(ch)
r = requ... | null | twitch_utils.py | twitch_utils.py | py | 1,560 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.exception",
"line_numb... |
292755576 | from dashboard.models import *
from datetime import datetime
def weight_distribution():
distribution ={
'over_weight':0,
'under_weight':0,
'normal':0
}
cattle_objs = Cattle.objects.all()
for cattle in cattle_objs:
weight = DailyWeight.objects.all().order_by('date_time... | null | instaweight/dashboard/graph_utils.py | graph_utils.py | py | 634 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
}
] |
330831633 | # Author: Jean-Remi King <jeanremi.king@gmail.com>
#
# Licence : GNU GPLv3
import numpy as np
from sklearn.base import BaseEstimator
from joblib import Parallel, delayed
class SelfRegression(BaseEstimator):
""" Fit a series of regressors that aim at predicting each feature when
the latter is hidden from the ... | null | jr/meg/artefact.py | artefact.py | py | 9,082 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "mne.parallel.check_n_jobs",
"line_number": 32,
"usage_type": "call"
},... |
477219843 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib.dates as mdates
import seaborn as sns
from ipywidgets import interactive, FloatSlider, fixed, Text, BoundedIntText
from ipywidgets import Layout, Dropdown
from outbreak_modelling import *
def sim... | null | plotutils.py | plotutils.py | py | 9,178 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.concat",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "matplotlib... |
132788144 | " I am a generic padding oracle exploit written using the Twisted framework "
from twisted.internet import defer
from random import choice
import sys
ASCII = map(chr, range(256))
ASCII.reverse()
def xor(a, b):
return ''.join([chr(ord(x) ^ ord(y)) for x, y in zip(a, b)])
class POExploit:
" I am the padding or... | null | poracle.py | poracle.py | py | 1,714 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "twisted.internet.defer.DeferredList",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "twisted.internet.defer",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "twisted.internet.defer.returnValue",
"line_number": 27,
"usage_type": "call"
... |
618447371 | import sqlite3
from public import website
from flask import g
DATABASE = 'db/message-board.db'
def connect_db():
db = sqlite3.connect(DATABASE)
db.row_factory = convert_row_to_dictionary
return db
def init_db():
with website.app_context():
db = get_db()
with website.open_resource(... | null | assets/projects/message-board/public/datamanager.py | datamanager.py | py | 1,211 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlite3.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "public.website.app_context",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "public.website",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "public.webs... |
206451197 | from django.shortcuts import get_object_or_404, render,redirect,get_list_or_404
from tly_shopingcart.models import *
from .models import *
from django.core.exceptions import ObjectDoesNotExist
# Create your views here.
def cart_details(request,tot=0,count=0,cart_itmes=None):
try:
ct=cartlist.objects.get(ca... | null | add_cart/views.py | views.py | py | 1,888 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.core.exceptions.ObjectDoesNotExist",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 39,
"usage_type": "call"
}... |
66824095 | '''
Task Coach - Your friendly task manager
Copyright (C) 2004-2008 Frank Niessink <frank@niessink.com>
Task Coach 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 yo... | null | branches/Release0_72_Branch/taskcoachlib/gui/viewer/container.py | container.py | py | 6,275 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "wx.CallAfter",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "taskcoachlib.patterns.Publisher",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "taskcoachlib.patterns",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "wx... |
424712386 | from django.urls import path
from article import views
app_name = 'article'
urlpatterns = [
path('', views.article, name='article'),
path('articleCreate/', views.articleCreate, name='articleCreate'),
path('articleRead/<int:articleId>/', views.articleRead, name='articleRead'),
path('articleUpdate/<int:... | null | blog/article/urls.py | urls.py | py | 538 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "article.views.article",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "article.views",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.urls.pa... |
85853855 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import from_levels_and_colors
from mpl_toolkits.basemap import Basemap, cm
import Nio # use PyNIO for netCDF data I/O, instead of scipy.io
theta_sat_data = np.genfromtxt(
'/Users/wusun/Dropbox/IGBP_SOILS/local_output/ThetaS.srf', usecols=0)
#th... | null | plot_theta_sat.py | plot_theta_sat.py | py | 3,290 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number"... |
229896601 | import json
from django.views.generic import View
from js_logger.forms import ErrorForm
from js_logger import models
from django import http
def get_ip(request):
"""
Get IP address from request
"""
ip = request.META.get('REMOTE_ADDR') or \
models.Error._meta.get_field('ip').default
if ip... | null | js_logger/views.py | views.py | py | 1,046 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "js_logger.models.Error._meta.get_field",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "js_logger.models.Error",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "js_logger.models",
"line_number": 15,
"usage_type": "name"
},
{
... |
334349232 | # Functions for the itemset mining.
import csv
import pandas as pd
import numpy as np
from collections import defaultdict
import matplotlib.pyplot as plt
import networkx as nx
from networkx.algorithms.approximation import clique
# FUNCTION THAT TURNS A DICTIONARY INTO GRAPH IF VALUES ARE EQUAL
def GraphDict(nam... | null | coffee_analysis.py | coffee_analysis.py | py | 1,820 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.defaultdict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 59,
"usage_type": "call"
}
] |
611519610 | #Tkinter has different import names on different versions.
import tkinter
from tkinter import *
from tkinter import Frame
import tkinter.scrolledtext as tkst
#These are all standard LIbs
import subprocess, shlex, sys
from threading import Thread
from multiprocessing import Queue
from time import sleep
#This is a... | null | pyJmx-master/PyJmx.py | PyJmx.py | py | 4,203 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.stdout",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "tkinter.INSERT",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Frame",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "config.jmxFold... |
162199989 | import networkx as nx
import matplotlib.pyplot as plt
from utils import draw_automat
from utils import get_active_states
class State(object):
def __init__(self, name='X', prefix=set(), suffix=set(),transition = {},pre_states = {}):
self.name = name
self.prefix = prefix
self.suffix = suffix
self.transition = t... | null | lstm_exp5/gen_automat1.py | gen_automat1.py | py | 7,159 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.get_active_states",
"line_number": 210,
"usage_type": "call"
}
] |
337418143 | # -*-coding:utf-8-*_
from collections import namedtuple
Label = namedtuple(
'Label', ['id', 'categoryId', 'label', 'name'])
sign_instructive_labels = {
Label(0, 0, "i1", u"步行"),
Label(1, 1, "i2", u"非机动车行驶"),
Label(2, 2, "i3", u"环岛行驶"),
Label(3, 3, "i4", u"机动车行驶"),
Label(4, 4, "i5", u"靠右侧道路行驶... | null | sign_classfication/sign_labels.py | sign_labels.py | py | 20,962 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.namedtuple",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 164,
"usage_type": "call"
}
] |
347645632 | # -*- coding: utf-8 -*-
# This file defines the functions for reading and writing profiles.
# Import os for creating directories.
import os
# Import glob for getting a list of the profiles.
import glob
# Import time for formatting times.
import time
# Import json for saving the configuration file.
import json
# Imp... | null | weatherlog_resources/io.py | io.py | py | 4,526 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pickle.dump",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": ... |
80049191 | import torch
import torch.optim as optim
import torchvision.transforms as transforms
from torch.autograd import Variable
from torch.utils.data.dataloader import DataLoader
from torchvision import datasets
from tqdm import tqdm
from capsnet import CapsNet
from functions import DigitMarginLoss
from functions import accu... | null | main.py | main.py | py | 2,090 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.utils.data.dataloader.DataLoader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torchvision.datasets.MNIST",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torchvision.datasets",
"line_number": 15,
"usage_type": "name"
},
{... |
629136088 | # -*- coding: UTF-8 -*-
"""
Author : Ken-Kei
Create Date : 2016/07/01
"""
import configparser
import time
import os
# ====================================================================
config = configparser.ConfigParser()
config.read("E:\PythonWorkspace\Automation\JiuFu-Automation\config.ini")
# ======... | null | attribute.py | attribute.py | py | 6,348 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
168310450 | import discord
from discord.ext import commands
from .utils.dataIO import fileIO
from random import choice as randchoice
import os
class Compliment:
"""Compliment Cog"""
def __init__(self, bot):
self.bot = bot
self.compliments = fileIO("data/compliment/compliment.json", "load")
@commands... | null | compliment/compliment.py | compliment.py | py | 1,450 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.dataIO.fileIO",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "discord.Member",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "random.choice",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "random.choice",... |
630424188 | import os
import sys
import glob
import nltk
import sqlite3
import unittest
import math
connection = None
class TestStringMethods(unittest.TestCase):
def test_illegalInput(self):
os.system("python3 ./../vs_query.py ./Documents/data.db > output1.txt")
fp = open("./output1.txt")
for line in fp:
first_line... | null | assignment1/Part3/Part3_test/vs_query_unit_test.py | vs_query_unit_test.py | py | 2,932 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_numb... |
209470629 | #!/usr/bin/env python
import django
import django.dispatch
from django.dispatch import receiver
from django.conf import settings
from django.contrib.admin.models import LogEntry
from DjangoBlog.utils import get_current_site
from django.core.mail import EmailMultiAlternatives
from django.db.models.signals import post_s... | null | DjangoBlog/blog_signals.py | blog_signals.py | py | 4,019 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.dispatch.Signal",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.dispatch",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "django.... |
592865904 | from __future__ import with_statement
from sqlite3 import dbapi2 as sqlite3
from contextlib import closing
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
import models
# configuration settings
DATABASE = 'pom.db'
DEBUG = True
SECRET_KEY = 'development key'
USERNAM... | null | main.py | main.py | py | 3,301 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sqlite3.dbapi2.connect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlite3.dbapi2",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "contextlib.closing"... |
94038226 | #!/usr/bin/env python3
import requests
import time
import toml
MIDDLEWARE_URL="http://127.0.0.1:8888"
START_INDEX=0
def call_middleware(method,params):
rpc = {'method':method,'params':params}
rsp = requests.post(MIDDLEWARE_URL,json=rpc).json()
if 'Ok' in rsp:
return rsp['Ok']
else:
... | null | example/example-logs.py | example-logs.py | py | 886 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.post",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 26,
"usage_type": "call"
}
] |
187251734 | import numpy as np
import pandas as pd
from keras import models, layers, Input
import matplotlib.pyplot as plt
import keras
################################################ Data process
#################### standardization
path = "./features.xlsx"
out = pd.read_excel(path,index_col=0)
Max_out = np.max(out.values)
Min_... | null | baselines/GRU.py | GRU.py | py | 2,904 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_excel",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_numbe... |
191282519 |
"""
This is an implementation of a simple neural network that makes use of PyTorch's autograd
do do backprop. We have a single hidden layer networn that should be able to fit the XOR function.
This exmaple is given in deeplearningbook.org
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
class... | null | egs/simple_nnet.py | simple_nnet.py | py | 2,582 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
445395456 | from discord.ext import commands
import os
import traceback
bot = commands.Bot(command_prefix='/')
token = os.environ['DISCORD_BOT_TOKEN']
@bot.event
async def on_command_error(ctx, error):
orig_error = getattr(error, "original", error)
error_msg = ''.join(traceback.TracebackException.from_exception(orig_err... | null | discordbot.py | discordbot.py | py | 642 | python | en | code | null | code-starcoder2 | 83 | [
{
"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": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "traceback.... |
301942713 | from django.shortcuts import render
from .models import Check
from django.contrib import messages
# Create your views here.
def checkup(request):
if request.method == 'POST':
message_2 = request.POST['dry cough']
if request.POST['dry cough'] == "yes":
dry_cough = True
else:
... | null | Frosthack/covidcheck/views.py | views.py | py | 1,475 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "models.Check.objects.create",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "models.Check.objects",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "models.Check",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "mo... |
374410032 | import pyrebase
import time
config = {
"apiKey": "AIzaSyBd2BQuZexuu5IOUqHebir6-OOxEarTQmg",
"authDomain": "hackthenorth-8a3e2.firebaseapp.com",
"databaseURL": "https://hackthenorth-8a3e2.firebaseio.com",
"storageBucket": "hackthenorth.appspot.com"
}
firebase = pyrebase.initialize_app(config)
auth = firebase.a... | null | app/firebase_adapter.py | firebase_adapter.py | py | 1,565 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyrebase.initialize_app",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pyrebase.pyrebase",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.time",
... |
26050957 | import csv
from flask import Flask, render_template,request,redirect,url_for
import diseaseprediction
app = Flask(__name__)
with open('templates/Testing.csv', newline='') as f:
reader = csv.reader(f)
symptoms = next(reader)
symptoms = symptoms[:len(symptoms)-1]
@app.route('/', me... | null | app.py | app.py | py | 1,508 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
... |
417368490 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import pytest
@pytest.fixture
def driver():
_driver = driver = webdriver.Chrome()
yield _driver
_driver.close()
def test_search_in_python_org(driver):
driver.get("http://www.pyt... | null | selenium/selenium_tests.py | selenium_tests.py | py | 837 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pytest.fixture",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "seleniu... |
275977471 | # platform-apollo3blue: Apollo3Blue development platform for platformio.
# Copyright 2019-present NigelB
#
# 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/... | null | builder/frameworks/arduino/core_v2.py | core_v2.py | py | 5,668 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "SCons.Script.DefaultEnvironment",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.jo... |
117358666 | from django.shortcuts import render
from django.shortcuts import redirect
from todo.forms import TodoForm
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
@login_required()
def todo_view(request):
if request.POST:
form = TodoForm(request.POST)
... | null | todo/views.py | views.py | py | 660 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "todo.forms.TodoForm",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "todo.forms",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "todo.forms.Username",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "todo.forms",
... |
59701939 | """
Utility functions.
"""
import os
import sqlite3
import csv
def connection(db_filename):
"""
Factory for sqlite3.Connection objects.
"""
connection = sqlite3.connect(db_filename)
connection.row_factory = sqlite3.Row
return connection
def schema():
"""
Return the location of the... | null | src/random_quote/util.py | util.py | py | 1,169 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlite3.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlite3.Row",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
609550282 | import pygame as p
import random as r
p.init#초기화
s=(800,400)
white=(255,255,255)
sc=p.display.set_mode(s)#해상도(가로,세로)
p.display.set_caption("선생님의 요구")
playing = True
font=p.font.SysFont('malgungothic',20)
sco=o
do=p.image.load("q.png")
do_l=[]
for x in range(20):
do_r= do.get_rect(left=r.randint... | null | 200617좀슈.py | 200617좀슈.py | py | 1,175 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.disp... |
332029625 | '''
Vincent Lin
SoftDev pd7
K25 -- Getting More REST
2018-11-14
'''
from flask import Flask, render_template
import urllib, json
import ssl
app = Flask(__name__)
@app.route("/")
def index():
context = ssl._create_unverified_context()
x = urllib.request.urlopen("https://dog.ceo/api/breeds/image/random", conte... | null | 25_rest/app.py | app.py | py | 511 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ssl._create_unverified_context",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "url... |
154757157 | import numpy as np
import pandas as pd
from simulator import simulate
from sklearn import metrics
from sklearn.neighbors import KNeighborsRegressor
from sklearn.linear_model import LinearRegression
from sklearn.svm import SVR
from voting_regressor import VotingRegressor
np.random.seed(123456)
lr = SVR(... | null | Chapter10/voting.py | voting.py | py | 1,872 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.seed",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sklearn.svm.SVR",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",... |
590050564 | import maya.OpenMaya as om
import maya.cmds as cmds
# total number of vertices
numVertices = 6
# the total number of polygon faces
numPolygons = 2
# the vert positions
vertices = [ (0,0,0), (1,0,0), (1,1,0), (0,1,0),
(0,0,-1), (0,1,-1)
]
# the vert connections
conns = [ 0,1,2,3,
... | null | petfactory/modelling/mesh/dev/wrap_around_triangle_uv.py | wrap_around_triangle_uv.py | py | 1,685 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "maya.OpenMaya.MIntArray",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "maya.OpenMaya",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "maya.OpenMaya.MIntArray",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "maya.Op... |
346916658 | #!/usr/local/env python
"""
Test the ILCDIRAC job module
"""
from __future__ import print_function
import types
import unittest
from mock import patch, MagicMock as Mock
from DIRAC import S_OK, S_ERROR
from ILCDIRAC.Interfaces.API.NewInterface.Job import Job
from ILCDIRAC.Tests.Utilities.GeneralUtils import assertEq... | null | Interfaces/API/NewInterface/Tests/Test_Job.py | Test_Job.py | py | 13,070 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "mock.MagicMock",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "DIRAC.S_OK",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "mock.MagicMock",
... |
528567117 | import argparse
import glob
import os.path as osp
import pdb
from PIL import Image
import mmcv
import numpy as np
import pycocotools.mask as maskUtils
from tqdm import trange, tqdm
import numpy
import cv2
import matplotlib.pyplot as plt
import time
import shutil
import argparse
mhp_id2label = {0: 'Background',
... | null | sharefeaturekernel_12_pascal/tools/convert_datasets/pascal/copydata.py | copydata.py | py | 2,259 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tqdm.tqdm",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "shutil.copy",
"line_number": 41,
... |
98150315 | """
Event API for inter-figure communication.
The event API allows figures to communicate with each other, such that a change
in one figure can trigger a change in another figure. For example, moving the
time cursor in one plot can update the current time in another plot. Another
scenario is two drawing routines drawi... | null | mne/viz/ui_events.py | ui_events.py | py | 10,164 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "weakref.WeakKeyDictionary",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "weakref.WeakKeyDictionary",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "weakref.WeakSet",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "r... |
529358272 | import pytest
@pytest.fixture
def creature():
from dread_snarfle.model import CreatureModel
return CreatureModel(100, 'Confused Wumpus')
@pytest.fixture
def item_properties():
return {
'names': [
'Slayer of Wumpuses',
'Scourge of the Wombat'
],
'repairs': ... | null | tests/model.py | model.py | py | 1,624 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dread_snarfle.model.CreatureModel",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name"... |
465194728 | #
# @lc app=leetcode id=200 lang=python3
#
# [200] Number of Islands
#
from typing import List
# @lc code=start
class Solution:
def numIslands(self, grid: List[List[str]]) -> int:
if(len(grid)==0 or len(grid[0])==0):
return 0
res = 0
for i in range(len(grid)):
for j i... | null | heregreat/python/200.number-of-islands.py | 200.number-of-islands.py | py | 949 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
}
] |
400188151 | from django.conf.urls import include, url
from .views import ProductDetailView, ProductListView, VariationListView
urlpatterns = [
url(r'^$', ProductListView.as_view(), name="list"),
url(r'^(?P<pk>\d+)/$', ProductDetailView.as_view(), name="detail"),
url(r'^(?P<pk>\d+)/inventory/$', VariationListView.as_... | null | src/products/urls.py | urls.py | py | 353 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.ProductListView.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.ProductListView",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": ... |
144765274 | #!/usr/bin/env python
# coding: utf-8
import os
import re
import sys
import pandas as pd
import numpy as np
import glob
import csv
import logging
import argparse
import gzip
parser = argparse.ArgumentParser(description='Add rsIDs to DIAMANTE files.', add_help = True)
parser.add_argument('diamante', type = str, help ... | null | bin/prep-diamante-for-ldsc.py | prep-diamante-for-ldsc.py | py | 3,106 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "loggin... |
538265975 | from common import random_str, auth_check
def test_ingress_fields(client):
auth_check(client.schema, 'ingress', 'crud', {
'namespaceId': 'cr',
'projectId': 'cr',
'rules': 'cru',
'tls': 'cru',
'defaultBackend': 'cru',
'status': 'r',
})
auth_check(client.sche... | null | tests/core/test_ingress.py | test_ingress.py | py | 1,771 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "common.auth_check",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "common.auth_check",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "common.auth_check",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "common.random_st... |
192598937 | from unittest.mock import MagicMock
import pytest
import prefect
from prefect.tasks.twitter import LoadTweetReplies
from prefect.utilities.configuration import set_temporary_config
class TestLoadTweetReplies:
def test_initialize_with_nothing_sets_defaults(self):
task = LoadTweetReplies()
assert ... | null | tests/tasks/twitter/test_twitter.py | test_twitter.py | py | 1,439 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "prefect.tasks.twitter.LoadTweetReplies",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "prefect.tasks.twitter.LoadTweetReplies",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "prefect.tasks.twitter.LoadTweetReplies",
"line_number": 23,
... |
558115356 | # Create folder if doesn't exist
import os, pygame, sys
from pygame.locals import *
if not os.path.isdir('./Cloud/Download'):
pathD = os.path.join("./Cloud/Download")
os.mkdir(pathD)
if not os.path.isdir('./Cloud/Upload'):
pathU = os.path.join("./Cloud/Upload")
os.mkdir(pathU)
# PyGame
... | null | Cloud/fileSynch.py | fileSynch.py | py | 2,086 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.isdir",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
... |
391292631 | from mongo import *
import requests,json,time,random,re
from lxml import etree
class Coin():
def qwbzj(req,x,y):
a=req.find(x)
b=req.find(y,int(a+1))
return req[a+len(x):b]
def shijian(times):
if times.find('分間')!=-1:
sj=int(times[:times.find('分間')])
sj=in... | null | coin_news/jp_coinpost.py | jp_coinpost.py | py | 3,836 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.time",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.strptime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.mktime",
"line_number": 21... |
557232027 | from utils import *
import networkx
import sys
import warnings
warnings.filterwarnings('ignore')
def get_summarization_by_textrank(text, max_len=200):return merge_sen_from_scores(text, text_rank, max_len)
def text_rank(text, window=5):
graph = get_sentence_graph(text, window)
scored_sen = networkx.pagerank... | null | mozhiwen/text_rank.py | text_rank.py | py | 1,160 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "networkx.pagerank",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "networkx.graph.Graph",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "network... |
407798749 | """Limit vcf to coding regions pulled from gemini."""
import csv, argparse
def loadPos(chrom, codingFile):
pos = {}
with open(codingFile) as f:
reader = csv.DictReader(f, delimiter='\t')
for row in reader:
if row['chrom'] == chrom:
p = str( int(row['start']) +1)
... | null | code/scripts/limitToCoding.py | limitToCoding.py | py | 1,088 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "csv.DictReader",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 31,
"usage_type": "call"
}
] |
62191678 | '''
TRAM-ID : SK
TR 내용 : 현물 거래원
INPUT FIELD
[Single 데이터】
Field# 항 목 명 SIZE 항 목 내 용 설 명
0 단축코드 6
'''
# -*- coding: utf-8 -*-
import sys
import time
from PyQt5.QAxContainer import *
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtCore import *
from PyQt5.QAxConta... | null | data/mst_SK_TR_1206.py | mst_SK_TR_1206.py | py | 3,933 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "data.TR_1206.TR_1206",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "pymongo.M... |
137047765 | import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import urllib
import urllib2
import re
from bs4 import BeautifulSoup as bs
# get the number list of AC subjects
def getNumberList():
url = 'http://acm.tju.edu.cn/toj/user_3013216077.html'
request = urllib.urlopen(url);
html_data = request.read().decode('utf-... | null | 爬虫/爬取TOJ上AC题目源码/test.py | test.py | py | 2,323 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "urllib.urlopen",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.compile",
... |
355219813 | # -*- coding: utf-8 -*-
import pygame
class Ship():
def __init__(self, ai_settings, screen):
"""初始化飞船并设置其初始位置"""
#用传入的screen设置ship的screen
self.screen = screen
#获取飞船的设置类
self.ai_settings = ai_settings
"""加载飞船图像并获取其外接矩形"""
self.image = pygame.image.load('images/ship.bmp')
#将ship设置为传入的图像的矩形
self.re... | null | ship.py | ship.py | py | 1,865 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.image.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 15,
"usage_type": "attribute"
}
] |
597560278 | import django
from django import forms
from django.contrib.sites.models import Site
import os, datetime
from models import Image, Video, Audio, Flash, Document
class ContentCreationForm(forms.ModelForm):
"""
A form that creates a piece of content from a file and title.
"""
title = forms.CharField(max... | null | eaa2011/setup/build/massmedia/massmedia/forms.py | forms.py | py | 3,540 | python | en | code | null | code-starcoder2 | 83 | [
{
"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": 13,
"usage_type": "call"
},
{
"api_name": "django.... |
538899661 | #!/usr/bin/env python3
import argparse
import datetime
import os
import shutil
import hashlib
import commons
logger = commons.getlogger(name=__name__)
parser = argparse.ArgumentParser(description="sync cut media to ready upload folder")
parser.add_argument("--src", default="/data/yfm/draft/crhk/summit")
parser.add... | null | tools/sync_cut_media.py | sync_cut_media.py | py | 2,554 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "commons.getlogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetim... |
555337244 | import numpy as np
from cvxopt import matrix
from cvxopt import solvers
from matplotlib import cm
import matplotlib.pyplot as plt
n = 100
d = 2
c = 5
#Get train data
x = []
y = []
f = open('2a_train_data.txt','r')
for line in f:
x1,x2,y_temp=line.split(' ')
x.append(np.asarray([x1,x2],dtype=float))
y.appe... | null | Assignment 1/Code/Q2/Problem2_b.py | Problem2_b.py | py | 1,995 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.asarray",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_num... |
556349366 | from __future__ import absolute_import, division, print_function
import sys
import string
import llvm.core as lc
from llvm import LLVMException
from .. import llvm_array as lla
from .blaze_kernels import BlazeElementKernel, refresh_name
from . import blaze_kernels
from blaze.py2help import _strtypes
def letters(sour... | null | blaze/compute/bkernel/kernel_tree.py | kernel_tree.py | py | 10,324 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "string.ascii_lowercase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "blaze_kernels.refresh_name",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "blaze_kernels.BlazeElementKernel",
"line_number": 84,
"usage_type": "argument"
}... |
649163086 | import xml.etree.cElementTree as ET
import sys
import re
import csv
import collections
globalMsgListFile = "C:/Users/robert.ilitoi/Desktop/Warning View_subpriorities/Global_Msg_List.csv"
xmlFile1 = "d:/FordProject/Repository/Loop 7/FordS0_AMT_Configuration/Warnings/WarningDispatchers.xml"
translationFile2 = '... | null | hmi_wrn_test_comparator.py | hmi_wrn_test_comparator.py | py | 2,947 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "xml.etree.cElementTree.ElementTree",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "xml.etree.cElementTree",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "xml.etree.cElementTree.ElementTree",
"line_number": 20,
"usage_type": "call"
... |
395730149 | #coding:utf-8
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from models import User, Act
from django import forms
# Create your views here.
class UserForm(forms.Form):
username1 = forms.CharField(label='username',max_length=15)
nickname1 = forms.CharFie... | null | views.py | views.py | py | 9,509 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.Form",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.forms"... |
435609284 | # encoding=utf8
import os
import random
import socket
import time
import TickerConfig
import requests
from bs4 import BeautifulSoup
class proxy:
def __init__(self):
self.proxy_list = []
self.proxy_filter_list = []
ip = self.get_filter_proxy()
self.current = {
'http': '... | null | agency/agency_tools.py | agency_tools.py | py | 5,186 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "TickerConfig.PROXY_HOST",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
64616738 | import sys
from argparse import ArgumentParser
from Clanwars import Clanwars
from StatsRoyaleParser import StatsRoyaleParser
parser = ArgumentParser()
parser.add_argument("-r", "--refresh", dest="refresh", default=False, action="store_true", help="call refresh clan at statsroyale first")
parser.add_argument("-c", "--c... | null | main.py | main.py | py | 1,255 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "StatsRoyaleParser.StatsRoyaleParser",
"line_number": 17,
"usage_type": "call"
}
] |
152237431 | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.2'
# jupytext_version: 1.0.0
# kernelspec:
# display_name: Python [conda env:ncbi_remap]
# language: python
# name: conda-env-ncbi_remap-py
# ---
# %% [markdown]
... | null | notebook/2019-02-21_plots.py | 2019-02-21_plots.py | py | 3,700 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ncbi_remap.notebook.Nb.setup_notebook",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "ncbi_remap.notebook.Nb",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "pandas.HDFStore",
"line_number": 40,
"usage_type": "call"
},
{
"api_... |
313727227 | import os
from datetime import timedelta
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///data.db"
SQLALCHEMY_TRACK_MODIFICATIONS = False
PROPAGATE_EXCEPTIONS = True
JWT_SECRET_KEY = os.environ["APP_SECRET"]
SECRET_KEY = os.environ["APP_SECRET"]
JWT_ACCESS_TOKEN_EXPIRES = timedelta(
minutes=int(os.environ["ACCESS... | null | default_config.py | default_config.py | py | 562 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"li... |
484347325 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
strip_jsonp,
unified_strdate,
US_RATINGS,
)
class PBSIE(InfoExtractor):
_STATIONS = (
('video.pbs.org', 'PBS: Publ... | null | youtube_dl/extractor/pbs.py | pbs.py | py | 26,698 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "common.InfoExtractor",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "re.escape",
"line_number": 192,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 356,
"usage_type": "call"
},
{
"api_name": "utils.unified_strdate",
... |
492905381 | import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import matplotlib.pyplot as plt
from scipy import integrate
import numpy as np
import time
from torchdiffeq import odeint_adjoint as odeint
import matplotlib.pyplot as plt
#torch.manual_seed(1) # reproducible
... | null | Random_Search/dataset_def.py | dataset_def.py | py | 7,293 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.mm",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_nu... |
515808778 | """PyWeek Contest 2020 by GUVI"""
"""PySnake Game Created by J.KALIRAJ"""
"""GUVI ID : rrajuindarmy@gmail.com"""
import pygame
import random
pygame.init()
gray= (180,180,180)
gray2= (200,200,200)
white= (255,255,255)
black= (0,0,0)
red = (244,0,6)
green = (0,155,0)
display_width = 800
display_hei... | null | PySnake.py | PySnake.py | py | 10,320 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.image.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
... |
167135986 | #!/usr/bin/env python
import torch
import json
import pdb
import numpy as np
from torch.autograd import Variable
import os
import argparse
import datasets
import old_datasets
import models
import pickle
import time
import random
import monitoring
import training
import evaluations
#
def build_parser():
parser = arg... | null | predict_likelihood_same.py | predict_likelihood_same.py | py | 7,705 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.cuda.manual_seed",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 79,
"usage_type": "attribute"
},
{
"api_name": "torch.... |
433001737 | from typing import List
def merge(self, intervals: List[List[int]]) -> List[List[int]]:
#sort the list
intervals.sort(key=lambda x:x[0])
# init the first ele
res=[intervals[0]]
#loop through the array expect the first
for start,end in intervals[1:]:
#last ele of the res and end i... | null | leetcode/marge_intervals.py | marge_intervals.py | py | 561 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
}
] |
71120126 | #!/usr/bin/python
"""Plot order parameter series for all runs and reps.
Plots number of bound staples, number of bound domains, number of misbound
domains, and number of stacked pairs.
"""
import argparse
import sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec a... | null | scripts/plotting/plot_ops_series.py | plot_ops_series.py | py | 4,055 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.use",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "origamipy.plot.cm_to_inches",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "origamipy.plot",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "origamipy.p... |
410752860 | # Template for importing toy datasets for algo exploration and testing
# Load sklearn's datasets
from sklearn import datasets
# To load [sample] dataset below, uncomment desired dataset
# Comment out datasets not being tested, used
digits = datasets.load_digits() #1,797 images of handwritten digits, good for teaching... | null | DataLoad/SampleDatasetLoad.py | SampleDatasetLoad.py | py | 801 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.datasets.load_digits",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sklearn.datasets.load_boston",
"line_number": 9,
"usage_type": "call"
},
{
"api_name"... |
486242495 | from flask import render_template
from flask import Blueprint
from flask import url_for
from flask import Flask
from flask import request, Response
from flask import jsonify
import gzip
import os
import json
import random
import unicodedata
from settings import *
main = Blueprint('main', __name__, template_folder='te... | null | backend/main/__init__.py | __init__.py | py | 4,571 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask.re... |
632687183 | """
Data models for "studies" studies include attributes about the data and are
heavier in terms of data load
"""
import json
import os
import sys
import warnings
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import semantic_version
from .metadata import MetaData
from .expression import Expr... | null | flotilla/data_model/study.py | study.py | py | 52,788 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "warnings.warn",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"l... |
236366452 | """The base class for deriving types that require schema support.
.. image:: images/metadata_types.jpg
.. contents::
======
Usage
======
The **meta_type** module contains three classes that are used in the
definition and instantiation of object instances. The root class is
:class:`CoreType`, which is derived from... | null | ontic/meta_type.py | meta_type.py | py | 39,107 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.date",
"line_number": 240,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 240,
"usage_type": "name"
},
{
"api_name": "datetime.time",
"line_number": 240,
"usage_type": "name"
},
{
"api_name": "datetime.date",
... |
287047384 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 14 20:49:43 2020
@author: alres
"""
import sklearn
import re
from praw.models import MoreComments
import itertools
from bs4 import BeautifulSoup
import nltk
#nltk.download('all')
from nltk.corpus import stopwords
import flask
import pandas as pd
from f... | null | Flair_Detector_Model/app.py | app.py | py | 3,596 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "praw.Reddit",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"... |
402501435 | #!/usr/bin/env python3
# -------------------------------
# projects/netflix/Testnetflix.py
# Copyright (C) 2014
# Glenn P. Downing
# -------------------------------
# -------
# imports
# -------
from io import StringIO
from unittest import main, TestCase
from Netflix import netflix_eval_movieID, netflix_solve... | null | ch34698-TestNetflix.py | ch34698-TestNetflix.py | py | 2,364 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "Netflix.netflix_eval_movieID",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "Netflix.netflix_eval_movieID",
"line_number": 34,
"usage_type": "call"
},
{
"api_n... |
415420604 | #!/usr/bin/python
import os.path
from flask import flash, redirect, render_template, send_from_directory, url_for, request, session, abort
from pyipam.server import app
from pyipam.models.main import MainModel
from pyipam.models.subnets import SubnetsModel
# Initalise models
model = MainModel()
subnetsModel = SubnetsM... | null | pyipam/controllers/main.py | main.py | py | 1,451 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyipam.models.main.MainModel",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pyipam.models.subnets.SubnetsModel",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.send_from_directory",
"line_number": 15,
"usage_type": "call"
},
... |
146204285 | #!/usr/bin/env python3
from __future__ import division
from builtins import range
from past.utils import old_div
import os
import sys
import glob
import shutil
import ntpath
import pickle
import datetime
import argparse
import numpy as np
import numpy.matlib
from xml.etree.ElementTree import ElementTree
from subprocess... | null | script/log_ratio.py | log_ratio.py | py | 15,313 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.abspath",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
566187498 | import glob
import markdown
import json
import pprint
import uuid
# Get dir list of MD files.
mds = sorted(glob.glob("./*.md"), reverse=True)
# Create an empty array for data storing.
data = []
# Iterate over the MD files list and extract yaml data.
for md in mds:
with open(md) as f:
md = markdown.Markdo... | null | markdowns/getBlogList.py | getBlogList.py | py | 985 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "glob.glob",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "markdown.Markdown",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "uuid.uuid3",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "uuid.NAMESPACE_DNS",
"line_... |
357317269 | from flask import Flask , render_template
from wtforms_fields import *
from models import *
app = Flask(__name__)
app.secret_key = 'replace key later'
#configure database
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://ozawkdoyvqhipc:f35523972b309aab0ab3a73978616ee325ed23ae5808eb143c1174a77ff7a56d@ec2-54-197-23... | null | application.py | application.py | py | 744 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 27,
"usage_type": "call"
}
] |
540010577 | # Clustering with Hedonic Games
# Detecting communities in networks with cooperative game theory
# A research experiment in colaboration between *UFRJ and ^INRIA
# *Lucas Lopes, *Daniel Sadoc, ^Kostya and ^Giovanni
# December 2019
## Import Dependecies ##########################################################
import... | null | app.py | app.py | py | 19,053 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "hedonic.Game",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "hedonic.Game.show_networks",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "hedonic.Game",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "numpy.array",
... |
45956031 | import control as ctrl
import numpy as np
from utils import insert
class Controller:
specs = None;
Gff = None;
Gc = None;
def __init__ (self, specs = None):
self.specs = specs;
self.instantiate ();
def instantiate (self, specs = None):
if specs is not None:
s... | null | industrialPID_trab_1/pid_industrial/controller.py | controller.py | py | 1,306 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.insert",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "utils.insert",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "utils.insert",
"line_num... |
482520443 | from App8.models import ProductModel
from django import forms
class ProductForm(forms.ModelForm):
pno = forms.IntegerField(min_value=1001)
class Meta:
fields = '__all__'
model = ProductModel
def clean_price(self):
price = self.cleaned_data['price']
if price >= 1000:
... | null | App8/forms.py | forms.py | py | 622 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.IntegerField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "djang... |
84121631 | import statistics
import random
import timeit
import multiprocessing
from threading import Thread
class Producer:
def __init__(self,buff,companies):
self.buffer=buff
self.companies = companies
def getRandomQuote(self):
return [self.companies[random.randint(0,len(self.companies)-1)],random.randint(1,100)]
... | null | ProducerConsumer.py | ProducerConsumer.py | py | 1,787 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.randint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "statistics.mean",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "timeit.default_timer",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "threading.Thread"... |
533969280 | from .utils import ConfigureError, merge_clips
class TrimFrames:
def __init__(self, frames):
if len(frames) == 0:
raise ConfigureError('TrimFrames: frames length is 0')
self.frames = frames
def __call__(self, core, clip):
clips = [
core.std.Trim(clip, first=fir... | null | conf/filters/trim_frames.py | trim_frames.py | py | 422 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.ConfigureError",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "utils.merge_clips",
"line_number": 15,
"usage_type": "call"
}
] |
521034346 | from django.contrib import admin
from django.urls import path
from .views import *
from rest_framework.urlpatterns import format_suffix_patterns
urlpatterns = [
# path('article/', article_list),
path('services/', ServicesAPIView.as_view()),
path('service/<int:id>/', ServicesDetailsView.as_view()),
path(... | null | SeniorSidekick/backend/Sunshine/api/urls.py | urls.py | py | 687 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
184625493 | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""system start python file.
all start from Server class
work_func you can do implement your work
CollectorProcessTask is collect task implement
MQConsumerTask receive messages decode and run collect server
CollectorAnalyseTask is analyse task implement
MyHear... | null | data_transmission/data_transmission/application/start.py | start.py | py | 32,578 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "oslo_log.log.getLogger",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "oslo_log.log",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "oslo_log.log.getLogger",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "oslo_log.l... |
180640335 | from django.shortcuts import render, redirect
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
# Create your views here.
from django.core.mail import EmailMessage
... | null | services/views.py | views.py | py | 4,487 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "email.mime.multipart.MIMEMultipart",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "email.mime.text.MIMEText",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "smtplib.SMTP_SSL",
"line_number": 46,
"usage_type": "call"
},
{
"api_... |
424887088 | import numpy as np
from sklearn import model_selection, linear_model
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv("../data/machine.data")
df.replace('?', np.nan, inplace = True) # 把 "?" 變成 Nan
df.dropna(inplace = True) # 把缺失值拿掉
df.drop(['vendor_name'], 1, inplace = True) # 把位在"行"的 vendor_name ... | null | hw2/src/linear_regression.py | linear_regression.py | py | 926 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numb... |
459168950 | #!/usr/bin/python3
"""Using TensorFlow Lite to detect objects."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
import copy
import time
import threading
import cv2
import numpy as np
import paho.mqtt.publish as mqtt_publish
from PIL import ... | null | code/detect_objects.py | detect_objects.py | py | 9,598 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.FONT_HERSHEY_SIMPLEX",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "threading.Lock",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "threading.local",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "collecti... |
499778385 | """
MicroPython MQTT Eduponics APP Client
https://github.com/STEMinds/micropython-eduponics
MIT License
Copyright (c) 2020 STEMinds
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restrict... | null | examples/eduponics_mqtt/main.py | main.py | py | 7,297 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "machine.ADC",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "machine.Pin",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "machine.ADC",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "Eduponics.bh1750.BH1750",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.