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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
605665537 | """Basic code analysis tools for SELECT statements."""
from typing import List, NamedTuple, Optional
from sqlfluff.core.dialects.base import Dialect
from sqlfluff.core.dialects.common import AliasInfo, ColumnAliasInfo
from sqlfluff.core.parser.segments.base import BaseSegment
class SelectStatementColumnsAndTables(Na... | null | src/sqlfluff/utils/analysis/select.py | select.py | py | 6,149 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.NamedTuple",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sqlfluff.core.parser.segments.base.BaseSegment",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_n... |
195649675 | import numpy as np
from PIL import Image
import pyglet
window = pyglet.window.Window(width=512, height=512, resizable=True, caption='Lena Gauss gefiltert!')
# Groesse des zu erzeugenden Bildes
global datawidth
global dataheight
# RGBA-Format hat 4 Kanaele je 1 Byte
format_size = 4
bytes_per_channel = 1
def gKernel... | null | aufgabe_3/Aufgabe3_a.py | Aufgabe3_a.py | py | 2,300 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyglet.window.Window",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pyglet.window",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"... |
620710257 | import cv2
import numpy as np
# 设置初始化的窗口位置
r,h,c,w = 0,100,10,100 # 设置初试窗口位置和大小
track_window = (c,r,w,h)
cap = cv2.VideoCapture("E:\opencvtw.mp4")
ret, frame= cap.read()
# 设置追踪的区域
roi = frame[r:r+h, c:c+w]
# roi区域的hsv图像
hsv_roi = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
# 取值hsv值在(0,60,32)到(180,255,255)之间... | null | camshift.py | camshift.py | py | 1,542 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.inRange",
... |
168475929 | import csv
import os
import logging
import argparse
from collections import defaultdict
from distutils.dir_util import mkpath
def log_configuration(logLevel):
logging.basicConfig(format='%(levelname)s %(filename)s %(asctime)s %(funcName)s %(lineno)s:%(message)s', level=logLevel)
def get_result_dic... | null | trunk/GenerateReport.py | GenerateReport.py | py | 8,882 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.debug"... |
629564964 | '''
Plots accuracy orig vs. accuracy projected
'''
import argparse
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
sns.set()
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
'--results',
default='results.... | null | snap/vqa/vqa_lxr955_results/plot_results.py | plot_results.py | py | 1,424 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "seaborn.set",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"... |
131182474 | from django.conf.urls import url
from . import views
app_name = "polls"
urlpatterns = [
url(r'^$', views.poll, name='poll'),
url(r'^register/$', views.register, name='register'),
url(r'^login/$', views.login_user, name='login'),
url(r'^logout/$', views.signout, name='signout'),
url(r'^index/$', views... | null | polls/urls.py | urls.py | py | 403 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.co... |
353059191 | from flask import Blueprint, render_template, jsonify, request
from ecommerce import mongo
from flask_login import current_user
from bson.objectid import ObjectId
import json
main = Blueprint('main', __name__)
def ret_brands():
brands = mongo.db.items.distinct('Brand', {'Type': 'Bedsheet'})
return brands
@main.... | null | ecommerce/main/routes.py | routes.py | py | 2,518 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "ecommerce.mongo.db.items.distinct",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ecommerce.mongo.db",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name... |
594692123 | # -*- coding: utf-8
from django import forms
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
from django.forms.utils import flatatt
from django.conf import settings
import gsb.utils as utils
input_format_date = ('%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', '%d%m%y', '%d%m%Y')
class... | null | gsb/widgets.py | widgets.py | py | 4,881 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.DateInput",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.utils.encoding.force_text",
"line_number": 32,
"usage_type": "call"
},
{
"api_nam... |
255418977 | import requests, datetime, json
from assignment_type import Assignment
import traceback
import threading
class Schoolsoft:
def __init__(self, username, password, multithreading=False):
print("Class initialized")
self.username = username
self.password = password
self.multithreading... | null | schoolsoft.py | schoolsoft.py | py | 3,100 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.Session",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name"... |
609113910 | from threading import Thread
from bs4 import BeautifulSoup
from queue import Queue
import re
from Mixins import *
from Errors import *
class EtagiUrlFinder(Thread):
def __init__(self, urls):
super(EtagiUrlFinder, self).__init__()
#self._cities = ['alekseevka', 'almaty', 'anapa', 'ach', 'balashov',... | null | pint/Etagi.py | Etagi.py | py | 6,191 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "threading.Thread",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "queue.Queue",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
... |
306411506 | import boto3
import copy
import time
import json
ALARM_TEMPLATE = {
"AlarmName": "1193839-0 Active Alerts",
"AlarmDescription": "1193839-0 Active Alerts",
"ActionsEnabled": True,
"OKActions": [
],
"AlarmActions": [
],
"InsufficientDataActions": [],
"MetricName": "ActiveAlerts",
... | null | tools/create_test_alarms.py | create_test_alarms.py | py | 1,217 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "boto3.client",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": ... |
8287219 | # -*- coding: utf-8 -*-
from core.matching import SimpleMatchmaker
import importlib
class Application(object):
def __init__(self, input_plugin, output_plugin):
self._input_plugin = input_plugin
self._output_plugin = output_plugin
def process(self):
input_arguments = self._check_and_pa... | null | application.py | application.py | py | 1,882 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "core.matching.SimpleMatchmaker",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 53,
"usage_type": "call"
}
] |
606276019 | import sys
import time
from Datastructures.Machine import Machine
from Heuristics.JobShopMIP import JobShopMIP
from Heuristics.MaxKHeuristic import MaxKHeuristic
from Heuristics.RABMCP_MIP import RABMCP_MIP
from Heuristics.SmallKHeuristic import SmallKHeuristic
from Heuristics.JobShopApproximation import JobShopApprox... | null | Optimizer.py | Optimizer.py | py | 10,592 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.maxsize",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "Datastructures.Machine.Machine",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "Heuristic... |
187414396 | import copy
import mmcv
import torch
from mmcv.runner import force_fp32
from torch import nn as nn
from torch.nn import functional as F
from mmdet3d.core import bbox3d2result
from mmdet3d.ops import Voxelization
from mmdet.models import DETECTORS
from mmdet3d.models import builder
from mmdet3d.models.detectors.base im... | null | mmdet3d/models/detectors/new_fusion/fusion_contrast.py | fusion_contrast.py | py | 11,845 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mmdet3d.models.detectors.base.Base3DDetector",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "mmdet3d.models.builder.build_backbone",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "mmdet3d.models.builder",
"line_number": 35,
"usage_typ... |
209601336 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# Thinkopen - Portugal & Brasil
# Copyright (C) Thinkopen Solutions (<http://www.thinkopensolutions.... | null | tko_base_multiple_duplicate_invoices-10.0.0.005.1/tko_base_multiple_duplicate_invoices/wizard/multiple_duplicate.py | multiple_duplicate.py | py | 6,391 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Date... |
108673712 | from django.urls import path
from rest_framework_simplejwt import views as jwt_views
from .views import SignUpAPIView
urlpatterns = [
path(
'signup/',
SignUpAPIView.as_view(),
),
path(
'token/',
jwt_views.TokenObtainPairView.as_view(),
name='token_obtain_pair'
... | null | user/api/v1/urls.py | urls.py | py | 438 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "views.SignUpAPIView.as_view",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.SignUpAPIView",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "djang... |
149695128 | import matplotlib.pyplot as plt
import numpy as np
def parse_log_files(files):
# files is a list of log files
# plots mean reward and best mean reward
vals = []
for f in files:
x = []
y = []
z = []
with open(f) as file:
for line in file:
if "... | null | hw3/plot.py | plot.py | py | 1,510 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "mat... |
130508798 | from __future__ import absolute_import, division, print_function
import logging
import numpy as np
try:
from plotly import plotly
except ImportError:
plotly = None
from glue.core.layout import Rectangle, snap_to_grid
SYM = {'o': 'circle', 's': 'square', '+': 'cross', '^': 'triangle-up',
'*': 'cross'... | null | glue/plugins/exporters/plotly/export_plotly.py | export_plotly.py | py | 8,679 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "plotly.plotly",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.int",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "numpy.ones",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.bool",
"line_number... |
155502198 | # -*- coding: utf-8 -*-
# Author: 小狼狗
'''
=========================================
EM算法
=========================================
'''
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
import math
import sys
import random
parameter_dict = {}
parameter_dict["Mu_1"] = np.array([0, ... | null | EM.py | EM.py | py | 9,022 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
73708825 | import sys
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QIcon
from PyQt5.QtWebEngineWidgets import *
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.browser = QWebEngineView()
self.browser.setUrl(QUrl... | null | main.py | main.py | py | 1,665 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.QtGui.QIcon",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 51,
"usage_type": "attribute"
}
] |
159468653 | import json
import traceback
import time
import base58
import hashlib
import binascii
import tornado.ioloop
from tornado.iostream import StreamClosedError
from yadacoin.core.transactionutils import TU
from yadacoin.core.config import Config
from yadacoin.core.chain import CHAIN
from yadacoin.core.config import get_co... | null | yadacoin/tcpsocket/pool.py | pool.py | py | 7,281 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "yadacoin.core.peer.Miner",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "yadacoin.tcpsocket.base.RPCSocketServer",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "yadacoin.core.config.get_config",
"line_number": 39,
"usage_type": "call... |
634031746 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('rango', '0009_auto_20150707_0314'),
]
operations = [
migrations.AlterField(
model_... | null | rango/migrations/0010_auto_20150707_0317.py | 0010_auto_20150707_0317.py | py | 620 | 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.AlterField",
"line_number": 15,
"usage_type": "call"
},
{... |
76011667 | # -*- coding:utf-8 -*-
# @Desc:
# @Author: Administrator
# @DateTime: 2020/10/15 10:14
### 示例: 假设通过爬虫你获取到了北京2016年3,10月份每天白天的最高气温(分别位于列表y_03,y_10),那么此时如何寻找出气温和随时间(天)变化的某种规律?
from matplotlib import pyplot, font_manager
import matplotlib
## 设置中文显示
matplotlib.rc('font', family='MicroSoft YaHei')
# my_font = font_manag... | null | [15]Python-数据分析部分/matplotlib-04散点图示例.py | matplotlib-04散点图示例.py | py | 1,664 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.rc",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
104320891 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases()
import multiprocessing as mp
import warnings
import chainer
import ... | null | chainerrl/misc/async.py | async.py | py | 5,337 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "future.standard_library.install_aliases",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "future.standard_library",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "chainer.Link",
"line_number": 37,
"usage_type": "attribute"
},
{
"a... |
186522443 | """Test fixtures for the Open Thread Border Router integration."""
from unittest.mock import patch
import pytest
from homeassistant.components import otbr
from . import CONFIG_ENTRY_DATA, DATASET_CH16
from tests.common import MockConfigEntry
@pytest.fixture(name="otbr_config_entry")
async def otbr_config_entry_fi... | null | tests/components/otbr/conftest.py | conftest.py | py | 984 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tests.common.MockConfigEntry",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "homeassistant.components.otbr.DOMAIN",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "homeassistant.components.otbr",
"line_number": 18,
"usage_type": "... |
116892618 | # -*- coding: utf-8 -*-
# @Time : 2021/3/31 14:28
# @Author : 张丽雯
# @File : test_reservoir_abnormal.py
# @中文描述 : 库区管理异常场景测试用例
import sys
import pytest
from DataApp.KuquData import *
from src.pageobjectAPP.pageReservoir import *
from src.public.common.Close_current_tab import Close_current_tab
from src.public.commo... | null | TestcaseApp/Inventory/test_reservoir_abnormal.py | test_reservoir_abnormal.py | py | 1,534 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "src.public.common.Search_Item.search_item",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "src.public.common.Search_Item.search_item",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "src.public.common.Close_current_tab.Close_current_tab",
"... |
69635733 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import requests
class Webhook(object):
def __init__(self, webhook_url, s3_url):
self.webhook_url = webhook_url
self.s3_url = s3_url
splited = self.webhook_url.split('/')
self.collection = splited[-1]
self.database = splited[-2]
def exist(... | null | webhook.py | webhook.py | py | 1,512 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_number"... |
613479201 | from django.conf.urls import url
from django.contrib import admin
from . import views
app_name = 'main'
urlpatterns = [
url(r'^$', views.index, name = 'index'),
url(r'^admin/', admin.site.urls),
url(r'^categories/$', views.categories, name = 'Categories'),
url(r'^categories/(?P<category_name>[^/]+)/$', views.subc... | null | main/urls.py | urls.py | py | 639 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": ... |
344637565 | from scipy.io import loadmat
import numpy as np
import pandas as pd
content = loadmat('ex3weights.mat')
theta1, theta2 = content['Theta1'], content['Theta2']
theta_list = [theta1, theta2]
content = loadmat('ex3data1.mat')
x = pd.DataFrame(content['X'])
y = content['y']
def sigmoid(z):
return 1 / (1 ... | null | OneVSAll Logistic EX3.1/NeuralNetwork_FP.py | NeuralNetwork_FP.py | py | 1,024 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"lin... |
163552947 | import json
import os
from argparse import ArgumentParser
from flanker.addresslib import address
from paranuara.person import person_from_json
from cli_util import add_people_arg
def main():
parser = ArgumentParser(description="Process people.json files")
add_people_arg(parser)
args = parser.parse_args(... | null | process_persons_json.py | process_persons_json.py | py | 859 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cli_util.add_people_arg",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "paranuara.p... |
508626150 | from django.contrib.admin.models import LogEntry, ADDITION, CHANGE
from django.contrib.contenttypes.models import ContentType
def change(request, news_object):
LogEntry.objects.log_action(
user_id=request.user.id,
content_type_id=ContentType.objects.get_for_model(news_object).pk,
... | null | news/log_changes.py | log_changes.py | py | 463 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.admin.models.LogEntry.objects.log_action",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.models.LogEntry.objects",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin.models.LogEntry",
... |
487934357 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from sklearn import preprocessing
spec_power_data_file = '../Data/data.csv'
reader = pd.read_csv(spec_power_data_file, header=0)
columns = reader.columns
data_csv=reader._get_values
#Imprimimos la forma(dimensi... | null | scripts_python/principal_component_analysis.py | principal_component_analysis.py | py | 1,534 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.scale",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.p... |
37849295 | # i=1
# while(i<20):
# print("hello, this is {:0>5d}.".format(i))
# i += 1
# print("hello, this is {:0<5d}.".format(i))
# i += 1
# import time
# start=time.clock()
# for i in range(1,10):
# print(i)
# print('time {:.6f}'.format(time.clock() - start))
import cv2
x = cv2.imread('0.jpg')
cv2.im... | null | test.py | test.py | py | 376 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 20... |
61003470 | from django.urls import re_path, path
from . import views
app_name = 'jiaoyi'
urlpatterns = [
re_path(r'^addproduct/$', views.addproduct, name='addproduct'),
re_path(r'^user/mylisting/$', views.mylisting, name='mylisting'),
re_path(r'^user/listing/$', views.listing, name='listing'),
re_path(r'^user/pr... | null | jiaoyi/urls.py | urls.py | py | 657 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.re_path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.re_path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.re_path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.... |
71765518 | import os
import nsml
import json
def feed_infer(output_file, infer_func):
result = infer_func(os.path.join(nsml.DATASET_PATH, 'test'))
with open(output_file, 'w') as f:
json.dump(result, f)
assert len(result) in [9, 24, 49, 98]
if os.stat(output_file).st_size == 0:
raise AssertionEr... | null | AI_RUSH_Round2/round2-master/music/q2/data_loader.py | data_loader.py | py | 366 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "nsml.DATASET_PATH",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "json.dump",
"line_n... |
606647219 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 1 18:10:46 2020
@author: Yongyao SUN
"""
'''
4. 可以自动gen resi proxy 并且分给不同bot的proxy脚本
- 以smart为例,如果你用过oxy geo 或者netnut,请自行扩展,不要求支持多家proxy,但能支持是附加分
- 自行获取smart的地区列表
- 输入为 你想要的地区(可能是一个地区列表),你想要使用的bot(一个bot列表), 以及每个bot想要多少条proxy
- 输出直接是当前目录下的文件,为 bot名字开头的txt文件,分别代表给每个bot生成... | null | gen_proxy.py | gen_proxy.py | py | 6,962 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line... |
170215385 | import csv
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
from scipy.stats import tmean
from sklearn.metrics import auc
def get_data(name, trim_time=3): # Get the data from the spreadsheet
with open(name, "r", newline="") as f:
reader = csv.reader(f, delimiter=",")
time = ... | null | 2020_WINTER/IBEHS_3P04/Final Report/3P04_Data_Processor.py | 3P04_Data_Processor.py | py | 3,286 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "csv.reader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.auc",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "scipy.signal.savgol_filter",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "scipy.signa... |
640136212 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from common import admin_login
class ArticleTest(LiveServerTestCase):
fixtures = ['accounts_... | null | fts/test_cases/article_tests.py | article_tests.py | py | 2,446 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.LiveServerTestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.TEMPLATES",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 15,
"usage_type": "name"
},
... |
40063099 | # coding=utf-8
import sympy as sp
class Dem():
"""一个使用DEM模型计算热导率的类"""
def __init__(self, kr, km, h, particle_size):
"""初始化数据,并求出复合材料增强体的等效热导率"""
self.kr = kr
self.km = km
self.h = h
self.particle_size = particle_size
m=kr/h/particle_size
self.kreff = kr/(... | null | thermal conductivity/dem.py | dem.py | py | 699 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sympy.Symbol",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sympy.solve",
"line_number": 23,
"usage_type": "call"
}
] |
498257302 | import numpy as np
import sklearn.svm
import heapq
def dataset3Params(X, y, Xval, yval):
"""returns your choice of C and sigma. You should complete
this function to return the optimal C and sigma based on a
cross-validation set.
"""
# You need to return the following variables correctly.
C = ... | null | ex6/dataset3Params.py | dataset3Params.py | py | 1,389 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.svm.svm.SVC",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.svm",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "sklearn.svm",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "heapq.heappush",... |
343660367 | from typing import List
from collections import defaultdict
class Solution:
def subarraySum(self, nums: List[int], k: int) -> int:
count=0
n = len(nums)
hashed = defaultdict(lambda: 0)
curr = 0
for x in nums:
curr += x
if curr == k:
c... | null | LeetCode/30-day-leetcoding-challenge/week-4/subarray-sum-to-K.py | subarray-sum-to-K.py | py | 673 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
}
] |
124100124 | '''
Created on 21.07.2017
@author: Jascha Riedel
'''
import numpy as np
import scipy.optimize
from scipy.interpolate import interp1d
def findMpp(data):
'''
Finds Mpp by interpolating U*I in a cubic way.
Parameters:
data: 2-D Array containing U-I data
Returns:
... | null | features/at.sunplugged.celldatabase.feature/rootfiles/python/evaluation/lightevaluation/findMpp.py | findMpp.py | py | 920 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.interpolate.interp1d",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "scipy.optimize.optimize.fmin",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "s... |
68016114 | from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from . models import Film, Vehicle
class FilmForm(forms.ModelForm):
"""Form created for updating Film entity"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self... | null | apps/webapp/forms.py | forms.py | py | 830 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "crispy_forms.helper.FormHelper",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": ... |
634388731 | """Test file for testing all the views and the handlers."""
import uuid
from django.contrib.auth.models import User
from django.test import TestCase, Client
from django.urls import reverse
from api.models import (
Director,
Genre,
Movies,
Token
)
class TestMovieView(TestCase):
"""Test class for ... | null | oto_project/api/tests.py | tests.py | py | 3,855 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.TestCase",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.test.Client",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects.create_user",
"line_number": 22,
"usage_type": "call"
}... |
129525745 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import apps
from django.contrib.admin.sites import site
from django.core.exceptions import ObjectDoesNotExist
from django.forms import widgets
from django.db.models.fields.related import ManyToOneRel
from django.utils.encoding import pyth... | null | cmsplugin_cascade/image.py | image.py | py | 3,512 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "filer.fields.image.AdminFileWidget",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.sites.site",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "django.db.models.fields.related.ManyToOneRel",
"line_number": 21,
... |
477801784 | # -*- coding: utf-8 -*-
import scrapy
class ZonaSulSpider(scrapy.Spider):
name = 'ZonaSul'
allowed_domains = ['www.supermercadosmundial.com.br']
start_urls = ['https://www.supermercadosmundial.com.br/ofertas/']
def parse(self, response):
links = response.css('div.item-filtro a::attr(href)').g... | null | best_market_price/spiders/zonasul.py | zonasul.py | py | 1,448 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scrapy.Spider",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 16,
"usage_type": "call"
}
] |
644776789 | import unittest
from flask import url_for
from flask_testing import TestCase
from application import app
class TestBase(TestCase):
def create_app(self):
return app
class TestViews(TestBase):
def test_time(self):
response = self.client.get(url_for('time'))
self.assertEqual(response.... | null | service2/tests/test_backend.py | test_backend.py | py | 623 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask_testing.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "application.app",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.url_for",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.url_for",
... |
280061681 | import pygame
FPS = 60
W = 700 # ширина экрана
H = 300 # высота экрана
WHITE = (255, 255, 255)
BLUE = (0, 70, 225)
RIGHT = 1
LEFT = 2
STOP = 3
pygame.init()
sc = pygame.display.set_mode((W, H))
clock = pygame.time.Clock()
x = W // 2
y = H // 2
r = 50
motion = STOP
while 1:
sc.fill(WHITE)
pygame.dra... | null | Movement2.py | Movement2.py | py | 638 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pygame.time.C... |
611710827 | from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = 'Updates data on mean age from SCB.se'
def handle(self, *args, **options):
from stats.models import meanAgesData
import requests
import pandas as pd
import numpy as np
f... | null | stats/management/commands/update_meanagesdata.py | update_meanagesdata.py | py | 4,459 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "pand... |
480376374 | graph = {
1: {3, 4},
2: {3, 4, 5},
3: {1, 5},
4: {1},
5: {2, 6},
6: {3, 5}
}
def dfs(graph, root):
visited = []
stack = [root]
while stack:
v = stack.pop()
if v not in visited:
stack.extend(graph[v])
visited.append(v)
return visited
def... | null | 2021_summer_vacation/Graph.py | Graph.py | py | 850 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.deque",
"line_number": 32,
"usage_type": "call"
}
] |
128463803 |
from functools import reduce
from odoo import fields, models, _, api
import logging
from odoo.exceptions import Warning
log = logging.getLogger(__name__)
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP, float_compare
import time
class event_registration(mod... | null | event_price/models/events.py | events.py | py | 15,926 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Many2... |
554512399 | import glob
import os
import sys
import shutil, tempfile
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from tests.test_common import create_css_file
import icon_font_to_png
class TestRun(unittest.TestCase):
def setUp(self):
# Create a temporary di... | null | tests/test_run.py | test_run.py | py | 4,365 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
... |
26122613 | import cv2
import sys
import numpy as np
sys.path.insert(0, "/pyORBSLAM2/src/build")
import ORBSLAM2 as os2
from time import time, sleep
# import pickle
# from gridmap import to_gridmap, DisplayMap
import pyrealsense2 as rs
# Configure depth and color streams
pipeline = rs.pipeline()
config = rs.config()
config.enab... | null | scripts/test_orbslam.py | test_orbslam.py | py | 1,109 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.insert",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pyrealsense2.pipeline",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyrealsense2.config... |
454558488 | import numpy as np
from skimage.external import tifffile as tiff
from skimage import img_as_float, img_as_uint
from skimage.transform import resize, rotate
from skimage.feature import register_translation as rt
from scipy import ndimage
import matplotlib.pyplot as plt
from statistics import mode
import os
impo... | null | NewFunctions.py | NewFunctions.py | py | 12,378 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.zeros",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "skimage.external.tifffile.imread",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "skimage.external.tifffile",
"line_number": 43,
"usage_type": "name"
},
{
"api_name":... |
87781871 |
import time
from celery import shared_task
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
from django.core.mail import send_mail
User = get_user_model()
from .models import Question,Answer,qlike
@shared_task
def question_created(question_id)... | null | questions/task.py | task.py | py | 1,393 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.auth.models.User",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Question.objects.get",
"line_number": 13,
"usage_type": "call"
... |
476525551 | # uncompyle6 version 3.6.7
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: build/bdist.macosx-10.7-x86_64/egg/airflow/contrib/example_dags/example_azure_cosmosdb_sensor.py
# Compiled at: 2019-09-11 03:47:34
# Siz... | null | pycfiles/apache_beam-2.20.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64/example_azure_cosmosdb_sensor.cpython-36.py | example_azure_cosmosdb_sensor.cpython-36.py | py | 1,700 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "airflow.utils.dates.days_ago",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "airflow.utils.dates",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "airflow.DAG",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "airflow.... |
187270360 | import logging
import json
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters,
CallbackQueryHandler)
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from enum import Enum
import token_secure
from models import Pycampista, Project, ProjectOwner, Slot, Vo... | null | bot.py | bot.py | py | 12,063 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "telegram.ext.Updater",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "token_secure.TOKEN",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logg... |
41052279 | from django.conf.urls import url
from . import views
from django.views.generic import TemplateView
#from django.conf.urls.static import static
#from django.conf import settings
urlpatterns = [
url(r'^$', views.post_list, name='post_list'),
url(r'^post/(?P<pk>[0-9]+)/$', views.post_detail, name='post_detail'),
... | null | blog/urls.py | urls.py | py | 1,387 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.co... |
104334098 | from scipy.spatial.transform import Rotation as R
import numpy as np
def tf2matrix(trans, quat):
T = np.eye(4)
rot_mat = R.from_quat(quat).as_matrix()
trans = np.array(trans).reshape(3, 1)
T[:3, :4] = np.hstack((rot_mat, trans))
return T
def matrix2tf(T):
rot_mat = T[:3, :3]
quat = R.fro... | null | cam_tracking/src/utils.py | utils.py | py | 392 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.eye",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.transform.Rotation.from_quat",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.transform.Rotation",
"line_number": 7,
"usage_type": "name"
},
{
... |
335108177 | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 22 20:56:56 2019
@author: Taha
"""
import pandas as pd
import numpy as np
from scipy import stats
BIOM = pd.read_excel('table.from_biom.tsv.xlsx')
META = pd.read_table('sample-metadata.tsv', sep='\t')
LABELS = META.iloc[:,3]
IDS = META.iloc[:,0]
LABEL... | null | qiime_anova.py | qiime_anova.py | py | 972 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_excel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_table",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.full",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.stats.ttest_ind"... |
30791917 | #!/usr/bin/env python
'''
Chris Miller
cmiller@di.ens.fr
evaluates chord recognition by all chord qualities using MIREX
usage:
./evaluateAlChords.py -o output_file filelist /path/to/results/
^ -- this slash is important
parameters:
... | null | evaluation/evaluateAllChords.py | evaluateAllChords.py | py | 6,976 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.dump",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "future.utils.iteritems",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "sys.argv",
... |
572750791 | """Do comparisons involving abstract values."""
from pytype import abstract
from pytype import abstract_utils
from pytype import mixin
from pytype.pytd import slots
# Equality classes.
NUMERIC = {"__builtin__.bool", "__builtin__.int", "__builtin__.float",
"__builtin__.complex"}
STRING = {"__builtin__.str",... | null | pytype/compare.py | compare.py | py | 4,953 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pytype.mixin.PythonConstant",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "pytype.mixin",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "pytype.abstract.Instance",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_n... |
650180749 | # coding: utf-8
import torch
from torch import nn
from torch.nn import functional as F
from torch.autograd import Variable
import math
import numpy as np
from fairseq.models.fconv import Embedding, Linear
def Conv1d(in_channels, out_channels, kernel_size, dropout=0, **kwargs):
from .conv import Conv1d
m = C... | null | deepvoice3_pytorch/nyanko.py | nyanko.py | py | 3,071 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "conv.Conv1d",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn.utils.weight_norm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn.utils",
... |
5526803 | """
Creation date: Wed Apr 8 18:46:57 2020
Author: Jimmy Lilly (www.github.com/jlilly364)
Program Objective:
"""
from PIL import Image
import glob
# Create the frames
frames = []
imgs = glob.glob("*.png")
for i in imgs:
new_frame = Image.open(i)
frames.append(new_frame)
# Save into a GIF file that loops... | null | Research Assignments/5/GifMaker.py | GifMaker.py | py | 483 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "glob.glob",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 15,
"usage_type": "name"
}
] |
321643485 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.paginator import *
from django.http import HttpResponse, Http404
from django.shortcuts import render, get_object_or_404
from utils.models import ImageModel, FaceInfo, FacePlusPlusInfo
from utils.const import SINGLE_FACE_FOUND
def webapp_... | null | webapp/views.py | views.py | py | 2,957 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.shortcuts.render",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
343278289 | from django.views import generic
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.http import HttpResponse
from django.utils import timezone
from .models import Publication
# Create your views here.
class IndexView(generic.ListView):
"""
Index page will display a list of th... | null | research/views.py | views.py | py | 1,797 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.Publication.objects.all",
"line_number": 19,
"usage_type": "call"
},
{
... |
106570297 | from __future__ import annotations
from typing import Callable, Dict
import torch
import torch._ops
import torch.fx
from torch.fx import traceback as fx_traceback
from torch.fx.experimental import proxy_tensor
from torch.onnx._internal import _beartype
@_beartype.beartype
def _rename_placeholder_targets(
modul... | null | torch/onnx/_internal/fx/passes/decomp.py | decomp.py | py | 2,020 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.onnx._internal._beartype.beartype",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.onnx._internal._beartype",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.fx",
"line_number": 35,
"usage_type": "attribute"
},
... |
146302557 | import os
from django.template.response import TemplateResponse
from django.conf import settings
from django.http import HttpResponseNotAllowed
def home(request):
storefront_url = os.environ.get("STOREFRONT_URL", "")
dashboard_url = os.environ.get("DASHBOARD_URL", "")
if not settings.PLAYGROUND_ENABLED:
... | null | saleor/core/views.py | views.py | py | 564 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_nu... |
540338431 | # -*- coding: utf-8 -*-
from collections import OrderedDict
from operator import itemgetter
from workflow import settings
class Step(tuple):
'Step(engine, status, description, order, warning, step_classes)'
__slots__ = ()
_fields = ('engine', 'status', 'description',
'order', 'warning', ... | null | dbaas/flipperfox_migration/migration_steps.py | migration_steps.py | py | 3,232 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.OrderedDict",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "operator.itemgetter",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "operator.itemgetter",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "opera... |
449982336 | #!/usr/bin/env python3
from pinocchio.visualize import GepettoVisualizer as Visualizer
from models import *
robot = load_monoped_model(verbose=True)
q0 = robot.q0
model = robot.model
data = robot.data
q0 = robot.q0
robot.setVisualizer(Visualizer())
robot.initViewer()
robot.loadViewerModel("pinocchio")
robot.display(... | null | whole-body/test.py | test.py | py | 386 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pinocchio.visualize.GepettoVisualizer",
"line_number": 12,
"usage_type": "call"
}
] |
462018311 | #!/usr/bin/env/python
from typing import Tuple, List, Any, Sequence
import tensorflow as tf
import time
import os
import json
import numpy as np
import pickle
import random
import math
from sklearn.metrics import average_precision_score
from utils import MLP, ThreadedIterator, SMALL_NUMBER
class ChemModel(object)... | null | cpg/chem_tensorflow.py | chem_tensorflow.py | py | 33,145 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.strftime",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 59,... |
309126276 | #!/usr/bin/python3
import urllib.request
import json
import time
import logging
import os
from bs4 import BeautifulSoup
from os import listdir
from os.path import isfile, join
class Scraper(object):
"""docstring for Scraper"""
def __init__(self, config):
super(Scraper, self).__init__()
se... | null | scrape.py | scrape.py | py | 4,196 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line... |
511687008 | #encoding: utf-8
#!/bin/python2.7
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.pyplot import cm
#Direct input
plt.rcParams['text.latex.preamble']=[r"\usepackage{times} \usepackage{txfonts} \usepackage[french]{babel} \RequirePackage[utf8]{inputenc}"]
#Opt... | null | scripts/eigenfunction/homogeneous.py | homogeneous.py | py | 3,900 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matpl... |
345923005 | #!C:\Program Files (x86)\Python37-32\python.exe
import cgi, os, view,sys
import codecs
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
form = cgi.FieldStorage()
pageId = form["pageId"].value
os.remove('data/'+pageId)
#Redirection
print("Location: index.py")
print()
| null | process_delete.py | process_delete.py | py | 294 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.stdout",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "codecs.getwriter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.stdout.detach",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cgi.FieldStorage",
... |
205746558 | #Importing numpy and sqlite3
import numpy as NP
import sqlite3 as sql
from numpy.linalg import *
import matplotlib.pyplot as mpl
#Establishing connection to the database and creating cursor
conn = sql.connect('DataMiningAssignment2015.db')
c = conn.cursor()
#Importing Keystrokes_Train to matrices
KeyTrainX... | null | Datamining/DataminingFraud.py | DataminingFraud.py | py | 5,970 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlite3.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_num... |
338206661 | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy import Column, Integer, String, func
Base = declarative_base()
class Item(Base):
__tablename__ = 'items'
id = Column(Integer, primary_key=True)
itemcode =... | null | SQLAlchemy/alchemy3.py | alchemy3.py | py | 1,239 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 13,
"usage_type": "argument"
},
{
... |
57906051 | """
CSCC11 - Introduction to Machine Learning, Winter 2021, Assignment 3
B. Chan, Z. Zhang, D. Fleet
"""
import numpy as np
from utils import softmax
class LogisticRegression:
def __init__(self,
num_features,
num_classes,
rng=np.random):
""" This class re... | null | logistic_regression.py | logistic_regression.py | py | 10,036 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.squeeze",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.eye",
"line_num... |
239590237 | from lolcrawler.lolcrawler import LolCrawler, TopLolCrawler
from riotwatcher import RiotWatcher
from config import config
from pymongo import MongoClient
from datetime import date, timedelta
from clint import arguments
ALL_REGIONS = [
"na1",
"ru",
"kr",
"br1",
"oc1",
"jp... | null | crawl.py | crawl.py | py | 1,451 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "clint.arguments.Args",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "clint.arguments",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "config.confi... |
307387382 | __author__ = 'Ariel'
import random
import numpy as np
from scipy.spatial import distance
def Kmean(data, k):
"K-means clustering on data matrix, row vectors based"
# Initialization
seed = random.sample(xrange(data.shape[0]), k)
centers = data[seed]
newAssign = [0]*data.shape[0]
assign = [1]*d... | null | kmeans_w.py | kmeans_w.py | py | 1,762 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.sample",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.distance.cdist",... |
218361734 | import numpy as np
import gym_minigrid.envs.game as game
import torch
import utils as utils
def evaluate(dict_env, dict_agent, policy_net, net_expert, writer, global_step):
# Init expert
use_learned_expert = 1
# Device to use
if "device" in dict_env:
device = dict_env["device"]
else:
... | null | evaluate.py | evaluate.py | py | 7,307 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.device",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "gym_minigrid.env... |
65416889 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# based on checkgoogleip 'moonshawdo@gmail.com'
import threading
import operator
import time
import Queue
import os, sys
import traceback
current_path = os.path.dirname(os.path.abspath(__file__))
if __name__ == "__main__":
current_path = os.path.dirname(os.path.abspat... | null | gae_proxy/local/google_ip.py | google_ip.py | py | 27,322 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"l... |
526957585 | import os
import json
from django_classy_settings import DjangoClassSettings
def open_json_info(path, default=None):
try:
with open(path, "r") as fp:
info = json.load(fp)
return info
except (ValueError, FileNotFoundError):
if default is None:
default = {}
... | null | root/tilconfig/settings/base.py | base.py | py | 3,758 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django_classy_settings.DjangoClassSettings",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "o... |
237476813 | #-------------------------------------------------------------------------------
# Name: Printer Notification
# Purpose: Fetches paper and toner status for RICOH Aficio MP 5002 Printers
# and sends daily notifications about paper/toner levels as well as
# when paper/toner is low.
#
# Author: Geoffrey Chiou
... | null | printer_notification.py | printer_notification.py | py | 10,468 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 80,
"usage_type": "attribute"
},
{
... |
58463222 |
from math import sin, cos, acos
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d as p3
import matplotlib.animation as animation
import time
from mpl_toolkits.mplot3d import axes3d
from itertools import product, combinations
# Setting black background
plt.style.use('dark_backgrou... | null | potato3.py | potato3.py | py | 3,814 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
},
{
"api_na... |
380952428 | import types
from pytest import raises
from ssaw import MapsApi
from ssaw.headquarters_schema import Map
from . import my_vcr
@my_vcr.use_cassette()
def test_map_list(session):
r = MapsApi(session).get_list()
assert isinstance(r, types.GeneratorType)
assert isinstance(next(r), Map), "Ther... | null | tests/headquarters/test_maps.py | test_maps.py | py | 988 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ssaw.MapsApi",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "types.GeneratorType",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "ssaw.headquarters_schema.Map",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name":... |
138648016 | from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from snippify.snippets.models import Snippet
from snippify.django_authopenid.models import UserProfile
from django.contrib.auth.models import User
from snippify.snippets.forms import SnippetForm
from pygments.lexers import gues... | null | api/views.py | views.py | py | 1,544 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "snippify.django_authopenid.models.UserProfile.objects.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "snippify.django_authopenid.models.UserProfile.objects",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "snippify.django_authopenid.m... |
399106463 | #!/usr/bin/env python
import boto3
import json
import argparse
from botocore.exceptions import ClientError
from datetime import datetime
import requests
def json_serial(obj):
"""JSON serializer for objects not serializable by default json code"""
if isinstance(obj, datetime):
serial = obj.isoformat()... | null | manual-scans/aws-alias-cloudfront-s3.py | aws-alias-cloudfront-s3.py | py | 5,843 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "requests.get",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "boto3.session.Session... |
398593003 | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from itertools import combinations
import operator
import random
import sys
import unittest
from pqdict import pqdict, minpq, maxpq, nlargest, nsmallest
sample_keys = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
sample_values = [5, 8, 7, 3, 9, 12, 1]
sample_ite... | null | tests/test_pqdict.py | test_pqdict.py | py | 15,764 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "itertools.combinations",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "random.s... |
88555261 | import logging
import time
import unittest
import numpy as np
from neurolib.models.aln import ALNModel
from neurolib.optimize.exploration import BoxSearch
from neurolib.utils.parameterSpace import ParameterSpace
import neurolib.utils.functions as func
class TestALNExploration(unittest.TestCase):
"""
ALN mod... | null | tests/test_explorations.py | test_explorations.py | py | 4,842 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "neurolib.models.aln.ALN... |
554799898 | import numpy as np
import cv2
import time
from picamera.array import PiRGBArray
from picamera import PiCamera
#img = cv2.imread('image_new_1.jpg',cv2.IMREAD_COLOR)
#hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
camera = PiCamera()
camera.resolution = (640, 480)
camera.framerate = 15
camera.brightness = 40
c... | null | Demo/vision_dev/Vision System 1.py | Vision System 1.py | py | 10,246 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "picamera.PiCamera",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "picamera.array.PiRGBArray",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
... |
199540092 | import math
import typing
import collections
import random
from datetime import datetime as dt
import discord
from discord.ext import commands
from matplotlib import pyplot as plt
from cogs import utils
POINTS_MESSAGE = """
Cerberus uses multiple methods of keeping track of points. To see your sent messages in the ... | null | cogs/information.py | information.py | py | 12,860 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cogs.utils.Cog",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "cogs.utils",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "cogs.utils.Context",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "cogs.utils",
... |
632237815 | import sqlite3
import sys
import os.path
import logging
import convertutils
version = 13
def upgrade(conn, logger):
convertutils.checkVersion(conn, version, logger)
conn.execute("ALTER TABLE Config RENAME TO _Config_Orig")
conn.execute("""
CREATE TABLE IF NOT EXISTS Config (
Key TEXT... | null | Tardis/Converters/convert13to14.py | convert13to14.py | py | 941 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "convertutils.checkVersion",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "convertutils.updateVersion",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 30,
"usage_type": "call"
},
{
"api_name... |
88640489 | from django import forms
from .models import Comment
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ('content',)
def __init__(self, *args, **kwargs):
self.user = kwargs.pop('user',None)
self.article = kwargs.pop('article',None)
sup... | null | comment/forms.py | forms.py | py | 600 | 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": "models.Comment",
"line_number": 7,
"usage_type": "name"
}
] |
325425445 | from typing import List
import numpy as np
class MotionIntegrator:
def __init__(self, beta_bounds: List, phi_dot_bounds: List):
"""
Initialize the MotionIntegrator class.
:param beta_bounds: Min/max allowable value for steering angle, in rad.
:param phi_dot_bounds: Min/max... | null | libswervedrive/motionintegrator.py | motionintegrator.py | py | 1,457 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
... |
499104971 | # -*- coding: utf-8 -*-
import poisoner
from my_args import setup_argparse
from torch.autograd import Variable
import torch.nn as nn
import torch
import matplotlib.pyplot as plt
import matplotlib
import numpy.random as nr
import numpy as np
from sklearn.feature_selection import mutual_info_classif, SelectKBest
from skl... | null | 02_ransom.py | 02_ransom.py | py | 15,541 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.stdout",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "io.TextIOWrapper",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.set_printoptions",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.us... |
81611859 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule,Request
import json,re,os
class SkinSpider(CrawlSpider):
name = 'Skin'
allowed_domains = ['lol.qq.com']
start_urls = ['http://gpcd.gtimg.cn/upload/qqtalk/lol_hero/1d/hero_list... | null | LOlSkin/LOlSkin/spiders/Skin.py | Skin.py | py | 2,106 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scrapy.spiders.CrawlSpider",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scrapy.spiders.Request",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.findal... |
222786224 | """
A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
#
# Python setup file for hdp_tools library
#
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from os import path
here = path.abspath(path... | null | setup.py | setup.py | py | 1,322 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_... |
621561301 | from __future__ import print_function, division
import nltk
import sys, os
import random
from collections import Counter
from nltk import word_tokenize, WordNetLemmatizer
from nltk.corpus import stopwords
from nltk import NaiveBayesClassifier, classify
import pickle
import smtplib
import time
import imaplib
import emai... | null | FertigesProjektKrommMäder.py | FertigesProjektKrommMäder.py | py | 5,488 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 19,
"usage_type": "call"
},
{
"api... |
279609456 | # -*- coding: utf-8 -*-
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2015 Thumbor-Community
# Copyright (c) 2011 globo.com timehome@corp.globo.com
import gridfs
import urllib
import re
from datetime import datetime, timedelta
from cStringIO import StringIO
from pymo... | null | thumbor_mongodb_storage/storages/mongo_storage.py | mongo_storage.py | py | 5,267 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "thumbor.storages.BaseStorage",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "urllib.quote_plus",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "da... |
414460540 | # Use sympy to perform symbolic operation
# from sympy import *
import sympy as sym
import itertools
x = sym.symbols('x')
a = sym.symbols('a', integer=True)
y = sym.symbols('y')
b = sym.symbols('b', integer=True)
z = sym.symbols('z')
# polynomial = ((2*x+y)**3)*(x*y**2)*z**4
# print('polynomial is', polynom... | null | Polynomial.py | Polynomial.py | py | 7,811 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sympy.symbols",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sympy.symbols",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sympy.symbols",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sympy.symbols",
"line_numb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.