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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
176839511 | import time
try:
import bpy
except ImportError:
pass
from compas_blender.utilities import clear_layer
from compas_blender.artists.mixins import VertexArtist
from compas_blender.artists.mixins import EdgeArtist
from compas_blender.artists.mixins import PathArtist
__author__ = ['Andrew Liew <... | null | src/compas_blender/artists/networkartist.py | networkartist.py | py | 1,985 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "compas_blender.artists.mixins.PathArtist",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "compas_blender.artists.mixins.EdgeArtist",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "compas_blender.artists.mixins.VertexArtist",
"line_number":... |
111761988 | from collections import deque
# Definition for a binary tree node.
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
def minDepth(self, root):
"""
:type root: TreeNode
:rtype: int
... | null | python/111 Minimum Depth of Binary Tree.py | 111 Minimum Depth of Binary Tree.py | py | 1,482 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.deque",
"line_number": 34,
"usage_type": "call"
}
] |
49012878 | import webapp2
import main
from models import Attempt, CaseSet
from google.appengine.ext import ndb
from utils import get_current_profile
class AcceptSolutionHandler(webapp2.RequestHandler):
def post(self):
attempt_key = ndb.Key(urlsafe=self.request.get('key'))
attempt = attempt_key.get()
... | null | pages/view_problem/accept_solution.py | accept_solution.py | py | 1,500 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "webapp2.RequestHandler",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.ndb.Key",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "google.appengine.ext.ndb",
"line_number": 11,
"usage_type": "name"
},
{
"... |
283167898 | from __future__ import annotations
import asyncio as aio
import aurcore
import asyncpg
import aurflux
import typing as ty
import collections as clc
import TOKENS
import itertools as itt
import re
EMOJI_REGEX = re.compile("<(?P<animated>a)?:(?P<name>[0-9a-zA-Z_]{2,32}):(?P<id>[0-9]{15,21})>")
if ty.TYPE_CHECKING:
... | null | decompose.py | decompose.py | py | 3,055 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.compile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "typing.U... |
605601053 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 7 12:04:44 2018
@author: HP
"""
import os
import sys
from selenium import webdriver
import urllib
import urllib.request
from zipfile import *
import tkinter
from tkinter.filedialog import askopenfilename
from tkinter import messagebox
from PIL import ImageTk, Image
si... | null | GSmetrics/driver_module.py | driver_module.py | py | 6,498 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "urllib.... |
18074045 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('proposals', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='proposal',
name='t... | null | junction/proposals/migrations/0002_auto_20141219_1803.py | 0002_auto_20141219_1803.py | py | 2,332 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RemoveField",
"line_number": 14,
"usage_type": "call"
},
... |
507636432 | from django.conf import settings
from django.contrib.auth.models import User
from rest_framework.decorators import api_view
from rest_framework.reverse import reverse
from rest_framework.response import Response
from rest_framework import generics, permissions, serializers
from datetime import datetime
from PIL import ... | null | products/views.py | views.py | py | 3,842 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "time.time",... |
295768454 | """
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is ... | null | code/WalmartScraper.py | WalmartScraper.py | py | 3,431 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
484581578 | '''
Created on Jan 22, 2012
@author: James
'''
import datetime
from decimal import Decimal
from django.core.serializers.json import DateTimeAwareJSONEncoder
from django.db.models import Model
from django.db.models import ImageField, FileField
from django.db.models.query import QuerySet
from django.utils import simple... | null | django_jqgrid/json_jqgrid.py | json_jqgrid.py | py | 3,541 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "decimal.Decimal",
"line_number": 35,
"usage_type": "argument"
},
{
"api_name": "django.db.models.query.QuerySet",
"line_number": 38,
"usage_type": "argument"
},
{
"api_name": "django.db.models.Model",
"line_number": 41,
"usage_type": "argument"
},
{
... |
447819254 | from django.contrib import admin
from django.urls import path,include
from home import views
app_name='home'
urlpatterns = [
path('signin/',views.register,name='register'),
path('login/',views.userlogin,name='login'),
path('userdetail/',views.logedin,name='userdetail'),
path('logedout/',views.logedout... | null | home/urls.py | urls.py | py | 445 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "home.views.register",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "home.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
... |
632429378 | import pytest
@pytest.mark.notimpl(
[
"bigquery",
"clickhouse",
"dask",
"datafusion",
"impala",
"mssql",
"mysql",
"pandas",
"polars",
"postgres",
"pyspark",
"snowflake",
"trino",
]
)
def test_rowid(con):
... | null | ibis/backends/tests/test_column.py | test_column.py | py | 967 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pytest.mark.notimpl",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pytest.mar... |
394590901 | import requests
from bs4 import BeautifulSoup
import sys
import csv
f = open( "C:\\workspace\\Tomwaitsmap\\songs.csv", 'wb')
writer = csv.writer(f)
writer.writerow(["album","song","lyrics"])
url = "http://www.tomwaits.com/songs/"
baseUrl = url[:23]
markup = requests.get(url)
data = markup.text
soup = BeautifulSoup(da... | null | lyricScraper.py | lyricScraper.py | py | 838 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "csv.writer",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_num... |
252629629 | """Modelling of FreeBSD ports."""
from __future__ import absolute_import
from contextlib import contextmanager
import os
import subprocess
import time
from libpb import env, log, make, mk, pkg, queue
from ..signal import SignalProperty
__all__ = ["Port"]
# TODO:
# Non-privileged mode
# remove NO_DEPENDS once thor... | null | libpb/port/port.py | port.py | py | 18,971 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "event.suspend",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "event.resume",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "contextlib.contextmanager",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "contextlib.conte... |
585581073 | import cv2
import numpy as np
cv2.namedWindow('image')
# 이미지 파일 읽기
img = cv2.imread("cropped.jpg", cv2.IMREAD_COLOR)
# 이미지 색 바꾸기
#img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# img_ycrcb = cv2.cvtColor(img, cv2.COLOR_BGR2YCrCb)
img_hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
# 잡음 제거
img_hsv = cv2.fastNlMeansDenoi... | null | path/face_detect.py | face_detect.py | py | 1,515 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.namedWindow",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_COLOR",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"lin... |
609302004 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from enum import Enum
class CommandType(Enum):
A_COMMAND = 0
C_COMMAND = 1
L_COMMAND = 2
class Parser:
def __init__(self, filepath):
with open(filepath, 'r') as file:
self.lines = file.readlines()
self.cursor = 0
... | null | 06/assembler/parser.py | parser.py | py | 2,032 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "enum.Enum",
"line_number": 6,
"usage_type": "name"
}
] |
475721756 | # -*- coding: utf-8 -*-
"""
Python Codes for Chapter:
Insights from TWO variables
"""
#%%
import pandas as pd
#link to data
linkRepo='https://github.com/resourcesbookvisual/data/'
linkFile='raw/master/crime.csv'
fullLink=linkRepo+linkFile
crime=pd.read_csv(fullLink)
#%%
#contingency table of counts
PrecintDayt... | null | python/bivariate.py | bivariate.py | py | 19,828 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.crosstab",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.crosstab",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.Categorical",
... |
377098716 | import decimal
import parsy
import pytest
from pytest import param
from toolz import identity
import ibis
import ibis.expr.datatypes as dt
import ibis.expr.operations as ops
import ibis.expr.rules as rlz
import ibis.expr.types as ir
from ibis.common.exceptions import IbisTypeError
table = ibis.table(
[('int_col'... | null | ibis/tests/expr/test_rules.py | test_rules.py | py | 10,449 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ibis.table",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "ibis.table",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "ibis.expr.rules.datatype",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "ibis.expr.rules",
... |
9170334 | #-*- coding:utf-8 -*-
import os,time
import re
import sys
import win32print
import win32api
from datetime import datetime,date,timedelta
from PyQt4 import QtCore, QtGui
from ui.ui_mainwindow import Ui_MainWindow
from ui.LoginDialog import LoginDialog
from ui.SendNGDialog import SendNGDialog
from modules.DataSource impo... | null | example/FlashNG/ui/FlashNGUI.py | FlashNGUI.py | py | 28,505 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt4.QtGui.QMainWindow",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "PyQt4.QtGui",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
151034493 | from typing import *
import os
import csv
import logging
import pickle
import loompy
import numpy as np
import cytograph as cg
import luigi
import scipy.cluster.hierarchy as hierarchy
import numpy_groupies.aggregate_numpy as npg
import scipy.cluster.hierarchy as hc
import adolescent_mouse as am
class AggregateByTaxon... | null | adolescent_mouse/adolescent_L6/aggregate_by_taxon_L6.py | aggregate_by_taxon_L6.py | py | 2,606 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "luigi.Task",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "luigi.IntParameter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "luigi.IntParameter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "luigi.IntParame... |
332619045 | import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
import cv2
batch_size = 30
input_neurons = 784 # mnist image size
hidden_neurons = 250 # random hidden numbers
output_neurons = 10 # output neurons
learning_rate = .01
epochs = 10
train = torchvision.datasets.FashionMNIS... | null | CNNs/CNN_2.py | CNN_2.py | py | 5,635 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torchvision.datasets.FashionMNIST",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torchvision.datasets",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 14,
"usage_type": "call"
}... |
136468411 | from PyQt5.QtWidgets import QApplication,QMainWindow,QCheckBox
from PyQt5.QtCore import Qt
import sys
import guiMain
import os
from serialComThread import serialThreadClass
from cameraThread import cameraThreadClass
class MainClass(QMainWindow,guiMain.Ui_MainWindow):
#this is what was taken away,gui.Ui_MainWindow
... | null | SimpleGUI/Simple_Gui/Main.py | Main.py | py | 4,262 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "guiMain.Ui_MainWindow",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "serialComThread.serialThreadClass",
"line_number": 21,
"usage_type": "call"
},
{... |
334796050 | # -*- coding: utf-8 -*-
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^', include('inicio.urls', namespace='inicio')),
url(r'^usuarios/', include('usuarios.urls', namespace='usuarios')),
url(r'^cargainicial/', include('cargainicial.urls', namespace='carga... | null | sai/urls.py | urls.py | py | 615 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.include",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "djang... |
122236887 | # '''
# This deep learning model comes from network resources. We refer to it Mask-r-cnn,
# and the citation information shows below:
#
# @misc{matterport_maskrcnn_2017,
# title={Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow},
# author={Waleed Abdulla},
# year={2017},
# publi... | null | 9517_Group_Submision/Codes/task3_evaluate.py | task3_evaluate.py | py | 6,168 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.mean",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "task3_inference.mask_to_... |
56073599 | import asyncio
from aiohttp import ClientSession
from asyncio import Semaphore
from bs4 import BeautifulSoup
from .models import Repository, Commits
# global variables to evade coroutine objects returned by async functions.
'''
Global variables were created in order to evade coroutine objects to be returned,
thus we... | null | scraper/asynscraper.py | asynscraper.py | py | 2,927 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "models.Repository.objects.values_list",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "models.Repository.objects",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "models.Repository",
"line_number": 23,
"usage_type": "name"
},
{... |
414189778 | """
The :mod:`tslearn.metrics` module delivers time-series specific metrics to be
used at the core of machine learning algorithms.
**User guide:** See the :ref:`Dynamic Time Warping (DTW) <dtw>` section for
further details.
"""
import warnings
import numpy
from joblib import Parallel, delayed
from numba import nji... | null | tslearn/metrics.py | metrics.py | py | 71,667 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numba.njit",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.full",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 63,
"usage_type": "attribute"
},
{
"api_name": "numpy.isfinite",
"line_numbe... |
484656206 | import random
import collections
import numpy as np
from constant import ElevatorConst
from floor import Floor
SOURCEs = []
class Elevator(Floor):
def __init__(self, id):
super().__init__()
self.counter = 0
self.id = id
self.iterration_paths = []
self.source_x, self.sou... | null | Project/Program/elevator.py | elevator.py | py | 8,767 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "floor.Floor",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "constant.ElevatorConst.NUM_OF_ITERATION",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "constant.ElevatorConst",
"line_number": 26,
"usage_type": "name"
},
{
"a... |
318407996 | import numpy as np, random, operator, pandas as pd, matplotlib.pyplot as plt
from readData import ReadData
class City:
def __init__(self, label, distance_list):
self.label = label
self.distance_list = distance_list
def distance(self, city):
distance = self.distance_list[(c... | null | other_scripts/ga_tsp.py | ga_tsp.py | py | 7,589 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.sample",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "operator.itemgetter",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
381905528 | # -*- coding: utf-8 -*-
__author__ = 'Administrator'
#!/usr/bin/python
import requests
import time
from bs4 import BeautifulSoup
#开始抓取前先观察下目标页面或网站的结构,其中比较重要的是URL的结构。链家网的二手房列表页面共有100个,URL结构为http://bj.lianjia.com/ershoufang/pg9
#设置列表页URL的固定部分
url='http://bj.lianjia.com/ershoufang/'
#设置页面页的可变部分
page=('pg')
#设置请求头部信息
he... | null | lianjia_crawler/main.py | main.py | py | 1,607 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_nu... |
421029738 | import string
from itertools import cycle
from multiprocessing import cpu_count
from argparse import ArgumentParser
import numpy as np
import pandas as pd
import psutil
from cytoolz import take
from pyspark import SparkContext, HiveContext, SparkConf
def get_conf():
ncores = cpu_count()
conf = SparkConf()
... | null | examples/sparky.py | sparky.py | py | 1,577 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "multiprocessing.cpu_count",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkConf",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "psutil.avail_phymem",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pyspa... |
363181799 | from matplotlib import pyplot as plt
from matplotlib.patches import Rectangle
cmap = plt.cm.hot
fig = plt.figure()
ax = fig.add_subplot(111)
for w,x,y in zip(dur,dursum,hz):
ax.add_artist(Rectangle(xy=(x, y),width=w, height=1, color='k',edgecolor='k'))
# ylim(np.floor(glum.min()/10.)*10,np.ceil(glum.max()/10.)*1... | null | analysis/scripts/stimuli_raster.py | stimuli_raster.py | py | 370 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.cm",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "mat... |
621279187 | #!/usr/bin/env python3
import argparse
import json
import logging
import os
import os.path
import shutil
import sys
from datetime import datetime
from interop import InteropRunner
from run import client_implementations, implementations, server_implementations
from testcases import MEASUREMENTS, TESTCASES
def get_ar... | null | cron.py | cron.py | py | 1,715 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcno... |
484809063 | import numpy, threading, argparse
from queue import Queue
from netaddr import *
from scapy.all import *
parser = argparse.ArgumentParser(description="ICMP Flamethrower across IP Classes",epilog="Usage: pp.py --Class C")
parser.add_argument("-C", "--Class",required=True, type=str, metavar="", help="Class to scan")
pars... | null | lib/pp.py | pp.py | py | 2,503 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "threading.Lock",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
... |
588687245 | """
Wavefront Span Reporter.
@author: Hao Song (songhao@vmware.com)
"""
import logging
from wavefront_opentracing_python_sdk.reporting import reporter
class WavefrontSpanReporter(reporter.Reporter):
"""Wavefront Span Reporter."""
def __init__(self, client, source=None):
"""
Construct Wavefro... | null | wavefront_opentracing_python_sdk/reporting/wavefront.py | wavefront.py | py | 1,745 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "wavefront_opentracing_python_sdk.reporting.reporter.Reporter",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "wavefront_opentracing_python_sdk.reporting.reporter",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "logging.error",
"line_n... |
240643517 | import json
from django.conf import settings
from redis import StrictRedis
from spotipy import Spotify as _Spotify
from spotipy import SpotifyClientCredentials
from spotipy.cache_handler import CacheHandler
from spotipy.exceptions import SpotifyException
from spotipy.oauth2 import SpotifyOAuth
from ytmusicapi import Y... | null | converter/services.py | services.py | py | 6,067 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "redis.StrictRedis.from_url",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "redis.StrictRedis",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.REDIS_URL",
"line_number": 14,
"usage_type": "attribute"
},
{
"... |
299553290 | import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output
from app import app
from database import transforms
import pandas as pd
import numpy as np
df = transforms.df
min_p = df.confirmed.min()
max_p = df.confi... | null | cov19-aus/section_data/data_view.py | data_view.py | py | 4,005 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "database.transforms.df",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "database.transforms",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "dash_html_components.Div",
"line_number": 14,
"usage_type": "call"
},
{
"api_name... |
580363494 | #coding=utf-8
import time
import importlib
import matplotlib.pyplot as plt
import quantlib.common.runtime_env as rt
from ..core import *
from ..indicator import *
from ..statistics import *
from ..common import *
class BackTestingFrame(object):
def __init__(self):
self._starting_cash=100000
self.... | null | quantlib/frame/backtesting.py | backtesting.py | py | 3,737 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "importlib.reload",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "quantlib.common.runtime_env.get_symbols",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "quantlib.common.runtime_env",
"line_number": 46,
"usage_type": "name"
},
{
... |
51243748 | import pandas as pd
import numpy as np
from keras.preprocessing.image import ImageDataGenerator
from keras.preprocessing import image
from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPool2D, BatchNormalization
from keras.models import Sequential
from keras.optimizers import RMSprop
from keras.utils import ... | null | Santander2_v1.0.py | Santander2_v1.0.py | py | 3,688 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "keras.utils.np_utils.to... |
567660340 |
import argparse
from model import *
from utility.iofile import *
from utility.selfdefine import *
from utility.preprocessing import sparse_to_tensor
from utility.collate import mycollate
from torchvision import transforms
from torch import optim
import time
from sklearn.metrics import roc_auc_score
parser = argpar... | null | run_sglayer_mimiccxr.py | run_sglayer_mimiccxr.py | py | 10,449 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.manual_seed",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 47,
"usage_type": "call"
},
{
"api_name... |
378341861 | # uncompyle6 version 3.7.4
# Python bytecode 2.5 (62131)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.linux-x86_64/egg/pyglet/gl/glext_missing.py
# Compiled at: 2009-02-07 06:48:48
"""Additional hand-coded GL extensions.
These are hand-wrapped extens... | null | pycfiles/Fungus-0.1.1-py2.5/glext_missing.py | glext_missing.py | py | 2,496 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyglet.gl.lib.link_GL",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pyglet.gl.lib.link_GL",
"line_number": 53,
"usage_type": "call"
}
] |
269539717 | import cv2
import sys
sys.path.append('..')
from math import cos, sin
from FSA_Net.lib.FSANET_model import *
import numpy as np
from keras.layers import Average, Input
from keras.models import Model
from bbox import AnnotationContainer, AnnotationEntry, AnnotationInstance, BBox
from tqdm import tqdm
def draw_axis(im... | null | huddly_integration/predict_on_bbox.py | predict_on_bbox.py | py | 7,800 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number... |
114039408 | from logging import debug
from flask import Flask, render_template, request
import json
app = Flask(__name__)
@app.route('/', methods=['get'])
def hello_world(): # put application's code here
return render_template('index.html')
@app.route('/estoque', methods=['post'])
def estoque(): # put application's code ... | null | app.py | app.py | py | 1,377 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.form.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request... |
618623595 | import pytest
from webtest import TestApp
from .app import main
@pytest.fixture
def test_app():
"""Fixture for setting up a test test_app."""
settings = {
'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/',
'pyramid_swagger.enable_swagger_spec_validation': False,
}
r... | null | tests/acceptance/api_test.py | api_test.py | py | 684 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "webtest.TestApp",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "app.main",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 7,
"usage_type": "attribute"
}
] |
578646334 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open("version.py", "r", encoding="utf-8") as fh:
version = fh.read().split(" = ")[-1]
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setuptools.setup(
name="example-ban... | null | setup.py | setup.py | py | 1,046 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "setuptools.setup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 31,
"usage_type": "call"
}
] |
178701290 | import voluptuous as vol
import esphomeyaml.config_validation as cv
from esphomeyaml.components import binary_sensor
from esphomeyaml.components.remote_receiver import RemoteReceiverComponent, remote_ns
from esphomeyaml.components.remote_transmitter import RC_SWITCH_RAW_SCHEMA, \
RC_SWITCH_TYPE_A_SCHEMA, RC_SWITCH... | null | esphomeyaml/components/binary_sensor/remote_receiver.py | remote_receiver.py | py | 5,753 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "esphomeyaml.const.CONF_NEC",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "esphomeyaml.const.CONF_LG",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "esphomeyaml.const.CONF_SONY",
"line_number": 17,
"usage_type": "name"
},
{
"... |
118611300 | # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | null | neurom/check/tests/test_morphology.py | test_morphology.py | py | 8,797 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
311436405 | """
REINFORCE: Monte Carlo PG
The most basic form of policy gradient. Taken from examples.pytorch.pg_math
Thanks for the great explanation, Joshua :)
"""
import torch
import torch.nn as nn
from torch.distributions.categorical import Categorical
from torch.optim import Adam
import numpy as np
import gym
from typing im... | null | spinup/algos/yutai/reinforce/reinforce.py | reinforce.py | py | 5,049 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"li... |
92315189 | """Implements classes for velocity analysis: StackingVelocity and VelocityCube"""
import warnings
import numpy as np
import cv2
from scipy.interpolate import interp1d
from scipy.spatial.qhull import Delaunay, QhullError #pylint: disable=no-name-in-module
from sklearn.neighbors import NearestNeighbors
from .utils im... | null | seismicpro/src/velocity_cube.py | velocity_cube.py | py | 22,571 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.stack",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "cv2.convexHull",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.NearestNeighbors",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "scipy.s... |
416287328 | '''
train.py 年龄与性别对应的训练程序
author:lh-13
date:2020.0805
'''
import torch
import numpy as np
import torch.nn as nn
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import DataLoader
import torch.optim as optim
import torch.backends.cudnn as cudnn
from core.dataset import Dataset
from ... | null | train.py | train.py | py | 3,523 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "core.dataset.Dataset",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.utils.tensorboard.SummaryWriter",
"line_number": 23,
"usage_type": "call"
},
{... |
481399391 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : Mike
# @Contact : 597290963@qq.com
# @Time : 2021/6/11 15:17
# @File : PlusOne.py
from typing import List
"""
给定一个由 整数 组成的 非空 数组所表示的非负整数,在该数的基础上加一。
最高位数字存放在数组的首位, 数组中每个元素只存储单个数字。
你可以假设除了整数 0 之外,这个整数不会以零开头。
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/pr... | null | datastructure/Array_and_string/PlusOne.py | PlusOne.py | py | 1,082 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 24,
"usage_type": "name"
}
] |
312690820 | from __future__ import absolute_import
import torch
from torch import cat
from torch import nn
from torch.nn import functional as F
from torch.nn import init
import torchvision
import pdb
# use the DTDN+IN:
from . import resnet_in as resnet
# use the DTDN:
# from . import resnet
__all__ = ['resnet50']
class Dyna... | null | reid/models/dtdn.py | dtdn.py | py | 7,876 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torch.nn.AdaptiveAvgPool2d",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.nn",
... |
519934935 | # coding: UTF-8
"""
Created on 2017/04/24
@author: Yang Wanjun
"""
from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='contract-index'),
url(r'^contract_change/(?P<api_id>[0-9]+).html$', views.ContractChangeView.as_view(), name='contract_c... | null | contract/urls.py | urls.py | py | 1,413 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django... |
595365152 | from fabric.api import run, put, cd, execute, prompt, task, sudo
def package_available(packages):
if not type(packages) is list:
packages = [packages]
installed = True
for package in packages:
installed = installed and run('dpkg -s %s > /dev/null 2>&1' % package, warn_only=True).succeeded
return in... | null | fabfile.py | fabfile.py | py | 2,239 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "fabric.api.run",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fabric.api.run",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fabric.api.sudo",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "fabric.api.put",
"l... |
71824038 | from mongoengine import *
from profile.models import *
from BeautifulSoup import BeautifulSoup
from web_imagery import web_imagery as wb
import re
import datetime
from urlparse import urlparse
from sets import Set
VALID_TAGS = []
PAGE_LIMIT = 15
TAG_REGEX = re.compile(r'\w+')
class Post(Document):
author = Re... | null | posts/models.py | models.py | py | 6,742 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.compile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "re.findall",... |
629804190 | # Copyright 2010-2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | null | trove/common/remote.py | remote.py | py | 11,518 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "trove.openstack.common.log.getLogger",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "trove.openstack.common.log",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "trove.common.cfg.CONF",
"line_number": 39,
"usage_type": "attribute"
},... |
325686437 | import os
import re
import sys
import serial
import threading
import struct
import traceback
class UART_DUT_Transceiver(threading.Thread):
# instance variables
baud_rate = None
dev_usb_path = None
dev = None
f_log = None
byte_written = None
log_size = None
alive = True
def __init_... | null | AutoGrader/UART_DUT_Transceiver.py | UART_DUT_Transceiver.py | py | 1,868 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "threading.Thread",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "... |
365384902 | from sql import sqlFunc
import pymysql
pymysql.install_as_MySQLdb()
'''
================================================================
数据库链接配置
================================================================
'''
bin_db_conf: dict = dict(
host='127.0.0.1',
user='root',
password='123456',
db='travel',... | null | 网站与可视化/travelPro/travelDemo/sqlTable.py | sqlTable.py | py | 1,123 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pymysql.install_as_MySQLdb",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pymysql.escape_string",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "... |
433014789 | #
# Test cases
#
from west.main import BUILTIN_COMMAND_NAMES
from conftest import cmd
def test_help(west_init_tmpdir):
# Check that output from help is equivalent to -h
return
h1out = cmd('help')
h2out = cmd('-h')
assert(h1out == h2out)
for c in BUILTIN_COMMAND_NAMES:
h1out = cmd('h... | null | tests/west/commands/test_help.py | test_help.py | py | 409 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "conftest.cmd",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "conftest.cmd",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "west.main.BUILTIN_COMMAND_NAMES",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "conftest.cm... |
108045463 | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 09 19:49:48 2015
@author: Dimi
"""
import numpy as np
import matplotlib.pyplot as plt
import scipy.spatial.distance as ds
from solve_per_neuron3bas import solve_per_neuron3bas
from scipy.optimize import basinhopping
#global N
ISI_lengths = [[] fo... | null | estimate_delay_with_basin_hop.py | estimate_delay_with_basin_hop.py | py | 1,606 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.diff",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.ceil",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "solve_per_neuron3bas.solve_per_neuron3bas",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "... |
83187129 | import json
from celery import Celery
app = Celery('tasks', broker='pyamqp://guest@localhost//', backend='file:///tmp/celery/results')
@app.task()
def run(args, host=None):
if not host:
arch = 'centos-7-x86_64'
res = floaty.get(arch)
host = json.loads(res.stdout)[arch]
with setti... | null | tasks/build.py | build.py | py | 747 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "celery.Celery",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
}
] |
567225450 | import os
import random
import re
import json
from keras.models import Sequential
from keras.layers import LSTM, Dense, Input
from keras.preprocessing.sequence import TimeseriesGenerator
from sklearn.preprocessing import OneHotEncoder, OrdinalEncoder, binarize
import numpy as np
def load_text(f):
print("Readin... | null | generation_libs.py | generation_libs.py | py | 5,829 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,... |
78799717 | #!/usr/bin/env python3
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicab... | null | keras_retinanet/bin/test.py | test.py | py | 3,311 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "keras_retinanet.models.load_model",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "keras_retinane... |
480707066 | from contextlib import closing
import sqlite3
class Get:
def __init__(self):
pass
def privateChannels(self, member):
conn = sqlite3.connect("./Data/Cache/guild_channels.db") # или :memory: чтобы сохранить в RAM
cursor = conn.cursor()
cursor.execute(f"SELECT * FROM privates W... | null | Utils/DB.py | DB.py | py | 1,906 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlite3.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
... |
397505599 | import csv
import re
import requests
import json
import math
import sys, getopt
arg = sys.argv[1]
baseURL = sys.argv[2]
#arg = "server"
#baseURL = "https://vcgapigateway-test.apps.wdc-np.itcna.vmware.com/productsapi/v1/"
print("Products comparison with excel for Program "+arg)
fileName = "C:/Users/Public/D... | null | Resources/Scripts/ProductsCountVerification.py | ProductsCountVerification.py | py | 2,001 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "csv.reader",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": ... |
154503858 | # -*- coding: utf8 -*-
"""
Django settings for xarxacat_site project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
from django.conf.global_settings import TE... | null | xarxacat_site/xarxacat_site/settings.py | settings.py | py | 4,669 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
130164937 | from vega import VegaLite
import uuid
from IPython.display import publish_display_data, DisplayHandle
from ..common import Lockable, synchronized
class UpdatableVegaLite(VegaLite):
def __init__(self, *params, **args):
VegaLite.__init__(self, *params, **args)
self.ID = uuid.uuid4()
self... | null | striped/job/ipyvega.py | ipyvega.py | py | 1,758 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "vega.VegaLite",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "vega.VegaLite.__init__",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "vega.VegaLite",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "uuid.uuid4",
"lin... |
199482695 | """
Copyright (c) 2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | null | misc/pytorch_toolkit/noise_suppression/models.py | models.py | py | 2,709 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.getpid",
... |
78582028 | '''
.. versionadded:: 2.33
'''
import functools as ft
import json
import platform
from logging_helpers import _L
from pygtkhelpers.gthreads import gtk_threadsafe
import gtk
import path_helpers as ph
USER_DATA_DIR = (ph.path('~/MicroDrop').expand() if platform.system() != 'Windows'
else ph.path('~/Docume... | null | microdrop/default_paths.py | default_paths.py | py | 2,601 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "platform.system",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "path_helpers.path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "path_helpers.path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging_helpers._... |
274745711 | # Copyright 2021 The T5X Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | null | t5x/gin_utils.py | gin_utils.py | py | 4,219 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Sequence",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.Sequence",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "typing.Sequence",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "gin.add_config_file_s... |
651684805 | import json
import os
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_PARENT = os.path.dirname(PROJECT_ROOT)
config_file = os.path.join(PROJECT_ROOT, 'config.json')
class ConfigManager(object):
@staticmethod
def default_config():
return {
'authSource': '... | null | vilogged/config_manager.py | config_manager.py | py | 2,213 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line... |
72867274 | from flask import Blueprint, request, current_app as app
from model.user import User
from model.authentication import Authentication
from model.model import db
import uuid
import hashlib
from jose import jwt
import datetime
from util.http_response import ForbiddenResponse, JsonResponse, BadRequestResponse, Authenticati... | null | routes/login.py | login.py | py | 3,026 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "util.http_respon... |
372624775 | import os
import sqlite3
from datetime import datetime
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
import pytz
from feast import FeatureTable, FeatureView
from feast.infra.key_encoding_utils import serialize_entity_key
from feast.infra.provider import Provider
from feast.protos.feas... | null | sdk/python/feast/infra/local_sqlite.py | local_sqlite.py | py | 5,303 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Union",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "feast.FeatureTable",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "feast.FeatureView",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",... |
533695978 | import argparse
from pathlib import Path
import numpy as np
import pandas as pd
from evolutionary.utils.utils import is_pareto_efficient
def filter_analysis(folder):
folder = Path(folder)
run = np.load(folder / "raw_performance.npy")
ids = pd.read_csv(folder / "ids.csv", sep=",")["id"].to_numpy()
#... | null | extra/filter_analysis.py | filter_analysis.py | py | 2,381 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.percentile",
"line_... |
381737814 | from sklearn import datasets
from sklearn import preprocessing
from sklearn import model_selection
from sklearn.decomposition import TruncatedSVD
import matplotlib.pyplot as plt
from sklearn import neighbors
import pandas as pd
from sklearn import metrics
X, Y = datasets.load_iris().data, datasets.load_iris().target
p... | null | Algor/MachineLea/000data_analyse/learning3/problem2.py | problem2.py | py | 1,178 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 13,
"usage_type": "call"
},
{
... |
634447749 | # -*- coding: utf-8 -*-
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
from vk_api import VkUpload
import vk_api
import json
import re
import requests
import urllib.request
import os
#Initiliazing longpoll session
vk_session = vk_api.VkApi(token=os.environ['VK_TOKEN'])
vk_session._auth_token()
vk_sessio... | null | vk_bot.py | vk_bot.py | py | 3,857 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "vk_api.VkApi",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "vk_api.bot_longpoll.VkBotLongPoll",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "vk_api... |
603033630 | from django.conf.urls import url
#from django.contrib import admin
from . import views
urlpatterns = [
url(r'^$', views.index),
url(r'^main$', views.main),
url(r'^company$', views.company),
url(r'^user_score$', views.user_score),
url(r'^profile/(?P<id>\d+)$', views.profile),
#url(r'^profile$', ... | null | apps/hello_pract/urls.py | urls.py | py | 416 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"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.co... |
450399693 | #! -*- coding:utf-8 -*-
from __future__ import print_function
import re, datetime, yaml
from lxml import html
from six.moves.urllib.parse import urljoin
from scrapy import Spider
from miscrapy.items import WebPage
from miscrapy.commands import urlnorm
class SimpleSpider(Spider):
name = 'simple'
def __init__(... | null | miscrapy/spiders/simple_inject.py | simple_inject.py | py | 2,264 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scrapy.Spider",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "yaml.load",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_nu... |
605751095 | # -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2008 Tom Kralidis
#
# Authors : Tom Kralidis <tomkralidis@hotmail.com>
#
# Contact email: tomkralidis@hotmail.com
# =============================================================================
... | null | owslib/ows.py | ows.py | py | 10,273 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "owslib.namespaces.OWSLibNamespaces",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "owslib.util.nspath_eval",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "owslib.util.nspath",
"line_number": 35,
"usage_type": "call"
},
{
"api... |
32444174 | # Helical Port Rocket simulator (Iterative Code)
# Written by: Thomas Kulin
# October 2, 2020
# Designed from Cole's matlab simulator and this study: https://arc-aiaa-org.proxy.queensu.ca/doi/pdf/10.2514/1.B36208
import numpy as np
import matplotlib.pyplot as plt
from sympy import nsolve, Symbol
from objects import C... | null | fuelTest.py | fuelTest.py | py | 8,484 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.pi",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "objects.CEA",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number":... |
43873680 | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import matplotlib.pyplot as plt
from scipy.stats import rankdata
from scipy.stats import pearsonr
from my_dataset import CaseFrameDataset
from model import AssessmentNet
from logger import Logger
import os
... | null | frame_pairs/main_finetune.py | main_finetune.py | py | 4,181 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scipy.stats.rankdata",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.stats.rankdata",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.stats.pearsonr",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.... |
485579553 | import pyodbc
import csv
# Connexion à la base de données sur SQL Server
host = "DESKTOP-QEBO46O\SQLSERV"
db = "master"
user = ""
pwd = ""
conn = pyodbc.connect("DRIVER={SQL Server}; SERVER=" + host +
";DATABASE=" + db + ";UID=" + user + ";PWD=" + pwd)
# Création du curseur
cursor = conn.cursor... | null | Projet_Catastrophes_Naturelles/Code/Insertion_bd/insertion_bd_contents.py | insertion_bd_contents.py | py | 1,183 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyodbc.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 18,
"usage_type": "call"
}
] |
135111331 | # -*- coding:utf-8 -*-
from flask import Flask, request, flash, session, render_template, redirect
from flaskext.mysql import MySQL
from werkzeug import secure_filename
import connexionDAO
import articleDAO
import inscriptionDAO
import uploadImageDAO
import formDAO
import pageDAO
import compteDAO
app = Flask('Dynam... | null | server.py | server.py | py | 7,723 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flaskext.mysql.MySQL",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.session.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "flask.session",
... |
221228691 | import time
import re
from prettytable import PrettyTable
from datetime import datetime
from pytz import timezone
print()
print()
print('*'*50 + ' Welcome to GadgetifyWithBlr '+ '*'*50)
print()
print(' '*50 + ' Here is the list of items ')
print()
# shooping list is on the order: Item_no,Itemname , Actual_price , dis... | null | Medium/1. Shopping Cart Problem/solutions/Bharath-acchu_Bharath_C_S/medium_shop.py | medium_shop.py | py | 6,132 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "prettytable.PrettyTable",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_... |
4359264 | """rio-viz app dependencies."""
from dataclasses import dataclass, field
from typing import Dict, List, Optional, Tuple, Union
from fastapi import Query
from .resources.enums import ColorMaps, ResamplingNames
@dataclass
class ImageParams:
"""Image Rendering options."""
rescale: Optional[str] = Query(
... | null | rio_viz/dependencies.py | dependencies.py | py | 3,164 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Optional",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "fastapi.Query",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "fastapi.Query",
"li... |
376166890 | # import metrics
import os
import math
import random
import time
from PIL import Image
import torch # pytorch의 tensor와 그와 관련된 기본 연산 등을 지원
import torch.nn as nn # 여러 딥러닝 layer와 loss, 함수 등을 클래스 형태로 지원
import torch.nn.functional as F # 여러 loss, 함수 등을 function 형태로 지원
import torch.optim as optim # 여러 optimizer를 지원
from to... | null | ArcFace/test.py | test.py | py | 9,142 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.sum",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.norm",
"l... |
426567574 | from django.shortcuts import render
from django.conf import settings
from django.http import Http404
from datetime import datetime
ALL_POSTS = [
{
'id':0,
'author': {'username':'will', 'id':'1'},
'title':'My first blog post',
'body': 'This is my first post. I hope you like it.',
'postdate': dateti... | null | mainapp/views.py | views.py | py | 921 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.ht... |
289847861 | import datetime
from hashlib import sha1
import pytz
import time
class DAGItemLogger(object):
def __init__(self, dag_item_id):
from dag.models import DAGItem, DAGItemLogging, LoggingEvent
self.dag_item_id = dag_item_id
self.dag_item = DAGItem.objects.get(pk=self.dag_item_id)
self.LoggingEvent = LoggingEvent
... | null | bang/dag/utils.py | utils.py | py | 925 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dag.models.DAGItem.objects.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dag.models.DAGItem.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "dag.models.DAGItem",
"line_number": 11,
"usage_type": "name"
},
{
... |
289948887 | #!/usr/bin/env python
import asyncio
import os
import unittest
import pytz
import datetime as dt
from ottoengine import engine, config, enginelog, persistence, helpers
from ottoengine.utils import setup_debug_logging
from ottoengine.fibers import clock
setup_debug_logging()
class TestEngine(unittest.TestCase):
... | null | tests/unit/test_unit_engine.py | test_unit_engine.py | py | 4,327 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ottoengine.utils.setup_debug_logging",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "ottoengine.config.EngineConfig",
"line_number": 23,
"usage_type": "call"
},... |
404167441 | from datetime import datetime, timedelta
class Scheduler:
def __init__(self, bot) -> None:
self.bot = bot
self.schedule = []
def check_schedule(self) -> None:
for i in self.schedule:
if datetime.now() > i["time"]:
i["function"]()
self.schedu... | null | scheduler.py | scheduler.py | py | 522 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.now",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetim... |
580126109 | """
@file main.py
@author Joshua Tenorio, Emil Roy
Main program for the Ground Station software.
"""
from PyQt5.QtWidgets import QApplication, QVBoxLayout, QWidget, QHBoxLayout, QGridLayout
import pyqtgraph.examples
import pyqtgraph as pg
import cmd_terminal
import status_section
import graphs
import si... | null | GCS/main.py | main.py | py | 2,464 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QVBoxLayout",
"line_number": 35,
"usage_type": "name"
},
{
"... |
294530366 | import json
from http.server import BaseHTTPRequestHandler
from typing import Callable, Optional, Any, Tuple, List
from .errors import ERROR_DESCRIPTIONS, ERROR_HTTP_STATUSES
JsonEncoder = Callable[[Any], str]
JsonSerializable = Any
class JsonResponse:
def __init__(self,
data: JsonSerializable... | null | converter/server/responses.py | responses.py | py | 1,422 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Callable",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number... |
339147565 | # -*- coding: cp1252 -*-
# Code source: GaŽl Varoquaux
# Modified for documentation by Jaques Grobler
# License: BSD 3 clause
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from sklearn import datasets
import pandas as pd
from sklearn.decomposition import FactorAnalysis
import pandas as pd
f... | null | Assignment 3/kchao9/FactorAnalysis-wine.py | FactorAnalysis-wine.py | py | 3,807 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "matplotlib... |
588462633 | import scipy.sparse as sp
import scipy.sparse.linalg as lin
from scipy.linalg import solve
from numpy import double, ones, eye, logspace
from time import perf_counter
def laplaciana(N, tipo=double):
e = eye(N)-eye(N,N,1)
return tipo(e+e.T)
def laplaciana_dispersa(N, t=double):
return 2*sp.eye(N, dtype =... | null | Entrega 6/E6 Solve.py | E6 Solve.py | py | 1,938 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.double",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "numpy.eye",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.double",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "scipy.sparse.eye",
"line_number... |
109816761 | from django.test import TestCase, Client
from rebar.testing import flatten_to_dict
from ..forms import CandidateForm
class TestCandidateForm(TestCase):
def setUp(self):
self.data = flatten_to_dict(CandidateForm())
client = Client(enforce_csrf_checks=True)
self.request = client.request()
... | null | torontomayoralcandidateapi/api_feed/tests/test_forms.py | test_forms.py | py | 819 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "rebar.testing.flatten_to_dict",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "forms.CandidateForm",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
365087338 | # PCA decomposition
# Import PCA
from sklearn.decomposition import PCA
# Create PCA instance: model
model = PCA()
# Apply the fit_transform method of model to grains: pca_features
pca_features = model.fit_transform(grains)
# Assign 0th column of pca_features: xs
xs = pca_features[:,0]
# Assign 1st column of pca_fea... | null | unsupervised_learning/PCA.py | PCA.py | py | 2,140 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 61,
"usage_type": "call"
},
... |
94634787 | import collections
class Solution(object):
def containsDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
keyMap = collections.defaultdict(int)
result = False
for i in nums:
keyMap[i] += 1
if keyMap[i] > 1:
... | null | LPractice/217. Contains Duplicate.py | 217. Contains Duplicate.py | py | 1,346 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.defaultdict",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 31,
"usage_type": "call"
}
] |
609435830 | import cv2 as cv
import numpy as np
#from matplotlib import pyplot as plt
img = cv.imread('IMG/balon.jpg')
font = cv.FONT_HERSHEY_COMPLEX
text=cv.putText(img,"hola",(15,30),font,1,(0,0,0),2,cv.LINE_AA)
fromCenter = False
roi = cv.selectROI(img,fromCenter)
imCrop = img[int(roi[1]):int(roi[1]+roi[3]), int(roi[0]):int(ro... | null | StringPY/ejemplo_roi.py | ejemplo_roi.py | py | 440 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.FONT_HERSHEY_COMPLEX",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.putText",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.LINE_AA",
"... |
603404304 | from rest_framework.views import APIView
from rest_framework.response import Response
from store.models import Cart, CartItem, Store
from store.serializers import CartItemSerializer, CartSerializer, StoreListSerializer, StoreSerializer
from rest_framework import status
# Create your views here.
class GetCar... | null | store/views.py | views.py | py | 2,672 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "store.models.Cart.objects.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "store.models.Cart.objects",
"line_number": 12,
"usage_type": "attribute"
},
... |
309425087 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 23 07:42:21 2015
@author: Rik Huygen
"""
import math
import h5py
import psf
import numpy as np
from psf import PSF
from psf import getGnomonicRadialCoordinate
from psfRotationTools import getAngularDistanceOpticalAxis2SubFieldCenter
from referenceFrames import gnomonicPr... | null | python/psfGroup.py | psfGroup.py | py | 9,497 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.pi",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "math.atan2",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number":... |
609264479 | from django import forms
import datetime
from .models import Event
class EventForm(forms.ModelForm):
"""
A form used to create and update an event
"""
class Meta:
model = Event
fields = ['name', 'event_date', 'start_time', 'end_time', 'description']
def clean(self):
# ch... | null | occasions/forms.py | forms.py | py | 1,172 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.Event",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.forms.Vali... |
299481333 | # coding:utf-8
import inspect
import os
import sys
import logging,hashlib
log = logging.getLogger(__name__)
__author__ = 'xcma'
def ABSpath():
"""获取当前的绝对路径"""
ABSPATH = os.path.abspath(sys.argv[0])
ABSPATH = os.path.dirname(ABSPATH)+'/api/lib/'
return ABSPATH
def getFuncCalled():
"""
获取当前方法... | null | dpi/pubilc/misc.py | misc.py | py | 3,428 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.